Ver código fonte

Format sauces

Streetwalrus Einstein 10 anos atrás
pai
commit
0bafdcbea5

+ 1 - 1
.clang-format

@@ -20,7 +20,7 @@ BreakBeforeTernaryOperators: false
 BreakConstructorInitializersBeforeComma: false
 BinPackParameters: true
 BinPackArguments: true
-ColumnLimit:     0
+ColumnLimit:     90
 ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerIndentWidth: 4
 DerivePointerAlignment: false

+ 6 - 3
include/Camera.h

@@ -11,10 +11,12 @@ namespace WalrusRPG
         // So, how will track camera's position? Top left or center?
         signed x; // You'll probably want to switch over signed coordonates.
         signed y;
-        unsigned render_area_width; // What if you only want to display the map on a part of the screen?
+        unsigned render_area_width; // What if you only want to display the map on a part
+                                    // of the screen?
         unsigned render_area_height;
 
-        // Do you want to use classes for coordinates and allow them to have vector-based mathematics? With operator overriding that could be doable to have
+        // Do you want to use classes for coordinates and allow them to have vector-based
+        // mathematics? With operator overriding that could be doable to have
         // Vector2 a(3, 2); Vector2 b(1, 2); Vector3 c = a+b;
         // Vector2 destination;
         // Vector2 velocity;
@@ -23,7 +25,8 @@ namespace WalrusRPG
       public:
         Camera(signed x, signed y);
         ~Camera();
-        // This doesn't need any render as it's the utility which helps rendering. Unless you want to show debnug things.
+        // This doesn't need any render as it's the utility which helps rendering. Unless
+        // you want to show debnug things.
         // void render(float dt) const;
         void update(unsigned dt);
 

+ 7 - 5
include/Entity.h

@@ -9,10 +9,11 @@
 namespace WalrusRPG
 {
     /**
-	 * Well, for now, this class will be a non abstract for ALPHA PROGRAMMING REASONS.
-	 * Expect this sooner or later to be abstract.
-	 * I don't know at this moment how will we manage the different classes heriting or compositing from this, if we use components or heritance.
-	 */
+         * Well, for now, this class will be a non abstract for ALPHA PROGRAMMING REASONS.
+         * Expect this sooner or later to be abstract.
+         * I don't know at this moment how will we manage the different classes heriting
+     * or compositing from this, if we use components or heritance.
+         */
     class Entity
     {
       protected:
@@ -21,7 +22,8 @@ namespace WalrusRPG
         unsigned sprite_id;
 
       public:
-        Entity(int x, int y, unsigned w, unsigned h, WalrusRPG::Renderer *tset, unsigned sprite_id);
+        Entity(int x, int y, unsigned w, unsigned h, WalrusRPG::Renderer *tset,
+               unsigned sprite_id);
         ~Entity();
         void render(Camera &camera, unsigned dt) const;
         void update(unsigned dt);

+ 12 - 10
include/Graphics.h

@@ -8,8 +8,8 @@ namespace WalrusRPG
     namespace Graphics
     {
         /*
-	 * Buffer management
-	 */
+         * Buffer management
+         */
 
         void buffer_allocate();
         void buffer_free();
@@ -19,26 +19,28 @@ namespace WalrusRPG
 
 
         /*
-	 * Misc LCD functions
-	 */
+         * Misc LCD functions
+         */
 
         void lcd_vsync();
         void vsync_isr();
 
 
         /*
-	 * Drawing
-	 */
+         * Drawing
+         */
 
         void draw_pixel(unsigned x, unsigned y, unsigned short color);
-        void draw_sprite_sheet(const unsigned short *sheet, int x, int y, const WalrusRPG::Utils::Rect &window);
+        void draw_sprite_sheet(const unsigned short *sheet, int x, int y,
+                               const WalrusRPG::Utils::Rect &window);
 
 
         /*
-	 * Sprite manipulation
-	 */
+         * Sprite manipulation
+         */
 
-        unsigned short sprite_pixel_get(const unsigned short *sprite, unsigned x, unsigned y);
+        unsigned short sprite_pixel_get(const unsigned short *sprite, unsigned x,
+                                        unsigned y);
     }
 }
 

+ 2 - 2
include/Pixel.h

@@ -8,8 +8,8 @@ namespace WalrusRPG
     namespace Graphics
     {
         /*
-	 * Pixel structure
-	 */
+         * Pixel structure
+         */
         class Pixel
         {
             union

+ 2 - 4
include/Rect.h

@@ -12,10 +12,8 @@ namespace WalrusRPG
             // We don't need a source file for two inline functions.
             Rect(unsigned x_, unsigned y_, signed width_, signed height_)
                 : x(x_), y(y_), width(width_), height(height_){};
-            Rect(unsigned x_, unsigned y_)
-                : Rect(x_, y_, 0, 0){};
-            Rect()
-                : Rect(0, 0, 0, 0){};
+            Rect(unsigned x_, unsigned y_) : Rect(x_, y_, 0, 0){};
+            Rect() : Rect(0, 0, 0, 0){};
         };
     }
 }

