From caa63853c32c05b2b9ac58313f994e6ec0f69c47 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sun, 14 Jun 2009 16:00:34 +0000 Subject: [PATCH] - Linux CD Patch by caedes - Bump auf 1.05 --- README | 3 ++- src/common/qcommon.h | 2 +- src/sdl/cd.c | 29 +++++++++++++++++------------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/README b/README index 724f4c4d..332dfe5e 100644 --- a/README +++ b/README @@ -2,7 +2,8 @@ This is the Yamagi Quake II Client, an enhanced Version of id Software's legendary Quake II. Main focus is single player, the gameplay is unchanged but many bugs were fixed. This code should run under any POSIX compliant operating system, just type "make" oder "gmake" to compile. -Remeber, you'll need a working SDL installation! +Remeber, you'll need a working SDL installation and the OpenGL system +headers! This code is based upon Icculus Quake II, which is based upon id Software's original code drop. It's released under the terms of the GPL diff --git a/src/common/qcommon.h b/src/common/qcommon.h index fe7721df..844c26dc 100644 --- a/src/common/qcommon.h +++ b/src/common/qcommon.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../game/baseq2/q_shared.h" -#define VERSION 1.04 +#define VERSION 1.05 #define BASEDIRNAME "baseq2" #if defined __linux__ diff --git a/src/sdl/cd.c b/src/sdl/cd.c index 4e2b3c74..7d008306 100644 --- a/src/sdl/cd.c +++ b/src/sdl/cd.c @@ -201,6 +201,8 @@ void CDAudio_Resume() void CDAudio_Update() { + static int cnt=0; + if(!cd_id || !enabled) return; if(cd_volume && cd_volume->value != cdvolume) { @@ -217,18 +219,21 @@ void CDAudio_Update() cdvolume = cd_volume->value; return; } - - if(cd_nocd->value) - { - CDAudio_Stop(); - return; - } - - if(playLooping && - (SDL_CDStatus(cd_id) != CD_PLAYING) && - (SDL_CDStatus(cd_id) != CD_PAUSED)) - { - CDAudio_Play(lastTrack,true); + // this causes too much overhead to be executed every frame + if(++cnt == 16) { + cnt=0; + if(cd_nocd->value) + { + CDAudio_Stop(); + return; + } + + if(playLooping && + (SDL_CDStatus(cd_id) != CD_PLAYING) && + (SDL_CDStatus(cd_id) != CD_PAUSED)) + { + CDAudio_Play(lastTrack,true); + } } }