mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-29 16:14:54 -04:00
4df8ccc871
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}
* Update configure.py and project.py for new libs structure
* Refactor `#include <dolphin/x.h>` -> `<x.h>`
* Remove `__REVOLUTION_SDK__` forwards from dolphin
* Fix dolphin/ references in revolution
* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`
* Always build TRK against dolphin headers
* Resolve revolution SDK header resolution issues
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
/**
|
|
* JUTFont.cpp
|
|
* JUtility - Font Management
|
|
*/
|
|
|
|
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
|
|
|
#include "JSystem/JUtility/JUTFont.h"
|
|
|
|
JUTFont::JUTFont() : mColor1(), mColor2(), mColor3(), mColor4() {
|
|
mValid = false;
|
|
}
|
|
|
|
void JUTFont::initialize_state() {
|
|
setCharColor(-1);
|
|
setFixedWidth(false, 0);
|
|
mValid = false;
|
|
}
|
|
|
|
void JUTFont::setCharColor(JUtility::TColor col1) {
|
|
mColor1 = col1;
|
|
mColor2 = col1;
|
|
mColor3 = col1;
|
|
mColor4 = col1;
|
|
}
|
|
|
|
void JUTFont::setGradColor(JUtility::TColor col1, JUtility::TColor col2) {
|
|
mColor1 = col1;
|
|
mColor2 = col1;
|
|
mColor3 = col2;
|
|
mColor4 = col2;
|
|
}
|
|
|
|
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) {
|
|
s32 b = (u8)*str;
|
|
if (isLeadByte(b)) {
|
|
JUT_ASSERT(114, usz >= 2);
|
|
usz--;
|
|
str++;
|
|
b <<= 8;
|
|
b |= (u8)*str;
|
|
}
|
|
|
|
a1 += drawChar_scale(a1, a2, a3, a4, b, a7);
|
|
a7 = 1;
|
|
}
|
|
|
|
return a1 - temp;
|
|
}
|