Registers a particle and returns its ID.
413 {
416
419
420 string path =
string.
Format(
"%1%2", root_path, file_name);
421 string fullPath =
string.
Format(
"%1.ptc",
path);
422
424 {
425 string devMsgSuffix;
426 #ifdef DEVELOPER
427 devMsgSuffix = " Then rebuild 'scripts' and 'graphics' PBOs.";
428 #endif
429 ErrorEx(
string.Format(
"Particle file not found! <%1> Correct path to this particle in script file ParticleList.c!%2",
431
432 }
433
434 int existingNameId;
436 {
437 int existingPathId;
439 {
440 if (existingNameId == existingPathId)
441 {
442 return existingNameId;
443 }
444 else
445 {
446 ErrorEx(
string.Format(
"ParticleNames and ParticlePaths array are containing conflicting data. ID %1 vs ID %2", existingNameId, existingPathId));
447 }
448 }
449 else
450 {
451 ErrorEx(
string.Format(
"Duplicate particle filename: %1; GetParticleIDByName will only work with the first path if there are two different paths.", file_name),
ErrorExSeverity.WARNING);
452 }
453 }
454 else
455 {
457 }
458
462 }
static ref map< int, string > m_ParticlePaths
static ref map< string, int > m_ParticleNames
proto bool FileExist(string name)
Check existence of file.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.