From 70c040d042cb536e5ce16b0cfff0e0afa39e8ed7 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Thu, 14 Sep 2023 08:52:25 +0100 Subject: Logger::warning, format cleanup + req comments --- extension/src/openvic-extension/Utilities.hpp | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 extension/src/openvic-extension/Utilities.hpp (limited to 'extension/src/openvic-extension/Utilities.hpp') diff --git a/extension/src/openvic-extension/Utilities.hpp b/extension/src/openvic-extension/Utilities.hpp new file mode 100644 index 0000000..32e7cb5 --- /dev/null +++ b/extension/src/openvic-extension/Utilities.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include + +#include + +#define ERR(x) ((x) ? OK : FAILED) + +namespace OpenVic { + + inline std::string godot_to_std_string(godot::String const& str) { + return str.ascii().get_data(); + } + + inline godot::String std_to_godot_string(std::string const& str) { + return str.c_str(); + } + + inline godot::Color to_godot_color(colour_t colour) { + return { colour_byte_to_float((colour >> 16) & 0xFF), colour_byte_to_float((colour >> 8) & 0xFF), colour_byte_to_float(colour & 0xFF) }; + } + + godot::Ref load_godot_image(godot::String const& path); + + void draw_pie_chart(godot::Ref image, + godot::Array const& stopAngles, godot::Array const& colours, float radius, + godot::Vector2 shadow_displacement, float shadow_tightness, float shadow_radius, float shadow_thickness, + godot::Color trim_colour, float trim_size, float gradient_falloff, float gradient_base, + bool donut, bool donut_inner_trim, float donut_inner_radius); +} -- cgit v1.2.3-56-ga3b1