summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-08-20 13:47:53 +0200
committerSergeanur <s.anureev@yandex.ua>2020-08-20 13:47:53 +0200
commit0f5a77129225e2ff6587941dc11661b175df1f15 (patch)
tree21ecdab66f4daef9d53f9dcd7fcf9d9c2ad4903a
parentchanged a sound enum (diff)
downloadre3-0f5a77129225e2ff6587941dc11661b175df1f15.tar
re3-0f5a77129225e2ff6587941dc11661b175df1f15.tar.gz
re3-0f5a77129225e2ff6587941dc11661b175df1f15.tar.bz2
re3-0f5a77129225e2ff6587941dc11661b175df1f15.tar.lz
re3-0f5a77129225e2ff6587941dc11661b175df1f15.tar.xz
re3-0f5a77129225e2ff6587941dc11661b175df1f15.tar.zst
re3-0f5a77129225e2ff6587941dc11661b175df1f15.zip
-rw-r--r--src/audio/AudioScriptObject.cpp10
-rw-r--r--src/audio/AudioScriptObject.h3
-rw-r--r--src/audio/DMAudio.cpp4
3 files changed, 15 insertions, 2 deletions
diff --git a/src/audio/AudioScriptObject.cpp b/src/audio/AudioScriptObject.cpp
index 69d80fbc..ac30f757 100644
--- a/src/audio/AudioScriptObject.cpp
+++ b/src/audio/AudioScriptObject.cpp
@@ -4,6 +4,16 @@
#include "Pools.h"
#include "DMAudio.h"
+cAudioScriptObject::cAudioScriptObject()
+{
+ Reset();
+};
+
+cAudioScriptObject::~cAudioScriptObject()
+{
+ Reset();
+};
+
void
cAudioScriptObject::Reset()
{
diff --git a/src/audio/AudioScriptObject.h b/src/audio/AudioScriptObject.h
index ff36474d..8110b2bb 100644
--- a/src/audio/AudioScriptObject.h
+++ b/src/audio/AudioScriptObject.h
@@ -7,6 +7,9 @@ public:
CVector Posn;
int32 AudioEntity;
+ cAudioScriptObject();
+ ~cAudioScriptObject();
+
void Reset(); /// ok
static void* operator new(size_t);
diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp
index dd55f76d..9d278046 100644
--- a/src/audio/DMAudio.cpp
+++ b/src/audio/DMAudio.cpp
@@ -203,7 +203,7 @@ cDMAudio::ReportCrime(eCrimeType crime, const CVector &pos)
int32
cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject)
{
- int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, (CPhysical *)scriptObject);
+ int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) )
AudioManager.SetEntityStatus(audioEntity, true);
@@ -220,7 +220,7 @@ cDMAudio::DestroyLoopingScriptObject(int32 audioEntity)
void
cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject)
{
- int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, (CPhysical *)scriptObject);
+ int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) )
{