31#define SAMPLE_HASH_SIZE 64
35#define SAMPLE_MAX_COUNT 1000
62 const char** extension = soundExtensions;
64 if (!sound || sound[0] ==
'*')
67 size_t len = strlen(sound);
69 Com_Printf(
"S_LoadSound: MAX_QPATH exceeded for: '%s'\n", sound);
77 SDL_RWops* rw = SDL_RWFromMem(
buf,
len);
83 Mix_Chunk* chunk = Mix_LoadWAV_RW(rw,
false);
85 Com_Printf(
"S_LoadSound: %s.\n", Mix_GetError());
95 Com_Printf(
"S_LoadSound: Could not find sound file: '%s'\n", sound);
107 if (!
s_env.initialized)
114 return sample->index;
124 sample->
chunk = chunk;
129 return sample->
index;
143 Mix_FreeChunk(sample->chunk);
165 if (!
s_env.initialized)
169 for (
int i = 0;
i <
csi.numODs;
i++) {
void Com_Printf(const char *const fmt,...)
definitions common between client and server, but not game lib
int FS_LoadFile(const char *path, byte **buffer)
Filenames are relative to the quake search path.
void FS_FreeFile(void *buffer)
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
#define Mem_PoolStrDup(in, pool, tagNum)
#define Mem_PoolAllocType(type, pool)
static wrapCache_t * hash[MAX_WRAP_HASH]
QGL_EXTERN GLuint GLchar GLuint * len
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
memPool_t * cl_soundSysPool
#define SAMPLE_TYPES
Supported sound file extensions.
s_sample_t * stdSoundPool[MAX_SOUNDIDS]
s_sample_t * S_LoadSample(const char *soundFile)
Loads and registers a sound file for later use.
void S_PrecacheSamples(void)
s_sample_t * S_GetSample(const int soundIdx)
int S_LoadSampleIdx(const char *soundFile)
Loads and registers a sound file for later use.
static int sampleIndexLast
static s_sample_t * sampleHash[SAMPLE_HASH_SIZE]
static s_sample_t * sampleIndex[SAMPLE_MAX_COUNT]
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)
void Com_StripExtension(const char *in, char *out, const size_t size)
Removes the file extension from a filename.
unsigned int Com_HashKey(const char *name, int hashsize)
returns hash key for a string
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
this is a fire definition for our weapons/ammo
const char * hitBodySound
Defines all attributes of objects used in the inventory.
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
fireDefIndex_t numFiredefs[MAX_WEAPONS_PER_OBJDEF]
struct s_sample_s * hashNext