From 8dee7be9a4b5947570974aeca983a3cf912fe7e2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 10 Oct 2023 03:22:54 +0300 Subject: [PATCH 40/40] sdl3: Replace sdl2 references with sdl3 See osdn #48830 Signed-off-by: Marko Lindqvist --- client/gui-sdl3/action_dialog.c | 2 +- client/gui-sdl3/canvas.c | 4 +- client/gui-sdl3/chatline.c | 2 +- client/gui-sdl3/citydlg.c | 18 ++--- client/gui-sdl3/cityrep.c | 2 +- client/gui-sdl3/cma_fe.c | 10 +-- client/gui-sdl3/colors.c | 2 +- client/gui-sdl3/colors.h | 2 +- client/gui-sdl3/connectdlg.c | 6 +- client/gui-sdl3/dialogs.c | 4 +- client/gui-sdl3/diplodlg.c | 2 +- client/gui-sdl3/finddlg.c | 2 +- client/gui-sdl3/gotodlg.c | 2 +- client/gui-sdl3/graphics.c | 24 +++--- client/gui-sdl3/graphics.h | 26 +++---- client/gui-sdl3/gui_id.h | 6 +- client/gui-sdl3/gui_main.c | 24 +++--- client/gui-sdl3/gui_main.h | 12 +-- client/gui-sdl3/gui_mouse.c | 2 +- client/gui-sdl3/gui_string.c | 12 +-- client/gui-sdl3/gui_string.h | 2 +- client/gui-sdl3/gui_tilespec.c | 2 +- client/gui-sdl3/gui_tilespec.h | 2 +- client/gui-sdl3/helpdlg.c | 2 +- client/gui-sdl3/inteldlg.c | 2 +- client/gui-sdl3/mapctrl.c | 120 ++++++++++++++--------------- client/gui-sdl3/mapctrl.h | 8 +- client/gui-sdl3/mapview.c | 18 ++--- client/gui-sdl3/menu.c | 28 +++---- client/gui-sdl3/messagewin.c | 6 +- client/gui-sdl3/optiondlg.c | 4 +- client/gui-sdl3/pages.c | 6 +- client/gui-sdl3/plrdlg.c | 40 +++++----- client/gui-sdl3/repodlgs.c | 28 +++---- client/gui-sdl3/repodlgs.h | 2 +- client/gui-sdl3/spaceshipdlg.c | 2 +- client/gui-sdl3/sprite.c | 4 +- client/gui-sdl3/themebackgrounds.c | 2 +- client/gui-sdl3/themecolors.c | 2 +- client/gui-sdl3/themes.c | 8 +- client/gui-sdl3/themespec.c | 18 ++--- client/gui-sdl3/themespec.h | 4 +- client/gui-sdl3/widget.c | 2 +- client/gui-sdl3/widget.h | 4 +- client/gui-sdl3/widget_button.c | 2 +- client/gui-sdl3/widget_checkbox.c | 2 +- client/gui-sdl3/widget_combo.c | 2 +- client/gui-sdl3/widget_combo.h | 2 +- client/gui-sdl3/widget_core.c | 2 +- client/gui-sdl3/widget_edit.c | 2 +- client/gui-sdl3/widget_icon.c | 2 +- client/gui-sdl3/widget_label.c | 2 +- client/gui-sdl3/widget_scrollbar.c | 2 +- client/gui-sdl3/widget_scrollbar.h | 2 +- client/gui-sdl3/widget_window.c | 2 +- client/gui-sdl3/wldlg.c | 2 +- 56 files changed, 252 insertions(+), 252 deletions(-) diff --git a/client/gui-sdl3/action_dialog.c b/client/gui-sdl3/action_dialog.c index 0fdd8a6353..8c257cf86b 100644 --- a/client/gui-sdl3/action_dialog.c +++ b/client/gui-sdl3/action_dialog.c @@ -34,7 +34,7 @@ #include "control.h" #include "text.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "citydlg.h" #include "colors.h" #include "dialogs.h" diff --git a/client/gui-sdl3/canvas.c b/client/gui-sdl3/canvas.c index d2a3e8d5a0..6648e90f76 100644 --- a/client/gui-sdl3/canvas.c +++ b/client/gui-sdl3/canvas.c @@ -28,7 +28,7 @@ #include "log.h" #include "mem.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_main.h" @@ -64,7 +64,7 @@ void canvas_free(struct canvas *store) **************************************************************************/ void canvas_set_zoom(struct canvas *store, float zoom) { - /* sdl2-client has no zoom support */ + /* sdl3-client has no zoom support */ } /**********************************************************************//** diff --git a/client/gui-sdl3/chatline.c b/client/gui-sdl3/chatline.c index 3ee9a920c3..5355c4a8e1 100644 --- a/client/gui-sdl3/chatline.c +++ b/client/gui-sdl3/chatline.c @@ -45,7 +45,7 @@ #include "ratesdlg_g.h" #include "update_queue.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "dialogs.h" #include "graphics.h" diff --git a/client/gui-sdl3/citydlg.c b/client/gui-sdl3/citydlg.c index ba61e2a5c6..db7e0ef7e1 100644 --- a/client/gui-sdl3/citydlg.c +++ b/client/gui-sdl3/citydlg.c @@ -48,7 +48,7 @@ #include "control.h" #include "text.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "cityrep.h" #include "cma_fe.h" #include "colors.h" @@ -1741,7 +1741,7 @@ static int new_name_city_dlg_callback(struct widget *pedit) { if (pedit->string_utf8->text != NULL) { if (strcmp(pedit->string_utf8->text, city_name_get(pcity_dlg->pcity))) { - sdl2_client_flags |= CF_CHANGED_CITY_NAME; + sdl3_client_flags |= CF_CHANGED_CITY_NAME; city_rename(pcity_dlg->pcity, pedit->string_utf8->text); } } else { @@ -1769,11 +1769,11 @@ static void refresh_city_names(struct city *pcity) fc_snprintf(name, MAX_LEN_NAME, "%s", pcity_dlg->city_name_edit->string_utf8->text); if ((strcmp(city_name_get(pcity), name) != 0) - || (sdl2_client_flags & CF_CHANGED_CITY_NAME)) { + || (sdl3_client_flags & CF_CHANGED_CITY_NAME)) { copy_chars_to_utf8_str(pcity_dlg->city_name_edit->string_utf8, city_name_get(pcity)); rebuild_citydlg_title_str(pcity_dlg->end_city_widget_list, pcity); - sdl2_client_flags &= ~CF_CHANGED_CITY_NAME; + sdl3_client_flags &= ~CF_CHANGED_CITY_NAME; } } } @@ -2443,10 +2443,10 @@ static void redraw_city_dialog(struct city *pcity) if ((city_unhappy(pcity) || city_celebrating(pcity) || city_happy(pcity) || cma_is_city_under_agent(pcity, NULL)) - ^ ((sdl2_client_flags & CF_CITY_STATUS_SPECIAL) == CF_CITY_STATUS_SPECIAL)) { - /* city status was changed : NORMAL <-> DISORDER, HAPPY, CELEBR. */ + ^ ((sdl3_client_flags & CF_CITY_STATUS_SPECIAL) == CF_CITY_STATUS_SPECIAL)) { + /* City status was changed : NORMAL <-> DISORDER, HAPPY, CELEBR. */ - sdl2_client_flags ^= CF_CITY_STATUS_SPECIAL; + sdl3_client_flags ^= CF_CITY_STATUS_SPECIAL; #if 0 /* upd. resource map */ @@ -3787,7 +3787,7 @@ void real_city_dialog_popup(struct city *pcity) /* ===================================================== */ if ((city_unhappy(pcity) || city_celebrating(pcity) || city_happy(pcity))) { - sdl2_client_flags |= CF_CITY_STATUS_SPECIAL; + sdl3_client_flags |= CF_CITY_STATUS_SPECIAL; } /* ===================================================== */ @@ -3805,7 +3805,7 @@ void popdown_city_dialog(struct city *pcity) flush_dirty(); - sdl2_client_flags &= ~CF_CITY_STATUS_SPECIAL; + sdl3_client_flags &= ~CF_CITY_STATUS_SPECIAL; menus_update(); } } diff --git a/client/gui-sdl3/cityrep.c b/client/gui-sdl3/cityrep.c index ecc9db9b52..7d61ca5b42 100644 --- a/client/gui-sdl3/cityrep.c +++ b/client/gui-sdl3/cityrep.c @@ -32,7 +32,7 @@ /* client */ #include "client_main.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "citydlg.h" #include "cma_fe.h" #include "colors.h" diff --git a/client/gui-sdl3/cma_fe.c b/client/gui-sdl3/cma_fe.c index 50916912fa..25ff53e5d3 100644 --- a/client/gui-sdl3/cma_fe.c +++ b/client/gui-sdl3/cma_fe.c @@ -31,7 +31,7 @@ /* client */ #include "client_main.h" /* can_client_issue_orders() */ -/* gui-sdl2 */ +/* gui-sdl3 */ #include "citydlg.h" #include "cityrep.h" #include "cma_fec.h" @@ -1082,17 +1082,17 @@ void popup_city_cma_dialog(struct city *pcity) /* -------------------------------- */ cma->dlg->begin_widget_list = buf; -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN area.w = MAX(pcity_map->w + adj_size(220) + text_w + adj_size(10) + (pwindow->prev->prev->size.w + adj_size(5 + 70 + 5) + pwindow->prev->prev->size.w + adj_size(5 + 55 + 15)), area.w); area.h = adj_size(390) - (pwindow->size.w - pwindow->area.w); -#else /* GUI_SDL2_SMALL_SCREEN */ +#else /* GUI_SDL3_SMALL_SCREEN */ area.w = MAX(pcity_map->w + adj_size(150) + text_w + adj_size(10) + (pwindow->prev->prev->size.w + adj_size(5 + 70 + 5) + pwindow->prev->prev->size.w + adj_size(5 + 55 + 15)), area.w); area.h = adj_size(360) - (pwindow->size.w - pwindow->area.w); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ logo = theme_get_background(active_theme, BACKGROUND_CITYGOVDLG); if (resize_window(pwindow, logo, NULL, @@ -1124,7 +1124,7 @@ void popup_city_cma_dialog(struct city *pcity) (text_w + adj_size(10) + pwindow->prev->prev->size.w + adj_size(5 + 70 + 5) + pwindow->prev->prev->size.w + adj_size(5 + 55))) / 2; -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN dst.x += 22; #endif diff --git a/client/gui-sdl3/colors.c b/client/gui-sdl3/colors.c index 9740e8b0e0..fd620ff64d 100644 --- a/client/gui-sdl3/colors.c +++ b/client/gui-sdl3/colors.c @@ -36,7 +36,7 @@ /* client */ #include "tilespec.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "themespec.h" #include "colors.h" diff --git a/client/gui-sdl3/colors.h b/client/gui-sdl3/colors.h index 9769441cfa..9bee0b12c5 100644 --- a/client/gui-sdl3/colors.h +++ b/client/gui-sdl3/colors.h @@ -29,7 +29,7 @@ #include #endif /* SDL2_PLAIN_INCLUDE */ -/* gui-sdl2 */ +/* gui-sdl3 */ #include "themecolors.h" #include "colors_g.h" diff --git a/client/gui-sdl3/connectdlg.c b/client/gui-sdl3/connectdlg.c index f9028e5816..fb908a8b26 100644 --- a/client/gui-sdl3/connectdlg.c +++ b/client/gui-sdl3/connectdlg.c @@ -43,7 +43,7 @@ #include "servers.h" #include "update_queue.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "chatline.h" #include "colors.h" #include "graphics.h" @@ -645,7 +645,7 @@ void popup_join_game_dialog(void) dialog_w = MAX(adj_size(40) + buf->size.w * 2, adj_size(210)) + adj_size(80); -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN dialog_h = area.h + (pwindow->size.h - pwindow->area.h); #else dialog_h = area.h + (pwindow->size.h - pwindow->area.h); @@ -1150,7 +1150,7 @@ void handle_authentication_req(enum authentication_type type, /**********************************************************************//** Provide an interface for connecting to a Freeciv server. - sdl2-client does it as popup main start menu which != connecting dlg. + sdl3-client does it as popup main start menu which != connecting dlg. **************************************************************************/ void server_connect(void) { diff --git a/client/gui-sdl3/dialogs.c b/client/gui-sdl3/dialogs.c index 6397a502ea..1020c08ca6 100644 --- a/client/gui-sdl3/dialogs.c +++ b/client/gui-sdl3/dialogs.c @@ -55,7 +55,7 @@ #include "text.h" #include "zoom.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "chatline.h" #include "citydlg.h" #include "cityrep.h" @@ -672,7 +672,7 @@ void popup_upgrade_dialog(struct unit_list *punits) /* Assume only one unit for now. */ fc_assert_msg(unit_list_size(punits) <= 1, - "SDL2 popup_upgrade_dialog() handles max 1 unit."); + "SDL3 popup_upgrade_dialog() handles max 1 unit."); popup_unit_upgrade_dlg(unit_list_get(punits, 0), FALSE); } diff --git a/client/gui-sdl3/diplodlg.c b/client/gui-sdl3/diplodlg.c index e35255b659..9248655897 100644 --- a/client/gui-sdl3/diplodlg.c +++ b/client/gui-sdl3/diplodlg.c @@ -36,7 +36,7 @@ #include "climisc.h" #include "packhand.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "chatline.h" #include "colors.h" #include "dialogs.h" diff --git a/client/gui-sdl3/finddlg.c b/client/gui-sdl3/finddlg.c index 8e560dc235..548ebed1e7 100644 --- a/client/gui-sdl3/finddlg.c +++ b/client/gui-sdl3/finddlg.c @@ -35,7 +35,7 @@ /* client */ #include "zoom.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_id.h" diff --git a/client/gui-sdl3/gotodlg.c b/client/gui-sdl3/gotodlg.c index 719258c9df..3b65767c51 100644 --- a/client/gui-sdl3/gotodlg.c +++ b/client/gui-sdl3/gotodlg.c @@ -40,7 +40,7 @@ #include "control.h" #include "goto.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_id.h" diff --git a/client/gui-sdl3/graphics.c b/client/gui-sdl3/graphics.c index aa1f35a254..076989f4e8 100644 --- a/client/gui-sdl3/graphics.c +++ b/client/gui-sdl3/graphics.c @@ -43,7 +43,7 @@ /* client */ #include "tilespec.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "gui_tilespec.h" #include "mapview.h" @@ -54,7 +54,7 @@ /* ------------------------------ */ -struct sdl2_data main_data; +struct sdl3_data main_data; static SDL_Surface *main_surface = NULL; @@ -522,7 +522,7 @@ void init_sdl(int flags) error = (SDL_Init(flags) < 0); } if (error) { - log_fatal(_("Unable to initialize SDL2 library: %s"), SDL_GetError()); + log_fatal(_("Unable to initialize SDL3 library: %s"), SDL_GetError()); exit(EXIT_FAILURE); } @@ -530,7 +530,7 @@ void init_sdl(int flags) /* Initialize the TTF library */ if (TTF_Init() < 0) { - log_fatal(_("Unable to initialize SDL2_ttf library: %s"), SDL_GetError()); + log_fatal(_("Unable to initialize SDL3_ttf library: %s"), SDL_GetError()); exit(EXIT_FAILURE); } @@ -581,7 +581,7 @@ bool create_surfaces(int width, int height) } if (GUI_SDL_OPTION(swrenderer) - || (sdl2_client_flags & CF_SWRENDERER)) { + || (sdl3_client_flags & CF_SWRENDERER)) { flags = SDL_RENDERER_SOFTWARE; } else { flags = 0; @@ -635,7 +635,7 @@ void quit_sdl(void) **************************************************************************/ bool set_video_mode(unsigned width, unsigned height, unsigned flags_in) { - main_data.screen = SDL_CreateWindow(_("SDL2 Client for Freeciv"), + main_data.screen = SDL_CreateWindow(_("SDL3 Client for Freeciv"), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, @@ -1351,9 +1351,9 @@ void create_frame(SDL_Surface *dest, Sint16 left, Sint16 top, Sint16 width, Sint16 height, SDL_Color *pcolor) { - struct color gsdl2_color = { .color = pcolor }; - struct sprite *vertical = create_sprite(1, height, &gsdl2_color); - struct sprite *horizontal = create_sprite(width, 1, &gsdl2_color); + struct color gsdl3_color = { .color = pcolor }; + struct sprite *vertical = create_sprite(1, height, &gsdl3_color); + struct sprite *horizontal = create_sprite(width, 1, &gsdl3_color); SDL_Rect tmp, dst = { .x = left, .y = top, .w = 0, .h = 0 }; tmp = dst; @@ -1390,7 +1390,7 @@ void create_line(SDL_Surface *dest, Sint16 x0, Sint16 y0, Sint16 x1, Sint16 y1, struct sprite *spr; SDL_Rect dst = { xl, yt, w, h }; SDL_Color *pcol; - struct color gsdl2_color; + struct color gsdl3_color; int l = MAX((xr - xl) + 1, (yb - yt) + 1); int i; @@ -1400,8 +1400,8 @@ void create_line(SDL_Surface *dest, Sint16 x0, Sint16 y0, Sint16 x1, Sint16 y1, pcol->b = pcolor->b; pcol->a = 0; /* Fill with transparency */ - gsdl2_color.color = pcol; - spr = create_sprite(w, h, &gsdl2_color); + gsdl3_color.color = pcol; + spr = create_sprite(w, h, &gsdl3_color); lock_surf(spr->psurface); diff --git a/client/gui-sdl3/graphics.h b/client/gui-sdl3/graphics.h index 1e6cdf4b93..b3083855c6 100644 --- a/client/gui-sdl3/graphics.h +++ b/client/gui-sdl3/graphics.h @@ -38,7 +38,7 @@ /* client */ #include "graphics_g.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "canvas.h" #include "gui_main.h" @@ -191,7 +191,7 @@ #endif /* USE_DUFFS_LOOP */ /* Shrink surface on 320x240 screen */ -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN #define DEFAULT_ZOOM 0.5 #define adj_surf(surf) zoomSurface((surf), DEFAULT_ZOOM, DEFAULT_ZOOM, 0) #else @@ -202,22 +202,22 @@ struct gui_layer; -struct sdl2_data { - int rects_count; /* update rect. array counter */ - int guis_count; /* gui buffers array counter */ - SDL_Rect rects[RECT_LIMIT]; /* update rect. list */ - SDL_Window *screen; /* main screen buffer */ - SDL_Surface *map; /* map buffer */ - SDL_Surface *dummy; /* dummy surface for missing sprites */ +struct sdl3_data { + int rects_count; /* Update rect. array counter */ + int guis_count; /* Gui buffers array counter */ + SDL_Rect rects[RECT_LIMIT]; /* Update rect. list */ + SDL_Window *screen; /* Main screen buffer */ + SDL_Surface *map; /* Map buffer */ + SDL_Surface *dummy; /* Dummy surface for missing sprites */ SDL_Texture *maintext; SDL_Renderer *renderer; struct canvas map_canvas; - struct gui_layer *gui; /* gui buffer */ - struct gui_layer **guis; /* gui buffers used by sdl2-client widgets window menager */ - SDL_Event event; /* main event struct */ + struct gui_layer *gui; /* Gui buffer */ + struct gui_layer **guis; /* Gui buffers used by sdl3-client widgets window menager */ + SDL_Event event; /* Main event struct */ }; -extern struct sdl2_data main_data; +extern struct sdl3_data main_data; /* GUI layer */ /* A gui_layer is a surface with its own origin. Each widget belongs diff --git a/client/gui-sdl3/gui_id.h b/client/gui-sdl3/gui_id.h index cfa9dfa12d..b90daa0168 100644 --- a/client/gui-sdl3/gui_id.h +++ b/client/gui-sdl3/gui_id.h @@ -19,8 +19,8 @@ email : RafaƂ Bursig **********************************************************************/ -#ifndef FC__SDL2_GUI_ID_H -#define FC__SDL2_GUI_ID_H +#ifndef FC__SDL3_GUI_ID_H +#define FC__SDL3_GUI_ID_H enum GUI_ID { ID_ERROR = 0, @@ -214,4 +214,4 @@ enum GUI_ID { ID_ADD_NEW_WORKLIST }; -#endif /* FC__SDL2_GUI_ID_H */ +#endif /* FC__SDL3_GUI_ID_H */ diff --git a/client/gui-sdl3/gui_main.c b/client/gui-sdl3/gui_main.c index a68152b863..83d0e6f950 100644 --- a/client/gui-sdl3/gui_main.c +++ b/client/gui-sdl3/gui_main.c @@ -62,7 +62,7 @@ #include "update_queue.h" #include "zoom.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "chatline.h" #include "citydlg.h" #include "cityrep.h" @@ -86,7 +86,7 @@ #define UNITS_TIMER_INTERVAL 128 /* milliseconds */ #define MAP_SCROLL_TIMER_INTERVAL 500 -const char *client_string = "gui-sdl2"; +const char *client_string = "gui-sdl3"; /* The real GUI character encoding is UTF-16 which is not supported by * fciconv code at this time. Conversion between UTF-8 and UTF-16 is done @@ -94,7 +94,7 @@ const char *client_string = "gui-sdl2"; const char * const gui_character_encoding = "UTF-8"; const bool gui_use_transliteration = FALSE; -Uint32 sdl2_client_flags = 0; +Uint32 sdl3_client_flags = 0; Uint32 widget_info_counter = 0; int MOVE_STEP_X = DEFAULT_MOVE_STEP; @@ -201,7 +201,7 @@ static bool parse_options(int argc, char **argv) } else if (is_option("--fullscreen", argv[i])) { GUI_SDL_OPTION(fullscreen) = TRUE; } else if (is_option("--swrenderer", argv[i])) { - sdl2_client_flags |= CF_SWRENDERER; + sdl3_client_flags |= CF_SWRENDERER; } else if ((option = get_option_malloc("--Font", argv, &i, argc, FALSE))) { if (!str_to_uint(option, &font_size_parameter)) { fc_fprintf(stderr, _("Invalid font size %s"), option); @@ -593,7 +593,7 @@ int FilterMouseMotionEvents(void *data, SDL_Event *event) } /**********************************************************************//** - SDL2-client main loop. + SDL3-client main loop. **************************************************************************/ Uint16 gui_event_loop(void *data, void (*loop_action)(void *data), @@ -877,7 +877,7 @@ void ui_init(void) button_behavior.hold_state = MB_HOLD_SHORT; button_behavior.event = fc_calloc(1, sizeof(SDL_MouseButtonEvent)); - sdl2_client_flags = 0; + sdl3_client_flags = 0; sdl_flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE; init_sdl(sdl_flags); @@ -955,7 +955,7 @@ static void fullscreen_callback(struct option *poption) /**********************************************************************//** Extra initializers for client options. Here we make set the callback - for the specific gui-sdl2 options. + for the specific gui-sdl3 options. **************************************************************************/ void options_extra_init(void) { @@ -1093,7 +1093,7 @@ int ui_main(int argc, char *argv[]) is_unit_move_blocked = FALSE; - sdl2_client_flags |= (CF_DRAW_PLAYERS_NEUTRAL_STATUS + sdl3_client_flags |= (CF_DRAW_PLAYERS_NEUTRAL_STATUS |CF_DRAW_PLAYERS_WAR_STATUS |CF_DRAW_PLAYERS_CEASEFIRE_STATUS |CF_DRAW_PLAYERS_PEACE_STATUS @@ -1126,7 +1126,7 @@ int ui_main(int argc, char *argv[]) main_mouse_motion_handler); start_quitting(); -#if defined UNDER_CE && defined GUI_SDL2_SMALL_SCREEN +#if defined UNDER_CE && defined GUI_SDL3_SMALL_SCREEN /* Change back to window mode to restore the title bar */ set_video_mode(320, 240, SDL_SWSURFACE | SDL_ANYFORMAT); #endif @@ -1174,7 +1174,7 @@ void ui_exit(void) **************************************************************************/ enum gui_type get_gui_type(void) { - return GUI_SDL2; + return GUI_SDL3; } /**********************************************************************//** @@ -1192,7 +1192,7 @@ void sound_bell(void) void enable_focus_animation(void) { anim_user_event->user.code = ANIM; - sdl2_client_flags |= CF_FOCUS_ANIMATION; + sdl3_client_flags |= CF_FOCUS_ANIMATION; } /**********************************************************************//** @@ -1200,7 +1200,7 @@ void enable_focus_animation(void) **************************************************************************/ void disable_focus_animation(void) { - sdl2_client_flags &= ~CF_FOCUS_ANIMATION; + sdl3_client_flags &= ~CF_FOCUS_ANIMATION; } /**********************************************************************//** diff --git a/client/gui-sdl3/gui_main.h b/client/gui-sdl3/gui_main.h index 0be422163e..02b0da226f 100644 --- a/client/gui-sdl3/gui_main.h +++ b/client/gui-sdl3/gui_main.h @@ -34,13 +34,13 @@ struct theme; -#define GUI_SDL_OPTION(optname) gui_options.gui_sdl2_##optname -#define GUI_SDL_OPTION_STR(optname) "gui_sdl2_" #optname +#define GUI_SDL_OPTION(optname) gui_options.gui_sdl3_##optname +#define GUI_SDL_OPTION_STR(optname) "gui_sdl3_" #optname /* Enable this to adjust sizes for 320x240 resolution */ -/* #define GUI_SDL2_SMALL_SCREEN */ +/* #define GUI_SDL3_SMALL_SCREEN */ -/* SDL2 client Flags */ +/* SDL3 client Flags */ #define CF_NONE 0 #define CF_ORDERS_WIDGETS_CREATED (1<<0) #define CF_MAP_UNIT_W_CREATED (1<<1) @@ -97,7 +97,7 @@ struct mouse_button_behavior { }; extern struct widget *selected_widget; -extern Uint32 sdl2_client_flags; +extern Uint32 sdl3_client_flags; extern bool LSHIFT; extern bool RSHIFT; extern bool LCTRL; @@ -135,7 +135,7 @@ void update_font_from_theme(int theme_font_size); bool flush_event(void); /* Shrink sizes for 320x240 screen */ -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN #define adj_size(size) ((size) / 2) #else #define adj_size(size) (size) diff --git a/client/gui-sdl3/gui_mouse.c b/client/gui-sdl3/gui_mouse.c index 5c879666d5..9974d1e456 100644 --- a/client/gui-sdl3/gui_mouse.c +++ b/client/gui-sdl3/gui_mouse.c @@ -28,7 +28,7 @@ /* client */ #include "tilespec.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "graphics.h" #include "mapview.h" #include "sprite.h" diff --git a/client/gui-sdl3/gui_string.c b/client/gui-sdl3/gui_string.c index 31eadb3f7c..0e7efc28f8 100644 --- a/client/gui-sdl3/gui_string.c +++ b/client/gui-sdl3/gui_string.c @@ -35,7 +35,7 @@ #include "log.h" #include "mem.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_main.h" @@ -61,18 +61,18 @@ static SDL_Surface *create_utf8_surf(utf8_str *pstr); static SDL_Surface *create_utf8_multi_surf(utf8_str *pstr); /* Adjust font sizes on 320x240 screen */ -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN static int adj_font(int size); -#else /* GUI_SDL2_SMALL_SCREEN */ +#else /* GUI_SDL3_SMALL_SCREEN */ #define adj_font(size) size -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ #define ptsize_default() adj_font(default_font_size(active_theme)) /**********************************************************************//** Adjust font sizes for small screen. **************************************************************************/ -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN static int adj_font(int size) { switch (size) { @@ -98,7 +98,7 @@ static int adj_font(int size) return size; } } -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /**********************************************************************//** Calculate display size of string. diff --git a/client/gui-sdl3/gui_string.h b/client/gui-sdl3/gui_string.h index ac16a4875a..8aa022250b 100644 --- a/client/gui-sdl3/gui_string.h +++ b/client/gui-sdl3/gui_string.h @@ -34,7 +34,7 @@ /* common */ #include "fc_types.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "gui_main.h" #define SF_CENTER 0x10 diff --git a/client/gui-sdl3/gui_tilespec.c b/client/gui-sdl3/gui_tilespec.c index 4a19a85191..f43ea9119e 100644 --- a/client/gui-sdl3/gui_tilespec.c +++ b/client/gui-sdl3/gui_tilespec.c @@ -41,7 +41,7 @@ /* client */ #include "client_main.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_main.h" diff --git a/client/gui-sdl3/gui_tilespec.h b/client/gui-sdl3/gui_tilespec.h index 9e22d74fc9..93d70c6a10 100644 --- a/client/gui-sdl3/gui_tilespec.h +++ b/client/gui-sdl3/gui_tilespec.h @@ -32,7 +32,7 @@ /* client */ #include "tilespec.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "graphics.h" #include "sprite.h" diff --git a/client/gui-sdl3/helpdlg.c b/client/gui-sdl3/helpdlg.c index 9e68624bb9..3c43217eb6 100644 --- a/client/gui-sdl3/helpdlg.c +++ b/client/gui-sdl3/helpdlg.c @@ -35,7 +35,7 @@ #include "client_main.h" #include "helpdata.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_id.h" diff --git a/client/gui-sdl3/inteldlg.c b/client/gui-sdl3/inteldlg.c index b632b83290..ca9cfeac5a 100644 --- a/client/gui-sdl3/inteldlg.c +++ b/client/gui-sdl3/inteldlg.c @@ -35,7 +35,7 @@ #include "client_main.h" #include "spaceshipdlg_g.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "graphics.h" #include "gui_id.h" #include "gui_main.h" diff --git a/client/gui-sdl3/mapctrl.c b/client/gui-sdl3/mapctrl.c index b1d97f5023..e6f22a4fd4 100644 --- a/client/gui-sdl3/mapctrl.c +++ b/client/gui-sdl3/mapctrl.c @@ -46,7 +46,7 @@ #include "update_queue.h" #include "zoom.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "citydlg.h" #include "cityrep.h" #include "colors.h" @@ -270,7 +270,7 @@ static int toggle_unit_info_window_callback(struct widget *icon_widget) undraw_order_widgets(); } - if (sdl2_client_flags & CF_UNITINFO_SHOWN) { + if (sdl3_client_flags & CF_UNITINFO_SHOWN) { /* HIDE */ SDL_Surface *buf_surf; SDL_Rect src, window_area; @@ -297,7 +297,7 @@ static int toggle_unit_info_window_callback(struct widget *icon_widget) copy_chars_to_utf8_str(icon_widget->info_label, _("Show Unit Info Window")); - sdl2_client_flags &= ~CF_UNITINFO_SHOWN; + sdl3_client_flags &= ~CF_UNITINFO_SHOWN; set_new_unitinfo_window_pos(); @@ -360,7 +360,7 @@ static int toggle_unit_info_window_callback(struct widget *icon_widget) alphablit(current_theme->r_arrow_icon, NULL, icon_widget->theme, NULL, 255); - sdl2_client_flags |= CF_UNITINFO_SHOWN; + sdl3_client_flags |= CF_UNITINFO_SHOWN; set_new_unitinfo_window_pos(); @@ -404,7 +404,7 @@ static int toggle_map_window_callback(struct widget *map_button) undraw_order_widgets(); } - if (sdl2_client_flags & CF_OVERVIEW_SHOWN) { + if (sdl3_client_flags & CF_OVERVIEW_SHOWN) { /* Hide MiniMap */ SDL_Surface *buf_surf; SDL_Rect src, map_area = minimap_window->size; @@ -414,12 +414,12 @@ static int toggle_map_window_callback(struct widget *map_button) copy_chars_to_utf8_str(map_button->info_label, _("Show Mini Map")); - /* make new map icon */ + /* Make new map icon */ alphablit(current_theme->r_arrow_icon, NULL, map_button->theme, NULL, 255); - sdl2_client_flags &= ~CF_OVERVIEW_SHOWN; + sdl3_client_flags &= ~CF_OVERVIEW_SHOWN; - /* clear area under old map window */ + /* Clear area under old map window */ widget_undraw(minimap_window); widget_mark_dirty(minimap_window); @@ -467,11 +467,11 @@ static int toggle_map_window_callback(struct widget *map_button) pwidget = pwidget->prev; widget_redraw(pwidget); -#ifdef GUI_SDL2_SMALL_SCREEN - /* options */ +#ifdef GUI_SDL3_SMALL_SCREEN + /* Pptions */ pwidget = pwidget->prev; widget_redraw(pwidget); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* ID_TOGGLE_MAP_WINDOW_BUTTON */ pwidget = pwidget->prev; @@ -492,7 +492,7 @@ static int toggle_map_window_callback(struct widget *map_button) alphablit(current_theme->l_arrow_icon, NULL, map_button->theme, NULL, 255); - sdl2_client_flags |= CF_OVERVIEW_SHOWN; + sdl3_client_flags |= CF_OVERVIEW_SHOWN; minimap_window->size.w = (minimap_window->size.w - minimap_window->area.w) + overview_w + BLOCKM_W; @@ -717,7 +717,7 @@ static void popup_minimap_scale_dialog(void) int window_x = 0, window_y = 0; SDL_Rect area; - if (scale_minimap_dlg || !(sdl2_client_flags & CF_OVERVIEW_SHOWN)) { + if (scale_minimap_dlg || !(sdl3_client_flags & CF_OVERVIEW_SHOWN)) { return; } @@ -1108,7 +1108,7 @@ static void popup_unitinfo_scale_dialog(void) int window_x = 0, window_y = 0; SDL_Rect area; - if (scale_unit_info_dlg || !(sdl2_client_flags & CF_UNITINFO_SHOWN)) { + if (scale_unit_info_dlg || !(sdl3_client_flags & CF_UNITINFO_SHOWN)) { return; } @@ -1269,7 +1269,7 @@ static int minimap_window_callback(struct widget *pwidget) minimap_window->area.x - overview_start_x; mouse_y = main_data.event.motion.y - minimap_window->dst->dest_rect.y - minimap_window->area.y - overview_start_y; - if ((sdl2_client_flags & CF_OVERVIEW_SHOWN) + if ((sdl3_client_flags & CF_OVERVIEW_SHOWN) && (mouse_x >= 0) && (mouse_x < overview_w) && (mouse_y >= 0) && (mouse_y < overview_h)) { int map_x, map_y; @@ -1335,7 +1335,7 @@ void set_new_unitinfo_window_pos(void) struct widget *pwidget; SDL_Rect area; - if (sdl2_client_flags & CF_UNITINFO_SHOWN) { + if (sdl3_client_flags & CF_UNITINFO_SHOWN) { widget_set_position(units_info_window, main_window_width() - units_info_window->size.w, main_window_height() - units_info_window->size.h); @@ -1431,14 +1431,14 @@ void set_new_minimap_window_pos(void) area.x + adj_size(2), area.y + pwidget->size.h + 2); -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN /* ID_TOGGLE_MAP_WINDOW_BUTTON */ pwidget = pwidget->prev; widget_set_area(pwidget, area); widget_set_position(pwidget, area.x + adj_size(2), area.y + area.h - pwidget->size.h - 2); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* ID_TOGGLE_MAP_WINDOW_BUTTON */ pwidget = pwidget->prev; @@ -1556,7 +1556,7 @@ void popup_unitinfo_window(void) unit_info_dlg->begin_widget_list = pwidget; - sdl2_client_flags |= CF_UNITINFO_SHOWN; + sdl3_client_flags |= CF_UNITINFO_SHOWN; set_new_unitinfo_window_pos(); @@ -1640,7 +1640,7 @@ void popdown_unitinfo_window(void) popdown_window_group_dialog(unit_info_dlg->begin_widget_list, unit_info_dlg->end_widget_list); FC_FREE(unit_info_dlg); - sdl2_client_flags &= ~CF_UNITINFO_SHOWN; + sdl3_client_flags &= ~CF_UNITINFO_SHOWN; } } @@ -1747,7 +1747,7 @@ void popup_minimap_window(void) add_to_gui_list(ID_CHATLINE_TOGGLE_LOG_WINDOW_BUTTON, pwidget); -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN /* Options button */ options_button = create_themeicon(current_theme->options_icon, minimap_window->dst, @@ -1761,7 +1761,7 @@ void popup_minimap_window(void) options_button->key = SDLK_ESCAPE; add_to_gui_list(ID_CLIENT_OPTIONS, options_button); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* show/hide minimap button */ @@ -1785,7 +1785,7 @@ void popup_minimap_window(void) minimap_dlg->begin_widget_list = pwidget; - sdl2_client_flags |= CF_OVERVIEW_SHOWN; + sdl3_client_flags |= CF_OVERVIEW_SHOWN; set_new_minimap_window_pos(); @@ -1815,15 +1815,15 @@ void show_minimap_window_buttons(void) pwidget = pwidget->prev; clear_wflag(pwidget, WF_HIDDEN); - /* show/hide log window button */ + /* Show/hide log window button */ pwidget = pwidget->prev; clear_wflag(pwidget, WF_HIDDEN); -#ifdef GUI_SDL2_SMALL_SCREEN - /* options button */ +#ifdef GUI_SDL3_SMALL_SCREEN + /* Options button */ pwidget = pwidget->prev; clear_wflag(pwidget, WF_HIDDEN); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* show/hide minimap button */ pwidget = pwidget->prev; @@ -1853,15 +1853,15 @@ void hide_minimap_window_buttons(void) pwidget = pwidget->prev; set_wflag(pwidget, WF_HIDDEN); - /* show/hide log window button */ + /* Show/hide log window button */ pwidget = pwidget->prev; set_wflag(pwidget, WF_HIDDEN); -#ifdef GUI_SDL2_SMALL_SCREEN - /* options button */ +#ifdef GUI_SDL3_SMALL_SCREEN + /* Options button */ pwidget = pwidget->prev; set_wflag(pwidget, WF_HIDDEN); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* show/hide minimap button */ pwidget = pwidget->prev; @@ -1890,15 +1890,15 @@ void redraw_minimap_window_buttons(void) /* units button */ pwidget = pwidget->prev; widget_redraw(pwidget); - /* show/hide log window button */ + /* Show/hide log window button */ pwidget = pwidget->prev; widget_redraw(pwidget); -#ifdef GUI_SDL2_SMALL_SCREEN - /* options button */ +#ifdef GUI_SDL3_SMALL_SCREEN + /* Options button */ pwidget = pwidget->prev; widget_redraw(pwidget); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* show/hide minimap button */ pwidget = pwidget->prev; @@ -1928,15 +1928,15 @@ void disable_minimap_window_buttons(void) pwidget = pwidget->prev; set_wstate(pwidget, FC_WS_DISABLED); - /* show/hide log window button */ + /* Show/hide log window button */ pwidget = pwidget->prev; set_wstate(pwidget, FC_WS_DISABLED); -#ifdef GUI_SDL2_SMALL_SCREEN - /* options button */ +#ifdef GUI_SDL3_SMALL_SCREEN + /* Options button */ pwidget = pwidget->prev; set_wstate(pwidget, FC_WS_DISABLED); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ } /**********************************************************************//** @@ -1948,7 +1948,7 @@ void popdown_minimap_window(void) popdown_window_group_dialog(minimap_dlg->begin_widget_list, minimap_dlg->end_widget_list); FC_FREE(minimap_dlg); - sdl2_client_flags &= ~CF_OVERVIEW_SHOWN; + sdl3_client_flags &= ~CF_OVERVIEW_SHOWN; } } @@ -1960,50 +1960,50 @@ void show_game_page(void) struct widget *pwidget; SDL_Surface *icon_theme = NULL; - if (sdl2_client_flags & CF_MAP_UNIT_W_CREATED) { + if (sdl3_client_flags & CF_MAP_UNIT_W_CREATED) { return; } popup_minimap_window(); popup_unitinfo_window(); - sdl2_client_flags |= CF_MAP_UNIT_W_CREATED; + sdl3_client_flags |= CF_MAP_UNIT_W_CREATED; -#ifndef GUI_SDL2_SMALL_SCREEN +#ifndef GUI_SDL3_SMALL_SCREEN init_options_button(); #endif - /* cooling icon */ + /* Cooling icon */ icon_theme = adj_surf(GET_SURF(client_cooling_sprite())); fc_assert(icon_theme != NULL); pwidget = create_iconlabel(icon_theme, main_data.gui, NULL, WF_FREE_THEME); -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN widget_set_position(pwidget, pwidget->dst->surface->w - pwidget->size.w - adj_size(10), 0); -#else /* GUI_SDL2_SMALL_SCREEN */ +#else /* GUI_SDL3_SMALL_SCREEN */ widget_set_position(pwidget, pwidget->dst->surface->w - pwidget->size.w - adj_size(10), adj_size(10)); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ add_to_gui_list(ID_COOLING_ICON, pwidget); - /* warming icon */ + /* Warming icon */ icon_theme = adj_surf(GET_SURF(client_warming_sprite())); fc_assert(icon_theme != NULL); pwidget = create_iconlabel(icon_theme, main_data.gui, NULL, WF_FREE_THEME); -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN widget_set_position(pwidget, pwidget->dst->surface->w - pwidget->size.w * 2 - adj_size(10), 0); -#else /* GUI_SDL2_SMALL_SCREEN */ +#else /* GUI_SDL3_SMALL_SCREEN */ widget_set_position(pwidget, pwidget->dst->surface->w - pwidget->size.w * 2 - adj_size(10), adj_size(10)); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ add_to_gui_list(ID_WARMING_ICON, pwidget); @@ -2034,7 +2034,7 @@ void close_game_page(void) popdown_minimap_window(); popdown_unitinfo_window(); - sdl2_client_flags &= ~CF_MAP_UNIT_W_CREATED; + sdl3_client_flags &= ~CF_MAP_UNIT_W_CREATED; } /**********************************************************************//** @@ -2065,15 +2065,15 @@ static void disable_minimap_widgets(void) buf = buf->prev; set_wstate(buf, FC_WS_DISABLED); - /* show/hide log window button */ + /* Show/hide log window button */ buf = buf->prev; set_wstate(buf, FC_WS_DISABLED); -#ifdef GUI_SDL2_SMALL_SCREEN - /* options button */ +#ifdef GUI_SDL3_SMALL_SCREEN + /* Options button */ buf = buf->prev; set_wstate(buf, FC_WS_DISABLED); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* show/hide minimap button */ buf = buf->prev; @@ -2139,15 +2139,15 @@ static void enable_minimap_widgets(void) buf = buf->prev; set_wstate(buf, FC_WS_NORMAL); - /* show/hide log window button */ + /* Show/hide log window button */ buf = buf->prev; set_wstate(buf, FC_WS_NORMAL); -#ifdef GUI_SDL2_SMALL_SCREEN - /* options button */ +#ifdef GUI_SDL3_SMALL_SCREEN + /* Options button */ buf = buf->prev; set_wstate(buf, FC_WS_NORMAL); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* show/hide minimap button */ buf = buf->prev; diff --git a/client/gui-sdl3/mapctrl.h b/client/gui-sdl3/mapctrl.h index 5fb88dfd3e..b056279312 100644 --- a/client/gui-sdl3/mapctrl.h +++ b/client/gui-sdl3/mapctrl.h @@ -32,12 +32,12 @@ /* common */ #include "fc_types.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "gui_main.h" #include "mapctrl_g.h" -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN #define BLOCKM_W 28 #define BLOCKU_W 15 @@ -46,7 +46,7 @@ #define DEFAULT_UNITS_W (78 + BLOCKU_W) #define DEFAULT_UNITS_H 52 -#else /* GUI_SDL2_SMALL_SCREEN */ +#else /* GUI_SDL3_SMALL_SCREEN */ #define BLOCKM_W 52 #define BLOCKU_W 28 @@ -55,7 +55,7 @@ #define DEFAULT_UNITS_W (158 + BLOCKU_W) #define DEFAULT_UNITS_H 104 -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ extern int overview_w; extern int overview_h; diff --git a/client/gui-sdl3/mapview.c b/client/gui-sdl3/mapview.c index dc8099f0aa..9f2270f618 100644 --- a/client/gui-sdl3/mapview.c +++ b/client/gui-sdl3/mapview.c @@ -53,7 +53,7 @@ #include "pages_g.h" #include "text.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "dialogs.h" #include "graphics.h" @@ -158,7 +158,7 @@ void queue_flush(void) /* We don't want to set is_flush_queued in this case, since then * the flush code would simply stop working. But this means the * below message may be repeated many times. */ - bugreport_request(_("Failed to add events to SDL2 event buffer: %s"), + bugreport_request(_("Failed to add events to SDL3 event buffer: %s"), SDL_GetError()); } } @@ -403,7 +403,7 @@ void update_info_label(void) SDL_Color bg_color = {0, 0, 0, 80}; SDL_Surface *tmp = NULL; char buffer[512]; -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN SDL_Rect area = {0, 0, 0, 0}; #else SDL_Rect area = {0, 3, 0, 0}; @@ -422,7 +422,7 @@ void update_info_label(void) ptext->bgcol = (SDL_Color) {0, 0, 0, 0}; if (NULL != client.conn.playing) { -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN fc_snprintf(buffer, sizeof(buffer), _("%s Population: %s Year: %s " "Gold %d "), @@ -430,7 +430,7 @@ void update_info_label(void) population_to_text(civ_population(client.conn.playing)), calendar_text(), client.conn.playing->economic.gold); -#else /* GUI_SDL2_SMALL_SCREEN */ +#else /* GUI_SDL3_SMALL_SCREEN */ fc_snprintf(buffer, sizeof(buffer), _("%s Population: %s Year: %s " "Gold %d Tax: %d Lux: %d Sci: %d "), @@ -441,7 +441,7 @@ void update_info_label(void) client.conn.playing->economic.tax, client.conn.playing->economic.luxury, client.conn.playing->economic.science); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ /* Convert to utf8_str and create text surface */ copy_chars_to_utf8_str(ptext, buffer); @@ -530,7 +530,7 @@ void redraw_unit_info_label(struct unit_list *punitlist) punit = NULL; } - if (sdl2_client_flags & CF_UNITINFO_SHOWN) { + if (sdl3_client_flags & CF_UNITINFO_SHOWN) { info_window = get_unit_info_window_widget(); /* Blit theme surface */ @@ -973,7 +973,7 @@ void redraw_unit_info_label(struct unit_list *punitlist) **************************************************************************/ static bool is_focus_anim_enabled(void) { - return (sdl2_client_flags & CF_FOCUS_ANIMATION) == CF_FOCUS_ANIMATION; + return (sdl3_client_flags & CF_FOCUS_ANIMATION) == CF_FOCUS_ANIMATION; } /**********************************************************************//** @@ -1121,7 +1121,7 @@ void refresh_overview(void) struct widget *minimap; SDL_Rect overview_area; - if (sdl2_client_flags & CF_OVERVIEW_SHOWN) { + if (sdl3_client_flags & CF_OVERVIEW_SHOWN) { minimap = get_minimap_window_widget(); overview_area = (SDL_Rect) { diff --git a/client/gui-sdl3/menu.c b/client/gui-sdl3/menu.c index 9039c08a5e..4f0548d82a 100644 --- a/client/gui-sdl3/menu.c +++ b/client/gui-sdl3/menu.c @@ -47,7 +47,7 @@ #include "control.h" #include "pages_g.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "dialogs.h" #include "gotodlg.h" #include "graphics.h" @@ -931,7 +931,7 @@ void create_units_order_widgets(void) begin_order_widget_list = buf; - sdl2_client_flags |= CF_ORDERS_WIDGETS_CREATED; + sdl3_client_flags |= CF_ORDERS_WIDGETS_CREATED; } /**********************************************************************//** @@ -943,7 +943,7 @@ void delete_units_order_widgets(void) begin_order_widget_list = NULL; end_order_widget_list = NULL; - sdl2_client_flags &= ~CF_ORDERS_WIDGETS_CREATED; + sdl3_client_flags &= ~CF_ORDERS_WIDGETS_CREATED; } /**********************************************************************//** @@ -1004,22 +1004,22 @@ void real_menus_update(void) if ((C_S_RUNNING != client_state()) || (get_client_page() != PAGE_GAME)) { - sdl2_client_flags |= CF_GAME_JUST_STARTED; + sdl3_client_flags |= CF_GAME_JUST_STARTED; - if (sdl2_client_flags & CF_MAP_UNIT_W_CREATED) { + if (sdl3_client_flags & CF_MAP_UNIT_W_CREATED) { set_wflag(options_button, WF_HIDDEN); hide_minimap_window_buttons(); hide_unitinfo_window_buttons(); } - if (sdl2_client_flags & CF_ORDERS_WIDGETS_CREATED) { + if (sdl3_client_flags & CF_ORDERS_WIDGETS_CREATED) { hide_group(begin_order_widget_list, end_order_widget_list); } } else { /* Running state */ - if (sdl2_client_flags & CF_MAP_UNIT_W_CREATED) { - /* show options button */ + if (sdl3_client_flags & CF_MAP_UNIT_W_CREATED) { + /* Show options button */ clear_wflag(options_button, WF_HIDDEN); widget_redraw(options_button); widget_mark_dirty(options_button); @@ -1027,11 +1027,11 @@ void real_menus_update(void) if (NULL == client.conn.playing) { /* Global observer */ - if (sdl2_client_flags & CF_MAP_UNIT_W_CREATED) { - /* show minimap buttons and unitinfo buttons */ + if (sdl3_client_flags & CF_MAP_UNIT_W_CREATED) { + /* Show minimap buttons and unitinfo buttons */ show_minimap_window_buttons(); show_unitinfo_window_buttons(); - /* disable minimap buttons and unitinfo buttons */ + /* Disable minimap buttons and unitinfo buttons */ disable_minimap_window_buttons(); disable_unitinfo_window_buttons(); } @@ -1049,10 +1049,10 @@ void real_menus_update(void) undraw_order_widgets(); } - if (sdl2_client_flags & CF_GAME_JUST_STARTED) { - sdl2_client_flags &= ~CF_GAME_JUST_STARTED; + if (sdl3_client_flags & CF_GAME_JUST_STARTED) { + sdl3_client_flags &= ~CF_GAME_JUST_STARTED; - /* show minimap buttons and unitinfo buttons */ + /* Show minimap buttons and unitinfo buttons */ show_minimap_window_buttons(); show_unitinfo_window_buttons(); diff --git a/client/gui-sdl3/messagewin.c b/client/gui-sdl3/messagewin.c index 3937160e10..293cff0b2e 100644 --- a/client/gui-sdl3/messagewin.c +++ b/client/gui-sdl3/messagewin.c @@ -37,7 +37,7 @@ /* client */ #include "options.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "citydlg.h" #include "colors.h" #include "graphics.h" @@ -52,8 +52,8 @@ #include "messagewin.h" -#ifdef GUI_SDL2_SMALL_SCREEN -#define N_MSG_VIEW 3 /* max before scrolling happens */ +#ifdef GUI_SDL3_SMALL_SCREEN +#define N_MSG_VIEW 3 /* Max before scrolling happens */ #else #define N_MSG_VIEW 6 #endif diff --git a/client/gui-sdl3/optiondlg.c b/client/gui-sdl3/optiondlg.c index 55cb5bb76a..f329391c8b 100644 --- a/client/gui-sdl3/optiondlg.c +++ b/client/gui-sdl3/optiondlg.c @@ -50,7 +50,7 @@ #include "global_worklist.h" #include "pages_g.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "connectdlg.h" #include "dialogs.h" @@ -1394,7 +1394,7 @@ void init_options_button(void) set_wflag(options_button, WF_HIDDEN); widget_set_position(options_button, adj_size(5), adj_size(5)); -#ifndef GUI_SDL2_SMALL_SCREEN +#ifndef GUI_SDL3_SMALL_SCREEN add_to_gui_list(ID_CLIENT_OPTIONS, options_button); #endif diff --git a/client/gui-sdl3/pages.c b/client/gui-sdl3/pages.c index fb5deb9572..82e3f0910c 100644 --- a/client/gui-sdl3/pages.c +++ b/client/gui-sdl3/pages.c @@ -27,7 +27,7 @@ #include "connectdlg_common.h" #include "pages_g.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "chatline.h" #include "colors.h" #include "connectdlg.h" @@ -174,7 +174,7 @@ static void show_main_page(void) add_to_gui_list(ID_LABEL, pwidget); - /* TRANS: gui-sdl2 client */ + /* TRANS: gui-sdl3 client */ fc_snprintf(verbuf, sizeof(verbuf), _("%s client"), client_string); pwidget = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, verbuf, FONTO_ATTENTION, @@ -340,7 +340,7 @@ static void show_main_page(void) area.x + area.w - 1, area.y + (h * 2 - 1), &line_color); - set_output_window_text(_("SDL2-client welcomes you...")); + set_output_window_text(_("SDL3-client welcomes you...")); #if IS_BETA_VERSION || IS_DEVEL_VERSION set_output_window_text(unstable_message()); diff --git a/client/gui-sdl3/plrdlg.c b/client/gui-sdl3/plrdlg.c index f971a043c5..0eb7a00573 100644 --- a/client/gui-sdl3/plrdlg.c +++ b/client/gui-sdl3/plrdlg.c @@ -33,7 +33,7 @@ #include "client_main.h" #include "climisc.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "chatline.h" #include "colors.h" #include "diplodlg.h" @@ -110,7 +110,7 @@ static int toggle_draw_war_status_callback(struct widget *pwidget) /* exit button -> neutral -> war -> casefire -> peace -> alliance */ struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev; - sdl2_client_flags ^= CF_DRAW_PLAYERS_WAR_STATUS; + sdl3_client_flags ^= CF_DRAW_PLAYERS_WAR_STATUS; do { pplayer = pplayer->prev; FREESURFACE(pplayer->gfx); @@ -128,10 +128,10 @@ static int toggle_draw_war_status_callback(struct widget *pwidget) static int toggle_draw_ceasefire_status_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { - /* exit button -> neutral -> war -> casefire -> peace -> alliance */ + /* Exit button -> neutral -> war -> casefire -> peace -> alliance */ struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev; - sdl2_client_flags ^= CF_DRAW_PLAYERS_CEASEFIRE_STATUS; + sdl3_client_flags ^= CF_DRAW_PLAYERS_CEASEFIRE_STATUS; do { pplayer = pplayer->prev; FREESURFACE(pplayer->gfx); @@ -149,10 +149,10 @@ static int toggle_draw_ceasefire_status_callback(struct widget *pwidget) static int toggle_draw_peace_status_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { - /* exit button -> neutral -> war -> casefire -> peace -> alliance */ + /* Exit button -> neutral -> war -> casefire -> peace -> alliance */ struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev; - sdl2_client_flags ^= CF_DRAW_PLAYERS_PEACE_STATUS; + sdl3_client_flags ^= CF_DRAW_PLAYERS_PEACE_STATUS; do { pplayer = pplayer->prev; FREESURFACE(pplayer->gfx); @@ -170,10 +170,10 @@ static int toggle_draw_peace_status_callback(struct widget *pwidget) static int toggle_draw_alliance_status_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { - /* exit button -> neutral -> war -> casefire -> peace -> alliance */ + /* Exit button -> neutral -> war -> casefire -> peace -> alliance */ struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev; - sdl2_client_flags ^= CF_DRAW_PLAYERS_ALLIANCE_STATUS; + sdl3_client_flags ^= CF_DRAW_PLAYERS_ALLIANCE_STATUS; do { pplayer = pplayer->prev; FREESURFACE(pplayer->gfx); @@ -191,10 +191,10 @@ static int toggle_draw_alliance_status_callback(struct widget *pwidget) static int toggle_draw_neutral_status_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { - /* exit button -> neutral -> war -> casefire -> peace -> alliance */ + /* Exit button -> neutral -> war -> casefire -> peace -> alliance */ struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev; - sdl2_client_flags ^= CF_DRAW_PLAYERS_NEUTRAL_STATUS; + sdl3_client_flags ^= CF_DRAW_PLAYERS_NEUTRAL_STATUS; do { pplayer = pplayer->prev; FREESURFACE(pplayer->gfx); @@ -278,35 +278,35 @@ void real_players_dialog_update(void *unused) switch (player_diplstate_get(pplayer, pplayer1->data.player)->type) { case DS_ARMISTICE: - if (sdl2_client_flags & CF_DRAW_PLAYERS_NEUTRAL_STATUS) { + if (sdl3_client_flags & CF_DRAW_PLAYERS_NEUTRAL_STATUS) { create_line(pplayer1->dst->surface, dst0.x, dst0.y, dst1.x, dst1.y, get_theme_color(COLOR_THEME_PLRDLG_ARMISTICE)); } break; case DS_WAR: - if (sdl2_client_flags & CF_DRAW_PLAYERS_WAR_STATUS) { + if (sdl3_client_flags & CF_DRAW_PLAYERS_WAR_STATUS) { create_line(pplayer1->dst->surface, dst0.x, dst0.y, dst1.x, dst1.y, get_theme_color(COLOR_THEME_PLRDLG_WAR)); } break; case DS_CEASEFIRE: - if (sdl2_client_flags & CF_DRAW_PLAYERS_CEASEFIRE_STATUS) { + if (sdl3_client_flags & CF_DRAW_PLAYERS_CEASEFIRE_STATUS) { create_line(pplayer1->dst->surface, dst0.x, dst0.y, dst1.x, dst1.y, get_theme_color(COLOR_THEME_PLRDLG_CEASEFIRE)); } break; case DS_PEACE: - if (sdl2_client_flags & CF_DRAW_PLAYERS_PEACE_STATUS) { + if (sdl3_client_flags & CF_DRAW_PLAYERS_PEACE_STATUS) { create_line(pplayer1->dst->surface, dst0.x, dst0.y, dst1.x, dst1.y, get_theme_color(COLOR_THEME_PLRDLG_PEACE)); } break; case DS_ALLIANCE: - if (sdl2_client_flags & CF_DRAW_PLAYERS_ALLIANCE_STATUS) { + if (sdl3_client_flags & CF_DRAW_PLAYERS_ALLIANCE_STATUS) { create_line(pplayer1->dst->surface, dst0.x, dst0.y, dst1.x, dst1.y, get_theme_color(COLOR_THEME_PLRDLG_ALLIANCE)); @@ -390,35 +390,35 @@ void popup_players_dialog(bool raise) switch (i) { case DS_ARMISTICE: buf = create_checkbox(pwindow->dst, - (sdl2_client_flags & CF_DRAW_PLAYERS_NEUTRAL_STATUS), + (sdl3_client_flags & CF_DRAW_PLAYERS_NEUTRAL_STATUS), WF_RESTORE_BACKGROUND); buf->action = toggle_draw_neutral_status_callback; buf->key = SDLK_n; break; case DS_WAR: buf = create_checkbox(pwindow->dst, - (sdl2_client_flags & CF_DRAW_PLAYERS_WAR_STATUS), + (sdl3_client_flags & CF_DRAW_PLAYERS_WAR_STATUS), WF_RESTORE_BACKGROUND); buf->action = toggle_draw_war_status_callback; buf->key = SDLK_w; break; case DS_CEASEFIRE: buf = create_checkbox(pwindow->dst, - (sdl2_client_flags & CF_DRAW_PLAYERS_CEASEFIRE_STATUS), + (sdl3_client_flags & CF_DRAW_PLAYERS_CEASEFIRE_STATUS), WF_RESTORE_BACKGROUND); buf->action = toggle_draw_ceasefire_status_callback; buf->key = SDLK_c; break; case DS_PEACE: buf = create_checkbox(pwindow->dst, - (sdl2_client_flags & CF_DRAW_PLAYERS_PEACE_STATUS), + (sdl3_client_flags & CF_DRAW_PLAYERS_PEACE_STATUS), WF_RESTORE_BACKGROUND); buf->action = toggle_draw_peace_status_callback; buf->key = SDLK_p; break; case DS_ALLIANCE: buf = create_checkbox(pwindow->dst, - (sdl2_client_flags & CF_DRAW_PLAYERS_ALLIANCE_STATUS), + (sdl3_client_flags & CF_DRAW_PLAYERS_ALLIANCE_STATUS), WF_RESTORE_BACKGROUND); buf->action = toggle_draw_alliance_status_callback; buf->key = SDLK_a; diff --git a/client/gui-sdl3/repodlgs.c b/client/gui-sdl3/repodlgs.c index ad0a0abde1..9ccc8bdebe 100644 --- a/client/gui-sdl3/repodlgs.c +++ b/client/gui-sdl3/repodlgs.c @@ -37,7 +37,7 @@ #include "client_main.h" #include "text.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "cityrep.h" #include "colors.h" #include "dialogs.h" @@ -1173,11 +1173,11 @@ static int toggle_block_callback(struct widget *pcheckbox) if (PRESSED_EVENT(main_data.event)) { switch (pcheckbox->id) { case ID_CHANGE_TAXRATE_DLG_LUX_BLOCK_CHECKBOX: - sdl2_client_flags ^= CF_CHANGE_TAXRATE_LUX_BLOCK; + sdl3_client_flags ^= CF_CHANGE_TAXRATE_LUX_BLOCK; return -1; case ID_CHANGE_TAXRATE_DLG_SCI_BLOCK_CHECKBOX: - sdl2_client_flags ^= CF_CHANGE_TAXRATE_SCI_BLOCK; + sdl3_client_flags ^= CF_CHANGE_TAXRATE_SCI_BLOCK; return -1; default: @@ -1326,14 +1326,14 @@ static int horiz_taxrate_callback(struct widget *horiz_src) switch (horiz_src->id) { case ID_CHANGE_TAXRATE_DLG_LUX_SCROLLBAR: - if (sdl2_client_flags & CF_CHANGE_TAXRATE_LUX_BLOCK) { + if (sdl3_client_flags & CF_CHANGE_TAXRATE_LUX_BLOCK) { goto END; } motion.src_rate = (int *)horiz_src->data.ptr; motion.horiz_dst = horiz_src->prev->prev->prev; /* sci */ motion.dst_rate = (int *)motion.horiz_dst->data.ptr; motion.tax = 100 - *motion.src_rate - *motion.dst_rate; - if ((sdl2_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK)) { + if ((sdl3_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK)) { if (motion.tax <= get_player_bonus(client.conn.playing, EFT_MAX_RATES)) { motion.horiz_dst = NULL; /* tax */ motion.dst_rate = &motion.tax; @@ -1345,20 +1345,20 @@ static int horiz_taxrate_callback(struct widget *horiz_src) break; case ID_CHANGE_TAXRATE_DLG_SCI_SCROLLBAR: - if ((sdl2_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK)) { + if ((sdl3_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK)) { goto END; } motion.src_rate = (int *)horiz_src->data.ptr; motion.horiz_dst = horiz_src->next->next->next; /* lux */ motion.dst_rate = (int *)motion.horiz_dst->data.ptr; motion.tax = 100 - *motion.src_rate - *motion.dst_rate; - if (sdl2_client_flags & CF_CHANGE_TAXRATE_LUX_BLOCK) { + if (sdl3_client_flags & CF_CHANGE_TAXRATE_LUX_BLOCK) { if (motion.tax <= get_player_bonus(client.conn.playing, EFT_MAX_RATES)) { - /* tax */ + /* Tax */ motion.horiz_dst = NULL; motion.dst_rate = &motion.tax; } else { - goto END; /* all blocked */ + goto END; /* All blocked */ } } @@ -1989,7 +1989,7 @@ void economy_report_dialog_popup(bool make_modal) pstr->style |= TTF_STYLE_BOLD; buf = create_checkbox(pwindow->dst, - sdl2_client_flags & CF_CHANGE_TAXRATE_LUX_BLOCK, + sdl3_client_flags & CF_CHANGE_TAXRATE_LUX_BLOCK, WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL); set_new_checkbox_theme(buf, current_theme->lock_icon, current_theme->unlock_icon); @@ -2036,7 +2036,7 @@ void economy_report_dialog_popup(bool make_modal) pstr->style |= TTF_STYLE_BOLD; buf = create_checkbox(pwindow->dst, - sdl2_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK, + sdl3_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK, WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL); set_new_checkbox_theme(buf, current_theme->lock_icon, @@ -3393,11 +3393,11 @@ void science_report_dialog_popup(bool raise) pstr = create_utf8_from_char_fonto(_("Research"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN pwindow = create_window(NULL, pstr, 200, 132, 0); -#else /* GUI_SDL2_SMALL_SCREEN */ +#else /* GUI_SDL3_SMALL_SCREEN */ pwindow = create_window(NULL, pstr, adj_size(400), adj_size(246), 0); -#endif /* GUI_SDL2_SMALL_SCREEN */ +#endif /* GUI_SDL3_SMALL_SCREEN */ set_wstate(pwindow, FC_WS_NORMAL); pwindow->action = science_dialog_callback; diff --git a/client/gui-sdl3/repodlgs.h b/client/gui-sdl3/repodlgs.h index 01ec4e2302..45da5ff1fb 100644 --- a/client/gui-sdl3/repodlgs.h +++ b/client/gui-sdl3/repodlgs.h @@ -21,7 +21,7 @@ #include #endif /* SDL2_PLAIN_INCLUDE */ -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "gui_string.h" #include "repodlgs_g.h" diff --git a/client/gui-sdl3/spaceshipdlg.c b/client/gui-sdl3/spaceshipdlg.c index e54d6277e5..d2fc886931 100644 --- a/client/gui-sdl3/spaceshipdlg.c +++ b/client/gui-sdl3/spaceshipdlg.c @@ -30,7 +30,7 @@ #include "spaceshipdlg_g.h" #include "text.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "graphics.h" #include "gui_id.h" #include "gui_main.h" diff --git a/client/gui-sdl3/sprite.c b/client/gui-sdl3/sprite.c index 4cf05a2adc..c8758e24e5 100644 --- a/client/gui-sdl3/sprite.c +++ b/client/gui-sdl3/sprite.c @@ -29,7 +29,7 @@ #include "log.h" #include "mem.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "colors.h" #include "graphics.h" @@ -200,6 +200,6 @@ static struct sprite *ctor_sprite(SDL_Surface *surf) ****************************************************************************/ struct sprite *load_gfxnumber(int num) { - /* Not supported in sdl2-client */ + /* Not supported in sdl3-client */ return NULL; } diff --git a/client/gui-sdl3/themebackgrounds.c b/client/gui-sdl3/themebackgrounds.c index f1af0e69c6..2c73a7133b 100644 --- a/client/gui-sdl3/themebackgrounds.c +++ b/client/gui-sdl3/themebackgrounds.c @@ -19,7 +19,7 @@ #include "registry.h" #include "mem.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "graphics.h" #include "themespec.h" diff --git a/client/gui-sdl3/themecolors.c b/client/gui-sdl3/themecolors.c index 81d741157f..b10d733c51 100644 --- a/client/gui-sdl3/themecolors.c +++ b/client/gui-sdl3/themecolors.c @@ -18,7 +18,7 @@ /* utility */ #include "mem.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "colors.h" #include "themespec.h" diff --git a/client/gui-sdl3/themes.c b/client/gui-sdl3/themes.c index ddfd81336e..1732129c34 100644 --- a/client/gui-sdl3/themes.c +++ b/client/gui-sdl3/themes.c @@ -27,7 +27,7 @@ #include "mem.h" #include "string_vector.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "gui_main.h" #include "themespec.h" @@ -35,7 +35,7 @@ #include "themes_g.h" /*************************************************************************//** - Loads a gui-sdl2 theme directory/theme_name + Loads a gui-sdl3 theme directory/theme_name *****************************************************************************/ void gui_load_theme(const char *directory, const char *theme_name) { @@ -67,7 +67,7 @@ void gui_clear_theme(void) { if (!load_theme(GUI_SDL_OPTION(default_theme_name))) { /* TRANS: No full stop after the URL, could cause confusion. */ - log_fatal(_("No Sdl2-client theme was found. For instructions on how to " + log_fatal(_("No Sdl3-client theme was found. For instructions on how to " "get one, please visit %s"), HOMEPAGE_URL); exit(EXIT_FAILURE); @@ -101,7 +101,7 @@ char **get_gui_specific_themes_directories(int *count) /*************************************************************************//** Return an array of names of usable themes in the given directory. Array size is stored in count. - Useable theme for gui-sdl2 is a directory which contains file theme.themespec. + Useable theme for gui-sdl3 is a directory which contains file theme.themespec. The caller is responsible for freeing the array and the names *****************************************************************************/ char **get_useable_themes_in_directory(const char *directory, int *count) diff --git a/client/gui-sdl3/themespec.c b/client/gui-sdl3/themespec.c index 3ae77347e6..f1057f8ce2 100644 --- a/client/gui-sdl3/themespec.c +++ b/client/gui-sdl3/themespec.c @@ -39,7 +39,7 @@ #include "citydlg_common.h" #include "client_main.h" /* for client_state() */ -/* gui-sdl2 */ +/* gui-sdl3 */ #include "dialogs.h" #include "gui_tilespec.h" #include "mapview.h" @@ -47,7 +47,7 @@ #include "themespec.h" -#define THEMESPEC_SDL2_CAPSTR "+Freeciv-sdl2-3.3-themespec-Devel-2023-Jun-07 duplicates_ok" +#define THEMESPEC_SDL3_CAPSTR "+Freeciv-sdl2-3.3-themespec-Devel-2023-Jun-07 duplicates_ok" /* * Themespec capabilities acceptable to this program: * @@ -59,7 +59,7 @@ * have duplicates should specify "+duplicates_ok") */ -#define SPEC_SDL2_CAPSTR "+Freeciv-sdl2-3.3-spec-Devel-2023-Jun-10" +#define SPEC_SDL3_CAPSTR "+Freeciv-sdl2-3.3-spec-Devel-2023-Jun-10" /* * Individual spec file capabilities acceptable to this program: * @@ -453,7 +453,7 @@ void themespec_reread(const char *new_theme_name) Loads the given graphics file (found in the data path) into a newly allocated sprite. ****************************************************************************/ -static struct sprite *load_sdl2_gfx_file(const char *gfx_filename) +static struct sprite *load_sdl3_gfx_file(const char *gfx_filename) { const char **gfx_fileexts = gfx_fileextensions(), *gfx_fileext; struct sprite *s; @@ -501,13 +501,13 @@ static void theme_ensure_big_sprite(struct specfile *sf) } if (!check_themespec_capabilities(file, "spec", - SPEC_SDL2_CAPSTR, sf->file_name)) { + SPEC_SDL3_CAPSTR, sf->file_name)) { exit(EXIT_FAILURE); } gfx_filename = secfile_lookup_str(file, "file.gfx"); - sf->big_sprite = load_sdl2_gfx_file(gfx_filename); + sf->big_sprite = load_sdl3_gfx_file(gfx_filename); if (!sf->big_sprite) { log_fatal("Could not load gfx file for the spec file \"%s\".", @@ -539,7 +539,7 @@ static void scan_specfile(struct theme *t, struct specfile *sf, exit(EXIT_FAILURE); } if (!check_themespec_capabilities(file, "spec", - SPEC_SDL2_CAPSTR, sf->file_name)) { + SPEC_SDL3_CAPSTR, sf->file_name)) { exit(EXIT_FAILURE); } @@ -749,7 +749,7 @@ struct theme *theme_read_toplevel(const char *theme_name) } if (!check_themespec_capabilities(file, "themespec", - THEMESPEC_SDL2_CAPSTR, fname)) { + THEMESPEC_SDL3_CAPSTR, fname)) { secfile_destroy(file); FC_FREE(fname); theme_free(t); @@ -868,7 +868,7 @@ static struct sprite *theme_load_sprite(struct theme *t, const char *tag_name) /* If the sprite hasn't been loaded already, then load it. */ fc_assert_ret_val(ss->ref_count == 0, NULL); if (ss->file) { - ss->sprite = load_sdl2_gfx_file(ss->file); + ss->sprite = load_sdl3_gfx_file(ss->file); if (!ss->sprite) { log_fatal("Couldn't load gfx file \"%s\" for sprite '%s'.", ss->file, tag_name); diff --git a/client/gui-sdl3/themespec.h b/client/gui-sdl3/themespec.h index c99b1dc6af..401ed6a915 100644 --- a/client/gui-sdl3/themespec.h +++ b/client/gui-sdl3/themespec.h @@ -24,11 +24,11 @@ /* client */ #include "options.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "themebackgrounds.h" #include "themecolors.h" -struct sprite; /* opaque; gui-dep */ +struct sprite; /* Opaque; gui-dep */ struct theme; diff --git a/client/gui-sdl3/widget.c b/client/gui-sdl3/widget.c index d02fb68c59..b869d8fb4e 100644 --- a/client/gui-sdl3/widget.c +++ b/client/gui-sdl3/widget.c @@ -33,7 +33,7 @@ /* utility */ #include "log.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_id.h" diff --git a/client/gui-sdl3/widget.h b/client/gui-sdl3/widget.h index 3e8ff94d46..42a756c923 100644 --- a/client/gui-sdl3/widget.h +++ b/client/gui-sdl3/widget.h @@ -25,11 +25,11 @@ /* utility */ #include "fc_types.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "gui_main.h" #include "gui_string.h" -#ifdef GUI_SDL2_SMALL_SCREEN +#ifdef GUI_SDL3_SMALL_SCREEN #define WINDOW_TITLE_HEIGHT 10 #else #define WINDOW_TITLE_HEIGHT 20 diff --git a/client/gui-sdl3/widget_button.c b/client/gui-sdl3/widget_button.c index 0b2ac61908..0e229a6484 100644 --- a/client/gui-sdl3/widget_button.c +++ b/client/gui-sdl3/widget_button.c @@ -25,7 +25,7 @@ /* utility */ #include "log.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_tilespec.h" diff --git a/client/gui-sdl3/widget_checkbox.c b/client/gui-sdl3/widget_checkbox.c index 125c747908..6e6042723c 100644 --- a/client/gui-sdl3/widget_checkbox.c +++ b/client/gui-sdl3/widget_checkbox.c @@ -25,7 +25,7 @@ /* utility */ #include "log.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_tilespec.h" diff --git a/client/gui-sdl3/widget_combo.c b/client/gui-sdl3/widget_combo.c index e13c2fdbbf..f948560707 100644 --- a/client/gui-sdl3/widget_combo.c +++ b/client/gui-sdl3/widget_combo.c @@ -26,7 +26,7 @@ #include "log.h" #include "string_vector.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "colors.h" #include "gui_id.h" #include "gui_string.h" diff --git a/client/gui-sdl3/widget_combo.h b/client/gui-sdl3/widget_combo.h index 9779f135b2..0b8a89e68f 100644 --- a/client/gui-sdl3/widget_combo.h +++ b/client/gui-sdl3/widget_combo.h @@ -14,7 +14,7 @@ #ifndef FC__WIDGET_COMBO_H #define FC__WIDGET_COMBO_H -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "gui_string.h" struct strvec; diff --git a/client/gui-sdl3/widget_core.c b/client/gui-sdl3/widget_core.c index 93da290dcd..d44fddf3db 100644 --- a/client/gui-sdl3/widget_core.c +++ b/client/gui-sdl3/widget_core.c @@ -22,7 +22,7 @@ #include #endif /* SDL2_PLAIN_INCLUDE */ -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "mapview.h" diff --git a/client/gui-sdl3/widget_edit.c b/client/gui-sdl3/widget_edit.c index 4f152ddfef..94cf0c207c 100644 --- a/client/gui-sdl3/widget_edit.c +++ b/client/gui-sdl3/widget_edit.c @@ -22,7 +22,7 @@ #include #endif /* SDL2_PLAIN_INCLUDE */ -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_id.h" diff --git a/client/gui-sdl3/widget_icon.c b/client/gui-sdl3/widget_icon.c index e5c90e895e..8c0ace653f 100644 --- a/client/gui-sdl3/widget_icon.c +++ b/client/gui-sdl3/widget_icon.c @@ -25,7 +25,7 @@ /* utility */ #include "log.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "themespec.h" diff --git a/client/gui-sdl3/widget_label.c b/client/gui-sdl3/widget_label.c index d8e8e13876..0449b0fca1 100644 --- a/client/gui-sdl3/widget_label.c +++ b/client/gui-sdl3/widget_label.c @@ -26,7 +26,7 @@ #include "log.h" #include "mem.h" -/* client/gui-sdl2 */ +/* client/gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "themespec.h" diff --git a/client/gui-sdl3/widget_scrollbar.c b/client/gui-sdl3/widget_scrollbar.c index c1b1002153..4490050c9d 100644 --- a/client/gui-sdl3/widget_scrollbar.c +++ b/client/gui-sdl3/widget_scrollbar.c @@ -25,7 +25,7 @@ /* utility */ #include "log.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_id.h" diff --git a/client/gui-sdl3/widget_scrollbar.h b/client/gui-sdl3/widget_scrollbar.h index 457ebbbc26..1b54196125 100644 --- a/client/gui-sdl3/widget_scrollbar.h +++ b/client/gui-sdl3/widget_scrollbar.h @@ -14,7 +14,7 @@ #ifndef FC__WIDGET_SCROLLBAR_H #define FC__WIDGET_SCROLLBAR_H -/* gui-sdl2 */ +/* gui-sdl3 */ #include "widget.h" struct scroll_bar { diff --git a/client/gui-sdl3/widget_window.c b/client/gui-sdl3/widget_window.c index fcf9dd2109..814d2f32f1 100644 --- a/client/gui-sdl3/widget_window.c +++ b/client/gui-sdl3/widget_window.c @@ -25,7 +25,7 @@ /* utility */ #include "log.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "colors.h" #include "graphics.h" #include "gui_id.h" diff --git a/client/gui-sdl3/wldlg.c b/client/gui-sdl3/wldlg.c index 10b01d7f52..3f1d79816b 100644 --- a/client/gui-sdl3/wldlg.c +++ b/client/gui-sdl3/wldlg.c @@ -45,7 +45,7 @@ #include "climisc.h" #include "global_worklist.h" -/* gui-sdl2 */ +/* gui-sdl3 */ #include "citydlg.h" #include "colors.h" #include "graphics.h" -- 2.42.0