int WolfMain(int argc, char *argv[]) { WaitTick(); /* Wait for a system tick to go by */ playstate = (exit_t)setjmp(ResetJmp); NumberIndex = 36; /* Force the score to redraw properly */ IntermissionHack = FALSE; if (playstate) { goto DoGame; /* Begin a new game or saved game */ } JumpOK = TRUE; /* Jump vector is VALID */ FlushKeys(); /* Allow a system event */ Intro(); /* Do the game intro */ for (;;) { if (TitleScreen()) { /* Show the game logo */ StartSong(SongListPtr[0]); ClearTheScreen(BLACK); /* Blank out the title page */ BlastScreen(); SetAPalette(rBlackPal); if (ChooseGameDiff()) { /* Choose your difficulty */ playstate = EX_NEWGAME; /* Start a new game */ DoGame: FadeToBlack(); /* Fade the screen */ StartGame(); /* Play the game */ } } /* TODO: demos or whatever here */ } return 0; }
void PlayerDlg::OnCancel(AWEvent* event) { Player::Load(); FlushKeys(); manager->ShowMenuDlg(); }
void PlayerDlg::OnApply(AWEvent* event) { Player* player = Player::GetCurrentPlayer(); if (player) { UpdatePlayer(); Player::Save(); } FlushKeys(); manager->ShowMenuDlg(); }
// Отмена интерактьивного режима // После вызова этой функции можно вызывать CheckKeys() void LeaveInteractiveMode() { // SDL_WM_SetCaption("Not Interactive",0); bInteractive=0; SDL_EnableKeyRepeat(0, 0); SDL_EnableUNICODE(0); bBlinkCursor=1; StartSound(); FlushKeys(); if (vmVideoMode==vmGraph512) SDL_FillRect(SDL_GetVideoSurface(),0,0); //............ }
void LevelCompleted(void) { Word k; /* setup */ ParTime = MapListPtr->InfoArray[gamestate.mapon].ParTime; BonusScore = 0; /* Init the bonus */ IntermissionHack = TRUE; /* Hack to keep score from drawing twice */ NumberIndex = 47; /* Hack to draw score using an alternate number set */ NewGameWindow(1); /* Force 512 mode screen */ DisplayScreen(rIntermission, rInterPal); BlastScreen(); InitInterMisPic(); WhichBJ = 0; /* Init BJ */ BJTime = ReadTick()-50; /* Force a redraw */ BlastScreen(); /* Draw the screen */ ShowBJ(); /* Draw BJ */ StartSong(SongListPtr[1]); /* Play the intermission song */ SetAPalette(rInterPal); /* Set the palette */ DrawIScore(); /* Draw the current score */ FlushKeys(); /* Flush the keyboard buffer */ /* First an initial pause */ BJBreath(60); /* Display Par Time, Player's Time, and show bonus if any. */ if (gamestate.playtime>=(100*60*60UL)) { k =(99*60)+59; } else { k = gamestate.playtime/60; } DrawTime(TIMEX,TIMEY,k); /* How much time has elapsed? */ DrawTime(TIMEX,TIMEY2,ParTime); if (k < ParTime) { k = (ParTime-k) * 50; /* 50 points per second */ BonusScore += k; /* Add to the bonus */ DrawIBonus(); /* Draw the bonus */ PlaySound(SND_EXTRA); BJBreath(60); /* Breath a little */ } /* Show ratios for "terminations", treasure, and secret stuff. */ /* If 100% on all counts, Perfect Bonus! */ k=0; /* Not perfect (Yet) */ RollRatio(RATIOX,RATIOY,(gamestate.treasurecount*100)/gamestate.treasuretotal); if (gamestate.treasurecount == gamestate.treasuretotal) { k++; /* Perfect treasure */ } if (!NoEnemies) { RollRatio(RATIOX,RATIOY2,(gamestate.killcount*100)/gamestate.killtotal); if (gamestate.killcount == gamestate.killtotal) { k++; /* Perfect kills */ } } RollRatio(RATIOX,RATIOY3,(gamestate.secretcount*100)/gamestate.secrettotal); if (gamestate.secretcount == gamestate.secrettotal) { k++; /* Perfect secret */ } if (BonusScore) { /* Did you get a bonus? */ RollScore(); BJBreath(60); } if (k==3) { WhichBJ = 2; /* Draw thumbs up for BJ */ PlaySound(SND_THUMBSUP); } do { ShowBJ(); /* Animate BJ */ } while (!WaitTicksEvent(1)); /* Wait for a keypress */ FadeToBlack(); /* Fade away */ FreeInitMisPic(); IntermissionHack = FALSE; /* Release the hack */ NumberIndex = 36; /* Restore the index */ }