From: Arianna B. <ar...@us...> - 2006-01-22 17:23:24
|
Update of /cvsroot/planeshift/planeshift/src/common/effects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8602 Modified Files: pseffectobjsound.cpp Log Message: Fixed crash in client Index: pseffectobjsound.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/effects/pseffectobjsound.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pseffectobjsound.cpp 15 Jan 2006 21:49:31 -0000 1.19 --- pseffectobjsound.cpp 22 Jan 2006 17:23:16 -0000 1.20 *************** *** 125,177 **** effectID += nextUniqueID++; ! if (!sndStream.IsValid() && soundmanager->PlayingActions()) { ! sndStream = soundmanager->GetSoundSystem()->CreateStream(sndData, CS_SND3D_RELATIVE); ! if (!sndStream.IsValid()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create stream for sound: %s\n", soundName.GetData()); ! return false; ! } ! } ! if (!sndSource.IsValid()) ! { ! if (!soundmanager->GetSoundSystem()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create %s effect obj sound source. Sound system not found.\n", name.GetData()); ! return false; ! } ! csRef<SOUND_SOURCE_TYPE> src = soundmanager->GetSoundSystem()->CreateSource(sndStream); ! if (!src.IsValid()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create %s effect obj sound source.\n", name.GetData()); ! return false; ! } ! sndSource=SCF_QUERY_INTERFACE(src, SOUND_SOURCE3D_TYPE); ! if (!sndSource.IsValid()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create %s effect obj sound 3D source.\n", name.GetData()); ! return false; ! } ! } ! // Setup looping on the stream ! if (loop) ! sndStream->SetLoopState(CS_SNDSYS_STREAM_LOOP); ! else ! sndStream->SetLoopState(CS_SNDSYS_STREAM_DONTLOOP); ! volumeMultiplier = soundmanager->GetActionsVolume(); ! sndSource->SetVolume(volumeMultiplier); ! sndSource->SetPosition(csVector3(0,0,0)); ! sndSource->SetMinimumDistance(sqrt(minDistSquared)); ! sndSource->SetMaximumDistance(sqrt(maxDistSquared)); ! isAlive = false; ! return true; } --- 125,181 ---- effectID += nextUniqueID++; ! if (soundmanager->PlayingActions()) { ! if (!sndStream.IsValid()) ! { ! sndStream = soundmanager->GetSoundSystem()->CreateStream(sndData, CS_SND3D_RELATIVE); ! if (!sndStream.IsValid()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create stream for sound: %s\n", soundName.GetData()); ! return false; ! } ! } ! if (!sndSource.IsValid()) ! { ! if (!soundmanager->GetSoundSystem()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create %s effect obj sound source. Sound system not found.\n", name.GetData()); ! return false; ! } ! csRef<SOUND_SOURCE_TYPE> src = soundmanager->GetSoundSystem()->CreateSource(sndStream); ! if (!src.IsValid()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create %s effect obj sound source.\n", name.GetData()); ! return false; ! } ! sndSource=SCF_QUERY_INTERFACE(src, SOUND_SOURCE3D_TYPE); ! if (!sndSource.IsValid()) ! { ! csReport(psCSSetup::object_reg, CS_REPORTER_SEVERITY_ERROR, "planeshift_effects", "Could not create %s effect obj sound 3D source.\n", name.GetData()); ! return false; ! } ! } ! // Setup looping on the stream ! if (loop) ! sndStream->SetLoopState(CS_SNDSYS_STREAM_LOOP); ! else ! sndStream->SetLoopState(CS_SNDSYS_STREAM_DONTLOOP); ! volumeMultiplier = soundmanager->GetActionsVolume(); ! sndSource->SetVolume(volumeMultiplier); ! sndSource->SetPosition(csVector3(0,0,0)); ! sndSource->SetMinimumDistance(sqrt(minDistSquared)); ! sndSource->SetMaximumDistance(sqrt(maxDistSquared)); ! isAlive = false; ! return true; ! } ! return false; } |