metaforce/Runtime/GuiSys/CGuiSys.cpp

72 lines
2.1 KiB
C++
Raw Normal View History

2016-03-11 00:23:16 +00:00
#include "CGuiSys.hpp"
#include "CGuiWidget.hpp"
#include "CGuiHeadWidget.hpp"
#include "CGuiLight.hpp"
#include "CGuiCamera.hpp"
#include "CGuiGroup.hpp"
#include "CGuiPane.hpp"
#include "CAuiImagePane.hpp"
#include "CAuiMeter.hpp"
#include "CGuiModel.hpp"
#include "CGuiTableGroup.hpp"
#include "CGuiSliderGroup.hpp"
#include "CGuiTextPane.hpp"
#include "CAuiEnergyBarT01.hpp"
#include "CTextParser.hpp"
#include "CSimplePool.hpp"
2016-03-21 22:01:19 +00:00
#include "CTextExecuteBuffer.hpp"
2016-03-11 00:23:16 +00:00
namespace urde
{
2016-03-19 03:58:01 +00:00
CGuiSys* g_GuiSys = nullptr;
2016-03-21 22:01:19 +00:00
CTextExecuteBuffer* g_TextExecuteBuf = nullptr;
CTextParser* g_TextParser = nullptr;
2016-03-19 03:58:01 +00:00
std::shared_ptr<CGuiWidget> CGuiSys::CreateWidgetInGame(FourCC type, CInputStream& in,
CGuiFrame* frame, CSimplePool* sp)
{
switch (type)
{
case SBIG('BWIG'):
return CGuiWidget::Create(frame, in, sp);
case SBIG('HWIG'):
return CGuiHeadWidget::Create(frame, in, sp);
case SBIG('LITE'):
return CGuiLight::Create(frame, in, sp);
case SBIG('CAMR'):
return CGuiCamera::Create(frame, in, sp);
case SBIG('GRUP'):
return CGuiGroup::Create(frame, in, sp);
case SBIG('PANE'):
return CGuiPane::Create(frame, in, sp);
case SBIG('IMGP'):
return CAuiImagePane::Create(frame, in, sp);
case SBIG('METR'):
return CAuiMeter::Create(frame, in, sp);
case SBIG('MODL'):
return CGuiModel::Create(frame, in, sp);
case SBIG('TBGP'):
return CGuiTableGroup::Create(frame, in, sp);
case SBIG('SLGP'):
return CGuiSliderGroup::Create(frame, in, sp);
case SBIG('TXPN'):
return CGuiTextPane::Create(frame, in, sp);
case SBIG('ENRG'):
return CAuiEnergyBarT01::Create(frame, in, sp);
default: break;
}
return {};
}
2016-03-11 00:23:16 +00:00
CGuiSys::CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode)
: x0_resFactory(resFactory), x4_resStore(resStore), x8_mode(mode),
xc_textExecuteBuf(new CTextExecuteBuffer()),
x10_textParser(new CTextParser(resStore))
2016-03-11 00:23:16 +00:00
{
g_TextExecuteBuf = xc_textExecuteBuf.get();
g_TextParser = x10_textParser.get();
2016-03-11 00:23:16 +00:00
}
}