]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
fixed some issues with how D3D=1 worked in the makefile
[xonotic/darkplaces.git] / vid_sdl.c
index c368bbc126f650cd257891f824c096a6479a4d46..e751030db90594cec9ec21100bccf92f9111e8c8 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -388,7 +388,7 @@ void Sys_SendKeyEvents( void )
                                break;
                        case SDL_KEYDOWN:
                        case SDL_KEYUP:
-                               Key_Event( MapKey( event.key.keysym.sym ), (char)event.key.keysym.unicode, (event.key.state == SDL_PRESSED) );
+                               Key_Event( MapKey( event.key.keysym.sym ), event.key.keysym.unicode, (event.key.state == SDL_PRESSED) );
                                break;
                        case SDL_ACTIVEEVENT:
                                if( event.active.state & SDL_APPACTIVE )
@@ -488,7 +488,7 @@ void VID_Init (void)
        //Cvar_RegisterVariable(&joy_sensitivityroll);
        
 #ifdef SDL_R_RESTART
-       R_RegisterModule("SDL", sdl_start, sdl_shutdown, sdl_newmap);
+       R_RegisterModule("SDL", sdl_start, sdl_shutdown, sdl_newmap, NULL, NULL);
 #endif
 
        if (SDL_Init(SDL_INIT_VIDEO) < 0)
@@ -549,9 +549,19 @@ static void VID_SetIcon(void)
        int thenone = -1;
        static SDL_Color palette[256];
        unsigned short palenc[256]; // store color id by char
+       char *xpm;
+       char **idata, *data;
 
-       char **idata = ENGINE_ICON;
-       char *data = idata[0];
+       xpm = (char *) FS_LoadFile("darkplaces-icon.xpm", tempmempool, false, NULL);
+       idata = NULL;
+       if(xpm)
+               idata = XPM_DecodeString(xpm);
+       if(!idata)
+               idata = ENGINE_ICON;
+       if(xpm)
+               Mem_Free(xpm);
+
+       data = idata[0];
 
        if(sscanf(data, "%i %i %i %i", &width, &height, &colors, &isize) != 4)
        {
@@ -761,7 +771,6 @@ qboolean VID_InitMode(viddef_mode_t *mode)
 
        gl_platform = "SDL";
        gl_platformextensions = "";
-       gl_videosyncavailable = true;
 
        GL_Init();