void PlayLoop (void) { int give; int helmetangle; playstate = ex_stillplaying; TimeCount = lasttimecount = 0; frameon = 0; running = False; anglefrac = 0; facecount = 0; funnyticount = 0; memset (buttonstate,0,sizeof(buttonstate)); ClearPaletteShifts (); //if (MousePresent) // PORT //Mouse(MDelta); // Clear accumulated mouse movement if (demoplayback) IN_StartAck (); do { if (virtualreality) { //helmetangle = peek (0x40,0xf0); // PORT player->angle += helmetangle; if (player->angle >= ANGLES) player->angle -= ANGLES; } PollControls(); // // actor thinking // madenoise = False; MoveDoors (); MovePWalls (); for (obj = player;obj;obj = obj->next) DoActor (obj); UpdatePaletteShifts (); ThreeDRefresh (); // // MAKE FUNNY FACE IF BJ DOESN'T MOVE FOR AWHILE // #ifdef SPEAR funnyticount += tics; if (funnyticount > 30l*70) { funnyticount = 0; StatusDrawPic (17,4,BJWAITING1PIC+(US_RndT()&1)); facecount = 0; } #endif gamestate.TimeCount+=tics; SD_Poll (); UpdateSoundLoc(); // JAB if (screenfaded) VW_FadeIn (); CheckKeys(); // // debug aids // if (singlestep) { VW_WaitVBL(14); lasttimecount = TimeCount; } if (extravbls) VW_WaitVBL(extravbls); if (demoplayback) { if (IN_CheckAck ()) { IN_ClearKeysDown (); playstate = ex_abort; } } if (virtualreality) { player->angle -= helmetangle; if (player->angle < 0) player->angle += ANGLES; } }while (!playstate && !startgame); if (playstate != ex_died) FinishPaletteShifts (); }
void PlayLoop (void) { #if defined(USE_FEATUREFLAGS) && defined(USE_CLOUDSKY) if(GetFeatureFlags() & FF_CLOUDSKY) InitSky(); #endif #ifdef USE_SHADING InitLevelShadeTable(); #endif playstate = ex_stillplaying; lasttimecount = GetTimeCount(); frameon = 0; anglefrac = 0; facecount = 0; funnyticount = 0; memset (buttonstate, 0, sizeof (buttonstate)); ClearPaletteShifts (); if (MousePresent && IN_IsInputGrabbed()) IN_CenterMouse(); // Clear accumulated mouse movement if (demoplayback) IN_StartAck (); do { PollControls (); // // actor thinking // madenoise = false; MoveDoors (); MovePWalls (); for (obj = player; obj; obj = obj->next) DoActor (obj); UpdatePaletteShifts (); ThreeDRefresh (); // // MAKE FUNNY FACE IF BJ DOESN'T MOVE FOR AWHILE // #ifdef SPEAR funnyticount += tics; if (funnyticount > 30l * 70) { funnyticount = 0; if(viewsize != 21) StatusDrawFace(BJWAITING1PIC + (US_RndT () & 1)); facecount = 0; } #endif gamestate.TimeCount += tics; UpdateSoundLoc (); // JAB if (screenfaded) VW_FadeIn (); CheckKeys (); // // debug aids // if (singlestep) { VW_WaitVBL (singlestep); lasttimecount = GetTimeCount(); } if (extravbls) VW_WaitVBL (extravbls); if (demoplayback) { if (IN_CheckAck ()) { IN_ClearKeysDown (); playstate = ex_abort; } } } while (!playstate && !startgame); if (playstate != ex_died) FinishPaletteShifts (); }
void PlayLoop (void) { boolean reset_areas=false; objtype *obj; lasttimecount = 0; TimeCount = 0; playstate = ex_stillplaying; framecount = frameon = 0; pwallstate = anglefrac = 0; memset (buttonstate,0,sizeof(buttonstate)); ClearPaletteShifts (); ForceUpdateStatusBar(); ::in_clear_mouse_deltas(); tics = 1; // for first time through if (demoplayback) IN_StartAck (); do { PollControls(); // // actor thinking // madenoise = false; if (alerted) alerted--; MoveDoors (); MovePWalls (); for (obj = player;obj;obj = obj->next) { if ((obj != player) && (Keyboard[sc_6] || Keyboard[sc_7]) && Keyboard[sc_8] && DebugOk) { if (!reset_areas) memset(areabyplayer,1,sizeof(areabyplayer)); reset_areas=true; if ((((!(obj->flags & FL_INFORMANT)) && (obj->flags & FL_SHOOTABLE))) || (obj->obclass == liquidobj && !(obj->flags & FL_DEADGUY))) DamageActor(obj,1000,player); } else if (reset_areas) { ConnectAreas(); reset_areas=false; } DoActor (obj); } if (NumEAWalls) CheckSpawnEA(); if ((!GoldsternInfo.GoldSpawned) && GoldsternInfo.SpawnCnt) CheckSpawnGoldstern(); UpdatePaletteShifts (); ThreeDRefresh (); gamestate.TimeCount+=tics; UpdateSoundLoc(); // JAB if (screenfaded & !playstate) VW_FadeIn(); // Display first-time instructions. // if (ShowQuickMsg) ShowQuickInstructions(); CheckKeys(); if (demoplayback && demoptr == lastdemoptr) playstate = ex_title; // // debug aids // if (singlestep) { VW_WaitVBL(14); lasttimecount = TimeCount; } if (extravbls) VW_WaitVBL(extravbls); if ((demoplayback) && (IN_CheckAck())) { IN_ClearKeysDown (); playstate = ex_abort; } }while (!playstate && !startgame); if (playstate != ex_died) FinishPaletteShifts (); gamestate.flags &= ~GS_VIRGIN_LEVEL; }