Brought back evil DirectSound hack for SDL/SGL

This commit is contained in:
Dabb 2000-12-29 16:20:38 +00:00
parent 2d4ced491e
commit 1d2e83bb66
3 changed files with 41 additions and 3 deletions

View file

@ -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)
{
}

View file

@ -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 <windows.h>
#include <SDL_syswm.h>
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

View file

@ -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 <windows.h>
#include <SDL_syswm.h>
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
}