mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 05:43:42 -07:00
blobs are not raw files
This commit is contained in:
parent
fd81ee71ea
commit
929826a19f
1 changed files with 8 additions and 7 deletions
|
@ -62,7 +62,7 @@ typedef std::unordered_set<s16>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
std::string path;
|
std::string path;
|
||||||
std::shared_ptr<Ship::IResource> resource;
|
std::shared_ptr<Ship::File> resource;
|
||||||
std::shared_ptr<s16*> decodedSample; // Set if the record is for a raw sample as opposed to a SFX.
|
std::shared_ptr<s16*> decodedSample; // Set if the record is for a raw sample as opposed to a SFX.
|
||||||
} SfxRecord;
|
} SfxRecord;
|
||||||
|
|
||||||
|
@ -689,8 +689,7 @@ const char* ActorAccessibility_MapSfxToExternalAudio(s16 sfxId) {
|
||||||
if (it == aa->sfxMap.end()) {
|
if (it == aa->sfxMap.end()) {
|
||||||
SfxRecord tempRecord;
|
SfxRecord tempRecord;
|
||||||
std::string fullPath = SfxExtractor::getExternalFileName(sfxId);
|
std::string fullPath = SfxExtractor::getExternalFileName(sfxId);
|
||||||
auto res = std::static_pointer_cast<Ship::Blob>(
|
auto res = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFile(fullPath);
|
||||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(fullPath));
|
|
||||||
|
|
||||||
if (res == nullptr)
|
if (res == nullptr)
|
||||||
return NULL; // Resource doesn't exist, user's gotta run the extractor.
|
return NULL; // Resource doesn't exist, user's gotta run the extractor.
|
||||||
|
@ -700,10 +699,11 @@ const char* ActorAccessibility_MapSfxToExternalAudio(s16 sfxId) {
|
||||||
tempRecord.path = ss.str();
|
tempRecord.path = ss.str();
|
||||||
aa->sfxMap[sfxId] = tempRecord;
|
aa->sfxMap[sfxId] = tempRecord;
|
||||||
record = &aa->sfxMap[sfxId];
|
record = &aa->sfxMap[sfxId];
|
||||||
aa->audioEngine->cacheDecodedSample(record->path, record->resource->GetRawPointer(),
|
aa->audioEngine->cacheDecodedSample(record->path, record->resource->Buffer->data(),
|
||||||
record->resource->GetPointerSize());
|
record->resource->Buffer->size());
|
||||||
} else
|
} else {
|
||||||
record = &it->second;
|
record = &it->second;
|
||||||
|
}
|
||||||
|
|
||||||
return record->path.c_str();
|
return record->path.c_str();
|
||||||
}
|
}
|
||||||
|
@ -730,8 +730,9 @@ const char* ActorAccessibility_MapRawSampleToExternalAudio(const char* name) {
|
||||||
aa->sampleMap[key] = tempRecord;
|
aa->sampleMap[key] = tempRecord;
|
||||||
record = &aa->sampleMap[key];
|
record = &aa->sampleMap[key];
|
||||||
aa->audioEngine->cacheDecodedSample(record->path, wav, wavSize);
|
aa->audioEngine->cacheDecodedSample(record->path, wav, wavSize);
|
||||||
} else
|
} else {
|
||||||
record = &it->second;
|
record = &it->second;
|
||||||
|
}
|
||||||
|
|
||||||
return record->path.c_str();
|
return record->path.c_str();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue