]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
undo an accidental r_test commit in vid_sdl.c
[xonotic/darkplaces.git] / vid_sdl.c
index e7b770d6400252a8ac909be69eaddc14dd207c05..fa35ea55d91e26f31e755c797d75557eecc3d11a 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -66,9 +66,6 @@ int cl_available = true;
 
 qboolean vid_supportrefreshrate = false;
 
-cvar_t vid_soft = {CVAR_SAVE, "vid_soft", "0", "enables use of the DarkPlaces Software Rasterizer rather than OpenGL or Direct3D"};
-cvar_t vid_soft_threads = {CVAR_SAVE, "vid_soft_threads", "2", "the number of threads the DarkPlaces Software Rasterizer should use"}; 
-cvar_t vid_soft_interlace = {CVAR_SAVE, "vid_soft_interlace", "1", "whether the DarkPlaces Software Rasterizer should interlace the screen bands occupied by each thread"};
 cvar_t joy_detected = {CVAR_READONLY, "joy_detected", "0", "number of joysticks detected by engine"};
 cvar_t joy_enable = {CVAR_SAVE, "joy_enable", "0", "enables joystick support"};
 cvar_t joy_index = {0, "joy_index", "0", "selects which joystick to use if you have multiple"};
@@ -1688,6 +1685,9 @@ void GLES_Init(void)
        
        // LordHavoc: report supported extensions
        Con_DPrintf("\nQuakeC extensions for server and client: %s\nQuakeC extensions for menu: %s\n", vm_sv_extensions, vm_m_extensions );
+
+       // GLES devices in general do not like GL_BGRA, so use GL_RGBA
+       vid.forcetextype = TEXTYPE_RGBA;
        
        vid.support.gl20shaders = true;
        vid.support.amd_texture_texture4 = false;
@@ -1712,6 +1712,7 @@ void GLES_Init(void)
        vid.support.ext_texture_compression_s3tc = false;
        vid.support.ext_texture_edge_clamp = true;
        vid.support.ext_texture_filter_anisotropic = false; // probably don't want to use it...
+       vid.support.ext_texture_srgb = false;
 
        qglGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_2d);
        if (vid.support.ext_texture_filter_anisotropic)
@@ -1774,9 +1775,6 @@ void VID_Init (void)
        Cvar_RegisterVariable(&apple_mouse_noaccel);
 #endif
 #endif
-       Cvar_RegisterVariable(&vid_soft);
-       Cvar_RegisterVariable(&vid_soft_threads);
-       Cvar_RegisterVariable(&vid_soft_interlace);
        Cvar_RegisterVariable(&joy_detected);
        Cvar_RegisterVariable(&joy_enable);
        Cvar_RegisterVariable(&joy_index);
@@ -2304,6 +2302,7 @@ qboolean VID_InitModeSoft(viddef_mode_t *mode)
        int i;
 #if SETVIDEOMODE
        int flags = SDL_HWSURFACE;
+       if(!COM_CheckParm("-noasyncblit")) flags |= SDL_ASYNCBLIT;
 #else
        int windowflags = SDL_WINDOW_SHOWN;
 #endif
@@ -2384,62 +2383,7 @@ qboolean VID_InitModeSoft(viddef_mode_t *mode)
        // enable key repeat since everyone expects it
        SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 
-       gl_platform = "SDLSoft";
-       gl_platformextensions = "";
-
-       gl_renderer = "DarkPlaces-Soft";
-       gl_vendor = "Forest Hale";
-       gl_version = "0.0";
-       gl_extensions = "";
-
-       // clear the extension flags
-       memset(&vid.support, 0, sizeof(vid.support));
-       Cvar_SetQuick(&gl_info_extensions, "");
-
-       vid.forcevbo = false;
-       vid.support.arb_depth_texture = true;
-       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_cube_map = true;
-       vid.support.arb_texture_non_power_of_two = false;
-       vid.support.arb_vertex_buffer_object = true;
-       vid.support.ext_blend_subtract = true;
-       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_filter_anisotropic = true;
-       vid.support.ati_separate_stencil = true;
-
-       vid.maxtexturesize_2d = 16384;
-       vid.maxtexturesize_3d = 512;
-       vid.maxtexturesize_cubemap = 16384;
-       vid.texunits = 4;
-       vid.teximageunits = 32;
-       vid.texarrayunits = 8;
-       vid.max_anisotropy = 1;
-       vid.maxdrawbuffers = 4;
-
-       vid.texunits = bound(4, vid.texunits, MAX_TEXTUREUNITS);
-       vid.teximageunits = bound(16, vid.teximageunits, MAX_TEXTUREUNITS);
-       vid.texarrayunits = bound(8, vid.texarrayunits, MAX_TEXTUREUNITS);
-       Con_DPrintf("Using DarkPlaces Software Rasterizer rendering path\n");
-       vid.renderpath = RENDERPATH_SOFT;
-       vid.useinterleavedarrays = false;
-
-       Cvar_SetQuick(&gl_info_vendor, gl_vendor);
-       Cvar_SetQuick(&gl_info_renderer, gl_renderer);
-       Cvar_SetQuick(&gl_info_version, gl_version);
-       Cvar_SetQuick(&gl_info_platform, gl_platform ? gl_platform : "");
-       Cvar_SetQuick(&gl_info_driver, gl_driver);
-
-       // LordHavoc: report supported extensions
-       Con_DPrintf("\nQuakeC extensions for server and client: %s\nQuakeC extensions for menu: %s\n", vm_sv_extensions, vm_m_extensions );
-
-       // clear to black (loading plaque will be seen over this)
-       GL_Clear(GL_COLOR_BUFFER_BIT, NULL, 1.0f, 128);
+       VID_Soft_SharedSetup();
 
        vid_numjoysticks = SDL_NumJoysticks();
        vid_numjoysticks = bound(0, vid_numjoysticks, MAX_JOYSTICKS);
@@ -2474,7 +2418,7 @@ 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
+#ifdef SSE_POSSIBLE
        if (vid_soft.integer)
                return VID_InitModeSoft(mode);
        else
@@ -2576,8 +2520,11 @@ void VID_Finish (void)
                case RENDERPATH_SOFT:
                        DPSOFTRAST_Finish();
 #if SETVIDEOMODE
+//             if (!r_test.integer)
+               {
                        SDL_BlitSurface(vid_softsurface, NULL, screen, NULL);
                        SDL_Flip(screen);
+               }
 #else
                        {
                                SDL_Surface *screen = SDL_GetWindowSurface(window);