Codacy fixes
This commit is contained in:
parent
dc7927c6b0
commit
d6e6e9449a
|
@ -213,7 +213,6 @@ gui_render_log(Gui *gui, unsigned int width, unsigned int height, Camera *cam)
|
||||||
{
|
{
|
||||||
static SDL_Color color = { 255, 255, 255, 255 };
|
static SDL_Color color = { 255, 255, 255, 255 };
|
||||||
|
|
||||||
Texture *t;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int render_count;
|
unsigned int render_count;
|
||||||
Position p;
|
Position p;
|
||||||
|
@ -224,6 +223,7 @@ gui_render_log(Gui *gui, unsigned int width, unsigned int height, Camera *cam)
|
||||||
gui_render_frame(gui, width/16, height/16, cam);
|
gui_render_frame(gui, width/16, height/16, cam);
|
||||||
|
|
||||||
for (i = 0; i < render_count; ++i) {
|
for (i = 0; i < render_count; ++i) {
|
||||||
|
Texture *t;
|
||||||
p.y = 16 + ((LOG_FONT_SIZE+1) * i);
|
p.y = 16 + ((LOG_FONT_SIZE+1) * i);
|
||||||
t = gui->log_lines[i];
|
t = gui->log_lines[i];
|
||||||
texture_load_from_text(t, log_data.log[i], color, cam->renderer);
|
texture_load_from_text(t, log_data.log[i], color, cam->renderer);
|
||||||
|
|
|
@ -69,7 +69,7 @@ has_collided(Monster *monster, RoomMatrix *matrix)
|
||||||
player_hit(space->player, dmg);
|
player_hit(space->player, dmg);
|
||||||
|
|
||||||
if (dmg > 0)
|
if (dmg > 0)
|
||||||
sprintf(msg, "Monster '%s' hit you for %d damage",
|
sprintf(msg, "Monster '%s' hit you for %u damage",
|
||||||
monster->label, dmg);
|
monster->label, dmg);
|
||||||
else
|
else
|
||||||
sprintf(msg, "Monster '%s' missed you", monster->label);
|
sprintf(msg, "Monster '%s' missed you", monster->label);
|
||||||
|
|
|
@ -39,7 +39,7 @@ has_collided(Player *player, RoomMatrix *matrix)
|
||||||
|
|
||||||
if (hit > 0) {
|
if (hit > 0) {
|
||||||
char *msg = ec_malloc(200 * sizeof(char));
|
char *msg = ec_malloc(200 * sizeof(char));
|
||||||
sprintf(msg, "You hit '%s' for %d damage",
|
sprintf(msg, "You hit '%s' for %u damage",
|
||||||
space->monster->label, hit);
|
space->monster->label, hit);
|
||||||
gui_log(msg);
|
gui_log(msg);
|
||||||
free(msg);
|
free(msg);
|
||||||
|
|
Loading…
Reference in New Issue