Added a font registry, a text rendering helper, and an FPS counter function
This commit is contained in:
@@ -11,6 +11,8 @@ SDL_PropertiesID REGISTRY_ACTOR_STATE_STRINGS;
|
||||
SDL_PropertiesID REGISTRY_SPRITE;
|
||||
SDL_PropertiesID REGISTRY_SPRITESHEET;
|
||||
SDL_PropertiesID REGISTRY_CHARACTER;
|
||||
SDL_PropertiesID REGISTRY_MUSIC;
|
||||
SDL_PropertiesID REGISTRY_FONT;
|
||||
|
||||
akerr_ErrorContext *registry_init()
|
||||
{
|
||||
@@ -21,6 +23,8 @@ akerr_ErrorContext *registry_init()
|
||||
CATCH(errctx, registry_init_character());
|
||||
CATCH(errctx, registry_init_actor());
|
||||
CATCH(errctx, registry_init_actor_state_strings());
|
||||
CATCH(errctx, registry_init_font());
|
||||
CATCH(errctx, registry_init_music());
|
||||
} CLEANUP {
|
||||
} PROCESS(errctx) {
|
||||
} FINISH(errctx, true);
|
||||
@@ -35,6 +39,22 @@ akerr_ErrorContext *registry_init_actor()
|
||||
SUCCEED_RETURN(errctx);
|
||||
}
|
||||
|
||||
akerr_ErrorContext AKERR_NOIGNORE *registry_init_font()
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
REGISTRY_FONT = SDL_CreateProperties();
|
||||
FAIL_ZERO_RETURN(errctx, REGISTRY_FONT, AKERR_NULLPOINTER, "Error initializing font registry");
|
||||
SUCCEED_RETURN(errctx);
|
||||
}
|
||||
|
||||
akerr_ErrorContext *registry_init_music()
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
REGISTRY_MUSIC = SDL_CreateProperties();
|
||||
FAIL_ZERO_RETURN(errctx, REGISTRY_MUSIC, AKERR_NULLPOINTER, "Error initializing music registry");
|
||||
SUCCEED_RETURN(errctx);
|
||||
}
|
||||
|
||||
akerr_ErrorContext *registry_init_actor_state_strings()
|
||||
{
|
||||
int i = 0;
|
||||
@@ -54,7 +74,7 @@ akerr_ErrorContext *registry_init_actor_state_strings()
|
||||
|
||||
akerr_ErrorContext *registry_init_sprite()
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
PREPARE_ERROR(errctx);
|
||||
REGISTRY_SPRITE = SDL_CreateProperties();
|
||||
FAIL_ZERO_RETURN(errctx, REGISTRY_SPRITE, AKERR_NULLPOINTER, "Error initializing sprite registry");
|
||||
SUCCEED_RETURN(errctx);
|
||||
|
||||
Reference in New Issue
Block a user