Commit 761d01e5 authored by Steven Fuller's avatar Steven Fuller

(synch checkin) Chuck Mason's attempt at fixing fizzlefade

parent ca350592
......@@ -29,6 +29,7 @@ B M - use something like config file or getenv to point at data directories
P I - finish handling/mapping for all keys in sys. specific code
B I - add mouse support
B M - add joystick/gamepad support
P I - fix or remove fizzlefade
Complete:
------------------------------------------------------------------------------
......
......@@ -30,7 +30,8 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
int x, y, p, frame;
unsigned int rndval;
int retr;
int blocksize;
rndval = 1;
pixperframe = 64000/frames;
......@@ -38,10 +39,11 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
frame = 0;
set_TimeCount(0);
if (vwidth != 320) /* TODO */
if (vwidth & 3)
return false;
blocksize = (vwidth / 320);
retr = -1;
/* VL_DirectPlotInit(); */
......@@ -51,8 +53,9 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
retr = true;
else
for (p = 0; p < pixperframe; p++) {
y = (rndval & 0x00FF) - 1;
x = (rndval & 0x00FFFF00) >> 8;
y = ((rndval & 0x00FF) - 1) * blocksize;
//y = (rndval & 0x000007FF) - 1;
x = ((rndval & 0x00FFFF00) >> 8) * blocksize;
if (rndval & 1) {
rndval >>= 1;
......@@ -63,8 +66,9 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
if ((x > width) || (y > height))
continue;
VL_DirectPlot(xx+x, yy+y, xx+x, yy+y);
//VL_DirectPlot(xx+x, yy+y, xx+x, yy+y);
VL_DirectUpdateRect(xx+x, yy+y, blocksize, blocksize);
if (rndval == 1) {
/* entire sequence has been completed */
retr = false;
......@@ -73,8 +77,8 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
}
VL_DirectPlotFlush();
//VL_DirectPlotFlush();
frame++;
while (get_TimeCount() < frame);
} while (retr == -1);
......
......@@ -26,6 +26,7 @@ void VL_DeModeXize(byte *buf, int width, int height);
void VL_DirectPlot(int x1, int y1, int x2, int y2);
void VL_DirectPlotFlush();
void VL_DirectUpdateRect(int x, int y, int w, int h);
#define MaxPlayers 4
#define MaxJoys 2
......
......@@ -127,7 +127,7 @@ void VL_Shutdown()
SDL_Quit();
}
//===========================================================================
/* ======================================================================== */
/*
=================
......@@ -183,6 +183,11 @@ void VL_DirectPlotFlush()
SDL_Flip(surface);
}
void VL_DirectUpdateRect(int x, int y, int w, int h)
{
SDL_UpdateRect(surface, x, y, w, h);
}
static int XKeysymToScancode(unsigned int keysym)
{
switch (keysym) {
......
......@@ -170,6 +170,11 @@ void VL_DirectPlotFlush()
{
}
void VL_DirectUpdateRect(int x, int y, int w, int h)
{
/* TODO: fixme for FizzleFade */
}
/*
=============================================================================
......
......@@ -531,6 +531,11 @@ void VL_DirectPlotFlush()
{
}
void VL_DirectUpdateRect(int x, int y, int w, int h)
{
/* TODO: fixme for FizzleFade */
}
static int XKeysymToScancode(KeySym keysym)
{
switch (keysym) {
......
......@@ -906,7 +906,7 @@ void Died()
{
float fangle;
long dx,dy;
int iangle,curangle,clockwise,counter,change;
int iangle,curangle,clockwise,counter,change;
gamestate.weapon = -1; // take away weapon
SD_PlaySound(PLAYERDEATHSND);
......@@ -987,10 +987,10 @@ void Died()
VL_Bar(xoffset, yoffset, viewwidth, viewheight, 4);
IN_ClearKeysDown();
FizzleFade(xoffset, yoffset, viewwidth, viewheight, 70, false);
IN_ClearKeysDown();
IN_UserInput(100);
IN_UserInput(140);
SD_WaitSoundDone();
gamestate.lives--;
......@@ -1059,10 +1059,11 @@ restartgame:
StartMusic();
if (!died)
PreloadGraphics();
else
else {
fizzlein = true;
died = false;
fizzlein = true;
}
//fizzlein = true;
DrawLevel();
#ifdef SPEAR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment