mirror of
https://github.com/zeldaret/tp
synced 2026-05-23 06:54:28 -04:00
c161523338
* Jut cleanup work * data section fix * match the last of JUtility * added more helpful comment * Add missed null terminator * do while -> while loop * replace more do whiles * Fix wii regression * Add suggestions * fix null check --------- Co-authored-by: roeming <roeming@users.noreply.github.com>
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
|
|
|
#include "JSystem/JUtility/JUTPalette.h"
|
|
#include <dolphin/gx.h>
|
|
#include <dolphin/os.h>
|
|
|
|
void JUTPalette::storeTLUT(GXTlut param_0, ResTLUT* tlut) {
|
|
if (tlut == NULL) {
|
|
OSPanic("JUTPalette.cpp", 35, "JUTTexture: TLUT is NULL\n");
|
|
}
|
|
mTlutName = param_0;
|
|
mFormat = (const u8)tlut->format;
|
|
mTransparency = (const u8)tlut->transparency;
|
|
mNumColors = tlut->numColors;
|
|
mColorTable = tlut + 8;
|
|
GXInitTlutObj(&mTlutObj, (void*)mColorTable, (GXTlutFmt)mFormat, mNumColors);
|
|
}
|
|
|
|
void JUTPalette::storeTLUT(GXTlut param_0, GXTlutFmt param_1, JUTTransparency param_2,
|
|
u16 param_3, void* param_4) {
|
|
mTlutName = param_0;
|
|
mFormat = param_1;
|
|
mTransparency = param_2;
|
|
mNumColors = param_3;
|
|
mColorTable = (ResTLUT*)param_4;
|
|
GXInitTlutObj(&mTlutObj, (void*)mColorTable, (GXTlutFmt)mFormat, mNumColors);
|
|
}
|
|
|
|
bool JUTPalette::load() {
|
|
bool check = mNumColors != 0;
|
|
if (check) {
|
|
GXLoadTlut(&mTlutObj, mTlutName);
|
|
}
|
|
|
|
return check;
|
|
}
|