| 443 | // Storage |
| 444 | |
| 445 | bool 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 |