1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +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

@@ -12,7 +12,7 @@
#include "MiscWidgets.h"
#include "../gui/CGuiHandler.h"
#include "../GameEngine.h"
#include "../render/IImage.h"
#include "../render/IRenderHandler.h"
#include "../render/CAnimation.h"
@@ -62,7 +62,7 @@ CPicture::CPicture( const ImagePath & bmpname )
{}
CPicture::CPicture( const ImagePath & bmpname, const Point & position, EImageBlitMode mode )
: bg(GH.renderHandler().loadImage(bmpname, mode))
: bg(ENGINE->renderHandler().loadImage(bmpname, mode))
, needRefresh(false)
{
pos.x += position.x;
@@ -154,7 +154,7 @@ void CPicture::showPopupWindow(const Point & cursorPosition)
CFilledTexture::CFilledTexture(const ImagePath & imageName, Rect position)
: CIntObject(0, position.topLeft())
, texture(GH.renderHandler().loadImage(imageName, EImageBlitMode::COLORKEY))
, texture(ENGINE->renderHandler().loadImage(imageName, EImageBlitMode::COLORKEY))
{
pos.w = position.w;
pos.h = position.h;
@@ -163,7 +163,7 @@ CFilledTexture::CFilledTexture(const ImagePath & imageName, Rect position)
CFilledTexture::CFilledTexture(const ImagePath & imageName, Rect position, Rect imageArea)
: CIntObject(0, position.topLeft())
, texture(GH.renderHandler().loadImage(imageName, EImageBlitMode::COLORKEY))
, texture(ENGINE->renderHandler().loadImage(imageName, EImageBlitMode::COLORKEY))
, imageArea(imageArea)
{
pos.w = position.w;
@@ -195,7 +195,7 @@ void FilledTexturePlayerColored::setPlayerColor(PlayerColor player)
{
ImagePath imagePath = ImagePath::builtin("DialogBoxBackground_" + player.toString() + ".bmp");
texture = GH.renderHandler().loadImage(imagePath, EImageBlitMode::COLORKEY);
texture = ENGINE->renderHandler().loadImage(imagePath, EImageBlitMode::COLORKEY);
}
CAnimImage::CAnimImage(const AnimationPath & name, size_t Frame, size_t Group, int x, int y, ui8 Flags):
@@ -205,12 +205,12 @@ CAnimImage::CAnimImage(const AnimationPath & name, size_t Frame, size_t Group, i
{
pos.x += x;
pos.y += y;
anim = GH.renderHandler().loadAnimation(name, getModeForFlags(Flags));
anim = ENGINE->renderHandler().loadAnimation(name, getModeForFlags(Flags));
init();
}
CAnimImage::CAnimImage(const AnimationPath & name, size_t Frame, Rect targetPos, size_t Group, ui8 Flags):
anim(GH.renderHandler().loadAnimation(name, getModeForFlags(Flags))),
anim(ENGINE->renderHandler().loadAnimation(name, getModeForFlags(Flags))),
frame(Frame),
group(Group),
flags(Flags),
@@ -286,7 +286,7 @@ void CAnimImage::showAll(Canvas & to)
void CAnimImage::setAnimationPath(const AnimationPath & name, size_t frame)
{
this->frame = frame;
anim = GH.renderHandler().loadAnimation(name, EImageBlitMode::COLORKEY);
anim = ENGINE->renderHandler().loadAnimation(name, EImageBlitMode::COLORKEY);
init();
}
@@ -328,7 +328,7 @@ bool CAnimImage::isPlayerColored() const
}
CShowableAnim::CShowableAnim(int x, int y, const AnimationPath & name, ui8 Flags, ui32 frameTime, size_t Group, uint8_t alpha):
anim(GH.renderHandler().loadAnimation(name, getModeForFlags(Flags))),
anim(ENGINE->renderHandler().loadAnimation(name, getModeForFlags(Flags))),
group(Group),
frame(0),
first(0),