diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-27 18:35:57 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-27 18:35:57 -0400 |
commit | 6907a45f8b99d2a076ba965d6278f27044b19af9 (patch) | |
tree | d78472aa3d8d1495b838588b1a9b236cf262402e | |
parent | 4f25fa9ae42a0d43c20e954e8e50c66a6b057c92 (diff) | |
download | wittle-6907a45f8b99d2a076ba965d6278f27044b19af9.tar.gz wittle-6907a45f8b99d2a076ba965d6278f27044b19af9.tar.bz2 wittle-6907a45f8b99d2a076ba965d6278f27044b19af9.zip |
Can write polys now
-rw-r--r-- | ext/wittle_generator/Panel.cpp | 14 | ||||
-rw-r--r-- | ext/wittle_generator/Test.cpp | 9 |
2 files changed, 17 insertions, 6 deletions
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() { | |||
159 | } else if (symbol == Decoration::Poly) { | 159 | } else if (symbol == Decoration::Poly) { |
160 | serializer.writeByte(Serializer::Poly); | 160 | serializer.writeByte(Serializer::Poly); |
161 | serializer.writeColor(val & 0xF); | 161 | serializer.writeColor(val & 0xF); |
162 | // TODO: write polyshape | 162 | |
163 | long polyshape = (val & 0xFFFF0000) >> 16; | ||
164 | if (val & Decoration::Can_Rotate) { | ||
165 | polyshape |= (1 << 20); | ||
166 | } | ||
167 | serializer.writeLong(polyshape); | ||
163 | } else if (symbol == Decoration::Negative) { | 168 | } else if (symbol == Decoration::Negative) { |
164 | serializer.writeByte(Serializer::Ylop); | 169 | serializer.writeByte(Serializer::Ylop); |
165 | serializer.writeColor(val & 0xF); | 170 | serializer.writeColor(val & 0xF); |
166 | // TODO: write polyshape | 171 | |
172 | long polyshape = (val & 0xFFFF0000) >> 16; | ||
173 | if (val & Decoration::Can_Rotate) { | ||
174 | polyshape |= (1 << 20); | ||
175 | } | ||
176 | serializer.writeLong(polyshape); | ||
167 | } else { | 177 | } else { |
168 | serializer.writeByte(Serializer::Nonce); | 178 | serializer.writeByte(Serializer::Nonce); |
169 | } | 179 | } |
diff --git a/ext/wittle_generator/Test.cpp b/ext/wittle_generator/Test.cpp index 1da6cd8..1a2597a 100644 --- a/ext/wittle_generator/Test.cpp +++ b/ext/wittle_generator/Test.cpp | |||
@@ -6,10 +6,11 @@ int main(int, char**) { | |||
6 | generator.setSymbol(Decoration::Exit, 4 * 2, 0); | 6 | generator.setSymbol(Decoration::Exit, 4 * 2, 0); |
7 | /*generator.generate(4 * 2 + 1, 4 * 2 + 1, | 7 | /*generator.generate(4 * 2 + 1, 4 * 2 + 1, |
8 | {{{Decoration::Triangle | Decoration::Orange, 6}}});*/ | 8 | {{{Decoration::Triangle | Decoration::Orange, 6}}});*/ |
9 | generator.generate(4 * 2 + 1, 4 * 2 + 1, | 9 | generator.generate( |
10 | {{{Decoration::Star | Decoration::Color::Magenta, 4}, | 10 | 4 * 2 + 1, 4 * 2 + 1, |
11 | {Decoration::Stone | Decoration::Color::Black, 4}, | 11 | {{{Decoration::Poly | Decoration::Can_Rotate | Decoration::Yellow, 1}, |
12 | {Decoration::Stone | Decoration::Color::White, 4}}}); | 12 | {Decoration::Poly | Decoration::Yellow, 1}, |
13 | {Decoration::Gap, 6}}}); | ||
13 | 14 | ||
14 | return 0; | 15 | return 0; |
15 | } | 16 | } |