bool LightningData::preload(bool server, String &errorStr) { if (Parent::preload(server, errorStr) == false) return false; dQsort(thunderSounds, MaxThunders, sizeof(SFXTrack*), cmpSounds); for (numThunders = 0; numThunders < MaxThunders && thunderSounds[numThunders] != NULL; numThunders++) { // } if (server == false) { String sfxErrorStr; for (U32 i = 0; i < MaxThunders; i++) { if( !sfxResolve( &thunderSounds[ i ], sfxErrorStr ) ) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); } if( !sfxResolve( &strikeSound, sfxErrorStr ) ) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); for (U32 i = 0; i < MaxTextures; i++) { if (strikeTextureNames[i][0]) strikeTextures[i] = GFXTexHandle(strikeTextureNames[i], &GFXDefaultStaticDiffuseProfile, avar("%s() - strikeTextures[%d] (line %d)", __FUNCTION__, i, __LINE__)); } } return true; }
bool ProjectileData::preload(bool server, String &errorStr) { if (Parent::preload(server, errorStr) == false) return false; if( !server ) { if (!particleEmitter && particleEmitterId != 0) if (Sim::findObject(particleEmitterId, particleEmitter) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(particleEmitter): %d", particleEmitterId); if (!particleWaterEmitter && particleWaterEmitterId != 0) if (Sim::findObject(particleWaterEmitterId, particleWaterEmitter) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(particleWaterEmitter): %d", particleWaterEmitterId); if (!explosion && explosionId != 0) if (Sim::findObject(explosionId, explosion) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(explosion): %d", explosionId); if (!waterExplosion && waterExplosionId != 0) if (Sim::findObject(waterExplosionId, waterExplosion) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(waterExplosion): %d", waterExplosionId); if (!splash && splashId != 0) if (Sim::findObject(splashId, splash) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(splash): %d", splashId); if (!decal && decalId != 0) if (Sim::findObject(decalId, decal) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId); String sfxErrorStr; if( !sfxResolve( &sound, sfxErrorStr ) ) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet: %s", sfxErrorStr.c_str()); if (!lightDesc && lightDescId != 0) if (Sim::findObject(lightDescId, lightDesc) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockid(lightDesc): %d", lightDescId); } if (projectileShapeName && projectileShapeName[0] != '\0') { projectileShape = ResourceManager::get().load(projectileShapeName); if (bool(projectileShape) == false) { errorStr = String::ToString("ProjectileData::load: Couldn't load shape \"%s\"", projectileShapeName); return false; } activateSeq = projectileShape->findSequence("activate"); maintainSeq = projectileShape->findSequence("maintain"); } if (bool(projectileShape)) // create an instance to preload shape data { TSShapeInstance* pDummy = new TSShapeInstance(projectileShape, !server); delete pDummy; } return true; }
bool SFXTrack::preload( bool server, String& errorStr ) { if( !Parent::preload( server, errorStr ) ) return false; if( !server ) { if( !sfxResolve( &mDescription, errorStr ) ) return false; } return true; }
bool ProximityMineData::preload( bool server, String& errorStr ) { if ( Parent::preload( server, errorStr ) == false ) return false; if ( !server ) { // Resolve sounds if( !sfxResolve( &armingSound, errorStr ) ) Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", errorStr.c_str() ); if( !sfxResolve( &triggerSound, errorStr ) ) Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", errorStr.c_str() ); } if ( mShape ) { // Lookup animation sequences armingSequence = mShape->findSequence( "armed" ); triggerSequence = mShape->findSequence( "triggered" ); } return true; }
bool SFXPlayList::preload( bool server, String& errorStr ) { if( !Parent::preload( server, errorStr ) ) return false; validate(); // Resolve SFXTracks and SFXStates on client. if( !server ) { for( U32 i = 0; i < NUM_SLOTS; ++ i ) { if( !sfxResolve( &mSlots.mTrack[ i ], errorStr ) ) return false; if( !sfxResolve( &mSlots.mState[ i ], errorStr ) ) return false; } } return true; }