mirror of
https://github.com/zeldaret/tp
synced 2026-07-09 14:55:32 -04:00
Refactor JUTFont symbols (#71)
* fix JUTFont args * fix Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
@@ -1,39 +1,53 @@
|
||||
#include "JSystem/JUtility/JUTFont/JUTFont.h"
|
||||
|
||||
#ifdef NONMATCHING
|
||||
JUTFont::JUTFont() {
|
||||
mColor1 = TColor();
|
||||
mColor2 = TColor();
|
||||
mColor3 = TColor();
|
||||
mColor4 = TColor();
|
||||
unk4 = false;
|
||||
JUTFont::JUTFont() : mColor1(), mColor2(), mColor3(), mColor4() {
|
||||
unk4 = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void JUTFont::initialize_state() {
|
||||
setCharColor(TColor());
|
||||
setCharColor(JUtility::TColor());
|
||||
unk5 = false;
|
||||
unk8 = 0;
|
||||
unk4 = false;
|
||||
}
|
||||
|
||||
void JUTFont::setCharColor(TColor col1) {
|
||||
void JUTFont::setCharColor(JUtility::TColor col1) {
|
||||
mColor1 = col1;
|
||||
mColor2 = col1;
|
||||
mColor3 = col1;
|
||||
mColor4 = col1;
|
||||
}
|
||||
|
||||
void JUTFont::setGradColor(TColor col1, TColor col2) {
|
||||
void JUTFont::setGradColor(JUtility::TColor col1, JUtility::TColor col2) {
|
||||
mColor1 = col1;
|
||||
mColor2 = col1;
|
||||
mColor3 = col2;
|
||||
mColor4 = col2;
|
||||
}
|
||||
|
||||
asm float JUTFont::drawString_size_scale(float a1, float a2, float a3, float a4, char* a5,
|
||||
unsigned long usz, bool a7) {
|
||||
nofralloc
|
||||
#ifdef NONMATCHING // regalloc
|
||||
f32 JUTFont::drawString_size_scale(f32 a1, f32 a2, f32 a3, f32 a4, const char* str, u32 usz,
|
||||
bool a7) {
|
||||
f32 temp = a1;
|
||||
|
||||
for (; usz > 0; usz--, str++) {
|
||||
u32 b = *(u8*)str;
|
||||
if (isLeadByte(b)) {
|
||||
str++;
|
||||
b = (b << 8 | *(u8*)str);
|
||||
usz--;
|
||||
}
|
||||
|
||||
a1 += drawChar_scale(temp, a2, a3, a4, b, a7);
|
||||
a7 = 1;
|
||||
}
|
||||
|
||||
return a1 - temp;
|
||||
}
|
||||
#else
|
||||
asm f32 JUTFont::drawString_size_scale(f32 a1, f32 a2, f32 a3, f32 a4, const char* a5, u32 usz,
|
||||
bool a7) {
|
||||
nofralloc
|
||||
#include "JSystem/JUtility/JUTFont/asm/drawString_size_scale.s"
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user