Cleans up some more warnings (gcc)

This commit is contained in:
Linus Probert 2018-02-24 00:29:25 +01:00
parent 5d1bb383dc
commit fbf746d270
4 changed files with 12 additions and 12 deletions

View File

@ -84,7 +84,7 @@ create_label_sprite(Position pos)
} }
static void static void
init_sprites(Gui *gui, SDL_Renderer *renderer) init_sprites(Gui *gui)
{ {
Texture *t; Texture *t;
unsigned int i; unsigned int i;
@ -144,7 +144,7 @@ init_sprites(Gui *gui, SDL_Renderer *renderer)
} }
Gui* Gui*
gui_create(SDL_Renderer *renderer) gui_create(void)
{ {
Texture *t; Texture *t;
unsigned int i; unsigned int i;
@ -168,13 +168,13 @@ gui_create(SDL_Renderer *renderer)
gui_malloc_log(); gui_malloc_log();
init_sprites(gui, renderer); init_sprites(gui);
return gui; return gui;
} }
static void static void
set_max_health(Gui *gui, int max, SDL_Renderer *renderer) set_max_health(Gui *gui, int max)
{ {
Texture *texture0, *texture1; Texture *texture0, *texture1;
int i; 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) { if (max_health != player->stats.maxhp) {
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) { if (current_health != player->stats.hp) {
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 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"); Texture *texture = texturecache_get("GUI/GUI0.png");
unsigned int i, j; unsigned int i, j;
@ -372,7 +372,7 @@ gui_render_frame(Gui *gui, unsigned int width, unsigned int height, Camera *cam)
void void
gui_render_panel(Gui *gui, unsigned int width, unsigned int height, Camera *cam) 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; LinkedList *item = gui->health;
while (item != NULL) { 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; 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) { for (i = 0; i < render_count; ++i) {
Texture *t; Texture *t;

View File

@ -46,7 +46,7 @@ typedef struct {
} Gui; } Gui;
Gui* Gui*
gui_create(SDL_Renderer *renderer); gui_create(void);
void void
gui_update_player_stats(Gui*, Player*, Map*, SDL_Renderer*); gui_update_player_stats(Gui*, Player*, Map*, SDL_Renderer*);

View File

@ -184,7 +184,7 @@ initGame(void)
texturecache_init(gRenderer); texturecache_init(gRenderer);
gCamera.renderer = gRenderer; gCamera.renderer = gRenderer;
gRoomMatrix = roommatrix_create(); gRoomMatrix = roommatrix_create();
gGui = gui_create(gRenderer); gGui = gui_create();
gSkillBar = skillbar_create(gRenderer); gSkillBar = skillbar_create(gRenderer);
item_builder_init(gRenderer); item_builder_init(gRenderer);
gPointer = pointer_create(gRenderer); gPointer = pointer_create(gRenderer);

View File

@ -59,7 +59,7 @@ skillbar_create(SDL_Renderer *renderer)
} }
static void 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_left = { 1*16, 10*16, 16, 16 };
static SDL_Rect c_top_right = { 3*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 void
skillbar_render(SkillBar *bar, Camera *cam) skillbar_render(SkillBar *bar, Camera *cam)
{ {
render_frame(bar, cam); render_frame(cam);
render_sprites(bar, cam); render_sprites(bar, cam);
render_activation_indicator(bar, cam); render_activation_indicator(bar, cam);
} }