Skip to content

Commit

Permalink
d_a_obj_pumpkin_leaf OK (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper authored Oct 6, 2024
1 parent 5980549 commit b83c0d5
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 49 deletions.
3 changes: 3 additions & 0 deletions config/SOUE01/rels/d_a_obj_pumpkin_leafNP/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ REL/global_destructor_chain.c:
REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp:
.text start:0x000000F0 end:0x00000AC8
.ctors start:0x00000000 end:0x00000004
.rodata start:0x00000000 end:0x00000014
.data start:0x00000000 end:0x000001D4
.bss start:0x00000008 end:0x00000048
96 changes: 48 additions & 48 deletions config/SOUE01/rels/d_a_obj_pumpkin_leafNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@ _epilog = .text:0x00000030; // type:function size:0x2C scope:global
_unresolved = .text:0x00000060; // type:function size:0x4 scope:global
__register_global_object = .text:0x00000070; // type:function size:0x1C scope:global
__destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global
fn_465_F0 = .text:0x000000F0; // type:function size:0xC0
fn_465_1B0 = .text:0x000001B0; // type:function size:0x58
fn_465_210 = .text:0x00000210; // type:function size:0x6C
fn_465_280 = .text:0x00000280; // type:function size:0xA0
fn_465_320 = .text:0x00000320; // type:function size:0xA4
fn_465_3D0 = .text:0x000003D0; // type:function size:0x7C
fn_465_450 = .text:0x00000450; // type:function size:0x11C
fn_465_570 = .text:0x00000570; // type:function size:0x10
fn_465_580 = .text:0x00000580; // type:function size:0x8
fn_465_590 = .text:0x00000590; // type:function size:0x30
fn_465_5C0 = .text:0x000005C0; // type:function size:0x28
fn_465_5F0 = .text:0x000005F0; // type:function size:0x4
fn_465_600 = .text:0x00000600; // type:function size:0x4
fn_465_610 = .text:0x00000610; // type:function size:0x4
fn_465_620 = .text:0x00000620; // type:function size:0xCC
fn_465_6F0 = .text:0x000006F0; // type:function size:0x10
fn_465_700 = .text:0x00000700; // type:function size:0x10
fn_465_710 = .text:0x00000710; // type:function size:0x60
fn_465_770 = .text:0x00000770; // type:function size:0xC
fn_465_780 = .text:0x00000780; // type:function size:0x1C
fn_465_7A0 = .text:0x000007A0; // type:function size:0x1C
fn_465_7C0 = .text:0x000007C0; // type:function size:0x1C
fn_465_7E0 = .text:0x000007E0; // type:function size:0x10
fn_465_7F0 = .text:0x000007F0; // type:function size:0x10
fn_465_800 = .text:0x00000800; // type:function size:0x10
fn_465_810 = .text:0x00000810; // type:function size:0x10
fn_465_820 = .text:0x00000820; // type:function size:0x10
fn_465_830 = .text:0x00000830; // type:function size:0x10
fn_465_840 = .text:0x00000840; // type:function size:0x30
fn_465_870 = .text:0x00000870; // type:function size:0x30
fn_465_8A0 = .text:0x000008A0; // type:function size:0x30
fn_465_8D0 = .text:0x000008D0; // type:function size:0x10C
fn_465_9E0 = .text:0x000009E0; // type:function size:0x58
fn_465_A40 = .text:0x00000A40; // type:function size:0x88
dAcOPumpkinLeaf_c_classInit__Fv = .text:0x000000F0; // type:function size:0xC0
__dt__30sFState_c<17dAcOPumpkinLeaf_c>Fv = .text:0x000001B0; // type:function size:0x58
__dt__33sFStateFct_c<17dAcOPumpkinLeaf_c>Fv = .text:0x00000210; // type:function size:0x6C
__dt__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000280; // type:function size:0xA0
__dt__56sFStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c>Fv = .text:0x00000320; // type:function size:0xA4
createHeap__17dAcOPumpkinLeaf_cFv = .text:0x000003D0; // type:function size:0x7C
create__17dAcOPumpkinLeaf_cFv = .text:0x00000450; // type:function size:0x11C
changeState__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000570; // type:function size:0x10
doDelete__17dAcOPumpkinLeaf_cFv = .text:0x00000580; // type:function size:0x8
actorExecute__17dAcOPumpkinLeaf_cFv = .text:0x00000590; // type:function size:0x30
draw__17dAcOPumpkinLeaf_cFv = .text:0x000005C0; // type:function size:0x28
initializeState_Wait__17dAcOPumpkinLeaf_cFv = .text:0x000005F0; // type:function size:0x4
executeState_Wait__17dAcOPumpkinLeaf_cFv = .text:0x00000600; // type:function size:0x4
finalizeState_Wait__17dAcOPumpkinLeaf_cFv = .text:0x00000610; // type:function size:0x4
__dt__17dAcOPumpkinLeaf_cFv = .text:0x00000620; // type:function size:0xCC
executeState__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000006F0; // type:function size:0x10
getStateID__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00000700; // type:function size:0x10
build__33sFStateFct_c<17dAcOPumpkinLeaf_c>FRC12sStateIDIf_c = .text:0x00000710; // type:function size:0x60
dispose__33sFStateFct_c<17dAcOPumpkinLeaf_c>FRP10sStateIf_c = .text:0x00000770; // type:function size:0xC
initialize__30sFState_c<17dAcOPumpkinLeaf_c>Fv = .text:0x00000780; // type:function size:0x1C
execute__30sFState_c<17dAcOPumpkinLeaf_c>Fv = .text:0x000007A0; // type:function size:0x1C
finalize__30sFState_c<17dAcOPumpkinLeaf_c>Fv = .text:0x000007C0; // type:function size:0x1C
initializeState__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000007E0; // type:function size:0x10
finalizeState__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000007F0; // type:function size:0x10
refreshState__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000800; // type:function size:0x10
getState__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00000810; // type:function size:0x10
getNewStateID__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00000820; // type:function size:0x10
getOldStateID__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00000830; // type:function size:0x10
finalizeState__32sFStateID_c<17dAcOPumpkinLeaf_c>CFR17dAcOPumpkinLeaf_c = .text:0x00000840; // type:function size:0x30
executeState__32sFStateID_c<17dAcOPumpkinLeaf_c>CFR17dAcOPumpkinLeaf_c = .text:0x00000870; // type:function size:0x30
initializeState__32sFStateID_c<17dAcOPumpkinLeaf_c>CFR17dAcOPumpkinLeaf_c = .text:0x000008A0; // type:function size:0x30
__sinit_\d_a_obj_pumpkin_leaf_cpp = .text:0x000008D0; // type:function size:0x10C scope:local
__dt__32sFStateID_c<17dAcOPumpkinLeaf_c>Fv = .text:0x000009E0; // type:function size:0x58
isSameName__32sFStateID_c<17dAcOPumpkinLeaf_c>CFPCc = .text:0x00000A40; // type:function size:0x88
_ctors = .ctors:0x00000000; // type:label scope:global
_dtors = .dtors:0x00000000; // type:label scope:global
__destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global
lbl_465_rodata_0 = .rodata:0x00000000; // type:object size:0x14 data:float
lbl_465_data_0 = .data:0x00000000; // type:object size:0x10 data:4byte
lbl_465_data_10 = .data:0x00000010; // type:object size:0x8 data:string
lbl_465_data_18 = .data:0x00000018; // type:object size:0x8
lbl_465_data_20 = .data:0x00000020; // type:object size:0x20
lbl_465_data_40 = .data:0x00000040; // type:object size:0x8 data:string
lbl_465_data_48 = .data:0x00000048; // type:object size:0x80
lbl_465_data_C8 = .data:0x000000C8; // type:object size:0x30
lbl_465_data_F8 = .data:0x000000F8; // type:object size:0x30
lbl_465_data_128 = .data:0x00000128; // type:object size:0x18
lbl_465_data_140 = .data:0x00000140; // type:object size:0x60
lbl_465_data_1A0 = .data:0x000001A0; // type:object size:0x34
lbl_465_rodata_0 = .rodata:0x00000000; // type:object size:0x14 scope:local data:float
g_profile_OBJ_PUMPKIN_LEAF = .data:0x00000000; // type:object size:0x10 data:4byte
lbl_465_data_10 = .data:0x00000010; // type:object size:0x8 scope:local data:string
lbl_465_data_18 = .data:0x00000018; // type:object size:0x8 scope:local
lbl_465_data_20 = .data:0x00000020; // type:object size:0x20 scope:local
lbl_465_data_40 = .data:0x00000040; // type:object size:0x8 scope:local data:string
__vt__17dAcOPumpkinLeaf_c = .data:0x00000048; // type:object size:0x80
__vt__56sFStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c> = .data:0x000000C8; // type:object size:0x30
__vt__86sStateMgr_c<17dAcOPumpkinLeaf_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x000000F8; // type:object size:0x30
__vt__33sFStateFct_c<17dAcOPumpkinLeaf_c> = .data:0x00000128; // type:object size:0x14
__vt__30sFState_c<17dAcOPumpkinLeaf_c> = .data:0x00000140; // type:object size:0x18
__vt__32sFStateID_c<17dAcOPumpkinLeaf_c> = .data:0x000001A0; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_465_bss_8 = .bss:0x00000008; // type:object size:0x10
lbl_465_bss_18 = .bss:0x00000018; // type:object size:0x30 data:4byte
lbl_465_bss_8 = .bss:0x00000008; // type:object size:0x10 scope:local
StateID_Wait__17dAcOPumpkinLeaf_c = .bss:0x00000018; // type:object size:0x30 data:4byte
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ def nw4rLib(lib_name, objects, extra_cflags=[]):
Rel(NonMatching, "d_a_obj_propeller_lift", "REL/d/a/obj/d_a_obj_propeller_lift.cpp"),
Rel(NonMatching, "d_a_obj_propera", "REL/d/a/obj/d_a_obj_propera.cpp"),
Rel(NonMatching, "d_a_obj_pumpkin_bar", "REL/d/a/obj/d_a_obj_pumpkin_bar.cpp"),
Rel(NonMatching, "d_a_obj_pumpkin_leaf", "REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp"),
Rel(Matching, "d_a_obj_pumpkin_leaf", "REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp"),
Rel(NonMatching, "d_a_obj_push_block", "REL/d/a/obj/d_a_obj_push_block.cpp"),
Rel(NonMatching, "d_a_obj_puzzle_island", "REL/d/a/obj/d_a_obj_puzzle_island.cpp"),
Rel(NonMatching, "d_a_obj_rail_end", "REL/d/a/obj/d_a_obj_rail_end.cpp"),
Expand Down
4 changes: 4 additions & 0 deletions include/d/a/d_a_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ class dAcBase_c : public dBase_c {
return getSquareDistanceTo(point) > radius;
}

u32 getRoomId() {
return roomid;
}

public:
// funcs found in TU
/* 8002c650 */ static void setTempCreateParams(mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2,
Expand Down
31 changes: 31 additions & 0 deletions include/d/a/obj/d_a_obj_pumpkin_leaf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifndef D_A_OBJ_PUMPKIN_LEAF_H
#define D_A_OBJ_PUMPKIN_LEAF_H

#include <d/a/obj/d_a_obj_base.h>
#include <m/m3d/m_smdl.h>
#include <s/s_State.hpp>
#include <s/s_StateMgr.hpp>

class dAcOPumpkinLeaf_c : public dAcObjBase_c {
public:
dAcOPumpkinLeaf_c() : mStateMgr(*this, sStateID::null) {}
virtual ~dAcOPumpkinLeaf_c() {}
virtual bool createHeap() override;
virtual int create() override;
virtual int actorExecute() override;
virtual int draw() override;
virtual int doDelete() override;

STATE_FUNC_DECLARE(dAcOPumpkinLeaf_c, Wait);

private:
nw4r::g3d::ResFile mBrres;
m3d::smdl_c mModel;
STATE_MGR_DECLARE(dAcOPumpkinLeaf_c);
void dummy_executeState() {
// Not called from the class but needed for weak function ordering
mStateMgr.executeState();
}
};

#endif
47 changes: 47 additions & 0 deletions src/REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <d/a/obj/d_a_obj_pumpkin_leaf.h>
#include <s/s_Math.h>

SPECIAL_ACTOR_PROFILE(OBJ_PUMPKIN_LEAF, dAcOPumpkinLeaf_c, fProfile::OBJ_PUMPKIN_LEAF, 0x0135, 0, 3);

STATE_DEFINE(dAcOPumpkinLeaf_c, Wait);

bool dAcOPumpkinLeaf_c::createHeap() {
mBrres = getOarcResFile("Pumpkin");
nw4r::g3d::ResMdl mdl = mBrres.GetResMdl("Leaf");
TRY_CREATE(mModel.create(mdl, &heap_allocator, 0x120, 1, nullptr));
return true;
}

int dAcOPumpkinLeaf_c::create() {
if (!initAllocatorWork1Heap(0x1000, "dAcOPumpkinLeaf_c::m_allocator", 0x20)) {
return FAILED;
}

forwardAccel = -1.0f;
forwardMaxSpeed = -40.0f;
updateMatrix();
mStateMgr.changeState(StateID_Wait);
setBoundingBox(mVec3_c(-50.0f, -10.0f, -50.0f), mVec3_c(50.0f, 50.0f, 50.0f));
dAcObjBase_c::create(
"PmpknBd", getRoomId(), 0, &position, &rotation, &scale, getParams2_ignoreLower(), -1, viewclip_index
);
return SUCCEEDED;
}

int dAcOPumpkinLeaf_c::doDelete() {
return SUCCEEDED;
}

int dAcOPumpkinLeaf_c::actorExecute() {
mModel.setLocalMtx(worldMatrix);
return SUCCEEDED;
}

int dAcOPumpkinLeaf_c::draw() {
drawModelType1(&mModel);
return SUCCEEDED;
}

void dAcOPumpkinLeaf_c::initializeState_Wait() {}
void dAcOPumpkinLeaf_c::executeState_Wait() {}
void dAcOPumpkinLeaf_c::finalizeState_Wait() {}

0 comments on commit b83c0d5

Please sign in to comment.