1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

140 Commits

Author SHA1 Message Date
298ec472bf Split BattleInterfaceClasses into smaller files 2025-06-18 17:29:20 +03:00
d295c380b5 Fix uninitialized value on playback of hero batte animation 2025-06-03 15:44:26 +03:00
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
63d00b080e Removed pointer to army from StackInstance 2025-04-27 14:57:30 +03:00
844dfb1604 Removed usage of boost::thread from vcmi, except for AI 2025-03-02 14:33:11 +00:00
a8a6be7ac1 Fix potential compatibility with C++20 / C++23 mode
This fixes several issues with compatibility with C++20. C++23 was also
tested, but apparently it does not have any additional breaking changes
compared to C++20 (or we don't have those).

VCMI still uses C++17 as before - goal is only to make potential
transition easier.

There were 2 cases that are deprecated in C++20 that we use:
- Floating point operations on enums are deprecated
- `this` can no longer be captured when using default capture by value
`[=]`

Both of those should now be replaced with code that works fine in both C+
+17 and in C++20 mode
2025-03-02 14:11:48 +00:00
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
156de5b17e Added GameInstance class
- available as global GAME
- integrates LOCPLINT (CPlayerInterface)
- integrates CGI->mh (CMapHandler)
- integrates CSH (CServerHandler)
2025-02-21 16:54:06 +00:00
ffd37a8fa8 Removed CGI in favor of VLC. Map handle is for now global variable 2025-02-21 16:53:14 +00:00
f657e85305 Integrated CClientState into GameEngine class 2025-02-21 16:53:14 +00:00
cacceda950 Renamed CGuiHandler to GameEngine
- class CGuiHandler is now called GameEngine to better describe its
functionality
- renamed global GH to more clear ENGINE
- GH/ENGINE is now unique_ptr to make construction / deconstruction
order more clear and to allow interface / implementation split
- CGuiHandler.cpp/h is now called GameEngine.cpp/h and located in root
directory of client dir
2025-02-21 16:53:13 +00:00
ecdd394bb1 Use BattleHex as const ref wherever possible
Minor Fixes
Drop unused function from BattleHexArray
2025-01-21 13:23:17 +01:00
a99274d72e BattleHexArray - new container for BattleHexes 2025-01-06 23:18:18 +01:00
dfe6e04464 Implemented semi-transparent spell effects 2024-11-17 19:48:16 +00:00
10ad0fc760 Split CHeroHandler.cpp/.h into 1 file per class
All parts of CHeroHandler.cpp are now in lib/entities/hero
Adjusted includes to use new paths
No functionality changes
2024-10-13 14:01:09 +00:00
36c1ed670f Support for configurable town fortifications
Removed most of hardcoded checks for fort level or for presence of fort/
citadel/castle buildings.

It is now possible to define which parts of town fortifications are
provided by town buildings

Configuration for H3-like fortifications is provided in
buildingsLibrary.json and will be used automatically by mods as long as
mods have buidings named "fort", "citadel" and "castle".

Alternatively, mods can separately define:
- hitpoints of walls (shared value for all sections)
- hitpoints of central, upper and lower towers (separate values)
- presence of moat
- shooters for each tower (separate values)
2024-08-28 19:42:14 +00:00
2a05fbdd50 Unified handling of battle sides ID's
- Replaced BattleSide namespace-enum with enum class
- Merged two different BattleSide enum's into one
- Merged BattlePerspective enum into BattleSide enum
- Changed all places that use integers to represent battle side to use
BattleSide enum
- Added BattleSideArray convenience wrapper for std::array that is
always 2-elements in size and allows access to its elements using
BattleSide enum
2024-08-11 20:54:44 +00:00
4533271692 Merge pull request #4312 from IvanSavenko/texthandler_split
Split CGeneralTextHandler file into 1 file per class form
2024-07-21 13:49:14 +03:00
1aa391fdf8 Split CGeneralTextHandler file into 1 file per class form
All text processing code is now located in lib/texts.
No changes other than code being moved around and adjustment of includes

Moved without changes:
Languages.h           -> texts/Languages.h
MetaString.*          -> texts/MetaString.*
TextOperations.*      -> texts/TextOperations.*

Split into parts:
CGeneralTextHandler.* -> texts/CGeneralTextHandler.*
                      -> texts/CLegacyConfigParser.*
                      -> texts/TextLocalizationContainer.*
                      -> texts/TextIdentifier.h
2024-07-20 12:55:17 +00:00
ee0cf58395 option to enable quickspell 2024-07-19 19:43:22 +02:00
9c5d5d7c5a It is now possible to define custom battle opening sound and custom music
for a battlefield
2024-07-15 21:46:23 +00:00
df83fa33a1 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
adc3441bda Merge pull request #3998 from IvanSavenko/refactor_sdl_media
[1.6] Reorganize SDL sound/music/video handling
2024-05-31 12:02:55 +03:00
2aec3cde2c Fix possible crash on replaying combat after manual run 2024-05-23 12:46:28 +00:00
9bfe000724 Added semi-workaround method for network thread shutdown:
Currently closing game while network thread is waiting for something is
very bug-prone, since network thread may resume during shutdown and
access partially destroyed client state.

Now if exit has been requested, the very first step would be semi-
graceful shutdown of network thread (via exception throwing). This may
in theory skip some cleanup in non-RAII code, but since game is shutting
down this does not matters much.

This logic applies to:
- shutting down while network thread is waiting for dialogs
- shuttind down while network thread waiting for animations in combat
2024-05-18 11:04:10 +00:00
721b15d9de Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-17 08:26:37 +00:00
d27b854cb1 Reorganized music, video and sound players:
- All XXXplayers are now in client/media directory
- Reogranized code on one class per file basis
- Extracted interfaces from handlers. Handlers now implement
corresponding interface.
- CCS now only stores pointer to an interface
2024-05-15 17:05:12 +00:00
e06c09d709 battle log expansion 2024-05-14 02:50:57 +02:00
30e0a16ee9 Fix some 'new' issues reported by Sonar Cloud 2024-05-06 15:33:30 +00:00
2861ebb515 Capture members by copy instead of capturing this due to short lifetime 2024-04-16 18:55:21 +03:00
24d25730ad Changed checks for null with checks for hasValue 2024-01-20 16:41:10 +02:00
0d0d3d8c80 Renamed speed -> getMovementRange, remove misleading default parameter 2024-01-14 17:14:36 +02:00
c540dd1183 round_counter 2023-12-23 19:57:19 +01:00
a1f34e059a Fix possible crash on starting 2nd battle while intro sound from 1st one
is still playing
2023-12-13 19:35:02 +02:00
f7a31865f3 basic touch introduction implementation 2023-11-14 21:52:30 +01:00
b88a8da4e8 Split off some netpack structures into separate files 2023-10-23 13:59:15 +03:00
a1a5bc28c2 convert line endings from CRLF (Windows) to LF (Linux/Unix)
Mixed line endings cause problems when exporting patches with
git-format-patch and then trying to "git am" a patch with mixed and
non-matching line endings. In such a situation git will fail to apply
the patch.

This commit runs the dos2unix tools on the remaining files with CRLF
(\r\n) line endings to convert them to line-feeds (\n) only.

Files that are Windows specific like *.vcxproj and *.props files were
not converted.

Closes: #3073
2023-10-19 16:23:21 +02:00
195320dcf2 Removed remaining references to 'pim' name 2023-09-27 18:50:01 +03:00
d6b9fa8fbd Replaced CPlayerInterface::pim with CGuiHandler::interfaceLock
- Removed CPlayerInterface::pim since this lock does not actually
protects LOCPLINT but rather entire game UI state
- added more logical CGuiHandler::interfaceLock
- interface lock is now non-recursive and is locked only once by initial
caller that want to access GUI
2023-09-27 18:33:52 +03:00
f39fbe5151 Merge pull request #2757 from IvanSavenko/filesystem_refactor
Filesystem refactor - part 1
2023-09-07 10:51:02 +03:00
9fa7a93fb0 Properly pass battleID in all battle netpack's 2023-09-06 16:03:47 +03:00
41210c1dbf Client-side support for multiple battles 2023-09-06 16:03:47 +03:00
86a7f5f5cd Removed getStr(bool), replaced with similar toString() 2023-09-04 22:21:02 +03:00
8dfdfffd87 Use ResourcePath for audio files 2023-09-04 18:22:34 +03:00
823ffa7a07 Always use ResourcePath for referencing images and animations 2023-09-04 18:22:34 +03:00
e40dc76304 Fix giving commands in battles in hotseat 2023-08-24 23:34:33 +03:00
81242d3500 Fixed ending of battles due to retreat/surrender 2023-08-23 18:46:56 +03:00
3eb19e6ed7 Fix possible unprotected access to battleint 2023-08-23 16:32:29 +03:00
142889e3a5 Give all threads created by client human-readable name for debug 2023-08-23 16:32:29 +03:00
013417fb7e Code cleanup 2023-08-21 17:55:49 +03:00