about summary refs log tree commit diff stats
path: root/Source/PuzzleSerializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/PuzzleSerializer.cpp')
-rw-r--r--Source/PuzzleSerializer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/PuzzleSerializer.cpp b/Source/PuzzleSerializer.cpp index da7a336..8165fe8 100644 --- a/Source/PuzzleSerializer.cpp +++ b/Source/PuzzleSerializer.cpp
@@ -157,17 +157,20 @@ void PuzzleSerializer::ReadExtras(Puzzle& p) {
157 // Note that Y coordinates are reversed: 0.0 (bottom) 1.0 (top) 157 // Note that Y coordinates are reversed: 0.0 (bottom) 1.0 (top)
158 else if (y1 < y2) p.grid[x][y].end = Cell::Dir::DOWN; 158 else if (y1 < y2) p.grid[x][y].end = Cell::Dir::DOWN;
159 else if (y1 > y2) p.grid[x][y].end = Cell::Dir::UP; 159 else if (y1 > y2) p.grid[x][y].end = Cell::Dir::UP;
160 else assert(false);
160 } else if (_intersectionFlags[i] & Flags::HAS_DOT) { 161 } else if (_intersectionFlags[i] & Flags::HAS_DOT) {
161 if (x1 < x2) x--; 162 if (x1 < x2) x--;
162 else if (x1 > x2) x++; 163 else if (x1 > x2) x++;
163 else if (y1 < y2) y++; 164 else if (y1 < y2) y++;
164 else if (y1 > y2) y--; 165 else if (y1 > y2) y--;
166 else assert(false);
165 p.grid[x][y].dot = FlagsToDot(_intersectionFlags[i]); 167 p.grid[x][y].dot = FlagsToDot(_intersectionFlags[i]);
166 } else if (_intersectionFlags[i] & Flags::HAS_ONE_CONN) { 168 } else if (_intersectionFlags[i] & Flags::HAS_ONE_CONN) {
167 if (x1 < x2) x--; 169 if (x1 < x2) x--;
168 else if (x1 > x2) x++; 170 else if (x1 > x2) x++;
169 else if (y1 < y2) y++; 171 else if (y1 < y2) y++;
170 else if (y1 > y2) y--; 172 else if (y1 > y2) y--;
173 else assert(false);
171 p.grid[x][y].gap = Cell::Gap::BREAK; 174 p.grid[x][y].gap = Cell::Gap::BREAK;
172 gapLocations[i] = Pos{x, y}; 175 gapLocations[i] = Pos{x, y};
173 } 176 }