Skip to content

Commit

Permalink
Proper memory size allocation for wiping effect
Browse files Browse the repository at this point in the history
Co-Authored-By: Fabian Greffrath <fabian@greffrath.com>
  • Loading branch information
JNechaevsky and fabiangreffrath committed Apr 19, 2024
1 parent 9594624 commit faea87f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/strife/f_wipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,25 +283,17 @@ wipe_ScreenWipe
{
go = 1;
// haleyjd 20110629 [STRIFE]: We *must* use a temp buffer here.
#ifndef CRISPY_TRUECOLOR
wipe_scr = (pixel_t *) Z_Malloc(width*height, PU_STATIC, 0); // DEBUG
wipe_scr = (pixel_t *) Z_Malloc(width*height*sizeof(*wipe_scr), PU_STATIC, 0); // DEBUG
//wipe_scr = I_VideoBuffer;
#else
// [crispy] In TrueColor render perform everything in common buffer.
// Otherwise serious malloc errors will happen.
wipe_scr = I_VideoBuffer;
#endif
(*wipes[wipeno*3])(width, height, ticks);
}

// do a piece of wipe-in
V_MarkRect(0, 0, width, height);
rc = (*wipes[wipeno*3+1])(width, height, ticks);

#ifndef CRISPY_TRUECOLOR
// haleyjd 20110629 [STRIFE]: Copy temp buffer to the real screen.
V_DrawBlock(x, y, width, height, wipe_scr);
#endif

// final stuff
if (rc)
Expand Down

0 comments on commit faea87f

Please sign in to comment.