More conversion
This commit is contained in:
+20
-20
@@ -29,7 +29,7 @@
|
||||
#define MUSIC_DIRNAME "music"
|
||||
|
||||
qboolean bgmloop;
|
||||
cvar_t bgm_extmusic = {"bgm_extmusic", "1", CVAR_ARCHIVE};
|
||||
convar bgm_extmusic{"bgm_extmusic", "1", {.archive = true}};
|
||||
|
||||
static qboolean no_extmusic= false;
|
||||
static float old_volume = -1.0f;
|
||||
@@ -76,8 +76,8 @@ static snd_stream_t *bgmstream = NULL;
|
||||
|
||||
static void BGM_Play_f (void)
|
||||
{
|
||||
if (Cmd_Argc() == 2) {
|
||||
BGM_Play (Cmd_Argv(1));
|
||||
if (command::argc() == 2) {
|
||||
BGM_Play (command::argv(1)->c_str());
|
||||
}
|
||||
else {
|
||||
Con_Printf ("music <musicfile>\n");
|
||||
@@ -96,14 +96,14 @@ static void BGM_Resume_f (void)
|
||||
|
||||
static void BGM_Loop_f (void)
|
||||
{
|
||||
if (Cmd_Argc() == 2) {
|
||||
if (q_strcasecmp(Cmd_Argv(1), "0") == 0 ||
|
||||
q_strcasecmp(Cmd_Argv(1),"off") == 0)
|
||||
if (command::argc() == 2) {
|
||||
if (q_strcasecmp(command::argv(1)->c_str(), "0") == 0 ||
|
||||
q_strcasecmp(command::argv(1)->c_str(),"off") == 0)
|
||||
bgmloop = false;
|
||||
else if (q_strcasecmp(Cmd_Argv(1), "1") == 0 ||
|
||||
q_strcasecmp(Cmd_Argv(1),"on") == 0)
|
||||
else if (q_strcasecmp(command::argv(1)->c_str(), "1") == 0 ||
|
||||
q_strcasecmp(command::argv(1)->c_str(),"on") == 0)
|
||||
bgmloop = true;
|
||||
else if (q_strcasecmp(Cmd_Argv(1),"toggle") == 0)
|
||||
else if (q_strcasecmp(command::argv(1)->c_str(),"toggle") == 0)
|
||||
bgmloop = !bgmloop;
|
||||
|
||||
if (bgmstream) bgmstream->loop = bgmloop;
|
||||
@@ -122,11 +122,11 @@ static void BGM_Stop_f (void)
|
||||
|
||||
static void BGM_Jump_f (void)
|
||||
{
|
||||
if (Cmd_Argc() != 2) {
|
||||
if (command::argc() != 2) {
|
||||
Con_Printf ("music_jump <ordernum>\n");
|
||||
}
|
||||
else if (bgmstream) {
|
||||
S_CodecJumpToOrder(bgmstream, atoi(Cmd_Argv(1)));
|
||||
S_CodecJumpToOrder(bgmstream, atoi(command::argv(1)->c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,13 +135,13 @@ qboolean BGM_Init (void)
|
||||
music_handler_t *handlers = NULL;
|
||||
int i;
|
||||
|
||||
Cvar_RegisterVariable(&bgm_extmusic);
|
||||
Cmd_AddCommand("music", BGM_Play_f);
|
||||
Cmd_AddCommand("music_pause", BGM_Pause_f);
|
||||
Cmd_AddCommand("music_resume", BGM_Resume_f);
|
||||
Cmd_AddCommand("music_loop", BGM_Loop_f);
|
||||
Cmd_AddCommand("music_stop", BGM_Stop_f);
|
||||
Cmd_AddCommand("music_jump", BGM_Jump_f);
|
||||
bgm_extmusic.inscribe();
|
||||
command::add("music", BGM_Play_f);
|
||||
command::add("music_pause", BGM_Pause_f);
|
||||
command::add("music_resume", BGM_Resume_f);
|
||||
command::add("music_loop", BGM_Loop_f);
|
||||
command::add("music_stop", BGM_Stop_f);
|
||||
command::add("music_jump", BGM_Jump_f);
|
||||
|
||||
if (COM_CheckParm("-noextmusic") != 0)
|
||||
no_extmusic = true;
|
||||
@@ -467,9 +467,9 @@ void BGM_Update (void)
|
||||
if (old_volume != bgmvolume.value)
|
||||
{
|
||||
if (bgmvolume.value < 0)
|
||||
Cvar_SetQuick (&bgmvolume, "0");
|
||||
bgmvolume.set("0");
|
||||
else if (bgmvolume.value > 1)
|
||||
Cvar_SetQuick (&bgmvolume, "1");
|
||||
bgmvolume.set("1");
|
||||
old_volume = bgmvolume.value;
|
||||
}
|
||||
if (bgmstream)
|
||||
|
||||
Reference in New Issue
Block a user