Commit 2e6276cf authored by Kiste's avatar Kiste
Browse files

Add option for linear scaling

parent 5928d4ff
......@@ -225,7 +225,7 @@ static void draw() {
static int accframe = 0;
static void usage(char *argv0) {
fprintf(stderr, "Usage: %s [-nosound] [-window] [-reverse] [-brightness n] [-nowait] [-accframe]\n", argv0);
fprintf(stderr, "Usage: %s [-nosound] [-window] [-reverse] [-brightness n] [-nowait] [-accframe] [-linear]\n", argv0);
}
static void parseArgs(int argc, char *argv[]) {
......@@ -235,6 +235,8 @@ static void parseArgs(int argc, char *argv[]) {
noSound = 1;
} else if ( strcmp(argv[i], "-window") == 0 ) {
windowMode = 1;
} else if ( strcmp(argv[i], "-linear") == 0 ) {
linearScaling = 1;
} else if ( strcmp(argv[i], "-reverse") == 0 ) {
buttonReversed = 1;
} else if ( (strcmp(argv[i], "-brightness") == 0) && argv[i+1] ) {
......@@ -269,7 +271,7 @@ int main(int argc, char *argv[]) {
parseArgs(argc, argv);
initDegutil();
initSDL(windowMode);
initSDL(windowMode, linearScaling);
if ( !noSound ) initSound();
initFirst();
initTitle();
......
......@@ -24,6 +24,7 @@
#include "attractmanager.h"
int windowMode = 0;
int linearScaling = 0;
int brightness = DEFAULT_BRIGHTNESS;
static SDL_Surface *video, *layer, *lpanel, *rpanel, *helperSurface = NULL;
......@@ -121,7 +122,7 @@ static void makeSmokeBuf() {
}
}
void initSDL(int window) {
void initSDL(int window, int scaling) {
Uint8 videoBpp;
Uint32 windowFlags;
SDL_PixelFormat *pfrm;
......@@ -135,7 +136,7 @@ void initSDL(int window) {
videoBpp = BPP;
windowFlags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_INPUT_FOCUS;
if ( !window ) windowFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaling ? "linear" : "nearest");
sdlWindow = SDL_CreateWindow(CAPTION, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, windowFlags);
if ( sdlWindow == NULL ) {
......
......@@ -37,6 +37,7 @@
#define DEFAULT_BRIGHTNESS 224
extern int windowMode;
extern int linearScaling;
extern LayerBit *l1buf, *l2buf;
extern LayerBit *buf;
extern LayerBit *lpbuf, *rpbuf;
......@@ -45,7 +46,7 @@ extern SDL_Joystick *stick;
extern int buttonReversed;
extern int brightness;
void initSDL(int window);
void initSDL(int window, int linearScaling);
void closeSDL();
void blendScreen();
void flipScreen();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment