mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-16 15:20:11 -05:00
SoH now uses the multithreaded resource manager. (#2467)
* SoH now uses the multithreaded resource manager. * Fixes build errors on Linux and decreases audio heap size. * Updates LUS.
This commit is contained in:
parent
7c3c662eba
commit
3a4a260e21
@ -22,6 +22,7 @@
|
||||
#include <Utils/MemoryStream.h>
|
||||
#include <Utils/BinaryWriter.h>
|
||||
#include <bit>
|
||||
#include <mutex>
|
||||
|
||||
std::string otrFileName = "oot.otr";
|
||||
std::shared_ptr<Ship::Archive> otrArchive;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit d3e42d7f4e56bfad29aafc1b63a8d09f1d8d720a
|
||||
Subproject commit 1fc9f3795405f6263c3adb3ab8f7d5f0b24b6e75
|
@ -35,7 +35,7 @@
|
||||
#define _SOH64
|
||||
#endif
|
||||
|
||||
#define AUDIO_HEAP_SIZE 0x3800000
|
||||
#define AUDIO_HEAP_SIZE 0x380000
|
||||
#define SYSTEM_HEAP_SIZE (1024 * 1024 * 4)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <fstream>
|
||||
|
||||
#include <ResourceMgr.h>
|
||||
#include <OtrFile.h>
|
||||
#include <DisplayList.h>
|
||||
#include <Window.h>
|
||||
#include <GameVersions.h>
|
||||
@ -878,7 +879,17 @@ std::shared_ptr<Ship::Resource> ResourceMgr_LoadResource(const char* path) {
|
||||
}
|
||||
|
||||
extern "C" char* ResourceMgr_LoadFileRaw(const char* resName) {
|
||||
return OTRGlobals::Instance->context->GetResourceManager()->LoadFile(resName)->Buffer.get();
|
||||
// TODO: This should not exist. Anywhere we are loading textures with this function should be Resources instead.
|
||||
// We are not currently packing our otr archive with certain textures as resources with otr headers.
|
||||
static std::unordered_map<std::string, std::shared_ptr<Ship::OtrFile>> cachedRawFiles;
|
||||
auto file = OTRGlobals::Instance->context->GetResourceManager()->LoadFile(resName);
|
||||
cachedRawFiles[resName] = file;
|
||||
|
||||
if (file == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return file->Buffer.data();
|
||||
}
|
||||
|
||||
extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) {
|
||||
|
@ -6,6 +6,6 @@ void* SetPathways::GetPointer() {
|
||||
}
|
||||
|
||||
size_t SetPathways::GetPointerSize() {
|
||||
return paths.size() * sizeof(std::shared_ptr<Path>);
|
||||
return paths.size() * sizeof(std::shared_ptr<Ship::Path>);
|
||||
}
|
||||
} // namespace Ship
|
||||
|
@ -16,6 +16,6 @@ class SetPathways : public SceneCommand {
|
||||
size_t GetPointerSize();
|
||||
|
||||
uint32_t numPaths;
|
||||
std::vector<std::shared_ptr<Path>> paths;
|
||||
std::vector<std::shared_ptr<Ship::Path>> paths;
|
||||
};
|
||||
}; // namespace Ship
|
||||
|
Loading…
Reference in New Issue
Block a user