Initial CGuiTextSupport fields; integrated optional template

This commit is contained in:
Jack Andersen 2016-03-20 19:02:56 -10:00
parent 89daac544f
commit 6fcdb3a99c
9 changed files with 1146 additions and 4 deletions

View File

@ -27,10 +27,11 @@ static const hecl::SystemChar* MomErr[] =
_S("Unable to find Waldo"), _S("Unable to find Waldo"),
_S("Expected Ridley, found furby"), _S("Expected Ridley, found furby"),
_S("Adam has not authorized this, please do not bug the developers"), _S("Adam has not authorized this, please do not bug the developers"),
_S("Error: Lady returned objection") _S("Lady returned objection"),
_S("Unterminated plot thread 'Deleter' detected")
}; };
constexpr uint32_t MomErrCount = 11; constexpr uint32_t MomErrCount = std::extent<decltype(MomErr)>::value;
SpecBase::SpecBase(hecl::Database::Project& project) SpecBase::SpecBase(hecl::Database::Project& project)
: m_project(project), : m_project(project),
m_masterShader(project.getProjectWorkingPath(), ".hecl/RetroMasterShader.blend") {} m_masterShader(project.getProjectWorkingPath(), ".hecl/RetroMasterShader.blend") {}

View File

@ -66,6 +66,7 @@ add_library(RuntimeCommon
CPlayMovieBase.hpp CPlayMovieBase.hpp
CGameDebug.hpp CGameDebug.cpp CGameDebug.hpp CGameDebug.cpp
rstl.hpp rstl.cpp rstl.hpp rstl.cpp
optional.hpp optional.cpp
GameGlobalObjects.hpp GameGlobalObjects.hpp
RetroTypes.hpp RetroTypes.hpp
GCNTypes.hpp GCNTypes.hpp

View File

@ -14,6 +14,8 @@
#include "CGuiSliderGroup.hpp" #include "CGuiSliderGroup.hpp"
#include "CGuiTextPane.hpp" #include "CGuiTextPane.hpp"
#include "CAuiEnergyBarT01.hpp" #include "CAuiEnergyBarT01.hpp"
#include "CTextParser.hpp"
#include "CSimplePool.hpp"
namespace urde namespace urde
{ {
@ -71,6 +73,7 @@ CGuiWidget* CGuiSys::CreateWidgetInGame(FourCC type, CInputStream& in, CGuiFrame
CGuiSys::CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode) CGuiSys::CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode)
: x0_resFactory(resFactory), x4_resStore(resStore), x2c_mode(mode), : x0_resFactory(resFactory), x4_resStore(resStore), x2c_mode(mode),
x38_frameFactoryParams(new TObjOwnerParam<CGuiResFrameData>(CGuiResFrameData(*this))), x38_frameFactoryParams(new TObjOwnerParam<CGuiResFrameData>(CGuiResFrameData(*this))),
x34_textParser(new CTextParser(resStore)),
x40_constructTime(std::chrono::steady_clock::now()) x40_constructTime(std::chrono::steady_clock::now())
{ {
AddFactories(mode); AddFactories(mode);

View File

@ -19,6 +19,7 @@ class IFactory;
class CSimplePool; class CSimplePool;
class CGuiWidget; class CGuiWidget;
class CGuiFrame; class CGuiFrame;
class CTextParser;
typedef CGuiObject*(*FGuiFactoryFunc)(const SObjectTag&, const CVParamTransfer&); typedef CGuiObject*(*FGuiFactoryFunc)(const SObjectTag&, const CVParamTransfer&);
@ -50,6 +51,7 @@ private:
std::unordered_map<EPhysicalControllerID, CGuiAutoRepeatData> x18_repeatMap; std::unordered_map<EPhysicalControllerID, CGuiAutoRepeatData> x18_repeatMap;
EUsageMode x2c_mode; EUsageMode x2c_mode;
std::stack<CSaveableState, std::vector<CSaveableState>> x30_saveStack; std::stack<CSaveableState, std::vector<CSaveableState>> x30_saveStack;
std::unique_ptr<CTextParser> x34_textParser;
CVParamTransfer x38_frameFactoryParams; CVParamTransfer x38_frameFactoryParams;
std::chrono::time_point<std::chrono::steady_clock> x40_constructTime; std::chrono::time_point<std::chrono::steady_clock> x40_constructTime;

View File

@ -1,5 +1,7 @@
#include "CGuiTextSupport.hpp" #include "CGuiTextSupport.hpp"
#include "CSimplePool.hpp" #include "CSimplePool.hpp"
#include "CFontImageDef.hpp"
#include "Graphics/CGraphicsPalette.hpp"
namespace urde namespace urde
{ {
@ -7,8 +9,73 @@ namespace urde
CGuiTextSupport::CGuiTextSupport(TResId fontId, const CGuiTextProperties& props, CGuiTextSupport::CGuiTextSupport(TResId fontId, const CGuiTextProperties& props,
const zeus::CColor& col1, const zeus::CColor& col2, const zeus::CColor& col1, const zeus::CColor& col2,
const zeus::CColor& col3, int, int, CSimplePool* store) const zeus::CColor& col3, int, int, CSimplePool* store)
: x10_props(props), x1c_(col1), x20_(col2), x24_(col3)
{
x2c0_font = store->GetObj({SBIG('FONT'), fontId});
}
void CGuiTextSupport::GetCurrentAnimationOverAge() const
{
if (!x2ac_ || !x44_)
return;
}
int CGuiTextSupport::GetNumCharsPrinted() const
{
}
int CGuiTextSupport::GetTotalAnimationTime() const
{
}
void CGuiTextSupport::SetTypeWriteEffectOptions(bool, float, float)
{
}
void CGuiTextSupport::Update(float dt)
{
}
void CGuiTextSupport::ClearBuffer()
{
}
void CGuiTextSupport::CheckAndRebuildTextRenderBuffer()
{
}
void CGuiTextSupport::Render() const
{
}
void CGuiTextSupport::SetGeometryColor(const zeus::CColor& col)
{
}
void CGuiTextSupport::SetOutlineColor(const zeus::CColor& col)
{
}
void CGuiTextSupport::SetFontColor(const zeus::CColor& col)
{
}
void CGuiTextSupport::AddText(const std::wstring& str)
{
}
void CGuiTextSupport::SetText(const std::wstring& str)
{
}
void CGuiTextSupport::SetText(const std::string& str)
{
}
bool CGuiTextSupport::GetIsTextSupportFinishedLoading() const
{ {
store->GetObj({SBIG('FONT'), fontId});
} }
} }

View File

@ -4,12 +4,15 @@
#include "zeus/CColor.hpp" #include "zeus/CColor.hpp"
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "CToken.hpp" #include "CToken.hpp"
#include "CTextRenderBuffer.hpp"
#include "optional.hpp"
#include <string> #include <string>
namespace urde namespace urde
{ {
class CSimplePool; class CSimplePool;
class CRasterFont; class CRasterFont;
class CTextRenderBuffer;
enum class EJustification enum class EJustification
{ {
@ -72,12 +75,30 @@ public:
class CGuiTextSupport class CGuiTextSupport
{ {
u32 x4_ = 0;
u32 x8_ = 0;
CGuiTextProperties x10_props;
zeus::CColor x1c_;
zeus::CColor x20_;
zeus::CColor x24_;
s32 x28_;
s32 x2c_;
float x30_ = 0.f;
std::vector<u32> x34_;
s32 x44_ = 0;
float x48_ = 0.1f;
float x4c_ = 10.0f;
TResId x50_fontId; TResId x50_fontId;
std::experimental::optional<CTextRenderBuffer> x54_renderBuf;
bool x2ac_ = false;
s32 x2b4_ = 0;
s32 x2b8_ = 0;
s32 x2bc_ = 0;
TLockedToken<CRasterFont> x2c0_font; TLockedToken<CRasterFont> x2c0_font;
public: public:
CGuiTextSupport(TResId fontId, const CGuiTextProperties& props, CGuiTextSupport(TResId fontId, const CGuiTextProperties& props,
const zeus::CColor& col1, const zeus::CColor& col2, const zeus::CColor& col1, const zeus::CColor& col2,
const zeus::CColor& col3, int, int, CSimplePool*); const zeus::CColor& col3, s32, s32, CSimplePool*);
void GetCurrentAnimationOverAge() const; void GetCurrentAnimationOverAge() const;
int GetNumCharsPrinted() const; int GetNumCharsPrinted() const;
int GetTotalAnimationTime() const; int GetTotalAnimationTime() const;

View File

@ -28,6 +28,7 @@
#include "GuiSys/CSplashScreen.hpp" #include "GuiSys/CSplashScreen.hpp"
#include "CMainFlow.hpp" #include "CMainFlow.hpp"
#include "GuiSys/CConsoleOutputWindow.hpp" #include "GuiSys/CConsoleOutputWindow.hpp"
#include "GuiSys/CTextParser.hpp"
#include "Audio/CAudioStateWin.hpp" #include "Audio/CAudioStateWin.hpp"
#include "GameGlobalObjects.hpp" #include "GameGlobalObjects.hpp"
#include "CArchitectureQueue.hpp" #include "CArchitectureQueue.hpp"

2
Runtime/optional.cpp Normal file
View File

@ -0,0 +1,2 @@
#include "optional.hpp"
logvisor::Module OptionalLogModule("optional.hpp");

1044
Runtime/optional.hpp Normal file

File diff suppressed because it is too large Load Diff