Some misc graphics stuff

This commit is contained in:
robojumper
2025-03-15 00:07:44 +01:00
parent 7400f6c66a
commit 3967ab8dc6
30 changed files with 991 additions and 156 deletions
@@ -10,8 +10,8 @@ draw__20dAcOtreasureIsland_cFv = .text:0x00000650; // type:function size:0x58
__dt__20dAcOtreasureIsland_cFv = .text:0x000006B0; // type:function size:0xBC
_ctors = .ctors:0x00000000; // type:label scope:global
_dtors = .dtors:0x00000000; // type:label scope:global
lbl_392_rodata_00 = .rodata:0x00000000; // type:object size:0x4 data:float
lbl_392_rodata_04 = .rodata:0x00000004; // type:object size:0x4 data:float
unkFloat0__20dAcOtreasureIsland_c = .rodata:0x00000000; // type:object size:0x4 data:float
unkFloat1__20dAcOtreasureIsland_c = .rodata:0x00000004; // type:object size:0x4 data:float
lbl_392_rodata_08 = .rodata:0x00000008; // type:object size:0x20 scope:local
lbl_392_rodata_28 = .rodata:0x00000028; // type:object size:0x20 scope:local
lbl_392_rodata_48 = .rodata:0x00000048; // type:object size:0x20 scope:local
+14
View File
@@ -27,6 +27,20 @@ toBeSorted/file_manager.cpp:
toBeSorted/save_manager.cpp:
.text start:0x80011730 end:0x80015310
toBeSorted/d_d3d.cpp:
.text start:0x80016700 end:0x80019E74
.ctors start:0x804DB64C end:0x804DB650
.data start:0x80500838 end:0x80500A70
.sdata2 start:0x80576A00 end:0x80576A68
toBeSorted/d_scn_callback.cpp:
.text start:0x80019E80 end:0x8001A590
.data start:0x80500A70 end:0x80500AD8
toBeSorted/d_unk_proc.cpp:
.text start:0x8001A590 end:0x8001BE58
.sdata2 start:0x80576A78 end:0x80576B08
toBeSorted/blur_and_palette_manager.cpp:
.text start:0x800221A0 end:0x800268AC
.ctors start:0x804DB65C end:0x804DB660
+64 -63
View File
@@ -558,33 +558,33 @@ fn_80016930 = .text:0x80016930; // type:function size:0x2C
fn_80016960 = .text:0x80016960; // type:function size:0x130
fn_80016A90 = .text:0x80016A90; // type:function size:0xCC
fn_80016B60 = .text:0x80016B60; // type:function size:0xAC
AnimModelWrapper__ctor = .text:0x80016C10; // type:function size:0x88
fn_80016CA0 = .text:0x80016CA0; // type:function size:0xB0
fn_80016D50 = .text:0x80016D50; // type:function size:0x78
fn_80016DD0 = .text:0x80016DD0; // type:function size:0x10
fn_80016DE0 = .text:0x80016DE0; // type:function size:0x80
fn_80016E60 = .text:0x80016E60; // type:function size:0x10
fn_80016E70 = .text:0x80016E70; // type:function size:0x28
fn_80016EA0 = .text:0x80016EA0; // type:function size:0x10
fn_80016EB0 = .text:0x80016EB0; // type:function size:0x54
fn_80016F10 = .text:0x80016F10; // type:function size:0x10
fn_80016F20 = .text:0x80016F20; // type:function size:0x34
fn_80016F60 = .text:0x80016F60; // type:function size:0x34
fn_80016FA0 = .text:0x80016FA0; // type:function size:0x54
fn_80017000 = .text:0x80017000; // type:function size:0x44
fn_80017050 = .text:0x80017050; // type:function size:0x8
fn_80017060 = .text:0x80017060; // type:function size:0xCC
fn_80017130 = .text:0x80017130; // type:function size:0x20
fn_80017150 = .text:0x80017150; // type:function size:0x50
fn_800171A0 = .text:0x800171A0; // type:function size:0xDC
fn_80017280 = .text:0x80017280; // type:function size:0x10
fn_80017290 = .text:0x80017290; // type:function size:0xEC
fn_80017380 = .text:0x80017380; // type:function size:0xAC
fn_80017430 = .text:0x80017430; // type:function size:0xCC
__ct__Q23d3d13AnmMdlWrapperFv = .text:0x80016C10; // type:function size:0x88
__dt__Q23d3d13AnmMdlWrapperFv = .text:0x80016CA0; // type:function size:0xB0
create__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPvPCcPCcUl = .text:0x80016D50; // type:function size:0x78
create2__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPvPCcPCcUl = .text:0x80016DD0; // type:function size:0x10
create__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPvPCcPCcPQ33m3d5mdl_c13mdlCallback_cUl = .text:0x80016DE0; // type:function size:0x80
create2__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPvPCcPCcPQ33m3d5mdl_c13mdlCallback_cUl = .text:0x80016E60; // type:function size:0x10
create__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPCcPCcUl = .text:0x80016E70; // type:function size:0x28
create2__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPCcPCcUl = .text:0x80016EA0; // type:function size:0x10
create__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPCcPCcPQ33m3d5mdl_c13mdlCallback_cUl = .text:0x80016EB0; // type:function size:0x54
create2__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPCcPCcPQ33m3d5mdl_c13mdlCallback_cUl = .text:0x80016F10; // type:function size:0x10
play__Q23d3d13AnmMdlWrapperFv = .text:0x80016F20; // type:function size:0x34
setFrame__Q23d3d13AnmMdlWrapperFf = .text:0x80016F60; // type:function size:0x34
setAnm__Q23d3d13AnmMdlWrapperFPCcQ23m3d10playMode_ef = .text:0x80016FA0; // type:function size:0x54
setRate__Q23d3d13AnmMdlWrapperFf = .text:0x80017000; // type:function size:0x44
setSoundSource__Q23d3d13AnmMdlWrapperFP11SoundSource = .text:0x80017050; // type:function size:0x8
loadSounds__Q23d3d13AnmMdlWrapperFPCc = .text:0x80017060; // type:function size:0xCC
setSoundRate__Q23d3d13AnmMdlWrapperFf = .text:0x80017130; // type:function size:0x20
syncAnmFrame__Q23d3d13AnmMdlWrapperFv = .text:0x80017150; // type:function size:0x50
createExt__Q23d3d14AnmMdlWrapper2FR9dAcBase_cPvPvPvPvPCcPCcPQ33m3d5mdl_c13mdlCallback_cUl = .text:0x800171A0; // type:function size:0xDC
create3__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPvPCcPCcPQ33m3d5mdl_c13mdlCallback_cUl = .text:0x80017280; // type:function size:0x10
setAnm__Q23d3d14AnmMdlWrapper2FPCcQ23m3d10playMode_ef = .text:0x80017290; // type:function size:0xEC
insertNode__3d3dFPQ23d3d12SomeListNodeff = .text:0x80017380; // type:function size:0xAC
clearList__3d3dFv = .text:0x80017430; // type:function size:0xCC
fn_80017500 = .text:0x80017500; // type:function size:0x1DC
fn_800176E0 = .text:0x800176E0; // type:function size:0x10
fn_800176F0 = .text:0x800176F0; // type:function size:0x418
fn_80017B10 = .text:0x80017B10; // type:function size:0x1D4
unk2__3d3dFRQ34nw4r3g3d6ResMatRQ34nw4r3g3d14ResMatTevColorP12LightingInfo = .text:0x800176F0; // type:function size:0x418
setRoomTevColors__3d3dFQ34nw4r3g3d6ResMdlib = .text:0x80017B10; // type:function size:0x1D4
fn_80017CF0 = .text:0x80017CF0; // type:function size:0x230
fn_80017F20 = .text:0x80017F20; // type:function size:0x20C
fn_80018130 = .text:0x80018130; // type:function size:0x788
@@ -594,22 +594,22 @@ fn_80018CD0 = .text:0x80018CD0; // type:function size:0x34
fn_80018D10 = .text:0x80018D10; // type:function size:0x190
fn_80018EA0 = .text:0x80018EA0; // type:function size:0x58
fn_80018F00 = .text:0x80018F00; // type:function size:0x60
fn_80018F60 = .text:0x80018F60; // type:function size:0x7C
fn_80018FE0 = .text:0x80018FE0; // type:function size:0xD0
remove__12UnkWithWaterFv = .text:0x800190B0; // type:function size:0xB8
fn_80019170 = .text:0x80019170; // type:function size:0x74
fn_800191F0 = .text:0x800191F0; // type:function size:0x9C
calc__Q23d3d12UnkWithWaterFPQ23EGG10CpuTexture = .text:0x80018F60; // type:function size:0x7C
init__Q23d3d12UnkWithWaterFRQ34nw4r3g3d9ResTexObj11_GXTexMapID = .text:0x80018FE0; // type:function size:0xD0
remove__Q23d3d12UnkWithWaterFv = .text:0x800190B0; // type:function size:0xB8
apply__Q23d3d16UnkWithWaterNodeFPC9_GXTexObj = .text:0x80019170; // type:function size:0x74
entry__Q23d3d14EggTextureProcFv = .text:0x800191F0; // type:function size:0x9C
fn_80019290 = .text:0x80019290; // type:function size:0x5C
fn_800192F0 = .text:0x800192F0; // type:function size:0x6C
fn_80019360 = .text:0x80019360; // type:function size:0x204
fn_80019570 = .text:0x80019570; // type:function size:0x44
fn_800195C0 = .text:0x800195C0; // type:function size:0xAC
fn_80019670 = .text:0x80019670; // type:function size:0x74
doDraw__Q23d3d14EggTextureProcFv = .text:0x80019360; // type:function size:0x204
doRemove__Q23d3d14EggTextureProcFv = .text:0x80019570; // type:function size:0x44
create__Q23d3d14EggTextureProcFiiP12mAllocator_c = .text:0x800195C0; // type:function size:0xAC
createXlu__Q23d3d14EggTextureProcFiP12mAllocator_c = .text:0x80019670; // type:function size:0x74
fn_800196F0 = .text:0x800196F0; // type:function size:0x90
fn_80019780 = .text:0x80019780; // type:function size:0x6C
fn_800197F0 = .text:0x800197F0; // type:function size:0x5C
fn_80019850 = .text:0x80019850; // type:function size:0x58
fn_800198B0 = .text:0x800198B0; // type:function size:0x17C
drawXlu__Q23d3d7XluProcFv = .text:0x800198B0; // type:function size:0x17C
EGG__CapTexture____dt = .text:0x80019A30; // type:function size:0x58
fn_80019A90 = .text:0x80019A90; // type:function size:0x4C
fn_80019AE0 = .text:0x80019AE0; // type:function size:0x98
@@ -617,27 +617,27 @@ fn_80019B80 = .text:0x80019B80; // type:function size:0x8
fn_80019B90 = .text:0x80019B90; // type:function size:0x8
fn_80019BA0 = .text:0x80019BA0; // type:function size:0x8
fn_80019BB0 = .text:0x80019BB0; // type:function size:0x8
fn_80019BC0 = .text:0x80019BC0; // type:function size:0x7C
fn_80019C40 = .text:0x80019C40; // type:function size:0x4
fn_80019C50 = .text:0x80019C50; // type:function size:0x4
fn_80019C60 = .text:0x80019C60; // type:function size:0x60
__dt__Q23d3d14EggTextureProcFv = .text:0x80019BC0; // type:function size:0x7C
drawXlu__Q23d3d14EggTextureProcFv = .text:0x80019C40; // type:function size:0x4
drawOpa__Q23d3d14EggTextureProcFv = .text:0x80019C50; // type:function size:0x4
__dt__Q23d3d12UnkWithWaterFv = .text:0x80019C60; // type:function size:0x60
fn_80019CC0 = .text:0x80019CC0; // type:function size:0x58
fn_80019D20 = .text:0x80019D20; // type:function size:0x10
fn_80019D30 = .text:0x80019D30; // type:function size:0x10
fn_80019D40 = .text:0x80019D40; // type:function size:0x10
fn_80019D50 = .text:0x80019D50; // type:function size:0x14
fn_80019D70 = .text:0x80019D70; // type:function size:0x58
fn_80019DD0 = .text:0x80019DD0; // type:function size:0x5C
fn_80019E30 = .text:0x80019E30; // type:function size:0x44
fn_80019E80 = .text:0x80019E80; // type:function size:0x3A8
create3__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPvPCcPCcUl = .text:0x80019D20; // type:function size:0x10
create3__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPCcPCcUl = .text:0x80019D30; // type:function size:0x10
create3__Q23d3d13AnmMdlWrapperFR9dAcBase_cPvPCcPCcPQ33m3d5mdl_c13mdlCallback_cUl = .text:0x80019D40; // type:function size:0x10
setAnm__Q23d3d13AnmMdlWrapperFPCcQ23m3d10playMode_e = .text:0x80019D50; // type:function size:0x14
__dt__Q23d3d14AnmMdlWrapper2Fv = .text:0x80019D70; // type:function size:0x58
__dt__Q23d3d7XluProcFv = .text:0x80019DD0; // type:function size:0x5C
__sinit_\d_d3d_cpp = .text:0x80019E30; // type:function size:0x44
ExecCallback_CALC_MAT__14dScnCallback_cFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x80019E80; // type:function size:0x3A8
attach__14dScnCallback_cFRQ23m3d9scnLeaf_c = .text:0x8001A230; // type:function size:0x50
setPCAMpos2 = .text:0x8001A280; // type:function size:0x144
linkMdl__12UnkWithWaterFRQ34nw4r3g3d6ResMdlP12UnkWithWater = .text:0x8001A3D0; // type:function size:0x140
fn_8001A510 = .text:0x8001A510; // type:function size:0x4
fn_8001A520 = .text:0x8001A520; // type:function size:0x4
fn_8001A530 = .text:0x8001A530; // type:function size:0x4
fn_8001A540 = .text:0x8001A540; // type:function size:0x4
fn_8001A550 = .text:0x8001A550; // type:function size:0x40
setPCAMPos2__FP4PCAM = .text:0x8001A280; // type:function size:0x144
linkMdl__Q23d3d12UnkWithWaterFRQ34nw4r3g3d6ResMdlPQ23d3d12UnkWithWater = .text:0x8001A3D0; // type:function size:0x140
ExecCallback_DRAW_XLU__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x8001A510; // type:function size:0x4
ExecCallback_DRAW_OPA__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x8001A520; // type:function size:0x4
ExecCallback_CALC_VIEW__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x8001A530; // type:function size:0x4
ExecCallback_CALC_WORLD__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x8001A540; // type:function size:0x4
__dt__14dScnCallback_cFv = .text:0x8001A550; // type:function size:0x40
fn_8001A590 = .text:0x8001A590; // type:function size:0x198
fn_8001A730 = .text:0x8001A730; // type:function size:0x1E4
fn_8001A920 = .text:0x8001A920; // type:function size:0x7F4
@@ -10556,8 +10556,8 @@ addObjId__11dStageMgr_cFUs = .text:0x80199130; // type:function size:0x8
addStageArcn__11dStageMgr_cFPCc = .text:0x80199140; // type:function size:0x8
addActorId__11dStageMgr_cFUs = .text:0x80199150; // type:function size:0x8
addLayerArcn__11dStageMgr_cFPCc = .text:0x80199160; // type:function size:0x8
initUnkWithWater__11dStageMgr_cFUlP12UnkWithWater = .text:0x80199170; // type:function size:0x18
destroyUnkWithWater__11dStageMgr_cFUlP12UnkWithWater = .text:0x80199190; // type:function size:0x18
initUnkWithWater__11dStageMgr_cFUlPQ23d3d12UnkWithWater = .text:0x80199170; // type:function size:0x18
destroyUnkWithWater__11dStageMgr_cFUlPQ23d3d12UnkWithWater = .text:0x80199190; // type:function size:0x18
fn_801991B0 = .text:0x801991B0; // type:function size:0xA0
fn_80199250 = .text:0x80199250; // type:function size:0x3C
fn_80199290 = .text:0x80199290; // type:function size:0x164
@@ -11070,7 +11070,7 @@ __ct__Q34nw4r4math4AABBFv = .text:0x801B73E0; // type:function size:0x4
configureSomething__Q27dRoom_c5mdl_cFv = .text:0x801B73F0; // type:function size:0xE4
somethingVisibility__Q27dRoom_c5mdl_cFUlb = .text:0x801B74E0; // type:function size:0xB0
doSomethingWithVis__Q27dRoom_c5mdl_cFb = .text:0x801B7590; // type:function size:0x98
create__Q27dRoom_c7model_cFQ34nw4r3g3d7ResFileR12mAllocator_clP12UnkWithWater = .text:0x801B7630; // type:function size:0x490
create__Q27dRoom_c7model_cFQ34nw4r3g3d7ResFileR12mAllocator_clPQ23d3d12UnkWithWater = .text:0x801B7630; // type:function size:0x490
execute__Q27dRoom_c7model_cFlbf = .text:0x801B7AC0; // type:function size:0x168
draw__Q27dRoom_c7model_cFi = .text:0x801B7C30; // type:function size:0x68
configureSomething__Q27dRoom_c7model_cFiPQ27dRoom_c5mdl_c = .text:0x801B7CA0; // type:function size:0x38
@@ -29873,16 +29873,17 @@ lbl_80500920 = .data:0x80500920; // type:object size:0x14
lbl_80500934 = .data:0x80500934; // type:object size:0x14
lbl_80500948 = .data:0x80500948; // type:object size:0x14
lbl_8050095C = .data:0x8050095C; // type:object size:0xC
lbl_80500968 = .data:0x80500968; // type:object size:0x2C
lbl_80500994 = .data:0x80500994; // type:object size:0x2C
__vt__12UnkWithWater = .data:0x805009C0; // type:object size:0x10
lbl_805009D0 = .data:0x805009D0; // type:object size:0x50
AnimModelWrapper__vtable = .data:0x80500A20; // type:object size:0x50
__vt__Q23d3d7XluProc = .data:0x80500968; // type:object size:0x2C
__vt__Q23d3d14EggTextureProc = .data:0x80500994; // type:object size:0x2C
__vt__Q23d3d12UnkWithWater = .data:0x805009C0; // type:object size:0x10
__vt__Q23d3d14AnmMdlWrapper2 = .data:0x805009D0; // type:object size:0x50
__vt__Q23d3d13AnmMdlWrapper = .data:0x80500A20; // type:object size:0x50
lbl_80500A70 = .data:0x80500A70; // type:object size:0x2C
lbl_80500A9C = .data:0x80500A9C; // type:object size:0xC
lbl_80500AA8 = .data:0x80500AA8; // type:object size:0x10 data:string
__vt__14dScnCallback_c = .data:0x80500AB8; // type:object size:0x20
lbl_80500AD8 = .data:0x80500AD8; // type:object size:0x44
lbl_80500AD8 = .data:0x80500AD8; // type:object size:0x18
lbl_80500AF0 = .data:0x80500AF0; // type:object size:0x2C
lbl_80500B1C = .data:0x80500B1C; // type:object size:0x2C
lbl_80500B48 = .data:0x80500B48; // type:object size:0xC
lbl_80500B54 = .data:0x80500B54; // type:object size:0xC
+3
View File
@@ -440,6 +440,9 @@ config.libs = [
Object(Matching, "d/lyt/d_lyt_common_arrow.cpp"),
Object(NonMatching, "toBeSorted/file_manager.cpp"),
Object(NonMatching, "toBeSorted/save_manager.cpp"),
Object(NonMatching, "toBeSorted/d_d3d.cpp"),
Object(NonMatching, "toBeSorted/d_scn_callback.cpp"),
Object(NonMatching, "toBeSorted/d_unk_proc.cpp"),
Object(NonMatching, "toBeSorted/blur_and_palette_manager.cpp"),
Object(Matching, "DynamicLink.cpp"),
],
+7
View File
@@ -14,6 +14,13 @@ struct cBgS_PolyInfo;
struct SoundSource {
virtual ~SoundSource() {}
// TODO
virtual bool shutdown(); // 0x48
virtual bool isReadyMaybe(); // 0x100
virtual bool load(void *data, const char *name); // 0x100
virtual void setFrame(f32 frame); // 0x108
virtual void setRate(f32 frame); // 0x10C
};
struct SoundInfo {
+24 -2
View File
@@ -2,6 +2,7 @@
#define D_A_OBJ_BASE_H
#include "c/c_math.h"
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/c/c_m3d_g_aab.h"
@@ -9,6 +10,7 @@
#include "m/m3d/m_shadow.h"
#include "m/m3d/m_smdl.h"
#include "m/m_angle.h"
#include "m/m_color.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
#include "m/types_m.h"
@@ -60,9 +62,29 @@ struct ActorCarryStruct {
// Ghidra has it as `unk_ActorObjectBase`
struct LightingInfo {
/* 0x00 */ u8 mField_0x00[0x60 - 0x00];
/* 0x00 */ u8 mField_0x00[0x40 - 0x00];
/* 0x40 */ mColor mTev0Color;
/* 0x44 */ mColor mTev1Color;
/* 0x48 */ mColor mTev2Color;
/* 0x4C */ mColor mTevPrevColor;
/* 0x50 */ mColor mTevK0Color;
/* 0x54 */ mColor mTevK1Color;
/* 0x58 */ mColor mTevK2Color;
/* 0x5C */ mColor mTevK3Color;
/* 0x60 */ u8 mLightingCode;
/* 0x61 */ u8 mField_0x61[0x70 - 0x61];
/* 0x61 */ u8 _0x61;
/* 0x62 */ u8 _0x62;
/* 0x63 */ u8 _0x63;
/* 0x64 */ u8 _0x64;
/* 0x65 */ bool mUseTev0;
/* 0x66 */ bool mUseTev1;
/* 0x67 */ bool mUseTev2;
/* 0x68 */ bool mUseTevPrev;
/* 0x69 */ bool mUseTevK0;
/* 0x6A */ bool mUseTevK1;
/* 0x6B */ bool mUseTevK2;
/* 0x6C */ bool mUseTevK3;
/* 0x6D */ u8 mField_0x69[0x70 - 0x6D];
};
// Ghidra: ActorObjectBase
+2 -2
View File
@@ -4,7 +4,7 @@
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_w.h"
#include "m/m3d/m_anmtexsrt.h"
#include "toBeSorted/unk_with_water.h"
#include "toBeSorted/d_d3d.h"
class dAcOtreasureIsland_c : public dAcObjBase_c {
public:
@@ -20,7 +20,7 @@ private:
const static f32 unkFloat0;
const static f32 unkFloat1;
/* 0x330 */ UnkWithWater waterStuff;
/* 0x330 */ d3d::UnkWithWater waterStuff;
/* 0x348 */ m3d::smdl_c mModel;
/* 0x364 */ m3d::smdl_c mWater00;
/* 0x380 */ m3d::smdl_c mWater01;
+3 -3
View File
@@ -18,8 +18,8 @@
#include "nw4r/math/math_geometry.h"
#include "s/s_State.hpp"
#include "sized_string.h"
#include "toBeSorted/d_d3d.h"
#include "toBeSorted/raii_ptr.h"
#include "toBeSorted/unk_with_water.h"
struct DrawPriorityConfig {
u8 pDrawOpa1;
@@ -57,7 +57,7 @@ class dRoom_c : public dBase_c {
public:
model_c() {}
bool create(nw4r::g3d::ResFile resFile, mAllocator_c &alloc, s32 idx, UnkWithWater *waterThing);
bool create(nw4r::g3d::ResFile resFile, mAllocator_c &alloc, s32 idx, d3d::UnkWithWater *waterThing);
bool getBounds(mVec3_c *min, mVec3_c *max) const;
nw4r::g3d::ResNode getResNode(const char *nodeName);
void updateObjNode(const char *node, bool visible);
@@ -197,7 +197,7 @@ private:
/* 0x068 */ mHeapAllocator_c mAllocator;
/* 0x084 */ nw4r::g3d::ResFile mRoomRes;
/* 0x088 */ UnkWithWater mWaterThing;
/* 0x088 */ d3d::UnkWithWater mWaterThing;
/* 0x0A0 */ model_c mModels[ROOM_NUM_MODELS];
/* 0x220 */ dBgWKCol mBg[ROOM_NUM_BG];
/* 0x4E0 */ STATE_MGR_DECLARE(dRoom_c);
+3 -3
View File
@@ -16,8 +16,8 @@
#include "toBeSorted/arc_managers/layout_arc_manager.h"
#include "toBeSorted/arc_managers/oarc_manager.h"
#include "toBeSorted/attention.h"
#include "toBeSorted/d_d3d.h"
#include "toBeSorted/time_area_mgr.h"
#include "toBeSorted/unk_with_water.h"
class RelObjCtrl {
public:
@@ -62,8 +62,8 @@ public:
return (field_0x88A0 & flag) != 0;
}
void initUnkWithWater(u32 val, UnkWithWater *waterThing);
void destroyUnkWithWater(u32 val, UnkWithWater *waterThing);
void initUnkWithWater(u32 val, d3d::UnkWithWater *waterThing);
void destroyUnkWithWater(u32 val, d3d::UnkWithWater *waterThing);
const RMPL *getRmpl() const {
return mpRmpl;
+25
View File
@@ -0,0 +1,25 @@
#ifndef D_T_SIREN_H
#define D_T_SIREN_H
#include "common.h"
#include "d/t/d_tg.h"
class dTgSiren_c : public dTg_c {
public:
dTgSiren_c() {}
virtual ~dTgSiren_c() {}
static bool isOutOfTime() {
if (sInstance == nullptr) {
return false;
}
return sInstance->outOfTime();
}
private:
bool outOfTime() const;
static dTgSiren_c *sInstance;
};
#endif
+6 -1
View File
@@ -1,9 +1,14 @@
#ifndef EGG_CPU_TEXTURE_H
#define EGG_CPU_TEXTURE_H
#include "rvl/GX/GXTexture.h"
namespace EGG {
class CpuTexture {};
class CpuTexture {
public:
void GetTexObj(GXTexObj *) const;
};
} // namespace EGG
+4 -4
View File
@@ -15,9 +15,9 @@ public:
virtual void play(); // 0x0C
virtual void setFrame(f32); // 0x10
virtual void setAnm(const char *name, playMode_e mode, f32); // 0x14
virtual void setAnm(const char *name, playMode_e mode); // 0x18
virtual void setRate(f32); // 0x20
virtual bool setAnm(const char *name, playMode_e mode, f32); // 0x14
virtual bool setAnm(const char *name, playMode_e mode); // 0x18
virtual void setRate(f32); // 0x1C
bool create(
void *mdlFile, void *anmFile, const char *mdlName, const char *anmName, mAllocator_c *alloc, u32 bufferOption,
@@ -57,7 +57,7 @@ public:
return mAnm;
}
private:
protected:
nw4r::g3d::ResFile mMdlFile;
nw4r::g3d::ResFile mAnmFile;
+1 -1
View File
@@ -15,7 +15,7 @@ public:
virtual int getType() const override;
virtual void remove() override;
virtual void setAnm(banm_c &anm);
virtual bool setAnm(banm_c &anm);
virtual void play();
int getMatID(const char *name) const;
+4 -4
View File
@@ -57,12 +57,12 @@ public:
bool create(nw4r::g3d::ResMdl, mAllocator_c *, u32, int, u32 *);
bool create(nw4r::g3d::ResMdl, mdlCallback_c *cb, mAllocator_c *, u32, int, u32 *);
virtual void remove();
virtual void remove() override;
void setCallback(callback_c *cb);
void play();
void setAnm(banm_c &);
void setAnm(banm_c &, f32);
virtual void play() override;
virtual bool setAnm(banm_c &) override;
bool setAnm(banm_c &, f32);
private:
/** If we allocated the callback ourselves, this is what we need to free */
+10
View File
@@ -494,6 +494,16 @@ public:
return ResName(NULL);
}
const char *GetTexName() const {
const ResTexPlttInfoData &r = ref();
if (r.nameTex != 0) {
return NW4R_G3D_OFS_TO_RESNAME(&r, r.nameTex).GetName();
}
return nullptr;
}
bool IsCIFmt() const {
return ref().namePltt != 0;
}
+1
View File
@@ -81,6 +81,7 @@ public:
void GXSetIndTexOrder(GXIndTexStageID stage, GXTexCoordID coord, GXTexMapID map);
void GXSetTevColorIn(GXTevStageID stage, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d);
void GXSetTevAlphaIn(GXTevStageID stage, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d);
void CallDisplayList(bool sync) const;
+11 -3
View File
@@ -37,12 +37,12 @@ struct UnalignedColor {
};
struct PaletteDefaultMCF {
/* 0x00 */ mColor MA00_kcolor3;
/* 0x00 */ mColor MA00_kColor3;
/* 0x04 */ mColor MA01_tevReg1;
/* 0x08 */ mColor MA01_kColor2;
/* 0x0C */ mColor MA02_tevReg1;
/* 0x10 */ mColor MA02_kcolor2;
/* 0x14 */ mColor MA03_kcolor3;
/* 0x10 */ mColor MA02_kColor2;
/* 0x14 */ mColor MA03_kColor3;
/* 0x18 */ mColor MA06_kColor3;
/* 0x1C */ mColor field_0x1C;
};
@@ -232,6 +232,14 @@ public:
void fn_800223A0(void *);
void fn_80022440(void *);
u8 get0x2DE8() const {
return field_0x2DE0[8];
}
const PaletteDefaultMCF &GetCurrentDefaultMcf() const {
return field_0x5CE4;
}
private:
mColor combineColors(const mColor &c1, const mColor &c2, f32 ratio);
+219
View File
@@ -0,0 +1,219 @@
#ifndef D_D3D_H
#define D_D3D_H
#include "common.h"
#include "d/a/d_a_base.h"
#include "egg/egg_types.h"
#include "m/m3d/m_anmmdl.h"
#include "m/m3d/m_fanm.h"
#include "m/m3d/m_mdl.h"
#include "m/m3d/m_proc.h"
#include "m/m_color.h"
#include "m/m_mtx.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "toBeSorted/tlist.h"
#include <cstddef>
namespace d3d {
class AnmMdlWrapper : protected m3d::mdlAnmChr {
public:
AnmMdlWrapper();
virtual ~AnmMdlWrapper();
virtual void play() override;
virtual bool setAnm(const char *name, m3d::playMode_e mode, f32) override;
virtual bool setAnm(const char *name, m3d::playMode_e mode) override {
return setAnm(name, mode, 0.0f);
}
virtual void setFrame(f32 frame) override;
virtual void setRate(f32 rate) override;
// Base creation function, different names in different files
/* 0x20 */ virtual bool
create(dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName, u32 bufferOption);
// Unknown overloads
/* 0x24 */ virtual bool
create2(dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName, u32 bufferOption);
/* 0x28 */ virtual bool
create3(dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName, u32 bufferOption) {
return create2(ac, mdlFile, anmFile, mdlName, anmName, bufferOption);
}
// Create with a callback
/* 0x2C */ virtual bool create(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
);
// Unknown overloads
/* 0x30 */ virtual bool create2(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
);
/* 0x34 */ virtual bool create3(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
);
// Create with same file name for both model and anim
/* 0x38 */ virtual bool
create(dAcBase_c &ac, void *resFile, const char *mdlName, const char *anmName, u32 bufferOption);
// Unknown overloads
/* 0x3C */ virtual bool
create2(dAcBase_c &ac, void *resFile, const char *mdlName, const char *anmName, u32 bufferOption);
/* 0x40 */ virtual bool
create3(dAcBase_c &ac, void *resFile, const char *mdlName, const char *anmName, u32 bufferOption) {
return create2(ac, resFile, mdlName, anmName, bufferOption);
}
// Create with a callback, same file name for both model and anim
/* 0x44 */ virtual bool create(
dAcBase_c &ac, void *mdlFile, const char *mdlName, const char *anmName, m3d::mdl_c::mdlCallback_c *callback,
u32 bufferOption
);
// Unknown overloads
/* 0x48 */ virtual bool create2(
dAcBase_c &ac, void *mdlFile, const char *mdlName, const char *anmName, m3d::mdl_c::mdlCallback_c *callback,
u32 bufferOption
);
/* 0x4C */ virtual bool create3(
dAcBase_c &ac, void *mdlFile, const char *mdlName, const char *anmName, m3d::mdl_c::mdlCallback_c *callback,
u32 bufferOption
) {
return create2(ac, mdlFile, mdlName, anmName, callback, bufferOption);
}
void setSoundSource(SoundSource *pSource);
protected:
bool loadSounds(const char *name);
void syncAnmFrame();
void setSoundRate(f32 rate);
/* 0x68 */ SoundSource *mpSoundSource;
/* 0x6C */ void *mpSoundData;
};
class AnmMdlWrapper2 : public AnmMdlWrapper {
public:
bool createExt(
dAcBase_c &ac, void *mdlFile, void *anmFile, void *ext1, void *ext2, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
);
virtual bool setAnm(const char *name, m3d::playMode_e mode, f32) override;
private:
/* 0x70 */ nw4r::g3d::ResFile mExt1;
/* 0x74 */ nw4r::g3d::ResFile mExt2;
/* 0x78 */ bool mHasExt1;
/* 0x79 */ bool mHasExt2;
};
struct SomeListNode {
/* 0x00 */ u8 _0x00[4];
/* 0x04 */ u16 field_0x04;
/* 0x06 */ u16 field_0x06;
/* 0x08 */ u8 _0x08[4];
/* 0x0C */ TListNode<SomeListNode> mNode;
};
typedef TList<SomeListNode, offsetof(SomeListNode, mNode)> SomeList;
struct SomeListStruct {
SomeList list;
};
void setRoomTevColors(nw4r::g3d::ResMdl mdl, int b1, bool bUnk);
struct UnkWithWaterNode {
public:
UnkWithWaterNode(nw4r::g3d::ResTexObj &obj, GXTexMapID mapId) : mObj(obj), mMapId(mapId) {}
void apply(const GXTexObj *obj);
/* 0x00 */ TListNode<UnkWithWaterNode> mNode;
/* 0x08 */ nw4r::g3d::ResTexObj mObj;
/* 0x0C */ GXTexMapID mMapId;
};
class UnkWithWaterBase {
public:
UnkWithWaterBase() : field_0x04(0), field_0x08(0) {}
virtual void calc(EGG::CpuTexture *tex) = 0;
private:
/* 0x04 */ UNKWORD field_0x04;
/* 0x08 */ UNKWORD field_0x08;
};
class UnkWithWater : public UnkWithWaterBase {
public:
typedef TList<UnkWithWaterNode, offsetof(UnkWithWaterNode, mNode)> NodeList;
UnkWithWater() {}
virtual ~UnkWithWater() {
remove();
}
virtual void calc(EGG::CpuTexture *tex) override;
bool init(nw4r::g3d::ResTexObj &obj, GXTexMapID mapId);
static bool linkMdl(nw4r::g3d::ResMdl &mdl, UnkWithWater *thing);
bool hasLinks() const {
return mList.mCount != 0;
}
private:
void remove();
/* 0x0C */ NodeList mList;
};
class UnkProc : public m3d::proc_c {
public:
private:
};
class EggTextureProc : public UnkProc {
public:
EggTextureProc() : mpCpuTexture(nullptr) {}
virtual ~EggTextureProc() {
doRemove();
}
virtual int entry() override;
bool create(int prioOpa, int prioXlu, mAllocator_c *alloc);
bool createXlu(int prioXlu, mAllocator_c *alloc);
virtual void drawOpa() override {
doDraw();
}
virtual void drawXlu() override {
doDraw();
}
private:
void doRemove();
void doDraw();
/* 0x18 */ EGG::TextureBuffer *mpCpuTexture;
/* 0x1C */ mMtx_c mMtx;
/* 0x4C */ UNKWORD _0x4C;
/* 0x50 */ u8 field_0x50;
/* 0x51 */ u8 field_0x51;
/* 0x52 */ u8 field_0x52;
};
class XluProc : public UnkProc {
public:
virtual void drawXlu() override;
private:
/* 0x18 */ mColor mClr;
};
} // end namespace d3d
#endif
+1 -1
View File
@@ -13,7 +13,7 @@ public:
ExecCallback_CALC_MAT(nw4r::g3d::ScnObj::Timing, nw4r::g3d::ScnObj *, u32, void *) override;
/* 0x04 */ dAcObjBase_c *mpActor;
/* 0x08 */ UNKWORD field_0x08;
/* 0x08 */ bool field_0x08;
/* 8001a230 */ void attach(m3d::scnLeaf_c &);
};
+2 -2
View File
@@ -86,7 +86,7 @@ public:
* list of this type.
*/
Iterator GetPosition(T *pT) {
if (pT->mLink.mpNext == nullptr || pT->mLink.mpPrev == nullptr) {
if (GetNodeFromPtr(pT)->mpNext == nullptr || GetNodeFromPtr(pT)->mpPrev == nullptr) {
return GetEndIter();
} else {
return Iterator(pT);
@@ -139,7 +139,7 @@ public:
mCount--;
}
T* GetFirst() {
T *GetFirst() {
return GetPtrFromNode(&mStartEnd);
}
-45
View File
@@ -1,45 +0,0 @@
#ifndef UNK_WITH_WATER_H
#define UNK_WITH_WATER_H
#include "common.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
#include "toBeSorted/tlist.h"
struct UnkWithWaterNode {
public:
/* 0x00 */ TListNode<UnkWithWaterNode> mNode;
/* 0x08 */ UNKWORD field_0x08;
/* 0x0C */ UNKWORD field_0x0C;
};
class UnkWithWaterBase {
public:
UnkWithWaterBase() : field_0x04(0), field_0x08(0) {}
virtual void calc() = 0;
private:
/* 0x04 */ UNKWORD field_0x04;
/* 0x08 */ UNKWORD field_0x08;
};
class UnkWithWater : public UnkWithWaterBase {
public:
typedef TList<UnkWithWaterNode, offsetof(UnkWithWaterNode, mNode)> NodeList;
UnkWithWater() {}
virtual ~UnkWithWater() {
remove();
}
virtual void calc() override;
static bool linkMdl(nw4r::g3d::ResMdl &mdl, UnkWithWater *thing);
bool hasLinks() const {
return mList.mCount != 0;
}
private:
void remove();
/* 0x0C */ NodeList mList;
};
#endif
+1 -1
View File
@@ -45,7 +45,7 @@ bool dAcOtreasureIsland_c::createHeap() {
}
mdl = mResFile.GetResMdl("IslTreCWater01");
UnkWithWater::linkMdl(mdl, &waterStuff);
d3d::UnkWithWater::linkMdl(mdl, &waterStuff);
TRY_CREATE(mWater01.create(mdl, &heap_allocator, 0x324));
if (dStage_c::getMA0IndirectSrt(&anmSrt, mdl)) {
+4 -6
View File
@@ -38,8 +38,8 @@
#include "nw4r/math/math_types.h"
#include "sized_string.h"
#include "toBeSorted/arc_managers/current_stage_arc_manager.h"
#include "toBeSorted/d_d3d.h"
#include "toBeSorted/time_area_mgr.h"
#include "toBeSorted/unk_with_water.h"
SPECIAL_BASE_PROFILE(ROOM, dRoom_c, fProfile::ROOM, 0x9, 96);
@@ -473,7 +473,7 @@ void dRoom_c::mdl_c::doSomethingWithVis(bool arg) {
}
}
bool dRoom_c::model_c::create(nw4r::g3d::ResFile resFile, mAllocator_c &alloc, s32 idx, UnkWithWater *waterThing) {
bool dRoom_c::model_c::create(nw4r::g3d::ResFile resFile, mAllocator_c &alloc, s32 idx, d3d::UnkWithWater *waterThing) {
SizedString<16> mdlName;
mdlName.sprintf("model%d", idx >> 1);
if ((idx & 1) != 0) {
@@ -485,7 +485,7 @@ bool dRoom_c::model_c::create(nw4r::g3d::ResFile resFile, mAllocator_c &alloc, s
return true;
}
bool linkResult = UnkWithWater::linkMdl(mdl, waterThing);
bool linkResult = d3d::UnkWithWater::linkMdl(mdl, waterThing);
if (!mMdl.create(mdl, alloc)) {
return false;
}
@@ -601,11 +601,9 @@ void dRoom_c::model_c::draw(int roomid) {
mMdl.entry();
}
extern "C" void fn_80017B10(nw4r::g3d::ResMdl &mdl, bool, bool);
void dRoom_c::model_c::configureSomething(int roomid, mdl_c *mdl) {
nw4r::g3d::ResMdl resMdl = mdl->getResMdl();
fn_80017B10(resMdl, true, false);
d3d::setRoomTevColors(resMdl, true, false);
}
const DrawPriorityConfig cfg[] = {
+4 -4
View File
@@ -14,8 +14,8 @@ void mdlAnmChr::setFrame(f32 f) {
mAnm.setFrameOnly(f);
}
void mdlAnmChr::setAnm(const char *name, playMode_e mode) {
setAnm(name, mode, 0.0f);
bool mdlAnmChr::setAnm(const char *name, playMode_e mode) {
return setAnm(name, mode, 0.0f);
}
void mdlAnmChr::setRate(f32 rate) {
@@ -75,13 +75,13 @@ bool mdlAnmChr::create(
return create(resFile, resFile, mdlName, anmName, nullptr, alloc, bufferOption, nView, pSize);
}
void mdlAnmChr::setAnm(const char *name, playMode_e mode, f32 blend) {
bool mdlAnmChr::setAnm(const char *name, playMode_e mode, f32 blend) {
nw4r::g3d::ResAnmChr anm = mAnmFile.GetResAnmChr(name);
if (!anm.IsValid()) {
anm = mMdlFile.GetResAnmChr(name);
}
mAnm.setAnm(mMdl, anm, mode);
mMdl.setAnm(mAnm, blend);
return mMdl.setAnm(mAnm, blend);
}
} // namespace m3d
+3 -3
View File
@@ -49,17 +49,17 @@ bool bmdl_c::getNodeWorldMtxMultVec(u32 p1, nw4r::math::VEC3 &in, nw4r::math::VE
}
}
void bmdl_c::setAnm(banm_c &anm) {
bool bmdl_c::setAnm(banm_c &anm) {
nw4r::g3d::ScnMdlSimple *mdl;
if (anm.getType() == nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_SHP) {
mdl = nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::ScnMdl>(mpScnLeaf);
mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
return mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
} else {
mdl = nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::ScnMdlSimple>(mpScnLeaf);
if (anm.getType() == nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_CHR) {
mpCurrentAnm = &anm;
}
mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
return mdl->SetAnmObj(anm.getAnimObj(), nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_NOT_SPECIFIED);
}
}
+4 -4
View File
@@ -217,8 +217,8 @@ void mdl_c::remove() {
bmdl_c::remove();
}
void mdl_c::setAnm(m3d::banm_c &anm) {
setAnm(anm, 0.0f);
bool mdl_c::setAnm(m3d::banm_c &anm) {
return setAnm(anm, 0.0f);
}
void mdl_c::play() {
@@ -226,11 +226,11 @@ void mdl_c::play() {
mpCallback->calcBlend();
}
void mdl_c::setAnm(m3d::banm_c &anm, f32 f) {
bool mdl_c::setAnm(m3d::banm_c &anm, f32 f) {
if (anm.getType() == nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_CHR) {
mpCallback->setBlendFrame(f);
}
bmdl_c::setAnm(anm);
return bmdl_c::setAnm(anm);
}
void mdl_c::setCallback(callback_c *cb) {
+2 -2
View File
@@ -182,8 +182,8 @@ BlurAndPaletteManager::BlurAndPaletteManager() {
field_0x5CE4.MA01_tevReg1 = mColor(0xff, 0xff, 0xff, 0xff);
field_0x5CE4.MA01_kColor2 = mColor(0xff, 0xff, 0xff, 0xff);
field_0x5CE4.MA02_tevReg1 = mColor(0xff, 0xff, 0xff, 0xff);
field_0x5CE4.MA02_kcolor2 = mColor(0xff, 0xff, 0xff, 0xff);
field_0x5CE4.MA03_kcolor3 = mColor(0xff, 0xff, 0xff, 0xff);
field_0x5CE4.MA02_kColor2 = mColor(0xff, 0xff, 0xff, 0xff);
field_0x5CE4.MA03_kColor3 = mColor(0xff, 0xff, 0xff, 0xff);
field_0x5D04.field_0x00 = field_0x5CE4;
field_0x5D04.field_0x20 = field_0x5CE4;
+408
View File
@@ -0,0 +1,408 @@
#include "toBeSorted/d_d3d.h"
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/d_sc_game.h"
#include "d/t/d_t_siren.h"
#include "egg/gfx/eggCpuTexture.h"
#include "egg/gfx/eggScreen.h"
#include "m/m3d/m_anmmdl.h"
#include "m/m3d/m_proc.h"
#include "m/m3d/m_scnleaf.h"
#include "m/m_color.h"
#include "nw4r/g3d/g3d_scnobj.h"
#include "nw4r/g3d/res/g3d_resanmchr.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "nw4r/g3d/res/g3d_resmat.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
#include "nw4r/g3d/res/g3d_restev.h"
#include "rvl/GX/GXTexture.h"
#include "rvl/GX/GXTypes.h"
#include "rvl/VI/vi.h"
#include "sized_string.h"
#include "toBeSorted/blur_and_palette_manager.h"
namespace d3d {
static EGG::Screen sSomeScreen;
static SomeList sSomeList;
AnmMdlWrapper::AnmMdlWrapper() : mpSoundSource(nullptr), mpSoundData(nullptr) {}
AnmMdlWrapper::~AnmMdlWrapper() {
if (mpSoundSource != nullptr) {
if (mpSoundSource->shutdown()) {
do {
VIWaitForRetrace();
} while (mpSoundSource->shutdown());
}
}
}
bool AnmMdlWrapper::create(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName, u32 bufferOption
) {
if (!m3d::mdlAnmChr::create(mdlFile, anmFile, mdlName, anmName, &ac.heap_allocator, bufferOption, 1, nullptr)) {
return false;
}
mpSoundSource = ac.getSoundSource();
return true;
}
bool AnmMdlWrapper::create2(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName, u32 bufferOption
) {
return create(ac, mdlFile, anmFile, mdlName, anmName, bufferOption);
}
bool AnmMdlWrapper::create(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
) {
if (!m3d::mdlAnmChr::create(
mdlFile, anmFile, mdlName, anmName, callback, &ac.heap_allocator, bufferOption, 1, nullptr
)) {
return false;
}
mpSoundSource = ac.getSoundSource();
return true;
}
bool AnmMdlWrapper::create2(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
) {
return create(ac, mdlFile, anmFile, mdlName, anmName, callback, bufferOption);
}
bool AnmMdlWrapper::create(dAcBase_c &ac, void *resFile, const char *mdlName, const char *anmName, u32 bufferOption) {
return create(ac, resFile, resFile, mdlName, anmName, bufferOption);
}
bool AnmMdlWrapper::create2(dAcBase_c &ac, void *resFile, const char *mdlName, const char *anmName, u32 bufferOption) {
return create(ac, resFile, mdlName, anmName, bufferOption);
}
bool AnmMdlWrapper::create(
dAcBase_c &ac, void *mdlFile, const char *mdlName, const char *anmName, m3d::mdl_c::mdlCallback_c *callback,
u32 bufferOption
) {
return create(ac, mdlFile, mdlFile, mdlName, anmName, callback, bufferOption);
}
bool AnmMdlWrapper::create2(
dAcBase_c &ac, void *mdlFile, const char *mdlName, const char *anmName, m3d::mdl_c::mdlCallback_c *callback,
u32 bufferOption
) {
return create(ac, mdlFile, mdlName, anmName, callback, bufferOption);
}
void AnmMdlWrapper::play() {
m3d::mdlAnmChr::play();
syncAnmFrame();
}
void AnmMdlWrapper::setFrame(f32 frame) {
m3d::mdlAnmChr::setFrame(frame);
syncAnmFrame();
}
bool AnmMdlWrapper::setAnm(const char *name, m3d::playMode_e mode, f32 frame) {
if (!m3d::mdlAnmChr::setAnm(name, mode, frame)) {
return false;
}
return loadSounds(name);
}
void AnmMdlWrapper::setRate(f32 rate) {
m3d::mdlAnmChr::setRate(rate);
setSoundRate(rate);
}
void AnmMdlWrapper::setSoundSource(SoundSource *pSource) {
mpSoundSource = pSource;
}
bool AnmMdlWrapper::loadSounds(const char *name) {
if (mpSoundSource == nullptr || !mpSoundSource->isReadyMaybe()) {
return true;
}
SizedString<64> resPath;
resPath.sprintf("%s.brasd", name);
mpSoundData = mAnmFile.GetExternalData(resPath);
if (mpSoundData == nullptr) {
mpSoundData = mMdlFile.GetExternalData(resPath);
}
mpSoundSource->load(mpSoundData, name);
return true;
}
void AnmMdlWrapper::setSoundRate(f32 rate) {
if (mpSoundSource != nullptr) {
mpSoundSource->setRate(rate);
}
}
void AnmMdlWrapper::syncAnmFrame() {
if (mpSoundSource != nullptr) {
mpSoundSource->setFrame(getAnm().getFrame());
}
}
bool AnmMdlWrapper2::createExt(
dAcBase_c &ac, void *mdlFile, void *anmFile, void *ext1, void *ext2, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
) {
if (!create2(ac, mdlFile, anmFile, mdlName, anmName, callback, bufferOption)) {
return false;
}
if (ext1 != nullptr) {
mExt1 = nw4r::g3d::ResFile(ext1);
mHasExt1 = true;
}
if (ext2 != nullptr) {
mExt2 = nw4r::g3d::ResFile(ext2);
mHasExt2 = true;
}
if (mHasExt1) {
mExt1.Bind(mMdlFile);
}
if (mHasExt2) {
mExt2.Bind(mMdlFile);
}
return true;
}
bool AnmMdlWrapper::create3(
dAcBase_c &ac, void *mdlFile, void *anmFile, const char *mdlName, const char *anmName,
m3d::mdl_c::mdlCallback_c *callback, u32 bufferOption
) {
return create2(ac, mdlFile, anmFile, mdlName, anmName, callback, bufferOption);
}
bool AnmMdlWrapper2::setAnm(const char *anmFile, m3d::playMode_e mode, f32 frame) {
nw4r::g3d::ResAnmChr res = mAnmFile.GetResAnmChr(anmFile);
if (!res.IsValid()) {
if (mHasExt1) {
res = mExt1.GetResAnmChr(anmFile);
if (!res.IsValid()) {
if (mHasExt2) {
res = mExt2.GetResAnmChr(anmFile);
if (!res.IsValid()) {
res = mMdlFile.GetResAnmChr(anmFile);
}
}
}
}
}
mAnm.setAnm(mMdl, res, mode);
if (mMdl.setAnm(mAnm, frame)) {
return loadSounds(anmFile);
}
return false;
}
extern "C" f32 lbl_80575150;
extern "C" f32 lbl_8057514C;
extern "C" f32 lbl_80576A0C;
void insertNode(SomeListNode *node, f32 a, f32 b) {
node->field_0x04 = ((a * lbl_80575150) - 0.5f) + lbl_8057514C;
node->field_0x06 = (lbl_80575150 - 0.5f) - b;
sSomeList.insert(node);
}
void clearList() {
// TODO
for (SomeList::Iterator it = sSomeList.GetBeginIter(); it != sSomeList.GetEndIter(); ++it) {
SomeListNode *nd = &*it;
SomeList::Iterator itCopy = sSomeList.GetPosition(nd);
sSomeList.remove(nd);
it = itCopy;
}
}
// More screen / list stuff...
void unk2(nw4r::g3d::ResMat &mat, nw4r::g3d::ResMatTevColor &clr, LightingInfo *info) {
BlurAndPaletteManager &pllt = BlurAndPaletteManager::GetInstance();
const char *name = mat.GetName();
if (name != nullptr && name[0] == 'M' && name[1] == 'A' && name[2] == '0') {
char idx = name[3];
if (idx == '0') {
if (clr.IsValid()) {
clr.GXSetTevKColor(GX_KCOLOR3, pllt.GetCurrentDefaultMcf().MA00_kColor3);
clr.DCStore(false);
if (info != nullptr) {
info->mTevK3Color = pllt.GetCurrentDefaultMcf().MA00_kColor3;
info->mUseTevK3 = true;
}
}
} else if (idx == '1') {
if (clr.IsValid()) {
clr.GXSetTevColor(GX_TEVREG1, pllt.GetCurrentDefaultMcf().MA01_tevReg1);
clr.GXSetTevKColor(GX_KCOLOR2, pllt.GetCurrentDefaultMcf().MA01_kColor2);
clr.DCStore(false);
if (info != nullptr) {
info->mTev1Color = pllt.GetCurrentDefaultMcf().MA01_tevReg1;
info->mUseTev1 = true;
info->mTevK2Color = pllt.GetCurrentDefaultMcf().MA01_kColor2;
info->mUseTevK2 = true;
}
}
} else if (idx == '2') {
if (clr.IsValid()) {
clr.GXSetTevColor(GX_TEVREG1, pllt.GetCurrentDefaultMcf().MA02_tevReg1);
clr.GXSetTevKColor(GX_KCOLOR2, pllt.GetCurrentDefaultMcf().MA02_kColor2);
clr.DCStore(false);
if (info != nullptr) {
info->mTev1Color = pllt.GetCurrentDefaultMcf().MA02_tevReg1;
info->mUseTev1 = true;
info->mTevK2Color = pllt.GetCurrentDefaultMcf().MA02_kColor2;
info->mUseTevK2 = true;
}
}
} else if (idx == '3') {
if (clr.IsValid()) {
clr.GXSetTevKColor(GX_KCOLOR2, pllt.GetCurrentDefaultMcf().MA03_kColor3);
clr.DCStore(false);
if (info != nullptr) {
info->mTevK3Color = pllt.GetCurrentDefaultMcf().MA03_kColor3;
info->mUseTevK3 = true;
}
}
}
// TODO
}
}
void setRoomTevColors(nw4r::g3d::ResMdl mdl, int b1, bool bUnk) {
BlurAndPaletteManager &pllt = BlurAndPaletteManager::GetInstance();
SpawnInfo &spawn = dScGame_c::currentSpawnInfo;
for (u32 i = 0; i < mdl.GetResMatNumEntries(); i++) {
nw4r::g3d::ResMat mat = mdl.GetResMat(i);
nw4r::g3d::ResMatMisc misc = mat.GetResMatMisc();
nw4r::g3d::ResMatTevColor clr = mat.GetResMatTevColor();
unk2(mat, clr, nullptr);
nw4r::g3d::ResMat mat2 = mdl.GetResMat(i);
nw4r::g3d::ResTev tev = mat2.GetResTev();
// Apply false colors in trials
if (tev.IsValid() && spawn.getTrial() == SpawnInfo::TRIAL) {
if (pllt.get0x2DE8() == 0) {
if (!dTgSiren_c::isOutOfTime()) {
// blue -> green
tev.GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_GREEN, GX_CH_ALPHA);
tev.DCStore(false);
} else {
// red -> green, blue -> red
tev.GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_GREEN, GX_CH_GREEN, GX_CH_RED, GX_CH_ALPHA);
tev.DCStore(false);
}
} else {
// no change
tev.GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
tev.DCStore(false);
}
}
if (b1 == 1) {
misc.SetLightSetIdx(b1);
}
nw4r::g3d::ResMatChan chan = mat.GetResMatChan();
chan.GXSetChanAmbColor(GX_COLOR0, mColor(0xFF, 0xFF, 0xFF, 0xFF));
}
}
void UnkWithWater::calc(EGG::CpuTexture *tex) {
GXTexObj obj;
if (tex != nullptr) {
tex->GetTexObj(&obj);
}
for (NodeList::Iterator it = mList.GetBeginIter(); it != mList.GetEndIter(); ++it) {
it->apply(&obj);
}
}
bool UnkWithWater::init(nw4r::g3d::ResTexObj &obj, GXTexMapID mapId) {
UnkWithWaterNode *nd = new UnkWithWaterNode(obj, mapId);
if (nd == nullptr) {
return false;
}
mList.insert(nd);
return true;
}
void UnkWithWater::remove() {
// TODO register usage
NodeList::Iterator nextIt;
for (NodeList::Iterator it = mList.GetBeginIter(); it != mList.GetEndIter(); it = nextIt) {
nextIt = it;
++nextIt;
UnkWithWaterNode *nd = &*it;
mList.remove(nd);
delete nd;
}
}
void UnkWithWaterNode::apply(const GXTexObj *obj) {
GXTexObj *o = mObj.GetTexObj(mMapId);
*o = *obj;
}
int EggTextureProc::entry() {
field_0x50 = field_0x51;
if (field_0x50) {
field_0x51 = (f32)field_0x50 * ((f32)field_0x52 / (f32)(field_0x52 + 1));
return m3d::scnLeaf_c::entry();
} else {
doRemove();
return 0;
}
}
void EggTextureProc::doDraw() {}
void EggTextureProc::doRemove() {}
bool EggTextureProc::create(int prioOpa, int prioXlu, mAllocator_c *alloc) {
if (!m3d::proc_c::create(alloc, nullptr)) {
return false;
}
if (prioOpa >= 0) {
setPriorityDraw(prioOpa, 0);
setOption(nw4r::g3d::ScnObj::OPTION_DISABLE_DRAW_XLU, true);
} else {
setPriorityDraw(0, prioXlu);
setOption(nw4r::g3d::ScnObj::OPTION_DISABLE_DRAW_OPA, true);
}
return true;
}
bool EggTextureProc::createXlu(int prioXlu, mAllocator_c *alloc) {
if (!m3d::proc_c::create(alloc, nullptr)) {
return false;
}
setPriorityDraw(0, prioXlu);
setOption(nw4r::g3d::ScnObj::OPTION_DISABLE_DRAW_OPA, true);
return true;
}
void XluProc::drawXlu() {
// TODO
}
} // namespace d3d
+159
View File
@@ -0,0 +1,159 @@
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/d_bzs_types.h"
#include "m/m3d/m3d.h"
#include "nw4r/g3d/g3d_camera.h"
#include "nw4r/g3d/g3d_scnmdl.h"
#include "nw4r/g3d/g3d_scnmdlsmpl.h"
#include "nw4r/g3d/g3d_scnobj.h"
#include "nw4r/g3d/res/g3d_resmat.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
#include "nw4r/g3d/res/g3d_respltt.h"
#include "rvl/GX/GXTypes.h"
#include "sized_string.h"
#include "toBeSorted/d_d3d.h"
#include "toBeSorted/stage_render_stuff.h"
void dScnCallback_c::ExecCallback_CALC_MAT(nw4r::g3d::ScnObj::Timing, nw4r::g3d::ScnObj *obj, u32 param, void *pObj) {
const LightingInfo &info = mpActor->mLightingInfo;
mColor tev0 = info.mTev0Color;
mColor tev1 = info.mTev1Color;
mColor tev2 = info.mTev2Color;
mColor tevPrev = info.mTevPrevColor;
mColor tevK0 = info.mTevK0Color;
mColor tevK1 = info.mTevK1Color;
mColor tevK2 = info.mTevK2Color;
mColor tevK3 = info.mTevK3Color;
bool bTevK3 = false;
bool bTev0 = info.mUseTev0;
bool bTev1 = info.mUseTev1;
bool bTev2 = info.mUseTev2;
bool bTevPrev = info.mUseTevPrev;
bool bTevK0 = info.mUseTevK0;
bool bTevK1 = info.mUseTevK1;
bool bTevK2 = info.mUseTevK2;
if (!field_0x08 && info.mUseTevK3) {
bTevK3 = true;
}
nw4r::g3d::ScnMdl *pMdl = nw4r::g3d::ScnObj::DynamicCast<nw4r::g3d::ScnMdl>(obj);
if (pMdl != nullptr) {
nw4r::g3d::ResMdl resMdl = pMdl->GetResMdl();
for (u32 i = 0; i < resMdl.GetResMatNumEntries(); i++) {
nw4r::g3d::ScnMdl::CopiedMatAccess mat(pMdl, i);
nw4r::g3d::ResMatTevColor clr = mat.GetResMatTevColor(false);
if (bTev0) {
clr.GXSetTevColor(GX_TEVREG0, tev0);
}
if (bTevK0) {
clr.GXSetTevKColor(GX_KCOLOR0, tevK0);
}
if (bTevK3) {
clr.GXSetTevKColor(GX_KCOLOR3, tevK3);
}
if (bTev1) {
clr.GXSetTevColor(GX_TEVREG1, tev1);
}
if (bTev2) {
clr.GXSetTevColor(GX_TEVREG2, tev2);
}
if (bTevPrev) {
clr.GXSetTevColor(GX_TEVPREV, tevPrev);
}
if (bTevK1) {
clr.GXSetTevKColor(GX_KCOLOR1, tevK1);
}
if (bTevK2) {
clr.GXSetTevKColor(GX_KCOLOR2, tevK2);
}
clr.DCStore(false);
}
return;
}
nw4r::g3d::ScnMdlSimple *pMdlSimple = nw4r::g3d::ScnObj::DynamicCast<nw4r::g3d::ScnMdlSimple>(obj);
nw4r::g3d::ResMdl resMdl = pMdlSimple->GetResMdl();
for (u32 i = 0; i < resMdl.GetResMatNumEntries(); i++) {
nw4r::g3d::ResMat mat = resMdl.GetResMat(i);
nw4r::g3d::ResMatTevColor clr = mat.GetResMatTevColor();
if (bTev0) {
clr.GXSetTevColor(GX_TEVREG0, tev0);
}
if (bTevK0) {
clr.GXSetTevKColor(GX_KCOLOR0, tevK0);
}
if (bTevK3) {
clr.GXSetTevKColor(GX_KCOLOR3, tevK3);
}
if (bTev1) {
clr.GXSetTevColor(GX_TEVREG1, tev1);
}
if (bTev2) {
clr.GXSetTevColor(GX_TEVREG2, tev2);
}
if (bTevPrev) {
clr.GXSetTevColor(GX_TEVPREV, tevPrev);
}
if (bTevK1) {
clr.GXSetTevKColor(GX_KCOLOR1, tevK1);
}
if (bTevK2) {
clr.GXSetTevKColor(GX_KCOLOR2, tevK2);
}
clr.DCStore(false);
}
}
void dScnCallback_c::attach(m3d::scnLeaf_c &leaf) {
leaf.swapCallback(this);
leaf.enableCallbackTiming(nw4r::g3d::ScnObj::CALLBACK_TIMING_C);
leaf.enableCallbackOp(nw4r::g3d::ScnObj::EXECOP_CALC_MAT);
}
void setPCAMPos2(PCAM *pcam) {
static nw4r::g3d::Camera::PostureInfo sPosture = {
nw4r::g3d::Camera::POSTURE_AIM,
nw4r::math::VEC3(0.0f, 0.0f, 0.0f),
nw4r::math::VEC3(0.0f, 0.0f, 0.0f),
nw4r::math::VEC3(0.0f, 0.0f, 0.0f),
0.0f,
};
nw4r::g3d::Camera cam = m3d::getCamera(pcam->id);
cam.SetPosition(pcam->position1.x, pcam->position1.y, pcam->position1.z);
// TODO
sPosture.cameraTarget = pcam->position2;
cam.SetPosture(sPosture);
cam.SetOrtho(pcam->field_0x1C, -pcam->field_0x1C, -pcam->field_0x1C, pcam->field_0x1C, 1.0f, 1000000.0f);
cam.SetTexMtxParam(0.5f, 0.5f, 0.5f, 0.5f);
}
// TODO
bool d3d::UnkWithWater::linkMdl(nw4r::g3d::ResMdl &mdl, d3d::UnkWithWater *thing) {
bool result = false;
for (u32 i = 0; i < mdl.GetResMatNumEntries(); i++) {
nw4r::g3d::ResMat mat = mdl.GetResMat(i);
nw4r::g3d::ResTexSrt srt = mat.GetResTexSrt();
for (u32 j = 0; j < mat.GetNumResTexPlttInfo(); j++) {
nw4r::g3d::ResTexPlttInfo paletteInfo = mat.GetResTexPlttInfo(j);
const char *name = paletteInfo.GetTexName();
if (strequals(name, "DummyWater") || strequals(name, "TimeDoorB_Dummy")) {
nw4r::g3d::ResTexObj obj = mat.GetResTexObj();
thing->init(obj, paletteInfo.ptr()->mapID);
u32 mode;
int camRef;
int lightRef;
srt.GetMapMode(j, &mode, &camRef, &lightRef);
srt.SetMapMode(j, mode, 0, lightRef);
result = true;
}
}
}
return result;
}
View File