From 953ffe21486717a6027047f5af57fa2abfb7037d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 29 Sep 2018 18:43:53 +0200 Subject: [PATCH] Add outer space view --- demo2.cpp | 276 ++++++++++++++++++++++++++++++++++++++++++++++++++-- general.hpp | 7 +- 2 files changed, 275 insertions(+), 8 deletions(-) diff --git a/demo2.cpp b/demo2.cpp index fa1e936..d953eee 100644 --- a/demo2.cpp +++ b/demo2.cpp @@ -593,6 +593,84 @@ const unsigned char texture6[] = ,0xb1,0xb1 }; +const unsigned char texture7[] = +{ 32, 32 // width, height + ,0x11,0x02,0x21,0x10,0x21,0x02,0x12,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x53,0x53,0x03,0x03,0x53,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x03,0x03,0x45,0x03,0x11,0x02,0x21,0x10,0x21,0x02,0x03,0x03,0x34,0x44 + ,0x44,0x44,0x44,0x44,0x54,0x54,0x43,0x43,0x54,0x44,0x44,0x44,0x44,0x44 + ,0x44,0x44,0x44,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x10,0x21,0x02 + ,0x03,0x03,0x34,0x04,0x44,0x44,0x44,0x04,0x53,0x53,0x43,0x43,0x54,0x44 + ,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x43,0x43,0x03,0x45,0x03,0x11,0x02 + ,0x21,0x10,0x21,0x02,0x12,0x03,0x03,0x03,0x03,0x03,0x03,0x11,0x11,0x11 + ,0x11,0x11,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x45,0x44,0x43,0x43,0x03 + ,0x45,0x03,0x11,0x02,0x21,0x10,0x21,0x02,0x03,0x44,0x44,0x44,0x44,0x44 + ,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x03 + ,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x83,0x21,0x02,0x54,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x10 + ,0x21,0x02,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03 + ,0x11,0x02,0x21,0x10,0x21,0x02,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43 + ,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x02,0x54,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x83,0x02,0x12 + ,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02 + ,0x21,0x01,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03 + ,0x45,0x03,0x11,0x12,0x21,0x01,0x11,0x03,0x54,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03 + ,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12,0x54,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x83 + ,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03 + ,0x11,0x02,0x21,0x01,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43 + ,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12,0x54,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x12,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12 + ,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02 + ,0x21,0x83,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03 + ,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03 + ,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12,0x54,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01 + ,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03 + ,0x11,0x02,0x21,0x83,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43 + ,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12,0x54,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12 + ,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02 + ,0x21,0x01,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03 + ,0x45,0x03,0x11,0x02,0x21,0x83,0x11,0x12,0x54,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x03 + ,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x12,0x21,0x01,0x11,0x12,0x54,0x0f + ,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f + ,0x0f,0x0f,0x0f,0x03,0x45,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01 + ,0x11,0x12,0x03,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44 + ,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x03,0x45,0x43,0x43,0x03,0x45,0x03 + ,0x11,0x02,0x21,0x01,0x11,0x12,0x12,0x03,0x03,0x03,0x03,0x03,0x03,0x02 + ,0x11,0x11,0x11,0x11,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x45,0x44,0x43 + ,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12,0x03,0x34,0x44,0x44 + ,0x44,0x44,0x45,0x44,0x53,0x53,0x44,0x44,0x43,0x45,0x44,0x44,0x44,0x44 + ,0x44,0x44,0x44,0x43,0x43,0x03,0x45,0x03,0x11,0x02,0x21,0x01,0x11,0x12 + ,0x03,0x34,0x44,0x44,0x44,0x44,0x44,0x44,0x54,0x54,0x44,0x44,0x54,0x44 + ,0x45,0x44,0x44,0x44,0x44,0x44,0x44,0x43,0x43,0x03,0x45,0x03,0x11,0x02 + ,0x21,0x01,0x11,0x02,0x03,0x03,0x34,0x34,0x34,0x34,0x34,0x34,0x53,0x53 + ,0x43,0x43,0x53,0x34,0x34,0x34,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x45,0x03 +}; + const unsigned char imageBar[] = { 110, 21 // width, height ,0x00,0x0d,0x0b,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a @@ -840,10 +918,187 @@ const unsigned char spritePlasma[] = ,0x55,0x8f }; -#define TEXTURES 6 +const unsigned char imageSpace[] = +{ 55, 44 // width, height + ,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x14,0x00,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 + ,0xe1,0xe1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0x00,0x12,0x04,0x12,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 + ,0x82,0xe1,0xe1,0xe1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0x12,0x04,0x1f,0x04 + ,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x12 + ,0x04,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01 + ,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0x02,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1 + ,0xd0,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01 + ,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00 + ,0x00,0x00,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0x02,0x02,0xd1,0xb3,0xb3,0xd1 + ,0xd1,0xd1,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0xe1,0xe1,0xe1,0x02,0x02,0xd1,0xb3 + ,0xb3,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x27,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0xe1,0x02,0x02,0x02 + ,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02 + ,0x02,0x07,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00 + ,0x02,0x02,0x02,0x0c,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03 + ,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x00,0x01,0x02,0x02,0x07,0x0a,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0 + ,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x03,0x03 + ,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03 + ,0x03,0x03,0x03,0x03,0x02,0x02,0x0c,0x0a,0xd0,0xd1,0xd1,0xd1,0xd1,0xd1 + ,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01 + ,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x03,0x03 + ,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x0c,0x0a,0xd0,0xd1,0xd1,0xd1 + ,0xd1,0xd1,0xd0,0xd0,0xd0,0x00,0x00,0x01,0x00,0x00,0x01,0x01,0x01,0x01 + ,0x01,0x01,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00 + ,0x03,0x00,0x00,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x0a,0xd0,0xd0 + ,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x01,0x01,0x00,0x01,0x00,0x00,0x01,0x01 + ,0x02,0x01,0x01,0x01,0x00,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00 + ,0x00,0x14,0x0f,0x14,0x00,0x00,0x00,0x00,0x03,0x03,0x03,0x03,0x03,0x03 + ,0xd0,0xd0,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0xd0,0x01,0x01,0x01,0x00,0x01 + ,0x01,0x01,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x03,0x03,0x03,0x03,0x03 + ,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x02,0x03,0x03,0x03 + ,0x03,0x03,0xd0,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0xd0,0x01,0x01 + ,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x03,0x03 + ,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02 + ,0x0c,0x03,0x03,0x03,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0xd0 + ,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x82,0x82 + ,0x00,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01 + ,0x02,0x02,0x0d,0x0c,0x09,0x03,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0 + ,0xd0,0xd0,0xd0,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00 + ,0x82,0x82,0x00,0x00,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x01,0x02,0x02,0x0d,0x0a,0x09,0x09,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1 + ,0xd1,0xd0,0xd0,0xd0,0xd0,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x00 + ,0x00,0x00,0x00,0x02,0x02,0x02,0x0d,0x0a,0x09,0x09,0x22,0x27,0x22,0xd1 + ,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01 + ,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x03,0x03 + ,0x03,0x03,0x00,0x00,0x00,0x02,0x02,0x07,0x0c,0x0a,0x09,0x08,0x27,0x1f + ,0x27,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x01,0x01,0x01,0x01,0x02,0x02 + ,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x0d,0x0d + ,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x02,0x02,0x0c,0x0c,0x09,0x09,0x08 + ,0x22,0x27,0x22,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0x00,0x00,0x01,0x01,0x01 + ,0x01,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x0a + ,0x08,0x08,0x0a,0x03,0x03,0x03,0x03,0x03,0x00,0x02,0x02,0x0d,0x0c,0x09 + ,0x09,0x09,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x00,0x00 + ,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x0d,0x08,0x08,0x08,0x05,0x00,0x00,0x03,0x03,0x03,0x03,0x02,0x02,0x0d + ,0x0a,0x09,0x09,0x0c,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0xd0,0x00 + ,0x00,0x00,0x00,0x01,0xc2,0x01,0x01,0x02,0x01,0x01,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x0a,0x08,0x08,0x05,0x05,0x00,0x00,0x00,0x03,0x03,0x03,0x02 + ,0x02,0x0d,0x0a,0x09,0x09,0x08,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0xd0 + ,0xd0,0x00,0x00,0x00,0x00,0xc2,0x28,0xc2,0x01,0x02,0x01,0x01,0x01,0xd0 + ,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x03,0x02,0x02,0x0d,0x0a,0x09,0x09,0x08,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0 + ,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0xc2,0x01,0x01,0x02,0x02,0x01 + ,0x01,0xd0,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x02,0x02,0x0c,0x0a,0x09,0x0a,0x08,0xd1,0xd1,0xd1,0xd1 + ,0xd1,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02 + ,0x02,0x01,0x01,0xd0,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x01,0x14,0x01,0x00 + ,0x00,0x31,0x00,0x00,0x00,0x02,0x02,0x0c,0x0a,0x09,0x0c,0x08,0xd1,0xd1 + ,0xd1,0xd1,0xd1,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01 + ,0x01,0x02,0x02,0x01,0x01,0x01,0xd0,0xd0,0x31,0xd0,0xd0,0x00,0x00,0x01 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x0a,0x0a,0x09,0x0c,0x08 + ,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x0a,0x0a,0x0c + ,0x0a,0x08,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x01,0x02,0x02,0x01,0x01,0x01,0xd0,0xd0,0xd1,0xd1 + ,0xd1,0xd0,0xd0,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x0c + ,0x0a,0x0a,0x08,0x08,0xd1,0xd1,0xd1,0xd0,0xd0,0xd0,0xb3,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x82,0x00,0x00,0x01,0x02,0x02,0x01,0x01,0xd0,0xd0,0xd1 + ,0xd1,0xd1,0xd1,0xd1,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02 + ,0x02,0x0c,0x0a,0x09,0x08,0x08,0xd1,0xd1,0xd0,0xd0,0xd0,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x02,0x01,0x01,0xd0 + ,0xd0,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd0,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x02,0x02,0x0c,0x0a,0x09,0x09,0x08,0xd0,0xd0,0xd0,0xd0,0xd0,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x01,0x01 + ,0xd0,0xd0,0xd0,0xd0,0xd1,0xd1,0x11,0xd1,0xd1,0xd1,0xd1,0xd1,0x00,0x00 + ,0x00,0x00,0x00,0x02,0x02,0x07,0x0a,0x09,0x09,0x09,0xd0,0xd0,0xd0,0xd0 + ,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x02 + ,0x01,0x01,0xd0,0xd0,0xd0,0xd0,0xd0,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1 + ,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x0a,0x09,0x09,0x08,0xd0,0xd0 + ,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01 + ,0x02,0x01,0x01,0x01,0xd0,0xd0,0xd0,0xd0,0xd0,0xd1,0xd1,0xd1,0xd1,0xd1 + ,0xd1,0xd1,0xd1,0x00,0x00,0x00,0x00,0x01,0x02,0x02,0x0a,0x09,0x08,0x08 + ,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x01,0x01,0x01,0x01,0x01,0xd0,0xd0,0xd0,0x00,0x00,0xd0,0xd0,0xd1,0xd1 + ,0xd1,0xd1,0xd1,0xd1,0xd1,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x0c,0x0a + ,0x09,0x08,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0xd1,0xd1,0xd1,0xd1,0xd1,0xd1,0x00,0x00,0x00,0x00,0x00,0x02,0x02 + ,0x0c,0x0a,0x09,0x0c,0x00,0x00,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0xc6 + ,0xc6,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0xd1,0xd1,0x11,0xd1,0xd1,0xd1,0x00,0x00,0x00,0x00,0x00 + ,0x02,0x02,0x07,0x0a,0x09,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0xc6,0xc6,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00 + ,0x00,0x00,0x00,0xc2,0xc6,0xc2,0xd1,0xd1,0xd1,0x00,0x00,0x00,0x00,0x00 + ,0xf0,0x00,0x01,0x02,0x02,0x0a,0x09,0x09,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x01,0x31,0x01,0x00 + ,0x00,0x00,0x00,0x00,0x00,0xc6,0x0f,0xc6,0xd1,0xd1,0x00,0x00,0x00,0x00 + ,0x00,0x00,0xf0,0x00,0x00,0x02,0x02,0x0a,0x0a,0x09,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x31,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x01,0x01 + ,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc2,0xc6,0xc2,0x00,0x00,0x00,0x00 + ,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0x02,0x02,0x07,0x0a,0x09,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02 + ,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0 + ,0xf0,0xf0,0xf0,0x82,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0x02,0x02,0x0a,0x09 + ,0x00,0x00,0x00,0x00,0x00,0xb3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01 + ,0x01,0x01,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xe1,0xe1,0xf0,0xf0,0xf0,0x02,0x02 + ,0x07,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x01,0x01,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0xf0,0xf0,0xf0,0xf0,0xe1,0xe1,0xe1,0xe1,0xe1,0xf0,0xf0 + ,0x01,0x02,0x02,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x01,0x01,0x14,0x02,0x01,0x01,0x00,0x00,0x00,0x00 + ,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 + ,0xe1,0xf0,0xf0,0x02,0x02,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x31,0x00,0x01,0x01,0x1f,0x02,0x01,0x01,0x00,0x00 + ,0x00,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0xf0,0xf0,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x14,0x02,0x01,0x01 + ,0x00,0x00,0x00,0x00,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xe1,0xe1,0xe1,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xf0,0xf0,0x02,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01 + ,0x02,0x01,0x00,0x00,0x00,0x00,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xe1,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x01,0x01,0x02,0x01,0x00,0x00,0x00,0xf0,0xf0,0xf0,0xc3,0xf0,0xf0,0xf0 + ,0xf0,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x01,0x02,0x01,0x00,0x00,0x00,0xf0,0xf0,0xc3,0x1f,0xc3 + ,0xf0,0xf0,0xf0,0xf0,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 + ,0xe1,0xe1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x01,0x00,0x00,0x00,0xf0,0xf0,0xf0 + ,0xc3,0xf0,0xf0,0xf0,0x00,0xf0,0xf0,0xf0,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00 + ,0x00,0xf0,0xf0,0xf0,0xf0,0x00,0x00,0x00,0x00,0xf0,0xe1,0xe1,0xe1,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0x82,0xe1,0xd0,0xd0,0x00,0x82,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x23,0x0f,0x23,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1 + ,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xd0,0xd0,0xd0,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x01,0x01,0x01 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xd1,0xd1,0xd0,0xd0 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01 + ,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1 +}; + +#define TEXTURES 7 const unsigned char *textures[TEXTURES] = - {texture1, texture2, texture3, texture4, texture5, texture6}; + {texture1, texture2, texture3, texture4, texture5, texture6, texture7}; unsigned char textureAverageColors[TEXTURES]; @@ -874,7 +1129,7 @@ RCL_Unit collisionAt(int16_t x, int16_t y) RCL_Unit textureAt(int16_t x, int16_t y) { - RCL_Unit t = 0; + RCL_Unit t = 6; if (x >= 0 && x < LEVEL_X_RES && y >= 0 && y < LEVEL_Y_RES) t = max(level[(LEVEL_Y_RES - y -1) * LEVEL_X_RES + x] - 1,0); @@ -962,11 +1217,12 @@ inline void pixelFunc(RCL_PixelInfo *pixel) color = addIntensity(color,intensity); #endif - mirror++; } else { + // wall + RCL_Unit textureScroll = pixel->hit.type != 4 ? 0 : 16 * pokitto.frameCount; #ifdef NO_TEXTURES @@ -977,12 +1233,18 @@ inline void pixelFunc(RCL_PixelInfo *pixel) textureAverageColors[pixel->hit.type]; #endif + if (color == 15) + { + // replace white color with view to the outer space + color = imageSpace[2 + ((pixel->position.x / 2 + player.mCamera.direction / 8) % imageSpace[0]) * imageSpace[1] + + (pixel->position.y / 2 + 8)]; + } #ifndef NO_SHADING /* NOTE: to gain a lot of performance, it's best to have precomputed color color gradients and look the colors up as opposed to calling addIntensity(...), but for the sake of simplicity we don't do it here. */ - if (previousColumn == pixel->position.x) + else if (previousColumn == pixel->position.x) { color = addIntensity(color,pixelIntensity); } @@ -1070,12 +1332,12 @@ int main() defaultConstraints.maxSteps = 20; for (uint8_t i = 0; i < TEXTURES; ++i) - textureAverageColors[i] = computeAverageColor(textures[i]); + textureAverageColors[i] = computeAverageColor(textures[i],i == 6 ? 15 : -1); cFloor = 10; cCeiling = 10; - player.setPositionSquare(9,1); + player.setPositionSquare(7,15); player.mCamera.height = RCL_CAMERA_COLL_HEIGHT_BELOW; player.mCamera.resolution.y = RESOLUTION_Y; diff --git a/general.hpp b/general.hpp index 2034a2c..3731171 100644 --- a/general.hpp +++ b/general.hpp @@ -456,7 +456,7 @@ void initGeneral() /** Computes an average color of given texture. */ -unsigned char computeAverageColor(const unsigned char *texture) +unsigned char computeAverageColor(const unsigned char *texture, int16_t excludeColor=-1) { uint8_t h,s,v; uint32_t sumH = 0; @@ -466,6 +466,11 @@ unsigned char computeAverageColor(const unsigned char *texture) for (uint16_t i = 0; i < pixels; ++i) { + uint8_t color = texture[2 + i]; + + if (color == excludeColor) + continue; + decodeHSV(texture[2 + i],&h,&s,&v); sumH += h;