aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/GameSingleton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/openvic-extension/GameSingleton.cpp')
-rw-r--r--extension/src/openvic-extension/GameSingleton.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/extension/src/openvic-extension/GameSingleton.cpp b/extension/src/openvic-extension/GameSingleton.cpp
index 2d6f784..cdba44c 100644
--- a/extension/src/openvic-extension/GameSingleton.cpp
+++ b/extension/src/openvic-extension/GameSingleton.cpp
@@ -9,10 +9,8 @@
using namespace godot;
using namespace OpenVic;
-TerrainVariant::TerrainVariant(const std::string_view new_identfier,
- colour_t new_colour, Ref<Image> const& new_image)
- : HasIdentifierAndColour { new_identfier, new_colour, true, false },
- image { new_image } {}
+TerrainVariant::TerrainVariant(const std::string_view new_identfier, Ref<Image> const& new_image)
+ : HasIdentifier { new_identfier }, image { new_image } {}
Ref<Image> TerrainVariant::get_image() const {
return image;
@@ -81,6 +79,7 @@ void GameSingleton::_bind_methods() {
"shadow_displacement", "shadow_tightness", "shadow_radius", "shadow_thickness",
"trim_colour", "trim_size", "gradient_falloff", "gradient_base",
"donut", "donut_inner_trim", "donut_inner_radius"), &GameSingleton::draw_pie_chart);
+ ClassDB::bind_static_method("GameSingleton", D_METHOD("load_image", "path"), &GameSingleton::load_image);
}
void GameSingleton::draw_pie_chart(Ref<Image> image,
@@ -94,6 +93,10 @@ void GameSingleton::draw_pie_chart(Ref<Image> image,
donut, donut_inner_trim, donut_inner_radius);
}
+Ref<Image> GameSingleton::load_image(String const& path) {
+ return load_godot_image(path);
+}
+
GameSingleton* GameSingleton::get_singleton() {
return singleton;
}