Files
tp/libs/JSystem/JUtility/JUTFont.cpp
T

54 lines
1.2 KiB
C++
Raw Normal View History

2020-12-03 17:58:53 -08:00
#include "JSystem/JUtility/JUTFont/JUTFont.h"
2021-01-06 17:36:27 -08:00
JUTFont::JUTFont() : mColor1(), mColor2(), mColor3(), mColor4() {
unk4 = 0;
2020-12-03 17:58:53 -08:00
}
2020-12-26 11:31:49 -05:00
void JUTFont::initialize_state() {
2021-01-06 17:36:27 -08:00
setCharColor(JUtility::TColor());
2020-12-03 17:58:53 -08:00
unk5 = false;
unk8 = 0;
unk4 = false;
}
2021-01-06 17:36:27 -08:00
void JUTFont::setCharColor(JUtility::TColor col1) {
2020-12-03 17:58:53 -08:00
mColor1 = col1;
mColor2 = col1;
mColor3 = col1;
mColor4 = col1;
}
2021-01-06 17:36:27 -08:00
void JUTFont::setGradColor(JUtility::TColor col1, JUtility::TColor col2) {
2020-12-03 17:58:53 -08:00
mColor1 = col1;
mColor2 = col1;
mColor3 = col2;
mColor4 = col2;
}
2021-01-06 17:36:27 -08:00
#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;
2020-12-03 17:58:53 -08:00
2021-01-06 17:36:27 -08:00
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
2020-12-03 17:58:53 -08:00
#include "JSystem/JUtility/JUTFont/asm/drawString_size_scale.s"
2021-01-06 17:36:27 -08:00
}
#endif