added runtime stubs

This commit is contained in:
Jack Andersen 2015-07-11 12:41:10 -10:00
parent 043af55580
commit c1f4f31e6f
15 changed files with 31 additions and 9 deletions

View File

@ -5,3 +5,4 @@ if (NOT TARGET NOD)
endif()
include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR})
add_subdirectory(DataSpec)
add_subdirectory(Runtime)

View File

@ -10,6 +10,20 @@ namespace Retro
/* This comes up a great deal */
typedef Athena::io::DNA<Athena::BigEndian> BigDNA;
class FourCC final : public BigDNA, public HECL::FourCC
{
public:
FourCC() : HECL::FourCC() {}
FourCC(const char* name)
: HECL::FourCC(name) {}
Delete expl;
inline void read(Athena::io::IStreamReader& reader)
{reader.readUBytesToBuf(fcc, 4);}
inline void write(Athena::io::IStreamWriter& writer) const
{writer.writeUBytes((atUint8*)fcc, 4);}
};
/* PAK 32-bit Unique ID */
class UniqueID32 : public BigDNA
{

View File

@ -8,7 +8,7 @@ namespace DNAMP1
struct MLVL : BigDNA
{
DECL_DNA
HECL::FourCC magic;
FourCC magic;
Value<atUint32> version;
UniqueID32 worldNameId;
UniqueID32 saveWorldId;

View File

@ -17,7 +17,7 @@ public:
struct NameEntry : public BigDNA
{
DECL_DNA
HECL::FourCC type;
FourCC type;
UniqueID32 id;
Value<atUint32> nameLen;
String<DNA_COUNT(nameLen)> name;
@ -27,7 +27,7 @@ public:
{
DECL_DNA
Value<atUint32> compressed;
HECL::FourCC type;
FourCC type;
UniqueID32 id;
Value<atUint32> size;
Value<atUint32> offset;

View File

@ -24,7 +24,7 @@ struct STRG : BigDNA
struct Language
{
HECL::FourCC lang;
FourCC lang;
std::vector<std::wstring> strings;
};
std::vector<Language> langs;

View File

@ -8,7 +8,7 @@ namespace DNAMP2
struct MLVL : BigDNA
{
DECL_DNA
HECL::FourCC magic;
FourCC magic;
Value<atUint32> version;
UniqueID32 worldNameId;
UniqueID32 darkWorldNameId;

View File

@ -55,7 +55,7 @@ void PAK::write(Athena::io::IStreamWriter& writer) const
writer.setEndian(Athena::BigEndian);
m_header.write(writer);
HECL::FourCC("STRG").write(writer);
FourCC("STRG").write(writer);
atUint32 strgSz = 4;
for (const NameEntry& entry : m_nameEntries)
strgSz += entry.name.size() + 13;
@ -63,13 +63,13 @@ void PAK::write(Athena::io::IStreamWriter& writer) const
strgSz += strgPad;
writer.writeUint32(strgSz);
HECL::FourCC("RSHD").write(writer);
FourCC("RSHD").write(writer);
atUint32 rshdSz = 4 + 24 * m_entries.size();
atUint32 rshdPad = ((rshdSz + 63) & ~63) - rshdSz;
rshdSz += rshdPad;
writer.writeUint32(rshdSz);
HECL::FourCC("DATA").write(writer);
FourCC("DATA").write(writer);
atUint32 dataSz = 0;
for (const Entry& entry : m_entries)
dataSz += (entry.size + 63) & ~63;

View File

@ -27,7 +27,7 @@ public:
{
DECL_DNA
String<-1> name;
HECL::FourCC type;
FourCC type;
UniqueID64 id;
};

View File

7
Runtime/CMakeLists.txt Normal file
View File

@ -0,0 +1,7 @@
add_subdirectory(Core)
add_subdirectory(Graphics)
add_subdirectory(Audio)
add_subdirectory(Character)
add_subdirectory(GuiSys)
add_subdirectory(Script)

View File

View File

View File

View File

View File