mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-21 02:39:17 +00:00
Implemented serialization support and initial support for raw resource formats
This commit is contained in:
@@ -26,6 +26,17 @@ EResType CResource::ResTypeForExtension(CFourCC Extension)
|
||||
}
|
||||
|
||||
// ************ GLOBAL ************
|
||||
bool ResourceSupportsSerialization(EResType Type)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case eWorld:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
TString GetResourceTypeName(EResType Type)
|
||||
{
|
||||
switch (Type)
|
||||
@@ -52,8 +63,8 @@ TString GetResourceTypeName(EResType Type)
|
||||
case eDependencyGroup: return "Dependency Group";
|
||||
case eDynamicCollision: return "Dynamic Collision";
|
||||
case eFont: return "Font";
|
||||
case eGuiFrame: return "GUI Frame";
|
||||
case eGuiKeyFrame: return "GUI Keyframe";
|
||||
case eGuiFrame: return "Gui Frame";
|
||||
case eGuiKeyFrame: return "Gui Keyframe";
|
||||
case eHintSystem: return "Hint System";
|
||||
case eMapArea: return "Area Map";
|
||||
case eMapWorld: return "World Map";
|
||||
@@ -90,7 +101,7 @@ TString GetResourceTypeName(EResType Type)
|
||||
case eStringTable: return "String Table";
|
||||
case eTexture: return "Texture";
|
||||
case eTweak: return "Tweak Data";
|
||||
case eUnknown_CAAD: return "Unknown (CAAD)";
|
||||
case eUnknown_CAAD: return "CAAD";
|
||||
case eUserEvaluatorData: return "User Evaluator Data";
|
||||
case eVideo: return "Video";
|
||||
case eWorld: return "World";
|
||||
@@ -98,8 +109,16 @@ TString GetResourceTypeName(EResType Type)
|
||||
}
|
||||
}
|
||||
|
||||
TString GetResourceRawExtension(EResType /*Type*/, EGame /*Game*/)
|
||||
TString GetResourceSerialName(EResType Type)
|
||||
{
|
||||
TString Name = GetResourceTypeName(Type);
|
||||
Name.RemoveWhitespace();
|
||||
return Name;
|
||||
}
|
||||
|
||||
TString GetResourceRawExtension(EResType Type, EGame /*Game*/)
|
||||
{
|
||||
if (Type == eWorld) return "mwld";
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <Common/CFourCC.h>
|
||||
#include <Common/types.h>
|
||||
#include <Common/TString.h>
|
||||
#include <Common/Serialization/IArchive.h>
|
||||
|
||||
// This macro creates functions that allow us to easily identify this resource type.
|
||||
// Must be included on every CResource subclass.
|
||||
@@ -40,7 +41,8 @@ public:
|
||||
}
|
||||
|
||||
virtual ~CResource() {}
|
||||
virtual CDependencyTree* BuildDependencyTree() const { return new CDependencyTree(ID()); }
|
||||
virtual CDependencyTree* BuildDependencyTree() const { return new CDependencyTree(ID()); }
|
||||
virtual void Serialize(IArchive& /*rArc*/) {}
|
||||
|
||||
inline CResourceEntry* Entry() const { return mpEntry; }
|
||||
inline TString Source() const { return mpEntry ? mpEntry->CookedAssetPath(true).GetFileName() : ""; }
|
||||
@@ -56,7 +58,9 @@ public:
|
||||
};
|
||||
|
||||
// Global Functions
|
||||
bool ResourceSupportsSerialization(EResType Type);
|
||||
TString GetResourceTypeName(EResType Type);
|
||||
TString GetResourceSerialName(EResType Type);
|
||||
TString GetResourceRawExtension(EResType Type, EGame Game);
|
||||
TString GetResourceCookedExtension(EResType Type, EGame Game);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ CDependencyTree* CWorld::BuildDependencyTree() const
|
||||
|
||||
for (u32 iArea = 0; iArea < mAreas.size(); iArea++)
|
||||
{
|
||||
pTree->AddDependency(mAreas[iArea].FileID);
|
||||
pTree->AddDependency(mAreas[iArea].AreaResID);
|
||||
pTree->AddDependency(mAreas[iArea].pAreaName);
|
||||
}
|
||||
|
||||
@@ -59,3 +59,69 @@ void CWorld::SetAreaLayerInfo(CGameArea *pArea)
|
||||
pLayer->SetActive(rLayerInfo.EnabledByDefault);
|
||||
}
|
||||
}
|
||||
|
||||
// ************ SERIALIZATION ************
|
||||
void CWorld::Serialize(IArchive& rArc)
|
||||
{
|
||||
rArc << SERIAL("WorldNameSTRG", mpWorldName)
|
||||
<< SERIAL("DarkWorldNameSTRG", mpDarkWorldName)
|
||||
<< SERIAL("WorldSaveInfo", mpSaveWorld)
|
||||
<< SERIAL("DefaultSkyCMDL", mpDefaultSkybox)
|
||||
<< SERIAL("MapWorld", mpMapWorld)
|
||||
<< SERIAL("Unknown1", mUnknown1)
|
||||
<< SERIAL("UnknownAreas", mUnknownAreas)
|
||||
<< SERIAL("UnknownAGSC", mUnknownAGSC)
|
||||
<< SERIAL_CONTAINER("MemoryRelays", mMemoryRelays, "MemoryRelay")
|
||||
<< SERIAL_CONTAINER("Areas", mAreas, "Area")
|
||||
<< SERIAL_CONTAINER("AudioGroups", mAudioGrps, "AudioGroup");
|
||||
}
|
||||
|
||||
void Serialize(IArchive& rArc, CWorld::SMemoryRelay& rMemRelay)
|
||||
{
|
||||
rArc << SERIAL_HEX("MemoryRelayID", rMemRelay.InstanceID)
|
||||
<< SERIAL_HEX("TargetID", rMemRelay.TargetID)
|
||||
<< SERIAL("Message", rMemRelay.Message)
|
||||
<< SERIAL("Unknown", rMemRelay.Unknown);
|
||||
}
|
||||
|
||||
void Serialize(IArchive& rArc, CWorld::SArea& rArea)
|
||||
{
|
||||
rArc << SERIAL("Name", rArea.InternalName)
|
||||
<< SERIAL("NameSTRG", rArea.pAreaName)
|
||||
<< SERIAL("Transform", rArea.Transform)
|
||||
<< SERIAL("BoundingBox", rArea.AetherBox)
|
||||
<< SERIAL("AreaMREA", rArea.AreaResID)
|
||||
<< SERIAL_HEX("AreaID", rArea.AreaID)
|
||||
<< SERIAL_CONTAINER("AttachedAreas", rArea.AttachedAreaIDs, "AreaIndex")
|
||||
<< SERIAL_CONTAINER("Dependencies", rArea.Dependencies, "Dependency")
|
||||
<< SERIAL_CONTAINER("RelModules", rArea.RelFilenames, "Module")
|
||||
<< SERIAL_CONTAINER("RelOffsets", rArea.RelOffsets, "Offset")
|
||||
<< SERIAL("CommonDependsStart", rArea.CommonDependenciesStart)
|
||||
<< SERIAL_CONTAINER("Docks", rArea.Docks, "Dock")
|
||||
<< SERIAL_CONTAINER("Layers", rArea.Layers, "Layer");
|
||||
}
|
||||
|
||||
void Serialize(IArchive& rArc, CWorld::SArea::SDock& rDock)
|
||||
{
|
||||
rArc << SERIAL_CONTAINER("ConnectingDocks", rDock.ConnectingDocks, "ConnectingDock")
|
||||
<< SERIAL_CONTAINER("DockCoords", rDock.DockCoordinates, "Coord");
|
||||
}
|
||||
|
||||
void Serialize(IArchive& rArc, CWorld::SArea::SDock::SConnectingDock& rDock)
|
||||
{
|
||||
rArc << SERIAL("AreaIndex", rDock.AreaIndex)
|
||||
<< SERIAL("DockIndex", rDock.DockIndex);
|
||||
}
|
||||
|
||||
void Serialize(IArchive& rArc, CWorld::SArea::SLayer& rLayer)
|
||||
{
|
||||
rArc << SERIAL("Name", rLayer.LayerName)
|
||||
<< SERIAL("DefaultEnabled", rLayer.EnabledByDefault)
|
||||
<< SERIAL("LayerDependsStart", rLayer.LayerDependenciesStart);
|
||||
}
|
||||
|
||||
void Serialize(IArchive& rArc, CWorld::SAudioGrp& rAudioGrp)
|
||||
{
|
||||
rArc << SERIAL("StudioID", rAudioGrp.Unknown)
|
||||
<< SERIAL("AGSC", rAudioGrp.ResID);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "CResource.h"
|
||||
#include "CStringTable.h"
|
||||
#include "SDependency.h"
|
||||
#include "Core/Resource/Area/CGameArea.h"
|
||||
#include "Core/Resource/Model/CModel.h"
|
||||
#include <Math/CTransform4f.h>
|
||||
@@ -27,7 +26,7 @@ class CWorld : public CResource
|
||||
u32 mUnknownAGSC;
|
||||
struct SAudioGrp
|
||||
{
|
||||
u32 ResID;
|
||||
CAssetID ResID;
|
||||
u32 Unknown;
|
||||
};
|
||||
std::vector<SAudioGrp> mAudioGrps;
|
||||
@@ -47,11 +46,11 @@ class CWorld : public CResource
|
||||
TResPtr<CStringTable> pAreaName;
|
||||
CTransform4f Transform;
|
||||
CAABox AetherBox;
|
||||
u64 FileID; // Loading every single area as a CResource would be a very bad idea
|
||||
CAssetID AreaResID; // Loading every single area as a CResource would be a very bad idea
|
||||
u64 AreaID;
|
||||
|
||||
std::vector<u16> AttachedAreaIDs;
|
||||
std::vector<SDependency> Dependencies;
|
||||
std::vector<CAssetID> Dependencies;
|
||||
std::vector<TString> RelFilenames;
|
||||
std::vector<u32> RelOffsets;
|
||||
u32 CommonDependenciesStart;
|
||||
@@ -64,7 +63,7 @@ class CWorld : public CResource
|
||||
u32 DockIndex;
|
||||
};
|
||||
std::vector<SConnectingDock> ConnectingDocks;
|
||||
CVector3f DockCoordinates[4];
|
||||
std::vector<CVector3f> DockCoordinates;
|
||||
};
|
||||
std::vector<SDock> Docks;
|
||||
|
||||
@@ -79,7 +78,6 @@ class CWorld : public CResource
|
||||
};
|
||||
std::vector<SArea> mAreas;
|
||||
|
||||
|
||||
public:
|
||||
CWorld(CResourceEntry *pEntry = 0);
|
||||
~CWorld();
|
||||
@@ -87,6 +85,15 @@ public:
|
||||
CDependencyTree* BuildDependencyTree() const;
|
||||
void SetAreaLayerInfo(CGameArea *pArea);
|
||||
|
||||
// Serialization
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
friend void Serialize(IArchive& rArc, SMemoryRelay& rMemRelay);
|
||||
friend void Serialize(IArchive& rArc, SArea& rArea);
|
||||
friend void Serialize(IArchive& rArc, SArea::SDock& rDock);
|
||||
friend void Serialize(IArchive& rArc, SArea::SDock::SConnectingDock& rDock);
|
||||
friend void Serialize(IArchive& rArc, SArea::SLayer& rLayer);
|
||||
friend void Serialize(IArchive& rArc, SAudioGrp& rAudioGrp);
|
||||
|
||||
// Accessors
|
||||
inline EGame Version() const { return mWorldVersion; }
|
||||
inline CStringTable* WorldName() const { return mpWorldName; }
|
||||
@@ -96,7 +103,7 @@ public:
|
||||
inline CResource* MapWorld() const { return mpMapWorld; }
|
||||
|
||||
inline u32 NumAreas() const { return mAreas.size(); }
|
||||
inline u64 AreaResourceID(u32 AreaIndex) const { return mAreas[AreaIndex].FileID; }
|
||||
inline u64 AreaResourceID(u32 AreaIndex) const { return mAreas[AreaIndex].AreaResID.ToLongLong(); }
|
||||
inline u32 AreaAttachedCount(u32 AreaIndex) const { return mAreas[AreaIndex].AttachedAreaIDs.size(); }
|
||||
inline u32 AreaAttachedID(u32 AreaIndex, u32 AttachedIndex) const { return mAreas[AreaIndex].AttachedAreaIDs[AttachedIndex]; }
|
||||
inline TString AreaInternalName(u32 AreaIndex) const { return mAreas[AreaIndex].InternalName; }
|
||||
|
||||
103
src/Core/Resource/Factory/CResourceFactory.h
Normal file
103
src/Core/Resource/Factory/CResourceFactory.h
Normal file
@@ -0,0 +1,103 @@
|
||||
#ifndef CRESOURCEFACTORY
|
||||
#define CRESOURCEFACTORY
|
||||
|
||||
#include "CAnimationLoader.h"
|
||||
#include "CAnimSetLoader.h"
|
||||
#include "CAreaLoader.h"
|
||||
#include "CCollisionLoader.h"
|
||||
#include "CDependencyGroupLoader.h"
|
||||
#include "CFontLoader.h"
|
||||
#include "CMaterialLoader.h"
|
||||
#include "CModelLoader.h"
|
||||
#include "CPoiToWorldLoader.h"
|
||||
#include "CScanLoader.h"
|
||||
#include "CScriptLoader.h"
|
||||
#include "CSkeletonLoader.h"
|
||||
#include "CSkinLoader.h"
|
||||
#include "CStringLoader.h"
|
||||
#include "CTextureDecoder.h"
|
||||
#include "CUnsupportedFormatLoader.h"
|
||||
#include "CUnsupportedParticleLoader.h"
|
||||
#include "CWorldLoader.h"
|
||||
|
||||
#include "Core/Resource/Resources.h"
|
||||
|
||||
// Static helper class to allow spawning resources based on an EResType
|
||||
class CResourceFactory
|
||||
{
|
||||
CResourceFactory() {}
|
||||
|
||||
public:
|
||||
static CResource* SpawnResource(CResourceEntry *pEntry)
|
||||
{
|
||||
switch (pEntry->ResourceType())
|
||||
{
|
||||
case eAnimation: return new CAnimation(pEntry);
|
||||
case eAnimSet: return new CAnimSet(pEntry);
|
||||
case eArea: return new CGameArea(pEntry);
|
||||
case eDynamicCollision: return new CCollisionMeshGroup(pEntry);
|
||||
case eDependencyGroup: return new CDependencyGroup(pEntry);
|
||||
case eFont: return new CFont(pEntry);
|
||||
case eModel: return new CModel(pEntry);
|
||||
case eScan: return new CScan(pEntry);
|
||||
case eSkeleton: return new CSkeleton(pEntry);
|
||||
case eSkin: return new CSkin(pEntry);
|
||||
case eStaticGeometryMap: return new CPoiToWorld(pEntry);
|
||||
case eStringTable: return new CStringTable(pEntry);
|
||||
case eTexture: return new CTexture(pEntry);
|
||||
case eWorld: return new CWorld(pEntry);
|
||||
default: return nullptr; // should it return a CResource instead?
|
||||
}
|
||||
}
|
||||
|
||||
static CResource* LoadCookedResource(CResourceEntry *pEntry, IInputStream& rInput)
|
||||
{
|
||||
// Warning: It is the caller's responsibility to check if the required resource is already in memory before calling this function.
|
||||
if (!rInput.IsValid()) return nullptr;
|
||||
|
||||
CResource *pRes = nullptr;
|
||||
|
||||
switch (pEntry->ResourceType())
|
||||
{
|
||||
case eAnimation: pRes = CAnimationLoader::LoadANIM(rInput, pEntry); break;
|
||||
case eAnimEventData: pRes = CUnsupportedFormatLoader::LoadEVNT(rInput, pEntry); break;
|
||||
case eAnimSet: pRes = CAnimSetLoader::LoadANCSOrCHAR(rInput, pEntry); break;
|
||||
case eArea: pRes = CAreaLoader::LoadMREA(rInput, pEntry); break;
|
||||
case eDependencyGroup: pRes = CDependencyGroupLoader::LoadDGRP(rInput, pEntry); break;
|
||||
case eDynamicCollision: pRes = CCollisionLoader::LoadDCLN(rInput, pEntry); break;
|
||||
case eFont: pRes = CFontLoader::LoadFONT(rInput, pEntry); break;
|
||||
case eGuiFrame: pRes = CUnsupportedFormatLoader::LoadFRME(rInput, pEntry); break;
|
||||
case eHintSystem: pRes = CUnsupportedFormatLoader::LoadHINT(rInput, pEntry); break;
|
||||
case eMapWorld: pRes = CUnsupportedFormatLoader::LoadMAPW(rInput, pEntry); break;
|
||||
case eMapUniverse: pRes = CUnsupportedFormatLoader::LoadMAPU(rInput, pEntry); break;
|
||||
case eMidi: pRes = CUnsupportedFormatLoader::LoadCSNG(rInput, pEntry); break;
|
||||
case eModel: pRes = CModelLoader::LoadCMDL(rInput, pEntry); break;
|
||||
case eRuleSet: pRes = CUnsupportedFormatLoader::LoadRULE(rInput, pEntry); break;
|
||||
case eScan: pRes = CScanLoader::LoadSCAN(rInput, pEntry); break;
|
||||
case eSkeleton: pRes = CSkeletonLoader::LoadCINF(rInput, pEntry); break;
|
||||
case eSkin: pRes = CSkinLoader::LoadCSKR(rInput, pEntry); break;
|
||||
case eStaticGeometryMap: pRes = CPoiToWorldLoader::LoadEGMC(rInput, pEntry); break;
|
||||
case eStringTable: pRes = CStringLoader::LoadSTRG(rInput, pEntry); break;
|
||||
case eTexture: pRes = CTextureDecoder::LoadTXTR(rInput, pEntry); break;
|
||||
case eWorld: pRes = CWorldLoader::LoadMLVL(rInput, pEntry); break;
|
||||
|
||||
case eParticle:
|
||||
case eParticleElectric:
|
||||
case eParticleSwoosh:
|
||||
case eParticleDecal:
|
||||
case eParticleWeapon:
|
||||
case eParticleCollisionResponse:
|
||||
pRes = CUnsupportedParticleLoader::LoadParticle(rInput, pEntry);
|
||||
break;
|
||||
|
||||
default:
|
||||
pRes = new CResource(pEntry);
|
||||
break;
|
||||
}
|
||||
|
||||
return pRes;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CRESOURCEFACTORY
|
||||
|
||||
@@ -67,13 +67,13 @@ void CWorldLoader::LoadPrimeMLVL(IInputStream& rMLVL)
|
||||
|
||||
if (mVersion < eCorruptionProto)
|
||||
{
|
||||
pArea->FileID = rMLVL.ReadLong() & 0xFFFFFFFF; // This is the MREA ID; not actually loading it for obvious reasons
|
||||
pArea->AreaResID = rMLVL.ReadLong() & 0xFFFFFFFF;
|
||||
pArea->AreaID = rMLVL.ReadLong() & 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
pArea->FileID = rMLVL.ReadLongLong();
|
||||
pArea->AreaResID = rMLVL.ReadLongLong();
|
||||
pArea->AreaID = rMLVL.ReadLongLong();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void CWorldLoader::LoadPrimeMLVL(IInputStream& rMLVL)
|
||||
if (mVersion < eCorruptionProto)
|
||||
rMLVL.Seek(0x4, SEEK_CUR); // Skipping unknown value (always 0)
|
||||
|
||||
// Depedencies
|
||||
// Dependencies
|
||||
if (mVersion < eCorruptionProto)
|
||||
{
|
||||
u32 NumDependencies = rMLVL.ReadLong();
|
||||
@@ -94,10 +94,8 @@ void CWorldLoader::LoadPrimeMLVL(IInputStream& rMLVL)
|
||||
|
||||
for (u32 iDep = 0; iDep < NumDependencies; iDep++)
|
||||
{
|
||||
SDependency Dependency;
|
||||
Dependency.ResID = rMLVL.ReadLong() & 0xFFFFFFFF;
|
||||
Dependency.ResType = rMLVL.ReadLong();
|
||||
pArea->Dependencies.push_back(Dependency);
|
||||
pArea->Dependencies.push_back( CAssetID(rMLVL, e32Bit) );
|
||||
rMLVL.Seek(0x4, SEEK_CUR);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +135,8 @@ void CWorldLoader::LoadPrimeMLVL(IInputStream& rMLVL)
|
||||
}
|
||||
|
||||
u32 NumCoordinates = rMLVL.ReadLong();
|
||||
if (NumCoordinates != 4) Log::Error("Dock coordinate count not 4");
|
||||
ASSERT(NumCoordinates == 4);
|
||||
pDock->DockCoordinates.resize(NumCoordinates);
|
||||
|
||||
for (u32 iCoord = 0; iCoord < NumCoordinates; iCoord++)
|
||||
pDock->DockCoordinates[iCoord] = CVector3f(rMLVL);
|
||||
@@ -245,7 +244,7 @@ void CWorldLoader::LoadReturnsMLVL(IInputStream& rMLVL)
|
||||
pArea->pAreaName = gpResourceStore->LoadResource(rMLVL.ReadLongLong(), "STRG");
|
||||
pArea->Transform = CTransform4f(rMLVL);
|
||||
pArea->AetherBox = CAABox(rMLVL);
|
||||
pArea->FileID = rMLVL.ReadLongLong();
|
||||
pArea->AreaResID = rMLVL.ReadLongLong();
|
||||
pArea->AreaID = rMLVL.ReadLongLong();
|
||||
|
||||
rMLVL.Seek(0x4, SEEK_CUR);
|
||||
|
||||
21
src/Core/Resource/Resources.h
Normal file
21
src/Core/Resource/Resources.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef RESOURCES_H
|
||||
#define RESOURCES_H
|
||||
|
||||
#include "CAnimation.h"
|
||||
#include "CAnimSet.h"
|
||||
#include "CCollisionMeshGroup.h"
|
||||
#include "CDependencyGroup.h"
|
||||
#include "CFont.h"
|
||||
#include "CPoiToWorld.h"
|
||||
#include "CResource.h"
|
||||
#include "CScan.h"
|
||||
#include "CSkeleton.h"
|
||||
#include "CSkin.h"
|
||||
#include "CStringTable.h"
|
||||
#include "CTexture.h"
|
||||
#include "CWorld.h"
|
||||
#include "Core/Resource/Area/CGameArea.h"
|
||||
#include "Core/Resource/Model/CModel.h"
|
||||
|
||||
#endif // RESOURCES_H
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#ifndef SDEPENDENCY
|
||||
#define SDEPENDENCY
|
||||
|
||||
#include <Common/CFourCC.h>
|
||||
#include <Common/types.h>
|
||||
|
||||
struct SDependency
|
||||
{
|
||||
u64 ResID;
|
||||
CFourCC ResType;
|
||||
};
|
||||
|
||||
#endif // SDEPENDENCY
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define TRESPTR_H
|
||||
|
||||
#include "CResource.h"
|
||||
#include "Core/GameProject/CGameProject.h"
|
||||
|
||||
template <typename ResType>
|
||||
class TResPtr
|
||||
@@ -30,6 +31,21 @@ public:
|
||||
mpRes->Release();
|
||||
}
|
||||
|
||||
inline void Serialize(IArchive& rArc)
|
||||
{
|
||||
bool IsReader = rArc.IsReader();
|
||||
EGame ActiveGame = gpResourceStore->ActiveProject()->Game();
|
||||
|
||||
CAssetID ID = (mpRes && !IsReader ? mpRes->ID() : (ActiveGame <= eEchoes ? CAssetID::skInvalidID32 : CAssetID::skInvalidID64));
|
||||
rArc.SerializePrimitive(ID);
|
||||
|
||||
if (IsReader)
|
||||
{
|
||||
CResourceEntry *pEntry = gpResourceStore->FindEntry(ID);
|
||||
*this = (pEntry ? pEntry->Load() : nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
inline void Delete()
|
||||
{
|
||||
// use with caution! this function exists because not all resources are cached currently
|
||||
|
||||
Reference in New Issue
Block a user