diff --git a/.gitmodules b/.gitmodules index 9465ae8aa..338869a93 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "PakLib"] path = PakLib url = https://github.com/RetroView/PakLib.git +[submodule "NODLib"] + path = NODLib + url = https://github.com/RetroView/NODLib.git diff --git a/DNA/DNA.pri b/DNA/DNA.pri deleted file mode 100644 index efd50f423..000000000 --- a/DNA/DNA.pri +++ /dev/null @@ -1,5 +0,0 @@ -include(DNACommon/DNACommon.pri) -include(DNAMP1/DNAMP1.pri) -include(DNAMP2/DNAMP2.pri) -include(DNAMP3/DNAMP3.pri) - diff --git a/DNA/DNACommon/DNACommon.hpp b/DataSpec/DNACommon/DNACommon.hpp similarity index 98% rename from DNA/DNACommon/DNACommon.hpp rename to DataSpec/DNACommon/DNACommon.hpp index 1272cde7d..ce8ff51de 100644 --- a/DNA/DNACommon/DNACommon.hpp +++ b/DataSpec/DNACommon/DNACommon.hpp @@ -5,6 +5,9 @@ #include #include +namespace Retro +{ + /* This comes up a great deal */ typedef Athena::io::DNA BigDNA; @@ -52,4 +55,6 @@ public: {_write(writer);} }; +} + #endif // __DNA_COMMON_HPP__ diff --git a/DNA/DNACommon/DNACommon.pri b/DataSpec/DNACommon/DNACommon.pri similarity index 100% rename from DNA/DNACommon/DNACommon.pri rename to DataSpec/DNACommon/DNACommon.pri diff --git a/DNA/DNAMP1/DNAMP1.pri b/DataSpec/DNAMP1/DNAMP1.pri similarity index 100% rename from DNA/DNAMP1/DNAMP1.pri rename to DataSpec/DNAMP1/DNAMP1.pri diff --git a/DNA/DNAMP1/MLVL.hpp b/DataSpec/DNAMP1/MLVL.hpp similarity index 99% rename from DNA/DNAMP1/MLVL.hpp rename to DataSpec/DNAMP1/MLVL.hpp index d548e4286..5bf717ddc 100644 --- a/DNA/DNAMP1/MLVL.hpp +++ b/DataSpec/DNAMP1/MLVL.hpp @@ -1,5 +1,7 @@ #include "../DNACommon/DNACommon.hpp" +namespace Retro +{ namespace DNAMP1 { @@ -101,3 +103,4 @@ struct MLVL : public BigDNA }; } +} diff --git a/DNA/DNAMP2/DNAMP2.pri b/DataSpec/DNAMP2/DNAMP2.pri similarity index 100% rename from DNA/DNAMP2/DNAMP2.pri rename to DataSpec/DNAMP2/DNAMP2.pri diff --git a/DNA/DNAMP3/DNAMP3.pri b/DataSpec/DNAMP3/DNAMP3.pri similarity index 100% rename from DNA/DNAMP3/DNAMP3.pri rename to DataSpec/DNAMP3/DNAMP3.pri diff --git a/DataSpec/DataSpec.pro b/DataSpec/DataSpec.pro new file mode 100644 index 000000000..527377f2b --- /dev/null +++ b/DataSpec/DataSpec.pro @@ -0,0 +1,26 @@ +TEMPLATE = lib +CONFIG += staticlib c++11 +TARGET = RetroDataSpec +CONFIG -= Qt +QT = + +# Get hecl's headers (when built as submodule in hecl's extern) +INCLUDEPATH += ../../../include \ + ../../Athena/include \ + ../NODLib/include + +include(../PakLib/PakLib.pri) + +include(DNACommon/DNACommon.pri) +include(DNAMP1/DNAMP1.pri) +include(DNAMP2/DNAMP2.pri) +include(DNAMP3/DNAMP3.pri) + +HEADERS += \ + SpecBase.hpp + +SOURCES += \ + SpecMP1.cpp \ + SpecMP2.cpp \ + SpecMP3.cpp \ + SpecBase.cpp diff --git a/DataSpec/SpecBase.cpp b/DataSpec/SpecBase.cpp new file mode 100644 index 000000000..fbcad675a --- /dev/null +++ b/DataSpec/SpecBase.cpp @@ -0,0 +1,39 @@ +#include "SpecBase.hpp" + +namespace Retro +{ + +bool SpecBase::canExtract(const HECL::Database::Project& project, const ExtractPassInfo& info, + HECL::SystemString& reasonNo) +{ + +} + +void SpecBase::doExtract(const HECL::Database::Project& project, const ExtractPassInfo& info) +{ +} + +bool SpecBase::canCook(const HECL::Database::Project& project, const CookTaskInfo& info, + HECL::SystemString& reasonNo) +{ +} + +void SpecBase::doCook(const HECL::Database::Project& project, const CookTaskInfo& info) +{ +} + +bool SpecBase::canPackage(const HECL::Database::Project& project, const PackagePassInfo& info, + HECL::SystemString& reasonNo) +{ +} + +void SpecBase::gatherDependencies(const HECL::Database::Project& project, const PackagePassInfo& info, + std::unordered_set& implicitsOut) +{ +} + +void SpecBase::doPackage(const HECL::Database::Project& project, const PackagePassInfo& info) +{ +} + +} diff --git a/DataSpec/SpecBase.hpp b/DataSpec/SpecBase.hpp new file mode 100644 index 000000000..2e24505ef --- /dev/null +++ b/DataSpec/SpecBase.hpp @@ -0,0 +1,53 @@ +#ifndef SPECBASE_HPP +#define SPECBASE_HPP + +#include + +#include +#include + +namespace Retro +{ + +struct SpecBase : public HECL::Database::IDataSpec +{ + bool canExtract(const HECL::Database::Project& project, const ExtractPassInfo& info, + HECL::SystemString& reasonNo); + void doExtract(const HECL::Database::Project& project, const ExtractPassInfo& info); + + bool canCook(const HECL::Database::Project& project, const CookTaskInfo& info, + HECL::SystemString& reasonNo); + void doCook(const HECL::Database::Project& project, const CookTaskInfo& info); + + bool canPackage(const HECL::Database::Project& project, const PackagePassInfo& info, + HECL::SystemString& reasonNo); + void gatherDependencies(const HECL::Database::Project& project, const PackagePassInfo& info, + std::unordered_set& implicitsOut); + void doPackage(const HECL::Database::Project& project, const PackagePassInfo& info); + + virtual bool checkFromGCNDisc(const NOD::DiscGCN& disc)=0; + virtual bool readFromGCNDisc(const NOD::DiscGCN& disc)=0; + + virtual bool checkFromWiiDisc(const NOD::DiscWii& disc)=0; + virtual bool readFromWiiDisc(const NOD::DiscWii& disc)=0; + + virtual bool checkFromProject(const HECL::Database::Project& proj)=0; + virtual bool readFromProject(const HECL::Database::Project& proj)=0; + + virtual bool visitGameObjects(std::function)=0; + struct ILevelSpec + { + virtual bool visitLevelObjects(std::function)=0; + struct IAreaSpec + { + virtual bool visitAreaObjects(std::function)=0; + }; + virtual bool visitAreas(std::function)=0; + }; + virtual bool visitLevels(std::function)=0; +}; + +} + +#endif // SPECBASE_HPP + diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp new file mode 100644 index 000000000..7e70996c3 --- /dev/null +++ b/DataSpec/SpecMP1.cpp @@ -0,0 +1,61 @@ +#include "SpecBase.hpp" + +namespace Retro +{ + +struct SpecMP1 : public SpecBase +{ + bool checkFromGCNDisc(const NOD::DiscGCN& disc) + { + } + bool readFromGCNDisc(const NOD::DiscGCN& disc) + { + } + + bool checkFromWiiDisc(const NOD::DiscWii& disc) + { + } + bool readFromWiiDisc(const NOD::DiscWii& disc) + { + } + + bool checkFromProject(const HECL::Database::Project& proj) + { + } + bool readFromProject(const HECL::Database::Project& proj) + { + } + + bool visitGameObjects(std::function) + { + } + struct LevelSpec : public ILevelSpec + { + bool visitLevelObjects(std::function) + { + } + struct AreaSpec : public IAreaSpec + { + bool visitAreaObjects(std::function) + { + } + }; + bool visitAreas(std::function) + { + } + }; + bool visitLevels(std::function) + { + } +}; + +static HECL::Database::DataSpecEntry SpecMP1 +( + _S("MP1"), + _S("Data specification for original Metroid Prime engine"), + [](HECL::Database::DataSpecTool) -> HECL::Database::IDataSpec* {return new struct SpecMP1;} +); + +} + + diff --git a/DataSpec/SpecMP2.cpp b/DataSpec/SpecMP2.cpp new file mode 100644 index 000000000..f17c1db50 --- /dev/null +++ b/DataSpec/SpecMP2.cpp @@ -0,0 +1,8 @@ +#include "SpecBase.hpp" + +static HECL::Database::DataSpecEntry SpecMP2 +( + _S("MP2"), + _S("Data specification for original Metroid Prime 2 engine"), + [](HECL::Database::DataSpecTool tool) -> HECL::Database::IDataSpec* {} +); diff --git a/DataSpec/SpecMP3.cpp b/DataSpec/SpecMP3.cpp new file mode 100644 index 000000000..754385817 --- /dev/null +++ b/DataSpec/SpecMP3.cpp @@ -0,0 +1,9 @@ +#include "SpecBase.hpp" + +static HECL::Database::DataSpecEntry SpecMP3 +( + _S("MP3"), + _S("Data specification for original Metroid Prime 3 engine"), + [](HECL::Database::DataSpecTool tool) -> HECL::Database::IDataSpec* {} +); + diff --git a/NODLib b/NODLib new file mode 160000 index 000000000..a1b2a262b --- /dev/null +++ b/NODLib @@ -0,0 +1 @@ +Subproject commit a1b2a262bf4a4847eda00790da77a1a5289ddba1 diff --git a/RetroCommon.pri b/RetroCommon.pri deleted file mode 100644 index bd76566a6..000000000 --- a/RetroCommon.pri +++ /dev/null @@ -1,13 +0,0 @@ -INCLUDEPATH += $$PWD/DNA $$PWD/include - -include(../libSquish/libSquish.pri) -include(PakLib/PakLib.pri) - -HEADERS += \ - $$PWD/include/RetroCommon.hpp - -SOURCES += \ - $$PWD/src/RetroCommon.cpp \ - $$PWD/src/MREADecompress.cpp - -include(DNA/DNA.pri) diff --git a/RetroCommon.pro b/RetroCommon.pro new file mode 100644 index 000000000..3ddb9761a --- /dev/null +++ b/RetroCommon.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs +CONFIG -= Qt +QT = + +SUBDIRS += DataSpec NODLib/lib +