mirror of
https://github.com/zeldaret/ss
synced 2026-07-01 03:40:11 -04:00
9c3c480b24
* g3d_calcvtx GetData seems to have changed -> dwarf says r is a local and using ofs_to_ptr didnt work * g3d_light and g3d_fog sdata2 splits and func ordering * g3d_scnproc * g3d_init * g3d_scnmdl * g3d_scnmdlsmpl * g3d_scnroot * g3d_scnobj * g3d_res* progress * g3d_resmdl OK * g3d_restev OK * g3d_resmat OK * g3d_resvtx and g3d_restex OK * g3d_resnode OK * g3d_resanm OK * g3d_resanmchr Progress * the rest of g3d_res* OK * g3d_anmvis OK * g3d_anmclr OK * Some Splitting * more OK, Inline Issue in g3d_anmtexsrt * g3d_obj, g3d_anmobj, g3d_gpu, g3d_tmem, g3d_cpu OK * g3d_state OK * g3d/dcc OK * Include fixup * More Fixups * g3d_camera OK * g3d_draw OK * g3d_calcworld OK * g3d_calcworld actually OK * g3d_workmem, g3d_dcc OK * g3d_calcview OK * g3d_anmtexsrt OK with DONT_INLINE * g3d_transform OK (Feels Cheaty) * g3d_resanmchr OK * g3d_draw1mat1shp Close * g3d_draw1mat1shp OK (Thanks Lago!). Ran symbol applying script
139 lines
3.9 KiB
C++
139 lines
3.9 KiB
C++
#ifndef NW4R_G3D_SCN_ROOT_H
|
|
#define NW4R_G3D_SCN_ROOT_H
|
|
#include <nw4r/types_nw4r.h>
|
|
|
|
#include "nw4r/g3d/g3d_camera.h"
|
|
#include "nw4r/g3d/g3d_fog.h"
|
|
#include "nw4r/g3d/g3d_light.h"
|
|
#include "nw4r/g3d/g3d_scnobj.h"
|
|
#include "nw4r/g3d/g3d_state.h"
|
|
|
|
namespace nw4r {
|
|
namespace g3d {
|
|
|
|
// Forward declarations
|
|
class AnmScn;
|
|
|
|
/******************************************************************************
|
|
*
|
|
* ScnRoot
|
|
*
|
|
******************************************************************************/
|
|
class ScnRoot : public ScnGroup {
|
|
public:
|
|
enum ScnRootFlag {
|
|
SCNROOTFLAG_FORCE_RESMDLDRAWMODE = (1 << 0)
|
|
};
|
|
|
|
public:
|
|
static ScnRoot *
|
|
Construct(MEMAllocator *pAllocator, u32 *pSize, u32 maxChildren, u32 maxScnObj, u32 numLightObj, u32 numLightSet);
|
|
|
|
static ScnRoot *Construct(MEMAllocator *pAllocator, u32 *pSize, u32 maxChildren, u32 maxScnObj) {
|
|
return Construct(pAllocator, pSize, maxChildren, maxScnObj, G3DState::NUM_LIGHT, G3DState::NUM_LIGHT_SET);
|
|
}
|
|
|
|
ScnRoot(
|
|
MEMAllocator *pAllocator, IScnObjGather *pGather, ScnObj **ppChildrenBuf, u32 maxChildren, u32 numLight,
|
|
u32 numLightSet, LightObj *pLightObjBuf, AmbLightObj *pAmbObjBuf, LightSetData *pLightSetBuf
|
|
);
|
|
|
|
virtual void G3dProc(u32 task, u32 param, void *pInfo); // at 0xC
|
|
virtual ~ScnRoot(); // at 0x10
|
|
|
|
Camera GetCamera(int idx);
|
|
Camera GetCurrentCamera();
|
|
void SetCurrentCamera(int idx);
|
|
|
|
Fog GetFog(int idx);
|
|
LightSet GetLightSet(int idx);
|
|
|
|
void UpdateFrame();
|
|
void SetGlbSettings();
|
|
|
|
void CalcAnmScn();
|
|
void CalcWorld();
|
|
void CalcMaterial();
|
|
void CalcVtx();
|
|
void CalcView();
|
|
|
|
void GatherDrawScnObj();
|
|
void ZSort();
|
|
void DrawOpa();
|
|
void DrawXlu();
|
|
|
|
u32 TestScnRootFlag(ScnRootFlag flag) const {
|
|
return (mScnRootFlags & flag) != 0;
|
|
}
|
|
void SetScnRootFlag(ScnRootFlag flag, u32 on) {
|
|
if (on) {
|
|
mScnRootFlags |= flag;
|
|
} else {
|
|
mScnRootFlags &= ~flag;
|
|
}
|
|
}
|
|
|
|
int GetCurrentCameraID() const {
|
|
return mCurrentCameraID;
|
|
}
|
|
|
|
LightSetting &GetLightSetting() {
|
|
return mLightSetting;
|
|
}
|
|
|
|
private:
|
|
IScnObjGather *mpCollection; // at 0xE8
|
|
ResMdlDrawMode mDrawMode; // at 0xEC
|
|
u32 mScnRootFlags; // at 0xF0
|
|
u8 mCurrentCameraID; // at 0xF4
|
|
u8 PADDING_0xF5; // at 0xF5
|
|
u8 PADDING_0xF6; // at 0xF6
|
|
u8 PADDING_0xF7; // at 0xF7
|
|
CameraData mCamera[G3DState::NUM_CAMERA]; // at 0xF8
|
|
FogData mFog[G3DState::NUM_FOG]; // at 0x2278
|
|
LightSetting mLightSetting; // at 0x2878
|
|
AnmScn *mpAnmScn; // at 0x2888
|
|
|
|
NW4R_G3D_RTTI_DECL_DERIVED(ScnRoot, ScnGroup);
|
|
};
|
|
|
|
/******************************************************************************
|
|
*
|
|
* ScnObjGather
|
|
*
|
|
******************************************************************************/
|
|
class ScnObjGather : public IScnObjGather {
|
|
public:
|
|
ScnObjGather(ScnObj **ppBufOpa, ScnObj **ppBufXlu, u32 capacity);
|
|
|
|
virtual ~ScnObjGather() {} // at 0x8
|
|
|
|
virtual CullingStatus Add(ScnObj *pObj, bool opa, bool xlu); // at 0xC
|
|
virtual void Clear() {
|
|
mNumScnObjOpa = mNumScnObjXlu = 0;
|
|
} // at 0x10
|
|
|
|
virtual void ZSort(); // at 0x14
|
|
|
|
virtual void Sort(); // at 0x18
|
|
virtual void Sort(LessThanFunc pOpaFunc,
|
|
LessThanFunc pXluFunc); // at 0x1C
|
|
|
|
virtual void DrawOpa(ResMdlDrawMode *pForceMode); // at 0x20
|
|
virtual void DrawXlu(ResMdlDrawMode *pForceMode); // at 0x24
|
|
|
|
virtual CheckStatus CheckScnObj(ScnObj *); // at 0x28
|
|
|
|
protected:
|
|
ScnObj **mpArrayOpa; // at 0x4
|
|
ScnObj **mpArrayXlu; // at 0x8
|
|
u32 mSizeScnObj; // at 0xC
|
|
u32 mNumScnObjOpa; // at 0x10
|
|
u32 mNumScnObjXlu; // at 0x14
|
|
};
|
|
|
|
} // namespace g3d
|
|
} // namespace nw4r
|
|
|
|
#endif
|