Small refactor and rename of struct field.
This commit is contained in:
+11
-4
@@ -13,10 +13,12 @@ Tile_Type :: enum {
|
||||
}
|
||||
|
||||
Game_Map :: struct {
|
||||
width: int,
|
||||
height: int,
|
||||
tile_size: int,
|
||||
data: [400]int
|
||||
width: int,
|
||||
height: int,
|
||||
width_px: f32,
|
||||
height_px: f32,
|
||||
data: [400]int
|
||||
}
|
||||
|
||||
Grid_Pos :: [2]int
|
||||
@@ -47,12 +49,17 @@ map_init :: proc() -> Game_Map {
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
}
|
||||
|
||||
return Game_Map{
|
||||
game := Game_Map{
|
||||
width = 20,
|
||||
height = 20,
|
||||
tile_size = TILE_SIZE,
|
||||
data = map_data,
|
||||
}
|
||||
|
||||
game.width_px = f32(game.width * game.tile_size)
|
||||
game.height_px = f32(game.height * game.tile_size)
|
||||
|
||||
return game
|
||||
}
|
||||
|
||||
// requires raw window-space
|
||||
|
||||
Reference in New Issue
Block a user