2015-07-17 00:01:05 +00:00
|
|
|
#include <set>
|
|
|
|
|
|
|
|
#define NOD_ATHENA 1
|
2015-07-16 01:57:34 +00:00
|
|
|
#include "DNAMP3.hpp"
|
2015-07-17 00:01:05 +00:00
|
|
|
#include "STRG.hpp"
|
|
|
|
#include "MLVL.hpp"
|
2015-07-19 06:19:46 +00:00
|
|
|
#include "../DNACommon/TXTR.hpp"
|
2015-07-16 01:57:34 +00:00
|
|
|
|
|
|
|
namespace Retro
|
|
|
|
{
|
|
|
|
namespace DNAMP3
|
|
|
|
{
|
2015-07-17 00:01:05 +00:00
|
|
|
|
2015-07-16 01:57:34 +00:00
|
|
|
LogVisor::LogModule Log("Retro::DNAMP3");
|
2015-07-17 00:01:05 +00:00
|
|
|
|
|
|
|
PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPartition::Node& node)
|
|
|
|
: m_project(project), m_node(node)
|
|
|
|
{
|
|
|
|
NOD::AthenaPartReadStream rs(node.beginReadStream());
|
|
|
|
m_pak.read(rs);
|
|
|
|
|
2015-08-04 02:14:47 +00:00
|
|
|
/* Append Level String */
|
2015-07-19 06:19:46 +00:00
|
|
|
std::set<HECL::SystemString, CaseInsensitiveCompare> uniq;
|
2015-07-17 00:01:05 +00:00
|
|
|
for (const PAK::Entry& entry : m_pak.m_entries)
|
|
|
|
{
|
|
|
|
if (entry.type == Retro::MLVL)
|
|
|
|
{
|
|
|
|
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
|
|
|
MLVL mlvl;
|
|
|
|
mlvl.read(rs);
|
|
|
|
const PAK::Entry* nameEnt = m_pak.lookupEntry(mlvl.worldNameId);
|
|
|
|
if (nameEnt)
|
|
|
|
{
|
|
|
|
PAKEntryReadStream rs = nameEnt->beginReadStream(m_node);
|
|
|
|
STRG mlvlName;
|
|
|
|
mlvlName.read(rs);
|
2015-07-19 06:19:46 +00:00
|
|
|
uniq.insert(mlvlName.getSystemString(ENGL, 0));
|
2015-07-17 00:01:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-07-18 04:33:38 +00:00
|
|
|
bool comma = false;
|
2015-07-19 06:19:46 +00:00
|
|
|
for (const HECL::SystemString& str : uniq)
|
2015-07-17 00:01:05 +00:00
|
|
|
{
|
2015-07-18 04:33:38 +00:00
|
|
|
if (comma)
|
2015-08-04 02:14:47 +00:00
|
|
|
m_levelString += _S(", ");
|
2015-07-18 04:33:38 +00:00
|
|
|
comma = true;
|
2015-08-04 02:14:47 +00:00
|
|
|
m_levelString += str;
|
2015-07-17 00:01:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-04 02:14:47 +00:00
|
|
|
void PAKBridge::build()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
|
2015-07-17 00:01:05 +00:00
|
|
|
{
|
2015-07-19 06:19:46 +00:00
|
|
|
switch (entry.type.toUint32())
|
|
|
|
{
|
|
|
|
case SBIG('STRG'):
|
2015-08-04 02:14:47 +00:00
|
|
|
return {STRG::Extract, nullptr, ".as"};
|
2015-07-19 06:19:46 +00:00
|
|
|
case SBIG('TXTR'):
|
2015-08-04 02:14:47 +00:00
|
|
|
return {TXTR::Extract, nullptr, ".png"};
|
2015-07-19 06:19:46 +00:00
|
|
|
}
|
2015-07-17 00:01:05 +00:00
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2015-07-16 01:57:34 +00:00
|
|
|
}
|
|
|
|
}
|