summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorVitaliy <numzer0@yandex.ru>2018-09-16 19:59:42 +0300
committerParamat <paramat@users.noreply.github.com>2018-09-16 17:59:42 +0100
commit79e393cf4b5027eb9071df23f4834aac3f3a689f (patch)
treebe17c63026522fca0808a0a966390a76baf38c13 /src/util
parent220ec79e4a10ea553310b16eb07d0c7a03fedb78 (diff)
downloadminetest-79e393cf4b5027eb9071df23f4834aac3f3a689f.tar.gz
minetest-79e393cf4b5027eb9071df23f4834aac3f3a689f.tar.bz2
minetest-79e393cf4b5027eb9071df23f4834aac3f3a689f.zip
Light curve: Simplify and improve code, fix darkened daytime sky (#7693)
Diffstat (limited to 'src/util')
-rw-r--r--src/util/numeric.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/numeric.h b/src/util/numeric.h
index 61370a3f4..b1e2845b8 100644
--- a/src/util/numeric.h
+++ b/src/util/numeric.h
@@ -243,6 +243,11 @@ inline s32 myround(f32 f)
return (s32)(f < 0.f ? (f - 0.5f) : (f + 0.5f));
}
+inline constexpr f32 sqr(f32 f)
+{
+ return f * f;
+}
+
/*
Returns integer position of node in given floating point position
*/