Compare commits
1 Commits
main
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aa6ce4a75 |
@@ -1,21 +1,6 @@
|
||||
#include <nw4r/db/assert.h>
|
||||
|
||||
extern "C" const u8 lbl_81695550 = 255;
|
||||
extern "C" const u8 lbl_81695551 = 255;
|
||||
extern "C" const u8 lbl_81695552 = 255;
|
||||
extern "C" const u8 lbl_81695553 = 0;
|
||||
extern "C" char lbl_816719DC[] = "Error#004\nAn error has occurred.\nThe system files are corrupted.";
|
||||
|
||||
#undef NW4R_ASSERT
|
||||
#define NW4R_ASSERT(x) \
|
||||
{ \
|
||||
if (!(x)) { \
|
||||
GXColor front = {*((volatile const u8*)&::lbl_81695550), *((volatile const u8*)&::lbl_81695551), \
|
||||
*((volatile const u8*)&::lbl_81695552), *((volatile const u8*)&::lbl_81695553)}; \
|
||||
GXColor back = {0, 0, 0, 0}; \
|
||||
OSFatal((GXColor)front, (GXColor)back, ::lbl_816719DC); \
|
||||
} \
|
||||
}
|
||||
extern "C" extern char lbl_816719DC[];
|
||||
|
||||
#include <nw4r/lyt/window.h>
|
||||
|
||||
@@ -29,6 +14,22 @@ extern "C" char lbl_816719DC[] = "Error#004\nAn error has occurred.\nThe system
|
||||
|
||||
#include <new>
|
||||
|
||||
#undef NW4R_ASSERT
|
||||
#define NW4R_ASSERT(x) \
|
||||
{ \
|
||||
if (!(x)) { \
|
||||
static const u8 front_0 = 255; \
|
||||
static const u8 front_1 = 255; \
|
||||
static const u8 front_2 = 255; \
|
||||
static const u8 front_3 = 0; \
|
||||
GXColor front = {*((volatile const u8*)&front_0), *((volatile const u8*)&front_1), \
|
||||
*((volatile const u8*)&front_2), *((volatile const u8*)&front_3)}; \
|
||||
GXColor back = {0, 0, 0, 0}; \
|
||||
OSFatal((GXColor)front, (GXColor)back, ::lbl_816719DC); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
namespace nw4r {
|
||||
namespace lyt {
|
||||
NW4R_UT_GET_DERIVED_RUNTIME_TYPEINFO(Window, Pane);
|
||||
@@ -44,8 +45,18 @@ namespace {
|
||||
u8 idx[FLIPINDEX_MAX]; // 0x08
|
||||
} TextureFlipInfo;
|
||||
|
||||
extern "C" const u8 lbl_81695530 = 255;
|
||||
extern "C" const u8 lbl_81695531 = 255;
|
||||
extern "C" const u8 lbl_81695532 = 255;
|
||||
extern "C" const u8 lbl_81695533 = 0;
|
||||
|
||||
TextureFlipInfo& GetTexutreFlipInfo(u8 textureFlip) {
|
||||
NW4R_ASSERT(textureFlip < TEXTUREFLIP_MAX);
|
||||
if (!(textureFlip < TEXTUREFLIP_MAX)) {
|
||||
GXColor front = {*((volatile const u8*)&::lbl_81695530), *((volatile const u8*)&::lbl_81695531),
|
||||
*((volatile const u8*)&::lbl_81695532), *((volatile const u8*)&::lbl_81695533)};
|
||||
GXColor back = {0, 0, 0, 0};
|
||||
OSFatal((GXColor)front, (GXColor)back, ::lbl_816719DC);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
static TextureFlipInfo flipInfos[] = { // 0 1 2 3
|
||||
@@ -165,7 +176,10 @@ namespace {
|
||||
flipInfo.coords[VERTEXCOLOR_RB][iy] +
|
||||
polSize.height / ((flipInfo.coords[VERTEXCOLOR_RT][iy] - flipInfo.coords[VERTEXCOLOR_RB][iy]) * tSz[iy]);
|
||||
}
|
||||
} // namespace
|
||||
}
|
||||
|
||||
extern "C" char lbl_816719DC[] = "Error#004\nAn error has occurred.\nThe system files are corrupted.";
|
||||
// namespace
|
||||
|
||||
namespace nw4r {
|
||||
namespace lyt {
|
||||
@@ -285,13 +299,33 @@ namespace nw4r {
|
||||
Pane::SetAnimationEnable(animTrans, bEnable, bRecursive);
|
||||
}
|
||||
|
||||
extern "C" const u8 lbl_81695534 = 255;
|
||||
extern "C" const u8 lbl_81695535 = 255;
|
||||
extern "C" const u8 lbl_81695536 = 255;
|
||||
extern "C" const u8 lbl_81695537 = 0;
|
||||
|
||||
ut::Color Window::GetVtxColor(u32 idx) const {
|
||||
NW4R_ASSERT(idx < VERTEXCOLOR_MAX);
|
||||
if (!(idx < VERTEXCOLOR_MAX)) {
|
||||
GXColor front = {*((volatile const u8*)&::lbl_81695534), *((volatile const u8*)&::lbl_81695535),
|
||||
*((volatile const u8*)&::lbl_81695536), *((volatile const u8*)&::lbl_81695537)};
|
||||
GXColor back = {0, 0, 0, 0};
|
||||
OSFatal((GXColor)front, (GXColor)back, ::lbl_816719DC);
|
||||
}
|
||||
return mContent.vtxColors[idx];
|
||||
}
|
||||
|
||||
extern "C" const u8 lbl_81695538 = 255;
|
||||
extern "C" const u8 lbl_81695539 = 255;
|
||||
extern "C" const u8 lbl_8169553A = 255;
|
||||
extern "C" const u8 lbl_8169553B = 0;
|
||||
|
||||
void Window::SetVtxColor(u32 idx, ut::Color value) {
|
||||
NW4R_ASSERT(idx < VERTEXCOLOR_MAX);
|
||||
if (!(idx < VERTEXCOLOR_MAX)) {
|
||||
GXColor front = {*((volatile const u8*)&::lbl_81695538), *((volatile const u8*)&::lbl_81695539),
|
||||
*((volatile const u8*)&::lbl_8169553A), *((volatile const u8*)&::lbl_8169553B)};
|
||||
GXColor back = {0, 0, 0, 0};
|
||||
OSFatal((GXColor)front, (GXColor)back, ::lbl_816719DC);
|
||||
}
|
||||
mContent.vtxColors[idx] = value;
|
||||
}
|
||||
|
||||
@@ -487,8 +521,22 @@ namespace nw4r {
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" const u8 lbl_81695550 = 255;
|
||||
extern "C" const u8 lbl_81695551 = 255;
|
||||
extern "C" const u8 lbl_81695552 = 255;
|
||||
extern "C" const u8 lbl_81695553 = 0;
|
||||
extern "C" const u8 lbl_81695554 = 0;
|
||||
extern "C" const u8 lbl_81695555 = 0;
|
||||
extern "C" const u8 lbl_81695556 = 0;
|
||||
extern "C" const u8 lbl_81695557 = 0;
|
||||
|
||||
Material* Window::GetFrameMaterial(u32 frameIdx) const {
|
||||
NW4R_ASSERT(frameIdx < WINDOWFRAME_MAX);
|
||||
if (!(frameIdx < WINDOWFRAME_MAX)) {
|
||||
GXColor front = {*((volatile const u8*)&::lbl_81695550), *((volatile const u8*)&::lbl_81695551),
|
||||
*((volatile const u8*)&::lbl_81695552), *((volatile const u8*)&::lbl_81695553)};
|
||||
GXColor back = {0, 0, 0, 0};
|
||||
OSFatal((GXColor)front, (GXColor)back, ::lbl_816719DC);
|
||||
}
|
||||
if (frameIdx >= mFrameNum) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -356,31 +356,30 @@ namespace nw4r {
|
||||
|
||||
// u32 fontSizeToEndOfGlgr;
|
||||
|
||||
u16 countSheet;
|
||||
u16 countName, countSheet, count0A, count0C;
|
||||
u16 sheetGlyphCount, dataBlockCount;
|
||||
|
||||
u32 stepSheetFlags;
|
||||
u32 flagsSheetsOff;
|
||||
const u32* flagsSheets;
|
||||
|
||||
u32 sheetOffsetsSize;
|
||||
u16* sheetOffsetsScratch;
|
||||
u32 sheetOffsetsScratchSize;
|
||||
|
||||
u32 sheetOffsetsScratchSize;
|
||||
|
||||
dataBlockCount = font->hdr.dataBlocks; // 0x0E
|
||||
sheetGlyphCount = font->glgr.inner.sheetGlyphCount; // 0x1C
|
||||
// countName = font->glgr.inner.nameCount;
|
||||
countName = font->glgr.inner.nameCount;
|
||||
countSheet = font->glgr.inner.sheetCount;
|
||||
// count0A = font->glgr.inner.smthCount_0x0a;
|
||||
// count0C = font->glgr.inner.smthCount_0x0c;
|
||||
sheetOffsetsSize = ROUNDUP(countSheet * sizeof(u16), 4);
|
||||
sheetOffsetsScratch = (u16*)ROUNDDOWN((u32)((u8*)font + ctx->remWorkSpace()) - sheetOffsetsSize, 2);
|
||||
count0A = font->glgr.inner.smthCount_0x0a;
|
||||
sheetGlyphCount = font->glgr.inner.sheetGlyphCount; // 0x1C
|
||||
count0C = font->glgr.inner.smthCount_0x0c;
|
||||
dataBlockCount = font->hdr.dataBlocks; // 0x0E
|
||||
|
||||
flagsSheets =
|
||||
(const u32*)font + (detail::CalcOffsetSheetFlags(countName, countSheet, count0A, count0C) >> 2);
|
||||
sheetOffsetsSize = detail::CalcSizeSheetOffsets(countSheet);
|
||||
sheetOffsetsScratch =
|
||||
(u16*)ROUNDDOWN((u32)((u8*)font + ctx->remWorkSpace()) - sheetOffsetsSize, 2);
|
||||
|
||||
stepSheetFlags = detail::CalcSizeFlagSet(countSheet);
|
||||
flagsSheetsOff = detail::CalcOffsetSheetFlags(font->glgr.inner.nameCount, countSheet, font->glgr.inner.smthCount_0x0a,
|
||||
font->glgr.inner.smthCount_0x0c);
|
||||
flagsSheets = (const u32*)font + (flagsSheetsOff >> 2);
|
||||
|
||||
pGlgr = &font->glgr;
|
||||
ENSURE_WORK_HAS_SIZE(ctx, glgrEnd - (u8*)font + sheetOffsetsSize);
|
||||
|
||||
Reference in New Issue
Block a user