Commit 4b2765d4 authored by Steven Fuller's avatar Steven Fuller

Implemented FizzleFade

parent 57c3d823
...@@ -48,7 +48,6 @@ data in vga memory. so figure it out, fix it, and remove ...@@ -48,7 +48,6 @@ data in vga memory. so figure it out, fix it, and remove
* especially with the video functions, there are functions/defines which * especially with the video functions, there are functions/defines which
just call a different function (most are left from the update block code) just call a different function (most are left from the update block code)
rename/remove them rename/remove them
* implement fizzlefade, and get that last pixel!
* fix wl_debug.c, lots of junk code.. * fix wl_debug.c, lots of junk code..
* change the current parameter handling code to something like getopt * change the current parameter handling code to something like getopt
* urgent: fix input (event handling), so that it makes sense * urgent: fix input (event handling), so that it makes sense
...@@ -57,6 +56,12 @@ rename/remove them ...@@ -57,6 +56,12 @@ rename/remove them
* for some reason, it feels sluggish, maybe its from having mikmod playing * for some reason, it feels sluggish, maybe its from having mikmod playing
at the same time... especially when you pick up items at the same time... especially when you pick up items
* look for places where gfx needs to be redrawn, like back to game etc * look for places where gfx needs to be redrawn, like back to game etc
* wl_menu uses specific scancodes for names, config file will have to use
metaname like sc_Left etc or something
* fizzlefade is hackish, stipple buf would work ok in opengl, maybe only
update once per frame or such.. hm
and where is that greenpixel coming from (when using end game with largest
window size)
Specific: Specific:
* memory/sound intro screen goes * memory/sound intro screen goes
......
...@@ -212,18 +212,15 @@ void LoadLatchMem(void) ...@@ -212,18 +212,15 @@ void LoadLatchMem(void)
=================== ===================
*/ */
boolean FizzleFade(byte *source, unsigned width,unsigned height, unsigned frames, boolean abortable) boolean FizzleFade(unsigned xx, unsigned yy, unsigned width,unsigned height, unsigned frames, boolean abortable)
{ {
int pixperframe; int pixperframe;
unsigned drawofs,pagedelta; unsigned x, y, p, frame;
byte mask,maskb[8] = {1,2,4,8}; long rndval;
unsigned x,y,p,frame;
long rndval;
rndval = 1; rndval = 1;
y = 0;
pixperframe = 64000/frames; pixperframe = 64000/frames;
IN_StartAck (); IN_StartAck ();
frame=0; frame=0;
...@@ -232,51 +229,21 @@ boolean FizzleFade(byte *source, unsigned width,unsigned height, unsigned frames ...@@ -232,51 +229,21 @@ boolean FizzleFade(byte *source, unsigned width,unsigned height, unsigned frames
do { do {
if (abortable && IN_CheckAck ()) if (abortable && IN_CheckAck ())
return true; return true;
for (p=0;p<pixperframe;p++) { for (p=0;p<pixperframe;p++) {
#if 0 y = (rndval & 0x00FF) - 1;
// x = (rndval & 0x00FFFF00) >> 8;
// seperate random value into x/y pair
// if (rndval & 1) {
asm mov ax,[WORD PTR rndval] rndval >>= 1;
asm mov dx,[WORD PTR rndval+2] rndval ^= 0x00012000;
asm mov bx,ax } else
asm dec bl rndval >>= 1;
asm mov [BYTE PTR y],bl // low 8 bits - 1 = y xoordinate
asm mov bx,ax if ((x>width) || (y>height))
asm mov cx,dx
asm mov [BYTE PTR x],ah // next 9 bits = x xoordinate
asm mov [BYTE PTR x+1],dl
//
// advance to next random element
//
asm shr dx,1
asm rcr ax,1
asm jnc noxor
asm xor dx,0x0001
asm xor ax,0x2000
noxor:
asm mov [WORD PTR rndval],ax
asm mov [WORD PTR rndval+2],dx
if (x>width || y>height)
continue; continue;
drawofs = source+ylookup[y] + (x>>2);
//
// copy one pixel
//
mask = x&3;
VGAREADMAP(mask);
mask = maskb[mask];
VGAMAPMASK(mask);
asm mov di,[drawofs] *(graph_mem + (xx+x) + (yy+y) * 320) = *(gfxbuf + (xx+x) + (yy+y) * 320);
asm mov al,[es:di]
asm add di,[pagedelta]
asm mov [es:di],al
#endif
if (rndval == 1) /* entire sequence has been completed */ if (rndval == 1) /* entire sequence has been completed */
return false; return false;
......
...@@ -51,7 +51,7 @@ extern byte gamepal; ...@@ -51,7 +51,7 @@ extern byte gamepal;
#define VW_FadeOut() VL_FadeOut(0,255,0,0,0,30); #define VW_FadeOut() VL_FadeOut(0,255,0,0,0,30);
void VW_MeasurePropString(char *string, word *width, word *height); void VW_MeasurePropString(char *string, word *width, word *height);
boolean FizzleFade(byte *source, unsigned width,unsigned height, unsigned frames,boolean abortable); boolean FizzleFade(unsigned xoffset, unsigned yoffset, unsigned width,unsigned height, unsigned frames,boolean abortable);
void LatchDrawPic(unsigned x, unsigned y, unsigned picnum); void LatchDrawPic(unsigned x, unsigned y, unsigned picnum);
void LoadLatchMem(void); void LoadLatchMem(void);
......
...@@ -3789,8 +3789,8 @@ void A_StartDeathCam (objtype *ob) ...@@ -3789,8 +3789,8 @@ void A_StartDeathCam (objtype *ob)
} }
gamestate.victoryflag = true; gamestate.victoryflag = true;
VW_Bar (0,0,320,200-STATUSLINES,127); VW_Bar(0, 0, 320,200-STATUSLINES,127);
FizzleFade(gfxbuf, 320, 200-STATUSLINES,70,false); FizzleFade(0, 0, 320, 200-STATUSLINES, 70, false);
CA_UpLevel (); CA_UpLevel ();
CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
......
...@@ -715,7 +715,7 @@ void ThreeDRefresh (void) ...@@ -715,7 +715,7 @@ void ThreeDRefresh (void)
// //
if (fizzlein) if (fizzlein)
{ {
FizzleFade(gfxbuf, viewwidth,viewheight,20,false); FizzleFade(xoffset, yoffset, viewwidth,viewheight,20,false);
fizzlein = false; fizzlein = false;
lasttimecount = 0; /* don't make a big tic count */ lasttimecount = 0; /* don't make a big tic count */
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
============================================================================= =============================================================================
*/ */
extern unsigned xoffset, yoffset;
boolean ingame,fizzlein; boolean ingame,fizzlein;
gametype gamestate; gametype gamestate;
...@@ -1175,13 +1177,15 @@ void Died() ...@@ -1175,13 +1177,15 @@ void Died()
// //
// fade to red // fade to red
// //
FinishPaletteShifts (); FinishPaletteShifts();
VW_Bar (0,0,viewwidth,viewheight,4); VW_Bar(xoffset, yoffset, viewwidth, viewheight, 4);
IN_ClearKeysDown ();
FizzleFade(gfxbuf, viewwidth,viewheight,70,false); IN_ClearKeysDown();
FizzleFade(xoffset, yoffset, viewwidth, viewheight, 70, false);
IN_UserInput(100); IN_UserInput(100);
SD_WaitSoundDone (); SD_WaitSoundDone();
gamestate.lives--; gamestate.lives--;
......
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