Get rid of obsolete HAVE_VIDEO_LAYOUT - obsolete spec, was only

ever implemented for OpenGL2 driver, lots of code debt, best to
instead just keep improving the overlay system instead which is
already available for most video drivers
This commit is contained in:
libretroadmin 2023-02-23 21:03:41 +01:00
parent c7f2e6e163
commit 51d238875e
123 changed files with 32 additions and 3763 deletions

View File

@ -1098,18 +1098,6 @@ ifeq ($(HAVE_OVERLAY), 1)
led/drivers/led_overlay.o
endif
ifeq ($(HAVE_VIDEO_LAYOUT), 1)
DEFINES += -DHAVE_VIDEO_LAYOUT
OBJ += \
gfx/video_layout.o \
gfx/video_layout/view.o \
gfx/video_layout/element.o \
gfx/video_layout/component.o \
gfx/video_layout/internal.o \
gfx/video_layout/scope.o \
gfx/video_layout/load.o
endif
ifeq ($(HAVE_STB_FONT), 1)
OBJ += gfx/drivers_font_renderer/stb.o
OBJ += gfx/drivers_font_renderer/stb_unicode.o

View File

@ -93,7 +93,6 @@ HAVE_STRCASESTR = 1
HAVE_THREADS = 1
HAVE_TRANSLATE = 1
HAVE_UDEV = 1
HAVE_VIDEO_LAYOUT = 1
HAVE_XMB = 1
HAVE_ZLIB = 1
HAVE_CONFIGFILE = 1

View File

@ -24,7 +24,6 @@ HAVE_GLSL = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_AUDIOMIXER = 1
HAVE_VIDEO_LAYOUT = 0
HAVE_CC_RESAMPLER = 1
HAVE_EGL = 1
HAVE_OPENGLES = 1

View File

@ -214,7 +214,6 @@ else ifeq ($(libogc_platform), 1)
HAVE_RTGA := 1
HAVE_IBXM := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_CONFIGFILE := 1
@ -348,7 +347,6 @@ else ifeq ($(platform), vita)
HAVE_IFINFO := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -371,7 +369,6 @@ else ifeq ($(platform), windows_msvc6_x86)
HAVE_NETWORK_CMD := 0
HAVE_NETPLAYDISCOVERY := 0
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -419,7 +416,6 @@ else ifeq ($(platform), windows_msvc2003_x86)
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -475,7 +471,6 @@ else ifeq ($(platform), windows_msvc2005_x86)
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_OZONE := 1
@ -560,7 +555,6 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_OZONE := 1
@ -657,7 +651,6 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -745,7 +738,6 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -833,7 +825,6 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -936,7 +927,6 @@ else ifeq (qnx,$(platform))
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -984,7 +974,6 @@ else ifneq (,$(findstring unix,$(platform)))
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
@ -1128,10 +1117,6 @@ ifeq ($(HAVE_OVERLAY), 1)
CFLAGS += -DHAVE_OVERLAY
endif
ifeq ($(HAVE_VIDEO_LAYOUT), 1)
CFLAGS += -DHAVE_VIDEO_LAYOUT
endif
ifeq ($(HAVE_NETWORKING), 1)
CFLAGS += -DHAVE_NETWORKING
endif

View File

@ -75,7 +75,6 @@ ifeq ($(HAVE_OPENGL), 1)
HAVE_XMB = 1
HAVE_OZONE = 1
HAVE_OVERLAY = 1
HAVE_VIDEO_LAYOUT = 1
HAVE_GLSL = 1
else
HAVE_RGUI = 1

View File

@ -61,7 +61,6 @@ HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_LANGEXTRA := 1
HAVE_CHEEVOS := 1
HAVE_SHADERPIPELINE := 1

View File

@ -125,7 +125,6 @@ HAVE_RBMP := 1
HAVE_RTGA := 1
HAVE_IBXM := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_CONFIGFILE := 1

View File

@ -32,7 +32,6 @@ DEFINES += -DHAVE_THREADS \
-DHAVE_RPNG \
-DHAVE_RJPEG \
-DHAVE_OVERLAY \
-DHAVE_VIDEO_LAYOUT \
-DHAVE_ALSA \
-DHAVE_ZLIB \
-D__linux__ \

View File

@ -52,7 +52,6 @@ else
HAVE_ZLIB := 1
HAVE_BUILTINZLIB := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 1
HAVE_7ZIP := 1
HAVE_EGL := 1
HAVE_GFX_WIDGETS := 1

View File

@ -16,7 +16,6 @@ ifeq ($(DEBUG), 1)
DEFINES += -DDEBUG
else
OPTIMIZE_LV := -O3
# LDFLAGS := -s
endif
ifeq ($(MUTE_WARNINGS), 1)

View File

@ -72,7 +72,6 @@ endif
SHARED_FLAGS :=
SHARED_FLAGS += -DHAVE_VIDEO_LAYOUT
SHARED_FLAGS += -DHAVE_GCM
SHARED_FLAGS += -DHAVE_MENU \
-DHAVE_CONFIGFILE \

View File

@ -85,7 +85,6 @@ endif
SHARED_FLAGS :=
SHARED_FLAGS += -DHAVE_VIDEO_LAYOUT
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER -DHAVE_MULTIMAN -DHAVE_RGUI -DIS_SALAMANDER -DHAVE_GCM
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
CXXFLAGS += $(SHARED_FLAGS)

View File

@ -86,7 +86,6 @@ else
HAVE_PATCH := 1
HAVE_CHEATS := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_RGUI := 1

View File

@ -133,7 +133,6 @@ HAVE_RBMP := 1
HAVE_RTGA := 1
HAVE_IBXM := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_CONFIGFILE := 1

View File

@ -165,7 +165,6 @@ endif
HAVE_OVERLAY = 1
HAVE_SPIRV_CROSS = 1
HAVE_SLANG = 1
HAVE_VIDEO_LAYOUT = 0
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1

View File

@ -99,7 +99,6 @@ OBJ :=
LIBS := -lm
DEFINES :=
DEFINES += -I. -Ilibretro-common/include -Ilibretro-common/include/compat/zlib -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_OVERLAY
#DEFINES += -DHAVE_VIDEO_LAYOUT
LDFLAGS := -L. -static-libgcc
include Makefile.common

View File

@ -1518,12 +1518,6 @@ static struct config_path_setting *populate_settings_path(
#ifdef HAVE_OVERLAY
SETTING_PATH("input_overlay",
settings->paths.path_overlay, false, NULL, true);
#endif
#ifdef HAVE_VIDEO_LAYOUT
SETTING_PATH("video_layout_path",
settings->paths.path_video_layout, false, NULL, true);
SETTING_PATH("video_layout_directory",
settings->paths.directory_video_layout, true, NULL, true);
#endif
SETTING_PATH("video_record_config",
settings->paths.path_record_config, false, NULL, true);
@ -1586,10 +1580,6 @@ static struct config_path_setting *populate_settings_path(
#ifdef HAVE_OVERLAY
SETTING_PATH("overlay_directory",
settings->paths.directory_overlay, true, NULL, true);
#endif
#ifdef HAVE_VIDEO_LAYOUT
SETTING_PATH("video_layout_directory",
settings->paths.directory_video_layout, true, NULL, true);
#endif
SETTING_PATH(
"screenshot_directory",
@ -1901,9 +1891,6 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("menu_show_latency", &settings->bools.menu_show_latency, true, DEFAULT_QUICK_MENU_SHOW_LATENCY, false);
SETTING_BOOL("menu_show_rewind", &settings->bools.menu_show_rewind, true, DEFAULT_QUICK_MENU_SHOW_REWIND, false);
SETTING_BOOL("menu_show_overlays", &settings->bools.menu_show_overlays, true, DEFAULT_QUICK_MENU_SHOW_OVERLAYS, false);
#ifdef HAVE_VIDEO_LAYOUT
SETTING_BOOL("menu_show_video_layout", &settings->bools.menu_show_video_layout, true, DEFAULT_QUICK_MENU_SHOW_VIDEO_LAYOUT, false);
#endif
SETTING_BOOL("menu_show_help", &settings->bools.menu_show_help, true, DEFAULT_MENU_SHOW_HELP, false);
SETTING_BOOL("menu_show_quit_retroarch", &settings->bools.menu_show_quit_retroarch, true, DEFAULT_MENU_SHOW_QUIT, false);
@ -1977,9 +1964,6 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("input_overlay_auto_rotate", &settings->bools.input_overlay_auto_rotate, true, DEFAULT_OVERLAY_AUTO_ROTATE, false);
SETTING_BOOL("input_overlay_auto_scale", &settings->bools.input_overlay_auto_scale, true, DEFAULT_INPUT_OVERLAY_AUTO_SCALE, false);
#endif
#ifdef HAVE_VIDEO_LAYOUT
SETTING_BOOL("video_layout_enable", &settings->bools.video_layout_enable, true, true, false);
#endif
#ifdef HAVE_COMMAND
SETTING_BOOL("network_cmd_enable", &settings->bools.network_cmd_enable, true, DEFAULT_NETWORK_CMD_ENABLE, false);
SETTING_BOOL("stdin_cmd_enable", &settings->bools.stdin_cmd_enable, true, DEFAULT_STDIN_CMD_ENABLE, false);
@ -2225,9 +2209,6 @@ static struct config_uint_setting *populate_settings_uint(
#endif
SETTING_UINT("video_scale", &settings->uints.video_scale, true, DEFAULT_SCALE, false);
SETTING_UINT("video_window_opacity", &settings->uints.video_window_opacity, true, DEFAULT_WINDOW_OPACITY, false);
#ifdef HAVE_VIDEO_LAYOUT
SETTING_UINT("video_layout_selected_view", &settings->uints.video_layout_selected_view, true, 0, false);
#endif
SETTING_UINT("video_shader_delay", &settings->uints.video_shader_delay, true, DEFAULT_SHADER_DELAY, false);
#ifdef HAVE_COMMAND
SETTING_UINT("network_cmd_port", &settings->uints.network_cmd_port, true, DEFAULT_NETWORK_CMD_PORT, false);
@ -2812,9 +2793,6 @@ void config_set_defaults(void *data)
*settings->paths.path_rgui_theme_preset = '\0';
*settings->paths.path_content_database = '\0';
*settings->paths.path_overlay = '\0';
#ifdef HAVE_VIDEO_LAYOUT
*settings->paths.path_video_layout = '\0';
#endif
*settings->paths.path_record_config = '\0';
*settings->paths.path_stream_config = '\0';
*settings->paths.path_stream_url = '\0';
@ -2922,14 +2900,6 @@ void config_set_defaults(void *data)
#endif
}
#endif
#ifdef HAVE_VIDEO_LAYOUT
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]))
{
fill_pathname_expand_special(settings->paths.directory_video_layout,
g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
sizeof(settings->paths.directory_video_layout));
}
#endif
#ifdef HAVE_MENU
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG]))
@ -3804,10 +3774,6 @@ static bool config_load_file(global_t *global,
#ifdef HAVE_OVERLAY
if (string_is_equal(settings->paths.directory_overlay, "default"))
*settings->paths.directory_overlay = '\0';
#endif
#ifdef HAVE_VIDEO_LAYOUT
if (string_is_equal(settings->paths.directory_video_layout, "default"))
*settings->paths.directory_video_layout = '\0';
#endif
if (string_is_equal(settings->paths.directory_system, "default"))
*settings->paths.directory_system = '\0';

View File

@ -236,9 +236,6 @@ typedef struct settings
unsigned video_dingux_ipu_filter_type;
unsigned video_dingux_refresh_rate;
unsigned video_dingux_rs90_softfilter_type;
#ifdef HAVE_VIDEO_LAYOUT
unsigned video_layout_selected_view;
#endif
#ifdef GEKKO
unsigned video_overscan_correction_top;
unsigned video_overscan_correction_bottom;
@ -486,9 +483,6 @@ typedef struct settings
char path_cheat_database[PATH_MAX_LENGTH];
char path_content_database[PATH_MAX_LENGTH];
char path_overlay[PATH_MAX_LENGTH];
#ifdef HAVE_VIDEO_LAYOUT
char path_video_layout[PATH_MAX_LENGTH];
#endif
char path_record_config[PATH_MAX_LENGTH];
char path_stream_config[PATH_MAX_LENGTH];
char path_menu_wallpaper[PATH_MAX_LENGTH];
@ -512,9 +506,6 @@ typedef struct settings
char directory_libretro[PATH_MAX_LENGTH];
char directory_input_remapping[PATH_MAX_LENGTH];
char directory_overlay[PATH_MAX_LENGTH];
#ifdef HAVE_VIDEO_LAYOUT
char directory_video_layout[PATH_MAX_LENGTH];
#endif
char directory_resampler[PATH_MAX_LENGTH];
char directory_screenshot[PATH_MAX_LENGTH];
char directory_system[PATH_MAX_LENGTH];
@ -585,9 +576,6 @@ typedef struct settings
#endif
bool video_wiiu_prefer_drc;
bool video_notch_write_over_enable;
#ifdef HAVE_VIDEO_LAYOUT
bool video_layout_enable;
#endif
bool video_hdr_enable;
bool video_hdr_expand_gamut;
@ -701,9 +689,6 @@ typedef struct settings
bool menu_show_rewind;
bool menu_show_overlays;
bool menu_show_legacy_thumbnail_updater;
#ifdef HAVE_VIDEO_LAYOUT
bool menu_show_video_layout;
#endif
bool menu_materialui_icons_enable;
bool menu_materialui_playlist_icons_enable;
bool menu_materialui_switch_icons;

View File

@ -41,9 +41,6 @@ enum default_dirs
DEFAULT_DIR_CORE,
DEFAULT_DIR_CORE_INFO,
DEFAULT_DIR_OVERLAY,
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_DIR_VIDEO_LAYOUT,
#endif
DEFAULT_DIR_PORT,
DEFAULT_DIR_SHADER,
DEFAULT_DIR_SAVESTATE,

View File

@ -396,9 +396,6 @@ static void frontend_darwin_get_env(int *argc, char *argv[],
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], home_dir_buf, "info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], home_dir_buf, "overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], home_dir_buf, "layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], home_dir_buf, "autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS], home_dir_buf, "downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], home_dir_buf, "assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
@ -434,9 +431,6 @@ static void frontend_darwin_get_env(int *argc, char *argv[],
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], application_data, "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], application_data, "info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], application_data, "overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], application_data, "layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], application_data, "autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], application_data, "assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE], application_data, "database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE]));

View File

@ -95,10 +95,6 @@ static void frontend_dos_get_env_settings(int *argc, char *argv[],
"cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], base_path,
"overlay", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], base_path,
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS], base_path,
"download", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT], base_path,

View File

@ -106,10 +106,6 @@ static void frontend_emscripten_get_env(int *argc, char *argv[],
"bundle/info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], base_path,
"bundle/overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], base_path,
"bundle/layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER], base_path,
"bundle/shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER], base_path,

View File

@ -280,11 +280,6 @@ static void frontend_gx_get_env(int *argc, char *argv[],
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
g_defaults.dirs[DEFAULT_DIR_CORE], "overlays",
sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
g_defaults.dirs[DEFAULT_DIR_CORE], "layouts",
sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER],
g_defaults.dirs[DEFAULT_DIR_CORE], "filters/video",
sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER]));

View File

@ -143,10 +143,6 @@ static void frontend_orbis_get_env(int *argc, char *argv[],
"temp", sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], user_path,
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], user_path,
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], user_path,
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,

View File

@ -100,10 +100,6 @@ static void create_path_names(void)
"temp", sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], user_path,
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], user_path,
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], user_path,
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,

View File

@ -162,11 +162,6 @@ static void fill_derived_paths(void)
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
g_defaults.dirs[DEFAULT_DIR_PORT],
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
g_defaults.dirs[DEFAULT_DIR_PORT],
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS],
g_defaults.dirs[DEFAULT_DIR_PORT],
"assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));

View File

@ -130,10 +130,6 @@ static void frontend_psp_get_env_settings(int *argc, char *argv[],
sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], user_path,
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], user_path,
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], user_path,
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path, "logs",

View File

