1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00
Commit Graph

850 Commits

Author SHA1 Message Date
Vasily Postnicov
db2997f240 Fix incorrect assertion in CArtPlace::setArtifact
This fixes a crash in debug builds when the player tries to access
a hero's inventory and the hero has a "Summon Boat" spell scroll.
2025-05-07 15:49:59 +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
d34b47bb20 Remove pointers from artifacts 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
George King
a71c70351c Max width for mana field 2025-04-14 00:24:35 +02:00
George King
fce4cbac89 Fix text align in info window 2025-04-14 00:18:39 +02:00
George King
fb587f0deb Fix text align in info window 2025-04-14 00:17:25 +02:00
Ivan Savenko
0197d226c9 Merge pull request #5565 from kdmcser/new_morale_luck
support setting dice molecule for rolling morale and luck
2025-03-26 16:53:13 +02:00
Ivan Savenko
7a3e1409d0 Remove old boost includes and defines 2025-03-19 08:03:56 +00:00
kdmcser
32e945c116 fix lack icons when allow morale or luck > 3 or < -3 (setting in gameConfig.json) 2025-03-18 00:45:54 +08:00
Laserlicht
7af340e301 setting to disable subtitle 2025-03-10 00:04:44 +01:00
Ivan Savenko
a061ed04de Remove usage of ConstTransitivePtr from CTown 2025-03-08 14:04:51 +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
a075ac1ad1 Merge pull request #5468 from Laserlicht/lobby_aspect_ratio
[1.6.7] make lobby 4:3 aspect ratio & fixes
2025-02-26 17:20:53 +02:00
Ivan Savenko
e4a719fb7e Fix corrupted pixels on town building animations in mods 2025-02-25 15:28:45 +00:00
Laserlicht
eeef7efac5 fix stuck (press) slider w. clicking on empty area 2025-02-23 20:54:31 +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
05e8542a79 Fix corrupted image of university 2025-02-20 13:09:38 +00:00
Ivan Savenko
7d9c9d19c4 Merge pull request #5432 from Laserlicht/fixes
[1.6.6] multiple fixes
2025-02-17 12:36:47 +02:00
Dydzio
a6ab76d3ec Add ctrl+click and shift+click behavior for creatures "arrows" - hero exchange 2025-02-15 18:49:12 +01:00
Laserlicht
e9dc9f81b8 text fixes 2025-02-15 16:46:41 +01:00
Laserlicht
bdc15cfdc5 fix scroll issue (#5076) 2025-02-15 15:44:41 +01: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
0bbcb21826 optimize radial wheel if only few button exisiting 2025-02-09 21:54:31 +01:00
Ivan Savenko
367aa94227 Do not scroll lists in lobby if another item is hovered 2025-02-06 14:20:45 +00:00
Ivan Savenko
38bb5a76e6 Handle flag color overlay and creature selection overlay separately
Fixes handling of Iron Golem animation from HotA
2025-02-03 11:44:21 +00: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
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
MichalZr6
f893c80192 Move UpgradeInfo class to header and source files 2024-12-19 14:13:09 +01:00
MichalZr6
af9445c16f Fixes following review 2024-12-17 22:34:06 +01:00
MichalZr6
d8d3948ac3 Fix AI to use hillFort all available upgrades. UpgradeInfo refactor. 2024-12-17 22:34:06 +01:00
Laserlicht
a29f455625 fix video crash with subtitles 2024-12-11 21:31:00 +01:00
Ivan Savenko
9fbeacb688 Fix possible memory corruption in video player
Fixes two bugs, one was definitely happening, and 2nd one that is causing
undefined behavior and may work only in some std implementations

- VideoPlayer would attempt to access subtitles widget after VideoPlayer
itself was destroyed in onPlaybackFinished call
- std::function was destroyed from a function that is being called by
it. Replaced with 1-method interface to avoid usage of std::function in
this scenario
2024-12-07 15:37:03 +00:00
Dydzio
e87ed1e80c Add extra clientside sanity check (should be there from thestart) 2024-12-03 21:03:25 +01:00
Ivan Savenko
877f47e37f Merge branch 'develop' into video 2024-12-02 13:48:30 +02:00
Laserlicht
e6cd3630e0 fix warning 2024-11-30 17:20:39 +01:00
Laserlicht
543185a530 prescale support for video 2024-11-29 23:33:28 +01:00
Ivan Savenko
c3494b4a73 Merge pull request #4982 from kdmcser/fix_dismiss_crash
crash fix: dismiss hero when pick artifact
2024-11-27 16:41:44 +02:00
kdmcser
993a4dc73d crash fix: dismiss hero when pick artifact 2024-11-26 01:11:09 +08:00
Laserlicht
b89db3f044 fix popup 2024-11-21 23:12:27 +01:00