aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession/MapView.gd
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-01-15 13:55:45 +0100
committer GitHub <noreply@github.com>2024-01-15 13:55:45 +0100
commitff4673ac2cbc06280cfccf9930ff3dbc9949effa (patch)
tree742bcbbeff8169f45a97b35de45aa06b6458d8b9 /game/src/Game/GameSession/MapView.gd
parent92267a046506077418823a16ac8748579cf7905c (diff)
parentfe1dd80ca6eb6d024e046f1ab804e5be707e483e (diff)
Merge pull request #193 from OpenVicProject/map-colours
Improved province colouring and terrain texture tiling
Diffstat (limited to 'game/src/Game/GameSession/MapView.gd')
-rw-r--r--game/src/Game/GameSession/MapView.gd14
1 files changed, 8 insertions, 6 deletions
diff --git a/game/src/Game/GameSession/MapView.gd b/game/src/Game/GameSession/MapView.gd
index 499f745..838a19a 100644
--- a/game/src/Game/GameSession/MapView.gd
+++ b/game/src/Game/GameSession/MapView.gd
@@ -66,12 +66,7 @@ func _ready() -> void:
return
_map_shader_material = map_material
- if not _map_mesh_instance.mesh is MapMesh:
- push_error("Invalid map mesh class: ", _map_mesh_instance.mesh.get_class(), "(expected MapMesh)")
- return
- _map_mesh = _map_mesh_instance.mesh
-
- const pixels_per_terrain_tile : float = 20.0
+ const pixels_per_terrain_tile : float = 16.0
_map_shader_material.set_shader_parameter(GameLoader.ShaderManager.param_terrain_tile_factor,
float(GameSingleton.get_map_height()) / pixels_per_terrain_tile)
@@ -79,6 +74,13 @@ func _ready() -> void:
_map_shader_material.set_shader_parameter(GameLoader.ShaderManager.param_stripe_tile_factor,
float(GameSingleton.get_map_height()) / pixels_per_stripe_tile)
+ if not _map_mesh_instance.mesh is MapMesh:
+ push_error("Invalid map mesh class: ", _map_mesh_instance.mesh.get_class(), "(expected MapMesh)")
+ return
+ _map_mesh = _map_mesh_instance.mesh
+
+ _map_mesh.set_aspect_ratio(GameSingleton.get_map_aspect_ratio())
+
# Get map mesh bounds
var map_mesh_aabb : AABB = _map_mesh.get_core_aabb() * _map_mesh_instance.transform
_map_mesh_corner = Vector2(