MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / writeField

Method writeField

Engine/source/scene/sceneObject.cpp:740–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738//-----------------------------------------------------------------------------
739
740bool SceneObject::writeField( StringTableEntry fieldName, const char* value )
741{
742 if( !Parent::writeField( fieldName, value ) )
743 return false;
744
745 static StringTableEntry sIsRenderEnabled = StringTable->insert( "isRenderEnabled" );
746 static StringTableEntry sIsSelectionEnabled = StringTable->insert( "isSelectionEnabled" );
747 static StringTableEntry sMountNode = StringTable->insert( "mountNode" );
748 static StringTableEntry sMountPos = StringTable->insert( "mountPos" );
749 static StringTableEntry sMountRot = StringTable->insert( "mountRot" );
750
751 // Don't write flag fields if they are at their default values.
752
753 if( fieldName == sIsRenderEnabled && dAtob( value ) )
754 return false;
755 else if( fieldName == sIsSelectionEnabled && dAtob( value ) )
756 return false;
757 else if ( mMountPID == NULL && ( fieldName == sMountNode ||
758 fieldName == sMountPos ||
759 fieldName == sMountRot ) )
760 {
761 return false;
762 }
763
764
765 return true;
766}
767
768//-----------------------------------------------------------------------------
769

Callers

nothing calls this directly

Calls 2

dAtobFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected