// // Created by Wouter Groeneveld on 11/07/20. // #include #include "monkey.h" // BLACK, [white->black] from 0xFFFF / 252 const unsigned short pal[253] __attribute__((aligned(4))) = { 0x0000, 65535,32767,21845,16383,13107,10922,9362,8191,7281,6553,5957,5461,5041,4681,4369,4095,3855,3640,3449,3276,3120,2978,2849,2730,2621,2520,2427,2340,2259,2184,2114,2047,1985,1927,1872,1820,1771,1724,1680,1638,1598,1560,1524,1489,1456,1424,1394,1365,1337,1310,1285,1260,1236,1213,1191,1170,1149,1129,1110,1092,1074,1057,1040,1023,1008,992,978,963,949,936,923,910,897,885,873,862,851,840,829,819,809,799,789,780,771,762,753,744,736,728,720,712,704,697,689,682,675,668,661,655,648,642,636,630,624,618,612,606,601,595,590,585,579,574,569,564,560,555,550,546,541,537,532,528,524,520,516,511,508,504,500,496,492,489,485,481,478,474,471,468,464,461,458,455,451,448,445,442,439,436,434,431,428,425,422,420,417,414,412,409,407,404,402,399,397,394,392,390,387,385,383,381,378,376,374,372,370,368,366,364,362,360,358,356,354,352,350,348,346,344,343,341,339,337,336,334,332,330,329,327,326,324,322,321,319,318,316,315,313,312,310,309,307,306,304,303,302,300,299,297,296,295,293,292,291,289,288,287,286,284,283,282,281,280,278,277,276,275,274,273,271,270,269,268,267,266,265,264,263,262,261,260 }; std::vector MonkeyScene::meshes() { return { monkey.get() }; } Camera MonkeyScene::camera() { return Camera(VectorFx::fromInt(0, 0, 10), VectorFx::fromInt(0, 0, 0)); } void MonkeyScene::load() { foregroundPalette = std::unique_ptr(new ForegroundPaletteManager()); backgroundPalette = std::unique_ptr(new BackgroundPaletteManager(pal, sizeof(pal))); monkey = std::unique_ptr(createMesh()); } void MonkeyScene::tick(u16 keys) { monkey->rotate(10, 10); }