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

48 Commits

Author SHA1 Message Date
298ec472bf Split BattleInterfaceClasses into smaller files 2025-06-18 17:29:20 +03:00
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03: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
dbe82b94f6 Changes following review:
- shared_ptr for destructibleEnemyTurns instead of raw pointer
- drop implicit int conversion for BattleHex class
  and implement toInt() instead
- implement necessary operators in BattleHex
- adjust code to work properly with JSON serializer
2025-01-08 07:24:43 +01:00
dad6437661 Refactor BattleHex, remake the use of precomputed neighbouring tiles containers.
- Moved short, frequently used functions to the BattleHex header for inlining
- Made BattleHex a class with a private hex value
- Moved getClosestTile implementation back to BattleHex
- Enabled access to static precomputed data in BattleHexArray via BattleHex
(note: circular dependency prevented static precomputed containers being directly placed in BattleHex)
2025-01-06 23:28:46 +01:00
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
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
0d6ec0d224 Reviewed usage of EBlitMode, now specified clearly in all cases 2024-07-19 10:08:50 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02: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
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +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
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
f39fbe5151 Merge pull request #2757 from IvanSavenko/filesystem_refactor
Filesystem refactor - part 1
2023-09-07 10:51:02 +03:00
41210c1dbf Client-side support for multiple battles 2023-09-06 16:03:47 +03:00
1d0e696db6 Added RenderHandler that acts as factory for images and animations 2023-09-04 18:22:34 +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
e2718db791 Converted several enumerations into constants 2023-08-25 13:38:02 +03:00
62a5eeebbc Fixed rendering priority of battlefield background obstacles 2023-08-07 21:18:43 +03:00
e6d8b65e2c Fix toggling of auto combat 2023-07-22 12:15:27 +03:00
428fb832c6 Implemented foreground/background obstacles:
- obstacles now have "foreground" field
- if "foreground" field set, obstacle will appear on top of other
objects, such as units
- if "foreground" is not set, obstacle will appear below units
- updated schema and cleared up obstacles config
2023-06-06 15:53:14 +03:00
c4d5a7a2d6 vcmi:towns now can choose if moat render is needed
Using invalid points. Also removed unused variable.
2023-03-31 01:01:25 +03:00
688b8db3eb Removed delays due to thread waits from battle animations 2023-03-20 20:19:05 +02:00
9205ef2c91 vcmi: skill-agnostic ballistics
Made ballistics by using spell action and more code is shared now.
2023-03-16 16:46:41 +03:00
5366f9190e vcmi: reduce boost::lexical_cast usage 2023-03-09 16:36:46 +03:00
108a42e4ba Reorganized includes for new layout. New class - IImageLoader 2023-02-01 20:42:06 +02:00
05a1d7c6e3 All text for factions/towns/building are passed through translator 2023-01-20 15:18:36 +02:00
1d7f004658 Implemented reinforced walls in towns with Castle 2023-01-13 01:09:24 +02:00
500cf7f15d EWallPart & EWallState are now enum class 2023-01-13 00:35:58 +02:00
a25214ae71 Fixes graphical artifacts on toggling stack queue visibility
Battlefield rendering now uses local coordinates
2023-01-05 14:16:01 +02:00
ae3f6c5e79 Renamed PointEffectAnimation -> EffectAnimation 2022-12-25 21:39:55 +02:00
5b41ced427 Removed sound playback from PointEffectAnimation 2022-12-25 21:35:13 +02:00
c835a84051 Moved all GUI handling from BattleInterface to BattleControlPanel 2022-12-21 17:02:53 +02:00
864990db13 Implemented Bloodlust & Petrification effect
- ColorFilter is now in separate file
- Moved lerp function into global.h
- Bloodlust visuals mostly matches H3
- Petrify visual matches H3
- TODO: Adjust timing of all ColorFilter efects to match H3
- TODO: Petrify should pause stack animations
- TODO: ColorFilter-powered effects should be configurable in Spell system
2022-12-15 23:24:03 +02:00
c172e3c8e0 Cleaned up BattleAnimationClasses file 2022-12-13 21:31:49 +02:00
e791323502 Implemented placement sound for obstacles 2022-12-13 21:31:49 +02:00
60a00b450e Multiple fixes & improvements to animation ordering 2022-12-13 21:31:49 +02:00
0020d76d1d Introduced animation phases for beter ordering of visuals in battles 2022-12-13 21:31:49 +02:00
99e5569ab5 Changes according to review 2022-12-13 15:10:31 +02:00
264f5c91e8 Applied suggestions from review 2022-12-13 13:58:16 +02:00
49a6d056d9 Changes for BattleInterface classes according to code review:
- added documentation comments for classes, members and methods
- added const specifier to methods where applicable
- renamed some methods with more clear name
- removed some commented-out or unused code
2022-12-11 23:16:23 +02:00
7f5e5259c8 Changes to Canvas class according to review:
- renamed CCanvas -> Canvas.cpp
- replaced shared_ptr<Canvas> with Canvas&
- removed getSurface method
2022-12-11 22:09:57 +02:00
c855823528 Renamed files in client/battle to match new names of classes 2022-12-09 13:38:46 +02:00