mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
fix(ui): improve const correctness across xml loading functions in ui
This commit is contained in:
parent
d51ea7e0e0
commit
6732199eab
@ -1 +1 @@
|
|||||||
Subproject commit ddaf9b9ba2b30a9adcfc4a9dd1c5015f9d151640
|
Subproject commit 4393798b9b783dca7d670b583bb2c02463797f0d
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit d590e2e94ffb7b75af0a86a7790372c9c2ba1823
|
Subproject commit 5cdbd74e01dff8a48ab4617013e526ad62987b61
|
||||||
@ -86,7 +86,7 @@ void CBackdropGenerator::Generate(const CRect* rect) {
|
|||||||
this->SetBorderVertexColor(this->m_borderColor);
|
this->SetBorderVertexColor(this->m_borderColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBackdropGenerator::LoadXML(XMLNode* node, CStatus* status) {
|
void CBackdropGenerator::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
const char* bgFileAttr = node->GetAttributeByName("bgFile");
|
const char* bgFileAttr = node->GetAttributeByName("bgFile");
|
||||||
const char* edgeFileAttr = node->GetAttributeByName("edgeFile");
|
const char* edgeFileAttr = node->GetAttributeByName("edgeFile");
|
||||||
const char* tileAttr = node->GetAttributeByName("tile");
|
const char* tileAttr = node->GetAttributeByName("tile");
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class CBackdropGenerator {
|
|||||||
// Member functions
|
// Member functions
|
||||||
CBackdropGenerator();
|
CBackdropGenerator();
|
||||||
void Generate(const CRect* rect);
|
void Generate(const CRect* rect);
|
||||||
void LoadXML(XMLNode* node, CStatus* status);
|
void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
void SetBorderVertexColor(const CImVector& borderColor);
|
void SetBorderVertexColor(const CImVector& borderColor);
|
||||||
void SetOutput(CSimpleFrame* frame);
|
void SetOutput(CSimpleFrame* frame);
|
||||||
void SetVertexColor(const CImVector& color);
|
void SetVertexColor(const CImVector& color);
|
||||||
|
|||||||
@ -438,8 +438,8 @@ float CLayoutFrame::Left() {
|
|||||||
return left;
|
return left;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLayoutFrame::LoadXML(XMLNode* node, CStatus* status) {
|
void CLayoutFrame::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
XMLNode* size = node->GetChildByName("Size");
|
auto size = node->GetChildByName("Size");
|
||||||
float width;
|
float width;
|
||||||
float height;
|
float height;
|
||||||
|
|
||||||
@ -533,7 +533,7 @@ void CLayoutFrame::LoadXML(XMLNode* node, CStatus* status) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLNode* offsetNode = anchorNode->GetChildByName("Offset");
|
auto offsetNode = anchorNode->GetChildByName("Offset");
|
||||||
|
|
||||||
float offsetX = 0.0f;
|
float offsetX = 0.0f;
|
||||||
float offsetY = 0.0f;
|
float offsetY = 0.0f;
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class CLayoutFrame {
|
|||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual ~CLayoutFrame();
|
virtual ~CLayoutFrame();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual CLayoutFrame* GetLayoutParent();
|
virtual CLayoutFrame* GetLayoutParent();
|
||||||
virtual bool SetLayoutScale(float scale, bool force);
|
virtual bool SetLayoutScale(float scale, bool force);
|
||||||
virtual void SetWidth(float width);
|
virtual void SetWidth(float width);
|
||||||
|
|||||||
@ -99,7 +99,7 @@ char* CScriptObject::GetName() {
|
|||||||
return this->m_name.m_str;
|
return this->m_name.m_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScriptObject::PreLoadXML(XMLNode* node, CStatus* status) {
|
void CScriptObject::PreLoadXML(const XMLNode* node, CStatus* status) {
|
||||||
const char* name = node->GetAttributeByName("name");
|
const char* name = node->GetAttributeByName("name");
|
||||||
|
|
||||||
if (name && *name) {
|
if (name && *name) {
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class CScriptObject : public FrameScript_Object {
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
void CreateName(const char* source, char* dest, uint32_t destsize);
|
void CreateName(const char* source, char* dest, uint32_t destsize);
|
||||||
void PreLoadXML(XMLNode* node, CStatus* status);
|
void PreLoadXML(const XMLNode* node, CStatus* status);
|
||||||
void SetName(const char* name);
|
void SetName(const char* name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ bool CScriptRegion::IsDragging() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScriptRegion::LoadXML(XMLNode* node, CStatus* status) {
|
void CScriptRegion::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
CLayoutFrame::LoadXML(node, status);
|
CLayoutFrame::LoadXML(node, status);
|
||||||
|
|
||||||
const char* parentKey = node->GetAttributeByName("parentKey");
|
const char* parentKey = node->GetAttributeByName("parentKey");
|
||||||
@ -95,7 +95,7 @@ void CScriptRegion::LoadXML(XMLNode* node, CStatus* status) {
|
|||||||
this->LoadXML_Animations(node, status);
|
this->LoadXML_Animations(node, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScriptRegion::LoadXML_Animations(XMLNode* node, CStatus* status) {
|
void CScriptRegion::LoadXML_Animations(const XMLNode* node, CStatus* status) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,12 +40,12 @@ class CScriptRegion : public CScriptObject, public CLayoutFrame {
|
|||||||
virtual void AddAnimRotation(CScriptRegion*, FRAMEPOINT, const C2Vector&, float) {};
|
virtual void AddAnimRotation(CScriptRegion*, FRAMEPOINT, const C2Vector&, float) {};
|
||||||
virtual void AddAnimScale(CScriptRegion*, FRAMEPOINT, const C2Vector&, const C2Vector&) {};
|
virtual void AddAnimScale(CScriptRegion*, FRAMEPOINT, const C2Vector&, const C2Vector&) {};
|
||||||
virtual void AddAnimAlpha(CScriptRegion*, int16_t) {};
|
virtual void AddAnimAlpha(CScriptRegion*, int16_t) {};
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual CLayoutFrame* GetLayoutParent();
|
virtual CLayoutFrame* GetLayoutParent();
|
||||||
virtual CLayoutFrame* GetLayoutFrameByName(const char* name);
|
virtual CLayoutFrame* GetLayoutFrameByName(const char* name);
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
void LoadXML_Animations(XMLNode* node, CStatus* status);
|
void LoadXML_Animations(const XMLNode* node, CStatus* status);
|
||||||
bool ProtectedFunctionsAllowed();
|
bool ProtectedFunctionsAllowed();
|
||||||
void SetParent(CSimpleFrame* parent);
|
void SetParent(CSimpleFrame* parent);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include <common/XML.hpp>
|
#include <common/XML.hpp>
|
||||||
#include <storm/String.hpp>
|
#include <storm/String.hpp>
|
||||||
|
|
||||||
int32_t LoadXML_Color(XMLNode* node, CImVector& color) {
|
int32_t LoadXML_Color(const XMLNode* node, CImVector& color) {
|
||||||
float r = 0.0f;
|
float r = 0.0f;
|
||||||
float g = 0.0f;
|
float g = 0.0f;
|
||||||
float b = 0.0f;
|
float b = 0.0f;
|
||||||
@ -61,7 +61,7 @@ int32_t LoadXML_Color(XMLNode* node, CImVector& color) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadXML_Dimensions(XMLNode* node, float& x, float& y, CStatus* status) {
|
int32_t LoadXML_Dimensions(const XMLNode* node, float& x, float& y, CStatus* status) {
|
||||||
const char* xAttr = node->GetAttributeByName("x");
|
const char* xAttr = node->GetAttributeByName("x");
|
||||||
|
|
||||||
if (xAttr && *xAttr) {
|
if (xAttr && *xAttr) {
|
||||||
@ -128,7 +128,7 @@ int32_t LoadXML_Dimensions(XMLNode* node, float& x, float& y, CStatus* status) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadXML_Gradient(XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status) {
|
int32_t LoadXML_Gradient(const XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status) {
|
||||||
orientation = ORIENTATION_HORIZONTAL;
|
orientation = ORIENTATION_HORIZONTAL;
|
||||||
|
|
||||||
// Orientation
|
// Orientation
|
||||||
@ -150,7 +150,7 @@ int32_t LoadXML_Gradient(XMLNode* node, ORIENTATION& orientation, CImVector& min
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadXML_Insets(XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status) {
|
int32_t LoadXML_Insets(const XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status) {
|
||||||
left = 0.0f;
|
left = 0.0f;
|
||||||
right = 0.0f;
|
right = 0.0f;
|
||||||
top = 0.0f;
|
top = 0.0f;
|
||||||
@ -265,7 +265,7 @@ int32_t LoadXML_Insets(XMLNode* node, float& left, float& right, float& top, flo
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSimpleFontString* LoadXML_String(XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
CSimpleFontString* LoadXML_String(const XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
||||||
// TODO
|
// TODO
|
||||||
// auto m = CDataAllocator::GetData(CSimpleFontString::s_allocator, 0, a__avcsimplefon, -2);
|
// auto m = CDataAllocator::GetData(CSimpleFontString::s_allocator, 0, a__avcsimplefon, -2);
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ CSimpleFontString* LoadXML_String(XMLNode* node, CSimpleFrame* frame, CStatus* s
|
|||||||
return fontString;
|
return fontString;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSimpleTexture* LoadXML_Texture(XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
CSimpleTexture* LoadXML_Texture(const XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
||||||
// TODO
|
// TODO
|
||||||
// auto m = (CSimpleTexture *)CDataAllocator::GetData((int)CSimpleTexture::s_allocator, 0, a__avcsimpletex, -2);
|
// auto m = (CSimpleTexture *)CDataAllocator::GetData((int)CSimpleTexture::s_allocator, 0, a__avcsimpletex, -2);
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ CSimpleTexture* LoadXML_Texture(XMLNode* node, CSimpleFrame* frame, CStatus* sta
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadXML_Value(XMLNode* node, float& value, CStatus* status) {
|
int32_t LoadXML_Value(const XMLNode* node, float& value, CStatus* status) {
|
||||||
value = 0.0;
|
value = 0.0;
|
||||||
|
|
||||||
const char* v4 = node->GetAttributeByName("val");
|
const char* v4 = node->GetAttributeByName("val");
|
||||||
|
|||||||
@ -11,18 +11,18 @@ class CSimpleTexture;
|
|||||||
class CStatus;
|
class CStatus;
|
||||||
class XMLNode;
|
class XMLNode;
|
||||||
|
|
||||||
int32_t LoadXML_Color(XMLNode* node, CImVector& color);
|
int32_t LoadXML_Color(const XMLNode* node, CImVector& color);
|
||||||
|
|
||||||
int32_t LoadXML_Dimensions(XMLNode* node, float& x, float& y, CStatus* status);
|
int32_t LoadXML_Dimensions(const XMLNode* node, float& x, float& y, CStatus* status);
|
||||||
|
|
||||||
int32_t LoadXML_Gradient(XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status);
|
int32_t LoadXML_Gradient(const XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status);
|
||||||
|
|
||||||
int32_t LoadXML_Insets(XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status);
|
int32_t LoadXML_Insets(const XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status);
|
||||||
|
|
||||||
CSimpleFontString* LoadXML_String(XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
CSimpleFontString* LoadXML_String(const XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
||||||
|
|
||||||
CSimpleTexture* LoadXML_Texture(XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
CSimpleTexture* LoadXML_Texture(const XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
||||||
|
|
||||||
int32_t LoadXML_Value(XMLNode* node, float& value, CStatus* status);
|
int32_t LoadXML_Value(const XMLNode* node, float& value, CStatus* status);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -128,7 +128,7 @@ bool CSimpleButton::IsA(int32_t type) {
|
|||||||
|| type == CScriptObject::s_objectType;
|
|| type == CScriptObject::s_objectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleButton::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleButton::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
CSimpleFrame::LoadXML(node, status);
|
CSimpleFrame::LoadXML(node, status);
|
||||||
|
|
||||||
CSimpleFontString* buttonText = nullptr;
|
CSimpleFontString* buttonText = nullptr;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class CSimpleButton : public CSimpleFrame {
|
|||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void OnLayerHide();
|
virtual void OnLayerHide();
|
||||||
virtual void OnLayerCursorEnter(int32_t a2);
|
virtual void OnLayerCursorEnter(int32_t a2);
|
||||||
virtual void OnLayerCursorExit(int32_t a2, int32_t a3);
|
virtual void OnLayerCursorExit(int32_t a2, int32_t a3);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ int32_t CSimpleCheckbox::GetChecked() {
|
|||||||
return this->m_checked;
|
return this->m_checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleCheckbox::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleCheckbox::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
CSimpleButton::LoadXML(node, status);
|
CSimpleButton::LoadXML(node, status);
|
||||||
|
|
||||||
auto checkedAttr = node->GetAttributeByName("checked");
|
auto checkedAttr = node->GetAttributeByName("checked");
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class CSimpleCheckbox : public CSimpleButton {
|
|||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void Enable(int32_t enabled);
|
virtual void Enable(int32_t enabled);
|
||||||
virtual void OnClick(const char* btn, int32_t a3);
|
virtual void OnClick(const char* btn, int32_t a3);
|
||||||
|
|
||||||
|
|||||||
@ -594,7 +594,7 @@ int32_t CSimpleEditBox::IsCurrentFocus() {
|
|||||||
return this == CSimpleEditBox::s_currentFocus;
|
return this == CSimpleEditBox::s_currentFocus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleEditBox::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleEditBox::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
CSimpleFrame::LoadXML(node, status);
|
CSimpleFrame::LoadXML(node, status);
|
||||||
|
|
||||||
const char* fontAttr = node->GetAttributeByName("font");
|
const char* fontAttr = node->GetAttributeByName("font");
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class CSimpleEditBox : public CSimpleFrame, CSimpleFontedFrame {
|
|||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void OnLayerUpdate(float elapsedSec);
|
virtual void OnLayerUpdate(float elapsedSec);
|
||||||
virtual void OnFrameSizeChanged(float width, float height);
|
virtual void OnFrameSizeChanged(float width, float height);
|
||||||
virtual int32_t OnLayerKeyDownRepeat(const CKeyEvent& evt);
|
virtual int32_t OnLayerKeyDownRepeat(const CKeyEvent& evt);
|
||||||
|
|||||||
@ -86,7 +86,7 @@ bool CSimpleFont::IsA(int32_t type) {
|
|||||||
return type == CSimpleFont::s_objectType;
|
return type == CSimpleFont::s_objectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFont::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleFont::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
||||||
if (inheritsAttr && *inheritsAttr) {
|
if (inheritsAttr && *inheritsAttr) {
|
||||||
auto font = CSimpleFont::GetFont(inheritsAttr, 0);
|
auto font = CSimpleFont::GetFont(inheritsAttr, 0);
|
||||||
@ -111,7 +111,7 @@ void CSimpleFont::LoadXML(XMLNode* node, CStatus* status) {
|
|||||||
} else {
|
} else {
|
||||||
float fontHeight = 0.0f;
|
float fontHeight = 0.0f;
|
||||||
|
|
||||||
XMLNode* fontHeightNode = node->GetChildByName("FontHeight");
|
auto fontHeightNode = node->GetChildByName("FontHeight");
|
||||||
if (fontHeightNode) {
|
if (fontHeightNode) {
|
||||||
LoadXML_Value(fontHeightNode, fontHeight, status);
|
LoadXML_Value(fontHeightNode, fontHeight, status);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class CSimpleFont : public FrameScript_Object, public CSimpleFontable {
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
CSimpleFont();
|
CSimpleFont();
|
||||||
void LoadXML(XMLNode* node, CStatus* status);
|
void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
void UpdateObjects();
|
void UpdateObjects();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -375,7 +375,7 @@ float CSimpleFontString::GetWidth() {
|
|||||||
return v9 <= v4 ? v4 : v9;
|
return v9 <= v4 ? v4 : v9;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFontString::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleFontString::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
||||||
if (inheritsAttr && *inheritsAttr) {
|
if (inheritsAttr && *inheritsAttr) {
|
||||||
auto font = CSimpleFont::GetFont(inheritsAttr, 0);
|
auto font = CSimpleFont::GetFont(inheritsAttr, 0);
|
||||||
@ -451,7 +451,7 @@ void CSimpleFontString::LoadXML(XMLNode* node, CStatus* status) {
|
|||||||
} else {
|
} else {
|
||||||
float fontHeight = 0.0f;
|
float fontHeight = 0.0f;
|
||||||
|
|
||||||
XMLNode* fontHeightNode = node->GetChildByName("FontHeight");
|
auto fontHeightNode = node->GetChildByName("FontHeight");
|
||||||
if (fontHeightNode) {
|
if (fontHeightNode) {
|
||||||
LoadXML_Value(fontHeightNode, fontHeight, status);
|
LoadXML_Value(fontHeightNode, fontHeight, status);
|
||||||
}
|
}
|
||||||
@ -634,7 +634,7 @@ void CSimpleFontString::OnFrameSizeChanged(const CRect& rect) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFontString::PostLoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleFontString::PostLoadXML(const XMLNode* node, CStatus* status) {
|
||||||
if (this->m_parent) {
|
if (this->m_parent) {
|
||||||
int32_t hasPoint = 0;
|
int32_t hasPoint = 0;
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class CSimpleFontString : public CSimpleRegion, public CSimpleFontable {
|
|||||||
virtual ~CSimpleFontString();
|
virtual ~CSimpleFontString();
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void OnColorChanged(bool a2);
|
virtual void OnColorChanged(bool a2);
|
||||||
virtual void OnScreenSizeChanged();
|
virtual void OnScreenSizeChanged();
|
||||||
virtual void Draw(CRenderBatch* batch);
|
virtual void Draw(CRenderBatch* batch);
|
||||||
@ -70,7 +70,7 @@ class CSimpleFontString : public CSimpleRegion, public CSimpleFontable {
|
|||||||
float GetStringWidth();
|
float GetStringWidth();
|
||||||
const char* GetText();
|
const char* GetText();
|
||||||
float GetTextWidth(const char* text, uint32_t textBytes);
|
float GetTextWidth(const char* text, uint32_t textBytes);
|
||||||
void PostLoadXML(XMLNode* node, CStatus* status);
|
void PostLoadXML(const XMLNode* node, CStatus* status);
|
||||||
void RefreshEmbeddedTextures();
|
void RefreshEmbeddedTextures();
|
||||||
void RemoveShadow();
|
void RemoveShadow();
|
||||||
int32_t SetFont(const char* fontName, float fontHeight, uint32_t fontFlags, bool force);
|
int32_t SetFont(const char* fontName, float fontHeight, uint32_t fontFlags, bool force);
|
||||||
|
|||||||
@ -89,7 +89,7 @@ void CSimpleFrame::EnableDrawLayer(uint32_t drawlayer) {
|
|||||||
this->NotifyDrawLayerChanged(drawlayer);
|
this->NotifyDrawLayerChanged(drawlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFrame::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleFrame::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
const char* inherits = node->GetAttributeByName("inherits");
|
const char* inherits = node->GetAttributeByName("inherits");
|
||||||
|
|
||||||
const char** v68 = &inherits;
|
const char** v68 = &inherits;
|
||||||
@ -288,7 +288,7 @@ void CSimpleFrame::LoadXML(XMLNode* node, CStatus* status) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFrame::PostLoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleFrame::PostLoadXML(const XMLNode* node, CStatus* status) {
|
||||||
this->m_loading = 0;
|
this->m_loading = 0;
|
||||||
|
|
||||||
if (this->m_visible) {
|
if (this->m_visible) {
|
||||||
@ -708,11 +708,11 @@ int32_t CSimpleFrame::HideThis() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFrame::LoadXML_Attributes(XMLNode* node, CStatus* status) {
|
void CSimpleFrame::LoadXML_Attributes(const XMLNode* node, CStatus* status) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFrame::LoadXML_Backdrop(XMLNode* node, CStatus* status) {
|
void CSimpleFrame::LoadXML_Backdrop(const XMLNode* node, CStatus* status) {
|
||||||
auto m = SMemAlloc(sizeof(CBackdropGenerator), __FILE__, __LINE__, 0x0);
|
auto m = SMemAlloc(sizeof(CBackdropGenerator), __FILE__, __LINE__, 0x0);
|
||||||
auto backdrop = new (m) CBackdropGenerator();
|
auto backdrop = new (m) CBackdropGenerator();
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ void CSimpleFrame::LoadXML_Backdrop(XMLNode* node, CStatus* status) {
|
|||||||
this->SetBackdrop(backdrop);
|
this->SetBackdrop(backdrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFrame::LoadXML_Layers(XMLNode* node, CStatus* status) {
|
void CSimpleFrame::LoadXML_Layers(const XMLNode* node, CStatus* status) {
|
||||||
if (!node->m_child) {
|
if (!node->m_child) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -776,7 +776,7 @@ void CSimpleFrame::LoadXML_Layers(XMLNode* node, CStatus* status) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFrame::LoadXML_Scripts(XMLNode* root, CStatus* status) {
|
void CSimpleFrame::LoadXML_Scripts(const XMLNode* root, CStatus* status) {
|
||||||
lua_State* L = FrameScript_GetContext();
|
lua_State* L = FrameScript_GetContext();
|
||||||
|
|
||||||
const char* scriptName;
|
const char* scriptName;
|
||||||
@ -1210,7 +1210,7 @@ void CSimpleFrame::ParentFrame(CSimpleFrame* frame) {
|
|||||||
node->frame = frame;
|
node->frame = frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFrame::PostLoadXML_Frames(XMLNode *node, CStatus* status) {
|
void CSimpleFrame::PostLoadXML_Frames(const XMLNode* node, CStatus* status) {
|
||||||
// Call this function with all inherited nodes
|
// Call this function with all inherited nodes
|
||||||
|
|
||||||
const char* inheritNames = node->GetAttributeByName("inherits");
|
const char* inheritNames = node->GetAttributeByName("inherits");
|
||||||
@ -1265,7 +1265,7 @@ void CSimpleFrame::PostLoadXML_Frames(XMLNode *node, CStatus* status) {
|
|||||||
|
|
||||||
// Create child frames
|
// Create child frames
|
||||||
|
|
||||||
XMLNode* framesNode = node->GetChildByName("Frames");
|
auto framesNode = node->GetChildByName("Frames");
|
||||||
|
|
||||||
if (framesNode) {
|
if (framesNode) {
|
||||||
XMLNode* frameNode;
|
XMLNode* frameNode;
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class CSimpleFrame : public CScriptRegion {
|
|||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void PreOnAnimUpdate();
|
virtual void PreOnAnimUpdate();
|
||||||
virtual void OnLayerShow();
|
virtual void OnLayerShow();
|
||||||
virtual void OnLayerHide();
|
virtual void OnLayerHide();
|
||||||
@ -106,7 +106,7 @@ class CSimpleFrame : public CScriptRegion {
|
|||||||
virtual int32_t OnLayerKeyUp(const CKeyEvent& evt);
|
virtual int32_t OnLayerKeyUp(const CKeyEvent& evt);
|
||||||
virtual int32_t OnLayerMouseDown(const CMouseEvent& evt, const char* btn);
|
virtual int32_t OnLayerMouseDown(const CMouseEvent& evt, const char* btn);
|
||||||
virtual int32_t OnLayerMouseUp(const CMouseEvent& evt, const char* btn);
|
virtual int32_t OnLayerMouseUp(const CMouseEvent& evt, const char* btn);
|
||||||
virtual void PostLoadXML(XMLNode* node, CStatus* status);
|
virtual void PostLoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void UnregisterRegion(CSimpleRegion* region);
|
virtual void UnregisterRegion(CSimpleRegion* region);
|
||||||
virtual int32_t GetBoundsRect(CRect& bounds);
|
virtual int32_t GetBoundsRect(CRect& bounds);
|
||||||
virtual void PreLoadXML(XMLNode* node, CStatus* status);
|
virtual void PreLoadXML(XMLNode* node, CStatus* status);
|
||||||
@ -127,13 +127,13 @@ class CSimpleFrame : public CScriptRegion {
|
|||||||
void EnableEvent(CSimpleEventType eventType, int32_t priority);
|
void EnableEvent(CSimpleEventType eventType, int32_t priority);
|
||||||
int32_t GetHitRect(CRect& rect);
|
int32_t GetHitRect(CRect& rect);
|
||||||
void Hide();
|
void Hide();
|
||||||
void LoadXML_Attributes(XMLNode* node, CStatus* status);
|
void LoadXML_Attributes(const XMLNode* node, CStatus* status);
|
||||||
void LoadXML_Backdrop(XMLNode* node, CStatus* status);
|
void LoadXML_Backdrop(const XMLNode* node, CStatus* status);
|
||||||
void LoadXML_Layers(XMLNode* node, CStatus* status);
|
void LoadXML_Layers(const XMLNode* node, CStatus* status);
|
||||||
void LoadXML_Scripts(XMLNode* node, CStatus* status);
|
void LoadXML_Scripts(const XMLNode* node, CStatus* status);
|
||||||
void NotifyDrawLayerChanged(uint32_t drawlayer);
|
void NotifyDrawLayerChanged(uint32_t drawlayer);
|
||||||
void NotifyScrollParent();
|
void NotifyScrollParent();
|
||||||
void PostLoadXML_Frames(XMLNode* node, CStatus* status);
|
void PostLoadXML_Frames(const XMLNode* node, CStatus* status);
|
||||||
void Raise();
|
void Raise();
|
||||||
void RegisterForEvents(int32_t a2);
|
void RegisterForEvents(int32_t a2);
|
||||||
void RegisterRegion(CSimpleRegion* region);
|
void RegisterRegion(CSimpleRegion* region);
|
||||||
|
|||||||
@ -119,7 +119,7 @@ bool CSimpleHTML::IsA(int32_t type) {
|
|||||||
|| type == CScriptObject::s_objectType;
|
|| type == CScriptObject::s_objectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleHTML::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleHTML::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
CSimpleFrame::LoadXML(node, status);
|
CSimpleFrame::LoadXML(node, status);
|
||||||
|
|
||||||
const char* fontAttr = node->GetAttributeByName("font");
|
const char* fontAttr = node->GetAttributeByName("font");
|
||||||
@ -163,7 +163,7 @@ void CSimpleHTML::LoadXML(XMLNode* node, CStatus* status) {
|
|||||||
// TODO hyperlinkFormat
|
// TODO hyperlinkFormat
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleHTML::ParseBODY(XMLNode* node, CStatus* status) {
|
void CSimpleHTML::ParseBODY(const XMLNode* node, CStatus* status) {
|
||||||
for (auto child = node->m_child; child; child = child->m_next) {
|
for (auto child = node->m_child; child; child = child->m_next) {
|
||||||
if (!SStrCmpI(child->GetName(), "H1", STORM_MAX_STR)) {
|
if (!SStrCmpI(child->GetName(), "H1", STORM_MAX_STR)) {
|
||||||
this->ParseP(child, HTML_TEXT_HEADER1, status);
|
this->ParseP(child, HTML_TEXT_HEADER1, status);
|
||||||
@ -194,11 +194,11 @@ void CSimpleHTML::ParseBODY(XMLNode* node, CStatus* status) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleHTML::ParseIMG(XMLNode* node, CStatus* status) {
|
void CSimpleHTML::ParseIMG(const XMLNode* node, CStatus* status) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleHTML::ParseP(XMLNode* node, HTML_TEXT_TYPE type, CStatus* status) {
|
void CSimpleHTML::ParseP(const XMLNode* node, HTML_TEXT_TYPE type, CStatus* status) {
|
||||||
uint32_t justify = 1;
|
uint32_t justify = 1;
|
||||||
auto justifyAttr = node->GetAttributeByName("align");
|
auto justifyAttr = node->GetAttributeByName("align");
|
||||||
if (justifyAttr && *justifyAttr) {
|
if (justifyAttr && *justifyAttr) {
|
||||||
|
|||||||
@ -35,16 +35,16 @@ class CSimpleHTML : public CSimpleHyperlinkedFrame, CSimpleFontedFrame {
|
|||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void FontUpdated(CSimpleFontedFrameFont* font, int32_t a3);
|
virtual void FontUpdated(CSimpleFontedFrameFont* font, int32_t a3);
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
CSimpleHTML(CSimpleFrame* parent);
|
CSimpleHTML(CSimpleFrame* parent);
|
||||||
void AddText(const char* text, HTML_TEXT_TYPE type, uint32_t justify);
|
void AddText(const char* text, HTML_TEXT_TYPE type, uint32_t justify);
|
||||||
void ClearContent();
|
void ClearContent();
|
||||||
void ParseBODY(XMLNode* node, CStatus* status);
|
void ParseBODY(const XMLNode* node, CStatus* status);
|
||||||
void ParseIMG(XMLNode* node, CStatus* status);
|
void ParseIMG(const XMLNode* node, CStatus* status);
|
||||||
void ParseP(XMLNode* node, HTML_TEXT_TYPE type, CStatus* status);
|
void ParseP(const XMLNode* node, HTML_TEXT_TYPE type, CStatus* status);
|
||||||
bool SetText(const char* text, CStatus* status);
|
bool SetText(const char* text, CStatus* status);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -172,7 +172,7 @@ bool CSimpleModel::IsA(int32_t type) {
|
|||||||
|| type == CScriptObject::s_objectType;
|
|| type == CScriptObject::s_objectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleModel::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleModel::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
CSimpleFrame::LoadXML(node, status);
|
CSimpleFrame::LoadXML(node, status);
|
||||||
|
|
||||||
const char* fileAttr = node->GetAttributeByName("file");
|
const char* fileAttr = node->GetAttributeByName("file");
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class CSimpleModel : public CSimpleFrame {
|
|||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void OnLayerUpdate(float elapsedSec);
|
virtual void OnLayerUpdate(float elapsedSec);
|
||||||
virtual void OnFrameRender(CRenderBatch*, uint32_t);
|
virtual void OnFrameRender(CRenderBatch*, uint32_t);
|
||||||
virtual void UpdateModel();
|
virtual void UpdateModel();
|
||||||
|
|||||||
@ -240,10 +240,10 @@ bool CSimpleScrollFrame::IsA(int32_t type) {
|
|||||||
|| type == CScriptObject::s_objectType;
|
|| type == CScriptObject::s_objectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleScrollFrame::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleScrollFrame::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
CSimpleFrame::LoadXML(node, status);
|
CSimpleFrame::LoadXML(node, status);
|
||||||
|
|
||||||
XMLNode* scrollChildNode = node->GetChildByName("ScrollChild");
|
auto scrollChildNode = node->GetChildByName("ScrollChild");
|
||||||
|
|
||||||
if (scrollChildNode) {
|
if (scrollChildNode) {
|
||||||
XMLNode* childNode = scrollChildNode->m_child;
|
XMLNode* childNode = scrollChildNode->m_child;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class CSimpleScrollFrame : public CSimpleFrame {
|
|||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual int32_t GetBoundsRect(CRect& bounds);
|
virtual int32_t GetBoundsRect(CRect& bounds);
|
||||||
virtual void OnLayerUpdate(float elapsedSec);
|
virtual void OnLayerUpdate(float elapsedSec);
|
||||||
virtual void OnFrameRender(CRenderBatch* batch, uint32_t layer);
|
virtual void OnFrameRender(CRenderBatch* batch, uint32_t layer);
|
||||||
|
|||||||
@ -61,7 +61,7 @@ bool CSimpleSlider::IsA(int32_t type) {
|
|||||||
|| type == CScriptObject::s_objectType;
|
|| type == CScriptObject::s_objectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleSlider::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleSlider::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
this->CSimpleFrame::LoadXML(node, status);
|
this->CSimpleFrame::LoadXML(node, status);
|
||||||
|
|
||||||
// Thumb
|
// Thumb
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class CSimpleSlider : public CSimpleFrame {
|
|||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual void UnregisterRegion(CSimpleRegion* region);
|
virtual void UnregisterRegion(CSimpleRegion* region);
|
||||||
virtual void OnLayerHide();
|
virtual void OnLayerHide();
|
||||||
virtual void OnLayerUpdate(float elapsedSec);
|
virtual void OnLayerUpdate(float elapsedSec);
|
||||||
|
|||||||
@ -153,7 +153,7 @@ bool CSimpleTexture::IsA(int32_t type) {
|
|||||||
|| type == CScriptObject::s_objectType;
|
|| type == CScriptObject::s_objectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleTexture::LoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleTexture::LoadXML(const XMLNode* node, CStatus* status) {
|
||||||
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
||||||
|
|
||||||
if (inheritsAttr && *inheritsAttr) {
|
if (inheritsAttr && *inheritsAttr) {
|
||||||
@ -438,7 +438,7 @@ void CSimpleTexture::OnFrameSizeChanged(const CRect& rect) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleTexture::PostLoadXML(XMLNode* node, CStatus* status) {
|
void CSimpleTexture::PostLoadXML(const XMLNode* node, CStatus* status) {
|
||||||
if (this->m_parent) {
|
if (this->m_parent) {
|
||||||
for (int32_t i = 0; i < FRAMEPOINT_NUMPOINTS; i++) {
|
for (int32_t i = 0; i < FRAMEPOINT_NUMPOINTS; i++) {
|
||||||
if (this->m_points[i] && !(this->m_points[i]->m_flags & 0x8)) {
|
if (this->m_points[i] && !(this->m_points[i]->m_flags & 0x8)) {
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class CSimpleTexture : public CSimpleRegion {
|
|||||||
virtual ~CSimpleTexture();
|
virtual ~CSimpleTexture();
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
virtual bool IsA(int32_t type);
|
virtual bool IsA(int32_t type);
|
||||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||||
virtual float GetWidth();
|
virtual float GetWidth();
|
||||||
virtual float GetHeight();
|
virtual float GetHeight();
|
||||||
virtual void Draw(CRenderBatch* batch);
|
virtual void Draw(CRenderBatch* batch);
|
||||||
@ -51,7 +51,7 @@ class CSimpleTexture : public CSimpleRegion {
|
|||||||
// Member functions
|
// Member functions
|
||||||
CSimpleTexture(CSimpleFrame* frame, uint32_t drawlayer, int32_t show);
|
CSimpleTexture(CSimpleFrame* frame, uint32_t drawlayer, int32_t show);
|
||||||
void GetTexCoord(C2Vector* texCoord);
|
void GetTexCoord(C2Vector* texCoord);
|
||||||
void PostLoadXML(XMLNode* node, CStatus* status);
|
void PostLoadXML(const XMLNode* node, CStatus* status);
|
||||||
void SetAlpha(float alpha);
|
void SetAlpha(float alpha);
|
||||||
void SetBlendMode(EGxBlend blend);
|
void SetBlendMode(EGxBlend blend);
|
||||||
void SetPosition(const CRect& rect, C3Vector* position);
|
void SetPosition(const CRect& rect, C3Vector* position);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user