Add integerscale option

This commit is contained in:
BEN ENGLISCH
2021-07-21 08:32:03 +09:00
committed by kichikuou
parent 98e1355461
commit f66ebff002
3 changed files with 17 additions and 0 deletions
+1
View File
@@ -44,6 +44,7 @@ extern void sdl_getWindowInfo(DispInfo *info);
extern void sdl_setFullscreen(boolean on);
extern boolean sdl_isFullscreen(void);
extern agsurface_t *sdl_getDIB(void);
extern void sdl_setIntegerScaling(boolean bool);
/* 画面更新 */
extern void sdl_updateArea(MyRectangle *src, MyPoint *dst);
+6
View File
@@ -41,6 +41,7 @@ static void makeDIB(int width, int height, int depth);
struct sdl_private_data *sdl_videodev;
static int joy_device_index = -1;
static boolean integer_scaling = FALSE;
#ifdef HAVE_SDLJOY
static SDL_Joystick *js;
@@ -158,6 +159,7 @@ static void window_init(void) {
SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT,
flags);
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
SDL_RenderSetIntegerScale(sdl_renderer, integer_scaling);
}
static void makeDIB(int width, int height, int depth) {
@@ -275,6 +277,10 @@ void sdl_setJoyDeviceIndex(int index) {
joy_device_index = index;
}
void sdl_setIntegerScaling(boolean bool) {
integer_scaling = bool;
}
#ifdef __EMSCRIPTEN__
void* EMSCRIPTEN_KEEPALIVE sdl_getDisplaySurface() {
+10
View File
@@ -147,6 +147,7 @@ static void sys35_usage(boolean verbose) {
#endif
puts(" -noantialias : never use antialiased string");
puts(" -fullscreen : start with fullscreen");
puts(" -integerscale : use integer scaling when resizing");
puts(" -noimagecursor : disable image cursor");
puts(" -version : show version");
puts(" -h : show this message");
@@ -332,6 +333,8 @@ static void sys35_ParseOption(int *argc, char **argv) {
} else if (0 == strcmp(argv[i], "-version")) {
puts(VERSION);
exit(0);
} else if (0 == strcmp(argv[i], "-integerscale")) {
sdl_setIntegerScaling(TRUE);
}
}
}
@@ -403,6 +406,13 @@ static void check_profile() {
nact->noimagecursor = TRUE;
}
}
/* enable integer scaling */
param = get_profile("integerscale");
if (param) {
if (0 == strcmp(param, "Yes")) {
sdl_setIntegerScaling(TRUE);
}
}
}
#ifdef HAVE_SIGACTION