Loading SCLY file properties into a new class CResourceInfo instead of loading it as a CResource

This commit is contained in:
parax0
2016-01-10 08:57:21 -07:00
parent b768473b44
commit 29bf0234ec
15 changed files with 163 additions and 73 deletions

View File

@@ -228,7 +228,7 @@ CModel* CScriptTemplate::FindDisplayModel(CPropertyStruct *pProperties)
if (pProp->Type() == eFileProperty)
{
TFileProperty *pFile = static_cast<TFileProperty*>(pProp);
pRes = pFile->Get();
pRes = pFile->Get().Load();
}
else if (pProp->Type() == eCharacterProperty)
@@ -268,7 +268,7 @@ CTexture* CScriptTemplate::FindBillboardTexture(CPropertyStruct *pProperties)
if (pProp->Type() == eFileProperty)
{
TFileProperty *pFile = static_cast<TFileProperty*>(pProp);
pRes = pFile->Get();
pRes = pFile->Get().Load();
}
}
@@ -302,7 +302,7 @@ CCollisionMeshGroup* CScriptTemplate::FindCollision(CPropertyStruct *pProperties
if (pProp->Type() == eFileProperty)
{
TFileProperty *pFile = static_cast<TFileProperty*>(pProp);
pRes = pFile->Get();
pRes = pFile->Get().Load();
}
}
@@ -327,7 +327,7 @@ bool CScriptTemplate::HasInGameModel(CPropertyStruct *pProperties)
if (pProp->Type() == eFileProperty)
{
TFileProperty *pFile = static_cast<TFileProperty*>(pProp);
pRes = pFile->Get();
pRes = pFile->Get().Load();
}
else if (pProp->Type() == eCharacterProperty)

View File

@@ -67,7 +67,7 @@ typedef TTypedProperty<float, eFloatProperty, CFloatValue>
typedef TTypedProperty<TString, eStringProperty, CStringValue> TStringProperty;
typedef TTypedProperty<CVector3f, eVector3Property, CVector3Value> TVector3Property;
typedef TTypedProperty<CColor, eColorProperty, CColorValue> TColorProperty;
typedef TTypedProperty<TResPtr<CResource>, eFileProperty, CFileValue> TFileProperty;
typedef TTypedProperty<CResourceInfo, eFileProperty, CFileValue> TFileProperty;
typedef TTypedProperty<CAnimationParameters, eCharacterProperty, CCharacterValue> TAnimParamsProperty;
typedef TTypedProperty<std::vector<u8>, eUnknownProperty, CUnknownValue> TUnknownProperty;

View File

@@ -5,6 +5,7 @@
#include "Core/Log.h"
#include "Core/Resource/CAnimationParameters.h"
#include "Core/Resource/CResource.h"
#include "Core/Resource/CResourceInfo.h"
#include "Core/Resource/TResPtr.h"
#include <Common/CColor.h>
@@ -253,11 +254,11 @@ public:
void FromString(const TString&) { }
};
class CFileValue : public TTypedPropertyValue<TResPtr<CResource>>
class CFileValue : public TTypedPropertyValue<CResourceInfo>
{
public:
CFileValue() {}
CFileValue(CResource *pRes) { mValue = pRes; }
CFileValue(const CResourceInfo& rkInfo) { mValue = rkInfo; }
TString ToString() const { return ""; }
void FromString(const TString&) { }