Changeset - 2154d10fecad
[Not reviewed]
default
0 3 0
Jason Maltzen - 5 years ago 2019-11-02 13:25:48
jason@hiddenachievement.com
Fix another bug in scanning where it was scanning off the right side of the image.
3 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
DesertPaintLab.csproj
Show inline comments
...
 
@@ -11,33 +11,33 @@
 
    <IsWebBootstrapper>false</IsWebBootstrapper>
 
    <PublishUrl>publish\</PublishUrl>
 
    <Install>true</Install>
 
    <InstallFrom>Disk</InstallFrom>
 
    <UpdateEnabled>false</UpdateEnabled>
 
    <UpdateMode>Foreground</UpdateMode>
 
    <UpdateInterval>7</UpdateInterval>
 
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
 
    <UpdatePeriodically>false</UpdatePeriodically>
 
    <UpdateRequired>false</UpdateRequired>
 
    <MapFileExtensions>true</MapFileExtensions>
 
    <AutorunEnabled>true</AutorunEnabled>
 
    <ApplicationRevision>0</ApplicationRevision>
 
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
 
    <UseApplicationTrust>false</UseApplicationTrust>
 
    <BootstrapperEnabled>true</BootstrapperEnabled>
 
    <ReleaseVersion>9.0.3</ReleaseVersion>
 
    <ReleaseVersion>9.0.4</ReleaseVersion>
 
  </PropertyGroup>
 
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
 
    <DebugSymbols>true</DebugSymbols>
 
    <DebugType>full</DebugType>
 
    <Optimize>false</Optimize>
 
    <OutputPath>bin\x86\Debug</OutputPath>
 
    <DefineConstants>DEBUG</DefineConstants>
 
    <ErrorReport>prompt</ErrorReport>
 
    <WarningLevel>4</WarningLevel>
 
    <PlatformTarget>x86</PlatformTarget>
 
    <ConsolePause>false</ConsolePause>
 
    <additionalargs>/unsafe</additionalargs>
 
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
 
  </PropertyGroup>
 
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
 
    <DebugType>none</DebugType>
DesertPaintLab.sln
Show inline comments
...
 
@@ -28,19 +28,19 @@ Global
 
	GlobalSection(MonoDevelopProperties) = preSolution
 
		Policies = $0
 
		$0.DotNetNamingPolicy = $1
 
		$1.DirectoryNamespaceAssociation = PrefixedHierarchical
 
		$0.TextStylePolicy = $2
 
		$2.inheritsSet = null
 
		$2.scope = text/x-csharp
 
		$0.CSharpFormattingPolicy = $3
 
		$3.scope = text/x-csharp
 
		$0.TextStylePolicy = $4
 
		$4.FileWidth = 80
 
		$4.TabsToSpaces = True
 
		$4.scope = text/plain
 
		$0.StandardHeader = $5
 
		$0.VersionControlPolicy = $6
 
		description = Desert Paint Lab utility for A Tale in the Desert
 
		version = 9.0.3
 
		version = 9.0.4
 
	EndGlobalSection
 
EndGlobal
ReactionRecorder.cs
Show inline comments
...
 
@@ -323,33 +323,33 @@ namespace DesertPaintLab
 

	
 
            // 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]);
 

	
 
            if (!result)
 
            {
 
                return false;
 
            }
 

	
 
            // scan down the right and left sides
 
            for (int yOff = 1; yOff < (swatchHeight - 5); ++yOff)
 
            {
 
                int testPixel = solidUpperLeft + (yOff * stride);
 
                result &= IsColorMatch(swatch_r, swatch_r, swatch_r, pixBytes[testPixel], pixBytes[testPixel + 1], pixBytes[testPixel + 2]);
 
                testPixel += ((swatchWidth - 1) * (x + 3));
 
                testPixel += ((swatchWidth - 1) * 3);
 
                result &= IsColorMatch(swatch_r, swatch_r, swatch_r, pixBytes[testPixel], pixBytes[testPixel + 1], pixBytes[testPixel + 2]);
 
            }
 

	
 
            if (!result)
 
            {
 
                WriteLog("Failed to find left edge for potential swatch of color {2}, {3}, {4} at {0}, {1}", x, y, swatch_r, swatch_g, swatch_b);
 
                return false;
 
            }
 

	
 
            // test the left edge for dark pixels
 
            int i = 0;
 
            for (i = 0; result && (i < swatchHeight-pixelMultiplier); ++i)
 
            {
 
                int otherPixelStart = testPixelStart + (stride * i);
 
                result &= IsDarkPixel(pixBytes[otherPixelStart], pixBytes[otherPixelStart+1], pixBytes[otherPixelStart+2]);
 
            }
0 comments (0 inline, 0 general)