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

Method writeField

Engine/source/ts/tsShapeConstruct.cpp:581–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579// Storage
580
581bool TSShapeConstructor::writeField(StringTableEntry fieldname, const char* value)
582{
583 // Ignore the sequence fields (these are written as 'addSequence' commands instead)
584 if (dStrnicmp(fieldname, "sequence", 8) == 0)
585 return false;
586 else if (dStrnicmp(fieldname, "baseShape", 9) == 0)
587 {
588 // Small hack to only write the base filename (no path) since the
589 // TSShapeConstructor script must be in the same folder as the model, and
590 // then we can easily copy both around without having to change the field
591 const char* filename = dStrrchr(value, '/');
592 if (filename > value)
593 {
594 S32 len = dStrlen(filename);
595 dMemmove((void*)(value + 1), filename, len);
596 ((char*)value)[0] = '.';
597 ((char*)value)[len + 1] = '\0';
598 }
599 return true;
600 }
601
602 return Parent::writeField(fieldname, value);
603}
604
605//-----------------------------------------------------------------------------
606// 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