From f93a4287cf833134020e5b35c4b800c2edff1b94 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Thu, 11 May 2023 12:32:23 +0200 Subject: Enable shadow warnings and fix raised errors (cherry picked from commit 71ee65dc5701a0675ae6b1879a694a28c7206a63) --- scene/3d/lightmapper.h | 16 +++++------ scene/resources/audio_stream_wav.cpp | 56 ++++++++++++++++++------------------ scene/resources/audio_stream_wav.h | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) (limited to 'scene') diff --git a/scene/3d/lightmapper.h b/scene/3d/lightmapper.h index 018ed9485d..5a390eaede 100644 --- a/scene/3d/lightmapper.h +++ b/scene/3d/lightmapper.h @@ -71,15 +71,15 @@ public: /*! Constructs a ray from origin, direction, and ray segment. Near * has to be smaller than far. */ - _FORCE_INLINE_ Ray(const Vector3 &org, - const Vector3 &dir, - float tnear = 0.0f, - float tfar = INFINITY) : - org(org), - tnear(tnear), - dir(dir), + _FORCE_INLINE_ Ray(const Vector3 &p_org, + const Vector3 &p_dir, + float p_tnear = 0.0f, + float p_tfar = INFINITY) : + org(p_org), + tnear(p_tnear), + dir(p_dir), time(0.0f), - tfar(tfar), + tfar(p_tfar), mask(-1), u(0.0), v(0.0), diff --git a/scene/resources/audio_stream_wav.cpp b/scene/resources/audio_stream_wav.cpp index f331e3a22c..669b455f89 100644 --- a/scene/resources/audio_stream_wav.cpp +++ b/scene/resources/audio_stream_wav.cpp @@ -87,21 +87,21 @@ void AudioStreamPlaybackWAV::seek(double p_time) { } template -void AudioStreamPlaybackWAV::do_resample(const Depth *p_src, AudioFrame *p_dst, int64_t &offset, int32_t &increment, uint32_t amount, IMA_ADPCM_State *ima_adpcm) { +void AudioStreamPlaybackWAV::do_resample(const Depth *p_src, AudioFrame *p_dst, int64_t &p_offset, int32_t &p_increment, uint32_t p_amount, IMA_ADPCM_State *p_ima_adpcm) { // this function will be compiled branchless by any decent compiler int32_t final, final_r, next, next_r; - while (amount) { - amount--; - int64_t pos = offset >> MIX_FRAC_BITS; + while (p_amount) { + p_amount--; + int64_t pos = p_offset >> MIX_FRAC_BITS; if (is_stereo && !is_ima_adpcm) { pos <<= 1; } if (is_ima_adpcm) { - int64_t sample_pos = pos + ima_adpcm[0].window_ofs; + int64_t sample_pos = pos + p_ima_adpcm[0].window_ofs; - while (sample_pos > ima_adpcm[0].last_nibble) { + while (sample_pos > p_ima_adpcm[0].last_nibble) { static const int16_t _ima_adpcm_step_table[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, @@ -122,20 +122,20 @@ void AudioStreamPlaybackWAV::do_resample(const Depth *p_src, AudioFrame *p_dst, for (int i = 0; i < (is_stereo ? 2 : 1); i++) { int16_t nibble, diff, step; - ima_adpcm[i].last_nibble++; + p_ima_adpcm[i].last_nibble++; const uint8_t *src_ptr = (const uint8_t *)base->data; src_ptr += AudioStreamWAV::DATA_PAD; - uint8_t nbb = src_ptr[(ima_adpcm[i].last_nibble >> 1) * (is_stereo ? 2 : 1) + i]; - nibble = (ima_adpcm[i].last_nibble & 1) ? (nbb >> 4) : (nbb & 0xF); - step = _ima_adpcm_step_table[ima_adpcm[i].step_index]; + uint8_t nbb = src_ptr[(p_ima_adpcm[i].last_nibble >> 1) * (is_stereo ? 2 : 1) + i]; + nibble = (p_ima_adpcm[i].last_nibble & 1) ? (nbb >> 4) : (nbb & 0xF); + step = _ima_adpcm_step_table[p_ima_adpcm[i].step_index]; - ima_adpcm[i].step_index += _ima_adpcm_index_table[nibble]; - if (ima_adpcm[i].step_index < 0) { - ima_adpcm[i].step_index = 0; + p_ima_adpcm[i].step_index += _ima_adpcm_index_table[nibble]; + if (p_ima_adpcm[i].step_index < 0) { + p_ima_adpcm[i].step_index = 0; } - if (ima_adpcm[i].step_index > 88) { - ima_adpcm[i].step_index = 88; + if (p_ima_adpcm[i].step_index > 88) { + p_ima_adpcm[i].step_index = 88; } diff = step >> 3; @@ -152,26 +152,26 @@ void AudioStreamPlaybackWAV::do_resample(const Depth *p_src, AudioFrame *p_dst, diff = -diff; } - ima_adpcm[i].predictor += diff; - if (ima_adpcm[i].predictor < -0x8000) { - ima_adpcm[i].predictor = -0x8000; - } else if (ima_adpcm[i].predictor > 0x7FFF) { - ima_adpcm[i].predictor = 0x7FFF; + p_ima_adpcm[i].predictor += diff; + if (p_ima_adpcm[i].predictor < -0x8000) { + p_ima_adpcm[i].predictor = -0x8000; + } else if (p_ima_adpcm[i].predictor > 0x7FFF) { + p_ima_adpcm[i].predictor = 0x7FFF; } /* store loop if there */ - if (ima_adpcm[i].last_nibble == ima_adpcm[i].loop_pos) { - ima_adpcm[i].loop_step_index = ima_adpcm[i].step_index; - ima_adpcm[i].loop_predictor = ima_adpcm[i].predictor; + if (p_ima_adpcm[i].last_nibble == p_ima_adpcm[i].loop_pos) { + p_ima_adpcm[i].loop_step_index = p_ima_adpcm[i].step_index; + p_ima_adpcm[i].loop_predictor = p_ima_adpcm[i].predictor; } - //printf("%i - %i - pred %i\n",int(ima_adpcm[i].last_nibble),int(nibble),int(ima_adpcm[i].predictor)); + //printf("%i - %i - pred %i\n",int(p_ima_adpcm[i].last_nibble),int(nibble),int(p_ima_adpcm[i].predictor)); } } - final = ima_adpcm[0].predictor; + final = p_ima_adpcm[0].predictor; if (is_stereo) { - final_r = ima_adpcm[1].predictor; + final_r = p_ima_adpcm[1].predictor; } } else { @@ -201,7 +201,7 @@ void AudioStreamPlaybackWAV::do_resample(const Depth *p_src, AudioFrame *p_dst, } } - int32_t frac = int64_t(offset & MIX_FRAC_MASK); + int32_t frac = int64_t(p_offset & MIX_FRAC_MASK); final = final + ((next - final) * frac >> MIX_FRAC_BITS); if (is_stereo) { @@ -217,7 +217,7 @@ void AudioStreamPlaybackWAV::do_resample(const Depth *p_src, AudioFrame *p_dst, p_dst->r = final_r / 32767.0; p_dst++; - offset += increment; + p_offset += p_increment; } } diff --git a/scene/resources/audio_stream_wav.h b/scene/resources/audio_stream_wav.h index bea273720c..f150a17d21 100644 --- a/scene/resources/audio_stream_wav.h +++ b/scene/resources/audio_stream_wav.h @@ -61,7 +61,7 @@ class AudioStreamPlaybackWAV : public AudioStreamPlayback { Ref base; template - void do_resample(const Depth *p_src, AudioFrame *p_dst, int64_t &offset, int32_t &increment, uint32_t amount, IMA_ADPCM_State *ima_adpcm); + void do_resample(const Depth *p_src, AudioFrame *p_dst, int64_t &p_offset, int32_t &p_increment, uint32_t p_amount, IMA_ADPCM_State *p_ima_adpcm); public: virtual void start(double p_from_pos = 0.0) override; -- cgit v1.2.3