]> git.lizzy.rs Git - shadowclad.git/blobdiff - src/game/level.h
Convert data counts and indices to size_t
[shadowclad.git] / src / game / level.h
index 2f2d8db4466ab02b1dc698c119fd256069bd5a8c..89d7e2e0daeb96d85c3c9b286cf1454b9595661e 100644 (file)
@@ -19,8 +19,8 @@ typedef struct {
 } Block;
 
 typedef struct {
-       int width;
-       int depth;
+       size_t width;
+       size_t depth;
        Block** blocks;
 } BlockGrid;
 
@@ -32,11 +32,11 @@ Vector3D playerSpawnPos;
 void initLevel();
 void buildLevelFromImage(TgaImage* image);
 
-static inline Block* getBlockFromGrid(BlockGrid grid, int x, int z) {
+static inline Block* getBlockFromGrid(BlockGrid grid, size_t x, size_t z) {
        return grid.blocks[(z * grid.width) + x];
 }
 
-static inline void setBlockInGrid(BlockGrid grid, int x, int z, Block* block) {
+static inline void setBlockInGrid(BlockGrid grid, size_t x, size_t z, Block* block) {
        grid.blocks[(z * grid.width) + x] = block;
 }