]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
Squashed commit of the following:
[xonotic/darkplaces.git] / vid_sdl.c
index a9dd5c45db006ee9c36e75928aafa6a4c9d4fce5..0af682106c132b50912443dcab2e3776eee2d072 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -613,11 +613,11 @@ void Sys_SendKeyEvents( void )
                                        {
                                                SDL_FreeSurface(vid_softsurface);
                                                vid_softsurface = SDL_CreateRGBSurface(SDL_SWSURFACE, vid.width, vid.height, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
-                                               vid.softpixels = vid_softsurface->pixels;
+                                               vid.softpixels = (unsigned int *)vid_softsurface->pixels;
                                                SDL_SetAlpha(vid_softsurface, 0, 255);
                                                if (vid.softdepthpixels)
                                                        free(vid.softdepthpixels);
-                                               vid.softdepthpixels = calloc(1, vid.width * vid.height * 4);
+                                               vid.softdepthpixels = (unsigned int*)calloc(1, vid.width * vid.height * 4);
                                        }
 #ifdef SDL_R_RESTART
                                        // better not call R_Modules_Restart from here directly, as this may wreak havoc...
@@ -1162,9 +1162,9 @@ qboolean VID_InitModeSoft(viddef_mode_t *mode)
        }
        SDL_SetAlpha(vid_softsurface, 0, 255);
 
-       vid.softpixels = vid_softsurface->pixels;
-       vid.softdepthpixels = calloc(1, mode->width * mode->height * 4);
-       DPSOFTRAST_Init(mode->width, mode->height, vid_softsurface->pixels, vid.softdepthpixels);
+       vid.softpixels = (unsigned int *)vid_softsurface->pixels;
+       vid.softdepthpixels = (unsigned int *)calloc(1, mode->width * mode->height * 4);
+       DPSOFTRAST_Init(mode->width, mode->height, (unsigned int *)vid_softsurface->pixels, (unsigned int *)vid.softdepthpixels);
 
        // set window title
        VID_SetCaption();
@@ -1192,7 +1192,7 @@ qboolean VID_InitModeSoft(viddef_mode_t *mode)
        vid.support.arb_draw_buffers = true;
        vid.support.arb_occlusion_query = true;
        vid.support.arb_shadow = true;
-       vid.support.arb_texture_compression = true;
+       //vid.support.arb_texture_compression = true;
        vid.support.arb_texture_cube_map = true;
        vid.support.arb_texture_non_power_of_two = false;
        vid.support.arb_vertex_buffer_object = true;
@@ -1200,7 +1200,7 @@ qboolean VID_InitModeSoft(viddef_mode_t *mode)
        vid.support.ext_draw_range_elements = true;
        vid.support.ext_framebuffer_object = true;
        vid.support.ext_texture_3d = true;
-       vid.support.ext_texture_compression_s3tc = true;
+       //vid.support.ext_texture_compression_s3tc = true;
        vid.support.ext_texture_filter_anisotropic = true;
        vid.support.ati_separate_stencil = true;
 
@@ -1262,9 +1262,11 @@ qboolean VID_InitMode(viddef_mode_t *mode)
 {
        if (!SDL_WasInit(SDL_INIT_VIDEO) && SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
                Sys_Error ("Failed to init SDL video subsystem: %s", SDL_GetError());
+#ifdef SSE2_PRESENT
        if (vid_soft.integer)
                return VID_InitModeSoft(mode);
        else
+#endif
                return VID_InitModeGL(mode);
 }