@ -99,11 +99,6 @@ static void frontend_qnx_get_env_settings(int *argc, char *argv[],
"info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], data_path,
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], data_path,
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
/* user data */
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS], user_path,
"cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));

View File

@ -247,11 +247,6 @@ static void frontend_switch_get_env(
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], g_defaults.dirs[DEFAULT_DIR_PORT],
"overlay", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], g_defaults.dirs[DEFAULT_DIR_PORT],
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS], g_defaults.dirs[DEFAULT_DIR_PORT],
"downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));

View File

@ -1665,11 +1665,6 @@ static void frontend_unix_get_env(int *argc,
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS],
parent_path, "cheats",
sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
parent_path, "layouts",
sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE],
parent_path, "temp",
@ -1891,10 +1886,6 @@ static void frontend_unix_get_env(int *argc,
"cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], base_path,
"overlay", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], base_path,
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS], base_path,
"downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT], base_path,

View File

@ -304,10 +304,6 @@ static void frontend_uwp_env_get(int *argc, char *argv[],
"~\\thumbnails\\", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
"~\\overlays\\", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
"~\\layouts\\", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
/* This one is an exception: cores have to be loaded from
* the install directory,
* since this is the only place UWP apps can take .dlls from */

View File

@ -597,10 +597,6 @@ static void frontend_win32_env_get(int *argc, char *argv[],
":\\thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
":\\overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
":\\layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
if (!string_is_empty(libretro_directory))
strlcpy(g_defaults.dirs[DEFAULT_DIR_CORE], libretro_directory,
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));

View File

@ -122,12 +122,6 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
g_defaults.dirs[DEFAULT_DIR_CORE],
"overlays",
sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
#ifdef HAVE_VIDEO_LAYOUT
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
g_defaults.dirs[DEFAULT_DIR_CORE],
"layouts",
sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS],
g_defaults.dirs[DEFAULT_DIR_CORE],
"media", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));

View File

@ -158,29 +158,28 @@ typedef struct gl2 gl2_t;
enum gl2_flags
{
GL2_FLAG_VIDEO_LAYOUT_RESIZE = (1 << 0),
GL2_FLAG_TEXTURE_MIPMAP = (1 << 1),
GL2_FLAG_SHOULD_RESIZE = (1 << 2),
GL2_FLAG_HAVE_MIPMAP = (1 << 3),
GL2_FLAG_QUITTING = (1 << 4),
GL2_FLAG_FULLSCREEN = (1 << 5),
GL2_FLAG_KEEP_ASPECT = (1 << 6),
GL2_FLAG_HAVE_FBO = (1 << 7),
GL2_FLAG_HW_RENDER_USE = (1 << 8),
GL2_FLAG_FBO_INITED = (1 << 9),
GL2_FLAG_FBO_FEEDBACK_ENABLE = (1 << 10),
GL2_FLAG_HW_RENDER_FBO_INIT = (1 << 11),
GL2_FLAG_SHARED_CONTEXT_USE = (1 << 12),
GL2_FLAG_CORE_CONTEXT_IN_USE = (1 << 13),
GL2_FLAG_HAVE_SYNC = (1 << 14),
GL2_FLAG_HAVE_UNPACK_ROW_LENGTH = (1 << 15),
GL2_FLAG_HAVE_ES2_COMPAT = (1 << 16),
GL2_FLAG_PBO_READBACK_ENABLE = (1 << 17),
GL2_FLAG_OVERLAY_ENABLE = (1 << 18),
GL2_FLAG_OVERLAY_FULLSCREEN = (1 << 19),
GL2_FLAG_MENU_TEXTURE_ENABLE = (1 << 20),
GL2_FLAG_MENU_TEXTURE_FULLSCREEN= (1 << 21),
GL2_FLAG_NONE = (1 << 22)
GL2_FLAG_TEXTURE_MIPMAP = (1 << 0),
GL2_FLAG_SHOULD_RESIZE = (1 << 1),
GL2_FLAG_HAVE_MIPMAP = (1 << 2),
GL2_FLAG_QUITTING = (1 << 3),
GL2_FLAG_FULLSCREEN = (1 << 4),
GL2_FLAG_KEEP_ASPECT = (1 << 5),
GL2_FLAG_HAVE_FBO = (1 << 6),
GL2_FLAG_HW_RENDER_USE = (1 << 7),
GL2_FLAG_FBO_INITED = (1 << 8),
GL2_FLAG_FBO_FEEDBACK_ENABLE = (1 << 9),
GL2_FLAG_HW_RENDER_FBO_INIT = (1 << 10),
GL2_FLAG_SHARED_CONTEXT_USE = (1 << 11),
GL2_FLAG_CORE_CONTEXT_IN_USE = (1 << 12),
GL2_FLAG_HAVE_SYNC = (1 << 13),
GL2_FLAG_HAVE_UNPACK_ROW_LENGTH = (1 << 14),
GL2_FLAG_HAVE_ES2_COMPAT = (1 << 15),
GL2_FLAG_PBO_READBACK_ENABLE = (1 << 16),
GL2_FLAG_OVERLAY_ENABLE = (1 << 17),
GL2_FLAG_OVERLAY_FULLSCREEN = (1 << 18),
GL2_FLAG_MENU_TEXTURE_ENABLE = (1 << 19),
GL2_FLAG_MENU_TEXTURE_FULLSCREEN= (1 << 20),
GL2_FLAG_NONE = (1 << 21)
};
struct gl2
@ -213,12 +212,6 @@ struct gl2
GLuint texture[GFX_MAX_TEXTURES];
GLuint hw_render_fbo[GFX_MAX_TEXTURES];
#ifdef HAVE_VIDEO_LAYOUT
GLuint video_layout_fbo;
GLuint video_layout_fbo_texture;
GLuint video_layout_white_texture;
#endif
uint32_t flags;
unsigned video_width;

View File

@ -307,9 +307,6 @@ video_driver_t video_caca = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
caca_gfx_get_poke_interface,
NULL /* wrap_type_to_enum */

View File

@ -2435,9 +2435,6 @@ video_driver_t video_ctr =
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
ctr_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
ctr_get_poke_interface,
NULL,

View File

@ -1953,9 +1953,6 @@ video_driver_t video_d3d10 = {
#ifdef HAVE_OVERLAY
d3d10_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
d3d10_gfx_get_poke_interface,
NULL, /* d3d10_wrap_type_to_enum */

View File

@ -2752,9 +2752,6 @@ video_driver_t video_d3d11 = {
#ifdef HAVE_OVERLAY
d3d11_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
d3d11_gfx_get_poke_interface,
NULL, /* d3d11_wrap_type_to_enum */

View File

@ -3117,9 +3117,6 @@ video_driver_t video_d3d12 = {
#ifdef HAVE_OVERLAY
d3d12_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
d3d12_gfx_get_poke_interface,
NULL, /* d3d12_wrap_type_to_enum */

View File

@ -1846,9 +1846,6 @@ video_driver_t video_d3d8 = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
d3d8_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
d3d8_get_poke_interface
};

View File

@ -2019,9 +2019,6 @@ video_driver_t video_d3d9_cg = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
d3d9_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
d3d9_cg_get_poke_interface,
NULL, /* wrap_type_to_enum */

View File

@ -1610,9 +1610,6 @@ video_driver_t video_d3d9_hlsl = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
d3d9_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
d3d9_hlsl_get_poke_interface,
NULL, /* wrap_type_to_enum */

View File

@ -657,9 +657,6 @@ video_driver_t video_dispmanx = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
dispmanx_gfx_get_poke_interface
};

View File

@ -999,9 +999,6 @@ video_driver_t video_drm = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
drm_gfx_get_poke_interface
};

View File

@ -1539,9 +1539,6 @@ video_driver_t video_exynos = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
exynos_gfx_get_poke_interface
};

View File

@ -755,9 +755,6 @@ video_driver_t video_gdi = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
gdi_gfx_get_poke_interface,
};

View File

@ -1672,9 +1672,6 @@ video_driver_t video_gl1 = {
#ifdef HAVE_OVERLAY
gl1_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
gl1_gfx_get_poke_interface,
gl1_wrap_type_to_enum,

View File

@ -2549,312 +2549,6 @@ static void gl2_pbo_async_readback(gl2_t *gl)
gl2_renderchain_unbind_pbo();
}
#ifdef HAVE_VIDEO_LAYOUT
static float video_layout_layer_tex_coord[8] = {
0.0f, 1.0f,
1.0f, 1.0f,
0.0f, 0.0f,
1.0f, 0.0f,
};
static void gl2_video_layout_fbo_init(gl2_t *gl,
unsigned width, unsigned height)
{
glGenTextures(1, &gl->video_layout_fbo_texture);
glBindTexture(GL_TEXTURE_2D, gl->video_layout_fbo_texture);
gl2_load_texture_image(GL_TEXTURE_2D,
0, RARCH_GL_INTERNAL_FORMAT32,
width,
height,
0, RARCH_GL_TEXTURE_TYPE32,
RARCH_GL_FORMAT32, NULL);
gl2_gen_fb(1, &gl->video_layout_fbo);
gl2_bind_fb(gl->video_layout_fbo);
gl2_fb_texture_2d(RARCH_GL_FRAMEBUFFER, RARCH_GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, gl->video_layout_fbo_texture, 0);
if (gl2_check_fb_status(RARCH_GL_FRAMEBUFFER) !=
RARCH_GL_FRAMEBUFFER_COMPLETE)
RARCH_ERR("[GL]: Unable to create FBO for video_layout.\n");
gl2_bind_fb(0);
}
static void gl2_video_layout_fbo_free(gl2_t *gl)
{
if (gl->video_layout_fbo)
{
gl2_delete_fb(1, &gl->video_layout_fbo);
gl->video_layout_fbo = 0;
}
if (gl->video_layout_fbo_texture)
{
glDeleteTextures(1, &gl->video_layout_fbo_texture);
gl->video_layout_fbo_texture = 0;
}
}
static void gl2_video_layout_viewport(gl2_t *gl)
{
if (gl->flags & GL2_FLAG_VIDEO_LAYOUT_RESIZE)
{
if (gl->video_layout_fbo)
gl2_video_layout_fbo_free(gl);
gl2_video_layout_fbo_init(gl, gl->video_width, gl->video_height);
video_layout_view_change();
gl->flags &= ~(GL2_FLAG_VIDEO_LAYOUT_RESIZE);
}
if (video_layout_view_on_change())
{
video_layout_bounds_t b;
b.x = 0.0f;
b.y = 0.0f;
b.w = (float)gl->video_width;
b.h = (float)gl->video_height;
video_layout_view_fit_bounds(b);
}
if (video_layout_screen_count())
{
const video_layout_bounds_t *bounds;
bounds = video_layout_screen(0);
glViewport(
bounds->x, gl->video_height - bounds->y - bounds->h,
bounds->w, bounds->h
);
}
}
static void gl2_video_layout_render(gl2_t *gl)
{
int i;
if (!video_layout_valid())
return;
glViewport(0, 0, gl->video_width, gl->video_height);
glEnable(GL_BLEND);
for (i = 0; i < video_layout_layer_count(); ++i)
video_layout_layer_render(i);
glDisable(GL_BLEND);
}
static void gl2_video_layout_init(gl2_t *gl)
{
uint32_t px;
gl->flags |= GL2_FLAG_VIDEO_LAYOUT_RESIZE;
/* white 1px texture for drawing solid colors */
px = 0xFFFFFFFF;
glGenTextures(1, &gl->video_layout_white_texture);
gl_load_texture_data(gl->video_layout_white_texture,
RARCH_WRAP_EDGE, TEXTURE_FILTER_NEAREST,
sizeof(uint32_t), 1, 1, &px, sizeof(uint32_t));
}
static void gl2_video_layout_free(gl2_t *gl)
{
gl2_video_layout_fbo_free(gl);
if (gl->video_layout_white_texture)
{
glDeleteTextures(1, &gl->video_layout_white_texture);
gl->video_layout_white_texture = 0;
}
}
static void *gl2_video_layout_take_image(void *video_driver_data, struct texture_image image)
{
GLuint tex = 0;
unsigned alignment = gl2_get_alignment(image.width * sizeof(uint32_t));
glGenTextures(1, &tex);
gl_load_texture_data(tex,
RARCH_WRAP_EDGE, TEXTURE_FILTER_MIPMAP_LINEAR,
alignment, image.width, image.height, image.pixels, sizeof(uint32_t));
free(image.pixels);
return (void*)(uintptr_t)tex;
}
static void gl2_video_layout_free_image(void *video_driver_data, void *image)
{
GLuint tex;
tex = (GLuint)(uintptr_t)image;
glDeleteTextures(1, &tex);
}
static void gl2_video_layout_layer_begin(const video_layout_render_info_t *info)
{
gl2_t *gl;
gl = (gl2_t*)info->video_driver_data;
gl2_bind_fb(gl->video_layout_fbo);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
gl->shader->use(gl, gl->shader_data,
VIDEO_SHADER_STOCK_BLEND, true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
static void gl2_video_layout_image(
const video_layout_render_info_t *info,
void *image_handle, void *alpha_handle)
{
/* TODO alpha_handle */
int i;
float coord[8];
float color[16];
gl2_t *gl = (gl2_t*)info->video_driver_data;
video_layout_bounds_t b = info->bounds;
b.x /= gl->video_width;
b.y /= gl->video_height;
b.w /= gl->video_width;
b.h /= gl->video_height;
coord[0] = b.x;
coord[1] = 1.f - b.y;
coord[2] = b.x + b.w;
coord[3] = 1.f - b.y;
coord[4] = b.x;
coord[5] = 1.f - (b.y + b.h);
coord[6] = b.x + b.w;
coord[7] = 1.f - (b.y + b.h);
i = 0;
while (i < 16)
{
color[i++] = info->color.r;
color[i++] = info->color.g;
color[i++] = info->color.b;
color[i++] = info->color.a;
}
gl->coords.vertex = coord;
gl->coords.tex_coord = tex_coords;
gl->coords.color = color;
gl->coords.vertices = 4;
gl->shader->set_coords(gl->shader_data, &gl->coords);
gl->shader->set_mvp(gl->shader_data, &gl->mvp_no_rot);
glBindTexture(GL_TEXTURE_2D, (GLuint)(uintptr_t)image_handle);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
static void gl2_video_layout_text(const video_layout_render_info_t *info, const char *str)
{
/* TODO */
}
static void gl2_video_layout_counter(const video_layout_render_info_t *info, int value)
{
/* TODO */
}
static void gl2_video_layout_rect(const video_layout_render_info_t *info)
{
gl2_t *gl;
gl = (gl2_t*)info->video_driver_data;
gl2_video_layout_image(info, (void*)(uintptr_t)gl->video_layout_white_texture, NULL);
}
static void gl2_video_layout_screen(const video_layout_render_info_t *info, int screen_index)
{
gl2_video_layout_rect(info);
}
static void gl2_video_layout_ellipse(const video_layout_render_info_t *info)
{
/* TODO */
}
static void gl2_video_layout_led_dot(const video_layout_render_info_t *info, int dot_count, int dot_mask)
{
/* TODO */
}
static void gl2_video_layout_led_seg(const video_layout_render_info_t *info, video_layout_led_t seg_layout, int seg_mask)
{
/* TODO */
}
static void gl2_video_layout_layer_end(const video_layout_render_info_t *info, video_layout_blend_t blend_type)
{
gl2_t *gl;
gl = (gl2_t*)info->video_driver_data;
switch (blend_type)
{
case VIDEO_LAYOUT_BLEND_ALPHA:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
break;
case VIDEO_LAYOUT_BLEND_ADD:
glBlendFunc(GL_ONE, GL_ONE);
break;
case VIDEO_LAYOUT_BLEND_MOD:
glBlendFunc(GL_DST_COLOR, GL_ZERO);
break;
}
gl2_bind_fb(0);
gl->coords.vertex = gl->vertex_ptr;
gl->coords.tex_coord = video_layout_layer_tex_coord;
gl->coords.color = gl->white_color_ptr;
gl->coords.vertices = 4;
gl->shader->set_coords(gl->shader_data, &gl->coords);
gl->shader->set_mvp(gl->shader_data, &gl->mvp_no_rot);
glBindTexture(GL_TEXTURE_2D, gl->video_layout_fbo_texture);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
gl->coords.tex_coord = gl->tex_info.coord;
}
static video_layout_render_interface_t gl2_video_layout_render_interface =
{
gl2_video_layout_take_image,
gl2_video_layout_free_image,
gl2_video_layout_layer_begin,
gl2_video_layout_screen,
gl2_video_layout_image,
gl2_video_layout_text,
gl2_video_layout_counter,
gl2_video_layout_rect,
gl2_video_layout_ellipse,
gl2_video_layout_led_dot,
gl2_video_layout_led_seg,
gl2_video_layout_layer_end
};
static const video_layout_render_interface_t *gl2_get_video_layout_render_interface(void *data)
{
return &gl2_video_layout_render_interface;
}
#endif /* HAVE_VIDEO_LAYOUT */
static bool gl2_frame(void *data, const void *frame,
unsigned frame_width, unsigned frame_height,
uint64_t frame_count,
@ -2982,17 +2676,8 @@ static bool gl2_frame(void *data, const void *frame,
}
else
gl2_set_viewport(gl, width, height, false, true);
#ifdef HAVE_VIDEO_LAYOUT
gl->flags |= GL2_FLAG_VIDEO_LAYOUT_RESIZE;
#endif
}
#ifdef HAVE_VIDEO_LAYOUT
if (video_layout_valid())
gl2_video_layout_viewport(gl);
#endif
if (frame)
gl->tex_index = ((gl->tex_index + 1) % gl->textures);
@ -3094,10 +2779,6 @@ static bool gl2_frame(void *data, const void *frame,
gl2_renderchain_bind_prev_texture(gl,
chain, &gl->tex_info);
#ifdef HAVE_VIDEO_LAYOUT
gl2_video_layout_render(gl);
#endif
#ifdef HAVE_OVERLAY
if ((gl->flags & GL2_FLAG_OVERLAY_ENABLE) && overlay_behind_menu)
gl2_render_overlay(gl);
@ -3239,10 +2920,6 @@ static void gl2_free(void *data)
if (!gl)
return;
#ifdef HAVE_VIDEO_LAYOUT
gl2_video_layout_free(gl);
#endif
if (gl->flags & GL2_FLAG_SHARED_CONTEXT_USE)
gl->ctx_driver->bind_hw_render(gl->ctx_data, false);
@ -4072,10 +3749,6 @@ static void *gl2_init(const video_info_t *video,
goto error;
}
#ifdef HAVE_VIDEO_LAYOUT
gl2_video_layout_init(gl);
#endif
if (gl->flags & GL2_FLAG_SHARED_CONTEXT_USE)
gl->ctx_driver->bind_hw_render(gl->ctx_data, true);
@ -4762,9 +4435,6 @@ video_driver_t video_gl2 = {
#ifdef HAVE_OVERLAY
gl2_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
gl2_get_video_layout_render_interface,
#endif
gl2_get_poke_interface,
gl2_wrap_type_to_enum,

View File

@ -2248,9 +2248,6 @@ video_driver_t video_gl3 = {
#ifdef HAVE_OVERLAY
gl3_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
gl3_get_poke_interface,
gl3_wrap_type_to_enum,

View File

@ -1802,9 +1802,6 @@ video_driver_t video_wiiu =
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
gx2_get_overlay_interface, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
wiiu_gfx_get_poke_interface,
NULL, /* wrap_type_to_enum */

View File

@ -1810,9 +1810,6 @@ video_driver_t video_gx = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
gx_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
gx_get_poke_interface,
};

View File

@ -2005,9 +2005,6 @@ video_driver_t video_metal = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
metal_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
metal_get_poke_interface,
NULL, /* metal_wrap_type_to_enum */

View File

@ -493,9 +493,6 @@ video_driver_t video_network = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
network_gfx_get_poke_interface,
NULL /* wrap_type_to_enum */

View File

@ -801,9 +801,6 @@ video_driver_t video_oga = {
NULL,
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
oga_get_poke_interface
};

View File

@ -1150,9 +1150,6 @@ video_driver_t video_omap = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
omap_gfx_get_poke_interface
};

View File

@ -776,9 +776,6 @@ video_driver_t video_ps2 = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
ps2_gfx_get_poke_interface,
};

View File

@ -907,9 +907,6 @@ video_driver_t video_psp1 = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
psp_get_poke_interface
};

View File

@ -1428,9 +1428,6 @@ video_driver_t video_gcm =
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
rsx_get_poke_interface,
rsx_wrap_type_to_enum,

View File

@ -734,9 +734,6 @@ video_driver_t video_sdl2 = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
sdl2_gfx_poke_interface
};

View File

@ -1140,9 +1140,6 @@ video_driver_t video_sdl_dingux = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
sdl_dingux_get_poke_interface
};

