diff options
author | Hop311 <hop3114@gmail.com> | 2023-08-24 01:33:21 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-09 22:57:07 +0200 |
commit | aa49dbbb3cf9dbff18c08245b0e46a9943df9b15 (patch) | |
tree | f3f5d78cd4e461c6c37d69076de93d78d496638d /extension/src/Utilities.cpp | |
parent | 5d127faa9388ecb763846c3bf19190c891d2a583 (diff) |
Big Dataloader Commit (openvic)
Default compat path + formatting + bits+bobs
Diffstat (limited to 'extension/src/Utilities.cpp')
-rw-r--r-- | extension/src/Utilities.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extension/src/Utilities.cpp b/extension/src/Utilities.cpp index f09eae0..4ca6855 100644 --- a/extension/src/Utilities.cpp +++ b/extension/src/Utilities.cpp @@ -19,7 +19,7 @@ Ref<Image> OpenVic::load_godot_image(String const& path) { // Get the polar coordinates of a pixel relative to the center static Vector2 getPolar(Vector2 UVin, Vector2 center) { - Vector2 relcoord = (UVin-center); + Vector2 relcoord = (UVin - center); float dist = relcoord.length(); float theta = std::numbers::pi / 2 + atan2(relcoord.y, relcoord.x); if (theta < 0.0f) theta += std::numbers::pi * 2; @@ -27,11 +27,11 @@ static Vector2 getPolar(Vector2 UVin, Vector2 center) { } // From thebookofshaders, returns a gradient falloff -static inline float parabola(float base, float x, float k){ +static inline float parabola(float base, float x, float k) { return powf(base * x * (1.0 - x), k); } -static inline float parabola_shadow(float base, float x){ +static inline float parabola_shadow(float base, float x) { return base * x * x; } @@ -57,9 +57,9 @@ static Color pie_chart_fragment(Vector2 UV, float radius, Array const& stopAngle return { trim_colour, 1.0 }; } // Interior - else if (dist <= radius-trim_size) { + else if (dist <= radius - trim_size) { Color col { 1.0f, 0.0f, 0.0f }; - for (int i = 0; i < stopAngles.size(); i++){ + for (int i = 0; i < stopAngles.size(); i++) { if (theta <= float(stopAngles[i])) { col = colours[i]; break; @@ -73,7 +73,7 @@ static Color pie_chart_fragment(Vector2 UV, float radius, Array const& stopAngle return { trim_colour, 1.0 }; } // Outside the circle - else{ + else { return { 0.1, 0.1, 0.1, shadow_gradient }; } } |