From ed840b24eac466f710116f29e4dc29f880344b0c Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Sun, 25 Sep 2022 00:01:11 +0800 Subject: [PATCH] Deprecate love.math.noise --- src/modules/math/wrap_Math.cpp | 2 ++ src/modules/math/wrap_Math.lua | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/modules/math/wrap_Math.cpp b/src/modules/math/wrap_Math.cpp index 1e510ae24..fa4bc5454 100644 --- a/src/modules/math/wrap_Math.cpp +++ b/src/modules/math/wrap_Math.cpp @@ -318,6 +318,8 @@ int w_linearToGamma(lua_State *L) int w_noise(lua_State *L) { + luax_markdeprecated(L, 1, "love.math.noise", API_FUNCTION, DEPRECATED_REPLACED, "love.math.perlinNoise or love.math.simplexNoise"); + int nargs = std::min(std::max(lua_gettop(L), 1), 4); double args[4]; diff --git a/src/modules/math/wrap_Math.lua b/src/modules/math/wrap_Math.lua index 17eb32257..d5ff62ece 100644 --- a/src/modules/math/wrap_Math.lua +++ b/src/modules/math/wrap_Math.lua @@ -113,6 +113,8 @@ local ffifuncs = ffi.cast("FFI_Math **", ffifuncspointer_str)[0] -- Overwrite some regular love.math functions with FFI implementations. function love_math.noise(x, y, z, w) + love.markDeprecated(2, "love.math.noise", "function", "replaced", "love.math.perlinNoise or love.math.simplexNoise") + if w ~= nil then return tonumber(ffifuncs.pnoise4(x, y, z, w)) elseif z ~= nil then