mirror of
https://github.com/zeldaret/ss
synced 2026-05-28 00:15:59 -04:00
Some small classes
This commit is contained in:
@@ -2200,7 +2200,14 @@ egg/gfx/eggDrawPathUnk2.cpp:
|
||||
.text start:0x804A4BF0 end:0x804A54E8
|
||||
|
||||
egg/gfx/eggFog.cpp:
|
||||
.text start:0x804A54F0 end:0x804A5F60
|
||||
.text start:0x804A54F0 end:0x804A5A08
|
||||
.data start:0x8056EFF0 end:0x8056F010
|
||||
.sdata start:0x80574F20 end:0x80574F28
|
||||
.sdata2 start:0x8057F608 end:0x8057F618
|
||||
|
||||
egg/gfx/eggFogManager.cpp:
|
||||
.text start:0x804A5A10 end:0x804A5F60
|
||||
.data start:0x8056F010 end:0x8056F030
|
||||
|
||||
egg/gfx/eggFrustum.cpp:
|
||||
.text start:0x804A5F60 end:0x804A6854
|
||||
@@ -2215,15 +2222,21 @@ egg/gfx/eggGfxEngine.cpp:
|
||||
egg/gfx/eggGlobalDrawState.cpp:
|
||||
.text start:0x804A7750 end:0x804A7814
|
||||
.ctors start:0x804DB9A0 end:0x804DB9A4
|
||||
.sbss start:0x80576838 end:0x80576848
|
||||
.bss start:0x80674E48 end:0x80674E78
|
||||
|
||||
egg/gfx/eggGXUtility.cpp:
|
||||
.text start:0x804A7820 end:0x804A7BC0
|
||||
|
||||
egg/gfx/eggIScnProc.cpp:
|
||||
.text start:0x804A7BC0 end:0x804A7F7C
|
||||
.data start:0x8056F058 end:0x8056F068
|
||||
|
||||
egg/gfx/eggLight.cpp:
|
||||
.text start:0x804A7F80 end:0x804AB24C
|
||||
egg/gfx/eggLightManager.cpp:
|
||||
.text start:0x804A7F80 end:0x804A9808
|
||||
|
||||
egg/gfx/eggLightObject.cpp:
|
||||
.text start:0x804A9810 end:0x804AB24C
|
||||
|
||||
egg/gfx/eggLightTexture.cpp:
|
||||
.text start:0x804AB250 end:0x804AD448
|
||||
@@ -2263,6 +2276,8 @@ egg/gfx/eggScreen.cpp:
|
||||
egg/gfx/eggScreenEffectBase.cpp:
|
||||
.text start:0x804B30C0 end:0x804B30EC
|
||||
.ctors start:0x804DB9AC end:0x804DB9B0
|
||||
.data start:0x8056F268 end:0x8056F278
|
||||
.bss start:0x80674F88 end:0x80675010
|
||||
|
||||
egg/gfx/eggScreenEffectBlur.cpp:
|
||||
.text start:0x804B30F0 end:0x804B3D98
|
||||
|
||||
+14
-14
@@ -9781,7 +9781,7 @@ fn_80171BD0 = .text:0x80171BD0; // type:function size:0xA90
|
||||
fn_80172660 = .text:0x80172660; // type:function size:0x4C
|
||||
fn_801726B0 = .text:0x801726B0; // type:function size:0x218
|
||||
EGG__DrawPathBase____dt = .text:0x801728D0; // type:function size:0x5C
|
||||
fn_80172930 = .text:0x80172930; // type:function size:0x40
|
||||
__dt__Q23EGG16ScreenEffectBaseFv = .text:0x80172930; // type:function size:0x40
|
||||
fn_80172970 = .text:0x80172970; // type:function size:0xB4
|
||||
fn_80172A30 = .text:0x80172A30; // type:function size:0x40
|
||||
fn_80172A70 = .text:0x80172A70; // type:function size:0x10DC
|
||||
@@ -10673,7 +10673,7 @@ nextPhase__22sFPhase<11dStageMgr_c>Fv = .text:0x8019C420; // type:function size:
|
||||
hasReachedEnd__22sFPhase<11dStageMgr_c>CFv = .text:0x8019C430; // type:function size:0x2C
|
||||
fn_8019C460 = .text:0x8019C460; // type:function size:0x10
|
||||
fn_8019C470 = .text:0x8019C470; // type:function size:0x10
|
||||
fn_8019C480 = .text:0x8019C480; // type:function size:0x10
|
||||
SetBinary__Q23EGG19IBinary<Q23EGG3Fog>FPCv = .text:0x8019C480; // type:function size:0x10
|
||||
fn_8019C490 = .text:0x8019C490; // type:function size:0x8
|
||||
fn_8019C4A0 = .text:0x8019C4A0; // type:function size:0x10
|
||||
fn_8019C4B0 = .text:0x8019C4B0; // type:function size:0x8
|
||||
@@ -26585,7 +26585,7 @@ createScnProc__Q23EGG8IScnProcFUsP12MEMAllocator = .text:0x804A7C80; // type:fun
|
||||
setPriorityScnProc__Q23EGG8IScnProcFUsUcb = .text:0x804A7D90; // type:function size:0xBC
|
||||
pushBackToScnGroup__Q23EGG8IScnProcFPQ34nw4r3g3d8ScnGroup = .text:0x804A7E50; // type:function size:0x84
|
||||
drawProcFunc__Q23EGG8IScnProcFPQ34nw4r3g3d7ScnProcb = .text:0x804A7EE0; // type:function size:0x78
|
||||
EGG__IScnProc__drawProcFuncNoGlobalState = .text:0x804A7F60; // type:function size:0x1C
|
||||
drawProcFuncNoGlobalState__Q23EGG8IScnProcFPQ34nw4r3g3d7ScnProcb = .text:0x804A7F60; // type:function size:0x1C
|
||||
__ct__Q23EGG12LightManagerFUlUlUc = .text:0x804A7F80; // type:function size:0x1A8
|
||||
__ct__Q33EGG12LightManager9LightDataFv = .text:0x804A8130; // type:function size:0x30
|
||||
__dt__Q23EGG11LightObjectFv = .text:0x804A8160; // type:function size:0x40
|
||||
@@ -37364,11 +37364,11 @@ lbl_8056EE60 = .data:0x8056EE60; // type:object size:0x50
|
||||
lbl_8056EEB0 = .data:0x8056EEB0; // type:object size:0x78
|
||||
lbl_8056EF28 = .data:0x8056EF28; // type:object size:0x78
|
||||
lbl_8056EFA0 = .data:0x8056EFA0; // type:object size:0x50
|
||||
EGG__Fog__vtable = .data:0x8056EFF0; // type:object size:0x20
|
||||
EGG__FogManager__vtable = .data:0x8056F010; // type:object size:0x20
|
||||
__vt__Q23EGG3Fog = .data:0x8056EFF0; // type:object size:0x20
|
||||
__vt__Q23EGG10FogManager = .data:0x8056F010; // type:object size:0x20
|
||||
EGG__Frustum__vtable = .data:0x8056F030; // type:object size:0x18
|
||||
EGG__GfxEnginer__Configuration__vtable = .data:0x8056F048; // type:object size:0x10
|
||||
lbl_8056F058 = .data:0x8056F058; // type:object size:0x10
|
||||
__vt__Q23EGG8IScnProc = .data:0x8056F058; // type:object size:0x10
|
||||
EGG__LightManager__vtable = .data:0x8056F068; // type:object size:0x30
|
||||
EGG__LightObject__vtable = .data:0x8056F098; // type:object size:0x20
|
||||
EGG__LightTexture__vtable = .data:0x8056F0B8; // type:object size:0x38
|
||||
@@ -37384,7 +37384,7 @@ lbl_8056F1F0 = .data:0x8056F1F0; // type:object size:0x20
|
||||
lbl_8056F210 = .data:0x8056F210; // type:object size:0x20
|
||||
sTVModeInfo__Q23EGG6Screen = .data:0x8056F230; // type:object size:0x24 data:2byte
|
||||
EGG__Screen__vtable = .data:0x8056F254; // type:object size:0x14
|
||||
lbl_8056F268 = .data:0x8056F268; // type:object size:0x10
|
||||
__vt__Q23EGG16ScreenEffectBase = .data:0x8056F268; // type:object size:0xC
|
||||
lbl_8056F278 = .data:0x8056F278; // type:object size:0x38
|
||||
lbl_8056F2B0 = .data:0x8056F2B0; // type:object size:0x10
|
||||
__vt__Q23EGG9ArcPlayer = .data:0x8056F2C0; // type:object size:0x5C
|
||||
@@ -41152,13 +41152,13 @@ EGG__DrawGX__sTexMapDefault = .sbss:0x8057680C; // type:object size:0x4 data:4by
|
||||
EGG__Frustum__sGlobalScale = .sbss:0x80576810; // type:object size:0x4 data:float
|
||||
EGG__Frustum__sGlobalOffset = .sbss:0x80576818; // type:object size:0x4 data:float
|
||||
lbl_80576820 = .sbss:0x80576820; // type:object size:0x1 data:byte
|
||||
lbl_80576824 = .sbss:0x80576824; // type:object size:0x4 data:4byte
|
||||
sAllocator__Q23EGG10G3DUtility = .sbss:0x80576824; // type:object size:0x4 data:4byte
|
||||
lbl_80576828 = .sbss:0x80576828; // type:object size:0x4 data:4byte
|
||||
lbl_8057682C = .sbss:0x8057682C; // type:object size:0x4 data:4byte
|
||||
lbl_80576830 = .sbss:0x80576830; // type:object size:0x8 data:4byte
|
||||
EGG__GlobalDrawState__spScreen = .sbss:0x80576838; // type:object size:0x4 data:4byte
|
||||
EGG__GlobalDrawState__sCameraID = .sbss:0x8057683C; // type:object size:0x2 data:2byte
|
||||
lbl_80576840 = .sbss:0x80576840; // type:object size:0x8 data:4byte
|
||||
spScreen__Q23EGG15GlobalDrawState = .sbss:0x80576838; // type:object size:0x4 data:4byte
|
||||
sCameraId__Q23EGG15GlobalDrawState = .sbss:0x8057683C; // type:object size:0x2 data:2byte
|
||||
sDrawFlag__Q23EGG15GlobalDrawState = .sbss:0x80576840; // type:object size:0x4 data:4byte
|
||||
lbl_80576848 = .sbss:0x80576848; // type:object size:0x2 data:2byte
|
||||
lbl_8057684A = .sbss:0x8057684A; // type:object size:0x2 data:2byte
|
||||
lbl_8057684C = .sbss:0x8057684C; // type:object size:0x2 data:2byte
|
||||
@@ -41186,7 +41186,7 @@ lbl_805768A4 = .sbss:0x805768A4; // type:object size:0x4 data:4byte
|
||||
lbl_805768A8 = .sbss:0x805768A8; // type:object size:0x4 data:4byte
|
||||
lbl_805768AC = .sbss:0x805768AC; // type:object size:0x1 data:byte
|
||||
lbl_805768B0 = .sbss:0x805768B0; // type:object size:0x2 data:2byte
|
||||
lbl_805768B2 = .sbss:0x805768B2; // type:object size:0x6 data:2byte
|
||||
s_commandFlag__Q23EGG7StateGX = .sbss:0x805768B2; // type:object size:0x6 data:2byte
|
||||
lbl_805768B8 = .sbss:0x805768B8; // type:object size:0x4 data:4byte
|
||||
lbl_805768BC = .sbss:0x805768BC; // type:object size:0x4 data:4byte
|
||||
lbl_805768C0 = .sbss:0x805768C0; // type:object size:0x4 data:4byte
|
||||
@@ -49802,12 +49802,12 @@ buf__Q23EGG6Assert = .bss:0x80674C60; // type:object size:0x104
|
||||
lbl_80674D68 = .bss:0x80674D68; // type:object size:0x90
|
||||
sCameraMtx = .bss:0x80674DF8; // type:object size:0x30 data:float
|
||||
lbl_80674E28 = .bss:0x80674E28; // type:object size:0x20
|
||||
lbl_80674E48 = .bss:0x80674E48; // type:object size:0x30
|
||||
sMtx__Q23EGG15GlobalDrawState = .bss:0x80674E48; // type:object size:0x30
|
||||
CPU_TEX_ARR = .bss:0x80674E78; // type:object size:0x48 data:4byte
|
||||
lbl_80674EC0 = .bss:0x80674EC0; // type:object size:0x30 data:float
|
||||
lbl_80674EF0 = .bss:0x80674EF0; // type:object size:0x10 data:float
|
||||
lbl_80674F00 = .bss:0x80674F00; // type:object size:0x88 data:4byte
|
||||
lbl_80674F88 = .bss:0x80674F88; // type:object size:0x88
|
||||
sScreen__Q23EGG16ScreenEffectBase = .bss:0x80674F88; // type:object size:0x88
|
||||
lbl_80675010 = .bss:0x80675010; // type:object size:0x30
|
||||
lbl_80675040 = .bss:0x80675040; // type:object size:0x18 data:float
|
||||
lbl_80675058 = .bss:0x80675058; // type:object size:0x18 data:float
|
||||
|
||||
+6
-4
@@ -877,13 +877,15 @@ config.libs = [
|
||||
Object(NonMatching, "egg/gfx/eggDrawPathDOF.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggDrawPathUnk2.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggFog.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggFogManager.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggFrustum.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggG3DUtility.cpp"), # Unknown Guess
|
||||
Object(NonMatching, "egg/gfx/eggGfxEngine.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggGlobalDrawState.cpp"),
|
||||
Object(Matching, "egg/gfx/eggGlobalDrawState.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggGXUtility.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggIScnProc.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggLight.cpp"),
|
||||
Object(Matching, "egg/gfx/eggIScnProc.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggLightManager.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggLightObject.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggLightTexture.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggLightTextureMgr.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggModelEx.cpp"),
|
||||
@@ -895,7 +897,7 @@ config.libs = [
|
||||
Object(NonMatching, "egg/gfx/eggPostEffectMaskDOF.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggPostEffectSimple.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggScreen.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggScreenEffectBase.cpp"),
|
||||
Object(Matching, "egg/gfx/eggScreenEffectBase.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggScreenEffectBlur.cpp"), # Unknown Guess
|
||||
Object(NonMatching, "egg/gfx/eggStateEfb.cpp"),
|
||||
Object(NonMatching, "egg/gfx/eggStateGX.cpp"),
|
||||
|
||||
+30
-10
@@ -1,26 +1,46 @@
|
||||
#ifndef EGG_FOG_H
|
||||
#define EGG_FOG_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/prim/eggBinary.h"
|
||||
#include "nw4r/g3d/g3d_fog.h"
|
||||
#include "nw4r/types_nw4r.h"
|
||||
#include "rvl/GX/GXTypes.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
// TODO: Add members
|
||||
class FogManager : IBinary<FogManager> {
|
||||
class Fog : public IBinary<Fog> {
|
||||
public:
|
||||
FogManager(u16);
|
||||
virtual ~FogManager();
|
||||
virtual void SetBinaryInner(Bin &) override;
|
||||
struct BinData {
|
||||
/* 0x10 */ f32 mStartZ;
|
||||
/* 0x14 */ f32 mEndZ;
|
||||
/* 0x18 */ f32 mNearZ;
|
||||
/* 0x1C */ f32 mFarZ;
|
||||
/* 0x20 */ GXColor mColor;
|
||||
/* 0x24 */ u8 field_0x24;
|
||||
/* 0x25 */ u8 mFlag2;
|
||||
/* 0x26 */ u16 field_0x26;
|
||||
/* 0x28 */ UNKWORD field_0x28;
|
||||
/* 0x2C */ UNKWORD field_0x2C;
|
||||
};
|
||||
Fog();
|
||||
virtual ~Fog();
|
||||
virtual void SetBinaryInner(const Bin &) override;
|
||||
virtual void GetBinaryInner(Bin *) const override;
|
||||
virtual size_t GetBinarySize() override;
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
|
||||
|
||||
void Calc();
|
||||
void CopyToG3D(nw4r::g3d::ScnRoot *) const;
|
||||
void CopyToG3D(nw4r::g3d::Fog fof) const;
|
||||
void Reset();
|
||||
|
||||
/* 0x04 */ u8 mFlag;
|
||||
/* 0x05 */ u8 TODO[0x10 - 0x05];
|
||||
private:
|
||||
|
||||
/* 0x04 */ GXColor mColor;
|
||||
/* 0x08 */ f32 mStartZ;
|
||||
/* 0x0C */ f32 mEndZ;
|
||||
/* 0x10 */ f32 mNearZ;
|
||||
/* 0x14 */ f32 mFarZ;
|
||||
/* 0x18 */ GXFogType mFogType;
|
||||
/* 0x1C */ u8 mFlags;
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef EGG_FOG_MANAGER_H
|
||||
#define EGG_FOG_MANAGER_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/gfx/eggFog.h"
|
||||
#include "egg/prim/eggBinary.h"
|
||||
#include "nw4r/types_nw4r.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
// TODO: Add members
|
||||
class FogManager : IBinary<FogManager> {
|
||||
public:
|
||||
struct BinData {
|
||||
/* 0x10 */ u16 mCount;
|
||||
/* 0x12 */ u8 _0x12[2];
|
||||
/* 0x14 */ IBinary<Fog>::Bin mFogData[1];
|
||||
};
|
||||
FogManager(u16);
|
||||
virtual ~FogManager();
|
||||
virtual void SetBinaryInner(const Bin &) override;
|
||||
virtual void GetBinaryInner(Bin *) const override;
|
||||
virtual size_t GetBinarySize() const override;
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
|
||||
|
||||
void ResetFog();
|
||||
void Calc();
|
||||
void CopyToG3D(nw4r::g3d::ScnRoot *) const;
|
||||
|
||||
void DoneDraw() {
|
||||
mFlag &= ~4;
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x04 */ u8 mFlag;
|
||||
/* 0x05 */ u8 TODO[0x08 - 0x05];
|
||||
/* 0x08 */ u16 mCount;
|
||||
/* 0x0A */ u16 mCount2;
|
||||
/* 0x0C */ Fog *mpFog;
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,20 @@
|
||||
#ifndef EGG_G3D_UTILITY_H
|
||||
#define EGG_G3D_UTILITY_H
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "rvl/MEM/mem_allocator.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class G3DUtility {
|
||||
public:
|
||||
static MEMAllocator *getAllocator() {
|
||||
return sAllocator;
|
||||
}
|
||||
|
||||
private:
|
||||
static MEMAllocator *sAllocator;
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
#ifndef EGG_GLOBAL_DRAW_STATE_H
|
||||
#define EGG_GLOBAL_DRAW_STATE_H
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "egg/gfx/eggScreen.h"
|
||||
#include "nw4r/math/math_types.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class GlobalDrawState {
|
||||
public:
|
||||
GlobalDrawState() {}
|
||||
static void setDrawSettingGX(bool, bool);
|
||||
static void beginDrawView(u16, nw4r::math::MTX34 const &, Screen const &);
|
||||
|
||||
private:
|
||||
static u16 sCameraId;
|
||||
static u32 sDrawFlag;
|
||||
static Screen const *spScreen;
|
||||
|
||||
// unknown
|
||||
static nw4r::math::MTX34 sMtx;
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,45 @@
|
||||
#ifndef EGG_ISCNPROC_H
|
||||
#define EGG_ISCNPROC_H
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "common.h"
|
||||
#include "nw4r/g3d/g3d_scnproc.h"
|
||||
#include "rvl/MEM/mem_allocator.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class IScnProc {
|
||||
private:
|
||||
// Unofficial name
|
||||
struct ProcData {
|
||||
IScnProc *mpThis; // at 0x0
|
||||
nw4r::g3d::ScnProc *mpScnProc; // at 0x4
|
||||
u16 mIndex; // at 0x8
|
||||
u8 mFlags; // at 0xA
|
||||
};
|
||||
|
||||
ProcData *mpDataSet; // at 0x0
|
||||
u16 mNumScnProc; // at 0x4
|
||||
|
||||
public:
|
||||
IScnProc() : mpDataSet(nullptr), mNumScnProc(0) {}
|
||||
virtual void doDraw(u16) = 0; // at 0x8
|
||||
virtual ~IScnProc(); // at 0xC
|
||||
|
||||
void createScnProc(u16 procNum, MEMAllocator *allocator);
|
||||
void setPriorityScnProc(u16, u8, bool);
|
||||
void pushBackToScnGroup(nw4r::g3d::ScnGroup *);
|
||||
void removeFromScnGroup(nw4r::g3d::ScnGroup *);
|
||||
static void drawProcFunc(nw4r::g3d::ScnProc *, bool);
|
||||
static void drawProcFuncNoGlobalState(nw4r::g3d::ScnProc *, bool);
|
||||
|
||||
u16 getNumScnProc() {
|
||||
return mNumScnProc;
|
||||
}
|
||||
ProcData *getData(u16 procIndex) {
|
||||
return &mpDataSet[procIndex];
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
|
||||
@@ -16,10 +16,11 @@ public:
|
||||
// TODO: Fill out more
|
||||
class LightTextureManager : public IBinary<LightTextureManager> {
|
||||
public:
|
||||
struct BinData {};
|
||||
virtual ~LightTextureManager();
|
||||
virtual void SetBinaryInner(Bin &) override;
|
||||
virtual void SetBinaryInner(const Bin &) override;
|
||||
virtual void GetBinaryInner(Bin *) const override;
|
||||
virtual size_t GetBinarySize() override;
|
||||
virtual size_t GetBinarySize() const override;
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
|
||||
void replaceModelTextures(nw4r::g3d::ResMdl) const;
|
||||
|
||||
@@ -29,12 +30,13 @@ public:
|
||||
// TODO: Fill out more
|
||||
class LightManager : public IBinary<LightManager> {
|
||||
public:
|
||||
struct BinData {};
|
||||
// vt at 0x00
|
||||
LightManager(u32, u32, u8);
|
||||
virtual ~LightManager();
|
||||
virtual void SetBinaryInner(Bin &) override;
|
||||
virtual void SetBinaryInner(const Bin &) override;
|
||||
virtual void GetBinaryInner(Bin *) const override;
|
||||
virtual size_t GetBinarySize() override;
|
||||
virtual size_t GetBinarySize() const override;
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
|
||||
virtual void Reset();
|
||||
virtual void Calc(nw4r::g3d::ScnRoot *);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
#ifndef EGG_SCREEN_EFFECT_BASE_H
|
||||
#define EGG_SCREEN_EFFECT_BASE_H
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "common.h"
|
||||
#include "egg/gfx/eggScreen.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class ScreenEffectBase {
|
||||
private:
|
||||
u8 mFlag;
|
||||
|
||||
public:
|
||||
ScreenEffectBase();
|
||||
virtual ~ScreenEffectBase() {} // at 0x8
|
||||
|
||||
protected:
|
||||
static Screen sScreen;
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
#ifndef EGG_STATE_EFB_H
|
||||
#define EGG_STATE_EFB_H
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
namespace EGG {
|
||||
|
||||
class StateEfb {
|
||||
public:
|
||||
static void Clean();
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,11 @@ public:
|
||||
|
||||
static void invalidateTexAllGX();
|
||||
|
||||
static bool GXSetColorUpdate_(bool);
|
||||
static bool GXSetAlphaUpdate_(bool);
|
||||
static bool GXSetDither_(bool);
|
||||
static bool GXSetDstAlpha_(bool, u8);
|
||||
|
||||
static bool GXSetColorUpdate(bool);
|
||||
static bool GXSetAlphaUpdate(bool);
|
||||
static bool GXSetDither();
|
||||
@@ -38,6 +43,9 @@ public:
|
||||
static void GXSetViewport(f32, f32, f32, f32, f32, f32);
|
||||
static void GZSetScissor(u32, u32, u32, u32);
|
||||
static void GZSetScissorBoxOffset(s32, s32);
|
||||
|
||||
|
||||
static u16 s_commandFlag;
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -3,23 +3,88 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
/**
|
||||
* @brief Common interface for objects that can be serialized to
|
||||
* and deserializized from binary.
|
||||
*
|
||||
* @tparam T The type of the Egg class. Must have a BinData type
|
||||
* that describes the binary type.
|
||||
*/
|
||||
template <class T>
|
||||
class IBinary {
|
||||
public:
|
||||
class Bin {};
|
||||
virtual void SetBinaryInner(Bin &) = 0;
|
||||
#pragma pack(push, 1)
|
||||
struct BinHeader {
|
||||
/* 0x00 */ char mType[4];
|
||||
/* 0x04 */ size_t mSize;
|
||||
/* 0x08 */ u8 mVersion;
|
||||
/* 0x09 */ u16 field_0x09;
|
||||
/* 0x0B */ u8 field_0x0B;
|
||||
/* 0x0C */ u32 field_0x0C;
|
||||
};
|
||||
struct Bin {
|
||||
BinHeader mHeader;
|
||||
typename T::BinData mData;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
protected:
|
||||
/** Load the object from binary */
|
||||
virtual void SetBinaryInner(const Bin &) = 0;
|
||||
/** Save the object to binary */
|
||||
virtual void GetBinaryInner(Bin *) const = 0;
|
||||
virtual size_t GetBinarySize() = 0;
|
||||
/** Get the size of the serialized data. Override if your binary has a dynamic size */
|
||||
virtual size_t GetBinarySize() const {
|
||||
return sizeof(Bin);
|
||||
}
|
||||
/** Load the object from binary, interpolating between values */
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) = 0;
|
||||
|
||||
/** Get a 4-bytes long ID string corresponding to this type */
|
||||
static const char *GetBinaryType();
|
||||
int GetVersion();
|
||||
|
||||
void GetBinary(void *) const;
|
||||
/** Get the current version of this type */
|
||||
static int GetVersion();
|
||||
|
||||
public:
|
||||
// These functions below are automatically provided, you should not need to
|
||||
// touch them to implement de-/serialization for your type. They will parse
|
||||
// the binary header and then invoke the above virtual functions.
|
||||
void GetBinary(void *pData) const;
|
||||
void SetBinary(const void *);
|
||||
|
||||
void SetBinaryBlend(const void *, const void *, f32);
|
||||
void SetBinaryBlend(const void *a, const void *b, f32 blend);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
void IBinary<T>::GetBinary(void *pData) const {
|
||||
Bin *pBin = reinterpret_cast<Bin *>(pData);
|
||||
BinHeader zeroedHeader = {0};
|
||||
pBin->mHeader = zeroedHeader;
|
||||
|
||||
pBin->mHeader.mVersion = GetVersion();
|
||||
pBin->mHeader.mSize = GetBinarySize();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
pBin->mHeader.mType[i] = GetBinaryType()[i];
|
||||
}
|
||||
typename T::BinData zeroedDatat = {0};
|
||||
pBin->mData = zeroedDatat;
|
||||
GetBinaryInner(pBin);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void IBinary<T>::SetBinary(const void *a) {
|
||||
const Bin *pBinA = reinterpret_cast<const Bin *>(a);
|
||||
SetBinaryInner(*pBinA);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void IBinary<T>::SetBinaryBlend(const void *a, const void *b, f32 blend) {
|
||||
const Bin *pBinA = reinterpret_cast<const Bin *>(a);
|
||||
const Bin *pBinB = reinterpret_cast<const Bin *>(b);
|
||||
SetBinaryInner(*pBinA, *pBinB, blend);
|
||||
}
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#define M3D_H
|
||||
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "egg/gfx/eggFog.h"
|
||||
#include "egg/gfx/eggFogManager.h"
|
||||
#include "egg/gfx/eggLight.h"
|
||||
#include "m/m_allocator.h"
|
||||
#include "nw4r/g3d/g3d_scnroot.h"
|
||||
|
||||
@@ -76,6 +76,13 @@ public:
|
||||
bool IsFogRangeAdjEnable() const {
|
||||
return IsValid() && ref().adjEnable == TRUE;
|
||||
}
|
||||
|
||||
void SetFogRangeAdjEnable(bool enable) {
|
||||
if (!IsValid()) {
|
||||
return;
|
||||
}
|
||||
ref().adjEnable = enable;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace g3d
|
||||
|
||||
+66
-1
@@ -1,3 +1,68 @@
|
||||
#include "egg/gfx/eggFog.h"
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "egg/egg_types.h"
|
||||
#include "egg/gfx/eggDrawGX.h"
|
||||
#include "rvl/GX/GXTypes.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
template <>
|
||||
const char *IBinary<Fog>::GetBinaryType() {
|
||||
return "FOGD";
|
||||
}
|
||||
|
||||
template <>
|
||||
int IBinary<Fog>::GetVersion() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Fog::Fog() {
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Fog::Reset() {
|
||||
// TODO
|
||||
mColor = DrawGX::WHITE;
|
||||
mNearZ = 0.0f;
|
||||
mFarZ = 0.0f;
|
||||
mEndZ = 0.0f;
|
||||
mStartZ = 0.0f;
|
||||
mFogType = GX_FOG_NONE;
|
||||
mFlags = 0;
|
||||
}
|
||||
|
||||
void Fog::CopyToG3D(nw4r::g3d::Fog fog) const {
|
||||
fog.SetFogType((mFlags & 1) ? mFogType : GX_FOG_NONE);
|
||||
fog.SetZ(mStartZ, mEndZ);
|
||||
fog.SetFogColor(mColor);
|
||||
fog.SetFogRangeAdjEnable(mFlags & 2);
|
||||
}
|
||||
|
||||
void Fog::SetBinaryInner(const Bin &bin) {
|
||||
if (bin.mHeader.mVersion != 0) {
|
||||
return;
|
||||
}
|
||||
mStartZ = bin.mData.mStartZ;
|
||||
mEndZ = bin.mData.mEndZ;
|
||||
mNearZ = bin.mData.mNearZ;
|
||||
mFarZ = bin.mData.mFarZ;
|
||||
mColor = bin.mData.mColor;
|
||||
mFogType = (GXFogType)bin.mData.field_0x24;
|
||||
mFlags = bin.mData.mFlag2;
|
||||
}
|
||||
|
||||
void Fog::GetBinaryInner(Bin *pBin) const {
|
||||
pBin->mData.mStartZ = mStartZ;
|
||||
pBin->mData.mEndZ = mEndZ;
|
||||
pBin->mData.mNearZ = mNearZ;
|
||||
pBin->mData.mFarZ = mFarZ;
|
||||
pBin->mData.mColor = mColor;
|
||||
pBin->mData.field_0x24 = mFogType;
|
||||
pBin->mData.mFlag2 = mFlags;
|
||||
}
|
||||
|
||||
void Fog::SetBinaryInner(const Bin &, const Bin &, f32) {}
|
||||
|
||||
Fog::~Fog() {}
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#include "egg/gfx/eggFogManager.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "nw4r/g3d/g3d_scnroot.h"
|
||||
|
||||
|
||||
namespace EGG {
|
||||
|
||||
FogManager::FogManager(u16 num) : mFlag(0), mCount(num), mCount2(num) {
|
||||
mpFog = new Fog[num];
|
||||
}
|
||||
|
||||
FogManager::~FogManager() {
|
||||
delete[] mpFog;
|
||||
}
|
||||
|
||||
void FogManager::ResetFog() {
|
||||
for (int i = 0; i < mCount; i++) {
|
||||
mpFog[i].Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void FogManager::Calc() {
|
||||
if (!(mFlag & 4)) {
|
||||
mFlag |= 4;
|
||||
}
|
||||
}
|
||||
|
||||
void FogManager::CopyToG3D(nw4r::g3d::ScnRoot *root) const {
|
||||
for (int i = 0; i < mCount; i++) {
|
||||
mpFog[i].CopyToG3D(root->GetFog(i));
|
||||
}
|
||||
}
|
||||
|
||||
void FogManager::SetBinaryInner(const Bin &bin) {
|
||||
if (bin.mHeader.mVersion == 0) {
|
||||
u32 loopMax = bin.mData.mCount >= mCount2 ? mCount2 : bin.mData.mCount;
|
||||
const IBinary<Fog>::Bin *pBinData = bin.mData.mFogData;
|
||||
for (u16 i = 0; i < loopMax; i++) {
|
||||
mpFog[i].SetBinary(&pBinData[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FogManager::SetBinaryInner(const Bin &bin1, const Bin &bin2, f32 blend) {
|
||||
if (bin1.mHeader.mVersion == 0) {
|
||||
u32 loopMax = bin1.mData.mCount >= mCount2 ? mCount2 : bin1.mData.mCount;
|
||||
const IBinary<Fog>::Bin *pBinData1 = bin1.mData.mFogData;
|
||||
const IBinary<Fog>::Bin *pBinData2 = bin2.mData.mFogData;
|
||||
for (u16 i = 0; i < loopMax; i++) {
|
||||
mpFog[i].SetBinaryBlend(&pBinData1[i], &pBinData2[i], blend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FogManager::GetBinaryInner(Bin *pOutBin) const {
|
||||
pOutBin->mData.mCount = mCount2;
|
||||
u16 max = mCount2;
|
||||
IBinary<Fog>::Bin *pOutData = pOutBin->mData.mFogData;
|
||||
for (u16 i = 0; i < max; i++) {
|
||||
mpFog[i].GetBinary(&pOutData[i]);
|
||||
}
|
||||
}
|
||||
|
||||
size_t FogManager::GetBinarySize() const {
|
||||
return sizeof(Bin) + (mCount2 - 1) * sizeof(Fog::Bin);
|
||||
}
|
||||
|
||||
} // namespace EGG
|
||||
@@ -1,3 +1,37 @@
|
||||
#include "egg/gfx/eggGlobalDrawState.h"
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "common.h"
|
||||
#include "egg/gfx/eggStateEfb.h"
|
||||
#include "egg/gfx/eggStateGX.h"
|
||||
#include "rvl/MTX/mtx.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
Screen const *GlobalDrawState::spScreen;
|
||||
u16 GlobalDrawState::sCameraId;
|
||||
u32 GlobalDrawState::sDrawFlag;
|
||||
|
||||
// unknown
|
||||
nw4r::math::MTX34 GlobalDrawState::sMtx;
|
||||
|
||||
GlobalDrawState sState;
|
||||
|
||||
void GlobalDrawState::beginDrawView(u16 cameraId, const nw4r::math::MTX34 &mtx, const Screen &screen) {
|
||||
spScreen = &screen;
|
||||
sCameraId = cameraId;
|
||||
PSMTXCopy(mtx, sMtx);
|
||||
StateEfb::Clean();
|
||||
}
|
||||
|
||||
void GlobalDrawState::setDrawSettingGX(bool b1, bool b2) {
|
||||
StateGX::GXSetColorUpdate_(sDrawFlag & 1);
|
||||
StateGX::GXSetAlphaUpdate_(sDrawFlag & 2);
|
||||
StateGX::GXSetDither_(sDrawFlag & 4);
|
||||
StateGX::GXSetDstAlpha_(false, 0);
|
||||
if (b2 && spScreen != nullptr) {
|
||||
spScreen->SetProjectionGX();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -1,3 +1,88 @@
|
||||
#include "egg/gfx/eggIScnProc.h"
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "egg/gfx/eggG3DUtility.h"
|
||||
#include "egg/gfx/eggGlobalDrawState.h"
|
||||
#include "egg/gfx/eggStateGX.h"
|
||||
#include "nw4r/g3d/g3d_scnobj.h"
|
||||
#include "nw4r/math/math_types.h"
|
||||
#include "rvl/MTX/mtx.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
IScnProc::~IScnProc() {
|
||||
if (mpDataSet != nullptr) {
|
||||
for (int i = 0; i < getNumScnProc(); i++) {
|
||||
mpDataSet[i].mpScnProc->Destroy();
|
||||
mpDataSet[i].mpScnProc = nullptr;
|
||||
}
|
||||
|
||||
delete[] mpDataSet;
|
||||
mpDataSet = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void IScnProc::createScnProc(u16 procNum, MEMAllocator *pAllocator) {
|
||||
mNumScnProc = procNum;
|
||||
mpDataSet = new ProcData[mNumScnProc];
|
||||
nw4r::math::MTX34 mtx;
|
||||
PSMTXIdentity(mtx);
|
||||
|
||||
for (u16 i = 0; i < getNumScnProc(); i++) {
|
||||
u32 sp8;
|
||||
MEMAllocator *allocator = (pAllocator == nullptr) ? G3DUtility::getAllocator() : pAllocator;
|
||||
|
||||
mpDataSet[i].mpScnProc = nw4r::g3d::ScnProc::Construct(allocator, &sp8, IScnProc::drawProcFunc, true, false, 0);
|
||||
|
||||
mpDataSet[i].mpScnProc->SetUserData(&mpDataSet[i]);
|
||||
mpDataSet[i].mpScnProc->SetMtx(nw4r::g3d::ScnObj::MTX_LOCAL, mtx);
|
||||
|
||||
mpDataSet[i].mIndex = i;
|
||||
mpDataSet[i].mpThis = this;
|
||||
mpDataSet[i].mFlags = 1 | 2;
|
||||
|
||||
setPriorityScnProc(i, i, true);
|
||||
}
|
||||
}
|
||||
|
||||
void IScnProc::setPriorityScnProc(u16 procIndex, u8 priority, bool bUseOpa) {
|
||||
nw4r::g3d::ScnProc *pScnProc = getData(procIndex)->mpScnProc;
|
||||
if (bUseOpa) {
|
||||
pScnProc->SetDrawProc(IScnProc::drawProcFunc, true, false);
|
||||
pScnProc->SetPriorityDrawOpa(priority);
|
||||
mpDataSet[procIndex].mFlags |= 1;
|
||||
} else {
|
||||
pScnProc->SetDrawProc(IScnProc::drawProcFunc, false, true);
|
||||
pScnProc->SetPriorityDrawXlu(priority);
|
||||
mpDataSet[procIndex].mFlags &= ~1;
|
||||
}
|
||||
}
|
||||
|
||||
void IScnProc::pushBackToScnGroup(nw4r::g3d::ScnGroup *pScnGroup) {
|
||||
for (u16 i = 0; i < getNumScnProc(); i++) {
|
||||
bool is_push_back = pScnGroup->Insert(pScnGroup->Size(), getData(i)->mpScnProc);
|
||||
}
|
||||
}
|
||||
|
||||
void IScnProc::removeFromScnGroup(nw4r::g3d::ScnGroup *pScnGroup) {
|
||||
for (u16 i = 0; i < getNumScnProc(); i++) {
|
||||
bool is_remove = pScnGroup->Remove(getData(i)->mpScnProc);
|
||||
}
|
||||
}
|
||||
|
||||
void IScnProc::drawProcFunc(nw4r::g3d::ScnProc *pScnProc, bool b) {
|
||||
GlobalDrawState::setDrawSettingGX(b, false);
|
||||
StateGX::s_commandFlag &= ~0xF;
|
||||
drawProcFuncNoGlobalState(pScnProc, b);
|
||||
StateGX::resetGXCache();
|
||||
|
||||
GlobalDrawState::setDrawSettingGX(b, (StateGX::s_commandFlag & 0xF) != 0);
|
||||
}
|
||||
|
||||
void IScnProc::drawProcFuncNoGlobalState(nw4r::g3d::ScnProc *pScnProc, bool b) {
|
||||
ProcData *dat = static_cast<ProcData *>(pScnProc->GetUserData());
|
||||
dat->mpThis->doDraw(dat->mIndex);
|
||||
}
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#include "egg/gfx/eggLight.h"
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
@@ -1,3 +1,9 @@
|
||||
#include "egg/gfx/eggScreenEffectBase.h"
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
namespace EGG {
|
||||
|
||||
Screen ScreenEffectBase::sScreen;
|
||||
|
||||
ScreenEffectBase::ScreenEffectBase() : mFlag(1) {}
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ void drawDone(int idx) {
|
||||
internal::l_lightMgr_pp[idx]->DoneDraw();
|
||||
}
|
||||
if (internal::l_fogMgr_pp && internal::l_fogMgr_pp[idx]) {
|
||||
internal::l_fogMgr_pp[idx]->mFlag &= 0xFB;
|
||||
internal::l_fogMgr_pp[idx]->DoneDraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user