1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +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

@@ -11,7 +11,7 @@
#include "StdInc.h"
#include "InputSourceText.h"
#include "../gui/CGuiHandler.h"
#include "../GameEngine.h"
#include "../gui/EventDispatcher.h"
#include "../render/IScreenHandler.h"
#include "../renderSDL/SDL_Extensions.h"
@@ -29,19 +29,19 @@ InputSourceText::InputSourceText()
void InputSourceText::handleEventTextInput(const SDL_TextInputEvent & text)
{
GH.events().dispatchTextInput(text.text);
ENGINE->events().dispatchTextInput(text.text);
}
void InputSourceText::handleEventTextEditing(const SDL_TextEditingEvent & text)
{
GH.events().dispatchTextEditing(text.text);
ENGINE->events().dispatchTextEditing(text.text);
}
void InputSourceText::startTextInput(const Rect & whereInput)
{
GH.dispatchMainThread([whereInput]()
ENGINE->dispatchMainThread([whereInput]()
{
Rect rectInScreenCoordinates = GH.screenHandler().convertLogicalPointsToWindow(whereInput);
Rect rectInScreenCoordinates = ENGINE->screenHandler().convertLogicalPointsToWindow(whereInput);
SDL_Rect textInputRect = CSDL_Ext::toSDL(rectInScreenCoordinates);
SDL_SetTextInputRect(&textInputRect);
@@ -55,7 +55,7 @@ void InputSourceText::startTextInput(const Rect & whereInput)
void InputSourceText::stopTextInput()
{
GH.dispatchMainThread([]()
ENGINE->dispatchMainThread([]()
{
if (SDL_IsTextInputActive() == SDL_TRUE)
{