summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
m---------libultraship0
-rw-r--r--soh/assets/.gitignore1
-rw-r--r--soh/include/macros.h4
-rw-r--r--soh/soh/OTRGlobals.cpp2
-rw-r--r--soh/soh/resource/importer/AnimationFactory.cpp6
-rw-r--r--soh/soh/resource/importer/AnimationFactory.h2
-rw-r--r--soh/soh/resource/importer/ArrayFactory.cpp6
-rw-r--r--soh/soh/resource/importer/ArrayFactory.h2
-rw-r--r--soh/soh/resource/importer/AudioSampleFactory.cpp6
-rw-r--r--soh/soh/resource/importer/AudioSampleFactory.h2
-rw-r--r--soh/soh/resource/importer/AudioSequenceFactory.cpp6
-rw-r--r--soh/soh/resource/importer/AudioSequenceFactory.h2
-rw-r--r--soh/soh/resource/importer/AudioSoundFontFactory.cpp6
-rw-r--r--soh/soh/resource/importer/AudioSoundFontFactory.h2
-rw-r--r--soh/soh/resource/importer/BackgroundFactory.cpp6
-rw-r--r--soh/soh/resource/importer/BackgroundFactory.h2
-rw-r--r--soh/soh/resource/importer/CollisionHeaderFactory.cpp12
-rw-r--r--soh/soh/resource/importer/CollisionHeaderFactory.h4
-rw-r--r--soh/soh/resource/importer/CutsceneFactory.cpp6
-rw-r--r--soh/soh/resource/importer/CutsceneFactory.h2
-rw-r--r--soh/soh/resource/importer/PathFactory.cpp12
-rw-r--r--soh/soh/resource/importer/PathFactory.h4
-rw-r--r--soh/soh/resource/importer/PlayerAnimationFactory.cpp6
-rw-r--r--soh/soh/resource/importer/PlayerAnimationFactory.h2
-rw-r--r--soh/soh/resource/importer/SceneFactory.cpp12
-rw-r--r--soh/soh/resource/importer/SceneFactory.h4
-rw-r--r--soh/soh/resource/importer/SkeletonFactory.cpp12
-rw-r--r--soh/soh/resource/importer/SkeletonFactory.h4
-rw-r--r--soh/soh/resource/importer/SkeletonLimbFactory.cpp12
-rw-r--r--soh/soh/resource/importer/SkeletonLimbFactory.h4
-rw-r--r--soh/soh/resource/importer/TextFactory.cpp12
-rw-r--r--soh/soh/resource/importer/TextFactory.h4
33 files changed, 96 insertions, 81 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19703c989..2771ee8c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -199,6 +199,11 @@ find_package(Python3 COMPONENTS Interpreter)
add_custom_target(
ExtractAssets
COMMAND ${CMAKE_COMMAND} -E rm -f oot.otr oot-mq.otr soh.otr
+
+ # copy LUS default shaders into assets/custom
+ COMMAND ${CMAKE_COMMAND} -E rm -r -f ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/shaders/ ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/
+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --xml-root ../soh/assets/xml --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
@@ -220,6 +225,11 @@ add_custom_target(
add_custom_target(
GenerateSohOtr
COMMAND ${CMAKE_COMMAND} -E rm -f soh.otr
+
+ # copy LUS default shaders into assets/custom
+ COMMAND ${CMAKE_COMMAND} -E rm -r -f ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/shaders/ ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/
+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --norom --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLYSOHOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
diff --git a/libultraship b/libultraship
-Subproject 02bb77ef253e2de0969fd2cb36ad2e870677d18
+Subproject 455b6dadef901d586332d6015fd2fd01ff07b54
diff --git a/soh/assets/.gitignore b/soh/assets/.gitignore
index d75078bf1..7a844a727 100644
--- a/soh/assets/.gitignore
+++ b/soh/assets/.gitignore
@@ -5,3 +5,4 @@
*.vtx.inc
*.dlist.inc
!*.png
+custom/shaders
diff --git a/soh/include/macros.h b/soh/include/macros.h
index 302e3755d..325fb91b6 100644
--- a/soh/include/macros.h
+++ b/soh/include/macros.h
@@ -8,6 +8,10 @@
// #define __attribute__(x)
// #endif
+// this was removed from the LUS rcp.h in https://github.com/Kenix3/libultraship/pull/833/
+// it is still used in graph.c and fault.c
+#define HW_REG(reg, type) *(volatile type*)((reg) | 0xA0000000)
+
// SoH [Port] Always use the AVOID_UB version (we don't set AVOID_UB while building yet)
/*
#ifndef AVOID_UB
diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp
index 3809a2ac6..5cdf06d9e 100644
--- a/soh/soh/OTRGlobals.cpp
+++ b/soh/soh/OTRGlobals.cpp
@@ -909,7 +909,7 @@ OTRVersion ReadPortVersionFromOTR(std::string otrPath) {
// Use a temporary archive instance to load the otr and read the version file
auto archive = std::make_shared<Ship::OtrArchive>(otrPath);
if (archive->Open()) {
- auto t = archive->LoadFile("portVersion", std::make_shared<Ship::ResourceInitData>());
+ auto t = archive->LoadFile("portVersion");
if (t != nullptr && t->IsLoaded) {
auto stream = std::make_shared<Ship::MemoryStream>(t->Buffer->data(), t->Buffer->size());
auto reader = std::make_shared<Ship::BinaryReader>(stream);
diff --git a/soh/soh/resource/importer/AnimationFactory.cpp b/soh/soh/resource/importer/AnimationFactory.cpp
index 13aa71c86..45b582035 100644
--- a/soh/soh/resource/importer/AnimationFactory.cpp
+++ b/soh/soh/resource/importer/AnimationFactory.cpp
@@ -3,12 +3,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto animation = std::make_shared<Animation>(file->InitData);
+ auto animation = std::make_shared<Animation>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
AnimationType animType = (AnimationType)reader->ReadUInt32();
diff --git a/soh/soh/resource/importer/AnimationFactory.h b/soh/soh/resource/importer/AnimationFactory.h
index ae27832b6..b77374602 100644
--- a/soh/soh/resource/importer/AnimationFactory.h
+++ b/soh/soh/resource/importer/AnimationFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryAnimationV0 : 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 SOH
diff --git a/soh/soh/resource/importer/ArrayFactory.cpp b/soh/soh/resource/importer/ArrayFactory.cpp
index 39be7c093..50e208a48 100644
--- a/soh/soh/resource/importer/ArrayFactory.cpp
+++ b/soh/soh/resource/importer/ArrayFactory.cpp
@@ -4,12 +4,12 @@
#include "graphic/Fast3D/lus_gbi.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryArrayV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryArrayV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto array = std::make_shared<Array>(file->InitData);
+ auto array = std::make_shared<Array>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
array->ArrayType = (ArrayResourceType)reader->ReadUInt32();
diff --git a/soh/soh/resource/importer/ArrayFactory.h b/soh/soh/resource/importer/ArrayFactory.h
index b9f5ca75b..4497591c4 100644
--- a/soh/soh/resource/importer/ArrayFactory.h
+++ b/soh/soh/resource/importer/ArrayFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryArrayV0 : 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 LUS
diff --git a/soh/soh/resource/importer/AudioSampleFactory.cpp b/soh/soh/resource/importer/AudioSampleFactory.cpp
index 0ec3f5260..8ef0b9657 100644
--- a/soh/soh/resource/importer/AudioSampleFactory.cpp
+++ b/soh/soh/resource/importer/AudioSampleFactory.cpp
@@ -3,12 +3,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto audioSample = std::make_shared<AudioSample>(file->InitData);
+ auto audioSample = std::make_shared<AudioSample>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
audioSample->sample.codec = reader->ReadUByte();
diff --git a/soh/soh/resource/importer/AudioSampleFactory.h b/soh/soh/resource/importer/AudioSampleFactory.h
index 372e8a310..5a1a9da3a 100644
--- a/soh/soh/resource/importer/AudioSampleFactory.h
+++ b/soh/soh/resource/importer/AudioSampleFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryAudioSampleV2 : 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 SOH
diff --git a/soh/soh/resource/importer/AudioSequenceFactory.cpp b/soh/soh/resource/importer/AudioSequenceFactory.cpp
index 35da7f798..a10ae7eee 100644
--- a/soh/soh/resource/importer/AudioSequenceFactory.cpp
+++ b/soh/soh/resource/importer/AudioSequenceFactory.cpp
@@ -3,12 +3,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto audioSequence = std::make_shared<AudioSequence>(file->InitData);
+ auto audioSequence = std::make_shared<AudioSequence>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
audioSequence->sequence.seqDataSize = reader->ReadInt32();
diff --git a/soh/soh/resource/importer/AudioSequenceFactory.h b/soh/soh/resource/importer/AudioSequenceFactory.h
index 35fd1ebef..71b1f713d 100644
--- a/soh/soh/resource/importer/AudioSequenceFactory.h
+++ b/soh/soh/resource/importer/AudioSequenceFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryAudioSequenceV2 : 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 SOH
diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.cpp b/soh/soh/resource/importer/AudioSoundFontFactory.cpp
index 534a7914c..e5c637574 100644
--- a/soh/soh/resource/importer/AudioSoundFontFactory.cpp
+++ b/soh/soh/resource/importer/AudioSoundFontFactory.cpp
@@ -4,12 +4,12 @@
#include "libultraship/libultraship.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto audioSoundFont = std::make_shared<AudioSoundFont>(file->InitData);
+ auto audioSoundFont = std::make_shared<AudioSoundFont>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
audioSoundFont->soundFont.fntIndex = reader->ReadInt32();
diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.h b/soh/soh/resource/importer/AudioSoundFontFactory.h
index a80b8fe97..5db75aa66 100644
--- a/soh/soh/resource/importer/AudioSoundFontFactory.h
+++ b/soh/soh/resource/importer/AudioSoundFontFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryAudioSoundFontV2 : 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 SOH
diff --git a/soh/soh/resource/importer/BackgroundFactory.cpp b/soh/soh/resource/importer/BackgroundFactory.cpp
index 6be484698..e8902827f 100644
--- a/soh/soh/resource/importer/BackgroundFactory.cpp
+++ b/soh/soh/resource/importer/BackgroundFactory.cpp
@@ -3,12 +3,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto background = std::make_shared<Background>(file->InitData);
+ auto background = std::make_shared<Background>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t dataSize = reader->ReadUInt32();
diff --git a/soh/soh/resource/importer/BackgroundFactory.h b/soh/soh/resource/importer/BackgroundFactory.h
index e74e897e9..587f750a1 100644
--- a/soh/soh/resource/importer/BackgroundFactory.h
+++ b/soh/soh/resource/importer/BackgroundFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryBackgroundV0 : 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 SOH
diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.cpp b/soh/soh/resource/importer/CollisionHeaderFactory.cpp
index 4636d80c7..0c615fa87 100644
--- a/soh/soh/resource/importer/CollisionHeaderFactory.cpp
+++ b/soh/soh/resource/importer/CollisionHeaderFactory.cpp
@@ -3,12 +3,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto collisionHeader = std::make_shared<CollisionHeader>(file->InitData);
+ auto collisionHeader = std::make_shared<CollisionHeader>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
collisionHeader->collisionHeaderData.minBounds.x = reader->ReadInt16();
@@ -123,12 +123,12 @@ std::shared_ptr<Ship::IResource> ResourceFactoryBinaryCollisionHeaderV0::ReadRes
return collisionHeader;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto collisionHeader = std::make_shared<CollisionHeader>(file->InitData);
+ auto collisionHeader = std::make_shared<CollisionHeader>(initData);
auto reader = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader)->FirstChildElement();
auto child = reader->FirstChildElement();
diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.h b/soh/soh/resource/importer/CollisionHeaderFactory.h
index dd438f9c3..66702f33d 100644
--- a/soh/soh/resource/importer/CollisionHeaderFactory.h
+++ b/soh/soh/resource/importer/CollisionHeaderFactory.h
@@ -7,11 +7,11 @@
namespace SOH {
class ResourceFactoryBinaryCollisionHeaderV0 : 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;
};
class ResourceFactoryXMLCollisionHeaderV0 : 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 SOH
diff --git a/soh/soh/resource/importer/CutsceneFactory.cpp b/soh/soh/resource/importer/CutsceneFactory.cpp
index 49e44680c..63a5695e9 100644
--- a/soh/soh/resource/importer/CutsceneFactory.cpp
+++ b/soh/soh/resource/importer/CutsceneFactory.cpp
@@ -58,12 +58,12 @@ static inline uint32_t read_CMD_HH(std::shared_ptr<Ship::BinaryReader> reader) {
}
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto cutscene = std::make_shared<Cutscene>(file->InitData);
+ auto cutscene = std::make_shared<Cutscene>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t numEntries = reader->ReadUInt32();
diff --git a/soh/soh/resource/importer/CutsceneFactory.h b/soh/soh/resource/importer/CutsceneFactory.h
index 8afe98bb8..9eb5e1415 100644
--- a/soh/soh/resource/importer/CutsceneFactory.h
+++ b/soh/soh/resource/importer/CutsceneFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryCutsceneV0 : 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 SOH
diff --git a/soh/soh/resource/importer/PathFactory.cpp b/soh/soh/resource/importer/PathFactory.cpp
index f0f92be02..19c374c64 100644
--- a/soh/soh/resource/importer/PathFactory.cpp
+++ b/soh/soh/resource/importer/PathFactory.cpp
@@ -4,12 +4,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto path = std::make_shared<Path>(file->InitData);
+ auto path = std::make_shared<Path>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
path->numPaths = reader->ReadUInt32();
@@ -43,12 +43,12 @@ std::shared_ptr<Ship::IResource> ResourceFactoryBinaryPathV0::ReadResource(std::
return path;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLPathV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLPathV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto path = std::make_shared<Path>(file->InitData);
+ auto path = std::make_shared<Path>(initData);
auto reader = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader);
auto pathElement = reader->RootElement();
diff --git a/soh/soh/resource/importer/PathFactory.h b/soh/soh/resource/importer/PathFactory.h
index 9dd73b110..2cba7d219 100644
--- a/soh/soh/resource/importer/PathFactory.h
+++ b/soh/soh/resource/importer/PathFactory.h
@@ -7,11 +7,11 @@
namespace SOH {
class ResourceFactoryBinaryPathV0 : 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;
};
class ResourceFactoryXMLPathV0 : 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 SOH
diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.cpp b/soh/soh/resource/importer/PlayerAnimationFactory.cpp
index 59610da46..76857b351 100644
--- a/soh/soh/resource/importer/PlayerAnimationFactory.cpp
+++ b/soh/soh/resource/importer/PlayerAnimationFactory.cpp
@@ -3,12 +3,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto playerAnimation = std::make_shared<PlayerAnimation>(file->InitData);
+ auto playerAnimation = std::make_shared<PlayerAnimation>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t numEntries = reader->ReadUInt32();
diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.h b/soh/soh/resource/importer/PlayerAnimationFactory.h
index 3ee8b1d3a..d7efb5035 100644
--- a/soh/soh/resource/importer/PlayerAnimationFactory.h
+++ b/soh/soh/resource/importer/PlayerAnimationFactory.h
@@ -6,6 +6,6 @@
namespace SOH {
class ResourceFactoryBinaryPlayerAnimationV0 : 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 SOH
diff --git a/soh/soh/resource/importer/SceneFactory.cpp b/soh/soh/resource/importer/SceneFactory.cpp
index 1bcf92e1c..b8cecf5b5 100644
--- a/soh/soh/resource/importer/SceneFactory.cpp
+++ b/soh/soh/resource/importer/SceneFactory.cpp
@@ -93,12 +93,12 @@ std::shared_ptr<ISceneCommand> ResourceFactoryBinarySceneV0::ParseSceneCommand(s
return result;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto scene = std::make_shared<Scene>(file->InitData);
+ auto scene = std::make_shared<Scene>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
ParseSceneCommands(scene, reader);
@@ -216,12 +216,12 @@ std::shared_ptr<ISceneCommand> ResourceFactoryXMLSceneV0::ParseSceneCommand(std:
return result;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto scene = std::make_shared<Scene>(file->InitData);
+ auto scene = std::make_shared<Scene>(initData);
auto reader = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader);
ParseSceneCommands(scene, reader);
diff --git a/soh/soh/resource/importer/SceneFactory.h b/soh/soh/resource/importer/SceneFactory.h
index 115c3f3f5..52a4c42c9 100644
--- a/soh/soh/resource/importer/SceneFactory.h
+++ b/soh/soh/resource/importer/SceneFactory.h
@@ -12,7 +12,7 @@ class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary {
public:
ResourceFactoryBinarySceneV0();
- 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;
void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<Ship::BinaryReader> reader);
// Doing something very similar to what we do on the ResourceLoader.
@@ -28,7 +28,7 @@ class ResourceFactoryXMLSceneV0 : public Ship::ResourceFactoryXML {
public:
ResourceFactoryXMLSceneV0();
- 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;
void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<tinyxml2::XMLDocument> reader);
// Doing something very similar to what we do on the ResourceLoader.
diff --git a/soh/soh/resource/importer/SkeletonFactory.cpp b/soh/soh/resource/importer/SkeletonFactory.cpp
index d4cb965bf..e9545b978 100644
--- a/soh/soh/resource/importer/SkeletonFactory.cpp
+++ b/soh/soh/resource/importer/SkeletonFactory.cpp
@@ -4,12 +4,12 @@
#include <libultraship/libultraship.h>
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto skeleton = std::make_shared<Skeleton>(file->InitData);
+ auto skeleton = std::make_shared<Skeleton>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
skeleton->type = (SkeletonType)reader->ReadInt8();
@@ -62,12 +62,12 @@ std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(s
return skeleton;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto skel = std::make_shared<Skeleton>(file->InitData);
+ auto skel = std::make_shared<Skeleton>(initData);
auto reader = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader)->FirstChildElement();
auto child = reader->FirstChildElement();
diff --git a/soh/soh/resource/importer/SkeletonFactory.h b/soh/soh/resource/importer/SkeletonFactory.h
index 24f92720a..33c1ea12b 100644
--- a/soh/soh/resource/importer/SkeletonFactory.h
+++ b/soh/soh/resource/importer/SkeletonFactory.h
@@ -7,11 +7,11 @@
namespace SOH {
class ResourceFactoryBinarySkeletonV0 : 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;
};
class ResourceFactoryXMLSkeletonV0 : 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 SOH
diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.cpp b/soh/soh/resource/importer/SkeletonLimbFactory.cpp
index 3f780e6d4..4efdd66dc 100644
--- a/soh/soh/resource/importer/SkeletonLimbFactory.cpp
+++ b/soh/soh/resource/importer/SkeletonLimbFactory.cpp
@@ -4,12 +4,12 @@
#include "libultraship/libultraship.h"
namespace SOH {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto skeletonLimb = std::make_shared<SkeletonLimb>(file->InitData);
+ auto skeletonLimb = std::make_shared<SkeletonLimb>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
skeletonLimb->limbType = (LimbType)reader->ReadInt8();
@@ -184,12 +184,12 @@ std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonLimbV0::ReadResour
return skeletonLimb;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto skelLimb = std::make_shared<SkeletonLimb>(file->InitData);
+ auto skelLimb = std::make_shared<SkeletonLimb>(initData);
auto reader = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader)->FirstChildElement();
std::string limbType = reader->Attribute("Type");
diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.h b/soh/soh/resource/importer/SkeletonLimbFactory.h
index 222cefa2c..cb5b9da22 100644
--- a/soh/soh/resource/importer/SkeletonLimbFactory.h
+++ b/soh/soh/resource/importer/SkeletonLimbFactory.h
@@ -7,11 +7,11 @@
namespace SOH {
class ResourceFactoryBinarySkeletonLimbV0 : 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;
};
class ResourceFactoryXMLSkeletonLimbV0 : 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 SOH
diff --git a/soh/soh/resource/importer/TextFactory.cpp b/soh/soh/resource/importer/TextFactory.cpp
index 1da1d50db..9796285c6 100644
--- a/soh/soh/resource/importer/TextFactory.cpp
+++ b/soh/soh/resource/importer/TextFactory.cpp
@@ -3,12 +3,12 @@
#include "spdlog/spdlog.h"
namespace SOH {
-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;
}
- auto text = std::make_shared<Text>(file->InitData);
+ auto text = std::make_shared<Text>(initData);
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t msgCount = reader->ReadUInt32();
@@ -27,12 +27,12 @@ std::shared_ptr<Ship::IResource> ResourceFactoryBinaryTextV0::ReadResource(std::
return text;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
- auto txt = std::make_shared<Text>(file->InitData);
+ auto txt = std::make_shared<Text>(initData);
auto child = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader)->FirstChildElement()->FirstChildElement();
while (child != nullptr) {
diff --git a/soh/soh/resource/importer/TextFactory.h b/soh/soh/resource/importer/TextFactory.h
index 55a569366..2f55743b9 100644
--- a/soh/soh/resource/importer/TextFactory.h
+++ b/soh/soh/resource/importer/TextFactory.h
@@ -7,11 +7,11 @@
namespace SOH {
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;
};
class ResourceFactoryXMLTextV0 : 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 SOH