diff options
author | Hop311 <hop3114@gmail.com> | 2023-09-24 23:45:37 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-27 15:14:46 +0200 |
commit | de2017128313b9a322eb59c40a4180099d9c18b7 (patch) | |
tree | a8aa710f9f2024e863d489f1ab553dccb4398315 /extension/src/openvic-extension/GameSingleton.cpp | |
parent | fadabd3e19605a7f30ee7e3dd1453f21384dd662 (diff) |
DDS load + moved terrain (type) loading to sim
Diffstat (limited to 'extension/src/openvic-extension/GameSingleton.cpp')
-rw-r--r-- | extension/src/openvic-extension/GameSingleton.cpp | 11 |
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; } |