From 1d2e83bb666fbb1c1bba4b2367a2428a7734e914 Mon Sep 17 00:00:00 2001 From: Dabb Date: Fri, 29 Dec 2000 16:20:38 +0000 Subject: [PATCH] Brought back evil DirectSound hack for SDL/SGL --- source/cl_sys_sdl.c | 9 +++++++-- source/vid_sdl.c | 17 ++++++++++++++++- source/vid_sgl.c | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/source/cl_sys_sdl.c b/source/cl_sys_sdl.c index 82e1c4c..2d56004 100644 --- a/source/cl_sys_sdl.c +++ b/source/cl_sys_sdl.c @@ -218,7 +218,7 @@ Sys_Error (char *error, ...) Host_Shutdown (); exit (1); } - +/* void Sys_Printf (char *fmt, ...) { @@ -229,7 +229,7 @@ Sys_Printf (char *fmt, ...) va_end (argptr); } - +*/ void Sys_Quit (void) { @@ -307,3 +307,8 @@ SDL_main (int c, char **v) } } + +/* fixme: evil stub for directsound crap */ +IN_Accumulate (void) +{ +} diff --git a/source/vid_sdl.c b/source/vid_sdl.c index 53f6ef2..7927942 100644 --- a/source/vid_sdl.c +++ b/source/vid_sdl.c @@ -50,8 +50,14 @@ extern viddef_t vid; // global video state unsigned short d_8to16table[256]; int modestate; // fixme: just to avoid cross-comp. + // errors - remove later - // errors - remove later +#ifdef WIN32 +/* fixme: this is evil hack to get full DirectSound support with SDL */ +#include +#include +HWND mainwindow; +#endif // The original defaults #define BASEWIDTH 320 @@ -167,6 +173,15 @@ VID_Init (unsigned char *palette) // initialize the mouse SDL_ShowCursor (0); +#ifdef WIN32 + // fixme: EVIL thing - but needed for win32 until + // SDL_sound works better - without this DirectSound fails. + +// SDL_GetWMInfo(&info); +// mainwindow=info.window; + mainwindow=GetActiveWindow(); +#endif + } void diff --git a/source/vid_sgl.c b/source/vid_sgl.c index b78614c..347ecba 100644 --- a/source/vid_sgl.c +++ b/source/vid_sgl.c @@ -52,6 +52,13 @@ static qboolean vid_initialized = false; cvar_t *vid_fullscreen; +#ifdef WIN32 +/* fixme: this is evil hack to get full DirectSound support with SDL */ +#include +#include +HWND mainwindow; +#endif + int VID_options_items = 1; int modestate; @@ -115,6 +122,8 @@ VID_Init (unsigned char *palette) Uint32 flags = SDL_OPENGL; int i; +// SDL_SysWMinfo info; + VID_GetWindowSize (640, 480); vid.maxwarpwidth = WARP_WIDTH; @@ -196,6 +205,15 @@ VID_Init (unsigned char *palette) vid_initialized = true; +#ifdef WIN32 + // fixme: EVIL thing - but needed for win32 until + // SDL_sound works better - without this DirectSound fails. + +// SDL_GetWMInfo(&info); +// mainwindow=info.window; + mainwindow=GetActiveWindow(); +#endif + vid.recalc_refdef = 1; // force a surface cache flush }