1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Commit Graph

147 Commits

Author SHA1 Message Date
3fef2a5e1f Moved Colors to a separate file, updated includes 2023-02-03 11:39:40 +02:00
aab082fd2e Remove remaining access to SDL_Events 2023-02-03 11:39:40 +02:00
594b7614cf Fix CI build 2023-02-03 11:39:40 +02:00
cfcaf5cbb6 renamed keyDown -> keyPressed 2023-02-03 11:39:40 +02:00
b1821d4442 Removed some SDL access from non-SDL code 2023-02-03 11:39:40 +02:00
e1bd0d2a04 API for custom events no longer requires SDL access 2023-02-03 11:39:40 +02:00
d4fba3787c Removed usage of SDL_KeyboardEvent from UI code 2023-02-03 11:39:40 +02:00
860fe43131 Merged two mouse button enums 2023-02-03 11:39:40 +02:00
6669ffd4b3 Moved input-related code from SDL_Extensions to GuiHandler 2023-02-03 11:39:40 +02:00
214fc19e74 CIntObject now receives mouse position as point instead of SDL event 2023-02-03 11:39:39 +02:00
108a42e4ba Reorganized includes for new layout. New class - IImageLoader 2023-02-01 20:42:06 +02:00
9c3030603d Removed most SDL includes from headers, removed SDL int's 2023-01-30 19:55:32 +02:00
42df5626d9 Added Color class to replace SDL_Color 2023-01-30 00:12:43 +02:00
080d4b13dd vcmi: suppress warning on IOS
Let CI passes on develop.
2023-01-29 21:30:37 +03:00
57ee9a9bf3 Merge vcmi/beta into vcmi/develop 2023-01-29 18:21:55 +02:00
50a0fc4fb2 Removed pointer to current SDL_Event from GuiHandler 2023-01-27 23:17:40 +02:00
4d1c338503 Merge pull request #1498 from rilian-la-te/conan-v2
Conan as MXE replacement
2023-01-27 23:14:37 +02:00
a7bd7232ce CGuiHandler: fix false positive dangling pointer
Making this an auto variable fixes compilation with Werror.
2023-01-25 17:14:41 +03:00
08b04a3527 handle double-click in Town Portal dialog 2023-01-23 15:43:55 +03:00
fc0f5a9fb3 Reduced SDL includes 2023-01-20 16:11:43 +02:00
ee7a573cb8 Refactoring of SDL API usage:
- Rect no longer inherits from SDL_Rect
- renamed vcmi functions that used SDL naming format
- moved all functions in SDL_Extensions file into CSDL_Ext namespace
- SDL_Rect is now used only by SDL_Extensions, all other code uses Rect
2023-01-20 16:11:43 +02:00
9a765e5f67 Remove not supported method, allow relative mode for iOS 2023-01-19 08:26:35 +02:00
6c843bce0b SDL relative pointer for android 2023-01-18 10:38:55 +02:00
c24b89fe06 2 finger rclick block adwmap scrolling and disable for iOS 2023-01-17 16:22:44 +02:00
2b1511df99 SDL fix 2 finger touch when you remove fingers instantly 2023-01-16 13:39:45 +02:00
7ccfcf51e9 Handle 2 fingers gesture as rclick via SDL 2023-01-16 09:46:52 +02:00
0e8ee929df Renamed CCursorHandler -> CursorHandler 2023-01-15 21:18:34 +02:00
d8c4209ded Movement animation is now more smooth at high animation speeds 2023-01-04 17:21:40 +02:00
f8dec3861b Fixed animation skipping with no sound mod and enemy having first turn 2022-12-30 11:56:26 +02:00
16c4851d3b Animated cursor for spell selection, removed hardcoded cursor ID's 2022-12-18 22:32:07 +02:00
c79634b6a7 Moved all animation ordering logic to callers
Previously, CBattleAnimation & inheritors were controlling animation
ordering - e.g. which animations should play after which.
Now, this is controlled by caller, e.g. BattleInterface & its
controllers.
H3 animations are fairly linear and can be split in stages which are
already somewhat implemented via waitForAnims
2022-12-13 21:31:49 +02:00
c855823528 Renamed files in client/battle to match new names of classes 2022-12-09 13:38:46 +02:00
2521e7bac9 Fix flickering in fullscreen 2022-06-13 16:11:53 +03:00
1128abc593 Fix hero movement animation 2022-06-07 15:00:39 +03:00
d92356f085 Fixed game crash: divide by zero due to threads racing 2022-05-28 14:34:36 +03:00
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03:00
c61bae4060 Fixed RETURN_IF_BATTLE(). Undid disabled warnings. Fixed indentation. 2020-10-05 16:28:28 -07:00
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
fca9bcdd7f Fixed possible freezes while dragging visible area on minimap (#638) 2020-05-03 01:26:30 +03:00
e6f1ab6539 Fix SDL letterboxing on Android builds
On Android calling `SDL_RenderSetLogicalSize` with dimensions having a different aspect ratio than the screen will cause letterboxing with blinking garbage data in that areas (instead of having black bars). This is annoying and makes the game really hard to play.

This change will make sure that on Android `SDL_RenderSetLogicalSize` will always be called with dimensions where the aspect ratio is the same as the screen to make sure there is no letterboxing.

The only problem with this is that during drawing the adventure map nothing will clear out the areas that would have been letterboxes, so there is an added explicit clear screen command for `totalRedraw()`.

The changes are only applied to Android builds in order not to affect PC builds - but some changes, especially clearing the screen could be easily added to the PC builds as well
2020-01-06 18:46:56 +00:00
75f8c8b29a Gui cleanup4 (#446)
* use smart pointers for almost all widget fields
* use SDL2 texture for cursor
* a lot af small tweaks and formatting
* removed CompImage class, it is actually useless as long as regular SDLImage support margins
* CGuiHandler: use smart pointers for [push|pop]Int
2018-07-25 01:36:48 +03:00
ac66fc7f42 Full rework of pre-game interface and networking
New features for players:
* Loading for multiplayer. Any save could be used for multiplayer.
* Restart for multiplayer. All clients will restart together.
* Loading from single save.
* Hotseat mixed with network game. Multiple players per client.
* Now connection to server could be cancelled.
* Return to menu on disconnections instead of crashes.
* Restoring of last selected map, save or campaign on next run.

TLDR on important changes in engine code:
* UI: work with server separated from UI
* UI: all explitic blitting replaced with IntObject's
* UI: all new code use smart pointers instead of DISPOSE
* Gameplay always start through lobby controlled by server.
* Threads receiving netpacks now shared for lobby and gameplay.
* Campaigns: heroes for crossover now serialized as JsonNode.
2018-04-04 14:24:26 +07:00
69dbf339fc CGuiHandler: fix invalid read on event handling 2018-01-18 06:34:57 +03:00
f15cadc87b Implement configurable object sounds: ambient, visit and removal
* If there more than one sound for visit or removal random is played
* At moment only the first ambient sound will be used
2018-01-02 09:49:03 +01:00
494872937a CGuiHandler: use std:atomic to sync breaks in event handling 2017-09-11 12:18:16 +03:00
986fc08b1e CGuiHandler: use SDL_PushEvent in fakeMouseMove to avoid crashes
Somehow this worked on other platforms, but on macOS it's cause constant crashes.
2017-09-11 12:18:16 +03:00
9423555015 Declare ownership of CCursorHandler::dndObject
# Conflicts:
#	AI/FuzzyLite
#	client/gui/CGuiHandler.cpp
2017-09-05 15:25:31 +03:00
fad2a0a3fb Fix memory leak and remove some garbage files added in last commit 2017-08-13 22:15:25 +03:00
cd98dd0b89 CGuiHandler: make terminate_cond non-static
Static variable might be not yet initialized by the time it's used inside CGuiHandler constructor.
This fix let us avoid crash that occur when built with Xcode 8.2.1
2017-08-13 21:54:07 +03:00
64d9dadd64 Logging cleanup. 2017-08-11 15:47:50 +03:00