From 8f1d0a474a74b166e302046fa47f91450ba05598 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 21 Mar 2020 22:14:24 +0100 Subject: Cured floating point exception --- Makefile | 1 + src/ft_draw_life_bar.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index c11281d..ae460b6 100644 --- a/Makefile +++ b/Makefile @@ -155,6 +155,7 @@ CFLAGS += -Wall CFLAGS += -Wextra CFLAGS += -Werror CFLAGS += -pedantic +CFLAGS += -march=ivybridge -O2 -pipe #--------------------------------------------------------------------------------------------------# ifdef DEBUG CFLAGS += ${DBG} diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c index 25d5ebe..64d1f1f 100644 --- a/src/ft_draw_life_bar.c +++ b/src/ft_draw_life_bar.c @@ -92,6 +92,7 @@ static void int16_t y; const int16_t scl = cl->mlist.scale; + x = ((cl->mlist.map_w * scl) + 20) + (32 * scl) - ((32 * scl) / 4); y = cl->wlist.y_size - (cl->mlist.map_h * scl) - 10; while (y < (int16_t)(cl->wlist.y_size - 10)) { @@ -102,6 +103,8 @@ static void } y -= cl->wlist.y_size - (cl->mlist.map_h * scl) - 10; x -= ((cl->mlist.map_w * scl) + 20) + (32 * scl) - ((32 * scl) / 4); + y = (y == 0) ? (1) : (y); + x = (x == 0) ? (1) : (x); cl->h = y; cl->w = x; } -- cgit v1.2.3