summaryrefslogtreecommitdiff
path: root/extractor/gat_format.gd
diff options
context:
space:
mode:
Diffstat (limited to 'extractor/gat_format.gd')
-rw-r--r--extractor/gat_format.gd18
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