Moved EGame to Common
This commit is contained in:
parent
de18044ae0
commit
74574c318e
|
@ -80,7 +80,8 @@ HEADERS += \
|
||||||
CAssetID.h \
|
CAssetID.h \
|
||||||
Serialization/IArchive.h \
|
Serialization/IArchive.h \
|
||||||
Serialization/CXMLWriter.h \
|
Serialization/CXMLWriter.h \
|
||||||
Serialization/CXMLReader.h
|
Serialization/CXMLReader.h \
|
||||||
|
EGame.h
|
||||||
|
|
||||||
# Source Files
|
# Source Files
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef EGAME_H
|
#ifndef EGAME_H
|
||||||
#define EGAME_H
|
#define EGAME_H
|
||||||
|
|
||||||
// Global version enum that can be easily shared between loaders
|
|
||||||
enum EGame
|
enum EGame
|
||||||
{
|
{
|
||||||
ePrimeDemo,
|
ePrimeDemo,
|
||||||
|
@ -11,7 +10,7 @@ enum EGame
|
||||||
eCorruptionProto,
|
eCorruptionProto,
|
||||||
eCorruption,
|
eCorruption,
|
||||||
eReturns,
|
eReturns,
|
||||||
eUnknownVersion = -1
|
eUnknownGame = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // EGAME_H
|
#endif // EGAME_H
|
|
@ -80,7 +80,7 @@ void CGameExporter::CopyDiscData()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Hack to determine game
|
// Hack to determine game
|
||||||
if (Game() == eUnknownVersion)
|
if (Game() == eUnknownGame)
|
||||||
{
|
{
|
||||||
TWideString Name = FullPath.GetFileName(false);
|
TWideString Name = FullPath.GetFileName(false);
|
||||||
if (Name == L"MetroidCWP") SetGame(ePrimeDemo);
|
if (Name == L"MetroidCWP") SetGame(ePrimeDemo);
|
||||||
|
@ -107,7 +107,7 @@ void CGameExporter::CopyDiscData()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(Game() != eUnknownVersion);
|
ASSERT(Game() != eUnknownGame);
|
||||||
mpProject->SetGame(Game());
|
mpProject->SetGame(Game());
|
||||||
mpProject->SetProjectName(CMasterTemplate::FindGameName(Game()));
|
mpProject->SetProjectName(CMasterTemplate::FindGameName(Game()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
#include "CPackage.h"
|
#include "CPackage.h"
|
||||||
#include "CResourceStore.h"
|
#include "CResourceStore.h"
|
||||||
#include "Core/Resource/EGame.h"
|
|
||||||
#include <Common/FileUtil.h>
|
|
||||||
#include <Common/CAssetID.h>
|
#include <Common/CAssetID.h>
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
#include <Common/FileUtil.h>
|
||||||
#include <Common/TString.h>
|
#include <Common/TString.h>
|
||||||
#include <Common/types.h>
|
#include <Common/types.h>
|
||||||
|
|
||||||
|
@ -29,12 +29,12 @@ class CGameProject
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGameProject()
|
CGameProject()
|
||||||
: mGame(eUnknownVersion)
|
: mGame(eUnknownGame)
|
||||||
, mProjectName("Unnamed Project")
|
, mProjectName("Unnamed Project")
|
||||||
{}
|
{}
|
||||||
|
|
||||||
CGameProject(const TWideString& rkProjRootDir)
|
CGameProject(const TWideString& rkProjRootDir)
|
||||||
: mGame(eUnknownVersion)
|
: mGame(eUnknownGame)
|
||||||
, mProjectName("Unnamed Project")
|
, mProjectName("Unnamed Project")
|
||||||
, mProjectRoot(rkProjRootDir)
|
, mProjectRoot(rkProjRootDir)
|
||||||
, mResourceDBPath(L"ResourceDB.rdb")
|
, mResourceDBPath(L"ResourceDB.rdb")
|
||||||
|
|
|
@ -25,7 +25,7 @@ CResourceEntry::CResourceEntry(CResourceStore *pStore, const CAssetID& rkID,
|
||||||
|
|
||||||
mpDirectory = mpStore->GetVirtualDirectory(rkDir, Transient, true);
|
mpDirectory = mpStore->GetVirtualDirectory(rkDir, Transient, true);
|
||||||
if (mpDirectory) mpDirectory->AddChild(L"", this);
|
if (mpDirectory) mpDirectory->AddChild(L"", this);
|
||||||
mGame = ((Transient || !mpStore->ActiveProject()) ? eUnknownVersion : mpStore->ActiveProject()->Game());
|
mGame = ((Transient || !mpStore->ActiveProject()) ? eUnknownGame : mpStore->ActiveProject()->Game());
|
||||||
}
|
}
|
||||||
|
|
||||||
CResourceEntry::~CResourceEntry()
|
CResourceEntry::~CResourceEntry()
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
#include "CAnimSet.h"
|
#include "CAnimSet.h"
|
||||||
#include "CResourceInfo.h"
|
#include "CResourceInfo.h"
|
||||||
#include "EGame.h"
|
|
||||||
#include "TResPtr.h"
|
#include "TResPtr.h"
|
||||||
#include "Core/Resource/Model/CModel.h"
|
#include "Core/Resource/Model/CModel.h"
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CAnimationParameters
|
class CAnimationParameters
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ CMaterial::CMaterial()
|
||||||
, mShaderStatus(eNoShader)
|
, mShaderStatus(eNoShader)
|
||||||
, mRecalcHash(true)
|
, mRecalcHash(true)
|
||||||
, mEnableBloom(false)
|
, mEnableBloom(false)
|
||||||
, mVersion(eUnknownVersion)
|
, mVersion(eUnknownGame)
|
||||||
, mOptions(eNoSettings)
|
, mOptions(eNoSettings)
|
||||||
, mVtxDesc(eNoAttributes)
|
, mVtxDesc(eNoAttributes)
|
||||||
, mBlendSrcFac(GL_ONE)
|
, mBlendSrcFac(GL_ONE)
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
|
|
||||||
#include "CMaterialPass.h"
|
#include "CMaterialPass.h"
|
||||||
#include "CTexture.h"
|
#include "CTexture.h"
|
||||||
#include "EGame.h"
|
|
||||||
#include "TResPtr.h"
|
#include "TResPtr.h"
|
||||||
#include "Core/Resource/Model/EVertexAttribute.h"
|
#include "Core/Resource/Model/EVertexAttribute.h"
|
||||||
#include "Core/Render/FRenderOptions.h"
|
#include "Core/Render/FRenderOptions.h"
|
||||||
#include "Core/OpenGL/CShader.h"
|
#include "Core/OpenGL/CShader.h"
|
||||||
|
|
||||||
#include <Common/CColor.h>
|
#include <Common/CColor.h>
|
||||||
|
#include <Common/EGame.h>
|
||||||
#include <Common/Flags.h>
|
#include <Common/Flags.h>
|
||||||
#include <Common/types.h>
|
#include <Common/types.h>
|
||||||
#include <FileIO/IInputStream.h>
|
#include <FileIO/IInputStream.h>
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include "CMaterial.h"
|
#include "CMaterial.h"
|
||||||
#include "CTexture.h"
|
#include "CTexture.h"
|
||||||
#include "EGame.h"
|
|
||||||
#include <FileIO/IInputStream.h>
|
#include <FileIO/IInputStream.h>
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CMaterialSet
|
class CMaterialSet
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,7 +124,7 @@ TString GetResourceRawExtension(EResType Type, EGame /*Game*/)
|
||||||
|
|
||||||
TString GetResourceCookedExtension(EResType Type, EGame Game)
|
TString GetResourceCookedExtension(EResType Type, EGame Game)
|
||||||
{
|
{
|
||||||
if (Game == eUnknownVersion)
|
if (Game == eUnknownGame)
|
||||||
Game = ePrime;
|
Game = ePrime;
|
||||||
|
|
||||||
u32 GameTypeID = GetGameTypeID(Game, Type);
|
u32 GameTypeID = GetGameTypeID(Game, Type);
|
||||||
|
@ -151,7 +151,7 @@ TString GetResourceCookedExtension(EResType Type, EGame Game)
|
||||||
public: \
|
public: \
|
||||||
CResourceTypeRegistrant__##CookedExtension() \
|
CResourceTypeRegistrant__##CookedExtension() \
|
||||||
{ \
|
{ \
|
||||||
ASSERT(FirstGame != eUnknownVersion); \
|
ASSERT(FirstGame != eUnknownGame); \
|
||||||
\
|
\
|
||||||
/* Register extension with resource type (should be consistent across all games) */ \
|
/* Register extension with resource type (should be consistent across all games) */ \
|
||||||
u32 IntExt = CFourCC(#CookedExtension).ToLong(); \
|
u32 IntExt = CFourCC(#CookedExtension).ToLong(); \
|
||||||
|
|
|
@ -48,7 +48,7 @@ public:
|
||||||
inline TString Source() const { return mpEntry ? mpEntry->CookedAssetPath(true).GetFileName() : ""; }
|
inline TString Source() const { return mpEntry ? mpEntry->CookedAssetPath(true).GetFileName() : ""; }
|
||||||
inline TString FullSource() const { return mpEntry ? mpEntry->CookedAssetPath(true) : ""; }
|
inline TString FullSource() const { return mpEntry ? mpEntry->CookedAssetPath(true) : ""; }
|
||||||
inline CAssetID ID() const { return mpEntry ? mpEntry->ID() : CAssetID::skInvalidID64; }
|
inline CAssetID ID() const { return mpEntry ? mpEntry->ID() : CAssetID::skInvalidID64; }
|
||||||
inline EGame Game() const { return mpEntry ? mpEntry->Game() : eUnknownVersion; }
|
inline EGame Game() const { return mpEntry ? mpEntry->Game() : eUnknownGame; }
|
||||||
inline bool IsReferenced() const { return mRefCount > 0; }
|
inline bool IsReferenced() const { return mRefCount > 0; }
|
||||||
inline void SetGame(EGame Game) { if (mpEntry) mpEntry->SetGame(Game); }
|
inline void SetGame(EGame Game) { if (mpEntry) mpEntry->SetGame(Game); }
|
||||||
inline void Lock() { mRefCount++; }
|
inline void Lock() { mRefCount++; }
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include "CResource.h"
|
#include "CResource.h"
|
||||||
#include "CStringTable.h"
|
#include "CStringTable.h"
|
||||||
#include "EGame.h"
|
|
||||||
#include "TResPtr.h"
|
#include "TResPtr.h"
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CScan : public CResource
|
class CScan : public CResource
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
CWorld::CWorld(CResourceEntry *pEntry /*= 0*/)
|
CWorld::CWorld(CResourceEntry *pEntry /*= 0*/)
|
||||||
: CResource(pEntry)
|
: CResource(pEntry)
|
||||||
, mWorldVersion(eUnknownVersion)
|
, mWorldVersion(eUnknownGame)
|
||||||
, mpWorldName(nullptr)
|
, mpWorldName(nullptr)
|
||||||
, mpDarkWorldName(nullptr)
|
, mpDarkWorldName(nullptr)
|
||||||
, mpSaveWorld(nullptr)
|
, mpSaveWorld(nullptr)
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include "CSectionMgrOut.h"
|
#include "CSectionMgrOut.h"
|
||||||
#include "Core/Resource/Area/CGameArea.h"
|
#include "Core/Resource/Area/CGameArea.h"
|
||||||
#include "Core/Resource/EGame.h"
|
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CAreaCooker
|
class CAreaCooker
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "Core/Resource/CMaterial.h"
|
#include "Core/Resource/CMaterial.h"
|
||||||
#include "Core/Resource/CMaterialSet.h"
|
#include "Core/Resource/CMaterialSet.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CMaterialCooker
|
class CMaterialCooker
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#define CMODELCOOKER_H
|
#define CMODELCOOKER_H
|
||||||
|
|
||||||
#include "Core/Resource/Model/CModel.h"
|
#include "Core/Resource/Model/CModel.h"
|
||||||
#include "Core/Resource/EGame.h"
|
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CModelCooker
|
class CModelCooker
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#ifndef CSCRIPTCOOKER_H
|
#ifndef CSCRIPTCOOKER_H
|
||||||
#define CSCRIPTCOOKER_H
|
#define CSCRIPTCOOKER_H
|
||||||
|
|
||||||
#include "Core/Resource/EGame.h"
|
|
||||||
#include "Core/Resource/Script/CScriptLayer.h"
|
#include "Core/Resource/Script/CScriptLayer.h"
|
||||||
#include "Core/Resource/Script/CScriptObject.h"
|
#include "Core/Resource/Script/CScriptObject.h"
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CScriptCooker
|
class CScriptCooker
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define CWORLDCOOKER_H
|
#define CWORLDCOOKER_H
|
||||||
|
|
||||||
#include "Core/Resource/CWorld.h"
|
#include "Core/Resource/CWorld.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
#include <Common/types.h>
|
#include <Common/types.h>
|
||||||
|
|
||||||
class CWorldCooker
|
class CWorldCooker
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef ERESTYPE
|
#ifndef ERESTYPE
|
||||||
#define ERESTYPE
|
#define ERESTYPE
|
||||||
|
|
||||||
#include "EGame.h"
|
#include <Common/EGame.h>
|
||||||
#include <Common/TString.h>
|
#include <Common/TString.h>
|
||||||
|
|
||||||
enum EResType
|
enum EResType
|
||||||
|
|
|
@ -232,7 +232,7 @@ CAnimSet* CAnimSetLoader::LoadANCS(IInputStream& rANCS, CResourceEntry *pEntry)
|
||||||
|
|
||||||
rANCS.Seek(0x4, SEEK_CUR); // Skipping node self-index
|
rANCS.Seek(0x4, SEEK_CUR); // Skipping node self-index
|
||||||
u16 Unknown1 = rANCS.ReadShort();
|
u16 Unknown1 = rANCS.ReadShort();
|
||||||
if (iNode == 0 && Loader.mVersion == eUnknownVersion)
|
if (iNode == 0 && Loader.mVersion == eUnknownGame)
|
||||||
{
|
{
|
||||||
Loader.mVersion = (Unknown1 == 0xA) ? eEchoes : ePrime; // Best version indicator we know of unfortunately
|
Loader.mVersion = (Unknown1 == 0xA) ? eEchoes : ePrime; // Best version indicator we know of unfortunately
|
||||||
Loader.pSet->SetGame(Loader.mVersion);
|
Loader.pSet->SetGame(Loader.mVersion);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define CCHARACTERLOADER_H
|
#define CCHARACTERLOADER_H
|
||||||
|
|
||||||
#include "Core/Resource/CAnimSet.h"
|
#include "Core/Resource/CAnimSet.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CAnimSetLoader
|
class CAnimSetLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,7 +75,7 @@ void CAnimationLoader::ReadUncompressedANIM()
|
||||||
NumBoneChannels++;
|
NumBoneChannels++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mGame == eUnknownVersion)
|
if (mGame == eUnknownGame)
|
||||||
{
|
{
|
||||||
mGame = UncompressedCheckVersion();
|
mGame = UncompressedCheckVersion();
|
||||||
mpAnim->SetGame(mGame);
|
mpAnim->SetGame(mGame);
|
||||||
|
@ -211,7 +211,7 @@ void CAnimationLoader::ReadCompressedANIM()
|
||||||
// Header
|
// Header
|
||||||
mpInput->Seek(0x4, SEEK_CUR); // Skip alloc size
|
mpInput->Seek(0x4, SEEK_CUR); // Skip alloc size
|
||||||
|
|
||||||
if (mGame == eUnknownVersion)
|
if (mGame == eUnknownGame)
|
||||||
{
|
{
|
||||||
mGame = (mpInput->PeekShort() == 0x0101 ? eEchoes : ePrime);
|
mGame = (mpInput->PeekShort() == 0x0101 ? eEchoes : ePrime);
|
||||||
mpAnim->SetGame(mGame);
|
mpAnim->SetGame(mGame);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "Core/Resource/TResPtr.h"
|
#include "Core/Resource/TResPtr.h"
|
||||||
#include "Core/Resource/CAnimation.h"
|
#include "Core/Resource/CAnimation.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CAnimationLoader
|
class CAnimationLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -749,6 +749,6 @@ EGame CAreaLoader::GetFormatVersion(u32 Version)
|
||||||
case 0x1D: return eCorruptionProto;
|
case 0x1D: return eCorruptionProto;
|
||||||
case 0x1E: return eCorruption;
|
case 0x1E: return eCorruption;
|
||||||
case 0x20: return eReturns;
|
case 0x20: return eReturns;
|
||||||
default: return eUnknownVersion;
|
default: return eUnknownGame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "Core/GameProject/CResourceStore.h"
|
#include "Core/GameProject/CResourceStore.h"
|
||||||
#include "Core/Resource/Area/CGameArea.h"
|
#include "Core/Resource/Area/CGameArea.h"
|
||||||
#include "Core/Resource/Script/CLink.h"
|
#include "Core/Resource/Script/CLink.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
|
|
||||||
|
|
|
@ -207,6 +207,6 @@ EGame CCollisionLoader::GetFormatVersion(u32 Version)
|
||||||
case 0x3: return ePrime;
|
case 0x3: return ePrime;
|
||||||
case 0x4: return eEchoes;
|
case 0x4: return eEchoes;
|
||||||
case 0x5: return eReturns;
|
case 0x5: return eReturns;
|
||||||
default: return eUnknownVersion;
|
default: return eUnknownGame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "Core/Resource/CCollisionMesh.h"
|
#include "Core/Resource/CCollisionMesh.h"
|
||||||
#include "Core/Resource/CCollisionMeshGroup.h"
|
#include "Core/Resource/CCollisionMeshGroup.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CCollisionLoader
|
class CCollisionLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define CDEPENDENCYGROUPLOADER_H
|
#define CDEPENDENCYGROUPLOADER_H
|
||||||
|
|
||||||
#include "Core/Resource/CDependencyGroup.h"
|
#include "Core/Resource/CDependencyGroup.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CDependencyGroupLoader
|
class CDependencyGroupLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,7 +92,7 @@ CFont* CFontLoader::LoadFONT(IInputStream& rFONT, CResourceEntry *pEntry)
|
||||||
|
|
||||||
u32 FileVersion = rFONT.ReadLong();
|
u32 FileVersion = rFONT.ReadLong();
|
||||||
EGame Version = GetFormatVersion(FileVersion);
|
EGame Version = GetFormatVersion(FileVersion);
|
||||||
if (Version == eUnknownVersion)
|
if (Version == eUnknownGame)
|
||||||
{
|
{
|
||||||
Log::FileError(rFONT.GetSourceString(), "Unsupported FONT version: " + TString::HexString(FileVersion, 0));
|
Log::FileError(rFONT.GetSourceString(), "Unsupported FONT version: " + TString::HexString(FileVersion, 0));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -113,6 +113,6 @@ EGame CFontLoader::GetFormatVersion(u32 Version)
|
||||||
case 2: return ePrime;
|
case 2: return ePrime;
|
||||||
case 4: return eEchoes;
|
case 4: return eEchoes;
|
||||||
case 5: return eCorruption;
|
case 5: return eCorruption;
|
||||||
default: return eUnknownVersion;
|
default: return eUnknownGame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "Core/GameProject/CResourceStore.h"
|
#include "Core/GameProject/CResourceStore.h"
|
||||||
#include "Core/Resource/CFont.h"
|
#include "Core/Resource/CFont.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CFontLoader
|
class CFontLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "Core/GameProject/CResourceStore.h"
|
#include "Core/GameProject/CResourceStore.h"
|
||||||
#include "Core/Resource/CMaterialSet.h"
|
#include "Core/Resource/CMaterialSet.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
|
|
|
@ -446,7 +446,7 @@ CModel* CModelLoader::LoadCMDL(IInputStream& rCMDL, CResourceEntry *pEntry)
|
||||||
// The rest is common to all CMDL versions
|
// The rest is common to all CMDL versions
|
||||||
Loader.mVersion = GetFormatVersion(Version);
|
Loader.mVersion = GetFormatVersion(Version);
|
||||||
|
|
||||||
if (Loader.mVersion == eUnknownVersion)
|
if (Loader.mVersion == eUnknownGame)
|
||||||
{
|
{
|
||||||
Log::FileError(rCMDL.GetSourceString(), "Unsupported CMDL version: " + TString::HexString(Magic, 0));
|
Log::FileError(rCMDL.GetSourceString(), "Unsupported CMDL version: " + TString::HexString(Magic, 0));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -644,6 +644,6 @@ EGame CModelLoader::GetFormatVersion(u32 Version)
|
||||||
case 0x4: return eEchoes;
|
case 0x4: return eEchoes;
|
||||||
case 0x5: return eCorruption;
|
case 0x5: return eCorruption;
|
||||||
case 0xA: return eReturns;
|
case 0xA: return eReturns;
|
||||||
default: return eUnknownVersion;
|
default: return eUnknownGame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "Core/GameProject/CResourceStore.h"
|
#include "Core/GameProject/CResourceStore.h"
|
||||||
#include "Core/Resource/Model/CBasicModel.h"
|
#include "Core/Resource/Model/CBasicModel.h"
|
||||||
#include "Core/Resource/Model/CModel.h"
|
#include "Core/Resource/Model/CModel.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
#include <Common/Flags.h>
|
#include <Common/Flags.h>
|
||||||
|
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define CSCANLOADER_H
|
#define CSCANLOADER_H
|
||||||
|
|
||||||
#include "Core/Resource/CScan.h"
|
#include "Core/Resource/CScan.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CScanLoader
|
class CScanLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,7 @@ CSkeleton* CSkeletonLoader::LoadCINF(IInputStream& rCINF, CResourceEntry *pEntry
|
||||||
// rotation value in MP2. The max bone count is 100 so the linked bone count will not be higher
|
// rotation value in MP2. The max bone count is 100 so the linked bone count will not be higher
|
||||||
// than that. Additionally, every bone links to its parent at least and every skeleton (as far as I
|
// than that. Additionally, every bone links to its parent at least and every skeleton (as far as I
|
||||||
// know) has at least two bones so the linked bone count will never be 0.
|
// know) has at least two bones so the linked bone count will never be 0.
|
||||||
if (Game == eUnknownVersion)
|
if (Game == eUnknownGame)
|
||||||
{
|
{
|
||||||
u32 Check = rCINF.PeekLong();
|
u32 Check = rCINF.PeekLong();
|
||||||
Game = ((Check > 100 || Check == 0) ? eEchoes : ePrime);
|
Game = ((Check > 100 || Check == 0) ? eEchoes : ePrime);
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#define CSKELETONLOADER_H
|
#define CSKELETONLOADER_H
|
||||||
|
|
||||||
#include "Core/Resource/CSkeleton.h"
|
#include "Core/Resource/CSkeleton.h"
|
||||||
#include "Core/Resource/EGame.h"
|
|
||||||
#include "Core/Resource/TResPtr.h"
|
#include "Core/Resource/TResPtr.h"
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CSkeletonLoader
|
class CSkeletonLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -160,7 +160,7 @@ CStringTable* CStringLoader::LoadSTRG(IInputStream& rSTRG, CResourceEntry *pEntr
|
||||||
if (!rSTRG.IsValid()) return nullptr;
|
if (!rSTRG.IsValid()) return nullptr;
|
||||||
|
|
||||||
u32 Magic = rSTRG.ReadLong();
|
u32 Magic = rSTRG.ReadLong();
|
||||||
EGame Version = eUnknownVersion;
|
EGame Version = eUnknownGame;
|
||||||
|
|
||||||
if (Magic != 0x87654321)
|
if (Magic != 0x87654321)
|
||||||
{
|
{
|
||||||
|
@ -185,7 +185,7 @@ CStringTable* CStringLoader::LoadSTRG(IInputStream& rSTRG, CResourceEntry *pEntr
|
||||||
u32 FileVersion = rSTRG.ReadLong();
|
u32 FileVersion = rSTRG.ReadLong();
|
||||||
Version = GetFormatVersion(FileVersion);
|
Version = GetFormatVersion(FileVersion);
|
||||||
|
|
||||||
if (FileVersion == eUnknownVersion)
|
if (FileVersion == eUnknownGame)
|
||||||
{
|
{
|
||||||
Log::FileError(rSTRG.GetSourceString(), "Unsupported STRG version: " + TString::HexString(FileVersion, 0));
|
Log::FileError(rSTRG.GetSourceString(), "Unsupported STRG version: " + TString::HexString(FileVersion, 0));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -212,6 +212,6 @@ EGame CStringLoader::GetFormatVersion(u32 Version)
|
||||||
case 0x0: return ePrime;
|
case 0x0: return ePrime;
|
||||||
case 0x1: return eEchoes;
|
case 0x1: return eEchoes;
|
||||||
case 0x3: return eCorruption;
|
case 0x3: return eCorruption;
|
||||||
default: return eUnknownVersion;
|
default: return eUnknownGame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include "Core/GameProject/CResourceStore.h"
|
#include "Core/GameProject/CResourceStore.h"
|
||||||
#include "Core/Resource/CStringTable.h"
|
#include "Core/Resource/CStringTable.h"
|
||||||
#include "Core/Resource/EGame.h"
|
|
||||||
#include "Core/Resource/TResPtr.h"
|
#include "Core/Resource/TResPtr.h"
|
||||||
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
class CStringLoader
|
class CStringLoader
|
||||||
{
|
{
|
||||||
|
|
|
@ -293,7 +293,7 @@ CWorld* CWorldLoader::LoadMLVL(IInputStream& rMLVL, CResourceEntry *pEntry)
|
||||||
|
|
||||||
u32 FileVersion = rMLVL.ReadLong();
|
u32 FileVersion = rMLVL.ReadLong();
|
||||||
EGame Version = GetFormatVersion(FileVersion);
|
EGame Version = GetFormatVersion(FileVersion);
|
||||||
if (Version == eUnknownVersion)
|
if (Version == eUnknownGame)
|
||||||
{
|
{
|
||||||
Log::FileError(rMLVL.GetSourceString(), "Unsupported MLVL version: " + TString::HexString(FileVersion, 2));
|
Log::FileError(rMLVL.GetSourceString(), "Unsupported MLVL version: " + TString::HexString(FileVersion, 2));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -324,6 +324,6 @@ EGame CWorldLoader::GetFormatVersion(u32 Version)
|
||||||
case 0x17: return eEchoes;
|
case 0x17: return eEchoes;
|
||||||
case 0x19: return eCorruption;
|
case 0x19: return eCorruption;
|
||||||
case 0x1B: return eReturns;
|
case 0x1B: return eReturns;
|
||||||
default: return eUnknownVersion;
|
default: return eUnknownGame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "Core/GameProject/CResourceStore.h"
|
#include "Core/GameProject/CResourceStore.h"
|
||||||
#include "Core/Resource/CWorld.h"
|
#include "Core/Resource/CWorld.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
|
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ EGame CMasterTemplate::FindGameForName(const TString& rkName)
|
||||||
return pMaster->Game();
|
return pMaster->Game();
|
||||||
}
|
}
|
||||||
|
|
||||||
return eUnknownVersion;
|
return eUnknownGame;
|
||||||
}
|
}
|
||||||
|
|
||||||
TString CMasterTemplate::PropertyName(u32 PropertyID)
|
TString CMasterTemplate::PropertyName(u32 PropertyID)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "CLink.h"
|
#include "CLink.h"
|
||||||
#include "CScriptTemplate.h"
|
#include "CScriptTemplate.h"
|
||||||
#include "Core/Resource/EGame.h"
|
#include <Common/EGame.h>
|
||||||
#include <Common/types.h>
|
#include <Common/types.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// ************ IPropertyTemplate ************
|
// ************ IPropertyTemplate ************
|
||||||
EGame IPropertyTemplate::Game() const
|
EGame IPropertyTemplate::Game() const
|
||||||
{
|
{
|
||||||
return (mpMasterTemplate ? mpMasterTemplate->Game() : eUnknownVersion);
|
return (mpMasterTemplate ? mpMasterTemplate->Game() : eUnknownGame);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPropertyTemplate::IsInVersion(u32 Version) const
|
bool IPropertyTemplate::IsInVersion(u32 Version) const
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef CPAKTOOLDIALOG
|
#ifndef CPAKTOOLDIALOG
|
||||||
#define CPAKTOOLDIALOG
|
#define CPAKTOOLDIALOG
|
||||||
|
|
||||||
|
#include <Common/EGame.h>
|
||||||
#include <Common/Log.h>
|
#include <Common/Log.h>
|
||||||
#include <Common/types.h>
|
#include <Common/types.h>
|
||||||
#include <Core/Resource/EGame.h>
|
|
||||||
#include "Editor/UICommon.h"
|
#include "Editor/UICommon.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
bool HasAnyScriptNodesSelected() const;
|
bool HasAnyScriptNodesSelected() const;
|
||||||
|
|
||||||
inline CGameArea* ActiveArea() const { return mpArea; }
|
inline CGameArea* ActiveArea() const { return mpArea; }
|
||||||
inline EGame CurrentGame() const { return mpArea ? mpArea->Version() : eUnknownVersion; }
|
inline EGame CurrentGame() const { return mpArea ? mpArea->Version() : eUnknownGame; }
|
||||||
inline CLinkDialog* LinkDialog() const { return mpLinkDialog; }
|
inline CLinkDialog* LinkDialog() const { return mpLinkDialog; }
|
||||||
CSceneViewport* Viewport() const;
|
CSceneViewport* Viewport() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue