UFO: Alien Invasion
Loading...
Searching...
No Matches
s_local.h
Go to the documentation of this file.
1
4
5/*
6All original material Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8Original file from Quake 2 v3.21: quake2-2.31/client/sound.h
9Copyright (C) 1997-2001 Id Software, Inc.
10
11This program is free software; you can redistribute it and/or
12modify it under the terms of the GNU General Public License
13as published by the Free Software Foundation; either version 2
14of the License, or (at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20See the GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26*/
27
28#pragma once
29
30#include <SDL_mixer.h>
31#include "../../shared/shared.h"
32#include "../../shared/mathlib.h" /* for vec3_t */
33#include "../../common/cvar.h" /* for cvar_t */
34#include "../../common/mem.h"
35
37
39#define SAMPLE_TYPES { "ogg", "wav", nullptr }
40
41typedef struct s_sample_s {
42 char* name;
45 Mix_Chunk* chunk;
46 struct s_sample_s* hashNext;
47 int index;
49
50typedef struct s_channel_s {
53 float atten;
54 int count;
56
58#define MAX_CHANNELS 64
59
60typedef struct s_env_s {
61 vec3_t right; /* for stereo panning */
62
64
66 int rate;
68 uint16_t format;
69
71} s_env_t;
72
73extern cvar_t* snd_volume;
75
76extern s_env_t s_env;
Cvar (console variable) header file.
Memory handling with sentinel checking and pools with tags for grouped free'ing.
memPool_t * cl_soundSysPool
Definition s_main.cpp:48
cvar_t * snd_volume
Definition s_main.cpp:42
#define MAX_CHANNELS
the sound environment
Definition s_local.h:58
cvar_t * snd_distance_scale
Definition s_main.cpp:43
s_env_t s_env
Definition s_main.cpp:40
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
Definition cvar.h:71
s_sample_t * sample
Definition s_local.h:52
int count
Definition s_local.h:54
float atten
Definition s_local.h:53
vec3_t org
Definition s_local.h:51
bool initialized
Definition s_local.h:70
vec3_t right
Definition s_local.h:61
int rate
Definition s_local.h:66
s_channel_t channels[MAX_CHANNELS]
Definition s_local.h:63
uint16_t format
Definition s_local.h:68
int numChannels
Definition s_local.h:67
int sampleRepeatRate
Definition s_local.h:65
int index
Definition s_local.h:47
char * name
Definition s_local.h:42
int lastPlayed
Definition s_local.h:43
struct s_sample_s * hashNext
Definition s_local.h:46
Mix_Chunk * chunk
Definition s_local.h:45
vec_t vec3_t[3]
Definition ufotypes.h:39