+ 2 - 1
include/TileRenderer.h

@@ -14,7 +14,8 @@ namespace WalrusRPG
         unsigned tile_height;
 
       public:
-        TileRenderer(unsigned short *tilesheet, unsigned tile_width, unsigned tile_height);
+        TileRenderer(unsigned short *tilesheet, unsigned tile_width,
+                     unsigned tile_height);
         void render(const unsigned id, const WalrusRPG::Utils::Rect &rect);
 
         int get_tile_width() const;

+ 1 - 2
include/timers.h

@@ -2,8 +2,7 @@
 #define INCLUDE_TIMERS_H
 
 #ifdef __cplusplus
-extern
-    "C" {
+extern "C" {
 #endif
 
 // TODO : Move these functions to C++ namespace

+ 11 - 6
src/Camera.cpp

@@ -23,10 +23,11 @@ void CAMERA::update(unsigned dt)
     UNUSED(dt);
     // TODO update map's data according to elasped time
     /*
-		// Need to think aagain on how to go to a target point and/or we need to align the corner OR the center to this point.
-		position += velocity * dt;
-		velocity += acceleration * dt;
-	 */
+                // Need to think aagain on how to go to a target point and/or we need to
+       align the corner OR the center to this point.
+                position += velocity * dt;
+                velocity += acceleration * dt;
+         */
 
     if (isKeyPressed(KEY_NSPIRE_5))
         y++;
@@ -60,8 +61,12 @@ signed CAMERA::get_y() const
 
 bool CAMERA::is_visible(const WalrusRPG::Utils::Rect &object) const
 {
-    if ((in_range(object.x, x, x + (signed) render_area_width) || in_range(object.x + (signed) object.width - 1, x, x + (signed) render_area_width))
-        && (in_range(object.y, y, y + (signed) render_area_height) || in_range(object.y + (signed) object.height - 1, y, y + (signed) render_area_height)))
+    if ((in_range(object.x, x, x + (signed) render_area_width) ||
+         in_range(object.x + (signed) object.width - 1, x,
+                  x + (signed) render_area_width)) &&
+        (in_range(object.y, y, y + (signed) render_area_height) ||
+         in_range(object.y + (signed) object.height - 1, y,
+                  y + (signed) render_area_height)))
     {
         return true;
     }

+ 11 - 7
src/Entity.cpp

@@ -6,7 +6,8 @@
 #define ENTITY WalrusRPG::Entity
 #define RECT WalrusRPG::Utils::Rect
 
-ENTITY::Entity(int x, int y, unsigned w, unsigned h, WalrusRPG::Renderer *tset, unsigned sprite_id)
+ENTITY::Entity(int x, int y, unsigned w, unsigned h, WalrusRPG::Renderer *tset,
+               unsigned sprite_id)
     : coords(x, y, w, h), tset(tset), sprite_id(sprite_id)
 {
 }
@@ -22,8 +23,10 @@ void ENTITY::render(Camera &camera, unsigned dt) const
 
     if (camera.is_visible(coords))
     {
-        tset->render(sprite_id, RECT(coords.x - camera.get_x(), coords.y - camera.get_y()));
-        //(*tset).render_tile(sprite_id, coords.x - camera.get_x(), coords.y - camera.get_y(), dt);
+        tset->render(sprite_id,
+                     RECT(coords.x - camera.get_x(), coords.y - camera.get_y()));
+        //(*tset).render_tile(sprite_id, coords.x - camera.get_x(), coords.y -
+        // camera.get_y(), dt);
     }
 }
 
@@ -32,8 +35,9 @@ void ENTITY::update(unsigned dt)
     UNUSED(dt);
     // TODO update map's data according to elasped time
     /*
-		// Need to think aagain on how to go to a target point and/or we need to align the corner OR the center to this point.
-		position += velocity * dt;
-		velocity += acceleration * dt;
-	 */
+                // Need to think aagain on how to go to a target point and/or we need to
+       align the corner OR the center to this point.
+                position += velocity * dt;
+                velocity += acceleration * dt;
+         */
 }

+ 6 - 3
src/Graphics.cpp

@@ -14,7 +14,8 @@ volatile unsigned *lcd_imsc = (unsigned *) (LCD_CONTROLLER + 0x1C);
 unsigned lcd_imsc_bkp;
 
 #define BUFFER_SIZE 320 * 240 * 2
-unsigned short *buffer_screen = NULL, *buffer_render = NULL, *buffer_ready = NULL, *buffer_os;
+unsigned short *buffer_screen = NULL, *buffer_render = NULL, *buffer_ready = NULL,
+               *buffer_os;
 bool buffer_swap_ready;
 
 /*
@@ -116,7 +117,8 @@ void GRAPHICS::draw_pixel(unsigned x, unsigned y, unsigned short color)
     buffer_render[x + (y * 320)] = color;
 }
 
-void GRAPHICS::draw_sprite_sheet(const unsigned short *sheet, int x, int y, const WalrusRPG::Utils::Rect &window)
+void GRAPHICS::draw_sprite_sheet(const unsigned short *sheet, int x, int y,
+                                 const WalrusRPG::Utils::Rect &window)
 {
     unsigned short color;
     int w = min(window.width + x, 320);
@@ -138,7 +140,8 @@ void GRAPHICS::draw_sprite_sheet(const unsigned short *sheet, int x, int y, cons
  * Sprite manipulation
  */
 
-unsigned short GRAPHICS::sprite_pixel_get(const unsigned short *sprite, unsigned x, unsigned y)
+unsigned short GRAPHICS::sprite_pixel_get(const unsigned short *sprite, unsigned x,
+                                          unsigned y)
 {
     if (x < sprite[0] && y < sprite[1])
         return sprite[x + (y * sprite[0]) + 3];

+ 10 - 6
src/Interrupts.cpp

@@ -31,18 +31,22 @@ void INTERRUPTS::init()
 
     // Enable IRQ in the CPU
     asm("mrs r1, cpsr \n\t"
-            "bic r1, r1, #0x80 \n\t"
-            "msr cpsr, r1"
-            : : : "r1");
+        "bic r1, r1, #0x80 \n\t"
+        "msr cpsr, r1"
+        :
+        :
+        : "r1");
 }
 
 void INTERRUPTS::off()
 {
     // Disable IRQ in the CPU
     asm("mrs r1, cpsr \n\t"
-            "orr r1, r1, #0x80 \n\t"
-            "msr cpsr, r1"
-            : : : "r1");
+        "orr r1, r1, #0x80 \n\t"
+        "msr cpsr, r1"
+        :
+        :
+        : "r1");
 
     *interrupt_select = interrupt_select_bkp;
 

