Sound effects over areas of the map.
More...
|
T_void | AreaSoundCheck (T_void) |
|
T_areaSound | AreaSoundCreate (T_sword16 x, T_sword16 y, T_word16 radius, T_word16 volume, E_areaSoundType type, T_word16 length, T_areaSound p_groupLeader, T_areaSoundFinishCallback p_callback, T_word32 data, T_word16 soundNum) |
|
T_void | AreaSoundDestroy (T_areaSound areaSound) |
|
T_areaSound | AreaSoundFindGroupLeader (T_word16 groupID) |
|
T_void | AreaSoundFinish (T_void) |
|
T_void | AreaSoundInitialize (T_void) |
|
T_void | AreaSoundLoad (T_word32 mapNumber) |
|
T_void | AreaSoundMove (T_areaSound areaSound, T_sword16 newX, T_sword16 newY) |
|
T_void | AreaSoundSetGroupId (T_areaSound areaSound, T_word16 groupID) |
|
T_void | AreaSoundUpdate (T_sword16 listenX, T_sword16 listenY) |
|
T_void | ICalculateAllVolumes (T_sword16 listenX, T_sword16 listenY) |
|
T_word16 | ICalculateVolume (T_areaSoundStruct *p_sound, T_sword16 listenX, T_sword16 listenY) |
|
T_areaSound | IFindGroupLeader (T_word16 groupId) |
|
T_areaSoundStruct * | IFindLoudestNotChannelSound (T_void) |
|
T_areaSoundStruct * | IFindPrevSound (T_areaSoundStruct *p_sound) |
|
T_void | ISetGroupLeaderAndId (T_areaSound areaSound, T_areaSound groupLeader, T_word16 groupId) |
|
T_void | IUpdateActiveSounds (T_sword16 listenX, T_sword16 listenY) |
|
T_void | IUpdateInactiveSounds (T_sword16 listenX, T_sword16 listenY) |
|
Sound effects over areas of the map.
Area sounds are sound effects on a map. They are used for environmental effects such as lava and water or just windy corridors.
- See Also
- http://www.amuletsandarmor.com/AALicense.txt
#define AREA_SOUND_ID_DONE |
AreaSoundCheck is a routine only used in debugging to check to see that the sounds have not been corrupted. If there is a problem, it will crash the program.
AreaSoundCreate creates and sets up a new area sound. As well, it sets up the new location and placement of the area sound in reference to its group.
- Parameters
-
x | – X Location of area sound |
y | – Y Location of area sound |
radius | – Radius at point zero sound |
volume | – Maximum volume at center |
type | – One shot, or loop |
length | – How long is sound to play (not used if looping) |
p_groupLeader | – Connect to which group? |
p_callback | – who to call when ONCE done |
data | – Extra data field |
soundNum | – Number of sound to play |
- Returns
- area sound handle that was created
AreaSoundDestroy turns off a given sound AND removes it from the list of sounds.
- Parameters
-
areaSound | – Area sound to destroy |
AreaSoundFindGroupLeader finds the group leader for a given group id. returns AREA_SOUND_BAD if no group is found, or groupID is zero.
- Parameters
-
- Returns
- identifier for area sound
AreaSoundFinish frees up all memory used by the area sound module after turning off all the sounds.
AreaSoundInitialize starts up the area sound module. Really not too much is done here. Should things change in the future, more will be done.
AreaSoundLoad loads a whole level of area sounds for the given level number.
- Parameters
-
mapNumber | – Map/level sounds to load |
AreaSoundMove changes the placement of the given area sound to the new location.
- Parameters
-
areaSound | – area sound to move |
newX | – New X location of sound |
newY | – New Y location of sound |
AreaSoundSetGroupId changes the group id on an area sound.
- Parameters
-
areaSound | – Area sound to affect |
groupID | – ID of the group to attach sound |
AreaSoundUpdate updates the volumes and activity of all sounds based on the sound areas and the given listening location.
- Parameters
-
listenX | – X Position where sounds are heard. |
listenY | – Y Position where sounds are heard. |
ICalculateAllVolumes is a routine that determines volume levels for all the area sounds.
- Parameters
-
listenX | – X Position where sounds are heard. |
listenY | – Y Position where sounds are heard. |
ICalculateVolume determines the volume level of a sound given the listening location.
- Parameters
-
p_sound | – Pointer to sound to calc. volume. |
listenX | – X Position where sounds are heard. |
listenY | – Y Position where sounds are heard. |
IFindGroupLeader searches through the list of area sounds and finds the first instance of a given areaSound.
- Parameters
-
groupId | – Group id to find leader of. |
- Returns
- Found group leader, or AREA_SOUND_BAD
IFindLoudestNotChannelSound searches throught the area sounds to find the loudest audible sound that is not being played.
- Returns
- loudest non-playing sound, or NULL
IFindPrevSound searches in the linked list for the previous sound to the given sound.
- Parameters
-
p_sound | – Sound to find previous of |
- Returns
- Previous sound, or NULL
ISetGroupLeaderAndId changes the group leader and id for the given instance.
- Parameters
-
areaSound | – area sound to change group leader |
groupLeader | – Group leader to change to |
groupId | – Group Id to change to |
IUpdateActiveSounds go through the listof area sounds and identifies those sounds that are active and determines their new volume level and if they should be turned off.
- Parameters
-
listenX | – X Position where sounds are heard. |
listenY | – Y Position where sounds are heard. |
IUpdateInactiveSounds does the work of determining if there are new sounds that can be played or "take over" other sounds.
- Parameters
-
listenX | – X Position where sounds are heard. |
listenY | – Y Position where sounds are heard. |