character: add detailedProgress property for progress report on each frame

This commit is contained in:
Sebastian Krzyszkowiak 2019-08-28 04:18:20 +02:00
parent 02650dfb4f
commit 29e38ac04c
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
2 changed files with 5 additions and 0 deletions

View file

@ -132,6 +132,9 @@ SYMBOL_EXPORT void LoadSpritesheets(struct Game* game, struct Character* charact
if (height > tmp->height) {
tmp->height = height;
}
if (character->detailedProgress && progress) {
progress(game);
}
}
if (progress) {
progress(game);
@ -400,6 +403,7 @@ SYMBOL_EXPORT struct Character* CreateCharacter(struct Game* game, char* name) {
character->callback = NULL;
character->callback_data = NULL;
character->destructor = NULL;
character->detailedProgress = false;
return character;
}

View file

@ -112,6 +112,7 @@ struct Character {
void* callback_data;
CharacterDestructor* destructor;
bool shared; /*!< Marks the list of spritesheets as shared, so it won't be freed together with the character. */
bool detailedProgress; /*!< Reports progress of loading individual frames. */
};
// TODO: document functions