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

347 Commits

Author SHA1 Message Date
Ivan Savenko
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
Ivan Savenko
283adc37d7 Unit stack rebalancing rework
- CStackInstance::count is now private with accessor methods
- CStackInstance::experience renamed to totalExperience and now stores
total stack experience (multiplied by stack size) to reduce rounding
errors
- CStackInstance::totalExperience is now private with accessors methods
- stack experience is now automatically reallocated on stack management
- Removed buggy BulkSmartRebalanceStacks pack, that mostly duplicates
BulkRebalanceStacks
- Renamed BulkSmartSplitStack to BulkSplitAndRebalanceStack to drop
unclear "smart" in name
- Reworked split-and-rebalance logic to correctly reallocate stack
experience
2025-05-01 18:18:30 +03:00
Ivan Savenko
f70ad2c15b Reorganized artifact-related classes
- files now generally contain only 1 class (except for tightly coupled
classes)
- files are now located in lib/entities/artifact directory
- removed excessive includes

No changes to functionality
2025-04-29 13:29:08 +03:00
Ivan Savenko
829739da24 Reduce usage of implicit conversions to int 2025-04-27 14:57:31 +03:00
Ivan Savenko
63d00b080e Removed pointer to army from StackInstance 2025-04-27 14:57:30 +03:00
Ivan Savenko
c02a8a84fd Stacks of armed instance are now unique_ptr 2025-04-27 14:57:30 +03:00
Ivan Savenko
417ea6451a Remove ConstTransitivePtr from hero and town instances 2025-04-27 14:57:30 +03:00
Ivan Savenko
ee5cddb52c
Merge pull request #5518 from Laserlicht/fix_upgrade_all
[develop] fix crash, when no cost for upgrade
2025-03-08 19:21:13 +02:00
Laserlicht
d983d54cc0
Update client/windows/CCastleInterface.cpp
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2025-03-08 15:08:33 +01:00
Ivan Savenko
a061ed04de Remove usage of ConstTransitivePtr from CTown 2025-03-08 14:04:51 +00:00
Laserlicht
3f4267df15
fix crash, when no cost for upgrade 2025-03-08 12:46:00 +01:00
Ivan Savenko
9f713a0914 Rename int3::valid to isValid for consistency 2025-03-03 10:46:00 +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
8f074490a7 Merge branch 'master' into 'develop' 2025-02-27 21:15:42 +00:00
Ivan Savenko
e2e83b392b
Merge pull request #5467 from IvanSavenko/brotherhood_fix
[1.6.7] Fix Brotherhood displaying Thieves Guild UI on click instead of Tavern
2025-02-25 16:50:18 +02:00
Ivan Savenko
b6dd4460de Fix Brotherhood displaying Thieves Guild UI on click instead of Tavern 2025-02-23 14:46:04 +00:00
Laserlicht
db23cc2ffa add setting for disabling overlay 2025-02-21 21:35:17 +01: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
9effde04bb
Merge pull request #5404 from Laserlicht/upgrade_all
[1.6.6] extend radial wheel in town to upgrade all creatures
2025-02-15 11:12:37 +02:00
Laserlicht
3e161da834 code review 2025-02-14 21:03:23 +01:00
Laserlicht
c6987f4183 upgrade all radial wheel button 2025-02-09 21:54:30 +01:00
Laserlicht
1f61f22122 implement overlay for touch screens 2025-02-09 13:10:27 +01:00
Ivan Savenko
d54d498d5f Don't play new building sound twice on auto-built buildings 2025-01-26 15:50:26 +00:00
Ivan Savenko
668bf63fc0 Remove access to internal surface of Canvas 2025-01-21 21:15:21 +00:00
Ivan Savenko
4a600a9d4c Reworked image container classes for easier support of new features 2025-01-21 21:15:21 +00:00
Ivan Savenko
8bf5c474d6
Merge pull request #5160 from Laserlicht/alt_town
[1.6.2] show building names with ALT
2024-12-30 21:52:32 +02:00
Laserlicht
c44b91de45 Update client/windows/CCastleInterface.cpp
Co-Authored-By: Ivan Savenko <saven.ivan@gmail.com>
2024-12-30 18:13:18 +01:00
MichalZr6
4e9f052e98 Fix creature upgrades in Fort and town's dwellings 2024-12-30 01:14:57 +01:00
Laserlicht
eb319fc15e show building names with ALT 2024-12-26 14:22:12 +01:00
Ivan Savenko
65fc50d33b Simplified building ID logic
- Replaced overcomplicated and broken math on dwelling ID's with fixed
enum
- Fixed broken 2nd upgrades and 8th dwelling
- Removed no longer used enumeration values from building ID's
2024-12-25 19:16:21 +00:00
Laserlicht
6366175a3c fix window 2024-11-23 19:19:07 +01:00
Ivan Savenko
251155d913 More robust management of body/shadow/overlay split 2024-11-17 17:54:55 +00:00
kdmcser
51e742f475 Merge branch 'develop' into fix_research_spell_crash 2024-11-10 23:32:33 +08:00
kdmcser
2621d4f5bf fix spell research crash when no more spells can be researched due to map limit 2024-11-10 23:02:36 +08:00
Laserlicht
7a52d1d533
8th creature fix 2024-11-03 22:51:48 +01:00
Ivan Savenko
a8e84c55f6 Fix some of the new warnings from sonarcloud 2024-10-11 10:45:29 +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
Laserlicht
613da80f55 fix 8th creature and portal of summoning 2024-10-07 16:25:18 +02:00
Laserlicht
b885fd9d3b added custom icons for buttons made by Ivan 2024-10-07 13:26:43 +02:00
Laserlicht
9c6bd20159 code review 2024-10-01 16:32:28 +02:00
Laserlicht
31f87cb6ed improve ui 2024-09-30 18:15:13 +02:00
Laserlicht
e2b49bbf79 fix condition 2024-09-30 02:46:45 +02:00
Laserlicht
713fcd6543 research per day & seperate config 2024-09-30 02:40:28 +02:00
Laserlicht
3813db83ab make ci happy 2024-09-28 16:16:34 +02:00
Laserlicht
8461189e95 code review + text 2024-09-28 16:10:03 +02:00