mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
rename Init method and move implementation
This commit is contained in:
parent
2fe5464938
commit
a61c45550d
|
@ -219,7 +219,7 @@ void CGameClient::OnInit()
|
||||||
m_pGraphics->AddWindowResizeListener(OnWindowResizeCB, this);
|
m_pGraphics->AddWindowResizeListener(OnWindowResizeCB, this);
|
||||||
|
|
||||||
// propagate pointers
|
// propagate pointers
|
||||||
m_UI.SetGraphics(Graphics(), TextRender());
|
m_UI.Init(Graphics(), TextRender());
|
||||||
|
|
||||||
m_RenderTools.Init(Graphics(), UI(), this);
|
m_RenderTools.Init(Graphics(), UI(), this);
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,12 @@ void CUIElement::SUIElementRect::Reset()
|
||||||
|
|
||||||
float CUI::ms_FontmodHeight = 0.8f;
|
float CUI::ms_FontmodHeight = 0.8f;
|
||||||
|
|
||||||
|
void CUI::Init(class IGraphics *pGraphics, class ITextRender *pTextRender)
|
||||||
|
{
|
||||||
|
m_pGraphics = pGraphics;
|
||||||
|
m_pTextRender = pTextRender;
|
||||||
|
}
|
||||||
|
|
||||||
CUI::CUI()
|
CUI::CUI()
|
||||||
{
|
{
|
||||||
m_pHotItem = 0;
|
m_pHotItem = 0;
|
||||||
|
|
|
@ -200,11 +200,7 @@ public:
|
||||||
static float ms_FontmodHeight;
|
static float ms_FontmodHeight;
|
||||||
|
|
||||||
// TODO: Refactor: Fill this in
|
// TODO: Refactor: Fill this in
|
||||||
void SetGraphics(class IGraphics *pGraphics, class ITextRender *pTextRender)
|
void Init(class IGraphics *pGraphics, class ITextRender *pTextRender);
|
||||||
{
|
|
||||||
m_pGraphics = pGraphics;
|
|
||||||
m_pTextRender = pTextRender;
|
|
||||||
}
|
|
||||||
class IGraphics *Graphics() const { return m_pGraphics; }
|
class IGraphics *Graphics() const { return m_pGraphics; }
|
||||||
class ITextRender *TextRender() const { return m_pTextRender; }
|
class ITextRender *TextRender() const { return m_pTextRender; }
|
||||||
|
|
||||||
|
|
|
@ -6129,8 +6129,8 @@ void CEditor::Init()
|
||||||
m_pStorage = Kernel()->RequestInterface<IStorage>();
|
m_pStorage = Kernel()->RequestInterface<IStorage>();
|
||||||
m_pSound = Kernel()->RequestInterface<ISound>();
|
m_pSound = Kernel()->RequestInterface<ISound>();
|
||||||
CGameClient *pGameClient = (CGameClient *)Kernel()->RequestInterface<IGameClient>();
|
CGameClient *pGameClient = (CGameClient *)Kernel()->RequestInterface<IGameClient>();
|
||||||
|
m_UI.Init(m_pGraphics, m_pTextRender);
|
||||||
m_RenderTools.Init(m_pGraphics, &m_UI, pGameClient);
|
m_RenderTools.Init(m_pGraphics, &m_UI, pGameClient);
|
||||||
m_UI.SetGraphics(m_pGraphics, m_pTextRender);
|
|
||||||
m_Map.m_pEditor = this;
|
m_Map.m_pEditor = this;
|
||||||
|
|
||||||
UIEx()->Init(UI(), Kernel(), RenderTools(), Input()->GetEventsRaw(), Input()->GetEventCountRaw());
|
UIEx()->Init(UI(), Kernel(), RenderTools(), Input()->GetEventsRaw(), Input()->GetEventCountRaw());
|
||||||
|
|
Loading…
Reference in a new issue