Exemple #1
0
void stop_sound(int code) {
	if (code == MUSIC && build_short(music_pos) != -1) {
		clear_sound();
		decompose_short(music_pos, -1);
	}
	else if (code == VICTORY && build_short(victory_pos) != -1) {
		clear_sound();
		decompose_short(victory_pos, -1);
	}
	else if (code == INTRO && build_short(intro_pos) != -1) {
		clear_sound();
		decompose_short(intro_pos, -1);
	}
}
Exemple #2
0
/// cleans up game memory and SDL at exit
void cleanup()
{
    extern void clear_command();
    extern void clear_console();
    extern void clear_mdls();
    extern void clear_sound();

    recorder::stop();
    cleanupserver();
    
    /// "Use this function to set a window's input grab mode."
    /// https://wiki.libsdl.org/SDL_SetWindowGrab
    if(screen) SDL_SetWindowGrab(screen, SDL_FALSE);

    /// "Use this function to set relative mouse mode."
    /// https://wiki.libsdl.org/SDL_SetRelativeMouseMode
    SDL_SetRelativeMouseMode(SDL_FALSE);

    /// "Use this function to toggle whether or not the cursor is shown."
    /// https://wiki.libsdl.org/SDL_ShowCursor
    SDL_ShowCursor(SDL_TRUE);
    cleargamma();

    /// free octree memory
    freeocta(worldroot);
    clear_command();
    clear_console();
    clear_mdls();
    clear_sound();
    closelogfile();
    
    /// "Use this function to clean up all initialized subsystems. You should call it upon all exit conditions."
    /// https://wiki.libsdl.org/SDL_Quit
    SDL_Quit();
}
Exemple #3
0
void deactivate_expired_sounds() {
	clear_sound();
	if (build_short(music_pos) != -1) {
		activate_sound(music, music_size);
	}
	else if (build_short(intro_pos) != -1) {
		activate_sound(intro, intro_size);
	}
	else if (build_short(victory_pos) != -1) {
		activate_sound(victory, victory_size);
	}
}
Exemple #4
0
void cleanup()
{
    recorder::stop();
    cleanupserver();
    SDL_ShowCursor(1);
    SDL_WM_GrabInput(SDL_GRAB_OFF);
    SDL_SetGamma(1, 1, 1);
    freeocta(worldroot);
    extern void clear_command(); clear_command();
    extern void clear_console(); clear_console();
    extern void clear_mdls();    clear_mdls();
    extern void clear_sound();   clear_sound();
    SDL_Quit();
}
Exemple #5
0
void cleanup()
{
    recorder::stop();
    cleanupserver();
    SDL_ShowCursor(1);
    SDL_WM_GrabInput(SDL_GRAB_OFF);
    cleargamma();
    freeocta(worldroot);
    varsys::clear();
    extern void clear_console(); clear_console();
    extern void clear_mdls();    clear_mdls();
    extern void clear_sound();   clear_sound();
    closelogfile();
    SDL_Quit();
}
Exemple #6
0
void cleanup()
{
    holdscreenlock;
    recorder::stop();
    cleanupserver();
    if(screen) SDL_SetWindowGrab(screen, SDL_FALSE);
    SDL_SetRelativeMouseMode(SDL_FALSE);
    SDL_ShowCursor(SDL_TRUE);
    cleargamma();
    freeocta(worldroot);
    extern void clear_command(); clear_command();
    extern void clear_console(); clear_console();
    extern void clear_mdls();    clear_mdls();
    extern void clear_sound();   clear_sound();
    closelogfile();
    SDL_Quit();
}