blob: b5093c52a3c5683e1187b9eaf9c4eeee45d25b3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#include "common.h"
#include "patcher.h"
#include "AudioScriptObject.h"
#include "Pools.h"
#include "DMAudio.h"
WRAPPER void cAudioScriptObject::SaveAllAudioScriptObjects(uint8 *buf, uint32 *size) { EAXJMP(0x57c460); }
void
cAudioScriptObject::Reset()
{
AudioId = 125;
Posn = CVector(0.0f, 0.0f, 0.0f);
AudioEntity = AEHANDLE_NONE;
}
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);
}
void
PlayOneShotScriptObject(uint8 id, CVector const &pos)
{
cAudioScriptObject *audioScriptObject = new cAudioScriptObject();
audioScriptObject->Posn = pos;
audioScriptObject->AudioId = id;
audioScriptObject->AudioEntity = AEHANDLE_NONE;
DMAudio.CreateOneShotScriptObject(audioScriptObject);
}
STARTPATCHES
InjectHook(0x57C430, &cAudioScriptObject::Reset, PATCH_JUMP);
InjectHook(0x57C5F0, &PlayOneShotScriptObject, PATCH_JUMP);
ENDPATCHES
|