This commit is contained in:
robojumper
2025-03-31 03:34:21 +02:00
committed by GitHub
parent e85a989271
commit daadae4881
7 changed files with 127 additions and 85 deletions
+49
View File
@@ -42,10 +42,59 @@ public:
return 1.0f;
}
inline static f32 getFn800B1FD0() {
if (sInstance != nullptr) {
return sInstance->fn_800B1FD0();
}
return 1.0f;
}
inline static f32 getFn800B1F10() {
return sInstance->fn_800B1F10();
}
inline static f32 getFn800B1FF0() {
if (sInstance != nullptr) {
return sInstance->fn_800B1FF0();
}
return 0.0f;
}
inline static f32 getFn800B2000() {
if (sInstance != nullptr) {
return sInstance->fn_800B2000();
}
return 0.0f;
}
inline static f32 getFn800B2010() {
if (sInstance != nullptr) {
return sInstance->fn_800B2010();
}
return 0.0f;
}
inline static f32 getFn800B2020() {
if (sInstance != nullptr) {
return sInstance->fn_800B2020();
}
return 0.0f;
}
inline static f32 getFn800B2030() {
if (sInstance != nullptr) {
return sInstance->fn_800B2030();
}
return 0.0f;
}
inline static f32 getFn800B2040() {
if (sInstance != nullptr) {
return sInstance->fn_800B2040();
}
return 0.0f;
}
private:
static UnkTextThing *sInstance;
+2
View File
@@ -286,6 +286,8 @@ struct AnmGroup_c : public AnmGroupBase_c {
/* 0x28 */ m2d::FrameCtrl_c mFrameCtrl;
};
void pushToEnd(nw4r::lyt::Pane *);
// This abstraction is apparently only ever used in CsGame
class AnmGroups {
public:
+8 -19
View File
@@ -3,8 +3,7 @@
#include "d/lyt/d2d.h"
#include "nw4r/lyt/lyt_textBox.h"
extern "C" void *lbl_805753B0;
#include "nw4r/lyt/lyt_types.h"
class dTextBox_c : public nw4r::lyt::TextBox {
friend class dWindow_c;
@@ -18,13 +17,13 @@ public:
mpLytBase = lytBase;
}
void SetScale(float scale) {
nw4r::math::VEC2 value = GetScale();
value.x = GetScale().x * scale;
value.y = GetScale().y * scale;
void SetScale(f32 scale) {
nw4r::lyt::Size value(mTextScale);
value.width *= scale;
value.height *= scale;
mScale = scale;
MySetScale(value);
nw4r::lyt::TextBox::SetScale(value);
nw4r::lyt::TextBox::SetFontSize(value);
}
void set0x1F8(u8 val) {
@@ -35,28 +34,18 @@ public:
return mScale;
}
static inline f32 GetTranslateX1() {
if (lbl_805753B0 != nullptr) {
return GetTranslateX1_();
} else {
return 0.0f;
}
}
void fn_800E0A60(const char *area, ...) {
// TODO
}
static f32 GetTranslateX1_();
// @bug: This does not implement UT's RTTI, so casts to dTextBox_c will
// succeed even if all you have is a lyt::TextBox
private:
void MySetScale(const nw4r::math::VEC2 &value);
void MySetScale(const nw4r::lyt::Size &value);
/* 0x104 */ d2d::LytBase_c *mpLytBase;
/* 0x108 */ u8 field_0x108[0x118 - 0x108];
/* 0x118 */ nw4r::math::VEC2 mTextScale;
/* 0x118 */ nw4r::lyt::Size mTextScale;
/* 0x120 */ f32 mScale;
/* 0x124 */ u8 field_0x124[0x1F8 - 0x124];
/* 0x1F8 */ u8 field_0x1F8;
+18 -14
View File
@@ -44,23 +44,27 @@ struct SizedString {
void operator+=(const char *src) {
if (src != nullptr) {
size_t destLen = strlen(mChars);
size_t copyLen = strlen(src);
// Make sure copy length isnt more than destination length
if (destLen + copyLen + 1 >= Size) {
size_t tmpLen = Size - destLen;
copyLen = tmpLen - 1;
}
strncpy(mChars + destLen, src, copyLen);
// make sure string is null terminated
size_t offset = destLen + copyLen;
mChars[offset] = '\0';
append(src);
}
}
void append(const char *src) {
size_t destLen = strlen(mChars);
size_t copyLen = strlen(src);
// Make sure copy length isnt more than destination length
if (destLen + copyLen + 1 >= Size) {
size_t tmpLen = Size - destLen;
copyLen = tmpLen - 1;
}
strncpy(mChars + destLen, src, copyLen);
// make sure string is null terminated
size_t offset = destLen + copyLen;
mChars[offset] = '\0';
}
bool operator==(const char *other) const {
return strequals(mChars, other);
}