rename Init method and move implementation

This commit is contained in:
Robert Müller 2021-12-03 20:17:43 +01:00
parent 2fe5464938
commit a61c45550d
4 changed files with 9 additions and 7 deletions

View file

@ -219,7 +219,7 @@ void CGameClient::OnInit()
m_pGraphics->AddWindowResizeListener(OnWindowResizeCB, this);
// propagate pointers
m_UI.SetGraphics(Graphics(), TextRender());
m_UI.Init(Graphics(), TextRender());
m_RenderTools.Init(Graphics(), UI(), this);

View file

@ -44,6 +44,12 @@ void CUIElement::SUIElementRect::Reset()
float CUI::ms_FontmodHeight = 0.8f;
void CUI::Init(class IGraphics *pGraphics, class ITextRender *pTextRender)
{
m_pGraphics = pGraphics;
m_pTextRender = pTextRender;
}
CUI::CUI()
{
m_pHotItem = 0;

View file

@ -200,11 +200,7 @@ public:
static float ms_FontmodHeight;
// TODO: Refactor: Fill this in
void SetGraphics(class IGraphics *pGraphics, class ITextRender *pTextRender)
{
m_pGraphics = pGraphics;
m_pTextRender = pTextRender;
}
void Init(class IGraphics *pGraphics, class ITextRender *pTextRender);
class IGraphics *Graphics() const { return m_pGraphics; }
class ITextRender *TextRender() const { return m_pTextRender; }

View file

@ -6129,8 +6129,8 @@ void CEditor::Init()
m_pStorage = Kernel()->RequestInterface<IStorage>();
m_pSound = Kernel()->RequestInterface<ISound>();
CGameClient *pGameClient = (CGameClient *)Kernel()->RequestInterface<IGameClient>();
m_UI.Init(m_pGraphics, m_pTextRender);
m_RenderTools.Init(m_pGraphics, &m_UI, pGameClient);
m_UI.SetGraphics(m_pGraphics, m_pTextRender);
m_Map.m_pEditor = this;
UIEx()->Init(UI(), Kernel(), RenderTools(), Input()->GetEventsRaw(), Input()->GetEventCountRaw());