Skip to content

Commit

Permalink
proc_c OK
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Jun 21, 2024
1 parent ae9477d commit 8b3cc63
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 8 deletions.
1 change: 1 addition & 0 deletions config/SOUE01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ m/m3d/m3d.cpp:

m/m3d/m_proc.cpp:
.text start:0x802E4720 end:0x802E48D4
.data start:0x805424A0 end:0x805424D0

m/m3d/m_anmchr.cpp:
.text start:0x802E48E0 end:0x802E4D98
Expand Down
14 changes: 7 additions & 7 deletions config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17435,10 +17435,10 @@ fn_802E4640 = .text:0x802E4640; // type:function size:0x40
getNodeID__3m3dFQ34nw4r3g3d6ResMdlPCc = .text:0x802E4680; // type:function size:0x4C
resetMaterial__3m3dFv = .text:0x802E46D0; // type:function size:0x44
proc_c_drawProc__3m3dFPQ34nw4r3g3d7ScnProcb = .text:0x802E4720; // type:function size:0x2C
fn_802E4750 = .text:0x802E4750; // type:function size:0x58
fn_802E47B0 = .text:0x802E47B0; // type:function size:0x8
fn_802E47C0 = .text:0x802E47C0; // type:function size:0x4
fn_802E47D0 = .text:0x802E47D0; // type:function size:0x4
__dt__Q23m3d6proc_cFv = .text:0x802E4750; // type:function size:0x58
getType__Q23m3d6proc_cCFv = .text:0x802E47B0; // type:function size:0x8
drawOpa__Q23m3d6proc_cFv = .text:0x802E47C0; // type:function size:0x4
drawXlu__Q23m3d6proc_cFv = .text:0x802E47D0; // type:function size:0x4
create__Q23m3d6proc_cFP12mAllocator_cPUl = .text:0x802E47E0; // type:function size:0xF4
__dt__Q23m3d8anmChr_cFv = .text:0x802E48E0; // type:function size:0x58
getType__Q23m3d8anmChr_cCFv = .text:0x802E4940; // type:function size:0x8
Expand Down Expand Up @@ -24979,7 +24979,7 @@ fn_8045FDA0 = .text:0x8045FDA0; // type:function size:0xC
fn_8045FDB0 = .text:0x8045FDB0; // type:function size:0x234
G3dInit__Q24nw4r3g3dFb = .text:0x8045FFF0; // type:function size:0xF0
fn_804600E0 = .text:0x804600E0; // type:function size:0x8
fn_804600F0 = .text:0x804600F0; // type:function size:0x110
Construct__Q34nw4r3g3d7ScnProcFP12MEMAllocatorPUlPFPQ34nw4r3g3d7ScnProcb_vbbUl = .text:0x804600F0; // type:function size:0x110
fn_80460200 = .text:0x80460200; // type:function size:0x100
fn_80460300 = .text:0x80460300; // type:function size:0x68
fn_80460370 = .text:0x80460370; // type:function size:0x30
Expand Down Expand Up @@ -29127,7 +29127,7 @@ lbl_804F7B20 = .rodata:0x804F7B20; // type:object size:0x10
TYPE_NAME__Q34nw4r3g3d12ScnMdlSimple = .rodata:0x804F7B30; // type:object size:0x18
TYPE_NAME__Q34nw4r3g3d6ScnMdl = .rodata:0x804F7B48; // type:object size:0x10
lbl_804F7B58 = .rodata:0x804F7B58; // type:object size:0x18
lbl_804F7B70 = .rodata:0x804F7B70; // type:object size:0x10
TYPE_NAME__Q34nw4r3g3d7ScnProc = .rodata:0x804F7B70; // type:object size:0x10
lbl_804F7B80 = .rodata:0x804F7B80; // type:object size:0x460
lbl_804F7FE0 = .rodata:0x804F7FE0; // type:object size:0x3CC
lbl_804F83AC = .rodata:0x804F83AC; // type:object size:0x4C4
Expand Down Expand Up @@ -35681,7 +35681,7 @@ lbl_80542430 = .data:0x80542430; // type:object size:0xC
lbl_8054243C = .data:0x8054243C; // type:object size:0xC
lbl_80542448 = .data:0x80542448; // type:object size:0x18
lbl_80542460 = .data:0x80542460; // type:object size:0x40
lbl_805424A0 = .data:0x805424A0; // type:object size:0x30
__vt__Q23m3d6proc_c = .data:0x805424A0; // type:object size:0x2C
__vt__Q23m3d8anmChr_c = .data:0x805424D0; // type:object size:0x18
__vt__Q23m3d13anmChrBlend_c = .data:0x805424E8; // type:object size:0x18
__vt__Q23m3d11anmMatClr_c = .data:0x80542500; // type:object size:0x18
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def nw4rLib(lib_name, objects, extra_cflags=[]):
Object(Matching, "f/f_list.cpp"),
Object(Matching, "f/f_manager.cpp"),
Object(NonMatching, "m/m3d/m3d.cpp"),
Object(NonMatching, "m/m3d/m_proc.cpp"),
Object(Matching, "m/m3d/m_proc.cpp"),
Object(Matching, "m/m3d/m_anmchr.cpp"),
Object(Matching, "m/m3d/m_anmchrblend.cpp"),
Object(Matching, "m/m3d/m_anmtexpat.cpp"),
Expand Down
21 changes: 21 additions & 0 deletions include/m/m3d/m_proc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef M_M3D_PROC_H
#define M_M3D_PROC_H

#include <common.h>
#include <m/m3d/m_scnleaf.h>

namespace m3d {

class proc_c : public scnLeaf_c {
public:
virtual ~proc_c();
virtual int getType() const override;
bool create(mAllocator_c *, u32 *);

virtual void drawOpa();
virtual void drawXlu();
};

} // namespace m3d

#endif
46 changes: 46 additions & 0 deletions src/m/m3d/m_proc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <m/m3d/m3d.h>
#include <m/m3d/m_proc.h>
#include <nw4r/g3d/g3d_scnproc.h>

namespace m3d {

void proc_c_drawProc(nw4r::g3d::ScnProc *proc, bool b) {
proc_c *p = static_cast<proc_c *>(proc->GetUserData());
if (b) {
p->drawOpa();
} else {
p->drawXlu();
}
}

proc_c::~proc_c() {}

int proc_c::getType() const {
return 0x2;
}

void proc_c::drawOpa() {}
void proc_c::drawXlu() {}

bool proc_c::create(mAllocator_c *alloc, u32 *pSize) {
if (alloc == nullptr) {
alloc = internal::l_allocator_p;
}

u32 size;
if (pSize == nullptr) {
pSize = &size;
}

mpScnLeaf = nw4r::g3d::ScnProc::Construct(alloc, pSize, proc_c_drawProc, true, true, 0);
if (!mpScnLeaf) {
return false;
}

mpScnLeaf->SetPriorityDrawOpa(0x7f);
mpScnLeaf->SetPriorityDrawXlu(0x7f);
nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::ScnProc>(mpScnLeaf)->SetUserData(this);
return true;
}

} // namespace m3d

0 comments on commit 8b3cc63

Please sign in to comment.