Exemple #1
0
void game_list_pause( void ) {
	struct game *g = game_start;
	if( g ) {
		do {
			ogl_free_texture( g->texture );
			g->texture = NULL;
			g = g->all_next;
		} while( g != game_start );
	}
}
Exemple #2
0
void snap_free( void ) {
	int i;

	snap_clear();
	
	for( i = 0 ; i < NUM_NOISE ; i++ ) {
		ogl_free_texture( noise[i] );
		noise[i] = NULL;
	}
}
Exemple #3
0
void snap_clear( void ) {
	if( video ) {
		video_close();
		video = 0;
	}
	else {
		if( texture ) {
			ogl_free_texture( texture );
		}
	}
	texture = NULL;
	platform_texture = NULL;
}
Exemple #4
0
void game_free( struct game* game ) {
	if( game ) {
		ogl_free_texture( game->texture );
		game->all_prev->all_next = game->all_next;
		game->all_next->all_prev = game->all_prev;
		game_start = game->all_next;
		if( game_start->all_next == game_start ) {
			/* last in the list */
			game_start = NULL;
		}
		free( game );
		game = NULL;
	}
}
Exemple #5
0
int bg_set( const char *filename ) {
	if( filename && *filename ) {
		if( bg_texture != bg_clear_texture ) {
			ogl_free_texture( bg_texture );
		}
		bg_texture = sdl_create_texture( filename );
		if( bg_texture == 0 ) {
			fprintf( stderr, "Warning: couldn't load background image '%s'\n", filename );
			return -1;
		}
	}
	else {
		bg_clear();
	}
	return 0;
}
Exemple #6
0
void video_close( void ) {
    int timeout = 10;
    stop = 1;

    packet_queue_flush( &audio_queue );
    frame_queue_flush( &video_queue );

    while( (reader_running || audio_running) && timeout-- )
        SDL_Delay( 10 );

    if( audio_open )
        SDL_CloseAudio();
    audio_open = 0;

    if( video_codec_context )
        avcodec_close( video_codec_context );
    video_codec_context = NULL;

    if( audio_codec_context )
        avcodec_close( audio_codec_context );
    audio_codec_context = NULL;

    if( format_context )
        av_close_input_file( format_context );
    format_context = NULL;

    if( video_buffer )
        av_free( video_buffer );
    video_buffer = NULL;

    video_stream = -1;
    audio_stream = -1;

    if( texture )
        ogl_free_texture( texture );
    texture = NULL;
    got_texture = 0;

    sound_open_mixer();
}
Exemple #7
0
void game_free_texture( struct game *game ) {
	if( game->texture ) {
		ogl_free_texture( game->texture );
		game->texture = NULL;
	}
}
Exemple #8
0
void bg_free( void ) {
	if( bg_texture != bg_clear_texture ) {
		ogl_free_texture( bg_clear_texture );
	}
	ogl_free_texture( bg_texture );
}