]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cd_win.c
because gethostbyname("0.0.0.0") fails in windows, the fallback was being called...
[xonotic/darkplaces.git] / cd_win.c
index d61f269af41491ac546d52b0ab4fcce142d4e8be..4ea77dd96870c391606a98339084d2a420154e0d 100644 (file)
--- a/cd_win.c
+++ b/cd_win.c
@@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 See the GNU General Public License for more details.
 
@@ -107,7 +107,7 @@ void CDAudio_Play(qbyte track, qboolean looping)
 
        if (!enabled)
                return;
-       
+
        if (!cdValid)
        {
                CDAudio_GetAudioDiskInfo();
@@ -180,7 +180,7 @@ void CDAudio_Stop(void)
 
        if (!enabled)
                return;
-       
+
        if (!playing)
                return;
 
@@ -219,13 +219,13 @@ void CDAudio_Resume(void)
 
        if (!enabled)
                return;
-       
+
        if (!cdValid)
                return;
 
        if (!wasPlaying)
                return;
-       
+
        mciPlayParms.dwFrom = MCI_MAKE_TMSF(playTrack, 0, 0, 0);
        mciPlayParms.dwTo = MCI_MAKE_TMSF(playTrack + 1, 0, 0, 0);
        mciPlayParms.dwCallback = (DWORD)mainwindow;
@@ -241,22 +241,22 @@ void CDAudio_Resume(void)
 
 static void CD_f (void)
 {
-       char    *command;
-       int             ret;
-       int             n;
+       const char *command;
+       int ret;
+       int n;
 
        if (Cmd_Argc() < 2)
                return;
 
        command = Cmd_Argv (1);
 
-       if (Q_strcasecmp(command, "on") == 0)
+       if (strcasecmp(command, "on") == 0)
        {
                enabled = true;
                return;
        }
 
-       if (Q_strcasecmp(command, "off") == 0)
+       if (strcasecmp(command, "off") == 0)
        {
                if (playing)
                        CDAudio_Stop();
@@ -264,7 +264,7 @@ static void CD_f (void)
                return;
        }
 
-       if (Q_strcasecmp(command, "reset") == 0)
+       if (strcasecmp(command, "reset") == 0)
        {
                enabled = true;
                if (playing)
@@ -275,7 +275,7 @@ static void CD_f (void)
                return;
        }
 
-       if (Q_strcasecmp(command, "remap") == 0)
+       if (strcasecmp(command, "remap") == 0)
        {
                ret = Cmd_Argc() - 2;
                if (ret <= 0)
@@ -290,7 +290,7 @@ static void CD_f (void)
                return;
        }
 
-       if (Q_strcasecmp(command, "close") == 0)
+       if (strcasecmp(command, "close") == 0)
        {
                CDAudio_CloseDoor();
                return;
@@ -306,37 +306,37 @@ static void CD_f (void)
                }
        }
 
-       if (Q_strcasecmp(command, "play") == 0)
+       if (strcasecmp(command, "play") == 0)
        {
                CDAudio_Play((qbyte)atoi(Cmd_Argv (2)), false);
                return;
        }
 
-       if (Q_strcasecmp(command, "loop") == 0)
+       if (strcasecmp(command, "loop") == 0)
        {
                CDAudio_Play((qbyte)atoi(Cmd_Argv (2)), true);
                return;
        }
 
-       if (Q_strcasecmp(command, "stop") == 0)
+       if (strcasecmp(command, "stop") == 0)
        {
                CDAudio_Stop();
                return;
        }
 
-       if (Q_strcasecmp(command, "pause") == 0)
+       if (strcasecmp(command, "pause") == 0)
        {
                CDAudio_Pause();
                return;
        }
 
-       if (Q_strcasecmp(command, "resume") == 0)
+       if (strcasecmp(command, "resume") == 0)
        {
                CDAudio_Resume();
                return;
        }
 
-       if (Q_strcasecmp(command, "eject") == 0)
+       if (strcasecmp(command, "eject") == 0)
        {
                if (playing)
                        CDAudio_Stop();
@@ -345,7 +345,7 @@ static void CD_f (void)
                return;
        }
 
-       if (Q_strcasecmp(command, "info") == 0)
+       if (strcasecmp(command, "info") == 0)
        {
                Con_Printf("%u tracks\n", maxTrack);
                if (playing)
@@ -426,7 +426,7 @@ int CDAudio_Init(void)
        if (cls.state == ca_dedicated)
                return -1;
 
-       if (COM_CheckParm("-nocdaudio"))
+       if (COM_CheckParm("-nocdaudio") || COM_CheckParm("-safe"))
                return -1;
 
        mciOpenParms.lpstrDeviceType = "cdaudio";
@@ -454,13 +454,13 @@ int CDAudio_Init(void)
 
        if (CDAudio_GetAudioDiskInfo())
        {
-               Con_Printf("CDAudio_Init: No CD in player.\n");
+               Con_DPrintf("CDAudio_Init: No CD in player.\n");
                cdValid = false;
        }
 
        Cmd_AddCommand ("cd", CD_f);
 
-       Con_Printf("CD Audio Initialized\n");
+       Con_DPrintf("CD Audio Initialized\n");
 
        return 0;
 }
@@ -475,3 +475,11 @@ void CDAudio_Shutdown(void)
                Con_DPrintf("CDAudio_Shutdown: MCI_CLOSE failed\n");
 }
 
+
+void CDAudio_Open(void)
+{
+}
+
+void CDAudio_Close(void)
+{
+}