// // Created by Wouter Groeneveld on 02/08/18. // #include #include #include "wirescene.h" const unsigned short pal[4] __attribute__((aligned(4))) = { 0x0000, 0xFFFF, 0x3AE2 }; const FIXED pointZeroOne = float2fx(0.01); std::vector WireScene::meshes() { return { cube.get() }; } Camera WireScene::camera() { return Camera(VectorFx::fromInt(0, 0, 10), VectorFx::fromInt(0, 0, 0)); } void WireScene::load() { foregroundPalette = std::unique_ptr(new ForegroundPaletteManager()); backgroundPalette = std::unique_ptr(new BackgroundPaletteManager(pal, sizeof(pal))); cube = std::unique_ptr(new Mesh()); cube->add(VectorFx(-1, 1, 1)); cube->add(VectorFx(1, 1, 1)); cube->add(VectorFx(-1, -1, 1)); cube->add(VectorFx(-1, -1, -1)); cube->add(VectorFx(-1, 1, -1)); cube->add(VectorFx(1, 1, -1)); cube->add(VectorFx(1, -1, 1)); cube->add(VectorFx(-1, -1, -1)); } void WireScene::tick(u16 keys) { cube->rotate(pointZeroOne, pointZeroOne); }