mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Merge pull request #315 from Areloch/MemleakAndFriends
Various misc. tweaks and fixes targeting memleaks and crashes
This commit is contained in:
commit
d6ec72de6e
44 changed files with 125 additions and 257 deletions
|
|
@ -11,7 +11,8 @@ Scene::Scene() :
|
|||
mParentScene(nullptr),
|
||||
mSceneId(-1),
|
||||
mIsEditing(false),
|
||||
mIsDirty(false)
|
||||
mIsDirty(false),
|
||||
mEditPostFX(0)
|
||||
{
|
||||
mGameModeName = StringTable->EmptyString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,8 @@ AIPlayer::AIPlayer()
|
|||
|
||||
for( S32 i = 0; i < MaxTriggerKeys; i ++ )
|
||||
mMoveTriggers[ i ] = false;
|
||||
|
||||
mAttackRadius = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ GuiControl* GuiInspectorTypeGameObjectAssetPtr::constructEditControl()
|
|||
|
||||
const char* assetId = getData();
|
||||
|
||||
if (assetId == "")
|
||||
if (dStrEqual(assetId, ""))
|
||||
{
|
||||
mGameObjectEditButton->setText("Create Game Object");
|
||||
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ bool GuiInspectorTypeMaterialAssetPtr::updateRects()
|
|||
|
||||
bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
|
||||
|
||||
if (mMatEdContainer != nullptr)
|
||||
if (mMatEdContainer != nullptr && mMatPreviewButton != nullptr)
|
||||
{
|
||||
mMatPreviewButton->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -783,7 +783,7 @@ U32 DecalManager::_generateConvexHull( const Vector<Point3F> &points, Vector<Poi
|
|||
while ( ++i <= maxmin )
|
||||
{
|
||||
// the lower line joins P[minmin] with P[maxmin]
|
||||
if ( isLeft( points[minmin], points[maxmin], points[i]) >= 0 && i < maxmin )
|
||||
if (i < maxmin && isLeft(points[minmin], points[maxmin], points[i]) >= 0)
|
||||
continue; // ignore P[i] above or on the lower line
|
||||
|
||||
while (top > 0) // there are at least 2 points on the stack
|
||||
|
|
|
|||
|
|
@ -747,14 +747,21 @@ void ReflectionProbe::processStaticCubemap()
|
|||
|
||||
if (Platform::isFile(irradFileName))
|
||||
{
|
||||
mIrridianceMap->setCubemapFile(FileName(irradFileName));
|
||||
mIrridianceMap->updateFaces();
|
||||
}
|
||||
if (mIrridianceMap == nullptr)
|
||||
{
|
||||
Con::errorf("ReflectionProbe::processStaticCubemap() - Unable to load baked irradiance map at %s", irradFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIrridianceMap == nullptr || mIrridianceMap->mCubemap.isNull())
|
||||
{
|
||||
Con::errorf("ReflectionProbe::processStaticCubemap() - Unable to load baked irradiance map at %s", irradFileName);
|
||||
return;
|
||||
mIrridianceMap->setCubemapFile(FileName(irradFileName));
|
||||
|
||||
if (mIrridianceMap->mCubemap.isNull())
|
||||
{
|
||||
Con::errorf("ReflectionProbe::processStaticCubemap() - Unable to load baked irradiance map at %s", irradFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
mIrridianceMap->updateFaces();
|
||||
}
|
||||
|
||||
char prefilterFileName[256];
|
||||
|
|
@ -762,14 +769,21 @@ void ReflectionProbe::processStaticCubemap()
|
|||
|
||||
if (Platform::isFile(prefilterFileName))
|
||||
{
|
||||
mPrefilterMap->setCubemapFile(FileName(prefilterFileName));
|
||||
mPrefilterMap->updateFaces();
|
||||
}
|
||||
if (mPrefilterMap == nullptr)
|
||||
{
|
||||
Con::errorf("ReflectionProbe::processStaticCubemap() - Unable to load baked prefilter map at %s", prefilterFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mPrefilterMap == nullptr || mPrefilterMap->mCubemap.isNull())
|
||||
{
|
||||
Con::errorf("ReflectionProbe::processStaticCubemap() - Unable to load baked prefilter map at %s", prefilterFileName);
|
||||
return;
|
||||
mPrefilterMap->setCubemapFile(FileName(prefilterFileName));
|
||||
|
||||
if (mPrefilterMap->mCubemap.isNull())
|
||||
{
|
||||
Con::errorf("ReflectionProbe::processStaticCubemap() - Unable to load baked prefilter map at %s", prefilterFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
mPrefilterMap->updateFaces();
|
||||
}
|
||||
|
||||
if (!Platform::isFile(prefilterFileName) || !Platform::isFile(irradFileName))
|
||||
|
|
@ -809,7 +823,7 @@ void ReflectionProbe::processStaticCubemap()
|
|||
IBLUtilities::SaveCubeMap(prefilterFileName, mPrefilterMap->mCubemap);
|
||||
}
|
||||
|
||||
if ((mIrridianceMap != nullptr || !mIrridianceMap->mCubemap.isNull()) && (mPrefilterMap != nullptr || !mPrefilterMap->mCubemap.isNull()))
|
||||
if ((mIrridianceMap != nullptr && !mIrridianceMap->mCubemap.isNull()) && (mPrefilterMap != nullptr && !mPrefilterMap->mCubemap.isNull()))
|
||||
{
|
||||
mProbeInfo->mPrefilterCubemap = mPrefilterMap->mCubemap;
|
||||
mProbeInfo->mIrradianceCubemap = mIrridianceMap->mCubemap;
|
||||
|
|
|
|||
|
|
@ -290,6 +290,7 @@ PlayerData::PlayerData()
|
|||
|
||||
maxStepHeight = 1.0f;
|
||||
runSurfaceAngle = 80.0f;
|
||||
runSurfaceCos = mCos(mDegToRad(runSurfaceAngle));
|
||||
|
||||
fallingSpeedThreshold = -10.0f;
|
||||
|
||||
|
|
|
|||
|
|
@ -120,8 +120,7 @@ SFXEmitter::~SFXEmitter()
|
|||
{
|
||||
mLocalProfile._unregisterSignals();
|
||||
|
||||
if( mSource )
|
||||
SFX_DELETE( mSource );
|
||||
SFX_DELETE( mSource );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1210,7 +1210,7 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload )
|
|||
}
|
||||
ShapeBaseData *prevDB = dynamic_cast<ShapeBaseData*>( mDataBlock );
|
||||
|
||||
bool isInitialDataBlock = ( mDataBlock == 0 );
|
||||
bool isInitialDataBlock = (prevDB == 0);
|
||||
|
||||
if ( Parent::onNewDataBlock( dptr, reload ) == false )
|
||||
return false;
|
||||
|
|
@ -1236,13 +1236,14 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload )
|
|||
for (S32 i = 0; i < mDataBlock->txr_tag_remappings.size(); i++)
|
||||
{
|
||||
ShapeBaseData::TextureTagRemapping* remap = &mDataBlock->txr_tag_remappings[i];
|
||||
Vector<String> & mat_names = (Vector<String>&) mat_list->getMaterialNameList();
|
||||
for (S32 j = 0; j < mat_names.size(); j++)
|
||||
Vector<String>& mat_names = (Vector<String>&) mat_list->getMaterialNameList();
|
||||
S32 old_tagLen = dStrlen(remap->old_tag);
|
||||
for (S32 j = 0; j < mat_names.size(); j++)
|
||||
{
|
||||
if (mat_names[j].compare(remap->old_tag, dStrlen(remap->old_tag), String::NoCase) == 0)
|
||||
if (mat_names[j].compare(remap->old_tag, old_tagLen, String::NoCase) == 0)
|
||||
{
|
||||
mat_names[j] = String(remap->new_tag);
|
||||
mat_names[j].insert(0,'#');
|
||||
mat_names[j].insert(0, '#');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1263,14 +1264,15 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload )
|
|||
for (S32 i = 0; i < mDataBlock->txr_tag_remappings.size(); i++)
|
||||
{
|
||||
ShapeBaseData::TextureTagRemapping* remap = &mDataBlock->txr_tag_remappings[i];
|
||||
Vector<String> & mat_names = (Vector<String>&) mat_list->getMaterialNameList();
|
||||
for (S32 j = 0; j < mat_names.size(); j++)
|
||||
Vector<String>& mat_names = (Vector<String>&) mat_list->getMaterialNameList();
|
||||
S32 new_tagLen = dStrlen(remap->new_tag);
|
||||
for (S32 j = 0; j < mat_names.size(); j++)
|
||||
{
|
||||
String::SizeType len = mat_names[j].length();
|
||||
if (len > 1)
|
||||
{
|
||||
String temp_name = mat_names[j].substr(1,len-1);
|
||||
if (temp_name.compare(remap->new_tag, dStrlen(remap->new_tag)) == 0)
|
||||
String temp_name = mat_names[j].substr(1, len - 1);
|
||||
if (temp_name.compare(remap->new_tag, new_tagLen) == 0)
|
||||
{
|
||||
mat_names[j] = String(remap->old_tag);
|
||||
break;
|
||||
|
|
@ -1286,7 +1288,7 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload )
|
|||
resetWorldBox();
|
||||
|
||||
// Set the initial mesh hidden state.
|
||||
mMeshHidden.setSize( mDataBlock->mShape->objects.size() );
|
||||
mMeshHidden.setSize(mDataBlock->mShape->objects.size());
|
||||
mMeshHidden.clear();
|
||||
|
||||
// Initialize the threads
|
||||
|
|
@ -1304,37 +1306,37 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload )
|
|||
// initialized either by the constructor or from the server.
|
||||
bool reset = st.thread != 0;
|
||||
st.thread = 0;
|
||||
|
||||
|
||||
// New datablock/shape may not actually HAVE this sequence.
|
||||
// In that case stop playing it.
|
||||
|
||||
AssertFatal( prevDB != NULL, "ShapeBase::onNewDataBlock - how did you have a sequence playing without a prior datablock?" );
|
||||
|
||||
const TSShape *prevShape = prevDB->mShape;
|
||||
const TSShape::Sequence &prevSeq = prevShape->sequences[st.sequence];
|
||||
const String &prevSeqName = prevShape->names[prevSeq.nameIndex];
|
||||
|
||||
st.sequence = mDataBlock->mShape->findSequence( prevSeqName );
|
||||
AssertFatal(prevDB != NULL, "ShapeBase::onNewDataBlock - how did you have a sequence playing without a prior datablock?");
|
||||
|
||||
if ( st.sequence != -1 )
|
||||
const TSShape* prevShape = prevDB->mShape;
|
||||
const TSShape::Sequence& prevSeq = prevShape->sequences[st.sequence];
|
||||
const String& prevSeqName = prevShape->names[prevSeq.nameIndex];
|
||||
|
||||
st.sequence = mDataBlock->mShape->findSequence(prevSeqName);
|
||||
|
||||
if (st.sequence != -1)
|
||||
{
|
||||
setThreadSequence( i, st.sequence, reset );
|
||||
}
|
||||
setThreadSequence(i, st.sequence, reset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mDataBlock->damageSequence != -1) {
|
||||
mDamageThread = mShapeInstance->addThread();
|
||||
mShapeInstance->setSequence(mDamageThread,
|
||||
mDataBlock->damageSequence,0);
|
||||
mDataBlock->damageSequence, 0);
|
||||
}
|
||||
if (mDataBlock->hulkSequence != -1) {
|
||||
mHulkThread = mShapeInstance->addThread();
|
||||
mShapeInstance->setSequence(mHulkThread,
|
||||
mDataBlock->hulkSequence,0);
|
||||
mDataBlock->hulkSequence, 0);
|
||||
}
|
||||
|
||||
if( isGhost() )
|
||||
if (isGhost())
|
||||
{
|
||||
// Reapply the current skin
|
||||
mAppliedSkinName = "";
|
||||
|
|
|
|||
|
|
@ -339,8 +339,13 @@ bool WheeledVehicleData::preload(bool server, String &errorStr)
|
|||
// Resolve objects transmitted from server
|
||||
if (!server) {
|
||||
for (S32 i = 0; i < MaxSounds; i++)
|
||||
if( !sfxResolve( &sound[ i ], errorStr ) )
|
||||
{
|
||||
if (!sfxResolve(&sound[i], errorStr))
|
||||
{
|
||||
delete si;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (tireEmitter)
|
||||
Sim::findObject(SimObjectId((uintptr_t)tireEmitter),tireEmitter);
|
||||
|
|
|
|||
|
|
@ -1584,8 +1584,8 @@ static void handleMasterServerListResponse( BitStream* stream, U32 key, U8 /*fla
|
|||
{
|
||||
if ( i != packetIndex )
|
||||
{
|
||||
PacketStatus* p = new PacketStatus( i, gMasterServerPing.key, currentTime );
|
||||
gPacketStatusList.push_back( *p );
|
||||
PacketStatus p = PacketStatus( i, gMasterServerPing.key, currentTime );
|
||||
gPacketStatusList.push_back( p );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1674,8 +1674,8 @@ static void handleExtendedMasterServerListResponse(BitStream* stream, U32 key, U
|
|||
{
|
||||
if (i != packetIndex)
|
||||
{
|
||||
PacketStatus* p = new PacketStatus(i, gMasterServerPing.key, currentTime);
|
||||
gPacketStatusList.push_back(*p);
|
||||
PacketStatus p = PacketStatus(i, gMasterServerPing.key, currentTime);
|
||||
gPacketStatusList.push_back(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ typedef Chunker<BSPNode> BSPTree;
|
|||
/// @see Collision
|
||||
struct RayInfo : public Collision
|
||||
{
|
||||
RayInfo() : userData( NULL ) {}
|
||||
RayInfo() : t(0), userData( NULL ) {}
|
||||
|
||||
// The collision struct has object, point, normal & material.
|
||||
|
||||
|
|
|
|||
|
|
@ -1579,6 +1579,9 @@ ConsoleValueRef _internalExecute(SimObject *object, S32 argc, ConsoleValueRef ar
|
|||
}
|
||||
bool result;
|
||||
const char* methodRes = CInterface::CallMethod(object, argv[0], argv_str, argc - 2, &result);
|
||||
|
||||
free(argv_str);
|
||||
|
||||
if (result)
|
||||
{
|
||||
return ConsoleValueRef::fromValue(CSTK.pushString(methodRes));
|
||||
|
|
|
|||
|
|
@ -542,6 +542,8 @@ void FieldBrushObject::pasteFields( SimObject* pSimObject )
|
|||
// Force modification of static-fields on target object!
|
||||
pSimObject->setModStaticFields( true );
|
||||
|
||||
S32 prefixLength = dStrlen(INTERNAL_FIELD_PREFIX);
|
||||
|
||||
// Iterate fields.
|
||||
for ( SimFieldDictionaryIterator itr(pFieldDictionary); *itr; ++itr )
|
||||
{
|
||||
|
|
@ -553,7 +555,7 @@ void FieldBrushObject::pasteFields( SimObject* pSimObject )
|
|||
if ( pInternalField == fieldEntry->slotName )
|
||||
{
|
||||
// Yes, so skip the prefix.
|
||||
pInternalField += dStrlen(INTERNAL_FIELD_PREFIX);
|
||||
pInternalField += prefixLength;
|
||||
|
||||
// Is this a static-field on the target object?
|
||||
// NOTE:- We're doing this so we don't end-up creating a dynamic-field if it isn't present.
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
|||
|
||||
if (mShapeAssetId != StringTable->EmptyString())
|
||||
{
|
||||
mShape = mShape = mShapeAsset->getShapeResource();
|
||||
mShape = mShapeAsset->getShapeResource();
|
||||
}
|
||||
else if (mShapeName && mShapeName[0] != '\0')
|
||||
{
|
||||
|
|
@ -1048,7 +1048,7 @@ void VolumetricFog::prepRenderImage(SceneRenderState *state)
|
|||
return;
|
||||
if (mNumDetailLevels > 1)
|
||||
{
|
||||
if ((det_size[mCurDetailLevel].det_size > mPixelSize) && (mCurDetailLevel < mNumDetailLevels - 1))
|
||||
if ((mCurDetailLevel < mNumDetailLevels - 1) && (det_size[mCurDetailLevel].det_size > mPixelSize))
|
||||
UpdateBuffers(mCurDetailLevel + 1);
|
||||
else if (mCurDetailLevel > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -375,6 +375,8 @@ GFXTextureObject *GFXTextureManager::_createTexture( GBitmap *bmp,
|
|||
|
||||
if(!ret)
|
||||
{
|
||||
SAFE_DELETE(realBmp);
|
||||
|
||||
Con::errorf("GFXTextureManager - failed to create texture (1) for '%s'", (resourceName.isNotEmpty() ? resourceName.c_str() : "unknown"));
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ DefineEngineMethod(CubemapData, save, void, (const char* filename, const GFXForm
|
|||
"Returns the script filename of where the CubemapData object was "
|
||||
"defined. This is used by the material editor.")
|
||||
{
|
||||
if (filename == "")
|
||||
if (dStrEqual(filename, ""))
|
||||
filename = object->getName();
|
||||
|
||||
//add dds extension if needed
|
||||
|
|
@ -211,4 +211,4 @@ DefineEngineMethod(CubemapData, save, void, (const char* filename, const GFXForm
|
|||
finalName += String(".dds");
|
||||
|
||||
CubemapSaver::save(object->mCubemap, finalName, format);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ class GuiMLTextCtrl : public GuiControl
|
|||
Resource<GFont> mFont;
|
||||
|
||||
// Console settable parameters
|
||||
U32 mLineSpacingPixels;
|
||||
S32 mLineSpacingPixels;
|
||||
bool mAllowColorChars;
|
||||
bool mUseURLMouseCursor;
|
||||
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ DefineEngineMethod(GuiVariableInspector, addField, void, (const char* name, cons
|
|||
const char* description, const char* defaultValue, const char* dataValues, SimObject* ownerObj),
|
||||
("","","","","", "", nullAsType<SimObject*>()), "addField( fieldName/varName, fieldLabel, fieldTypeName, description, defaultValue, defaultValues, ownerObject )")
|
||||
{
|
||||
if (name == "" || typeName == "")
|
||||
if (dStrEqual(name, "") || dStrEqual(typeName, ""))
|
||||
return;
|
||||
|
||||
object->addField(name, label, typeName, description, defaultValue, dataValues, "", ownerObj);
|
||||
|
|
@ -278,7 +278,7 @@ DefineEngineMethod(GuiVariableInspector, addCallbackField, void, (const char* na
|
|||
const char* description, const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj),
|
||||
("", "", "", "", "", "", nullAsType<SimObject*>()), "addField( fieldName/varName, fieldLabel, fieldTypeName, description, defaultValue, defaultValues, callbackName, ownerObject )")
|
||||
{
|
||||
if (name == "" || typeName == "")
|
||||
if (dStrEqual(name, "") || dStrEqual(typeName, ""))
|
||||
return;
|
||||
|
||||
object->addCallbackField(name, label, typeName, description, defaultValue, dataValues, callbackName, ownerObj);
|
||||
|
|
|
|||
|
|
@ -4042,23 +4042,6 @@ bool WorldEditor::makeSelectionAMesh(const char *filename)
|
|||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
// Allocate TSStatic object and add to level.
|
||||
TSStatic *ts = new TSStatic();
|
||||
ts->setShapeFileName(StringTable->insert(filename));
|
||||
fabMat.inverse();
|
||||
ts->setTransform(fabMat);
|
||||
ts->registerObject();
|
||||
scene->addObject(ts);
|
||||
|
||||
// Select it, mark level as dirty.
|
||||
clearSelection();
|
||||
selectObject(ts);
|
||||
setDirty();
|
||||
|
||||
// Delete original objects and temporary SimGroup.
|
||||
for (S32 i = 0; i < objectList.size(); i++)
|
||||
objectList[i]->deleteObject();
|
||||
}
|
||||
|
||||
DefineEngineMethod( WorldEditor, makeSelectionPrefab, void, ( const char* filename, bool dontDeleteOriginals ), (false),
|
||||
|
|
|
|||
|
|
@ -114,10 +114,6 @@ void DeferredRTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &component
|
|||
meta->addStatement( new GenOp( " @.y = 1.0 - @.y;\r\n", uvScene, uvScene ) ); // flip the y axis
|
||||
meta->addStatement( new GenOp( " @ = ( @ * @.zw ) + @.xy;\r\n", uvScene, uvScene, rtParams, rtParams) ); // scale it down and offset it to the rt size
|
||||
|
||||
Var *lightInfoSamp = new Var;
|
||||
lightInfoSamp->setType( "vec4" );
|
||||
lightInfoSamp->setName( "lightInfoSample" );
|
||||
|
||||
// create texture var
|
||||
Var *lightInfoBuffer = new Var;
|
||||
lightInfoBuffer->setType( "sampler2D" );
|
||||
|
|
|
|||
|
|
@ -115,10 +115,6 @@ void DeferredRTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
|||
meta->addStatement( new GenOp( " @.y = 1.0 - @.y;\r\n", uvScene, uvScene ) ); // flip the y axis
|
||||
meta->addStatement( new GenOp( " @ = ( @ * @.zw ) + @.xy;\r\n", uvScene, uvScene, rtParams, rtParams) ); // scale it down and offset it to the rt size
|
||||
|
||||
Var *lightInfoSamp = new Var;
|
||||
lightInfoSamp->setType( "float4" );
|
||||
lightInfoSamp->setName( "lightInfoSample" );
|
||||
|
||||
// create texture var
|
||||
Var *lightInfoBuffer = new Var;
|
||||
lightInfoBuffer->setType( "SamplerState" );
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ bool CustomMaterial::onAdd()
|
|||
}
|
||||
|
||||
const char* samplerDecl = "sampler";
|
||||
S32 samplerDeclLen = dStrlen(samplerDecl);
|
||||
S32 i = 0;
|
||||
for (SimFieldDictionaryIterator itr(getFieldDictionary()); *itr; ++itr)
|
||||
{
|
||||
|
|
@ -132,7 +133,7 @@ bool CustomMaterial::onAdd()
|
|||
return false;
|
||||
}
|
||||
|
||||
if (dStrlen(entry->slotName) == dStrlen(samplerDecl))
|
||||
if (dStrlen(entry->slotName) == samplerDeclLen)
|
||||
{
|
||||
logError("sampler declarations must have a sampler name, e.g. sampler[\"diffuseMap\"]");
|
||||
return false;
|
||||
|
|
@ -140,7 +141,7 @@ bool CustomMaterial::onAdd()
|
|||
|
||||
// Assert sampler names are defined on ShaderData
|
||||
S32 pos = -1;
|
||||
String samplerName = entry->slotName + dStrlen(samplerDecl);
|
||||
String samplerName = entry->slotName + samplerDeclLen;
|
||||
samplerName.insert(0, '$');
|
||||
mShaderData->hasSamplerDef(samplerName, pos);
|
||||
|
||||
|
|
|
|||
|
|
@ -502,11 +502,6 @@ void Material::initPersistFields()
|
|||
|
||||
endGroup( "Behavioral" );
|
||||
|
||||
addProtectedField("customShaderFeature", TypeRealString, NULL, &protectedSetCustomShaderFeature, &defaultProtectedGetFn,
|
||||
"Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors);
|
||||
addProtectedField("CustomShaderFeatureUniforms", TypeRealString, NULL, &protectedSetCustomShaderFeatureUniforms, &defaultProtectedGetFn,
|
||||
"Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors);
|
||||
|
||||
Parent::initPersistFields();
|
||||
}
|
||||
|
||||
|
|
@ -524,36 +519,6 @@ bool Material::writeField( StringTableEntry fieldname, const char *value )
|
|||
return Parent::writeField( fieldname, value );
|
||||
}
|
||||
|
||||
bool Material::protectedSetCustomShaderFeature(void *object, const char *index, const char *data)
|
||||
{
|
||||
Material *material = static_cast< Material* >(object);
|
||||
|
||||
CustomShaderFeatureData* customFeature;
|
||||
if (!Sim::findObject(data, customFeature))
|
||||
return false;
|
||||
|
||||
material->mCustomShaderFeatures.push_back(customFeature);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Material::protectedSetCustomShaderFeatureUniforms(void *object, const char *index, const char *data)
|
||||
{
|
||||
Material *material = static_cast< Material* >(object);
|
||||
|
||||
if (index != NULL)
|
||||
{
|
||||
char featureName[256] = { 0 };
|
||||
U32 id = 0;
|
||||
dSscanf(index, "%s_%i", featureName, id);
|
||||
|
||||
String uniformName = data;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Material::onAdd()
|
||||
{
|
||||
if (Parent::onAdd() == false)
|
||||
|
|
|
|||
|
|
@ -41,10 +41,6 @@
|
|||
#include "console/dynamicTypes.h"
|
||||
#endif
|
||||
|
||||
#ifndef CUSTOMSHADERFEATURE_H
|
||||
#include "shaderGen/customShaderFeature.h"
|
||||
#endif
|
||||
|
||||
#ifndef IMAGE_ASSET_H
|
||||
#include "T3D/assets/ImageAsset.h"
|
||||
#endif
|
||||
|
|
@ -59,7 +55,6 @@ class FeatureSet;
|
|||
class FeatureType;
|
||||
class MaterialSoundProfile;
|
||||
class MaterialPhysicsProfile;
|
||||
class CustomShaderFeatureData;
|
||||
|
||||
/// The basic material definition.
|
||||
class Material : public BaseMaterialDefinition
|
||||
|
|
@ -356,8 +351,6 @@ public:
|
|||
F32 mDirectSoundOcclusion; ///< Amount of volume occlusion on direct sounds.
|
||||
F32 mReverbSoundOcclusion; ///< Amount of volume occlusion on reverb sounds.
|
||||
|
||||
Vector<CustomShaderFeatureData*> mCustomShaderFeatures;
|
||||
|
||||
///@}
|
||||
|
||||
String mMapTo; // map Material to this texture name
|
||||
|
|
@ -395,9 +388,6 @@ public:
|
|||
virtual void inspectPostApply();
|
||||
virtual bool writeField( StringTableEntry fieldname, const char *value );
|
||||
|
||||
static bool protectedSetCustomShaderFeature(void *object, const char *index, const char *data);
|
||||
static bool protectedSetCustomShaderFeatureUniforms(void *object, const char *index, const char *data);
|
||||
|
||||
//
|
||||
// ConsoleObject interface
|
||||
//
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ bool ProcessedCustomMaterial::init( const FeatureSet &features,
|
|||
return false;
|
||||
}
|
||||
|
||||
rpd->shaderHandles.init( rpd->shader, mCustomMaterial->mCustomShaderFeatures, mCustomMaterial );
|
||||
rpd->shaderHandles.init( rpd->shader, mCustomMaterial );
|
||||
_initMaterialParameters();
|
||||
mDefaultParameters = allocMaterialParameters();
|
||||
setMaterialParameters( mDefaultParameters, 0 );
|
||||
|
|
|
|||
|
|
@ -85,8 +85,6 @@ public:
|
|||
|
||||
MaterialFeatureData mFeatureData;
|
||||
|
||||
Vector<CustomShaderFeatureData*> mCustomShaderFeatureData;
|
||||
|
||||
bool mGlow;
|
||||
|
||||
Material::BlendOp mBlendOp;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
///
|
||||
/// ShaderConstHandles
|
||||
///
|
||||
void ShaderConstHandles::init( GFXShader *shader, Vector<CustomShaderFeatureData*> customFeatureData, CustomMaterial* mat /*=NULL*/)
|
||||
void ShaderConstHandles::init( GFXShader *shader, CustomMaterial* mat /*=NULL*/)
|
||||
{
|
||||
mDiffuseColorSC = shader->getShaderConstHandle("$diffuseMaterialColor");
|
||||
mTexMatSC = shader->getShaderConstHandle(ShaderGenVars::texMat);
|
||||
|
|
@ -125,19 +125,6 @@ void ShaderConstHandles::init( GFXShader *shader, Vector<CustomShaderFeatureData
|
|||
|
||||
// Deferred Shading
|
||||
mMatInfoFlagsSC = shader->getShaderConstHandle(ShaderGenVars::matInfoFlags);
|
||||
|
||||
//custom features
|
||||
for (U32 f = 0; f < customFeatureData.size(); ++f)
|
||||
{
|
||||
for (U32 i = 0; i < customFeatureData[f]->mAddedShaderConstants.size(); ++i)
|
||||
{
|
||||
customHandleData newSC;
|
||||
newSC.handle = shader->getShaderConstHandle(String("$") + String(customFeatureData[f]->mAddedShaderConstants[i]));
|
||||
newSC.handleName = customFeatureData[f]->mAddedShaderConstants[i];
|
||||
|
||||
mCustomHandles.push_back(newSC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
|
|
@ -686,10 +673,10 @@ bool ProcessedShaderMaterial::_addPass( ShaderRenderPassData &rpd,
|
|||
|
||||
// Generate shader
|
||||
GFXShader::setLogging( true, true );
|
||||
rpd.shader = SHADERGEN->getShader( rpd.mFeatureData, mMaterial->mCustomShaderFeatures, mVertexFormat, &mUserMacros, samplers );
|
||||
rpd.shader = SHADERGEN->getShader( rpd.mFeatureData, mVertexFormat, &mUserMacros, samplers );
|
||||
if( !rpd.shader )
|
||||
return false;
|
||||
rpd.shaderHandles.init( rpd.shader, mMaterial->mCustomShaderFeatures);
|
||||
rpd.shaderHandles.init( rpd.shader );
|
||||
|
||||
// If a pass glows, we glow
|
||||
if( rpd.mGlow )
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public:
|
|||
};
|
||||
Vector<customHandleData> mCustomHandles;
|
||||
|
||||
void init( GFXShader* shader, Vector<CustomShaderFeatureData*> customFeatureData, CustomMaterial* mat = NULL);
|
||||
void init( GFXShader* shader, CustomMaterial* mat = NULL);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ struct PolyhedronData
|
|||
/// it defines a *clockwise* orientation for face[ 0 ]. This is important!
|
||||
U32 vertex[ 2 ];
|
||||
|
||||
Edge() { std::fill_n(face, 2, 0), std::fill_n(vertex, 0, 0); }
|
||||
Edge() { std::fill_n(face, 2, 0), std::fill_n(vertex, 2, 0); }
|
||||
Edge( U32 face1, U32 face2, U32 vertex1, U32 vertex2 )
|
||||
{
|
||||
face[ 0 ] = face1;
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ bool ModuleManager::unloadModuleGroup( const char* pModuleGroup )
|
|||
if ( mEchoInfo )
|
||||
{
|
||||
Con::printf( "Module Manager: Unloading group '%s' but could not unload module Id '%s' at version Id '%d'.",
|
||||
moduleGroup, pLoadedEntry->mpModuleDefinition->getModuleId(), pLoadedEntry->mpModuleDefinition->getVersionId() );
|
||||
moduleGroup, pLoadReadyModuleDefinition->getModuleId(), pLoadReadyModuleDefinition->getVersionId());
|
||||
}
|
||||
// Skip.
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -918,7 +918,7 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe, bool writeFiles)
|
|||
Frustum culler;
|
||||
culler.set(false,
|
||||
query.fov,
|
||||
(F32)resolution / (F32)resolution,
|
||||
1.0f,
|
||||
query.nearPlane,
|
||||
query.farPlane,
|
||||
query.cameraMatrix);
|
||||
|
|
@ -962,6 +962,8 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe, bool writeFiles)
|
|||
IBLUtilities::GenerateIrradianceMap(renderTarget, cubeRefl.getCubemap(), clientProbe->mIrridianceMap->mCubemap);
|
||||
IBLUtilities::GeneratePrefilterMap(renderTarget, cubeRefl.getCubemap(), prefilterMipLevels, clientProbe->mPrefilterMap->mCubemap);
|
||||
|
||||
renderTarget->destroySelf();
|
||||
|
||||
U32 endMSTime = Platform::getRealMilliseconds();
|
||||
F32 diffTime = F32(endMSTime - startMSTime);
|
||||
Con::warnf("RenderProbeMgr::bake() - Finished Capture! Took %g milliseconds", diffTime);
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ void RenderTranslucentMgr::render( SceneRenderState *state )
|
|||
if (passRI->accuTex != lastAccuTex)
|
||||
{
|
||||
sgData.accuTex = passRI->accuTex;
|
||||
lastAccuTex = lastAccuTex;
|
||||
lastAccuTex = passRI->accuTex;
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ struct WaterFogData
|
|||
densityOffset = 0.0f;
|
||||
wetDepth = 0.0f;
|
||||
wetDarkening = 0.0f;
|
||||
color.set( 0.5f, 0.5f, 0.5f, 1.0f );
|
||||
color = ColorI(128, 128, 128, 128);
|
||||
plane.set( 0.0f, 0.0f, 1.0f, 1e10 ); // Default to global bounds distance
|
||||
depthGradMax = 0.0f;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _FOGSTRUCTS_H_
|
||||
#endif // _FOGSTRUCTS_H_
|
||||
|
|
|
|||
|
|
@ -1704,7 +1704,7 @@ void SceneObject::updateRenderChangesByParent(){
|
|||
// This is needed by objects that update their own render transform thru interpolate tick
|
||||
// Mostly for stationary objects.
|
||||
|
||||
if (getClassName() == "Player")
|
||||
if (getClassName() == StringTable->insert("Player"))
|
||||
mat.mul(offset,getRenderTransform());
|
||||
else
|
||||
mat.mul(offset,getTransform());
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ SFXSound* SFXSound::_create( SFXDevice* device,
|
|||
SFXBuffer* buffer = SFX->_createBuffer( stream, description );
|
||||
if( !buffer )
|
||||
{
|
||||
source->deleteObject();
|
||||
SAFE_DELETE_OBJECT(source);
|
||||
|
||||
Con::errorf( "SFXSound::_create() - Could not create device buffer!" );
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -185,6 +185,8 @@ bool CustomShaderFeatureData::hasFeature(String name)
|
|||
if (GFX->getAdapterType() == GFXAdapterType::OpenGL)
|
||||
return mFeatureGLSL->hasFeature(name);
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CustomShaderFeatureData::writeLine(String format, S32 argc, ConsoleValueRef* argv)
|
||||
|
|
|
|||
|
|
@ -141,16 +141,13 @@ void ShaderGen::generateShader( const MaterialFeatureData &featureData,
|
|||
F32 *pixVersion,
|
||||
const GFXVertexFormat *vertexFormat,
|
||||
const char* cacheName,
|
||||
Vector<GFXShaderMacro> ¯os,
|
||||
Vector<CustomShaderFeatureData*> &customFeatureData)
|
||||
Vector<GFXShaderMacro> ¯os)
|
||||
{
|
||||
PROFILE_SCOPE( ShaderGen_GenerateShader );
|
||||
|
||||
mFeatureData = featureData;
|
||||
mVertexFormat = vertexFormat;
|
||||
|
||||
mCustomFeaturesData = customFeatureData;
|
||||
|
||||
_uninit();
|
||||
_init();
|
||||
|
||||
|
|
@ -290,44 +287,6 @@ void ShaderGen::_processVertFeatures( Vector<GFXShaderMacro> ¯os, bool macro
|
|||
}
|
||||
}
|
||||
|
||||
//Handle if we have any custom features
|
||||
if (!mCustomFeaturesData.empty())
|
||||
{
|
||||
for (U32 i = 0; i < mCustomFeaturesData.size(); ++i)
|
||||
{
|
||||
#ifdef TORQUE_D3D11
|
||||
if (GFX->getAdapterType() == GFXAdapterType::Direct3D11)
|
||||
{
|
||||
mCustomFeaturesData[i]->mFeatureHLSL->processVert(mComponents, mFeatureData);
|
||||
|
||||
String line = String::ToString(" // %s\r\n", mCustomFeaturesData[i]->mFeatureHLSL->getName().c_str());
|
||||
mOutput->addStatement(new GenOp(line));
|
||||
|
||||
if (mCustomFeaturesData[i]->mFeatureHLSL->getOutput())
|
||||
mOutput->addStatement(mCustomFeaturesData[i]->mFeatureHLSL->getOutput());
|
||||
|
||||
mCustomFeaturesData[i]->mFeatureHLSL->reset();
|
||||
mOutput->addStatement(new GenOp(" \r\n"));
|
||||
}
|
||||
#endif
|
||||
#ifdef TORQUE_OPENGL
|
||||
if (GFX->getAdapterType() == GFXAdapterType::OpenGL)
|
||||
{
|
||||
mCustomFeaturesData[i]->mFeatureGLSL->processVert(mComponents, mFeatureData);
|
||||
|
||||
String line = String::ToString(" // %s\r\n", mCustomFeaturesData[i]->mFeatureGLSL->getName().c_str());
|
||||
mOutput->addStatement(new GenOp(line));
|
||||
|
||||
if (mCustomFeaturesData[i]->mFeatureGLSL->getOutput())
|
||||
mOutput->addStatement(mCustomFeaturesData[i]->mFeatureGLSL->getOutput());
|
||||
|
||||
mCustomFeaturesData[i]->mFeatureGLSL->reset();
|
||||
mOutput->addStatement(new GenOp(" \r\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
ShaderConnector *connect = dynamic_cast<ShaderConnector *>( mComponents[C_CONNECTOR] );
|
||||
connect->sortVars();
|
||||
}
|
||||
|
|
@ -367,44 +326,6 @@ void ShaderGen::_processPixFeatures( Vector<GFXShaderMacro> ¯os, bool macros
|
|||
mOutput->addStatement( new GenOp( " \r\n" ) );
|
||||
}
|
||||
}
|
||||
|
||||
//Handle if we have any custom features
|
||||
if (!mCustomFeaturesData.empty())
|
||||
{
|
||||
for (U32 i = 0; i < mCustomFeaturesData.size(); ++i)
|
||||
{
|
||||
#ifdef TORQUE_D3D11
|
||||
if (GFX->getAdapterType() == GFXAdapterType::Direct3D11)
|
||||
{
|
||||
mCustomFeaturesData[i]->mFeatureHLSL->processPix(mComponents, mFeatureData);
|
||||
|
||||
String line = String::ToString(" // %s\r\n", mCustomFeaturesData[i]->mFeatureHLSL->getName().c_str());
|
||||
mOutput->addStatement(new GenOp(line));
|
||||
|
||||
if (mCustomFeaturesData[i]->mFeatureHLSL->getOutput())
|
||||
mOutput->addStatement(mCustomFeaturesData[i]->mFeatureHLSL->getOutput());
|
||||
|
||||
mCustomFeaturesData[i]->mFeatureHLSL->reset();
|
||||
mOutput->addStatement(new GenOp(" \r\n"));
|
||||
}
|
||||
#endif
|
||||
#ifdef TORQUE_OPENGL
|
||||
if (GFX->getAdapterType() == GFXAdapterType::OpenGL)
|
||||
{
|
||||
mCustomFeaturesData[i]->mFeatureGLSL->processPix(mComponents, mFeatureData);
|
||||
|
||||
String line = String::ToString(" // %s\r\n", mCustomFeaturesData[i]->mFeatureGLSL->getName().c_str());
|
||||
mOutput->addStatement(new GenOp(line));
|
||||
|
||||
if (mCustomFeaturesData[i]->mFeatureGLSL->getOutput())
|
||||
mOutput->addStatement(mCustomFeaturesData[i]->mFeatureGLSL->getOutput());
|
||||
|
||||
mCustomFeaturesData[i]->mFeatureGLSL->reset();
|
||||
mOutput->addStatement(new GenOp(" \r\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
ShaderConnector *connect = dynamic_cast<ShaderConnector *>( mComponents[C_CONNECTOR] );
|
||||
connect->sortVars();
|
||||
|
|
@ -528,7 +449,7 @@ void ShaderGen::_printPixShader( Stream &stream )
|
|||
mPrinter->printPixelShaderCloser(stream);
|
||||
}
|
||||
|
||||
GFXShader* ShaderGen::getShader( const MaterialFeatureData &featureData, Vector<CustomShaderFeatureData*> &customFeatureData, const GFXVertexFormat *vertexFormat, const Vector<GFXShaderMacro> *macros, const Vector<String> &samplers )
|
||||
GFXShader* ShaderGen::getShader( const MaterialFeatureData &featureData, const GFXVertexFormat *vertexFormat, const Vector<GFXShaderMacro> *macros, const Vector<String> &samplers )
|
||||
{
|
||||
PROFILE_SCOPE( ShaderGen_GetShader );
|
||||
|
||||
|
|
@ -568,7 +489,7 @@ GFXShader* ShaderGen::getShader( const MaterialFeatureData &featureData, Vector<
|
|||
shaderMacros.push_back( GFXShaderMacro( "TORQUE_SHADERGEN" ) );
|
||||
if ( macros )
|
||||
shaderMacros.merge( *macros );
|
||||
generateShader( featureData, vertFile, pixFile, &pixVersion, vertexFormat, cacheKey, shaderMacros, customFeatureData );
|
||||
generateShader( featureData, vertFile, pixFile, &pixVersion, vertexFormat, cacheKey, shaderMacros );
|
||||
|
||||
GFXShader *shader = GFX->createShader();
|
||||
if (!shader->init(vertFile, pixFile, pixVersion, shaderMacros, samplers, &mInstancingFormat))
|
||||
|
|
|
|||
|
|
@ -47,10 +47,6 @@
|
|||
#include "materials/materialFeatureData.h"
|
||||
#endif
|
||||
|
||||
#ifndef CUSTOMSHADERFEATURE_H
|
||||
#include "shadergen/customShaderFeature.h"
|
||||
#endif
|
||||
|
||||
/// Base class used by shaderGen to be API agnostic. Subclasses implement the various methods
|
||||
/// in an API specific way.
|
||||
class ShaderGenPrinter
|
||||
|
|
@ -155,11 +151,10 @@ public:
|
|||
F32 *pixVersion,
|
||||
const GFXVertexFormat *vertexFormat,
|
||||
const char* cacheName,
|
||||
Vector<GFXShaderMacro> ¯os,
|
||||
Vector<CustomShaderFeatureData*> &customFeatureData);
|
||||
Vector<GFXShaderMacro> ¯os);
|
||||
|
||||
// Returns a shader that implements the features listed by dat.
|
||||
GFXShader* getShader( const MaterialFeatureData &dat, Vector<CustomShaderFeatureData*> &customFeatureData, const GFXVertexFormat *vertexFormat, const Vector<GFXShaderMacro> *macros, const Vector<String> &samplers );
|
||||
GFXShader* getShader( const MaterialFeatureData &dat, const GFXVertexFormat *vertexFormat, const Vector<GFXShaderMacro> *macros, const Vector<String> &samplers );
|
||||
|
||||
// This will delete all of the procedural shaders that we have. Used to regenerate shaders when
|
||||
// the ShaderFeatures have changed (due to lighting system change, or new plugin)
|
||||
|
|
@ -181,8 +176,6 @@ protected:
|
|||
|
||||
Vector< ShaderComponent *> mComponents;
|
||||
|
||||
Vector< CustomShaderFeatureData* > mCustomFeaturesData;
|
||||
|
||||
AutoPtr<ShaderGenPrinter> mPrinter;
|
||||
AutoPtr<ShaderGenComponentFactory> mComponentFactory;
|
||||
|
||||
|
|
|
|||
|
|
@ -863,7 +863,7 @@ public:
|
|||
void setScopeObject(NetObject *object);
|
||||
|
||||
/// Get the object around which we are currently scoping network traffic.
|
||||
NetObject* getScopeObject() {};
|
||||
NetObject* getScopeObject() { return nullptr; };
|
||||
|
||||
/// Add an object to scope.
|
||||
void objectInScope(NetObject *object);
|
||||
|
|
|
|||
|
|
@ -482,8 +482,6 @@ bool TerrainCellMaterial::_createPass( Vector<MaterialInfo*> *materials,
|
|||
featureData.features = features;
|
||||
featureData.materialFeatures = features;
|
||||
|
||||
Vector<CustomShaderFeatureData*> customFeatures;
|
||||
|
||||
// Check to see how many vertex shader output
|
||||
// registers we're gonna need.
|
||||
U32 numTex = 0;
|
||||
|
|
@ -526,7 +524,7 @@ bool TerrainCellMaterial::_createPass( Vector<MaterialInfo*> *materials,
|
|||
const bool logErrors = true;// matCount == 1;
|
||||
GFXShader::setLogging( logErrors, true );
|
||||
|
||||
pass->shader = SHADERGEN->getShader( featureData, customFeatures, getGFXVertexFormat<TerrVertex>(), NULL, mSamplerNames );
|
||||
pass->shader = SHADERGEN->getShader( featureData, getGFXVertexFormat<TerrVertex>(), NULL, mSamplerNames );
|
||||
}
|
||||
|
||||
// If we got a shader then we can continue.
|
||||
|
|
|
|||
|
|
@ -770,6 +770,8 @@ static void conditioner_createDefaultClip(domCOLLADA* root)
|
|||
|
||||
static void conditioner_fixupAnimation(domAnimation* anim)
|
||||
{
|
||||
S32 visibilityLen = dStrlen("/visibility");
|
||||
|
||||
for (S32 iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) {
|
||||
|
||||
// Get the animation elements: <channel>, <sampler>
|
||||
|
|
@ -815,7 +817,7 @@ static void conditioner_fixupAnimation(domAnimation* anim)
|
|||
|
||||
// Get parent SID string
|
||||
char *parentSID = dStrdup(channel->getTarget());
|
||||
parentSID[dStrlen(parentSID) - dStrlen("/visibility")] = '\0';
|
||||
parentSID[dStrlen(parentSID) - visibilityLen] = '\0';
|
||||
|
||||
// Find the parent element (should be a <node>)
|
||||
daeSIDResolver parentResolver(channel, parentSID);
|
||||
|
|
@ -3039,4 +3041,4 @@ void ColladaUtils::ExportData::processData()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ void TSShapeInstance::dumpNode(Stream & stream ,S32 level, S32 nodeIndex, Vector
|
|||
if (objectList.size() == 0)
|
||||
dumpLine("\r\n");
|
||||
|
||||
S32 nodeNameLen = dStrlen(nodeName);
|
||||
S32 spaceCount = -1;
|
||||
for (S32 j=0;j<objectList.size(); j++)
|
||||
{
|
||||
|
|
@ -101,7 +102,7 @@ void TSShapeInstance::dumpNode(Stream & stream ,S32 level, S32 nodeIndex, Vector
|
|||
|
||||
// how many spaces should we prepend if we have another object on this node
|
||||
if (spaceCount<0)
|
||||
spaceCount = (S32)(dStrlen(space) + dStrlen(nodeName));
|
||||
spaceCount = (S32)(dStrlen(space) + nodeNameLen);
|
||||
|
||||
if(spaceCount > 2000)
|
||||
spaceCount = 2000;
|
||||
|
|
|
|||
|
|
@ -424,6 +424,8 @@ bool TSShapeConstructor::onAdd()
|
|||
group = new SimGroup();
|
||||
if ( !group->registerObject("TSShapeConstructorGroup") )
|
||||
{
|
||||
SAFE_DELETE(group);
|
||||
|
||||
Con::errorf("TSShapeConstructor::onAdd failed: Could not register "
|
||||
"TSShapeConstructorGroup");
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue