mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
error string interpreter, example of usage in shapebase::preload, plus flips the datablock filter back on to save some network bandwidth.
This commit is contained in:
parent
220771d2fe
commit
8bb43dd5ae
5 changed files with 68 additions and 22 deletions
|
|
@ -366,14 +366,14 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
|||
shapeAssetId = ShapeAsset::getAssetIdByFilename(shapeName);
|
||||
}
|
||||
U32 assetState = ShapeAsset::getAssetById(shapeAssetId, &shapeAsset);
|
||||
if (AssetErrCode::Failed != assetState)
|
||||
if (ShapeAsset::Failed != assetState)
|
||||
{
|
||||
//only clear the legacy direct file reference if everything checks out fully
|
||||
if (assetState == AssetErrCode::Ok)
|
||||
if (assetState == ShapeAsset::Ok)
|
||||
{
|
||||
shapeName = StringTable->EmptyString();
|
||||
}
|
||||
|
||||
else Con::warnf("Warning: ShapeBaseData::preload-%s", ShapeAsset::getAssetErrstrn(assetState).c_str());
|
||||
S32 i;
|
||||
|
||||
// Resolve shapename
|
||||
|
|
@ -798,10 +798,14 @@ void ShapeBaseData::packData(BitStream* stream)
|
|||
stream->write(shadowSphereAdjust);
|
||||
|
||||
|
||||
//if (stream->writeFlag(shapeAsset.notNull()))
|
||||
if (stream->writeFlag(shapeAsset.notNull()))
|
||||
{
|
||||
stream->writeString(shapeAsset.getAssetId());
|
||||
//else
|
||||
}
|
||||
else
|
||||
{
|
||||
stream->writeString(shapeName);
|
||||
}
|
||||
|
||||
stream->writeString(cloakTexName);
|
||||
if(stream->writeFlag(mass != gShapeBaseDataProto.mass))
|
||||
|
|
@ -880,10 +884,16 @@ void ShapeBaseData::unpackData(BitStream* stream)
|
|||
stream->read(&shadowSphereAdjust);
|
||||
|
||||
|
||||
//if (stream->readFlag())
|
||||
if (stream->readFlag())
|
||||
{
|
||||
shapeAssetId = stream->readSTString();
|
||||
//else
|
||||
ShapeAsset::getAssetById(shapeAssetId, &shapeAsset);
|
||||
shapeName = shapeAsset->getShapeFilename();
|
||||
}
|
||||
else
|
||||
{
|
||||
shapeName = stream->readSTString();
|
||||
}
|
||||
|
||||
cloakTexName = stream->readSTString();
|
||||
if(stream->readFlag())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue