Updated outdated IArchive documentation and got rid of old template reader/writer classes

This commit is contained in:
Aruki
2018-10-21 19:23:41 -06:00
parent 1bc95a30a5
commit 64e0aa8a44
17 changed files with 11 additions and 1514 deletions

View File

@@ -102,7 +102,6 @@ HEADERS += \
Resource/Factory/CScanLoader.h \
Resource/Factory/CScriptLoader.h \
Resource/Factory/CStringLoader.h \
Resource/Factory/CTemplateLoader.h \
Resource/Factory/CTextureDecoder.h \
Resource/Factory/CWorldLoader.h \
Resource/Model/CBasicModel.h \
@@ -274,7 +273,6 @@ SOURCES += \
Resource/Factory/CScanLoader.cpp \
Resource/Factory/CScriptLoader.cpp \
Resource/Factory/CStringLoader.cpp \
Resource/Factory/CTemplateLoader.cpp \
Resource/Factory/CTextureDecoder.cpp \
Resource/Factory/CWorldLoader.cpp \
Resource/Model/CBasicModel.cpp \

View File

@@ -1,6 +1,5 @@
#include "CGameProject.h"
#include "IUIRelay.h"
#include "Core/Resource/Factory/CTemplateLoader.h"
#include "Core/Resource/Script/CGameTemplate.h"
#include <Common/Serialization/XML.h>
#include <nod/nod.hpp>

View File

@@ -1,5 +1,4 @@
#include "CScriptLoader.h"
#include "CTemplateLoader.h"
#include "Core/GameProject/CResourceStore.h"
#include "Core/Resource/Script/CGameTemplate.h"
#include "Core/Resource/Script/NGameList.h"

File diff suppressed because it is too large Load Diff

View File

@@ -1,64 +0,0 @@
#ifndef CTEMPLATELOADER_H
#define CTEMPLATELOADER_H
// Old code! This is being kept around for now in case there is a reason to need to load the old templates.
// Template loading is handled by the serializer now. This code should only be used if there is a reason that
// the new templates need to be regenerated (i.e. if any data from the old templates is missing on the new ones).
#define USE_LEGACY_TEMPLATE_LOADER 0
#if USE_LEGACY_TEMPLATE_LOADER
#include "Core/Resource/Script/CGameTemplate.h"
#include "Core/Resource/Script/CScriptTemplate.h"
#include "Core/Resource/Script/Property/IProperty.h"
#include "Core/Resource/Script/Property/CEnumProperty.h"
#include "Core/Resource/Script/Property/CFlagsProperty.h"
#include <tinyxml2.h>
class CTemplateLoader
{
static const TString mskTemplatesDir;
static const TString mskGameListPath;
CGameTemplate *mpGameTemplate;
EGame mGame;
TString mTemplatesDir;
TString mGameDir;
// Constructor
CTemplateLoader(const TString& rkTemplatesDir)
: mTemplatesDir(rkTemplatesDir) {}
// Load Property
IProperty* LoadProperty(tinyxml2::XMLElement* pElem, CScriptTemplate* pScript, CStructProperty* pParentStruct, const TString& rkTemplateName);
IProperty* CreateProperty(u32 ID, EPropertyType Type, const TString& rkName, CScriptTemplate* pScript, CStructProperty* pStruct);
CStructProperty* LoadStructArchetype(const TString& rkTemplateFileName);
CEnumProperty* LoadEnumArchetype(const TString& rkTemplateFileName, bool bIsChoice);
CFlagsProperty* LoadFlagsArchetype(const TString& rkTemplateFileName);
void LoadProperties(tinyxml2::XMLElement* pPropertiesElem, CScriptTemplate* pScript, CStructProperty* pStruct, const TString& rkTemplateName);
void LoadEnumerators(tinyxml2::XMLElement* pEnumeratorsElem, CEnumProperty* pEnum, const TString& rkTemplateName);
void LoadBitFlags(tinyxml2::XMLElement* pFlagsElem, CFlagsProperty* pFlags, const TString& rkTemplateName);
// Load Script Object
CScriptTemplate* LoadScriptTemplate(tinyxml2::XMLDocument* pDoc, const TString& rkTemplateName, u32 ObjectID);
// Load Game
CGameTemplate* LoadGameInfo(tinyxml2::XMLNode* pNode);
void LoadGameTemplate(tinyxml2::XMLDocument* pDoc, CGameTemplate* pGame);
// Utility
static void OpenXML(const TString& rkPath, tinyxml2::XMLDocument& rDoc);
static TString ErrorName(tinyxml2::XMLError Error);
public:
static void LoadGameList();
static void LoadGameTemplates(EGame Game);
static void LoadAllGames();
static void LoadPropertyList(tinyxml2::XMLDocument* pDoc, const TString& rkListName);
static void SaveGameList();
};
#endif
#endif // CTEMPLATELOADER_H

View File

@@ -95,9 +95,6 @@ struct SPropertyTemplatePath
/** CGameTemplate - Per-game template data */
class CGameTemplate
{
friend class CTemplateLoader;
friend class CTemplateWriter;
EGame mGame;
TString mSourceFile;
bool mFullyLoaded;

View File

@@ -43,9 +43,6 @@ struct SAttachment
*/
class CScriptTemplate
{
friend class CTemplateLoader;
friend class CTemplateWriter;
public:
enum ERotationType {
eRotationEnabled, eRotationDisabled

View File

@@ -23,7 +23,6 @@ struct SScriptArray
class CArrayProperty : public TTypedProperty<u32, EPropertyType::Array>
{
friend class IProperty;
friend class CTemplateLoader;
/** This class inherits from TTypedPropertyNew<int> in order to expose the array
* count value (the first member of SScriptArray). Outside users can edit this

View File

@@ -6,7 +6,6 @@
class CAssetProperty : public TSerializeableTypedProperty<CAssetID, EPropertyType::Asset>
{
friend class CTemplateLoader;
friend class IProperty;
CResTypeFilter mTypeFilter;

View File

@@ -13,7 +13,6 @@
template<EPropertyType TypeEnum>
class TEnumPropertyBase : public TSerializeableTypedProperty<s32, TypeEnum>
{
friend class CTemplateLoader;
friend class IProperty;
struct SEnumValue

View File

@@ -5,7 +5,6 @@
class CFlagsProperty : public TSerializeableTypedProperty<u32, EPropertyType::Flags>
{
friend class CTemplateLoader;
friend class IProperty;
struct SBitFlag

View File

@@ -5,7 +5,6 @@
class CPointerProperty : public TTypedProperty<void*, EPropertyType::Pointer>
{
friend class CTemplateLoader;
friend class IProperty;
CPointerProperty(EGame Game)

View File

@@ -1,6 +1,5 @@
#include "CPropertyNameGenerator.h"
#include "IUIRelay.h"
#include "Core/Resource/Factory/CTemplateLoader.h"
#include "Core/Resource/Script/CGameTemplate.h"
#include "Core/Resource/Script/NPropertyMap.h"
#include <Common/Hash/CCRC32.h>

View File

@@ -5,7 +5,6 @@
class CStructProperty : public IProperty
{
friend class CTemplateLoader;
friend class IProperty;
public:

View File

@@ -111,9 +111,6 @@ enum class ECookPreference
/** New property class */
class IProperty
{
friend class CTemplateLoader;
friend class CPropertyFactory;
protected:
/** Flags */
FPropertyFlags mFlags;