Speedup api_circle, api_tri. #474

it crashed when you try to draw circle with y<0
This commit is contained in:
BADIM-PC\Vadim 2017-12-20 10:10:30 +03:00
parent 46eb6f7a9a
commit 6c6fa6cc8e
1 changed files with 2 additions and 2 deletions

View File

@ -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; if (r > x || err > y) err += ++x*2+1;
} while (x < 0); } while (x < 0);
s32 yt = max(machine->state.clip.t, ym-radius); s32 yt = max(machine->state.clip.t, ym-(s32)radius);
s32 yb = min(machine->state.clip.b, ym+radius+1); s32 yb = min(machine->state.clip.b, ym+(s32)radius+1);
u8 final_color = mapColor(&machine->memory, color); u8 final_color = mapColor(&machine->memory, color);
for(s32 y = yt; y < yb; y++) { for(s32 y = yt; y < yb; y++) {
s32 xl = max(SidesBuffer.Left[y], machine->state.clip.l); s32 xl = max(SidesBuffer.Left[y], machine->state.clip.l);