2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 15:44:56 +00:00

initial TXTR support

This commit is contained in:
Jack Andersen
2015-07-18 20:19:46 -10:00
parent dea341d27b
commit 29103838da
13 changed files with 505 additions and 29 deletions

View File

@@ -2,7 +2,6 @@ make_dnalist(liblist
MLVL
STRG)
add_library(DNAMP2
DNAMP2.hpp
DNAMP2.cpp
DNAMP2.hpp DNAMP2.cpp
${liblist}
STRG.cpp)

View File

@@ -2,6 +2,7 @@
#include "DNAMP2.hpp"
#include "STRG.hpp"
#include "MLVL.hpp"
#include "../DNACommon/TXTR.hpp"
namespace Retro
{
@@ -17,9 +18,9 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPar
m_pak.read(rs);
}
std::string PAKBridge::getLevelString() const
HECL::SystemString PAKBridge::getLevelString() const
{
std::string retval;
HECL::SystemString retval;
for (const DNAMP1::PAK::Entry& entry : m_pak.m_entries)
{
if (entry.type == Retro::MLVL)
@@ -35,7 +36,7 @@ std::string PAKBridge::getLevelString() const
mlvlName.read(rs);
if (retval.size())
retval += _S(", ");
retval += mlvlName.getUTF8(ENGL, 0);
retval += mlvlName.getSystemString(ENGL, 0);
}
}
}
@@ -44,8 +45,13 @@ std::string PAKBridge::getLevelString() const
ResExtractor PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& entry)
{
if (entry.type == Retro::STRG)
switch (entry.type.toUint32())
{
case SBIG('STRG'):
return {STRG::Extract<STRG>, ".as"};
case SBIG('TXTR'):
return {TXTR::Extract, ".png"};
}
return {};
}

View File

@@ -21,7 +21,7 @@ class PAKBridge
public:
PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPartition::Node& node);
const std::string& getName() const {return m_node.getName();}
std::string getLevelString() const;
HECL::SystemString getLevelString() const;
bool extractResources(const HECL::ProjectPath& dirOut,
const HECL::ProjectPath& cookedOut,
bool force);