UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
s_local.h
Go to the documentation of this file.
1 
5 /*
6 All original material Copyright (C) 2002-2020 UFO: Alien Invasion.
7 
8 Original file from Quake 2 v3.21: quake2-2.31/client/sound.h
9 Copyright (C) 1997-2001 Id Software, Inc.
10 
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 as published by the Free Software Foundation; either version 2
14 of the License, or (at your option) any later version.
15 
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 
20 See the GNU General Public License for more details.
21 
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, 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 
41 typedef struct s_sample_s {
42  char* name;
43  int lastPlayed;
45  Mix_Chunk* chunk;
46  struct s_sample_s* hashNext;
47  int index;
48 } s_sample_t;
49 
50 typedef struct s_channel_s {
53  float atten;
54  int count;
55 } s_channel_t;
56 
58 #define MAX_CHANNELS 64
59 
60 typedef 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 
73 extern cvar_t* snd_volume;
75 
76 extern s_env_t s_env;
uint16_t format
Definition: s_local.h:68
int index
Definition: s_local.h:47
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
Definition: cvar.h:71
struct s_sample_s s_sample_t
int sampleRepeatRate
Definition: s_local.h:65
float atten
Definition: s_local.h:53
bool initialized
Definition: s_local.h:70
cvar_t * snd_distance_scale
Definition: s_main.cpp:43
vec3_t right
Definition: s_local.h:61
int count
Definition: s_local.h:54
s_channel_t channels[MAX_CHANNELS]
Definition: s_local.h:63
int rate
Definition: s_local.h:66
s_env_t s_env
Definition: s_main.cpp:40
int lastPlayed
Definition: s_local.h:43
cvar_t * snd_volume
Definition: s_main.cpp:42
char * name
Definition: s_local.h:42
struct s_env_s s_env_t
vec3_t org
Definition: s_local.h:51
memPool_t * cl_soundSysPool
Definition: s_main.cpp:48
struct s_channel_s s_channel_t
vec_t vec3_t[3]
Definition: ufotypes.h:39
Mix_Chunk * chunk
Definition: s_local.h:45
s_sample_t * sample
Definition: s_local.h:52
int numChannels
Definition: s_local.h:67
#define MAX_CHANNELS
the sound environment
Definition: s_local.h:58
struct s_sample_s * hashNext
Definition: s_local.h:46