This commit is contained in:
Jack Andersen 2016-07-23 18:47:04 -10:00
commit 4b10697a5a
15 changed files with 200 additions and 5 deletions

View File

@ -2,6 +2,7 @@ make_dnalist(liblist
CMDL
MAPA
EGMC
SAVWCommon
ParticleCommon)
add_library(DNACommon

View File

@ -0,0 +1,57 @@
#ifndef __COMMON_SAVWCOMMON_HPP__
#define __COMMON_SAVWCOMMON_HPP__
#include "DNACommon.hpp"
#include "PAK.hpp"
namespace DataSpec
{
namespace SAVWCommon
{
enum class EScanCategory
{
None,
Data,
Lore,
Creature,
Research
};
struct Header : BigYAML
{
DECL_YAML
Value<atUint32> magic;
Value<atUint32> version;
Value<atUint32> areaCount;
};
struct EnvironmentVariable : BigYAML
{
DECL_YAML
String<-1> name;
Value<atUint32> unk1;
Value<atUint32> unk2;
Value<atUint32> unk3;
};
struct Layer : BigYAML
{
DECL_YAML
Value<atUint32> areaId;
Value<atUint32> layer;
};
template <class SAVW>
static bool ExtractSAVW(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
{
SAVW savw;
savw.read(rs);
FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb"));
savw.toYAMLFile(fp);
fclose(fp);
return true;
}
}
}
#endif // __COMMON_SAVWCOMMON_HPP__

View File

@ -14,6 +14,7 @@ make_dnalist(liblist
DeafBabe
SCAN
FRME
SAVW
Tweaks/CTweakGame
Tweaks/CTweakParticle
Tweaks/CTweakPlayer

View File

@ -16,6 +16,7 @@
#include "../DNACommon/DGRP.hpp"
#include "CMDL.hpp"
#include "AFSM.hpp"
#include "SAVW.hpp"
#include "ANCS.hpp"
#include "MREA.hpp"
#include "MAPA.hpp"
@ -277,6 +278,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
return {STRG::Extract, nullptr, {_S(".yaml")}};
case SBIG('SCAN'):
return {SCAN::Extract, nullptr, {_S(".yaml")}, 0, SCAN::Name};
case SBIG('SAVW'):
return {SAVWCommon::ExtractSAVW<SAVW>, nullptr, {_S(".yaml")}};
case SBIG('TXTR'):
return {TXTR::Extract, nullptr, {_S(".png")}};
case SBIG('AFSM'):

36
DataSpec/DNAMP1/SAVW.hpp Normal file
View File

@ -0,0 +1,36 @@
#ifndef __DNAMP1_SAVW_HPP__
#define __DNAMP1_SAVW_HPP__
#include "../DNACommon/SAVWCommon.hpp"
#include "DNAMP1.hpp"
namespace DataSpec
{
namespace DNAMP1
{
struct Scan : BigYAML
{
DECL_YAML
UniqueID32 scanId;
Value<SAVWCommon::EScanCategory> category;
};
struct SAVW : BigYAML
{
DECL_YAML
SAVWCommon::Header header;
Value<atUint32> skippableCutsceneCount;
Vector<atUint32, DNA_COUNT(skippableCutsceneCount)> skippableCutscenes;
Value<atUint32> relayCount;
Vector<atUint32, DNA_COUNT(relayCount)> relays;
Value<atUint32> layerCount;
Vector<SAVWCommon::Layer, DNA_COUNT(layerCount)> layers;
Value<atUint32> doorCount;
Vector<atUint32, DNA_COUNT(doorCount)> doors;
Value<atUint32> scanCount;
Vector<Scan, DNA_COUNT(scanCount)> scans;
};
}
}
#endif // __DNAMP1_SAVW_HPP__

View File

@ -7,6 +7,7 @@ make_dnalist(liblist
CSKR
MREA
PTLA
SAVW
DeafBabe)
add_library(DNAMP2
DNAMP2.hpp DNAMP2.cpp

View File

@ -7,6 +7,7 @@
#include "MREA.hpp"
#include "MAPA.hpp"
#include "AFSM.hpp"
#include "SAVW.hpp"
#include "../DNACommon/FSM2.hpp"
#include "../DNACommon/TXTR.hpp"
#include "../DNACommon/FONT.hpp"
@ -222,6 +223,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& ent
return {TXTR::Extract, nullptr, {_S(".png")}};
case SBIG('AFSM'):
return {AFSM::Extract, nullptr, {_S(".yaml")}};
case SBIG('SAVW'):
return {SAVWCommon::ExtractSAVW<SAVW>, nullptr, {_S(".yaml")}};
case SBIG('CMDL'):
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
case SBIG('ANCS'):

View File

@ -1,5 +1,5 @@
#ifndef PTLA_HPP
#define PTLA_HPP
#ifndef __DNAMP2_PTLA_HPP__
#define __DNAMP2_PTLA_HPP__
#include "../DNACommon/DNACommon.hpp"
@ -69,4 +69,4 @@ struct PTLA : BigDNA
};
}
}
#endif // PTLA_HPP
#endif // __DNAMP2_PTLA_HPP__

24
DataSpec/DNAMP2/SAVW.hpp Normal file
View File

@ -0,0 +1,24 @@
#ifndef __DNAMP2_SAVW_HPP__
#define __DNAMP2_SAVW_HPP__
#include "../DNAMP1/SAVW.hpp"
#include "DNAMP2.hpp"
namespace DataSpec
{
namespace DNAMP2
{
struct SAVW : DNAMP1::SAVW
{
DECL_YAML
Value<atUint32> systemVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(systemVarCount)> systemVars;
Value<atUint32> gameVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(gameVarCount)> gameVars;
Value<atUint32> gameObjectCount;
Vector<atUint32, DNA_COUNT(gameObjectCount)> gameObjects;
};
}
}
#endif // __DNAMP2_SAVW_HPP__

View File

@ -6,7 +6,8 @@ make_dnalist(liblist
CMDLMaterials
CINF
CSKR
MREA)
MREA
SAVW)
add_library(DNAMP3
DNAMP3.hpp DNAMP3.cpp
${liblist}

View File

@ -8,6 +8,7 @@
#include "CHAR.hpp"
#include "MREA.hpp"
#include "MAPA.hpp"
#include "SAVW.hpp"
#include "../DNACommon/TXTR.hpp"
#include "../DNACommon/FONT.hpp"
#include "../DNACommon/FSM2.hpp"
@ -230,6 +231,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
return {STRG::Extract, nullptr, {_S(".yaml")}};
case SBIG('TXTR'):
return {TXTR::Extract, nullptr, {_S(".png")}};
case SBIG('SAVW'):
return {SAVWCommon::ExtractSAVW<SAVW>, nullptr, {_S(".yaml")}};
case SBIG('CMDL'):
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
case SBIG('CHAR'):

54
DataSpec/DNAMP3/SAVW.hpp Normal file
View File

@ -0,0 +1,54 @@
#ifndef __DNAMP3_SAVW_HPP__
#define __DNAMP3_SAVW_HPP__
#include "../DNACommon/SAVWCommon.hpp"
#include "DNAMP3.hpp"
namespace DataSpec
{
namespace DNAMP3
{
struct Scan : BigYAML
{
DECL_YAML
UniqueID64 scanId;
Value<SAVWCommon::EScanCategory> category;
};
struct SavedState : BigYAML
{
DECL_YAML
struct ID : BigYAML
{
DECL_YAML
Value<atUint64> id[2];
};
ID id;
Value<atUint32> instance;
};
struct SAVW : BigYAML
{
DECL_YAML
SAVWCommon::Header header;
Value<atUint32> skippableCutsceneCount;
Vector<SavedState, DNA_COUNT(skippableCutsceneCount)> skippableCutscenes;
Value<atUint32> relayCount;
Vector<SavedState, DNA_COUNT(relayCount)> relays;
Value<atUint32> layerCount;
Vector<SAVWCommon::Layer, DNA_COUNT(layerCount)> layers;
Value<atUint32> doorCount;
Vector<SavedState, DNA_COUNT(doorCount)> doors;
Value<atUint32> scanCount;
Vector<Scan, DNA_COUNT(scanCount)> scans;
Value<atUint32> systemVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(systemVarCount)> systemVars;
Value<atUint32> gameVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(gameVarCount)> gameVars;
Value<atUint32> gameObjectCount;
Vector<SavedState, DNA_COUNT(gameObjectCount)> gameObjects;
};
}
}
#endif // __DNAMP3_SAVW_HPP__

View File

@ -0,0 +1,9 @@
#include "CSaveWorld.hpp"
namespace urde
{
CSaveWorld::CSaveWorld(CInputStream &in)
{
}
}

View File

@ -1,6 +1,8 @@
#ifndef __URDE_CSAVEWORLD_HPP__
#define __URDE_CSAVEWORLD_HPP__
#include "RetroTypes.hpp"
namespace urde
{
class CSaveWorld

2
hecl

@ -1 +1 @@
Subproject commit 778dfaad0e133fe3126910204e97f7157c7a0492
Subproject commit c4bdd92138ccc5de801bb109f9761605e3b81f74