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

Method effects_render

src/SB/Game/zDiscoFloor.cpp:1008–1063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006}
1007
1008void z_disco_floor::effects_render(S32 group)
1009{
1010 F32 glow = pulse_glow[group];
1011
1012 if (0.0f == glow)
1013 {
1014 return;
1015 }
1016
1017 // non-matching: regalloc
1018
1019 F32 dyoffset = 0.1f * glow;
1020 F32 dalpha = 0.35f * -glow;
1021 F32 yoffset = dyoffset;
1022 F32 alpha = 0.7f * glow;
1023
1024 for (S32 i = 0; i < 2; i++)
1025 {
1026 RpAtomic* atomic = NULL;
1027 tile_data* tile = tiles[group];
1028 tile_data* end_tile = tile + tiles_size;
1029 F32 alphaf = 255.0f * alpha + 0.5f;
1030
1031 while (tile != end_tile)
1032 {
1033 if (!tile->culled)
1034 {
1035 RpAtomic* a = tile->ent->model->Data;
1036
1037 if (atomic != a)
1038 {
1039 if (atomic)
1040 {
1041 iModelResetMaterial(atomic);
1042 }
1043
1044 iModelSetMaterialAlpha(a, alphaf);
1045
1046 atomic = a;
1047 }
1048
1049 render_model(tile->ent->model, tile->sphere, yoffset);
1050 }
1051
1052 tile++;
1053 }
1054
1055 if (atomic)
1056 {
1057 iModelResetMaterial(atomic);
1058 }
1059
1060 alpha += dalpha;
1061 yoffset += dyoffset;
1062 }
1063}
1064
1065S32 z_disco_floor::event_handler(xBase*, xBase* to, U32 event, const F32* argf, xBase*)

Callers 1

effects_render_allMethod · 0.80

Calls 3

render_modelFunction · 0.70
iModelResetMaterialFunction · 0.50
iModelSetMaterialAlphaFunction · 0.50

Tested by

no test coverage detected