aboutsummaryrefslogtreecommitdiff
path: root/game/src/GameSession/MapView.gd
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-04-26 13:06:19 +0200
committer Hop311 <hop3114@gmail.com>2023-04-26 13:06:19 +0200
commit2455806f52f0133e5bd5e4997589c5ce4fe99b2c (patch)
treea1882d8d3a4e836ec305dd0893b6eda5ec3dd230 /game/src/GameSession/MapView.gd
parent10053cf259c55ee45803268a844edf1011d8a16b (diff)
Vertical subdivision + calculation for both dims
Diffstat (limited to 'game/src/GameSession/MapView.gd')
-rw-r--r--game/src/GameSession/MapView.gd5
1 files changed, 5 insertions, 0 deletions
diff --git a/game/src/GameSession/MapView.gd b/game/src/GameSession/MapView.gd
index e74ea59..1b04097 100644
--- a/game/src/GameSession/MapView.gd
+++ b/game/src/GameSession/MapView.gd
@@ -13,6 +13,7 @@ const _action_drag : StringName = &"map_drag"
const _action_click : StringName = &"map_click"
const _shader_param_province_index : StringName = &"province_index_tex"
+const _shader_param_province_index_subdivisions : StringName = &"province_index_subdivisions"
const _shader_param_province_colour : StringName = &"province_colour_tex"
const _shader_param_hover_index : StringName = &"hover_index"
const _shader_param_selected_index : StringName = &"selected_index"
@@ -86,6 +87,10 @@ func _ready():
push_error("Failed to generate province index texture array!")
return
_map_shader_material.set_shader_parameter(_shader_param_province_index, province_index_texture)
+ var subdivisions := GameSingleton.get_province_index_image_subdivisions()
+ if subdivisions.x < 1 or subdivisions.y < 1:
+ push_error("Invalid province index image subdivision: ", subdivisions.x, "x", subdivisions.y)
+ _map_shader_material.set_shader_parameter(_shader_param_province_index_subdivisions, Vector2(subdivisions))
# Province colour texture
_map_province_colour_image = GameSingleton.get_province_colour_image()