mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
reskinning fixes
1) falls back to assuming the word "base" is what is to be replaced if no "oldSkin = newSkin" entry exists 2) falls back to *using* base if the entry is left entriely blank
This commit is contained in:
parent
e15f17354d
commit
a8380744d8
2 changed files with 58 additions and 36 deletions
|
|
@ -3694,7 +3694,9 @@ void ShapeBase::setSkinName(const char* name)
|
||||||
|
|
||||||
void ShapeBase::reSkin()
|
void ShapeBase::reSkin()
|
||||||
{
|
{
|
||||||
if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
|
if (isGhost() && mShapeInstance)
|
||||||
|
{
|
||||||
|
if (mSkinNameHandle.isValidString())
|
||||||
{
|
{
|
||||||
mShapeInstance->resetMaterialList();
|
mShapeInstance->resetMaterialList();
|
||||||
Vector<String> skins;
|
Vector<String> skins;
|
||||||
|
|
@ -3714,11 +3716,20 @@ void ShapeBase::reSkin()
|
||||||
oldSkin = newSkin.substr(0, split);
|
oldSkin = newSkin.substr(0, split);
|
||||||
newSkin = newSkin.erase(0, split + 1);
|
newSkin = newSkin.erase(0, split + 1);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
oldSkin = "";
|
||||||
|
}
|
||||||
mShapeInstance->reSkin(newSkin, oldSkin);
|
mShapeInstance->reSkin(newSkin, oldSkin);
|
||||||
mAppliedSkinName = newSkin;
|
mAppliedSkinName = newSkin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mShapeInstance->reSkin("", mAppliedSkinName);
|
||||||
|
mAppliedSkinName = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeBase::setCurrentWaterObject( WaterObject *obj )
|
void ShapeBase::setCurrentWaterObject( WaterObject *obj )
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,9 @@ void TSStatic::setSkinName( const char *name )
|
||||||
|
|
||||||
void TSStatic::reSkin()
|
void TSStatic::reSkin()
|
||||||
{
|
{
|
||||||
if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
|
if (isGhost() && mShapeInstance)
|
||||||
|
{
|
||||||
|
if (mSkinNameHandle.isValidString())
|
||||||
{
|
{
|
||||||
mShapeInstance->resetMaterialList();
|
mShapeInstance->resetMaterialList();
|
||||||
Vector<String> skins;
|
Vector<String> skins;
|
||||||
|
|
@ -562,11 +564,20 @@ void TSStatic::reSkin()
|
||||||
oldSkin = newSkin.substr(0, split);
|
oldSkin = newSkin.substr(0, split);
|
||||||
newSkin = newSkin.erase(0, split + 1);
|
newSkin = newSkin.erase(0, split + 1);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
oldSkin = "";
|
||||||
|
}
|
||||||
mShapeInstance->reSkin(newSkin, oldSkin);
|
mShapeInstance->reSkin(newSkin, oldSkin);
|
||||||
mAppliedSkinName = newSkin;
|
mAppliedSkinName = newSkin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mShapeInstance->reSkin("", mAppliedSkinName);
|
||||||
|
mAppliedSkinName = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSStatic::processTick( const Move *move )
|
void TSStatic::processTick( const Move *move )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue