Skip to content

Commit

Permalink
dAcOlavaF200_c OK
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Jun 25, 2024
1 parent b6bd727 commit fc0bfd0
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 26 deletions.
2 changes: 2 additions & 0 deletions config/SOUE01/rels/d_a_obj_lava_F200NP/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ REL/executor.c:

REL/d/a/obj/d_a_obj_lava_F200.cpp:
.text start:0x00000070 end:0x000006C4
.rodata start:0x00000000 end:0x00000008
.data start:0x00000000 end:0x000000C8
32 changes: 16 additions & 16 deletions config/SOUE01/rels/d_a_obj_lava_F200NP/symbols.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
_prolog = .text:0x00000000; // type:function size:0x2C scope:global
_epilog = .text:0x00000030; // type:function size:0x2C scope:global
_unresolved = .text:0x00000060; // type:function size:0x4 scope:global
fn_429_70 = .text:0x00000070; // type:function size:0xB4
fn_429_130 = .text:0x00000130; // type:function size:0x64
fn_429_1A0 = .text:0x000001A0; // type:function size:0x64
fn_429_210 = .text:0x00000210; // type:function size:0x1C4
fn_429_3E0 = .text:0x000003E0; // type:function size:0x14C
fn_429_530 = .text:0x00000530; // type:function size:0x8
fn_429_540 = .text:0x00000540; // type:function size:0x7C
fn_429_5C0 = .text:0x000005C0; // type:function size:0x60
fn_429_620 = .text:0x00000620; // type:function size:0xA4
dAcOlavaF200_c_classInit__Fv = .text:0x00000070; // type:function size:0xB4
__ct__Q23m3d11anmTexSrt_cFv = .text:0x00000130; // type:function size:0x64
__ct__Q23m3d11anmMatClr_cFv = .text:0x000001A0; // type:function size:0x64
createHeap__14dAcOlavaF200_cFv = .text:0x00000210; // type:function size:0x1C4
create__14dAcOlavaF200_cFv = .text:0x000003E0; // type:function size:0x14C
doDelete__14dAcOlavaF200_cFv = .text:0x00000530; // type:function size:0x8
actorExecute__14dAcOlavaF200_cFv = .text:0x00000540; // type:function size:0x7C
draw__14dAcOlavaF200_cFv = .text:0x000005C0; // type:function size:0x60
__dt__14dAcOlavaF200_cFv = .text:0x00000620; // type:function size:0xA4
_ctors = .ctors:0x00000000; // type:label scope:global
_dtors = .dtors:0x00000000; // type:label scope:global
lbl_429_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float
lbl_429_rodata_4 = .rodata:0x00000004; // type:object size:0x4 data:float
lbl_429_data_0 = .data:0x00000000; // type:object size:0x10
lbl_429_data_10 = .data:0x00000010; // type:object size:0xC
lbl_429_data_1C = .data:0x0000001C; // type:object size:0xC
lbl_429_data_28 = .data:0x00000028; // type:object size:0x20
lbl_429_data_48 = .data:0x00000048; // type:object size:0x80
lbl_429_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float
lbl_429_rodata_4 = .rodata:0x00000004; // type:object size:0x4 scope:local data:float
g_profile_OBJ_LAVA_F200 = .data:0x00000000; // type:object size:0x10
lbl_429_data_10 = .data:0x00000010; // type:object size:0xC scope:local
lbl_429_data_1C = .data:0x0000001C; // type:object size:0xC scope:local
lbl_429_data_28 = .data:0x00000028; // type:object size:0x20 scope:local
__vt__14dAcOlavaF200_c = .data:0x00000048; // type:object size:0x80
4 changes: 2 additions & 2 deletions config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10983,8 +10983,8 @@ fn_801B40E0 = .text:0x801B40E0; // type:function size:0x12C
fn_801B4210 = .text:0x801B4210; // type:function size:0x28
fn_801B4240 = .text:0x801B4240; // type:function size:0x68
getRoom__11RoomManagerFi = .text:0x801B42B0; // type:function size:0x20
fn_801B42D0 = .text:0x801B42D0; // type:function size:0x50
fn_801B4320 = .text:0x801B4320; // type:function size:0x54
bindStageResToFile__11RoomManagerFPQ34nw4r3g3d7ResFile = .text:0x801B42D0; // type:function size:0x50
bindSkyCmnToResFile__11RoomManagerFPQ34nw4r3g3d7ResFile = .text:0x801B4320; // type:function size:0x54
fn_801B4380 = .text:0x801B4380; // type:function size:0xA0
fn_801B4420 = .text:0x801B4420; // type:function size:0x9C
changeLoadedEntities__11RoomManagerFP11RoomManagerUlb = .text:0x801B44C0; // type:function size:0x50
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ def nw4rLib(lib_name, objects, extra_cflags=[]):
Rel(NonMatching, "d_a_obj_kumite_wall", "REL/d/a/obj/d_a_obj_kumite_wall.cpp"),
Rel(NonMatching, "d_a_obj_lamp", "REL/d/a/obj/d_a_obj_lamp.cpp"),
Rel(NonMatching, "d_a_obj_lava_d201", "REL/d/a/obj/d_a_obj_lava_d201.cpp"),
Rel(NonMatching, "d_a_obj_lava_F200", "REL/d/a/obj/d_a_obj_lava_F200.cpp"),
Rel(Matching, "d_a_obj_lava_F200", "REL/d/a/obj/d_a_obj_lava_F200.cpp"),
Rel(NonMatching, "d_a_obj_lava_plate", "REL/d/a/obj/d_a_obj_lava_plate.cpp"),
Rel(NonMatching, "d_a_obj_leaf_swing", "REL/d/a/obj/d_a_obj_leaf_swing.cpp"),
Rel(NonMatching, "d_a_obj_lighthouse_harp", "REL/d/a/obj/d_a_obj_lighthouse_harp.cpp"),
Expand Down
26 changes: 26 additions & 0 deletions include/d/a/obj/d_a_obj_lava_F200.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef D_A_OBJ_LAVA_F200_H
#define D_A_OBJ_LAVA_F200_H

