From 6c6fa6cc8ef8252d05434b2f184cda3a4dbafb50 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Wed, 20 Dec 2017 10:10:30 +0300 Subject: [PATCH] Speedup api_circle, api_tri. #474 it crashed when you try to draw circle with y<0 --- src/tic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tic.c b/src/tic.c index ff5edd5..2a42bad 100644 --- a/src/tic.c +++ b/src/tic.c @@ -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-radius); - s32 yb = min(machine->state.clip.b, ym+radius+1); + s32 yt = max(machine->state.clip.t, ym-(s32)radius); + s32 yb = min(machine->state.clip.b, ym+(s32)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);