From 4a20aa0460d4b5671b1e3767a351009c34594fce Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 30 Sep 2025 22:11:28 +0200 Subject: [PATCH] Rename members of VehicleSoundParams --- src/openrct2-ui/ride/VehicleSounds.cpp | 46 +++++++++++++------------- src/openrct2/audio/Audio.h | 4 +-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/openrct2-ui/ride/VehicleSounds.cpp b/src/openrct2-ui/ride/VehicleSounds.cpp index 6e0047e54e..c73010f8e5 100644 --- a/src/openrct2-ui/ride/VehicleSounds.cpp +++ b/src/openrct2-ui/ride/VehicleSounds.cpp @@ -185,7 +185,7 @@ namespace OpenRCT2::Audio { screenWidth = 64; } - param.pan_x = ((((panX * 65536) / screenWidth) - 0x8000) >> 4); + param.panX = ((((panX * 65536) / screenWidth) - 0x8000) >> 4); int32_t panY = (vehicle.SpriteData.SpriteRect.GetTop() / 2) + (vehicle.SpriteData.SpriteRect.GetBottom() / 2) - gMusicTrackingViewport->viewPos.y; @@ -197,7 +197,7 @@ namespace OpenRCT2::Audio { screenHeight = 64; } - param.pan_y = ((((panY * 65536) / screenHeight) - 0x8000) >> 4); + param.panY = ((((panY * 65536) / screenHeight) - 0x8000) >> 4); int32_t frequency = std::abs(vehicle.velocity); @@ -302,35 +302,35 @@ namespace OpenRCT2::Audio uint8_t vol1 = 0xFF; uint8_t vol2 = 0xFF; - int16_t pan_y = std::abs(sound_params->pan_y); - pan_y = std::min(static_cast(0xFFF), pan_y); - pan_y -= 0x800; - if (pan_y > 0) + int16_t panY = std::abs(sound_params->panY); + panY = std::min(static_cast(0xFFF), panY); + panY -= 0x800; + if (panY > 0) { - pan_y = (0x400 - pan_y) / 4; - vol1 = LoByte(pan_y); - if (static_cast(HiByte(pan_y)) != 0) + panY = (0x400 - panY) / 4; + vol1 = LoByte(panY); + if (static_cast(HiByte(panY)) != 0) { vol1 = 0xFF; - if (static_cast(HiByte(pan_y)) < 0) + if (static_cast(HiByte(panY)) < 0) { vol1 = 0; } } } - int16_t pan_x = std::abs(sound_params->pan_x); - pan_x = std::min(static_cast(0xFFF), pan_x); - pan_x -= 0x800; + int16_t panX = std::abs(sound_params->panX); + panX = std::min(static_cast(0xFFF), panX); + panX -= 0x800; - if (pan_x > 0) + if (panX > 0) { - pan_x = (0x400 - pan_x) / 4; - vol2 = LoByte(pan_x); - if (static_cast(HiByte(pan_x)) != 0) + panX = (0x400 - panX) / 4; + vol2 = LoByte(panX); + if (static_cast(HiByte(panX)) != 0) { vol2 = 0xFF; - if (static_cast(HiByte(pan_x)) < 0) + if (static_cast(HiByte(panX)) < 0) { vol2 = 0; } @@ -491,13 +491,13 @@ namespace OpenRCT2::Audio { auto frequency = SoundFrequency(id, sound_params->frequency); auto looping = IsLoopingSound(id); - auto pan = sound_params->pan_x; + auto pan = sound_params->panX; auto channel = CreateAudioChannel( id, looping, DStoMixerVolume(volume), DStoMixerPan(pan), DStoMixerRate(frequency), false); if (channel != nullptr) { sound.id = id; - sound.pan = sound_params->pan_x; + sound.pan = sound_params->panX; sound.volume = volume; sound.frequency = sound_params->frequency; sound.channel = channel; @@ -513,10 +513,10 @@ namespace OpenRCT2::Audio sound.volume = volume; sound.channel->SetVolume(DStoMixerVolume(volume)); } - if (sound_params->pan_x != sound.pan) + if (sound_params->panX != sound.pan) { - sound.pan = sound_params->pan_x; - sound.channel->SetPan(DStoMixerPan(sound_params->pan_x)); + sound.pan = sound_params->panX; + sound.channel->SetPan(DStoMixerPan(sound_params->panX)); } if (!(getGameState().currentTicks & 3) && sound_params->frequency != sound.frequency) { diff --git a/src/openrct2/audio/Audio.h b/src/openrct2/audio/Audio.h index 44cbdc6935..237fd41dab 100644 --- a/src/openrct2/audio/Audio.h +++ b/src/openrct2/audio/Audio.h @@ -53,8 +53,8 @@ namespace OpenRCT2::Audio struct VehicleSoundParams { uint16_t id; - int16_t pan_x; - int16_t pan_y; + int16_t panX; + int16_t panY; uint16_t frequency; int16_t volume; uint16_t priority;