From 2eaa1224cf51f2e503da3c959a40227f3cbc6489 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 1 Nov 2012 20:14:06 -0300 Subject: [PATCH] tools/ant-gui/ant-gui.c (gui): add gap between images --- tools/ant-gui/ant-gui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/ant-gui/ant-gui.c b/tools/ant-gui/ant-gui.c index c020523..e9df3b7 100644 --- a/tools/ant-gui/ant-gui.c +++ b/tools/ant-gui/ant-gui.c @@ -27,9 +27,10 @@ #define W 80 /* image width */ #define H 16 /* image height */ +#define GAP 6 -#define NX (XRES/W) -#define NY (YRES/H) +#define NX ((XRES+GAP)/(W+GAP)) +#define NY ((YRES+GAP)/(H+GAP)) #define FG_SEL_RGBA 0x000000ff @@ -133,7 +134,8 @@ static void gui(uint8_t *const *imgs, int n) i = iy*NX+ix; if (i >= n) break; - render(surf, imgs[i], ix*W, (iy-y_top)*H, + render(surf, imgs[i], + ix*(W+GAP), (iy-y_top)*(H+GAP), ix == x && iy == y, i == active); } SDL_UnlockSurface(surf);