forked from rosebudai/OpenRCT2-Web
Merge pull request #18312 from IntelOrca/opensounds
Add RMC sounds, audio objects and asset packs
This commit is contained in:
13 files changed
+181
-93
No files matched your search
+30
-2
@@ -64,9 +64,17 @@ set(TITLE_SEQUENCE_VERSION "0.4.0")
|
||||
set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v${TITLE_SEQUENCE_VERSION}/title-sequences.zip")
|
||||
set(TITLE_SEQUENCE_SHA1 "4ab0065e5a4d9f9c77d94718bbdfcfcd5a389da0")
|
||||
|
||||
set(OBJECTS_VERSION "1.3.5")
|
||||
set(OBJECTS_VERSION "1.3.6")
|
||||
set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip")
|
||||
set(OBJECTS_SHA1 "58bddc5f845d8c7eb5d9fd25e52ab1fed24c85db")
|
||||
set(OBJECTS_SHA1 "20e0eb1389918ea1a90ec891f46ef03100b3e935")
|
||||
|
||||
set(OPENSFX_VERSION "1.0.1")
|
||||
set(OPENSFX_URL "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${OPENSFX_VERSION}/opensound.zip")
|
||||
set(OPENSFX_SHA1 "8f04aea33f8034131c3069f6accacce0d94f80c1")
|
||||
|
||||
set(OPENMSX_VERSION "1.0.1")
|
||||
set(OPENMSX_URL "https://github.com/OpenRCT2/OpenMusic/releases/download/v${OPENMSX_VERSION}/openmusic.zip")
|
||||
set(OPENMSX_SHA1 "8ff94490180e2fbfdd13a4130eb300da726ca406")
|
||||
|
||||
set(REPLAYS_VERSION "0.0.70")
|
||||
set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip")
|
||||
@@ -436,6 +444,26 @@ if (NOT MACOS_BUNDLE OR (MACOS_BUNDLE AND WITH_TESTS))
|
||||
SHA1 ${OBJECTS_SHA1}
|
||||
)")
|
||||
endif ()
|
||||
if (DOWNLOAD_OPENSFX)
|
||||
install(CODE "
|
||||
include(${ROOT_DIR}/cmake/download.cmake)
|
||||
download_openrct2_zip(
|
||||
ZIP_VERSION ${OPENSFX_VERSION}
|
||||
DOWNLOAD_DIR \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/
|
||||
ZIP_URL ${OPENSFX_URL}
|
||||
SHA1 ${OPENSFX_SHA1}
|
||||
)")
|
||||
endif ()
|
||||
if (DOWNLOAD_OPENMSX)
|
||||
install(CODE "
|
||||
include(${ROOT_DIR}/cmake/download.cmake)
|
||||
download_openrct2_zip(
|
||||
ZIP_VERSION ${OPENMSX_VERSION}
|
||||
DOWNLOAD_DIR \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/
|
||||
ZIP_URL ${OPENMSX_URL}
|
||||
SHA1 ${OPENMSX_SHA1}
|
||||
)")
|
||||
endif ()
|
||||
if (DOWNLOAD_REPLAYS)
|
||||
# Checks if this version of the replays are already installed, updates if necessary
|
||||
install(CODE "
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
0.4.3 (in development)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: [#17782] The Flying Coaster now has access to boosters and can draw outside loops.
|
||||
- Feature: [#18312, objects#220, OpenSFX#13] New sound effects for the Hybrid and Single Rail roller coasters.
|
||||
- Feature: [objects#221] Add two extra jungle walls.
|
||||
- Feature: [OpenMusic#14, OpenMusic#15, OpenMusic#18] Added Galaxy, Acid and Dodgems ride music styles.
|
||||
- Improved: [#18192] Tycoon Park has been added Extras tab.
|
||||
- Improved: [#18214] Competition scenarios have received their own section.
|
||||
- Improved: [#18250] Added modern style file and folder pickers on Windows.
|
||||
@@ -13,6 +16,7 @@
|
||||
- Change: [#17998] Show cursor when using inverted mouse dragging.
|
||||
- Change: [#18230] Make the large flat to steep pieces available on the corkscrew roller coaster without cheats.
|
||||
- Change: [#18381] Convert custom invisible paths to the built-in ones.
|
||||
- Change: [OpenSFX#11, OpenMusic#19] First implementation of official replacement asset packs for sound effects & music.
|
||||
- Fix: [#1519] “See-through rides” doesn't affect all rides (original bug).
|
||||
- Fix: [#11679] Facilities clipping issues.
|
||||
- Fix: [#14312] Research ride type message incorrect.
|
||||
|
||||
+24
-2
@@ -45,8 +45,12 @@
|
||||
<LibsSha1 Condition="'$(Platform)'=='ARM64'">f3a03c2e7b610fefa28d6962da10144f6324078d</LibsSha1>
|
||||
<TitleSequencesUrl>https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.0/title-sequences.zip</TitleSequencesUrl>
|
||||
<TitleSequencesSha1>4ab0065e5a4d9f9c77d94718bbdfcfcd5a389da0</TitleSequencesSha1>
|
||||
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.3.5/objects.zip</ObjectsUrl>
|
||||
<ObjectsSha1>58bddc5f845d8c7eb5d9fd25e52ab1fed24c85db</ObjectsSha1>
|
||||
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.3.6/objects.zip</ObjectsUrl>
|
||||
<ObjectsSha1>20e0eb1389918ea1a90ec891f46ef03100b3e935</ObjectsSha1>
|
||||
<OpenSFXUrl>https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.1/opensound.zip</OpenSFXUrl>
|
||||
<OpenSFXSha1>8f04aea33f8034131c3069f6accacce0d94f80c1</OpenSFXSha1>
|
||||
<OpenMSXUrl>https://github.com/OpenRCT2/OpenMusic/releases/download/v1.0.1/openmusic.zip</OpenMSXUrl>
|
||||
<OpenMSXSha1>8ff94490180e2fbfdd13a4130eb300da726ca406</OpenMSXSha1>
|
||||
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.70/replays.zip</ReplaysUrl>
|
||||
<ReplaysSha1>09B339E86AAE81580C5AC3E23AC4BC9E030DA076</ReplaysSha1>
|
||||
</PropertyGroup>
|
||||
@@ -128,6 +132,24 @@
|
||||
OutputDirectory="$(TargetDir)data\object" />
|
||||
</Target>
|
||||
|
||||
<!-- Target to download OpenSFX -->
|
||||
<Target Name="DownloadOpenSFX" AfterTargets="Build">
|
||||
<DownloadDependency Name="OpenSFX"
|
||||
Url="$(OpenSFXUrl)"
|
||||
Sha1="$(OpenSFXSha1)"
|
||||
CheckFile="$(DependenciesCheckFile)"
|
||||
OutputDirectory="$(TargetDir)data" />
|
||||
</Target>
|
||||
|
||||
<!-- Target to download OpenMSX -->
|
||||
<Target Name="DownloadOpenMSX" AfterTargets="Build">
|
||||
<DownloadDependency Name="OpenMSX"
|
||||
Url="$(OpenMSXUrl)"
|
||||
Sha1="$(OpenMSXSha1)"
|
||||
CheckFile="$(DependenciesCheckFile)"
|
||||
OutputDirectory="$(TargetDir)data" />
|
||||
</Target>
|
||||
|
||||
<!-- Target to download replays -->
|
||||
<Target Name="DownloadReplays" AfterTargets="Build">
|
||||
<DownloadDependency Name="Replays"
|
||||
|
||||
@@ -15,8 +15,8 @@ let
|
||||
objects-src = pkgs.fetchFromGitHub {
|
||||
owner = "OpenRCT2";
|
||||
repo = "objects";
|
||||
rev = "v1.3.5";
|
||||
sha256 = "4859b7a443d0969cb1c639202fe70f40ac4c2625830657c72645d987912258ff";
|
||||
rev = "v1.3.6";
|
||||
sha256 = "db9c3806a09cf2031f62f8e75cdc014376ec91d3c97e5764f747a88c8d8faf40";
|
||||
};
|
||||
|
||||
title-sequences-src = pkgs.fetchFromGitHub {
|
||||
|
||||
@@ -232,7 +232,21 @@ if(MACOS_BUNDLE)
|
||||
ZIP_URL ${TITLE_SEQUENCE_URL}
|
||||
SHA1 ${TITLE_SEQUENCE_SHA1}
|
||||
)
|
||||
|
||||
|
||||
# download opensfx and openmsx
|
||||
download_openrct2_zip(
|
||||
ZIP_VERSION ${OPENSFX_VERSION}
|
||||
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
|
||||
ZIP_URL ${OPENSFX_URL}
|
||||
SHA1 ${OPENSFX_SHA1}
|
||||
)
|
||||
download_openrct2_zip(
|
||||
ZIP_VERSION ${OPENMSX_VERSION}
|
||||
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
|
||||
ZIP_URL ${OPENMSX_URL}
|
||||
SHA1 ${OPENMSX_SHA1}
|
||||
)
|
||||
|
||||
file(COPY ${OBJECTS_DIR} DESTINATION "${BUNDLE_RESOURCE_DIR}")
|
||||
file(COPY ${TITLE_SEQUENCE_DIR} DESTINATION "${BUNDLE_RESOURCE_DIR}")
|
||||
|
||||
|
||||
@@ -67,12 +67,20 @@ void AssetPackManager::Scan()
|
||||
|
||||
auto context = GetContext();
|
||||
auto env = context->GetPlatformEnvironment();
|
||||
auto assetPackDirectory = fs::u8path(env->GetDirectoryPath(DIRBASE::USER, DIRID::ASSET_PACK));
|
||||
Platform::EnsureDirectoryExists(assetPackDirectory.u8string());
|
||||
|
||||
auto openrct2Dir = fs::u8path(env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::ASSET_PACK));
|
||||
Scan(openrct2Dir);
|
||||
|
||||
auto userDirectory = fs::u8path(env->GetDirectoryPath(DIRBASE::USER, DIRID::ASSET_PACK));
|
||||
Platform::EnsureDirectoryExists(userDirectory.u8string());
|
||||
Scan(userDirectory);
|
||||
}
|
||||
|
||||
void AssetPackManager::Scan(const fs::path& directory)
|
||||
{
|
||||
// Recursively scan for .parkap files
|
||||
std::error_code ec;
|
||||
for (const fs::directory_entry& entry : fs::recursive_directory_iterator(assetPackDirectory, ec))
|
||||
for (const fs::directory_entry& entry : fs::recursive_directory_iterator(directory, ec))
|
||||
{
|
||||
if (!entry.is_directory())
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace OpenRCT2
|
||||
size_t GetAssetPackIndex(std::string_view id);
|
||||
|
||||
void Scan();
|
||||
void Scan(const fs::path& directory);
|
||||
void Reload();
|
||||
void Swap(size_t index, size_t otherIndex);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace OpenRCT2::Audio
|
||||
static std::vector<std::string> _audioDevices;
|
||||
static int32_t _currentAudioDevice = -1;
|
||||
static ObjectEntryIndex _soundsAudioObjectEntryIndex = OBJECT_ENTRY_INDEX_NULL;
|
||||
static ObjectEntryIndex _soundsAdditionalAudioObjectEntryIndex = OBJECT_ENTRY_INDEX_NULL;
|
||||
static ObjectEntryIndex _titleAudioObjectEntryIndex = OBJECT_ENTRY_INDEX_NULL;
|
||||
|
||||
bool gGameSoundsOff = false;
|
||||
@@ -123,6 +124,9 @@ namespace OpenRCT2::Audio
|
||||
}
|
||||
}
|
||||
|
||||
objManager.LoadObject(AudioObjectIdentifiers::OpenRCT2Additional);
|
||||
_soundsAdditionalAudioObjectEntryIndex = objManager.GetLoadedObjectEntryIndex(
|
||||
AudioObjectIdentifiers::OpenRCT2Additional);
|
||||
objManager.LoadObject(AudioObjectIdentifiers::Rct2Circus);
|
||||
}
|
||||
|
||||
@@ -195,12 +199,23 @@ namespace OpenRCT2::Audio
|
||||
return params;
|
||||
}
|
||||
|
||||
AudioObject* GetBaseAudioObject()
|
||||
static std::tuple<AudioObject*, uint32_t> GetAudioObjectAndSampleIndex(SoundId id)
|
||||
{
|
||||
auto& objManager = GetContext()->GetObjectManager();
|
||||
auto* baseAudioObject = static_cast<AudioObject*>(
|
||||
objManager.GetLoadedObject(ObjectType::Audio, _soundsAudioObjectEntryIndex));
|
||||
return baseAudioObject;
|
||||
AudioObject* audioObject{};
|
||||
uint32_t sampleIndex = EnumValue(id);
|
||||
if (id >= SoundId::LiftRMC)
|
||||
{
|
||||
audioObject = static_cast<AudioObject*>(
|
||||
objManager.GetLoadedObject(ObjectType::Audio, _soundsAdditionalAudioObjectEntryIndex));
|
||||
sampleIndex -= EnumValue(SoundId::LiftRMC);
|
||||
}
|
||||
else
|
||||
{
|
||||
audioObject = static_cast<AudioObject*>(
|
||||
objManager.GetLoadedObject(ObjectType::Audio, _soundsAudioObjectEntryIndex));
|
||||
}
|
||||
return std::make_tuple(audioObject, sampleIndex);
|
||||
}
|
||||
|
||||
static void Play(IAudioSource* audioSource, int32_t volume, int32_t pan)
|
||||
@@ -222,13 +237,13 @@ namespace OpenRCT2::Audio
|
||||
return;
|
||||
|
||||
// Get sound from base object
|
||||
auto* baseAudioObject = GetBaseAudioObject();
|
||||
auto [baseAudioObject, sampleIndex] = GetAudioObjectAndSampleIndex(soundId);
|
||||
if (baseAudioObject != nullptr)
|
||||
{
|
||||
auto params = GetParametersFromLocation(baseAudioObject, EnumValue(soundId), loc);
|
||||
auto params = GetParametersFromLocation(baseAudioObject, sampleIndex, loc);
|
||||
if (params.in_range)
|
||||
{
|
||||
auto source = baseAudioObject->GetSample(EnumValue(soundId));
|
||||
auto source = baseAudioObject->GetSample(sampleIndex);
|
||||
if (source != nullptr)
|
||||
{
|
||||
Play(source, params.volume, params.pan);
|
||||
@@ -243,10 +258,10 @@ namespace OpenRCT2::Audio
|
||||
return;
|
||||
|
||||
// Get sound from base object
|
||||
auto* baseAudioObject = GetBaseAudioObject();
|
||||
auto [baseAudioObject, sampleIndex] = GetAudioObjectAndSampleIndex(soundId);
|
||||
if (baseAudioObject != nullptr)
|
||||
{
|
||||
auto source = baseAudioObject->GetSample(EnumValue(soundId));
|
||||
auto source = baseAudioObject->GetSample(sampleIndex);
|
||||
if (source != nullptr)
|
||||
{
|
||||
Play(source, volume, pan);
|
||||
@@ -440,10 +455,10 @@ namespace OpenRCT2::Audio
|
||||
SoundId id, bool loop, int32_t volume, float pan, double rate, bool forget)
|
||||
{
|
||||
// Get sound from base object
|
||||
auto baseAudioObject = GetBaseAudioObject();
|
||||
auto [baseAudioObject, sampleIndex] = GetAudioObjectAndSampleIndex(id);
|
||||
if (baseAudioObject != nullptr)
|
||||
{
|
||||
auto source = baseAudioObject->GetSample(EnumValue(id));
|
||||
auto source = baseAudioObject->GetSample(sampleIndex);
|
||||
if (source != nullptr)
|
||||
{
|
||||
return CreateAudioChannel(source, MixerGroup::Sound, loop, volume, pan, rate, forget);
|
||||
|
||||
@@ -127,6 +127,8 @@ namespace OpenRCT2::Audio
|
||||
DoorClose,
|
||||
Portcullis,
|
||||
CrowdAmbience,
|
||||
LiftRMC,
|
||||
TrackFrictionRMC,
|
||||
NoScream = 254,
|
||||
Null = 255
|
||||
};
|
||||
@@ -140,6 +142,7 @@ namespace OpenRCT2::Audio
|
||||
constexpr std::string_view Rct2cBase = "rct2.audio.base.rctc";
|
||||
constexpr std::string_view Rct2Title = "rct2.audio.title";
|
||||
constexpr std::string_view Rct2Circus = "rct2.audio.circus";
|
||||
constexpr std::string_view OpenRCT2Additional = "openrct2.audio.additional";
|
||||
} // namespace AudioObjectIdentifiers
|
||||
|
||||
extern bool gGameSoundsOff;
|
||||
|
||||
@@ -91,72 +91,6 @@ static constexpr const OpenRCT2::Audio::SoundId _screamSet2[] = {
|
||||
OpenRCT2::Audio::SoundId::Scream6,
|
||||
};
|
||||
|
||||
static constexpr const uint8_t _soundParams[OpenRCT2::Audio::RCT2SoundCount][2] = {
|
||||
{ 1, 0 }, // LiftClassic
|
||||
{ 1, 0 }, // TrackFrictionClassicWood
|
||||
{ 1, 0 }, // FrictionClassic
|
||||
{ 0, 1 }, // Scream1
|
||||
{ 0, 0 }, // Click1
|
||||
{ 0, 0 }, // Click2
|
||||
{ 0, 0 }, // PlaceItem
|
||||
{ 0, 1 }, // Scream2
|
||||
{ 0, 1 }, // Scream3
|
||||
{ 0, 1 }, // Scream4
|
||||
{ 0, 1 }, // Scream5
|
||||
{ 0, 1 }, // Scream6
|
||||
{ 1, 0 }, // LiftFrictionWheels
|
||||
{ 0, 0 }, // Purchase
|
||||
{ 0, 0 }, // Crash
|
||||
{ 0, 0 }, // LayingOutWater
|
||||
{ 0, 0 }, // Water1
|
||||
{ 0, 0 }, // Water2
|
||||
{ 0, 1 }, // TrainWhistle
|
||||
{ 0, 1 }, // TrainDeparting
|
||||
{ 0, 0 }, // WaterSplash
|
||||
{ 1, 0 }, // GoKartEngine
|
||||
{ 0, 0 }, // RideLaunch1
|
||||
{ 0, 0 }, // RideLaunch2
|
||||
{ 0, 0 }, // Cough1
|
||||
{ 0, 0 }, // Cough2
|
||||
{ 0, 0 }, // Cough3
|
||||
{ 0, 0 }, // Cough4
|
||||
{ 1, 0 }, // Rain
|
||||
{ 0, 0 }, // Thunder1
|
||||
{ 0, 0 }, // Thunder2
|
||||
{ 1, 0 }, // TrackFrictionTrain
|
||||
{ 1, 0 }, // TrackFrictionWater
|
||||
{ 0, 0 }, // BalloonPop
|
||||
{ 0, 0 }, // MechanicFix
|
||||
{ 0, 1 }, // Scream7
|
||||
{ 0, 0 }, // ToiletFlush
|
||||
{ 0, 0 }, // Click3
|
||||
{ 0, 0 }, // Quack
|
||||
{ 0, 0 }, // NewsItem
|
||||
{ 0, 0 }, // WindowOpen
|
||||
{ 0, 0 }, // Laugh1
|
||||
{ 0, 0 }, // Laugh2
|
||||
{ 0, 0 }, // Laugh3
|
||||
{ 0, 0 }, // Applause
|
||||
{ 0, 0 }, // HauntedHouseScare
|
||||
{ 0, 0 }, // HauntedHouseScream1
|
||||
{ 0, 0 }, // HauntedHouseScream2
|
||||
{ 0, 0 }, // BlockBrakeClose
|
||||
{ 0, 0 }, // BlockBrakeRelease
|
||||
{ 0, 0 }, // Error
|
||||
{ 0, 0 }, // BrakeRelease
|
||||
{ 1, 0 }, // LiftArrow
|
||||
{ 1, 0 }, // LiftWood
|
||||
{ 1, 0 }, // TrackFrictionWood
|
||||
{ 1, 0 }, // LiftWildMouse
|
||||
{ 1, 0 }, // LiftBM
|
||||
{ 1, 2 }, // TrackFrictionBM
|
||||
{ 0, 1 }, // Scream8
|
||||
{ 0, 1 }, // Tram
|
||||
{ 0, 0 }, // DoorOpen
|
||||
{ 0, 0 }, // DoorClose
|
||||
{ 0, 0 }, // Portcullis
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
static constexpr const uint8_t SpaceRingsTimeToSpriteMap[] =
|
||||
{
|
||||
@@ -1047,6 +981,64 @@ static OpenRCT2::Audio::VehicleSound* vehicle_sounds_update_get_vehicle_sound(Op
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static bool IsLoopingSound(SoundId id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case SoundId::LiftClassic:
|
||||
case SoundId::TrackFrictionClassicWood:
|
||||
case SoundId::FrictionClassic:
|
||||
case SoundId::LiftFrictionWheels:
|
||||
case SoundId::GoKartEngine:
|
||||
case SoundId::TrackFrictionTrain:
|
||||
case SoundId::TrackFrictionWater:
|
||||
case SoundId::LiftArrow:
|
||||
case SoundId::LiftWood:
|
||||
case SoundId::TrackFrictionWood:
|
||||
case SoundId::LiftWildMouse:
|
||||
case SoundId::LiftBM:
|
||||
case SoundId::TrackFrictionBM:
|
||||
case SoundId::LiftRMC:
|
||||
case SoundId::TrackFrictionRMC:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsFixedFrequencySound(SoundId id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case SoundId::Scream1:
|
||||
case SoundId::Scream2:
|
||||
case SoundId::Scream3:
|
||||
case SoundId::Scream4:
|
||||
case SoundId::Scream5:
|
||||
case SoundId::Scream6:
|
||||
case SoundId::Scream7:
|
||||
case SoundId::Scream8:
|
||||
case SoundId::TrainWhistle:
|
||||
case SoundId::TrainDeparting:
|
||||
case SoundId::Tram:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsSpecialFrequencySound(SoundId id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case SoundId::TrackFrictionBM:
|
||||
case SoundId::TrackFrictionRMC:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
enum class SoundType
|
||||
{
|
||||
TrackNoises,
|
||||
@@ -1057,7 +1049,7 @@ template<SoundType type> static uint16_t SoundFrequency(const OpenRCT2::Audio::S
|
||||
{
|
||||
if constexpr (type == SoundType::TrackNoises)
|
||||
{
|
||||
if (_soundParams[static_cast<uint8_t>(id)][1] & 2)
|
||||
if (IsSpecialFrequencySound(id))
|
||||
{
|
||||
return (baseFrequency / 2) + 4000;
|
||||
}
|
||||
@@ -1065,7 +1057,7 @@ template<SoundType type> static uint16_t SoundFrequency(const OpenRCT2::Audio::S
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_soundParams[static_cast<uint8_t>(id)][1] & 1)
|
||||
if (IsFixedFrequencySound(id))
|
||||
{
|
||||
return 22050;
|
||||
}
|
||||
@@ -1075,7 +1067,7 @@ template<SoundType type> static uint16_t SoundFrequency(const OpenRCT2::Audio::S
|
||||
|
||||
template<SoundType type> static bool ShouldUpdateChannelRate(const OpenRCT2::Audio::SoundId id)
|
||||
{
|
||||
return type == SoundType::TrackNoises || !(_soundParams[static_cast<uint8_t>(id)][1] & 1);
|
||||
return type == SoundType::TrackNoises || !IsFixedFrequencySound(id);
|
||||
}
|
||||
|
||||
template<SoundType type>
|
||||
@@ -1105,7 +1097,7 @@ static void UpdateSound(
|
||||
if (sound.Id == OpenRCT2::Audio::SoundId::Null)
|
||||
{
|
||||
auto frequency = SoundFrequency<type>(id, sound_params->frequency);
|
||||
auto looping = _soundParams[static_cast<uint8_t>(id)][0];
|
||||
auto looping = IsLoopingSound(id);
|
||||
auto pan = sound_params->pan_x;
|
||||
auto channel = CreateAudioChannel(
|
||||
id, looping, DStoMixerVolume(volume), DStoMixerPan(pan), DStoMixerRate(frequency), false);
|
||||
|
||||
@@ -507,6 +507,7 @@ enum
|
||||
FRICTION_SOUND_WATERSLIDE = 32,
|
||||
FRICTION_SOUND_WOOD_LARGE = 54,
|
||||
FRICTION_SOUND_STEEL_SMOOTH = 57,
|
||||
FRICTION_SOUND_HYBRID = 65,
|
||||
FRICTION_SOUND_NONE = 255
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ constexpr const RideTypeDescriptor HybridCoasterRTD =
|
||||
SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)),
|
||||
SET_FIELD(Heights, { 43, 24, 13, 13}),
|
||||
SET_FIELD(MaxMass, 18),
|
||||
SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 5, 8 }),
|
||||
SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftRMC, 5, 8 }),
|
||||
SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_hybrid_coaster),
|
||||
SET_FIELD(RatingsMultipliers, { 52, 36, 10 }),
|
||||
SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }),
|
||||
|
||||
@@ -34,7 +34,7 @@ constexpr const RideTypeDescriptor SingleRailRollerCoasterRTD =
|
||||
SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)),
|
||||
SET_FIELD(Heights, { 28, 24, 5, 7}),
|
||||
SET_FIELD(MaxMass, 18),
|
||||
SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 5, 8 }),
|
||||
SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftRMC, 5, 8 }),
|
||||
SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_single_rail_roller_coaster),
|
||||
SET_FIELD(RatingsMultipliers, { 52, 36, 10 }),
|
||||
SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }),
|
||||
|
||||
Reference in new issue
Block a user