More stubs and class discoveries

This commit is contained in:
Jack Andersen 2016-03-10 19:32:18 -10:00
parent e1c9beed7d
commit cc4b5d3f98
8 changed files with 186 additions and 1 deletions

View File

@ -0,0 +1,12 @@
#include "CGuiFrame.hpp"
namespace urde
{
CGuiFrame::CGuiFrame(u32 id, const std::string& name, CGuiSys& sys, int, int, int)
: x4_name(name), x14_id(id), x1c_transitionOpts(EFrameTransitionOptions::Zero)
{
}
}

View File

@ -5,7 +5,32 @@
namespace urde namespace urde
{ {
class CGuiSys;
enum class EFrameTransitionOptions
{
Zero
};
class CGuiFrameTransitionOptions
{
EFrameTransitionOptions x0_opts;
bool x4_ = true;
float x8_ = 1.f;
zeus::CVector3f xc_;
public:
CGuiFrameTransitionOptions(EFrameTransitionOptions opts)
: x0_opts(opts) {}
};
class CGuiFrame
{
std::string x4_name;
u32 x14_id;
CGuiFrameTransitionOptions x1c_transitionOpts;
public:
CGuiFrame(u32 id, const std::string& name, CGuiSys& sys, int, int, int);
};
} }

View File

View File

@ -0,0 +1,43 @@
#ifndef __URDE_CGUIFUNCPARM_HPP__
#define __URDE_CGUIFUNCPARM_HPP__
#include "RetroTypes.hpp"
namespace urde
{
class CGuiFuncParm
{
public:
enum class Type
{
Null = -1,
Int = 0,
Float = 1,
IntrusivePointer = 2
};
private:
Type x0_type = Type::Null;
union
{
u32 x4_int;
float x4_float;
void* x4_ptr = nullptr;
};
public:
CGuiFuncParm() = default;
CGuiFuncParm(int arg) : x0_type(Type::Int), x4_int(arg) {}
CGuiFuncParm(float arg) : x0_type(Type::Float), x4_float(arg) {}
CGuiFuncParm(void* arg) : x0_type(Type::IntrusivePointer), x4_ptr(arg) {}
~CGuiFuncParm()
{
if (x0_type == Type::IntrusivePointer)
delete static_cast<u8*>(x4_ptr);
}
};
}
#endif // __URDE_CGUIFUNCPARM_HPP__

View File

@ -0,0 +1,30 @@
#include "CGuiFunctionDef.hpp"
namespace urde
{
CGuiFunctionDef::CGuiFunctionDef(int funcId, bool flag,
const CGuiFuncParm& a, const CGuiFuncParm& b,
const CGuiFuncParm& c, const CGuiFuncParm& d)
: x0_funcId(funcId), x4_parmCount(4), x48_flag(flag)
{
x8_parms[0] = a;
x8_parms[1] = b;
x8_parms[2] = c;
x8_parms[3] = d;
}
CGuiFunctionDef::CGuiFunctionDef(int funcId, bool flag,
const CGuiFuncParm& a, const CGuiFuncParm& b)
: x0_funcId(funcId), x4_parmCount(2), x48_flag(flag)
{
x8_parms[0] = a;
x8_parms[1] = b;
}
CGuiFunctionDef::CGuiFunctionDef(int funcId, bool flag)
: x0_funcId(funcId), x48_flag(flag)
{
}
}

View File

@ -0,0 +1,31 @@
#ifndef __URDE_CGUIFUNCTIONDEF_HPP__
#define __URDE_CGUIFUNCTIONDEF_HPP__
#include "CGuiFuncParm.hpp"
namespace urde
{
class CGuiFunctionDef
{
int x0_funcId;
unsigned x4_parmCount = 0;
std::array<CGuiFuncParm, 8> x8_parms;
bool x48_flag;
public:
const CGuiFuncParm& GetParm(int parm)
{
return x8_parms[parm];
}
CGuiFunctionDef(int funcId, bool,
const CGuiFuncParm& a, const CGuiFuncParm& b,
const CGuiFuncParm& c, const CGuiFuncParm& d);
CGuiFunctionDef(int funcId, bool,
const CGuiFuncParm& a, const CGuiFuncParm& b);
CGuiFunctionDef(int funcId, bool);
};
}
#endif // __URDE_CGUIFUNCTIONDEF_HPP__

View File

@ -14,6 +14,14 @@ enum class EGuiAnimBehListID
{ {
}; };
enum class ETraversalMode
{
};
enum class EGuiAnimInitMode
{
};
class CGuiWidget : public CGuiObject class CGuiWidget : public CGuiObject
{ {
public: public:
@ -51,6 +59,38 @@ public:
virtual void DoRegisterEventHandler(); virtual void DoRegisterEventHandler();
virtual void DoUnregisterEventHandler(); virtual void DoUnregisterEventHandler();
void AddFunctionDef(u32, CGuiFunctionDef* def);
void FindFunctionDefList(int);
zeus::CVector3f GetIdlePosition() const;
void SetIdlePosition(const zeus::CVector3f& pos);
void ReapplyXform();
void SetIsVisible(bool);
void SetIsActive(bool, bool);
void BroadcastMessage(int, CGuiControllerInfo* info);
void LockEvents(bool);
void UnregisterEventHandler();
void UnregisterEventHandler(ETraversalMode);
void RegisterEventHandler();
void RegisterEventHandler(ETraversalMode);
void ResetAllAnimUpdateState();
void SetVisibility(bool, ETraversalMode);
void SetAnimUpdateState(EGuiAnimBehListID, bool);
void SetAnimUpdateState(EGuiAnimBehListID, bool, ETraversalMode);
void GetBranchAnimLen(EGuiAnimBehListID, float&);
void GetBranchAnimLen(EGuiAnimBehListID, float&, ETraversalMode);
void IsAllAnimsDone(EGuiAnimBehListID, bool&);
void IsAllAnimsDone(EGuiAnimBehListID, bool&, ETraversalMode);
void InitializeAnimControllers(EGuiAnimBehListID, float, bool, EGuiAnimInitMode);
void InitializeAnimControllers(EGuiAnimBehListID, float, bool, EGuiAnimInitMode, ETraversalMode);
void RecalcWidgetColor(ETraversalMode);
void SetColor(const zeus::CColor& color);
void RecalculateAllRGBA();
void InitializeRGBAFactor();
void FindWidget(u16);
bool GetIsFinishedLoading() const;
void InitializeRecursive();
bool MAF_StartAnimationSet(CGuiFunctionDef* def, CGuiControllerInfo* info); bool MAF_StartAnimationSet(CGuiFunctionDef* def, CGuiControllerInfo* info);
bool MAF_SendMessage(CGuiFunctionDef* def, CGuiControllerInfo* info); bool MAF_SendMessage(CGuiFunctionDef* def, CGuiControllerInfo* info);
bool MAF_PauseAnim(CGuiFunctionDef* def, CGuiControllerInfo* info); bool MAF_PauseAnim(CGuiFunctionDef* def, CGuiControllerInfo* info);

View File

@ -61,4 +61,8 @@ add_library(RuntimeCommonGuiSys
CGuiGroup.cpp CGuiGroup.cpp
CGuiGroup.hpp CGuiGroup.hpp
CGuiMenuRadial.cpp CGuiMenuRadial.cpp
CGuiMenuRadial.hpp) CGuiMenuRadial.hpp
CGuiFunctionDef.cpp
CGuiFunctionDef.hpp
CGuiFuncParm.cpp
CGuiFuncParm.hpp)