View File

@ -583,9 +583,6 @@ video_driver_t video_sdl = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
sdl_get_poke_interface
};

View File

@ -1442,9 +1442,6 @@ video_driver_t video_sdl_rs90 = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
sdl_rs90_get_poke_interface
};

View File

@ -589,9 +589,6 @@ video_driver_t video_sixel = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
sixel_gfx_get_poke_interface,
NULL /* wrap_type_to_enum */

View File

@ -984,9 +984,6 @@ video_driver_t video_sunxi = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
sunxi_gfx_get_poke_interface
};

View File

@ -428,9 +428,6 @@ video_driver_t video_switch = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
switch_get_poke_interface,
};

View File

@ -713,9 +713,6 @@ video_driver_t video_switch = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
switch_overlay_interface, /* switch_overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
switch_get_poke_interface,
};

View File

@ -525,9 +525,6 @@ video_driver_t video_vg = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
vg_get_poke_interface
};

View File

@ -414,9 +414,6 @@ video_driver_t video_vga = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
vga_gfx_get_poke_interface,
};

View File

@ -1012,9 +1012,6 @@ video_driver_t video_vita2d = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
vita2d_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
vita2d_gfx_get_poke_interface,
NULL,

View File

@ -3863,9 +3863,6 @@ video_driver_t video_vulkan = {
#ifdef HAVE_OVERLAY
vulkan_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
vulkan_get_poke_interface,
NULL, /* vulkan_wrap_type_to_enum */

View File

@ -293,9 +293,6 @@ video_driver_t video_xenon360 = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
xenon360_gfx_get_poke_interface
};

View File

@ -231,9 +231,6 @@ video_driver_t video_xshm = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
xshm_gfx_poke_interface
};

View File

@ -1157,9 +1157,6 @@ video_driver_t video_xvideo = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
xv_get_poke_interface
};

View File

@ -255,9 +255,6 @@ video_driver_t video_null = {
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL,
#endif
NULL, /* get_poke_interface */
};
@ -1505,10 +1502,6 @@ void video_driver_free_internal(void)
VIDEO_DRIVER_IS_THREADED_INTERNAL(video_st);
#endif
#ifdef HAVE_VIDEO_LAYOUT
video_layout_deinit();
#endif
command_event(CMD_EVENT_OVERLAY_DEINIT, NULL);
if (!(video_st->flags & VIDEO_FLAG_CACHE_CONTEXT))
@ -1690,19 +1683,6 @@ void video_driver_set_texture_frame(const void *frame, bool rgb32,
}
#ifdef HAVE_VIDEO_LAYOUT
const video_layout_render_interface_t *video_driver_layout_render_interface(void)
{
video_driver_state_t *video_st = &video_driver_st;
if ( !video_st->current_video ||
!video_st->current_video->video_layout_render_interface)
return NULL;
return video_st->current_video->video_layout_render_interface(
video_st->data);
}
#endif
void *video_driver_read_frame_raw(unsigned *width,
unsigned *height, size_t *pitch)
{
@ -3556,16 +3536,6 @@ bool video_driver_init_internal(bool *video_is_threaded, bool verbosity_enabled)
input_overlay_init();
#endif
#ifdef HAVE_VIDEO_LAYOUT
if (settings->bools.video_layout_enable)
{
video_layout_init(video_st->data,
video_driver_layout_render_interface());
video_layout_load(settings->paths.path_video_layout);
video_layout_view_select(settings->uints.video_layout_selected_view);
}
#endif
if (!(runloop_st->current_core.flags & RETRO_CORE_FLAG_GAME_LOADED))
video_driver_cached_frame_set(&dummy_pixels, 4, 4, 8);

View File

@ -40,10 +40,6 @@
#include "video_defines.h"
#ifdef HAVE_VIDEO_LAYOUT
#include "video_layout.h"
#endif
#ifdef HAVE_CRTSWITCHRES
#include "video_crt_switch.h"
#endif
@ -767,9 +763,6 @@ typedef struct video_driver
#ifdef HAVE_OVERLAY
void (*overlay_interface)(void *data,
const video_overlay_interface_t **iface);
#endif
#ifdef HAVE_VIDEO_LAYOUT
const video_layout_render_interface_t *(*video_layout_render_interface)(void *data);
#endif
void (*poke_interface)(void *data, const video_poke_interface_t **iface);
unsigned (*wrap_type_to_enum)(enum gfx_wrap_type type);
@ -1005,10 +998,6 @@ void video_driver_set_texture_enable(bool enable, bool full_screen);
void video_driver_set_texture_frame(const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha);
#ifdef HAVE_VIDEO_LAYOUT
const video_layout_render_interface_t *video_driver_layout_render_interface(void);
#endif
void * video_driver_read_frame_raw(unsigned *width,
unsigned *height, size_t *pitch);

View File

@ -1,489 +0,0 @@
/* Copyright (C) 2010-2020 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (video_layout.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <formats/rxml.h>
#include <file/file_path.h>
#include <file/archive_file.h>
#include <compat/strl.h>
#include <string/stdstring.h>
#include "video_layout.h"
#include "video_layout/view.h"
#include "../retroarch.h"
#include "../verbosity.h"
bool video_layout_load_internal(view_array_t *view_array,
rxml_document_t *doc);
typedef struct io
{
char *name;
int base_value;
int value;
}
io_t;
typedef struct video_layout_state
{
video_layout_render_info_t render_info;
const video_layout_render_interface_t *render;
view_array_t view_array;
view_t *view;
int view_index;
io_t *io;
int io_count;
void **images;
int images_count;
char *base_path;
bool is_archive;
bool view_changed;
}
video_layout_state_t;
/* TODO/FIXME - global state - perhaps move outside this file */
static video_layout_state_t *video_layout_state = NULL;
void video_layout_init(void *video_driver_data,
const video_layout_render_interface_t *render)
{
if (video_layout_state)
video_layout_deinit();
video_layout_state = (video_layout_state_t*)
calloc(1, sizeof(video_layout_state_t));
video_layout_state->render_info.video_driver_data = video_driver_data;
video_layout_state->render = render;
vec_size((void**)&video_layout_state->images, sizeof(void*), 1);
video_layout_state->images[0] = NULL;
video_layout_state->images_count = 1;
}
void video_layout_deinit(void)
{
unsigned i;
if (!video_layout_state)
return;
free(video_layout_state->base_path);
for (i = 1; i < video_layout_state->images_count; ++i)
{
video_layout_state->render->free_image(
video_layout_state->render_info.video_driver_data,
video_layout_state->images[i]
);
}
free(video_layout_state->images);
for (i = 0; i < video_layout_state->io_count; ++i)
free(video_layout_state->io[i].name);
free(video_layout_state->io);
view_array_deinit(&video_layout_state->view_array);
free(video_layout_state);
video_layout_state = NULL;
}
int video_layout_io_assign(const char *name, int base_value)
{
int index = video_layout_state->io_count;
vec_size((void**)&video_layout_state->io,
sizeof(io_t), ++video_layout_state->io_count);
video_layout_state->io[index].name = string_init(name);
video_layout_state->io[index].base_value = base_value;
video_layout_state->io[index].value = base_value;
return index;
}
int video_layout_io_find(const char *name)
{
unsigned i;
for (i = 0; i < video_layout_state->io_count; ++i)
{
if (string_is_equal(video_layout_state->io[i].name, name))
return i;
}
return -1;
}
int video_layout_io_get(int index)
{
return video_layout_state->io[index].value;
}
void video_layout_io_set(int index, int value)
{
video_layout_state->io[index].value = value;
}
bool video_layout_load(const char *path)
{
rxml_document_t *doc = NULL;
bool result;
if (!path || !strlen(path))
return true;
video_layout_state->is_archive = path_is_compressed_file(path);
if (video_layout_state->is_archive)
{
void *buf;
int64_t len;
char respath[PATH_MAX_LENGTH];
strlcpy(respath, path, sizeof(respath));
strlcat(respath, "#", sizeof(respath));
string_set(&video_layout_state->base_path, respath);
strlcat(respath, "default.lay", sizeof(respath));
if (file_archive_compressed_read(respath, &buf, NULL, &len))
{
char *str;
if ((str = (char*)realloc(buf, (size_t)len + 1)))
{
str[(size_t)len] = '\0';
doc = rxml_load_document_string(str);
free(str);
}
else free(buf);
}
}
else
{
char respath[PATH_MAX_LENGTH];
fill_pathname_basedir(respath, path, sizeof(respath));
string_set(&video_layout_state->base_path, respath);
doc = rxml_load_document(path);
}
if (!doc)
{
RARCH_LOG("video_layout: unable to open file \"%s\"\n", path);
return false;
}
result = video_layout_load_internal(&video_layout_state->view_array, doc);
rxml_free_document(doc);
video_layout_view_select(video_layout_view_index());
return result;
}
bool video_layout_valid(void)
{
return video_layout_state && video_layout_state->view;
}
static int video_layout_load_image(const char *path)
{
struct texture_image image;
void *handle;
int index;
image.supports_rgba = video_driver_supports_rgba();
if (video_layout_state->is_archive)
{
void *buf;
int64_t len;
char respath[PATH_MAX_LENGTH];
strlcpy(respath, video_layout_state->base_path, sizeof(respath));
strlcat(respath, path, sizeof(respath));
if (!file_archive_compressed_read(respath, &buf, NULL, &len))
{
RARCH_LOG("video_layout: failed to decompress image: %s\n", respath);
return 0;
}
if (!image_texture_load_buffer(&image,
image_texture_get_type(path), buf, (size_t)len))
{
free(buf);
RARCH_LOG("video_layout: failed to load image: %s\n", respath);
return 0;
}
free(buf);
}
else
{
char respath[PATH_MAX_LENGTH];
strlcpy(respath, video_layout_state->base_path, sizeof(respath));
strlcat(respath, path, sizeof(respath));
if (!image_texture_load(&image, respath))
{
RARCH_LOG("video_layout: failed to load image: %s\n", respath);
return 0;
}
}
handle = video_layout_state->render->take_image(
video_layout_state->render_info.video_driver_data, image);
if (!handle)
return 0;
index = video_layout_state->images_count;
vec_size((void**)&video_layout_state->images,
sizeof(void*), ++video_layout_state->images_count);
video_layout_state->images[index] = handle;
return index;
}
int video_layout_view_count(void)
{
return video_layout_state->view_array.views_count;
}
const char *video_layout_view_name(int index)
{
return video_layout_state->view_array.views[index].name;
}
int video_layout_view_select(int index)
{
index = MAX(0,
MIN(index, video_layout_state->view_array.views_count - 1));
video_layout_state->view_index = index;
video_layout_state->view = video_layout_state->view_array.views_count
? &video_layout_state->view_array.views[index]
: NULL;
video_layout_view_change();
return index;
}
int video_layout_view_cycle(void)
{
return video_layout_view_select(
(video_layout_state->view_index + 1)
% video_layout_state->view_array.views_count);
}
int video_layout_view_index(void)
{
return video_layout_state->view_index;
}
void video_layout_view_change(void)
{
video_layout_state->view_changed = true;
}
bool video_layout_view_on_change(void)
{
if (video_layout_state->view_changed)
{
video_layout_state->view_changed = false;
return true;
}
return false;
}
void video_layout_view_fit_bounds(video_layout_bounds_t bounds)
{
unsigned i, j, k;
view_t *view = video_layout_state->view;
float c = MIN(bounds.w / view->bounds.w,
bounds.h / view->bounds.h);
float dx = view->bounds.w * c;
float dy = view->bounds.h * c;
view->render_bounds.w = dx;
view->render_bounds.h = dy;
view->render_bounds.x = (bounds.w - dx) / 2.f;
view->render_bounds.y = (bounds.h - dy) / 2.f;
for (i = 0; i < view->layers_count; ++i)
{
layer_t *layer = &view->layers[i];
for (j = 0; j < layer->elements_count; ++j)
{
element_t *elem = &layer->elements[j];
elem->render_bounds.x = elem->bounds.x * view->render_bounds.w + view->render_bounds.x;
elem->render_bounds.y = elem->bounds.y * view->render_bounds.h + view->render_bounds.y;
elem->render_bounds.w = elem->bounds.w * view->render_bounds.w;
elem->render_bounds.h = elem->bounds.h * view->render_bounds.h;
for (k = 0; k < elem->components_count; ++k)
{
component_t *comp = &elem->components[k];
comp->render_bounds.x = comp->bounds.x * elem->render_bounds.w + elem->render_bounds.x;
comp->render_bounds.y = comp->bounds.y * elem->render_bounds.h + elem->render_bounds.y;
comp->render_bounds.w = comp->bounds.w * elem->render_bounds.w;
comp->render_bounds.h = comp->bounds.h * elem->render_bounds.h;
if (comp->type == VIDEO_LAYOUT_C_SCREEN)
view->screens[comp->attr.screen.index] = comp->render_bounds;
}
}
}
}
int video_layout_layer_count(void)
{
return video_layout_state->view->layers_count;
}
void video_layout_layer_render(int index)
{
unsigned i, j;
video_layout_render_info_t *info = &video_layout_state->render_info;
const video_layout_render_interface_t *r = video_layout_state->render;
layer_t *layer =
&video_layout_state->view->layers[index];
r->layer_begin(info);
for (i = 0; i < layer->elements_count; ++i)
{
element_t *elem = &layer->elements[i];
if (elem->o_bind != -1)
elem->state = video_layout_state->io[elem->o_bind].value;
for (j = 0; j < elem->components_count; ++j)
{
component_t *comp = &elem->components[j];
if (comp->enabled_state != -1)
{
if (comp->enabled_state != elem->state)
continue;
}
info->bounds = comp->render_bounds;
info->orientation = comp->orientation;
info->color = comp->color;
switch (comp->type)
{
case VIDEO_LAYOUT_C_UNKNOWN:
break;
case VIDEO_LAYOUT_C_SCREEN:
r->screen(info, comp->attr.screen.index);
break;
case VIDEO_LAYOUT_C_RECT:
r->rect(info);
break;
case VIDEO_LAYOUT_C_DISK:
r->ellipse(info);
break;
case VIDEO_LAYOUT_C_IMAGE:
if (!comp->attr.image.loaded)
{
comp->attr.image.image_idx =
video_layout_load_image(comp->attr.image.file);
if (comp->attr.image.alpha_file)
comp->attr.image.alpha_idx =
video_layout_load_image(comp->attr.image.alpha_file);
comp->attr.image.loaded = true;
}
r->image(info,
video_layout_state->images[comp->attr.image.image_idx],
video_layout_state->images[comp->attr.image.alpha_idx]);
break;
case VIDEO_LAYOUT_C_TEXT:
r->text(info, comp->attr.text.string);
break;
case VIDEO_LAYOUT_C_COUNTER:
r->counter(info, MIN(elem->state,
comp->attr.counter.max_state));
break;
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
r->led_dot(info, 1, elem->state);
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
r->led_dot(info, 5, elem->state);
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
r->led_dot(info, 8, elem->state);
break;
case VIDEO_LAYOUT_C_LED_7:
r->led_seg(info, VIDEO_LAYOUT_LED_7, elem->state);
break;
case VIDEO_LAYOUT_C_LED_8_GTS1:
r->led_seg(info, VIDEO_LAYOUT_LED_8_GTS1, elem->state);
break;
case VIDEO_LAYOUT_C_LED_14:
r->led_seg(info, VIDEO_LAYOUT_LED_14, elem->state);
break;
case VIDEO_LAYOUT_C_LED_14_SC:
r->led_seg(info, VIDEO_LAYOUT_LED_14_SC, elem->state);
break;
case VIDEO_LAYOUT_C_LED_16:
r->led_seg(info, VIDEO_LAYOUT_LED_16, elem->state);
break;
case VIDEO_LAYOUT_C_LED_16_SC:
r->led_seg(info, VIDEO_LAYOUT_LED_16_SC, elem->state);
break;
case VIDEO_LAYOUT_C_REEL:
/* not implemented */
break;
}
}
}
r->layer_end(info, layer->blend);
}
const video_layout_bounds_t *video_layout_screen(int index)
{
return &video_layout_state->view->screens[index];
}
int video_layout_screen_count(void)
{
return video_layout_state->view->screens_count;
}

View File

@ -1,95 +0,0 @@
/* Copyright (C) 2010-2020 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (video_layout.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef VIDEO_LAYOUT_H
#define VIDEO_LAYOUT_H
#include "video_layout/types.h"
#include <boolean.h>
#include <formats/image.h>
typedef struct video_layout_render_info
{
void *video_driver_data;
video_layout_bounds_t bounds; /* float alignment */
video_layout_color_t color; /* float alignment */
video_layout_orientation_t orientation; /* uint8_t alignment */
} video_layout_render_info_t;
typedef enum video_layout_led
{
VIDEO_LAYOUT_LED_7, /* digit with . */
VIDEO_LAYOUT_LED_8_GTS1, /* digit with vertical split */
VIDEO_LAYOUT_LED_14, /* alphanumeric */
VIDEO_LAYOUT_LED_14_SC, /* alphanumeric with ., */
VIDEO_LAYOUT_LED_16, /* full alphanumeric */
VIDEO_LAYOUT_LED_16_SC /* full alphanumeric with ., */
} video_layout_led_t;
typedef struct video_layout_render_interface
{
void *(*take_image) (void *video_driver_data, struct texture_image image);
void (*free_image) (void *video_driver_data, void *image);
void (*layer_begin) (const video_layout_render_info_t *info);
void (*screen) (const video_layout_render_info_t *info, int screen_index);
void (*image) (const video_layout_render_info_t *info, void *image_handle, void *alpha_handle);
void (*text) (const video_layout_render_info_t *info, const char *str);
void (*counter) (const video_layout_render_info_t *info, int value);
void (*rect) (const video_layout_render_info_t *info);
void (*ellipse) (const video_layout_render_info_t *info);
void (*led_dot) (const video_layout_render_info_t *info, int dot_count, int dot_mask);
void (*led_seg) (const video_layout_render_info_t *info, video_layout_led_t seg_layout, int seg_mask);
void (*layer_end) (const video_layout_render_info_t *info, video_layout_blend_t blend_type);
} video_layout_render_interface_t;
void video_layout_init (void *video_driver_data, const video_layout_render_interface_t *render);
void video_layout_deinit (void);
int video_layout_io_assign (const char *name, int base_value);
int video_layout_io_get (int index);
void video_layout_io_set (int index, int value);
bool video_layout_load (const char *path);
bool video_layout_valid (void);
int video_layout_view_count (void);
const char *video_layout_view_name (int index);
int video_layout_view_select (int index);
int video_layout_view_cycle (void);
int video_layout_view_index (void);
void video_layout_view_change (void);
bool video_layout_view_on_change (void);
void video_layout_view_fit_bounds (video_layout_bounds_t bounds);
int video_layout_layer_count (void);
void video_layout_layer_render (int index);
const video_layout_bounds_t
*video_layout_screen (int index);
int video_layout_screen_count (void);
#endif

