From 97a98f0c8685870214444b3237720de9d342b329 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sat, 15 Jul 2017 13:16:50 -1000 Subject: [PATCH] Force X11 scaling to 2X and remove option for now --- src/interface.c | 42 ------------------------------------------ src/video/video.h | 2 +- src/video/xvideo.c | 13 +++++++------ 3 files changed, 8 insertions(+), 49 deletions(-) diff --git a/src/interface.c b/src/interface.c index 95892b66..167a73be 100644 --- a/src/interface.c +++ b/src/interface.c @@ -699,9 +699,6 @@ typedef enum interface_enum_t { OPT_CALIBRATE, OPT_PATH, OPT_COLOR, -#if !VIDEO_OPENGL - OPT_VIDEO, -#endif OPT_VOLUME, OPT_CAPS, @@ -718,9 +715,6 @@ static const char *options[] = " --> Calibrate Joystick", " Path : ", " Color : ", -#if !VIDEO_OPENGL - " Video : ", -#endif " Volume : ", " CAPSlock : ", }; @@ -830,12 +824,6 @@ void c_interface_parameters() (color_mode == COLOR_INTERP) ? "Interpolated" : "Black/White "); break; -#if !VIDEO_OPENGL - case OPT_VIDEO: - sprintf(temp, "%s", (a2_video_mode == VIDEO_1X) ? "1X " : (a2_video_mode == VIDEO_2X) ? "2X " : "Fullscreen"); - break; -#endif - case OPT_JOYSTICK: snprintf(temp, TEMPSIZE, "%s", (joy_mode == JOY_KPAD) ? "Emulated on Keypad" : "PC Joystick "); break; @@ -1008,21 +996,6 @@ void c_interface_parameters() prefs_setLongValue(PREF_DOMAIN_VIDEO, PREF_COLOR_MODE, color_mode); break; -#if !VIDEO_OPENGL - case OPT_VIDEO: - if (a2_video_mode == 1) - { - a2_video_mode = NUM_VIDOPTS-1; - } - else - { - --a2_video_mode; - } - extern void video_set_mode(a2_video_mode_t); - video_set_mode(a2_video_mode); - break; -#endif - case OPT_VOLUME: if (speaker_volume > 0) { @@ -1094,21 +1067,6 @@ void c_interface_parameters() prefs_setLongValue(PREF_DOMAIN_VIDEO, PREF_COLOR_MODE, color_mode); break; -#if !VIDEO_OPENGL - case OPT_VIDEO: - if (a2_video_mode == NUM_VIDOPTS-1) - { - a2_video_mode = 1; - } - else - { - ++a2_video_mode; - } - extern void video_set_mode(a2_video_mode_t); - video_set_mode(a2_video_mode); - break; -#endif - case OPT_VOLUME: speaker_volume++; if (speaker_volume > 10) diff --git a/src/video/video.h b/src/video/video.h index 93782ac8..33959bee 100644 --- a/src/video/video.h +++ b/src/video/video.h @@ -43,7 +43,7 @@ typedef struct A2Color_s { */ extern A2Color_s colormap[]; -#if !VIDEO_OPENGL +#if VIDEO_X11 // X11 scaling ... typedef enum a2_video_mode_t { VIDEO_FULLSCREEN = 0, diff --git a/src/video/xvideo.c b/src/video/xvideo.c index 542deb79..4de83ac5 100644 --- a/src/video/xvideo.c +++ b/src/video/xvideo.c @@ -13,6 +13,8 @@ * */ +#define VIDEO_X11 1 + #include "common.h" #include "video/video.h" @@ -31,7 +33,7 @@ static Display *display; static Window win; static GC gc; static unsigned int width, height; /* window size */ -static unsigned int scale = 1; +static unsigned int scale = 2; static int screen_num; static XVisualInfo visualinfo; @@ -60,7 +62,7 @@ static int bitmap_pad = sizeof(uint32_t); static video_backend_s xvideo_backend = { 0 }; static bool request_set_mode = false; -static int request_mode = 0; +static a2_video_mode_t request_mode = VIDEO_2X; typedef struct { unsigned long flags; @@ -569,10 +571,9 @@ void video_set_mode(a2_video_mode_t mode) { static void _redo_image(void) { _destroy_image(); - int mode = request_mode; - scale = mode; - if (mode == VIDEO_FULLSCREEN) { - scale = 1; // HACK FIXME for now ................ + scale = (int)request_mode; + if (scale == VIDEO_FULLSCREEN) { + scale = 2; // HACK FIXME for now ................ } width = SCANWIDTH*scale;