예제 #1
0
파일: main.cpp 프로젝트: Ole-x/musicbox
	void parsePad(int pad_gpio) {
		if (pad_gpio == PAD_SELECT) {

			stop();
			shutdownSound();
			program->terminate = true;
//			program = programs[0];
			nextProgram = "Main menu";

		}

	}
예제 #2
0
void LegacyMenu::onRaceFinishing()
{
    if (_piRaceEngine->inData()->_displayMode == RM_DISP_MODE_NORMAL)
	{
		shutdownSound();
        unloadCarsGraphics();
        shutdownGraphicsView();
        unloadTrackGraphics();
        RmScreenShutdown();
    }
	else
	{
        RmResScreenShutdown();
    }
}
예제 #3
0
void LegacyMenu::shutdown()
{
    // Shutdown graphics in case relevant and not already done.
    if (_piRaceEngine->inData()->_displayMode == RM_DISP_MODE_NORMAL)
	{
        shutdownSound();
        unloadCarsGraphics();
        shutdownGraphicsView();
        unloadTrackGraphics();
        shutdownGraphics(/*bUnloadModule=*/true);
    }

    // Shutdown stuff that needs it.
    ::RmStopRaceMenuShutdown();
    ::RmStartRaceMenuShutdown();
    ::RmShutdownReUpdateStateHook();
}
예제 #4
0
파일: main.c 프로젝트: spaceflounder/sr389
int main(int argc __attribute__((unused)), char *argv[])
{

    /* init allegro library */
    ALLEGRO_TIMER *timer = NULL;
    al_init();

    /* prepare random number generator */
    srand(time(NULL));

    /* activate all engine subsystems using the startup macro */
    resetCollisionTable();
    STARTUP(videoInit())
    STARTUP(init_datafile(argv))
    STARTUP(al_install_keyboard())
    STARTUP(al_install_joystick())
    STARTUP(fontInit())
    STARTUP(setupSound())
    timer = al_create_timer(1.0 / 60);
    al_start_timer(timer);
    initMediaLib();
    initBuffers();

    /* prepare game */
    startGame();

    /* begin game loop */
    while(!state.terminate) {
        runState(timer);
    }

    /* finish, return control to os */
    al_destroy_timer(timer);
    shutdownState();
    shutdownGame();
    videoKill();
    shutdownSound();
    al_uninstall_system();
    PHYSFS_deinit();

    /* no problems, exit false */
    return EXIT_SUCCESS;

}
예제 #5
0
파일: main.cpp 프로젝트: Ole-x/musicbox
	void parsePad(int pad_gpio) {

		if (pad_gpio == PAD_PREVIOUS) {
			if (currentSel > 0)
				currentSel--;
		}

		if (pad_gpio == PAD_NEXT) {
			if (currentSel < 2)
				currentSel++;
		}

		// select
		if (pad_gpio == PAD_SELECT) {
			switch (currentSel) {
			case 0:
				if (isPlaying) {
					pause();
				}
				else {
					play();
				}
				break;
			case 1:
				stop();
				break;
			case 2:
				stop();
				shutdownSound();
				program->terminate = true;
				//program = programs[0];
				nextProgram = "Main menu";
				break;
			}
		}

	}
예제 #6
0
파일: main.cpp 프로젝트: Ole-x/musicbox
	void parsePad(int pad_gpio) {
		if (pad_gpio == PAD_TOP) {
			rotate();
		}

		if (pad_gpio == PAD_BOTTOM) {
		}

		if (pad_gpio == PAD_PREVIOUS) {
			move(LEFT);
		}

		if (pad_gpio == PAD_NEXT) {
			move(RIGHT);
		}
		if (pad_gpio == PAD_SELECT) {
			stop();
			shutdownSound();
			program->terminate = true;
//			program = programs[0];
			nextProgram = "Main menu";

		}
	}
예제 #7
0
void SystemExit() {
#ifdef SOUND
  shutdownSound();
#endif
  SDL_Quit();
}