* Initial M3d Pass
* `m_bmdl` and `m_bline` left

---------

Co-authored-by: elijah-thomas774 <elijahthomas774@gmail.com>
Co-authored-by: Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>
This commit is contained in:
robojumper
2024-09-12 22:36:34 +02:00
committed by GitHub
parent e2c4bb7be7
commit 1180e1f486
150 changed files with 5890 additions and 818 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_3DSMAX_H
#define NW4R_G3D_3DSMAX_H
#include "common.h"
#include "g3d_anmtexsrt.h"
#include "nw4r/g3d/g3d_anmtexsrt.h"
#include "nw4r/math.h"
namespace nw4r {
namespace g3d {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_G3D_ANMCAMERA_H
#define NW4R_G3D_ANMCAMERA_H
#include "common.h"
#include "math_types.h"
#include "nw4r/math/math_types.h"
#include <rvl/GX.h>
+73 -5
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_ANMCHR_H
#define NW4R_G3D_ANMCHR_H
#include "common.h"
#include "math_types.h"
#include "nw4r/g3d/g3d_anmobj.h"
#include "nw4r/math/math_types.h"
namespace nw4r {
namespace g3d {
@@ -12,13 +13,80 @@ struct ChrAnmResult {
math::MTX34 mMtx; // at 0x1C
};
struct AnmObjChr {};
class AnmObjChrRes;
struct AnmObjChrNode {};
class AnmObjChr : public AnmObj {
public:
struct AnmObjChrBlend {};
enum BindOption {};
static const TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
virtual ChrAnmResult *GetResult(ChrAnmResult *, u32); // at 0x38
virtual void Attach(int, AnmObjChrRes*); // at 0x3C
virtual void Detach(int); // at 0x40
virtual void DetachAll(); // at 0x44
virtual void SetWeight(int, f32); // at 0x48
virtual f32 GetWeight(int) const; // at 0x4C
virtual void Bind(ResMdl, u32, BindOption) = 0; // at 0x50
virtual void Release(ResMdl, u32, BindOption) = 0; // at 0x54
private:
UNKWORD field_0x10;
UNKWORD field_0x14;
protected:
NW4R_G3D_TYPE_OBJ_DECL(AnmObjChr);
};
class AnmObjChrNode : public AnmObjChr {
public:
static const TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
inline int Size() {
return mNodeArraySize;
}
AnmObjChrRes *GetNode(int i) {
return mpNodes[i];
}
private:
int mNodeArraySize;
AnmObjChrRes **mpNodes;
protected:
NW4R_G3D_TYPE_OBJ_DECL(AnmObjChrNode);
};
class AnmObjChrBlend : public AnmObjChrNode {
public:
static const TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjChrBlend *Construct(MEMAllocator*, u32*, ResMdl, int);
protected:
NW4R_G3D_TYPE_OBJ_DECL(AnmObjChrBlend);
};
class AnmObjChrRes : public AnmObjChr, public FrameCtrl {
public:
static const TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjChrRes *Construct(MEMAllocator*, u32*, ResAnmChr, ResMdl, bool);
protected:
NW4R_G3D_TYPE_OBJ_DECL(AnmObjChrRes);
};
struct AnmObjChrRes {};
} // namespace g3d
} // namespace nw4r
+69
View File
@@ -1,6 +1,8 @@
#ifndef NW4R_G3D_ANMCLR_H
#define NW4R_G3D_ANMCLR_H
#include "common.h"
#include "nw4r/g3d/g3d_anmobj.h"
#include "nw4r/g3d/g3d_resanmclr.h"
namespace nw4r {
namespace g3d {
@@ -11,6 +13,73 @@ struct ClrAnmResult {
u32 COLORS_0x4[ANM_COUNT];
UNKWORD WORDS_0x30[ANM_COUNT];
};
class AnmObjMatClrRes;
class AnmObjMatClr : public AnmObj {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
virtual ClrAnmResult *GetResult(); // at 0x38
virtual void Attach(s32, AnmObjMatClrRes *res); // at 0x3C
virtual void Detach(s32); // at 0x40
private:
int mChildrenArraySize;
u16 *mpChildrenArray;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjMatClr);
};
class AnmObjMatClrNode : public AnmObjMatClr {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
inline int Size() {
return mNodeArraySize;
}
AnmObjMatClrRes *GetNode(int i) {
return mpNodes[i];
}
private:
int mNodeArraySize;
AnmObjMatClrRes **mpNodes;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjMatClrNode);
};
class AnmObjMatClrRes : public AnmObjMatClr, public FrameCtrl {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjMatClrRes *Construct(MEMAllocator *, u32 *, ResAnmClr, ResMdl, bool);
private:
ResAnmClr mRes;
TexSrtAnmResult *mpResultCache;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjMatClrRes);
};
class AnmObjMatClrOverride : public AnmObjMatClrNode {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjMatClrOverride *Construct(MEMAllocator *, u32 *, ResMdl, int);
NW4R_G3D_TYPE_OBJ_DECL(AnmObjMatClrOverride);
};
} // namespace g3d
} // namespace nw4r
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_ANMOBJ_H
#define NW4R_G3D_ANMOBJ_H
#include "common.h"
#include "g3d_obj.h"
#include "g3d_rescommon.h"
#include "g3d_resmdl.h"
#include "nw4r/g3d/g3d_obj.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/g3d/g3d_resmdl.h"
namespace nw4r {
namespace g3d {
+4 -4
View File
@@ -1,10 +1,10 @@
#ifndef NW4R_G3D_ANMSCN_H
#define NW4R_G3D_ANMSCN_H
#include "common.h"
#include "g3d_camera.h"
#include "g3d_fog.h"
#include "g3d_light.h"
#include "g3d_obj.h"
#include "nw4r/g3d/g3d_camera.h"
#include "nw4r/g3d/g3d_fog.h"
#include "nw4r/g3d/g3d_light.h"
#include "nw4r/g3d/g3d_obj.h"
namespace nw4r {
namespace g3d {
+99
View File
@@ -0,0 +1,99 @@
#ifndef NW4R_G3D_ANMSHP_H
#define NW4R_G3D_ANMSHP_H
#include "common.h"
#include "nw4r/g3d/g3d_anmobj.h"
#include "nw4r/g3d/g3d_resanmshp.h"
// This header is based on the SS ghidra, the TypeNames in the binary,
// and an assumed symmetry to AnmObjVis. Everything about it could be wrong.
namespace nw4r {
namespace g3d {
class AnmObjShpRes;
class AnmObjShp : public AnmObj {
public:
AnmObjShp(MEMAllocator *, u16 *, int);
virtual bool IsDerivedFrom(TypeObj other) const // at 0x8
{
return (other == GetTypeObjStatic()) ? true : AnmObj::IsDerivedFrom(other);
}
virtual void G3dProc(u32, u32, void *); // at 0xC
virtual ~AnmObjShp() {} // at 0x10
virtual const TypeObj GetTypeObj() const // at 0x14
{
return TypeObj(TYPE_NAME);
}
virtual const char *GetTypeName() const // at 0x18
{
return GetTypeObj().GetTypeName();
}
virtual void SetFrame(f32) = 0; // at 0x1C
virtual f32 GetFrame() const = 0; // at 0x20
virtual void UpdateFrame() = 0; // at 0x24
virtual void SetUpdateRate(f32) = 0; // at 0x28
virtual f32 GetUpdateRate() const = 0; // at 0x2C
virtual bool Bind(ResMdl) = 0; // at 0x30
virtual void Release(); // at 0x34
virtual bool GetResult(u32) = 0; // at 0x38
virtual AnmObjShpRes *Attach(int, AnmObjShpRes *); // at 0x3C
virtual AnmObjShpRes *Detach(int); // at 0x40
static const TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
bool TestDefined(u32 idx) const;
bool TestExistence(u32 idx) const;
void DetachAll();
protected:
static const int MAX_RESOURCES = 4;
int mNumBinds; // at 0x10
u16 *mBinds; // at 0x14
NW4R_G3D_TYPE_OBJ_DECL(AnmObjShp);
};
class AnmObjShpRes : public AnmObjShp, public FrameCtrl {
public:
AnmObjShpRes(MEMAllocator *, ResAnmShp, u16 *, int);
virtual bool IsDerivedFrom(TypeObj other) const // at 0x8
{
return (other == GetTypeObjStatic()) ? true : AnmObjShp::IsDerivedFrom(other);
}
virtual ~AnmObjShpRes() {} // at 0x10
virtual const TypeObj GetTypeObj() const // at 0x14
{
return TypeObj(TYPE_NAME);
}
virtual const char *GetTypeName() const // at 0x18
{
return GetTypeObj().GetTypeName();
}
virtual void SetFrame(f32); // at 0x1C
virtual f32 GetFrame() const; // at 0x20
virtual void UpdateFrame(); // at 0x24
virtual void SetUpdateRate(f32); // at 0x28
virtual f32 GetUpdateRate() const; // at 0x2C
virtual bool Bind(ResMdl); // at 0x30
virtual bool GetResult(u32); // at 0x38
static const TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjShpRes *Construct(MEMAllocator *, u32 *, ResAnmShp, ResMdl, int);
private:
ResAnmShp mResAnmShp; // at 0x2C
NW4R_G3D_TYPE_OBJ_DECL(AnmObjShpRes);
};
} // namespace g3d
} // namespace nw4r
#endif
+72 -2
View File
@@ -1,6 +1,8 @@
#ifndef NW4R_G3D_ANMTEXPAT_H
#define NW4R_G3D_ANMTEXPAT_H
#include "g3d_restex.h"
#include "nw4r/g3d/g3d_anmobj.h"
#include "nw4r/g3d/g3d_restex.h"
#include "nw4r/g3d/g3d_resanmtexpat.h"
namespace nw4r
{
@@ -18,7 +20,75 @@ namespace nw4r
ResTex mTexs[ANM_COUNT]; // at 0x4
ResPltt mPltts[ANM_COUNT]; // at 0x24
};
class AnmObjTexPatRes;
class AnmObjTexPat : public AnmObj {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
virtual TexPatAnmResult *GetResult(); // at 0x38
virtual void Attach(s32, AnmObjTexPatRes *res); // at 0x3C
virtual void Detach(s32); // at 0x40
private:
int mChildrenArraySize;
u16 *mpChildrenArray;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexPat);
};
class AnmObjTexPatNode : public AnmObjTexPat {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
inline int Size() {
return mNodeArraySize;
}
AnmObjTexPatRes *GetNode(int i) {
return mpNodes[i];
}
private:
int mNodeArraySize;
AnmObjTexPatRes **mpNodes;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexPatNode);
};
class AnmObjTexPatRes : public AnmObjTexPat, public FrameCtrl {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjTexPatRes *Construct(MEMAllocator*, u32*, ResAnmTexPat, ResMdl, bool);
private:
ResAnmTexPat mRes;
TexPatAnmResult *mpResultCache;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexPatRes);
};
class AnmObjTexPatOverride : public AnmObjTexPatNode {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjTexPatOverride *Construct(MEMAllocator*, u32*, ResMdl, int);
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexPatOverride);
};
}
}
#endif
#endif
+72 -2
View File
@@ -1,11 +1,81 @@
#ifndef NW4R_G3D_ANMTEXSRT_H
#define NW4R_G3D_ANMTEXSRT_H
#include "g3d_restex.h"
#include "nw4r/g3d/g3d_restex.h"
#include "nw4r/g3d/g3d_resanmtexsrt.h"
namespace nw4r
{
namespace g3d
{
class AnmObjTexSrtRes;
struct TexSrtAnmResult;
class AnmObjTexSrt : public AnmObj {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
virtual TexSrtAnmResult *GetResult(); // at 0x38
virtual void Attach(s32, AnmObjTexSrtRes *res); // at 0x3C
virtual void Detach(s32); // at 0x40
private:
int mChildrenArraySize;
u16 *mpChildrenArray;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexSrt);
};
class AnmObjTexSrtNode : public AnmObjTexSrt {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
inline int Size() {
return mNodeArraySize;
}
AnmObjTexSrtRes *GetNode(int i) {
return mpNodes[i];
}
private:
int mNodeArraySize;
AnmObjTexSrtRes **mpNodes;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexSrtNode);
};
class AnmObjTexSrtRes : public AnmObjTexSrt, public FrameCtrl {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjTexSrtRes *Construct(MEMAllocator*, u32*, ResAnmTexSrt, ResMdl, bool);
private:
ResAnmTexSrt mRes;
TexSrtAnmResult *mpResultCache;
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexSrtRes);
};
class AnmObjTexSrtOverride : public AnmObjTexSrtNode {
public:
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
static AnmObjTexSrtOverride *Construct(MEMAllocator*, u32*, ResMdl, int);
NW4R_G3D_TYPE_OBJ_DECL(AnmObjTexSrtOverride);
};
struct TexSrtTypedef
{
enum TexMatrixMode
@@ -44,4 +114,4 @@ namespace nw4r
}
}
#endif
#endif
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_ANMVIS_H
#define NW4R_G3D_ANMVIS_H
#include "common.h"
#include "g3d_anmobj.h"
#include "g3d_resanmvis.h"
#include "nw4r/g3d/g3d_anmobj.h"
#include "nw4r/g3d/g3d_resanmvis.h"
namespace nw4r {
namespace g3d {
+3 -3
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_G3D_BASIC_H
#define NW4R_G3D_BASIC_H
#include "math_types.h"
#include "g3d_anmchr.h"
#include "nw4r/math/math_types.h"
#include "nw4r/g3d/g3d_anmchr.h"
namespace nw4r
{
@@ -45,4 +45,4 @@ namespace nw4r
}
}
#endif
#endif
+1
View File
@@ -1,6 +1,7 @@
#ifndef NW4R_G3D_CALC_VIEW_H
#define NW4R_G3D_CALC_VIEW_H
#include "common.h"
#include "nw4r/math.h"
namespace nw4r {
namespace g3d {
+30
View File
@@ -1,9 +1,39 @@
#ifndef NW4R_G3D_CALC_WORLD_H
#define NW4R_G3D_CALC_WORLD_H
#include "common.h"
#include "nw4r/math.h"
namespace nw4r {
namespace g3d {
struct FuncObjCalcWorld {
private:
u8 UNK_0x00[0x06];
/** 0x06 */ u16 mNodeId;
public:
u32 GetNodeId() const {
return mNodeId;
}
void SetNodeId(u32 n) {
mNodeId = n;
}
};
class WorldMtxManip {};
// Name from ketteiban
class ICalcWorldCallback {
public:
virtual ~ICalcWorldCallback() {}
virtual void ExecCallbackA(nw4r::g3d::ChrAnmResult *, nw4r::g3d::ResMdl, nw4r::g3d::FuncObjCalcWorld *) {}
virtual void ExecCallbackB(nw4r::g3d::WorldMtxManip *, nw4r::g3d::ResMdl, nw4r::g3d::FuncObjCalcWorld *) {}
virtual void ExecCallbackC(nw4r::math::MTX34 *, nw4r::g3d::ResMdl, nw4r::g3d::FuncObjCalcWorld *) {}
};
void CalcWorld(math::MTX34 *, u32 *, const u8 *, const math::MTX34 *, ResMdl, AnmObjChr *, FuncObjCalcWorld *, u32);
void CalcWorld(math::MTX34 *, u32 *, const u8 *, const math::MTX34 *, ResMdl, AnmObjChr *, FuncObjCalcWorld *);
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_CAMERA_H
#define NW4R_G3D_CAMERA_H
#include "common.h"
#include "g3d_rescommon.h"
#include "math_types.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/math/math_types.h"
#include <rvl/MTX.h>
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_DCC_H
#define NW4R_G3D_DCC_H
#include "common.h"
#include "g3d_anmtexsrt.h"
#include "nw4r/math.h"
#include "nw4r/g3d/g3d_anmtexsrt.h"
namespace nw4r {
namespace g3d {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_G3D_DRAW_H
#define NW4R_G3D_DRAW_H
#include "common.h"
#include "g3d_resmdl.h"
#include "nw4r/g3d/g3d_resmdl.h"
namespace nw4r {
namespace g3d {
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_DRAW1_MAT1_SHP_H
#define NW4R_G3D_DRAW1_MAT1_SHP_H
#include "common.h"
#include "g3d_resmat.h"
#include "g3d_resshp.h"
#include "nw4r/g3d/g3d_resmat.h"
#include "nw4r/g3d/g3d_resshp.h"
namespace nw4r {
namespace g3d {
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_FOG_H
#define NW4R_G3D_FOG_H
#include "common.h"
#include "g3d_rescommon.h"
#include "math_types.h"
#include "ut_Color.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/math/math_types.h"
#include "nw4r/ut/ut_Color.h"
#include <rvl/GX.h>
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_GPU_H
#define NW4R_G3D_GPU_H
#include "common.h"
#include "g3d_rescommon.h"
#include "math_types.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/math/math_types.h"
#include <rvl/GX.h>
-6
View File
@@ -5,12 +5,6 @@
namespace nw4r {
namespace g3d {
inline void InitFastCast() {
OSInitFastCast();
OSSetGQR6(7, 5);
OSSetGQR7(7, 8);
}
void G3dInit(bool);
void G3dReset();
} // namespace g3d
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_LIGHT_H
#define NW4R_G3D_LIGHT_H
#include "common.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/math.h"
#include <rvl/GX.h>
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_MAYA_H
#define NW4R_G3D_MAYA_H
#include "common.h"
#include "g3d_anmtexsrt.h"
#include "nw4r/g3d/g3d_anmtexsrt.h"
#include "nw4r/math.h"
namespace nw4r {
namespace g3d {
+5 -1
View File
@@ -90,6 +90,7 @@ public:
}
void Destroy();
void DetachFromParent();
G3dObj(MEMAllocator *pAllocator, G3dObj *pParent) : mAllocator(pAllocator), mParent(pParent) {}
@@ -115,7 +116,10 @@ public:
template <typename T>
static T *DynamicCast(G3dObj *obj) {
return (obj != NULL && obj->IsDerivedFrom(T::GetTypeObjStatic())) ? static_cast<T *>(obj) : NULL;
if (obj != nullptr && obj->IsDerivedFrom(T::GetTypeObjStatic())) {
return static_cast<T *>(obj);
}
return nullptr;
}
private:
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_RESANMCAMERA_H
#define NW4R_G3D_RESANMCAMERA_H
#include "common.h"
#include "g3d_anmcamera.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_anmcamera.h"
#include "nw4r/g3d/g3d_rescommon.h"
namespace nw4r {
namespace g3d {
+16 -1
View File
@@ -1,13 +1,18 @@
#ifndef NW4R_G3D_RESANMCHR_H
#define NW4R_G3D_RESANMCHR_H
#include "common.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_rescommon.h"
namespace nw4r {
namespace g3d {
struct ResAnmChrData {
char UNK_0x0[0x8];
u32 mRevision; // at 0x8
char UNK_0xC[0x4];
s32 mMatDictOffset; // at 0x10
char UNK_0x14[0x0C];
u16 mNumFrames; // at 0x20
AnmPolicy mAnmPolicy; // at 0x24
};
struct ResAnmChr {
@@ -20,6 +25,16 @@ struct ResAnmChr {
inline bool CheckRevision() const {
return mAnmChr.ref().mRevision == REVISION;
}
AnmPolicy GetAnmPolicy() const
{
return mAnmChr.ref().mAnmPolicy;
}
int GetNumFrame() const
{
return mAnmChr.ref().mNumFrames;
}
};
} // namespace g3d
} // namespace nw4r
+17 -3
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_RESANMCLR_H
#define NW4R_G3D_RESANMCLR_H
#include "g3d_resdict.h"
#include "g3d_resanm.h"
#include "nw4r/g3d/g3d_resdict.h"
#include "nw4r/g3d/g3d_resanm.h"
#include "nw4r/g3d/g3d_anmclr.h"
namespace nw4r
{
@@ -32,6 +33,9 @@ namespace nw4r
char UNK_0xC[0x4];
s32 mMatDictOffset; // at 0x10
ResAnmClrInfoData mInfo; // at 0x14
char UNK_0x1E[0x2];
u16 mNumFrames; // at 0x20
AnmPolicy mAnmPolicy; // at 0x24
};
struct ResAnmClr
@@ -54,6 +58,16 @@ namespace nw4r
{
return ref().mRevision == REVISION;
}
AnmPolicy GetAnmPolicy() const
{
return ref().mAnmPolicy;
}
int GetNumFrame() const
{
return ref().mNumFrames;
}
inline const ResAnmClrMatData * GetMatAnm(u32 i) const
{
@@ -65,4 +79,4 @@ namespace nw4r
}
}
#endif
#endif
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_RESANMFOG_H
#define NW4R_G3D_RESANMFOG_H
#include "common.h"
#include "g3d_anmfog.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_anmfog.h"
#include "nw4r/g3d/g3d_rescommon.h"
namespace nw4r {
namespace g3d {
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_RESANMSCN_H
#define NW4R_G3D_RESANMSCN_H
#include "common.h"
#include "g3d_resanmcamera.h"
#include "g3d_resanmfog.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_resanmcamera.h"
#include "nw4r/g3d/g3d_resanmfog.h"
#include "nw4r/g3d/g3d_rescommon.h"
namespace nw4r {
namespace g3d {
+13 -1
View File
@@ -1,13 +1,17 @@
#ifndef NW4R_G3D_RESANMSHP_H
#define NW4R_G3D_RESANMSHP_H
#include "common.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_anmobj.h"
#include "nw4r/g3d/g3d_rescommon.h"
namespace nw4r {
namespace g3d {
struct ResAnmShpData {
char UNK_0x0[0x8];
u32 mRevision; // at 0x8
char UNK_0xC[0x24 - 0xC];
u16 mNumFrames; // at 0x24
AnmPolicy mAnmPolicy; // at 0x28
};
struct ResAnmShp {
@@ -20,6 +24,14 @@ struct ResAnmShp {
inline bool CheckRevision() const {
return mAnmShp.ref().mRevision == REVISION;
}
AnmPolicy GetAnmPolicy() const {
return mAnmShp.ref().mAnmPolicy;
}
int GetNumFrame() const {
return mAnmShp.ref().mNumFrames;
}
};
} // namespace g3d
} // namespace nw4r
+16 -3
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_RESANMTEXPAT_H
#define NW4R_G3D_RESANMTEXPAT_H
#include "g3d_resdict.h"
#include "g3d_resanm.h"
#include "nw4r/g3d/g3d_resdict.h"
#include "nw4r/g3d/g3d_resfile.h"
#include "nw4r/g3d/g3d_resanm.h"
namespace nw4r
{
@@ -51,6 +52,8 @@ namespace nw4r
char UNK_0x24[0xC];
u16 mTexCount; // at 0x30
u16 mPlttCount; // at 0x32
char UNK_0x34[0x4];
AnmPolicy mAnmPolicy; // at 0x38
};
struct ResAnmTexPat
@@ -78,6 +81,16 @@ namespace nw4r
{
return static_cast<const ResAnmTexPatMatData *>(mAnmTexPat.ofs_to_obj<ResDic>(ref().mMatDictOffset)[i]);
}
AnmPolicy GetAnmPolicy() const
{
return ref().mAnmPolicy;
}
int GetNumFrame() const
{
return ref().mTexCount;
}
void GetAnmResult(TexPatAnmResult *, u32, float) const;
@@ -87,4 +100,4 @@ namespace nw4r
}
}
#endif
#endif
+18 -3
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_RESANMTEXSRT_H
#define NW4R_G3D_RESANMTEXSRT_H
#include "g3d_resanm.h"
#include "g3d_resdict.h"
#include "nw4r/g3d/g3d_resanm.h"
#include "nw4r/g3d/g3d_resdict.h"
#include "nw4r/g3d/g3d_anmtexsrt.h"
namespace nw4r
{
@@ -27,6 +28,10 @@ namespace nw4r
u32 mRevision; // at 0x8
char UNK_0xC[0x4];
s32 mMatDictOffset; // at 0x10
char UNK_0x14[0x0C];
u16 mNumFrames; // at 0x20
UNKWORD UNK_0x24;
AnmPolicy mAnmPolicy; // at 0x28
};
struct ResAnmTexSrt
@@ -54,10 +59,20 @@ namespace nw4r
{
return static_cast<const ResAnmTexSrtMatData *>(mAnmTexSrt.ofs_to_obj<ResDic>(ref().mMatDictOffset)[i]);
}
AnmPolicy GetAnmPolicy() const
{
return ref().mAnmPolicy;
}
int GetNumFrame() const
{
return ref().mNumFrames;
}
void GetAnmResult(TexSrtAnmResult *, u32, float) const;
};
}
}
#endif
#endif
+7 -7
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_RESANMVIS_H
#define NW4R_G3D_RESANMVIS_H
#include "g3d_resdict.h"
#include "g3d_resanm.h"
#include "g3d_anmobj.h"
#include "nw4r/g3d/g3d_resdict.h"
#include "nw4r/g3d/g3d_resanm.h"
#include "nw4r/g3d/g3d_anmobj.h"
namespace nw4r
{
@@ -10,10 +10,10 @@ namespace nw4r
{
struct ResAnmVisInfoData
{
char UNK_0x0[0x8];
u16 mNumFrames; // at 0x1C
char UNK_0x0[0xC];
u16 mNumFrames; // at 0x20
u16 mNumNodes;
AnmPolicy mAnmPolicy; // at 0x20
AnmPolicy mAnmPolicy; // at 0x24
};
struct ResAnmVisNodeData
@@ -79,4 +79,4 @@ namespace nw4r
}
}
#endif
#endif
+15 -15
View File
@@ -1,31 +1,31 @@
#ifndef NW4R_G3D_RESDICT_H
#define NW4R_G3D_RESDICT_H
#include "common.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include <string.h>
namespace nw4r {
namespace g3d {
struct ResDicEntry {
u16 INT_0x0; // at 0x0
u16 INT_0x2; // at 0x2
u16 unk_index; // at 0x4
u16 unk_index2; // at 0x6
u32 INT_0x8; // at 0x8
u32 INT_0xC; // at 0xC
struct ResDicNodeData {
u16 ref; // at 0x0
u16 flag; // at 0x2
u16 idxLeft; // at 0x4
u16 idxRight; // at 0x6
u32 ofsString; // at 0x8
u32 ofsData; // at 0xC
};
struct ResDicData {
u32 mSize; // at 0x0
u32 mNumData; // at 0x4
ResDicEntry mEntries[]; // 0x8
u32 size; // at 0x0
u32 numData; // at 0x4
ResDicNodeData data[1]; // 0x8
};
struct ResDic {
ResCommon<ResDicData> mDict;
ResDicEntry *Get(ResName) const;
ResDicEntry *Get(const char *, u32) const;
ResDicNodeData *Get(ResName) const;
ResDicNodeData *Get(const char *, u32) const;
void *operator[](const char *) const;
void *operator[](ResName) const;
s32 GetIndex(ResName) const;
@@ -34,7 +34,7 @@ struct ResDic {
inline void *operator[](int i) const {
if (mDict.IsValid()) {
return (void *)mDict.ofs_to_ptr<void>(mDict.ref().mEntries[i + 1].INT_0xC);
return (void *)mDict.ofs_to_ptr<void>(mDict.ref().data[i + 1].ofsData);
}
return NULL;
@@ -42,7 +42,7 @@ struct ResDic {
inline u32 GetNumData() const {
if (mDict.IsValid()) {
return mDict.ref().mNumData;
return mDict.ref().numData;
}
return 0;
+6 -3
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_RESFILE_H
#define NW4R_G3D_RESFILE_H
#include "common.h"
#include "g3d_rescommon.h"
#include "g3d_resdict.h"
#include "ut_binaryFileFormat.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/g3d/g3d_resdict.h"
#include "nw4r/ut/ut_binaryFileFormat.h"
namespace nw4r {
namespace g3d {
@@ -18,6 +18,9 @@ struct ResFileData {
struct ResFile {
ResCommon<ResFileData> mFile; // at 0x0
ResFile(): mFile((void*)nullptr) {}
ResFile(void *ptr): mFile(ptr) {}
inline ResFileData &ref() const {
return mFile.ref();
}
+114 -30
View File
@@ -1,21 +1,63 @@
#ifndef NW4R_G3D_RESMAT_H
#define NW4R_G3D_RESMAT_H
#include "common.h"
#include "g3d_rescommon.h"
#include "math_types.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/math/math_types.h"
#include <rvl/GX.h>
namespace nw4r {
namespace g3d {
struct ResMatTexCoordGenData {};
struct ResMatTexCoordGen {
ResCommon<ResMatTexCoordGenData> mTexGen; // at 0x0
struct ResTevColorDL {
union {
struct {
u8 tevColor[3][20]; // offset 0x0, size 0x3C
u8 _0[4]; // offset 0x3C, size 0x4
u8 tevKColor[4][10]; // offset 0x40, size 0x28
u8 _1[24]; // offset 0x68, size 0x18
} dl;
u8 data[128];
};
};
inline ResMatTexCoordGen(void *vptr) : mTexGen(vptr) {}
struct ResMatTevColor : public ResCommon<ResTevColorDL> {
ResMatTevColor(void *vptr) : ResCommon<ResTevColorDL>(vptr) {}
void DCStore(bool sync);
void CallDisplayList(bool bSync) const;
ResMatTevColor CopyTo(void *p) const;
void GXGetTevColor(GXTevRegID id, GXColor *color);
void GXSetTevColor(GXTevRegID id, GXColor color);
void GXSetTevKColor(GXTevKColorID id, GXColor color);
};
struct ResPixDL {
union {
struct {
unsigned char alphaCompare[5]; // offset 0x0, size 0x5
unsigned char zMode[5]; // offset 0x5, size 0x5
unsigned char blendMode[10]; // offset 0xA, size 0xA
unsigned char setDstAlpha[5]; // offset 0x14, size 0x5
unsigned char _[7]; // offset 0x19, size 0x7
} dl; // offset 0x0, size 0x20
unsigned char data[32]; // offset 0x0, size 0x20
};
};
struct ResMatPix : public ResCommon<ResPixDL> {
ResMatPix(void *vptr) : ResCommon(vptr) {}
void DCStore(bool sync);
void CallDisplayList(bool bSync) const;
ResMatPix CopyTo(void *p) const;
void GXSetBlendMode(GXBlendMode, GXBlendFactor, GXBlendFactor, GXLogicOp);
};
struct ResTexCoordGenDL {};
struct ResMatTexCoordGen : public ResCommon<ResTexCoordGenDL> {
inline ResMatTexCoordGen(void *vptr) : ResCommon(vptr) {}
bool IsValid() const {
return mTexGen.IsValid();
return ResCommon::IsValid();
}
bool GXGetTexCoordGen2(GXTexCoordID, GXTexGenType *, GXTexGenSrc *, u8 *, u32 *);
@@ -23,15 +65,18 @@ struct ResMatTexCoordGen {
void DCStore(bool);
};
struct ResTexSrtData {};
struct ResTexSrtData {
union {
struct {
unsigned char texCoordGen[8][18]; // offset 0x0, size 0x90
unsigned char _[16]; // offset 0x90, size 0x10
} dl; // offset 0x0, size 0xA0
unsigned char data[160]; // offset 0x0, size 0xA0
};
};
struct ResTexSrt {
ResCommon<ResTexSrtData> mTexSrt; // at 0x0
inline ResTexSrt(void *vptr) : mTexSrt(vptr) {}
bool IsValid() const {
return mTexSrt.IsValid();
}
struct ResTexSrt : public ResCommon<ResTexSrtData> {
inline ResTexSrt(void *vptr) : ResCommon(vptr) {}
void SetMapMode(u32, u32, int, int);
};
@@ -52,32 +97,71 @@ struct ResTexPlttInfo {
};
struct ResMatDLData {
char UNK_0x0[0xE0];
ResMatTexCoordGenData texCoordGenData; // at 0xE0
ResPixDL dlPix; // offset 0x0, size 0x20
ResTevColorDL dlTevColor; // offset 0x20, size 0x80
/* ResIndMtxAndScaleDL */ u8 dlIndMtxAndScale[0x40]; // offset 0xA0, size 0x40
ResTexCoordGenDL dlTexCoordGen; // offset 0xE0, size 0xA0
};
struct ResGenModeData {
u8 nTexGens; // offset 0x0, size 0x1
u8 nChans; // offset 0x1, size 0x1
u8 nTevs; // offset 0x2, size 0x1
u8 nInds; // offset 0x3, size 0x1
GXCullMode cullMode; // offset 0x4, size 0x4
};
struct ResGenMode : public ResCommon<ResGenModeData> {
ResGenMode(void *vptr) : ResCommon(vptr) {}
void DCStore(bool sync);
ResGenMode CopyTo(void *p) const;
GXCullMode GXGetCullMode();
u8 GXGetNumIndStages() const;
u8 GXGetNumTevStages() const;
u8 GXGetNumChans() const;
u8 GXGetNumTexGens() const;
void GXSetCullMode(GXCullMode);
};
struct ResMatData {
char UNK_0x0[0x38];
u32 resMatDLOfs; // at 0x38
char UNK_0x3C[0x1A4 - 0x3C];
ResTexSrtData texSrtData; // at 0x1A4
u32 size; // offset 0x0, size 0x4
s32 toResMdlData; // offset 0x4, size 0x4
s32 name; // offset 0x8, size 0x4
u32 id; // offset 0xC, size 0x4
u32 flag; // offset 0x10, size 0x
ResGenModeData genMode; // offset 0x14, size 0x8
/* ResMatMiscData */ u8 misc[0xC]; // offset 0x1C, size 0xC
s32 toResTevData; // offset 0x28, size 0x4
u32 numResTexPlttInfo; // offset 0x2C, size 0x4
s32 toResTexPlttInfo; // offset 0x30, size 0x4
s32 toResMatFurData; // offset 0x34, size 0x4
u32 toResUserData; // offset 0x38, size 0x4
u32 toResMatDLData; // offset 0x3C, size 0x4
/* ResTexObjData */ u8 texObjData[0x104]; // offset 0x40, size 0x104
/* ResTlutObjData */ u8 tlutObjData[0x64]; // offset 0x144, size 0x64
ResTexSrtData texSrtData; // offset 0x1A8, size 0x248
/* ResChanData */ u8 chan[0x20]; // offset 0x3F0, size 0x28
};
struct ResMat {
ResCommon<ResMatData> mMat;
struct ResMat : public ResCommon<ResMatData> {
ResMatTevColor GetResMatTevColor() {
return ResMatTevColor(&ofs_to_ptr<ResMatDLData>(ref().toResMatDLData)->dlTevColor);
}
inline ResMat(void *vptr) : mMat(vptr) {}
bool IsValid() const {
return mMat.IsValid();
ResMatPix GetResMatPix() {
return ResMatPix(&ofs_to_ptr<ResMatDLData>(ref().toResMatDLData)->dlPix);
}
ResGenMode GetResGenMode() {
return ResGenMode(&ref().genMode);
}
ResTexSrt GetResTexSrt() {
return ResTexSrt(&mMat.ref().texSrtData);
return ResTexSrt(&ref().texSrtData);
}
ResMatTexCoordGen GetResMatTexCoordGen() {
ResMatDLData *dlData = mMat.ofs_to_ptr<ResMatDLData>(mMat.ref().resMatDLOfs);
return ResMatTexCoordGen(&dlData->texCoordGenData);
return ResMatTexCoordGen(&ofs_to_ptr<ResMatDLData>(ref().toResMatDLData)->dlTexCoordGen);
}
bool Bind(ResFile);
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_RESMDL_H
#define NW4R_G3D_RESMDL_H
#include "common.h"
#include "g3d_rescommon.h"
#include "g3d_resdict.h"
#include "g3d_resnode.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/g3d/g3d_resdict.h"
#include "nw4r/g3d/g3d_resnode.h"
namespace nw4r {
namespace g3d {
+5 -3
View File
@@ -1,12 +1,14 @@
#ifndef NW4R_G3D_RESNODE_H
#define NW4R_G3D_RESNODE_H
#include "common.h"
#include "g3d_anmchr.h"
#include "g3d_rescommon.h"
#include "math_types.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/math/math_types.h"
namespace nw4r {
namespace g3d {
class ChrAnmResult;
struct ResNodeData {
u32 INT_0x0;
s32 INT_0x4;
+3 -3
View File
@@ -1,8 +1,8 @@
#ifndef NW4R_G3D_RESSHP_H
#define NW4R_G3D_RESSHP_H
#include "g3d_rescommon.h"
#include "g3d_resmdl.h"
#include "g3d_resvtx.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include "nw4r/g3d/g3d_resmdl.h"
#include "nw4r/g3d/g3d_resvtx.h"
#include <GXAttr.h>#include "common.h"
+3 -3
View File
@@ -2,8 +2,8 @@
#define NW4R_G3D_RESTEV_H
#include <GXTev.h>
#include <GXTexture.h>
#include "g3d_cpu.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_cpu.h"
#include "nw4r/g3d/g3d_rescommon.h"
namespace nw4r
{
@@ -58,4 +58,4 @@ namespace nw4r
}
}
#endif
#endif
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_G3D_RESTEX_H
#define NW4R_G3D_RESTEX_H
#include "common.h"
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_rescommon.h"
#include <rvl/GX.h>
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_G3D_RESVTX_H
#define NW4R_G3D_RESVTX_H
#include <GXAttr.h>
#include "g3d_rescommon.h"
#include "nw4r/g3d/g3d_rescommon.h"
namespace nw4r
{
@@ -155,4 +155,4 @@ namespace nw4r
}
}
#endif
#endif
+12 -5
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_SCN_MDL_H
#define NW4R_G3D_SCN_MDL_H
#include "common.h"
#include "g3d_draw.h"
#include "g3d_resmat.h"
#include "g3d_scnmdlsmpl.h"
#include "nw4r/g3d/g3d_draw.h"
#include "nw4r/g3d/g3d_resmat.h"
#include "nw4r/g3d/g3d_scnmdlsmpl.h"
namespace nw4r {
namespace g3d {
@@ -12,13 +12,20 @@ public:
class CopiedMatAccess {
public:
CopiedMatAccess(ScnMdl *, u32);
ResTexSrt GetResTexSrtEx();
ResTexSrt GetResTexSrtEx(bool);
ResMatPix GetResMatPix(bool);
ResMatTevColor GetResMatTevColor(bool);
ResGenMode GetResGenMode(bool);
private:
char UNK_0x0[0x2C];
char UNK_0x0[0x34];
};
public:
virtual bool SetAnmObj(AnmObj *p, AnmObjType type) override;
static ScnMdl *Construct(MEMAllocator *, unsigned long *, nw4r::g3d::ResMdl, u32 bufferOption, int);
static const G3dObj::TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_SCN_MDL1_MAT1_SHP_H
#define NW4R_G3D_SCN_MDL1_MAT1_SHP_H
#include "common.h"
#include "g3d_resmat.h"
#include "g3d_resshp.h"
#include "g3d_scnobj.h"
#include "nw4r/g3d/g3d_resmat.h"
#include "nw4r/g3d/g3d_resshp.h"
#include "nw4r/g3d/g3d_scnobj.h"
namespace nw4r {
namespace g3d {
+35 -2
View File
@@ -1,8 +1,10 @@
#ifndef NW4R_G3D_SCN_MDL_SIMPLE_H
#define NW4R_G3D_SCN_MDL_SIMPLE_H
#include "common.h"
#include "g3d_resmdl.h"
#include "g3d_scnobj.h"
#include "nw4r/g3d/g3d_calcworld.h"
#include "nw4r/g3d/g3d_resmdl.h"
#include "nw4r/g3d/g3d_scnobj.h"
#include "nw4r/math/math_types.h"
namespace nw4r {
namespace g3d {
@@ -15,13 +17,31 @@ public:
BYTE_CODE_DRAW_XLU,
};
enum AnmObjType {
ANMOBJTYPE_CHR = 0,
ANMOBJTYPE_VIS = 1,
ANMOBJTYPE_MATCLR = 2,
ANMOBJTYPE_TEXPAT = 3,
ANMOBJTYPE_TEXSRT = 4,
ANMOBJTYPE_SHP = 5,
ANMOBJTYPE_NOT_SPECIFIED = 6,
ANMOBJTYPE_VTX = 5,
};
public:
ScnMdlSimple(MEMAllocator *, ResMdl, math::MTX34 *, u32 *, math::MTX34 *, math::MTX33 *, math::MTX34 *, int, int);
static ScnMdlSimple *Construct(MEMAllocator *, unsigned long *, nw4r::g3d::ResMdl, int);
bool GetScnMtxPos(math::MTX34 *pOut, ScnObjMtxType tp, u32 nodeID) const;
virtual bool IsDerivedFrom(TypeObj other) const // at 0x8
{
return (other == GetTypeObjStatic()) ? true : ScnLeaf::IsDerivedFrom(other);
}
static const TypeObj GetTypeObjStatic() {
return TypeObj(TYPE_NAME);
}
virtual void G3dProc(u32, u32, void *); // at 0xC
virtual ~ScnMdlSimple(); // at 0x10
virtual const TypeObj GetTypeObj() const // at 0x14
@@ -33,7 +53,14 @@ public:
return GetTypeObj().GetTypeName();
}
virtual bool SetAnmObj(AnmObj *p, AnmObjType type);
virtual bool RemoveAnmObj(AnmObj *p);
virtual bool RemoveAnmObj(AnmObjType type);
virtual AnmObj *GetAnmObj(AnmObjType type);
virtual AnmObj *GetAnmObj(AnmObjType type) const;
const u8 *GetByteCode(ByteCodeType) const;
void EnableScnMdlCallbackTiming(Timing);
const ResMdl GetResMdl() const {
return mResMdl;
@@ -53,6 +80,10 @@ public:
return mNumViewMtx;
}
void SetCalcWorldCallback(ICalcWorldCallback *cb) {
mpCalcWorldCallback = cb;
}
private:
ResMdl mResMdl; // at 0xE8
math::MTX34 *mWldMatrixArray; // at 0xEC
@@ -68,6 +99,8 @@ private:
void *mByteCodeMix; // at 0x10C
void *mByteCodeDrawOpa; // at 0x110
void *mByteCodeDrawXlu; // at 0x114
UNKWORD WORD_0x118;
ICalcWorldCallback *mpCalcWorldCallback; // at 0x11C
NW4R_G3D_TYPE_OBJ_DECL(ScnMdlSimple);
};
+46 -21
View File
@@ -1,9 +1,9 @@
#ifndef NW4R_G3D_SCNOBJ_H
#define NW4R_G3D_SCNOBJ_H
#include "common.h"
#include "g3d_obj.h"
#include "math_geometry.h"
#include "math_types.h"
#include "nw4r/g3d/g3d_obj.h"
#include "nw4r/math/math_geometry.h"
#include "nw4r/math/math_types.h"
namespace nw4r {
namespace g3d {
@@ -23,25 +23,25 @@ public:
enum ForEachResult { FOREACH_RESULT_0, FOREACH_RESULT_1 };
enum ScnObjFlag {
FLAG_1 = 0x1,
FLAG_2 = 0x2,
FLAG_4 = 0x4,
FLAG_8 = 0x8,
FLAG_10 = 0x10,
FLAG_20 = 0x20,
FLAG_40 = 0x40,
FLAG_80 = 0x80,
FLAG_10000000 = 0x10000000,
FLAG_20000000 = 0x20000000,
FLAG_40000000 = 0x40000000,
FLAG_80000000 = 0x80000000,
FLAG_60 = FLAG_40 | FLAG_20
SCNOBJFLAG_DISABLE_CALC_WORLD = 1,
SCNOBJFLAG_DISABLE_CALC_MAT = 2,
SCNOBJFLAG_DISABLE_CALC_VTX = 4,
SCNOBJFLAG_DISABLE_CALC_VIEW = 8,
SCNOBJFLAG_DISABLE_GATHER_SCNOBJ = 16,
SCNOBJFLAG_DISABLE_DRAW_OPA = 32,
SCNOBJFLAG_DISABLE_DRAW_XLU = 64,
SCNOBJFLAG_DISABLE_UPDATEFRAME = 128,
SCNOBJFLAG_IGNORE_ANMCHR_TRANS = 256,
SCNOBJFLAG_ENABLE_CULLING = 268435456,
SCNOBJFLAG_NOT_GATHER_DRAW_OPA = 536870912,
SCNOBJFLAG_NOT_GATHER_DRAW_XLU = 1073741824,
SCNOBJFLAG_MTX_LOCAL_IDENTITY = -2147483648,
SCNOBJFLAG_DISABLE_DRAW = 96,
};
enum ScnObjMtxType { MTX_TYPE_0, MTX_TYPE_WORLD, MTX_TYPE_VIEW, MTX_TYPE_MAX };
enum ScnObjMtxType { MTX_TYPE_LOCAL, MTX_TYPE_WORLD, MTX_TYPE_VIEW, MTX_TYPE_MAX };
enum Timing { TIMING_1 = 0x1, TIMING_2 = 0x2, TIMING_4 = 0x4 };
enum Timing { TIMING_1 = 0x1, TIMING_2 = 0x2, TIMING_4 = 0x4, TIMING_ALL = 0x7 };
enum ExecOp { EXEC_OP_1 = 0x1, EXEC_OP_2 = 0x2, EXEC_OP_4 = 0x4 };
@@ -88,6 +88,13 @@ public:
void EnableScnObjCallbackExecOp(ExecOp);
bool SetBoundingVolume(ScnObjBoundingVolumeType, const math::AABB *);
bool GetBoundingVolume(ScnObjBoundingVolumeType, math::AABB *) const;
void SetCallback(IScnObjCallback *cb) {
mCallback = cb;
}
IScnObjCallback *GetScnObjCallback() {
return mCallback;
}
const math::MTX34 *GetMtxPtr(ScnObjMtxType type) const {
return &mMatrices[type];
@@ -202,6 +209,22 @@ public:
ScaleProperty GetScaleProperty() const;
void DefG3dProcScnLeaf(u32, u32, void *);
inline void SetScale(f32 x, f32 y, f32 z) {
mScale.x = x;
mScale.y = y;
mScale.z = z;
}
inline void SetScale(const math::VEC3 &scale) {
mScale = scale;
}
inline void GetScale(math::VEC3 *scale) const {
if (scale) {
*scale = mScale;
}
}
private:
math::VEC3 mScale;
@@ -235,6 +258,10 @@ public:
return TypeObj(TYPE_NAME);
}
bool PushBack(ScnObj *obj) {
return Insert(Size(), obj);
}
bool Empty() const {
return mSize == 0;
}
@@ -263,8 +290,6 @@ public:
void ScnGroup_G3DPROC_CALC_VIEW(u32, const math::MTX34 *);
void DefG3dProcScnGroup(u32, u32, void *);
bool PushBack(ScnObj *);
ScnObj **mObjects; // at 0xDC
u32 mCapacity; // at 0xE0
u32 mSize; // at 0xE4
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_G3D_SCNPROC_H
#define NW4R_G3D_SCNPROC_H
#include "common.h"
#include "g3d_scnobj.h"
#include "nw4r/g3d/g3d_scnobj.h"
namespace nw4r {
namespace g3d {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_G3D_SCNRFL_H
#define NW4R_G3D_SCNRFL_H
#include "common.h"
#include "g3d_scnleaf.h"
#include "nw4r/g3d/g3d_scnobj.h"
#include <RFL/RFL_MiddleDatabase.h>
#include <RFL/RFL_Model.h>
+14 -4
View File
@@ -1,9 +1,10 @@
#ifndef NW4R_G3D_SCNROOT_H
#define NW4R_G3D_SCNROOT_H
#include "common.h"
#include "g3d_camera.h"
#include "g3d_fog.h"
#include "g3d_scnobj.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"
namespace nw4r {
namespace g3d {
@@ -14,6 +15,9 @@ public:
void SetCurrentCamera(int);
Fog GetFog(int);
static ScnRoot *Construct(MEMAllocator *pHeap, u32 *pSize, u32 maxNumChildren, u32 maxNumScnObj, u32 numLightObj,
u32 numLightSet);
void UpdateFrame();
void CalcWorld();
void CalcMaterial();
@@ -28,11 +32,17 @@ public:
return mCameraId;
}
inline LightSetting *getLightSetting() {
return &mLightSetting;
}
private:
UNKWORD WORD_0xE8;
UNKWORD WORD_0xEC;
UNKWORD WORD_0xF0;
u8 mCameraId;
/* 0x00F4 */ u8 mCameraId;
u8 unk1[0x2878 - 0x00F8];
/* 0x2878 */ LightSetting mLightSetting;
};
} // namespace g3d
} // namespace nw4r
+4
View File
@@ -1,6 +1,7 @@
#ifndef NW4R_G3D_STATE_H
#define NW4R_G3D_STATE_H
#include "common.h"
#include "nw4r/math.h"
#include <rvl/GX.h>
namespace nw4r {
@@ -12,6 +13,9 @@ void SetViewPosNrmMtxArray(const math::MTX34 *, const math::MTX33 *, const math:
void SetRenderModeObj(const GXRenderModeObj &);
GXRenderModeObj &GetRenderModeObj();
void LoadLightSet(int idx_lightset, u32 *mask_diff_color /* r1+0xC */, u32 *mask_diff_alpha, u32 *mask_spec_color,
u32 *mask_spec_alpha, AmbLightObj *amb);
void Invalidate(u32);
} // namespace G3DState
} // namespace g3d
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef NW4R_G3D_XSI_H
#define NW4R_G3D_XSI_H
#include "common.h"
#include "g3d_anmtexsrt.h"
#include "nw4r/math.h"
#include "nw4r/g3d/g3d_anmtexsrt.h"
namespace nw4r {
namespace g3d {
+2 -2
View File
@@ -2,7 +2,7 @@
#define NW4R_SND_SOUND_3D_ACTOR_H
#include "snd_BasicSound.h"
#include "snd_SoundActor.h"
#include "math_types.h"
#include "nw4r/math/math_types.h"
namespace nw4r
{
@@ -37,4 +37,4 @@ namespace nw4r
}
}
#endif
#endif
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef NW4R_SND_SOUND_3D_LISTENER_H
#define NW4R_SND_SOUND_3D_LISTENER_H
#include "common.h"
#include "math_types.h"
#include "nw4r/math/math_types.h"
namespace nw4r {
namespace snd {
+2 -2
View File
@@ -4,7 +4,7 @@
#include "snd_SoundArchive.h"
#include "snd_SoundActor.h"
#include "snd_InstancePool.h"
#include "math_types.h"
#include "nw4r/math/math_types.h"
namespace nw4r
{
@@ -50,4 +50,4 @@ namespace nw4r
}
}
#endif
#endif