1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

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
This commit is contained in:
Ivan Savenko
2025-02-10 21:49:23 +00:00
parent 0c5a560c80
commit cacceda950
144 changed files with 1019 additions and 1021 deletions

View File

@@ -15,7 +15,7 @@
#include "mapHandler.h"
#include "../CGameInfo.h"
#include "../gui/CGuiHandler.h"
#include "../GameEngine.h"
#include "../render/CAnimation.h"
#include "../render/Canvas.h"
#include "../render/IImage.h"
@@ -105,7 +105,7 @@ void MapTileStorage::load(size_t index, const AnimationPath & filename, EImageBl
for(auto & entry : terrainAnimations)
{
if (!filename.empty())
entry = GH.renderHandler().loadAnimation(filename, blitMode);
entry = ENGINE->renderHandler().loadAnimation(filename, blitMode);
}
if (terrainAnimations[1])
@@ -260,7 +260,7 @@ uint8_t MapRendererRoad::checksum(IMapRendererContext & context, const int3 & co
MapRendererBorder::MapRendererBorder()
{
animation = GH.renderHandler().loadAnimation(AnimationPath::builtin("EDG"), EImageBlitMode::OPAQUE);
animation = ENGINE->renderHandler().loadAnimation(AnimationPath::builtin("EDG"), EImageBlitMode::OPAQUE);
}
size_t MapRendererBorder::getIndexForTile(IMapRendererContext & context, const int3 & tile)
@@ -321,8 +321,8 @@ uint8_t MapRendererBorder::checksum(IMapRendererContext & context, const int3 &
MapRendererFow::MapRendererFow()
{
fogOfWarFullHide = GH.renderHandler().loadAnimation(AnimationPath::builtin("TSHRC"), EImageBlitMode::OPAQUE);
fogOfWarPartialHide = GH.renderHandler().loadAnimation(AnimationPath::builtin("TSHRE"), EImageBlitMode::SIMPLE);
fogOfWarFullHide = ENGINE->renderHandler().loadAnimation(AnimationPath::builtin("TSHRC"), EImageBlitMode::OPAQUE);
fogOfWarPartialHide = ENGINE->renderHandler().loadAnimation(AnimationPath::builtin("TSHRE"), EImageBlitMode::SIMPLE);
static const std::vector<int> rotations = {22, 15, 2, 13, 12, 16, 28, 17, 20, 19, 7, 24, 26, 25, 30, 32, 27};
@@ -407,7 +407,7 @@ std::shared_ptr<CAnimation> MapRendererObjects::getAnimation(const AnimationPath
if(it != animations.end())
return it->second;
auto ret = GH.renderHandler().loadAnimation(filename, enableOverlay ? EImageBlitMode::WITH_SHADOW_AND_FLAG_COLOR: EImageBlitMode::WITH_SHADOW);
auto ret = ENGINE->renderHandler().loadAnimation(filename, enableOverlay ? EImageBlitMode::WITH_SHADOW_AND_FLAG_COLOR: EImageBlitMode::WITH_SHADOW);
animations[filename] = ret;
if(generateMovementGroups)
@@ -566,10 +566,10 @@ uint8_t MapRendererObjects::checksum(IMapRendererContext & context, const int3 &
}
MapRendererOverlay::MapRendererOverlay()
: imageGrid(GH.renderHandler().loadImage(ImagePath::builtin("debug/grid"), EImageBlitMode::COLORKEY))
, imageBlocked(GH.renderHandler().loadImage(ImagePath::builtin("debug/blocked"), EImageBlitMode::COLORKEY))
, imageVisitable(GH.renderHandler().loadImage(ImagePath::builtin("debug/visitable"), EImageBlitMode::COLORKEY))
, imageSpellRange(GH.renderHandler().loadImage(ImagePath::builtin("debug/spellRange"), EImageBlitMode::COLORKEY))
: imageGrid(ENGINE->renderHandler().loadImage(ImagePath::builtin("debug/grid"), EImageBlitMode::COLORKEY))
, imageBlocked(ENGINE->renderHandler().loadImage(ImagePath::builtin("debug/blocked"), EImageBlitMode::COLORKEY))
, imageVisitable(ENGINE->renderHandler().loadImage(ImagePath::builtin("debug/visitable"), EImageBlitMode::COLORKEY))
, imageSpellRange(ENGINE->renderHandler().loadImage(ImagePath::builtin("debug/spellRange"), EImageBlitMode::COLORKEY))
{
}
@@ -625,7 +625,7 @@ uint8_t MapRendererOverlay::checksum(IMapRendererContext & context, const int3 &
}
MapRendererPath::MapRendererPath()
: pathNodes(GH.renderHandler().loadAnimation(AnimationPath::builtin("ADAG"), EImageBlitMode::SIMPLE))
: pathNodes(ENGINE->renderHandler().loadAnimation(AnimationPath::builtin("ADAG"), EImageBlitMode::SIMPLE))
{
}