From 6907a45f8b99d2a076ba965d6278f27044b19af9 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 27 Oct 2023 18:35:57 -0400 Subject: Can write polys now --- ext/wittle_generator/Panel.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'ext/wittle_generator/Panel.cpp') diff --git a/ext/wittle_generator/Panel.cpp b/ext/wittle_generator/Panel.cpp index 54c7283..125636f 100644 --- a/ext/wittle_generator/Panel.cpp +++ b/ext/wittle_generator/Panel.cpp @@ -159,11 +159,21 @@ std::string Panel::Write() { } else if (symbol == Decoration::Poly) { serializer.writeByte(Serializer::Poly); serializer.writeColor(val & 0xF); - // TODO: write polyshape + + long polyshape = (val & 0xFFFF0000) >> 16; + if (val & Decoration::Can_Rotate) { + polyshape |= (1 << 20); + } + serializer.writeLong(polyshape); } else if (symbol == Decoration::Negative) { serializer.writeByte(Serializer::Ylop); serializer.writeColor(val & 0xF); - // TODO: write polyshape + + long polyshape = (val & 0xFFFF0000) >> 16; + if (val & Decoration::Can_Rotate) { + polyshape |= (1 << 20); + } + serializer.writeLong(polyshape); } else { serializer.writeByte(Serializer::Nonce); } -- cgit 1.4.1