From ca0a6d10358f4f6d2f7f07b6a35e0ed6ef682b2e Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Mon, 18 Dec 2017 16:35:53 +0300 Subject: [PATCH] Revert "Use drawhline in api_tri." This reverts commit 09c17432958e7a32f139bca3e59280011a5c36da. --- src/tic.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/tic.c b/src/tic.c index 73300e2..dfcce3a 100644 --- a/src/tic.c +++ b/src/tic.c @@ -922,14 +922,9 @@ static void api_tri(tic_mem* memory, s32 x1, s32 y1, s32 x2, s32 y2, s32 x3, s32 ticLine(memory, x2, y2, x3, y3, color, triPixelFunc); ticLine(memory, x3, y3, x1, y1, color, triPixelFunc); - u8 final_color = mapColor(&machine->memory, color); - s32 yt = max(0, min(y1, min(y2, y3))); - s32 yb = min(TIC80_HEIGHT, max(y1, max(y2, y3)) + 1); - for(s32 y = yt; y < yb; y++) { - s32 xl = max(SidesBuffer.Left[y], machine->state.clip.l); - s32 xr = min(SidesBuffer.Right[y], machine->state.clip.r); - machine->state.drawhline(&machine->memory, xl, xr, y, final_color); - } + for(s32 y = 0; y < TIC80_HEIGHT; y++) + for(s32 x = SidesBuffer.Left[y]; x <= SidesBuffer.Right[y]; ++x) + setPixel(machine, x, y, color); }