mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-30 16:02:18 -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,49 @@
|
||||
#ifndef JAWEXTSYSTEM_H
|
||||
#define JAWEXTSYSTEM_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWSystem.h"
|
||||
#include "JSystem/JGadget/std-list.h"
|
||||
|
||||
class JAWWindow;
|
||||
struct JUTGamePad;
|
||||
|
||||
namespace JAWExtSystem {
|
||||
BOOL registWindow(u32, JAWWindow*, int, int);
|
||||
BOOL destroyWindow(u32, JAWWindow*);
|
||||
void nextPage();
|
||||
void prevPage();
|
||||
void nextWindow();
|
||||
void prevWindow();
|
||||
void draw();
|
||||
void padProc(const JUTGamePad&);
|
||||
|
||||
class TSystemInterface : public JAWSystemInterface {
|
||||
public:
|
||||
TSystemInterface() {}
|
||||
virtual BOOL registWindow(u32 param_1, JAWWindow* param_2, int param_3, int param_4) {
|
||||
return JAWExtSystem::registWindow(param_1, param_2, param_3, param_4);
|
||||
}
|
||||
virtual BOOL destroyWindow(u32 param_1, JAWWindow* param_2) {
|
||||
return JAWExtSystem::destroyWindow(param_1, param_2);
|
||||
}
|
||||
virtual void setForegroundWindow(JAWWindow*) {}
|
||||
};
|
||||
|
||||
class TCurrentHeap {
|
||||
public:
|
||||
TCurrentHeap(const TSystemInterface& interface) {
|
||||
heap = JKRGetCurrentHeap();
|
||||
JKRSetCurrentHeap(interface.getCurrentHeap());
|
||||
}
|
||||
~TCurrentHeap() { JKRSetCurrentHeap(heap); }
|
||||
|
||||
/* 0x00 */ JKRHeap* heap;
|
||||
};
|
||||
|
||||
extern JGadget::TList<JAWWindow*> sPage[128];
|
||||
extern TSystemInterface sInterface;
|
||||
extern s32 sCurrentPage;
|
||||
extern u8 lbl_80748E44;
|
||||
}
|
||||
|
||||
#endif /* JAWEXTSYSTEM_H */
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef JAWGRAPHCONTEXT_H
|
||||
#define JAWGRAPHCONTEXT_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
class J2DPrint;
|
||||
class JUTResFont;
|
||||
|
||||
class JAWGraphContext {
|
||||
public:
|
||||
JAWGraphContext();
|
||||
~JAWGraphContext();
|
||||
void reset();
|
||||
void color(u8, u8, u8, u8);
|
||||
void color(const JUtility::TColor&);
|
||||
void locate(int, int);
|
||||
void print(char const*, ...);
|
||||
void print(int, int, const char*, ...);
|
||||
void color(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
|
||||
void fillBox(const JGeometry::TBox2<f32>&);
|
||||
void drawFrame(const JGeometry::TBox2<f32>&);
|
||||
void line(const JGeometry::TVec2<f32>&, const JGeometry::TVec2<f32>&);
|
||||
void setGXforPrint();
|
||||
void setGXforDraw();
|
||||
|
||||
/* 0x00 */ J2DPrint* field_0x0;
|
||||
/* 0x04 */ JUtility::TColor field_0x4;
|
||||
/* 0x08 */ JUtility::TColor field_0x8;
|
||||
/* 0x0C */ JUtility::TColor field_0xc;
|
||||
/* 0x10 */ JUtility::TColor field_0x10;
|
||||
/* 0x14 */ u8 mParentAlpha;
|
||||
/* 0x15 */ u8 field_0x15;
|
||||
/* 0x16 */ u8 field_0x16;
|
||||
/* 0x18 */ int field_0x18;
|
||||
|
||||
void setParentAlpha(u8 alpha) { mParentAlpha = alpha; }
|
||||
|
||||
static JUTResFont* sFont;
|
||||
static bool lbl_8074CD30;
|
||||
};
|
||||
|
||||
#endif /* JAWGRAPHCONTEXT_H */
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef JAWSYSTEM_H
|
||||
#define JAWSYSTEM_H
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
class JAWWindow;
|
||||
|
||||
class JAWSystemInterface {
|
||||
public:
|
||||
JAWSystemInterface();
|
||||
virtual BOOL registWindow(u32, JAWWindow*, int, int) = 0;
|
||||
virtual BOOL destroyWindow(u32, JAWWindow*) = 0;
|
||||
virtual void setForegroundWindow(JAWWindow*) = 0;
|
||||
|
||||
/* 0x04 */ JKRHeap* mHeap;
|
||||
|
||||
JKRHeap* getCurrentHeap() const;
|
||||
|
||||
static JAWSystemInterface* sInstance;
|
||||
};
|
||||
|
||||
#endif /* JAWSYSTEM_H */
|
||||
@@ -0,0 +1,114 @@
|
||||
#ifndef JAWWINDOW_H
|
||||
#define JAWWINDOW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include "JSystem/J2DGraph/J2DWindow.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
class JAWGraphContext;
|
||||
struct JUTGamePad;
|
||||
|
||||
class JUTPoint {
|
||||
public:
|
||||
JUTPoint(int i_x, int i_y) {
|
||||
x = i_x;
|
||||
y = i_y;
|
||||
}
|
||||
|
||||
/* 0x00*/ int x;
|
||||
/* 0x04*/ int y;
|
||||
};
|
||||
|
||||
class JAWWindow {
|
||||
public:
|
||||
class TWindowText : public J2DPane {
|
||||
public:
|
||||
TWindowText(JAWWindow*);
|
||||
virtual ~TWindowText();
|
||||
virtual void drawSelf(f32, f32);
|
||||
virtual void drawSelf(f32, f32, Mtx*);
|
||||
|
||||
/* 0x0FC */ JAWGraphContext field_0xfc;
|
||||
/* 0x118 */ JAWWindow* m_pParent;
|
||||
/* 0x11C */ JUTPoint field_0x11c;
|
||||
};
|
||||
|
||||
class TJ2DWindowDraw : public J2DWindow {
|
||||
public:
|
||||
TJ2DWindowDraw(u32 param_1, const JGeometry::TBox2<f32>& param_2, const char* param_3) : J2DWindow(param_1, param_2, param_3, TEXTUREBASE_0, NULL) {}
|
||||
virtual ~TJ2DWindowDraw() {}
|
||||
|
||||
void drawPane(int x, int y, const J2DGrafContext* p_grafCtx) {
|
||||
J2DPane::draw(x, y, p_grafCtx, true, true);
|
||||
calcMtx();
|
||||
}
|
||||
};
|
||||
|
||||
JAWWindow(const char*, int, int);
|
||||
virtual ~JAWWindow();
|
||||
virtual void onDraw(JAWGraphContext*);
|
||||
virtual BOOL onInit();
|
||||
virtual void frameWork() {}
|
||||
virtual void onPadProc(const JUTGamePad&) {}
|
||||
virtual void onTrigA(const JUTGamePad&) {}
|
||||
virtual void onTrigB(const JUTGamePad&) {}
|
||||
virtual void onTrigX(const JUTGamePad&) {}
|
||||
virtual void onTrigY(const JUTGamePad&) {}
|
||||
virtual void onTrigMenu(const JUTGamePad&) {}
|
||||
virtual void onTrigL(const JUTGamePad&) {}
|
||||
virtual void onTrigZ(const JUTGamePad&) {}
|
||||
virtual void onTrigUp(const JUTGamePad&) {}
|
||||
virtual void onTrigDown(const JUTGamePad&) {}
|
||||
virtual void onTrigLeft(const JUTGamePad&) {}
|
||||
virtual void onTrigRight(const JUTGamePad&) {}
|
||||
virtual void onReleaseA(const JUTGamePad&) {}
|
||||
virtual void onReleaseB(const JUTGamePad&) {}
|
||||
virtual void onReleaseX(const JUTGamePad&) {}
|
||||
virtual void onReleaseY(const JUTGamePad&) {}
|
||||
virtual void onReleaseMenu(const JUTGamePad&) {}
|
||||
virtual void onReleaseL(const JUTGamePad&) {}
|
||||
virtual void onReleaseZ(const JUTGamePad&) {}
|
||||
virtual void onReleaseUp(const JUTGamePad&) {}
|
||||
virtual void onReleaseDown(const JUTGamePad&) {}
|
||||
virtual void onReleaseLeft(const JUTGamePad&) {}
|
||||
virtual void onReleaseRight(const JUTGamePad&) {}
|
||||
virtual void onKeyA(const JUTGamePad&) {}
|
||||
virtual void onKeyB(const JUTGamePad&) {}
|
||||
virtual void onKeyX(const JUTGamePad&) {}
|
||||
virtual void onKeyY(const JUTGamePad&) {}
|
||||
virtual void onKeyMenu(const JUTGamePad&) {}
|
||||
virtual void onKeyL(const JUTGamePad&) {}
|
||||
virtual void onKeyZ(const JUTGamePad&) {}
|
||||
virtual void onKeyUp(const JUTGamePad&) {}
|
||||
virtual void onKeyDown(const JUTGamePad&) {}
|
||||
virtual void onKeyLeft(const JUTGamePad&) {}
|
||||
virtual void onKeyRight(const JUTGamePad&) {}
|
||||
|
||||
BOOL initIf();
|
||||
void setTitleColor(const JUtility::TColor&, const JUtility::TColor&);
|
||||
void setWindowColor(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
|
||||
void move(f32, f32);
|
||||
void addPosition(f32, f32);
|
||||
void addSize(f32, f32);
|
||||
static JUtility::TColor convJudaColor(u16);
|
||||
void padProc(const JUTGamePad&);
|
||||
|
||||
/* 0x004 */ Mtx mMatrix;
|
||||
/* 0x034 */ u8 field_0x34[0x38 - 0x34];
|
||||
/* 0x038 */ TJ2DWindowDraw field_0x38;
|
||||
/* 0x180 */ J2DTextBox field_0x180;
|
||||
/* 0x2B0 */ TWindowText field_0x2b0;
|
||||
/* 0x3D8 */ JUtility::TColor field_0x3d8;
|
||||
/* 0x3DC */ JUtility::TColor field_0x3dc;
|
||||
/* 0x3E0 */ JUtility::TColor field_0x3e0;
|
||||
/* 0x3E4 */ JUtility::TColor field_0x3e4;
|
||||
/* 0x3E8 */ int field_0x3e8;
|
||||
/* 0x3EC */ u8 field_0x3ec;
|
||||
|
||||
void setMatrix(Mtx mtx) { MTXCopy(mtx, mMatrix); }
|
||||
void setAlpha(u8 alpha) { field_0x38.setAlpha(alpha); }
|
||||
void draw(int x, int y, const J2DGrafContext* p_grafCtx) { field_0x38.drawPane(x, y, p_grafCtx); }
|
||||
};
|
||||
|
||||
#endif /* JAWWINDOW_H */
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef JAWWINDOW3D_H
|
||||
#define JAWWINDOW3D_H
|
||||
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
namespace JAWWindow3D {
|
||||
extern JGeometry::TVec2<f32> sPtOrigin;
|
||||
}
|
||||
|
||||
#endif /* JAWWINDOW3D_H */
|
||||
Reference in New Issue
Block a user