mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-09 10:54:06 -04:00
Reorganize library code into libs/ (#3119)
* 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
This commit is contained in:
@@ -0,0 +1,166 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWExtSystem.h"
|
||||
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
|
||||
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include <algorithm>
|
||||
|
||||
JGadget::TList<JAWWindow*> JAWExtSystem::sPage[128];
|
||||
JAWExtSystem::TSystemInterface JAWExtSystem::sInterface;
|
||||
s32 JAWExtSystem::sCurrentPage = ARRAY_SIZE(sPage) - 1;
|
||||
u8 JAWExtSystem::lbl_80748E44;
|
||||
|
||||
BOOL JAWExtSystem::registWindow(u32 param_1, JAWWindow* param_2, int param_3, int param_4) {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (param_1 >= ARRAY_SIZE(sPage)) {
|
||||
return FALSE;
|
||||
}
|
||||
param_2->move(param_3, param_4);
|
||||
sPage[param_1].push_back(param_2);
|
||||
if (sCurrentPage > param_1) {
|
||||
sCurrentPage = param_1;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JAWExtSystem::destroyWindow(u32 param_1, JAWWindow* param_2) {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (param_1 >= ARRAY_SIZE(sPage)) {
|
||||
return FALSE;
|
||||
}
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[param_1];
|
||||
JGadget::TList<JAWWindow*>::iterator it = std::find(page->begin(), page->end(), param_2);
|
||||
if (it == page->end()) {
|
||||
return FALSE;
|
||||
}
|
||||
page->erase(it);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void JAWExtSystem::nextPage() {
|
||||
int page = sCurrentPage;
|
||||
do {
|
||||
sCurrentPage++;
|
||||
if (sCurrentPage >= ARRAY_SIZE(sPage)) {
|
||||
sCurrentPage = 0;
|
||||
}
|
||||
if (page == sCurrentPage) {
|
||||
break;
|
||||
}
|
||||
} while (sPage[sCurrentPage].empty());
|
||||
}
|
||||
|
||||
void JAWExtSystem::prevPage() {
|
||||
int page = sCurrentPage;
|
||||
do {
|
||||
sCurrentPage--;
|
||||
if (sCurrentPage < 0) {
|
||||
sCurrentPage = ARRAY_SIZE(sPage) - 1;
|
||||
}
|
||||
if (page == sCurrentPage) {
|
||||
break;
|
||||
}
|
||||
} while (sPage[sCurrentPage].empty());
|
||||
}
|
||||
|
||||
void JAWExtSystem::nextWindow() {
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TList<JAWWindow*>::iterator begin = page->begin();
|
||||
if (begin == page->end()) {
|
||||
return;
|
||||
}
|
||||
JAWWindow* window = *begin;
|
||||
page->erase(begin);
|
||||
page->push_back(window);
|
||||
}
|
||||
|
||||
void JAWExtSystem::prevWindow() {
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TList<JAWWindow*>::iterator end = page->end();
|
||||
end--;
|
||||
if (end == page->end()) {
|
||||
return;
|
||||
}
|
||||
JAWWindow* window = *end;
|
||||
page->erase(end);
|
||||
page->push_front(window);
|
||||
}
|
||||
|
||||
void JAWExtSystem::draw() {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (!JAWGraphContext::lbl_8074CD30) {
|
||||
return;
|
||||
}
|
||||
J2DOrthoGraph ortho(0.0f, 0.0f, 640.0f, 480.0f, -1.0f, 1.0f);
|
||||
ortho.setOrtho(0.0f, -20.0f, 640.0f, 520.0f, -1.0, 1.0f);
|
||||
ortho.setPort();
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TIterator_reverse<JGadget::TList<JAWWindow*>::iterator> it;
|
||||
for (it = page->rbegin(); it != page->rend(); it++) {
|
||||
JAWWindow** window = &*it;
|
||||
(*window)->initIf();
|
||||
(*window)->setAlpha(lbl_80748E44);
|
||||
(*window)->draw(0, 0, &ortho);
|
||||
}
|
||||
for (int i = 0; i < ARRAY_SIZE(sPage); i++) {
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[i];
|
||||
JGadget::TIterator_reverse<JGadget::TList<JAWWindow*>::iterator> it;
|
||||
for (it = page->rbegin(); it != page->rend(); it++) {
|
||||
JAWWindow** window = &*it;
|
||||
(*window)->frameWork();
|
||||
}
|
||||
}
|
||||
GXSetScissor(0, 0, 640, 480);
|
||||
}
|
||||
|
||||
void JAWExtSystem::padProc(const JUTGamePad& pad) {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (pad.getAnalogR() && pad.testTrigger(PAD_BUTTON_MENU)) {
|
||||
JAWGraphContext::lbl_8074CD30 ^= true;
|
||||
}
|
||||
if (!JAWGraphContext::lbl_8074CD30) {
|
||||
return;
|
||||
}
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TList<JAWWindow*>::iterator begin = page->begin();
|
||||
if (begin == page->end()) {
|
||||
return;
|
||||
}
|
||||
JAWWindow* window = *begin;
|
||||
if (pad.getAnalogR()) {
|
||||
f32 f31 = pad.getAnalogL() * 0.1f + 8.0f;
|
||||
int r25 = f31 * pad.getMainStickX();
|
||||
int r28 = -int(f31 * pad.getMainStickY());
|
||||
if (pad.testButton(PAD_BUTTON_X)) {
|
||||
window->addSize(r25, r28);
|
||||
} else if (pad.testButton(PAD_BUTTON_B)) {
|
||||
int r29 = lbl_80748E44;
|
||||
r29 += (r28 > 0 ? -2 : r28 < 0 ? 2 : 0) * (pad.getAnalogL() ? 2 : 1);
|
||||
if (r29 < 0) {
|
||||
r29 = 0;
|
||||
}
|
||||
if (r29 >= 256) {
|
||||
r29 = 255;
|
||||
}
|
||||
lbl_80748E44 = r29;
|
||||
} else {
|
||||
window->addPosition(r25, r28);
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_RIGHT)) {
|
||||
nextPage();
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_LEFT)) {
|
||||
prevPage();
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_UP)) {
|
||||
prevWindow();
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_DOWN)) {
|
||||
nextWindow();
|
||||
}
|
||||
} else {
|
||||
window->padProc(pad);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
|
||||
#include "JSystem/J2DGraph/J2DPrint.h"
|
||||
#include "JSystem/JUtility/JUTResFont.h"
|
||||
|
||||
JUTResFont* JAWGraphContext::sFont;
|
||||
bool JAWGraphContext::lbl_8074CD30;
|
||||
|
||||
JAWGraphContext::JAWGraphContext() :
|
||||
field_0x0(NULL),
|
||||
field_0x4(255, 255, 255, 255),
|
||||
field_0x8(255, 255, 255, 255),
|
||||
field_0xc(255, 255, 255, 255),
|
||||
field_0x10(255, 255, 255, 255) {
|
||||
mParentAlpha = 255;
|
||||
field_0x15 = 6;
|
||||
field_0x16 = 6;
|
||||
field_0x18 = 0;
|
||||
if (!sFont) {
|
||||
sFont = new JUTResFont((ResFONT*)JUTResFONT_Ascfont_fix12, NULL);
|
||||
}
|
||||
field_0x0 = new J2DPrint(sFont, JUtility::TColor(255, 255, 255, 255), JUtility::TColor(255, 255, 255, 255));
|
||||
field_0x0->initiate();
|
||||
locate(0, 0);
|
||||
}
|
||||
|
||||
JAWGraphContext::~JAWGraphContext() {}
|
||||
|
||||
void JAWGraphContext::reset() {
|
||||
locate(0, 0);
|
||||
color(255, 255, 255, 255);
|
||||
setGXforPrint();
|
||||
}
|
||||
|
||||
void JAWGraphContext::color(u8 r, u8 g, u8 b, u8 a) {
|
||||
color(JUtility::TColor(r, g, b, a));
|
||||
}
|
||||
|
||||
void JAWGraphContext::color(const JUtility::TColor& c) {
|
||||
color(c, c, c, c);
|
||||
}
|
||||
|
||||
void JAWGraphContext::locate(int param_1, int param_2) {
|
||||
field_0x0->locate(param_1 * field_0x0->getFont()->getWidth(), (param_2 + 1) * field_0x0->getFont()->getHeight());
|
||||
}
|
||||
|
||||
void JAWGraphContext::print(char const* msg, ...) {
|
||||
va_list args;
|
||||
if (field_0x0->getCursorV() > 640.0f) {
|
||||
return;
|
||||
}
|
||||
if (field_0x18) {
|
||||
setGXforPrint();
|
||||
}
|
||||
va_start(args, msg);
|
||||
u8 alpha = field_0x4.a * mParentAlpha / 255;
|
||||
field_0x0->print_va(alpha, msg, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void JAWGraphContext::print(int param_1, int param_2, const char* msg, ...) {
|
||||
va_list args;
|
||||
locate(param_1, param_2);
|
||||
if (field_0x0->getCursorV() > 640.0f) {
|
||||
return;
|
||||
}
|
||||
if (field_0x18) {
|
||||
setGXforPrint();
|
||||
}
|
||||
va_start(args, msg);
|
||||
u8 alpha = field_0x4.a * mParentAlpha / 255;
|
||||
field_0x0->print_va(alpha, msg, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void JAWGraphContext::color(const JUtility::TColor& param_1, const JUtility::TColor& param_2, const JUtility::TColor& param_3, const JUtility::TColor& param_4) {
|
||||
field_0x4 = param_1;
|
||||
field_0x8 = param_2;
|
||||
field_0xc = param_3;
|
||||
field_0x10 = param_4;
|
||||
field_0x0->setCharColor(param_1);
|
||||
field_0x0->setGradColor(param_2);
|
||||
}
|
||||
|
||||
void JAWGraphContext::fillBox(const JGeometry::TBox2<f32>& box) {
|
||||
if (field_0x18 != 1) {
|
||||
setGXforDraw();
|
||||
}
|
||||
JUtility::TColor color0(field_0x4);
|
||||
JUtility::TColor color1(field_0x8);
|
||||
JUtility::TColor color2(field_0xc);
|
||||
JUtility::TColor color3(field_0x10);
|
||||
if (mParentAlpha != 255) {
|
||||
color0.a = field_0x4.a * mParentAlpha / 255;
|
||||
color1.a = field_0x8.a * mParentAlpha / 255;
|
||||
color2.a = field_0xc.a * mParentAlpha / 255;
|
||||
color3.a = field_0x10.a * mParentAlpha / 255;
|
||||
}
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3s16(box.i.x, box.i.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXPosition3s16(box.f.x, box.i.y, 0);
|
||||
GXColor1u32(color2);
|
||||
GXPosition3s16(box.f.x, box.f.y, 0);
|
||||
GXColor1u32(color3);
|
||||
GXPosition3s16(box.i.x, box.f.y, 0);
|
||||
GXColor1u32(color1);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
void JAWGraphContext::drawFrame(const JGeometry::TBox2<f32>& box) {
|
||||
if (field_0x18 != 1) {
|
||||
setGXforDraw();
|
||||
}
|
||||
JUtility::TColor color0(field_0x4);
|
||||
JUtility::TColor color1(field_0x8);
|
||||
JUtility::TColor color2(field_0xc);
|
||||
JUtility::TColor color3(field_0x10);
|
||||
if (mParentAlpha != 255) {
|
||||
color0.a = field_0x4.a * mParentAlpha / 255;
|
||||
color1.a = field_0x8.a * mParentAlpha / 255;
|
||||
color2.a = field_0xc.a * mParentAlpha / 255;
|
||||
color3.a = field_0x10.a * mParentAlpha / 255;
|
||||
}
|
||||
GXBegin(GX_LINESTRIP, GX_VTXFMT0, 5);
|
||||
GXPosition3s16(box.i.x, box.i.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXPosition3s16(box.f.x, box.i.y, 0);
|
||||
GXColor1u32(color2);
|
||||
GXPosition3s16(box.f.x, box.f.y, 0);
|
||||
GXColor1u32(color3);
|
||||
GXPosition3s16(box.i.x, box.f.y, 0);
|
||||
GXColor1u32(color1);
|
||||
GXPosition3s16(box.i.x, box.i.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
void JAWGraphContext::line(const JGeometry::TVec2<f32>& p1, const JGeometry::TVec2<f32>& p2) {
|
||||
if (field_0x18 != 1) {
|
||||
setGXforDraw();
|
||||
}
|
||||
JUtility::TColor color0(field_0x4);
|
||||
JUtility::TColor color1(field_0x8);
|
||||
if (mParentAlpha != 255) {
|
||||
color0.a = field_0x4.a * mParentAlpha / 255;
|
||||
color1.a = field_0x8.a * mParentAlpha / 255;
|
||||
}
|
||||
GXBegin(GX_LINES, GX_VTXFMT0, 2);
|
||||
GXPosition3s16(p1.x, p1.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXPosition3s16(p2.x, p2.y, 0);
|
||||
GXColor1u32(color1);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
void JAWGraphContext::setGXforPrint() {
|
||||
GXSetNumChans(1);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
|
||||
GXSetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_RGBX8, 15);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
field_0x18 = 0;
|
||||
}
|
||||
|
||||
void JAWGraphContext::setGXforDraw() {
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||
GXSetNumChans(1);
|
||||
GXSetNumTexGens(0);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
|
||||
GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, 0, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0);
|
||||
GXSetPointSize(field_0x15, GX_TO_ZERO);
|
||||
GXSetLineWidth(field_0x16, GX_TO_ZERO);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
field_0x18 = 1;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWSystem.h"
|
||||
|
||||
JAWSystemInterface* JAWSystemInterface::sInstance;
|
||||
|
||||
JAWSystemInterface::JAWSystemInterface() {
|
||||
mHeap = NULL;
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
JKRHeap* JAWSystemInterface::getCurrentHeap() const {
|
||||
if (mHeap) {
|
||||
return mHeap;
|
||||
}
|
||||
return JKRGetCurrentHeap();
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "JSystem/JUtility/JUTResFont.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
JAWWindow::JAWWindow(const char* param_1, int param_2, int param_3) :
|
||||
field_0x38('WIN1', JGeometry::TBox2<f32>(0.0f, 0.0f, param_2, param_3), "frame_lu.bti"),
|
||||
field_0x180('TITL', JGeometry::TBox2<f32>(10.0f, 10.0f, 640.0f, 170.0f), (const ResFONT*)JUTResFONT_Ascfont_fix16, param_1, -1, HBIND_LEFT, VBIND_TOP),
|
||||
field_0x2b0(this),
|
||||
field_0x3d8(JUtility::TColor(0, 0, 0, 255)),
|
||||
field_0x3dc(JUtility::TColor(0, 0, 0, 255)),
|
||||
field_0x3e0(JUtility::TColor(0, 0, 0, 255)),
|
||||
field_0x3e4(JUtility::TColor(0, 0, 0, 255)) {
|
||||
field_0x3e8 = 0;
|
||||
field_0x3ec = 0;
|
||||
field_0x38.setContentsColor(field_0x3d8, field_0x3e0, field_0x3dc, field_0x3e4);
|
||||
field_0x180.setCharColor(JUtility::TColor(0, 255, 0, 255));
|
||||
field_0x180.setGradColor(JUtility::TColor(255, 255, 255, 255));
|
||||
field_0x38.appendChild(&field_0x180);
|
||||
field_0x38.appendChild(&field_0x2b0);
|
||||
}
|
||||
|
||||
JAWWindow::~JAWWindow() {}
|
||||
|
||||
BOOL JAWWindow::initIf() {
|
||||
if (field_0x3ec) {
|
||||
return TRUE;
|
||||
} else {
|
||||
field_0x3ec = TRUE;
|
||||
return onInit();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL JAWWindow::onInit() { return TRUE; }
|
||||
|
||||
void JAWWindow::setTitleColor(const JUtility::TColor& param_1, const JUtility::TColor& param_2) {
|
||||
field_0x180.setCharColor(param_1);
|
||||
field_0x180.setGradColor(param_2);
|
||||
}
|
||||
|
||||
void JAWWindow::setWindowColor(const JUtility::TColor& param_1, const JUtility::TColor& param_2, const JUtility::TColor& param_3, const JUtility::TColor& param_4) {
|
||||
field_0x3d8 = param_1;
|
||||
field_0x3dc = param_2;
|
||||
field_0x3e0 = param_3;
|
||||
field_0x3e4 = param_4;
|
||||
field_0x38.setContentsColor(field_0x3d8, field_0x3e0, field_0x3dc, field_0x3e4);
|
||||
}
|
||||
|
||||
void JAWWindow::onDraw(JAWGraphContext*) {}
|
||||
|
||||
void JAWWindow::move(f32 param_1, f32 param_2) {
|
||||
field_0x38.move(param_1, param_2);
|
||||
}
|
||||
|
||||
void JAWWindow::addPosition(f32 param_1, f32 param_2) {
|
||||
field_0x38.add(param_1, param_2);
|
||||
}
|
||||
|
||||
void JAWWindow::addSize(f32 width, f32 height) {
|
||||
JGeometry::TBox2<f32> bounds = field_0x38.getBounds();
|
||||
f32 newWidth = width + bounds.getWidth();
|
||||
f32 newHeight = height + bounds.getHeight();
|
||||
if (newWidth < 36.0f) {
|
||||
newWidth = 36.0f;
|
||||
} else if (newWidth > 640.0f) {
|
||||
newWidth = 640.0f;
|
||||
}
|
||||
if (newHeight < 36.0f) {
|
||||
newHeight = 36.0f;
|
||||
} else if (newHeight > 480.0f) {
|
||||
newHeight = 480.0f;
|
||||
}
|
||||
field_0x38.resize(newWidth, newHeight);
|
||||
}
|
||||
|
||||
JUtility::TColor JAWWindow::convJudaColor(u16 param_1) {
|
||||
return JUtility::TColor((param_1 & 0xf800) >> 8, (param_1 & 0x7c0) >> 3, (param_1 & 0x3e) << 2, 255);
|
||||
}
|
||||
|
||||
void JAWWindow::padProc(const JUTGamePad& pad) {
|
||||
u32 trigger = pad.getTrigger();
|
||||
u32 release = pad.getRelease();
|
||||
u32 button = pad.getButton();
|
||||
u32 repeat = pad.getRepeat();
|
||||
onPadProc(pad);
|
||||
if (trigger & PAD_BUTTON_A) {
|
||||
onTrigA(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_B) {
|
||||
onTrigB(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_X) {
|
||||
onTrigX(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_Y) {
|
||||
onTrigY(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_MENU) {
|
||||
onTrigMenu(pad);
|
||||
}
|
||||
if (trigger & PAD_TRIGGER_L) {
|
||||
onTrigL(pad);
|
||||
}
|
||||
if (trigger & PAD_TRIGGER_Z) {
|
||||
onTrigZ(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_UP) {
|
||||
onTrigUp(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_DOWN) {
|
||||
onTrigDown(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_LEFT) {
|
||||
onTrigLeft(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_RIGHT) {
|
||||
onTrigRight(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_A) {
|
||||
onReleaseA(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_B) {
|
||||
onReleaseB(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_X) {
|
||||
onReleaseX(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_Y) {
|
||||
onReleaseY(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_MENU) {
|
||||
onReleaseMenu(pad);
|
||||
}
|
||||
if (release & PAD_TRIGGER_L) {
|
||||
onReleaseL(pad);
|
||||
}
|
||||
if (release & PAD_TRIGGER_Z) {
|
||||
onReleaseZ(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_UP) {
|
||||
onReleaseUp(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_DOWN) {
|
||||
onReleaseDown(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_LEFT) {
|
||||
onReleaseLeft(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_RIGHT) {
|
||||
onReleaseRight(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_A) {
|
||||
onKeyA(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_B) {
|
||||
onKeyB(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_X) {
|
||||
onKeyX(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_Y) {
|
||||
onKeyY(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_MENU) {
|
||||
onKeyMenu(pad);
|
||||
}
|
||||
if (repeat & PAD_TRIGGER_L) {
|
||||
onKeyL(pad);
|
||||
}
|
||||
if (repeat & PAD_TRIGGER_Z) {
|
||||
onKeyZ(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_UP) {
|
||||
onKeyUp(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_DOWN) {
|
||||
onKeyDown(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_LEFT) {
|
||||
onKeyLeft(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_RIGHT) {
|
||||
onKeyRight(pad);
|
||||
}
|
||||
}
|
||||
|
||||
JAWWindow::TWindowText::TWindowText(JAWWindow* window) :
|
||||
J2DPane('TEXT', JGeometry::TBox2<f32>(10.0f, 30.0f, 650.0f, 510.0f)),
|
||||
m_pParent(window),
|
||||
field_0x11c(0, 0) {
|
||||
}
|
||||
|
||||
JAWWindow::TWindowText::~TWindowText() {}
|
||||
|
||||
void JAWWindow::TWindowText::drawSelf(f32 param_1, f32 param_2) {
|
||||
Mtx mtx;
|
||||
MTXIdentity(mtx);
|
||||
drawSelf(param_1, param_2, &mtx);
|
||||
}
|
||||
|
||||
void JAWWindow::TWindowText::drawSelf(f32, f32, Mtx* param_3) {
|
||||
field_0xfc.reset();
|
||||
MTXTrans(*param_3, -field_0x11c.x, -field_0x11c.y, 0.0f);
|
||||
Mtx stack_48;
|
||||
MTXConcat(*param_3, mGlobalMtx, stack_48);
|
||||
GXLoadPosMtxImm(stack_48, 0);
|
||||
field_0xfc.setParentAlpha(mColorAlpha);
|
||||
JUT_ASSERT(209, m_pParent != NULL);
|
||||
m_pParent->setMatrix(stack_48);
|
||||
m_pParent->onDraw(&field_0xfc);
|
||||
}
|
||||
|
||||
static void dummy(J2DPane* pane, J2DWindow* window) {
|
||||
pane->rewriteAlpha();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow3D.h"
|
||||
|
||||
JGeometry::TVec2<f32> JAWWindow3D::sPtOrigin(0, 0);
|
||||
Reference in New Issue
Block a user