+ 9 - 6
src/Map.cpp

@@ -10,8 +10,7 @@
 #define RECT WalrusRPG::Utils::Rect
 #define TILERENDERER WalrusRPG::TileRenderer
 
-MAP::Map(int width, int height, unsigned *layer0, unsigned *layer1)
-    : anim()
+MAP::Map(int width, int height, unsigned *layer0, unsigned *layer1) : anim()
 {
     this->renderer = new TileRenderer(overworld, 16, 16);
     this->width = width;
@@ -37,7 +36,8 @@ void MAP::render(WalrusRPG::Camera &camera, unsigned dt)
     signed t_width = renderer->get_tile_width();
     signed t_height = renderer->get_tile_height();
     // By Eiyeron : I assumed that the camera's position is the top left pixel.
-    // Margins moves the rendered map if we go outside of the bounds (specially on the left or on the top).
+    // Margins moves the rendered map if we go outside of the bounds (specially on the
+    // left or on the top).
     signed offset_x = camera.get_x() % t_width * -1;
     signed offset_y = camera.get_y() % t_height * -1;
     signed start_x = camera.get_x() / t_width;
@@ -46,7 +46,8 @@ void MAP::render(WalrusRPG::Camera &camera, unsigned dt)
     signed end_y = start_y + 240 / t_height + 1;
 
     // Bound-checking code. To avoid reading outside of the map.
-    // The offset edition allows the map to be correctly moved to the right to make up for the lack of renderable tiles.
+    // The offset edition allows the map to be correctly moved to the right to make up for
+    // the lack of renderable tiles.
     if (start_x < 0)
     {
         offset_x -= start_x * t_width;
@@ -82,14 +83,16 @@ void MAP::render(WalrusRPG::Camera &camera, unsigned dt)
             unsigned index = (start_x + i) + (start_y + j) * this->width;
             unsigned tile_over = anim.get_animation_frame(this->layer0[index]);
             if (tile_over != 0)
-                renderer->render(tile_over, RECT(offset_x + i * t_width, offset_y + j * t_height));
+                renderer->render(tile_over,
+                                 RECT(offset_x + i * t_width, offset_y + j * t_height));
 
             // layer1 : Over-layer
             if (this->layer1 == NULL)
                 continue;
             tile_over = anim.get_animation_frame(this->layer1[index]);
             if (tile_over != 0)
-                renderer->render(anim.get_animation_frame(tile_over), RECT(offset_x + i * t_width, offset_y + j * t_height));
+                renderer->render(anim.get_animation_frame(tile_over),
+                                 RECT(offset_x + i * t_width, offset_y + j * t_height));
         }
     }
 }

