|
UFO: Alien Invasion
|
Main control for any streaming sound output device. More...
#include "s_sample.h"#include "s_main.h"#include "../../common/filesys.h"#include "../../common/common.h"
Go to the source code of this file.
Macros | |
| #define | SAMPLE_HASH_SIZE 64 |
| #define | SAMPLE_MAX_COUNT 1000 |
Functions | |
| static s_sample_t * | S_FindByName (const char *name) |
| Searches the hash for a given sound file. | |
| static Mix_Chunk * | S_LoadSampleChunk (const char *sound) |
| int | S_LoadSampleIdx (const char *soundFile) |
| Loads and registers a sound file for later use. | |
| s_sample_t * | S_GetSample (const int soundIdx) |
| void | S_FreeSamples (void) |
| void | S_PrecacheSamples (void) |
Variables | |
| static s_sample_t * | sampleHash [SAMPLE_HASH_SIZE] |
| static s_sample_t * | sampleIndex [SAMPLE_MAX_COUNT] |
| static int | sampleIndexLast = 0 |
| s_sample_t * | stdSoundPool [MAX_SOUNDIDS] |
Main control for any streaming sound output device.
Definition in file s_sample.cpp.
| #define SAMPLE_HASH_SIZE 64 |
Definition at line 31 of file s_sample.cpp.
Referenced by S_FindByName(), S_FreeSamples(), and S_LoadSampleIdx().
| #define SAMPLE_MAX_COUNT 1000 |
Definition at line 35 of file s_sample.cpp.
|
static |
Searches the hash for a given sound file.
| name | The soundfile (relative to the sound dir and without extension) |
nullptr if not yet loaded Definition at line 47 of file s_sample.cpp.
References Com_HashKey(), hash, name, Q_streq, SAMPLE_HASH_SIZE, and sampleHash.
Referenced by S_LoadSampleIdx().
Definition at line 139 of file s_sample.cpp.
References s_sample_t::hashNext, i, Mem_Free, OBJZERO, SAMPLE_HASH_SIZE, sampleHash, and sampleIndex.
Referenced by S_Shutdown().
| s_sample_t * S_GetSample | ( | const int | soundIdx | ) |
Definition at line 132 of file s_sample.cpp.
References sampleIndex, and sampleIndexLast.
Referenced by S_Frame(), and S_LoadSample().
|
static |
Definition at line 58 of file s_sample.cpp.
References Com_Printf(), FS_FreeFile(), FS_LoadFile(), len, MAX_QPATH, SAMPLE_TYPES, and va().
Referenced by S_LoadSampleIdx().
| int S_LoadSampleIdx | ( | const char * | soundFile | ) |
Loads and registers a sound file for later use.
| [in] | soundFile | The name of the soundfile, relative to the sounds dir |
Definition at line 105 of file s_sample.cpp.
References s_sample_t::chunk, cl_soundSysPool, Com_HashKey(), Com_StripExtension(), hash, s_sample_t::hashNext, s_sample_t::index, MAX_QPATH, Mem_PoolAllocType, Mem_PoolStrDup, name, s_sample_t::name, s_env, S_FindByName(), S_LoadSampleChunk(), SAMPLE_HASH_SIZE, sampleHash, sampleIndex, and sampleIndexLast.
Referenced by LE_AddAmbientSound(), and S_LoadSample().
Definition at line 163 of file s_sample.cpp.
References fireDef_t::bounceSound, csi, objDef_t::fd, fireDef_t::fireSound, fireDef_t::hitBodySound, i, fireDef_t::impactSound, INVSH_GetItemByIDX(), objDef_t::numFiredefs, objDef_t::numWeapons, s_env, S_LoadSample(), SOUND_WATER_IN, SOUND_WATER_MOVE, SOUND_WATER_OUT, and stdSoundPool.
Referenced by S_LoadSamples().
|
static |
Definition at line 32 of file s_sample.cpp.
Referenced by S_FindByName(), S_FreeSamples(), and S_LoadSampleIdx().
|
static |
Definition at line 36 of file s_sample.cpp.
Referenced by S_FreeSamples(), S_GetSample(), and S_LoadSampleIdx().
|
static |
Definition at line 37 of file s_sample.cpp.
Referenced by S_GetSample(), and S_LoadSampleIdx().
| s_sample_t* stdSoundPool[MAX_SOUNDIDS] |
this pool is reloaded on every sound system restart
Definition at line 40 of file s_sample.cpp.
Referenced by S_PlayStdSample(), and S_PrecacheSamples().