diff options
Diffstat (limited to 'Source/PuzzleSerializer.cpp')
-rw-r--r-- | Source/PuzzleSerializer.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/Source/PuzzleSerializer.cpp b/Source/PuzzleSerializer.cpp index 7461f7b..33f6da6 100644 --- a/Source/PuzzleSerializer.cpp +++ b/Source/PuzzleSerializer.cpp | |||
@@ -1,6 +1,6 @@ | |||
1 | #include "pch.h" | ||
1 | #include "PuzzleSerializer.h" | 2 | #include "PuzzleSerializer.h" |
2 | #include "Memory.h" | 3 | #include "Memory.h" |
3 | #include <cassert> | ||
4 | 4 | ||
5 | #pragma warning (disable:26451) | 5 | #pragma warning (disable:26451) |
6 | #pragma warning (disable:26812) | 6 | #pragma warning (disable:26812) |
@@ -65,16 +65,6 @@ void PuzzleSerializer::WritePuzzle(const Puzzle& p, int id) { | |||
65 | WriteSequence(p, id); | 65 | WriteSequence(p, id); |
66 | WriteSymmetry(p, id); | 66 | WriteSymmetry(p, id); |
67 | 67 | ||
68 | #ifndef NDEBUG | ||
69 | int maxDots = _memory->ReadEntityData<int>(id, NUM_DOTS, 1)[0]; | ||
70 | assert(_intersectionFlags.size() <= maxDots); | ||
71 | assert(_intersectionLocations.size() <= maxDots*2); | ||
72 | |||
73 | int maxConnections = _memory->ReadEntityData<int>(id, NUM_CONNECTIONS, 1)[0]; | ||
74 | assert(_connectionsA.size() <= maxConnections); | ||
75 | assert(_connectionsB.size() <= maxConnections); | ||
76 | #endif | ||
77 | |||
78 | _memory->WriteEntityData<int>(id, GRID_SIZE_X, {(p.width + 1)/2}); | 68 | _memory->WriteEntityData<int>(id, GRID_SIZE_X, {(p.width + 1)/2}); |
79 | _memory->WriteEntityData<int>(id, GRID_SIZE_Y, {(p.height + 1)/2}); | 69 | _memory->WriteEntityData<int>(id, GRID_SIZE_Y, {(p.height + 1)/2}); |
80 | _memory->WriteEntityData<int>(id, NUM_DOTS, {static_cast<int>(_intersectionFlags.size())}); | 70 | _memory->WriteEntityData<int>(id, NUM_DOTS, {static_cast<int>(_intersectionFlags.size())}); |
@@ -455,10 +445,6 @@ void PuzzleSerializer::WriteDecorations(const Puzzle& p, int id) { | |||
455 | } | 445 | } |
456 | } | 446 | } |
457 | 447 | ||
458 | #ifndef NDEBUG | ||
459 | int maxDecorations = _memory->ReadEntityData<int>(id, NUM_DECORATIONS, 1)[0]; | ||
460 | assert(decorations.size() < maxDecorations); | ||
461 | #endif | ||
462 | _memory->WriteEntityData<int>(id, NUM_DECORATIONS, {static_cast<int>(decorations.size())}); | 448 | _memory->WriteEntityData<int>(id, NUM_DECORATIONS, {static_cast<int>(decorations.size())}); |
463 | _memory->WriteArray<int>(id, DECORATIONS, decorations); | 449 | _memory->WriteArray<int>(id, DECORATIONS, decorations); |
464 | } | 450 | } |