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

Function xFX_SceneEnter

src/SB/Core/x/xFX.cpp:213–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 RwTexture* bump, F32 bumpiness);
212
213void xFX_SceneEnter(RpWorld* world)
214{
215 S32 i;
216 S32 num = RpWorldGetNumMaterials(world);
217
218 for (i = 0; i < num; i++)
219 {
220 xSurface* sp = zSurfaceGetSurface(i);
221 zSurfaceProps* pp = (zSurfaceProps*)sp->moprops;
222
223 if (pp && pp->asset)
224 {
225 zSurfMatFX* fxp = &pp->asset->matfx;
226
227 if (fxp->flags)
228 {
229 if (fxp->flags == 0x10)
230 {
231 fxp->flags |= 0x1;
232 }
233
234 RpMaterial* mp = RpWorldGetMaterial(world, i);
235
236 if (RpMaterialGetTexture(mp))
237 {
238 gFXSurfaceFlags = fxp->flags;
239
240 if (fxp->flags & 0x1)
241 {
242 RwTexture* env = (RwTexture*)xSTFindAsset(fxp->envmapID, NULL);
243
244 if (!env)
245 {
246 continue;
247 }
248
249 MaterialSetEnvMap(mp, env);
250 RpMatFXMaterialSetEnvMapCoefficient(mp, 0.5f * fxp->shininess);
251 }
252
253 if (fxp->flags & 0x2)
254 {
255 RwTexture* bump = (RwTexture*)xSTFindAsset(fxp->bumpmapID, NULL);
256
257 if (!bump)
258 {
259 continue;
260 }
261
262 MaterialSetBumpMap(mp, bump);
263 RpMatFXMaterialSetBumpMapCoefficient(mp, fxp->bumpiness);
264 }
265
266 if (fxp->flags & 0x4)
267 {
268 RwTexture* env = (RwTexture*)xSTFindAsset(fxp->envmapID, NULL);
269 RwTexture* bump = (RwTexture*)xSTFindAsset(fxp->bumpmapID, NULL);
270

Callers

nothing calls this directly

Calls 7

MaterialSetBumpMapFunction · 0.85
MaterialSetBumpEnvMapFunction · 0.85
xSTFindAssetFunction · 0.70
MaterialSetEnvMapFunction · 0.70
xStrHashFunction · 0.70
xSTAssetNameFunction · 0.70
zSurfaceGetSurfaceFunction · 0.50

Tested by

no test coverage detected