+2014-01-27
+ * fixed problems with window scaling and updating related setup value
+ * added setup option to select anti-aliasing quality of scaled windows
+
2014-01-17
* improved speed of displaying progress when loading levels and artwork
* changed fullscreen and window scaling changes in setup menu to have
{ "background.envelope_4.anim_mode", "default" },
{ "background.envelope_4.draw_masked", "false" },
+ { "background.request", "RocksScreen.png" },
+ { "background.request.x", "562" },
+ { "background.request.y", "56" },
+ { "background.request.width", "108" },
+ { "background.request.height", "288" },
+ { "background.request.anim_mode", "default" },
+ { "background.request.draw_masked", "false" },
+
{ "titlescreen_initial_1", UNDEFINED_FILENAME },
{ "titlescreen_initial_2", UNDEFINED_FILENAME },
{ "titlescreen_initial_3", UNDEFINED_FILENAME },
{ "request.button.player_4.draw_player", "true" },
{ "request.button.player_4.tile_size", "16" },
+ { "global.use_envelope_request", "false" },
+
{ "game.forced_scroll_delay_value", "-1" },
{ "game.use_native_emc_graphics_engine", "false" },
{ "game.use_native_sp_graphics_engine", "true" },
#define IMG_BACKGROUND_ENVELOPE_2 1835
#define IMG_BACKGROUND_ENVELOPE_3 1836
#define IMG_BACKGROUND_ENVELOPE_4 1837
-#define IMG_TITLESCREEN_INITIAL_1 1838
-#define IMG_TITLESCREEN_INITIAL_2 1839
-#define IMG_TITLESCREEN_INITIAL_3 1840
-#define IMG_TITLESCREEN_INITIAL_4 1841
-#define IMG_TITLESCREEN_INITIAL_5 1842
-#define IMG_TITLESCREEN_1 1843
-#define IMG_TITLESCREEN_2 1844
-#define IMG_TITLESCREEN_3 1845
-#define IMG_TITLESCREEN_4 1846
-#define IMG_TITLESCREEN_5 1847
+#define IMG_BACKGROUND_REQUEST 1838
+#define IMG_TITLESCREEN_INITIAL_1 1839
+#define IMG_TITLESCREEN_INITIAL_2 1840
+#define IMG_TITLESCREEN_INITIAL_3 1841
+#define IMG_TITLESCREEN_INITIAL_4 1842
+#define IMG_TITLESCREEN_INITIAL_5 1843
+#define IMG_TITLESCREEN_1 1844
+#define IMG_TITLESCREEN_2 1845
+#define IMG_TITLESCREEN_3 1846
+#define IMG_TITLESCREEN_4 1847
+#define IMG_TITLESCREEN_5 1848
-#define NUM_IMAGE_FILES 1848
+#define NUM_IMAGE_FILES 1849
#endif /* CONF_GFX_H */
{ "door.opening", "oeffnen.wav" },
{ "door.closing", "oeffnen.wav" },
+ { "request.opening", UNDEFINED_FILENAME },
+ { "request.closing", UNDEFINED_FILENAME },
+
/* sounds for menu actions */
{ "menu.item.activating", "empty.wav" },
{ "menu.item.selecting", "base.wav" },
#define SND_GAME_SOKOBAN_SOLVING 191
#define SND_DOOR_OPENING 192
#define SND_DOOR_CLOSING 193
-#define SND_MENU_ITEM_ACTIVATING 194
-#define SND_MENU_ITEM_SELECTING 195
-#define SND_BACKGROUND_TITLE_INITIAL 196
-#define SND_BACKGROUND_TITLE 197
-#define SND_BACKGROUND_MAIN 198
-#define SND_BACKGROUND_LEVELS 199
-#define SND_BACKGROUND_SCORES 200
-#define SND_BACKGROUND_EDITOR 201
-#define SND_BACKGROUND_INFO 202
-#define SND_BACKGROUND_SETUP 203
-#define SND_BACKGROUND_TITLESCREEN_INITIAL_1 204
-#define SND_BACKGROUND_TITLESCREEN_INITIAL_2 205
-#define SND_BACKGROUND_TITLESCREEN_INITIAL_3 206
-#define SND_BACKGROUND_TITLESCREEN_INITIAL_4 207
-#define SND_BACKGROUND_TITLESCREEN_INITIAL_5 208
-#define SND_BACKGROUND_TITLESCREEN_1 209
-#define SND_BACKGROUND_TITLESCREEN_2 210
-#define SND_BACKGROUND_TITLESCREEN_3 211
-#define SND_BACKGROUND_TITLESCREEN_4 212
-#define SND_BACKGROUND_TITLESCREEN_5 213
-#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_1 214
-#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_2 215
-#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_3 216
-#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_4 217
-#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_5 218
-#define SND_BACKGROUND_TITLEMESSAGE_1 219
-#define SND_BACKGROUND_TITLEMESSAGE_2 220
-#define SND_BACKGROUND_TITLEMESSAGE_3 221
-#define SND_BACKGROUND_TITLEMESSAGE_4 222
-#define SND_BACKGROUND_TITLEMESSAGE_5 223
+#define SND_REQUEST_OPENING 194
+#define SND_REQUEST_CLOSING 195
+#define SND_MENU_ITEM_ACTIVATING 196
+#define SND_MENU_ITEM_SELECTING 197
+#define SND_BACKGROUND_TITLE_INITIAL 198
+#define SND_BACKGROUND_TITLE 199
+#define SND_BACKGROUND_MAIN 200
+#define SND_BACKGROUND_LEVELS 201
+#define SND_BACKGROUND_SCORES 202
+#define SND_BACKGROUND_EDITOR 203
+#define SND_BACKGROUND_INFO 204
+#define SND_BACKGROUND_SETUP 205
+#define SND_BACKGROUND_TITLESCREEN_INITIAL_1 206
+#define SND_BACKGROUND_TITLESCREEN_INITIAL_2 207
+#define SND_BACKGROUND_TITLESCREEN_INITIAL_3 208
+#define SND_BACKGROUND_TITLESCREEN_INITIAL_4 209
+#define SND_BACKGROUND_TITLESCREEN_INITIAL_5 210
+#define SND_BACKGROUND_TITLESCREEN_1 211
+#define SND_BACKGROUND_TITLESCREEN_2 212
+#define SND_BACKGROUND_TITLESCREEN_3 213
+#define SND_BACKGROUND_TITLESCREEN_4 214
+#define SND_BACKGROUND_TITLESCREEN_5 215
+#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_1 216
+#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_2 217
+#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_3 218
+#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_4 219
+#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_5 220
+#define SND_BACKGROUND_TITLEMESSAGE_1 221
+#define SND_BACKGROUND_TITLEMESSAGE_2 222
+#define SND_BACKGROUND_TITLEMESSAGE_3 223
+#define SND_BACKGROUND_TITLEMESSAGE_4 224
+#define SND_BACKGROUND_TITLEMESSAGE_5 225
-#define NUM_SOUND_FILES 224
+#define NUM_SOUND_FILES 226
#endif /* CONF_SND_H */
"request.button.player_4.tile_size",
&request.button.player_4.size
},
+ {
+ "global.use_envelope_request",
+ &global.use_envelope_request
+ },
{
"game.forced_scroll_delay_value",
&game.forced_scroll_delay_value
-#define COMPILE_DATE_STRING "2014-01-22 14:42"
+#define COMPILE_DATE_STRING "2014-01-27 22:11"
#define SETUP_TOKEN_FULLSCREEN 17
#define SETUP_TOKEN_FULLSCREEN_MODE 18
#define SETUP_TOKEN_WINDOW_SCALING_PERCENT 19
-#define SETUP_TOKEN_ASK_ON_ESCAPE 20
-#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR 21
-#define SETUP_TOKEN_QUICK_SWITCH 22
-#define SETUP_TOKEN_INPUT_ON_FOCUS 23
-#define SETUP_TOKEN_PREFER_AGA_GRAPHICS 24
-#define SETUP_TOKEN_GAME_FRAME_DELAY 25
-#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS 26
-#define SETUP_TOKEN_SMALL_GAME_GRAPHICS 27
-#define SETUP_TOKEN_GRAPHICS_SET 28
-#define SETUP_TOKEN_SOUNDS_SET 29
-#define SETUP_TOKEN_MUSIC_SET 30
-#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 31
-#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 32
-#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 33
-#define SETUP_TOKEN_VOLUME_SIMPLE 34
-#define SETUP_TOKEN_VOLUME_LOOPS 35
-#define SETUP_TOKEN_VOLUME_MUSIC 36
-
-#define NUM_GLOBAL_SETUP_TOKENS 37
+#define SETUP_TOKEN_WINDOW_SCALING_QUALITY 20
+#define SETUP_TOKEN_ASK_ON_ESCAPE 21
+#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR 22
+#define SETUP_TOKEN_QUICK_SWITCH 23
+#define SETUP_TOKEN_INPUT_ON_FOCUS 24
+#define SETUP_TOKEN_PREFER_AGA_GRAPHICS 25
+#define SETUP_TOKEN_GAME_FRAME_DELAY 26
+#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS 27
+#define SETUP_TOKEN_SMALL_GAME_GRAPHICS 28
+#define SETUP_TOKEN_GRAPHICS_SET 29
+#define SETUP_TOKEN_SOUNDS_SET 30
+#define SETUP_TOKEN_MUSIC_SET 31
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 32
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 33
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 34
+#define SETUP_TOKEN_VOLUME_SIMPLE 35
+#define SETUP_TOKEN_VOLUME_LOOPS 36
+#define SETUP_TOKEN_VOLUME_MUSIC 37
+
+#define NUM_GLOBAL_SETUP_TOKENS 38
/* editor setup */
#define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0
{ TYPE_SWITCH, &si.fullscreen, "fullscreen" },
{ TYPE_STRING, &si.fullscreen_mode, "fullscreen_mode" },
{ TYPE_INTEGER,&si.window_scaling_percent, "window_scaling_percent" },
+ { TYPE_STRING, &si.window_scaling_quality, "window_scaling_quality" },
{ TYPE_SWITCH, &si.ask_on_escape, "ask_on_escape" },
{ TYPE_SWITCH, &si.ask_on_escape_editor, "ask_on_escape_editor" },
{ TYPE_SWITCH, &si.quick_switch, "quick_player_switch" },
si->fullscreen = FALSE;
si->fullscreen_mode = getStringCopy(DEFAULT_FULLSCREEN_MODE);
si->window_scaling_percent = STD_WINDOW_SCALING_PERCENT;
+ si->window_scaling_quality = getStringCopy(SCALING_QUALITY_DEFAULT);
si->ask_on_escape = TRUE;
si->ask_on_escape_editor = TRUE;
si->quick_switch = FALSE;
global.fading_type = TYPE_ENTER_MENU;
#endif
- global.use_envelope_request = FALSE; /* !!! MOVE TO ARTWORK CONFIG !!! */
+ global.use_envelope_request = FALSE;
}
void Execute_Command(char *command)
#endif
video.window_scaling_percent = setup.window_scaling_percent;
+ video.window_scaling_quality = setup.window_scaling_quality;
#if defined(TARGET_SDL2)
int num_displays = SDL_GetNumVideoDisplays();
if (sdl_renderer != NULL)
{
SDL_RenderSetLogicalSize(sdl_renderer, width, height);
- SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
+ // SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
+ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, setup.window_scaling_quality);
sdl_texture = SDL_CreateTexture(sdl_renderer,
SDL_PIXELFORMAT_ARGB8888,
video.fullscreen_enabled = FALSE;
video.window_scaling_percent = setup.window_scaling_percent;
+ video.window_scaling_quality = setup.window_scaling_quality;
success = TRUE;
}
video.window_height = new_window_height;
}
+void SDLSetWindowScalingQuality(char *window_scaling_quality)
+{
+ if (sdl_texture == NULL)
+ return;
+
+ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, window_scaling_quality);
+
+ SDL_Texture *new_texture = SDL_CreateTexture(sdl_renderer,
+ SDL_PIXELFORMAT_ARGB8888,
+ SDL_TEXTUREACCESS_STREAMING,
+ video.width, video.height);
+
+ if (new_texture != NULL)
+ {
+ SDL_DestroyTexture(sdl_texture);
+
+ sdl_texture = new_texture;
+
+ SDLRedrawWindow();
+ }
+
+ video.window_scaling_quality = window_scaling_quality;
+}
+
void SDLSetWindowFullscreen(boolean fullscreen)
{
if (sdl_window == NULL)
#if defined(TARGET_SDL2)
SDL_Surface *SDL_DisplayFormat(SDL_Surface *);
void SDLSetWindowScaling(int);
+void SDLSetWindowScalingQuality(char *);
void SDLSetWindowFullscreen(boolean);
void SDLRedrawWindow();
#endif
#define MAX_WINDOW_SCALING_PERCENT 300
#define STEP_WINDOW_SCALING_PERCENT 10
+/* values for window scaling quality */
+#define SCALING_QUALITY_NEAREST "nearest"
+#define SCALING_QUALITY_LINEAR "linear"
+#define SCALING_QUALITY_BEST "best"
+
+#define SCALING_QUALITY_DEFAULT SCALING_QUALITY_LINEAR
+
/* default input keys */
#define DEFAULT_KEY_LEFT KSYM_Left
#define DEFAULT_KEY_RIGHT KSYM_Right
boolean window_scaling_available;
int window_scaling_percent;
+ char *window_scaling_quality;
};
struct AudioSystemInfo
boolean fullscreen;
char *fullscreen_mode;
int window_scaling_percent;
+ char *window_scaling_quality;
boolean ask_on_escape;
boolean ask_on_escape_editor;
boolean quick_switch;
/* sub-screens on the setup screen (specific) */
#define SETUP_MODE_CHOOSE_GAME_SPEED 15
-#define SETUP_MODE_CHOOSE_SCREEN_MODE 16
-#define SETUP_MODE_CHOOSE_WINDOW_SIZE 17
-#define SETUP_MODE_CHOOSE_SCROLL_DELAY 18
-#define SETUP_MODE_CHOOSE_GRAPHICS 19
-#define SETUP_MODE_CHOOSE_SOUNDS 20
-#define SETUP_MODE_CHOOSE_MUSIC 21
-#define SETUP_MODE_CHOOSE_VOLUME_SIMPLE 22
-#define SETUP_MODE_CHOOSE_VOLUME_LOOPS 23
-#define SETUP_MODE_CHOOSE_VOLUME_MUSIC 24
-
-#define MAX_SETUP_MODES 25
+#define SETUP_MODE_CHOOSE_SCROLL_DELAY 16
+#define SETUP_MODE_CHOOSE_SCREEN_MODE 17
+#define SETUP_MODE_CHOOSE_WINDOW_SIZE 18
+#define SETUP_MODE_CHOOSE_SCALING_TYPE 19
+#define SETUP_MODE_CHOOSE_GRAPHICS 20
+#define SETUP_MODE_CHOOSE_SOUNDS 21
+#define SETUP_MODE_CHOOSE_MUSIC 22
+#define SETUP_MODE_CHOOSE_VOLUME_SIMPLE 23
+#define SETUP_MODE_CHOOSE_VOLUME_LOOPS 24
+#define SETUP_MODE_CHOOSE_VOLUME_MUSIC 25
+
+#define MAX_SETUP_MODES 26
/* for input setup functions */
#define SETUPINPUT_SCREEN_POS_START 0
static TreeInfo *window_sizes = NULL;
static TreeInfo *window_size_current = NULL;
+static TreeInfo *scaling_types = NULL;
+static TreeInfo *scaling_type_current = NULL;
+
static TreeInfo *scroll_delays = NULL;
static TreeInfo *scroll_delay_current = NULL;
{ -1, NULL },
};
+static struct
+{
+ char *value;
+ char *text;
+} scaling_types_list[] =
+{
+ { SCALING_QUALITY_NEAREST, "None" },
+ { SCALING_QUALITY_LINEAR, "Linear" },
+ { SCALING_QUALITY_BEST, "Anisotropic" },
+
+ { NULL, NULL },
+};
+
static struct
{
int value;
}
else if (game_status == GAME_MODE_SETUP)
{
- if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)
+ if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED ||
+ setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
execSetupGame();
else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE ||
setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE ||
- setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
+ setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
execSetupGraphics();
else if (setup_mode == SETUP_MODE_CHOOSE_VOLUME_SIMPLE ||
setup_mode == SETUP_MODE_CHOOSE_VOLUME_LOOPS ||
if (game_status == GAME_MODE_SETUP)
{
- if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)
+ if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED ||
+ setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
execSetupGame();
else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE ||
setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE ||
- setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
+ setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
execSetupGraphics();
else if (setup_mode == SETUP_MODE_CHOOSE_VOLUME_SIMPLE ||
setup_mode == SETUP_MODE_CHOOSE_VOLUME_LOOPS ||
static char *screen_mode_text;
static char *window_size_text;
+static char *scaling_type_text;
static char *scroll_delay_text;
static char *game_speed_text;
static char *graphics_set_name;
DrawSetupScreen();
}
-static void execSetupGame()
+static void execSetupGame_setGameSpeeds()
{
if (game_speeds == NULL)
{
/* needed for displaying game speed text instead of identifier */
game_speed_text = game_speed_current->name;
+}
+
+static void execSetupGame_setScrollDelays()
+{
+ if (scroll_delays == NULL)
+ {
+ int i;
+
+ for (i = 0; scroll_delays_list[i].value != -1; i++)
+ {
+ TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED);
+ char identifier[32], name[32];
+ int value = scroll_delays_list[i].value;
+ char *text = scroll_delays_list[i].text;
+
+ ti->node_top = &scroll_delays;
+ ti->sort_priority = value;
+
+ sprintf(identifier, "%d", value);
+ sprintf(name, "%s", text);
+
+ setString(&ti->identifier, identifier);
+ setString(&ti->name, name);
+ setString(&ti->name_sorting, name);
+ setString(&ti->infotext, "Scaling Type");
+
+ pushTreeInfo(&scroll_delays, ti);
+ }
+
+ /* sort scaling type values to start with lowest scaling type value */
+ sortTreeInfo(&scroll_delays);
+
+ /* set current scaling type value to configured scaling type value */
+ scroll_delay_current =
+ getTreeInfoFromIdentifier(scroll_delays,i_to_a(setup.scroll_delay_value));
+
+ /* if that fails, set current scaling type to reliable default value */
+ if (scroll_delay_current == NULL)
+ scroll_delay_current =
+ getTreeInfoFromIdentifier(scroll_delays, i_to_a(STD_SCROLL_DELAY));
+
+ /* if that also fails, set current scaling type to first available value */
+ if (scroll_delay_current == NULL)
+ scroll_delay_current = scroll_delays;
+ }
+
+ setup.scroll_delay_value = atoi(scroll_delay_current->identifier);
+
+ /* needed for displaying scaling type text instead of identifier */
+ scroll_delay_text = scroll_delay_current->name;
+}
+
+static void execSetupGame()
+{
+ execSetupGame_setGameSpeeds();
+ execSetupGame_setScrollDelays();
setup_mode = SETUP_MODE_GAME;
DrawSetupScreen();
}
+static void execSetupChooseScrollDelay()
+{
+ setup_mode = SETUP_MODE_CHOOSE_SCROLL_DELAY;
+
+ DrawSetupScreen();
+}
+
static void execSetupEditor()
{
setup_mode = SETUP_MODE_EDITOR;
window_size_text = window_size_current->name;
}
+static void execSetupGraphics_setScalingTypes()
+{
+ if (scaling_types == NULL)
+ {
+ int i;
+
+ for (i = 0; scaling_types_list[i].value != NULL; i++)
+ {
+ TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED);
+ char identifier[32], name[32];
+ char *value = scaling_types_list[i].value;
+ char *text = scaling_types_list[i].text;
+
+ ti->node_top = &scaling_types;
+ ti->sort_priority = i;
+
+ sprintf(identifier, "%s", value);
+ sprintf(name, "%s", text);
+
+ setString(&ti->identifier, identifier);
+ setString(&ti->name, name);
+ setString(&ti->name_sorting, name);
+ setString(&ti->infotext, "Anti-Aliasing");
+
+ pushTreeInfo(&scaling_types, ti);
+ }
+
+ /* sort scaling type values to start with lowest scaling type value */
+ sortTreeInfo(&scaling_types);
+
+ /* set current scaling type value to configured scaling type value */
+ scaling_type_current =
+ getTreeInfoFromIdentifier(scaling_types, setup.window_scaling_quality);
+
+ /* if that fails, set current scaling type to reliable default value */
+ if (scaling_type_current == NULL)
+ scaling_type_current =
+ getTreeInfoFromIdentifier(scaling_types, SCALING_QUALITY_DEFAULT);
+
+ /* if that also fails, set current scaling type to first available value */
+ if (scaling_type_current == NULL)
+ scaling_type_current = scaling_types;
+ }
+
+ setup.window_scaling_quality = scaling_type_current->identifier;
+
+ /* needed for displaying scaling type text instead of identifier */
+ scaling_type_text = scaling_type_current->name;
+}
+
static void execSetupGraphics_setScreenModes()
{
// if (screen_modes == NULL && video.fullscreen_available)
}
}
-static void execSetupGraphics_setScrollDelays()
+static void execSetupGraphics()
{
- if (scroll_delays == NULL)
+ if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
{
- int i;
-
- for (i = 0; scroll_delays_list[i].value != -1; i++)
- {
- TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED);
- char identifier[32], name[32];
- int value = scroll_delays_list[i].value;
- char *text = scroll_delays_list[i].text;
-
- ti->node_top = &scroll_delays;
- ti->sort_priority = value;
-
- sprintf(identifier, "%d", value);
- sprintf(name, "%s", text);
-
- setString(&ti->identifier, identifier);
- setString(&ti->name, name);
- setString(&ti->name_sorting, name);
- setString(&ti->infotext, "Scroll Delay");
-
- pushTreeInfo(&scroll_delays, ti);
- }
-
- /* sort scroll delay values to start with lowest scroll delay value */
- sortTreeInfo(&scroll_delays);
-
- /* set current scroll delay value to configured scroll delay value */
- scroll_delay_current =
- getTreeInfoFromIdentifier(scroll_delays,i_to_a(setup.scroll_delay_value));
-
- /* if that fails, set current scroll delay to reliable default value */
- if (scroll_delay_current == NULL)
- scroll_delay_current =
- getTreeInfoFromIdentifier(scroll_delays, i_to_a(STD_SCROLL_DELAY));
-
- /* if that also fails, set current scroll delay to first available value */
- if (scroll_delay_current == NULL)
- scroll_delay_current = scroll_delays;
+ // update "setup.window_scaling_percent" from list selection
+ execSetupGraphics_setWindowSizes(FALSE);
+ }
+ else
+ {
+ // update list selection from "setup.window_scaling_percent"
+ execSetupGraphics_setWindowSizes(TRUE);
}
- setup.scroll_delay_value = atoi(scroll_delay_current->identifier);
-
- /* needed for displaying scroll delay text instead of identifier */
- scroll_delay_text = scroll_delay_current->name;
-}
-
-static void execSetupGraphics()
-{
- // update "setup.window_scaling_percent" from list selection
- execSetupGraphics_setWindowSizes(FALSE);
- // maybe remove non-preset value (if standard value was selected)
- execSetupGraphics_setWindowSizes(TRUE);
-
+ execSetupGraphics_setScalingTypes();
execSetupGraphics_setScreenModes();
- execSetupGraphics_setScrollDelays();
setup_mode = SETUP_MODE_GRAPHICS;
DrawSetupScreen();
+#if defined(TARGET_SDL2)
// window scaling may have changed at this point
ToggleFullscreenOrChangeWindowScalingIfNeeded();
+
+ // window scaling quality may have changed at this point
+ if (!strEqual(setup.window_scaling_quality, video.window_scaling_quality))
+ SDLSetWindowScalingQuality(setup.window_scaling_quality);
+#endif
}
#if !defined(PLATFORM_ANDROID)
DrawSetupScreen();
}
+
+static void execSetupChooseScalingType()
+{
+ setup_mode = SETUP_MODE_CHOOSE_SCALING_TYPE;
+
+ DrawSetupScreen();
+}
#else
static void execSetupChooseScreenMode()
{
#endif
#endif
-static void execSetupChooseScrollDelay()
-{
- setup_mode = SETUP_MODE_CHOOSE_SCROLL_DELAY;
-
- DrawSetupScreen();
-}
-
static void execSetupChooseVolumeSimple()
{
setup_mode = SETUP_MODE_CHOOSE_VOLUME_SIMPLE;
{ TYPE_SWITCH, &setup.autorecord, "Auto-Record Tapes:" },
{ TYPE_ENTER_LIST, execSetupChooseGameSpeed, "Game Speed:" },
{ TYPE_STRING, &game_speed_text, "" },
+#if 1
+ { TYPE_ENTER_LIST, execSetupChooseScrollDelay, "Scroll Delay:" },
+ { TYPE_STRING, &scroll_delay_text, "" },
+#endif
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Back" },
#if defined(TARGET_SDL2)
{ TYPE_ENTER_LIST, execSetupChooseWindowSize, "Window Scaling:" },
{ TYPE_STRING, &window_size_text, "" },
+#if 1
+ { TYPE_ENTER_LIST, execSetupChooseScalingType, "Anti-Aliasing:" },
+ { TYPE_STRING, &scaling_type_text, "" },
+#endif
#else
{ TYPE_ENTER_LIST, execSetupChooseScreenMode, "Fullscreen Mode:" },
{ TYPE_STRING, &screen_mode_text, "" },
#if 0
{ TYPE_SWITCH, &setup.scroll_delay, "Scroll Delay:" },
#endif
+#if 0
{ TYPE_ENTER_LIST, execSetupChooseScrollDelay, "Scroll Delay Value:" },
{ TYPE_STRING, &scroll_delay_text, "" },
+#endif
#if 0
{ TYPE_SWITCH, &setup.soft_scrolling, "Soft Scrolling:" },
#endif
(value_ptr == &setup.sound_music && !audio.music_available) ||
(value_ptr == &setup.fullscreen && !video.fullscreen_available) ||
(value_ptr == &screen_mode_text && !video.fullscreen_available) ||
- (value_ptr == &window_size_text && !video.window_scaling_available))
+ (value_ptr == &window_size_text && !video.window_scaling_available) ||
+ (value_ptr == &scaling_type_text && !video.window_scaling_available))
setup_info[i].type |= TYPE_GHOSTED;
if (setup_info[i].type & (TYPE_ENTER_MENU|TYPE_ENTER_LIST))
{
PlaySound(SND_MENU_ITEM_SELECTING);
- for (y = 0; y < num_setup_info; y++)
+ // for (y = 0; y < num_setup_info; y++)
+ for (y = 0; setup_info[y].type != 0; y++)
{
if (setup_info[y].type & TYPE_LEAVE_MENU)
{
DrawSetupScreen_Input();
else if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)
DrawChooseTree(&game_speed_current);
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
+ DrawChooseTree(&scroll_delay_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
DrawChooseTree(&screen_mode_current);
else if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
DrawChooseTree(&window_size_current);
- else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
- DrawChooseTree(&scroll_delay_current);
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
+ DrawChooseTree(&scaling_type_current);
else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS)
DrawChooseTree(&artwork.gfx_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SOUNDS)
if (setup_mode == SETUP_MODE_GRAPHICS ||
setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
{
- // update "setup.window_scaling_percent" from list selection
+ // update list selection from "setup.window_scaling_percent"
execSetupGraphics_setWindowSizes(TRUE);
DrawSetupScreen();
HandleSetupScreen_Input(mx, my, dx, dy, button);
else if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)
HandleChooseTree(mx, my, dx, dy, button, &game_speed_current);
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
+ HandleChooseTree(mx, my, dx, dy, button, &scroll_delay_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
HandleChooseTree(mx, my, dx, dy, button, &screen_mode_current);
else if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
HandleChooseTree(mx, my, dx, dy, button, &window_size_current);
- else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
- HandleChooseTree(mx, my, dx, dy, button, &scroll_delay_current);
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
+ HandleChooseTree(mx, my, dx, dy, button, &scaling_type_current);
else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS)
HandleChooseTree(mx, my, dx, dy, button, &artwork.gfx_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SOUNDS)
DrawMiniGraphic(sx, sy, el2edimg(getBorderElement(x, y)));
}
-void DrawEnvelopeBackground(int envelope_nr, int startx, int starty,
- int x, int y, int xsize, int ysize, int font_nr)
+void DrawEnvelopeBackground(int graphic, int startx, int starty,
+ int x, int y, int xsize, int ysize, int font_nr,
+ int line_spacing)
{
int font_width = getFontWidth(font_nr);
- int font_height = getFontHeight(font_nr);
- int graphic = IMG_BACKGROUND_ENVELOPE_1 + envelope_nr;
+ int font_height = getFontHeight(font_nr) + line_spacing;
Bitmap *src_bitmap;
int src_x, src_y;
int dst_x = SX + startx + x * font_width;
SetDrawtoField(DRAW_BACKBUFFER);
- for (yy = 0; yy < ysize; yy++) for (xx = 0; xx < xsize; xx++)
- DrawEnvelopeBackground(envelope_nr, sx,sy, xx,yy, xsize, ysize, font_nr);
+ for (yy = 0; yy < ysize; yy++)
+ for (xx = 0; xx < xsize; xx++)
+ DrawEnvelopeBackground(graphic, sx,sy, xx,yy, xsize, ysize,
+ font_nr, 0);
#if 1
DrawTextBuffer(SX + sx + font_width, SY + sy + font_height,
}
}
-void AnimateEnvelopeDoor(char *text, int anim_mode, int action)
+void AnimateEnvelopeRequest(char *text, int anim_mode, int action)
{
-#if 1
+#if 0
int envelope_nr = 0;
#endif
+#if 1
+ int graphic = IMG_BACKGROUND_REQUEST;
+#else
int graphic = IMG_BACKGROUND_ENVELOPE_1 + envelope_nr;
+#endif
Bitmap *src_bitmap = graphic_info[graphic].bitmap;
int mask_mode = (src_bitmap != NULL ? BLIT_MASKED : BLIT_ON_BACKGROUND);
boolean ffwd_delay = (tape.playing && tape.fast_forward);
boolean no_delay = (tape.warp_forward);
unsigned int anim_delay = 0;
int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay);
- int anim_delay_value = (no_delay ? 0 : frame_delay_value);
+ int anim_delay_value = (no_delay ? 0 : frame_delay_value + 500 * 0);
#if 1
int max_word_len = maxWordLengthInString(text);
int font_nr = (max_word_len > 7 ? FONT_TEXT_1 : FONT_TEXT_2);
#endif
int font_width = getFontWidth(font_nr);
int font_height = getFontHeight(font_nr);
+ int line_spacing = 2 * 1;
#if 1
#if 1
int max_xsize = DXSIZE / font_width;
- int max_ysize = DYSIZE / font_height;
+ // int max_ysize = DYSIZE / font_height;
+ int max_ysize = DYSIZE / (font_height + line_spacing);
#else
int max_xsize = 7; /* tools.c: MAX_REQUEST_LINE_FONT1_LEN == 7 */
int max_ysize = 13; /* tools.c: MAX_REQUEST_LINES == 13 */
int xsize = (action == ACTION_CLOSING ? xend - (x - xstart) : x) + 2;
int ysize = (action == ACTION_CLOSING ? yend - (y - ystart) : y) + 2;
int sx = (SXSIZE - xsize * font_width) / 2;
- int sy = (SYSIZE - ysize * font_height) / 2;
+ // int sy = (SYSIZE - ysize * font_height) / 2;
+ int sy = (SYSIZE - ysize * (font_height + line_spacing)) / 2;
int xx, yy;
#if 1
SetDrawtoField(DRAW_BACKBUFFER);
#endif
- for (yy = 0; yy < ysize; yy++) for (xx = 0; xx < xsize; xx++)
- DrawEnvelopeBackground(envelope_nr, sx,sy, xx,yy, xsize, ysize, font_nr);
+ for (yy = 0; yy < ysize; yy++)
+ for (xx = 0; xx < xsize; xx++)
+ DrawEnvelopeBackground(graphic, sx,sy, xx,yy, xsize, ysize,
+ font_nr, line_spacing);
#if 1
#if 1
DrawTextBuffer(SX + sx + font_width, SY + sy + font_height + 8,
text_copy, font_nr, max_xsize,
- xsize - 2, ysize - 2, 2, mask_mode,
+ xsize - 2, ysize - 2, line_spacing, mask_mode,
FALSE, TRUE, FALSE);
#else
DrawTextBuffer(SX + sx + font_width, SY + sy + font_height,
/* copy request gadgets to door backbuffer */
#if 1
+ /*
if ((ysize - 2) > 13)
BlitBitmap(bitmap_db_door, drawto,
DOOR_GFX_PAGEX1 + (DXSIZE - (xsize - 2) * font_width) / 2,
(ysize - 2 - 13) * font_height,
SX + sx + font_width,
SY + sy + font_height * (1 + 13));
+ */
+ if ((ysize - 2) > 13)
+ BlitBitmap(bitmap_db_door, drawto,
+ DOOR_GFX_PAGEX1 + (DXSIZE - (xsize - 2) * font_width) / 2,
+ DOOR_GFX_PAGEY1 + 11 * (font_height + line_spacing * 0),
+ (xsize - 2) * font_width,
+ (ysize - 2 - 13) * (font_height + line_spacing),
+ SX + sx + font_width,
+ SY + sy + (font_height + line_spacing) * (1 + 13));
#else
if ((ysize - 2) > 13)
BlitBitmap(bitmap_db_door, drawto,
BackToFront();
}
-void ShowEnvelopeDoor(char *text, int action)
+void ShowEnvelopeRequest(char *text, int action)
{
#if 1
int last_game_status = game_status; /* save current game status */
// int last_draw_background_mask = gfx.draw_background_mask;
- int envelope_nr = 0;
#endif
+#if 1
+ int graphic = IMG_BACKGROUND_REQUEST;
+ int sound_opening = SND_REQUEST_OPENING;
+ int sound_closing = SND_REQUEST_CLOSING;
+#else
+ int envelope_nr = 0;
int element = EL_ENVELOPE_1 + envelope_nr;
int graphic = IMG_BACKGROUND_ENVELOPE_1 + envelope_nr;
int sound_opening = element_info[element].sound[ACTION_OPENING];
int sound_closing = element_info[element].sound[ACTION_CLOSING];
+#endif
#if 0
boolean ffwd_delay = (tape.playing && tape.fast_forward);
boolean no_delay = (tape.warp_forward);
PlayMenuSoundStereo(sound_opening, SOUND_MIDDLE);
if (anim_mode == ANIM_DEFAULT)
- AnimateEnvelopeDoor(text, ANIM_DEFAULT, ACTION_OPENING);
+ AnimateEnvelopeRequest(text, ANIM_DEFAULT, ACTION_OPENING);
- AnimateEnvelopeDoor(text, main_anim_mode, ACTION_OPENING);
+ AnimateEnvelopeRequest(text, main_anim_mode, ACTION_OPENING);
#if 0
if (tape.playing)
PlayMenuSoundStereo(sound_closing, SOUND_MIDDLE);
if (anim_mode != ANIM_NONE)
- AnimateEnvelopeDoor(text, main_anim_mode, ACTION_CLOSING);
+ AnimateEnvelopeRequest(text, main_anim_mode, ACTION_CLOSING);
if (anim_mode == ANIM_DEFAULT)
- AnimateEnvelopeDoor(text, ANIM_DEFAULT, ACTION_CLOSING);
+ AnimateEnvelopeRequest(text, ANIM_DEFAULT, ACTION_CLOSING);
}
game.envelope_active = FALSE;
char *text_ptr;
int i;
-#if 1
- global.use_envelope_request = 0;
+#if 0
+ global.use_envelope_request = 1;
#endif
#if 1
#if 1
if (global.use_envelope_request)
{
- ShowEnvelopeDoor(text, ACTION_OPENING);
+ ShowEnvelopeRequest(text, ACTION_OPENING);
for (i = 0; i < NUM_TOOL_BUTTONS; i++)
{
#if 1
if (global.use_envelope_request)
- ShowEnvelopeDoor(text, ACTION_CLOSING);
+ ShowEnvelopeRequest(text, ACTION_CLOSING);
#endif
#if 1