diff --git a/include/UnknownTypeBelongings.h b/include/UnknownTypeBelongings.h index 177c7f23..0dac36a6 100644 --- a/include/UnknownTypeBelongings.h +++ b/include/UnknownTypeBelongings.h @@ -26,4 +26,15 @@ struct ObjInfoPtr { /* 0x08 */ u16 fiTextEntryId; /* 0x0A */ u8 unk_0xA; /* 0x0B */ u8 subtype; +}; + +class fBase_c; +struct ActorReference { + ActorReference* prev; + ActorReference* next; + fBase_c* link; +}; + +class UnkCollider { + }; \ No newline at end of file diff --git a/include/d/a/en/d_a_en_base.h b/include/d/a/en/d_a_en_base.h index a4150a87..f4961976 100644 --- a/include/d/a/en/d_a_en_base.h +++ b/include/d/a/en/d_a_en_base.h @@ -5,6 +5,6 @@ // Ghidra: ActorEnemyBase // size: // non-official name -class dAcEnBase_c : public dAcOBase_c { +class dAcEnBase_c : public dAcObjBase_c { }; \ No newline at end of file diff --git a/include/d/a/npc/d_a_npc.h b/include/d/a/npc/d_a_npc.h index dca5b929..5c414adc 100644 --- a/include/d/a/npc/d_a_npc.h +++ b/include/d/a/npc/d_a_npc.h @@ -7,6 +7,6 @@ // Ghidra: ActorNpcBase // size: 0x6e4 // official name -class dAcNpc_c : public dAcOBase_c { +class dAcNpc_c : public dAcObjBase_c { }; \ No newline at end of file diff --git a/include/d/a/obj/d_a_obj_base.h b/include/d/a/obj/d_a_obj_base.h index 7afc5e76..7bf7d920 100644 --- a/include/d/a/obj/d_a_obj_base.h +++ b/include/d/a/obj/d_a_obj_base.h @@ -1,10 +1,87 @@ #pragma once #include +#include // Ghidra: ActorObjectBase // size: 0x330 +// vtable: 0x805015b8 // non-official name -class dAcOBase_c : public dAcBase_c { +class dAcObjBase_c : public dAcBase_c { +public: + // Data Members + +public: + // could be their own thing? + /* 8002de40 */ static void* getOarcFile(char* oarcName, char* fileName); + /* 8002de60 */ static void* getOarcSubEntry(char* oarcName, char* fileName); + /* 8002de80 */ static void* getOarcResFile(char* oarcName); + /* 8002de90 */ static void* getOarcModelFile(char* oarcName); + /* 8002dea0 */ static void* getOarcZev(char* oarcName); + /* 8002deb0 */ static void* getOarcDZB(char* dzbName); + /* 8002ded0 */ static void* getOarcPLC(char* plcName); + +public: + /* 8002def0 */ dAcObjBase_c(); + /* 8002e050 */ virtual ~dAcObjBase_c(); + /* 8002e0e0 */ virtual int preCreate(); + /* 8002e150 */ virtual int preExecute(); + /* 8002e2a0 */ virtual void postExecute(); + /* 8002e330 */ virtual int preDraw(); + /* 8002e5b0 */ virtual void* getObjectListEntry(); + /* 8002e5c0 */ virtual bool restorePosRotFromCopy(); + /* 8002ea10 */ virtual bool canBeLinkedToWoodTag(); + /* 8002ea20 */ virtual bool drop(); + +public: + /* 8002e630 */ static dAcObjBase_c create( \ + fProfile::PROFILE_NAME_e actorId, u32 roomId, u32 params1, \ + Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2 ); + /* 8002e6d0 */ static dAcObjBase_c create( \ + char* name, u32 roomId, u32 params1, \ + Vec3f* pos, Vec3s* rot, Vec3f* scale, \ + u32 params2, u16 id, u8 viewclipId); + /* 8002e770 */ static dAcObjBase_c* findObject(fProfile::PROFILE_NAME_e actorId,\ + ActorReference* refList, dAcObjBase_c* parent); + /* 8002e7f0 */ static dAcObjBase_c* getNextObject(ActorReference* ref, dAcObjBase_c* parent); + /* 8002e850 */ bool isPlayer(); + /* 8002e870 */ void calcVelocity(Vec3f& pos, f32 speed); + /* 8002e8e0 */ void calcVelocity(); + /* 8002e9a0 */ void updateMatrix(); + /* 8002ea00 */ void setDefaultCullDistance(); + /* 8002ea30 */ void fn_8002EA30(f32,f32,f32,f32,f32, void*); + /* 8002ea60 */ void fn_8002EA60(void*); + /* 8002eb30 */ void fn_8002EB30(void*); + /* 8002eb90 */ void putInODesert(f32 depth, Vec3f* position); + // Disabling makes Items and Link Disappear + /* 8002ec70 */ void drawModelType1(); + // Disabling make Lava and other objects Disappear + /* 8002ecd0 */ void drawModel2(); + /* 8002ed20 */ void fn_8002ed20(); + /* 8002edb0 */ void fn_8002edb0(); + /* 8002ee40 */ void drawShadow(); + /* 8002ef40 */ void createChildAttached( \ + fProfile::PROFILE_NAME_e actorId, u32 params1, \ + Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2, \ + u32 roomId ); + /* 8002ef40 */ void createChildNonAttached( \ + fProfile::PROFILE_NAME_e actorId, u32 params1, \ + Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2, \ + u32 roomId ); + /* 8002efa0 */ void fn_8002efa0(); + /* 8002eff0 */ bool fn_8002eff0(f32*, s16*, UnkCollider*, f32*, f32*); + /* 8002f190 */ void createChildAttached2( \ + fProfile::PROFILE_NAME_e actorId, u32 params1, \ + Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2, \ + u32 roomId ); + // These may not belong here + /* 8002f1c0 */ static dAcBase_c createActorUnkGroup3( \ + fProfile::PROFILE_NAME_e actorId, u32 roomId, \ + u32 params1, Vec3f* pos, Vec3s* rot, Vec3f* scale, \ + u32 params2); + /* 8002f260 */ static dAcBase_c createActorUnkGroup3( \ + char* name, u32 roomId, u32 params1, \ + Vec3f* pos, Vec3s* rot, Vec3f* scale, \ + u32 params2, u16 id, u8 viewclipId); }; \ No newline at end of file diff --git a/include/d/a/obj/d_a_obj_item.h b/include/d/a/obj/d_a_obj_item.h index b29b4aa5..35942d22 100644 --- a/include/d/a/obj/d_a_obj_item.h +++ b/include/d/a/obj/d_a_obj_item.h @@ -5,6 +5,6 @@ // Ghidra: AcItem // Size: 0xd68 // official name -class dAcItem_c : public dAcOBase_c { +class dAcItem_c : public dAcObjBase_c { }; \ No newline at end of file diff --git a/include/lib/egg/egg_types.h b/include/lib/egg/egg_types.h new file mode 100644 index 00000000..890b1465 --- /dev/null +++ b/include/lib/egg/egg_types.h @@ -0,0 +1,93 @@ +#pragma once + +#include + +// Types pulled from ogws +// May need to remove/add later + +namespace EGG +{ + // gfx + struct CapTexture; + struct CpuTexture; + struct DrawGX; + struct DrawPathBase; + struct DrawPathBloom; + struct DrawPathDOF; + struct DrawPathHDR; + struct DrawPathLightMap; + struct DrawPathShadowVolume; + struct Fog; + struct FogManager; + struct G3DUtility; + struct GfxEngine; + struct GXUtility; + struct IDrawGX; + struct IScnProc; + struct IScnProcModel; + struct LightObj; + struct LightManager; + struct LightTexture; + struct LightTextureManager; + struct ModelBoundingInfo; + struct ModelEx; + struct ModelSnapshot; + struct PostEffectBase; + struct PostEffectBlur; + struct PostEffectBlurGather; + struct PostEffectHDR; + struct PostEffectSimple; + struct ResTIMG; + struct ScnRenderer; + struct ScnRootEx; + struct Screen; + struct ScreenEffectBase; + struct ShadowTextureManager; + struct ShadowTexture; + struct StateGX; + struct StateGX; + struct TextureBuffer; + + // math + template struct Math; + struct Matrix33f; + struct Matrix34f; + struct Matrix44f; + struct Quatf; + struct Vector2f; + struct Vector3f; + + // core + struct Allocator; + struct Archive; + struct AsyncDisplay; + template struct IBinary; + template struct TBitFlag; + struct CntFile; + struct ColorFader; + struct Decomp; + struct Display; + struct Disposer; + struct DvdFile; + struct DvdRipper; + struct ExpHeap; + struct Fader; + struct FrmHeap; + struct Heap; + struct Scene; + struct SceneManager; + struct Thread; + struct Video; + struct Xfb; + struct XfbManager; + + // audio + struct ArcPlayer; + struct IAudioMgr; + struct SimpleAudioMgr; + struct SoundHeapMgr; + + // util + struct Exception; + struct MsgRes; +} // namespace EGG diff --git a/include/lib/nw4r/g3d/g3d_rescommon.h b/include/lib/nw4r/g3d/g3d_rescommon.h new file mode 100644 index 00000000..e69de29b diff --git a/include/lib/nw4r/g3d/g3d_resfile.h b/include/lib/nw4r/g3d/g3d_resfile.h new file mode 100644 index 00000000..7a04a1ab --- /dev/null +++ b/include/lib/nw4r/g3d/g3d_resfile.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace nw4r { + namespace g3d { + + struct ResFileData { + + }; + + struct ResFile + { + /* data */ + }; + + }; +}; \ No newline at end of file diff --git a/include/lib/nw4r/nw4r_types.h b/include/lib/nw4r/nw4r_types.h new file mode 100644 index 00000000..9b528a46 --- /dev/null +++ b/include/lib/nw4r/nw4r_types.h @@ -0,0 +1,197 @@ +#pragma once + +#include + +namespace nw4r +{ + namespace ut + { + template struct TextWriterBase; + template struct TagProcessorBase; + + struct Color; + struct FileStream; + + namespace detail + { + struct RuntimeTypeInfo; + } + } + + namespace ef + { + struct DrawOrder; + struct DrawInfo; + struct DrawStrategy; + struct DrawStrategyImpl; + struct DrawStrategyBuilder; + struct Effect; + struct EffectSystem; + struct EffectProject; + struct Emitter; + struct EmitterDrawSetting; + struct EmitFormBuilder; + struct ResEmitter; + struct EmitterResource; + struct EmitterForm; + struct EmitterInheritSetting; + struct Particle; + struct ParticleManager; + struct MemoryManager; + struct MemoryManagerBase; + } + + namespace math + { + struct VEC2; + struct VEC3; + struct MTX33; + struct MTX34; + struct AABB; + struct FRUSTUM; + } + + namespace snd + { + struct FxBase; + struct SoundPlayer; + struct SoundHandle; + struct SeqSoundHandle; + struct SoundArchive; + struct SoundArchivePlayer; + struct Sound3DActor; + struct Sound3DListener; + struct Sound3DManager; + struct SoundHandle; + struct StrmSoundHandle; + struct WaveSoundHandle; + + namespace detail + { + struct BasicSound; + struct BasicPlayer; + struct ChannelManager; + struct SeqSound; + struct SeqPlayer; + struct MmlParser; + struct MmlSeqTrack; + struct SeqTrack; + struct SeqTrackAllocator; + template struct SoundInstanceManager; + struct StrmBufferPool; + struct StrmSound; + struct NoteOnCallback; + struct PlayerHeap; + struct SoundArchiveFileReader; + struct SoundThread; + struct WaveSound; + struct StrmPlayer; + struct WsdPlayer; + } + } + + namespace g3d + { + struct AnmObjVis; + struct AnmObjVisNode; + struct AnmObjVisOR; + struct AnmObjVisRes; + struct AnmObj; + struct AnmObjChr; + struct FuncObjCalcWorld; + struct AnmScn; + struct AnmScnRes; + struct CameraAnmResult; + struct Draw1Mat1ShpSwap; + struct DrawResMdlReplacement; + struct FogAnmResult; + struct ResFile; + struct ResMdl; + struct ResPltt; + struct ResTex; + struct ResTexSrt; + struct ResMat; + struct ResTexPlttInfo; + struct ResShp; + struct ResFog; + struct ResAnmChr; + struct ResAnmVis; + struct ResAnmClr; + struct ResAnmTexPat; + struct ResAnmTexSrt; + struct ResAnmShp; + struct ResAnmScn; + struct ResAnmFog; + struct ResAnmCamera; + struct ResVtxPos; + struct ResVtxNrm; + struct ResVtxClr; + struct ResVtxTexCoord; + struct ClrAnmResult; + struct TexPatAnmResult; + struct TexSrtAnmResult; + struct ScnMdl1Mat1Shp; + struct TexSrt; + struct TexSrtTypedef; + struct LightObj; + struct LightAnmResult; + struct LightSet; + struct LightSetting; + struct LightSetData; + struct AmbLightObj; + struct AmbLightAnmResult; + struct Fog; + struct ScnRoot; + struct ScnProc; + struct ScnLeaf; + struct ScnObj; + struct ScnRfl; + struct ScnGroup; + struct ScnMdlSimple; + struct ScnMdl; + struct IScnObjGather; + struct IScnObjCallback; + + namespace G3DState + { + struct IndMtxOp; + } + } + + namespace lyt + { + struct Size; + + namespace detail + { + struct PaneBase; + struct TexCoordAry; + } + + namespace res + { + struct Group; + struct Pane; + struct Bounding; + struct AnimationBlock; + struct BinaryFileHeader; + } + + struct Group; + struct GroupContainer; + struct Pane; + struct DrawInfo; + struct AnimResource; + struct AnimTransform; + struct AnimTransformBasic; + struct AnimationLink; + struct ResourceAccessor; + struct ArcResourceAccessor; + struct FontRefLink; + struct Material; + struct Layout; + struct Bounding; + struct ResBlockSet; + struct TexMap; + } +} diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index 12d4de9b..536f272f 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -56,7 +56,7 @@ int dAcBase_c::initAllocatorWork1Heap(int size, char* name, int align) { initAllocator(size, name, dHeap::work1Heap, align); } -extern "C" int fn_802EE510(mAllocator*, int size, EGG::Heap* heap, char* name, int align, int unk); +extern "C" int fn_802EE510(mAllocator_c*, int size, EGG::Heap* heap, char* name, int align, int unk); /* 8002c720 */ int dAcBase_c::initAllocator(int size, char* name, EGG::Heap* heap, int align) { diff --git a/src/d/a/obj/d_a_obj_base.cpp b/src/d/a/obj/d_a_obj_base.cpp new file mode 100644 index 00000000..9f418b3b --- /dev/null +++ b/src/d/a/obj/d_a_obj_base.cpp @@ -0,0 +1 @@ +#include