home · contact · privacy
Fix non-initializations that are detected as errors on gcc -O3.
[plomrogue] / src / client / draw_wins.c
index 08e59270f36931451870f7c5e34a5fe6e6af9b55..5c35dd6cc2939e5f2176b1a6aec3e9cbb08b14c3 100644 (file)
@@ -186,7 +186,8 @@ static void add_line_compact(struct Win * win, char * line, attr_t attri,
     uint32_t len_line_new = len_line + strlen(separator);
     char line_new[len_line_new];
     sprintf(line_new, "%s%s", line, separator);
-    uint16_t x, y;
+    uint16_t x = 0;
+    uint16_t y;
     uint32_t z;
     for (z = 0, y = y_start; z < len_line_new; y++)
     {
@@ -204,7 +205,7 @@ static void add_line_compact(struct Win * win, char * line, attr_t attri,
             try_resize_winmap(win, y + 1 + 1, win->winmap_size.x);
         }
     }
-    * offset = x;
+    *offset = x;
 }
 
 
@@ -338,14 +339,14 @@ extern void draw_win_log(struct Win * win)
 
 extern void draw_win_map(struct Win * win)
 {
-    try_resize_winmap(win, world.map.size.y, world.map.size.x);
+    try_resize_winmap(win, world.map.size.y, world.map.size.x * 2);
     uint16_t z = 0;
     uint16_t x, y;
     for (y = 0; y < world.map.size.y; y++)
     {
         for (x = 0; x < world.map.size.x; x++)
         {
-            set_ch_on_yx(win, y, x, world.map.cells[z]);
+            set_ch_on_yx(win, y, x * 2 + (y % 2), world.map.cells[z]);
             z++;
         }
     }