View File

@ -1,168 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include <string/stdstring.h>
#include "component.h"
void component_init(component_t *comp, comp_type_t type)
{
comp->type = type;
comp->bounds = make_bounds();
comp->render_bounds = make_bounds_unit();
comp->orientation = VIDEO_LAYOUT_ROT0;
comp->color = make_color_white();
comp->enabled_state = -1;
switch (comp->type)
{
case VIDEO_LAYOUT_C_UNKNOWN:
break;
case VIDEO_LAYOUT_C_SCREEN:
comp->attr.screen.index = 0;
break;
case VIDEO_LAYOUT_C_RECT:
break;
case VIDEO_LAYOUT_C_DISK:
break;
case VIDEO_LAYOUT_C_IMAGE:
comp->attr.image.file = NULL;
comp->attr.image.alpha_file = NULL;
comp->attr.image.image_idx = 0;
comp->attr.image.alpha_idx = 0;
comp->attr.image.loaded = false;
break;
case VIDEO_LAYOUT_C_TEXT:
comp->attr.text.string = NULL;
comp->attr.text.align = VIDEO_LAYOUT_TEXT_ALIGN_CENTER;
break;
case VIDEO_LAYOUT_C_COUNTER:
comp->attr.counter.digits = 2;
comp->attr.counter.max_state = 999;
comp->attr.counter.align = VIDEO_LAYOUT_TEXT_ALIGN_CENTER;
break;
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
break;
case VIDEO_LAYOUT_C_LED_7:
break;
case VIDEO_LAYOUT_C_LED_8_GTS1:
break;
case VIDEO_LAYOUT_C_LED_14:
break;
case VIDEO_LAYOUT_C_LED_14_SC:
break;
case VIDEO_LAYOUT_C_LED_16:
break;
case VIDEO_LAYOUT_C_LED_16_SC:
break;
case VIDEO_LAYOUT_C_REEL:
break;
}
}
void component_copy(component_t *comp, const component_t *src)
{
comp->type = src->type;
comp->bounds = src->bounds;
comp->render_bounds = src->render_bounds;
comp->orientation = src->orientation;
comp->color = src->color;
comp->enabled_state = src->enabled_state;
switch (comp->type)
{
case VIDEO_LAYOUT_C_UNKNOWN:
break;
case VIDEO_LAYOUT_C_SCREEN:
comp->attr.screen.index = src->attr.screen.index;
break;
case VIDEO_LAYOUT_C_RECT:
break;
case VIDEO_LAYOUT_C_DISK:
break;
case VIDEO_LAYOUT_C_IMAGE:
comp->attr.image.file = string_init(src->attr.image.file);
comp->attr.image.alpha_file = string_init(src->attr.image.alpha_file);
comp->attr.image.image_idx = src->attr.image.image_idx;
comp->attr.image.alpha_idx = src->attr.image.alpha_idx;
comp->attr.image.loaded = src->attr.image.loaded;
break;
case VIDEO_LAYOUT_C_TEXT:
comp->attr.text.string = string_init(src->attr.text.string);
comp->attr.text.align = src->attr.text.align;
break;
case VIDEO_LAYOUT_C_COUNTER:
comp->attr.counter.digits = src->attr.counter.digits;
comp->attr.counter.max_state = src->attr.counter.max_state;
comp->attr.counter.align = src->attr.counter.align;
break;
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
break;
case VIDEO_LAYOUT_C_LED_7:
break;
case VIDEO_LAYOUT_C_LED_8_GTS1:
break;
case VIDEO_LAYOUT_C_LED_14:
break;
case VIDEO_LAYOUT_C_LED_14_SC:
break;
case VIDEO_LAYOUT_C_LED_16:
break;
case VIDEO_LAYOUT_C_LED_16_SC:
break;
case VIDEO_LAYOUT_C_REEL:
break;
}
}
void component_deinit(component_t *comp)
{
switch (comp->type)
{
case VIDEO_LAYOUT_C_UNKNOWN:
break;
case VIDEO_LAYOUT_C_SCREEN:
break;
case VIDEO_LAYOUT_C_RECT:
break;
case VIDEO_LAYOUT_C_DISK:
break;
case VIDEO_LAYOUT_C_IMAGE:
free(comp->attr.image.file);
free(comp->attr.image.alpha_file);
break;
case VIDEO_LAYOUT_C_TEXT:
free(comp->attr.text.string);
break;
case VIDEO_LAYOUT_C_COUNTER:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
break;
case VIDEO_LAYOUT_C_LED_7:
break;
case VIDEO_LAYOUT_C_LED_8_GTS1:
break;
case VIDEO_LAYOUT_C_LED_14:
break;
case VIDEO_LAYOUT_C_LED_14_SC:
break;
case VIDEO_LAYOUT_C_LED_16:
break;
case VIDEO_LAYOUT_C_LED_16_SC:
break;
case VIDEO_LAYOUT_C_REEL:
break;
}
}

View File

@ -1,51 +0,0 @@
#ifndef VIDEO_LAYOUT_COMPONENT_H
#define VIDEO_LAYOUT_COMPONENT_H
#include "internal.h"
#include "component_attr.h"
typedef enum comp_type
{
VIDEO_LAYOUT_C_UNKNOWN,
VIDEO_LAYOUT_C_SCREEN,
VIDEO_LAYOUT_C_RECT,
VIDEO_LAYOUT_C_DISK,
VIDEO_LAYOUT_C_IMAGE,
VIDEO_LAYOUT_C_TEXT,
VIDEO_LAYOUT_C_COUNTER,
VIDEO_LAYOUT_C_DOTMATRIX_X1,
VIDEO_LAYOUT_C_DOTMATRIX_H5,
VIDEO_LAYOUT_C_DOTMATRIX_H8,
VIDEO_LAYOUT_C_LED_7,
VIDEO_LAYOUT_C_LED_8_GTS1,
VIDEO_LAYOUT_C_LED_14,
VIDEO_LAYOUT_C_LED_14_SC,
VIDEO_LAYOUT_C_LED_16,
VIDEO_LAYOUT_C_LED_16_SC,
VIDEO_LAYOUT_C_REEL
} comp_type_t;
union comp_attr
{
c_attr_screen_t screen;
c_attr_image_t image;
c_attr_text_t text;
c_attr_counter_t counter;
};
typedef struct component
{
comp_type_t type;
video_layout_bounds_t bounds;
video_layout_bounds_t render_bounds;
video_layout_orientation_t orientation;
video_layout_color_t color;
int enabled_state;
union comp_attr attr;
} component_t;
void component_init (component_t *comp, comp_type_t type);
void component_copy (component_t *comp, const component_t *src);
void component_deinit (component_t *comp);
#endif

View File

@ -1,31 +0,0 @@
#ifndef VIDEO_LAYOUT_COMPONENT_ATTR_H
#define VIDEO_LAYOUT_COMPONENT_ATTR_H
typedef struct c_attr_screen
{
int index;
} c_attr_screen_t;
typedef struct c_attr_image
{
char *file;
char *alpha_file;
int image_idx;
int alpha_idx;
bool loaded;
} c_attr_image_t;
typedef struct c_attr_text
{
char *string;
video_layout_text_align_t align; /* enum alignment */
} c_attr_text_t;
typedef struct c_attr_counter
{
int digits;
int max_state;
video_layout_text_align_t align;
} c_attr_counter_t;
#endif

View File

@ -1,80 +0,0 @@
#include <stdlib.h>
#include <string/stdstring.h>
#include "element.h"
void element_init(element_t *elem, const char *name, int components_count)
{
elem->name = string_init(name);
elem->state = -1;
elem->o_bind = -1;
elem->i_bind = -1;
elem->i_mask = -1;
elem->i_raw = false;
elem->bounds = make_bounds();
elem->render_bounds = make_bounds_unit();
elem->components = (component_t*)(components_count > 0 ?
calloc(components_count, sizeof(component_t)) : NULL);
elem->components_count = components_count;
}
void element_copy(element_t *elem, const element_t *src)
{
unsigned i;
elem->name = string_init(src->name);
elem->state = src->state;
elem->bounds = src->bounds;
elem->render_bounds = src->render_bounds;
elem->components = (component_t*)(src->components_count > 0 ?
calloc(src->components_count, sizeof(component_t)) : NULL);
for (i = 0; i < src->components_count; ++i)
component_copy(&elem->components[i], &src->components[i]);
elem->components_count = src->components_count;
}
void element_deinit(element_t *elem)
{
unsigned i;
for (i = 0; i < elem->components_count; ++i)
component_deinit(&elem->components[i]);
free(elem->components);
free(elem->name);
}
void element_apply_orientation(element_t *elem,
video_layout_orientation_t orientation)
{
unsigned i;
for (i = 0; i < elem->components_count; ++i)
{
component_t *comp = &elem->components[i];
comp->orientation ^= orientation;
if (orientation & VIDEO_LAYOUT_SWAP_XY)
{
video_layout_bounds_t b = comp->bounds;
comp->bounds.x = b.y;
comp->bounds.y = b.x;
comp->bounds.w = b.h;
comp->bounds.h = b.w;
}
if (orientation & VIDEO_LAYOUT_FLIP_X)
comp->bounds.x = 1.0f - comp->bounds.x - comp->bounds.w;
if (orientation & VIDEO_LAYOUT_FLIP_Y)
comp->bounds.y = 1.0f - comp->bounds.y - comp->bounds.h;
}
}

