MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zSurfaceGetSurface

Function zSurfaceGetSurface

src/SB/Game/zSurface.cpp:144–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144xSurface* zSurfaceGetSurface(U32 mat_id)
145{
146 for (S32 map = 0; map < sMapperCount; map++)
147 {
148 zMaterialMapAsset* mapper = sMapper[map];
149 if (mapper)
150 {
151 for (U16 i = 0; i < mapper->count; i++)
152 {
153 zMaterialMapEntry* entry = (zMaterialMapEntry*)(mapper + 1) + i;
154 if (entry->materialIndex == (mat_id & 0xFFFF))
155 {
156 U16 nsurfs = xSurfaceGetNumSurfaces();
157 for (U16 j = 0; j < nsurfs; j++)
158 {
159 xSurface* surf = xSurfaceGetByIdx(j);
160 if (surf->id == entry->surfaceAssetID)
161 {
162 return surf;
163 }
164 }
165 }
166 }
167 }
168 }
169 return &sDef_surf;
170}
171
172xSurface* zSurfaceGetSurface(const xCollis* coll)
173{

Callers 6

FindParentsMethod · 0.70
DoWallJumpCheckFunction · 0.70
CollReviewMethod · 0.70
zEnvRenderFunction · 0.70
xFX_SceneEnterFunction · 0.50

Calls 2

xSurfaceGetNumSurfacesFunction · 0.85
xSurfaceGetByIdxFunction · 0.85

Tested by

no test coverage detected