Commit 40ed398f authored by Steven Fuller's avatar Steven Fuller

Modified FizzleFade parms

parent 53e27e49
...@@ -545,14 +545,14 @@ boolean IN_UserInput(longword delay) ...@@ -545,14 +545,14 @@ boolean IN_UserInput(longword delay)
{ {
longword lasttime; longword lasttime;
lasttime = TimeCount; lasttime = get_TimeCount();
IN_StartAck (); IN_StartAck ();
do do
{ {
if (IN_CheckAck()) if (IN_CheckAck())
return true; return true;
} while (TimeCount - lasttime < delay); } while ( (get_TimeCount() - lasttime) < delay );
return(false); return false;
} }
//=========================================================================== //===========================================================================
......
...@@ -364,7 +364,7 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok, ...@@ -364,7 +364,7 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok,
cursormoved = redraw = true; cursormoved = redraw = true;
cursorvis = done = false; cursorvis = done = false;
lasttime = TimeCount; lasttime = get_TimeCount();
LastASCII = key_None; LastASCII = key_None;
LastScan = sc_None; LastScan = sc_None;
...@@ -488,13 +488,13 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok, ...@@ -488,13 +488,13 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok,
if (cursormoved) if (cursormoved)
{ {
cursorvis = false; cursorvis = false;
lasttime = TimeCount - TickBase; lasttime = get_TimeCount() - TickBase;
cursormoved = false; cursormoved = false;
} }
if (TimeCount - lasttime > TickBase / 2) if ( (get_TimeCount() - lasttime) > (TickBase / 2) )
{ {
lasttime = TimeCount; lasttime = get_TimeCount();
cursorvis ^= true; cursorvis ^= true;
} }
......
...@@ -222,8 +222,7 @@ void LoadLatchMem(void) ...@@ -222,8 +222,7 @@ void LoadLatchMem(void)
=================== ===================
*/ */
boolean FizzleFade (unsigned source, unsigned dest, boolean FizzleFade(byte *source, unsigned width,unsigned height, unsigned frames, boolean abortable)
unsigned width,unsigned height, unsigned frames, boolean abortable)
{ {
int pixperframe; int pixperframe;
unsigned drawofs,pagedelta; unsigned drawofs,pagedelta;
...@@ -231,14 +230,15 @@ boolean FizzleFade (unsigned source, unsigned dest, ...@@ -231,14 +230,15 @@ boolean FizzleFade (unsigned source, unsigned dest,
unsigned x,y,p,frame; unsigned x,y,p,frame;
long rndval; long rndval;
pagedelta = dest-source;
rndval = 1; rndval = 1;
y = 0; y = 0;
pixperframe = 64000/frames; pixperframe = 64000/frames;
IN_StartAck (); IN_StartAck ();
TimeCount=frame=0; frame=0;
set_TimeCount(0);
do { do {
if (abortable && IN_CheckAck ()) if (abortable && IN_CheckAck ())
return true; return true;
...@@ -292,7 +292,6 @@ noxor: ...@@ -292,7 +292,6 @@ noxor:
} }
frame++; frame++;
while (TimeCount<frame) while (get_TimeCount() < frame) ;
;
} while (1); } while (1);
} }
...@@ -69,8 +69,7 @@ void VW_MeasurePropString(char *string, word *width, word *height); ...@@ -69,8 +69,7 @@ void VW_MeasurePropString(char *string, word *width, word *height);
void LatchDrawPic (unsigned x, unsigned y, unsigned picnum); void LatchDrawPic (unsigned x, unsigned y, unsigned picnum);
void LoadLatchMem (void); void LoadLatchMem (void);
boolean FizzleFade (unsigned source, unsigned dest, boolean FizzleFade (byte *source, unsigned width,unsigned height, unsigned frames,boolean abortable);
unsigned width,unsigned height, unsigned frames,boolean abortable);
#define NUMLATCHPICS 100 #define NUMLATCHPICS 100
extern unsigned latchpics[NUMLATCHPICS]; extern unsigned latchpics[NUMLATCHPICS];
......
...@@ -3776,7 +3776,7 @@ void A_StartDeathCam (objtype *ob) ...@@ -3776,7 +3776,7 @@ 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(bufferofs,displayofs,320,200-STATUSLINES,70,false); FizzleFade(gfxbuf, 320, 200-STATUSLINES,70,false);
CA_UpLevel (); CA_UpLevel ();
CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
......
...@@ -720,7 +720,7 @@ void ThreeDRefresh (void) ...@@ -720,7 +720,7 @@ void ThreeDRefresh (void)
// //
if (fizzlein) if (fizzlein)
{ {
FizzleFade(xoffset, yoffset, viewwidth,viewheight,20,false); FizzleFade(gfxbuf, 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 */
......
...@@ -1149,7 +1149,7 @@ void Died (void) ...@@ -1149,7 +1149,7 @@ void Died (void)
VW_Bar (0,0,viewwidth,viewheight,4); VW_Bar (0,0,viewwidth,viewheight,4);
IN_ClearKeysDown (); IN_ClearKeysDown ();
FizzleFade(bufferofs,displayofs+screenofs,viewwidth,viewheight,70,false); FizzleFade(gfxbuf, viewwidth,viewheight,70,false);
IN_UserInput(100); IN_UserInput(100);
SD_WaitSoundDone (); SD_WaitSoundDone ();
......
...@@ -63,8 +63,8 @@ void EndSpear(void) ...@@ -63,8 +63,8 @@ void EndSpear(void)
US_CPrint (STR_ENDGAME2); US_CPrint (STR_ENDGAME2);
VW_UpdateScreen (); VW_UpdateScreen ();
IN_StartAck (); IN_StartAck ();
TimeCount = 0; set_TimeCount(0);
while (!IN_CheckAck () && TimeCount < 700); while ( !IN_CheckAck () && (get_TimeCount() < 700) );
PrintX = 0; PrintX = 0;
PrintY = 180; PrintY = 180;
...@@ -73,8 +73,8 @@ void EndSpear(void) ...@@ -73,8 +73,8 @@ void EndSpear(void)
US_CPrint (STR_ENDGAME4); US_CPrint (STR_ENDGAME4);
VW_UpdateScreen (); VW_UpdateScreen ();
IN_StartAck (); IN_StartAck ();
TimeCount = 0; set_TimeCount(0);
while (!IN_CheckAck () && TimeCount < 700); while ( !IN_CheckAck () && (get_TimeCount() < 700) );
VW_FadeOut (); VW_FadeOut ();
...@@ -391,13 +391,12 @@ void BJ_Breathe(void) ...@@ -391,13 +391,12 @@ void BJ_Breathe(void)
static int which=0,max=10; static int which=0,max=10;
int pics[2]={L_GUYPIC,L_GUY2PIC}; int pics[2]={L_GUYPIC,L_GUY2PIC};
if (get_TimeCount() > max)
if (TimeCount>max)
{ {
which^=1; which^=1;
VWB_DrawPic(0,16,pics[which]); VWB_DrawPic(0,16,pics[which]);
VW_UpdateScreen(); VW_UpdateScreen();
TimeCount=0; set_TimeCount(0);
max=35; max=35;
} }
} }
...@@ -892,7 +891,7 @@ void LevelCompleted (void) ...@@ -892,7 +891,7 @@ void LevelCompleted (void)
DrawScore(); DrawScore();
VW_UpdateScreen(); VW_UpdateScreen();
TimeCount=0; set_TimeCount(0);
IN_StartAck(); IN_StartAck();
while(!IN_CheckAck()) while(!IN_CheckAck())
BJ_Breathe(); BJ_Breathe();
......
...@@ -700,7 +700,7 @@ int CP_CheckQuick(unsigned scancode) ...@@ -700,7 +700,7 @@ int CP_CheckQuick(unsigned scancode)
if (loadedgame) if (loadedgame)
playstate = ex_abort; playstate = ex_abort;
lasttimecount = TimeCount; lasttimecount = get_TimeCount();
...@@ -771,7 +771,7 @@ int CP_CheckQuick(unsigned scancode) ...@@ -771,7 +771,7 @@ int CP_CheckQuick(unsigned scancode)
if (loadedgame) if (loadedgame)
playstate = ex_abort; playstate = ex_abort;
lasttimecount = TimeCount; lasttimecount = get_TimeCount();
#ifndef SPEAR #ifndef SPEAR
UNCACHEGRCHUNK(C_CURSOR1PIC); UNCACHEGRCHUNK(C_CURSOR1PIC);
...@@ -2148,7 +2148,9 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print ...@@ -2148,7 +2148,9 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print
if ((ci.button0|ci.button1|ci.button2|ci.button3)|| if ((ci.button0|ci.button1|ci.button2|ci.button3)||
((type==KEYBOARDBTNS||type==KEYBOARDMOVE) && LastScan==sc_Enter)) ((type==KEYBOARDBTNS||type==KEYBOARDMOVE) && LastScan==sc_Enter))
{ {
tick=TimeCount=picked=0; tick = picked = 0;
set_TimeCount(0);
SETFONTCOLOR(0,TEXTCOLOR); SETFONTCOLOR(0,TEXTCOLOR);
do do
...@@ -2162,7 +2164,7 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print ...@@ -2162,7 +2164,7 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print
// //
// FLASH CURSOR // FLASH CURSOR
// //
if (TimeCount>10) if (get_TimeCount() >10)
{ {
switch(tick) switch(tick)
{ {
...@@ -2175,7 +2177,7 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print ...@@ -2175,7 +2177,7 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print
SD_PlaySound(HITWALLSND); SD_PlaySound(HITWALLSND);
} }
tick^=1; tick^=1;
TimeCount=0; set_TimeCount(0);
VW_UpdateScreen(); VW_UpdateScreen();
} }
...@@ -3053,7 +3055,7 @@ int HandleMenu(CP_iteminfo *item_i,CP_itemtype *items,void (*routine)(int w)) ...@@ -3053,7 +3055,7 @@ int HandleMenu(CP_iteminfo *item_i,CP_itemtype *items,void (*routine)(int w))
shape=C_CURSOR1PIC; shape=C_CURSOR1PIC;
timer=8; timer=8;
exit=0; exit=0;
TimeCount=0; set_TimeCount(0);
IN_ClearKeysDown(); IN_ClearKeysDown();
...@@ -3062,9 +3064,9 @@ int HandleMenu(CP_iteminfo *item_i,CP_itemtype *items,void (*routine)(int w)) ...@@ -3062,9 +3064,9 @@ int HandleMenu(CP_iteminfo *item_i,CP_itemtype *items,void (*routine)(int w))
// //
// CHANGE GUN SHAPE // CHANGE GUN SHAPE
// //
if (TimeCount>timer) if (get_TimeCount() > timer)
{ {
TimeCount=0; set_TimeCount(0);
if (shape==C_CURSOR1PIC) if (shape==C_CURSOR1PIC)
{ {
shape=C_CURSOR2PIC; shape=C_CURSOR2PIC;
...@@ -3288,8 +3290,8 @@ void DrawHalfStep(int x,int y) ...@@ -3288,8 +3290,8 @@ void DrawHalfStep(int x,int y)
VWB_DrawPic(x,y,C_CURSOR1PIC); VWB_DrawPic(x,y,C_CURSOR1PIC);
VW_UpdateScreen(); VW_UpdateScreen();
SD_PlaySound(MOVEGUN1SND); SD_PlaySound(MOVEGUN1SND);
TimeCount=0; set_TimeCount(0);
while(TimeCount<8); while(get_TimeCount() < 8);
} }
...@@ -3325,12 +3327,10 @@ void TicDelay(int count) ...@@ -3325,12 +3327,10 @@ void TicDelay(int count)
{ {
ControlInfo ci; ControlInfo ci;
set_TimeCount(0);
TimeCount=0; do {
do
{
ReadAnyControl(&ci); ReadAnyControl(&ci);
} while(TimeCount<count && ci.dir!=dir_None); } while( (get_TimeCount() < count) && (ci.dir!=dir_None) );
} }
...@@ -3439,11 +3439,11 @@ int Confirm(char *string) ...@@ -3439,11 +3439,11 @@ int Confirm(char *string)
// //
x=PrintX; x=PrintX;
y=PrintY; y=PrintY;
TimeCount=0; set_TimeCount(0);
do do
{ {
if (TimeCount>=10) if (get_TimeCount() >= 10)
{ {
switch(tick) switch(tick)
{ {
...@@ -3457,7 +3457,7 @@ int Confirm(char *string) ...@@ -3457,7 +3457,7 @@ int Confirm(char *string)
} }
VW_UpdateScreen(); VW_UpdateScreen();
tick^=1; tick^=1;
TimeCount=0; set_TimeCount(0);
} }
#ifndef SPEAR #ifndef SPEAR
......
...@@ -428,9 +428,8 @@ void PollControls (void) ...@@ -428,9 +428,8 @@ void PollControls (void)
// //
if (demoplayback) if (demoplayback)
{ {
while (TimeCount<lasttimecount+DEMOTICS) while ( get_TimeCount() < (lasttimecount+DEMOTICS) ) ;
; set_TimeCount(lasttimecount + DEMOTICS);
TimeCount = lasttimecount + DEMOTICS;
lasttimecount += DEMOTICS; lasttimecount += DEMOTICS;
tics = DEMOTICS; tics = DEMOTICS;
} }
...@@ -439,9 +438,8 @@ void PollControls (void) ...@@ -439,9 +438,8 @@ void PollControls (void)
// //
// take DEMOTICS or more tics, and modify Timecount to reflect time taken // take DEMOTICS or more tics, and modify Timecount to reflect time taken
// //
while (TimeCount<lasttimecount+DEMOTICS) while ( get_TimeCount() < (lasttimecount+DEMOTICS) ) ;
; set_TimeCount(lasttimecount + DEMOTICS);
TimeCount = lasttimecount + DEMOTICS;
lasttimecount += DEMOTICS; lasttimecount += DEMOTICS;
tics = DEMOTICS; tics = DEMOTICS;
} }
...@@ -560,9 +558,8 @@ void PollControls (void) ...@@ -560,9 +558,8 @@ void PollControls (void)
#define MAXX 320 #define MAXX 320
#define MAXY 160 #define MAXY 160
void CenterWindow(word w,word h) void CenterWindow(word w,word h)
{ {
FixOfs ();
US_DrawWindow(((MAXX / 8) - w) / 2,((MAXY / 8) - h) / 2,w,h); US_DrawWindow(((MAXX / 8) - w) / 2,((MAXY / 8) - h) / 2,w,h);
} }
...@@ -767,7 +764,7 @@ void CheckKeys (void) ...@@ -767,7 +764,7 @@ void CheckKeys (void)
} }
if (loadedgame) if (loadedgame)
playstate = ex_abort; playstate = ex_abort;
lasttimecount = TimeCount; lasttimecount = get_TimeCount();
return; return;
} }
...@@ -780,7 +777,7 @@ void CheckKeys (void) ...@@ -780,7 +777,7 @@ void CheckKeys (void)
fontnumber=0; fontnumber=0;
SETFONTCOLOR(0,15); SETFONTCOLOR(0,15);
DebugKeys(); DebugKeys();
lasttimecount = TimeCount; lasttimecount = get_TimeCount();
return; return;
} }
...@@ -1317,7 +1314,9 @@ void PlayLoop (void) ...@@ -1317,7 +1314,9 @@ void PlayLoop (void)
int give; int give;
int helmetangle; int helmetangle;
playstate = TimeCount = lasttimecount = 0; playstate = lasttimecount = 0;
set_TimeCount(0);
frameon = 0; frameon = 0;
anglefrac = 0; anglefrac = 0;
facecount = 0; facecount = 0;
...@@ -1369,7 +1368,7 @@ void PlayLoop (void) ...@@ -1369,7 +1368,7 @@ void PlayLoop (void)
} }
#endif #endif
gamestate.TimeCount+=tics; gamestate.TimeCount += tics;
SD_Poll (); SD_Poll ();
UpdateSoundLoc(); // JAB UpdateSoundLoc(); // JAB
...@@ -1385,7 +1384,7 @@ void PlayLoop (void) ...@@ -1385,7 +1384,7 @@ void PlayLoop (void)
if (singlestep) if (singlestep)
{ {
VW_WaitVBL(14); VW_WaitVBL(14);
lasttimecount = TimeCount; lasttimecount = get_TimeCount();
} }
if (extravbls) if (extravbls)
VW_WaitVBL(extravbls); VW_WaitVBL(extravbls);
......
...@@ -163,9 +163,8 @@ void TimedPicCommand (void) ...@@ -163,9 +163,8 @@ void TimedPicCommand (void)
// //
// wait for time // wait for time
// //
TimeCount = 0; set_TimeCount(0);
while (TimeCount < picdelay) while (get_TimeCount() < picdelay) ;
;
// //
// draw pic // draw pic
......
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