View File

@ -1,26 +0,0 @@
#ifndef VIDEO_LAYOUT_ELEMENT_H
#define VIDEO_LAYOUT_ELEMENT_H
#include "internal.h"
#include "component.h"
typedef struct element
{
char *name;
component_t *components;
int components_count;
int state;
int o_bind;
int i_bind;
int i_mask;
video_layout_bounds_t bounds; /* float alignment */
video_layout_bounds_t render_bounds; /* float alignment */
bool i_raw;
} element_t;
void element_init (element_t *elem, const char *name, int components_count);
void element_copy (element_t *elem, const element_t *src);
void element_deinit (element_t *elem);
void element_apply_orientation (element_t *elem, video_layout_orientation_t orientation);
#endif

View File

@ -1,172 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <compat/posix_string.h>
#include "internal.h"
bool vec_size(void **target, size_t elem_size, int count)
{
const int seg = 4;
if (--count % seg == 0)
{
void *resized = realloc(*target, elem_size * (count + seg));
if (!resized)
return false;
*target = resized;
}
return true;
}
bool is_decimal(const char *str)
{
float v;
v = 0.0f;
sscanf(str, "%f", &v);
return (v && v != (int)v);
}
int get_int(const char *str)
{
int res;
res = 0;
if (str[0] == '#')
++str;
if (str[0] == '$')
{
unsigned hex;
++str;
sscanf(str, "%x", &hex);
res = (int)hex;
}
else
sscanf(str, "%i", &res);
return res;
}
float get_dec(const char *str)
{
float res = 0.0f;
sscanf(str, "%f", &res);
return res;
}
video_layout_color_t make_color(void)
{
video_layout_color_t color;
color.r = 0.0f;
color.g = 0.0f;
color.b = 0.0f;
color.a = 0.0f;
return color;
}
video_layout_color_t make_color_white(void)
{
video_layout_color_t color;
color.r = 1.0f;
color.g = 1.0f;
color.b = 1.0f;
color.a = 1.0f;
return color;
}
video_layout_color_t make_color_v(float v)
{
video_layout_color_t color;
color.r = v;
color.g = v;
color.b = v;
color.a = 1.0f;
return color;
}
video_layout_color_t make_color_rgb(float r, float g, float b)
{
video_layout_color_t color;
color.r = r;
color.g = g;
color.b = b;
color.a = 1.0f;
return color;
}
video_layout_color_t make_color_rgba(float r, float g, float b, float a)
{
video_layout_color_t color;
color.r = r;
color.g = g;
color.b = b;
color.a = a;
return color;
}
void color_mod(video_layout_color_t *dst, const video_layout_color_t *src)
{
dst->r *= src->r;
dst->g *= src->g;
dst->b *= src->b;
dst->a *= src->a;
}
video_layout_bounds_t make_bounds(void)
{
video_layout_bounds_t bounds;
bounds.x = 0.0f;
bounds.y = 0.0f;
bounds.w = 0.0f;
bounds.h = 0.0f;
return bounds;
}
video_layout_bounds_t make_bounds_unit(void)
{
video_layout_bounds_t bounds;
bounds.x = 0.0f;
bounds.y = 0.0f;
bounds.w = 1.0f;
bounds.h = 1.0f;
return bounds;
}
video_layout_bounds_t bounds_union(
const video_layout_bounds_t *a,
const video_layout_bounds_t *b)
{
video_layout_bounds_t bounds;
if (!bounds_valid(a))
return *b;
if (!bounds_valid(b))
return *a;
bounds.x = MIN(a->x, b->x);
bounds.y = MIN(a->y, b->y);
bounds.w = MAX(a->x + a->w, b->x + b->w) - bounds.x;
bounds.h = MAX(a->y + a->h, b->y + b->h) - bounds.y;
return bounds;
}
void bounds_scale(
video_layout_bounds_t *dst,
const video_layout_bounds_t *dim)
{
dst->x *= dim->w;
dst->y *= dim->h;
dst->w *= dim->w;
dst->h *= dim->h;
}
bool bounds_valid(const video_layout_bounds_t *bounds)
{
return (bounds->w > 0 && bounds->h > 0);
}

View File

@ -1,29 +0,0 @@
#ifndef VIDEO_LAYOUT_INTERNAL_H
#define VIDEO_LAYOUT_INTERNAL_H
#include <stddef.h>
#include <boolean.h>
#include <retro_miscellaneous.h>
#include "types.h"
bool vec_size (void **target, size_t elem_size, int count);
bool is_decimal (const char *str);
int get_int (const char *str);
float get_dec (const char *str);
video_layout_color_t make_color (void);
video_layout_color_t make_color_white (void);
video_layout_color_t make_color_v (float v);
video_layout_color_t make_color_rgb (float r, float g, float b);
video_layout_color_t make_color_rgba (float r, float g, float b, float a);
void color_mod (video_layout_color_t *dst, const video_layout_color_t *src);
video_layout_bounds_t make_bounds (void);
video_layout_bounds_t make_bounds_unit (void);
video_layout_bounds_t bounds_union (const video_layout_bounds_t *a, const video_layout_bounds_t *b);
void bounds_scale (video_layout_bounds_t *dst, const video_layout_bounds_t *dim);
bool bounds_valid (const video_layout_bounds_t *bounds);
#endif

View File

@ -1,727 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <formats/rxml.h>
#include <string/stdstring.h>
#include "../../verbosity.h"
#include "internal.h"
#include "view.h"
#include "scope.h"
int video_layout_io_find(const char *name);
static const char *const comp_type_str[] = {
NULL, /* VIDEO_LAYOUT_C_UNKNOWN */
NULL, /* VIDEO_LAYOUT_C_SCREEN */
"rect",
"disk",
"image",
"text",
"dotmatrixdot",
"dotmatrix5dot",
"dotmatrix",
"led7seg",
"led8seg_gts1",
"led14seg",
"led14segsc",
"led16seg",
"led16segsc",
"simplecounter",
"reel"
};
static const char *const video_layout_internal_device_params[] =
{
"devicetag" , ":",
"devicebasetag" , "root",
"devicename" , "RetroArch",
"deviceshortname" , "libretro"
};
static const char *const video_layout_internal_screen_params[] =
{
"scr#physicalxaspect" , "1",
"scr#physicalyaspect" , "1",
"scr#nativexaspect" , "1",
"scr#nativeyaspect" , "1",
"scr#width" , "1",
"scr#height" , "1"
};
static int child_count(rxml_node_t *node)
{
rxml_node_t *child;
int res = 0;
for (child = node->children; child; child = child->next)
++res;
return res;
}
static comp_type_t comp_type_from_str(const char *s)
{
size_t i;
for (i = 2; i < ARRAY_SIZE(comp_type_str); ++i)
{
if (string_is_equal(s, comp_type_str[i]))
return (comp_type_t)(int)i;
}
return VIDEO_LAYOUT_C_UNKNOWN;
}
static void init_device_params(scope_t *scope)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(video_layout_internal_device_params); i += 2)
{
scope_param(scope, video_layout_internal_device_params[i], video_layout_internal_device_params[i + 1]);
}
}
static void init_screen_params(scope_t *scope, int screen_index)
{
char buf[64];
size_t i;
for (i = 0; i < ARRAY_SIZE(video_layout_internal_screen_params); i += 2)
{
strcpy(buf, video_layout_internal_screen_params[i + 1]);
buf[3] = '0' + screen_index;
scope_param(scope, video_layout_internal_screen_params[i], buf);
}
}
static video_layout_bounds_t parse_bounds(scope_t *scope, rxml_node_t *node)
{
const char *prop;
video_layout_bounds_t bounds = make_bounds_unit();
if ((prop = scope_eval(scope, rxml_node_attrib(node, "x")))) bounds.x = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "y")))) bounds.y = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "width")))) bounds.w = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "height")))) bounds.h = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "left")))) bounds.x = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "top")))) bounds.y = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "right")))) bounds.w = get_dec(prop) - bounds.x;
if ((prop = scope_eval(scope, rxml_node_attrib(node, "bottom")))) bounds.h = get_dec(prop) - bounds.y;
return bounds;
}
static video_layout_color_t parse_color(scope_t *scope, rxml_node_t *node)
{
const char *prop;
video_layout_color_t color = make_color_white();
if ((prop = scope_eval(scope, rxml_node_attrib(node, "red")))) color.r = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "green")))) color.g = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "blue")))) color.b = get_dec(prop);
if ((prop = scope_eval(scope, rxml_node_attrib(node, "alpha")))) color.a = get_dec(prop);
return color;
}
static video_layout_orientation_t parse_orientation(scope_t *scope, rxml_node_t *node)
{
const char *prop;
video_layout_orientation_t result = VIDEO_LAYOUT_ROT0;
if ((prop = scope_eval(scope, rxml_node_attrib(node, "rotate"))))
{
if (string_is_equal(prop, "90"))
result = VIDEO_LAYOUT_ROT90;
else if (string_is_equal(prop, "180"))
result = VIDEO_LAYOUT_ROT180;
else if (string_is_equal(prop, "270"))
result = VIDEO_LAYOUT_ROT270;
}
if ((prop = scope_eval(scope, rxml_node_attrib(node, "swapxy"))))
{
if (!string_is_equal(prop, "no"))
result ^= VIDEO_LAYOUT_SWAP_XY;
}
if ((prop = scope_eval(scope, rxml_node_attrib(node, "flipx"))))
{
if (!string_is_equal(prop, "no"))
result ^= VIDEO_LAYOUT_FLIP_X;
}
if ((prop = scope_eval(scope, rxml_node_attrib(node, "flipy"))))
{
if (!string_is_equal(prop, "no"))
result ^= VIDEO_LAYOUT_FLIP_Y;
}
return result;
}
static bool load_param(scope_t *scope, rxml_node_t *node, bool can_repeat)
{
const char *name;
const char *value;
const char *start;
if (!(name = rxml_node_attrib(node, "name")))
{
RARCH_LOG("video_layout: <param> is missing 'name' attribute\n");
return false;
}
value = rxml_node_attrib(node, "value");
start = rxml_node_attrib(node, "start");
if (can_repeat && start)
{
const char *inc = rxml_node_attrib(node, "increment");
const char *ls = rxml_node_attrib(node, "lshift");
const char *rs = rxml_node_attrib(node, "rshift");
if (inc || ls || rs)
{
scope_generator(scope, name, start, inc, ls, rs);
}
else
{
RARCH_LOG("video_layout: invalid generator <param name=\"%s\" /> missing increment/shift\n",
scope_eval(scope, name));
return false;
}
}
else if (name && value)
{
scope_param(scope, name, value);
}
else
{
RARCH_LOG("video_layout: invalid parameter <param name=\"%s\" /> missing value\n",
scope_eval(scope, name));
return false;
}
return true;
}
static bool load_component(scope_t *scope, component_t *comp, rxml_node_t *node)
{
const char *state;
const char *attr;
rxml_node_t *n;
comp_type_t type = comp_type_from_str(node->name);
bool result = true;
if (type == VIDEO_LAYOUT_C_UNKNOWN)
{
RARCH_LOG("video_layout: invalid component <%s />\n", node->name);
return false;
}
component_init(comp, type);
if ((state = rxml_node_attrib(node, "state")))
comp->enabled_state = get_int(scope_eval(scope, state));
for (n = node->children; n; n = n->next)
{
if (string_is_equal(n->name, "bounds"))
comp->bounds = parse_bounds(scope, n);
else if (string_is_equal(n->name, "color"))
comp->color = parse_color(scope, n);
}
switch (comp->type)
{
case VIDEO_LAYOUT_C_UNKNOWN:
break;
case VIDEO_LAYOUT_C_SCREEN:
break;
case VIDEO_LAYOUT_C_RECT:
break;
case VIDEO_LAYOUT_C_DISK:
break;
case VIDEO_LAYOUT_C_IMAGE:
{
if (!(attr = rxml_node_attrib(node, "file")))
{
RARCH_LOG("video_layout: invalid component <%s />, missing 'file' attribute\n", node->name);
result = false;
}
string_set(&comp->attr.image.file, scope_eval(scope, attr));
if ((attr = rxml_node_attrib(node, "alphafile")))
string_set(&comp->attr.image.alpha_file, scope_eval(scope, attr));
}
break;
case VIDEO_LAYOUT_C_TEXT:
{
if (!(attr = rxml_node_attrib(node, "string")))
{
RARCH_LOG("video_layout: invalid component <%s />, missing 'string' attribute\n", node->name);
result = false;
}
string_set(&comp->attr.text.string, scope_eval(scope, attr));
if ((attr = rxml_node_attrib(node, "align")))
comp->attr.text.align = (video_layout_text_align_t)get_int(scope_eval(scope, attr));
}
break;
case VIDEO_LAYOUT_C_COUNTER:
{
if ((attr = rxml_node_attrib(node, "digits")))
comp->attr.counter.digits = get_int(scope_eval(scope, attr));
if ((attr = rxml_node_attrib(node, "maxstate")))
comp->attr.counter.max_state = get_int(scope_eval(scope, attr));
if ((attr = rxml_node_attrib(node, "align")))
comp->attr.counter.align = (video_layout_text_align_t)get_int(scope_eval(scope, attr));
}
break;
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
break;
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
break;
case VIDEO_LAYOUT_C_LED_7:
break;
case VIDEO_LAYOUT_C_LED_8_GTS1:
break;
case VIDEO_LAYOUT_C_LED_14:
break;
case VIDEO_LAYOUT_C_LED_14_SC:
break;
case VIDEO_LAYOUT_C_LED_16:
break;
case VIDEO_LAYOUT_C_LED_16_SC:
break;
case VIDEO_LAYOUT_C_REEL:
break;
}
return result;
}
static bool load_element(scope_t *scope, rxml_node_t *node)
{
const char *name;
const char *state;
int i;
element_t *elem;
rxml_node_t *n;
video_layout_bounds_t dim;
bool result = true;
if (!(name = rxml_node_attrib(node, "name")))
{
RARCH_LOG("video_layout: <element> is missing 'name' attribute\n");
return false;
}
elem = scope_add_element(scope);
element_init(elem, scope_eval(scope, name), child_count(node));
if ((state = rxml_node_attrib(node, "defstate")))
elem->state = get_int(scope_eval(scope, state));
i = 0;
for (n = node->children; n; n = n->next, ++i)
{
component_t *comp;
comp = &elem->components[i];
if (load_component(scope, comp, n))
elem->bounds = bounds_union(&elem->bounds, &comp->bounds);
else
result = false;
}
if (bounds_valid(&elem->bounds))
{
dim.x = elem->bounds.x / elem->bounds.w;
dim.y = elem->bounds.y / elem->bounds.h;
dim.w = 1.0f / elem->bounds.w;
dim.h = 1.0f / elem->bounds.h;
}
else
{
dim = make_bounds_unit();
}
for (i = 0; i < elem->components_count; ++i)
{
component_t *comp;
comp = &elem->components[i];
if (bounds_valid(&comp->bounds))
bounds_scale(&comp->bounds, &dim);
else
comp->bounds = dim;
comp->bounds.x -= dim.x;
comp->bounds.y -= dim.y;
}
elem->bounds = make_bounds_unit();
return result;
}
static bool load_screen(scope_t *scope, element_t *elem, rxml_node_t *node)
{
component_t *comp;
const char *index = rxml_node_attrib(node, "index");
element_init(elem, NULL, 1);
comp = &elem->components[0];
component_init(comp, VIDEO_LAYOUT_C_SCREEN);
comp->bounds = make_bounds_unit();
comp->attr.screen.index = get_int(scope_eval(scope, index));
return true;
}
static void merge_group(scope_t *scope, view_t *view, view_t *group,
bool has_bounds, video_layout_bounds_t n_bounds, video_layout_orientation_t n_orient, video_layout_color_t n_color)
{
int i, j, k;
bool constrain = bounds_valid(&n_bounds);
for (i = 0; i < group->layers_count; ++i)
{
layer_t *group_layer;
layer_t *layer;
group_layer = &group->layers[i];
layer = view_emplace_layer(view, group_layer->name);
for (j = 0; j < group_layer->elements_count; ++j)
{
element_t *elem;
elem = layer_add_element(layer);
element_copy(elem, &group_layer->elements[j]);
for (k = 0; k < elem->components_count; ++k)
color_mod(&elem->components->color, &n_color);
if (n_orient)
element_apply_orientation(elem, n_orient);
if (constrain)
{
bounds_scale(&elem->bounds, &n_bounds);
elem->bounds.x += n_bounds.x;
elem->bounds.y += n_bounds.y;
}
if (!has_bounds)
view->bounds = bounds_union(&view->bounds, &elem->bounds);
}
}
}
static bool load_view(scope_t *scope, view_t *view, rxml_node_t *node, bool is_named)
{
bool result, has_bounds;
rxml_node_t *n;
rxml_node_t *o;
int i;
if (is_named)
{
const char *name;
if (!(name = rxml_node_attrib(node, "name")))
{
RARCH_LOG("video_layout: <view> is missing 'name' attribute\n");
return false;
}
view_init(view, scope_eval(scope, name));
}
result = true;
has_bounds = false;
for (n = node->children; n; n = n->next)
{
video_layout_color_t n_color;
video_layout_bounds_t n_bounds;
video_layout_orientation_t n_orient;
if (string_is_equal(n->name, "param"))
{
if (!load_param(scope, n, true))
result = false;
continue;
}
else if (string_is_equal(n->name, "bounds"))
{
view->bounds = parse_bounds(scope, n);
has_bounds = true;
continue;
}
n_color = make_color_white();
n_bounds = make_bounds();
n_orient = VIDEO_LAYOUT_ROT0;
for (o = n->children; o; o = o->next)
{
if (string_is_equal(o->name, "color"))
n_color = parse_color(scope, o);
else if (string_is_equal(o->name, "bounds"))
n_bounds = parse_bounds(scope, o);
else if (string_is_equal(o->name, "orientation"))
n_orient = parse_orientation(scope, o);
}
if (string_is_equal(n->name, "group"))
{
const char *ref;
if ((ref = rxml_node_attrib(n, "ref")))
{
view_t *group;
if ((group = scope_find_group(scope, scope_eval(scope, ref))))
{
merge_group(scope, view, group, has_bounds, n_bounds, n_orient, n_color);
}
else
{
RARCH_LOG("video_layout: group \"%s\" is missing\n", scope_eval(scope, ref));
result = false;
}
}
else
{
RARCH_LOG("video_layout: <group> is missing 'ref' attribute\n");
result = false;
}
}
else if (string_is_equal(n->name, "repeat"))
{
const char *count_s;
int count;
if (!(count_s = rxml_node_attrib(n, "count")))
{
RARCH_LOG("video_layout: <repeat> is missing 'count' attribute\n");
result = false;
continue;
}
count = get_int(scope_eval(scope, count_s));
scope_push(scope);
for (o = n->children; o; o = o->next)
{
if (string_is_equal(o->name, "param"))
{
if (!load_param(scope, o, true))
result = false;
}
}
for (i = 0; i < count; ++i)
{
view_t rep;
view_init(&rep, NULL);
if (!load_view(scope, &rep, n, false))
result = false;
merge_group(scope, view, &rep, has_bounds, n_bounds, n_orient, n_color);
view_deinit(&rep);
scope_repeat(scope);
}
scope_pop(scope);
}
else /* element */
{
layer_t *layer = view_emplace_layer(view, n->name);
element_t *elem = layer_add_element(layer);
if (string_is_equal(n->name, "screen"))
{
if (!load_screen(scope, elem, n))
result = false;
}
else
{
const char *elem_name;
const char *attr;
if ((elem_name = rxml_node_attrib(n, "element")))
{
element_t *elem_src;
if ((elem_src = scope_find_element(scope, elem_name)))
{
element_copy(elem, elem_src);
if ((attr = rxml_node_attrib(n, "name")))
elem->o_bind = video_layout_io_find(scope_eval(scope, attr));
if ((attr = rxml_node_attrib(n, "inputtag")))
elem->i_bind = video_layout_io_find(scope_eval(scope, attr));
if ((attr = rxml_node_attrib(n, "inputmask")))
elem->i_mask = get_int(scope_eval(scope, attr));
if ((attr = rxml_node_attrib(n, "inputraw")))
elem->i_raw = get_int(scope_eval(scope, attr)) ? true : false;
}
else
{
RARCH_LOG("video_layout: element \"%s\" is missing\n", scope_eval(scope, elem_name));
result = false;
}
}
else
{
RARCH_LOG("video_layout: <%s> is missing 'element' attribute\n", n->name);
result = false;
}
}
for (i = 0; i < elem->components_count; ++i)
color_mod(&elem->components->color, &n_color);
elem->bounds = n_bounds;
if (n_orient)
element_apply_orientation(elem, n_orient);
if (!has_bounds)
view->bounds = bounds_union(&view->bounds, &elem->bounds);
}
}
return result;
}
static bool load_group(scope_t *scope, rxml_node_t *node)
{
bool result = true;
view_t *group = scope_add_group(scope);
scope_push(scope);
if (!load_view(scope, group, node, true))
result = false;
scope_pop(scope);
return result;
}
static bool load_top_level(scope_t *scope, int *view_count, rxml_node_t *root)
{
rxml_node_t *node;
bool result = true;
*view_count = 0;
for (node = root->children; node; node = node->next)
{
if (string_is_equal(node->name, "param"))
{
if (!load_param(scope, node, false))
result = false;
}
else if (string_is_equal(node->name, "element"))
{
if (!load_element(scope, node))
result = false;
}
else if (string_is_equal(node->name, "group"))
{
if (!load_group(scope, node))
result = false;
}
else if (string_is_equal(node->name, "view"))
++(*view_count);
}
return result;
}
static bool load_views(scope_t *scope, view_array_t *view_array,
rxml_node_t *root)
{
rxml_node_t *node = NULL;
bool result = true;
unsigned i = 0;
for (node = root->children; node; node = node->next)
{
if (string_is_equal(node->name, "view"))
{
view_t *view = &view_array->views[i];
scope_push(scope);
if (!load_view(scope, view, node, true))
result = false;
view_sort_layers(view);
view_normalize(view);
view_count_screens(view);
scope_pop(scope);
++i;
}
}
return result;
}
bool video_layout_load_internal(view_array_t *view_array, rxml_document_t *doc)
{
scope_t scope;
int view_count;
bool result = true;
rxml_node_t *root = rxml_root_node(doc);
if (strcmp(root->name, "mamelayout") ||
strcmp(rxml_node_attrib(root, "version"), "2"))
{
RARCH_LOG("video_layout: invalid MAME Layout file\n");
return false;
}
scope_init(&scope);
init_device_params(&scope);
init_screen_params(&scope, 0);
init_screen_params(&scope, 1);
if (!load_top_level(&scope, &view_count, root))
result = false;
view_array_init(view_array, view_count);
if (!load_views(&scope, view_array, root))
result = false;
scope_deinit(&scope);
return result;
}

