mirror of
https://github.com/PrimeDecomp/prime.git
synced 2026-07-12 18:18:56 -07:00
CGuiWidget progress
This commit is contained in:
@@ -12272,7 +12272,7 @@ ParseBaseInfo__10CGuiWidgetFP9CGuiFrameR12CInputStreamRCQ210CGuiWidget15CGuiWidg
|
||||
__dt__10CGuiWidgetFv = .text:0x802CABB4; // type:function size:0x70 scope:global
|
||||
__ct__10CGuiWidgetFRCQ210CGuiWidget15CGuiWidgetParms = .text:0x802CAC24; // type:function size:0x12C scope:global
|
||||
ReadWidgetHeader__10CGuiWidgetFP9CGuiFrameR12CInputStream = .text:0x802CAD50; // type:function size:0x108 scope:global
|
||||
Create__10CGuiWidgetFP9CGuiFrameR12CInputStreamb = .text:0x802CAE58; // type:function size:0xD8 scope:global
|
||||
Create__10CGuiWidgetFP9CGuiFrameR12CInputStreamP11CSimplePool = .text:0x802CAE58; // type:function size:0xD8 scope:global
|
||||
__ct__Q210CGuiWidget15CGuiWidgetParmsFP9CGuiFramebssbbbRC6CColorQ210CGuiWidget18EGuiModelDrawFlagsbb = .text:0x802CAF30; // type:function size:0x44 scope:global
|
||||
FindWidgetID__14CGuiWidgetIdDBCFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator> = .text:0x802CAF74; // type:function size:0x88 scope:global
|
||||
AddWidget__14CGuiWidgetIdDBFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator> = .text:0x802CAFFC; // type:function size:0xA8 scope:global
|
||||
|
||||
@@ -12272,7 +12272,7 @@ ParseBaseInfo__10CGuiWidgetFP9CGuiFrameR12CInputStreamRCQ210CGuiWidget15CGuiWidg
|
||||
__dt__10CGuiWidgetFv = .text:0x802CAC60; // type:function size:0x70 scope:global
|
||||
__ct__10CGuiWidgetFRCQ210CGuiWidget15CGuiWidgetParms = .text:0x802CACD0; // type:function size:0x12C scope:global
|
||||
ReadWidgetHeader__10CGuiWidgetFP9CGuiFrameR12CInputStream = .text:0x802CADFC; // type:function size:0x108 scope:global
|
||||
Create__10CGuiWidgetFP9CGuiFrameR12CInputStreamb = .text:0x802CAF04; // type:function size:0xD8 scope:global
|
||||
Create__10CGuiWidgetFP9CGuiFrameR12CInputStreamP11CSimplePool = .text:0x802CAF04; // type:function size:0xD8 scope:global
|
||||
__ct__Q210CGuiWidget15CGuiWidgetParmsFP9CGuiFramebssbbbRC6CColorQ210CGuiWidget18EGuiModelDrawFlagsbb = .text:0x802CAFDC; // type:function size:0x44 scope:global
|
||||
FindWidgetID__14CGuiWidgetIdDBCFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator> = .text:0x802CB020; // type:function size:0x88 scope:global
|
||||
AddWidget__14CGuiWidgetIdDBFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator> = .text:0x802CB0A8; // type:function size:0xA8 scope:global
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _CGUIFRAME
|
||||
#define _CGUIFRAME
|
||||
|
||||
#include "GuiSys/CGuiWidgetIdDB.hpp"
|
||||
#include "rstl/string.hpp"
|
||||
|
||||
class CGuiWidget;
|
||||
@@ -15,9 +16,12 @@ public:
|
||||
void AddLight(CGuiLight* light);
|
||||
void RemoveLight(CGuiLight* light);
|
||||
|
||||
CGuiWidgetIdDB& WidgetIdDB() { return x18_db; }
|
||||
|
||||
private:
|
||||
char x0_pad[0x14];
|
||||
char x0_[0x14];
|
||||
CGuiCamera* x14_camera;
|
||||
CGuiWidgetIdDB x18_db;
|
||||
};
|
||||
|
||||
#endif // _CGUIFRAME
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
class CFinalInput;
|
||||
class CGuiFrame;
|
||||
|
||||
class CInputStream;
|
||||
class CSimplePool;
|
||||
enum ETraversalMode {
|
||||
kTM_ChildrenAndSiblings = 0,
|
||||
kTM_Children = 1,
|
||||
@@ -27,8 +28,9 @@ public:
|
||||
};
|
||||
class CGuiWidgetParms {
|
||||
public:
|
||||
CGuiWidgetParms(CGuiFrame*, const rstl::string&, bool, short, short, bool, bool, bool,
|
||||
const CColor&, CGuiWidget::EGuiModelDrawFlags, bool, bool);
|
||||
CGuiWidgetParms(CGuiFrame* frame, bool useAnimController, short selfId, short parentId,
|
||||
bool defaultVisible, bool defaultActive, bool cullFaces, const CColor& color,
|
||||
EGuiModelDrawFlags drawFlags, bool g, bool h);
|
||||
CGuiFrame* x0_frame;
|
||||
bool x4_useAnimController;
|
||||
short x6_selfId;
|
||||
@@ -68,6 +70,7 @@ public:
|
||||
|
||||
CGuiFrame* GetFrame() { return xb0_frame; }
|
||||
|
||||
static CGuiWidget* Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
||||
static const short InvalidWidgetId() { return gkInvalidWidgetId; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -8,8 +8,9 @@ class CGuiWidgetIdDB {
|
||||
public:
|
||||
CGuiWidgetIdDB();
|
||||
void Reserve(int);
|
||||
int AddWidget(const rstl::string& name);
|
||||
short FindWidgetID(const rstl::string& name) const;
|
||||
const short AddWidget(const rstl::string& name);
|
||||
const short FindWidgetID(const rstl::string& name) const;
|
||||
|
||||
private:
|
||||
rstl::vector< rstl::string > x0_db;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
uint ReadLong();
|
||||
ushort ReadShort();
|
||||
bool ReadBool();
|
||||
uchar ReadChar();
|
||||
char ReadChar();
|
||||
uint ReadBits(uint len);
|
||||
size_t ReadBytes(void* dest, size_t len);
|
||||
void Get(void* dest, unsigned long len);
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
class COBBTree {
|
||||
struct SIndexData {
|
||||
rstl::vector< u32 > x0_materials;
|
||||
rstl::vector< u8 > x10_vertMaterials;
|
||||
rstl::vector< u8 > x20_edgeMaterials;
|
||||
rstl::vector< u8 > x30_surfaceMaterials;
|
||||
rstl::vector< uint > x0_materials;
|
||||
rstl::vector< uchar > x10_vertMaterials;
|
||||
rstl::vector< uchar > x20_edgeMaterials;
|
||||
rstl::vector< uchar > x30_surfaceMaterials;
|
||||
rstl::vector< CCollisionEdge > x40_edges;
|
||||
rstl::vector< u16 > x50_surfaceIndices;
|
||||
rstl::vector< ushort > x50_surfaceIndices;
|
||||
rstl::vector< CVector3f > x60_vertices;
|
||||
SIndexData(CInputStream& in);
|
||||
};
|
||||
|
||||
@@ -7,7 +7,9 @@ COBBox::COBBox(const CTransform4f& xf, const CVector3f& extents)
|
||||
|
||||
COBBox::COBBox(CInputStream& in) : mTransform(in), mExtents(in) {}
|
||||
|
||||
CAABox COBBox::CalculateAABox(const CTransform4f& xf) const { return CAABox(CVector3f::Zero(), CVector3f::Zero()); }
|
||||
CAABox COBBox::CalculateAABox(const CTransform4f& xf) const {
|
||||
return CAABox(CVector3f::Zero(), CVector3f::Zero());
|
||||
}
|
||||
|
||||
COBBox COBBox::FromAABox(const CAABox& box, const CTransform4f& xf) {
|
||||
CVector3f center = box.GetCenterPoint();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#include "GuiSys/CGuiWidget.hpp"
|
||||
#include "GuiSys/CGuiFrame.hpp"
|
||||
#include "GuiSys/CGuiWidgetDrawParms.hpp"
|
||||
|
||||
#include <Kyoto/Streams/CInputStream.hpp>
|
||||
|
||||
static const char* tmp = "Warning: Discarding useless worker id. Parent is not a compound widget.";
|
||||
|
||||
CGuiWidget::CGuiWidgetParms::CGuiWidgetParms(CGuiFrame* frame, bool useAnimController,
|
||||
const short selfId, const short parentId,
|
||||
const bool defaultVisible, const bool defaultActive,
|
||||
const bool cullFaces, const CColor& color,
|
||||
EGuiModelDrawFlags drawFlags, const bool g,
|
||||
const bool h)
|
||||
: x0_frame(frame)
|
||||
, x4_useAnimController(useAnimController)
|
||||
, x6_selfId(selfId)
|
||||
, x8_parentId(parentId)
|
||||
, xa_defaultVisible(defaultVisible)
|
||||
, xb_defaultActive(defaultActive)
|
||||
, xc_cullFaces(cullFaces)
|
||||
, xd_g(g)
|
||||
, xe_h(h)
|
||||
, x10_color(color)
|
||||
, x14_drawFlags(drawFlags) {}
|
||||
|
||||
CGuiWidget* CGuiWidget::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) {
|
||||
CGuiWidgetParms parms = ReadWidgetHeader(frame, in);
|
||||
CGuiWidget* ret = rs_new CGuiWidget(parms);
|
||||
ret->ParseBaseInfo(frame, in, parms);
|
||||
return ret;
|
||||
}
|
||||
|
||||
CGuiWidget::CGuiWidgetParms CGuiWidget::ReadWidgetHeader(CGuiFrame* frame, CInputStream& in) {
|
||||
rstl::string name(in);
|
||||
const short selfId = frame->WidgetIdDB().AddWidget(name);
|
||||
rstl::string parent(in);
|
||||
const short parentId = frame->WidgetIdDB().AddWidget(parent);
|
||||
|
||||
bool useAnimController = in.Get< bool >();
|
||||
bool defaultVis = in.Get< bool >();
|
||||
bool defaultActive = in.Get< bool >();
|
||||
bool cullFaces = in.Get< bool >();
|
||||
CColor color(in);
|
||||
EGuiModelDrawFlags flags = static_cast< EGuiModelDrawFlags >(in.Get< uint >());
|
||||
|
||||
return CGuiWidgetParms(frame, useAnimController, selfId, parentId, defaultVis, defaultActive,
|
||||
cullFaces, color, flags, true, false);
|
||||
}
|
||||
@@ -143,13 +143,13 @@ uint CInputStream::ReadBits(uint bitCount) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
uchar CInputStream::ReadChar() {
|
||||
static uchar c;
|
||||
Get(&c, sizeof(uchar));
|
||||
char CInputStream::ReadChar() {
|
||||
static char c;
|
||||
Get(&c, sizeof(char));
|
||||
return c;
|
||||
}
|
||||
|
||||
bool CInputStream::ReadBool() { return static_cast< bool >(ReadChar()); }
|
||||
bool CInputStream::ReadBool() { return static_cast< uchar >(ReadChar()) != 0; }
|
||||
|
||||
ushort CInputStream::ReadShort() {
|
||||
static ushort s;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "Kyoto/Streams/CInputStream.hpp"
|
||||
|
||||
#pragma inline_max_size(250)
|
||||
|
||||
COBBTree::SIndexData::SIndexData(CInputStream& in)
|
||||
: x0_materials(in)
|
||||
, x10_vertMaterials(in)
|
||||
@@ -10,3 +12,5 @@ COBBTree::SIndexData::SIndexData(CInputStream& in)
|
||||
, x40_edges(in)
|
||||
, x50_surfaceIndices(in)
|
||||
, x60_vertices(in) {}
|
||||
|
||||
COBBTree::COBBTree(const SIndexData& indexData, const CNode* root);
|
||||
|
||||
Reference in New Issue
Block a user