ref: c29ba6610fad7155c76bda66aa44c2e803df5ed7
parent: 25984213e8b3e751e3bc5840c8ad13042ac21b42
author: Olav Sørensen <olav.sorensen@live.no>
date: Tue May 12 07:19:18 EDT 2020
Added an INTEGERSCALING option to protracker.ini
--- a/release/macos/protracker.ini
+++ b/release/macos/protracker.ini
@@ -42,6 +42,25 @@
;
PIXELFILTER=NEAREST
+; Integer scaling of pixels
+; Syntax: TRUE or FALSE
+; Default value: TRUE
+; Comment: If the image is not completely stretched out vertically
+; in fullscreen mode, disabling this option will make it do so.
+; The aspect ratio will be maintained. However, the pixels might not
+; look perfect. This is best used together with PIXELFILTER=LINEAR
+; (or BEST). The image will look blurry though...
+;
+INTEGERSCALING=TRUE
+
+; Make fullscreen mode completely stretch out the image to fit the whole screen
+; Syntax: TRUE or FALSE
+; Default value: FALSE
+; Comment: Setting this to TRUE will in most cases ruin the aspect
+; ratio of the image. Please look at the INTEGERSCALING option as well.
+;
+FULLSCREENSTRETCH=FALSE
+
; Turn off vsync
; Syntax: TRUE or FALSE
; Default value: FALSE
@@ -60,11 +79,7 @@
;
HWMOUSE=TRUE
-; Make fullscreen mode stretch out the image to fit the whole screen
-; Syntax: TRUE or FALSE
-; Default value: FALSE
-;
-FULLSCREENSTRETCH=FALSE
+
[GENERAL SETTINGS]
; Hide last modification dates in Disk Op. to get longer dir/file names
--- a/release/other/protracker.ini
+++ b/release/other/protracker.ini
@@ -42,6 +42,25 @@
;
PIXELFILTER=NEAREST
+; Integer scaling of pixels
+; Syntax: TRUE or FALSE
+; Default value: TRUE
+; Comment: If the image is not completely stretched out vertically
+; in fullscreen mode, disabling this option will make it do so.
+; The aspect ratio will be maintained. However, the pixels might not
+; look perfect. This is best used together with PIXELFILTER=LINEAR
+; (or BEST). The image will look blurry though...
+;
+INTEGERSCALING=TRUE
+
+; Make fullscreen mode completely stretch out the image to fit the whole screen
+; Syntax: TRUE or FALSE
+; Default value: FALSE
+; Comment: Setting this to TRUE will in most cases ruin the aspect
+; ratio of the image. Please look at the INTEGERSCALING option as well.
+;
+FULLSCREENSTRETCH=FALSE
+
; Turn off vsync
; Syntax: TRUE or FALSE
; Default value: FALSE
@@ -60,11 +79,7 @@
;
HWMOUSE=TRUE
-; Make fullscreen mode stretch out the image to fit the whole screen
-; Syntax: TRUE or FALSE
-; Default value: FALSE
-;
-FULLSCREENSTRETCH=FALSE
+
[GENERAL SETTINGS]
; Hide last modification dates in Disk Op. to get longer dir/file names
--- a/release/win32/protracker.ini
+++ b/release/win32/protracker.ini
@@ -42,6 +42,25 @@
;
PIXELFILTER=NEAREST
+; Integer scaling of pixels
+; Syntax: TRUE or FALSE
+; Default value: TRUE
+; Comment: If the image is not completely stretched out vertically
+; in fullscreen mode, disabling this option will make it do so.
+; The aspect ratio will be maintained. However, the pixels might not
+; look perfect. This is best used together with PIXELFILTER=LINEAR
+; (or BEST). The image will look blurry though...
+;
+INTEGERSCALING=TRUE
+
+; Make fullscreen mode completely stretch out the image to fit the whole screen
+; Syntax: TRUE or FALSE
+; Default value: FALSE
+; Comment: Setting this to TRUE will in most cases ruin the aspect
+; ratio of the image. Please look at the INTEGERSCALING option as well.
+;
+FULLSCREENSTRETCH=FALSE
+
; Turn off vsync
; Syntax: TRUE or FALSE
; Default value: FALSE
@@ -60,11 +79,7 @@
;
HWMOUSE=TRUE
-; Make fullscreen mode stretch out the image to fit the whole screen
-; Syntax: TRUE or FALSE
-; Default value: FALSE
-;
-FULLSCREENSTRETCH=FALSE
+
[GENERAL SETTINGS]
; Hide last modification dates in Disk Op. to get longer dir/file names
--- a/release/win64/protracker.ini
+++ b/release/win64/protracker.ini
@@ -42,6 +42,25 @@
;
PIXELFILTER=NEAREST
+; Integer scaling of pixels
+; Syntax: TRUE or FALSE
+; Default value: TRUE
+; Comment: If the image is not completely stretched out vertically
+; in fullscreen mode, disabling this option will make it do so.
+; The aspect ratio will be maintained. However, the pixels might not
+; look perfect. This is best used together with PIXELFILTER=LINEAR
+; (or BEST). The image will look blurry though...
+;
+INTEGERSCALING=TRUE
+
+; Make fullscreen mode completely stretch out the image to fit the whole screen
+; Syntax: TRUE or FALSE
+; Default value: FALSE
+; Comment: Setting this to TRUE will in most cases ruin the aspect
+; ratio of the image. Please look at the INTEGERSCALING option as well.
+;
+FULLSCREENSTRETCH=FALSE
+
; Turn off vsync
; Syntax: TRUE or FALSE
; Default value: FALSE
@@ -60,11 +79,7 @@
;
HWMOUSE=TRUE
-; Make fullscreen mode stretch out the image to fit the whole screen
-; Syntax: TRUE or FALSE
-; Default value: FALSE
-;
-FULLSCREENSTRETCH=FALSE
+
[GENERAL SETTINGS]
; Hide last modification dates in Disk Op. to get longer dir/file names
--- a/src/pt2_config.c
+++ b/src/pt2_config.c
@@ -64,6 +64,7 @@
config.sampleLowpass = true;
config.startInFullscreen = false;
config.pixelFilter = PIXELFILTER_NEAREST;
+ config.integerScaling = true;
#ifndef _WIN32
getcwd(oldCwd, PATH_MAX);
@@ -210,6 +211,13 @@
{
if (!_strnicmp(&configLine[9], "TRUE", 4)) config.vsyncOff = true;
else if (!_strnicmp(&configLine[9], "FALSE", 5)) config.vsyncOff = false;
+ }
+
+ // INTEGERSCALING
+ else if (!_strnicmp(configLine, "INTEGERSCALING=", 15))
+ {
+ if (!_strnicmp(&configLine[15], "TRUE", 4)) config.integerScaling = true;
+ else if (!_strnicmp(&configLine[15], "FALSE", 5)) config.integerScaling = false;
}
// FULLSCREENSTRETCH
--- a/src/pt2_config.h
+++ b/src/pt2_config.h
@@ -15,7 +15,7 @@
char *defModulesDir, *defSamplesDir;
bool dottedCenterFlag, pattDots, a500LowPassFilter, compoMode, autoCloseDiskOp, hideDiskOpDates, hwMouse;
bool transDel, fullScreenStretch, vsyncOff, modDot, blankZeroFlag, realVuMeters, rememberPlayMode;
- bool sampleLowpass, startInFullscreen;
+ bool sampleLowpass, startInFullscreen, integerScaling;
int8_t stereoSeparation, videoScaleFactor, accidental;
uint8_t pixelFilter;
uint16_t quantizeValue;
--- a/src/pt2_visuals.c
+++ b/src/pt2_visuals.c
@@ -2549,7 +2549,7 @@
SDL_RenderSetLogicalSize(video.renderer, SCREEN_W, SCREEN_H);
#if SDL_PATCHLEVEL >= 5
- SDL_RenderSetIntegerScale(video.renderer, SDL_TRUE);
+ SDL_RenderSetIntegerScale(video.renderer, config.integerScaling ? SDL_TRUE : SDL_FALSE);
#endif
SDL_SetRenderDrawBlendMode(video.renderer, SDL_BLENDMODE_NONE);
--- a/vs2019_project/pt2-clone/protracker.ini
+++ b/vs2019_project/pt2-clone/protracker.ini
@@ -42,6 +42,25 @@
;
PIXELFILTER=NEAREST
+; Integer scaling of pixels
+; Syntax: TRUE or FALSE
+; Default value: TRUE
+; Comment: If the image is not completely stretched out vertically
+; in fullscreen mode, disabling this option will make it do so.
+; The aspect ratio will be maintained. However, the pixels might not
+; look perfect. This is best used together with PIXELFILTER=LINEAR
+; (or BEST). The image will look blurry though...
+;
+INTEGERSCALING=TRUE
+
+; Make fullscreen mode completely stretch out the image to fit the whole screen
+; Syntax: TRUE or FALSE
+; Default value: FALSE
+; Comment: Setting this to TRUE will in most cases ruin the aspect
+; ratio of the image. Please look at the INTEGERSCALING option as well.
+;
+FULLSCREENSTRETCH=FALSE
+
; Turn off vsync
; Syntax: TRUE or FALSE
; Default value: FALSE
@@ -60,11 +79,7 @@
;
HWMOUSE=TRUE
-; Make fullscreen mode stretch out the image to fit the whole screen
-; Syntax: TRUE or FALSE
-; Default value: FALSE
-;
-FULLSCREENSTRETCH=FALSE
+
[GENERAL SETTINGS]
; Hide last modification dates in Disk Op. to get longer dir/file names