// Used by wizard fade in/out function bool Scheduler::fadeLoop() { SDL_Event event; viewer.displayCopyright(); viewer.displayWelcomeMessage(); // Start buzz Mix_Volume(viewer.fadChannel, 0); Mix_PlayChannel(viewer.fadChannel, creature.buzz, -1); while(true) { if ( keyCheck() ) { viewer.clearArea(&viewer.TXTPRI); while(SDL_PollEvent(&event)) { ; // clear event buffer } // Stop buzz Mix_HaltChannel(viewer.fadChannel); return false; // auto-play mode off == start demo game } if ( viewer.draw_fade() ) { // Stop buzz Mix_HaltChannel(viewer.fadChannel); return true; // auto-play mode on == start regular game } } }
void dodGame::Restart() { Uint32 ticks1, ticks2; object.Reset(); creature.Reset(); parser.Reset(); player.Reset(); scheduler.Reset(); viewer.Reset(); hasWon = false; dungeon.VFTPTR = 0; scheduler.SYSTCB(); object.CreateAll(); player.HBEATF = 0; player.setInitialObjects(false); viewer.displayPrepare(); viewer.displayCopyright(); viewer.display_mode = Viewer::MODE_TITLE; viewer.draw_game(); // Delay with "PREPARE!" on screen ticks1 = SDL_GetTicks(); do { oslink.process_events(); ticks2 = SDL_GetTicks(); } while (ticks2 < ticks1 + 2500); creature.NEWLVL(); INIVU(); viewer.PROMPT(); }