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