#include "cdaudio.h"
#include <SDL.h>
-/*IMPORTANT:
+/*IMPORTANT:
SDL 1.2.7 and older seems to have a strange bug regarding CDPause and CDResume under WIN32.
If CDResume is called, it plays to end of the CD regardless what values for lasttrack and lastframe
were passed to CDPlayTracks.
}
-int CDAudio_SysPlay (qbyte track)
+int CDAudio_SysPlay (unsigned char track)
{
SDL_CDStop( cd );
endtime = realtime + (float) cd->track[ track - 1 ].length / CD_FPS;
{
SDL_CDResume( cd );
endtime = realtime + (cd->track[ cdPlayTrack - 1 ].length - pauseoffset) / CD_FPS;
- return SDL_CDPlayTracks( cd, cdPlayTrack - 1, pauseoffset, cdPlayTrack, 0 );
+ return SDL_CDPlayTracks( cd, cdPlayTrack - 1, (int)pauseoffset, cdPlayTrack, 0 );
}
int CDAudio_SysUpdate (void)
void CDAudio_SysInit (void)
{
- if( SDL_InitSubSystem( SDL_INIT_CDROM ) == -1 )
+ if( SDL_InitSubSystem( SDL_INIT_CDROM ) == -1 )
Con_Print( "Failed to init the CDROM SDL subsystem!\n" );
Cmd_AddCommand( "cddrive", CDAudio_SDL_CDDrive_f );
{
int i;
int numdrives;
-
+
numdrives = SDL_CDNumDrives();
if( numdrives == -1 ) // was the CDROM system initialized correctly?
return -1;
if( !cd ) {
Con_Printf( "Couldn't open drive %i.\n", i );
return;
- }
-
+ }
+
if( !CD_INDRIVE( SDL_CDStatus( cd ) ) )
Con_Printf( "No cd in drive %i.\n", i );
else if( !IsAudioCD() )
-
+