]> git.lizzy.rs Git - shadowclad.git/blobdiff - level.h
Render the level's grid of blocks
[shadowclad.git] / level.h
diff --git a/level.h b/level.h
index 539ab37fbf1a8aeaa539f6b13c5fad8f81cc4135..c2e5c1395b0ce227d2a78603eb43b6fe310381c7 100644 (file)
--- a/level.h
+++ b/level.h
@@ -22,14 +22,20 @@ typedef struct {
 
 typedef struct {
        int width;
-       int height;
-       Block* blocks;
+       int depth;
+       Block** blocks;
 } BlockGrid;
 
+#define BLOCKGRID_CELL_SIZE 2.5f
+
 BlockGrid levelGrid;
 
 void initLevel();
 void buildLevelFromImage(TgaImage* image);
 const AiScene* importScene(const char* path);
 
+static inline Block* getBlockFromGrid(BlockGrid grid, int x, int z) {
+       return grid.blocks[(z * grid.width) + x];
+}
+
 #endif