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

178 Commits

Author SHA1 Message Date
Ivan Savenko
829739da24 Reduce usage of implicit conversions to int 2025-04-27 14:57:31 +03:00
Ivan Savenko
4d57a8ed36 Prefer to pass CGameState as reference instead of pointer 2025-04-27 14:57:31 +03:00
Ivan Savenko
a43c3fcb31 Restore save compatibility with 1.6 2025-04-27 14:57:31 +03:00
Ivan Savenko
f025a3a932 Review & cleanup hiding / displaying map objects 2025-04-27 14:57:31 +03:00
Ivan Savenko
f5f8ed192b Fix random map generation 2025-04-27 14:57:31 +03:00
Ivan Savenko
912c2eae94 Fix regressions 2025-04-27 14:57:31 +03:00
Ivan Savenko
d1d2cf4189 Fix crashes on game start, gamestate now derives from GameCallbackHolder 2025-04-27 14:57:31 +03:00
Ivan Savenko
d34b47bb20 Remove pointers from artifacts 2025-04-27 14:57:31 +03:00
Ivan Savenko
cd7732456a Remove pointer to objects from TerrainTile 2025-04-27 14:57:30 +03:00
Ivan Savenko
ab11d2b075 Remove quests from CMap, now solely owned by quest objects 2025-04-27 14:57:30 +03:00
Ivan Savenko
bdae7285ae Objects list is now private member of CMap 2025-04-27 14:57:30 +03:00
Ivan Savenko
745040def3 Access to heroes storage in CMap is now done via public methods 2025-04-27 14:57:30 +03:00
Ivan Savenko
1f502c0548 CMap towns and heroes on map fields are now private 2025-04-27 14:57:30 +03:00
Ivan Savenko
0ada2a5ebd Map objects now use shared_ptr (game) 2025-04-27 14:57:30 +03:00
Ivan Savenko
2ca1748e96 Artifact instances are now owned solely by CMap 2025-04-27 14:57:30 +03:00
Ivan Savenko
797646cc05 Quests in map now use shared_ptr instead of const ptr 2025-04-27 14:57:30 +03:00
Ivan Savenko
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
Ivan Savenko
4b824d05e2 Do not allow heroes banned for player as starting heroes
- `disposedHeroes` is now in map header, for use in map selection
- heroes that are marked as unavailable for player will now be hidden
from starting hero selection
2025-02-14 10:43:55 +00:00
Ivan Savenko
e4505f20b9 Remove no longer used map checksum computation 2025-01-24 19:26:40 +00:00
MichalZr6
a99274d72e BattleHexArray - new container for BattleHexes 2025-01-06 23:18:18 +01:00
Ivan Savenko
ea368c5176 Inlined methods commonly used by pathfinder for better optimization 2025-01-04 15:09:50 +00:00
Dydzio
e9be46af98 Merge branch 'develop' into timed_events_objects_removal 2024-12-03 17:27:24 +01:00
Ivan Savenko
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
Ivan Savenko
604e3b5c67
Merge pull request #4763 from IvanSavenko/herohandler_split
Split CHeroHandler.cpp/.h into 1 file per class
2024-10-14 19:05:48 +03: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
Ivan Savenko
31095248ab Removed typeName and subtypeName properties from CGObjectInstance 2024-10-13 13:05:50 +00: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
godric3
d078c5ff2d store ObjectInstanceID of objects to remove instead of their position 2024-09-30 20:44:40 +02:00
godric3
e50ba14bbe Use exact position of object to remove + add object name to list of objects to remove 2024-09-30 19:17:21 +02:00
godric3
253af651cc Add map editor ui to set objects to remove on timed event 2024-09-29 13:37:24 +02:00
SoundSSGood
b9ae7f1138 CMap put move and remove artifact method 2024-09-23 23:30:38 +03:00
Dydzio
cf5ce96aeb Backend implementation of object removal possibility by timed map events 2024-09-23 21:45:50 +02:00
Ivan Savenko
ff8d36c350 It is now possible to define game settings in rmg template 2024-09-05 15:16:28 +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
SoundSSGood
b06426ac43 CMap removed from CArtifactSet level 2024-09-04 15:12:40 +03:00
K
18a69dfeb5 move CMap::isInTheMap to the header file and make it inline 2024-08-22 14:27:01 +02:00
K
3a27725fcb Optimize CMap::isInTheMap
replace x >= 0 && x < size by (unsigned)x < size

By converting signed coordinate to unsigned number, negative values became
very large positive ones, larger than every positive signed number and
therefore also bigger than the map size. As a result check against size
also implicitly checks if coordinate is negative.

Compiler cannot do this transformation automatically because it doesn't
know that map dimensions are always positive.

The change shrinks isInTheMap from 19 instructions to 11 on x86.
2024-08-22 11:39:24 +02:00
Ivan Savenko
26fdaacbe5 Map and town events are now processed on start of player turn instead of
on start of new day, in line with H3
2024-08-14 14:13:50 +00:00
Ivan Savenko
5523e08cb7 Players affected by event is now stored as std::set instead of bitmask 2024-08-14 14:13:49 +00:00
Ivan Savenko
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
Ivan Savenko
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
Ivan Savenko
63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
Ivan Savenko
c00a1e1b0c Fixed new issues detected by SonarCloud 2024-07-15 07:46:40 +00:00
Alexander Wilms
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
Ivan Savenko
31401e219f Fix possible crash on nullptr dereference 2024-05-11 13:19:07 +00:00
Tomasz Zieliński
8ed940d538 cleanup 2024-04-03 22:24:19 +02:00
Tomasz Zieliński
9f048888dd Restore previous removeObject 2024-04-03 22:17:36 +02:00
Tomasz Zieliński
2a213f2276 Reindex objects to show interactive objects on top 2024-04-03 14:48:04 +02:00
Tomasz Zieliński
263d439605 Fix uninitialized variable 2024-03-24 07:54:11 +01:00