All support for playing back CD-DA has been removed by leaving only the
SDL2 clients, and it is rather unlikely for CD-DA support to come back.
However while doing so, the CONFIG_CD macro was disabled in the makefile
but not the MSVC project, which broke faketracks (i.e. background music
via track003.ogg files) on Linux.
This change removes all #ifdefs for CONFIG_CD as well as its enablement
in the MSVC project, which is basically equivalent to having the feature
always being enabled.
Fixes background music in Quake with ripped music, Nexuiz, Xonotic, and
probably many other DP-based games. Also fixes Xonotic log spam about
gettime(GETTIME_CDTRACK).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12466
d7cf8633-e32d-0410-b094-
e92efae38249
// cl_parse.c -- parse a message received from the server
#include "quakedef.h"
// cl_parse.c -- parse a message received from the server
#include "quakedef.h"
#include "cl_collision.h"
#include "csprogs.h"
#include "libcurl.h"
#include "cl_collision.h"
#include "csprogs.h"
#include "libcurl.h"
case qw_svc_cdtrack:
cl.cdtrack = cl.looptrack = MSG_ReadByte(&cl_message);
case qw_svc_cdtrack:
cl.cdtrack = cl.looptrack = MSG_ReadByte(&cl_message);
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
CDAudio_Play ((unsigned char)cls.forcetrack, true);
else
CDAudio_Play ((unsigned char)cl.cdtrack, true);
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
CDAudio_Play ((unsigned char)cls.forcetrack, true);
else
CDAudio_Play ((unsigned char)cl.cdtrack, true);
break;
case qw_svc_intermission:
break;
case qw_svc_intermission:
case qw_svc_setpause:
cl.paused = MSG_ReadByte(&cl_message) != 0;
case qw_svc_setpause:
cl.paused = MSG_ReadByte(&cl_message) != 0;
if (cl.paused)
CDAudio_Pause ();
else
CDAudio_Resume ();
if (cl.paused)
CDAudio_Pause ();
else
CDAudio_Resume ();
S_PauseGameSounds (cl.paused);
break;
}
S_PauseGameSounds (cl.paused);
break;
}
case svc_setpause:
cl.paused = MSG_ReadByte(&cl_message) != 0;
case svc_setpause:
cl.paused = MSG_ReadByte(&cl_message) != 0;
if (cl.paused)
CDAudio_Pause ();
else
CDAudio_Resume ();
if (cl.paused)
CDAudio_Pause ();
else
CDAudio_Resume ();
S_PauseGameSounds (cl.paused);
break;
S_PauseGameSounds (cl.paused);
break;
case svc_cdtrack:
cl.cdtrack = MSG_ReadByte(&cl_message);
cl.looptrack = MSG_ReadByte(&cl_message);
case svc_cdtrack:
cl.cdtrack = MSG_ReadByte(&cl_message);
cl.looptrack = MSG_ReadByte(&cl_message);
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
CDAudio_Play ((unsigned char)cls.forcetrack, true);
else
CDAudio_Play ((unsigned char)cl.cdtrack, true);
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
CDAudio_Play ((unsigned char)cls.forcetrack, true);
else
CDAudio_Play ((unsigned char)cl.cdtrack, true);
break;
case svc_intermission:
break;
case svc_intermission:
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
<Optimization>Disabled</Optimization>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
<Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>CONFIG_MENU;CONFIG_CD;CONFIG_VIDEO_CAPTURE;WIN32;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>CONFIG_MENU;CONFIG_VIDEO_CAPTURE;WIN32;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<MinimalRebuild>true</MinimalRebuild>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
<MinimalRebuild>true</MinimalRebuild>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
</Midl>\r
<ClCompile>\r
<Optimization>Disabled</Optimization>\r
</Midl>\r
<ClCompile>\r
<Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>CONFIG_MENU;CONFIG_CD;CONFIG_VIDEO_CAPTURE;WIN32;WIN64;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>CONFIG_MENU;CONFIG_VIDEO_CAPTURE;WIN32;WIN64;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<MinimalRebuild>true</MinimalRebuild>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
<MinimalRebuild>true</MinimalRebuild>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
<ClCompile>\r
<Optimization>MaxSpeed</Optimization>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
<ClCompile>\r
<Optimization>MaxSpeed</Optimization>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
- <PreprocessorDefinitions>CONFIG_MENU;CONFIG_CD;CONFIG_VIDEO_CAPTURE;WIN32;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>CONFIG_MENU;CONFIG_VIDEO_CAPTURE;WIN32;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<PrecompiledHeader />\r
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<PrecompiledHeader />\r
<ClCompile>\r
<Optimization>MaxSpeed</Optimization>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
<ClCompile>\r
<Optimization>MaxSpeed</Optimization>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
- <PreprocessorDefinitions>CONFIG_MENU;CONFIG_CD;CONFIG_VIDEO_CAPTURE;WIN32;WIN64;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>CONFIG_MENU;CONFIG_VIDEO_CAPTURE;WIN32;WIN64;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<PrecompiledHeader />\r
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<PrecompiledHeader />\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
</ImportGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
</ImportGroup>\r
-</Project>
\ No newline at end of file
#include <time.h>
#include "libcurl.h"
#include <time.h>
#include "libcurl.h"
#include "cl_video.h"
#include "progsvm.h"
#include "csprogs.h"
#include "cl_video.h"
#include "progsvm.h"
#include "csprogs.h"
else
S_Update(&r_refdef.view.matrix);
else
S_Update(&r_refdef.view.matrix);
CDAudio_Update();
R_TimeReport("audio");
CDAudio_Update();
R_TimeReport("audio");
// reset gathering of mouse input
in_mouse_x = in_mouse_y = 0;
// reset gathering of mouse input
in_mouse_x = in_mouse_y = 0;
// make sure we open sockets before opening video because the Windows Firewall "unblock?" dialog can screw up the graphics context on some graphics drivers
NetConn_UpdateSockets();
VID_Start();
// make sure we open sockets before opening video because the Windows Firewall "unblock?" dialog can screw up the graphics context on some graphics drivers
NetConn_UpdateSockets();
VID_Start();
VID_Init();
Render_Init();
S_Init();
VID_Init();
Render_Init();
S_Init();
S_Terminate ();
Curl_Shutdown ();
NetConn_Shutdown ();
S_Terminate ();
Curl_Shutdown ();
NetConn_Shutdown ();
#include "image.h"
#include "progsvm.h"
#include "image.h"
#include "progsvm.h"
else if (options_cursor == optnum++) Cvar_SetValueQuick(&v_contrast, bound(1, v_contrast.value + dir * 0.0625, 4));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&v_gamma, bound(0.5, v_gamma.value + dir * 0.0625, 3));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&volume, bound(0, volume.value + dir * 0.0625, 1));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&v_contrast, bound(1, v_contrast.value + dir * 0.0625, 4));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&v_gamma, bound(0.5, v_gamma.value + dir * 0.0625, 3));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&volume, bound(0, volume.value + dir * 0.0625, 1));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&bgmvolume, bound(0, bgmvolume.value + dir * 0.0625, 1));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&bgmvolume, bound(0, bgmvolume.value + dir * 0.0625, 1));
M_Options_PrintSlider( " Brightness", true, v_contrast.value, 1, 2);
M_Options_PrintSlider( " Gamma", true, v_gamma.value, 0.5, 3);
M_Options_PrintSlider( " Sound Volume", snd_initialized.integer, volume.value, 0, 1);
M_Options_PrintSlider( " Brightness", true, v_contrast.value, 1, 2);
M_Options_PrintSlider( " Gamma", true, v_gamma.value, 0.5, 3);
M_Options_PrintSlider( " Sound Volume", snd_initialized.integer, volume.value, 0, 1);
M_Options_PrintSlider( " Music Volume", cdaudioinitialized.integer, bgmvolume.value, 0, 1);
M_Options_PrintSlider( " Music Volume", cdaudioinitialized.integer, bgmvolume.value, 0, 1);
M_Options_PrintCommand( " Customize Effects", true);
M_Options_PrintCommand( " Effects: Quake", true);
M_Options_PrintCommand( " Effects: Normal", true);
M_Options_PrintCommand( " Customize Effects", true);
M_Options_PrintCommand( " Effects: Quake", true);
M_Options_PrintCommand( " Effects: Normal", true);
float gettime(prvm_prog_t *prog)
=========
*/
float gettime(prvm_prog_t *prog)
=========
*/
float CDAudio_GetPosition(void);
float CDAudio_GetPosition(void);
void VM_gettime(prvm_prog_t *prog)
{
int timer_index;
void VM_gettime(prvm_prog_t *prog)
{
int timer_index;
case 3: // GETTIME_UPTIME
PRVM_G_FLOAT(OFS_RETURN) = realtime;
break;
case 3: // GETTIME_UPTIME
PRVM_G_FLOAT(OFS_RETURN) = realtime;
break;
case 4: // GETTIME_CDTRACK
PRVM_G_FLOAT(OFS_RETURN) = CDAudio_GetPosition();
break;
case 4: // GETTIME_CDTRACK
PRVM_G_FLOAT(OFS_RETURN) = CDAudio_GetPosition();
break;
default:
VM_Warning(prog, "VM_gettime: %s: unsupported timer specified, returning realtime\n", prog->name);
PRVM_G_FLOAT(OFS_RETURN) = realtime;
default:
VM_Warning(prog, "VM_gettime: %s: unsupported timer specified, returning realtime\n", prog->name);
PRVM_G_FLOAT(OFS_RETURN) = realtime;
#include "snd_ogg.h"
#include "csprogs.h"
#include "cl_collision.h"
#include "snd_ogg.h"
#include "csprogs.h"
#include "cl_collision.h"
#define SND_MIN_SPEED 8000
#define SND_MIN_SPEED 8000
if (snd_renderbuffer == NULL)
return;
if (snd_renderbuffer == NULL)
return;
// stop CD audio because it may be using a faketrack
CDAudio_Stop();
// stop CD audio because it may be using a faketrack
CDAudio_Stop();
if (simsound || SndSys_LockRenderBuffer ())
{
if (simsound || SndSys_LockRenderBuffer ())
{
#include "image.h"
#ifdef WIN32
#include "image.h"
#ifdef WIN32