Files
ss/include/egg/gfx/eggScreen.h
T
Elijah Thomas dc221b4795 Misc Egg (#37)
* EGG: Archive, DvdFile, DvdRipper

* start eggStream

* FrmHeap and AssertHeap OK

* progress on EggController

* port in WPAD stuff

* update WPAD/WUD/KPAD/SC symbols

* eggController OK

* bytematch more CoreController virtual funcs

* eggDecomp/eggStreamDecomp Ok

* eggDvdRipper OK

* EGG gfx splits

* Finished Splitting EGG

* create egg Files

* eggDecomp.h -> eggStreamDecomp.h

* Revert some format changes
2024-10-01 20:24:25 -04:00

92 lines
2.0 KiB
C++

#ifndef EGG_SCREEN_H
#define EGG_SCREEN_H
#include <common.h>
#include <egg/gfx/eggFrustum.h>
namespace EGG {
// TODO: Fill out more
class Screen : public Frustum {
public:
Screen();
Screen(f32, f32, f32, f32, Screen *, CanvasMode);
virtual ~Screen() {}
virtual void SetProjectionGX() const override;
virtual void CopyToG3D(nw4r::g3d::Camera) const override;
static void Initialize(const u16 *, const u16 *, Screen *);
static void SetTVModeDefault();
u8 TODO_0x3C[0x88 - 0x3C];
enum TVMode {
TV_MODE_1,
TV_MODE_2,
TV_MODE_3,
TV_MODE_4,
TV_MODE_MAX
};
struct TVModeInfo {
TVModeInfo() {}
u16 width;
u16 height;
f32 w_ratio;
f32 h_ratio;
};
struct DataEfb {
// Required for struct copy
struct Viewport {
f32 x1; // at 0x0
f32 y1; // at 0x4
f32 x2; // at 0x8
f32 y2; // at 0xC
f32 z1; // at 0x10
f32 z2; // at 0x14
} vp;
s32 sc_ox; // at 0x18
s32 sc_oy; // at 0x1C
};
static u16 GetSizeXMax(TVMode mode) {
return sTVModeInfo[mode].width;
}
static u16 GetSizeYMax(TVMode mode) {
return sTVModeInfo[mode].height;
}
static u16 GetSizeXMax() {
return sTVModeInfo[sTVMode].width;
}
static u16 GetSizeYMax() {
return sTVModeInfo[sTVMode].height;
}
static inline f32 GetAdjustScale() {
return (f32)sTVModeInfo[0].width / sTVModeInfo[Screen::sTVMode].width;
}
static TVMode GetTVMode() {
return sTVMode;
}
static TVMode sTVMode;
static Screen *spRoot;
typedef void (*ChangeTVModeFunc)(void *);
static ChangeTVModeFunc sChangeTVModeFunc;
static void *spChangeTVModeFuncInfo;
static TVModeInfo sTVModeInfo[Screen::TV_MODE_MAX];
static nw4r::math::VEC2 sCanvasScale;
static nw4r::math::VEC2 sCanvasOffset;
};
} // namespace EGG
#endif