View File

@ -1,334 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <compat/strl.h>
#include <string/stdstring.h>
#include "scope.h"
union number
{
int val_int;
float val_dec;
};
typedef struct generator
{
bool is_decimal;
union number value;
union number increment;
int shift;
} generator_t;
struct param
{
char *name;
char *value;
generator_t *generator;
param_t *prev;
int level;
};
static void param_deinit(param_t *param)
{
free(param->generator);
free(param->value);
free(param->name);
}
static param_t *param_find(scope_t *scope, const char *name, int level)
{
param_t *param = scope->param;
while (param && param->level >= level)
{
if (string_is_equal(param->name, name))
return param;
param = param->prev;
}
return NULL;
}
void scope_init(scope_t *scope)
{
scope->level = 0;
scope->param = NULL;
scope->elements = NULL;
scope->elements_count = 0;
scope->groups = NULL;
scope->groups_count = 0;
}
void scope_deinit(scope_t *scope)
{
int i;
param_t *param;
param_t *prev;
for (i = 0; i < scope->elements_count; ++i)
element_deinit(&scope->elements[i]);
free(scope->elements);
for (i = 0; i < scope->groups_count; ++i)
view_deinit(&scope->groups[i]);
free(scope->groups);
for (param = scope->param; param; param = prev)
{
prev = param->prev;
param_deinit(param);
free(param);
}
}
void scope_push(scope_t *scope)
{
++scope->level;
}
void scope_pop(scope_t *scope)
{
param_t *param;
--scope->level;
while ((param = scope->param))
{
if (param->level <= scope->level)
break;
scope->param = param->prev;
param_deinit(param);
free(param);
}
}
void scope_repeat(scope_t *scope)
{
param_t *param;
for (
param = scope->param;
param && param->level >= scope->level;
param = param->prev)
{
generator_t *gen;
if ((gen = param->generator))
{
char tmp[SCOPE_BUFFER_SIZE];
tmp[0] = '\0';
if (gen->is_decimal)
{
gen->value.val_dec += gen->increment.val_dec;
if (gen->shift > 0)
gen->value.val_dec = (float)((int)gen->value.val_dec << gen->shift);
else if (gen->shift < 0)
gen->value.val_dec = (float)((int)gen->value.val_dec >> -gen->shift);
snprintf(tmp, sizeof(tmp), "%f", gen->value.val_dec);
}
else
{
gen->value.val_int += gen->increment.val_int;
if (gen->shift > 0)
gen->value.val_int <<= gen->shift;
else if (gen->shift < 0)
gen->value.val_int >>= -gen->shift;
snprintf(tmp, sizeof(tmp), "%d", gen->value.val_int);
}
string_set(&param->value, tmp);
}
}
}
void scope_param(scope_t *scope, const char *name, const char *value)
{
param_t *param;
char *eval_name = string_init(scope_eval(scope, name));
char *eval_value = string_init(scope_eval(scope, value));
if ((param = param_find(scope, eval_name, scope->level)))
{
free(param->value);
param->value = eval_value;
}
else
{
param = (param_t*)malloc(sizeof(param_t));
param->name = string_init(name);
param->value = eval_value;
param->generator = NULL;
param->level = scope->level;
param->prev = scope->param;
scope->param = param;
}
free(eval_name);
}
void scope_generator(scope_t *scope, const char *name,
const char *start, const char *increment,
const char *lshift, const char *rshift)
{
char *e_val;
char *e_inc;
generator_t *gen;
param_t *param;
char *e_name = string_init(scope_eval(scope, name));
if (param_find(scope, e_name, scope->level))
{
free(e_name);
return;
}
e_val = string_init(scope_eval(scope, start));
e_inc = string_init(scope_eval(scope, increment));
gen = (generator_t*)malloc(sizeof(generator_t));
param = (param_t*)malloc(sizeof(param_t));
param->name = string_init(e_name);
param->value = string_init(e_val);
param->generator = gen;
param->level = scope->level;
param->prev = scope->param;
scope->param = param;
gen->is_decimal = is_decimal(e_val) | is_decimal(e_inc);
if (gen->is_decimal)
{
gen->value.val_dec = get_dec(e_val);
gen->increment.val_dec = get_dec(e_inc);
}
else
{
gen->value.val_int = get_int(e_val);
gen->increment.val_int = get_int(e_inc);
}
gen->shift = 0;
if (lshift)
gen->shift += get_int(scope_eval(scope, lshift));
if (rshift)
gen->shift -= get_int(scope_eval(scope, rshift));
free(e_inc);
free(e_val);
free(e_name);
}
const char *scope_eval(scope_t *scope, const char *src)
{
const char* next;
bool in_var;
char tmp[SCOPE_BUFFER_SIZE];
if (!src)
return NULL;
scope->eval[0] = '\0';
next = src;
while (next[0] != '\0')
{
const char *cur = next;
if ((in_var = (next[0] == '~')))
++cur;
next = strchr(cur, '~');
if (next && next != cur)
{
size_t len = next - cur;
if (in_var)
{
param_t *param;
strncpy(tmp, cur, len);
tmp[len] = '\0';
if ((param = param_find(scope, tmp, 0)))
strlcat(scope->eval, param->value,
sizeof(scope->eval));
else
strlcat(scope->eval, tmp, sizeof(scope->eval));
++next;
}
else
strncat(scope->eval, cur, len);
}
else
{
if (in_var)
--cur;
strlcat(scope->eval, cur, sizeof(scope->eval));
break;
}
}
return scope->eval;
}
element_t *scope_add_element(scope_t *scope)
{
element_t *elem;
vec_size((void**)&scope->elements,
sizeof(element_t), ++scope->elements_count);
elem = &scope->elements[scope->elements_count - 1];
element_init(elem, NULL, 0);
return elem;
}
element_t *scope_find_element(scope_t *scope, const char *name)
{
unsigned i;
for (i = 0; i < scope->elements_count; ++i)
{
if (string_is_equal(name, scope->elements[i].name))
return &scope->elements[i];
}
return NULL;
}
view_t *scope_add_group(scope_t *scope)
{
view_t *group;
vec_size((void**)&scope->groups, sizeof(view_t), ++scope->groups_count);
group = &scope->groups[scope->groups_count - 1];
view_init(group, NULL);
return group;
}
view_t *scope_find_group(scope_t *scope, const char *name)
{
unsigned i;
for (i = 0; i < scope->groups_count; ++i)
{
if (string_is_equal(name, scope->groups[i].name))
return &scope->groups[i];
}
return NULL;
}

View File

@ -1,42 +0,0 @@
#ifndef VIDEO_LAYOUT_SCOPE_H
#define VIDEO_LAYOUT_SCOPE_H
#include "view.h"
#include "element.h"
#define SCOPE_BUFFER_SIZE 256
typedef struct param param_t;
typedef struct scope
{
param_t *param;
element_t *elements;
int elements_count;
view_t *groups;
int groups_count;
int level;
char eval[SCOPE_BUFFER_SIZE];
} scope_t;
void scope_init (scope_t *scope);
void scope_deinit (scope_t *scope);
void scope_push (scope_t *scope);
void scope_pop (scope_t *scope);
void scope_repeat (scope_t *scope);
void scope_param (scope_t *scope, const char *name, const char *value);
void scope_generator (scope_t *scope, const char *name, const char *start, const char *increment, const char *lshift, const char *rshift);
const char *scope_eval (scope_t *scope, const char *src);
element_t *scope_add_element (scope_t *scope);
element_t *scope_find_element (scope_t *scope, const char *name);
view_t *scope_add_group (scope_t *scope);
view_t *scope_find_group (scope_t *scope, const char *name);
#endif

View File

@ -1,47 +0,0 @@
#ifndef VIDEO_LAYOUT_TYPES_H
#define VIDEO_LAYOUT_TYPES_H
#include <stdint.h>
typedef uint8_t video_layout_orientation_t;
#define VIDEO_LAYOUT_FLIP_X 1
#define VIDEO_LAYOUT_FLIP_Y 2
#define VIDEO_LAYOUT_SWAP_XY 4
#define VIDEO_LAYOUT_ROT0 0
#define VIDEO_LAYOUT_ROT90 VIDEO_LAYOUT_SWAP_XY | VIDEO_LAYOUT_FLIP_X
#define VIDEO_LAYOUT_ROT180 VIDEO_LAYOUT_FLIP_X | VIDEO_LAYOUT_FLIP_Y
#define VIDEO_LAYOUT_ROT270 VIDEO_LAYOUT_SWAP_XY | VIDEO_LAYOUT_FLIP_Y
typedef enum video_layout_blend
{
VIDEO_LAYOUT_BLEND_ALPHA = 0,
VIDEO_LAYOUT_BLEND_ADD,
VIDEO_LAYOUT_BLEND_MOD
} video_layout_blend_t;
typedef enum video_layout_text_align
{
VIDEO_LAYOUT_TEXT_ALIGN_CENTER = 0,
VIDEO_LAYOUT_TEXT_ALIGN_LEFT,
VIDEO_LAYOUT_TEXT_ALIGN_RIGHT
} video_layout_text_align_t;
typedef struct video_layout_color
{
float r;
float g;
float b;
float a;
} video_layout_color_t;
typedef struct video_layout_bounds
{
float x;
float y;
float w;
float h;
} video_layout_bounds_t;
#endif

