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

@@ -13,7 +13,7 @@
#include "../widgets/MiscWidgets.h"
#include "../widgets/Images.h"
#include "../widgets/TextControls.h"
#include "../gui/CGuiHandler.h"
#include "../GameEngine.h"
#include "../gui/CursorHandler.h"
#include "../battle/BattleInterface.h"
#include "../battle/BattleInterfaceClasses.h"
@@ -69,7 +69,7 @@ CWindowObject::CWindowObject(int options_, const ImagePath & imageName):
if(background)
pos = background->center();
else
center(GH.screenDimensions() / 2);
center(ENGINE->screenDimensions() / 2);
if(!(options & SHADOW_DISABLED))
setShadow(true);
@@ -153,9 +153,9 @@ void CWindowObject::setShadow(bool on)
Point sizeBottom(size, fullsize.y - size);
//create base 8x8 piece of shadow
auto imageCorner = GH.renderHandler().createImage(sizeCorner, CanvasScalingPolicy::AUTO);
auto imageRight = GH.renderHandler().createImage(sizeRight, CanvasScalingPolicy::AUTO);
auto imageBottom = GH.renderHandler().createImage(sizeBottom, CanvasScalingPolicy::AUTO);
auto imageCorner = ENGINE->renderHandler().createImage(sizeCorner, CanvasScalingPolicy::AUTO);
auto imageRight = ENGINE->renderHandler().createImage(sizeRight, CanvasScalingPolicy::AUTO);
auto imageBottom = ENGINE->renderHandler().createImage(sizeBottom, CanvasScalingPolicy::AUTO);
Canvas canvasCorner = imageCorner->getCanvas();
Canvas canvasRight = imageRight->getCanvas();
@@ -188,7 +188,7 @@ void CWindowObject::showAll(Canvas & to)
color = PlayerColor(1); // TODO: Spectator shouldn't need special code for UI colors
CIntObject::showAll(to);
if ((options & BORDERED) && (pos.dimensions() != GH.screenDimensions()))
if ((options & BORDERED) && (pos.dimensions() != ENGINE->screenDimensions()))
CMessage::drawBorder(color, to, pos.w+28, pos.h+29, pos.x-14, pos.y-15);
}