-
-
Notifications
You must be signed in to change notification settings - Fork 502
WIP: Add new event onClientWorldSound #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Necktrox
wants to merge
7
commits into
multitheftauto:master
from
Necktrox:feature/world-sound-event
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
db9d5dd
Added onClientWorldSound event
268bbc8
Restrict world sounds to Ped/Player
93c5b40
Revert "Restrict world sounds to Ped/Player"
d2ca755
Restrict onClientWorldSound to ped and player
b08eb79
Merge branch 'master' into feature/world-sound-event
d164604
Update CAESoundManagerSAInterface
92f0a99
Add CAudioZones
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /***************************************************************************** | ||
| * | ||
| * PROJECT: Multi Theft Auto | ||
| * LICENSE: See LICENSE in the top level directory | ||
| * FILE: game_sa/Audio/CAudioZonesSA.cpp | ||
| * PURPOSE: Source file for audio zones class | ||
| * | ||
| * Multi Theft Auto is available from https://www.multitheftauto.com/ | ||
| * | ||
| *****************************************************************************/ | ||
| #include "StdInc.h" | ||
| #include "CAudioZonesSA.h" | ||
|
|
||
| // 0xB6DC6C CAudioZones::m_aActiveBoxes | ||
| // 0xB6DC94 CAudioZones::m_aActiveSpheres | ||
| // 0xB6DCBC CAudioZones::m_NumActiveBoxes | ||
| // 0xB6DCC0 CAudioZones::m_NumActiveSpheres | ||
| // 0xB6DCC4 CAudioZones::m_NumBoxes | ||
| // 0xB6DCC8 CAudioZones::m_NumSpheres | ||
| // 0xB6EBB0 CAudioZones::m_aSpheres | ||
|
|
||
| #define VAR_CAudioZonesSA__m_aBoxes 0xB6DCD0 | ||
|
|
||
| CAudioZoneBoxSAInterface ( * CAudioZonesSA::m_aBoxes ) [100] = reinterpret_cast < decltype ( CAudioZonesSA::m_aBoxes ) > ( VAR_CAudioZonesSA__m_aBoxes ); | ||
|
|
||
| void CAudioZonesSA::Init ( void ) | ||
| { | ||
| // 0x5081A0 void __cdecl CAudioZones::Init(void) | ||
| } | ||
|
|
||
| void CAudioZonesSA::RegisterAudioBox ( const char * szZoneName, int16_t wBank, bool bEnabled, float minX, float minY, float minZ, float maxX, float maxY, float maxZ ) | ||
| { | ||
| // 0x508240 void __cdecl CAudioZones::RegisterAudioBox(const char *, int16_t, bool, float, float, float, float, float, float) | ||
| } | ||
|
|
||
| void CAudioZonesSA::RegisterAudioSphere ( const char * szZoneName, int16_t wBank, bool bEnabled, float centerX, float centerY, float centerZ ) | ||
| { | ||
| // 0x5081C0 void __cdecl CAudioZones::RegisterAudioSphere(const char *, in16_t, bool, float, float, float, float) | ||
| } | ||
|
|
||
| void CAudioZonesSA::SwitchAudioZone ( const char * szZoneName, bool bEnabled ) | ||
| { | ||
| // 0x508320 void __cdecl CAudioZones::SwitchAudioZone(const char *, bool) | ||
| } | ||
|
|
||
| void CAudioZonesSA::Update ( bool bForced ) | ||
| { | ||
| // 0x5083C0 CAudioZones::Update(bool) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /***************************************************************************** | ||
| * | ||
| * PROJECT: Multi Theft Auto | ||
| * LICENSE: See LICENSE in the top level directory | ||
| * FILE: game_sa/Audio/CAudioZonesSA.h | ||
| * PURPOSE: Header file for audio zones class | ||
| * | ||
| * Multi Theft Auto is available from https://www.multitheftauto.com/ | ||
| * | ||
| *****************************************************************************/ | ||
| #pragma once | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| struct CAudioZoneBoxSAInterface | ||
| { | ||
| char szName[8]; // + 0x00 | ||
| int16_t wBank; // + 0x08 | ||
| bool bEnabled; // + 0x0A | ||
| int8_t field_B; | ||
| uint16_t wMinX; // + 0x0C | ||
| uint16_t wMinY; // + 0x0E | ||
| uint16_t wMinZ; // + 0x10 | ||
| uint16_t wMaxX; // + 0x12 | ||
| uint16_t wMaxY; // + 0x14 | ||
| uint16_t wMaxZ; // + 0x16 | ||
| }; | ||
| static_assert(sizeof(CAudioZoneBoxSAInterface) == 0x18, "Invalid size of CAudioZoneBoxSAInterface"); | ||
|
|
||
| struct CAudioZoneSphereSAInterface | ||
| { | ||
|
|
||
| }; | ||
| // static_assert(sizeof(CAudioZoneSphereSAInterface) == 0x18, "Invalid size of CAudioZoneSphereSAInterface"); | ||
|
|
||
| class CAudioZonesSA | ||
| { | ||
| public: | ||
| static void Init ( void ); | ||
| static void RegisterAudioBox ( const char * szZoneName, int16_t wBank, bool bEnabled, float minX, float minY, float minZ, float maxX, float maxY, float maxZ ); | ||
| static void RegisterAudioSphere ( const char * szZoneName, int16_t wBank, bool bEnabled, float centerX, float centerY, float centerZ ); | ||
| static void SwitchAudioZone ( const char * szZoneName, bool bEnabled ); | ||
| static void Update ( bool bForced ); | ||
|
|
||
| public: | ||
| static CAudioZoneBoxSAInterface ( *m_aBoxes ) [100]; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sound can be from example: vehicles, explosion vehicle/barrels/gas station etc, weapons, destroyed objects
so, if element isnt ped/player then source=nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.