Match and link CCollidableCollisionSurface

This commit is contained in:
Phillip Stephens 2022-12-08 14:33:06 -08:00
parent d977d443ee
commit 394cbea9c3
5 changed files with 43 additions and 5 deletions

View File

@ -3,8 +3,8 @@
.section .sdata
.balign 8
.global lbl_805A86F0
lbl_805A86F0:
.global sTableIndex__27CCollidableCollisionSurface
sTableIndex__27CCollidableCollisionSurface:
# ROM: 0x3F6090
.4byte 0xFFFFFFFF
.4byte 0
@ -23,7 +23,7 @@ GetType__27CCollidableCollisionSurfaceFv:
.global SetStaticTableIndex__27CCollidableCollisionSurfaceFUi
SetStaticTableIndex__27CCollidableCollisionSurfaceFUi:
/* 802CE0B0 002CB010 90 6D 9B 30 */ stw r3, lbl_805A86F0@sda21(r13)
/* 802CE0B0 002CB010 90 6D 9B 30 */ stw r3, sTableIndex__27CCollidableCollisionSurface@sda21(r13)
/* 802CE0B4 002CB014 4E 80 00 20 */ blr
.section .rodata
@ -33,4 +33,3 @@ lbl_803D6A00:
# ROM: 0x3D3A00
.asciz "CCollidableCollisionSurface"
.4byte 0

View File

@ -448,7 +448,7 @@ LIBS = [
"host": True,
"objects": [
"Collision/CCollidableAABox",
"Collision/CCollidableCollisionSurface",
["Collision/CCollidableCollisionSurface", True],
["Collision/CCollisionInfo", True],
"Collision/InternalColliders",
"Collision/CCollisionPrimitive",

View File

@ -0,0 +1,15 @@
#ifndef _CCOLLIDABLECOLLISIONSURFACE
#define _CCOLLIDABLECOLLISIONSURFACE
#include "Collision/CCollisionPrimitive.hpp"
class CCollidableCollisionSurface {
static int sTableIndex;
public:
static CCollisionPrimitive::Type GetType();
static void SetStaticTableIndex(uint index);
};
#endif // _CCOLLIDABLECOLLISIONSURFACE

View File

@ -12,8 +12,21 @@
class CRayCastResult;
class CInternalRayCastStructure;
typedef void(*PrimitiveSetter)(uint);
class CCollisionPrimitive {
public:
class Type {
public:
Type(PrimitiveSetter setter, const char* info) : mSetter(setter), mInfo(info) {}
PrimitiveSetter GetSetter() const { return mSetter; }
const char* GetInfo() const { return mInfo; }
private:
PrimitiveSetter mSetter;
const char* mInfo;
};
CCollisionPrimitive(const CMaterialList& list);
virtual uint GetTableIndex() const = 0;

View File

@ -0,0 +1,11 @@
#include "Collision/CCollidableCollisionSurface.hpp"
int CCollidableCollisionSurface::sTableIndex = -1;
void CCollidableCollisionSurface::SetStaticTableIndex(uint index) {
sTableIndex = index;
}
CCollisionPrimitive::Type CCollidableCollisionSurface::GetType() {
return CCollisionPrimitive::Type(SetStaticTableIndex, "CCollidableCollisionSurface");
}