diff options
Diffstat (limited to 'ext/wittle_generator')
| -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 | } |
