27 #ifndef ICB_SOUND_LOGIC_H_INCLUDED 28 #define ICB_SOUND_LOGIC_H_INCLUDED 30 #include "engines/icb/p4.h" 31 #include "engines/icb/debug.h" 32 #include "engines/icb/session.h" 33 #include "engines/icb/global_objects.h" 34 #include "engines/icb/sound_logic_entry.h" 35 #include "engines/icb/common/px_sfx_description.h" 36 #include "engines/icb/mission.h" 41 #define SL_MAX_SUBSCRIBERS MAX_voxel_list 44 #define SL_MAX_SOUND_REGISTRATIONS 10 48 #define SL_MAX_CONCURRENT_SOUNDS 24 51 #define SL_SAME_FLOOR_BOUNDARY 40 54 #define SL_MIN_SOUND 1000 // 10 metres 55 #define SL_MAX_SOUND 15000 // 150 metres 58 #define SL_FLOOR_RECT_DROP_FACTOR 2 61 #define SL_SFX_SUBTITLE_X (SCREEN_WIDTH / 2) 62 #define SL_SFX_SUBTITLE_Y (SCREEN_DEPTH - 20) 63 #define SL_SUBTITLE_WIDTH 300 65 #define SL_SUBTITLE_R 255 66 #define SL_SUBTITLE_G 255 67 #define SL_SUBTITLE_B 255 70 #define SL_UNDEFINED_COORDINATE (1000000) 73 #define SL_MAX_FLOOR_LINKS 10 98 bool8 SoundEventPendingForID(uint32 nID);
101 void ClearHeardFlag(uint32 nID);
104 inline uint32 ProcessSound(int32 fX, int32 fY, int32 fZ,
const CSfx *pSFX)
const;
107 void NewSound(uint32 nObjectID, int32 nX, int32 nY, int32 nZ,
const CSfx *pSFX, uint32 nSoundHash);
110 bool8 SubtitleActive()
const {
return ((m_nSFXSubtitleTimer == 0) ? FALSE8 : TRUE8); }
111 void DrawSubtitle()
const;
114 void SetSuspendedFlag(uint32 nID, bool8 bSuspend);
117 void AddSubscription(uint32 nID,
const char *pcSoundID);
118 void RemoveSubscription(uint32 nID,
const char *pcSoundID);
119 void RemoveAllSubscriptions(uint32 nID);
120 void SetHearingSensitivity(uint32 nID, uint32 nSensitivity);
121 bool8 MegaHeardSomething(uint32 nID);
122 bool8 MegaHeardThis(uint32 nID,
const char *pcSoundID);
123 int32 GetSoundX(uint32 nSoundHash)
const;
124 int32 GetSoundZ(uint32 nSoundHash)
const;
125 void LinkFloorsForSoundEvents(
const char *pcFloor1,
const char *pcFloor2);
128 enum SoundVolumeMode { ACTUAL_VOLUME = 0, LOGIC_VOLUME };
130 uint32 m_nNumSubscribers;
131 uint32 m_nSFXSubtitleTimer;
132 const char *m_pcSFXSubtitleText;
135 uint32 m_pnLinkedFloors[SL_MAX_FLOOR_LINKS][2];
136 uint32 m_nNumLinkedFloors;
141 uint32 FindMegaInList(uint32 nID)
const;
143 uint8 CalculateEffectiveVolume(SoundVolumeMode eMode, uint32 nMegaID, int32 nSoundX, int32 nSoundY, int32 nSoundZ,
const CSfx *pSFX)
const;
145 bool8 SoundAndEarOnSameOrLinkedFloors(uint32 nEarID, PXreal fSoundX, PXreal fSoundY, PXreal fSoundZ)
const;
147 bool8 FloorsLinkedForSounds(uint32 nFloor1, uint32 nFloor2)
const;
150 inline _sound_logic::_sound_logic() { Initialise(); }
152 inline uint32 _sound_logic::ProcessSound(int32 nX, int32 nY, int32 nZ,
const CSfx *pSFX)
const {
154 int32 watch = MS->player.Fetch_player_id();
156 if (g_mission->camera_follow_id_overide) {
157 watch = g_mission->camera_follow_id_overide;
160 return (CalculateEffectiveVolume(ACTUAL_VOLUME, watch, nX, nY, nZ, pSFX));
167 #endif // #if !defined( SOUND_LOGIC_H_INCLUDED ) Definition: sound_logic.h:77
Definition: px_sfx_description.h:59
Definition: sound_logic.h:85
Definition: sound_logic_entry.h:50