View File

@ -1,257 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include <string/stdstring.h>
#include "view.h"
void layer_init(layer_t *layer, const char *name)
{
layer->name = string_init(name);
layer->blend = VIDEO_LAYOUT_BLEND_ALPHA;
layer->elements = NULL;
layer->elements_count = 0;
}
void layer_deinit(layer_t *layer)
{
unsigned i;
for (i = 0; i < layer->elements_count; ++i)
element_deinit(&layer->elements[i]);
free(layer->elements);
free(layer->name);
}
element_t *layer_add_element(layer_t *layer)
{
element_t *elem;
vec_size((void**)&layer->elements,
sizeof(element_t), ++layer->elements_count);
elem = &layer->elements[layer->elements_count - 1];
element_init(elem, NULL, 0);
return elem;
}
void view_init(view_t *view, const char *name)
{
view->name = string_init(name);
view->bounds = make_bounds();
view->render_bounds = make_bounds_unit();
view->layers = NULL;
view->layers_count = 0;
view->screens = NULL;
view->screens_count = 0;
}
void view_deinit(view_t *view)
{
unsigned i;
free(view->screens);
for (i = 0; i < view->layers_count; ++i)
layer_deinit(&view->layers[i]);
free(view->layers);
free(view->name);
}
layer_t *view_find_layer(view_t *view, const char *name)
{
unsigned i;
for (i = 0; i < view->layers_count; ++i)
{
if (string_is_equal(name, view->layers[i].name))
return &view->layers[i];
}
return NULL;
}
layer_t *view_emplace_layer(view_t *view, const char *name)
{
layer_t *layer = view_find_layer(view, name);
if (!layer)
{
vec_size((void**)&view->layers, sizeof(layer_t), ++view->layers_count);
layer = &view->layers[view->layers_count - 1];
layer_init(layer, name);
}
return layer;
}
void view_sort_layers(view_t *view)
{
layer_t sorted[6];
layer_t *layer;
unsigned i = 0;
/* retroarch frame *= screen's color */
if ((layer = view_find_layer(view, "screen")))
{
layer->blend = VIDEO_LAYOUT_BLEND_MOD;
sorted[i] = *layer;
++i;
}
if ((layer = view_find_layer(view, "overlay")))
{
layer->blend = VIDEO_LAYOUT_BLEND_MOD;
sorted[i] = *layer;
++i;
}
if ((layer = view_find_layer(view, "backdrop")))
{
layer->blend = VIDEO_LAYOUT_BLEND_ADD;
sorted[i] = *layer;
++i;
}
if ((layer = view_find_layer(view, "bezel")))
{
layer->blend = VIDEO_LAYOUT_BLEND_ALPHA;
sorted[i] = *layer;
++i;
}
if ((layer = view_find_layer(view, "cpanel")))
{
layer->blend = VIDEO_LAYOUT_BLEND_ALPHA;
sorted[i] = *layer;
++i;
}
if ((layer = view_find_layer(view, "marquee")))
{
layer->blend = VIDEO_LAYOUT_BLEND_ALPHA;
sorted[i] = *layer;
++i;
}
for (i = 0; i < view->layers_count; ++i)
view->layers[i] = sorted[i];
}
void view_normalize(view_t *view)
{
video_layout_bounds_t dim;
unsigned i, j;
if (bounds_valid(&view->bounds))
{
dim.x = view->bounds.x / view->bounds.w;
dim.y = view->bounds.y / view->bounds.h;
dim.w = 1.0f / view->bounds.w;
dim.h = 1.0f / view->bounds.h;
if (view->bounds.w < view->bounds.h)
{
view->bounds.w = view->bounds.w / view->bounds.h;
view->bounds.h = 1.f;
}
else
{
view->bounds.h = view->bounds.h / view->bounds.w;
view->bounds.w = 1.f;
}
view->bounds.x = 0;
view->bounds.y = 0;
}
else
dim = view->bounds = make_bounds_unit();
for (i = 0; i < view->layers_count; ++i)
{
layer_t *layer;
layer = &view->layers[i];
for (j = 0; j < layer->elements_count; ++j)
{
element_t *elem;
elem = &layer->elements[j];
if (bounds_valid(&elem->bounds))
bounds_scale(&elem->bounds, &dim);
else
elem->bounds = dim;
elem->bounds.x -= dim.x;
elem->bounds.y -= dim.y;
}
}
}
void view_count_screens(view_t *view)
{
unsigned i, j, k;
int idx = -1;
for (i = 0; i < view->layers_count; ++i)
{
layer_t *layer = &view->layers[i];
for (j = 0; j < layer->elements_count; ++j)
{
element_t *elem = &layer->elements[j];
for (k = 0; k < elem->components_count; ++k)
{
component_t *comp = &elem->components[k];
if (comp->type == VIDEO_LAYOUT_C_SCREEN)
idx = MAX(idx, comp->attr.screen.index);
}
}
}
if (view->screens_count)
{
free(view->screens);
view->screens_count = 0;
}
if ((++idx))
{
view->screens = (video_layout_bounds_t*)
calloc(idx, sizeof(video_layout_bounds_t));
view->screens_count = idx;
}
}
void view_array_init(view_array_t *view_array, int views_count)
{
view_array->views = (view_t*)(views_count > 0 ?
calloc(views_count, sizeof(view_t)) : NULL);
view_array->views_count = views_count;
}
void view_array_deinit(view_array_t *view_array)
{
unsigned i;
for (i = 0; i < view_array->views_count; ++i)
view_deinit(&view_array->views[i]);
free(view_array->views);
view_array->views = NULL;
view_array->views_count = 0;
}
view_t *view_array_find(view_array_t *view_array, const char *name)
{
unsigned i;
for (i = 0; i < view_array->views_count; ++i)
{
if (string_is_equal(name, view_array->views[i].name))
return &view_array->views[i];
}
return NULL;
}

View File

@ -1,51 +0,0 @@
#ifndef VIDEO_LAYOUT_VIEW_H
#define VIDEO_LAYOUT_VIEW_H
#include "internal.h"
#include "element.h"
typedef struct layer
{
char *name;
video_layout_blend_t blend;
element_t *elements;
int elements_count;
} layer_t;
typedef struct view
{
char *name;
video_layout_bounds_t bounds;
video_layout_bounds_t render_bounds;
layer_t *layers;
int layers_count;
video_layout_bounds_t *screens;
int screens_count;
} view_t;
typedef struct view_array
{
view_t *views;
int views_count;
} view_array_t;
void layer_init (layer_t *layer, const char *name);
void layer_deinit (layer_t *layer);
element_t *layer_add_element (layer_t *layer);
void view_init (view_t *view, const char *name);
void view_deinit (view_t *view);
layer_t *view_find_layer (view_t *view, const char *name);
layer_t *view_emplace_layer (view_t *view, const char *name);
void view_sort_layers (view_t *view);
void view_normalize (view_t *view);
void view_count_screens (view_t *view);
void view_array_init (view_array_t *view_array, int views_count);
void view_array_deinit (view_array_t *view_array);
view_t *view_array_find (view_array_t *view_array, const char *name);
#endif

View File

@ -1332,9 +1332,6 @@ static const video_driver_t video_thread = {
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
video_thread_get_overlay_interface,
#endif
#ifdef HAVE_VIDEO_LAYOUT
NULL, /* video_layout_render_interface */
#endif
video_thread_get_poke_interface,
NULL, /* wrap_type_to_enum */

View File

@ -568,16 +568,6 @@ VIDEO DRIVER
#include "../deps/ibxm/ibxm.c"
#ifdef HAVE_VIDEO_LAYOUT
#include "../gfx/video_layout.c"
#include "../gfx/video_layout/view.c"
#include "../gfx/video_layout/element.c"
#include "../gfx/video_layout/component.c"
#include "../gfx/video_layout/internal.c"
#include "../gfx/video_layout/scope.c"
#include "../gfx/video_layout/load.c"
#endif
/*============================================================
FONTS
============================================================ */

View File

@ -149,9 +149,6 @@ GENERIC_DEFERRED_PUSH(deferred_push_override_file_load, DISPLAYLIST_
GENERIC_DEFERRED_PUSH(deferred_push_record_configfile, DISPLAYLIST_RECORD_CONFIG_FILES)
GENERIC_DEFERRED_PUSH(deferred_push_stream_configfile, DISPLAYLIST_STREAM_CONFIG_FILES)
GENERIC_DEFERRED_PUSH(deferred_push_input_overlay, DISPLAYLIST_OVERLAYS)
#ifdef HAVE_VIDEO_LAYOUT
GENERIC_DEFERRED_PUSH(deferred_push_video_layout_path, DISPLAYLIST_VIDEO_LAYOUT_PATH)
#endif
GENERIC_DEFERRED_PUSH(deferred_push_video_font_path, DISPLAYLIST_VIDEO_FONTS)
GENERIC_DEFERRED_PUSH(deferred_push_xmb_font_path, DISPLAYLIST_FONTS)
GENERIC_DEFERRED_PUSH(deferred_push_content_history_path, DISPLAYLIST_CONTENT_HISTORY)
@ -191,9 +188,6 @@ GENERIC_DEFERRED_PUSH(deferred_push_onscreen_notifications_views_settings_list,
#if defined(HAVE_OVERLAY)
GENERIC_DEFERRED_PUSH(deferred_push_onscreen_overlay_settings_list, DISPLAYLIST_ONSCREEN_OVERLAY_SETTINGS_LIST)
#endif
#ifdef HAVE_VIDEO_LAYOUT
GENERIC_DEFERRED_PUSH(deferred_push_onscreen_video_layout_settings_list, DISPLAYLIST_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST)
#endif
GENERIC_DEFERRED_PUSH(deferred_push_menu_file_browser_settings_list,DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_menu_views_settings_list, DISPLAYLIST_MENU_VIEWS_SETTINGS_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_quick_menu_views_settings_list, DISPLAYLIST_QUICK_MENU_VIEWS_SETTINGS_LIST)
@ -712,9 +706,6 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_DEFERRED_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS_LIST, deferred_push_onscreen_notifications_views_settings_list},
#if defined(HAVE_OVERLAY)
{MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST, deferred_push_onscreen_overlay_settings_list},
#endif
#ifdef HAVE_VIDEO_LAYOUT
{MENU_ENUM_LABEL_DEFERRED_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST, deferred_push_onscreen_video_layout_settings_list},
#endif
{MENU_ENUM_LABEL_DEFERRED_MENU_FILE_BROWSER_SETTINGS_LIST, deferred_push_menu_file_browser_settings_list},
{MENU_ENUM_LABEL_DEFERRED_MENU_VIEWS_SETTINGS_LIST, deferred_push_menu_views_settings_list},
@ -850,9 +841,6 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_MAX_USERS, deferred_push_cursor_manager_list_deferred_query_rdb_entry_max_users},
{MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_RELEASEMONTH, deferred_push_cursor_manager_list_deferred_query_rdb_entry_releasemonth},
{MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_RELEASEYEAR, deferred_push_cursor_manager_list_deferred_query_rdb_entry_releaseyear},
#endif
#ifdef HAVE_VIDEO_LAYOUT
{MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH, deferred_push_video_layout_path},
#endif
{MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE_MENU, deferred_push_achievement_pause_menu},
{MENU_ENUM_LABEL_ACHIEVEMENT_LIST, deferred_push_achievement_list},
@ -1219,11 +1207,6 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_INPUT_OVERLAY:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_input_overlay);
break;
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_video_layout_path);
break;
#endif
case MENU_ENUM_LABEL_VIDEO_FONT_PATH:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_video_font_path);
break;
@ -1288,11 +1271,6 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_onscreen_overlay_settings_list);
break;
#endif
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_DEFERRED_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_onscreen_video_layout_settings_list);
break;
#endif
case MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_audio_settings_list);

View File

