created and drawing board - axis are incorrect though
authormatthew <matthew@owens.tech>
Sun, 29 Jul 2018 19:50:45 +0000 (19:50 +0000)
committermatthew <matthew@owens.tech>
Sun, 29 Jul 2018 19:50:45 +0000 (19:50 +0000)
common/board.c
nogl/main.c

index 56c8ef7..33918fe 100644 (file)
@@ -16,10 +16,10 @@ Board *board_init(int sizex, int sizey)
        b->dimensions.y = sizey;
        b->tiles = malloc(sizet * sizeof(Tile));
 
-       for(int i = 0; i < sizey; ++i){
-               b->tiles[i] = malloc(sizex * sizeof(Tile));
-               for(int j = 0; j < sizex; ++j){
-                       b->tiles[i][j] = tile_init(point3i(i,j,1), PLAINS);
+       for(int x = 0; x < sizex; ++x){
+               b->tiles[x] = malloc(sizey * sizeof(Tile));
+               for(int y = 0; y < sizey; ++y){
+                       b->tiles[x][y] = tile_init(point3i(x,y,1), PLAINS);
                }
        }
 
index 05b76f9..878bc4f 100644 (file)
@@ -45,6 +45,7 @@ int main()
                                printf("#");
                        }
                }
+               printf("\n");
        }
 
        strcpy(str, "Hello... |");