+ 4 - 5
src/Pixel.cpp

@@ -2,13 +2,11 @@
 
 #define PIXEL WalrusRPG::Graphics::Pixel
 
-PIXEL::Pixel(std::uint16_t color)
-    : value(color)
+PIXEL::Pixel(std::uint16_t color) : value(color)
 {
 }
 
-PIXEL::Pixel(Pixel &pix)
-    : value((std::uint8_t) pix)
+PIXEL::Pixel(Pixel &pix) : value((std::uint8_t) pix)
 {
 }
 
@@ -28,7 +26,8 @@ PIXEL &PIXEL::operator=(unsigned value)
     return *this;
 }
 
-#define CONST_COLOR(color, r, g, b) const WalrusRPG::Graphics::Pixel WalrusRPG::Graphics::color(r, g, b)
+#define CONST_COLOR(color, r, g, b) \
+    const WalrusRPG::Graphics::Pixel WalrusRPG::Graphics::color(r, g, b)
 CONST_COLOR(Black, 0, 0, 0);
 CONST_COLOR(White, 255, 255, 255);
 CONST_COLOR(Red, 255, 0, 0);

+ 1 - 2
src/SpriteRenderer.cpp

@@ -7,8 +7,7 @@
 #define GRAPHICS WalrusRPG::Graphics
 #define RECT WalrusRPG::Utils::Rect
 
-SPRITERENDERER::SpriteRenderer(unsigned short *_tilesheet)
-    : tilesheet(_tilesheet)
+SPRITERENDERER::SpriteRenderer(unsigned short *_tilesheet) : tilesheet(_tilesheet)
 {
 }
 

