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 ...@@ -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 P I - finish handling/mapping for all keys in sys. specific code
B I - add mouse support B I - add mouse support
B M - add joystick/gamepad support B M - add joystick/gamepad support
P I - fix or remove fizzlefade
Complete: Complete:
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
......
...@@ -30,6 +30,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -30,6 +30,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
int x, y, p, frame; int x, y, p, frame;
unsigned int rndval; unsigned int rndval;
int retr; int retr;
int blocksize;
rndval = 1; rndval = 1;
pixperframe = 64000/frames; pixperframe = 64000/frames;
...@@ -39,8 +40,9 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -39,8 +40,9 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
frame = 0; frame = 0;
set_TimeCount(0); set_TimeCount(0);
if (vwidth != 320) /* TODO */ if (vwidth & 3)
return false; return false;
blocksize = (vwidth / 320);
retr = -1; retr = -1;
...@@ -51,8 +53,9 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -51,8 +53,9 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
retr = true; retr = true;
else else
for (p = 0; p < pixperframe; p++) { for (p = 0; p < pixperframe; p++) {
y = (rndval & 0x00FF) - 1; y = ((rndval & 0x00FF) - 1) * blocksize;
x = (rndval & 0x00FFFF00) >> 8; //y = (rndval & 0x000007FF) - 1;
x = ((rndval & 0x00FFFF00) >> 8) * blocksize;
if (rndval & 1) { if (rndval & 1) {
rndval >>= 1; rndval >>= 1;
...@@ -63,7 +66,8 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -63,7 +66,8 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
if ((x > width) || (y > height)) if ((x > width) || (y > height))
continue; 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) { if (rndval == 1) {
/* entire sequence has been completed */ /* entire sequence has been completed */
...@@ -73,7 +77,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -73,7 +77,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
} }
VL_DirectPlotFlush(); //VL_DirectPlotFlush();
frame++; frame++;
while (get_TimeCount() < frame); while (get_TimeCount() < frame);
......
...@@ -26,6 +26,7 @@ void VL_DeModeXize(byte *buf, int width, int height); ...@@ -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_DirectPlot(int x1, int y1, int x2, int y2);
void VL_DirectPlotFlush(); void VL_DirectPlotFlush();
void VL_DirectUpdateRect(int x, int y, int w, int h);
#define MaxPlayers 4 #define MaxPlayers 4
#define MaxJoys 2 #define MaxJoys 2
......
...@@ -127,7 +127,7 @@ void VL_Shutdown() ...@@ -127,7 +127,7 @@ void VL_Shutdown()
SDL_Quit(); SDL_Quit();
} }
//=========================================================================== /* ======================================================================== */
/* /*
================= =================
...@@ -183,6 +183,11 @@ void VL_DirectPlotFlush() ...@@ -183,6 +183,11 @@ void VL_DirectPlotFlush()
SDL_Flip(surface); 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) static int XKeysymToScancode(unsigned int keysym)
{ {
switch (keysym) { switch (keysym) {
......
...@@ -170,6 +170,11 @@ void VL_DirectPlotFlush() ...@@ -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() ...@@ -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) static int XKeysymToScancode(KeySym keysym)
{ {
switch (keysym) { switch (keysym) {
......
...@@ -987,10 +987,10 @@ void Died() ...@@ -987,10 +987,10 @@ void Died()
VL_Bar(xoffset, yoffset, viewwidth, viewheight, 4); VL_Bar(xoffset, yoffset, viewwidth, viewheight, 4);
IN_ClearKeysDown();
FizzleFade(xoffset, yoffset, viewwidth, viewheight, 70, false); FizzleFade(xoffset, yoffset, viewwidth, viewheight, 70, false);
IN_ClearKeysDown();
IN_UserInput(100); IN_UserInput(140);
SD_WaitSoundDone(); SD_WaitSoundDone();
gamestate.lives--; gamestate.lives--;
...@@ -1059,10 +1059,11 @@ restartgame: ...@@ -1059,10 +1059,11 @@ restartgame:
StartMusic(); StartMusic();
if (!died) if (!died)
PreloadGraphics(); PreloadGraphics();
else else {
died = false;
fizzlein = true; fizzlein = true;
died = false;
}
//fizzlein = true;
DrawLevel(); DrawLevel();
#ifdef SPEAR #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