#include <d/a/obj/d_a_obj_base.h>
#include <m/m3d/m_anmmatclr.h>
#include <m/m3d/m_anmtexsrt.h>
#include <m/m3d/m_smdl.h>

class dAcOlavaF200_c : public dAcObjBase_c {
public:
dAcOlavaF200_c() {}
virtual ~dAcOlavaF200_c() {}
virtual bool createHeap() override;
virtual int create() override;
virtual int actorExecute() override;
virtual int draw() override;
virtual int doDelete() override;

private:
nw4r::g3d::ResFile mBrres;
m3d::smdl_c mModels[2];
m3d::anmTexSrt_c mTexAnms[2];
m3d::anmMatClr_c mClrAnms[2];
};

#endif
4 changes: 2 additions & 2 deletions include/m/m3d/m_anmmatclr.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef M3D_M_ANMTEXSRT_H
#define M3D_M_ANMTEXSRT_H
#ifndef M3D_M_ANMMATCLR_H
#define M3D_M_ANMMATCLR_H

#include <m/m3d/m_bmdl.h>
#include <m/m3d/m_fanm.h>
Expand Down
66 changes: 66 additions & 0 deletions src/REL/d/a/obj/d_a_obj_lava_F200.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include <d/a/obj/d_a_obj_lava_F200.h>
#include <toBeSorted/room_manager.h>

SPECIAL_ACTOR_PROFILE(OBJ_LAVA_F200, dAcOlavaF200_c, fProfile::OBJ_LAVA_F200, 0x0214, 0, 0);

bool dAcOlavaF200_c::createHeap() {
mBrres = getOarcResFile("LavaF200");
RoomManager::bindStageResToFile(&mBrres);

nw4r::g3d::ResMdl mdl0 = mBrres.GetResMdl("LavaF200");
TRY_CREATE(mModels[0].create(mdl0, &heap_allocator, 0x32C));
nw4r::g3d::ResAnmTexSrt anmTex0 = mBrres.GetResAnmTexSrt("LavaF200");
TRY_CREATE(mTexAnms[0].create(mdl0, anmTex0, &heap_allocator, nullptr, 1));
nw4r::g3d::ResAnmClr anmClr0 = mBrres.GetResAnmClr("LavaF200");
TRY_CREATE(mClrAnms[0].create(mdl0, anmClr0, &heap_allocator, nullptr, 1));

nw4r::g3d::ResMdl mdl1 = mBrres.GetResMdl("LavaF200_s");
TRY_CREATE(mModels[1].create(mdl1, &heap_allocator, 0x32C));
nw4r::g3d::ResAnmTexSrt anmTex1 = mBrres.GetResAnmTexSrt("LavaF200_s");
TRY_CREATE(mTexAnms[1].create(mdl1, anmTex1, &heap_allocator, nullptr, 1));
nw4r::g3d::ResAnmClr anmClr1 = mBrres.GetResAnmClr("LavaF200_s");
TRY_CREATE(mClrAnms[1].create(mdl1, anmClr1, &heap_allocator, nullptr, 1));

return true;
}

int dAcOlavaF200_c::create() {
if (!initAllocatorWork1Heap(-1, "dAcOlavaF200_c::m_allocator", 0x20)) {
return 2;
}

mModels[0].setAnm(mTexAnms[0]);
mModels[1].setAnm(mTexAnms[1]);
mModels[0].setAnm(mClrAnms[0]);
mModels[1].setAnm(mClrAnms[1]);

updateMatrix();
for (int i = 0; i < 2; i++) {
mModels[i].setLocalMtx(worldMatrix);
}

mModels[0].setPriorityDraw(0x1C, 9);
mModels[1].setPriorityDraw(0x22, 9);
setBoundingBox(mVec3_c(-0.0f, -0.0f, -0.0f), mVec3_c(0.0f, 0.0f, 0.0f));

return 1;
}

int dAcOlavaF200_c::doDelete() {
return 1;
}

int dAcOlavaF200_c::actorExecute() {
mTexAnms[0].play();
mTexAnms[1].play();
mClrAnms[0].play();
mClrAnms[1].play();
return 1;
}

int dAcOlavaF200_c::draw() {
for (int i = 0; i < 2; i++) {
drawModelType1(&mModels[i]);
}
return 1;
}
8 changes: 3 additions & 5 deletions src/REL/d/a/obj/d_a_obj_sun_light.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
#include <d/a/obj/d_a_obj_sun_light.h>
#include <toBeSorted/arc_managers/current_stage_arc_manager.h>
#include <toBeSorted/spawn_struct.h>
#include <toBeSorted/room_manager.h>

SPECIAL_ACTOR_PROFILE(OBJ_SUN_LIGHT, dAcOsunLight_c, fProfile::OBJ_SUN_LIGHT, 0x0219, 0, 3);

STATE_DEFINE(dAcOsunLight_c, Wait);

extern "C" void fn_801B42D0(nw4r::g3d::ResFile *);
extern "C" void fn_801B4320(nw4r::g3d::ResFile *);

bool dAcOsunLight_c::createHeap() {
mBrres = CurrentStageArcManager::sInstance->getData("g3d/stage.brres");
fn_801B42D0(&mBrres);
fn_801B4320(&mBrres);
RoomManager::bindStageResToFile(&mBrres);
RoomManager::bindSkyCmnToResFile(&mBrres);
nw4r::g3d::ResMdl mdl = mBrres.GetResMdl("StageF000Light");
TRY_CREATE(mModel.create(mdl, &heap_allocator, 0x120));
nw4r::g3d::ResAnmTexSrt srt = mBrres.GetResAnmTexSrt("StageF000Light");
Expand Down

0 comments on commit fc0bfd0

Please sign in to comment.