+ 1 - 2
src/Text.cpp

@@ -36,8 +36,7 @@ void TEXT::print_string(const std::string &str, unsigned x, unsigned y)
 
 void TEXT::print_format(unsigned x, unsigned y, const char *format, ...)
 {
-    char buffer[256] =
-        "";
+    char buffer[256] = "";
     va_list args;
     va_start(args, format);
     vsnprintf(buffer, 256, format, args);

+ 9 - 4
src/TileRenderer.cpp

@@ -6,7 +6,8 @@
 #define TILERENDERER WalrusRPG::TileRenderer
 #define RECT WalrusRPG::Utils::Rect
 
-TILERENDERER::TileRenderer(unsigned short *_tilesheet, unsigned tile_width, unsigned tile_height)
+TILERENDERER::TileRenderer(unsigned short *_tilesheet, unsigned tile_width,
+                           unsigned tile_height)
     : tilesheet(_tilesheet), tile_width(tile_width), tile_height(tile_height)
 {
 }
@@ -14,8 +15,11 @@ TILERENDERER::TileRenderer(unsigned short *_tilesheet, unsigned tile_width, unsi
 void TILERENDERER::render(const unsigned id, const RECT &rect)
 {
     unsigned num_tiles_x = tilesheet[0] / tile_width;
-    //unsigned num_tiles_y = sheet_height / tile_height;
-    GRAPHICS::draw_sprite_sheet(tilesheet, rect.x, rect.y, RECT(tile_width * (id % num_tiles_x), tile_height * (id / num_tiles_x), tile_width, tile_height));
+    // unsigned num_tiles_y = sheet_height / tile_height;
+    GRAPHICS::draw_sprite_sheet(tilesheet, rect.x, rect.y,
+                                RECT(tile_width * (id % num_tiles_x),
+                                     tile_height * (id / num_tiles_x), tile_width,
+                                     tile_height));
 }
 
 int TILERENDERER::get_tile_width() const
@@ -30,5 +34,6 @@ int TILERENDERER::get_tile_height() const
 
 TILERENDERER::~TileRenderer()
 {
-    // Nothing else than the current object is dynamically allocated, nothing should be done here atm.
+    // Nothing else than the current object is dynamically allocated, nothing should be
+    // done here atm.
 }

+ 50 - 48
src/main.cpp

@@ -18,19 +18,18 @@ using namespace WalrusRPG::Graphics::Text;
 
 void print_debug_camera_data(const Camera &camera)
 {
-    print_format(0, 8,
-                 "CAM : X : %d Y: %d", camera.get_x(), camera.get_y());
+    print_format(0, 8, "CAM : X : %d Y: %d", camera.get_x(), camera.get_y());
 }
 
 void print_debug_map_data(const Map &map)
 {
-    print_format(0, 16,
-                 "MAP : W: %d, H:%d", map.get_width(), map.get_height());
+    print_format(0, 16, "MAP : W: %d, H:%d", map.get_width(), map.get_height());
 }
 
 void map_loop(unsigned x, unsigned y, Map &map)
 {
-    timer_mode(0, 0b0000010); // Free-running, no interrupts, divider = 1, 32 bit, wrapping
+    // Free-running, no interrupts, divider = 1, 32 bit, wrapping
+    timer_mode(0, 0b0000010);
     timer_load(0, 0);
     unsigned loop_time = 546; // 32768Hz/60ups
     unsigned loop_next = -loop_time;
@@ -39,7 +38,7 @@ void map_loop(unsigned x, unsigned y, Map &map)
     unsigned keep_running = 1;
     Camera camera((signed) x, (signed) y);
 
-    //Tileset asdf(better_character, 9, 16);
+    // Tileset asdf(better_character, 9, 16);
     TileRenderer asdf(better_character, 9, 16);
     Entity test_char(115, 90, 9, 16, &asdf, 0);
 
@@ -58,8 +57,7 @@ void map_loop(unsigned x, unsigned y, Map &map)
             buffer_fill(pix);
             map.render(camera, 1);
             test_char.render(camera, 1);
-            print_format(0, 0,
-                         "WalrusRPG test build %s", git_version);
+            print_format(0, 0, "WalrusRPG test build %s", git_version);
 
             print_debug_camera_data(camera);
             print_debug_map_data(map);
@@ -86,48 +84,52 @@ int main(int argc, char *argv[])
     WalrusRPG::Interrupts::init();
 
     unsigned dungeonTest[] = {
-        21, 21, 1, 1, 1, 1, 21, 22, 21, 22, 21, 22, 21, 21, 1, 22, 21, 1, 22, 22,
-        22, 1, 21, 2, 3, 3, 3, 3, 3, 4, 21, 1, 22, 21, 22, 22, 21, 21, 21, 1,
-        22, 22, 22, 23, 108, 109, 109, 109, 24, 87, 4, 21, 21, 22, 5, 6, 6, 7, 1, 1,
-        22, 21, 21, 23, 66, 67, 108, 109, 24, 109, 25, 21, 22, 5, 132, 43, 43, 28, 1, 1,
-        21, 22, 1, 23, 25, 23, 109, 109, 108, 108, 25, 1, 1, 26, 42, 110, 48, 49, 22, 21,
-        1, 21, 21, 23, 87, 88, 109, 24, 109, 109, 25, 1, 1, 26, 43, 131, 6, 7, 21, 1,
-        22, 1, 21, 44, 67, 109, 24, 24, 24, 66, 46, 1, 22, 26, 27, 43, 42, 131, 7, 21,
-        22, 1, 22, 21, 44, 45, 45, 45, 45, 46, 1, 22, 1, 26, 27, 27, 43, 27, 28, 22,
-        21, 22, 21, 1, 21, 1, 22, 22, 21, 1, 21, 22, 1, 47, 48, 111, 42, 27, 28, 21,
-        21, 1, 21, 21, 22, 2, 3, 3, 4, 1, 2, 3, 4, 1, 5, 132, 27, 27, 28, 1,
-        1, 22, 1, 22, 21, 23, 24, 66, 46, 1, 23, 24, 25, 1, 26, 42, 42, 110, 49, 21,
-        22, 21, 22, 22, 2, 88, 24, 25, 2, 3, 88, 24, 87, 4, 26, 43, 110, 49, 21, 21,
-        1, 1, 1, 2, 88, 24, 24, 87, 88, 108, 24, 24, 109, 25, 47, 48, 49, 1, 22, 22,
-        21, 1, 21, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 87, 4, 21, 21, 22, 22, 22,
-        22, 1, 21, 23, 24, 24, 109, 24, 24, 24, 24, 24, 108, 109, 25, 21, 21, 22, 22, 22,
-        22, 21, 21, 44, 45, 45, 67, 24, 24, 24, 66, 45, 45, 45, 46, 1, 22, 1, 22, 22,
-        22, 21, 22, 22, 22, 1, 44, 67, 108, 108, 25, 22, 22, 1, 22, 21, 22, 21, 21, 1,
-        21, 22, 1, 22, 22, 1, 22, 44, 45, 45, 46, 1, 1, 1, 1, 21, 21, 21, 21, 21,
-        21, 22, 21, 21, 21, 1, 21, 1, 22, 22, 22, 1, 21, 22, 21, 1, 1, 22, 21, 1,
-        1, 21, 1, 1, 21, 21, 21, 1, 22, 22, 1, 21, 22, 21, 22, 1, 22, 21, 21, 21,
+        21, 21,  1,   1,   1,   1,   21,  22,  21,  22, 21,  22,  21,  21,  1,   22,  21,
+        1,  22,  22,  22,  1,   21,  2,   3,   3,   3,  3,   3,   4,   21,  1,   22,  21,
+        22, 22,  21,  21,  21,  1,   22,  22,  22,  23, 108, 109, 109, 109, 24,  87,  4,
+        21, 21,  22,  5,   6,   6,   7,   1,   1,   22, 21,  21,  23,  66,  67,  108, 109,
+        24, 109, 25,  21,  22,  5,   132, 43,  43,  28, 1,   1,   21,  22,  1,   23,  25,
+        23, 109, 109, 108, 108, 25,  1,   1,   26,  42, 110, 48,  49,  22,  21,  1,   21,
+        21, 23,  87,  88,  109, 24,  109, 109, 25,  1,  1,   26,  43,  131, 6,   7,   21,
+        1,  22,  1,   21,  44,  67,  109, 24,  24,  24, 66,  46,  1,   22,  26,  27,  43,
+        42, 131, 7,   21,  22,  1,   22,  21,  44,  45, 45,  45,  45,  46,  1,   22,  1,
+        26, 27,  27,  43,  27,  28,  22,  21,  22,  21, 1,   21,  1,   22,  22,  21,  1,
+        21, 22,  1,   47,  48,  111, 42,  27,  28,  21, 21,  1,   21,  21,  22,  2,   3,
+        3,  4,   1,   2,   3,   4,   1,   5,   132, 27, 27,  28,  1,   1,   22,  1,   22,
+        21, 23,  24,  66,  46,  1,   23,  24,  25,  1,  26,  42,  42,  110, 49,  21,  22,
+        21, 22,  22,  2,   88,  24,  25,  2,   3,   88, 24,  87,  4,   26,  43,  110, 49,
+        21, 21,  1,   1,   1,   2,   88,  24,  24,  87, 88,  108, 24,  24,  109, 25,  47,
+        48, 49,  1,   22,  22,  21,  1,   21,  23,  24, 24,  24,  24,  24,  24,  24,  24,
+        24, 87,  4,   21,  21,  22,  22,  22,  22,  1,  21,  23,  24,  24,  109, 24,  24,
+        24, 24,  24,  108, 109, 25,  21,  21,  22,  22, 22,  22,  21,  21,  44,  45,  45,
+        67, 24,  24,  24,  66,  45,  45,  45,  46,  1,  22,  1,   22,  22,  22,  21,  22,
+        22, 22,  1,   44,  67,  108, 108, 25,  22,  22, 1,   22,  21,  22,  21,  21,  1,
+        21, 22,  1,   22,  22,  1,   22,  44,  45,  45, 46,  1,   1,   1,   1,   21,  21,
+        21, 21,  21,  21,  22,  21,  21,  21,  1,   21, 1,   22,  22,  22,  1,   21,  22,
+        21, 1,   1,   22,  21,  1,   1,   21,  1,   1,  21,  21,  21,  1,   22,  22,  1,
+        21, 22,  21,  22,  1,   22,  21,  21,  21,
     };
     unsigned dungeonTest2[] = {
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 73, 74, 75, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 157, 158, 140, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 178, 179, 161, 181, 0, 12, 14, 12, 14, 162, 163, 164, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 184, 185, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 186, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 167, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 133, 134, 134, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 154, 155, 155, 71, 135, 39, 40, 41, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 154, 155, 155, 155, 156, 60, 61, 62, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 175, 176, 51, 155, 156, 81, 82, 83, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 175, 176, 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   52,  53,  54,  55,  0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   73,  74,  75,  76,  0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   157, 158, 140, 160, 0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   178, 179, 161, 181, 0,  12, 14, 12, 14, 162, 163, 164, 0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  183, 184, 185, 0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  166, 0,   0,   186, 0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   145, 167, 0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 133, 134, 134, 135, 0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 154, 155, 155, 71,  135, 39, 40, 41, 0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 154, 155, 155, 155, 156, 60, 61, 62, 0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 175, 176, 51,  155, 156, 81, 82, 83, 0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   0,   175, 176, 177, 0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
+        0, 0, 0, 0, 0,   0,   0,   0,   0,   0,  0,  0,  0,  0,  0,   0,   0,   0,   0, 0,
     };
 
     Map map(20, 20, dungeonTest, dungeonTest2);