File size: 3,693 Bytes
d7c5875
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
--[[
	Project: SA Memory (Available from https://blast.hk/)
	Developers: LUCHARE, FYP

	Special thanks:
		plugin-sdk (https://github.com/DK22Pac/plugin-sdk) for the structures and addresses.

	Copyright (c) 2018 BlastHack.
]]

local shared = require 'SAMemory.shared'

shared.require 'CAESound'
shared.require 'CAEAudioEntity'
shared.require 'CAETwinLoopSoundEntity'

shared.ffi.cdef[[
	typedef struct tVehicleSound
	{
    unsigned int  nIndex;
    CAESound     *pSound;
	} tVehicleSound;

	typedef struct tVehicleAudioSettings
	{
		char  nVehicleSoundType;
	  char field_1;
	  short nEngineOnSoundBankId;
	  short nEngineOffSoundBankId;
	  char  nStereo;
	  char field_7;
	  int field_8;
	  int field_C;
	  char  bHornTon;
	  char field_11[3];
	  float fHornHigh;
	  char  nDoorSound;
	  char field_19;
	  char  nRadioNum;
	  char  nRadioType;
	  char field_1C;
	  char field_1D[3];
	  float fHornVolumeDelta;
	} tVehicleAudioSettings;

	typedef struct CAEVehicleAudioEntity : CAEAudioEntity
	{
		short 									field_7C;
    char 										field_7E[2];
    tVehicleAudioSettings   settings;
    bool                    bEnabled;
    bool                    bPlayerDriver;
    bool                    bPlayerPassenger;
    bool                    bVehicleRadioPaused;
    bool                    bSoundsStopped;
    char                    nEngineState;
    char 										field_AA;
    char 										field_AB;
    int 										field_AC;
    bool                    bInhibitAccForLowSpeed;
    char 										field_B1;
    short                   nRainDropCounter;
    short 									field_B4;
    char 										gap_B6[2];
    int 										field_B8;
    char 										field_BC;
    bool                    bDisableHeliEngineSounds;
    char 										field_BE;
    bool                    bSirenOrAlarmPlaying;
    bool                    bHornPlaying;
    char 										gap_C1[3];
    float                   fSirenVolume;
    bool                    bModelWithSiren;
    char 										gap_C9[3];
    unsigned int            nBoatHitWaveLastPlayedTime;
    unsigned int            nTimeToInhibitAcc;
    unsigned int            nTimeToInhibitCrz;
    float                   fGeneralVehicleSoundVolume;
    short                   nEngineDecelerateSoundBankId;
    short                   nEngineAccelerateSoundBankId;
    short                   nEngineBankSlotId;
    short 									field_E2;
    tVehicleSound           aEngineSounds[12];
    int 										field_144;
    short 									field_148;
    short 									field_14A;
    short 									field_14C;
    short 									field_14E;
    int 										field_150;
    short 									field_154;
    short                   nSkidSoundType;
    CAESound 								*field_158;
    short                   nRoadNoiseSoundType;
    char 										gap_15E[2];
    CAESound                *pRoadNoiseSound;
    short                   nFlatTyreSoundType;
    char 										gap_166[2];
    CAESound                *pFlatTyreSound;
    short                   nReverseGearSoundType;
    char 										gap_16E[2];
    CAESound                *pReverseGearSound;
    char 										gap_174[4];
    CAESound                *pHornTonSound;
    CAESound                *pSirenSound;
    CAESound                *pPoliceSirenSound;
    CAETwinLoopSoundEntity  skidSound;
    float 									field_22C;
    float 									field_230;
    float 									field_234;
    float 									field_238;
    float 									field_23C;
    int 										field_240;
    bool                    bNitroSoundPresent;
    char 										field_245[3];
    float 									field_248;
	} CAEVehicleAudioEntity;
]]

shared.validate_size('CAEVehicleAudioEntity', 0x24C)