From a60099a58788291d50b92acad0df733ae2db8f5c Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Wed, 20 Dec 2017 13:58:44 +0300 Subject: [PATCH] #474 removed (s32) radius conversion --- src/tic.c | 8 ++++---- src/ticapi.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tic.c b/src/tic.c index 2a42bad..f848dcb 100644 --- a/src/tic.c +++ b/src/tic.c @@ -849,7 +849,7 @@ static void setSideTexPixel(s32 x, s32 y, float u, float v) } } -static void api_circle(tic_mem* memory, s32 xm, s32 ym, u32 radius, u8 color) +static void api_circle(tic_mem* memory, s32 xm, s32 ym, s32 radius, u8 color) { tic_machine* machine = (tic_machine*)memory; @@ -869,8 +869,8 @@ static void api_circle(tic_mem* memory, s32 xm, s32 ym, u32 radius, u8 color) if (r > x || err > y) err += ++x*2+1; } while (x < 0); - s32 yt = max(machine->state.clip.t, ym-(s32)radius); - s32 yb = min(machine->state.clip.b, ym+(s32)radius+1); + s32 yt = max(machine->state.clip.t, ym-radius); + s32 yb = min(machine->state.clip.b, ym+radius+1); u8 final_color = mapColor(&machine->memory, color); for(s32 y = yt; y < yb; y++) { s32 xl = max(SidesBuffer.Left[y], machine->state.clip.l); @@ -879,7 +879,7 @@ static void api_circle(tic_mem* memory, s32 xm, s32 ym, u32 radius, u8 color) } } -static void api_circle_border(tic_mem* memory, s32 xm, s32 ym, u32 radius, u8 color) +static void api_circle_border(tic_mem* memory, s32 xm, s32 ym, s32 radius, u8 color) { s32 r = radius; s32 x = -r, y = 0, err = 2-2*r; diff --git a/src/ticapi.h b/src/ticapi.h index 5693c16..0802684 100644 --- a/src/ticapi.h +++ b/src/ticapi.h @@ -85,8 +85,8 @@ typedef struct void (*remap) (tic_mem* memory, const tic_map* src, const tic_tiles* tiles, s32 x, s32 y, s32 width, s32 height, s32 sx, s32 sy, u8 chromakey, s32 scale, RemapFunc remap, void* data); void (*map_set) (tic_mem* memory, tic_map* src, s32 x, s32 y, u8 value); u8 (*map_get) (tic_mem* memory, const tic_map* src, s32 x, s32 y); - void (*circle) (tic_mem* memory, s32 x, s32 y, u32 radius, u8 color); - void (*circle_border) (tic_mem* memory, s32 x, s32 y, u32 radius, u8 color); + void (*circle) (tic_mem* memory, s32 x, s32 y, s32 radius, u8 color); + void (*circle_border) (tic_mem* memory, s32 x, s32 y, s32 radius, u8 color); void (*tri) (tic_mem* memory, s32 x1, s32 y1, s32 x2, s32 y2, s32 x3, s32 y3, u8 color); void(*textri) (tic_mem* memory, float x1, float y1, float x2, float y2, float x3, float y3, float u1, float v1, float u2, float v2, float u3, float v3, bool use_map, u8 chroma); void (*clip) (tic_mem* memory, s32 x, s32 y, s32 width, s32 height);