mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 12:04:38 -04:00
fix uncapped rendering for fizzle and crossfade (#1953)
* reformat and cosmetics
This commit is contained in:
parent
04f1323554
commit
55d6b31b32
54
src/f_wipe.c
54
src/f_wipe.c
@ -60,6 +60,11 @@ static int wipe_initColorXForm(int width, int height, int ticks)
|
||||
|
||||
static int wipe_doColorXForm(int width, int height, int ticks)
|
||||
{
|
||||
if (ticks <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
byte *sta = wipe_scr_start + y * width;
|
||||
@ -330,9 +335,13 @@ static int wipe_initFizzle(int width, int height, int ticks)
|
||||
|
||||
int rndbits = rndbits_x + rndbits_y;
|
||||
if (rndbits < 17)
|
||||
{
|
||||
rndbits = 17; // no problem, just a bit slower
|
||||
}
|
||||
else if (rndbits > 25)
|
||||
{
|
||||
rndbits = 25; // fizzle fade will not fill whole screen
|
||||
}
|
||||
|
||||
rndmask = rndmasks[rndbits - 17];
|
||||
|
||||
@ -345,6 +354,11 @@ static int wipe_initFizzle(int width, int height, int ticks)
|
||||
|
||||
static int wipe_doFizzle(int width, int height, int ticks)
|
||||
{
|
||||
if (ticks <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const int pixperframe = (video.unscaledw * WIPE_ROWS) >> 5;
|
||||
unsigned int rndval = lastrndval;
|
||||
|
||||
@ -395,23 +409,21 @@ static int wipe_doFizzle(int width, int height, int ticks)
|
||||
return false;
|
||||
}
|
||||
|
||||
static int (*const wipes[])(int, int, int) = {
|
||||
wipe_NOP,
|
||||
wipe_NOP,
|
||||
wipe_NOP,
|
||||
wipe_exit,
|
||||
wipe_initMelt,
|
||||
wipe_doMelt,
|
||||
wipe_renderMelt,
|
||||
wipe_exitMelt,
|
||||
wipe_initColorXForm,
|
||||
wipe_doColorXForm,
|
||||
wipe_NOP,
|
||||
wipe_exit,
|
||||
wipe_initFizzle,
|
||||
wipe_doFizzle,
|
||||
wipe_NOP,
|
||||
wipe_exit,
|
||||
typedef int (*wipefunc_t)(int, int, int);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wipefunc_t init;
|
||||
wipefunc_t update;
|
||||
wipefunc_t render;
|
||||
wipefunc_t exit;
|
||||
} wipe_t;
|
||||
|
||||
static wipe_t wipes[] = {
|
||||
{wipe_NOP, wipe_NOP, wipe_NOP, wipe_exit },
|
||||
{wipe_initMelt, wipe_doMelt, wipe_renderMelt, wipe_exitMelt},
|
||||
{wipe_initColorXForm, wipe_doColorXForm, wipe_NOP, wipe_exit },
|
||||
{wipe_initFizzle, wipe_doFizzle, wipe_NOP, wipe_exit },
|
||||
};
|
||||
|
||||
// killough 3/5/98: reformatted and cleaned up
|
||||
@ -423,15 +435,15 @@ int wipe_ScreenWipe(int wipeno, int x, int y, int width, int height, int ticks)
|
||||
{
|
||||
go = 1;
|
||||
wipe_scr = I_VideoBuffer;
|
||||
wipes[wipeno*4](width, height, ticks);
|
||||
wipes[wipeno].init(width, height, ticks);
|
||||
}
|
||||
|
||||
int rc = wipes[wipeno*4+1](width, height, ticks);
|
||||
wipes[wipeno*4+2](width, height, ticks);
|
||||
int rc = wipes[wipeno].update(width, height, ticks);
|
||||
wipes[wipeno].render(width, height, ticks);
|
||||
|
||||
if (rc) // final stuff
|
||||
{
|
||||
wipes[wipeno*4+3](width, height, ticks);
|
||||
wipes[wipeno].exit(width, height, ticks);
|
||||
go = 0;
|
||||
}
|
||||
return !go;
|
||||
|
Loading…
x
Reference in New Issue
Block a user