summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioScriptObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/AudioScriptObject.cpp')
-rw-r--r--src/audio/AudioScriptObject.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/audio/AudioScriptObject.cpp b/src/audio/AudioScriptObject.cpp
index ac30f757..03efdea9 100644
--- a/src/audio/AudioScriptObject.cpp
+++ b/src/audio/AudioScriptObject.cpp
@@ -3,6 +3,7 @@
#include "AudioScriptObject.h"
#include "Pools.h"
#include "DMAudio.h"
+#include "SaveBuf.h"
cAudioScriptObject::cAudioScriptObject()
{
@@ -23,25 +24,25 @@ cAudioScriptObject::Reset()
}
void *
-cAudioScriptObject::operator new(size_t sz)
+cAudioScriptObject::operator new(size_t sz) throw()
{
return CPools::GetAudioScriptObjectPool()->New();
}
void *
-cAudioScriptObject::operator new(size_t sz, int handle)
+cAudioScriptObject::operator new(size_t sz, int handle) throw()
{
return CPools::GetAudioScriptObjectPool()->New(handle);
}
void
-cAudioScriptObject::operator delete(void *p, size_t sz)
+cAudioScriptObject::operator delete(void *p, size_t sz) throw()
{
CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject *)p);
}
void
-cAudioScriptObject::operator delete(void *p, int handle)
+cAudioScriptObject::operator delete(void *p, int handle) throw()
{
CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject *)p);
}
@@ -53,12 +54,14 @@ cAudioScriptObject::LoadAllAudioScriptObjects(uint8 *buf, uint32 size)
CheckSaveHeader(buf, 'A', 'U', 'D', '\0', size - SAVE_HEADER_SIZE);
- int32 pool_size = ReadSaveBuf<int32>(buf);
+ int32 pool_size;
+ ReadSaveBuf(&pool_size, buf);
for (int32 i = 0; i < pool_size; i++) {
- int handle = ReadSaveBuf<int32>(buf);
+ int32 handle;
+ ReadSaveBuf(&handle, buf);
cAudioScriptObject *p = new(handle) cAudioScriptObject;
assert(p != nil);
- *p = ReadSaveBuf<cAudioScriptObject>(buf);
+ ReadSaveBuf(p, buf);
p->AudioEntity = DMAudio.CreateLoopingScriptObject(p);
}