2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-16 03:37:01 +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,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 {};
}