Skip to content

Commit

Permalink
Don't stub DrawTheGlow: every crash is an opportunity to find a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Nov 11, 2022
1 parent 1e45bcf commit 3345649
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/DETHRACE/common/spark.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,21 +1833,17 @@ void DrawTheGlow(br_pixelmap* pRender_screen, br_pixelmap* pDepth_buffer, br_act
tU32 seed;
LOG_TRACE("(%p, %p, %p)", pRender_screen, pDepth_buffer, pCamera);

// FIXME: sometimes this function causes a segfault (most commonly when looking at a glow fairly close up and the camera swings away). Stubbing it out for now.
LOG_WARN_ONCE("DrawTheGlow is stubbed out");
return;

if (gColumn_flags) {
if (gColumn_flags != 0) {
seed = rand();
srand(GetTotalTime());
for (i = 0; i < MAX_SMOKE_COLUMNS; i++) {
if (((1u << i) & gColumn_flags) != 0 && gSmoke_column[i].colour <= 1) {
strength = 0.5;
strength = .5f;
if (gSmoke_column[i].lifetime < 4000) {
strength = gSmoke_column[i].lifetime * 0.5 / 4000.0;
strength = gSmoke_column[i].lifetime * .5f / 4000.f;
}
BrVector3Set(&tv, gSmoke_column[i].pos.v[0], gSmoke_column[i].pos.v[1] + 0.02, gSmoke_column[i].pos.v[2]);
SmokeCircle3D(&tv, 0.07, strength, SRandomBetween(0.5, 0.99000001), pRender_screen, pDepth_buffer, gAcid_shade_table, pCamera);
BrVector3Set(&tv, gSmoke_column[i].pos.v[0], gSmoke_column[i].pos.v[1] + .02f, gSmoke_column[i].pos.v[2]);
SmokeCircle3D(&tv, .07f, strength, SRandomBetween(.5f, .99f), pRender_screen, pDepth_buffer, gAcid_shade_table, pCamera);
}
}
srand(seed);
Expand Down

0 comments on commit 3345649

Please sign in to comment.