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

Method writeField

Engine/source/ts/tsShapeConstruct.cpp:445–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443// Storage
444
445bool TSShapeConstructor::writeField(StringTableEntry fieldname, const char *value)
446{
447 // Ignore the sequence fields (these are written as 'addSequence' commands instead)
448 if ( dStrnicmp( fieldname, "sequence", 8 ) == 0 )
449 return false;
450 else if ( dStrnicmp( fieldname, "baseShape", 9 ) == 0 )
451 {
452 // Small hack to only write the base filename (no path) since the
453 // TSShapeConstructor script must be in the same folder as the model, and
454 // then we can easily copy both around without having to change the field
455 const char* filename = dStrrchr( value, '/' );
456 if ( filename > value )
457 {
458 S32 len = dStrlen( filename );
459 dMemmove((void*)(value + 1), filename, len );
460 ((char*)value)[0] = '.';
461 ((char*)value)[len + 1] = '\0';
462 }
463 return true;
464 }
465
466 return Parent::writeField( fieldname, value );
467}
468
469//-----------------------------------------------------------------------------
470// Console utility methods

Callers

nothing calls this directly

Calls 4

dStrnicmpFunction · 0.85
dStrrchrFunction · 0.50
dStrlenFunction · 0.50
dMemmoveFunction · 0.50

Tested by

no test coverage detected