Created
March 24, 2011 02:56
-
-
Save fengye/884460 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void bitmap_source_release_content(ALLEGRO_GC_BITMAPSOURCE *bitmap_source) | |
{ | |
if ( bitmap_source->type == BS_NORMAL ) | |
{ | |
if ( bitmap_source->name_to_bitmap ) | |
{ | |
/* free string key */ | |
AL_AATREE_ITERATOR* iterator = al_aa_begin(bitmap_source->name_to_bitmap); | |
while (iterator && al_aa_next(iterator)) | |
{ | |
al_free((void*)(iterator->current_node.key)); | |
al_destroy_bitmap((ALLEGRO_BITMAP*)iterator->current_node.value); | |
} | |
al_aa_end(iterator); | |
al_aa_free(bitmap_source->name_to_bitmap); | |
bitmap_source->name_to_bitmap = NULL; | |
} | |
} | |
else | |
{ | |
if ( bitmap_source->keyframes ) | |
{ | |
size_t i; | |
for(i = 0; i < al_vector_size(bitmap_source->keyframes); ++i ) | |
{ | |
KEYFRAME** pp_keyframe = (KEYFRAME**)al_vector_ref(bitmap_source->keyframes, i); | |
KEYFRAME* keyframe = *pp_keyframe; | |
al_destroy_bitmap(keyframe->bitmap); | |
al_free(keyframe); | |
} | |
al_vector_free(bitmap_source->keyframes); | |
bitmap_source->keyframes = NULL; | |
} | |
} | |
bitmap_source->time_scale = 1.0f; | |
bitmap_source->elapsed_time = 0; | |
bitmap_source->loop = false; | |
bitmap_source->current_index = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment