1 2 #ifndef AUDIO_FX_H 3 #define AUDIO_FX_H 4 5 #include <stdint.h> 6 7 8 // MAX_SLOTS specifies amount of FX slots used to apply environmental 9 // effects to sounds. We need at least two of them to prevent glitches 10 // at environment transition (slots are cyclically changed, leaving 11 // previously played samples at old slot). Maximum amount is 4, but 12 // it's not recommended to set it more than 2. 13 14 #define TR_AUDIO_MAX_SLOTS 2 15 16 // In TR3-5, there were 5 reverb / echo effect flags for each 17 // room, but they were never used in PC versions - however, level 18 // files still contain this info, so we now can re-use these flags 19 // to assign reverb/echo presets to each room. 20 // Also, underwater environment can be considered as additional 21 // reverb flag, so overall amount is 6. 22 23 enum TR_AUDIO_FX { 24 25 TR_AUDIO_FX_OUTSIDE, // EFX_REVERB_PRESET_CITY 26 TR_AUDIO_FX_SMALLROOM, // EFX_REVERB_PRESET_LIVINGROOM 27 TR_AUDIO_FX_MEDIUMROOM, // EFX_REVERB_PRESET_WOODEN_LONGPASSAGE 28 TR_AUDIO_FX_LARGEROOM, // EFX_REVERB_PRESET_DOME_TOMB 29 TR_AUDIO_FX_PIPE, // EFX_REVERB_PRESET_PIPE_LARGE 30 TR_AUDIO_FX_WATER, // EFX_REVERB_PRESET_UNDERWATER 31 TR_AUDIO_FX_LASTINDEX 32 }; 33 34 // Sound flags are found at offset 7 of SoundDetail unit and specify 35 // certain sound modifications. 36 37 /*#define TR_AUDIO_FLAG_RAND_PITCH 0x20 // P flag. Slight random pitch shift. 38 #define TR_AUDIO_FLAG_RAND_VOLUME 0x40 // V flag. Slight random gain shift. 39 #define TR_AUDIO_FLAG_UNKNOWN 0x10 // N flag. UNKNOWN MEANING! 40 */ 41 42 void Audio_InitFX(); 43 void Audio_DeinitFX(); 44 45 void Audio_SetFX(uint32_t source); 46 void Audio_UnsetFX(uint32_t source); 47 48 49 void Audio_SetFXWaterStateForSource(uint32_t source); 50 void Audio_SetFXRoomType(int value); 51 void Audio_SetFXWaterState(bool state); 52 bool Audio_GetFXWaterState(); 53 54 #endif // AUDIO_FX_H 55