void DrawFace (void) { if(viewsize == 21 && ingame) return; if (SD_SoundPlaying() == GETGATLINGSND) StatusDrawFace(GOTGATLINGPIC); else if (gamestate.health) { #ifdef SPEAR if (godmode) StatusDrawFace(GODMODEFACE1PIC+gamestate.faceframe); else #endif StatusDrawFace(FACE1APIC+3*((100-gamestate.health)/16)+gamestate.faceframe); } else { #ifndef SPEAR if (LastAttacker && LastAttacker->obclass == needleobj) StatusDrawFace(MUTANTBJPIC); else #endif StatusDrawFace(FACE8APIC); } }
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 (); }