Files
wii-ipl/include/utility/iplGraphics.h
coah f8d83e5ff2 Fork for AI-assisted matching work
Personal fork so AI-assisted decomp work has a home without disturbing
upstream. README explains the fork; AGENTS.md documents the method and
forbids ever opening a PR against koopthekoopa/wii-ipl.

Matching progress: +9 exact functions, 0 regressions, main.dol still
byte-identical (26116613f624061ba99c8d1a299aaa6efa85670d).

iplESMisc gains CheckTmdParentalControl, CheckSafeDeleteTitle,
NumPrivateContents, checkContentsNum and GetValidTicketIndex, plus the
other functions matched in the previous pass.

The load-bearing finding, written up in AGENTS.md: MWCC emits a
translation unit's string literals in source-token order. A missing
function, or an inverted if/else, shifts every later string offset and
breaks functions that were never edited. Fixing that pool ordering lifted
TMDFile::Open from 99.92 to 99.96 without touching Open.

Adds tools/decomp-assist/ with pool_diff.py, ctxdiff.py, disasm_fn.py,
export_pyghidra.py and the Ghidra decompilation dump.
2026-09-19 13:19:34 +00:00

68 lines
2.0 KiB
C++

#ifndef IPL_GRAPHICS_H
#define IPL_GRAPHICS_H
#include <revolution/gx/GXStruct.h>
#include <revolution/types.h>
#include <nw4r/math/types.h>
#include <nw4r/ut/Rect.h>
#include "iplMath.h"
namespace ipl {
namespace utility {
class Graphics {
public:
class Arg {
private:
Arg();
nw4r::math::MTX44 mProjMtx; // 0x00
nw4r::math::MTX34 mViewMtx; // 0x40
math::VEC3 mOrthoTrans; // 0x70
math::VEC2 mOrthoScale; // 0x7C
friend class Graphics;
};
typedef enum Orientation {
ORI_NONE = 0,
ORI_90CW,
ORI_90CCW
} Orientation;
static nw4r::math::MTX34& getViewMtx() { return mArg.mViewMtx; }
static void setOrtho(u32 ortho = GX_PNMTX0);
static void setDefaultOrtho(u32 ortho = GX_PNMTX0);
static void setOrthoProjection(const math::VEC3& translate, const math::VEC2& scale);
static void setOrthoProjection(u32 id);
static void calcOrthoCamera();
static void setCamera(u32 id = 0);
static void drawPolygon(const nw4r::ut::Rect& rect, GXColor color);
static void drawTexture(const nw4r::ut::Rect& rect, const GXTexObj& texObj, GXColor color, u8 texScale, Orientation ori = ORI_NONE);
static void setOrthoTransAndScale(const math::VEC3& translate, const math::VEC2& scale) {
mArg.mOrthoTrans = translate;
mArg.mOrthoScale = scale;
}
static void setOrthoTrans(const math::VEC3& translate) { mArg.mOrthoTrans = translate; }
static void setOrthoScale(const math::VEC2& scale) NO_INLINE {
mArg.mOrthoScale.x = scale.x;
mArg.mOrthoScale.y = scale.y;
}
private:
static Arg mArg;
};
} // namespace utility
} // namespace ipl
#endif // IPL_GRAPHICS_H