[Scummvm-git-logs] scummvm master -> 68da2d21b37d0691a69764a3fe1fe9710842d698

mduggan noreply at scummvm.org
Fri Dec 17 01:41:42 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
68da2d21b3 TINYGL: Reorder ARGB arguments to match function parameters


Commit: 68da2d21b37d0691a69764a3fe1fe9710842d698
    https://github.com/scummvm/scummvm/commit/68da2d21b37d0691a69764a3fe1fe9710842d698
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-12-17T10:30:03+09:00

Commit Message:
TINYGL: Reorder ARGB arguments to match function parameters

The arguments to `setARGBAt` and `getARGBAt` at were in RGBA order instead of
ARGB order (as the function name suggests they should be).

In practice this was not a bug as values were immediately passed back in the
same swapped order, but coverity complained about it and it's nicer to name
them correctly.

Changed paths:
    graphics/tinygl/image_util.cpp


diff --git a/graphics/tinygl/image_util.cpp b/graphics/tinygl/image_util.cpp
index b79b90666a..df351d8d30 100644
--- a/graphics/tinygl/image_util.cpp
+++ b/graphics/tinygl/image_util.cpp
@@ -91,15 +91,15 @@ void GLContext::gl_resizeImage(Graphics::PixelBuffer &dest, int xsize_dest, int
 				} else
 					point2_offset = point_offset;
 			}
-			src.getARGBAt(point1_offset, r00, g00, b00, a00);
-			src.getARGBAt(point2_offset, r01, g01, b01, a01);
-			src.getARGBAt(point3_offset, r10, g10, b10, a10);
+			src.getARGBAt(point1_offset, a00, r00, g00, b00);
+			src.getARGBAt(point2_offset, a01, r01, g01, b01);
+			src.getARGBAt(point3_offset, a10, r10, g10, b10);
 			dest.setPixelAt(
 				dest_offset++,
+				interpolate(a00, a01, a10, xf, curr_yf),
 				interpolate(r00, r01, r10, xf, curr_yf),
 				interpolate(g00, g01, g10, xf, curr_yf),
-				interpolate(b00, b01, b10, xf, curr_yf),
-				interpolate(a00, a01, a10, xf, curr_yf)
+				interpolate(b00, b01, b10, xf, curr_yf)
 			);
 			x1 += x1inc;
 		}
@@ -125,8 +125,8 @@ void GLContext::gl_resizeImageNoInterpolate(Graphics::PixelBuffer &dest, int xsi
 		yi = (y1 >> FRAC_BITS) * xsize_src;
 		x1 = 0;
 		for (int x = 0; x < xsize_dest; x++) {
-			src.getARGBAt(yi + (x1 >> FRAC_BITS), r, g, b, a);
-			dest.setPixelAt(dest_offset++, r, g, b, a);
+			src.getARGBAt(yi + (x1 >> FRAC_BITS), a, r, g, b);
+			dest.setPixelAt(dest_offset++, a, r, g, b);
 			x1 += x1inc;
 		}
 		y1 += y1inc;




More information about the Scummvm-git-logs mailing list