From 7ff2323dadc329f6e14fbd7ba1244e59c910e9a4 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 13 Jun 2023 06:12:57 +0200 Subject: [PATCH] Fix colorindex --- src/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.c b/src/helpers.c index ce16e59..9d27e86 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -47,7 +47,7 @@ void engine_rendertarget_draw_file(char * fpath) { int colorindex = 0; while (y < engine_rendertarget->height) { while (x < engine_rendertarget->width) { - colorindex = x + y * engine_rendertarget->width * 4; + colorindex = (x + (y * engine_rendertarget->width)) * 4; engine_color_set(buffer[colorindex],buffer[colorindex+1],buffer[colorindex+2],buffer[colorindex+3]); engine_rendertarget_draw_point(x,y); x += 1;