From cfc41eb3ccc99b92220115b0710fb821525e1075 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 28 Oct 2023 16:38:07 -0400 Subject: generating a lot of puzzles --- ext/wittle_generator/Panel.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'ext/wittle_generator/Panel.cpp') diff --git a/ext/wittle_generator/Panel.cpp b/ext/wittle_generator/Panel.cpp index 4bf4be7..892d4cc 100644 --- a/ext/wittle_generator/Panel.cpp +++ b/ext/wittle_generator/Panel.cpp @@ -157,16 +157,11 @@ std::string Panel::Write() { serializer.writeByte(Serializer::Nega); serializer.writeColor(val & 0xF); } else if (symbol == Decoration::Poly) { - serializer.writeByte(Serializer::Poly); - serializer.writeColor(val & 0xF); - - long polyshape = (val & 0xFFFF0000) >> 16; - if (val & Decoration::Can_Rotate) { - polyshape |= (1 << 20); + if (val & Decoration::Negative) { + serializer.writeByte(Serializer::Ylop); + } else { + serializer.writeByte(Serializer::Poly); } - serializer.writeLong(polyshape); - } else if (symbol == Decoration::Negative) { - serializer.writeByte(Serializer::Ylop); serializer.writeColor(val & 0xF); long polyshape = (val & 0xFFFF0000) >> 16; @@ -194,7 +189,9 @@ std::string Panel::Write() { } else { serializer.writeByte(Serializer::DotNone); } - if (val & Decoration::Gap) { + if (val == OPEN) { + serializer.writeByte(Serializer::GapFull); + } else if (val & Decoration::Gap) { serializer.writeByte(Serializer::GapBreak); } else { serializer.writeByte(Serializer::GapNone); -- cgit 1.4.1