shithub: choc

Download patch

ref: 8d3e982584c8ea904fe7c12044c147a19494310d
parent: f48bc14086eeeacc5f3bab4361d7302f019baca5
author: Mike Swanson <mikeonthecomputer@gmail.com>
date: Sat Mar 31 20:41:03 EDT 2018

Revert "video: allow setting linear filtering via config file"

Due to a misunderstanding of the rendering buffers, the prior commit
was a little pointless.  To achieve the same effect, instead use
`max_scaling_buffer_pixels 64000` in the extra cfg.

This reverts commit f48bc14086eeeacc5f3bab4361d7302f019baca5.

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -104,10 +104,6 @@
 
 char *window_position = "center";
 
-// Scaling filter applied
-
-char *scaling_filter = "nearest";
-
 // SDL display number on which to run.
 
 int video_display = 0;
@@ -1294,20 +1290,11 @@
         SDL_DestroyTexture(texture);
     }
 
-    // Set the scaling quality for rendering and immediate texture.
-    // Defaults to "nearest", which is gritty and pixelated and resembles
-    // software scaling pretty well.  "linear" can be set as an alternative,
-    // which may give better results at low resolutions.
+    // Set the scaling quality for rendering the intermediate texture into
+    // the upscaled texture to "nearest", which is gritty and pixelated and
+    // resembles software scaling pretty well.
 
-    if (!strcmp(scaling_filter, "linear"))
-    {
-        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
-    }
-    else
-    {
-        scaling_filter = "nearest";
-        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
-    }
+    SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
 
     // Create the intermediate texture that the RGBA surface gets loaded into.
     // The SDL_TEXTUREACCESS_STREAMING flag means that this texture's content
@@ -1469,7 +1456,6 @@
     M_BindIntVariable("grabmouse",                 &grabmouse);
     M_BindStringVariable("video_driver",           &video_driver);
     M_BindStringVariable("window_position",        &window_position);
-    M_BindStringVariable("scaling_filter",         &scaling_filter);
     M_BindIntVariable("usegamma",                  &usegamma);
     M_BindIntVariable("png_screenshots",           &png_screenshots);
 }
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -86,7 +86,6 @@
 extern int usegamma;
 extern pixel_t *I_VideoBuffer;
 
-extern char *scaling_filter;
 extern int screen_width;
 extern int screen_height;
 extern int fullscreen;
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -706,16 +706,6 @@
     CONFIG_VARIABLE_STRING(window_position),
 
     //!
-    //
-    // Scaling filter to use, accepted values are "nearest" (default)
-    // and "linear" - nearest gives a crisper display, but linear
-    // might produce more pleasing results at low resolutions
-    // (sub-640x480).
-    //
-
-    CONFIG_VARIABLE_STRING(scaling_filter),
-
-    //!
     // If non-zero, the game will run in full screen mode.  If zero,
     // the game will run in a window.
     //
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -65,7 +65,6 @@
 
 static char *video_driver = "";
 static char *window_position = "";
-static char *scaling_filter = "nearest";
 static int aspect_ratio_correct = 1;
 static int integer_scaling = 0;
 static int vga_porch_flash = 0;
@@ -262,7 +261,6 @@
     M_BindIntVariable("startup_delay",             &startup_delay);
     M_BindStringVariable("video_driver",           &video_driver);
     M_BindStringVariable("window_position",        &window_position);
-    M_BindStringVariable("scaling_filter",         &scaling_filter);
     M_BindIntVariable("usegamma",                  &usegamma);
     M_BindIntVariable("png_screenshots",           &png_screenshots);
     M_BindIntVariable("vga_porch_flash",           &vga_porch_flash);