UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_sound.cpp
Go to the documentation of this file.
1
4
5
/*
6
Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17
See the GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23
*/
24
25
#include "
ui_main.h
"
26
#include "
ui_sound.h
"
27
#include "
../sound/s_main.h
"
28
29
cvar_t
*
ui_sounds
;
30
35
void
UI_PlaySound
(
const
char
* soundFile)
36
{
37
if
(
ui_sounds
->integer)
38
S_StartLocalSample
(
va
(
"ui/%s"
, soundFile),
SND_VOLUME_DEFAULT
);
39
}
s_main.h
Specifies sound API?
S_StartLocalSample
void S_StartLocalSample(const char *s, float volume)
Plays a sample without spatialization.
Definition
s_mix.cpp:184
SND_VOLUME_DEFAULT
#define SND_VOLUME_DEFAULT
Definition
s_main.h:42
va
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...
Definition
shared.cpp:410
cvar_t
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
Definition
cvar.h:71
ui_main.h
ui_sounds
cvar_t * ui_sounds
Definition
ui_sound.cpp:29
UI_PlaySound
void UI_PlaySound(const char *soundFile)
Plays a ui sound.
Definition
ui_sound.cpp:35
ui_sound.h
src
client
ui
ui_sound.cpp
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0