summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-07-20 17:00:57 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-07-20 17:00:57 +0200
commita951996943382bc0952f19409bb5fa738f3cd58f (patch)
treee6074b3a771d6d85f7d4031b4e765ee6240b52c8 /src/audio
parentMerge pull request #155 from ThirteenAG/master (diff)
downloadre3-a951996943382bc0952f19409bb5fa738f3cd58f.tar
re3-a951996943382bc0952f19409bb5fa738f3cd58f.tar.gz
re3-a951996943382bc0952f19409bb5fa738f3cd58f.tar.bz2
re3-a951996943382bc0952f19409bb5fa738f3cd58f.tar.lz
re3-a951996943382bc0952f19409bb5fa738f3cd58f.tar.xz
re3-a951996943382bc0952f19409bb5fa738f3cd58f.tar.zst
re3-a951996943382bc0952f19409bb5fa738f3cd58f.zip
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/AudioManager.cpp6
-rw-r--r--src/audio/AudioManager.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 07469b87..368c08e8 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -13,6 +13,7 @@
#include "Physical.h"
#include "Plane.h"
#include "PlayerPed.h"
+#include "Pools.h"
#include "SampleManager.h"
#include "Stats.h"
#include "Vehicle.h"
@@ -94,6 +95,11 @@ enum eVehicleModel {
CAR159,
};
+void *cAudioScriptObject::operator new(size_t sz) { return CPools::GetAudioScriptObjectPool()->New(); }
+void *cAudioScriptObject::operator new(size_t sz, int handle) { return CPools::GetAudioScriptObjectPool()->New(handle); }
+void cAudioScriptObject::operator delete(void *p, size_t sz) { CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject*)p); }
+void cAudioScriptObject::operator delete(void *p, int handle) { CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject*)p); }
+
cAudioManager &AudioManager = *(cAudioManager *)0x880FC0;
constexpr int totalAudioEntitiesSlots = 200;
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 8e8a1d1d..1ae50b2f 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -178,6 +178,11 @@ struct cAudioScriptObject {
char gap_2[2];
CVector m_vecPos;
int m_nAudioEntityId;
+
+ static void *operator new(size_t);
+ static void *operator new(size_t, int);
+ static void operator delete(void*, size_t);
+ static void operator delete(void*, int);
};
static_assert(sizeof(cAudioScriptObject) == 0x14, "cAudioScriptObject: error");