@ -1339,20 +1339,6 @@ static void menu_action_setting_disp_set_label_menu_file_overlay(
path, "(OVERLAY)", STRLEN_CONST("(OVERLAY)"), s2, len2);
}
#ifdef HAVE_VIDEO_LAYOUT
static void menu_action_setting_disp_set_label_menu_file_video_layout(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *path,
char *s2, size_t len2)
{
MENU_ACTION_SETTING_GENERIC_DISP_SET_LABEL_2(w, s, len,
path, "(LAYOUT)", STRLEN_CONST("(LAYOUT)"), s2, len2);
}
#endif
static void menu_action_setting_disp_set_label_menu_file_config(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
@ -2185,12 +2171,6 @@ static int menu_cbs_init_bind_get_string_representation_compare_type(
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_overlay);
break;
#ifdef HAVE_VIDEO_LAYOUT
case FILE_TYPE_VIDEO_LAYOUT:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_video_layout);
break;
#endif
case FILE_TYPE_FONT:
case FILE_TYPE_VIDEO_FONT:
BIND_ACTION_GET_VALUE(cbs,

View File

@ -1211,9 +1211,6 @@ static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
case FILE_TYPE_SHADER_PRESET:
case FILE_TYPE_IMAGE:
case FILE_TYPE_OVERLAY:
#ifdef HAVE_VIDEO_LAYOUT
case FILE_TYPE_VIDEO_LAYOUT:
#endif
case FILE_TYPE_VIDEOFILTER:
case FILE_TYPE_AUDIOFILTER:
case FILE_TYPE_CONFIG:

View File

@ -125,9 +125,6 @@ enum
ACTION_OK_SET_PATH_AUDIO_FILTER,
ACTION_OK_SET_PATH_VIDEO_FILTER,
ACTION_OK_SET_PATH_OVERLAY,
#ifdef HAVE_VIDEO_LAYOUT
ACTION_OK_SET_PATH_VIDEO_LAYOUT,
#endif
ACTION_OK_SET_PATH_VIDEO_FONT,
ACTION_OK_SET_DIRECTORY,
ACTION_OK_SHOW_WIMP,
@ -381,10 +378,6 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS_LIST;
case ACTION_OK_DL_ONSCREEN_OVERLAY_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST;
#ifdef HAVE_VIDEO_LAYOUT
case ACTION_OK_DL_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST;
#endif
case ACTION_OK_DL_MENU_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_MENU_SETTINGS_LIST;
#ifdef _3DS
@ -969,22 +962,6 @@ int generic_action_ok_displaylist_push(const char *path,
info_path = parent_dir;
break;
#if defined(HAVE_VIDEO_LAYOUT)
case ACTION_OK_DL_VIDEO_LAYOUT:
filebrowser_clear_type();
info.directory_ptr = idx;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH);
info.enum_idx = MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH;
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
action_ok_get_file_browser_start_path(
settings->paths.path_video_layout,
settings->paths.directory_video_layout,
parent_dir, sizeof(parent_dir), true);
info_path = parent_dir;
break;
#endif
case ACTION_OK_DL_VIDEO_FONT:
filebrowser_set_type(FILEBROWSER_SELECT_VIDEO_FONT);
info.directory_ptr = idx;
@ -1627,9 +1604,6 @@ int generic_action_ok_displaylist_push(const char *path,
case ACTION_OK_DL_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST:
case ACTION_OK_DL_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS_LIST:
case ACTION_OK_DL_ONSCREEN_OVERLAY_SETTINGS_LIST:
#ifdef HAVE_VIDEO_LAYOUT
case ACTION_OK_DL_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST:
#endif
case ACTION_OK_DL_MENU_SETTINGS_LIST:
#ifdef _3DS
case ACTION_OK_DL_MENU_BOTTOM_SETTINGS_LIST:
@ -2278,12 +2252,6 @@ static int generic_action_ok(const char *path,
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST);
ret = set_path_generic(menu_label, action_path);
break;
#ifdef HAVE_VIDEO_LAYOUT
case ACTION_OK_SET_PATH_VIDEO_LAYOUT:
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST);
ret = set_path_generic(menu_label, action_path);
break;
#endif
case ACTION_OK_SET_PATH_VIDEO_FONT:
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST);
ret = set_path_generic(menu_label, action_path);
@ -2341,9 +2309,6 @@ static int default_action_ok_load_content_from_playlist_from_menu(const char *_p
DEFAULT_ACTION_OK_SET(action_ok_set_path_audiofilter, ACTION_OK_SET_PATH_AUDIO_FILTER, MSG_UNKNOWN)
DEFAULT_ACTION_OK_SET(action_ok_set_path_videofilter, ACTION_OK_SET_PATH_VIDEO_FILTER, MSG_UNKNOWN)
DEFAULT_ACTION_OK_SET(action_ok_set_path_overlay, ACTION_OK_SET_PATH_OVERLAY, MSG_UNKNOWN)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_ACTION_OK_SET(action_ok_set_path_video_layout,ACTION_OK_SET_PATH_VIDEO_LAYOUT, MSG_UNKNOWN)
#endif
DEFAULT_ACTION_OK_SET(action_ok_set_path_video_font, ACTION_OK_SET_PATH_VIDEO_FONT, MSG_UNKNOWN)
DEFAULT_ACTION_OK_SET(action_ok_set_path, ACTION_OK_SET_PATH, MSG_UNKNOWN)
DEFAULT_ACTION_OK_SET(action_ok_load_core, ACTION_OK_LOAD_CORE, MSG_UNKNOWN)
@ -5897,9 +5862,6 @@ DEFAULT_ACTION_OK_FUNC(action_ok_onscreen_display_list, ACTION_OK_DL_ONSCREEN_DI
DEFAULT_ACTION_OK_FUNC(action_ok_onscreen_notifications_list, ACTION_OK_DL_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST)
DEFAULT_ACTION_OK_FUNC(action_ok_onscreen_notifications_views_list, ACTION_OK_DL_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS_LIST)
DEFAULT_ACTION_OK_FUNC(action_ok_onscreen_overlay_list, ACTION_OK_DL_ONSCREEN_OVERLAY_SETTINGS_LIST)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_ACTION_OK_FUNC(action_ok_onscreen_video_layout_list, ACTION_OK_DL_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST)
#endif
DEFAULT_ACTION_OK_FUNC(action_ok_menu_list, ACTION_OK_DL_MENU_SETTINGS_LIST)
#ifdef _3DS
DEFAULT_ACTION_OK_FUNC(action_ok_menu_bottom_list, ACTION_OK_DL_MENU_BOTTOM_SETTINGS_LIST)
@ -5950,9 +5912,6 @@ DEFAULT_ACTION_OK_FUNC(action_ok_push_generic_list, ACTION_OK_DL_GENERIC)
DEFAULT_ACTION_OK_FUNC(action_ok_audio_dsp_plugin, ACTION_OK_DL_AUDIO_DSP_PLUGIN)
DEFAULT_ACTION_OK_FUNC(action_ok_video_filter, ACTION_OK_DL_VIDEO_FILTER)
DEFAULT_ACTION_OK_FUNC(action_ok_overlay_preset, ACTION_OK_DL_OVERLAY_PRESET)
#if defined(HAVE_VIDEO_LAYOUT)
DEFAULT_ACTION_OK_FUNC(action_ok_video_layout, ACTION_OK_DL_VIDEO_LAYOUT)
#endif
DEFAULT_ACTION_OK_FUNC(action_ok_video_font, ACTION_OK_DL_VIDEO_FONT)
DEFAULT_ACTION_OK_FUNC(action_ok_rpl_entry, ACTION_OK_DL_RPL_ENTRY)
DEFAULT_ACTION_OK_FUNC(action_ok_open_archive_detect_core, ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE)
@ -8262,9 +8221,6 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_NETPLAY_REFRESH_LAN, action_ok_push_netplay_refresh_lan},
#endif
#endif
#ifdef HAVE_VIDEO_LAYOUT
{MENU_ENUM_LABEL_ONSCREEN_VIDEO_LAYOUT_SETTINGS, action_ok_onscreen_video_layout_list},
#endif
#ifdef HAVE_LAKKA_SWITCH
{MENU_ENUM_LABEL_SWITCH_GPU_PROFILE, action_ok_push_default},
#endif
@ -8328,9 +8284,6 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN, action_ok_audio_dsp_plugin},
{MENU_ENUM_LABEL_VIDEO_FILTER, action_ok_video_filter},
{MENU_ENUM_LABEL_OVERLAY_PRESET, action_ok_overlay_preset},
#if defined(HAVE_VIDEO_LAYOUT)
{MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH, action_ok_video_layout},
#endif
{MENU_ENUM_LABEL_RECORD_CONFIG, action_ok_record_configfile},
{MENU_ENUM_LABEL_STREAM_CONFIG, action_ok_stream_configfile},
#ifdef HAVE_RGUI
@ -8565,9 +8518,6 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN, action_ok_audio_dsp_plugin},
{MENU_ENUM_LABEL_VIDEO_FILTER, action_ok_video_filter},
{MENU_ENUM_LABEL_OVERLAY_PRESET, action_ok_overlay_preset},
#if defined(HAVE_VIDEO_LAYOUT)
{MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH, action_ok_video_layout},
#endif
{MENU_ENUM_LABEL_REMAP_FILE_LOAD, action_ok_remap_file},
{MENU_ENUM_LABEL_OVERRIDE_FILE_LOAD, action_ok_override_file},
{MENU_ENUM_LABEL_RECORD_CONFIG, action_ok_record_configfile},
@ -9043,11 +8993,6 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
case FILE_TYPE_OVERLAY:
BIND_ACTION_OK(cbs, action_ok_set_path_overlay);
break;
#ifdef HAVE_VIDEO_LAYOUT
case FILE_TYPE_VIDEO_LAYOUT:
BIND_ACTION_OK(cbs, action_ok_set_path_video_layout);
break;
#endif
case FILE_TYPE_AUDIOFILTER:
BIND_ACTION_OK(cbs, action_ok_set_path_audiofilter);
break;

View File

@ -1033,9 +1033,6 @@ static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
case FILE_TYPE_SHADER_PRESET:
case FILE_TYPE_IMAGE:
case FILE_TYPE_OVERLAY:
#ifdef HAVE_VIDEO_LAYOUT
case FILE_TYPE_VIDEO_LAYOUT:
#endif
case FILE_TYPE_VIDEOFILTER:
case FILE_TYPE_AUDIOFILTER:
case FILE_TYPE_CONFIG:

View File

@ -791,10 +791,6 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_x_offset_portrait, MEN
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_y_offset_portrait, MENU_ENUM_SUBLABEL_OVERLAY_Y_OFFSET_PORTRAIT)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_enable, MENU_ENUM_SUBLABEL_INPUT_OVERLAY_ENABLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_preset, MENU_ENUM_SUBLABEL_OVERLAY_PRESET)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_layout_enable, MENU_ENUM_SUBLABEL_VIDEO_LAYOUT_ENABLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_layout_path, MENU_ENUM_SUBLABEL_VIDEO_LAYOUT_PATH)
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_netplay_public_announce, MENU_ENUM_SUBLABEL_NETPLAY_PUBLIC_ANNOUNCE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_netplay_ip_address, MENU_ENUM_SUBLABEL_NETPLAY_IP_ADDRESS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_netplay_tcp_udp_port, MENU_ENUM_SUBLABEL_NETPLAY_TCP_UDP_PORT)
@ -1013,9 +1009,6 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_core_options_flush,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_controls, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CONTROLS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_shaders, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_show_overlays, MENU_ENUM_SUBLABEL_CONTENT_SHOW_OVERLAYS)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_show_video_layout, MENU_ENUM_SUBLABEL_CONTENT_SHOW_VIDEO_LAYOUT)
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_show_rewind, MENU_ENUM_SUBLABEL_CONTENT_SHOW_REWIND)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_show_latency, MENU_ENUM_SUBLABEL_CONTENT_SHOW_LATENCY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_save_core_overrides, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SAVE_CORE_OVERRIDES)
@ -1082,9 +1075,6 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_savefile_directory,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_savestate_directory, MENU_ENUM_SUBLABEL_SAVESTATE_DIRECTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_screenshot_directory, MENU_ENUM_SUBLABEL_SCREENSHOT_DIRECTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_directory, MENU_ENUM_SUBLABEL_OVERLAY_DIRECTORY)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_layout_directory, MENU_ENUM_SUBLABEL_VIDEO_LAYOUT_DIRECTORY)
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_audio_filter_directory, MENU_ENUM_SUBLABEL_AUDIO_FILTER_DIR)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_filter_directory, MENU_ENUM_SUBLABEL_VIDEO_FILTER_DIR)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_shader_directory, MENU_ENUM_SUBLABEL_VIDEO_SHADER_DIR)
@ -1146,9 +1136,6 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_midi_input,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_midi_output, MENU_ENUM_SUBLABEL_MIDI_OUTPUT)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_midi_volume, MENU_ENUM_SUBLABEL_MIDI_VOLUME)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_onscreen_overlay_settings_list, MENU_ENUM_SUBLABEL_ONSCREEN_OVERLAY_SETTINGS)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_onscreen_video_layout_settings_list, MENU_ENUM_SUBLABEL_ONSCREEN_VIDEO_LAYOUT_SETTINGS)
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_onscreen_notifications_settings_list, MENU_ENUM_SUBLABEL_ONSCREEN_NOTIFICATIONS_SETTINGS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_onscreen_notifications_views_settings_list, MENU_ENUM_SUBLABEL_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS)
#ifdef HAVE_QT
@ -2587,11 +2574,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_OVERLAY_DIRECTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_directory);
break;
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_VIDEO_LAYOUT_DIRECTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_layout_directory);
break;
#endif
case MENU_ENUM_LABEL_SCREENSHOT_DIRECTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_screenshot_directory);
break;
@ -2837,11 +2819,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CONTENT_SHOW_OVERLAYS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_show_overlays);
break;
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_CONTENT_SHOW_VIDEO_LAYOUT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_show_video_layout);
break;
#endif
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_SHADERS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_shaders);
break;
@ -3554,14 +3531,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_PORTRAIT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_y_offset_portrait);
break;
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_VIDEO_LAYOUT_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_layout_enable);
break;
case MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_layout_path);
break;
#endif
case MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_dsp_plugin);
break;
@ -4934,11 +4903,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_ONSCREEN_OVERLAY_SETTINGS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_onscreen_overlay_settings_list);
break;
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_ONSCREEN_VIDEO_LAYOUT_SETTINGS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_onscreen_video_layout_settings_list);
break;
#endif
case MENU_ENUM_LABEL_ONSCREEN_NOTIFICATIONS_SETTINGS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_onscreen_notifications_settings_list);
break;

View File

@ -638,9 +638,6 @@ DEFAULT_TITLE_MACRO(action_get_onscreen_display_settings_list, MENU_ENUM_LABEL_
DEFAULT_TITLE_MACRO(action_get_onscreen_notifications_settings_list, MENU_ENUM_LABEL_VALUE_ONSCREEN_NOTIFICATIONS_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_onscreen_notifications_views_settings_list, MENU_ENUM_LABEL_VALUE_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_onscreen_overlay_settings_list, MENU_ENUM_LABEL_VALUE_ONSCREEN_OVERLAY_SETTINGS)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_TITLE_MACRO(action_get_onscreen_video_layout_settings_list, MENU_ENUM_LABEL_VALUE_ONSCREEN_VIDEO_LAYOUT_SETTINGS)
#endif
DEFAULT_TITLE_MACRO(action_get_menu_views_settings_list, MENU_ENUM_LABEL_VALUE_MENU_VIEWS_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_settings_views_settings_list, MENU_ENUM_LABEL_VALUE_SETTINGS_VIEWS_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_quick_menu_views_settings_list, MENU_ENUM_LABEL_VALUE_QUICK_MENU_VIEWS_SETTINGS)
@ -748,9 +745,6 @@ DEFAULT_FILL_TITLE_MACRO(action_get_title_audio_filter_directory, MENU_ENUM_LABE
DEFAULT_FILL_TITLE_MACRO(action_get_title_video_filter_directory, MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_DIR)
DEFAULT_FILL_TITLE_MACRO(action_get_title_savefile_directory, MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY)
DEFAULT_FILL_TITLE_MACRO(action_get_title_overlay_directory, MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY)
#ifdef HAVE_VIDEO_LAYOUT
DEFAULT_FILL_TITLE_MACRO(action_get_title_video_layout_directory, MENU_ENUM_LABEL_VALUE_VIDEO_LAYOUT_DIRECTORY)
#endif
DEFAULT_FILL_TITLE_MACRO(action_get_title_system_directory, MENU_ENUM_LABEL_VALUE_SYSTEM_DIRECTORY)
DEFAULT_FILL_TITLE_MACRO(action_get_title_assets_directory, MENU_ENUM_LABEL_VALUE_ASSETS_DIRECTORY)
DEFAULT_FILL_TITLE_MACRO(action_get_title_extraction_directory, MENU_ENUM_LABEL_VALUE_CACHE_DIRECTORY)
@ -1001,9 +995,6 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_DEFERRED_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST, action_get_onscreen_notifications_settings_list},
{MENU_ENUM_LABEL_DEFERRED_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS_LIST, action_get_onscreen_notifications_views_settings_list},
{MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST, action_get_onscreen_overlay_settings_list},
#ifdef HAVE_VIDEO_LAYOUT
{MENU_ENUM_LABEL_DEFERRED_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST, action_get_onscreen_video_layout_settings_list},
#endif
{MENU_ENUM_LABEL_DEFERRED_MENU_VIEWS_SETTINGS_LIST, action_get_menu_views_settings_list},
{MENU_ENUM_LABEL_DEFERRED_SETTINGS_VIEWS_SETTINGS_LIST, action_get_settings_views_settings_list},
{MENU_ENUM_LABEL_DEFERRED_QUICK_MENU_VIEWS_SETTINGS_LIST, action_get_quick_menu_views_settings_list},
@ -1114,10 +1105,6 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
action_get_title_savefile_directory},
{MENU_ENUM_LABEL_OVERLAY_DIRECTORY,
action_get_title_overlay_directory},
#ifdef HAVE_VIDEO_LAYOUT
{MENU_ENUM_LABEL_VIDEO_LAYOUT_DIRECTORY,
action_get_title_video_layout_directory},
#endif
{MENU_ENUM_LABEL_RGUI_BROWSER_DIRECTORY,
action_get_title_browser_directory},
{MENU_ENUM_LABEL_USE_LAST_START_DIRECTORY,
@ -1413,11 +1400,6 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_OVERLAY_DIRECTORY:
BIND_ACTION_GET_TITLE(cbs, action_get_title_overlay_directory);
break;
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_VIDEO_LAYOUT_DIRECTORY:
BIND_ACTION_GET_TITLE(cbs, action_get_title_video_layout_directory);
break;
#endif
case MENU_ENUM_LABEL_RGUI_BROWSER_DIRECTORY:
BIND_ACTION_GET_TITLE(cbs, action_get_title_browser_directory);
break;
@ -1621,11 +1603,6 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_onscreen_overlay_settings_list);
break;
#ifdef HAVE_VIDEO_LAYOUT
case MENU_ENUM_LABEL_DEFERRED_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_onscreen_video_layout_settings_list);
break;
#endif
case MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_core_settings_list);
break;

View File

@ -10818,9 +10818,6 @@ static void materialui_list_insert(
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_VIEWS_SETTINGS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_MENU_SETTINGS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ONSCREEN_OVERLAY_SETTINGS)) ||
#ifdef HAVE_VIDEO_LAYOUT
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ONSCREEN_VIDEO_LAYOUT_SETTINGS)) ||
#endif
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ONSCREEN_NOTIFICATIONS_SETTINGS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ONSCREEN_NOTIFICATIONS_VIEWS_SETTINGS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ACCOUNTS_LIST)) ||

Some files were not shown because too many files have changed in this diff Show More