From 1390a92a5b7bbb70e4a89e7750843c3625bfdefe Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 8 Oct 2023 19:12:37 -0400 Subject: [PATCH] correct indexing bug with FSAA --- src/image.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/image.cpp b/src/image.cpp index 27079eee58..3133723b32 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -395,12 +395,12 @@ void Image::merge() if (fsaa) { for (int h=0; h < height; h += 2) { for (int w=0; w < width; w +=2) { - int idx1 = 3*height*h + 3*w; - int idx2 = 3*height*h + 3*(w+1); - int idx3 = 3*height*(h+1) + 3*w; - int idx4 = 3*height*(h+1) + 3*(w+1); + int idx1 = 3*width*h + 3*w; + int idx2 = 3*width*h + 3*(w+1); + int idx3 = 3*width*(h+1) + 3*w; + int idx4 = 3*width*(h+1) + 3*(w+1); - int out = 3*(height/2)*(h/2) + 3*(w/2); + int out = 3*(width/2)*(h/2) + 3*(w/2); for (int i=0; i < 3; ++i) { writeBuffer[out+i] = (unsigned char) (0.25*((int)writeBuffer[idx1+i] +(int)writeBuffer[idx2+i]