diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-12-30 15:15:01 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-12-30 15:15:01 +0100 |
commit | e08a29e73ea4f7e6d78e8e7f5a6e7033dbc1f542 (patch) | |
tree | 966b95a7cdad16f7658d2e10cec6e549f3b98c17 /extractor/gat_format.gd | |
parent | 6e2deea3d1b2fb4d79dac02a0d4310936c7f317c (diff) |
next commit
Diffstat (limited to 'extractor/gat_format.gd')
-rw-r--r-- | extractor/gat_format.gd | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/extractor/gat_format.gd b/extractor/gat_format.gd index 712657b..7192cbc 100644 --- a/extractor/gat_format.gd +++ b/extractor/gat_format.gd @@ -42,6 +42,14 @@ static func from_bytes(bytes: ByteStream) -> GATFormat: return gat_format +enum TileFlags { + Walkable = 0b00000001, + Water = 0b00000010, + Snipable = 0b00000100, + Cliff = 0b00001000, +} + + class Tile: ## Byte Type: f32 [br] ## Byte Length: 4 [br] @@ -63,12 +71,12 @@ class Tile: ## Orignal Coordinates: (1, 1) var top_right_altitude: int - ## Byte Type: u32 ?[br] - ## Byte Length: 4 ? + ## Byte Type: u8 [br] + ## Byte Length: 1 var terrain_type: int - func get_height_map() -> Dictionary: # Dictionary[Vector2, int] + func get_height_map() -> Dictionary[Vector2, int]: return { Vector2(0, 0): top_left_altitude, Vector2(1, 0): top_right_altitude, @@ -84,6 +92,8 @@ class Tile: tile.bottom_right_altitude = bytes.decode_float() tile.top_left_altitude = bytes.decode_float() tile.top_right_altitude = bytes.decode_float() - tile.terrain_type = bytes.decode_u32() + tile.terrain_type = bytes.decode_u8() + + bytes.advance(3) # unused return tile |