void MPLoadMap::seedFromFile( const char* pFileName ) { FullPathFileName path; path.init( missionPath, pFileName, ".csv" ); CSVFile file; if ( NO_ERR != file.open( path ) ) { Assert( 0, 0, "couldn't open multiplayer mission .csv file" ); return; } int i = 1; char fileName[255]; while( true ) { if ( NO_ERR != file.readString( i, 1, fileName, 255 ) ) break; path.init( missionPath, fileName, ".fit" ); if ( fileExists( path ) ) { addFile( fileName, false ); } i++; } }
//--------------------------------------------------------------------------------- void WeaponEffects::init (char *effectCSVFileName) { FullPathFileName effectsName; effectsName.init(objectPath,effectCSVFileName,".csv"); CSVFile effectFile; long result = effectFile.open(effectsName); if (result != NO_ERR) STOP(("Unable to open Effects File %s",effectsName)); numEffects = effectFile.getNumLines() - 1; //Always subtract one for the column headers effects = (EffectData *)systemHeap->Malloc(sizeof(EffectData) * numEffects); gosASSERT(effects != NULL); for (long i=0;i<numEffects;i++) { effectFile.readString(i+2,2,effects[i].effectName,49); effectFile.readString(i+2,3,effects[i].muzzleFlashName,49); effectFile.readString(i+2,4,effects[i].hitEffectName,49); effectFile.readString(i+2,6,effects[i].missEffectName,49); effectFile.readLong(i+2,5,effects[i].effectObjNum); } }