1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Convert many of the now-deprecated plString::Format calls to plFormat

This commit is contained in:
2014-05-24 23:46:54 -07:00
parent 89a9bbb3c4
commit 1debf8180b
98 changed files with 404 additions and 413 deletions

View File

@ -411,7 +411,7 @@ plVoiceSound::plVoiceSound()
fEAXSettings.SetRoomParams(-1200, -100, 0, 0);
fLastUpdate = 0;
plString keyName = plString::Format("VoiceSound_%d", fCount);
plString keyName = plFormat("VoiceSound_{}", fCount);
fCount++;
hsgResMgr::ResMgr()->NewKey(keyName, this, plLocation::kGlobalFixedLoc);
}

View File

@ -160,7 +160,7 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
// We need it to be resident to read in
if( retVal == plSoundBuffer::kError)
{
plString str = plString::Format("Unable to open .wav file %s", fDataBufferKey ? fDataBufferKey->GetName().c_str() : "nil");
plString str = plFormat("Unable to open .wav file {}", fDataBufferKey ? fDataBufferKey->GetName() : "nil");
IPrintDbgMessage( str.c_str(), true );
fFailed = true;
return false;
@ -211,9 +211,10 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), true );
if( !fDSoundBuffer->IsValid() )
{
char str[256];
sprintf(str, "Can't create sound buffer for %s.wav. This could happen if the wav file is a stereo file. Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.", GetFileName().AsString().c_str());
IPrintDbgMessage( str, true );
plString str = plFormat("Can't create sound buffer for {}.wav. This could happen if the wav file is a stereo file."
" Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true;
delete fDSoundBuffer;
@ -228,14 +229,14 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
IFillCurrentSound( 0 );
// Logging
plString str = plString::Format(" Grouped %s %s allocated (%d msec).", buffer->GetFileName().IsValid() ? "file" : "buffer",
buffer->GetFileName().IsValid() ? buffer->GetFileName().AsString().c_str() : buffer->GetKey()->GetUoid().GetObjectName().c_str(),
//fDSoundBuffer->IsHardwareAccelerated() ? "hardware" : "software",
//fDSoundBuffer->IsStaticVoice() ? "static" : "dynamic",
plString str = plFormat(" Grouped {} {} allocated ({} msec).", buffer->GetFileName().IsValid() ? "file" : "buffer",
buffer->GetFileName().IsValid() ? buffer->GetFileName() : buffer->GetKeyName(),
//fDSoundBuffer->IsHardwareAccelerated() ? "hardware" : "software",
//fDSoundBuffer->IsStaticVoice() ? "static" : "dynamic",
#ifdef PL_PROFILE_ENABLED
gProfileVarStaticSndShoveTime.GetValue() );
gProfileVarStaticSndShoveTime.GetValue());
#else
0 );
0);
#endif
IPrintDbgMessage( str.c_str() );
if( GetKey() != nil && GetKeyName().Find( "Footstep" ) >= 0 )

View File

@ -115,7 +115,7 @@ bool plWin32StaticSound::LoadSound( bool is3D )
if( retVal == plSoundBuffer::kError )
{
plString str = plString::Format( "Unable to open .wav file %s", fDataBufferKey ? fDataBufferKey->GetName().c_str() : "nil");
plString str = plFormat("Unable to open .wav file {}", fDataBufferKey ? fDataBufferKey->GetName() : "nil");
IPrintDbgMessage( str.c_str(), true );
fFailed = true;
return false;
@ -143,9 +143,10 @@ bool plWin32StaticSound::LoadSound( bool is3D )
fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), tryStatic );
if( !fDSoundBuffer->IsValid() )
{
char str[256];
sprintf(str, "Can't create sound buffer for %s.wav. This could happen if the wav file is a stereo file. Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.", GetFileName().AsString().c_str());
IPrintDbgMessage( str, true );
plString str = plFormat("Can't create sound buffer for {}.wav. This could happen if the wav file is a stereo file."
" Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true;
delete fDSoundBuffer;

View File

@ -195,7 +195,7 @@ plSoundBuffer::ELoadReturnVal plWin32StreamingSound::IPreLoadBuffer( bool playWh
return plSoundBuffer::kError;
}
IPrintDbgMessage(plString::Format(" Readied file %s for streaming", fSrcFilename.AsString().c_str()).c_str());
IPrintDbgMessage(plFormat(" Readied file {} for streaming", fSrcFilename).c_str());
// dont free sound data until we have a chance to use it in load sound
@ -251,8 +251,8 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
if( retVal == plSoundBuffer::kError )
{
plString str = plString::Format( "Unable to open streaming source %s",
fDataBufferKey->GetName().c_str() );
plString str = plFormat("Unable to open streaming source {}",
fDataBufferKey->GetName());
IPrintDbgMessage( str.c_str(), true );
fFailed = true;
return false;
@ -282,9 +282,9 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
delete fDSoundBuffer;
fDSoundBuffer = nil;
plString str = plString::Format("Can't create sound buffer for %s.wav. This could happen if the wav file is a stereo file."
" Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
GetFileName().AsString().c_str());
plString str = plFormat("Can't create sound buffer for {}.wav. This could happen if the wav file is a stereo file."
" Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true;
return false;
@ -337,7 +337,7 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
IRefreshEAXSettings( true );
// Debug info
plString dbg = plString::Format(" Streaming %s.", fSrcFilename.AsString().c_str());
plString dbg = plFormat(" Streaming {}.", fSrcFilename);
IPrintDbgMessage(dbg.c_str());
plStatusLog::AddLineS( "audioTimes.log", 0xffffffff, "Streaming %4.2f secs of %s",