diff --git a/source/basque.c b/source/basque.c index 98054e3..47da2d5 100644 --- a/source/basque.c +++ b/source/basque.c @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) } memset(&app, 0, sizeof(App)); - memset(&game, 0, sizeof(GameState)); + memset(&game, 0, sizeof(Game)); init(); diff --git a/source/initialization.h b/source/initialization.h index 7083717..7de54e5 100644 --- a/source/initialization.h +++ b/source/initialization.h @@ -1,6 +1,6 @@ #include "mechanics.h" -GameState game; +Game game; App app; void cleanup(void) @@ -41,7 +41,7 @@ void cleanup(void) SDL_Quit(); } -void create_outlined_font(GameState* game, char* map_tile_str) +void create_outlined_font(Game* game, char* map_tile_str) { game->font.outline_surface = TTF_RenderText_Blended(game->font.outline, map_tile_str, game->font.outline_color); game->font.surface = TTF_RenderText_Blended(game->font.face, map_tile_str, game->font.color); diff --git a/source/map.h b/source/map.h index 1a6f10f..56d4917 100644 --- a/source/map.h +++ b/source/map.h @@ -10,7 +10,7 @@ bool map_char_is_not_tile_info(char char_to_check) return char_to_check == ' ' || char_to_check == '\0' || char_to_check == '\n' || char_to_check == ','; } -void read_map_layout(GameState* game) +void read_map_layout(Game* game) { game->map.layout_string = read_file(game->map.layout_file); // TODO: Return string length when file is read. @@ -59,7 +59,7 @@ void read_map_layout(GameState* game) } \ } -void read_map_attributes(GameState* game) +void read_map_attributes(Game* game) { game->map.attributes_string = read_file(game->map.attributes_file); game->map.attributes_string_length = strlen(game->map.attributes_string); @@ -182,7 +182,7 @@ void read_map_attributes(GameState* game) } } -void draw_edit_grid(App* app, GameState* game, Axes background, int map_tile) +void draw_edit_grid(App* app, Game* game, Axes background, int map_tile) { if (DEBUG_MODE && game->EDIT_MODE) { SDL_Rect text_clip; @@ -217,7 +217,7 @@ void draw_edit_grid(App* app, GameState* game, Axes background, int map_tile) } \ } -void generate_map(App* app, GameState* game) +void generate_map(App* app, Game* game) { Axes background; diff --git a/source/mechanics.h b/source/mechanics.h index 096b056..ce66597 100644 --- a/source/mechanics.h +++ b/source/mechanics.h @@ -9,7 +9,7 @@ SDL_Texture* load_texture(App* app, char* file) return texture; } -void load_music(GameState* game) +void load_music(Game* game) { int flags = MIX_INIT_OGG; int initted = Mix_Init(flags); @@ -31,7 +31,7 @@ void load_music(GameState* game) } } -void prepare_scene(App* app, GameState* game) +void prepare_scene(App* app, Game* game) { game->player_image = load_texture(app, PLAYER_IMAGE); game->background_image = load_texture(app, BACKGROUND_IMAGE); @@ -109,7 +109,7 @@ int is_above_bound(int coordinate, int sprite_dimension, int bound) } \ } -void handle_collisions(GameState* game) +void handle_collisions(Game* game) { if (DEBUG_MODE && game->EDIT_MODE) { @@ -123,7 +123,7 @@ void handle_collisions(GameState* game) } } -int write_map_layout(GameState* game) +int write_map_layout(Game* game) { if (file_exists(MAP_LOCK_FILE)) { // Do not write if there is a lock file, to avoid obliterating the map. @@ -237,7 +237,7 @@ int write_map_layout(GameState* game) } \ } -void handle_input(App* app, GameState* game) +void handle_input(App* app, Game* game) { game->done = SDL_FALSE; diff --git a/source/types.h b/source/types.h index 0d0b88d..2c604ee 100644 --- a/source/types.h +++ b/source/types.h @@ -116,4 +116,4 @@ typedef struct { bool EDIT_MODE; Editor editor; -} GameState; +} Game;