From fbf746d2700927feb64fd3aeeaf3b2cca56f65a1 Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Sat, 24 Feb 2018 00:29:25 +0100 Subject: [PATCH] Cleans up some more warnings (gcc) --- src/gui.c | 16 ++++++++-------- src/gui.h | 2 +- src/main.c | 2 +- src/skillbar.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gui.c b/src/gui.c index ab664b0..6fdea4e 100644 --- a/src/gui.c +++ b/src/gui.c @@ -84,7 +84,7 @@ create_label_sprite(Position pos) } static void -init_sprites(Gui *gui, SDL_Renderer *renderer) +init_sprites(Gui *gui) { Texture *t; unsigned int i; @@ -144,7 +144,7 @@ init_sprites(Gui *gui, SDL_Renderer *renderer) } Gui* -gui_create(SDL_Renderer *renderer) +gui_create(void) { Texture *t; unsigned int i; @@ -168,13 +168,13 @@ gui_create(SDL_Renderer *renderer) gui_malloc_log(); - init_sprites(gui, renderer); + init_sprites(gui); return gui; } static void -set_max_health(Gui *gui, int max, SDL_Renderer *renderer) +set_max_health(Gui *gui, int max) { Texture *texture0, *texture1; int i; @@ -286,7 +286,7 @@ gui_update_player_stats(Gui *gui, Player *player, Map *map, SDL_Renderer *render if (max_health != player->stats.maxhp) { max_health = player->stats.maxhp; - set_max_health(gui, max_health, renderer); + set_max_health(gui, max_health); } if (current_health != player->stats.hp) { current_health = player->stats.hp; @@ -334,7 +334,7 @@ gui_update_player_stats(Gui *gui, Player *player, Map *map, SDL_Renderer *render } static void -gui_render_frame(Gui *gui, unsigned int width, unsigned int height, Camera *cam) +gui_render_frame(unsigned int width, unsigned int height, Camera *cam) { Texture *texture = texturecache_get("GUI/GUI0.png"); unsigned int i, j; @@ -372,7 +372,7 @@ gui_render_frame(Gui *gui, unsigned int width, unsigned int height, Camera *cam) void gui_render_panel(Gui *gui, unsigned int width, unsigned int height, Camera *cam) { - gui_render_frame(gui, width/16, height/16, cam); + gui_render_frame(width/16, height/16, cam); LinkedList *item = gui->health; while (item != NULL) { @@ -442,7 +442,7 @@ gui_render_log(Gui *gui, unsigned int width, unsigned int height, Camera *cam) render_count = LOG_LINES_COUNT > log_data.count ? log_data.count : LOG_LINES_COUNT; - gui_render_frame(gui, width/16, height/16, cam); + gui_render_frame(width/16, height/16, cam); for (i = 0; i < render_count; ++i) { Texture *t; diff --git a/src/gui.h b/src/gui.h index e514e21..fe8d48e 100644 --- a/src/gui.h +++ b/src/gui.h @@ -46,7 +46,7 @@ typedef struct { } Gui; Gui* -gui_create(SDL_Renderer *renderer); +gui_create(void); void gui_update_player_stats(Gui*, Player*, Map*, SDL_Renderer*); diff --git a/src/main.c b/src/main.c index d98a0f1..2771ed8 100644 --- a/src/main.c +++ b/src/main.c @@ -184,7 +184,7 @@ initGame(void) texturecache_init(gRenderer); gCamera.renderer = gRenderer; gRoomMatrix = roommatrix_create(); - gGui = gui_create(gRenderer); + gGui = gui_create(); gSkillBar = skillbar_create(gRenderer); item_builder_init(gRenderer); gPointer = pointer_create(gRenderer); diff --git a/src/skillbar.c b/src/skillbar.c index d6b730c..478f597 100644 --- a/src/skillbar.c +++ b/src/skillbar.c @@ -59,7 +59,7 @@ skillbar_create(SDL_Renderer *renderer) } static void -render_frame(SkillBar *bar, Camera *cam) +render_frame(Camera *cam) { static SDL_Rect c_top_left = { 1*16, 10*16, 16, 16 }; static SDL_Rect c_top_right = { 3*16, 10*16, 16, 16 }; @@ -116,7 +116,7 @@ render_activation_indicator(SkillBar *bar, Camera *cam) void skillbar_render(SkillBar *bar, Camera *cam) { - render_frame(bar, cam); + render_frame(cam); render_sprites(bar, cam); render_activation_indicator(bar, cam); }