mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-04-28 20:37:58 +03:00
Fixed compilation with latest LUS
This commit is contained in:
parent
0ba0dffe2b
commit
e603bf3e7f
7 changed files with 20 additions and 15 deletions
|
@ -315,14 +315,14 @@ void GameEngine::LoadManifest() {
|
|||
continue;
|
||||
}
|
||||
|
||||
auto file = entry->LoadFile(path, init);
|
||||
auto file = entry->LoadFile(path);
|
||||
|
||||
if(file == nullptr){
|
||||
continue;
|
||||
}
|
||||
|
||||
auto raw = loader->LoadResource(file);
|
||||
auto res = static_pointer_cast<Ship::Json>(raw);
|
||||
auto raw = loader->LoadResource(path, file, init);
|
||||
auto res = std::static_pointer_cast<Ship::Json>(raw);
|
||||
if (res == nullptr) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -64,10 +64,10 @@ std::optional<std::string> LoadFromO2R(const std::string& path, const std::share
|
|||
std::shared_ptr<SF64::Text> res;
|
||||
|
||||
if (archive == nullptr) {
|
||||
res = static_pointer_cast<SF64::Text>(Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path, true, init));
|
||||
res = std::static_pointer_cast<SF64::Text>(Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path, true, init));
|
||||
} else {
|
||||
auto file = archive->LoadFile(path, init);
|
||||
res = static_pointer_cast<SF64::Text>(loader->GetResourceLoader()->LoadResource(file));
|
||||
auto file = archive->LoadFile(path);
|
||||
res = std::static_pointer_cast<SF64::Text>(loader->GetResourceLoader()->LoadResource(path, file, init));
|
||||
}
|
||||
|
||||
if (res == nullptr) {
|
||||
|
|
|
@ -39,10 +39,12 @@ std::shared_ptr<Ship::IResource> ResourceFactoryBinaryMessageV0::ReadResource(st
|
|||
return msg;
|
||||
}
|
||||
|
||||
std::shared_ptr<Ship::IResource> ResourceFactoryXMLMessageV0::ReadResource(std::shared_ptr<Ship::File> file) {
|
||||
if (!FileHasValidFormatAndReader(file)) {
|
||||
std::shared_ptr<Ship::IResource> ResourceFactoryXMLMessageV0::ReadResource(std::shared_ptr<Ship::File> file,
|
||||
std::shared_ptr<Ship::ResourceInitData> initData) {
|
||||
if (!FileHasValidFormatAndReader(file, initData)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto msg = std::make_shared<Message>(file->InitData);
|
||||
auto parent = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader)->FirstChildElement("Message");
|
||||
auto id = parent->IntAttribute("Id", -1);
|
||||
|
|
|
@ -14,7 +14,8 @@ class ResourceFactoryBinaryMessageV0 : public Ship::ResourceFactoryBinary {
|
|||
|
||||
class ResourceFactoryXMLMessageV0 : public Ship::ResourceFactoryXML {
|
||||
public:
|
||||
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
|
||||
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
|
||||
std::shared_ptr<Ship::ResourceInitData> initData) override;
|
||||
};
|
||||
}; // namespace LUS
|
||||
#else
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
#include "../type/Text.h"
|
||||
|
||||
namespace SF64 {
|
||||
std::shared_ptr<Ship::IResource> ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr<Ship::File> file) {
|
||||
if (!FileHasValidFormatAndReader(file)) {
|
||||
std::shared_ptr<Ship::IResource> ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr<Ship::File> file,
|
||||
std::shared_ptr<Ship::ResourceInitData> initData) {
|
||||
if (!FileHasValidFormatAndReader(file, initData)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
namespace SF64 {
|
||||
class ResourceFactoryBinaryTextV0 : public Ship::ResourceFactoryBinary {
|
||||
public:
|
||||
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
|
||||
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
|
||||
std::shared_ptr<Ship::ResourceInitData> initData) override;
|
||||
};
|
||||
}; // namespace SF64
|
||||
|
|
|
@ -140,7 +140,7 @@ void ResourceFactoryXMLSoundFontV0::ParseInstruments(SoundFont* soundFont, tinyx
|
|||
instrument->lowPitchTunedSample.tuning = instrumentElement->FloatAttribute("Tuning");
|
||||
const char* sampleStr = instrumentElement->Attribute("SampleRef");
|
||||
if (sampleStr != nullptr && sampleStr[0] != 0) {
|
||||
auto res = static_pointer_cast<Sample>(
|
||||
auto res = std::static_pointer_cast<Sample>(
|
||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleStr, true));
|
||||
auto sample = static_cast<SampleData*>(res ? res->GetRawPointer() : nullptr);
|
||||
instrument->lowPitchTunedSample.sample = sample;
|
||||
|
@ -155,7 +155,7 @@ void ResourceFactoryXMLSoundFontV0::ParseInstruments(SoundFont* soundFont, tinyx
|
|||
instrument->normalPitchTunedSample.tuning = instrumentElement->FloatAttribute("Tuning");
|
||||
const char* sampleStr = instrumentElement->Attribute("SampleRef");
|
||||
if (sampleStr != nullptr && sampleStr[0] != 0) {
|
||||
auto res = static_pointer_cast<Sample>(
|
||||
auto res = std::static_pointer_cast<Sample>(
|
||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleStr, true));
|
||||
auto sample = static_cast<SampleData*>(res ? res->GetRawPointer() : nullptr);
|
||||
instrument->normalPitchTunedSample.sample = sample;
|
||||
|
@ -170,7 +170,7 @@ void ResourceFactoryXMLSoundFontV0::ParseInstruments(SoundFont* soundFont, tinyx
|
|||
instrument->highPitchTunedSample.tuning = instrumentElement->FloatAttribute("Tuning");
|
||||
const char* sampleStr = instrumentElement->Attribute("SampleRef");
|
||||
if (sampleStr != nullptr && sampleStr[0] != 0) {
|
||||
auto res = static_pointer_cast<Sample>(
|
||||
auto res = std::static_pointer_cast<Sample>(
|
||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleStr, true));
|
||||
auto sample = static_cast<SampleData*>(res ? res->GetRawPointer() : nullptr);
|
||||
instrument->highPitchTunedSample.sample = sample;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue