mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Update subrepos (#281)
* git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "e02e151c" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "e02e151c" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/decomp-permuter --force subrepo: subdir: "tools/decomp-permuter" merged: "86b1975e" upstream: origin: "https://github.com/simonlindholm/decomp-permuter.git" branch: "main" commit: "86b1975e" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "eb25be94" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "eb25be94" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull (merge) tools/z64compress --force subrepo: subdir: "tools/z64compress" merged: "98ef0ac2" upstream: origin: "https://github.com/z64me/z64compress.git" branch: "main" commit: "98ef0ac2" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "45cb0d6b" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "45cb0d6b" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/asm-differ --force subrepo: subdir: "tools/asm-differ" merged: "48e675ff" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "48e675ff" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "3c00dcb3" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "3c00dcb3" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/asm-differ --force subrepo: subdir: "tools/asm-differ" merged: "47c94c99" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "47c94c99" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Declare required textures * Name texture, add decomp.me permuter settings * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "913810fc" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "913810fc" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/asm-differ --force subrepo: subdir: "tools/asm-differ" merged: "97197f2a" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "97197f2a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "623d779f" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "623d779f" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/asm-differ --force subrepo: subdir: "tools/asm-differ" merged: "55bba23a" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "55bba23a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/decomp-permuter --force subrepo: subdir: "tools/decomp-permuter" merged: "a20bac94" upstream: origin: "https://github.com/simonlindholm/decomp-permuter.git" branch: "main" commit: "a20bac94" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596"
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<Root>
|
||||
<File Name="Z2_SECOM" Segment="2" Game="MM">
|
||||
<Scene Name="Z2_SECOM" Offset="0x0"/>
|
||||
<!-- This texture is used in an "AnimatedMaterial", and must be declared to use the proper symbol -->
|
||||
<Texture Name="gSakonsHidoutConveyorBeltTex" OutName="sakons_hideout_conveyor_belt" Height="32" Width="32" Format="rgba16" Offset="0x47F0"/>
|
||||
</File>
|
||||
<File Name="Z2_SECOM_room_00" Segment="3" Game="MM">
|
||||
<Room Name="Z2_SECOM_room_00" Offset="0x0"/>
|
||||
|
||||
@@ -333,5 +333,8 @@ ASALocalRun/
|
||||
*.o
|
||||
*.d
|
||||
lib/libgfxd/libgfxd.a
|
||||
ExporterTest/ExporterTest.a
|
||||
ZAPDUtils/ZAPDUtils.a
|
||||
.vscode/
|
||||
ZAPD/BuildInfo.h
|
||||
build/
|
||||
ZAPDUtils/build/
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
[subrepo]
|
||||
remote = https://github.com/zeldaret/ZAPD.git
|
||||
branch = master
|
||||
commit = 6be9af65d39a1608ef854efbaf0bf9399aac5da1
|
||||
parent = 83546045c55d692e45ec25d3f2aac76b48945075
|
||||
commit = 623d779f8ea111cb8cbb78a218c8454e819c4c13
|
||||
parent = 9f2368dd710e740ced0f8086de91228b87f41512
|
||||
method = merge
|
||||
cmdver = 0.4.3
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
#include "CollisionExporter.h"
|
||||
|
||||
void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]]fs::path outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZCollisionHeader* col = (ZCollisionHeader*)res;
|
||||
|
||||
writer->Write(col->absMinX);
|
||||
writer->Write(col->absMinY);
|
||||
writer->Write(col->absMinZ);
|
||||
|
||||
writer->Write(col->absMaxX);
|
||||
writer->Write(col->absMaxY);
|
||||
writer->Write(col->absMaxZ);
|
||||
|
||||
writer->Write(col->numVerts);
|
||||
writer->Write(col->vtxAddress);
|
||||
|
||||
writer->Write(col->numPolygons);
|
||||
writer->Write(col->polyAddress);
|
||||
writer->Write(col->polyTypeDefAddress);
|
||||
writer->Write(col->camDataAddress);
|
||||
|
||||
writer->Write(col->numWaterBoxes);
|
||||
writer->Write(col->waterBoxAddress);
|
||||
|
||||
writer->Write(col->vtxSegmentOffset);
|
||||
writer->Write(col->polySegmentOffset);
|
||||
writer->Write(col->polyTypeDefSegmentOffset);
|
||||
writer->Write(col->camDataSegmentOffset);
|
||||
writer->Write(col->waterBoxSegmentOffset);
|
||||
|
||||
uint32_t oldOffset = writer->GetBaseAddress();
|
||||
|
||||
writer->Seek(col->vtxSegmentOffset, SeekOffsetType::Start);
|
||||
|
||||
for (uint16_t i = 0; i < col->vertices.size(); i++)
|
||||
{
|
||||
writer->Write(col->vertices[i].x);
|
||||
writer->Write(col->vertices[i].y);
|
||||
writer->Write(col->vertices[i].z);
|
||||
}
|
||||
|
||||
writer->Seek(col->polySegmentOffset, SeekOffsetType::Start);
|
||||
|
||||
for (uint16_t i = 0; i < col->polygons.size(); i++)
|
||||
{
|
||||
writer->Write(col->polygons[i].type);
|
||||
writer->Write(col->polygons[i].vtxA);
|
||||
writer->Write(col->polygons[i].vtxB);
|
||||
writer->Write(col->polygons[i].vtxC);
|
||||
writer->Write(col->polygons[i].a);
|
||||
writer->Write(col->polygons[i].b);
|
||||
writer->Write(col->polygons[i].c);
|
||||
writer->Write(col->polygons[i].d);
|
||||
}
|
||||
|
||||
writer->Seek(col->polyTypeDefSegmentOffset, SeekOffsetType::Start);
|
||||
|
||||
for (uint16_t i = 0; i < col->polygonTypes.size(); i++)
|
||||
writer->Write(col->polygonTypes[i]);
|
||||
|
||||
writer->Seek(col->camDataSegmentOffset, SeekOffsetType::Start);
|
||||
|
||||
for (auto entry : col->camData->entries)
|
||||
{
|
||||
writer->Write(entry->cameraSType);
|
||||
writer->Write(entry->numData);
|
||||
writer->Write(entry->cameraPosDataSeg);
|
||||
}
|
||||
|
||||
writer->Seek(oldOffset, SeekOffsetType::Start);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "ZResource.h"
|
||||
#include "ZCollision.h"
|
||||
|
||||
class ExporterExample_Collision : public ZResourceExporter
|
||||
{
|
||||
public:
|
||||
void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
|
||||
};
|
||||
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{65608eb0-1a47-45ad-ab66-192fb64c762c}</ProjectGuid>
|
||||
<RootNamespace>ExporterTest</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>ExporterExample</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir)\ZAPD\;$(SolutionDir)ZAPDUtils;$(SolutionDir)lib\tinyxml2;$(SolutionDir)lib\libgfxd;$(SolutionDir)lib\elfio;$(SolutionDir)lib\stb;$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CollisionExporter.h" />
|
||||
<ClInclude Include="TextureExporter.h" />
|
||||
<ClInclude Include="RoomExporter.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CollisionExporter.cpp" />
|
||||
<ClCompile Include="TextureExporter.cpp" />
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="RoomExporter.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="TextureExporter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RoomExporter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CollisionExporter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="TextureExporter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RoomExporter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CollisionExporter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,79 @@
|
||||
#include <TextureExporter.h>
|
||||
#include <RoomExporter.h>
|
||||
#include <CollisionExporter.h>
|
||||
#include <Globals.h>
|
||||
|
||||
enum class ExporterFileMode
|
||||
{
|
||||
ModeExample1 = (int)ZFileMode::Custom + 1,
|
||||
ModeExample2 = (int)ZFileMode::Custom + 2,
|
||||
ModeExample3 = (int)ZFileMode::Custom + 3,
|
||||
};
|
||||
|
||||
static void ExporterParseFileMode(std::string buildMode, ZFileMode& fileMode)
|
||||
{
|
||||
if (buildMode == "me1")
|
||||
fileMode = (ZFileMode)ExporterFileMode::ModeExample1;
|
||||
else if (buildMode == "me2")
|
||||
fileMode = (ZFileMode)ExporterFileMode::ModeExample2;
|
||||
else if (buildMode == "me3")
|
||||
fileMode = (ZFileMode)ExporterFileMode::ModeExample3;
|
||||
}
|
||||
|
||||
static void ExporterParseArgs([[maybe_unused]]int argc, char* argv[], int& i)
|
||||
{
|
||||
std::string arg = argv[i];
|
||||
|
||||
if (arg == "--do-x")
|
||||
{
|
||||
|
||||
}
|
||||
else if (arg == "--do-y")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static bool ExporterProcessFileMode(ZFileMode fileMode)
|
||||
{
|
||||
// Do whatever work is associated with these custom file modes...
|
||||
// Return true to indicate one of our own file modes is being processed
|
||||
if (fileMode == (ZFileMode)ExporterFileMode::ModeExample1)
|
||||
return true;
|
||||
else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample2)
|
||||
return true;
|
||||
else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample3)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ExporterFileBegin(ZFile* file)
|
||||
{
|
||||
printf("ExporterFileBegin() called on ZFile %s.\n", file->GetName().c_str());
|
||||
}
|
||||
|
||||
static void ExporterFileEnd(ZFile* file)
|
||||
{
|
||||
printf("ExporterFileEnd() called on ZFile %s.\n", file->GetName().c_str());
|
||||
}
|
||||
|
||||
static void ImportExporters()
|
||||
{
|
||||
// In this example we set up a new exporter called "EXAMPLE".
|
||||
// By running ZAPD with the argument -se EXAMPLE, we tell it that we want to use this exporter for our resources.
|
||||
ExporterSet* exporterSet = new ExporterSet();
|
||||
exporterSet->processFileModeFunc = ExporterProcessFileMode;
|
||||
exporterSet->parseFileModeFunc = ExporterParseFileMode;
|
||||
exporterSet->parseArgsFunc = ExporterParseArgs;
|
||||
exporterSet->beginFileFunc = ExporterFileBegin;
|
||||
exporterSet->endFileFunc = ExporterFileEnd;
|
||||
exporterSet->exporters[ZResourceType::Texture] = new ExporterExample_Texture();
|
||||
exporterSet->exporters[ZResourceType::Room] = new ExporterExample_Room();
|
||||
exporterSet->exporters[ZResourceType::CollisionHeader] = new ExporterExample_Collision();
|
||||
|
||||
Globals::AddExporter("EXAMPLE", exporterSet);
|
||||
}
|
||||
|
||||
// When ZAPD starts up, it will automatically call the below function, which in turn sets up our exporters.
|
||||
REGISTER_EXPORTER(ImportExporters)
|
||||
@@ -0,0 +1,28 @@
|
||||
# Only used for standalone compilation, usually inherits these from the main makefile
|
||||
CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17
|
||||
|
||||
SRC_DIRS := $(shell find -type d -not -path "*build*")
|
||||
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
||||
H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
|
||||
|
||||
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
|
||||
LIB := ExporterTest.a
|
||||
|
||||
# create build directories
|
||||
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
|
||||
|
||||
all: $(LIB)
|
||||
|
||||
clean:
|
||||
rm -rf build $(LIB)
|
||||
|
||||
format:
|
||||
clang-format-11 -i $(CPP_FILES) $(H_FILES)
|
||||
|
||||
.PHONY: all clean format
|
||||
|
||||
build/%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -I ./ -I ../ZAPD -I ../ZAPDUtils -I ../lib/tinyxml2 -c $(OUTPUT_OPTION) $<
|
||||
|
||||
$(LIB): $(O_FILES)
|
||||
$(AR) rcs $@ $^
|
||||
@@ -0,0 +1,373 @@
|
||||
#include "RoomExporter.h"
|
||||
#include <Utils/BinaryWriter.h>
|
||||
#include <Utils/MemoryStream.h>
|
||||
#include <Utils/File.h>
|
||||
#include <ZRoom/Commands/SetWind.h>
|
||||
#include <ZRoom/Commands/SetTimeSettings.h>
|
||||
#include <ZRoom/Commands/SetSkyboxModifier.h>
|
||||
#include <ZRoom/Commands/SetSoundSettings.h>
|
||||
#include <ZRoom/Commands/SetCameraSettings.h>
|
||||
#include <ZRoom/Commands/SetMesh.h>
|
||||
#include <ZRoom/Commands/SetRoomBehavior.h>
|
||||
#include <ZRoom/Commands/SetCsCamera.h>
|
||||
#include <ZRoom/Commands/SetRoomList.h>
|
||||
#include <ZRoom/Commands/SetCollisionHeader.h>
|
||||
#include <ZRoom/Commands/SetEntranceList.h>
|
||||
#include <ZRoom/Commands/SetSpecialObjects.h>
|
||||
#include <ZRoom/Commands/SetStartPositionList.h>
|
||||
#include <ZRoom/Commands/SetSkyboxSettings.h>
|
||||
#include <ZRoom/Commands/SetLightingSettings.h>
|
||||
#include <ZRoom/Commands/SetEchoSettings.h>
|
||||
#include <CollisionExporter.h>
|
||||
|
||||
void ExporterExample_Room::Save(ZResource* res, fs::path outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZRoom* room = (ZRoom*)res;
|
||||
|
||||
//MemoryStream* memStream = new MemoryStream();
|
||||
//BinaryWriter* writer = new BinaryWriter(memStream);
|
||||
|
||||
for (uint i = 0; i < room->commands.size() * 8; i++)
|
||||
writer->Write((uint8_t)0);
|
||||
|
||||
for (uint i = 0; i < room->commands.size(); i++)
|
||||
{
|
||||
ZRoomCommand* cmd = room->commands[i];
|
||||
|
||||
writer->Seek(i * 8, SeekOffsetType::Start);
|
||||
|
||||
writer->Write((uint8_t)cmd->cmdID);
|
||||
|
||||
switch (cmd->cmdID)
|
||||
{
|
||||
case RoomCommand::SetWind:
|
||||
{
|
||||
SetWind* cmdSetWind = (SetWind*)cmd;
|
||||
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
|
||||
writer->Write(cmdSetWind->windWest); // 0x04
|
||||
writer->Write(cmdSetWind->windVertical); // 0x05
|
||||
writer->Write(cmdSetWind->windSouth); // 0x06
|
||||
writer->Write(cmdSetWind->clothFlappingStrength); // 0x07
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetTimeSettings:
|
||||
{
|
||||
SetTimeSettings* cmdTime = (SetTimeSettings*)cmd;
|
||||
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
|
||||
writer->Write(cmdTime->hour); // 0x04
|
||||
writer->Write(cmdTime->min); // 0x05
|
||||
writer->Write(cmdTime->unk); // 0x06
|
||||
writer->Write((uint8_t)0); // 0x07
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetSkyboxModifier:
|
||||
{
|
||||
SetSkyboxModifier* cmdSkybox = (SetSkyboxModifier*)cmd;
|
||||
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
|
||||
writer->Write(cmdSkybox->disableSky); // 0x04
|
||||
writer->Write(cmdSkybox->disableSunMoon); // 0x05
|
||||
writer->Write((uint8_t)0); // 0x06
|
||||
writer->Write((uint8_t)0); // 0x07
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetEchoSettings:
|
||||
{
|
||||
SetEchoSettings* cmdEcho = (SetEchoSettings*)cmd;
|
||||
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write((uint8_t)0); // 0x04
|
||||
writer->Write((uint8_t)0); // 0x05
|
||||
writer->Write((uint8_t)0); // 0x06
|
||||
writer->Write((uint8_t)cmdEcho->echo); // 0x07
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetSoundSettings:
|
||||
{
|
||||
SetSoundSettings* cmdSound = (SetSoundSettings*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdSound->reverb); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write((uint8_t)0); // 0x04
|
||||
writer->Write((uint8_t)0); // 0x05
|
||||
|
||||
writer->Write(cmdSound->nightTimeSFX); // 0x06
|
||||
writer->Write(cmdSound->musicSequence); // 0x07
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetSkyboxSettings:
|
||||
{
|
||||
SetSkyboxSettings* cmdSkybox = (SetSkyboxSettings*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdSkybox->unk1); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write((uint8_t)cmdSkybox->skyboxNumber); // 0x04
|
||||
writer->Write((uint8_t)cmdSkybox->cloudsType); // 0x05
|
||||
writer->Write((uint8_t)cmdSkybox->isIndoors); // 0x06
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetRoomBehavior:
|
||||
{
|
||||
SetRoomBehavior* cmdRoom = (SetRoomBehavior*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdRoom->gameplayFlags); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write(cmdRoom->gameplayFlags2); // 0x04
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetCsCamera:
|
||||
{
|
||||
SetCsCamera* cmdCsCam = (SetCsCamera*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdCsCam->cameras.size()); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
|
||||
writer->Write(cmdCsCam->segmentOffset); // 0x04
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetMesh:
|
||||
{
|
||||
SetMesh* cmdMesh = (SetMesh*)cmd;
|
||||
|
||||
int baseStreamEnd = writer->GetStream().get()->GetLength();
|
||||
|
||||
writer->Write((uint8_t)cmdMesh->data); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
|
||||
writer->Write(baseStreamEnd); // 0x04
|
||||
|
||||
uint32_t oldOffset = writer->GetBaseAddress();
|
||||
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
|
||||
|
||||
// TODO: NOT DONE
|
||||
|
||||
writer->Write(cmdMesh->meshHeaderType);
|
||||
|
||||
if (cmdMesh->meshHeaderType == 0)
|
||||
{
|
||||
//writer->Write(cmdMesh->)
|
||||
}
|
||||
else if (cmdMesh->meshHeaderType == 1)
|
||||
{
|
||||
|
||||
}
|
||||
else if (cmdMesh->meshHeaderType == 2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
writer->Seek(oldOffset, SeekOffsetType::Start);
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetCameraSettings:
|
||||
{
|
||||
SetCameraSettings* cmdCam = (SetCameraSettings*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdCam->cameraMovement); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write(cmdCam->mapHighlight); // 0x04
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetLightingSettings:
|
||||
{
|
||||
SetLightingSettings* cmdLight = (SetLightingSettings*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdLight->settings.size()); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write(cmdLight->segmentOffset); // 0x04
|
||||
|
||||
uint32_t oldOffset = writer->GetBaseAddress();
|
||||
writer->Seek(cmdLight->segmentOffset, SeekOffsetType::Start);
|
||||
|
||||
for (LightingSettings setting : cmdLight->settings)
|
||||
{
|
||||
writer->Write(setting.ambientClrR);
|
||||
writer->Write(setting.ambientClrG);
|
||||
writer->Write(setting.ambientClrB);
|
||||
|
||||
writer->Write(setting.diffuseClrA_R);
|
||||
writer->Write(setting.diffuseClrA_G);
|
||||
writer->Write(setting.diffuseClrA_B);
|
||||
|
||||
writer->Write(setting.diffuseDirA_X);
|
||||
writer->Write(setting.diffuseDirA_Y);
|
||||
writer->Write(setting.diffuseDirA_Z);
|
||||
|
||||
writer->Write(setting.diffuseClrB_R);
|
||||
writer->Write(setting.diffuseClrB_G);
|
||||
writer->Write(setting.diffuseClrB_B);
|
||||
|
||||
writer->Write(setting.diffuseDirB_X);
|
||||
writer->Write(setting.diffuseDirB_Y);
|
||||
writer->Write(setting.diffuseDirB_Z);
|
||||
|
||||
writer->Write(setting.fogClrR);
|
||||
writer->Write(setting.fogClrG);
|
||||
writer->Write(setting.fogClrB);
|
||||
|
||||
writer->Write(setting.unk);
|
||||
writer->Write(setting.drawDistance);
|
||||
}
|
||||
|
||||
writer->Seek(oldOffset, SeekOffsetType::Start);
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetRoomList:
|
||||
{
|
||||
SetRoomList* cmdRoom = (SetRoomList*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdRoom->rooms.size()); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
|
||||
int baseStreamEnd = writer->GetLength();
|
||||
writer->Write(baseStreamEnd); // 0x04
|
||||
|
||||
uint32_t oldOffset = writer->GetBaseAddress();
|
||||
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
|
||||
|
||||
for (RoomEntry entry : cmdRoom->rooms)
|
||||
{
|
||||
writer->Write(entry.virtualAddressStart);
|
||||
writer->Write(entry.virtualAddressEnd);
|
||||
}
|
||||
|
||||
writer->Seek(oldOffset, SeekOffsetType::Start);
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetCollisionHeader:
|
||||
{
|
||||
SetCollisionHeader* cmdCollHeader = (SetCollisionHeader*)cmd;
|
||||
|
||||
int streamEnd = writer->GetStream().get()->GetLength();
|
||||
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write(streamEnd); // 0x04
|
||||
|
||||
// TODO: NOT DONE
|
||||
|
||||
uint32_t oldOffset = writer->GetBaseAddress();
|
||||
writer->Seek(streamEnd, SeekOffsetType::Start);
|
||||
|
||||
ExporterExample_Collision colExp = ExporterExample_Collision();
|
||||
|
||||
colExp.Save(cmdCollHeader->collisionHeader, outPath, writer);
|
||||
|
||||
writer->Seek(oldOffset, SeekOffsetType::Start);
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetEntranceList:
|
||||
{
|
||||
SetEntranceList* cmdEntrance = (SetEntranceList*)cmd;
|
||||
|
||||
uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
|
||||
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write(baseStreamEnd); // 0x04
|
||||
|
||||
uint32_t oldOffset = writer->GetBaseAddress();
|
||||
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
|
||||
|
||||
for (EntranceEntry entry : cmdEntrance->entrances)
|
||||
{
|
||||
writer->Write((uint8_t)entry.startPositionIndex);
|
||||
writer->Write((uint8_t)entry.roomToLoad);
|
||||
}
|
||||
|
||||
writer->Seek(oldOffset, SeekOffsetType::Start);
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetSpecialObjects:
|
||||
{
|
||||
SetSpecialObjects* cmdSpecObj = (SetSpecialObjects*)cmd;
|
||||
|
||||
writer->Write((uint8_t)cmdSpecObj->elfMessage); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write((uint8_t)0); // 0x04
|
||||
writer->Write((uint8_t)0); // 0x05
|
||||
writer->Write((uint16_t)cmdSpecObj->globalObject); // 0x06
|
||||
}
|
||||
break;
|
||||
case RoomCommand::SetStartPositionList:
|
||||
{
|
||||
SetStartPositionList* cmdStartPos = (SetStartPositionList*)cmd;
|
||||
|
||||
uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
|
||||
|
||||
writer->Write((uint8_t)cmdStartPos->actors.size()); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write(baseStreamEnd); // 0x04
|
||||
|
||||
uint32_t oldOffset = writer->GetBaseAddress();
|
||||
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
|
||||
|
||||
for (ActorSpawnEntry entry : cmdStartPos->actors)
|
||||
{
|
||||
writer->Write(entry.actorNum);
|
||||
writer->Write(entry.posX);
|
||||
writer->Write(entry.posY);
|
||||
writer->Write(entry.posZ);
|
||||
writer->Write(entry.rotX);
|
||||
writer->Write(entry.rotY);
|
||||
writer->Write(entry.rotZ);
|
||||
writer->Write(entry.initVar);
|
||||
}
|
||||
|
||||
writer->Seek(oldOffset, SeekOffsetType::Start);
|
||||
}
|
||||
break;
|
||||
case RoomCommand::EndMarker:
|
||||
{
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write((uint8_t)0); // 0x04
|
||||
writer->Write((uint8_t)0); // 0x05
|
||||
writer->Write((uint8_t)0); // 0x06
|
||||
writer->Write((uint8_t)0); // 0x07
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("UNIMPLEMENTED COMMAND: %i\n", (int)cmd->cmdID);
|
||||
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
writer->Write((uint8_t)0); // 0x02
|
||||
writer->Write((uint8_t)0); // 0x03
|
||||
writer->Write((uint8_t)0); // 0x04
|
||||
writer->Write((uint8_t)0); // 0x05
|
||||
writer->Write((uint8_t)0); // 0x06
|
||||
writer->Write((uint8_t)0); // 0x07
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//writer->Close();
|
||||
//File::WriteAllBytes(StringHelper::Sprintf("%s", res->GetName().c_str()), memStream->ToVector());
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "ZResource.h"
|
||||
#include "ZRoom/ZRoom.h"
|
||||
|
||||
class ExporterExample_Room : public ZResourceExporter
|
||||
{
|
||||
public:
|
||||
void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "TextureExporter.h"
|
||||
#include "../ZAPD/ZFile.h"
|
||||
|
||||
void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]]fs::path outPath, BinaryWriter* writer)
|
||||
{
|
||||
ZTexture* tex = (ZTexture*)res;
|
||||
|
||||
auto data = tex->parent->GetRawData();
|
||||
|
||||
for (uint i = tex->GetRawDataIndex(); i < tex->GetRawDataIndex() + tex->GetRawDataSize(); i++)
|
||||
writer->Write(data[i]);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ZResource.h"
|
||||
#include "ZTexture.h"
|
||||
#include <Utils/BinaryWriter.h>
|
||||
|
||||
class ExporterExample_Texture : public ZResourceExporter
|
||||
{
|
||||
public:
|
||||
void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
|
||||
};
|
||||
Vendored
+67
-47
@@ -1,70 +1,90 @@
|
||||
pipeline {
|
||||
agent {
|
||||
label "ZAPD"
|
||||
label 'ZAPD'
|
||||
}
|
||||
|
||||
stages {
|
||||
// Non-parallel ZAPD stage
|
||||
stage('Build ZAPD') {
|
||||
steps {
|
||||
sh 'make -j'
|
||||
}
|
||||
}
|
||||
stage('Checkout oot') {
|
||||
steps {
|
||||
dir('oot') {
|
||||
git url: 'https://github.com/zeldaret/oot.git'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Set up oot') {
|
||||
steps {
|
||||
dir('oot') {
|
||||
sh 'cp /usr/local/etc/roms/baserom_oot.z64 baserom_original.z64'
|
||||
|
||||
// Identical to `make setup` except for copying our newer ZAPD.out into oot
|
||||
sh 'git submodule update --init --recursive'
|
||||
sh 'make -C tools'
|
||||
sh 'cp ../ZAPD.out tools/ZAPD/'
|
||||
sh 'python3 fixbaserom.py'
|
||||
sh 'python3 extract_baserom.py'
|
||||
sh 'python3 extract_assets.py'
|
||||
// CHECKOUT THE REPOS
|
||||
stage('Checkout Repos') {
|
||||
parallel {
|
||||
stage('Checkout oot') {
|
||||
steps {
|
||||
dir('oot') {
|
||||
git url: 'https://github.com/zeldaret/oot.git'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build oot') {
|
||||
steps {
|
||||
dir('oot') {
|
||||
sh 'make -j'
|
||||
|
||||
stage('Checkout mm') {
|
||||
steps{
|
||||
dir('mm') {
|
||||
git url: 'https://github.com/zeldaret/mm.git'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Checkout mm') {
|
||||
steps {
|
||||
dir('mm') {
|
||||
git url: 'https://github.com/zeldaret/mm.git'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Set up mm') {
|
||||
steps {
|
||||
dir('mm') {
|
||||
sh 'cp /usr/local/etc/roms/mm.us.rev1.z64 baserom.mm.us.rev1.z64'
|
||||
// SETUP THE REPOS
|
||||
stage('Set up repos') {
|
||||
parallel {
|
||||
stage('Setup OOT') {
|
||||
steps {
|
||||
dir('oot') {
|
||||
sh 'cp /usr/local/etc/roms/baserom_oot.z64 baserom_original.z64'
|
||||
|
||||
// Identical to `make setup` except for copying our newer ZAPD.out into mm
|
||||
sh 'git submodule update --init --recursive'
|
||||
sh 'make -C tools'
|
||||
sh 'cp ../ZAPD.out tools/ZAPD/'
|
||||
sh 'python3 tools/extract_rom.py baserom.mm.us.rev1.z64'
|
||||
sh 'python3 extract_assets.py'
|
||||
// Identical to `make setup` except for copying our newer ZAPD.out into oot
|
||||
sh 'git submodule update --init --recursive'
|
||||
sh 'make -C tools'
|
||||
sh 'cp ../ZAPD.out tools/ZAPD/'
|
||||
sh 'python3 fixbaserom.py'
|
||||
sh 'python3 extract_baserom.py'
|
||||
sh 'python3 extract_assets.py'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Setup MM') {
|
||||
steps {
|
||||
dir('mm') {
|
||||
sh 'cp /usr/local/etc/roms/mm.us.rev1.z64 baserom.mm.us.rev1.z64'
|
||||
|
||||
// Identical to `make setup` except for copying our newer ZAPD.out into mm
|
||||
sh 'make -C tools'
|
||||
sh 'cp ../ZAPD.out tools/ZAPD/'
|
||||
sh 'python3 tools/fixbaserom.py'
|
||||
sh 'python3 tools/extract_baserom.py'
|
||||
sh 'python3 extract_assets.py -t 4'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build mm') {
|
||||
steps {
|
||||
dir('mm') {
|
||||
sh 'make assembly -j'
|
||||
sh 'make -j'
|
||||
|
||||
// BUILD THE REPOS
|
||||
stage('Build repos') {
|
||||
parallel {
|
||||
stage('Build oot') {
|
||||
steps {
|
||||
dir('oot') {
|
||||
sh 'make -j'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build mm') {
|
||||
steps {
|
||||
dir('mm') {
|
||||
sh 'make -j disasm'
|
||||
sh 'make -j all'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+51
-21
@@ -1,26 +1,31 @@
|
||||
# use variables in submakes
|
||||
export
|
||||
OPTIMIZATION_ON ?= 1
|
||||
ASAN ?= 0
|
||||
DEPRECATION_ON ?= 1
|
||||
DEBUG ?= 0
|
||||
CXXFLAGS ?=
|
||||
COPYCHECK_ARGS ?=
|
||||
COPYCHECK_ARGS ?=
|
||||
# Set LLD=1 to use ld.lld as the linker
|
||||
LLD ?= 0
|
||||
|
||||
CXX := g++
|
||||
INC := -I ZAPD -I lib/assimp/include -I lib/elfio -I lib/json/include -I lib/stb -I lib/tinygltf -I lib/libgfxd -I lib/tinyxml2
|
||||
CXXFLAGS += -fpic -std=c++17 -Wall -fno-omit-frame-pointer
|
||||
INC := -I ZAPD -I lib/elfio -I lib/libgfxd -I lib/tinyxml2 -I ZAPDUtils
|
||||
CXXFLAGS := -fpic -std=c++17 -Wall -Wextra -fno-omit-frame-pointer
|
||||
OPTFLAGS :=
|
||||
|
||||
ifneq ($(DEBUG),0)
|
||||
OPTIMIZATION_ON = 0
|
||||
DEPRECATION_OFF = 1
|
||||
CXXFLAGS += -g3 -DDEVELOPMENT
|
||||
COPYCHECK_ARGS += --devel
|
||||
DEPRECATION_ON = 0
|
||||
else
|
||||
CXXFLAGS += -Werror
|
||||
endif
|
||||
|
||||
ifeq ($(OPTIMIZATION_ON),0)
|
||||
CXXFLAGS += -O0
|
||||
OPTFLAGS := -O0
|
||||
else
|
||||
CXXFLAGS += -O2 -march=native -mtune=native
|
||||
OPTFLAGS := -O2 -march=native -mtune=native
|
||||
endif
|
||||
|
||||
ifneq ($(ASAN),0)
|
||||
@@ -31,48 +36,73 @@ ifneq ($(DEPRECATION_ON),0)
|
||||
endif
|
||||
# CXXFLAGS += -DTEXTURE_DEBUG
|
||||
|
||||
LDFLAGS := -lstdc++ -lm -ldl -lpng
|
||||
LDFLAGS := -lm -ldl -lpng
|
||||
|
||||
ifneq ($(LLD),0)
|
||||
LDFLAGS += -fuse-ld=lld
|
||||
endif
|
||||
|
||||
UNAME := $(shell uname)
|
||||
ifneq ($(UNAME), Darwin)
|
||||
LDFLAGS += -Wl,-export-dynamic -lstdc++fs
|
||||
endif
|
||||
|
||||
SRC_DIRS := ZAPD ZAPD/ZRoom ZAPD/ZRoom/Commands ZAPD/Overlays ZAPD/HighLevel
|
||||
ZAPD_SRC_DIRS := $(shell find ZAPD -type d)
|
||||
SRC_DIRS = $(ZAPD_SRC_DIRS) lib/tinyxml2
|
||||
|
||||
ZAPD_CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
||||
ZAPD_H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
|
||||
ZAPD_CPP_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
||||
ZAPD_H_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.h))
|
||||
|
||||
CPP_FILES += $(ZAPD_CPP_FILES) lib/tinyxml2/tinyxml2.cpp
|
||||
O_FILES := $(CPP_FILES:.cpp=.o)
|
||||
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
|
||||
O_FILES += build/ZAPD/BuildInfo.o
|
||||
|
||||
# create build directories
|
||||
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
|
||||
|
||||
|
||||
# Main targets
|
||||
all: ZAPD.out copycheck
|
||||
|
||||
genbuildinfo:
|
||||
build/ZAPD/BuildInfo.o:
|
||||
python3 ZAPD/genbuildinfo.py $(COPYCHECK_ARGS)
|
||||
$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) build/ZAPD/BuildInfo.cpp
|
||||
|
||||
copycheck: ZAPD.out
|
||||
python3 copycheck.py
|
||||
|
||||
clean:
|
||||
rm -f $(O_FILES) ZAPD.out
|
||||
rm -rf build ZAPD.out
|
||||
$(MAKE) -C lib/libgfxd clean
|
||||
$(MAKE) -C ZAPDUtils clean
|
||||
$(MAKE) -C ExporterTest clean
|
||||
|
||||
rebuild: clean all
|
||||
|
||||
format:
|
||||
clang-format-11 -i $(ZAPD_CPP_FILES) $(ZAPD_H_FILES)
|
||||
$(MAKE) -C ZAPDUtils format
|
||||
$(MAKE) -C ExporterTest format
|
||||
|
||||
.PHONY: all genbuildinfo copycheck clean rebuild format
|
||||
.PHONY: all build/ZAPD/BuildInfo.o copycheck clean rebuild format
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) $(INC) -c $< -o $@
|
||||
build/%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) $<
|
||||
|
||||
ZAPD/Main.o: genbuildinfo ZAPD/Main.cpp
|
||||
$(CXX) $(CXXFLAGS) $(INC) -c ZAPD/Main.cpp -o $@
|
||||
|
||||
# Submakes
|
||||
lib/libgfxd/libgfxd.a:
|
||||
$(MAKE) -C lib/libgfxd
|
||||
|
||||
ZAPD.out: $(O_FILES) lib/libgfxd/libgfxd.a
|
||||
$(CXX) $(CXXFLAGS) $(INC) $(O_FILES) lib/libgfxd/libgfxd.a -o $@ $(FS_INC) $(LDFLAGS)
|
||||
.PHONY: ExporterTest
|
||||
ExporterTest:
|
||||
$(MAKE) -C ExporterTest
|
||||
|
||||
.PHONY: ZAPDUtils
|
||||
ZAPDUtils:
|
||||
$(MAKE) -C ZAPDUtils
|
||||
|
||||
|
||||
# Linking
|
||||
ZAPD.out: $(O_FILES) lib/libgfxd/libgfxd.a ExporterTest ZAPDUtils
|
||||
$(CXX) $(O_FILES) lib/libgfxd/libgfxd.a ZAPDUtils/ZAPDUtils.a -Wl,--whole-archive ExporterTest/ExporterTest.a -Wl,--no-whole-archive $(LDFLAGS) $(OUTPUT_OPTION)
|
||||
|
||||
@@ -31,6 +31,7 @@ You can configure a bit your ZAPD build with the following options:
|
||||
- Debugging symbols enabled (`-g3`). They are disabled by default.
|
||||
- `OPTIMIZATION_ON=0`: Disables optimizations (`-O0`).
|
||||
- `DEPRECATION_OFF=1`: Disables deprecation warnings.
|
||||
- `LLD=1`: builds with the LLVM linker `ld.lld` instead of the system default.
|
||||
|
||||
As an example, if you want to build ZAPD with optimizations disabled and use the address sanitizer, you could use the following command:
|
||||
|
||||
@@ -110,5 +111,7 @@ ZAPD also accepts the following list of extra parameters:
|
||||
- `-tm MODE`: Test Mode (enables certain experimental features). To enable it, set `MODE` to `1`.
|
||||
- `-wno` / `--warn-no-offsets` : Enable warnings for nodes that dont have offsets specified. Takes priority over `-eno`/ `--error-no-offsets`.
|
||||
- `-eno`/ `--error-no-offsets` : Enable errors for nodes that dont have offsets specified.
|
||||
- `-se` / `--set-exporter` : Sets which exporter to use.
|
||||
- `--gcc-compat` : Enables GCC compatible mode. Slower.
|
||||
|
||||
Additionally, you can pass the flag `--version` to see the current ZAPD version. If that flag is passed, ZAPD will ignore any other parameter passed.
|
||||
|
||||
@@ -5,6 +5,10 @@ VisualStudioVersion = 16.0.30320.27
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPD", "ZAPD\ZAPD.vcxproj", "{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExporterExample", "ExporterTest\ExporterTest.vcxproj", "{65608EB0-1A47-45AD-AB66-192FB64C762C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPDUtils", "ZAPDUtils\ZAPDUtils.vcxproj", "{A2E01C3E-D647-45D1-9788-043DEBC1A908}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -33,6 +37,38 @@ Global
|
||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
|
||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.Build.0 = Release|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.Build.0 = Debug|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.Build.0 = Debug|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.ActiveCfg = Debug|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.Build.0 = Debug|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.ActiveCfg = Debug|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.Build.0 = Debug|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.ActiveCfg = Release|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.Build.0 = Release|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.ActiveCfg = Release|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.Build.0 = Release|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
|
||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.Build.0 = Release|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.Build.0 = Debug|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.Build.0 = Debug|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.ActiveCfg = Debug|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.Build.0 = Debug|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.ActiveCfg = Debug|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.Build.0 = Debug|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.ActiveCfg = Release|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.Build.0 = Release|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.ActiveCfg = Release|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.Build.0 = Release|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
|
||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -24,20 +24,20 @@ class Declaration
|
||||
public:
|
||||
DeclarationAlignment alignment;
|
||||
DeclarationPadding padding;
|
||||
size_t size = 0;
|
||||
std::string preText;
|
||||
std::string text;
|
||||
std::string rightText;
|
||||
std::string postText;
|
||||
std::string preComment;
|
||||
std::string postComment;
|
||||
std::string varType;
|
||||
std::string varName;
|
||||
std::string includePath;
|
||||
size_t size;
|
||||
std::string preText = "";
|
||||
std::string text = "";
|
||||
std::string rightText = "";
|
||||
std::string postText = "";
|
||||
std::string preComment = "";
|
||||
std::string postComment = "";
|
||||
std::string varType = "";
|
||||
std::string varName = "";
|
||||
std::string includePath = "";
|
||||
bool isExternal = false;
|
||||
bool isArray = false;
|
||||
size_t arrayItemCnt = 0;
|
||||
std::string arrayItemCntStr;
|
||||
std::string arrayItemCntStr = "";
|
||||
std::vector<uint32_t> references;
|
||||
bool isUnaccounted = false;
|
||||
bool isPlaceholder = false;
|
||||
@@ -62,4 +62,4 @@ public:
|
||||
protected:
|
||||
Declaration(DeclarationAlignment nAlignment, DeclarationPadding nPadding, size_t nSize,
|
||||
std::string nText);
|
||||
};
|
||||
};
|
||||
+46
-12
@@ -1,7 +1,7 @@
|
||||
#include "Globals.h"
|
||||
#include <Utils/File.h>
|
||||
#include <Utils/Path.h>
|
||||
#include <algorithm>
|
||||
#include "File.h"
|
||||
#include "Path.h"
|
||||
#include "tinyxml2.h"
|
||||
|
||||
using namespace tinyxml2;
|
||||
@@ -25,6 +25,7 @@ Globals::Globals()
|
||||
useExternalResources = true;
|
||||
lastScene = nullptr;
|
||||
verbosity = VerbosityLevel::VERBOSITY_SILENT;
|
||||
currentExporter = "";
|
||||
outputPath = Directory::GetCurrentDirectory();
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ std::string Globals::FindSymbolSegRef(int32_t segNumber, uint32_t symbolAddress)
|
||||
if (eResult != tinyxml2::XML_SUCCESS)
|
||||
return "ERROR";
|
||||
|
||||
XMLNode* root = doc.FirstChild();
|
||||
tinyxml2::XMLNode* root = doc.FirstChild();
|
||||
|
||||
if (root == nullptr)
|
||||
return "ERROR";
|
||||
@@ -67,8 +68,8 @@ std::string Globals::FindSymbolSegRef(int32_t segNumber, uint32_t symbolAddress)
|
||||
|
||||
void Globals::ReadConfigFile(const std::string& configFilePath)
|
||||
{
|
||||
XMLDocument doc;
|
||||
XMLError eResult = doc.LoadFile(configFilePath.c_str());
|
||||
tinyxml2::XMLDocument doc;
|
||||
tinyxml2::XMLError eResult = doc.LoadFile(configFilePath.c_str());
|
||||
|
||||
if (eResult != tinyxml2::XML_SUCCESS)
|
||||
{
|
||||
@@ -76,12 +77,12 @@ void Globals::ReadConfigFile(const std::string& configFilePath)
|
||||
return;
|
||||
}
|
||||
|
||||
XMLNode* root = doc.FirstChild();
|
||||
tinyxml2::XMLNode* root = doc.FirstChild();
|
||||
|
||||
if (root == nullptr)
|
||||
return;
|
||||
|
||||
for (XMLElement* child = root->FirstChildElement(); child != NULL;
|
||||
for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != NULL;
|
||||
child = child->NextSiblingElement())
|
||||
{
|
||||
if (std::string(child->Name()) == "SymbolMap")
|
||||
@@ -128,8 +129,8 @@ void Globals::ReadConfigFile(const std::string& configFilePath)
|
||||
|
||||
void Globals::ReadTexturePool(const std::string& texturePoolXmlPath)
|
||||
{
|
||||
XMLDocument doc;
|
||||
XMLError eResult = doc.LoadFile(texturePoolXmlPath.c_str());
|
||||
tinyxml2::XMLDocument doc;
|
||||
tinyxml2::XMLError eResult = doc.LoadFile(texturePoolXmlPath.c_str());
|
||||
|
||||
if (eResult != tinyxml2::XML_SUCCESS)
|
||||
{
|
||||
@@ -137,12 +138,12 @@ void Globals::ReadTexturePool(const std::string& texturePoolXmlPath)
|
||||
return;
|
||||
}
|
||||
|
||||
XMLNode* root = doc.FirstChild();
|
||||
tinyxml2::XMLNode* root = doc.FirstChild();
|
||||
|
||||
if (root == nullptr)
|
||||
return;
|
||||
|
||||
for (XMLElement* child = root->FirstChildElement(); child != NULL;
|
||||
for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != NULL;
|
||||
child = child->NextSiblingElement())
|
||||
{
|
||||
if (std::string(child->Name()) == "Texture")
|
||||
@@ -177,7 +178,7 @@ void Globals::AddSegment(int32_t segment, ZFile* file)
|
||||
if (std::find(segments.begin(), segments.end(), segment) == segments.end())
|
||||
segments.push_back(segment);
|
||||
|
||||
segmentRefs[segment] = file->GetXmlFilePath();
|
||||
segmentRefs[segment] = file->GetXmlFilePath().string();
|
||||
segmentRefFiles[segment] = file;
|
||||
}
|
||||
|
||||
@@ -185,3 +186,36 @@ bool Globals::HasSegment(int32_t segment)
|
||||
{
|
||||
return std::find(segments.begin(), segments.end(), segment) != segments.end();
|
||||
}
|
||||
|
||||
std::map<std::string, ExporterSet*>* Globals::GetExporterMap()
|
||||
{
|
||||
static std::map<std::string, ExporterSet*> exporters;
|
||||
return &exporters;
|
||||
}
|
||||
|
||||
void Globals::AddExporter(std::string exporterName, ExporterSet* exporterSet)
|
||||
{
|
||||
auto exporters = GetExporterMap();
|
||||
(*exporters)[exporterName] = exporterSet;
|
||||
}
|
||||
|
||||
ZResourceExporter* Globals::GetExporter(ZResourceType resType)
|
||||
{
|
||||
auto exporters = *GetExporterMap();
|
||||
|
||||
if (currentExporter != "" && exporters[currentExporter]->exporters.find(resType) !=
|
||||
exporters[currentExporter]->exporters.end())
|
||||
return exporters[currentExporter]->exporters[resType];
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ExporterSet* Globals::GetExporterSet()
|
||||
{
|
||||
auto exporters = *GetExporterMap();
|
||||
|
||||
if (currentExporter != "")
|
||||
return exporters[currentExporter];
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
+29
-19
@@ -4,8 +4,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ZFile.h"
|
||||
#include "ZRoom/ZRoom.h"
|
||||
#include "ZTexture.h"
|
||||
|
||||
class ZRoom;
|
||||
|
||||
enum class VerbosityLevel
|
||||
{
|
||||
@@ -35,6 +35,25 @@ public:
|
||||
GameConfig() = default;
|
||||
};
|
||||
|
||||
typedef void (*ExporterSetFunc)(ZFile*);
|
||||
typedef bool (*ExporterSetFuncBool)(ZFileMode fileMode);
|
||||
typedef void (*ExporterSetFuncVoid)(int argc, char* argv[], int& i);
|
||||
typedef void (*ExporterSetFuncVoid2)(std::string buildMode, ZFileMode& fileMode);
|
||||
typedef void (*ExporterSetFuncVoid3)();
|
||||
|
||||
class ExporterSet
|
||||
{
|
||||
public:
|
||||
std::map<ZResourceType, ZResourceExporter*> exporters;
|
||||
ExporterSetFuncVoid parseArgsFunc = nullptr;
|
||||
ExporterSetFuncVoid2 parseFileModeFunc = nullptr;
|
||||
ExporterSetFuncBool processFileModeFunc = nullptr;
|
||||
ExporterSetFunc beginFileFunc = nullptr;
|
||||
ExporterSetFunc endFileFunc = nullptr;
|
||||
ExporterSetFuncVoid3 beginXMLFunc = nullptr;
|
||||
ExporterSetFuncVoid3 endXMLFunc = nullptr;
|
||||
};
|
||||
|
||||
class Globals
|
||||
{
|
||||
public:
|
||||
@@ -56,6 +75,7 @@ public:
|
||||
bool warnNoOffset = false;
|
||||
bool errorNoOffset = false;
|
||||
bool verboseUnaccounted = false;
|
||||
bool gccCompat = false;
|
||||
|
||||
std::vector<ZFile*> files;
|
||||
std::vector<int32_t> segments;
|
||||
@@ -64,6 +84,10 @@ public:
|
||||
ZRoom* lastScene;
|
||||
std::map<uint32_t, std::string> symbolMap;
|
||||
|
||||
std::string currentExporter;
|
||||
static std::map<std::string, ExporterSet*>* GetExporterMap();
|
||||
static void AddExporter(std::string exporterName, ExporterSet* exporterSet);
|
||||
|
||||
Globals();
|
||||
std::string FindSymbolSegRef(int32_t segNumber, uint32_t symbolAddress);
|
||||
void ReadConfigFile(const std::string& configFilePath);
|
||||
@@ -71,20 +95,6 @@ public:
|
||||
void GenSymbolMap(const std::string& symbolMapPath);
|
||||
void AddSegment(int32_t segment, ZFile* file);
|
||||
bool HasSegment(int32_t segment);
|
||||
};
|
||||
|
||||
/*
|
||||
* Note: In being able to track references across files, there are a few major files that make use
|
||||
* of segments...
|
||||
* Segment 1: nintendo_rogo_static/title_static
|
||||
* Segment 2: parameter_static
|
||||
* Segment 4: gameplay_keep
|
||||
* Segment 5: gameplay_field_keep, gameplay_dangeon_keep
|
||||
* Segment 7: link_animetion
|
||||
* Segment 8: icon_item_static
|
||||
* Segment 9: icon_item_24_static
|
||||
* Segment 12: icon_item_field_static, icon_item_dungeon_static
|
||||
* Segment 13: icon_item_nes_static
|
||||
*
|
||||
* I'm thinking a config file could be usable, but I'll have to experiment...
|
||||
*/
|
||||
ZResourceExporter* GetExporter(ZResourceType resType);
|
||||
ExporterSet* GetExporterSet();
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user