don't allow Load() on copies
This commit is contained in:
@@ -113,7 +113,6 @@ RageSound::RageSound(const RageSound &cpy)
|
|||||||
original = cpy.original;
|
original = cpy.original;
|
||||||
full_buf = cpy.full_buf;
|
full_buf = cpy.full_buf;
|
||||||
big = cpy.big;
|
big = cpy.big;
|
||||||
m_sFilePath = cpy.m_sFilePath;
|
|
||||||
m_StartSample = cpy.m_StartSample;
|
m_StartSample = cpy.m_StartSample;
|
||||||
m_LengthSamples = cpy.m_LengthSamples;
|
m_LengthSamples = cpy.m_LengthSamples;
|
||||||
Loop = cpy.Loop;
|
Loop = cpy.Loop;
|
||||||
@@ -131,6 +130,10 @@ RageSound::RageSound(const RageSound &cpy)
|
|||||||
Load(cpy.GetLoadedFilePath(), false);
|
Load(cpy.GetLoadedFilePath(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Load() won't work on a copy if m_sFilePath is already set, so
|
||||||
|
* copy this down here. */
|
||||||
|
m_sFilePath = cpy.m_sFilePath;
|
||||||
|
|
||||||
/* Register ourselves, so we receive Update()s. */
|
/* Register ourselves, so we receive Update()s. */
|
||||||
SOUNDMAN->all_sounds.insert(this);
|
SOUNDMAN->all_sounds.insert(this);
|
||||||
}
|
}
|
||||||
@@ -154,7 +157,7 @@ void RageSound::Load(CString sSoundFilePath, bool cache)
|
|||||||
LOG->Trace( "RageSound::LoadSound( '%s' )", sSoundFilePath.GetString() );
|
LOG->Trace( "RageSound::LoadSound( '%s' )", sSoundFilePath.GetString() );
|
||||||
|
|
||||||
/* Don't load over copies. */
|
/* Don't load over copies. */
|
||||||
// ASSERT(original == this);
|
ASSERT(original == this || m_sFilePath == "");
|
||||||
|
|
||||||
Unload();
|
Unload();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user