extract tool work

This commit is contained in:
Jack Andersen 2015-07-12 20:30:20 -10:00
parent de73e764e1
commit cc340518f1
72 changed files with 27 additions and 10 deletions

View File

@ -14,6 +14,7 @@ add_executable(hecl main.cpp
list(APPEND DATA_SPEC_LIBS list(APPEND DATA_SPEC_LIBS
RetroDataSpec RetroDataSpec
DNACommon
DNAMP1 DNAMP1
DNAMP2 DNAMP2
DNAMP3) DNAMP3)

View File

@ -18,12 +18,12 @@ public:
if (!m_info.args.size()) if (!m_info.args.size())
LogModule.report(LogVisor::FatalError, "hecl extract needs a source path as its first argument"); LogModule.report(LogVisor::FatalError, "hecl extract needs a source path as its first argument");
m_einfo.srcpath = &m_info.args[0]; m_einfo.srcpath = m_info.args[0];
m_einfo.extractArgs.reserve(info.args.size() - 1); m_einfo.extractArgs.reserve(info.args.size() - 1);
for (std::vector<HECL::SystemString>::const_iterator it=info.args.begin() + 1; for (std::vector<HECL::SystemString>::const_iterator it=info.args.begin() + 1;
it != info.args.end(); it != info.args.end();
++it) ++it)
m_einfo.extractArgs.push_back(&*it); m_einfo.extractArgs.push_back(*it);
for (const HECL::Database::DataSpecEntry* entry : HECL::Database::DATA_SPEC_REGISTRY) for (const HECL::Database::DataSpecEntry* entry : HECL::Database::DATA_SPEC_REGISTRY)
{ {
@ -99,7 +99,10 @@ public:
HECL::Printf(_S("ABOUT TO EXTRACT:\n")); HECL::Printf(_S("ABOUT TO EXTRACT:\n"));
for (HECL::Database::IDataSpec::ExtractReport& rep : m_reps) for (HECL::Database::IDataSpec::ExtractReport& rep : m_reps)
{
_recursivePrint(0, rep); _recursivePrint(0, rep);
HECL::Printf(_S("\n"));
}
if (XTERM_COLOR) if (XTERM_COLOR)
HECL::Printf(_S("\n" BLUE BOLD "Continue?" NORMAL " (Y/N) ")); HECL::Printf(_S("\n" BLUE BOLD "Continue?" NORMAL " (Y/N) "));

@ -1 +1 @@
Subproject commit abb9d4c0004daa0c892b7d81eb189549089f8cf2 Subproject commit 7876d4c209a1f5ce85eede73f8e34d4b9f6ca2bc

View File

@ -70,8 +70,8 @@ public:
*/ */
struct ExtractPassInfo struct ExtractPassInfo
{ {
const SystemString* srcpath; SystemString srcpath;
std::vector<const SystemString*> extractArgs; std::vector<SystemString> extractArgs;
}; };
/** /**

View File

@ -231,6 +231,8 @@ protected:
public: public:
FourCC() /* Sentinel FourCC */ FourCC() /* Sentinel FourCC */
: num(0) {} : num(0) {}
FourCC(const FourCC& other)
{num = other.num;}
FourCC(const char* name) FourCC(const char* name)
: num(*(uint32_t*)name) {} : num(*(uint32_t*)name) {}
inline bool operator==(const FourCC& other) const {return num == other.num;} inline bool operator==(const FourCC& other) const {return num == other.num;}
@ -238,6 +240,7 @@ public:
inline bool operator==(const char* other) const {return num == *(uint32_t*)other;} inline bool operator==(const char* other) const {return num == *(uint32_t*)other;}
inline bool operator!=(const char* other) const {return num != *(uint32_t*)other;} inline bool operator!=(const char* other) const {return num != *(uint32_t*)other;}
inline std::string toString() const {return std::string(fcc, 4);} inline std::string toString() const {return std::string(fcc, 4);}
inline uint32_t toUint32() const {return num;}
}; };
/** /**
@ -511,6 +514,11 @@ static inline uint64_t SBig(uint64_t val) {return val;}
namespace std namespace std
{ {
template <> struct hash<HECL::FourCC>
{
inline size_t operator()(const HECL::FourCC& val) const noexcept
{return val.toUint32();}
};
template <> struct hash<HECL::ProjectPath> template <> struct hash<HECL::ProjectPath>
{ {
inline size_t operator()(const HECL::ProjectPath& val) const noexcept inline size_t operator()(const HECL::ProjectPath& val) const noexcept

View File

@ -1,10 +1,15 @@
add_subdirectory(backend) add_subdirectory(Backend)
add_subdirectory(database) add_subdirectory(Database)
add_subdirectory(frontend) add_subdirectory(Frontend)
add_subdirectory(runtime) add_subdirectory(Runtime)
add_library(HECL add_library(HECL
HECL.cpp HECL.cpp
ProjectPath.cpp ProjectPath.cpp
WideStringConvert.cpp) WideStringConvert.cpp
../include/HECL/HECL.hpp
../include/HECL/Backend.hpp
../include/HECL/Frontend.hpp
../include/HECL/Database.hpp
../include/HECL/Runtime.hpp)