More CCubeModel matches

This commit is contained in:
Phillip Stephens
2026-07-09 15:43:01 -07:00
parent 89c3bd6c66
commit 68e2c2013e
7 changed files with 111 additions and 18 deletions
+9 -9
View File
@@ -13377,7 +13377,7 @@ BuildLocalAmbient__6CLightFRC9CVector3fRC6CColor = .text:0x803064A4; // type:fun
__ct__6CLightFRC9CVector3fRC9CVector3fRC6CColorffffff = .text:0x803064DC; // type:function size:0x94 scope:global
__ct__6CLightF10ELightTypeRC9CVector3fRC9CVector3fRC6CColorf = .text:0x80306570; // type:function size:0x94 scope:global
__sinit_CLight_cpp = .text:0x80306604; // type:function size:0x2C scope:local
fn_80306630 = .text:0x80306630; // type:function size:0x1C0
DrawNormal__10CCubeModelCFPCfPCf17ESurfaceSelection = .text:0x80306630; // type:function size:0x1C0
RemapMaterialData__10CCubeModelFPCvPQ24rstl60vector<23TCachedToken<8CTexture>,Q24rstl17rmemory_allocator> = .text:0x803067F0; // type:function size:0x1C scope:global
UnlockTextures__10CCubeModelCFv = .text:0x8030680C; // type:function size:0x84 scope:global
SetModelWireframe__10CCubeModelFb = .text:0x80306890; // type:function size:0x8 scope:global
@@ -17788,8 +17788,8 @@ lbl_803D6E90 = .rodata:0x803D6E90; // type:object size:0x7 data:string
lbl_803D6EA0 = .rodata:0x803D6EA0; // type:object size:0x28
gCantBeginChars = .rodata:0x803D6EC8; // type:object size:0x1F8 scope:global
gCantEndChars = .rodata:0x803D70C0; // type:object size:0x2C8 scope:global
lbl_803D7388 = .rodata:0x803D7388; // type:object size:0x10
lbl_803D7398 = .rodata:0x803D7398; // type:object size:0x7 data:string
sDesc$426 = .rodata:0x803D7388; // type:object size:0x10 scope:local
@stringBase0 = .rodata:0x803D7398; // type:object size:0x7 scope:local data:string
indMtx$287 = .rodata:0x803D73A0; // type:object size:0x18 scope:local
vtxDescList$308 = .rodata:0x803D73B8; // type:object size:0x10 scope:local
skPosColorTexDirect = .rodata:0x803D73C8; // type:object size:0x20
@@ -22014,13 +22014,13 @@ lbl_805A932C = .sbss:0x805A932C; // type:object size:0x1 data:byte
mManagerInstalled__14CDvdRequestSys = .sbss:0x805A9330; // type:object size:0x1 scope:global data:byte
lbl_805A9338 = .sbss:0x805A9338; // type:object size:0x1 data:byte
lbl_805A933C = .sbss:0x805A933C; // type:object size:0x1 data:byte
sDrawingOccluders = .sbss:0x805A9340; // type:object size:0x1 data:byte
sDrawingWireframe = .sbss:0x805A9341; // type:object size:0x1 data:byte
sDrawingOccluders = .sbss:0x805A9340; // type:object size:0x1 scope:local data:byte
sDrawingWireframe = .sbss:0x805A9341; // type:object size:0x1 scope:local data:byte
sUsingPackedLightmaps__10CCubeModel = .sbss:0x805A9342; // type:object size:0x1 data:byte
lbl_805A9344 = .sbss:0x805A9344; // type:object size:0x4 data:4byte
lbl_805A9348 = .sbss:0x805A9348; // type:object size:0x1 data:byte
lbl_805A934C = .sbss:0x805A934C; // type:object size:0x4 data:4byte
lbl_805A9350 = .sbss:0x805A9350; // type:object size:0x8 data:byte
sLastDesc$411 = .sbss:0x805A9344; // type:object size:0x4 scope:local data:4byte
init$412 = .sbss:0x805A9348; // type:object size:0x1 scope:local data:byte
sAttrCount$414 = .sbss:0x805A934C; // type:object size:0x4 scope:local data:4byte
init$415 = .sbss:0x805A9350; // type:object size:0x1 scope:local data:byte
sNextUniquePass__13CTevCombiners = .sbss:0x805A9358; // type:object size:0x4 scope:global data:4byte
skAlphaOne__13CTevCombiners = .sbss:0x805A935C; // type:object size:0x4 scope:global
skColorOne__13CTevCombiners = .sbss:0x805A9360; // type:object size:0x4 scope:global
+1 -1
View File
@@ -13377,7 +13377,7 @@ BuildLocalAmbient__6CLightFRC9CVector3fRC6CColor = .text:0x80306584; // type:fun
__ct__6CLightFRC9CVector3fRC9CVector3fRC6CColorffffff = .text:0x803065BC; // type:function size:0x94 scope:global
__ct__6CLightF10ELightTypeRC9CVector3fRC9CVector3fRC6CColorf = .text:0x80306650; // type:function size:0x94 scope:global
__sinit_CLight_cpp = .text:0x803066E4; // type:function size:0x2C scope:local
fn_80306630 = .text:0x80306710; // type:function size:0x1C0 scope:global
DrawNormal__10CCubeModelCFPCfPCf17ESurfaceSelection = .text:0x80306710; // type:function size:0x1C0 scope:global
RemapMaterialData__10CCubeModelFPCvPQ24rstl60vector<23TCachedToken<8CTexture>,Q24rstl17rmemory_allocator> = .text:0x803068D0; // type:function size:0x1C scope:global
UnlockTextures__10CCubeModelCFv = .text:0x803068EC; // type:function size:0x84 scope:global
SetModelWireframe__10CCubeModelFb = .text:0x80306970; // type:function size:0x8 scope:global
+8 -1
View File
@@ -59,6 +59,9 @@ public:
uchar visorFlags, bool texturesLoaded, uint idx);
static void SetRenderModelBlack(bool v);
static void SetModelWireframe(bool v);
void UnlockTextures() const;
void RemapMaterialData(const void* data, rstl::vector< TCachedToken< CTexture > >* texture);
void DrawNormal(const float* positions, const float* normals, ESurfaceSelection which) const;
static void DisableShadowMaps();
static void EnableShadowMaps(const CTexture*, const CTransform4f&, unsigned char, unsigned char);
static void SetNewPlayerPositionAndTime(const CVector3f&, const CStopwatch&);
@@ -81,10 +84,14 @@ public:
void SetSkinningArraysCurrent(const float* positions, const float* normals) const;
void SetUsingPackedLightmaps(const bool use) const;
static bool IsUsingPackedLightmaps() { return sUsingPackedLightmaps; }
void DrawFlat(const float* positions, const float* normals, ESurfaceSelection which) const;
void DrawSurface(const CCubeSurface& surface, const CModelFlags& modelFlags) const;
void DrawSurfaceWireframe(const CCubeSurface& surface) const;
void DrawFlat(const float* positions, const float* normals, ESurfaceSelection which) const;
bool TryLockTextures() const;
void Draw(const CModelFlags& flags) const;
void Draw(const float* positions, const float* normals, const CModelFlags& flags) const;
void DrawNormal(const CModelFlags& flags) const;
void DrawAlpha(const CModelFlags& flags) const;
void DrawSurfaces(const CModelFlags& flags) const;
void DrawNormalSurfaces(const CModelFlags& flags) const;
void DrawAlphaSurfaces(const CModelFlags& flags) const;
+4 -4
View File
@@ -29,13 +29,13 @@ s32 GBAReadAsync(s32 chan, u8* dst, u8* status, GBACallback callback) {
}
s32 GBARead(s32 chan, u8* dst, u8* status) {
s32 tmp;
s32 unused;
GBAControl* gba = &__GBA[chan];
s32 ret;
ret = GBAReadAsync(chan, dst, status, __GBASyncCallback);
s32 ret = GBAReadAsync(chan, dst, status, __GBASyncCallback);
if (ret != GBA_READY) {
return ret;
}
return __GBASync(chan);
ret = __GBASync(chan);
return ret;
}
+1 -2
View File
@@ -27,8 +27,7 @@ s32 GBAWriteAsync(s32 chan, u8* src, u8* status, GBACallback callback) {
}
s32 GBAWrite(s32 chan, u8* src, u8* status) {
s32 tmp;
GBAControl* gba = &__GBA[chan];
s32 _[2];
s32 ret;
ret = GBAWriteAsync(chan, src, status, __GBASyncCallback);
if (ret != GBA_READY) {
+87
View File
@@ -242,3 +242,90 @@ void CCubeModel::DrawAlphaSurfaces(const CModelFlags& flags) const {
}
}
}
void CCubeModel::DrawFlat(const float* positions, const float* normals,
ESurfaceSelection which) const {
if (positions != nullptr) {
SetSkinningArraysCurrent(positions, normals);
} else {
SetArraysCurrent();
}
if (which != kSS_Sorted) {
for (CCubeSurface surface = x38_firstUnsorted; surface.IsValid();
surface = surface.GetNextSurface()) {
CCubeMaterial material = GetMaterialByIndex(surface.GetMaterialIndex());
CGX::SetVtxDescv_Compressed(material.GetVertexDesc());
CGX::CallDisplayList(surface.GetDisplayList(), surface.GetDisplayListSize());
}
}
if (which != kSS_Unsorted) {
for (CCubeSurface surface = x3c_firstSorted; surface.IsValid();
surface = surface.GetNextSurface()) {
CCubeMaterial material = GetMaterialByIndex(surface.GetMaterialIndex());
CGX::SetVtxDescv_Compressed(material.GetVertexDesc());
CGX::CallDisplayList(surface.GetDisplayList(), surface.GetDisplayListSize());
}
}
}
void CCubeModel::Draw(const CModelFlags& flags) const {
CCubeMaterial::KillCachedViewDepState();
SetArraysCurrent();
DrawSurfaces(flags);
}
void CCubeModel::Draw(const float* positions, const float* normals,
const CModelFlags& flags) const {
CCubeMaterial::KillCachedViewDepState();
SetSkinningArraysCurrent(positions, normals);
DrawSurfaces(flags);
}
void CCubeModel::DrawNormal(const CModelFlags& flags) const {
CCubeMaterial::KillCachedViewDepState();
SetArraysCurrent();
DrawNormalSurfaces(flags);
}
void CCubeModel::DrawAlpha(const CModelFlags& flags) const {
CCubeMaterial::KillCachedViewDepState();
SetArraysCurrent();
DrawAlphaSurfaces(flags);
}
void CCubeModel::SetDrawingOccluders(const bool drawOccluders) {
sDrawingOccluders = drawOccluders;
}
void CCubeModel::SetModelWireframe(const bool drawWireframe) { sDrawingWireframe = drawWireframe; }
void CCubeModel::UnlockTextures() const {
for (AUTO(texture, x1c_textures->begin()); texture != x1c_textures->end(); ++texture) {
texture->Unlock();
}
x40_24_loadTextures = false;
}
void CCubeModel::RemapMaterialData(const void* data,
rstl::vector< TCachedToken< CTexture > >* texture) {
x0_instance.SetMaterialPointer(data);
x1c_textures = texture;
x40_24_loadTextures = false;
}
void CCubeModel::DrawNormal(const float* positions, const float* normals, ESurfaceSelection which) const {
CGX::SetNumIndStages(0);
CGX::SetNumTevStages(1);
CGX::SetNumTexGens(1);
CGX::SetZMode(true, GX_LEQUAL, true);
CGX::SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL);
CGX::SetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO);
CGX::SetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
CGX::SetStandardTevColorAlphaOp(GX_TEVSTAGE0);
CGX::SetBlendMode(GX_BM_BLEND, GX_BL_ZERO, GX_BL_ONE, GX_LO_CLEAR);
DrawFlat(positions, normals, which);
}
+1 -1
View File
@@ -82,4 +82,4 @@ CModel::CModel(const rstl::auto_ptr< uchar >& data, int length, IObjectStore& st
x4_dataLen += x8_surfaces.size() * 4;
sTotalMemory += x4_dataLen;
DCFlushRange(x0_data.get(), x4_dataLen);
}
}