changeset 33:333832a6ee5e

Some (commented-out) debug
author Chris Cannam
date Thu, 13 Nov 2014 07:45:01 +0000
parents 37c0b59fd514
children 930cf86113b7 a43b53d32735
files Finder.cpp
diffstat 1 files changed, 22 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Finder.cpp	Fri Oct 31 16:36:19 2014 +0000
+++ b/Finder.cpp	Thu Nov 13 07:45:01 2014 +0000
@@ -257,16 +257,33 @@
 
     while (find(y, x) && ((x > 0) || (y > 0))) {
 
+//        cerr << "x = " << x << ", y = " << y;
+        
         pathx.push_back(x);
         pathy.push_back(y);
 
         switch (getDistance() & ADVANCE_BOTH) {
-        case ADVANCE_THIS:  y--; break;
-        case ADVANCE_OTHER: x--; break;
-        case ADVANCE_BOTH:  x--; y--; break;
+        case ADVANCE_THIS:
+//            cerr << ", going down (dist = " << (int)getDistance() << ")" << endl;
+            y--;
+            break;
+        case ADVANCE_OTHER:
+//            cerr << ", going left (dist = " << (int)getDistance() << ")" << endl;
+            x--;
+            break;
+        case ADVANCE_BOTH:
+//            cerr << ", going diag (dist = " << (int)getDistance() << ")" << endl;
+            x--;
+            y--;
+            break;
         default: // this would indicate a bug, but we wouldn't want to hang
-            cerr << "WARNING: Neither matcher advanced in path backtrack at (" << x << "," << y << ")" << endl;
-            if (x > y) x--; else y--; break;
+//            cerr << "WARNING: Neither matcher advanced in path backtrack at (" << x << "," << y << ")" << endl;
+            if (x > y) {
+                x--;
+            } else {
+                y--;
+            }
+            break;
         }
     }