changeset 1940:30fc1fa3dce7

Remove the search 'accuracy' as it is not used.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 13 Nov 2017 06:29:20 +0200
parents e525c390da03
children 97ff235f42f5
files mapsearch.c
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mapsearch.c	Mon Nov 13 05:44:18 2017 +0200
+++ b/mapsearch.c	Mon Nov 13 06:29:20 2017 +0200
@@ -76,7 +76,6 @@
     BOOL type;
     char *map, *loc1, *loc2;
     int mx, my, wx, wy;
-    int accuracy;
     BOOL centered;
 } MAPMatch;
 
@@ -777,7 +776,7 @@
 }
 
 
-int mapMatchBlock(const MapBlock *map, const MapBlock *match, const int ox, const int oy)
+BOOL mapMatchBlock(const MapBlock *map, const MapBlock *match, const int ox, const int oy)
 {
     const unsigned char
         *sp = map->data + (oy * map->scansize) + ox,
@@ -789,14 +788,14 @@
         for (int xc = 0; xc < match->width; xc++)
         {
             if (dp[xc] != 0 && dp[xc] != sp[xc])
-                return -1;
+                return FALSE;
         }
 
         sp += map->scansize;
         dp += match->scansize;
     }
 
-    return 100;
+    return TRUE;
 }
 
 
@@ -865,8 +864,7 @@
         if (match->type)
         {
             vstr = th_strdup_printf(
-                "[%d,%d,\"%s\",%d,%d,%d,%d]%s",
-                match->accuracy,
+                "[%d,\"%s\",%d,%d,%d,%d]%s",
                 match->centered,
                 match->map,
                 match->mx, match->my,
@@ -1065,8 +1063,7 @@
         for (int ox = 0; ox < info->map->width - pattern->width; ox++)
         {
             // Check for match
-            int accuracy = mapMatchBlock(info->map, pattern, ox, oy);
-            if (accuracy > 99)
+            if (mapMatchBlock(info->map, pattern, ox, oy))
             {
                 // Okay, add the match to our list
                 MAPMatch *match = &matches[nmatches++];
@@ -1077,7 +1074,6 @@
                 match->my = oy + centerY + 1;
                 match->wx = optWorldXC + info->locFile.x + ox + centerX;
                 match->wy = optWorldYC + info->locFile.y + oy + centerY;
-                match->accuracy = accuracy;
                 match->centered = centerFound;
 
                 // Check for max matches