aboutsummaryrefslogtreecommitdiff
path: root/sky/autoroute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sky/autoroute.cpp')
-rw-r--r--sky/autoroute.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/sky/autoroute.cpp b/sky/autoroute.cpp
index 73e64576e2..0e79092cf2 100644
--- a/sky/autoroute.cpp
+++ b/sky/autoroute.cpp
@@ -106,12 +106,6 @@ uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 **pSaveRoute) {
// next_stretch:
routeCalc--;
bitsLeft--;
- if (!bitsLeft) {
- gridData = screenGrid[0] | (screenGrid[1] << 8) |
- (screenGrid[2] << 16) | (screenGrid[3] << 24);
- screenGrid -= 4;
- bitsLeft = 32;
- }
// still bits:
gridCntX--;
if (gridCntX == 0) {
@@ -122,6 +116,12 @@ uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 **pSaveRoute) {
stretch1 = 0; // clear stretch factor
gridCntY--;
}
+ if (gridCntY && (!bitsLeft)) {
+ gridData = screenGrid[0] | (screenGrid[1] << 8) |
+ (screenGrid[2] << 16) | (screenGrid[3] << 24);
+ screenGrid -= 4;
+ bitsLeft = 32;
+ }
} while(gridCntY);
for (cnt = 0; cnt < ROUTE_GRID_WIDTH - 1; cnt++)
_routeGrid[cnt] = 0; // clear top line (right hand edge already done