| 326 | } |
| 327 | |
| 328 | void Forest::createNewFile() |
| 329 | { |
| 330 | // Release the current file if we have one. |
| 331 | mData = NULL; |
| 332 | |
| 333 | // We need to construct a default file name |
| 334 | String missionName( Con::getVariable( "$Client::MissionFile" ) ); |
| 335 | String levelDirectory( Con::getVariable( "$pref::Directories::Level" ) ); |
| 336 | if ( levelDirectory.isEmpty() ) |
| 337 | { |
| 338 | levelDirectory = "levels"; |
| 339 | } |
| 340 | missionName.replace( "tools/levels", levelDirectory ); |
| 341 | missionName = Platform::makeRelativePathName(missionName, Platform::getMainDotCsDir()); |
| 342 | |
| 343 | Torque::Path basePath( missionName ); |
| 344 | String fileName = Torque::FS::MakeUniquePath( basePath.getPath(), basePath.getFileName(), "forest" ); |
| 345 | mDataFileName = StringTable->insert( fileName ); |
| 346 | |
| 347 | ForestData *file = new ForestData; |
| 348 | file->write( mDataFileName ); |
| 349 | delete file; |
| 350 | |
| 351 | mData = ResourceManager::get().load( mDataFileName ); |
| 352 | mZoningDirty = true; |
| 353 | } |
| 354 | |
| 355 | void Forest::saveDataFile( const char *path ) |
| 356 | { |
nothing calls this directly
no test coverage detected