mirror of
https://github.com/zeldaret/ss
synced 2026-07-09 14:15:23 -04:00
Link d2d (#145)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user