1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Add new audio objects for loading sounds

This commit is contained in:
Ted John
2022-05-09 18:34:38 +01:00
parent 697fa7c436
commit a2e6691ac2
46 changed files with 1583 additions and 1152 deletions

View File

@@ -20,6 +20,7 @@
#include "../core/String.hpp"
#include "../core/Zip.h"
#include "../rct12/SawyerChunkReader.h"
#include "AudioObject.h"
#include "BannerObject.h"
#include "EntranceObject.h"
#include "FootpathItemObject.h"
@@ -69,8 +70,15 @@ public:
ObjectAsset GetAsset(std::string_view path) const override
{
auto absolutePath = Path::Combine(_basePath, path);
return ObjectAsset(absolutePath);
if (Path::IsAbsolute(path))
{
return ObjectAsset(path);
}
else
{
auto absolutePath = Path::Combine(_basePath, path);
return ObjectAsset(absolutePath);
}
}
};
@@ -367,6 +375,9 @@ namespace ObjectFactory
case ObjectType::FootpathRailings:
result = std::make_unique<FootpathRailingsObject>();
break;
case ObjectType::Audio:
result = std::make_unique<AudioObject>();
break;
default:
throw std::runtime_error("Invalid object type");
}
@@ -405,6 +416,8 @@ namespace ObjectFactory
return ObjectType::FootpathSurface;
if (s == "footpath_railings")
return ObjectType::FootpathRailings;
if (s == "audio")
return ObjectType::Audio;
return ObjectType::None;
}