From b5dcabb9f549a2c44f3e5fb1feab823bccadcfc8 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 8 Oct 2013 16:29:54 +0000 Subject: [PATCH] fix some non-windows builds. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4496 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cd_linux.c | 7 +++---- engine/client/cl_parse.c | 18 ++++++++++++------ engine/client/clhl_game.c | 10 +++++++--- engine/client/client.h | 2 -- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/engine/client/cd_linux.c b/engine/client/cd_linux.c index 4474dfb0a..aaa1dc6b7 100644 --- a/engine/client/cd_linux.c +++ b/engine/client/cd_linux.c @@ -85,7 +85,7 @@ int CDAudio_GetAudioDiskInfo(void) } -void CDAudio_Play(int track, qboolean looping) +void CDAudio_Play(int track) { struct cdrom_tocentry entry; struct cdrom_ti ti; @@ -121,6 +121,8 @@ void CDAudio_Play(int track, qboolean looping) if ( ioctl(cdfile, CDROMRESUME) == -1 ) Con_DPrintf("ioctl cdromresume failed\n"); + playing = true; + if (!bgmvolume.value) CDAudio_Pause (); } @@ -185,9 +187,6 @@ qboolean CDAudio_Startup(void) if (cdfile != -1) return true; - if (!bgmvolume.value) - return false; - if ((i = COM_CheckParm("-cddev")) != 0 && i < com_argc - 1) { Q_strncpyz(cd_dev, com_argv[i + 1], sizeof(cd_dev)); diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 5a73a4a72..0aad594e8 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -5700,8 +5700,11 @@ void CLQW_ParseServerMessage (void) break; case svc_cdtrack: - cl.cdtrack = MSG_ReadByte (); - Media_NumberedTrack ((qbyte)cl.cdtrack, (qbyte)cl.cdtrack); + { + unsigned int firsttrack; + firsttrack = MSG_ReadByte (); + Media_NumberedTrack (firsttrack, firsttrack); + } break; case svc_intermission: @@ -6350,10 +6353,13 @@ void CLNQ_ParseServerMessage (void) break; case svc_cdtrack: - cl.cdtrack = MSG_ReadByte (); - MSG_ReadByte (); - - Media_NumberedTrack ((qbyte)cl.cdtrack, (qbyte)cl.cdtrack); + { + unsigned int firsttrack; + unsigned int looptrack; + firsttrack = MSG_ReadByte (); + looptrack = MSG_ReadByte (); + Media_NumberedTrack (firsttrack, looptrack); + } break; case svc_setview: diff --git a/engine/client/clhl_game.c b/engine/client/clhl_game.c index b43e1db1a..55e177a2d 100644 --- a/engine/client/clhl_game.c +++ b/engine/client/clhl_game.c @@ -1458,9 +1458,13 @@ int CLHL_ParseGamePacket(void) cl.intermission = true; break; case svc_cdtrack: - cl.cdtrack = MSG_ReadByte(); - MSG_ReadByte(); - CDAudio_Play ((qbyte)cl.cdtrack, (qbyte)cl.cdtrack); + { + unsigned int firsttrack; + unsigned int looptrack; + firsttrack = MSG_ReadByte (); + looptrack = MSG_ReadByte (); + Media_NumberedTrack (firsttrack, looptrack); + } break; case 35: //svc_weaponanimation: diff --git a/engine/client/client.h b/engine/client/client.h index be5dda07a..7bfe1d41f 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -705,8 +705,6 @@ typedef struct int num_entities; // stored bottom up in cl_entities array int num_statics; // stored top down in cl_entitiers - int cdtrack; // cd audio - // all player information unsigned int allocated_client_slots; player_info_t players[MAX_CLIENTS];