]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cd_linux.c
Remove v_glslgamma cvar (now assumed to be 1) and corresponding code like R_DrawGamma.
[xonotic/darkplaces.git] / cd_linux.c
index b0e4fb0093d26a46a67d08dab4f783522bcb52b6..bc07b849f9febd274d719cdf36a2d3e7ca7699a5 100644 (file)
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // rights reserved.
 
 // suggested by Zero_Dogg to fix a compile problem on Mandriva Linux
-#define __KERNEL_STRICT_NAMES
+#include "quakedef.h"
 
 #include <linux/cdrom.h>
 #include <sys/ioctl.h>
@@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <time.h>
 #include <unistd.h>
 
-#include "quakedef.h"
 #include "cdaudio.h"
 
 
@@ -105,7 +104,7 @@ void CDAudio_SysSetVolume (float volume)
        if (cdfile == -1)
                return;
 
-       vol.channel0 = vol.channel1 = volume * 255;
+       vol.channel0 = vol.channel1 = (__u8)(volume * 255);
        vol.channel2 = vol.channel3 = 0;
 
        if (ioctl (cdfile, CDROMVOLCTRL, &vol) == -1)
@@ -113,7 +112,7 @@ void CDAudio_SysSetVolume (float volume)
 }
 
 
-int CDAudio_SysPlay (unsigned char track)
+int CDAudio_SysPlay (int track)
 {
        struct cdrom_tocentry entry;
        struct cdrom_ti ti;
@@ -204,7 +203,7 @@ int CDAudio_SysUpdate (void)
        struct cdrom_subchnl subchnl;
        static time_t lastchk = 0;
 
-       if (cdPlaying && lastchk < time(NULL))
+       if (cdPlaying && lastchk < time(NULL) && cdfile != -1)
        {
                lastchk = time(NULL) + 2; //two seconds between chks
                subchnl.cdsc_format = CDROM_MSF;