mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 02:27:21 -07:00
refactor: use LUS 1.0 RC
Co-authored-by: kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev>
This commit is contained in:
parent
ab104623a7
commit
ba13e6b2c4
863 changed files with 9227 additions and 4416 deletions
|
@ -1,11 +1,11 @@
|
|||
#include "AnimationExporter.h"
|
||||
#include <Animation.h>
|
||||
#include <resource/type/Animation.h>
|
||||
|
||||
void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZAnimation* anim = (ZAnimation*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Animation);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Animation);
|
||||
|
||||
ZNormalAnimation* normalAnim = dynamic_cast<ZNormalAnimation*>(anim);
|
||||
ZCurveAnimation* curveAnim = dynamic_cast<ZCurveAnimation*>(anim);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "AudioExporter.h"
|
||||
#include "Main.h"
|
||||
#include <Animation.h>
|
||||
#include <Utils/MemoryStream.h>
|
||||
#include <Globals.h>
|
||||
#include <Utils/File.h>
|
||||
|
@ -30,7 +29,7 @@ void OTRExporter_Audio::WriteSampleEntryReference(ZAudio* audio, SampleEntry* en
|
|||
|
||||
void OTRExporter_Audio::WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer)
|
||||
{
|
||||
WriteHeader(nullptr, "", writer, Ship::ResourceType::AudioSample, Ship::Version::Rachael);
|
||||
WriteHeader(nullptr, "", writer, Ship::ResourceType::SOH_AudioSample, Ship::Version::Rachael);
|
||||
|
||||
writer->Write(entry->codec);
|
||||
writer->Write(entry->medium);
|
||||
|
@ -82,7 +81,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
|
|||
{
|
||||
ZAudio* audio = (ZAudio*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Audio, Ship::Version::Rachael);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Audio, Ship::Version::Rachael);
|
||||
|
||||
// Write Samples as individual files
|
||||
for (auto pair : audio->samples)
|
||||
|
@ -115,7 +114,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
|
|||
MemoryStream* fntStream = new MemoryStream();
|
||||
BinaryWriter fntWriter = BinaryWriter(fntStream);
|
||||
|
||||
WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::AudioSoundFont, Ship::Version::Rachael);
|
||||
WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::SOH_AudioSoundFont, Ship::Version::Rachael);
|
||||
|
||||
fntWriter.Write((uint32_t)i);
|
||||
fntWriter.Write(audio->soundFontTable[i].medium);
|
||||
|
@ -174,7 +173,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
|
|||
MemoryStream* seqStream = new MemoryStream();
|
||||
BinaryWriter seqWriter = BinaryWriter(seqStream);
|
||||
|
||||
WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::AudioSequence, Ship::Version::Rachael);
|
||||
WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::SOH_AudioSequence, Ship::Version::Rachael);
|
||||
|
||||
seqWriter.Write((uint32_t)seq.size());
|
||||
seqWriter.Write(seq.data(), seq.size());
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
void OTRExporter_Background::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZBackground* bg = (ZBackground*)res;
|
||||
|
||||
WriteHeader(bg, outPath, writer, Ship::ResourceType::SOH_Background);
|
||||
|
||||
writer->Write((uint32_t)bg->GetRawDataSize());
|
||||
|
||||
auto data = bg->parent->GetRawData();
|
||||
writer->Write((char*)data.data() + bg->GetRawDataIndex(), bg->GetRawDataSize());
|
||||
|
|
|
@ -158,16 +158,19 @@ endif()
|
|||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/ZAPD/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/tinyxml2
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/include
|
||||
# TODO: these should no longer be necessary if we were to link against LUS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource/types
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/graphic/Fast3D/U64
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/Mercury
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/tinyxml2
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/StormLib/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/nlohmann-json/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../soh/soh
|
||||
.
|
||||
)
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "CollisionExporter.h"
|
||||
#include <Resource.h>
|
||||
#include <libultraship/bridge.h>
|
||||
|
||||
void OTRExporter_Collision::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZCollisionHeader* col = (ZCollisionHeader*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::CollisionHeader);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_CollisionHeader);
|
||||
|
||||
writer->Write(col->absMinX);
|
||||
writer->Write(col->absMinY);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "CutsceneExporter.h"
|
||||
#include <Resource.h>
|
||||
#include <libultraship/bridge.h>
|
||||
|
||||
void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZCutscene* cs = (ZCutscene*)res;
|
||||
|
||||
WriteHeader(cs, outPath, writer, Ship::ResourceType::Cutscene);
|
||||
WriteHeader(cs, outPath, writer, Ship::ResourceType::SOH_Cutscene);
|
||||
|
||||
//writer->Write((uint32_t)cs->commands.size() + 2 + 2);
|
||||
writer->Write((uint32_t)0);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <Utils/BitConverter.h>
|
||||
#include "StrHash64/StrHash64.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "PR/ultra64/gbi.h"
|
||||
#include <libultraship/libultra/gbi.h>
|
||||
#include <Globals.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "ZArray.h"
|
||||
//#include "OTRExporter.h"
|
||||
#include <Utils/BinaryWriter.h>
|
||||
#include <Resource.h>
|
||||
#include <libultraship/bridge.h>
|
||||
#include "VersionInfo.h"
|
||||
|
||||
class OTRExporter : public ZResourceExporter
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <Archive.h>
|
||||
#include "Main.h"
|
||||
#include "BackgroundExporter.h"
|
||||
#include "TextureExporter.h"
|
||||
#include "RoomExporter.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Archive.h>
|
||||
#include <libultraship/bridge.h>
|
||||
|
||||
extern std::shared_ptr<Ship::Archive> otrArchive;
|
||||
extern std::map<std::string, std::vector<char>> files;
|
||||
|
|
|
@ -5,7 +5,7 @@ void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
|||
{
|
||||
ZPath* path = (ZPath*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Path);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Path);
|
||||
|
||||
writer->Write((uint32_t)path->pathways.size());
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "PlayerAnimationExporter.h"
|
||||
#include <Resource.h>
|
||||
#include <libultraship/bridge.h>
|
||||
|
||||
void OTRExporter_PlayerAnimationExporter::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZPlayerAnimationData* anim = (ZPlayerAnimationData*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::PlayerAnimation);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_PlayerAnimation);
|
||||
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <ZRoom/Commands/SetAlternateHeaders.h>
|
||||
#include "CollisionExporter.h"
|
||||
#include "DisplayListExporter.h"
|
||||
#include "Resource.h"
|
||||
#include <libultraship/bridge.h>
|
||||
#include <Globals.h>
|
||||
#include <ZRoom/Commands/SetExitList.h>
|
||||
#include <ZRoom/Commands/SetPathways.h>
|
||||
|
@ -39,7 +39,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
|||
{
|
||||
ZRoom* room = (ZRoom*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Room);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Room);
|
||||
|
||||
writer->Write((uint32_t)room->commands.size());
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "SkeletonExporter.h"
|
||||
#include <Resource.h>
|
||||
#include <libultraship/bridge.h>
|
||||
#include <Globals.h>
|
||||
#include "DisplayListExporter.h"
|
||||
|
||||
|
@ -7,7 +7,7 @@ void OTRExporter_Skeleton::Save(ZResource* res, const fs::path& outPath, BinaryW
|
|||
{
|
||||
ZSkeleton* skel = (ZSkeleton*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Skeleton);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Skeleton);
|
||||
|
||||
writer->Write((uint8_t)skel->type);
|
||||
writer->Write((uint8_t)skel->limbType);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#include "SkeletonLimbExporter.h"
|
||||
#include "DisplayListExporter.h"
|
||||
#include <Resource.h>
|
||||
#include <libultraship/bridge.h>
|
||||
#include <Globals.h>
|
||||
|
||||
void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZLimb* limb = (ZLimb*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SkeletonLimb);
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_SkeletonLimb);
|
||||
|
||||
writer->Write((uint8_t)limb->type);
|
||||
writer->Write((uint8_t)limb->skinSegmentType);
|
||||
|
|
|
@ -5,7 +5,7 @@ void OTRExporter_Text::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
|||
{
|
||||
ZText* txt = (ZText*)res;
|
||||
|
||||
WriteHeader(txt, outPath, writer, Ship::ResourceType::Text);
|
||||
WriteHeader(txt, outPath, writer, Ship::ResourceType::SOH_Text);
|
||||
|
||||
writer->Write((uint32_t)txt->messages.size());
|
||||
|
||||
|
|
|
@ -1,27 +1,25 @@
|
|||
#include "VersionInfo.h"
|
||||
#include <Resource.h>
|
||||
#include <libultraship/bridge.h>
|
||||
|
||||
std::map<Ship::ResourceType, uint32_t> resourceVersions;
|
||||
|
||||
void InitVersionInfo()
|
||||
{
|
||||
resourceVersions = std::map<Ship::ResourceType, uint32_t> {
|
||||
{ Ship::ResourceType::Animation, 0 },
|
||||
{ Ship::ResourceType::Model, 0 },
|
||||
{ Ship::ResourceType::SOH_Animation, 0 },
|
||||
{ Ship::ResourceType::Texture, 0 },
|
||||
{ Ship::ResourceType::Material, 0 },
|
||||
{ Ship::ResourceType::PlayerAnimation, 0 },
|
||||
{ Ship::ResourceType::SOH_PlayerAnimation, 0 },
|
||||
{ Ship::ResourceType::DisplayList, 0 },
|
||||
{ Ship::ResourceType::Room, 0 },
|
||||
{ Ship::ResourceType::CollisionHeader, 0 },
|
||||
{ Ship::ResourceType::Skeleton, 0 },
|
||||
{ Ship::ResourceType::SkeletonLimb, 0 },
|
||||
{ Ship::ResourceType::SOH_Room, 0 },
|
||||
{ Ship::ResourceType::SOH_CollisionHeader, 0 },
|
||||
{ Ship::ResourceType::SOH_Skeleton, 0 },
|
||||
{ Ship::ResourceType::SOH_SkeletonLimb, 0 },
|
||||
{ Ship::ResourceType::Matrix, 0 },
|
||||
{ Ship::ResourceType::Path, 0 },
|
||||
{ Ship::ResourceType::SOH_Path, 0 },
|
||||
{ Ship::ResourceType::Vertex, 0 },
|
||||
{ Ship::ResourceType::Cutscene, 0 },
|
||||
{ Ship::ResourceType::SOH_Cutscene, 0 },
|
||||
{ Ship::ResourceType::Array, 0 },
|
||||
{ Ship::ResourceType::Text, 0 },
|
||||
{ Ship::ResourceType::SOH_Text, 0 },
|
||||
{ Ship::ResourceType::Blob, 0 },
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "VtxExporter.h"
|
||||
#include "Resource.h"
|
||||
#include <libultraship/bridge.h>
|
||||
#include "VersionInfo.h"
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define Z64CUTSCENE_H
|
||||
|
||||
#if 0
|
||||
#include "ultra64.h"
|
||||
#include <libultraship/libultra.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue