1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-17 22:22:59 +02:00

447 Commits

Author SHA1 Message Date
Ivan Savenko
9732d39c70 Moved shutdown request dialog handling to GameInstance 2025-03-12 13:33:12 +00:00
Ivan Savenko
844dfb1604 Removed usage of boost::thread from vcmi, except for AI 2025-03-02 14:33:11 +00:00
Ivan Savenko
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
Ivan Savenko
e5a095a237 Remove main menu global. Now accessed via GameInstance 2025-03-01 21:16:41 +00:00
Ivan Savenko
cbcd48aabb Fix build 2025-02-21 18:51:27 +00:00
Ivan Savenko
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
Ivan Savenko
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
Ivan Savenko
ffd37a8fa8 Removed CGI in favor of VLC. Map handle is for now global variable 2025-02-21 16:53:14 +00:00
Ivan Savenko
f657e85305 Integrated CClientState into GameEngine class 2025-02-21 16:53:14 +00:00
Ivan Savenko
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
Ivan Savenko
2362c6da21 Fixes for multiple new issues from Sonar 2025-02-21 15:57:39 +00:00
Ivan Savenko
0548f325e4 Merge branch 'master' into 'develop' 2025-02-21 13:59:34 +00:00
Ivan Savenko
f7f94bb7dc Remove old code 2025-02-10 21:08:30 +00:00
Ivan Savenko
31e627f128 Remove screen2 and screenBuf global variables 2025-02-10 21:08:30 +00:00
Ivan Savenko
2468ab54ea Show total movement cost for multi-turn paths 2025-02-09 17:29:28 +00:00
Ivan Savenko
7803f7a972 Clicking on blocked tile of a visitable object now builds a path to it
Suggestion from Discord.

If player has hero selected, clicking on a blocked tile of a visitable,
reachable object will now build a path to its visitable position (or
move hero to it, in case of second click / tap).

Objects that have interaction on left click (allied town and shipyards)
are excluded from this change and work as before
2025-02-07 13:59:32 +00:00
Ivan Savenko
c5a75b20ad
Merge pull request #5352 from IvanSavenko/assets_generation
[1.6.5] In-memory assets generation
2025-02-01 14:23:06 +02:00
Ivan Savenko
cca4c0888c In-memory assets generation
All assets generation (large spellbook, terrain animations, etc) are now
done in memory and used as it, without saving to disk.

This should slightly improve load times since there is no encode png /
decode png, and should help with avoiding strange bug when vcmi fails to
load recently saved assets.

If needed, such assets can be force-dumped on disk using already
existing console command
2025-01-30 22:21:38 +00:00
Ivan Savenko
6957ac33b6 Fix excessive paths updates when using Fly/Water Walk 2025-01-30 16:43:52 +00:00
Ivan Savenko
722d68643f
Merge pull request #5306 from IvanSavenko/xbrz_foreground
[1.6.4?] Move xbrz upscaling from foreground thread to background
2025-01-25 17:23:46 +02:00
Ivan Savenko
32391dc7a9 Pathfinder cache is now stored separately per playerBlocked
- human player will now use pathfinder settings from config (as before)
- nullkiller AI will now use its own, modified settings
- added option to configure NKAI usage of monolith to config
- fixed pathfinder costs not updating on receiving levelup
2025-01-23 15:28:44 +00:00
Ivan Savenko
668bf63fc0 Remove access to internal surface of Canvas 2025-01-21 21:15:21 +00:00
Ivan Savenko
69ee1a9098 Fix crash on reordering towns from town interface 2025-01-01 20:59:59 +00:00
Ivan Savenko
6d8e447ff3 Added new right-click popup to teleporters
Whirlpool, Subterranean Gates, and all Monoliths now show custom popup
on right-click that show all linked objects (exits and entrances).

Only revealed objects are visible, rest are hidden behind fow.

Exits, entrances, and bidirectional objects have different icon that
indicates direction.
2024-12-21 12:01:33 +00:00
Laserlicht
1fb5301750 remove test 2024-11-30 15:52:39 +01:00
Laserlicht
6366175a3c fix window 2024-11-23 19:19:07 +01:00
Ivan Savenko
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
Laserlicht
9ed4dbaeb4 Merge remote-tracking branch 'upstream/develop' into adv_search 2024-10-14 19:52:55 +02:00
Ivan Savenko
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
Laserlicht
11eaed9fef code review 2024-10-12 23:01:14 +02:00
Ivan Savenko
3dd4fa2528 Reduce usage of pointers to VLC entities
Final goal (of multiple PR's) is to remove all remaining pointers from
serializeable game state, and replace them with either identifiers or
with shared/unique pointers.

CGTownInstance::town and CGHeroInstance::type members have been removed.
Now this data is computed dynamically using subID member.

VLC entity of a town can now be accessed via following methods:
- getFactionID() returns ID of a faction
- getFaction() returns pointer to a faction
- getTown() returns pointer to a town

VLC entity of a hero can now be accessed via following methods:
- getHeroTypeID() returns ID of a hero
- getHeroClassID() returns ID of a hero class
- getHeroType() returns pointer to a hero
- getHeroClass() returns pointer to a hero class
2024-10-10 12:28:08 +00:00
Ivan Savenko
a8f8c3f4b1 Replaced most of accesses to CGObjectInstance::pos with anchorPoint() 2024-10-09 15:43:46 +00:00
Laserlicht
a4b60aca10 cleanup 2024-10-01 23:37:27 +02:00
Laserlicht
8e079cf016 add search box 2024-10-01 22:53:05 +02:00
Laserlicht
e86b694b22 fast search 2024-10-01 21:36:45 +02:00
Laserlicht
07aa7bac3c search for texts 2024-10-01 21:19:42 +02:00
Laserlicht
e85e938865 use subid 2024-10-01 20:44:08 +02:00
Laserlicht
bd58caac13 search feature working 2024-10-01 20:20:19 +02:00
Laserlicht
5ea9063a3b search with CObjectListWindow 2024-10-01 19:47:10 +02:00
Laserlicht
d04f369d85 search basic implementation 2024-10-01 18:15:32 +02:00
Ivan Savenko
e93a060500 Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-09-23 14:25:53 +00:00
Ivan Savenko
e7779a0b90
Merge pull request #4614 from dydzio0614/hero-description-movement-points
Add status bar movement points info for own hero on adventure map or hero list
2024-09-18 15:46:51 +03:00
Dydzio
c6edd615ac Block possibility to move hero if shift-clicking on path end 2024-09-17 21:49:21 +02:00
Dydzio
7979f62f82 Add status bar movement points info for own hero on adventure map or hero list 2024-09-17 21:38:28 +02:00
Ivan Savenko
915533ed2e Implemented generation of player-colored version of DiBoxBck 2024-09-12 21:22:41 +00:00
Ivan Savenko
8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
Ivan Savenko
748a3a1b64 Fixed minimap generation when upscaled mode is used 2024-08-17 15:25:26 +00:00
Ivan Savenko
5c7c4a7810
Merge pull request #4443 from IvanSavenko/fix_sonar
Fix miscellaneous issues discovered by Sonar
2024-08-14 17:12:27 +03:00
Ivan Savenko
89dca5061d
Merge pull request #4384 from Laserlicht/shortcut
add shortcut for list item ordering
2024-08-14 17:04:45 +03:00
Ivan Savenko
97f1a310df Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00