static id0_boolean_t Wait(id0_longword_t time) { time += SD_GetTimeCount(); while ((SD_GetTimeCount() < time) && (!IN_IsUserInput())) { if (!(SD_GetTimeCount() % MINTICS)) RF_Refresh(); else BE_ST_ShortSleep(); } return(IN_IsUserInput()); }
static id0_boolean_t MoveTitleTo(id0_int_t offset) { id0_boolean_t done; id0_int_t dir, chunk, move; id0_longword_t lasttime,delay; if (offset < originxglobal) dir = -1; else dir = +1; chunk = dir * PIXGLOBAL; done = false; delay = 1; while (!done) { lasttime = SD_GetTimeCount(); move = delay * chunk; if (chunk < 0) done = originxglobal + move <= offset; else done = originxglobal + move >= offset; if (!done) { RF_Scroll(move,0); RF_Refresh(); } if (IN_IsUserInput()) return(true); delay = SD_GetTimeCount() - lasttime; } if (originxglobal != offset) { RF_Scroll(offset - originxglobal,0); RF_Refresh(); } return(false); }
void DemoLoop (void) { id0_int_t i,level; // // check for launch from ted // if (tedlevel) { NewGame(); gamestate.mapon = tedlevelnum; restartgame = gd_Normal; for (i = 1;i < id0_argc;i++) { if ( (level = US_CheckParm(id0_argv[i],ParmStrings)) == -1) continue; // REFKEEN - Cast for C++ restartgame = (GameDiff)(gd_Easy+level); break; } GameLoop(); TEDDeath(); } // // main game cycle // displayofs = bufferofs = 0; VW_Bar (0,0,320,200,0); while (1) { CA_CacheGrChunk (TITLEPIC); bufferofs = SCREEN2START; displayofs = SCREEN1START; VWB_DrawPic (0,0,TITLEPIC); MM_SetPurge (&grsegs[TITLEPIC],3); UNMARKGRCHUNK(TITLEPIC); FizzleFade (bufferofs,displayofs,320,200,true); if (!IN_UserInput(TickBase*3,false)) { CA_CacheGrChunk (CREDITSPIC); VWB_DrawPic (0,0,CREDITSPIC); MM_SetPurge (&grsegs[CREDITSPIC],3); UNMARKGRCHUNK(CREDITSPIC); FizzleFade (bufferofs,displayofs,320,200,true); } if (!IN_UserInput(TickBase*3,false)) { highscores: DrawHighScores (); FizzleFade (bufferofs,displayofs,320,200,true); IN_UserInput(TickBase*3,false); } if (IN_IsUserInput()) { US_ControlPanel (); if (restartgame || loadedgame) { GameLoop (); goto highscores; } } } }