Changeset - 6d98e459cb93
[Not reviewed]
default
0 1 0
Jason Maltzen - 5 years ago 2019-11-02 13:07:31
jason@hiddenachievement.com
Fix a bad y offset computation when scanning for the paint bench.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
ReactionRecorder.cs
Show inline comments
...
 
@@ -304,25 +304,25 @@ namespace DesertPaintLab
 

	
 
        unsafe private bool IsPossibleSwatchUpperLeft(byte* pixBytes, int x, int y, int stride)
 
        {
 
            int testPixelStart = (y * stride) + (x * 3);
 

	
 
            if (testPixelStart < stride)
 
            {
 
                return false;
 
            }
 

	
 
            bool result = true;
 

	
 
            int solidUpperLeft = testPixelStart + (2 * y * stride) + (2 * x * 3);
 
            int solidUpperLeft = testPixelStart + ((y+2) * stride) + ((x+2) * 3);
 
            int solidLowerLeft = testPixelStart + ((swatchHeight - 4) * stride);
 
            int solidUpperRight = testPixelStart + ((swatchWidth - 4) * 3);
 
            int solidLowerRight = solidLowerLeft + ((swatchWidth - 4) * 3);
 
            byte swatch_r = pixBytes[solidUpperLeft];
 
            byte swatch_g = pixBytes[solidUpperLeft + 1];
 
            byte swatch_b = pixBytes[solidUpperLeft + 2];
 

	
 
            // Check the other 3 corners of the swatch size for color match
 
            result &= IsColorMatch(swatch_r, swatch_r, swatch_r, pixBytes[solidUpperRight], pixBytes[solidUpperRight + 1], pixBytes[solidUpperRight + 2]);
 
            result &= IsColorMatch(swatch_r, swatch_r, swatch_r, pixBytes[solidLowerLeft], pixBytes[solidLowerLeft + 1], pixBytes[solidLowerLeft + 2]);
 
            result &= IsColorMatch(swatch_r, swatch_r, swatch_r, pixBytes[solidLowerRight], pixBytes[solidLowerRight + 1], pixBytes[solidLowerRight + 2]);
 

	
0 comments (0 inline, 0 general)