Files
wii-ipl/include/utility/iplGraphics.h
devin-ai-integration[bot] 3aa9daf94a decomp: emission gates for iplSDChannelTitle + MemoryCardManager decodes (#972)
IPL_SD_CHANNEL_TITLE_CPP gates move inline members to declarations so the
TU emits non-inlined calls like retail (same dedup-loss pattern as
#834's vtable restoration): iplInterporation::get, math::VEC3 ctor,
FaderSceneBase::initCalcNormal/calcCommonAfter, SceneBase::isReady/
isResetProcessDone/getParent/getChild/getNext/getPrev, NANDTask::
isFinished/checkData, Graphics::setOrthoTrans/setOrthoScale,
ut::Rect/RuntimeTypeInfo.

Verified vs main: iplSDChannelTitle 68/69 fns byte-exact (152B tail
residual in iplSDChannelTitle_flushSaveBeforeExit), iplMemoryCardManager
18/26. Units stay NonMatching; documented walls in revisit.attempts.md.

Co-authored-by: devin <devin@cognition.ai>
Co-authored-by: coah80 <usernamecole7@gmail.com>
2026-10-02 17:22:10 -05:00

73 lines
2.2 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;
}
#ifdef IPL_SD_CHANNEL_TITLE_CPP
static void setOrthoTrans(const math::VEC3& translate);
static void setOrthoScale(const math::VEC2& scale);
#else
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;
}
#endif
private:
static Arg mArg;
};
} // namespace utility
} // namespace ipl
#endif // IPL_GRAPHICS_H