From 9c5bff1e87dcd29bcbf6b06453204391b9598b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Le=C3=A3o?= <60024671+DeeJayLSP@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:39:18 -0300 Subject: [PATCH] ResourceImporterWAV: remove unnecessary var declaration --- editor/import/resource_importer_wav.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index ab14a5f01d..c8add6ab20 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -330,14 +330,12 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s for (int i = 0; i < new_data_frames; i++) { // Cubic interpolation should be enough. - float mu = frac; - float y0 = data[MAX(0, ipos - 1) * format_channels + c]; float y1 = data[ipos * format_channels + c]; float y2 = data[MIN(frames - 1, ipos + 1) * format_channels + c]; float y3 = data[MIN(frames - 1, ipos + 2) * format_channels + c]; - new_data.write[i * format_channels + c] = Math::cubic_interpolate(y1, y2, y0, y3, mu); + new_data.write[i * format_channels + c] = Math::cubic_interpolate(y1, y2, y0, y3, frac); // update position and always keep fractional part within ]0...1] // in order to avoid 32bit floating point precision errors