2014-10-09 01:21:22 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2017-01-22 13:40:32 +01:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2018-11-26 00:13:11 +01:00
|
|
|
* Copyright (C) 2014-2017 - Jean-André Santoni
|
2017-01-22 13:40:32 +01:00
|
|
|
* Copyright (C) 2016-2017 - Brad Parker
|
2018-11-26 00:13:11 +01:00
|
|
|
* Copyright (C) 2018 - Alfredo Monclús
|
2014-10-09 01:21:22 +02:00
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stddef.h>
|
2014-10-16 07:27:42 +02:00
|
|
|
#include <stdint.h>
|
2014-10-09 01:21:22 +02:00
|
|
|
#include <string.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
2015-06-05 18:22:15 +02:00
|
|
|
#include <file/file_path.h>
|
|
|
|
#include <compat/posix_string.h>
|
2015-11-08 01:30:07 +01:00
|
|
|
#include <compat/strl.h>
|
|
|
|
#include <formats/image.h>
|
2015-06-05 18:22:15 +02:00
|
|
|
#include <string/stdstring.h>
|
2016-03-20 14:53:54 +01:00
|
|
|
#include <lists/string_list.h>
|
2015-11-08 01:30:07 +01:00
|
|
|
#include <gfx/math/matrix_4x4.h>
|
2017-12-14 20:05:46 +01:00
|
|
|
#include <streams/file_stream.h>
|
2016-08-23 19:16:18 -04:00
|
|
|
#include <encodings/utf.h>
|
2016-12-19 15:49:11 -05:00
|
|
|
#include <features/features_cpu.h>
|
2015-06-04 22:46:23 +02:00
|
|
|
|
2016-09-08 06:00:45 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-09-15 16:07:20 +02:00
|
|
|
#include "../../frontend/frontend_driver.h"
|
|
|
|
|
2015-10-03 03:15:47 +02:00
|
|
|
#include "menu_generic.h"
|
|
|
|
|
2015-06-04 10:39:48 +02:00
|
|
|
#include "../menu_driver.h"
|
2015-02-11 03:52:35 +01:00
|
|
|
#include "../menu_animation.h"
|
2018-09-25 16:46:15 +02:00
|
|
|
#include "../menu_entries.h"
|
|
|
|
#include "../menu_input.h"
|
2015-02-11 03:52:35 +01:00
|
|
|
|
2017-08-16 01:10:27 +02:00
|
|
|
#include "../../core_info.h"
|
|
|
|
#include "../../core.h"
|
2018-09-25 16:46:15 +02:00
|
|
|
|
2016-09-15 16:07:20 +02:00
|
|
|
#include "../widgets/menu_entry.h"
|
2016-09-15 19:26:04 +02:00
|
|
|
#include "../widgets/menu_input_dialog.h"
|
2017-01-12 11:31:24 +01:00
|
|
|
#include "../widgets/menu_osk.h"
|
2017-05-15 13:05:33 +02:00
|
|
|
#include "../widgets/menu_filebrowser.h"
|
2016-09-15 00:10:37 +02:00
|
|
|
|
2015-11-23 12:03:38 +01:00
|
|
|
#include "../../verbosity.h"
|
2018-10-29 21:23:53 -05:00
|
|
|
#include "../../dynamic.h"
|
2015-11-08 01:30:07 +01:00
|
|
|
#include "../../configuration.h"
|
2016-11-27 23:16:45 +01:00
|
|
|
#include "../../playlist.h"
|
2017-05-11 09:11:46 +02:00
|
|
|
#include "../../retroarch.h"
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2019-01-20 03:16:58 +01:00
|
|
|
#include "../../tasks/task_powerstate.h"
|
2016-02-09 17:12:39 +01:00
|
|
|
#include "../../tasks/tasks_internal.h"
|
2015-04-13 18:59:39 +02:00
|
|
|
|
2017-10-21 17:48:26 -04:00
|
|
|
#include "../../cheevos/badges.h"
|
2018-02-11 10:00:08 -05:00
|
|
|
#include "../../content.h"
|
2017-10-21 17:48:26 -04:00
|
|
|
|
2016-04-23 05:24:44 +07:00
|
|
|
#define XMB_RIBBON_ROWS 64
|
|
|
|
#define XMB_RIBBON_COLS 64
|
2016-04-19 23:00:55 +02:00
|
|
|
#define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS
|
2016-04-16 21:09:54 +02:00
|
|
|
|
2014-10-09 02:41:08 +02:00
|
|
|
#ifndef XMB_DELAY
|
2019-02-14 11:58:27 +01:00
|
|
|
#define XMB_DELAY 166
|
2014-10-09 02:41:08 +02:00
|
|
|
#endif
|
|
|
|
|
2016-12-19 15:49:11 -05:00
|
|
|
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
|
|
|
|
|
2016-12-12 03:28:55 +01:00
|
|
|
#if 0
|
2016-12-12 03:20:00 +01:00
|
|
|
#define XMB_DEBUG
|
|
|
|
#endif
|
|
|
|
|
2017-08-12 22:06:46 -03:00
|
|
|
/* NOTE: If you change this you HAVE to update
|
|
|
|
* xmb_alloc_node() and xmb_copy_node() */
|
2014-10-09 02:41:08 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
float alpha;
|
2014-10-20 20:00:39 +02:00
|
|
|
float label_alpha;
|
2014-10-09 02:41:08 +02:00
|
|
|
float zoom;
|
2014-10-20 20:00:39 +02:00
|
|
|
float x;
|
2014-10-09 02:41:08 +02:00
|
|
|
float y;
|
2015-11-08 01:30:07 +01:00
|
|
|
uintptr_t icon;
|
|
|
|
uintptr_t content_icon;
|
2017-08-29 22:19:19 -03:00
|
|
|
char *fullpath;
|
2014-10-09 02:41:08 +02:00
|
|
|
} xmb_node_t;
|
|
|
|
|
2014-10-09 04:34:16 +02:00
|
|
|
enum
|
|
|
|
{
|
2015-10-20 19:11:43 +07:00
|
|
|
XMB_TEXTURE_MAIN_MENU = 0,
|
|
|
|
XMB_TEXTURE_SETTINGS,
|
2015-10-23 01:05:51 +07:00
|
|
|
XMB_TEXTURE_HISTORY,
|
2017-08-12 16:37:20 +02:00
|
|
|
XMB_TEXTURE_FAVORITES,
|
2016-07-30 19:29:10 +02:00
|
|
|
XMB_TEXTURE_MUSICS,
|
2018-06-20 04:50:58 +02:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2016-07-31 01:47:58 +02:00
|
|
|
XMB_TEXTURE_MOVIES,
|
2016-07-30 19:29:10 +02:00
|
|
|
#endif
|
2017-01-18 22:46:48 -05:00
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
XMB_TEXTURE_NETPLAY,
|
2017-02-27 22:48:27 +01:00
|
|
|
XMB_TEXTURE_ROOM,
|
2017-07-09 18:19:56 -05:00
|
|
|
XMB_TEXTURE_ROOM_LAN,
|
2018-10-09 19:52:04 -03:00
|
|
|
XMB_TEXTURE_ROOM_RELAY,
|
2017-01-18 22:46:48 -05:00
|
|
|
#endif
|
2016-07-30 19:29:10 +02:00
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
XMB_TEXTURE_IMAGES,
|
|
|
|
#endif
|
2014-10-09 22:59:05 +02:00
|
|
|
XMB_TEXTURE_SETTING,
|
|
|
|
XMB_TEXTURE_SUBSETTING,
|
|
|
|
XMB_TEXTURE_ARROW,
|
|
|
|
XMB_TEXTURE_RUN,
|
2015-06-25 11:14:22 +07:00
|
|
|
XMB_TEXTURE_CLOSE,
|
2014-10-09 22:59:05 +02:00
|
|
|
XMB_TEXTURE_RESUME,
|
|
|
|
XMB_TEXTURE_SAVESTATE,
|
|
|
|
XMB_TEXTURE_LOADSTATE,
|
2016-09-13 22:58:52 +02:00
|
|
|
XMB_TEXTURE_UNDO,
|
2015-02-17 23:43:34 +01:00
|
|
|
XMB_TEXTURE_CORE_INFO,
|
2016-09-22 12:36:36 +02:00
|
|
|
XMB_TEXTURE_WIFI,
|
2015-02-17 23:43:34 +01:00
|
|
|
XMB_TEXTURE_CORE_OPTIONS,
|
|
|
|
XMB_TEXTURE_INPUT_REMAPPING_OPTIONS,
|
|
|
|
XMB_TEXTURE_CHEAT_OPTIONS,
|
|
|
|
XMB_TEXTURE_DISK_OPTIONS,
|
2015-06-25 11:47:20 +07:00
|
|
|
XMB_TEXTURE_SHADER_OPTIONS,
|
2015-11-19 15:14:19 +07:00
|
|
|
XMB_TEXTURE_ACHIEVEMENT_LIST,
|
2014-10-09 22:59:05 +02:00
|
|
|
XMB_TEXTURE_SCREENSHOT,
|
|
|
|
XMB_TEXTURE_RELOAD,
|
2017-08-18 18:30:31 +07:00
|
|
|
XMB_TEXTURE_RENAME,
|
2014-10-14 23:05:53 +02:00
|
|
|
XMB_TEXTURE_FILE,
|
|
|
|
XMB_TEXTURE_FOLDER,
|
|
|
|
XMB_TEXTURE_ZIP,
|
2017-08-12 17:27:31 +02:00
|
|
|
XMB_TEXTURE_FAVORITE,
|
2017-08-14 00:12:55 +02:00
|
|
|
XMB_TEXTURE_ADD_FAVORITE,
|
2015-06-30 23:07:22 +07:00
|
|
|
XMB_TEXTURE_MUSIC,
|
2015-07-01 19:53:34 +07:00
|
|
|
XMB_TEXTURE_IMAGE,
|
2015-07-04 07:14:26 +07:00
|
|
|
XMB_TEXTURE_MOVIE,
|
2014-10-18 16:26:02 +02:00
|
|
|
XMB_TEXTURE_CORE,
|
2015-02-03 00:27:18 +01:00
|
|
|
XMB_TEXTURE_RDB,
|
|
|
|
XMB_TEXTURE_CURSOR,
|
2014-10-22 02:41:28 +02:00
|
|
|
XMB_TEXTURE_SWITCH_ON,
|
|
|
|
XMB_TEXTURE_SWITCH_OFF,
|
2015-02-04 22:44:33 +01:00
|
|
|
XMB_TEXTURE_CLOCK,
|
2016-12-19 15:31:10 -05:00
|
|
|
XMB_TEXTURE_BATTERY_FULL,
|
2016-12-19 14:28:21 -05:00
|
|
|
XMB_TEXTURE_BATTERY_CHARGING,
|
2015-03-09 00:14:55 +01:00
|
|
|
XMB_TEXTURE_POINTER,
|
2015-10-25 00:37:59 +07:00
|
|
|
XMB_TEXTURE_ADD,
|
2016-11-03 08:55:24 +01:00
|
|
|
XMB_TEXTURE_KEY,
|
|
|
|
XMB_TEXTURE_KEY_HOVER,
|
2017-02-27 20:34:17 +01:00
|
|
|
XMB_TEXTURE_DIALOG_SLICE,
|
2018-08-08 18:47:42 -03:00
|
|
|
XMB_TEXTURE_ACHIEVEMENTS,
|
|
|
|
XMB_TEXTURE_AUDIO,
|
|
|
|
XMB_TEXTURE_EXIT,
|
|
|
|
XMB_TEXTURE_FRAMESKIP,
|
|
|
|
XMB_TEXTURE_INFO,
|
|
|
|
XMB_TEXTURE_HELP,
|
|
|
|
XMB_TEXTURE_NETWORK,
|
|
|
|
XMB_TEXTURE_POWER,
|
|
|
|
XMB_TEXTURE_SAVING,
|
|
|
|
XMB_TEXTURE_UPDATER,
|
|
|
|
XMB_TEXTURE_VIDEO,
|
|
|
|
XMB_TEXTURE_RECORD,
|
2018-11-04 13:58:22 -03:00
|
|
|
XMB_TEXTURE_INPUT_SETTINGS,
|
2018-08-08 18:47:42 -03:00
|
|
|
XMB_TEXTURE_MIXER,
|
|
|
|
XMB_TEXTURE_LOG,
|
|
|
|
XMB_TEXTURE_OSD,
|
|
|
|
XMB_TEXTURE_UI,
|
|
|
|
XMB_TEXTURE_USER,
|
|
|
|
XMB_TEXTURE_PRIVACY,
|
|
|
|
XMB_TEXTURE_LATENCY,
|
|
|
|
XMB_TEXTURE_DRIVERS,
|
|
|
|
XMB_TEXTURE_PLAYLIST,
|
|
|
|
XMB_TEXTURE_QUICKMENU,
|
|
|
|
XMB_TEXTURE_REWIND,
|
|
|
|
XMB_TEXTURE_OVERLAY,
|
|
|
|
XMB_TEXTURE_OVERRIDE,
|
|
|
|
XMB_TEXTURE_NOTIFICATIONS,
|
2018-09-27 17:18:04 -03:00
|
|
|
XMB_TEXTURE_STREAM,
|
2018-11-04 15:11:19 -03:00
|
|
|
XMB_TEXTURE_SHUTDOWN,
|
2018-11-04 13:58:22 -03:00
|
|
|
XMB_TEXTURE_INPUT_DPAD_U,
|
|
|
|
XMB_TEXTURE_INPUT_DPAD_D,
|
|
|
|
XMB_TEXTURE_INPUT_DPAD_L,
|
|
|
|
XMB_TEXTURE_INPUT_DPAD_R,
|
|
|
|
XMB_TEXTURE_INPUT_STCK_U,
|
|
|
|
XMB_TEXTURE_INPUT_STCK_D,
|
|
|
|
XMB_TEXTURE_INPUT_STCK_L,
|
|
|
|
XMB_TEXTURE_INPUT_STCK_R,
|
|
|
|
XMB_TEXTURE_INPUT_STCK_P,
|
|
|
|
XMB_TEXTURE_INPUT_SELECT,
|
|
|
|
XMB_TEXTURE_INPUT_START,
|
|
|
|
XMB_TEXTURE_INPUT_BTN_U,
|
|
|
|
XMB_TEXTURE_INPUT_BTN_D,
|
|
|
|
XMB_TEXTURE_INPUT_BTN_L,
|
|
|
|
XMB_TEXTURE_INPUT_BTN_R,
|
|
|
|
XMB_TEXTURE_INPUT_LB,
|
|
|
|
XMB_TEXTURE_INPUT_RB,
|
|
|
|
XMB_TEXTURE_INPUT_LT,
|
|
|
|
XMB_TEXTURE_INPUT_RT,
|
2019-01-03 11:02:15 -03:00
|
|
|
XMB_TEXTURE_INPUT_ADC,
|
|
|
|
XMB_TEXTURE_INPUT_BIND_ALL,
|
|
|
|
XMB_TEXTURE_INPUT_MOUSE,
|
|
|
|
XMB_TEXTURE_INPUT_LGUN,
|
|
|
|
XMB_TEXTURE_INPUT_TURBO,
|
2018-11-06 22:48:38 -03:00
|
|
|
XMB_TEXTURE_CHECKMARK,
|
2018-11-24 13:21:43 -03:00
|
|
|
XMB_TEXTURE_MENU_ADD,
|
|
|
|
XMB_TEXTURE_BRIGHTNESS,
|
|
|
|
XMB_TEXTURE_PAUSE,
|
2018-11-29 14:47:46 -03:00
|
|
|
XMB_TEXTURE_DEFAULT,
|
|
|
|
XMB_TEXTURE_DEFAULT_CONTENT,
|
2018-11-30 18:10:28 -03:00
|
|
|
XMB_TEXTURE_MENU_APPLY_TOGGLE,
|
|
|
|
XMB_TEXTURE_MENU_APPLY_COG,
|
2014-10-09 22:59:05 +02:00
|
|
|
XMB_TEXTURE_LAST
|
2014-10-09 04:34:16 +02:00
|
|
|
};
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2016-08-17 15:07:17 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
XMB_SYSTEM_TAB_MAIN = 0,
|
|
|
|
XMB_SYSTEM_TAB_SETTINGS,
|
2016-08-21 00:09:29 -05:00
|
|
|
XMB_SYSTEM_TAB_HISTORY,
|
2017-08-12 16:37:20 +02:00
|
|
|
XMB_SYSTEM_TAB_FAVORITES,
|
2016-08-21 00:09:29 -05:00
|
|
|
XMB_SYSTEM_TAB_MUSIC,
|
2018-06-20 04:50:58 +02:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2016-12-12 03:54:53 -06:00
|
|
|
XMB_SYSTEM_TAB_VIDEO,
|
2016-08-21 00:09:29 -05:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
XMB_SYSTEM_TAB_IMAGES,
|
2016-08-17 15:07:17 +02:00
|
|
|
#endif
|
2017-01-18 22:46:48 -05:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-02-27 22:36:45 +01:00
|
|
|
XMB_SYSTEM_TAB_NETPLAY,
|
2017-01-18 22:46:48 -05:00
|
|
|
#endif
|
2017-11-06 20:20:14 +00:00
|
|
|
XMB_SYSTEM_TAB_ADD,
|
|
|
|
|
|
|
|
/* End of this enum - use the last one to determine num of possible tabs */
|
|
|
|
XMB_SYSTEM_TAB_MAX_LENGTH
|
2016-08-17 15:07:17 +02:00
|
|
|
};
|
|
|
|
|
2014-10-09 04:34:16 +02:00
|
|
|
typedef struct xmb_handle
|
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
bool mouse_show;
|
2018-04-24 17:47:02 +02:00
|
|
|
bool use_ps3_layout;
|
2018-11-29 14:47:46 -03:00
|
|
|
bool assets_missing;
|
2017-09-28 08:42:12 +02:00
|
|
|
|
|
|
|
uint8_t system_tab_end;
|
2017-11-06 20:20:14 +00:00
|
|
|
uint8_t tabs[XMB_SYSTEM_TAB_MAX_LENGTH];
|
2017-09-28 08:42:12 +02:00
|
|
|
|
2014-10-10 22:42:56 +02:00
|
|
|
int depth;
|
2014-10-12 01:27:31 +02:00
|
|
|
int old_depth;
|
2017-09-28 08:42:12 +02:00
|
|
|
int icon_size;
|
|
|
|
int cursor_size;
|
|
|
|
|
|
|
|
size_t categories_selection_ptr;
|
|
|
|
size_t categories_selection_ptr_old;
|
|
|
|
size_t selection_ptr_old;
|
|
|
|
|
|
|
|
unsigned categories_active_idx;
|
|
|
|
unsigned categories_active_idx_old;
|
2016-04-08 01:42:53 +07:00
|
|
|
uintptr_t thumbnail;
|
2018-03-25 12:27:17 -03:00
|
|
|
uintptr_t left_thumbnail;
|
2016-12-01 02:43:53 +01:00
|
|
|
uintptr_t savestate_thumbnail;
|
2017-09-28 08:42:12 +02:00
|
|
|
|
|
|
|
float x;
|
|
|
|
float alpha;
|
2016-04-08 01:42:53 +07:00
|
|
|
float thumbnail_width;
|
|
|
|
float thumbnail_height;
|
2018-03-25 12:27:17 -03:00
|
|
|
float left_thumbnail_width;
|
|
|
|
float left_thumbnail_height;
|
2016-12-01 02:43:53 +01:00
|
|
|
float savestate_thumbnail_width;
|
|
|
|
float savestate_thumbnail_height;
|
2016-05-09 04:05:11 +07:00
|
|
|
float above_subitem_offset;
|
|
|
|
float above_item_offset;
|
|
|
|
float active_item_factor;
|
|
|
|
float under_item_offset;
|
2016-05-09 03:57:02 +07:00
|
|
|
float shadow_offset;
|
2017-09-28 08:42:12 +02:00
|
|
|
float font_size;
|
|
|
|
float font2_size;
|
2018-11-25 03:01:41 +01:00
|
|
|
float previous_scale_factor;
|
2017-09-28 08:42:12 +02:00
|
|
|
|
|
|
|
float margins_screen_left;
|
|
|
|
float margins_screen_top;
|
|
|
|
float margins_setting_left;
|
|
|
|
float margins_title_left;
|
|
|
|
float margins_title_top;
|
|
|
|
float margins_title_bottom;
|
|
|
|
float margins_label_left;
|
|
|
|
float margins_label_top;
|
|
|
|
float icon_spacing_horizontal;
|
|
|
|
float icon_spacing_vertical;
|
|
|
|
float items_active_alpha;
|
|
|
|
float items_active_zoom;
|
|
|
|
float items_passive_alpha;
|
|
|
|
float items_passive_zoom;
|
|
|
|
float margins_dialog;
|
|
|
|
float margins_slice;
|
|
|
|
float textures_arrow_alpha;
|
|
|
|
float categories_x_pos;
|
|
|
|
float categories_passive_alpha;
|
|
|
|
float categories_passive_zoom;
|
|
|
|
float categories_active_zoom;
|
|
|
|
float categories_active_alpha;
|
|
|
|
|
2016-10-27 09:13:36 +02:00
|
|
|
char title_name[255];
|
2017-09-29 19:55:06 +02:00
|
|
|
char *box_message;
|
|
|
|
char *thumbnail_system;
|
2017-09-29 18:37:04 +02:00
|
|
|
char *thumbnail_content;
|
2017-09-29 19:55:06 +02:00
|
|
|
char *savestate_thumbnail_file_path;
|
2018-01-23 05:38:02 +01:00
|
|
|
char *thumbnail_file_path;
|
2018-03-25 12:27:17 -03:00
|
|
|
char *left_thumbnail_file_path;
|
2018-01-23 05:56:41 +01:00
|
|
|
char *bg_file_path;
|
2017-09-28 08:42:12 +02:00
|
|
|
|
|
|
|
file_list_t *selection_buf_old;
|
|
|
|
file_list_t *horizontal_list;
|
2015-02-12 18:34:36 +01:00
|
|
|
|
2016-03-09 16:17:18 -05:00
|
|
|
struct
|
2015-02-12 19:27:13 +01:00
|
|
|
{
|
2016-03-05 08:40:28 +01:00
|
|
|
menu_texture_item bg;
|
|
|
|
menu_texture_item list[XMB_TEXTURE_LAST];
|
2015-02-12 19:27:13 +01:00
|
|
|
} textures;
|
|
|
|
|
2015-10-20 19:11:43 +07:00
|
|
|
xmb_node_t main_menu_node;
|
2016-07-30 19:29:10 +02:00
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
xmb_node_t images_tab_node;
|
|
|
|
#endif
|
2017-05-27 23:56:10 +02:00
|
|
|
xmb_node_t music_tab_node;
|
2018-06-20 04:50:58 +02:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2016-07-30 19:29:10 +02:00
|
|
|
xmb_node_t video_tab_node;
|
|
|
|
#endif
|
2015-10-20 19:11:43 +07:00
|
|
|
xmb_node_t settings_tab_node;
|
2015-10-23 01:05:51 +07:00
|
|
|
xmb_node_t history_tab_node;
|
2017-08-12 16:37:20 +02:00
|
|
|
xmb_node_t favorites_tab_node;
|
2015-10-25 00:37:59 +07:00
|
|
|
xmb_node_t add_tab_node;
|
2017-01-18 22:46:48 -05:00
|
|
|
xmb_node_t netplay_tab_node;
|
2015-03-25 11:04:53 -03:00
|
|
|
|
2016-10-18 20:36:54 -03:00
|
|
|
font_data_t *font;
|
2016-10-20 09:52:17 +02:00
|
|
|
font_data_t *font2;
|
2016-05-10 02:42:02 +02:00
|
|
|
video_font_raster_block_t raster_block;
|
2016-10-20 09:52:17 +02:00
|
|
|
video_font_raster_block_t raster_block2;
|
2014-10-09 04:34:16 +02:00
|
|
|
} xmb_handle_t;
|
|
|
|
|
2018-02-27 19:01:15 +01:00
|
|
|
float scale_mod[8] = {
|
2018-03-30 23:53:16 +02:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1
|
2018-02-27 19:01:15 +01:00
|
|
|
};
|
|
|
|
|
2017-09-09 06:52:49 +02:00
|
|
|
static float coord_shadow[] = {
|
2018-06-22 22:31:06 +07:00
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0,
|
2017-09-09 06:52:49 +02:00
|
|
|
0, 0, 0, 0
|
|
|
|
};
|
|
|
|
|
|
|
|
static float coord_black[] = {
|
2018-06-22 22:31:06 +07:00
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0,
|
2017-09-09 06:52:49 +02:00
|
|
|
0, 0, 0, 0
|
|
|
|
};
|
|
|
|
|
|
|
|
static float coord_white[] = {
|
2018-06-22 22:31:06 +07:00
|
|
|
1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1,
|
2017-09-09 06:52:49 +02:00
|
|
|
1, 1, 1, 1
|
|
|
|
};
|
|
|
|
|
|
|
|
static float item_color[] = {
|
2018-06-22 22:31:06 +07:00
|
|
|
1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1,
|
2017-09-09 06:52:49 +02:00
|
|
|
1, 1, 1, 1
|
|
|
|
};
|
|
|
|
|
2016-04-22 15:20:08 +07:00
|
|
|
float gradient_dark_purple[16] = {
|
2018-04-23 12:03:50 +02:00
|
|
|
20/255.0, 13/255.0, 20/255.0, 1.0,
|
|
|
|
20/255.0, 13/255.0, 20/255.0, 1.0,
|
|
|
|
92/255.0, 44/255.0, 92/255.0, 1.0,
|
2016-04-22 15:20:08 +07:00
|
|
|
148/255.0, 90/255.0, 148/255.0, 1.0,
|
2016-04-22 13:47:14 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
float gradient_midnight_blue[16] = {
|
|
|
|
44/255.0, 62/255.0, 80/255.0, 1.0,
|
|
|
|
44/255.0, 62/255.0, 80/255.0, 1.0,
|
|
|
|
44/255.0, 62/255.0, 80/255.0, 1.0,
|
|
|
|
44/255.0, 62/255.0, 80/255.0, 1.0,
|
|
|
|
};
|
|
|
|
|
2016-04-22 15:20:08 +07:00
|
|
|
float gradient_golden[16] = {
|
|
|
|
174/255.0, 123/255.0, 44/255.0, 1.0,
|
|
|
|
205/255.0, 174/255.0, 84/255.0, 1.0,
|
|
|
|
58/255.0, 43/255.0, 24/255.0, 1.0,
|
|
|
|
58/255.0, 43/255.0, 24/255.0, 1.0,
|
2016-04-22 13:47:14 +07:00
|
|
|
};
|
|
|
|
|
2016-04-22 15:20:08 +07:00
|
|
|
float gradient_legacy_red[16] = {
|
|
|
|
171/255.0, 70/255.0, 59/255.0, 1.0,
|
|
|
|
171/255.0, 70/255.0, 59/255.0, 1.0,
|
|
|
|
190/255.0, 80/255.0, 69/255.0, 1.0,
|
|
|
|
190/255.0, 80/255.0, 69/255.0, 1.0,
|
|
|
|
};
|
|
|
|
|
|
|
|
float gradient_electric_blue[16] = {
|
2018-04-23 12:03:50 +02:00
|
|
|
1/255.0, 2/255.0, 67/255.0, 1.0,
|
|
|
|
1/255.0, 73/255.0, 183/255.0, 1.0,
|
|
|
|
1/255.0, 93/255.0, 194/255.0, 1.0,
|
|
|
|
3/255.0, 162/255.0, 254/255.0, 1.0,
|
2016-04-22 15:20:08 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
float gradient_apple_green[16] = {
|
|
|
|
102/255.0, 134/255.0, 58/255.0, 1.0,
|
|
|
|
122/255.0, 131/255.0, 52/255.0, 1.0,
|
2018-04-23 12:03:50 +02:00
|
|
|
82/255.0, 101/255.0, 35/255.0, 1.0,
|
|
|
|
63/255.0, 95/255.0, 30/255.0, 1.0,
|
2016-04-22 15:20:08 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
float gradient_undersea[16] = {
|
2018-04-23 12:03:50 +02:00
|
|
|
23/255.0, 18/255.0, 41/255.0, 1.0,
|
|
|
|
30/255.0, 72/255.0, 114/255.0, 1.0,
|
|
|
|
52/255.0, 88/255.0, 110/255.0, 1.0,
|
|
|
|
69/255.0, 125/255.0, 140/255.0, 1.0,
|
2016-04-22 15:20:08 +07:00
|
|
|
|
2016-04-22 13:47:14 +07:00
|
|
|
};
|
|
|
|
|
2016-04-22 18:16:31 +07:00
|
|
|
float gradient_volcanic_red[16] = {
|
|
|
|
1.0, 0.0, 0.1, 1.00,
|
|
|
|
1.0, 0.1, 0.0, 1.00,
|
|
|
|
0.1, 0.0, 0.1, 1.00,
|
|
|
|
0.1, 0.0, 0.1, 1.00,
|
|
|
|
};
|
|
|
|
|
2016-04-29 05:06:32 +07:00
|
|
|
float gradient_dark[16] = {
|
|
|
|
0.1, 0.1, 0.1, 1.00,
|
|
|
|
0.1, 0.1, 0.1, 1.00,
|
|
|
|
0.0, 0.0, 0.0, 1.00,
|
|
|
|
0.0, 0.0, 0.0, 1.00,
|
|
|
|
};
|
|
|
|
|
2017-12-27 17:33:39 -05:00
|
|
|
float gradient_light[16] = {
|
2017-12-27 19:41:46 -05:00
|
|
|
1.0, 1.0, 1.0, 1.00,
|
|
|
|
1.0, 1.0, 1.0, 1.00,
|
2017-12-27 17:33:39 -05:00
|
|
|
1.0, 1.0, 1.0, 1.00,
|
|
|
|
1.0, 1.0, 1.0, 1.00,
|
|
|
|
};
|
|
|
|
|
2018-03-11 20:37:49 -04:00
|
|
|
float gradient_morning_blue[16] = {
|
|
|
|
221/255.0, 241/255.0, 254/255.0, 1.00,
|
|
|
|
135/255.0, 206/255.0, 250/255.0, 1.00,
|
|
|
|
1.0, 1.0, 1.0, 1.00,
|
|
|
|
170/255.0, 200/255.0, 252/255.0, 1.00,
|
|
|
|
};
|
|
|
|
|
2017-08-30 22:23:29 -03:00
|
|
|
static void xmb_calculate_visible_range(const xmb_handle_t *xmb,
|
|
|
|
unsigned height, size_t list_size, unsigned current,
|
|
|
|
unsigned *first, unsigned *last);
|
|
|
|
|
2017-01-14 04:06:56 -05:00
|
|
|
const char* xmb_theme_ident(void)
|
2016-03-22 02:54:16 +07:00
|
|
|
{
|
|
|
|
settings_t *settings = config_get_ptr();
|
2017-04-28 21:03:04 +02:00
|
|
|
switch (settings->uints.menu_xmb_theme)
|
2016-03-22 02:54:16 +07:00
|
|
|
{
|
2016-07-14 21:24:33 +02:00
|
|
|
case XMB_ICON_THEME_FLATUI:
|
2016-03-22 02:54:16 +07:00
|
|
|
return "flatui";
|
2016-07-14 21:24:33 +02:00
|
|
|
case XMB_ICON_THEME_RETROACTIVE:
|
2016-04-09 12:46:40 +07:00
|
|
|
return "retroactive";
|
2017-11-17 19:42:03 -03:00
|
|
|
case XMB_ICON_THEME_RETROSYSTEM:
|
|
|
|
return "retrosystem";
|
2016-07-14 21:24:33 +02:00
|
|
|
case XMB_ICON_THEME_PIXEL:
|
2016-05-09 03:45:38 +07:00
|
|
|
return "pixel";
|
2016-10-31 21:15:33 +01:00
|
|
|
case XMB_ICON_THEME_NEOACTIVE:
|
|
|
|
return "neoactive";
|
2016-12-08 23:39:39 -06:00
|
|
|
case XMB_ICON_THEME_SYSTEMATIC:
|
|
|
|
return "systematic";
|
2017-01-30 21:13:44 -05:00
|
|
|
case XMB_ICON_THEME_DOTART:
|
|
|
|
return "dot-art";
|
2016-07-14 21:24:33 +02:00
|
|
|
case XMB_ICON_THEME_CUSTOM:
|
2016-03-22 02:54:16 +07:00
|
|
|
return "custom";
|
2017-12-28 09:10:58 -05:00
|
|
|
case XMB_ICON_THEME_MONOCHROME_INVERTED:
|
2019-01-25 10:17:17 -03:00
|
|
|
return "monochrome";
|
2018-08-23 16:41:07 -03:00
|
|
|
case XMB_ICON_THEME_AUTOMATIC:
|
|
|
|
return "automatic";
|
2019-01-25 10:17:17 -03:00
|
|
|
case XMB_ICON_THEME_AUTOMATIC_INVERTED:
|
|
|
|
return "automatic";
|
2016-07-14 21:24:33 +02:00
|
|
|
case XMB_ICON_THEME_MONOCHROME:
|
2016-03-22 02:54:16 +07:00
|
|
|
default:
|
2016-03-21 21:18:25 +01:00
|
|
|
break;
|
2016-03-22 02:54:16 +07:00
|
|
|
}
|
2016-03-21 21:18:25 +01:00
|
|
|
return "monochrome";
|
2016-03-22 02:54:16 +07:00
|
|
|
}
|
|
|
|
|
2017-08-12 22:06:46 -03:00
|
|
|
/* NOTE: This exists because calloc()ing xmb_node_t is expensive
|
|
|
|
* when you can have big lists like MAME and fba playlists */
|
|
|
|
static xmb_node_t *xmb_alloc_node(void)
|
|
|
|
{
|
|
|
|
xmb_node_t *node = (xmb_node_t*)malloc(sizeof(*node));
|
|
|
|
|
2019-01-10 22:24:43 +01:00
|
|
|
if (!node)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
node->alpha = node->label_alpha = 0;
|
|
|
|
node->zoom = node->x = node->y = 0;
|
|
|
|
node->icon = node->content_icon = 0;
|
2017-08-29 22:19:19 -03:00
|
|
|
node->fullpath = NULL;
|
2017-08-12 22:06:46 -03:00
|
|
|
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2017-08-29 22:19:19 -03:00
|
|
|
static void xmb_free_node(xmb_node_t *node)
|
|
|
|
{
|
2018-04-23 12:03:50 +02:00
|
|
|
if (!node)
|
|
|
|
return;
|
2017-08-29 22:19:19 -03:00
|
|
|
|
2018-04-23 12:03:50 +02:00
|
|
|
if (node->fullpath)
|
|
|
|
free(node->fullpath);
|
2017-08-29 22:19:19 -03:00
|
|
|
|
2018-04-23 12:03:50 +02:00
|
|
|
node->fullpath = NULL;
|
2017-08-29 22:19:19 -03:00
|
|
|
|
2018-04-23 12:03:50 +02:00
|
|
|
free(node);
|
2017-08-29 22:19:19 -03:00
|
|
|
}
|
|
|
|
|
2017-09-03 09:48:31 -03:00
|
|
|
/**
|
|
|
|
* @brief frees all xmb_node_t in a file_list_t
|
|
|
|
*
|
|
|
|
* file_list_t asumes userdata holds a simple structure and
|
|
|
|
* free()'s it. Can't change this at the time because other
|
|
|
|
* code depends on this behavior.
|
|
|
|
*
|
|
|
|
* @param list
|
|
|
|
* @param actiondata whether to free actiondata too
|
|
|
|
*/
|
|
|
|
static void xmb_free_list_nodes(file_list_t *list, bool actiondata)
|
|
|
|
{
|
2018-04-09 15:56:45 +02:00
|
|
|
unsigned i, size = (unsigned)file_list_get_size(list);
|
2017-09-03 09:48:31 -03:00
|
|
|
|
|
|
|
for (i = 0; i < size; ++i)
|
|
|
|
{
|
2017-09-03 09:55:29 -03:00
|
|
|
xmb_free_node((xmb_node_t*)file_list_get_userdata_at_offset(list, i));
|
2017-09-03 09:48:31 -03:00
|
|
|
|
|
|
|
/* file_list_set_userdata() doesn't accept NULL */
|
|
|
|
list->list[i].userdata = NULL;
|
|
|
|
|
|
|
|
if (actiondata)
|
|
|
|
file_list_free_actiondata(list, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-03 09:55:29 -03:00
|
|
|
static xmb_node_t *xmb_copy_node(const xmb_node_t *old_node)
|
2017-08-12 22:06:46 -03:00
|
|
|
{
|
|
|
|
xmb_node_t *new_node = (xmb_node_t*)malloc(sizeof(*new_node));
|
|
|
|
|
2019-01-10 22:24:43 +01:00
|
|
|
if (!new_node)
|
|
|
|
return NULL;
|
|
|
|
|
2017-09-03 09:55:29 -03:00
|
|
|
*new_node = *old_node;
|
|
|
|
new_node->fullpath = old_node->fullpath ? strdup(old_node->fullpath) : NULL;
|
2017-08-12 22:06:46 -03:00
|
|
|
|
|
|
|
return new_node;
|
|
|
|
}
|
|
|
|
|
2018-03-25 12:27:17 -03:00
|
|
|
static const char *xmb_thumbnails_ident(char pos)
|
2016-04-08 01:42:53 +07:00
|
|
|
{
|
2018-03-30 15:50:11 +02:00
|
|
|
char folder = 0;
|
2016-04-08 01:42:53 +07:00
|
|
|
settings_t *settings = config_get_ptr();
|
2016-04-16 05:07:08 +02:00
|
|
|
|
2018-03-25 12:27:17 -03:00
|
|
|
if (pos == 'R')
|
|
|
|
folder = settings->uints.menu_thumbnails;
|
|
|
|
if (pos == 'L')
|
|
|
|
folder = settings->uints.menu_left_thumbnails;
|
|
|
|
|
|
|
|
switch (folder)
|
2016-04-08 01:42:53 +07:00
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
return "Named_Snaps";
|
|
|
|
case 2:
|
|
|
|
return "Named_Titles";
|
|
|
|
case 3:
|
|
|
|
return "Named_Boxarts";
|
2016-04-16 05:07:08 +02:00
|
|
|
case 0:
|
2016-04-08 01:42:53 +07:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-12-15 11:23:08 +01:00
|
|
|
return msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF);
|
2016-04-08 01:42:53 +07:00
|
|
|
}
|
|
|
|
|
2017-01-20 15:33:47 +01:00
|
|
|
static float *xmb_gradient_ident(video_frame_info_t *video_info)
|
2016-04-22 13:47:14 +07:00
|
|
|
{
|
2017-01-20 15:33:47 +01:00
|
|
|
switch (video_info->xmb_color_theme)
|
2016-04-22 13:47:14 +07:00
|
|
|
{
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_DARK_PURPLE:
|
2016-04-22 15:20:08 +07:00
|
|
|
return &gradient_dark_purple[0];
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_MIDNIGHT_BLUE:
|
2016-04-22 13:47:14 +07:00
|
|
|
return &gradient_midnight_blue[0];
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_GOLDEN:
|
2016-04-22 15:20:08 +07:00
|
|
|
return &gradient_golden[0];
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_ELECTRIC_BLUE:
|
2016-04-22 15:20:08 +07:00
|
|
|
return &gradient_electric_blue[0];
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_APPLE_GREEN:
|
2016-04-22 15:20:08 +07:00
|
|
|
return &gradient_apple_green[0];
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_UNDERSEA:
|
2016-04-22 15:20:08 +07:00
|
|
|
return &gradient_undersea[0];
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_VOLCANIC_RED:
|
2016-04-22 18:16:31 +07:00
|
|
|
return &gradient_volcanic_red[0];
|
2016-07-14 18:19:59 +02:00
|
|
|
case XMB_THEME_DARK:
|
2016-04-29 05:06:32 +07:00
|
|
|
return &gradient_dark[0];
|
2017-12-27 17:33:39 -05:00
|
|
|
case XMB_THEME_LIGHT:
|
|
|
|
return &gradient_light[0];
|
2018-03-11 20:37:49 -04:00
|
|
|
case XMB_THEME_MORNING_BLUE:
|
|
|
|
return &gradient_morning_blue[0];
|
2016-07-14 18:20:36 +02:00
|
|
|
case XMB_THEME_LEGACY_RED:
|
2016-04-22 13:47:14 +07:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-04-22 15:20:08 +07:00
|
|
|
return &gradient_legacy_red[0];
|
2016-04-22 13:47:14 +07:00
|
|
|
}
|
|
|
|
|
2015-06-15 19:00:52 +02:00
|
|
|
static size_t xmb_list_get_selection(void *data)
|
|
|
|
{
|
2015-12-11 14:50:06 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-06-15 19:00:52 +02:00
|
|
|
|
2015-07-08 17:26:23 +02:00
|
|
|
if (!xmb)
|
|
|
|
return 0;
|
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
return xmb->categories_selection_ptr;
|
2015-06-15 19:00:52 +02:00
|
|
|
}
|
|
|
|
|
2016-02-25 19:27:06 +01:00
|
|
|
static size_t xmb_list_get_size(void *data, enum menu_list_type type)
|
2015-06-07 14:29:43 +02:00
|
|
|
{
|
2015-12-10 15:23:43 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-07-08 17:26:23 +02:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case MENU_LIST_PLAIN:
|
2016-03-03 06:59:54 +01:00
|
|
|
return menu_entries_get_stack_size(0);
|
2015-07-08 17:26:23 +02:00
|
|
|
case MENU_LIST_HORIZONTAL:
|
|
|
|
if (xmb && xmb->horizontal_list)
|
2016-03-03 06:59:54 +01:00
|
|
|
return file_list_get_size(xmb->horizontal_list);
|
2015-07-08 17:26:23 +02:00
|
|
|
break;
|
2015-10-30 16:28:27 +07:00
|
|
|
case MENU_LIST_TABS:
|
2016-08-18 16:42:39 +02:00
|
|
|
return xmb->system_tab_end;
|
2015-07-08 17:26:23 +02:00
|
|
|
}
|
|
|
|
|
2016-03-03 06:59:54 +01:00
|
|
|
return 0;
|
2015-06-07 14:29:43 +02:00
|
|
|
}
|
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
static void *xmb_list_get_entry(void *data,
|
|
|
|
enum menu_list_type type, unsigned i)
|
2015-06-08 17:02:14 +02:00
|
|
|
{
|
2015-10-17 18:17:59 +02:00
|
|
|
size_t list_size = 0;
|
2015-12-11 14:52:16 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-07-08 17:26:23 +02:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case MENU_LIST_PLAIN:
|
2016-04-21 04:17:45 +02:00
|
|
|
{
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
|
|
|
list_size = menu_entries_get_stack_size(0);
|
|
|
|
if (i < list_size)
|
|
|
|
return (void*)&menu_stack->list[i];
|
|
|
|
}
|
2015-07-08 17:26:23 +02:00
|
|
|
break;
|
|
|
|
case MENU_LIST_HORIZONTAL:
|
|
|
|
if (xmb && xmb->horizontal_list)
|
|
|
|
list_size = file_list_get_size(xmb->horizontal_list);
|
|
|
|
if (i < list_size)
|
2016-04-21 04:17:45 +02:00
|
|
|
return (void*)&xmb->horizontal_list->list[i];
|
2015-07-08 17:26:23 +02:00
|
|
|
break;
|
2015-10-30 16:28:27 +07:00
|
|
|
default:
|
|
|
|
break;
|
2015-07-08 17:26:23 +02:00
|
|
|
}
|
|
|
|
|
2016-04-21 04:17:45 +02:00
|
|
|
return NULL;
|
2015-06-08 17:02:14 +02:00
|
|
|
}
|
|
|
|
|
2017-08-17 20:23:03 -03:00
|
|
|
static INLINE float xmb_item_y(const xmb_handle_t *xmb, int i, size_t current)
|
2015-02-09 22:54:14 +01:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
float iy = xmb->icon_spacing_vertical;
|
2015-02-09 22:54:14 +01:00
|
|
|
|
2015-03-16 17:40:05 +01:00
|
|
|
if (i < (int)current)
|
2015-02-09 22:54:14 +01:00
|
|
|
if (xmb->depth > 1)
|
2016-05-09 04:05:11 +07:00
|
|
|
iy *= (i - (int)current + xmb->above_subitem_offset);
|
2015-02-09 22:54:14 +01:00
|
|
|
else
|
2016-05-09 04:05:11 +07:00
|
|
|
iy *= (i - (int)current + xmb->above_item_offset);
|
2015-02-09 22:54:14 +01:00
|
|
|
else
|
2016-05-09 04:05:11 +07:00
|
|
|
iy *= (i - (int)current + xmb->under_item_offset);
|
2015-02-09 22:54:14 +01:00
|
|
|
|
2015-03-16 17:40:05 +01:00
|
|
|
if (i == (int)current)
|
2017-09-28 08:42:12 +02:00
|
|
|
iy = xmb->icon_spacing_vertical * xmb->active_item_factor;
|
2015-02-09 22:54:14 +01:00
|
|
|
|
|
|
|
return iy;
|
|
|
|
}
|
|
|
|
|
2016-04-21 09:14:25 +02:00
|
|
|
static void xmb_draw_icon(
|
2018-02-16 17:54:39 +01:00
|
|
|
video_frame_info_t *video_info,
|
2016-04-21 09:18:03 +02:00
|
|
|
int icon_size,
|
2016-04-07 23:43:04 +07:00
|
|
|
math_matrix_4x4 *mymat,
|
2015-11-08 01:30:07 +01:00
|
|
|
uintptr_t texture,
|
2016-04-21 09:14:25 +02:00
|
|
|
float x,
|
|
|
|
float y,
|
|
|
|
unsigned width,
|
|
|
|
unsigned height,
|
|
|
|
float alpha,
|
|
|
|
float rotation,
|
|
|
|
float scale_factor,
|
2016-05-09 03:57:02 +07:00
|
|
|
float *color,
|
2017-02-08 20:02:26 +01:00
|
|
|
float shadow_offset)
|
2014-10-09 01:21:22 +02:00
|
|
|
{
|
2016-02-09 04:34:07 +01:00
|
|
|
menu_display_ctx_draw_t draw;
|
2016-05-10 02:32:49 +02:00
|
|
|
struct video_coords coords;
|
2014-10-09 04:34:16 +02:00
|
|
|
|
2015-02-01 15:25:37 +01:00
|
|
|
if (
|
2016-12-14 16:47:10 +01:00
|
|
|
(x < (-icon_size / 2.0f)) ||
|
|
|
|
(x > width) ||
|
|
|
|
(y < (icon_size / 2.0f)) ||
|
|
|
|
(y > height + icon_size)
|
|
|
|
)
|
2014-10-09 01:21:22 +02:00
|
|
|
return;
|
|
|
|
|
2015-02-02 20:48:26 +01:00
|
|
|
coords.vertices = 4;
|
2015-11-02 22:37:29 +01:00
|
|
|
coords.vertex = NULL;
|
2015-11-02 22:46:23 +01:00
|
|
|
coords.tex_coord = NULL;
|
|
|
|
coords.lut_tex_coord = NULL;
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2016-04-21 09:18:03 +02:00
|
|
|
draw.width = icon_size;
|
|
|
|
draw.height = icon_size;
|
2018-01-25 01:34:53 +01:00
|
|
|
draw.rotation = rotation;
|
|
|
|
draw.scale_factor = scale_factor;
|
2017-05-22 07:34:30 +01:00
|
|
|
#if defined(VITA) || defined(WIIU)
|
2016-12-14 16:47:10 +01:00
|
|
|
draw.width *= scale_factor;
|
|
|
|
draw.height *= scale_factor;
|
2016-08-23 02:49:53 +02:00
|
|
|
#endif
|
2016-04-21 09:14:25 +02:00
|
|
|
draw.coords = &coords;
|
|
|
|
draw.matrix_data = mymat;
|
|
|
|
draw.texture = texture;
|
|
|
|
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
2016-05-08 11:11:28 +02:00
|
|
|
draw.pipeline.id = 0;
|
2016-02-09 04:34:07 +01:00
|
|
|
|
2018-03-06 15:55:06 +01:00
|
|
|
if (video_info->xmb_shadows_enable)
|
2016-04-08 00:24:55 +07:00
|
|
|
{
|
2017-09-09 06:52:49 +02:00
|
|
|
menu_display_set_alpha(coord_shadow, color[3] * 0.35f);
|
2016-04-08 00:24:55 +07:00
|
|
|
|
2017-09-09 06:52:49 +02:00
|
|
|
coords.color = coord_shadow;
|
2016-05-09 03:57:02 +07:00
|
|
|
draw.x = x + shadow_offset;
|
|
|
|
draw.y = height - y - shadow_offset;
|
2016-12-14 16:47:10 +01:00
|
|
|
|
2017-05-22 07:34:30 +01:00
|
|
|
#if defined(VITA) || defined(WIIU)
|
2016-12-14 16:47:10 +01:00
|
|
|
if(scale_factor < 1)
|
|
|
|
{
|
|
|
|
draw.x = draw.x + (icon_size-draw.width)/2;
|
|
|
|
draw.y = draw.y + (icon_size-draw.width)/2;
|
2016-08-23 02:49:53 +02:00
|
|
|
}
|
|
|
|
#endif
|
2018-02-16 17:54:39 +01:00
|
|
|
menu_display_draw(&draw, video_info);
|
2016-04-08 00:24:55 +07:00
|
|
|
}
|
|
|
|
|
2016-04-21 09:14:25 +02:00
|
|
|
coords.color = (const float*)color;
|
|
|
|
draw.x = x;
|
|
|
|
draw.y = height - y;
|
2016-12-14 16:47:10 +01:00
|
|
|
|
2017-05-22 07:34:30 +01:00
|
|
|
#if defined(VITA) || defined(WIIU)
|
2016-12-14 16:47:10 +01:00
|
|
|
if(scale_factor < 1)
|
|
|
|
{
|
2016-08-23 02:49:53 +02:00
|
|
|
draw.x = draw.x + (icon_size-draw.width)/2;
|
|
|
|
draw.y = draw.y + (icon_size-draw.width)/2;
|
|
|
|
}
|
|
|
|
#endif
|
2018-02-16 17:54:39 +01:00
|
|
|
menu_display_draw(&draw, video_info);
|
2014-10-09 01:21:22 +02:00
|
|
|
}
|
|
|
|
|
2017-01-09 16:00:53 +01:00
|
|
|
static void xmb_draw_thumbnail(
|
2018-02-16 17:54:39 +01:00
|
|
|
video_frame_info_t *video_info,
|
2017-01-09 16:00:53 +01:00
|
|
|
xmb_handle_t *xmb, float *color,
|
2017-07-14 14:49:41 -04:00
|
|
|
unsigned width, unsigned height,
|
2017-05-29 20:58:15 +02:00
|
|
|
float x, float y,
|
|
|
|
float w, float h, uintptr_t texture)
|
2015-06-19 02:16:45 +07:00
|
|
|
{
|
2016-02-09 04:43:15 +01:00
|
|
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
2016-02-09 04:34:07 +01:00
|
|
|
menu_display_ctx_draw_t draw;
|
2016-05-10 02:32:49 +02:00
|
|
|
struct video_coords coords;
|
2015-11-02 19:47:25 +01:00
|
|
|
math_matrix_4x4 mymat;
|
2015-06-19 23:19:49 +07:00
|
|
|
|
2016-02-09 04:43:15 +01:00
|
|
|
rotate_draw.matrix = &mymat;
|
|
|
|
rotate_draw.rotation = 0;
|
|
|
|
rotate_draw.scale_x = 1;
|
|
|
|
rotate_draw.scale_y = 1;
|
|
|
|
rotate_draw.scale_z = 1;
|
|
|
|
rotate_draw.scale_enable = true;
|
|
|
|
|
2018-02-16 19:42:13 +01:00
|
|
|
menu_display_rotate_z(&rotate_draw, video_info);
|
2015-07-12 06:12:39 +02:00
|
|
|
|
2016-12-14 16:47:10 +01:00
|
|
|
coords.vertices = 4;
|
|
|
|
coords.vertex = NULL;
|
|
|
|
coords.tex_coord = NULL;
|
|
|
|
coords.lut_tex_coord = NULL;
|
2015-06-19 02:16:45 +07:00
|
|
|
|
2018-03-29 16:39:38 +02:00
|
|
|
draw.width = w;
|
|
|
|
draw.height = h;
|
2016-12-14 16:47:10 +01:00
|
|
|
draw.coords = &coords;
|
|
|
|
draw.matrix_data = &mymat;
|
|
|
|
draw.texture = texture;
|
|
|
|
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
|
|
|
draw.pipeline.id = 0;
|
2016-02-09 04:34:07 +01:00
|
|
|
|
2018-03-06 15:55:06 +01:00
|
|
|
if (video_info->xmb_shadows_enable)
|
2016-04-25 17:55:18 +02:00
|
|
|
{
|
2017-09-09 06:52:49 +02:00
|
|
|
menu_display_set_alpha(coord_shadow, color[3] * 0.35f);
|
2016-04-25 17:55:18 +02:00
|
|
|
|
2017-09-09 06:52:49 +02:00
|
|
|
coords.color = coord_shadow;
|
2016-12-14 16:47:10 +01:00
|
|
|
draw.x = x + xmb->shadow_offset;
|
|
|
|
draw.y = height - y - xmb->shadow_offset;
|
2016-04-25 17:55:18 +02:00
|
|
|
|
2018-02-16 17:54:39 +01:00
|
|
|
menu_display_draw(&draw, video_info);
|
2016-04-25 17:55:18 +02:00
|
|
|
}
|
|
|
|
|
2016-12-14 16:47:10 +01:00
|
|
|
coords.color = (const float*)color;
|
|
|
|
draw.x = x;
|
|
|
|
draw.y = height - y;
|
|
|
|
|
2017-05-27 16:52:52 +02:00
|
|
|
menu_display_set_alpha(color, 1.0f);
|
2016-04-25 17:55:18 +02:00
|
|
|
|
2018-02-16 17:54:39 +01:00
|
|
|
menu_display_draw(&draw, video_info);
|
2015-06-19 02:16:45 +07:00
|
|
|
}
|
|
|
|
|
2017-01-09 16:00:53 +01:00
|
|
|
static void xmb_draw_text(
|
2018-03-06 15:55:06 +01:00
|
|
|
video_frame_info_t *video_info,
|
2017-01-09 16:00:53 +01:00
|
|
|
xmb_handle_t *xmb,
|
2015-04-21 16:45:27 +02:00
|
|
|
const char *str, float x,
|
|
|
|
float y, float scale_factor, float alpha,
|
2015-09-06 21:57:12 +02:00
|
|
|
enum text_alignment text_align,
|
2016-10-20 09:52:17 +02:00
|
|
|
unsigned width, unsigned height, font_data_t* font)
|
2014-10-09 01:21:22 +02:00
|
|
|
{
|
2016-11-03 15:56:21 +01:00
|
|
|
uint32_t color;
|
2017-01-09 23:11:05 +01:00
|
|
|
uint8_t a8;
|
2017-12-27 16:38:36 -05:00
|
|
|
settings_t *settings;
|
2014-10-09 04:34:16 +02:00
|
|
|
|
2014-10-10 22:42:56 +02:00
|
|
|
if (alpha > xmb->alpha)
|
2017-01-09 23:11:05 +01:00
|
|
|
alpha = xmb->alpha;
|
|
|
|
|
|
|
|
a8 = 255 * alpha;
|
2015-02-01 15:25:37 +01:00
|
|
|
|
2016-11-03 15:56:21 +01:00
|
|
|
/* Avoid drawing 100% transparent text */
|
2014-10-09 01:21:22 +02:00
|
|
|
if (a8 == 0)
|
|
|
|
return;
|
|
|
|
|
2017-12-27 16:38:36 -05:00
|
|
|
settings = config_get_ptr();
|
|
|
|
color = FONT_COLOR_RGBA(
|
2017-12-27 17:03:39 -05:00
|
|
|
settings->uints.menu_font_color_red,
|
|
|
|
settings->uints.menu_font_color_green,
|
|
|
|
settings->uints.menu_font_color_blue, a8);
|
2016-04-08 00:24:55 +07:00
|
|
|
|
2016-11-03 15:56:21 +01:00
|
|
|
menu_display_draw_text(font, str, x, y,
|
|
|
|
width, height, color, text_align, scale_factor,
|
2018-03-06 15:55:06 +01:00
|
|
|
video_info->xmb_shadows_enable,
|
2018-11-14 14:18:01 +01:00
|
|
|
xmb->shadow_offset, false);
|
2014-10-09 01:21:22 +02:00
|
|
|
}
|
|
|
|
|
2015-12-10 14:40:56 +01:00
|
|
|
static void xmb_messagebox(void *data, const char *message)
|
2014-10-09 01:21:22 +02:00
|
|
|
{
|
2015-12-10 14:40:56 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2016-12-14 16:47:10 +01:00
|
|
|
if (!xmb || string_is_empty(message))
|
2014-10-09 01:21:22 +02:00
|
|
|
return;
|
|
|
|
|
2017-09-29 19:55:06 +02:00
|
|
|
xmb->box_message = strdup(message);
|
2014-10-09 01:21:22 +02:00
|
|
|
}
|
|
|
|
|
2016-02-04 21:40:29 +01:00
|
|
|
static void xmb_render_messagebox_internal(
|
2017-01-19 00:09:38 +01:00
|
|
|
video_frame_info_t *video_info,
|
2018-11-08 11:59:55 +01:00
|
|
|
xmb_handle_t *xmb, const char *message)
|
2014-10-09 01:21:22 +02:00
|
|
|
{
|
2016-10-24 20:26:22 +02:00
|
|
|
unsigned i, y_position;
|
2017-01-19 00:09:38 +01:00
|
|
|
int x, y, longest = 0, longest_width = 0;
|
2018-01-23 04:30:47 +01:00
|
|
|
float line_height = 0;
|
2017-01-19 00:09:38 +01:00
|
|
|
unsigned width = video_info->width;
|
|
|
|
unsigned height = video_info->height;
|
2018-03-11 20:37:49 -04:00
|
|
|
struct string_list *list = !string_is_empty(message)
|
2018-01-23 04:30:47 +01:00
|
|
|
? string_split(message, "\n") : NULL;
|
|
|
|
|
2018-02-03 16:55:24 +01:00
|
|
|
if (!list || !xmb || !xmb->font)
|
2018-01-23 04:29:45 +01:00
|
|
|
{
|
|
|
|
if (list)
|
|
|
|
string_list_free(list);
|
2014-10-09 01:21:22 +02:00
|
|
|
return;
|
2018-01-23 04:29:45 +01:00
|
|
|
}
|
2015-01-10 23:45:14 +01:00
|
|
|
|
2014-10-09 01:21:22 +02:00
|
|
|
if (list->elems == 0)
|
2015-02-11 06:27:28 +01:00
|
|
|
goto end;
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2018-03-06 15:55:06 +01:00
|
|
|
line_height = xmb->font->size * 1.2;
|
2017-02-27 20:34:17 +01:00
|
|
|
|
2018-03-06 15:55:06 +01:00
|
|
|
y_position = height / 2;
|
2016-10-24 20:26:22 +02:00
|
|
|
if (menu_input_dialog_get_display_kb())
|
2018-03-06 15:55:06 +01:00
|
|
|
y_position = height / 4;
|
2016-10-24 20:26:22 +02:00
|
|
|
|
2018-03-06 15:55:06 +01:00
|
|
|
x = width / 2;
|
|
|
|
y = y_position - (list->size-1) * line_height / 2;
|
2016-08-10 22:30:17 +02:00
|
|
|
|
|
|
|
/* find the longest line width */
|
|
|
|
for (i = 0; i < list->size; i++)
|
|
|
|
{
|
2018-03-06 15:55:06 +01:00
|
|
|
const char *msg = list->elems[i].data;
|
|
|
|
int len = (int)utf8len(msg);
|
2017-07-14 14:49:41 -04:00
|
|
|
|
2016-08-10 22:30:17 +02:00
|
|
|
if (len > longest)
|
|
|
|
{
|
2018-03-06 15:55:06 +01:00
|
|
|
longest = len;
|
|
|
|
longest_width = font_driver_get_message_width(
|
2018-04-09 15:56:45 +02:00
|
|
|
xmb->font, msg, (unsigned)strlen(msg), 1);
|
2016-08-10 22:30:17 +02:00
|
|
|
}
|
|
|
|
}
|
2014-10-09 04:34:16 +02:00
|
|
|
|
2018-02-16 17:19:55 +01:00
|
|
|
menu_display_blend_begin(video_info);
|
2017-02-27 20:34:17 +01:00
|
|
|
|
|
|
|
menu_display_draw_texture_slice(
|
2018-02-16 17:54:39 +01:00
|
|
|
video_info,
|
2017-09-28 08:42:12 +02:00
|
|
|
x - longest_width/2 - xmb->margins_dialog,
|
|
|
|
y + xmb->margins_slice - xmb->margins_dialog,
|
2017-02-27 20:34:17 +01:00
|
|
|
256, 256,
|
2017-09-28 08:42:12 +02:00
|
|
|
longest_width + xmb->margins_dialog * 2,
|
|
|
|
line_height * list->size + xmb->margins_dialog * 2,
|
2017-02-27 20:34:17 +01:00
|
|
|
width, height,
|
2018-11-08 11:59:55 +01:00
|
|
|
NULL,
|
2018-03-06 15:55:06 +01:00
|
|
|
xmb->margins_slice, 1.0,
|
|
|
|
xmb->textures.list[XMB_TEXTURE_DIALOG_SLICE]);
|
2017-02-27 20:34:17 +01:00
|
|
|
|
2014-10-09 01:21:22 +02:00
|
|
|
for (i = 0; i < list->size; i++)
|
|
|
|
{
|
|
|
|
const char *msg = list->elems[i].data;
|
2014-10-09 22:45:29 +02:00
|
|
|
|
|
|
|
if (msg)
|
2017-02-27 20:34:17 +01:00
|
|
|
menu_display_draw_text(xmb->font, msg,
|
2016-08-10 22:30:17 +02:00
|
|
|
x - longest_width/2.0,
|
2017-02-27 20:34:17 +01:00
|
|
|
y + (i+0.75) * line_height,
|
2018-11-14 14:18:01 +01:00
|
|
|
width, height, 0x444444ff, TEXT_ALIGN_LEFT, 1.0f, false, 0, false);
|
2014-10-09 01:21:22 +02:00
|
|
|
}
|
|
|
|
|
2016-10-24 20:26:22 +02:00
|
|
|
if (menu_input_dialog_get_display_kb())
|
2018-04-23 11:42:55 +02:00
|
|
|
menu_display_draw_keyboard(
|
|
|
|
xmb->textures.list[XMB_TEXTURE_KEY_HOVER],
|
|
|
|
xmb->font,
|
2017-01-19 00:09:38 +01:00
|
|
|
video_info,
|
2016-12-14 16:47:10 +01:00
|
|
|
menu_event_get_osk_grid(),
|
2018-11-09 16:51:34 +01:00
|
|
|
menu_event_get_osk_ptr(),
|
|
|
|
0xffffffff);
|
2016-10-24 20:26:22 +02:00
|
|
|
|
2015-02-11 06:27:28 +01:00
|
|
|
end:
|
2014-10-09 01:21:22 +02:00
|
|
|
string_list_free(list);
|
|
|
|
}
|
|
|
|
|
2018-03-25 12:27:17 -03:00
|
|
|
static void xmb_update_thumbnail_path(void *data, unsigned i, char pos)
|
2015-06-18 09:32:56 +07:00
|
|
|
{
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_t entry;
|
2018-01-23 05:30:41 +01:00
|
|
|
unsigned entry_type = 0;
|
|
|
|
char new_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
playlist_t *playlist = NULL;
|
2018-01-23 21:18:29 +01:00
|
|
|
const char *dir_thumbnails = settings->paths.directory_thumbnails;
|
2016-11-27 23:16:45 +01:00
|
|
|
|
2017-09-30 17:09:52 +02:00
|
|
|
menu_entry_init(&entry);
|
|
|
|
|
2018-01-23 21:18:29 +01:00
|
|
|
if (!xmb || string_is_empty(dir_thumbnails))
|
2017-09-11 04:40:35 +02:00
|
|
|
goto end;
|
2016-04-28 03:26:09 +07:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_get(&entry, 0, i, NULL, true);
|
2015-06-18 09:32:56 +07:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
entry_type = menu_entry_get_type_new(&entry);
|
2017-09-28 07:15:29 +02:00
|
|
|
|
|
|
|
if (entry_type == FILE_TYPE_IMAGEVIEWER || entry_type == FILE_TYPE_IMAGE)
|
2017-01-10 23:26:07 +01:00
|
|
|
{
|
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
|
|
|
xmb_node_t *node = (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(selection_buf, i);
|
2017-01-10 23:26:07 +01:00
|
|
|
|
2019-01-24 08:08:00 -08:00
|
|
|
if (node && !string_is_empty(node->fullpath) &&
|
2018-04-23 12:03:50 +02:00
|
|
|
(pos == 'R' || (pos == 'L' && string_is_equal(xmb_thumbnails_ident('R'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))))
|
2017-01-10 23:26:07 +01:00
|
|
|
{
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(entry.path))
|
2017-09-29 18:37:04 +02:00
|
|
|
fill_pathname_join(
|
2018-01-23 05:30:41 +01:00
|
|
|
new_path,
|
2017-09-29 18:37:04 +02:00
|
|
|
node->fullpath,
|
|
|
|
entry.path,
|
2018-01-23 05:30:41 +01:00
|
|
|
sizeof(new_path));
|
2017-01-10 23:26:07 +01:00
|
|
|
|
2017-09-11 04:40:35 +02:00
|
|
|
goto end;
|
2017-01-10 23:26:07 +01:00
|
|
|
}
|
|
|
|
}
|
2017-05-15 13:05:33 +02:00
|
|
|
else if (filebrowser_get_type() != FILEBROWSER_NONE)
|
2017-01-10 23:26:07 +01:00
|
|
|
{
|
2018-10-25 19:40:24 +03:00
|
|
|
video_driver_texture_unload(&xmb->thumbnail);
|
2017-09-11 04:40:35 +02:00
|
|
|
goto end;
|
2017-01-10 23:26:07 +01:00
|
|
|
}
|
|
|
|
|
2018-04-10 17:51:40 +02:00
|
|
|
playlist = playlist_get_cached();
|
2016-11-27 23:16:45 +01:00
|
|
|
|
|
|
|
if (playlist)
|
|
|
|
{
|
2018-01-23 21:18:29 +01:00
|
|
|
const char *core_name = NULL;
|
2016-11-27 23:16:45 +01:00
|
|
|
playlist_get_index(playlist, i,
|
|
|
|
NULL, NULL, NULL, &core_name, NULL, NULL);
|
|
|
|
|
2017-05-28 17:53:45 +02:00
|
|
|
if (string_is_equal(core_name, "imageviewer"))
|
2016-11-27 23:16:45 +01:00
|
|
|
{
|
2018-04-10 16:34:33 +02:00
|
|
|
if (
|
2018-08-04 14:19:18 -03:00
|
|
|
(pos == 'R') ||
|
2018-04-10 16:34:33 +02:00
|
|
|
(
|
2018-08-04 14:19:18 -03:00
|
|
|
pos == 'L' &&
|
2018-04-10 16:34:33 +02:00
|
|
|
string_is_equal(xmb_thumbnails_ident('R'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))
|
|
|
|
)
|
|
|
|
)
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
if (!string_is_empty(entry.label))
|
|
|
|
strlcpy(new_path, entry.label,
|
|
|
|
sizeof(new_path));
|
|
|
|
}
|
|
|
|
else
|
2018-10-25 19:40:24 +03:00
|
|
|
video_driver_texture_unload(&xmb->left_thumbnail);
|
2018-04-10 16:34:33 +02:00
|
|
|
goto end;
|
2016-11-27 23:16:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-23 21:18:29 +01:00
|
|
|
/* Append thumbnail system directory */
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(xmb->thumbnail_system))
|
|
|
|
fill_pathname_join(
|
2018-01-23 05:30:41 +01:00
|
|
|
new_path,
|
2018-01-23 21:18:29 +01:00
|
|
|
dir_thumbnails,
|
2017-09-30 06:11:18 +02:00
|
|
|
xmb->thumbnail_system,
|
2018-01-23 05:30:41 +01:00
|
|
|
sizeof(new_path));
|
2016-09-15 16:25:10 +02:00
|
|
|
|
2018-01-23 05:30:41 +01:00
|
|
|
if (!string_is_empty(new_path))
|
2018-01-23 21:18:29 +01:00
|
|
|
{
|
|
|
|
char *tmp_new2 = (char*)
|
|
|
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
|
|
|
|
tmp_new2[0] = '\0';
|
|
|
|
|
2018-03-25 12:27:17 -03:00
|
|
|
/* Append Named_Snaps/Named_Boxarts/Named_Titles */
|
|
|
|
if (pos == 'R')
|
|
|
|
fill_pathname_join(tmp_new2, new_path,
|
|
|
|
xmb_thumbnails_ident('R'), PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
if (pos == 'L')
|
|
|
|
fill_pathname_join(tmp_new2, new_path,
|
|
|
|
xmb_thumbnails_ident('L'), PATH_MAX_LENGTH * sizeof(char));
|
2018-01-23 04:40:40 +01:00
|
|
|
|
2018-01-23 05:30:41 +01:00
|
|
|
strlcpy(new_path, tmp_new2,
|
2018-01-23 04:40:40 +01:00
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
2018-01-23 21:18:29 +01:00
|
|
|
free(tmp_new2);
|
|
|
|
}
|
2018-01-23 04:40:40 +01:00
|
|
|
|
|
|
|
/* Scrub characters that are not cross-platform and/or violate the
|
|
|
|
* No-Intro filename standard:
|
|
|
|
* http://datomatic.no-intro.org/stuff/The%20Official%20No-Intro%20Convention%20(20071030).zip
|
|
|
|
* Replace these characters in the entry name with underscores.
|
|
|
|
*/
|
|
|
|
if (!string_is_empty(xmb->thumbnail_content))
|
2017-09-29 18:37:04 +02:00
|
|
|
{
|
2018-01-23 21:18:29 +01:00
|
|
|
char *scrub_char_pointer = NULL;
|
|
|
|
char *tmp_new = (char*)
|
|
|
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
char *tmp = strdup(xmb->thumbnail_content);
|
|
|
|
|
|
|
|
tmp_new[0] = '\0';
|
|
|
|
|
2018-01-23 04:40:40 +01:00
|
|
|
while((scrub_char_pointer = strpbrk(tmp, "&*/:`\"<>?\\|")))
|
|
|
|
*scrub_char_pointer = '_';
|
2016-10-16 01:45:50 +02:00
|
|
|
|
2018-01-23 21:18:29 +01:00
|
|
|
/* Look for thumbnail file with this scrubbed filename */
|
|
|
|
|
2018-01-23 04:40:40 +01:00
|
|
|
fill_pathname_join(tmp_new,
|
2018-01-23 05:30:41 +01:00
|
|
|
new_path,
|
2018-01-23 04:40:40 +01:00
|
|
|
tmp, PATH_MAX_LENGTH * sizeof(char));
|
2018-01-23 21:18:29 +01:00
|
|
|
|
2018-01-23 04:49:36 +01:00
|
|
|
if (!string_is_empty(tmp_new))
|
2018-01-23 05:30:41 +01:00
|
|
|
strlcpy(new_path,
|
|
|
|
tmp_new, sizeof(new_path));
|
2018-01-23 21:18:29 +01:00
|
|
|
|
|
|
|
free(tmp_new);
|
|
|
|
free(tmp);
|
2017-09-29 18:37:04 +02:00
|
|
|
}
|
2015-11-24 05:21:29 +07:00
|
|
|
|
2018-01-23 21:18:29 +01:00
|
|
|
/* Append png extension */
|
2018-01-23 05:30:41 +01:00
|
|
|
if (!string_is_empty(new_path))
|
|
|
|
strlcat(new_path,
|
2018-01-23 04:49:36 +01:00
|
|
|
file_path_str(FILE_PATH_PNG_EXTENSION),
|
2018-01-23 05:30:41 +01:00
|
|
|
sizeof(new_path));
|
2017-09-11 04:40:35 +02:00
|
|
|
|
|
|
|
end:
|
2018-02-04 19:30:34 +01:00
|
|
|
if (xmb && !string_is_empty(new_path))
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
if (pos == 'R')
|
|
|
|
xmb->thumbnail_file_path = strdup(new_path);
|
|
|
|
if (pos == 'L')
|
|
|
|
xmb->left_thumbnail_file_path = strdup(new_path);
|
|
|
|
}
|
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_free(&entry);
|
2015-11-19 23:39:48 +07:00
|
|
|
}
|
2015-06-18 09:32:56 +07:00
|
|
|
|
2016-12-01 02:43:53 +01:00
|
|
|
static void xmb_update_savestate_thumbnail_path(void *data, unsigned i)
|
|
|
|
{
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_t entry;
|
2016-12-01 02:43:53 +01:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_init(&entry);
|
|
|
|
menu_entry_get(&entry, 0, i, NULL, true);
|
2016-12-01 02:43:53 +01:00
|
|
|
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(xmb->savestate_thumbnail_file_path))
|
2017-09-29 19:55:06 +02:00
|
|
|
free(xmb->savestate_thumbnail_file_path);
|
2017-09-30 07:10:58 +02:00
|
|
|
xmb->savestate_thumbnail_file_path = NULL;
|
2016-12-14 16:47:10 +01:00
|
|
|
|
2017-09-30 06:40:54 +02:00
|
|
|
if (!string_is_empty(entry.label))
|
2016-12-01 02:43:53 +01:00
|
|
|
{
|
2017-09-30 06:40:54 +02:00
|
|
|
if ( (settings->bools.savestate_thumbnail_enable)
|
2018-01-16 10:32:35 -05:00
|
|
|
&& ((string_is_equal(entry.label, "state_slot"))
|
|
|
|
|| (string_is_equal(entry.label, "loadstate"))
|
|
|
|
|| (string_is_equal(entry.label, "savestate"))))
|
2017-09-30 06:40:54 +02:00
|
|
|
{
|
2018-10-04 16:32:40 +02:00
|
|
|
size_t path_size = 8204 * sizeof(char);
|
|
|
|
char *path = (char*)malloc(path_size);
|
2017-09-30 06:40:54 +02:00
|
|
|
global_t *global = global_get_ptr();
|
2016-12-14 16:47:10 +01:00
|
|
|
|
2017-09-30 06:40:54 +02:00
|
|
|
path[0] = '\0';
|
2016-12-14 16:47:10 +01:00
|
|
|
|
2017-09-30 06:40:54 +02:00
|
|
|
if (global)
|
|
|
|
{
|
2018-01-23 21:18:29 +01:00
|
|
|
int state_slot = settings->ints.state_slot;
|
|
|
|
|
|
|
|
if (state_slot > 0)
|
2017-09-30 06:40:54 +02:00
|
|
|
snprintf(path, path_size, "%s%d",
|
2018-01-23 21:18:29 +01:00
|
|
|
global->name.savestate, state_slot);
|
|
|
|
else if (state_slot < 0)
|
2017-09-30 06:40:54 +02:00
|
|
|
fill_pathname_join_delim(path,
|
|
|
|
global->name.savestate, "auto", '.', path_size);
|
|
|
|
else
|
|
|
|
strlcpy(path, global->name.savestate, path_size);
|
|
|
|
}
|
2016-12-01 02:43:53 +01:00
|
|
|
|
2017-09-30 06:40:54 +02:00
|
|
|
strlcat(path, file_path_str(FILE_PATH_PNG_EXTENSION), path_size);
|
2016-12-01 02:43:53 +01:00
|
|
|
|
2017-12-14 20:05:46 +01:00
|
|
|
if (filestream_exists(path))
|
2017-09-30 07:10:58 +02:00
|
|
|
{
|
|
|
|
if (!string_is_empty(xmb->savestate_thumbnail_file_path))
|
|
|
|
free(xmb->savestate_thumbnail_file_path);
|
2017-09-30 06:40:54 +02:00
|
|
|
xmb->savestate_thumbnail_file_path = strdup(path);
|
2017-09-30 07:10:58 +02:00
|
|
|
}
|
2017-09-11 02:37:53 +02:00
|
|
|
|
2017-09-30 06:40:54 +02:00
|
|
|
free(path);
|
|
|
|
}
|
2016-12-01 02:43:53 +01:00
|
|
|
}
|
2017-09-28 06:02:14 +02:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_free(&entry);
|
2016-12-01 02:43:53 +01:00
|
|
|
}
|
|
|
|
|
2016-04-28 03:26:09 +07:00
|
|
|
static void xmb_update_thumbnail_image(void *data)
|
2015-11-19 23:39:48 +07:00
|
|
|
{
|
2016-04-28 03:26:09 +07:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!xmb)
|
2016-04-28 03:26:09 +07:00
|
|
|
return;
|
|
|
|
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!(string_is_empty(xmb->thumbnail_file_path)))
|
2018-04-23 12:03:50 +02:00
|
|
|
{
|
|
|
|
if (filestream_exists(xmb->thumbnail_file_path))
|
|
|
|
task_push_image_load(xmb->thumbnail_file_path,
|
|
|
|
menu_display_handle_thumbnail_upload, NULL);
|
|
|
|
else
|
2018-10-25 19:40:24 +03:00
|
|
|
video_driver_texture_unload(&xmb->thumbnail);
|
2018-01-23 05:38:02 +01:00
|
|
|
|
2018-04-23 12:03:50 +02:00
|
|
|
free(xmb->thumbnail_file_path);
|
|
|
|
xmb->thumbnail_file_path = NULL;
|
|
|
|
}
|
2018-03-25 12:27:17 -03:00
|
|
|
|
|
|
|
if (!(string_is_empty(xmb->left_thumbnail_file_path)))
|
2018-04-23 12:03:50 +02:00
|
|
|
{
|
|
|
|
if (filestream_exists(xmb->left_thumbnail_file_path))
|
|
|
|
task_push_image_load(xmb->left_thumbnail_file_path,
|
|
|
|
menu_display_handle_left_thumbnail_upload, NULL);
|
|
|
|
else
|
2018-10-25 19:40:24 +03:00
|
|
|
video_driver_texture_unload(&xmb->left_thumbnail);
|
2018-03-25 12:27:17 -03:00
|
|
|
|
2018-04-23 12:03:50 +02:00
|
|
|
free(xmb->left_thumbnail_file_path);
|
|
|
|
xmb->left_thumbnail_file_path = NULL;
|
|
|
|
}
|
2015-06-18 09:32:56 +07:00
|
|
|
}
|
|
|
|
|
2017-05-17 09:32:17 +02:00
|
|
|
static void xmb_set_thumbnail_system(void *data, char*s, size_t len)
|
2017-05-15 13:05:33 +02:00
|
|
|
{
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(xmb->thumbnail_system))
|
2017-09-29 19:55:06 +02:00
|
|
|
free(xmb->thumbnail_system);
|
2019-02-12 06:47:00 -03:00
|
|
|
/* There is only one mame thumbnail repo */
|
|
|
|
if (strncmp("MAME", s, 4) == 0)
|
|
|
|
strcpy(s, "MAME");
|
2017-09-29 19:55:06 +02:00
|
|
|
xmb->thumbnail_system = strdup(s);
|
2017-05-15 13:05:33 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 09:32:17 +02:00
|
|
|
static void xmb_reset_thumbnail_content(void *data)
|
|
|
|
{
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(xmb->thumbnail_content))
|
2017-09-29 18:37:04 +02:00
|
|
|
free(xmb->thumbnail_content);
|
|
|
|
xmb->thumbnail_content = NULL;
|
2017-05-17 09:32:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void xmb_set_thumbnail_content(void *data, char *s, size_t len)
|
2017-05-15 13:05:33 +02:00
|
|
|
{
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(xmb->thumbnail_content))
|
2017-09-29 20:56:54 +02:00
|
|
|
free(xmb->thumbnail_content);
|
2017-09-29 18:37:04 +02:00
|
|
|
xmb->thumbnail_content = strdup(s);
|
2017-05-15 13:05:33 +02:00
|
|
|
}
|
|
|
|
|
2016-12-01 02:43:53 +01:00
|
|
|
static void xmb_update_savestate_thumbnail_image(void *data)
|
|
|
|
{
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(xmb->savestate_thumbnail_file_path)
|
2017-12-14 20:05:46 +01:00
|
|
|
&& filestream_exists(xmb->savestate_thumbnail_file_path))
|
2016-12-29 22:53:10 +01:00
|
|
|
task_push_image_load(xmb->savestate_thumbnail_file_path,
|
2016-12-01 02:43:53 +01:00
|
|
|
menu_display_handle_savestate_thumbnail_upload, NULL);
|
|
|
|
else
|
2018-10-25 19:40:24 +03:00
|
|
|
video_driver_texture_unload(&xmb->savestate_thumbnail);
|
2016-12-01 02:43:53 +01:00
|
|
|
}
|
|
|
|
|
2017-10-12 09:49:59 +02:00
|
|
|
static unsigned xmb_get_system_tab(xmb_handle_t *xmb, unsigned i)
|
|
|
|
{
|
|
|
|
if (i <= xmb->system_tab_end)
|
|
|
|
{
|
|
|
|
return xmb->tabs[i];
|
|
|
|
}
|
|
|
|
return UINT_MAX;
|
|
|
|
}
|
|
|
|
|
2016-02-04 21:40:29 +01:00
|
|
|
static void xmb_selection_pointer_changed(
|
|
|
|
xmb_handle_t *xmb, bool allow_animations)
|
2014-10-09 02:41:08 +02:00
|
|
|
{
|
2017-01-16 23:38:46 +01:00
|
|
|
unsigned i, end, height;
|
2017-08-11 01:16:03 +02:00
|
|
|
menu_animation_ctx_tag tag;
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_t entry;
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t num = 0;
|
2015-12-12 14:39:35 +01:00
|
|
|
int threshold = 0;
|
2015-12-11 22:05:54 +01:00
|
|
|
menu_list_t *menu_list = NULL;
|
2015-10-27 10:10:33 +01:00
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2018-03-25 12:27:17 -03:00
|
|
|
const char *thumb_ident = xmb_thumbnails_ident('R');
|
|
|
|
const char *lft_thumb_ident= xmb_thumbnails_ident('L');
|
2015-02-13 19:00:34 +01:00
|
|
|
|
2015-12-11 22:05:54 +01:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_LIST_GET, &menu_list);
|
2017-09-30 17:05:26 +02:00
|
|
|
menu_entry_init(&entry);
|
2015-12-11 22:05:54 +01:00
|
|
|
|
2014-10-10 15:52:12 +02:00
|
|
|
if (!xmb)
|
2017-09-29 16:47:30 +02:00
|
|
|
goto end;
|
2014-10-09 02:41:08 +02:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_get(&entry, 0, selection, NULL, true);
|
2017-05-15 13:05:33 +02:00
|
|
|
|
2017-10-01 17:17:53 +02:00
|
|
|
end = (unsigned)menu_entries_get_size();
|
2017-09-28 08:42:12 +02:00
|
|
|
threshold = xmb->icon_size * 10;
|
2014-10-09 22:45:29 +02:00
|
|
|
|
2015-06-23 11:38:51 -03:00
|
|
|
video_driver_get_size(NULL, &height);
|
2015-06-23 11:04:57 -03:00
|
|
|
|
2017-08-11 01:16:03 +02:00
|
|
|
tag = (uintptr_t)selection_buf;
|
2016-02-25 13:23:39 +01:00
|
|
|
|
2018-10-17 06:49:24 +02:00
|
|
|
menu_animation_kill_by_tag(&tag);
|
2015-12-12 14:39:35 +01:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &num);
|
2015-06-23 11:04:57 -03:00
|
|
|
|
2014-10-09 22:33:23 +02:00
|
|
|
for (i = 0; i < end; i++)
|
2014-10-09 02:41:08 +02:00
|
|
|
{
|
2015-06-23 11:38:51 -03:00
|
|
|
float iy, real_iy;
|
2017-09-28 08:42:12 +02:00
|
|
|
float ia = xmb->items_passive_alpha;
|
|
|
|
float iz = xmb->items_passive_zoom;
|
2016-02-04 21:40:29 +01:00
|
|
|
xmb_node_t *node = (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(selection_buf, i);
|
2014-10-09 02:41:08 +02:00
|
|
|
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
|
2015-09-25 14:57:37 +02:00
|
|
|
iy = xmb_item_y(xmb, i, selection);
|
2017-09-28 08:42:12 +02:00
|
|
|
real_iy = iy + xmb->margins_screen_top;
|
2014-10-09 02:41:08 +02:00
|
|
|
|
2015-09-25 14:57:37 +02:00
|
|
|
if (i == selection)
|
2014-10-09 02:41:08 +02:00
|
|
|
{
|
2017-10-12 09:49:59 +02:00
|
|
|
unsigned depth = (unsigned)xmb_list_get_size(xmb, MENU_LIST_PLAIN);
|
|
|
|
unsigned xmb_system_tab = xmb_get_system_tab(xmb, (unsigned)xmb->categories_selection_ptr);
|
|
|
|
unsigned entry_type = menu_entry_get_type_new(&entry);
|
2017-01-16 23:38:46 +01:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
ia = xmb->items_active_alpha;
|
|
|
|
iz = xmb->items_active_zoom;
|
2017-05-29 01:46:57 +02:00
|
|
|
if (!string_is_equal(thumb_ident,
|
2018-04-23 12:03:50 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)) || !string_is_equal(lft_thumb_ident,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2016-05-05 17:00:43 +02:00
|
|
|
{
|
2017-10-12 09:49:59 +02:00
|
|
|
if ((xmb_system_tab > XMB_SYSTEM_TAB_SETTINGS && depth == 1) ||
|
2018-04-23 12:03:50 +02:00
|
|
|
(xmb_system_tab < XMB_SYSTEM_TAB_SETTINGS && depth == 4))
|
2017-05-15 13:05:33 +02:00
|
|
|
{
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(entry.path))
|
2017-09-29 18:37:04 +02:00
|
|
|
xmb_set_thumbnail_content(xmb, entry.path, 0 /* will be ignored */);
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!string_is_equal(thumb_ident,
|
2018-04-23 12:03:50 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, i, 'R');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
|
|
|
if (!string_is_equal(lft_thumb_ident,
|
2018-04-23 12:03:50 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, i, 'L');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
2017-05-15 13:05:33 +02:00
|
|
|
}
|
2017-09-28 07:15:29 +02:00
|
|
|
else if (((entry_type == FILE_TYPE_IMAGE || entry_type == FILE_TYPE_IMAGEVIEWER ||
|
|
|
|
entry_type == FILE_TYPE_RDB || entry_type == FILE_TYPE_RDB_ENTRY)
|
2018-04-23 12:03:50 +02:00
|
|
|
&& xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS))
|
2017-05-15 13:05:33 +02:00
|
|
|
{
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(entry.path))
|
2017-09-29 18:37:04 +02:00
|
|
|
xmb_set_thumbnail_content(xmb, entry.path, 0 /* will be ignored */);
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!string_is_equal(thumb_ident,
|
2018-04-23 12:03:50 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, i, 'R');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
|
|
|
else if (!string_is_equal(lft_thumb_ident,
|
2018-04-23 12:03:50 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, i, 'L');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
2017-05-15 13:05:33 +02:00
|
|
|
}
|
|
|
|
else if (filebrowser_get_type() != FILEBROWSER_NONE)
|
|
|
|
{
|
2017-05-17 09:32:17 +02:00
|
|
|
xmb_reset_thumbnail_content(xmb);
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!string_is_equal(thumb_ident,
|
2018-04-23 12:03:50 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, i, 'R');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
|
|
|
else if (!string_is_equal(lft_thumb_ident,
|
2018-04-23 12:03:50 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2018-03-25 12:27:17 -03:00
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, i, 'L');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
2017-05-15 13:05:33 +02:00
|
|
|
}
|
2016-05-05 17:00:43 +02:00
|
|
|
}
|
2016-12-01 02:43:53 +01:00
|
|
|
xmb_update_savestate_thumbnail_path(xmb, i);
|
|
|
|
xmb_update_savestate_thumbnail_image(xmb);
|
2014-10-09 02:41:08 +02:00
|
|
|
}
|
|
|
|
|
2016-02-04 21:40:29 +01:00
|
|
|
if ( (!allow_animations)
|
2016-03-09 16:17:18 -05:00
|
|
|
|| (real_iy < -threshold
|
2018-04-23 12:03:50 +02:00
|
|
|
|| real_iy > height+threshold))
|
2015-06-23 11:38:51 -03:00
|
|
|
{
|
|
|
|
node->alpha = node->label_alpha = ia;
|
|
|
|
node->y = iy;
|
|
|
|
node->zoom = iz;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-29 16:47:30 +02:00
|
|
|
menu_animation_ctx_entry_t anim_entry;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
anim_entry.duration = XMB_DELAY;
|
|
|
|
anim_entry.target_value = ia;
|
|
|
|
anim_entry.subject = &node->alpha;
|
|
|
|
anim_entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
anim_entry.tag = tag;
|
|
|
|
anim_entry.cb = NULL;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
anim_entry.subject = &node->label_alpha;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
anim_entry.target_value = iz;
|
|
|
|
anim_entry.subject = &node->zoom;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
anim_entry.target_value = iy;
|
|
|
|
anim_entry.subject = &node->y;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2015-06-23 11:38:51 -03:00
|
|
|
}
|
2014-10-09 02:41:08 +02:00
|
|
|
}
|
2017-09-28 06:02:14 +02:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
end:
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_free(&entry);
|
2014-10-09 02:41:08 +02:00
|
|
|
}
|
|
|
|
|
2015-04-21 16:45:27 +02:00
|
|
|
static void xmb_list_open_old(xmb_handle_t *xmb,
|
|
|
|
file_list_t *list, int dir, size_t current)
|
2014-10-09 02:41:08 +02:00
|
|
|
{
|
2015-06-23 13:10:59 -03:00
|
|
|
unsigned i, height = 0;
|
2017-09-28 08:42:12 +02:00
|
|
|
int threshold = xmb->icon_size * 10;
|
2015-06-15 17:34:12 +02:00
|
|
|
size_t end = 0;
|
2014-10-12 01:27:31 +02:00
|
|
|
|
2015-06-07 15:07:38 +02:00
|
|
|
end = file_list_get_size(list);
|
|
|
|
|
2015-06-23 13:10:59 -03:00
|
|
|
video_driver_get_size(NULL, &height);
|
|
|
|
|
2015-06-07 15:07:38 +02:00
|
|
|
for (i = 0; i < end; i++)
|
2014-10-20 20:00:39 +02:00
|
|
|
{
|
2015-01-10 23:45:14 +01:00
|
|
|
float ia = 0;
|
2015-06-23 13:10:59 -03:00
|
|
|
float real_y;
|
2016-02-04 21:40:29 +01:00
|
|
|
xmb_node_t *node = (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(list, i);
|
2015-01-10 23:45:14 +01:00
|
|
|
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (i == current)
|
2017-09-28 08:42:12 +02:00
|
|
|
ia = xmb->items_active_alpha;
|
2015-01-10 23:45:14 +01:00
|
|
|
if (dir == -1)
|
|
|
|
ia = 0;
|
2015-02-02 20:48:26 +01:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
real_y = node->y + xmb->margins_screen_top;
|
2015-06-23 13:10:59 -03:00
|
|
|
|
|
|
|
if (real_y < -threshold || real_y > height+threshold)
|
|
|
|
{
|
|
|
|
node->alpha = ia;
|
|
|
|
node->label_alpha = 0;
|
2017-09-28 08:42:12 +02:00
|
|
|
node->x = xmb->icon_size * dir * -2;
|
2015-06-23 13:10:59 -03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_ctx_entry_t anim_entry;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.duration = XMB_DELAY;
|
|
|
|
anim_entry.target_value = ia;
|
|
|
|
anim_entry.subject = &node->alpha;
|
|
|
|
anim_entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
anim_entry.tag = (uintptr_t)list;
|
|
|
|
anim_entry.cb = NULL;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.target_value = 0;
|
|
|
|
anim_entry.subject = &node->label_alpha;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
anim_entry.target_value = xmb->icon_size * dir * -2;
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.subject = &node->x;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2015-06-23 13:10:59 -03:00
|
|
|
}
|
2014-10-20 20:00:39 +02:00
|
|
|
}
|
|
|
|
}
|
2014-10-12 01:27:31 +02:00
|
|
|
|
2015-04-21 16:45:27 +02:00
|
|
|
static void xmb_list_open_new(xmb_handle_t *xmb,
|
|
|
|
file_list_t *list, int dir, size_t current)
|
2014-10-20 20:00:39 +02:00
|
|
|
{
|
2015-06-23 12:22:57 -03:00
|
|
|
unsigned i, height;
|
2017-10-22 05:12:42 +02:00
|
|
|
unsigned xmb_system_tab = 0;
|
|
|
|
size_t skip = 0;
|
|
|
|
int threshold = xmb->icon_size * 10;
|
|
|
|
size_t end = file_list_get_size(list);
|
2015-06-07 15:07:38 +02:00
|
|
|
|
2015-06-23 12:22:57 -03:00
|
|
|
video_driver_get_size(NULL, &height);
|
|
|
|
|
2015-06-07 15:07:38 +02:00
|
|
|
for (i = 0; i < end; i++)
|
2014-10-18 01:24:14 +02:00
|
|
|
{
|
2015-06-07 15:08:32 +02:00
|
|
|
float ia;
|
2015-06-23 12:22:57 -03:00
|
|
|
float real_y;
|
2015-04-21 16:45:27 +02:00
|
|
|
xmb_node_t *node = (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(list, i);
|
2015-02-02 20:48:26 +01:00
|
|
|
|
2015-02-11 06:22:00 +01:00
|
|
|
if (!node)
|
2015-02-02 20:48:26 +01:00
|
|
|
continue;
|
2015-01-26 19:30:44 +01:00
|
|
|
|
2014-10-20 20:00:39 +02:00
|
|
|
if (dir == 1 || (dir == -1 && i != current))
|
|
|
|
node->alpha = 0;
|
2015-01-26 19:30:44 +01:00
|
|
|
|
|
|
|
if (dir == 1 || dir == -1)
|
|
|
|
node->label_alpha = 0;
|
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
node->x = xmb->icon_size * dir * 2;
|
2015-02-11 05:33:53 +01:00
|
|
|
node->y = xmb_item_y(xmb, i, current);
|
2017-09-28 08:42:12 +02:00
|
|
|
node->zoom = xmb->categories_passive_zoom;
|
2014-10-18 01:24:14 +02:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
real_y = node->y + xmb->margins_screen_top;
|
2015-06-23 12:22:57 -03:00
|
|
|
|
2014-10-18 01:24:14 +02:00
|
|
|
if (i == current)
|
2017-09-28 08:42:12 +02:00
|
|
|
node->zoom = xmb->categories_active_zoom;
|
2014-11-27 17:07:52 +07:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
ia = xmb->items_passive_alpha;
|
2015-01-26 06:51:46 +01:00
|
|
|
if (i == current)
|
2017-09-28 08:42:12 +02:00
|
|
|
ia = xmb->items_active_alpha;
|
2015-01-26 06:51:46 +01:00
|
|
|
|
2015-06-23 12:22:57 -03:00
|
|
|
if (real_y < -threshold || real_y > height+threshold)
|
|
|
|
{
|
|
|
|
node->alpha = node->label_alpha = ia;
|
|
|
|
node->x = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_ctx_entry_t anim_entry;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.duration = XMB_DELAY;
|
|
|
|
anim_entry.target_value = ia;
|
|
|
|
anim_entry.subject = &node->alpha;
|
|
|
|
anim_entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
anim_entry.tag = (uintptr_t)list;
|
|
|
|
anim_entry.cb = NULL;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.subject = &node->label_alpha;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.target_value = 0;
|
|
|
|
anim_entry.subject = &node->x;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2015-06-23 12:22:57 -03:00
|
|
|
}
|
2014-10-18 01:24:14 +02:00
|
|
|
}
|
2014-10-20 01:51:00 +02:00
|
|
|
|
|
|
|
xmb->old_depth = xmb->depth;
|
2015-12-12 14:39:35 +01:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &skip);
|
2017-01-10 23:26:07 +01:00
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
xmb_system_tab = xmb_get_system_tab(xmb,
|
|
|
|
(unsigned)xmb->categories_selection_ptr);
|
2017-10-12 09:49:59 +02:00
|
|
|
|
|
|
|
if (xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS)
|
2017-05-15 13:05:33 +02:00
|
|
|
{
|
|
|
|
if (xmb->depth < 4)
|
2017-05-17 09:32:17 +02:00
|
|
|
xmb_reset_thumbnail_content(xmb);
|
2018-03-25 12:27:17 -03:00
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'R');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'L');
|
2017-05-15 13:05:33 +02:00
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
2014-10-09 02:41:08 +02:00
|
|
|
}
|
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
static xmb_node_t *xmb_node_allocate_userdata(
|
|
|
|
xmb_handle_t *xmb, unsigned i)
|
2015-06-07 16:39:40 +02:00
|
|
|
{
|
2018-03-30 15:50:11 +02:00
|
|
|
xmb_node_t *tmp = NULL;
|
2017-08-12 22:06:46 -03:00
|
|
|
xmb_node_t *node = xmb_alloc_node();
|
2015-01-26 06:51:46 +01:00
|
|
|
|
2015-06-07 16:41:20 +02:00
|
|
|
if (!node)
|
2014-11-17 16:17:24 +07:00
|
|
|
{
|
2015-01-26 06:51:46 +01:00
|
|
|
RARCH_ERR("XMB node could not be allocated.\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-11-17 16:17:24 +07:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
node->alpha = xmb->categories_passive_alpha;
|
|
|
|
node->zoom = xmb->categories_passive_zoom;
|
2014-11-17 16:17:24 +07:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
if ((i + xmb->system_tab_end) == xmb->categories_active_idx)
|
2015-01-26 06:51:46 +01:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
node->alpha = xmb->categories_active_alpha;
|
|
|
|
node->zoom = xmb->categories_active_zoom;
|
2014-11-17 16:17:24 +07:00
|
|
|
}
|
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
tmp = (xmb_node_t*)file_list_get_userdata_at_offset(
|
|
|
|
xmb->horizontal_list, i);
|
2017-08-29 22:19:19 -03:00
|
|
|
xmb_free_node(tmp);
|
|
|
|
|
2017-09-02 20:21:02 -03:00
|
|
|
file_list_set_userdata(xmb->horizontal_list, i, node);
|
2015-06-07 16:41:20 +02:00
|
|
|
|
2014-11-13 21:05:16 +01:00
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2015-06-07 16:52:07 +02:00
|
|
|
static xmb_node_t* xmb_get_userdata_from_horizontal_list(
|
2015-06-08 16:27:30 +02:00
|
|
|
xmb_handle_t *xmb, unsigned i)
|
2015-03-12 15:32:50 +01:00
|
|
|
{
|
2016-02-04 21:40:29 +01:00
|
|
|
return (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(xmb->horizontal_list, i);
|
2015-03-12 15:32:50 +01:00
|
|
|
}
|
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
static void xmb_push_animations(xmb_node_t *node,
|
|
|
|
uintptr_t tag, float ia, float ix)
|
2015-02-12 17:22:24 +01:00
|
|
|
{
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_animation_ctx_entry_t anim_entry;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
anim_entry.duration = XMB_DELAY;
|
|
|
|
anim_entry.target_value = ia;
|
|
|
|
anim_entry.subject = &node->alpha;
|
|
|
|
anim_entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
anim_entry.tag = tag;
|
|
|
|
anim_entry.cb = NULL;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
anim_entry.subject = &node->label_alpha;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
anim_entry.target_value = ix;
|
|
|
|
anim_entry.subject = &node->x;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_animation_push(&anim_entry);
|
2015-02-12 17:22:24 +01:00
|
|
|
}
|
|
|
|
|
2015-04-21 16:45:27 +02:00
|
|
|
static void xmb_list_switch_old(xmb_handle_t *xmb,
|
|
|
|
file_list_t *list, int dir, size_t current)
|
2014-11-14 21:56:21 +01:00
|
|
|
{
|
2018-04-09 15:56:45 +02:00
|
|
|
unsigned i, height;
|
|
|
|
size_t end = file_list_get_size(list);
|
|
|
|
float ix = -xmb->icon_spacing_horizontal * dir;
|
|
|
|
float ia = 0;
|
|
|
|
unsigned first = 0;
|
|
|
|
unsigned last = (unsigned)(end > 0 ? end - 1 : 0);
|
2017-08-30 22:23:29 -03:00
|
|
|
|
|
|
|
video_driver_get_size(NULL, &height);
|
2018-03-30 15:50:11 +02:00
|
|
|
xmb_calculate_visible_range(xmb, height, end,
|
2018-04-09 15:56:45 +02:00
|
|
|
(unsigned)current, &first, &last);
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2015-02-12 17:22:24 +01:00
|
|
|
for (i = 0; i < end; i++)
|
2014-11-14 21:56:21 +01:00
|
|
|
{
|
2015-02-01 15:25:37 +01:00
|
|
|
xmb_node_t *node = (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(list, i);
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2015-02-11 06:11:25 +01:00
|
|
|
if (!node)
|
2015-06-06 14:07:20 +02:00
|
|
|
continue;
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2017-08-30 22:23:29 -03:00
|
|
|
if (i >= first && i <= last)
|
|
|
|
xmb_push_animations(node, (uintptr_t)list, ia, ix);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
node->alpha = node->label_alpha = ia;
|
|
|
|
node->x = ix;
|
|
|
|
}
|
2014-11-14 21:56:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-21 16:45:27 +02:00
|
|
|
static void xmb_list_switch_new(xmb_handle_t *xmb,
|
|
|
|
file_list_t *list, int dir, size_t current)
|
2014-11-14 21:56:21 +01:00
|
|
|
{
|
2017-08-30 22:23:29 -03:00
|
|
|
unsigned i, first, last, height;
|
2015-06-14 04:19:25 +02:00
|
|
|
size_t end = 0;
|
2015-06-04 17:17:23 +07:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-02-13 19:00:34 +01:00
|
|
|
|
2017-04-28 13:43:47 +02:00
|
|
|
if (settings->bools.menu_dynamic_wallpaper_enable)
|
2015-06-04 17:17:23 +07:00
|
|
|
{
|
2017-09-11 02:37:53 +02:00
|
|
|
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
|
|
|
|
char *path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
char *tmp = string_replace_substring(xmb->title_name, "/", " ");
|
2015-06-04 17:17:23 +07:00
|
|
|
|
2017-09-11 02:37:53 +02:00
|
|
|
path[0] = '\0';
|
2016-10-08 19:25:05 +02:00
|
|
|
|
2015-06-04 17:17:23 +07:00
|
|
|
if (tmp)
|
|
|
|
{
|
2016-06-28 13:05:46 +02:00
|
|
|
fill_pathname_join_noext(
|
2016-04-28 19:26:02 +02:00
|
|
|
path,
|
2017-04-29 00:39:29 +02:00
|
|
|
settings->paths.directory_dynamic_wallpapers,
|
2016-04-28 19:26:02 +02:00
|
|
|
tmp,
|
2017-09-11 02:37:53 +02:00
|
|
|
path_size);
|
2015-06-04 17:17:23 +07:00
|
|
|
free(tmp);
|
|
|
|
}
|
|
|
|
|
2016-07-01 17:04:11 +02:00
|
|
|
strlcat(path,
|
|
|
|
file_path_str(FILE_PATH_PNG_EXTENSION),
|
2017-09-11 02:37:53 +02:00
|
|
|
path_size);
|
2016-03-09 16:17:18 -05:00
|
|
|
|
2017-12-14 20:05:46 +01:00
|
|
|
if (!filestream_exists(path))
|
2017-09-11 02:37:53 +02:00
|
|
|
fill_pathname_application_special(path, path_size,
|
2016-06-11 20:11:36 +02:00
|
|
|
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG);
|
2016-03-09 16:17:18 -05:00
|
|
|
|
2018-04-23 12:03:50 +02:00
|
|
|
if(!string_is_equal(path, xmb->bg_file_path))
|
|
|
|
{
|
|
|
|
if(filestream_exists(path))
|
|
|
|
{
|
|
|
|
task_push_image_load(path,
|
2015-11-24 13:50:37 -03:00
|
|
|
menu_display_handle_wallpaper_upload, NULL);
|
2018-04-23 12:03:50 +02:00
|
|
|
if (!string_is_empty(xmb->bg_file_path))
|
|
|
|
free(xmb->bg_file_path);
|
|
|
|
xmb->bg_file_path = strdup(path);
|
|
|
|
}
|
|
|
|
}
|
2017-09-11 02:37:53 +02:00
|
|
|
|
2018-04-23 12:03:50 +02:00
|
|
|
free(path);
|
2015-06-04 17:17:23 +07:00
|
|
|
}
|
|
|
|
|
2015-02-13 19:00:34 +01:00
|
|
|
end = file_list_get_size(list);
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2017-08-30 22:23:29 -03:00
|
|
|
first = 0;
|
2018-04-09 15:56:45 +02:00
|
|
|
last = (unsigned)(end > 0 ? end - 1 : 0);
|
2017-08-30 22:23:29 -03:00
|
|
|
|
|
|
|
video_driver_get_size(NULL, &height);
|
2018-04-09 15:56:45 +02:00
|
|
|
xmb_calculate_visible_range(xmb, height, end, (unsigned)current, &first, &last);
|
2017-08-30 22:23:29 -03:00
|
|
|
|
2015-02-12 17:22:24 +01:00
|
|
|
for (i = 0; i < end; i++)
|
2014-11-14 21:56:21 +01:00
|
|
|
{
|
2015-02-01 15:25:37 +01:00
|
|
|
xmb_node_t *node = (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(list, i);
|
2017-09-28 08:42:12 +02:00
|
|
|
float ia = xmb->items_passive_alpha;
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2015-02-11 06:15:15 +01:00
|
|
|
if (!node)
|
2015-06-06 14:07:20 +02:00
|
|
|
continue;
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
node->x = xmb->icon_spacing_horizontal * dir;
|
2015-02-02 20:48:26 +01:00
|
|
|
node->alpha = 0;
|
2014-11-14 23:39:24 +01:00
|
|
|
node->label_alpha = 0;
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2015-01-10 23:45:14 +01:00
|
|
|
if (i == current)
|
2017-09-28 08:42:12 +02:00
|
|
|
ia = xmb->items_active_alpha;
|
2015-06-06 14:07:20 +02:00
|
|
|
|
2017-08-30 22:23:29 -03:00
|
|
|
if (i >= first && i <= last)
|
|
|
|
xmb_push_animations(node, (uintptr_t)list, ia, 0);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
node->x = 0;
|
|
|
|
node->alpha = node->label_alpha = ia;
|
|
|
|
}
|
2014-11-14 21:56:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-13 19:00:34 +01:00
|
|
|
static void xmb_set_title(xmb_handle_t *xmb)
|
2014-11-15 00:35:45 +01:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
if (xmb->categories_selection_ptr <= xmb->system_tab_end)
|
2014-11-15 00:35:45 +01:00
|
|
|
{
|
2015-10-25 00:37:59 +07:00
|
|
|
menu_entries_get_title(xmb->title_name, sizeof(xmb->title_name));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *path = NULL;
|
|
|
|
menu_entries_get_at_offset(
|
|
|
|
xmb->horizontal_list,
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_selection_ptr - (xmb->system_tab_end + 1),
|
2015-10-25 00:37:59 +07:00
|
|
|
&path, NULL, NULL, NULL, NULL);
|
2014-11-15 00:35:45 +01:00
|
|
|
|
2015-10-25 00:37:59 +07:00
|
|
|
if (!path)
|
|
|
|
return;
|
2014-11-15 00:35:45 +01:00
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
fill_pathname_base_noext(
|
|
|
|
xmb->title_name, path, sizeof(xmb->title_name));
|
2015-10-25 00:37:59 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static xmb_node_t* xmb_get_node(xmb_handle_t *xmb, unsigned i)
|
|
|
|
{
|
2016-08-18 16:42:39 +02:00
|
|
|
switch (xmb_get_system_tab(xmb, i))
|
2016-08-17 15:07:17 +02:00
|
|
|
{
|
|
|
|
case XMB_SYSTEM_TAB_SETTINGS:
|
|
|
|
return &xmb->settings_tab_node;
|
2016-07-30 19:29:10 +02:00
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_IMAGES:
|
|
|
|
return &xmb->images_tab_node;
|
2016-07-30 19:29:10 +02:00
|
|
|
#endif
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_MUSIC:
|
|
|
|
return &xmb->music_tab_node;
|
2018-06-20 04:50:58 +02:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2016-12-12 03:54:53 -06:00
|
|
|
case XMB_SYSTEM_TAB_VIDEO:
|
|
|
|
return &xmb->video_tab_node;
|
2016-07-30 19:29:10 +02:00
|
|
|
#endif
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_HISTORY:
|
|
|
|
return &xmb->history_tab_node;
|
2017-08-12 16:37:20 +02:00
|
|
|
case XMB_SYSTEM_TAB_FAVORITES:
|
|
|
|
return &xmb->favorites_tab_node;
|
2017-01-22 17:57:49 -05:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-01-18 22:46:48 -05:00
|
|
|
case XMB_SYSTEM_TAB_NETPLAY:
|
|
|
|
return &xmb->netplay_tab_node;
|
2017-01-22 17:57:49 -05:00
|
|
|
#endif
|
2017-02-27 22:36:45 +01:00
|
|
|
case XMB_SYSTEM_TAB_ADD:
|
|
|
|
return &xmb->add_tab_node;
|
2016-08-17 15:07:17 +02:00
|
|
|
default:
|
2016-08-18 16:42:39 +02:00
|
|
|
if (i > xmb->system_tab_end)
|
2016-08-17 15:07:17 +02:00
|
|
|
return xmb_get_userdata_from_horizontal_list(
|
2016-08-18 16:42:39 +02:00
|
|
|
xmb, i - (xmb->system_tab_end + 1));
|
2016-08-17 15:07:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return &xmb->main_menu_node;
|
2014-11-15 00:35:45 +01:00
|
|
|
}
|
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb)
|
2014-10-09 01:21:22 +02:00
|
|
|
{
|
2014-11-14 21:56:21 +01:00
|
|
|
unsigned j;
|
2016-03-09 16:17:18 -05:00
|
|
|
size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
|
2016-08-18 16:42:39 +02:00
|
|
|
+ xmb->system_tab_end;
|
2015-01-26 21:59:55 +01:00
|
|
|
|
2016-08-18 14:06:54 +02:00
|
|
|
for (j = 0; j <= list_size; j++)
|
2014-11-14 21:56:21 +01:00
|
|
|
{
|
2016-02-25 15:44:30 +01:00
|
|
|
menu_animation_ctx_entry_t entry;
|
2017-09-28 08:42:12 +02:00
|
|
|
float ia = xmb->categories_passive_alpha;
|
|
|
|
float iz = xmb->categories_passive_zoom;
|
2015-10-25 00:37:59 +07:00
|
|
|
xmb_node_t *node = xmb_get_node(xmb, j);
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2015-01-26 21:59:55 +01:00
|
|
|
if (!node)
|
|
|
|
continue;
|
2015-06-06 14:07:20 +02:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
if (j == xmb->categories_active_idx)
|
2015-02-02 20:40:29 +01:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
ia = xmb->categories_active_alpha;
|
|
|
|
iz = xmb->categories_active_zoom;
|
2015-02-02 20:40:29 +01:00
|
|
|
}
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2016-02-25 15:44:30 +01:00
|
|
|
entry.duration = XMB_DELAY;
|
|
|
|
entry.target_value = ia;
|
|
|
|
entry.subject = &node->alpha;
|
2016-04-22 18:10:20 +07:00
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
2017-09-06 00:21:20 +02:00
|
|
|
/* TODO/FIXME - integer conversion resulted in change of sign */
|
2017-10-03 21:16:11 -03:00
|
|
|
entry.tag = -1;
|
2016-02-25 15:44:30 +01:00
|
|
|
entry.cb = NULL;
|
|
|
|
|
2017-08-11 01:20:57 +02:00
|
|
|
menu_animation_push(&entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
|
|
|
entry.target_value = iz;
|
|
|
|
entry.subject = &node->zoom;
|
|
|
|
|
2017-08-11 01:20:57 +02:00
|
|
|
menu_animation_push(&entry);
|
2015-01-26 21:59:55 +01:00
|
|
|
}
|
2015-06-07 13:09:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void xmb_list_switch(xmb_handle_t *xmb)
|
|
|
|
{
|
2017-09-28 06:02:14 +02:00
|
|
|
menu_animation_ctx_entry_t anim_entry;
|
2017-04-23 14:31:49 +02:00
|
|
|
int dir = -1;
|
2015-10-27 10:10:33 +01:00
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2017-07-14 15:11:27 -04:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-06-07 13:09:35 +02:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
if (xmb->categories_selection_ptr > xmb->categories_selection_ptr_old)
|
2015-06-07 13:09:35 +02:00
|
|
|
dir = 1;
|
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_active_idx += dir;
|
2015-06-07 13:09:35 +02:00
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
xmb_list_switch_horizontal_list(xmb);
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.duration = XMB_DELAY;
|
2018-08-04 14:19:18 -03:00
|
|
|
anim_entry.target_value = xmb->icon_spacing_horizontal
|
2018-03-30 15:50:11 +02:00
|
|
|
* -(float)xmb->categories_selection_ptr;
|
2017-09-28 08:42:12 +02:00
|
|
|
anim_entry.subject = &xmb->categories_x_pos;
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.easing_enum = EASING_OUT_QUAD;
|
2017-09-06 00:21:20 +02:00
|
|
|
/* TODO/FIXME - integer conversion resulted in change of sign */
|
2017-09-28 06:02:14 +02:00
|
|
|
anim_entry.tag = -1;
|
|
|
|
anim_entry.cb = NULL;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-28 06:02:14 +02:00
|
|
|
if (anim_entry.subject)
|
|
|
|
menu_animation_push(&anim_entry);
|
2015-02-02 20:40:29 +01:00
|
|
|
|
|
|
|
dir = -1;
|
2017-09-28 08:42:12 +02:00
|
|
|
if (xmb->categories_selection_ptr > xmb->categories_selection_ptr_old)
|
2015-02-02 20:40:29 +01:00
|
|
|
dir = 1;
|
|
|
|
|
2015-04-21 16:45:27 +02:00
|
|
|
xmb_list_switch_old(xmb, xmb->selection_buf_old,
|
|
|
|
dir, xmb->selection_ptr_old);
|
2017-07-14 15:11:27 -04:00
|
|
|
|
2017-08-06 17:12:57 +02:00
|
|
|
/* Check if we are to have horizontal animations. */
|
|
|
|
if (settings->bools.menu_horizontal_animation)
|
2017-07-14 15:11:27 -04:00
|
|
|
xmb_list_switch_new(xmb, selection_buf, dir, selection);
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_active_idx_old = (unsigned)xmb->categories_selection_ptr;
|
2015-06-18 09:32:56 +07:00
|
|
|
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!string_is_equal(xmb_thumbnails_ident('R'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
menu_entry_t entry;
|
|
|
|
|
|
|
|
menu_entry_init(&entry);
|
|
|
|
menu_entry_get(&entry, 0, selection, NULL, true);
|
|
|
|
|
|
|
|
if (!string_is_empty(entry.path))
|
|
|
|
xmb_set_thumbnail_content(xmb, entry.path, 0 /* will be ignored */);
|
|
|
|
|
|
|
|
menu_entry_free(&entry);
|
|
|
|
|
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'R');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
|
|
|
if (!string_is_equal(xmb_thumbnails_ident('L'),
|
2016-12-15 11:23:08 +01:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
2015-11-19 23:39:48 +07:00
|
|
|
{
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_t entry;
|
2017-05-15 13:05:33 +02:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_init(&entry);
|
|
|
|
menu_entry_get(&entry, 0, selection, NULL, true);
|
2017-05-15 13:05:33 +02:00
|
|
|
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(entry.path))
|
2017-09-29 18:37:04 +02:00
|
|
|
xmb_set_thumbnail_content(xmb, entry.path, 0 /* will be ignored */);
|
2017-09-28 06:02:14 +02:00
|
|
|
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_free(&entry);
|
2017-05-15 13:05:33 +02:00
|
|
|
|
2018-03-25 12:27:17 -03:00
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'L');
|
2016-04-08 01:42:53 +07:00
|
|
|
xmb_update_thumbnail_image(xmb);
|
2015-11-19 23:39:48 +07:00
|
|
|
}
|
2015-01-26 21:59:55 +01:00
|
|
|
}
|
2014-11-14 21:56:21 +01:00
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
static void xmb_list_open_horizontal_list(xmb_handle_t *xmb)
|
2015-01-26 21:59:55 +01:00
|
|
|
{
|
|
|
|
unsigned j;
|
2016-03-09 16:17:18 -05:00
|
|
|
size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
|
2016-08-18 16:42:39 +02:00
|
|
|
+ xmb->system_tab_end;
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2016-08-18 14:06:54 +02:00
|
|
|
for (j = 0; j <= list_size; j++)
|
2014-11-11 18:15:00 +01:00
|
|
|
{
|
2017-09-29 16:54:57 +02:00
|
|
|
menu_animation_ctx_entry_t anim_entry;
|
2015-03-22 08:09:00 +01:00
|
|
|
float ia = 0;
|
2015-10-25 00:37:59 +07:00
|
|
|
xmb_node_t *node = xmb_get_node(xmb, j);
|
2014-11-11 18:15:00 +01:00
|
|
|
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
if (j == xmb->categories_active_idx)
|
|
|
|
ia = xmb->categories_active_alpha;
|
2015-02-02 20:40:29 +01:00
|
|
|
else if (xmb->depth <= 1)
|
2017-09-28 08:42:12 +02:00
|
|
|
ia = xmb->categories_passive_alpha;
|
2015-02-02 20:40:29 +01:00
|
|
|
|
2017-09-29 16:54:57 +02:00
|
|
|
anim_entry.duration = XMB_DELAY;
|
|
|
|
anim_entry.target_value = ia;
|
|
|
|
anim_entry.subject = &node->alpha;
|
|
|
|
anim_entry.easing_enum = EASING_OUT_QUAD;
|
2017-09-06 00:21:20 +02:00
|
|
|
/* TODO/FIXME - integer conversion resulted in change of sign */
|
2017-09-29 16:54:57 +02:00
|
|
|
anim_entry.tag = -1;
|
|
|
|
anim_entry.cb = NULL;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-09-29 16:54:57 +02:00
|
|
|
if (anim_entry.subject)
|
|
|
|
menu_animation_push(&anim_entry);
|
2014-11-11 18:15:00 +01:00
|
|
|
}
|
2015-06-07 13:09:35 +02:00
|
|
|
}
|
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
static void xmb_context_destroy_horizontal_list(xmb_handle_t *xmb)
|
2015-11-02 22:56:05 +01:00
|
|
|
{
|
|
|
|
unsigned i;
|
2015-12-10 15:23:43 +01:00
|
|
|
size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL);
|
2015-11-02 22:56:05 +01:00
|
|
|
|
|
|
|
for (i = 0; i < list_size; i++)
|
|
|
|
{
|
2016-01-08 22:26:13 +01:00
|
|
|
const char *path = NULL;
|
2015-11-02 22:56:05 +01:00
|
|
|
xmb_node_t *node = xmb_get_userdata_from_horizontal_list(xmb, i);
|
|
|
|
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
|
2016-01-08 22:26:13 +01:00
|
|
|
file_list_get_at_offset(xmb->horizontal_list, i,
|
|
|
|
&path, NULL, NULL, NULL);
|
2016-03-09 16:17:18 -05:00
|
|
|
|
2016-06-26 10:12:28 +02:00
|
|
|
if (!path || !strstr(path, file_path_str(FILE_PATH_LPL_EXTENSION)))
|
2016-01-08 22:26:13 +01:00
|
|
|
continue;
|
|
|
|
|
2016-02-16 20:24:00 +01:00
|
|
|
video_driver_texture_unload(&node->icon);
|
|
|
|
video_driver_texture_unload(&node->content_icon);
|
2015-11-02 22:56:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
static void xmb_init_horizontal_list(xmb_handle_t *xmb)
|
2015-11-02 22:56:05 +01:00
|
|
|
{
|
2016-12-19 18:40:00 +01:00
|
|
|
menu_displaylist_info_t info;
|
2015-11-02 22:56:05 +01:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2017-09-10 23:22:09 +02:00
|
|
|
menu_displaylist_info_init(&info);
|
|
|
|
|
2016-12-19 18:40:00 +01:00
|
|
|
info.list = xmb->horizontal_list;
|
2017-09-28 03:06:54 +02:00
|
|
|
info.path = strdup(
|
|
|
|
settings->paths.directory_playlist);
|
2017-09-28 02:45:03 +02:00
|
|
|
info.label = strdup(
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST));
|
2017-09-28 01:37:39 +02:00
|
|
|
info.exts = strdup(
|
|
|
|
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT));
|
2016-12-19 18:40:00 +01:00
|
|
|
info.type_default = FILE_TYPE_PLAIN;
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST;
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2018-04-17 17:53:24 +02:00
|
|
|
if (settings->bools.menu_content_show_playlists && !string_is_empty(info.path))
|
2016-10-11 03:49:47 +01:00
|
|
|
{
|
2017-05-23 10:46:42 +02:00
|
|
|
if (menu_displaylist_ctl(DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL, &info))
|
|
|
|
{
|
|
|
|
size_t i;
|
2017-09-10 23:22:09 +02:00
|
|
|
for (i = 0; i < xmb->horizontal_list->size; i++)
|
2017-05-23 10:46:42 +02:00
|
|
|
xmb_node_allocate_userdata(xmb, (unsigned)i);
|
2017-05-26 20:12:52 +02:00
|
|
|
menu_displaylist_process(&info);
|
2017-05-23 10:46:42 +02:00
|
|
|
}
|
2016-10-11 03:49:47 +01:00
|
|
|
}
|
2017-09-28 03:53:48 +02:00
|
|
|
|
|
|
|
menu_displaylist_info_free(&info);
|
2015-11-02 22:56:05 +01:00
|
|
|
}
|
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
static void xmb_toggle_horizontal_list(xmb_handle_t *xmb)
|
2015-11-02 22:56:05 +01:00
|
|
|
{
|
|
|
|
unsigned i;
|
2016-03-09 16:17:18 -05:00
|
|
|
size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
|
2016-08-18 16:42:39 +02:00
|
|
|
+ xmb->system_tab_end;
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2016-08-18 14:06:54 +02:00
|
|
|
for (i = 0; i <= list_size; i++)
|
2015-11-02 22:56:05 +01:00
|
|
|
{
|
|
|
|
xmb_node_t *node = xmb_get_node(xmb, i);
|
|
|
|
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
node->alpha = 0;
|
2017-09-28 08:42:12 +02:00
|
|
|
node->zoom = xmb->categories_passive_zoom;
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
if (i == xmb->categories_active_idx)
|
2015-11-02 22:56:05 +01:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
node->alpha = xmb->categories_active_alpha;
|
|
|
|
node->zoom = xmb->categories_active_zoom;
|
2015-11-02 22:56:05 +01:00
|
|
|
}
|
|
|
|
else if (xmb->depth <= 1)
|
2017-09-28 08:42:12 +02:00
|
|
|
node->alpha = xmb->categories_passive_alpha;
|
2015-11-02 22:56:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-04 21:40:29 +01:00
|
|
|
static void xmb_context_reset_horizontal_list(
|
2016-06-11 19:50:44 +02:00
|
|
|
xmb_handle_t *xmb)
|
2015-11-02 22:56:05 +01:00
|
|
|
{
|
|
|
|
unsigned i;
|
2015-11-07 10:36:27 +07:00
|
|
|
int depth; /* keep this integer */
|
2017-10-03 21:16:11 -03:00
|
|
|
size_t list_size =
|
2017-09-11 02:37:53 +02:00
|
|
|
xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL);
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2018-08-04 14:19:18 -03:00
|
|
|
xmb->categories_x_pos =
|
2018-03-30 15:50:11 +02:00
|
|
|
xmb->icon_spacing_horizontal *
|
2017-09-28 08:42:12 +02:00
|
|
|
-(float)xmb->categories_selection_ptr;
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
depth = (xmb->depth > 1) ? 2 : 1;
|
|
|
|
xmb->x = xmb->icon_size * -(depth*2-2);
|
2015-11-04 05:17:21 +07:00
|
|
|
|
2015-11-02 22:56:05 +01:00
|
|
|
for (i = 0; i < list_size; i++)
|
|
|
|
{
|
|
|
|
const char *path = NULL;
|
2016-03-09 16:17:18 -05:00
|
|
|
xmb_node_t *node =
|
2016-02-04 21:40:29 +01:00
|
|
|
xmb_get_userdata_from_horizontal_list(xmb, i);
|
2015-11-02 22:56:05 +01:00
|
|
|
|
|
|
|
if (!node)
|
|
|
|
{
|
|
|
|
node = xmb_node_allocate_userdata(xmb, i);
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
file_list_get_at_offset(xmb->horizontal_list, i,
|
|
|
|
&path, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
if (!path)
|
|
|
|
continue;
|
|
|
|
|
2016-06-26 10:12:28 +02:00
|
|
|
if (!strstr(path, file_path_str(FILE_PATH_LPL_EXTENSION)))
|
2016-01-08 09:33:53 +01:00
|
|
|
continue;
|
|
|
|
|
2017-09-12 04:37:58 +02:00
|
|
|
{
|
|
|
|
struct texture_image ti;
|
2018-09-02 12:49:44 -07:00
|
|
|
char *sysname = (char*)
|
|
|
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
2018-03-30 15:50:11 +02:00
|
|
|
char *iconpath = (char*)
|
|
|
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
char *texturepath = (char*)
|
|
|
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
char *content_texturepath = (char*)
|
|
|
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2017-09-12 04:37:58 +02:00
|
|
|
iconpath[0] = sysname[0] =
|
2018-04-23 12:03:50 +02:00
|
|
|
texturepath[0] = content_texturepath[0] = '\0';
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2018-09-02 12:49:44 -07:00
|
|
|
fill_pathname_base_noext(sysname, path,
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2017-09-12 04:37:58 +02:00
|
|
|
fill_pathname_application_special(iconpath,
|
|
|
|
PATH_MAX_LENGTH * sizeof(char),
|
|
|
|
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
|
2016-10-18 04:15:24 +02:00
|
|
|
|
2017-09-12 04:37:58 +02:00
|
|
|
fill_pathname_join_concat(texturepath, iconpath, sysname,
|
|
|
|
file_path_str(FILE_PATH_PNG_EXTENSION),
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
|
2018-08-27 10:43:31 -03:00
|
|
|
/* If the playlist icon doesn't exist return default */
|
|
|
|
|
|
|
|
if (!filestream_exists(texturepath))
|
|
|
|
fill_pathname_join_concat(texturepath, iconpath, "default",
|
|
|
|
file_path_str(FILE_PATH_PNG_EXTENSION),
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
|
2017-09-12 04:37:58 +02:00
|
|
|
ti.width = 0;
|
|
|
|
ti.height = 0;
|
|
|
|
ti.pixels = NULL;
|
|
|
|
ti.supports_rgba = video_driver_supports_rgba();
|
|
|
|
|
|
|
|
if (image_texture_load(&ti, texturepath))
|
2016-07-17 15:58:14 +02:00
|
|
|
{
|
2017-09-12 04:37:58 +02:00
|
|
|
if(ti.pixels)
|
|
|
|
{
|
|
|
|
video_driver_texture_unload(&node->icon);
|
|
|
|
video_driver_texture_load(&ti,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR, &node->icon);
|
|
|
|
}
|
2016-07-17 15:58:14 +02:00
|
|
|
|
2017-09-12 04:37:58 +02:00
|
|
|
image_texture_free(&ti);
|
|
|
|
}
|
2015-11-02 22:56:05 +01:00
|
|
|
|
2018-08-27 10:43:31 -03:00
|
|
|
fill_pathname_join_delim(sysname, sysname,
|
2017-09-12 04:37:58 +02:00
|
|
|
file_path_str(FILE_PATH_CONTENT_BASENAME), '-',
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
2018-08-27 10:43:31 -03:00
|
|
|
strlcat(content_texturepath, iconpath, PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
strlcat(content_texturepath, sysname, PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
|
|
|
|
/* If the content icon doesn't exist return default-content */
|
|
|
|
|
|
|
|
if (!filestream_exists(content_texturepath))
|
|
|
|
{
|
|
|
|
strlcat(iconpath, "default", PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
fill_pathname_join_delim(content_texturepath, iconpath,
|
|
|
|
file_path_str(FILE_PATH_CONTENT_BASENAME), '-',
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
}
|
2016-07-17 15:59:38 +02:00
|
|
|
|
2017-09-12 04:37:58 +02:00
|
|
|
if (image_texture_load(&ti, content_texturepath))
|
2016-07-17 15:58:14 +02:00
|
|
|
{
|
2017-09-12 04:37:58 +02:00
|
|
|
if(ti.pixels)
|
|
|
|
{
|
|
|
|
video_driver_texture_unload(&node->content_icon);
|
|
|
|
video_driver_texture_load(&ti,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR, &node->content_icon);
|
|
|
|
}
|
|
|
|
|
|
|
|
image_texture_free(&ti);
|
2016-07-17 15:58:14 +02:00
|
|
|
}
|
2016-01-30 02:39:08 +01:00
|
|
|
|
2018-09-02 12:49:44 -07:00
|
|
|
free(sysname);
|
2017-09-12 04:37:58 +02:00
|
|
|
free(iconpath);
|
|
|
|
free(texturepath);
|
|
|
|
free(content_texturepath);
|
2016-07-16 20:32:00 -06:00
|
|
|
}
|
2015-11-02 22:56:05 +01:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_toggle_horizontal_list(xmb);
|
2015-11-02 22:56:05 +01:00
|
|
|
}
|
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
static void xmb_refresh_horizontal_list(xmb_handle_t *xmb)
|
2015-07-07 17:04:03 +07:00
|
|
|
{
|
2015-12-10 15:28:05 +01:00
|
|
|
xmb_context_destroy_horizontal_list(xmb);
|
2015-07-07 17:04:03 +07:00
|
|
|
if (xmb->horizontal_list)
|
2017-09-03 09:48:31 -03:00
|
|
|
{
|
|
|
|
xmb_free_list_nodes(xmb->horizontal_list, false);
|
2016-05-24 13:07:54 +10:00
|
|
|
file_list_free(xmb->horizontal_list);
|
2017-09-03 09:48:31 -03:00
|
|
|
}
|
2015-07-07 17:04:03 +07:00
|
|
|
xmb->horizontal_list = NULL;
|
2015-07-08 01:01:41 +02:00
|
|
|
|
2015-12-07 16:55:13 +01:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
2015-10-25 01:40:07 +07:00
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
xmb->horizontal_list = (file_list_t*)
|
|
|
|
calloc(1, sizeof(file_list_t));
|
2016-12-19 18:40:00 +01:00
|
|
|
|
|
|
|
if (xmb->horizontal_list)
|
|
|
|
xmb_init_horizontal_list(xmb);
|
|
|
|
|
2016-06-11 19:50:44 +02:00
|
|
|
xmb_context_reset_horizontal_list(xmb);
|
2015-07-07 17:04:03 +07:00
|
|
|
}
|
|
|
|
|
2016-02-25 19:30:14 +01:00
|
|
|
static int xmb_environ(enum menu_environ_cb type, void *data, void *userdata)
|
2015-07-08 00:37:44 +02:00
|
|
|
{
|
2016-12-23 22:12:30 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)userdata;
|
|
|
|
|
2015-07-08 00:37:44 +02:00
|
|
|
switch (type)
|
|
|
|
{
|
2016-12-23 22:12:30 +01:00
|
|
|
case MENU_ENVIRON_ENABLE_MOUSE_CURSOR:
|
|
|
|
if (!xmb)
|
|
|
|
return -1;
|
|
|
|
xmb->mouse_show = true;
|
|
|
|
break;
|
|
|
|
case MENU_ENVIRON_DISABLE_MOUSE_CURSOR:
|
|
|
|
if (!xmb)
|
|
|
|
return -1;
|
|
|
|
xmb->mouse_show = false;
|
|
|
|
break;
|
2015-07-08 00:37:44 +02:00
|
|
|
case MENU_ENVIRON_RESET_HORIZONTAL_LIST:
|
2016-12-23 22:12:30 +01:00
|
|
|
if (!xmb)
|
|
|
|
return -1;
|
2015-07-08 00:37:44 +02:00
|
|
|
|
2016-12-23 22:12:30 +01:00
|
|
|
xmb_refresh_horizontal_list(xmb);
|
2015-07-08 00:37:44 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-07 13:09:35 +02:00
|
|
|
static void xmb_list_open(xmb_handle_t *xmb)
|
|
|
|
{
|
2016-02-25 15:44:30 +01:00
|
|
|
menu_animation_ctx_entry_t entry;
|
|
|
|
|
2015-10-17 18:17:59 +02:00
|
|
|
int dir = 0;
|
2015-10-27 10:10:33 +01:00
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2015-06-07 13:09:35 +02:00
|
|
|
|
2017-02-26 10:33:03 +01:00
|
|
|
xmb->depth = (int)xmb_list_get_size(xmb, MENU_LIST_PLAIN);
|
2015-06-07 13:09:35 +02:00
|
|
|
|
|
|
|
if (xmb->depth > xmb->old_depth)
|
|
|
|
dir = 1;
|
|
|
|
else if (xmb->depth < xmb->old_depth)
|
|
|
|
dir = -1;
|
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
xmb_list_open_horizontal_list(xmb);
|
2014-11-11 18:15:00 +01:00
|
|
|
|
2015-04-21 16:45:27 +02:00
|
|
|
xmb_list_open_old(xmb, xmb->selection_buf_old,
|
|
|
|
dir, xmb->selection_ptr_old);
|
2015-10-17 18:17:59 +02:00
|
|
|
xmb_list_open_new(xmb, selection_buf,
|
2015-09-25 16:25:33 +02:00
|
|
|
dir, selection);
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2016-02-25 15:44:30 +01:00
|
|
|
entry.duration = XMB_DELAY;
|
2017-09-28 08:42:12 +02:00
|
|
|
entry.target_value = xmb->icon_size * -(xmb->depth*2-2);
|
2016-02-25 15:44:30 +01:00
|
|
|
entry.subject = &xmb->x;
|
2016-04-22 18:10:20 +07:00
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
2017-09-06 00:21:20 +02:00
|
|
|
/* TODO/FIXME - integer conversion resulted in change of sign */
|
2016-02-25 15:44:30 +01:00
|
|
|
entry.tag = -1;
|
|
|
|
entry.cb = NULL;
|
|
|
|
|
2015-02-01 15:25:37 +01:00
|
|
|
switch (xmb->depth)
|
|
|
|
{
|
|
|
|
case 1:
|
2017-08-11 01:20:57 +02:00
|
|
|
menu_animation_push(&entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
|
|
|
entry.target_value = 0;
|
2017-09-28 08:42:12 +02:00
|
|
|
entry.subject = &xmb->textures_arrow_alpha;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-08-11 01:20:57 +02:00
|
|
|
menu_animation_push(&entry);
|
2015-02-01 15:25:37 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2017-08-11 01:20:57 +02:00
|
|
|
menu_animation_push(&entry);
|
2016-02-25 15:44:30 +01:00
|
|
|
|
|
|
|
entry.target_value = 1;
|
2017-09-28 08:42:12 +02:00
|
|
|
entry.subject = &xmb->textures_arrow_alpha;
|
2016-02-25 15:44:30 +01:00
|
|
|
|
2017-08-11 01:20:57 +02:00
|
|
|
menu_animation_push(&entry);
|
2015-02-01 15:25:37 +01:00
|
|
|
break;
|
|
|
|
}
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2014-10-20 20:00:39 +02:00
|
|
|
xmb->old_depth = xmb->depth;
|
|
|
|
}
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2015-12-10 16:45:38 +01:00
|
|
|
static void xmb_populate_entries(void *data,
|
|
|
|
const char *path,
|
2015-09-21 21:32:31 +02:00
|
|
|
const char *label, unsigned k)
|
2015-01-26 21:59:55 +01:00
|
|
|
{
|
2015-12-10 16:45:38 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-01-26 21:59:55 +01:00
|
|
|
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
|
2015-12-07 16:55:13 +01:00
|
|
|
if (menu_driver_ctl(RARCH_MENU_CTL_IS_PREVENT_POPULATE, NULL))
|
2015-01-28 19:09:21 +01:00
|
|
|
{
|
2015-12-10 16:14:53 +01:00
|
|
|
xmb_selection_pointer_changed(xmb, false);
|
2015-12-07 16:55:13 +01:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!string_is_equal(xmb_thumbnails_ident('R'),
|
2018-06-05 10:51:51 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'R');
|
2016-04-08 01:42:53 +07:00
|
|
|
xmb_update_thumbnail_image(xmb);
|
2018-06-05 10:51:51 +02:00
|
|
|
}
|
2016-12-01 02:43:53 +01:00
|
|
|
xmb_update_savestate_thumbnail_image(xmb);
|
2018-03-25 12:27:17 -03:00
|
|
|
if (!string_is_equal(xmb_thumbnails_ident('L'),
|
2018-06-05 10:51:51 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'L');
|
2018-03-25 12:27:17 -03:00
|
|
|
xmb_update_thumbnail_image(xmb);
|
2018-06-05 10:51:51 +02:00
|
|
|
}
|
2015-01-28 19:09:21 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-02-13 19:00:34 +01:00
|
|
|
xmb_set_title(xmb);
|
2015-01-26 21:59:55 +01:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
if (xmb->categories_selection_ptr != xmb->categories_active_idx_old)
|
2015-02-13 19:00:34 +01:00
|
|
|
xmb_list_switch(xmb);
|
2015-02-23 21:40:36 +01:00
|
|
|
else
|
|
|
|
xmb_list_open(xmb);
|
2015-01-26 21:59:55 +01:00
|
|
|
}
|
|
|
|
|
2015-11-08 01:30:07 +01:00
|
|
|
static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
|
2016-10-30 17:14:13 -05:00
|
|
|
xmb_node_t *core_node, xmb_node_t *node,
|
2018-11-06 22:48:38 -03:00
|
|
|
enum msg_hash_enums enum_idx, unsigned type, bool active, bool checked)
|
2015-03-10 00:39:18 +01:00
|
|
|
{
|
2016-06-17 21:05:28 +02:00
|
|
|
switch (enum_idx)
|
2016-04-21 02:53:42 +07:00
|
|
|
{
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_CORE_OPTIONS:
|
2016-12-15 11:45:28 +01:00
|
|
|
case MENU_ENUM_LABEL_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CORE_OPTIONS];
|
2017-08-14 00:12:55 +02:00
|
|
|
case MENU_ENUM_LABEL_ADD_TO_FAVORITES:
|
2017-11-25 12:51:12 -05:00
|
|
|
case MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST:
|
2017-08-14 00:12:55 +02:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_ADD_FAVORITE];
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_PARENT_DIRECTORY:
|
|
|
|
case MENU_ENUM_LABEL_UNDO_LOAD_STATE:
|
|
|
|
case MENU_ENUM_LABEL_UNDO_SAVE_STATE:
|
2018-03-22 13:27:37 -04:00
|
|
|
case MENU_ENUM_LABEL_RESET_CORE_ASSOCIATION:
|
2018-08-21 14:19:35 -03:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_UNDO];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_REMAPPING_OPTIONS];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CHEAT_OPTIONS];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_DISK_OPTIONS:
|
2018-11-24 13:21:43 -03:00
|
|
|
case MENU_ENUM_LABEL_DISK_CYCLE_TRAY_STATUS:
|
|
|
|
case MENU_ENUM_LABEL_DISK_IMAGE_APPEND:
|
|
|
|
case MENU_ENUM_LABEL_DISK_INDEX:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_DISK_OPTIONS];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_SHADER_OPTIONS:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SHADER_OPTIONS];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST:
|
2016-11-05 16:55:57 -05:00
|
|
|
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST_HARDCORE:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_ACHIEVEMENT_LIST];
|
2016-06-17 22:36:13 +02:00
|
|
|
case MENU_ENUM_LABEL_SAVE_STATE:
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_SAVESTATE_AUTO_SAVE:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SAVESTATE];
|
2016-06-17 22:36:13 +02:00
|
|
|
case MENU_ENUM_LABEL_LOAD_STATE:
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_CONFIGURATIONS:
|
|
|
|
case MENU_ENUM_LABEL_GAME_SPECIFIC_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_LOAD:
|
|
|
|
case MENU_ENUM_LABEL_AUTO_OVERRIDES_ENABLE:
|
|
|
|
case MENU_ENUM_LABEL_AUTO_REMAPS_ENABLE:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_FILE_LOAD:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_FILE_LOAD_APPEND:
|
|
|
|
case MENU_ENUM_LABEL_SAVESTATE_AUTO_LOAD:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_LOADSTATE];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_TAKE_SCREENSHOT:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SCREENSHOT];
|
2016-08-29 00:54:51 +02:00
|
|
|
case MENU_ENUM_LABEL_DELETE_ENTRY:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CLOSE];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_RESTART_CONTENT:
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_REBOOT:
|
|
|
|
case MENU_ENUM_LABEL_RESET_TO_DEFAULT_CONFIG:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_RELOAD_CHEATS:
|
|
|
|
case MENU_ENUM_LABEL_RESTART_RETROARCH:
|
|
|
|
case MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE:
|
|
|
|
case MENU_ENUM_LABEL_AUTOSAVE_INTERVAL:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_RELOAD];
|
2017-10-02 22:17:44 +02:00
|
|
|
case MENU_ENUM_LABEL_RENAME_ENTRY:
|
2017-08-18 18:30:31 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_RENAME];
|
2016-06-17 21:05:28 +02:00
|
|
|
case MENU_ENUM_LABEL_RESUME_CONTENT:
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_RESUME];
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_DIRECTORY_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_SCAN_DIRECTORY:
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CONTENT_DIR:
|
|
|
|
case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_PARENT:
|
|
|
|
case MENU_ENUM_LABEL_FAVORITES: /* "Start Directory" */
|
2016-12-12 21:47:12 +01:00
|
|
|
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_FOLDER];
|
2016-12-13 03:55:28 +01:00
|
|
|
case MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RDB];
|
2018-08-08 18:47:42 -03:00
|
|
|
|
2019-01-03 13:49:59 -03:00
|
|
|
/* Menu collection submenus */
|
2018-08-08 18:47:42 -03:00
|
|
|
case MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_ZIP];
|
|
|
|
case MENU_ENUM_LABEL_GOTO_FAVORITES:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_FAVORITE];
|
|
|
|
case MENU_ENUM_LABEL_GOTO_IMAGES:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_IMAGE];
|
|
|
|
case MENU_ENUM_LABEL_GOTO_VIDEO:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MOVIE];
|
|
|
|
case MENU_ENUM_LABEL_GOTO_MUSIC:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MUSIC];
|
|
|
|
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_CONTENT_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_ASSETS:
|
|
|
|
case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME:
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_GAME:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_GAME:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_QUICKMENU];
|
|
|
|
case MENU_ENUM_LABEL_START_CORE:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_START_OR_CONT:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RUN];
|
|
|
|
case MENU_ENUM_LABEL_CORE_LIST:
|
|
|
|
case MENU_ENUM_LABEL_SIDELOAD_CORE_LIST:
|
|
|
|
case MENU_ENUM_LABEL_CORE_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_UPDATER_LIST:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_CORE:
|
|
|
|
case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE:
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CORE];
|
|
|
|
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
|
|
|
|
case MENU_ENUM_LABEL_SCAN_FILE:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_FILE];
|
|
|
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
|
|
|
case MENU_ENUM_LABEL_UPDATER_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_UPDATER];
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_LAKKA:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MAIN_MENU];
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CHEATS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CHEAT_OPTIONS];
|
|
|
|
case MENU_ENUM_LABEL_THUMBNAILS_UPDATER_LIST:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_IMAGE];
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_OVERLAYS:
|
|
|
|
case MENU_ENUM_LABEL_ONSCREEN_OVERLAY_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_OVERLAY];
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CG_SHADERS:
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_GLSL_SHADERS:
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_SLANG_SHADERS:
|
|
|
|
case MENU_ENUM_LABEL_AUTO_SHADERS_ENABLE:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_SHADER_OPTIONS];
|
|
|
|
case MENU_ENUM_LABEL_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_INFORMATION_LIST:
|
|
|
|
case MENU_ENUM_LABEL_SYSTEM_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CORE_INFO_FILES:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INFO];
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_DATABASES:
|
|
|
|
case MENU_ENUM_LABEL_DATABASE_MANAGER_LIST:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RDB];
|
|
|
|
case MENU_ENUM_LABEL_CURSOR_MANAGER_LIST:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CURSOR];
|
|
|
|
case MENU_ENUM_LABEL_HELP_LIST:
|
|
|
|
case MENU_ENUM_LABEL_HELP_CONTROLS:
|
|
|
|
case MENU_ENUM_LABEL_HELP_LOADING_CONTENT:
|
|
|
|
case MENU_ENUM_LABEL_HELP_SCANNING_CONTENT:
|
|
|
|
case MENU_ENUM_LABEL_HELP_WHAT_IS_A_CORE:
|
|
|
|
case MENU_ENUM_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD:
|
|
|
|
case MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_HELP];
|
|
|
|
case MENU_ENUM_LABEL_QUIT_RETROARCH:
|
|
|
|
case MENU_ENUM_LABEL_BLOCK_SRAM_OVERWRITE:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_EXIT];
|
|
|
|
case MENU_ENUM_LABEL_DRIVER_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_DRIVERS];
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_VIDEO];
|
|
|
|
case MENU_ENUM_LABEL_AUDIO_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_AUDIO];
|
|
|
|
case MENU_ENUM_LABEL_AUDIO_MIXER_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MIXER];
|
|
|
|
case MENU_ENUM_LABEL_INPUT_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_AUTOCONFIG_PROFILES:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_1_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_2_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_3_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_4_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_5_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_6_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_7_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_8_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_9_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_10_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_11_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_12_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_13_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_14_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_15_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_16_BINDS:
|
2019-01-06 00:41:38 -03:00
|
|
|
case MENU_ENUM_LABEL_START_NET_RETROPAD:
|
2019-01-03 13:49:59 -03:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_SETTINGS];
|
|
|
|
case MENU_ENUM_LABEL_LATENCY_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_LATENCY];
|
|
|
|
case MENU_ENUM_LABEL_SAVING_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG:
|
|
|
|
case MENU_ENUM_LABEL_SAVE_NEW_CONFIG:
|
|
|
|
case MENU_ENUM_LABEL_CONFIG_SAVE_ON_EXIT:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_FILE_SAVE_AS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_SAVING];
|
|
|
|
case MENU_ENUM_LABEL_LOGGING_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_LOG];
|
|
|
|
case MENU_ENUM_LABEL_FASTFORWARD_RATIO:
|
|
|
|
case MENU_ENUM_LABEL_FRAME_THROTTLE_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_FRAMESKIP];
|
|
|
|
case MENU_ENUM_LABEL_QUICK_MENU_START_RECORDING:
|
|
|
|
case MENU_ENUM_LABEL_RECORDING_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RECORD];
|
|
|
|
case MENU_ENUM_LABEL_QUICK_MENU_START_STREAMING:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_STREAM];
|
|
|
|
case MENU_ENUM_LABEL_QUICK_MENU_STOP_STREAMING:
|
|
|
|
case MENU_ENUM_LABEL_QUICK_MENU_STOP_RECORDING:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_DELETE_ALL:
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CORE:
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME:
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CONTENT_DIR:
|
|
|
|
case MENU_ENUM_LABEL_CORE_DELETE:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CLOSE];
|
|
|
|
case MENU_ENUM_LABEL_ONSCREEN_DISPLAY_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_OSD];
|
|
|
|
case MENU_ENUM_LABEL_SHOW_WIMP:
|
|
|
|
case MENU_ENUM_LABEL_USER_INTERFACE_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_UI];
|
2018-10-06 14:52:44 +02:00
|
|
|
#ifdef HAVE_LAKKA_SWITCH
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_SWITCH_GPU_PROFILE:
|
2018-11-29 18:42:44 +01:00
|
|
|
#endif
|
2018-11-30 18:10:28 -03:00
|
|
|
#if defined(HAVE_LAKKA_SWITCH) || defined(HAVE_LIBNX)
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_SWITCH_CPU_PROFILE:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_POWER];
|
2018-10-06 14:52:44 +02:00
|
|
|
#endif
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_POWER_MANAGEMENT_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_POWER];
|
|
|
|
case MENU_ENUM_LABEL_RETRO_ACHIEVEMENTS_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_ACHIEVEMENTS];
|
|
|
|
case MENU_ENUM_LABEL_PLAYLIST_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_PLAYLIST];
|
|
|
|
case MENU_ENUM_LABEL_USER_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_USER];
|
|
|
|
case MENU_ENUM_LABEL_PRIVACY_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_PRIVACY];
|
|
|
|
case MENU_ENUM_LABEL_REWIND_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_REWIND];
|
|
|
|
case MENU_ENUM_LABEL_QUICK_MENU_OVERRIDE_OPTIONS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_OVERRIDE];
|
|
|
|
case MENU_ENUM_LABEL_ONSCREEN_NOTIFICATIONS_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_NOTIFICATIONS];
|
2018-08-08 18:47:42 -03:00
|
|
|
#ifdef HAVE_NETWORKING
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RUN];
|
|
|
|
case MENU_ENUM_LABEL_NETPLAY_DISCONNECT:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CLOSE];
|
|
|
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_ROOM];
|
|
|
|
case MENU_ENUM_LABEL_NETPLAY_REFRESH_ROOMS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RELOAD];
|
|
|
|
case MENU_ENUM_LABEL_NETWORK_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_NETWORK_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_WIFI_SETTINGS:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_NETWORK];
|
2018-08-08 18:47:42 -03:00
|
|
|
#endif
|
2019-01-03 13:49:59 -03:00
|
|
|
case MENU_ENUM_LABEL_SHUTDOWN:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_SHUTDOWN];
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_APPLY_CHANGES:
|
|
|
|
case MENU_ENUM_LABEL_SHADER_APPLY_CHANGES:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CHECKMARK];
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_ADD_NEW_AFTER:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_ADD_NEW_BEFORE:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_ADD_NEW_TOP:
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_ADD_NEW_BOTTOM:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MENU_ADD];
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_APPLY_AFTER_TOGGLE:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MENU_APPLY_TOGGLE];
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_APPLY_AFTER_LOAD:
|
|
|
|
case MENU_ENUM_LABEL_SAVESTATE_AUTO_INDEX:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MENU_APPLY_COG];
|
|
|
|
case MENU_ENUM_LABEL_SLOWMOTION_RATIO:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RESUME];
|
2019-01-06 00:41:38 -03:00
|
|
|
case MENU_ENUM_LABEL_START_VIDEO_PROCESSOR:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MOVIE];
|
2019-01-03 13:49:59 -03:00
|
|
|
default:
|
|
|
|
break;
|
2016-04-21 02:53:42 +07:00
|
|
|
}
|
2016-04-20 17:34:15 +02:00
|
|
|
|
2015-03-10 00:39:18 +01:00
|
|
|
switch(type)
|
|
|
|
{
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DIRECTORY:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_FOLDER];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_PLAIN:
|
2016-12-18 17:26:02 +01:00
|
|
|
case FILE_TYPE_IN_CARCHIVE:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_FILE];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_RPL_ENTRY:
|
2015-03-10 00:39:18 +01:00
|
|
|
if (core_node)
|
|
|
|
return core_node->content_icon;
|
2016-07-31 14:29:33 +02:00
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
switch (xmb_get_system_tab(xmb,
|
|
|
|
(unsigned)xmb->categories_selection_ptr))
|
2016-08-17 15:07:17 +02:00
|
|
|
{
|
2017-08-12 17:27:31 +02:00
|
|
|
case XMB_SYSTEM_TAB_FAVORITES:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_FAVORITE];
|
2017-05-27 23:56:10 +02:00
|
|
|
case XMB_SYSTEM_TAB_MUSIC:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MUSIC];
|
2016-07-31 01:47:58 +02:00
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_IMAGES:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_IMAGE];
|
2016-07-31 01:47:58 +02:00
|
|
|
#endif
|
2018-06-20 04:50:58 +02:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_VIDEO:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_MOVIE];
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_FILE];
|
2018-04-18 08:22:01 +02:00
|
|
|
case FILE_TYPE_SHADER:
|
|
|
|
case FILE_TYPE_SHADER_PRESET:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_SHADER_OPTIONS];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CARCHIVE:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_ZIP];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_MUSIC:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_MUSIC];
|
2017-01-07 17:10:29 +01:00
|
|
|
case FILE_TYPE_IMAGE:
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_IMAGEVIEWER:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_IMAGE];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_MOVIE:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_MOVIE];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CORE:
|
2016-12-12 16:20:43 +01:00
|
|
|
case FILE_TYPE_DIRECT_LOAD:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CORE];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_RDB:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_RDB];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CURSOR:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CURSOR];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_PLAYLIST_ENTRY:
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_RUN:
|
2018-11-29 14:47:46 -03:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_RUN];
|
2018-11-07 15:10:13 -03:00
|
|
|
case MENU_SETTING_ACTION_RESUME_ACHIEVEMENTS:
|
2018-11-24 13:21:43 -03:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_RESUME];
|
2015-06-25 11:14:22 +07:00
|
|
|
case MENU_SETTING_ACTION_CLOSE:
|
2018-11-07 15:10:13 -03:00
|
|
|
case MENU_SETTING_ACTION_DELETE_ENTRY:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CLOSE];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_SAVESTATE:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SAVESTATE];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_LOADSTATE:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_LOADSTATE];
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_RDB_ENTRY:
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_CORE_INFORMATION:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CORE_INFO];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_CORE_OPTIONS:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CORE_OPTIONS];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_CORE_INPUT_REMAPPING_OPTIONS:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_REMAPPING_OPTIONS];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_CORE_CHEAT_OPTIONS:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CHEAT_OPTIONS];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_CORE_DISK_OPTIONS:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_DISK_OPTIONS];
|
2015-06-25 11:47:20 +07:00
|
|
|
case MENU_SETTING_ACTION_CORE_SHADER_OPTIONS:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SHADER_OPTIONS];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_SCREENSHOT:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SCREENSHOT];
|
2015-03-10 00:39:18 +01:00
|
|
|
case MENU_SETTING_ACTION_RESET:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_RELOAD];
|
2018-04-30 16:23:31 -05:00
|
|
|
case MENU_SETTING_ACTION_PAUSE_ACHIEVEMENTS:
|
2018-11-24 13:21:43 -03:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_PAUSE];
|
2018-10-06 14:52:44 +02:00
|
|
|
#ifdef HAVE_LAKKA_SWITCH
|
|
|
|
case MENU_SET_SWITCH_BRIGHTNESS:
|
2018-11-24 13:21:43 -03:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_BRIGHTNESS];
|
2018-10-06 14:52:44 +02:00
|
|
|
#endif
|
2018-11-24 13:21:43 -03:00
|
|
|
case MENU_SETTING_GROUP:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SETTING];
|
2015-10-23 03:43:25 +07:00
|
|
|
case MENU_INFO_MESSAGE:
|
2016-03-02 22:17:05 +01:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_CORE_INFO];
|
2016-09-22 12:36:36 +02:00
|
|
|
case MENU_WIFI:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_WIFI];
|
2017-02-28 04:50:07 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-02-27 22:48:27 +01:00
|
|
|
case MENU_ROOM:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_ROOM];
|
2017-07-09 18:19:56 -05:00
|
|
|
case MENU_ROOM_LAN:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_ROOM_LAN];
|
2018-10-09 19:52:04 -03:00
|
|
|
case MENU_ROOM_RELAY:
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_ROOM_RELAY];
|
2017-02-28 04:50:07 +01:00
|
|
|
#endif
|
2015-03-10 00:39:18 +01:00
|
|
|
}
|
|
|
|
|
2017-10-20 20:26:13 -04:00
|
|
|
#ifdef HAVE_CHEEVOS
|
2017-11-27 04:49:21 +01:00
|
|
|
if (
|
|
|
|
(type >= MENU_SETTINGS_CHEEVOS_START) &&
|
|
|
|
(type < MENU_SETTINGS_NETPLAY_ROOMS_START)
|
|
|
|
)
|
|
|
|
{
|
2017-10-21 17:48:26 -04:00
|
|
|
int new_id = type - MENU_SETTINGS_CHEEVOS_START;
|
2017-11-27 04:49:21 +01:00
|
|
|
if (get_badge_texture(new_id) != 0)
|
|
|
|
return get_badge_texture(new_id);
|
|
|
|
/* Should be replaced with placeholder badge icon. */
|
2018-11-07 15:10:13 -03:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_ACHIEVEMENTS];
|
2017-11-27 04:49:21 +01:00
|
|
|
}
|
2017-10-20 20:26:13 -04:00
|
|
|
#endif
|
|
|
|
|
2018-11-04 13:58:22 -03:00
|
|
|
if (
|
2018-11-12 00:30:09 -03:00
|
|
|
(type >= MENU_SETTINGS_INPUT_BEGIN) &&
|
2018-11-04 13:58:22 -03:00
|
|
|
(type <= MENU_SETTINGS_INPUT_DESC_END)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
unsigned input_id;
|
2018-11-12 00:30:09 -03:00
|
|
|
if (type < MENU_SETTINGS_INPUT_DESC_BEGIN)
|
2019-01-03 13:49:59 -03:00
|
|
|
/* Input User # Binds only */
|
2018-11-04 13:58:22 -03:00
|
|
|
{
|
2018-11-12 00:30:09 -03:00
|
|
|
input_id = MENU_SETTINGS_INPUT_BEGIN;
|
2019-01-03 11:02:15 -03:00
|
|
|
if ( type == input_id + 1)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_ADC];
|
2018-11-12 00:30:09 -03:00
|
|
|
if ( type == input_id + 2)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_SETTINGS];
|
2019-01-03 11:02:15 -03:00
|
|
|
if ( type == input_id + 3)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_BIND_ALL];
|
2018-11-12 00:30:09 -03:00
|
|
|
if ( type == input_id + 4)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_RELOAD];
|
|
|
|
if ( type == input_id + 5)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_SAVING];
|
2019-01-03 11:02:15 -03:00
|
|
|
if ( type == input_id + 6)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_MOUSE];
|
|
|
|
if ((type > (input_id + 30)) && (type < (input_id + 42)))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_LGUN];
|
|
|
|
if ( type == input_id + 42)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_TURBO];
|
2019-01-03 13:49:59 -03:00
|
|
|
/* align to use the same code of Quickmenu controls */
|
2018-11-12 00:30:09 -03:00
|
|
|
input_id = input_id + 7;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-01-03 13:49:59 -03:00
|
|
|
/* Quickmenu controls repeats the same icons for all users */
|
2018-11-12 00:30:09 -03:00
|
|
|
input_id = MENU_SETTINGS_INPUT_DESC_BEGIN;
|
|
|
|
while (type > (input_id + 23))
|
|
|
|
{
|
|
|
|
input_id = (input_id + 24) ;
|
|
|
|
}
|
2018-11-04 13:58:22 -03:00
|
|
|
}
|
2019-01-03 13:49:59 -03:00
|
|
|
/* This is utilized for both Input # Binds and Quickmenu controls */
|
2018-11-04 13:58:22 -03:00
|
|
|
if ( type == input_id )
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_D];
|
|
|
|
if ( type == (input_id + 1))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_L];
|
|
|
|
if ( type == (input_id + 2))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_SELECT];
|
|
|
|
if ( type == (input_id + 3))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_START];
|
|
|
|
if ( type == (input_id + 4))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_U];
|
|
|
|
if ( type == (input_id + 5))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_D];
|
|
|
|
if ( type == (input_id + 6))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_L];
|
|
|
|
if ( type == (input_id + 7))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_R];
|
|
|
|
if ( type == (input_id + 8))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_R];
|
|
|
|
if ( type == (input_id + 9))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_U];
|
|
|
|
if ( type == (input_id + 10))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_LB];
|
|
|
|
if ( type == (input_id + 11))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_RB];
|
|
|
|
if ( type == (input_id + 12))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_LT];
|
|
|
|
if ( type == (input_id + 13))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_RT];
|
|
|
|
if ( type == (input_id + 14))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_P];
|
|
|
|
if ( type == (input_id + 15))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_P];
|
|
|
|
if ( type == (input_id + 16))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_R];
|
|
|
|
if ( type == (input_id + 17))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_L];
|
|
|
|
if ( type == (input_id + 18))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_D];
|
|
|
|
if ( type == (input_id + 19))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_U];
|
|
|
|
if ( type == (input_id + 20))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_R];
|
|
|
|
if ( type == (input_id + 21))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_L];
|
|
|
|
if ( type == (input_id + 22))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_D];
|
|
|
|
if ( type == (input_id + 23))
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_U];
|
|
|
|
}
|
2018-11-07 15:10:13 -03:00
|
|
|
|
2018-11-06 22:48:38 -03:00
|
|
|
if (checked)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_CHECKMARK];
|
|
|
|
|
2018-11-07 15:10:13 -03:00
|
|
|
if (type == MENU_SETTING_ACTION)
|
|
|
|
return xmb->textures.list[XMB_TEXTURE_SETTING];
|
|
|
|
|
2016-04-21 02:53:42 +07:00
|
|
|
return xmb->textures.list[XMB_TEXTURE_SUBSETTING];
|
2018-11-07 15:10:13 -03:00
|
|
|
|
2015-03-10 00:39:18 +01:00
|
|
|
}
|
|
|
|
|
2017-08-30 22:23:29 -03:00
|
|
|
static void xmb_calculate_visible_range(const xmb_handle_t *xmb,
|
|
|
|
unsigned height, size_t list_size, unsigned current,
|
|
|
|
unsigned *first, unsigned *last)
|
2017-08-17 20:23:03 -03:00
|
|
|
{
|
|
|
|
unsigned j;
|
2017-09-28 08:42:12 +02:00
|
|
|
float base_y = xmb->margins_screen_top;
|
2017-08-17 20:23:03 -03:00
|
|
|
|
2017-09-03 18:06:32 -03:00
|
|
|
*first = 0;
|
2018-04-09 15:56:45 +02:00
|
|
|
*last = (unsigned)(list_size ? list_size - 1 : 0);
|
2017-09-03 18:06:32 -03:00
|
|
|
|
2017-08-17 20:23:03 -03:00
|
|
|
if (current)
|
|
|
|
{
|
|
|
|
for (j = current; j-- > 0; )
|
|
|
|
{
|
2018-08-04 14:19:18 -03:00
|
|
|
float bottom = xmb_item_y(xmb, j, current)
|
2018-03-30 15:50:11 +02:00
|
|
|
+ base_y + xmb->icon_size;
|
2017-08-17 20:23:03 -03:00
|
|
|
|
|
|
|
if (bottom < 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
*first = j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (j = current+1; j < list_size; j++)
|
|
|
|
{
|
|
|
|
float top = xmb_item_y(xmb, j, current) + base_y;
|
|
|
|
|
|
|
|
if (top > height)
|
|
|
|
break;
|
|
|
|
|
|
|
|
*last = j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-29 16:32:30 +02:00
|
|
|
static int xmb_draw_item(
|
2018-02-16 17:54:39 +01:00
|
|
|
video_frame_info_t *video_info,
|
2017-09-29 18:12:17 +02:00
|
|
|
menu_entry_t *entry,
|
2017-09-29 16:32:30 +02:00
|
|
|
math_matrix_4x4 *mymat,
|
|
|
|
xmb_handle_t *xmb,
|
|
|
|
xmb_node_t *core_node,
|
|
|
|
file_list_t *list,
|
|
|
|
float *color,
|
|
|
|
const char *thumb_ident,
|
2018-03-25 12:27:17 -03:00
|
|
|
const char *left_thumb_ident,
|
2017-09-29 16:32:30 +02:00
|
|
|
size_t i,
|
|
|
|
size_t current,
|
|
|
|
unsigned width,
|
|
|
|
unsigned height
|
|
|
|
)
|
|
|
|
{
|
|
|
|
float icon_x, icon_y, label_offset;
|
|
|
|
menu_animation_ctx_ticker_t ticker;
|
|
|
|
char tmp[255];
|
2019-02-14 15:10:07 +00:00
|
|
|
static const char ticker_spacer[] = " | ";
|
2017-09-29 18:46:53 +02:00
|
|
|
char *ticker_str = NULL;
|
2017-09-29 16:32:30 +02:00
|
|
|
unsigned entry_type = 0;
|
|
|
|
const float half_size = xmb->icon_size / 2.0f;
|
|
|
|
uintptr_t texture_switch = 0;
|
|
|
|
bool do_draw_text = false;
|
2018-02-27 19:01:15 +01:00
|
|
|
unsigned ticker_limit = 35 * scale_mod[0];
|
2017-09-29 16:32:30 +02:00
|
|
|
xmb_node_t * node = (xmb_node_t*)
|
2017-10-01 17:11:09 +02:00
|
|
|
file_list_get_userdata_at_offset(list, i);
|
2018-04-06 22:47:49 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
2017-09-29 16:32:30 +02:00
|
|
|
|
2019-02-14 15:10:07 +00:00
|
|
|
/* Initial ticker configuration */
|
2019-02-15 09:23:13 -08:00
|
|
|
ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
|
2019-02-14 15:10:07 +00:00
|
|
|
ticker.spacer = ticker_spacer;
|
|
|
|
|
2017-09-29 16:32:30 +02:00
|
|
|
if (!node)
|
2017-09-29 16:47:30 +02:00
|
|
|
goto iterate;
|
2017-09-29 16:32:30 +02:00
|
|
|
|
2017-09-29 18:46:53 +02:00
|
|
|
tmp[0] = '\0';
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
icon_y = xmb->margins_screen_top + node->y + half_size;
|
|
|
|
|
|
|
|
if (icon_y < half_size)
|
2017-09-29 16:47:30 +02:00
|
|
|
goto iterate;
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
if (icon_y > height + xmb->icon_size)
|
2017-09-29 16:47:30 +02:00
|
|
|
goto end;
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
icon_x = node->x + xmb->margins_screen_left +
|
|
|
|
xmb->icon_spacing_horizontal - half_size;
|
|
|
|
|
|
|
|
if (icon_x < -half_size || icon_x > width)
|
2017-09-29 16:47:30 +02:00
|
|
|
goto iterate;
|
2017-09-29 16:32:30 +02:00
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
entry_type = menu_entry_get_type_new(entry);
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
if (entry_type == FILE_TYPE_CONTENTLIST_ENTRY)
|
2017-09-30 16:52:41 +02:00
|
|
|
{
|
|
|
|
char entry_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
strlcpy(entry_path, entry->path, sizeof(entry_path));
|
|
|
|
|
|
|
|
fill_short_pathname_representation(entry_path, entry_path,
|
|
|
|
sizeof(entry_path));
|
|
|
|
|
|
|
|
if (!string_is_empty(entry_path))
|
|
|
|
{
|
|
|
|
if (!string_is_empty(entry->path))
|
|
|
|
free(entry->path);
|
|
|
|
entry->path = strdup(entry_path);
|
|
|
|
}
|
|
|
|
}
|
2017-09-29 16:32:30 +02:00
|
|
|
|
2018-03-30 15:50:11 +02:00
|
|
|
if (string_is_equal(entry->value,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) ||
|
|
|
|
(string_is_equal(entry->value,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))))
|
2017-09-29 16:32:30 +02:00
|
|
|
{
|
|
|
|
if (xmb->textures.list[XMB_TEXTURE_SWITCH_OFF])
|
|
|
|
texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_OFF];
|
|
|
|
else
|
|
|
|
do_draw_text = true;
|
|
|
|
}
|
2018-03-30 15:50:11 +02:00
|
|
|
else if (string_is_equal(entry->value,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) ||
|
|
|
|
(string_is_equal(entry->value,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))))
|
2017-09-29 16:32:30 +02:00
|
|
|
{
|
|
|
|
if (xmb->textures.list[XMB_TEXTURE_SWITCH_ON])
|
|
|
|
texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_ON];
|
|
|
|
else
|
|
|
|
do_draw_text = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(entry->value))
|
2017-09-29 16:32:30 +02:00
|
|
|
{
|
2017-12-06 21:55:21 +01:00
|
|
|
if (
|
|
|
|
string_is_equal(entry->value, "...") ||
|
2018-04-18 08:22:01 +02:00
|
|
|
string_is_equal(entry->value, "(PRESET)") ||
|
|
|
|
string_is_equal(entry->value, "(SHADER)") ||
|
2017-12-06 21:55:21 +01:00
|
|
|
string_is_equal(entry->value, "(COMP)") ||
|
|
|
|
string_is_equal(entry->value, "(CORE)") ||
|
|
|
|
string_is_equal(entry->value, "(MOVIE)") ||
|
|
|
|
string_is_equal(entry->value, "(MUSIC)") ||
|
|
|
|
string_is_equal(entry->value, "(DIR)") ||
|
|
|
|
string_is_equal(entry->value, "(RDB)") ||
|
|
|
|
string_is_equal(entry->value, "(CURSOR)")||
|
|
|
|
string_is_equal(entry->value, "(CFILE)") ||
|
|
|
|
string_is_equal(entry->value, "(FILE)") ||
|
|
|
|
string_is_equal(entry->value, "(IMAGE)")
|
|
|
|
)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else
|
2018-04-23 12:03:50 +02:00
|
|
|
do_draw_text = true;
|
2017-09-29 16:32:30 +02:00
|
|
|
}
|
2017-12-06 21:55:21 +01:00
|
|
|
else
|
|
|
|
do_draw_text = true;
|
|
|
|
|
2017-09-29 16:32:30 +02:00
|
|
|
}
|
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
if (string_is_empty(entry->value))
|
2017-09-29 16:32:30 +02:00
|
|
|
{
|
|
|
|
if (xmb->savestate_thumbnail ||
|
2018-04-24 17:47:02 +02:00
|
|
|
!xmb->use_ps3_layout ||
|
2017-09-29 16:32:30 +02:00
|
|
|
(!string_is_equal
|
|
|
|
(thumb_ident,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))
|
2018-04-06 22:47:49 +02:00
|
|
|
&& xmb->thumbnail) ||
|
2018-04-23 12:03:50 +02:00
|
|
|
(!string_is_equal
|
2018-04-06 22:47:49 +02:00
|
|
|
(left_thumb_ident,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))
|
|
|
|
&& xmb->left_thumbnail
|
|
|
|
&& settings->bools.menu_xmb_vertical_thumbnails)
|
2017-09-29 16:32:30 +02:00
|
|
|
)
|
2018-02-27 19:01:15 +01:00
|
|
|
ticker_limit = 40 * scale_mod[1];
|
2017-09-29 16:32:30 +02:00
|
|
|
else
|
2018-02-27 19:01:15 +01:00
|
|
|
ticker_limit = 70 * scale_mod[2];
|
2017-09-29 16:32:30 +02:00
|
|
|
}
|
|
|
|
|
2017-10-15 00:39:55 -04:00
|
|
|
if (!string_is_empty(entry->path))
|
|
|
|
ticker_str = menu_entry_get_rich_label(entry);
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
ticker.s = tmp;
|
|
|
|
ticker.len = ticker_limit;
|
2019-02-14 11:58:27 +01:00
|
|
|
ticker.idx = menu_animation_get_ticker_idx();
|
2017-09-29 16:32:30 +02:00
|
|
|
ticker.str = ticker_str;
|
|
|
|
ticker.selected = (i == current);
|
|
|
|
|
2017-10-15 00:39:55 -04:00
|
|
|
if (ticker.str)
|
|
|
|
menu_animation_ticker(&ticker);
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
label_offset = xmb->margins_label_top;
|
|
|
|
if (i == current && width > 320 && height > 240
|
2017-09-29 16:47:30 +02:00
|
|
|
&& !string_is_empty(entry->sublabel))
|
2017-09-29 16:32:30 +02:00
|
|
|
{
|
2018-10-08 23:29:17 -04:00
|
|
|
char entry_sublabel[512] = {0};
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
label_offset = - xmb->margins_label_top;
|
|
|
|
|
2018-02-27 19:01:15 +01:00
|
|
|
word_wrap(entry_sublabel, entry->sublabel, 50 * scale_mod[3], true);
|
2017-09-29 16:32:30 +02:00
|
|
|
|
2018-03-06 15:55:06 +01:00
|
|
|
xmb_draw_text(video_info, xmb, entry_sublabel,
|
2017-09-29 16:32:30 +02:00
|
|
|
node->x + xmb->margins_screen_left +
|
|
|
|
xmb->icon_spacing_horizontal + xmb->margins_label_left,
|
|
|
|
xmb->margins_screen_top + node->y + xmb->margins_label_top*3.5,
|
|
|
|
1, node->label_alpha, TEXT_ALIGN_LEFT,
|
|
|
|
width, height, xmb->font2);
|
|
|
|
}
|
|
|
|
|
2018-03-06 15:55:06 +01:00
|
|
|
xmb_draw_text(video_info, xmb, tmp,
|
2017-09-29 16:32:30 +02:00
|
|
|
node->x + xmb->margins_screen_left +
|
|
|
|
xmb->icon_spacing_horizontal + xmb->margins_label_left,
|
|
|
|
xmb->margins_screen_top + node->y + label_offset,
|
|
|
|
1, node->label_alpha, TEXT_ALIGN_LEFT,
|
|
|
|
width, height, xmb->font);
|
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
tmp[0] = '\0';
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
ticker.s = tmp;
|
2018-02-27 19:01:15 +01:00
|
|
|
ticker.len = 35 * scale_mod[7];
|
2019-02-14 11:58:27 +01:00
|
|
|
ticker.idx = menu_animation_get_ticker_idx();
|
2017-09-29 16:32:30 +02:00
|
|
|
ticker.selected = (i == current);
|
|
|
|
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(entry->value))
|
2017-09-29 21:19:07 +02:00
|
|
|
{
|
2019-01-29 10:32:22 +01:00
|
|
|
char entry_value[255];
|
|
|
|
menu_entry_get_value(entry, entry_value, sizeof(entry_value));
|
|
|
|
ticker.str = entry_value;
|
|
|
|
|
2017-09-29 21:19:07 +02:00
|
|
|
menu_animation_ticker(&ticker);
|
|
|
|
}
|
2017-09-29 16:32:30 +02:00
|
|
|
|
|
|
|
if (do_draw_text)
|
2018-03-06 15:55:06 +01:00
|
|
|
xmb_draw_text(video_info, xmb, tmp,
|
2017-09-29 16:32:30 +02:00
|
|
|
node->x +
|
|
|
|
+ xmb->margins_screen_left
|
|
|
|
+ xmb->icon_spacing_horizontal
|
|
|
|
+ xmb->margins_label_left
|
|
|
|
+ xmb->margins_setting_left,
|
|
|
|
xmb->margins_screen_top + node->y + xmb->margins_label_top,
|
|
|
|
1,
|
|
|
|
node->label_alpha,
|
|
|
|
TEXT_ALIGN_LEFT,
|
|
|
|
width, height, xmb->font);
|
|
|
|
|
|
|
|
menu_display_set_alpha(color, MIN(node->alpha, xmb->alpha));
|
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
if (
|
|
|
|
(!xmb->assets_missing) &&
|
|
|
|
(color[3] != 0) &&
|
|
|
|
(
|
|
|
|
(entry->checked) ||
|
|
|
|
!((entry_type >= MENU_SETTING_DROPDOWN_ITEM) && (entry_type <= MENU_SETTING_DROPDOWN_SETTING_UINT_ITEM_SPECIAL))
|
|
|
|
)
|
|
|
|
)
|
2017-09-29 16:32:30 +02:00
|
|
|
{
|
|
|
|
math_matrix_4x4 mymat_tmp;
|
|
|
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
|
|
|
uintptr_t texture = xmb_icon_get_id(xmb, core_node, node,
|
2018-11-06 22:48:38 -03:00
|
|
|
entry->enum_idx, entry_type, (i == current), entry->checked);
|
2017-09-29 16:32:30 +02:00
|
|
|
float x = icon_x;
|
|
|
|
float y = icon_y;
|
|
|
|
float rotation = 0;
|
|
|
|
float scale_factor = node->zoom;
|
|
|
|
|
|
|
|
rotate_draw.matrix = &mymat_tmp;
|
|
|
|
rotate_draw.rotation = rotation;
|
|
|
|
rotate_draw.scale_x = scale_factor;
|
|
|
|
rotate_draw.scale_y = scale_factor;
|
|
|
|
rotate_draw.scale_z = 1;
|
|
|
|
rotate_draw.scale_enable = true;
|
|
|
|
|
2018-02-16 19:42:13 +01:00
|
|
|
menu_display_rotate_z(&rotate_draw, video_info);
|
2017-09-29 16:32:30 +02:00
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
xmb_draw_icon(video_info,
|
|
|
|
xmb->icon_size,
|
|
|
|
&mymat_tmp,
|
|
|
|
texture,
|
|
|
|
x,
|
|
|
|
y,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
1.0,
|
|
|
|
rotation,
|
|
|
|
scale_factor,
|
|
|
|
&color[0],
|
|
|
|
xmb->shadow_offset);
|
2017-09-29 16:32:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
menu_display_set_alpha(color, MIN(node->alpha, xmb->alpha));
|
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
if (texture_switch != 0 && color[3] != 0 && !xmb->assets_missing)
|
2018-02-16 17:54:39 +01:00
|
|
|
xmb_draw_icon(video_info,
|
2017-09-29 16:32:30 +02:00
|
|
|
xmb->icon_size,
|
|
|
|
mymat,
|
|
|
|
texture_switch,
|
|
|
|
node->x + xmb->margins_screen_left
|
|
|
|
+ xmb->icon_spacing_horizontal
|
|
|
|
+ xmb->icon_size / 2.0 + xmb->margins_setting_left,
|
|
|
|
xmb->margins_screen_top + node->y + xmb->icon_size / 2.0,
|
|
|
|
width, height,
|
|
|
|
node->alpha,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
&color[0],
|
|
|
|
xmb->shadow_offset);
|
|
|
|
|
2017-09-29 16:47:30 +02:00
|
|
|
iterate:
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(ticker_str))
|
2017-09-29 18:46:53 +02:00
|
|
|
free(ticker_str);
|
2017-09-29 16:32:30 +02:00
|
|
|
return 0;
|
2017-09-29 16:47:30 +02:00
|
|
|
|
|
|
|
end:
|
2017-09-30 06:11:18 +02:00
|
|
|
if (!string_is_empty(ticker_str))
|
2017-09-29 18:46:53 +02:00
|
|
|
free(ticker_str);
|
2017-09-29 16:47:30 +02:00
|
|
|
return -1;
|
2017-09-29 16:32:30 +02:00
|
|
|
}
|
|
|
|
|
2017-01-09 16:00:53 +01:00
|
|
|
static void xmb_draw_items(
|
2017-01-18 21:40:56 +01:00
|
|
|
video_frame_info_t *video_info,
|
2017-01-09 16:00:53 +01:00
|
|
|
xmb_handle_t *xmb,
|
2017-09-03 14:51:14 -03:00
|
|
|
file_list_t *list,
|
2015-11-08 01:30:07 +01:00
|
|
|
size_t current, size_t cat_selection_ptr, float *color,
|
2015-09-06 23:10:00 +02:00
|
|
|
unsigned width, unsigned height)
|
2014-10-20 20:00:39 +02:00
|
|
|
{
|
2015-12-12 14:39:35 +01:00
|
|
|
size_t i;
|
2017-09-12 04:37:58 +02:00
|
|
|
unsigned first, last;
|
2015-11-02 19:47:25 +01:00
|
|
|
math_matrix_4x4 mymat;
|
2016-06-16 16:33:39 +02:00
|
|
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
2015-06-13 00:04:57 -03:00
|
|
|
xmb_node_t *core_node = NULL;
|
|
|
|
size_t end = 0;
|
2018-03-25 12:27:17 -03:00
|
|
|
const char *thumb_ident = xmb_thumbnails_ident('R');
|
|
|
|
const char *left_thumb_ident= xmb_thumbnails_ident('L');
|
2015-11-20 15:08:27 +01:00
|
|
|
|
2017-09-30 16:52:41 +02:00
|
|
|
if (!list || !list->size || !xmb)
|
2014-10-20 20:00:39 +02:00
|
|
|
return;
|
2014-10-09 01:21:22 +02:00
|
|
|
|
2016-08-18 16:42:39 +02:00
|
|
|
if (cat_selection_ptr > xmb->system_tab_end)
|
2016-02-04 21:40:29 +01:00
|
|
|
core_node = xmb_get_userdata_from_horizontal_list(
|
2017-02-26 21:46:19 +01:00
|
|
|
xmb, (unsigned)(cat_selection_ptr - (xmb->system_tab_end + 1)));
|
2014-11-27 17:07:52 +07:00
|
|
|
|
2017-09-28 05:00:00 +02:00
|
|
|
end = file_list_get_size(list);
|
2015-02-12 17:08:57 +01:00
|
|
|
|
2016-02-09 04:43:15 +01:00
|
|
|
rotate_draw.matrix = &mymat;
|
|
|
|
rotate_draw.rotation = 0;
|
|
|
|
rotate_draw.scale_x = 1;
|
|
|
|
rotate_draw.scale_y = 1;
|
|
|
|
rotate_draw.scale_z = 1;
|
|
|
|
rotate_draw.scale_enable = true;
|
|
|
|
|
2018-02-16 19:42:13 +01:00
|
|
|
menu_display_rotate_z(&rotate_draw, video_info);
|
2015-03-10 03:42:26 +01:00
|
|
|
|
2015-12-12 14:39:35 +01:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
|
2015-06-15 19:51:20 -03:00
|
|
|
|
|
|
|
if (list == xmb->selection_buf_old)
|
2017-08-17 21:52:47 -03:00
|
|
|
{
|
|
|
|
xmb_node_t *node = (xmb_node_t*)
|
2018-04-23 12:03:50 +02:00
|
|
|
file_list_get_userdata_at_offset(list, current);
|
2017-08-17 21:52:47 -03:00
|
|
|
|
2017-10-01 02:08:41 -04:00
|
|
|
if (node && (uint8_t)(255 * node->alpha) == 0)
|
2017-08-17 21:52:47 -03:00
|
|
|
return;
|
|
|
|
|
2015-06-15 19:51:20 -03:00
|
|
|
i = 0;
|
2017-08-17 21:52:47 -03:00
|
|
|
}
|
2015-06-15 19:51:20 -03:00
|
|
|
|
2018-04-09 15:56:45 +02:00
|
|
|
first = (unsigned)i;
|
|
|
|
last = (unsigned)(end - 1);
|
2017-08-17 20:23:03 -03:00
|
|
|
|
2018-04-09 15:56:45 +02:00
|
|
|
xmb_calculate_visible_range(xmb, height, end, (unsigned)current, &first, &last);
|
2017-08-17 20:23:03 -03:00
|
|
|
|
2018-02-16 17:19:55 +01:00
|
|
|
menu_display_blend_begin(video_info);
|
2016-04-21 10:16:21 +02:00
|
|
|
|
2017-08-17 20:23:03 -03:00
|
|
|
for (i = first; i <= last; i++)
|
2014-10-09 01:21:22 +02:00
|
|
|
{
|
2017-09-29 21:00:56 +02:00
|
|
|
int ret;
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_t entry;
|
2017-09-29 21:00:56 +02:00
|
|
|
menu_entry_init(&entry);
|
|
|
|
menu_entry_get(&entry, 0, i, list, true);
|
2018-02-16 17:54:39 +01:00
|
|
|
ret = xmb_draw_item(video_info,
|
2017-09-29 18:37:04 +02:00
|
|
|
&entry,
|
2017-09-29 16:32:30 +02:00
|
|
|
&mymat,
|
|
|
|
xmb, core_node,
|
2018-03-25 12:27:17 -03:00
|
|
|
list, color, thumb_ident, left_thumb_ident,
|
2017-09-29 16:32:30 +02:00
|
|
|
i, current,
|
|
|
|
width, height);
|
2017-09-29 18:37:04 +02:00
|
|
|
menu_entry_free(&entry);
|
2017-09-29 16:32:30 +02:00
|
|
|
if (ret == -1)
|
2017-08-19 11:01:27 -03:00
|
|
|
break;
|
2014-10-09 01:21:22 +02:00
|
|
|
}
|
2016-04-21 10:16:21 +02:00
|
|
|
|
2018-02-16 17:19:55 +01:00
|
|
|
menu_display_blend_end(video_info);
|
2014-10-20 20:00:39 +02:00
|
|
|
}
|
|
|
|
|
2018-11-26 00:13:11 +01:00
|
|
|
static void xmb_context_reset_internal(xmb_handle_t *xmb,
|
|
|
|
bool is_threaded, bool reinit_textures);
|
|
|
|
|
2017-05-13 21:06:06 +02:00
|
|
|
static void xmb_render(void *data, bool is_idle)
|
2015-03-08 19:15:24 +01:00
|
|
|
{
|
2016-04-20 17:37:31 +02:00
|
|
|
size_t i;
|
2015-06-13 22:57:55 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-12-10 14:45:34 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2017-02-26 10:33:03 +01:00
|
|
|
unsigned end = (unsigned)menu_entries_get_size();
|
2017-04-28 13:43:47 +02:00
|
|
|
bool mouse_enable = settings->bools.menu_mouse_enable;
|
|
|
|
bool pointer_enable = settings->bools.menu_pointer_enable;
|
2015-03-08 23:36:12 +01:00
|
|
|
|
2018-11-26 00:13:11 +01:00
|
|
|
unsigned width, height;
|
|
|
|
float scale_factor;
|
|
|
|
|
|
|
|
if (!xmb)
|
2015-03-08 23:36:12 +01:00
|
|
|
return;
|
|
|
|
|
2018-11-26 00:13:11 +01:00
|
|
|
video_driver_get_size(&width, &height);
|
|
|
|
|
|
|
|
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
|
|
|
|
|
2019-02-12 09:37:05 -08:00
|
|
|
if (scale_factor >= 0.1f && scale_factor != xmb->previous_scale_factor)
|
2018-11-26 00:13:11 +01:00
|
|
|
xmb_context_reset_internal(xmb, video_driver_is_threaded(),
|
|
|
|
false);
|
|
|
|
|
|
|
|
xmb->previous_scale_factor = scale_factor;
|
|
|
|
|
2017-04-28 13:43:47 +02:00
|
|
|
if (pointer_enable || mouse_enable)
|
2015-04-16 17:39:40 +02:00
|
|
|
{
|
2018-04-09 15:56:45 +02:00
|
|
|
unsigned height;
|
2017-08-12 17:53:56 -03:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
|
|
|
int16_t pointer_y = menu_input_pointer_state(MENU_POINTER_Y_AXIS);
|
|
|
|
int16_t mouse_y = menu_input_mouse_state(MENU_MOUSE_Y_AXIS)
|
2017-09-28 08:42:12 +02:00
|
|
|
+ (xmb->cursor_size/2);
|
2017-08-17 20:58:53 -03:00
|
|
|
unsigned first = 0, last = end;
|
2016-04-20 17:37:31 +02:00
|
|
|
|
2017-08-17 20:58:53 -03:00
|
|
|
video_driver_get_size(NULL, &height);
|
|
|
|
|
|
|
|
if (height)
|
2018-03-30 15:50:11 +02:00
|
|
|
xmb_calculate_visible_range(xmb, height,
|
2018-04-09 15:56:45 +02:00
|
|
|
end, (unsigned)selection, &first, &last);
|
2017-08-17 20:58:53 -03:00
|
|
|
|
|
|
|
for (i = first; i <= last; i++)
|
2015-06-15 19:51:20 -03:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
float item_y1 = xmb->margins_screen_top
|
2017-02-26 10:33:03 +01:00
|
|
|
+ xmb_item_y(xmb, (int)i, selection);
|
2017-09-28 08:42:12 +02:00
|
|
|
float item_y2 = item_y1 + xmb->icon_size;
|
2015-06-23 13:27:45 -03:00
|
|
|
|
2017-04-28 13:43:47 +02:00
|
|
|
if (pointer_enable)
|
2015-06-23 13:27:45 -03:00
|
|
|
{
|
2015-09-24 17:21:50 +02:00
|
|
|
if (pointer_y > item_y1 && pointer_y < item_y2)
|
2015-09-26 02:52:05 +02:00
|
|
|
menu_input_ctl(MENU_INPUT_CTL_POINTER_PTR, &i);
|
2015-06-23 13:27:45 -03:00
|
|
|
}
|
|
|
|
|
2017-04-28 13:43:47 +02:00
|
|
|
if (mouse_enable)
|
2015-06-23 13:27:45 -03:00
|
|
|
{
|
2015-09-24 17:34:44 +02:00
|
|
|
if (mouse_y > item_y1 && mouse_y < item_y2)
|
2015-09-26 02:52:05 +02:00
|
|
|
menu_input_ctl(MENU_INPUT_CTL_MOUSE_PTR, &i);
|
2015-06-23 13:27:45 -03:00
|
|
|
}
|
2015-04-16 17:39:40 +02:00
|
|
|
}
|
2015-03-08 23:36:12 +01:00
|
|
|
}
|
|
|
|
|
2015-12-12 14:39:35 +01:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
|
|
|
|
|
|
|
|
if (i >= end)
|
|
|
|
{
|
|
|
|
i = 0;
|
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &i);
|
|
|
|
}
|
2015-06-15 19:51:20 -03:00
|
|
|
|
2015-09-25 23:39:02 +02:00
|
|
|
menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
|
2015-03-08 19:15:24 +01:00
|
|
|
}
|
|
|
|
|
2017-01-20 15:33:47 +01:00
|
|
|
static bool xmb_shader_pipeline_active(video_frame_info_t *video_info)
|
2017-01-09 17:22:28 +01:00
|
|
|
{
|
2018-01-17 01:03:48 +01:00
|
|
|
if (string_is_not_equal(menu_driver_ident(), "xmb"))
|
2017-01-09 17:22:28 +01:00
|
|
|
return false;
|
2017-01-20 15:33:47 +01:00
|
|
|
if (video_info->menu_shader_pipeline == XMB_SHADER_PIPELINE_WALLPAPER)
|
2017-01-09 17:22:28 +01:00
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-04-21 05:04:01 +02:00
|
|
|
static void xmb_draw_bg(
|
|
|
|
xmb_handle_t *xmb,
|
2017-01-18 23:59:22 +01:00
|
|
|
video_frame_info_t *video_info,
|
2016-04-21 05:04:01 +02:00
|
|
|
unsigned width,
|
|
|
|
unsigned height,
|
|
|
|
float alpha,
|
|
|
|
uintptr_t texture_id,
|
2016-04-22 17:11:56 +07:00
|
|
|
float *coord_black,
|
|
|
|
float *coord_white)
|
2016-04-16 17:57:51 +02:00
|
|
|
{
|
2016-04-21 05:04:01 +02:00
|
|
|
menu_display_ctx_draw_t draw;
|
2016-05-08 12:33:28 +02:00
|
|
|
|
2017-01-20 14:25:00 +01:00
|
|
|
bool running = video_info->libretro_running;
|
2016-04-21 04:54:07 +02:00
|
|
|
|
2016-04-22 17:43:23 +07:00
|
|
|
draw.x = 0;
|
|
|
|
draw.y = 0;
|
2016-04-21 05:04:01 +02:00
|
|
|
draw.texture = texture_id;
|
|
|
|
draw.width = width;
|
|
|
|
draw.height = height;
|
2016-04-22 17:11:56 +07:00
|
|
|
draw.color = &coord_black[0];
|
2016-04-21 05:04:01 +02:00
|
|
|
draw.vertex = NULL;
|
|
|
|
draw.tex_coord = NULL;
|
|
|
|
draw.vertex_count = 4;
|
|
|
|
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
2016-05-08 11:11:28 +02:00
|
|
|
draw.pipeline.id = 0;
|
2017-01-20 15:33:47 +01:00
|
|
|
draw.pipeline.active = xmb_shader_pipeline_active(video_info);
|
2016-04-21 05:04:01 +02:00
|
|
|
|
2018-02-16 17:19:55 +01:00
|
|
|
menu_display_blend_begin(video_info);
|
2017-01-18 23:59:22 +01:00
|
|
|
menu_display_set_viewport(video_info->width, video_info->height);
|
2016-04-22 12:32:32 +07:00
|
|
|
|
2016-06-07 00:00:28 +02:00
|
|
|
#ifdef HAVE_SHADERPIPELINE
|
2017-01-20 15:33:47 +01:00
|
|
|
if (video_info->menu_shader_pipeline > XMB_SHADER_PIPELINE_WALLPAPER
|
2016-10-30 17:14:13 -05:00
|
|
|
&&
|
2017-01-20 15:33:47 +01:00
|
|
|
(video_info->xmb_color_theme != XMB_THEME_WALLPAPER))
|
2016-04-22 12:32:32 +07:00
|
|
|
{
|
2017-01-20 15:33:47 +01:00
|
|
|
draw.color = xmb_gradient_ident(video_info);
|
2016-04-22 20:05:56 +07:00
|
|
|
|
|
|
|
if (running)
|
|
|
|
menu_display_set_alpha(draw.color, coord_black[3]);
|
|
|
|
else
|
|
|
|
menu_display_set_alpha(draw.color, coord_white[3]);
|
|
|
|
|
2017-01-20 14:25:00 +01:00
|
|
|
menu_display_draw_gradient(&draw, video_info);
|
2016-05-08 11:11:28 +02:00
|
|
|
|
2016-12-06 00:34:38 +01:00
|
|
|
draw.pipeline.id = VIDEO_SHADER_MENU_2;
|
2016-11-17 21:08:50 +01:00
|
|
|
|
2017-01-20 15:33:47 +01:00
|
|
|
switch (video_info->menu_shader_pipeline)
|
2016-11-17 21:08:50 +01:00
|
|
|
{
|
|
|
|
case XMB_SHADER_PIPELINE_RIBBON:
|
|
|
|
draw.pipeline.id = VIDEO_SHADER_MENU;
|
|
|
|
break;
|
2016-12-06 00:48:36 +01:00
|
|
|
case XMB_SHADER_PIPELINE_SIMPLE_SNOW:
|
2016-11-17 21:08:50 +01:00
|
|
|
draw.pipeline.id = VIDEO_SHADER_MENU_3;
|
|
|
|
break;
|
2016-12-06 00:48:36 +01:00
|
|
|
case XMB_SHADER_PIPELINE_SNOW:
|
|
|
|
draw.pipeline.id = VIDEO_SHADER_MENU_4;
|
|
|
|
break;
|
2017-01-08 03:56:47 +01:00
|
|
|
case XMB_SHADER_PIPELINE_BOKEH:
|
|
|
|
draw.pipeline.id = VIDEO_SHADER_MENU_5;
|
|
|
|
break;
|
2017-12-02 22:47:16 -05:00
|
|
|
case XMB_SHADER_PIPELINE_SNOWFLAKE:
|
|
|
|
draw.pipeline.id = VIDEO_SHADER_MENU_6;
|
|
|
|
break;
|
2016-11-17 21:08:50 +01:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2016-04-24 22:56:28 +02:00
|
|
|
|
2018-02-16 19:08:16 +01:00
|
|
|
menu_display_draw_pipeline(&draw, video_info);
|
2016-04-22 12:32:32 +07:00
|
|
|
}
|
|
|
|
else
|
2016-06-07 00:00:28 +02:00
|
|
|
#endif
|
2016-04-22 12:32:32 +07:00
|
|
|
{
|
2016-07-14 20:28:47 +02:00
|
|
|
uintptr_t texture = draw.texture;
|
2016-04-22 20:05:56 +07:00
|
|
|
|
2017-01-20 15:33:47 +01:00
|
|
|
if (video_info->xmb_color_theme != XMB_THEME_WALLPAPER)
|
|
|
|
draw.color = xmb_gradient_ident(video_info);
|
2016-07-14 20:28:47 +02:00
|
|
|
|
|
|
|
if (running)
|
|
|
|
menu_display_set_alpha(draw.color, coord_black[3]);
|
|
|
|
else
|
|
|
|
menu_display_set_alpha(draw.color, coord_white[3]);
|
|
|
|
|
2017-01-20 15:33:47 +01:00
|
|
|
if (video_info->xmb_color_theme != XMB_THEME_WALLPAPER)
|
2017-01-20 14:25:00 +01:00
|
|
|
menu_display_draw_gradient(&draw, video_info);
|
2016-07-14 20:28:47 +02:00
|
|
|
|
|
|
|
{
|
2017-08-15 22:43:09 +02:00
|
|
|
float override_opacity = video_info->menu_wallpaper_opacity;
|
|
|
|
bool add_opacity = false;
|
|
|
|
|
|
|
|
draw.texture = texture;
|
2016-07-14 20:28:47 +02:00
|
|
|
menu_display_set_alpha(draw.color, coord_white[3]);
|
|
|
|
|
2017-06-19 16:34:57 +01:00
|
|
|
if (draw.texture)
|
2016-07-14 20:28:47 +02:00
|
|
|
draw.color = &coord_white[0];
|
|
|
|
|
2017-05-31 23:39:39 +01:00
|
|
|
if (running || video_info->xmb_color_theme == XMB_THEME_WALLPAPER)
|
2017-01-09 16:55:46 +01:00
|
|
|
add_opacity = true;
|
|
|
|
|
2017-08-15 22:43:09 +02:00
|
|
|
menu_display_draw_bg(&draw, video_info, add_opacity, override_opacity);
|
2016-07-14 20:28:47 +02:00
|
|
|
}
|
2016-04-22 12:32:32 +07:00
|
|
|
}
|
|
|
|
|
2018-02-16 17:54:39 +01:00
|
|
|
menu_display_draw(&draw, video_info);
|
2018-02-16 17:19:55 +01:00
|
|
|
menu_display_blend_end(video_info);
|
2016-04-12 16:25:13 +02:00
|
|
|
}
|
|
|
|
|
2016-04-22 14:05:18 +07:00
|
|
|
static void xmb_draw_dark_layer(
|
|
|
|
xmb_handle_t *xmb,
|
2018-02-16 17:19:55 +01:00
|
|
|
video_frame_info_t *video_info,
|
2016-04-22 14:05:18 +07:00
|
|
|
unsigned width,
|
|
|
|
unsigned height)
|
|
|
|
{
|
2016-04-22 14:27:34 +07:00
|
|
|
menu_display_ctx_draw_t draw;
|
2016-05-10 02:32:49 +02:00
|
|
|
struct video_coords coords;
|
2016-04-22 14:05:18 +07:00
|
|
|
float black[16] = {
|
|
|
|
0, 0, 0, 1,
|
|
|
|
0, 0, 0, 1,
|
|
|
|
0, 0, 0, 1,
|
|
|
|
0, 0, 0, 1,
|
|
|
|
};
|
|
|
|
|
2016-04-22 17:43:23 +07:00
|
|
|
menu_display_set_alpha(black, MIN(xmb->alpha, 0.75));
|
2016-04-22 14:05:18 +07:00
|
|
|
|
2016-04-22 14:27:34 +07:00
|
|
|
coords.vertices = 4;
|
|
|
|
coords.vertex = NULL;
|
|
|
|
coords.tex_coord = NULL;
|
|
|
|
coords.lut_tex_coord = NULL;
|
|
|
|
coords.color = &black[0];
|
|
|
|
|
|
|
|
draw.x = 0;
|
|
|
|
draw.y = 0;
|
|
|
|
draw.width = width;
|
|
|
|
draw.height = height;
|
|
|
|
draw.coords = &coords;
|
|
|
|
draw.matrix_data = NULL;
|
|
|
|
draw.texture = menu_display_white_texture;
|
|
|
|
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
2016-05-08 11:11:28 +02:00
|
|
|
draw.pipeline.id = 0;
|
2016-04-22 14:05:18 +07:00
|
|
|
|
2018-02-16 17:19:55 +01:00
|
|
|
menu_display_blend_begin(video_info);
|
2018-02-16 17:54:39 +01:00
|
|
|
menu_display_draw(&draw, video_info);
|
2018-02-16 17:19:55 +01:00
|
|
|
menu_display_blend_end(video_info);
|
2016-04-22 14:05:18 +07:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_frame(void *data, video_frame_info_t *video_info)
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
math_matrix_4x4 mymat;
|
|
|
|
unsigned i;
|
|
|
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
|
|
|
char msg[1024];
|
|
|
|
char title_msg[255];
|
|
|
|
char title_truncated[255];
|
|
|
|
size_t selection = 0;
|
|
|
|
size_t percent_width = 0;
|
|
|
|
const int min_thumb_size = 50;
|
|
|
|
bool render_background = false;
|
|
|
|
file_list_t *selection_buf = NULL;
|
|
|
|
unsigned width = video_info->width;
|
|
|
|
unsigned height = video_info->height;
|
|
|
|
const float under_thumb_margin = 0.96;
|
|
|
|
float scale_factor = 0.0f;
|
|
|
|
float pseudo_font_length = 0.0f;
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
unsigned xmb_system_tab = xmb_get_system_tab(xmb, (unsigned)xmb->categories_selection_ptr);
|
|
|
|
bool hide_thumbnails = false;
|
2016-12-12 03:18:48 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!xmb)
|
|
|
|
return;
|
2016-12-12 03:18:48 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
|
|
|
|
pseudo_font_length = xmb->icon_spacing_horizontal * 4 - xmb->icon_size / 4;
|
|
|
|
|
|
|
|
msg[0] = '\0';
|
|
|
|
title_msg[0] = '\0';
|
|
|
|
title_truncated[0] = '\0';
|
|
|
|
|
|
|
|
font_driver_bind_block(xmb->font, &xmb->raster_block);
|
|
|
|
font_driver_bind_block(xmb->font2, &xmb->raster_block2);
|
|
|
|
|
|
|
|
xmb->raster_block.carr.coords.vertices = 0;
|
|
|
|
xmb->raster_block2.carr.coords.vertices = 0;
|
|
|
|
|
|
|
|
menu_display_set_alpha(coord_black, MIN(
|
|
|
|
(float)video_info->xmb_alpha_factor/100, xmb->alpha));
|
|
|
|
menu_display_set_alpha(coord_white, xmb->alpha);
|
|
|
|
|
|
|
|
xmb_draw_bg(
|
|
|
|
xmb,
|
|
|
|
video_info,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
xmb->alpha,
|
|
|
|
xmb->textures.bg,
|
|
|
|
coord_black,
|
|
|
|
coord_white);
|
|
|
|
|
|
|
|
selection = menu_navigation_get_selection();
|
|
|
|
|
|
|
|
strlcpy(title_truncated,
|
|
|
|
xmb->title_name, sizeof(title_truncated));
|
|
|
|
|
|
|
|
if (selection > 1)
|
2018-11-25 02:48:14 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
/* skip 25 utf8 multi-byte chars */
|
|
|
|
char *end = title_truncated;
|
|
|
|
|
|
|
|
for(i = 0; i < 25 && *end; i++)
|
|
|
|
{
|
|
|
|
end++;
|
|
|
|
while((*end & 0xC0) == 0x80)
|
|
|
|
end++;
|
|
|
|
}
|
|
|
|
|
|
|
|
*end = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Title text */
|
|
|
|
xmb_draw_text(video_info, xmb,
|
|
|
|
title_truncated, xmb->margins_title_left,
|
|
|
|
xmb->margins_title_top,
|
|
|
|
1, 1, TEXT_ALIGN_LEFT,
|
|
|
|
width, height, xmb->font);
|
|
|
|
|
|
|
|
if (settings->bools.menu_core_enable &&
|
|
|
|
menu_entries_get_core_title(title_msg, sizeof(title_msg)) == 0)
|
|
|
|
xmb_draw_text(video_info, xmb, title_msg, xmb->margins_title_left,
|
|
|
|
height - xmb->margins_title_bottom, 1, 1, TEXT_ALIGN_LEFT,
|
|
|
|
width, height, xmb->font);
|
|
|
|
|
|
|
|
rotate_draw.matrix = &mymat;
|
|
|
|
rotate_draw.rotation = 0;
|
|
|
|
rotate_draw.scale_x = 1;
|
|
|
|
rotate_draw.scale_y = 1;
|
|
|
|
rotate_draw.scale_z = 1;
|
|
|
|
rotate_draw.scale_enable = true;
|
|
|
|
|
|
|
|
menu_display_rotate_z(&rotate_draw, video_info);
|
|
|
|
menu_display_blend_begin(video_info);
|
|
|
|
|
|
|
|
/* Save State thumbnail, right side */
|
|
|
|
if (xmb->savestate_thumbnail)
|
|
|
|
{
|
|
|
|
xmb_draw_thumbnail(video_info,
|
|
|
|
xmb, &coord_white[0], width, height,
|
|
|
|
xmb->margins_screen_left * scale_mod[5] +
|
|
|
|
xmb->icon_spacing_horizontal + pseudo_font_length,
|
|
|
|
xmb->margins_screen_top + xmb->icon_size +
|
|
|
|
xmb->savestate_thumbnail_height * scale_mod[4],
|
|
|
|
xmb->savestate_thumbnail_width * scale_mod[4],
|
|
|
|
xmb->savestate_thumbnail_height * scale_mod[4],
|
|
|
|
xmb->savestate_thumbnail);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is used for hiding thumbnails when going into sub-levels in the
|
|
|
|
* Quick Menu as well as when selecting "Information" for a playlist entry.
|
|
|
|
* NOTE: This is currently a pretty crude check, simply going by menu depth
|
|
|
|
* and not specifically identifying which menu we're actually in. */
|
|
|
|
hide_thumbnails = xmb_system_tab > XMB_SYSTEM_TAB_SETTINGS && xmb->depth > 2;
|
|
|
|
|
|
|
|
/* Right thumbnail big size */
|
|
|
|
if (!hide_thumbnails && !xmb->savestate_thumbnail && xmb->use_ps3_layout &&
|
|
|
|
(!settings->bools.menu_xmb_vertical_thumbnails ||
|
|
|
|
(settings->bools.menu_xmb_vertical_thumbnails && !xmb->left_thumbnail)))
|
|
|
|
{
|
|
|
|
/* Do not draw the right thumbnail if there is no space available */
|
|
|
|
|
|
|
|
if (((xmb->margins_screen_top +
|
|
|
|
xmb->icon_size + min_thumb_size) <= height) &&
|
|
|
|
((xmb->margins_screen_left * scale_mod[5] +
|
|
|
|
xmb->icon_spacing_horizontal +
|
|
|
|
pseudo_font_length + min_thumb_size) <= width))
|
|
|
|
{
|
|
|
|
if (xmb->thumbnail
|
|
|
|
&& !string_is_equal(xmb_thumbnails_ident('R'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
/* Limit thumbnail width */
|
|
|
|
|
|
|
|
float thumb_width = 0.0f;
|
|
|
|
float thumb_height = 0.0f;
|
|
|
|
float thumb_max_width = (float)width - (xmb->icon_size / 6)
|
|
|
|
- (xmb->margins_screen_left * scale_mod[5]) -
|
|
|
|
xmb->icon_spacing_horizontal - pseudo_font_length;
|
|
|
|
|
|
|
|
#ifdef XMB_DEBUG
|
|
|
|
RARCH_LOG("[XMB thumbnail] width: %.2f, height: %.2f\n",
|
|
|
|
xmb->thumbnail_width, xmb->thumbnail_height);
|
|
|
|
RARCH_LOG("[XMB thumbnail] w: %.2f, h: %.2f\n", width, height);
|
2018-11-25 02:48:14 +01:00
|
|
|
#endif
|
2018-11-25 20:34:50 +01:00
|
|
|
|
|
|
|
if (xmb->thumbnail_width * scale_mod[4] > thumb_max_width)
|
|
|
|
{
|
|
|
|
thumb_width = (xmb->thumbnail_width * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->thumbnail_width * scale_mod[4]));
|
|
|
|
thumb_height = (xmb->thumbnail_height * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->thumbnail_width * scale_mod[4]));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
thumb_width = xmb->thumbnail_width * scale_mod[4];
|
|
|
|
thumb_height = xmb->thumbnail_height * scale_mod[4];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Limit thumbnail height to screen height + margin. */
|
|
|
|
|
|
|
|
if (xmb->margins_screen_top + xmb->icon_size + thumb_height >=
|
|
|
|
((float)height * under_thumb_margin))
|
|
|
|
{
|
|
|
|
thumb_width = thumb_width *
|
|
|
|
((((float)height * under_thumb_margin) -
|
|
|
|
xmb->margins_screen_top - xmb->icon_size) /
|
|
|
|
thumb_height);
|
|
|
|
thumb_height = thumb_height *
|
|
|
|
((((float)height * under_thumb_margin) -
|
|
|
|
xmb->margins_screen_top - xmb->icon_size) /
|
|
|
|
thumb_height);
|
|
|
|
}
|
|
|
|
|
|
|
|
xmb_draw_thumbnail(video_info,
|
|
|
|
xmb, &coord_white[0], width, height,
|
|
|
|
(float)width - (xmb->icon_size / 6) - thumb_max_width +
|
|
|
|
((thumb_max_width - thumb_width) / 2),
|
|
|
|
xmb->margins_screen_top + xmb->icon_size + thumb_height,
|
|
|
|
thumb_width, thumb_height,
|
|
|
|
xmb->thumbnail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Left thumbnail in the left margin */
|
|
|
|
/* Do not draw the left thumbnail if there is no space available */
|
|
|
|
if (!hide_thumbnails && xmb->use_ps3_layout &&
|
|
|
|
!settings->bools.menu_xmb_vertical_thumbnails &&
|
|
|
|
(xmb->margins_screen_top + xmb->icon_size *
|
|
|
|
(!(xmb->depth == 1)? 2.1 : 1) + min_thumb_size)
|
|
|
|
<= (float)height)
|
|
|
|
{
|
|
|
|
/* Left Thumbnail in the left margin */
|
|
|
|
|
|
|
|
if (xmb->left_thumbnail
|
|
|
|
&& !string_is_equal(xmb_thumbnails_ident('L'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
/* Limit left thumbnail width */
|
|
|
|
|
|
|
|
float left_thumb_width = 0.0f;
|
|
|
|
float left_thumb_height = 0.0f;
|
|
|
|
float thumb_max_width = xmb->icon_size * 3.4;
|
|
|
|
|
|
|
|
#ifdef XMB_DEBUG
|
|
|
|
RARCH_LOG("[XMB left thumbnail] width: %.2f, height: %.2f\n",
|
|
|
|
xmb->left_thumbnail_width, xmb->left_thumbnail_height);
|
|
|
|
RARCH_LOG("[XMB left thumbnail] w: %.2f, h: %.2f\n", width, height);
|
2016-12-12 03:18:48 +01:00
|
|
|
#endif
|
2014-10-09 04:34:16 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->left_thumbnail_width * scale_mod[4] > thumb_max_width)
|
|
|
|
{
|
|
|
|
left_thumb_width = (xmb->left_thumbnail_width * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->left_thumbnail_width * scale_mod[4]));
|
|
|
|
left_thumb_height = (xmb->left_thumbnail_height * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->left_thumbnail_width * scale_mod[4]));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
left_thumb_width = xmb->left_thumbnail_width * scale_mod[4];
|
|
|
|
left_thumb_height = xmb->left_thumbnail_height * scale_mod[4];
|
|
|
|
}
|
2016-05-22 22:29:12 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Limit left thumbnail height to screen height + margin. */
|
|
|
|
if (xmb->margins_screen_top + xmb->icon_size *
|
|
|
|
(!(xmb->depth == 1)? 2.1 : 1) +
|
|
|
|
left_thumb_height >=
|
|
|
|
((float)height - (96.0 * scale_factor)))
|
|
|
|
{
|
|
|
|
left_thumb_width = left_thumb_width *
|
|
|
|
((((float)height - (96.0 * scale_factor))
|
|
|
|
- xmb->margins_screen_top -
|
|
|
|
(xmb->icon_size * (!(xmb->depth == 1)? 2.1 : 1))) /
|
|
|
|
left_thumb_height);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
left_thumb_height = left_thumb_height *
|
|
|
|
((((float)height - (96.0 * scale_factor))
|
|
|
|
- xmb->margins_screen_top -
|
|
|
|
(xmb->icon_size * (!(xmb->depth == 1)? 2.1 : 1))) /
|
|
|
|
left_thumb_height);
|
|
|
|
}
|
2016-05-22 22:29:12 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_draw_thumbnail(video_info,
|
|
|
|
xmb, &coord_white[0], width, height,
|
|
|
|
(xmb->icon_size / 6) +
|
|
|
|
((thumb_max_width - left_thumb_width) / 2),
|
|
|
|
xmb->margins_screen_top + xmb->icon_size *
|
|
|
|
(!(xmb->depth == 1)? 2.1 : 1) + left_thumb_height,
|
|
|
|
left_thumb_width, left_thumb_height,
|
|
|
|
xmb->left_thumbnail);
|
|
|
|
}
|
|
|
|
}
|
2016-05-22 22:29:12 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* No Right Thumbnail, draw only the left one big size */
|
|
|
|
if (!hide_thumbnails && !xmb->savestate_thumbnail && xmb->use_ps3_layout &&
|
|
|
|
settings->bools.menu_xmb_vertical_thumbnails && !xmb->thumbnail)
|
|
|
|
{
|
|
|
|
/* Do not draw the left thumbnail if there is no space available */
|
2018-10-09 20:30:20 -03:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (((xmb->margins_screen_top +
|
|
|
|
xmb->icon_size + min_thumb_size) <= height) &&
|
|
|
|
((xmb->margins_screen_left * scale_mod[5] +
|
|
|
|
xmb->icon_spacing_horizontal +
|
|
|
|
pseudo_font_length + min_thumb_size) <= width))
|
|
|
|
{
|
|
|
|
if (xmb->left_thumbnail
|
|
|
|
&& !string_is_equal(xmb_thumbnails_ident('L'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
/* Limit left thumbnail width */
|
2018-10-09 20:30:20 -03:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
float left_thumb_width = 0.0f;
|
|
|
|
float left_thumb_height = 0.0f;
|
|
|
|
float thumb_max_width = (float)width - (xmb->icon_size / 6)
|
|
|
|
- (xmb->margins_screen_left * scale_mod[5]) -
|
|
|
|
xmb->icon_spacing_horizontal - pseudo_font_length;
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
#ifdef XMB_DEBUG
|
|
|
|
RARCH_LOG("[XMB thumbnail] width: %.2f, height: %.2f\n",
|
|
|
|
xmb->thumbnail_width, xmb->thumbnail_height);
|
|
|
|
RARCH_LOG("[XMB thumbnail] w: %.2f, h: %.2f\n", width, height);
|
2016-07-30 22:17:55 +01:00
|
|
|
#endif
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->left_thumbnail_width * scale_mod[4] > thumb_max_width)
|
|
|
|
{
|
|
|
|
left_thumb_width = (xmb->left_thumbnail_width * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->left_thumbnail_width * scale_mod[4]));
|
|
|
|
left_thumb_height = (xmb->left_thumbnail_height * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->left_thumbnail_width * scale_mod[4]));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
left_thumb_width = xmb->left_thumbnail_width * scale_mod[4];
|
|
|
|
left_thumb_height = xmb->left_thumbnail_height * scale_mod[4];
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Limit left thumbnail height to screen height + margin. */
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->margins_screen_top + xmb->icon_size + left_thumb_height >=
|
|
|
|
((float)height * under_thumb_margin))
|
|
|
|
{
|
|
|
|
left_thumb_width = left_thumb_width *
|
|
|
|
((((float)height * under_thumb_margin) -
|
|
|
|
xmb->margins_screen_top - xmb->icon_size) /
|
|
|
|
left_thumb_height);
|
|
|
|
left_thumb_height = left_thumb_height *
|
|
|
|
((((float)height * under_thumb_margin) -
|
|
|
|
xmb->margins_screen_top - xmb->icon_size) /
|
|
|
|
left_thumb_height);
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_draw_thumbnail(video_info,
|
|
|
|
xmb, &coord_white[0], width, height,
|
|
|
|
(float)width - (xmb->icon_size / 6) - thumb_max_width +
|
|
|
|
((thumb_max_width - left_thumb_width) / 2),
|
|
|
|
xmb->margins_screen_top + xmb->icon_size + left_thumb_height,
|
|
|
|
left_thumb_width, left_thumb_height,
|
|
|
|
xmb->left_thumbnail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* PSP Layout Only - Left thumbnail in the left margin */
|
|
|
|
/* Do not draw the left thumbnail if there is no space available */
|
|
|
|
if (!hide_thumbnails && !xmb->use_ps3_layout &&
|
|
|
|
(xmb->margins_screen_top + xmb->icon_size * 1.5)
|
|
|
|
<= (float)height)
|
|
|
|
{
|
|
|
|
/* Left Thumbnail in the left margin */
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->left_thumbnail
|
|
|
|
&& !string_is_equal(xmb_thumbnails_ident('L'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
/* Limit left thumbnail width */
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
float left_thumb_width = 0.0f;
|
|
|
|
float left_thumb_height = 0.0f;
|
|
|
|
float thumb_max_width = xmb->icon_size * 2.4;
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
#ifdef XMB_DEBUG
|
|
|
|
RARCH_LOG("[XMB left thumbnail] width: %.2f, height: %.2f\n",
|
|
|
|
xmb->left_thumbnail_width, xmb->left_thumbnail_height);
|
|
|
|
RARCH_LOG("[XMB left thumbnail] w: %.2f, h: %.2f\n", width, height);
|
|
|
|
#endif
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->left_thumbnail_width > thumb_max_width)
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
left_thumb_width = xmb->left_thumbnail_width *
|
|
|
|
(thumb_max_width / xmb->left_thumbnail_width);
|
|
|
|
left_thumb_height = xmb->left_thumbnail_height *
|
|
|
|
(thumb_max_width / xmb->left_thumbnail_width);
|
2018-11-25 02:45:13 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
else
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
left_thumb_width = xmb->left_thumbnail_width;
|
|
|
|
left_thumb_height = xmb->left_thumbnail_height;
|
2018-11-25 02:45:13 +01:00
|
|
|
}
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Limit left thumbnail height to screen height + margin. */
|
|
|
|
if (xmb->margins_screen_top + xmb->icon_size +
|
|
|
|
left_thumb_height >= ((float)height - (xmb->icon_size * 0.5)))
|
|
|
|
{
|
|
|
|
left_thumb_width = left_thumb_width *
|
|
|
|
(((float)height - (xmb->icon_size * 0.5) -
|
|
|
|
xmb->margins_screen_top - xmb->icon_size) /
|
|
|
|
left_thumb_height);
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
left_thumb_height = left_thumb_height *
|
|
|
|
(((float)height - (xmb->icon_size * 0.5) -
|
|
|
|
xmb->margins_screen_top - xmb->icon_size) /
|
|
|
|
left_thumb_height);
|
|
|
|
}
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_draw_thumbnail(video_info,
|
|
|
|
xmb, &coord_white[0], width, height,
|
|
|
|
((thumb_max_width - left_thumb_width) / 2),
|
|
|
|
xmb->margins_screen_top + (xmb->icon_size * (!(xmb->depth == 1)? 2.2 : 0.75)) +
|
|
|
|
left_thumb_height,
|
|
|
|
left_thumb_width, left_thumb_height,
|
|
|
|
xmb->left_thumbnail);
|
2018-11-25 02:45:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Clock image */
|
2019-01-25 10:17:17 -03:00
|
|
|
menu_display_set_alpha(item_color, MIN(xmb->alpha, 1.00f));
|
2018-11-25 20:34:50 +01:00
|
|
|
|
|
|
|
if (video_info->battery_level_enable)
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
char msg[12];
|
|
|
|
static retro_time_t last_time = 0;
|
|
|
|
bool charging = false;
|
|
|
|
retro_time_t current_time = cpu_features_get_time_usec();
|
|
|
|
int percent = 0;
|
|
|
|
enum frontend_powerstate state = get_last_powerstate(&percent);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (state == FRONTEND_POWERSTATE_CHARGING)
|
|
|
|
charging = true;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (current_time - last_time >= BATTERY_LEVEL_CHECK_INTERVAL)
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
last_time = current_time;
|
|
|
|
task_push_get_powerstate();
|
2018-11-25 02:45:13 +01:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
*msg = '\0';
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (percent > 0)
|
|
|
|
{
|
|
|
|
size_t x_pos = xmb->icon_size / 6;
|
|
|
|
size_t x_pos_icon = xmb->margins_title_left;
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
if (coord_white[3] != 0 && !xmb->assets_missing)
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_draw_icon(video_info,
|
|
|
|
xmb->icon_size,
|
|
|
|
&mymat,
|
|
|
|
xmb->textures.list[charging
|
|
|
|
? XMB_TEXTURE_BATTERY_CHARGING : XMB_TEXTURE_BATTERY_FULL],
|
|
|
|
width - (xmb->icon_size / 2) - x_pos_icon,
|
|
|
|
xmb->icon_size,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
1,
|
|
|
|
0,
|
|
|
|
1,
|
2019-01-25 10:17:17 -03:00
|
|
|
&item_color[0],
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->shadow_offset);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
snprintf(msg, sizeof(msg), "%d%%", percent);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
percent_width = (unsigned)
|
|
|
|
font_driver_get_message_width(
|
|
|
|
xmb->font, msg, (unsigned)strlen(msg), 1);
|
|
|
|
|
|
|
|
xmb_draw_text(video_info, xmb, msg,
|
|
|
|
width - xmb->margins_title_left - x_pos,
|
|
|
|
xmb->margins_title_top, 1, 1, TEXT_ALIGN_RIGHT,
|
|
|
|
width, height, xmb->font);
|
|
|
|
}
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-12-22 14:51:33 -08:00
|
|
|
if (video_info->timedate_enable)
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_ctx_datetime_t datetime;
|
|
|
|
char timedate[255];
|
|
|
|
int x_pos = 0;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-12-22 14:51:33 -08:00
|
|
|
if (coord_white[3] != 0 && !xmb->assets_missing)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
int x_pos = 0;
|
|
|
|
|
|
|
|
if (percent_width)
|
|
|
|
x_pos = percent_width + (xmb->icon_size / 2.5);
|
|
|
|
|
|
|
|
xmb_draw_icon(video_info,
|
|
|
|
xmb->icon_size,
|
|
|
|
&mymat,
|
|
|
|
xmb->textures.list[XMB_TEXTURE_CLOCK],
|
|
|
|
width - xmb->icon_size - x_pos,
|
|
|
|
xmb->icon_size,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
1,
|
|
|
|
0,
|
|
|
|
1,
|
2019-01-25 10:17:17 -03:00
|
|
|
&item_color[0],
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->shadow_offset);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
timedate[0] = '\0';
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
datetime.s = timedate;
|
|
|
|
datetime.len = sizeof(timedate);
|
|
|
|
datetime.time_mode = settings->uints.menu_timedate_style;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_timedate(&datetime);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (percent_width)
|
|
|
|
x_pos = percent_width + (xmb->icon_size / 2.5);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_draw_text(video_info, xmb, timedate,
|
|
|
|
width - xmb->margins_title_left - xmb->icon_size / 4 - x_pos,
|
|
|
|
xmb->margins_title_top, 1, 1, TEXT_ALIGN_RIGHT,
|
|
|
|
width, height, xmb->font);
|
|
|
|
}
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Arrow image */
|
2019-01-25 10:17:17 -03:00
|
|
|
menu_display_set_alpha(item_color,
|
2018-11-25 20:34:50 +01:00
|
|
|
MIN(xmb->textures_arrow_alpha, xmb->alpha));
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
if (coord_white[3] != 0 && !xmb->assets_missing)
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_draw_icon(video_info,
|
|
|
|
xmb->icon_size,
|
|
|
|
&mymat,
|
|
|
|
xmb->textures.list[XMB_TEXTURE_ARROW],
|
|
|
|
xmb->x + xmb->margins_screen_left +
|
|
|
|
xmb->icon_spacing_horizontal -
|
|
|
|
xmb->icon_size / 2.0 + xmb->icon_size,
|
|
|
|
xmb->margins_screen_top +
|
|
|
|
xmb->icon_size / 2.0 + xmb->icon_spacing_vertical
|
|
|
|
* xmb->active_item_factor,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
xmb->textures_arrow_alpha,
|
|
|
|
0,
|
|
|
|
1,
|
2019-01-25 10:17:17 -03:00
|
|
|
&item_color[0],
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->shadow_offset);
|
2018-11-25 02:48:14 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_blend_begin(video_info);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Horizontal tab icons */
|
2018-11-29 14:47:46 -03:00
|
|
|
if (!xmb->assets_missing)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-29 14:47:46 -03:00
|
|
|
for (i = 0; i <= xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
|
|
|
|
+ xmb->system_tab_end; i++)
|
|
|
|
{
|
|
|
|
xmb_node_t *node = xmb_get_node(xmb, i);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
if (!node)
|
|
|
|
continue;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
menu_display_set_alpha(item_color, MIN(node->alpha, xmb->alpha));
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
if (item_color[3] != 0)
|
|
|
|
{
|
|
|
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
|
|
|
math_matrix_4x4 mymat;
|
|
|
|
uintptr_t texture = node->icon;
|
|
|
|
float x = xmb->x + xmb->categories_x_pos +
|
|
|
|
xmb->margins_screen_left +
|
|
|
|
xmb->icon_spacing_horizontal
|
|
|
|
* (i + 1) - xmb->icon_size / 2.0;
|
|
|
|
float y = xmb->margins_screen_top
|
|
|
|
+ xmb->icon_size / 2.0;
|
|
|
|
float rotation = 0;
|
|
|
|
float scale_factor = node->zoom;
|
|
|
|
|
|
|
|
rotate_draw.matrix = &mymat;
|
|
|
|
rotate_draw.rotation = rotation;
|
|
|
|
rotate_draw.scale_x = scale_factor;
|
|
|
|
rotate_draw.scale_y = scale_factor;
|
|
|
|
rotate_draw.scale_z = 1;
|
|
|
|
rotate_draw.scale_enable = true;
|
|
|
|
|
|
|
|
menu_display_rotate_z(&rotate_draw, video_info);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
xmb_draw_icon(video_info,
|
|
|
|
xmb->icon_size,
|
|
|
|
&mymat,
|
|
|
|
texture,
|
|
|
|
x,
|
|
|
|
y,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
1.0,
|
|
|
|
rotation,
|
|
|
|
scale_factor,
|
|
|
|
&item_color[0],
|
|
|
|
xmb->shadow_offset);
|
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Right side 2 thumbnails on top of each other */
|
|
|
|
/* here to be displayed above the horizontal icons */
|
2018-11-25 03:01:41 +01:00
|
|
|
if (!hide_thumbnails && !xmb->savestate_thumbnail && xmb->use_ps3_layout &&
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->left_thumbnail && xmb->thumbnail &&
|
|
|
|
settings->bools.menu_xmb_vertical_thumbnails)
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 03:01:41 +01:00
|
|
|
/* Do not draw the right thumbnail if there is no space available */
|
|
|
|
if (((xmb->margins_screen_top +
|
|
|
|
xmb->icon_size + min_thumb_size) <= height) &&
|
|
|
|
((xmb->margins_screen_left * scale_mod[5] +
|
|
|
|
xmb->icon_spacing_horizontal +
|
|
|
|
pseudo_font_length + min_thumb_size) <= width))
|
2018-11-25 02:48:14 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->thumbnail &&
|
|
|
|
!string_is_equal(xmb_thumbnails_ident('R'),
|
2018-11-25 03:01:41 +01:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Limit right thumbnail width */
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 03:01:41 +01:00
|
|
|
float thumb_width = 0.0f;
|
|
|
|
float thumb_height = 0.0f;
|
2018-11-25 20:34:50 +01:00
|
|
|
float thumb_max_width = (float)width - (xmb->icon_size / 6) -
|
|
|
|
(xmb->margins_screen_left * scale_mod[5]) -
|
2018-11-25 03:01:41 +01:00
|
|
|
xmb->icon_spacing_horizontal - pseudo_font_length;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 03:01:41 +01:00
|
|
|
#ifdef XMB_DEBUG
|
|
|
|
RARCH_LOG("[XMB thumbnail] width: %.2f, height: %.2f\n",
|
|
|
|
xmb->thumbnail_width, xmb->thumbnail_height);
|
|
|
|
RARCH_LOG("[XMB thumbnail] w: %.2f, h: %.2f\n", width, height);
|
|
|
|
#endif
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 03:01:41 +01:00
|
|
|
if (xmb->thumbnail_width * scale_mod[4] > thumb_max_width)
|
|
|
|
{
|
|
|
|
thumb_width = (xmb->thumbnail_width * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->thumbnail_width * scale_mod[4]));
|
|
|
|
thumb_height = (xmb->thumbnail_height * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->thumbnail_width * scale_mod[4]));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
thumb_width = xmb->thumbnail_width * scale_mod[4];
|
|
|
|
thumb_height = xmb->thumbnail_height * scale_mod[4];
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Limit right thumbnail height to usable area. */
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (thumb_height >=
|
|
|
|
((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
|
|
|
thumb_width = thumb_width *
|
2018-11-25 20:34:50 +01:00
|
|
|
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
|
2018-11-25 03:01:41 +01:00
|
|
|
thumb_height);
|
|
|
|
thumb_height = thumb_height *
|
2018-11-25 20:34:50 +01:00
|
|
|
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
|
2018-11-25 03:01:41 +01:00
|
|
|
thumb_height);
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 03:01:41 +01:00
|
|
|
xmb_draw_thumbnail(video_info,
|
|
|
|
xmb, &coord_white[0], width, height,
|
|
|
|
(float)width - (xmb->icon_size / 6) - thumb_max_width +
|
|
|
|
((thumb_max_width - thumb_width) / 2),
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->icon_size + ((((float)height / 2 -
|
|
|
|
(xmb->icon_size + (xmb->icon_size/12))) - thumb_height) / 2) +
|
|
|
|
thumb_height,
|
2018-11-25 03:01:41 +01:00
|
|
|
thumb_width, thumb_height,
|
|
|
|
xmb->thumbnail);
|
|
|
|
}
|
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
|
|
|
|
/* Do not draw the left thumbnail if there is no space available */
|
|
|
|
|
|
|
|
if (((xmb->margins_screen_top +
|
|
|
|
xmb->icon_size + min_thumb_size) <= height) &&
|
|
|
|
((xmb->margins_screen_left * scale_mod[5] +
|
|
|
|
xmb->icon_spacing_horizontal +
|
|
|
|
pseudo_font_length + min_thumb_size) <= width))
|
|
|
|
{
|
|
|
|
if (xmb->left_thumbnail &&
|
|
|
|
!string_is_equal(xmb_thumbnails_ident('L'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
/* Limit left thumbnail width */
|
|
|
|
|
|
|
|
float left_thumb_width = 0.0f;
|
|
|
|
float left_thumb_height = 0.0f;
|
|
|
|
float thumb_max_width = (float)width - (xmb->icon_size / 6) -
|
|
|
|
(xmb->margins_screen_left * scale_mod[5]) -
|
|
|
|
xmb->icon_spacing_horizontal - pseudo_font_length;
|
|
|
|
|
|
|
|
#ifdef XMB_DEBUG
|
|
|
|
RARCH_LOG("[XMB left thumbnail] width: %.2f, height: %.2f\n",
|
|
|
|
xmb->left_thumbnail_width, xmb->left_thumbnail_height);
|
|
|
|
RARCH_LOG("[XMB left thumbnail] w: %.2f, h: %.2f\n", width, height);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (xmb->left_thumbnail_width * scale_mod[4] > thumb_max_width)
|
|
|
|
{
|
|
|
|
left_thumb_width = (xmb->left_thumbnail_width * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->left_thumbnail_width * scale_mod[4]));
|
|
|
|
left_thumb_height = (xmb->left_thumbnail_height * scale_mod[4]) *
|
|
|
|
(thumb_max_width / (xmb->left_thumbnail_width * scale_mod[4]));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
left_thumb_width = xmb->left_thumbnail_width * scale_mod[4];
|
|
|
|
left_thumb_height = xmb->left_thumbnail_height * scale_mod[4];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Limit left thumbnail height to usable area. */
|
|
|
|
|
|
|
|
if (left_thumb_height >=
|
|
|
|
((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2)
|
|
|
|
{
|
|
|
|
left_thumb_width = left_thumb_width *
|
|
|
|
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
|
|
|
|
left_thumb_height);
|
|
|
|
left_thumb_height = left_thumb_height *
|
|
|
|
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
|
|
|
|
left_thumb_height);
|
|
|
|
}
|
|
|
|
|
|
|
|
xmb_draw_thumbnail(video_info,
|
|
|
|
xmb, &coord_white[0], width, height,
|
|
|
|
(float)width - (xmb->icon_size / 6) - thumb_max_width +
|
|
|
|
((thumb_max_width - left_thumb_width) / 2),
|
|
|
|
xmb->icon_size +
|
|
|
|
(((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) +
|
|
|
|
(((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) -
|
|
|
|
left_thumb_height) / 2) + left_thumb_height,
|
|
|
|
left_thumb_width, left_thumb_height,
|
|
|
|
xmb->left_thumbnail);
|
|
|
|
}
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_blend_end(video_info);
|
|
|
|
|
|
|
|
/* Vertical icons */
|
|
|
|
if (xmb)
|
|
|
|
xmb_draw_items(
|
|
|
|
video_info,
|
|
|
|
xmb,
|
|
|
|
xmb->selection_buf_old,
|
|
|
|
xmb->selection_ptr_old,
|
|
|
|
(xmb_list_get_size(xmb, MENU_LIST_PLAIN) > 1)
|
|
|
|
? xmb->categories_selection_ptr :
|
|
|
|
xmb->categories_selection_ptr_old,
|
|
|
|
&item_color[0],
|
|
|
|
width,
|
|
|
|
height);
|
|
|
|
|
|
|
|
selection_buf = menu_entries_get_selection_buf_ptr(0);
|
|
|
|
|
|
|
|
if (xmb)
|
|
|
|
xmb_draw_items(
|
|
|
|
video_info,
|
|
|
|
xmb,
|
|
|
|
selection_buf,
|
|
|
|
selection,
|
|
|
|
xmb->categories_selection_ptr,
|
|
|
|
&item_color[0],
|
|
|
|
width,
|
|
|
|
height);
|
|
|
|
|
|
|
|
font_driver_flush(video_info->width, video_info->height, xmb->font,
|
|
|
|
video_info);
|
|
|
|
font_driver_bind_block(xmb->font, NULL);
|
|
|
|
|
|
|
|
font_driver_flush(video_info->width, video_info->height, xmb->font2,
|
|
|
|
video_info);
|
|
|
|
font_driver_bind_block(xmb->font2, NULL);
|
|
|
|
|
|
|
|
if (menu_input_dialog_get_display_kb())
|
2018-11-25 02:48:14 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
const char *str = menu_input_dialog_get_buffer();
|
|
|
|
const char *label = menu_input_dialog_get_label_buffer();
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
snprintf(msg, sizeof(msg), "%s\n%s", label, str);
|
|
|
|
render_background = true;
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!string_is_empty(xmb->box_message))
|
|
|
|
{
|
|
|
|
strlcpy(msg, xmb->box_message,
|
|
|
|
sizeof(msg));
|
|
|
|
free(xmb->box_message);
|
|
|
|
xmb->box_message = NULL;
|
|
|
|
render_background = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (render_background)
|
|
|
|
{
|
|
|
|
xmb_draw_dark_layer(xmb, video_info, width, height);
|
|
|
|
xmb_render_messagebox_internal(
|
|
|
|
video_info, xmb, msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Cursor image */
|
|
|
|
if (xmb->mouse_show)
|
|
|
|
{
|
|
|
|
menu_display_set_alpha(coord_white, MIN(xmb->alpha, 1.00f));
|
|
|
|
menu_display_draw_cursor(
|
|
|
|
video_info,
|
|
|
|
&coord_white[0],
|
|
|
|
xmb->cursor_size,
|
|
|
|
xmb->textures.list[XMB_TEXTURE_POINTER],
|
|
|
|
menu_input_mouse_state(MENU_MOUSE_X_AXIS),
|
|
|
|
menu_input_mouse_state(MENU_MOUSE_Y_AXIS),
|
|
|
|
width,
|
|
|
|
height);
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_display_unset_viewport(video_info->width, video_info->height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void xmb_layout_ps3(xmb_handle_t *xmb, int width)
|
|
|
|
{
|
|
|
|
unsigned new_font_size, new_header_height;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
|
|
|
float scale_factor =
|
|
|
|
(settings->uints.menu_xmb_scale_factor * width) / (1920.0 * 100);
|
|
|
|
|
|
|
|
xmb->above_subitem_offset = 1.5;
|
|
|
|
xmb->above_item_offset = -1.0;
|
|
|
|
xmb->active_item_factor = 3.0;
|
|
|
|
xmb->under_item_offset = 5.0;
|
|
|
|
|
|
|
|
xmb->categories_active_zoom = 1.0;
|
|
|
|
xmb->categories_passive_zoom = 0.5;
|
|
|
|
xmb->items_active_zoom = 1.0;
|
|
|
|
xmb->items_passive_zoom = 0.5;
|
|
|
|
|
|
|
|
xmb->categories_active_alpha = 1.0;
|
|
|
|
xmb->categories_passive_alpha = 0.85;
|
|
|
|
xmb->items_active_alpha = 1.0;
|
|
|
|
xmb->items_passive_alpha = 0.85;
|
|
|
|
|
|
|
|
xmb->shadow_offset = 2.0;
|
|
|
|
|
|
|
|
new_font_size = 32.0 * scale_factor;
|
|
|
|
xmb->font2_size = 24.0 * scale_factor;
|
|
|
|
new_header_height = 128.0 * scale_factor;
|
|
|
|
|
|
|
|
xmb->thumbnail_width = 1024.0 * scale_factor;
|
|
|
|
xmb->left_thumbnail_width = 1024.0 * scale_factor;
|
|
|
|
xmb->savestate_thumbnail_width= 460.0 * scale_factor;
|
|
|
|
xmb->cursor_size = 64.0 * scale_factor;
|
|
|
|
|
|
|
|
xmb->icon_spacing_horizontal = 200.0 * scale_factor;
|
|
|
|
xmb->icon_spacing_vertical = 64.0 * scale_factor;
|
|
|
|
|
|
|
|
xmb->margins_screen_top = (256+32) * scale_factor;
|
|
|
|
xmb->margins_screen_left = 336.0 * scale_factor;
|
|
|
|
|
|
|
|
xmb->margins_title_left = 60 * scale_factor;
|
|
|
|
xmb->margins_title_top = 60 * scale_factor + new_font_size / 3;
|
|
|
|
xmb->margins_title_bottom = 60 * scale_factor - new_font_size / 3;
|
|
|
|
|
|
|
|
xmb->margins_label_left = 85.0 * scale_factor;
|
|
|
|
xmb->margins_label_top = new_font_size / 3.0;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->margins_setting_left = 600.0 * scale_factor * scale_mod[6];
|
|
|
|
xmb->margins_dialog = 48 * scale_factor;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->margins_slice = 16;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->icon_size = 128.0 * scale_factor;
|
|
|
|
xmb->font_size = new_font_size;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_set_header_height(new_header_height);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_layout_psp(xmb_handle_t *xmb, int width)
|
|
|
|
{
|
|
|
|
unsigned new_font_size, new_header_height;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
float scale_factor =
|
|
|
|
((settings->uints.menu_xmb_scale_factor * width) / (1920.0 * 100)) * 1.5;
|
|
|
|
#ifdef _3DS
|
|
|
|
scale_factor =
|
|
|
|
settings->uints.menu_xmb_scale_factor / 400.0;
|
|
|
|
#endif
|
2016-04-18 02:20:54 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->above_subitem_offset = 1.5;
|
|
|
|
xmb->above_item_offset = -1.0;
|
|
|
|
xmb->active_item_factor = 2.0;
|
|
|
|
xmb->under_item_offset = 3.0;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->categories_active_zoom = 1.0;
|
|
|
|
xmb->categories_passive_zoom = 1.0;
|
|
|
|
xmb->items_active_zoom = 1.0;
|
|
|
|
xmb->items_passive_zoom = 1.0;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->categories_active_alpha = 1.0;
|
|
|
|
xmb->categories_passive_alpha = 0.85;
|
|
|
|
xmb->items_active_alpha = 1.0;
|
|
|
|
xmb->items_passive_alpha = 0.85;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->shadow_offset = 1.0;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
new_font_size = 32.0 * scale_factor;
|
|
|
|
xmb->font2_size = 24.0 * scale_factor;
|
|
|
|
new_header_height = 128.0 * scale_factor;
|
|
|
|
xmb->margins_screen_top = (256+32) * scale_factor;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->thumbnail_width = 460.0 * scale_factor;
|
|
|
|
xmb->left_thumbnail_width = 400.0 * scale_factor;
|
|
|
|
xmb->savestate_thumbnail_width= 460.0 * scale_factor;
|
|
|
|
xmb->cursor_size = 64.0;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->icon_spacing_horizontal = 250.0 * scale_factor;
|
|
|
|
xmb->icon_spacing_vertical = 108.0 * scale_factor;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->margins_screen_left = 136.0 * scale_factor;
|
|
|
|
xmb->margins_title_left = 60 * scale_factor;
|
|
|
|
xmb->margins_title_top = 60 * scale_factor + new_font_size / 3;
|
|
|
|
xmb->margins_title_bottom = 60 * scale_factor - new_font_size / 3;
|
|
|
|
xmb->margins_label_left = 85.0 * scale_factor;
|
|
|
|
xmb->margins_label_top = new_font_size / 3.0;
|
|
|
|
xmb->margins_setting_left = 600.0 * scale_factor;
|
|
|
|
xmb->margins_dialog = 48 * scale_factor;
|
|
|
|
xmb->margins_slice = 16;
|
|
|
|
xmb->icon_size = 128.0 * scale_factor;
|
|
|
|
xmb->font_size = new_font_size;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_set_header_height(new_header_height);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_layout(xmb_handle_t *xmb)
|
|
|
|
{
|
|
|
|
unsigned width, height, i, current, end;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
|
|
|
size_t selection = menu_navigation_get_selection();
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
video_driver_get_size(&width, &height);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
switch (settings->uints.menu_xmb_layout)
|
|
|
|
{
|
|
|
|
/* Automatic */
|
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
xmb->use_ps3_layout = false;
|
|
|
|
xmb->use_ps3_layout = width > 320 && height > 240;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* Mimic the layout of the PSP instead of the PS3 on tiny screens */
|
|
|
|
if (xmb->use_ps3_layout)
|
|
|
|
xmb_layout_ps3(xmb, width);
|
|
|
|
else
|
|
|
|
xmb_layout_psp(xmb, width);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
/* PS3 */
|
|
|
|
case 1:
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->use_ps3_layout = true;
|
|
|
|
xmb_layout_ps3(xmb, width);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
break;
|
|
|
|
/* PSP */
|
|
|
|
case 2:
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->use_ps3_layout = false;
|
|
|
|
xmb_layout_psp(xmb, width);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
break;
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
#ifdef XMB_DEBUG
|
|
|
|
RARCH_LOG("[XMB] margin screen left: %.2f\n", xmb->margins_screen_left);
|
|
|
|
RARCH_LOG("[XMB] margin screen top: %.2f\n", xmb->margins_screen_top);
|
|
|
|
RARCH_LOG("[XMB] margin title left: %.2f\n", xmb->margins_title_left);
|
|
|
|
RARCH_LOG("[XMB] margin title top: %.2f\n", xmb->margins_title_top);
|
|
|
|
RARCH_LOG("[XMB] margin title bott: %.2f\n", xmb->margins_title_bottom);
|
|
|
|
RARCH_LOG("[XMB] margin label left: %.2f\n", xmb->margins_label_left);
|
|
|
|
RARCH_LOG("[XMB] margin label top: %.2f\n", xmb->margins_label_top);
|
|
|
|
RARCH_LOG("[XMB] margin sett left: %.2f\n", xmb->margins_setting_left);
|
|
|
|
RARCH_LOG("[XMB] icon spacing hor: %.2f\n", xmb->icon_spacing_horizontal);
|
|
|
|
RARCH_LOG("[XMB] icon spacing ver: %.2f\n", xmb->icon_spacing_vertical);
|
|
|
|
RARCH_LOG("[XMB] icon size: %.2f\n", xmb->icon_size);
|
|
|
|
#endif
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
current = (unsigned)selection;
|
|
|
|
end = (unsigned)menu_entries_get_size();
|
|
|
|
|
|
|
|
for (i = 0; i < end; i++)
|
|
|
|
{
|
|
|
|
float ia = xmb->items_passive_alpha;
|
|
|
|
float iz = xmb->items_passive_zoom;
|
|
|
|
xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
|
|
|
|
selection_buf, i);
|
|
|
|
|
|
|
|
if (!node)
|
|
|
|
continue;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (i == current)
|
|
|
|
{
|
|
|
|
ia = xmb->items_active_alpha;
|
|
|
|
iz = xmb->items_active_alpha;
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
|
|
|
|
node->alpha = ia;
|
|
|
|
node->label_alpha = ia;
|
|
|
|
node->zoom = iz;
|
|
|
|
node->y = xmb_item_y(xmb, i, current);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->depth <= 1)
|
|
|
|
return;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
current = (unsigned)xmb->selection_ptr_old;
|
|
|
|
end = (unsigned)file_list_get_size(xmb->selection_buf_old);
|
|
|
|
|
|
|
|
for (i = 0; i < end; i++)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
float ia = 0;
|
|
|
|
float iz = xmb->items_passive_zoom;
|
|
|
|
xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
|
|
|
|
xmb->selection_buf_old, i);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!node)
|
|
|
|
continue;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (i == current)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
ia = xmb->items_active_alpha;
|
|
|
|
iz = xmb->items_active_alpha;
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
node->alpha = ia;
|
|
|
|
node->label_alpha = 0;
|
|
|
|
node->zoom = iz;
|
|
|
|
node->y = xmb_item_y(xmb, i, current);
|
|
|
|
node->x = xmb->icon_size * 1 * -2;
|
|
|
|
}
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_ribbon_set_vertex(float *ribbon_verts,
|
|
|
|
unsigned idx, unsigned row, unsigned col)
|
|
|
|
{
|
|
|
|
ribbon_verts[idx++] = ((float)col) / (XMB_RIBBON_COLS-1) * 2.0f - 1.0f;
|
|
|
|
ribbon_verts[idx++] = ((float)row) / (XMB_RIBBON_ROWS-1) * 2.0f - 1.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void xmb_init_ribbon(xmb_handle_t * xmb)
|
|
|
|
{
|
|
|
|
video_coords_t coords;
|
|
|
|
unsigned r, c, col;
|
|
|
|
unsigned i = 0;
|
|
|
|
video_coord_array_t *ca = menu_display_get_coords_array();
|
|
|
|
unsigned vertices_total = XMB_RIBBON_VERTICES;
|
|
|
|
float *dummy = (float*)calloc(4 * vertices_total, sizeof(float));
|
|
|
|
float *ribbon_verts = (float*)calloc(2 * vertices_total, sizeof(float));
|
|
|
|
|
|
|
|
/* Set up vertices */
|
|
|
|
for (r = 0; r < XMB_RIBBON_ROWS - 1; r++)
|
|
|
|
{
|
|
|
|
for (c = 0; c < XMB_RIBBON_COLS; c++)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
col = r % 2 ? XMB_RIBBON_COLS - c - 1 : c;
|
|
|
|
xmb_ribbon_set_vertex(ribbon_verts, i, r, col);
|
|
|
|
xmb_ribbon_set_vertex(ribbon_verts, i + 2, r + 1, col);
|
|
|
|
i += 4;
|
|
|
|
}
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
coords.color = dummy;
|
|
|
|
coords.vertex = ribbon_verts;
|
|
|
|
coords.tex_coord = dummy;
|
|
|
|
coords.lut_tex_coord = dummy;
|
|
|
|
coords.vertices = vertices_total;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
video_coord_array_append(ca, &coords, coords.vertices);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
free(dummy);
|
|
|
|
free(ribbon_verts);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void *xmb_init(void **userdata, bool video_is_threaded)
|
|
|
|
{
|
|
|
|
unsigned width, height;
|
|
|
|
int i;
|
|
|
|
xmb_handle_t *xmb = NULL;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
|
|
|
|
float scale_value = settings->uints.menu_xmb_scale_factor;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
/* scaling multiplier formulas made from these values: */
|
|
|
|
/* xmb_scale 50 = {2.5, 2.5, 2, 1.7, 2.5, 4, 2.4, 2.5} */
|
|
|
|
/* xmb_scale 75 = { 2, 1.6, 1.6, 1.4, 1.5, 2.3, 1.9, 1.3} */
|
|
|
|
|
|
|
|
if (scale_value < 100)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
/* text length & word wrap (base 35 apply to file browser, 1st column) */
|
|
|
|
scale_mod[0] = -0.03 * scale_value + 4.083;
|
|
|
|
/* playlist text length when thumbnail is ON (small, base 40) */
|
|
|
|
scale_mod[1] = -0.03 * scale_value + 3.95;
|
|
|
|
/* playlist text length when thumbnail is OFF (large, base 70) */
|
|
|
|
scale_mod[2] = -0.02 * scale_value + 3.033;
|
|
|
|
/* sub-label length & word wrap */
|
|
|
|
scale_mod[3] = -0.014 * scale_value + 2.416;
|
|
|
|
/* thumbnail size & vertical margin from top */
|
|
|
|
scale_mod[4] = -0.03 * scale_value + 3.916;
|
|
|
|
/* thumbnail horizontal left margin (horizontal positioning) */
|
|
|
|
scale_mod[5] = -0.06 * scale_value + 6.933;
|
|
|
|
/* margin before 2nd column start (shaders parameters, cheats...) */
|
|
|
|
scale_mod[6] = -0.028 * scale_value + 3.866;
|
|
|
|
/* text length & word wrap (base 35 apply to 2nd column in cheats, shaders, etc) */
|
|
|
|
scale_mod[7] = 134.179 * pow(scale_value, -1.0778);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
if (scale_mod[i] < 1)
|
|
|
|
scale_mod[i] = 1;
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!menu)
|
|
|
|
goto error;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!menu_display_init_first_driver(video_is_threaded))
|
|
|
|
goto error;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
video_driver_get_size(&width, &height);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb = (xmb_handle_t*)calloc(1, sizeof(xmb_handle_t));
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!xmb)
|
|
|
|
goto error;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
*userdata = xmb;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->selection_buf_old = (file_list_t*)calloc(1, sizeof(file_list_t));
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!xmb->selection_buf_old)
|
|
|
|
goto error;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->categories_active_idx = 0;
|
|
|
|
xmb->categories_active_idx_old = 0;
|
|
|
|
xmb->x = 0;
|
|
|
|
xmb->categories_x_pos = 0;
|
|
|
|
xmb->textures_arrow_alpha = 0;
|
|
|
|
xmb->depth = 1;
|
|
|
|
xmb->old_depth = 1;
|
|
|
|
xmb->alpha = 0;
|
|
|
|
|
|
|
|
xmb->system_tab_end = 0;
|
|
|
|
xmb->tabs[xmb->system_tab_end] = XMB_SYSTEM_TAB_MAIN;
|
|
|
|
if (settings->bools.menu_content_show_settings && !settings->bools.kiosk_mode_enable)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_SETTINGS;
|
|
|
|
if (settings->bools.menu_content_show_favorites)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_FAVORITES;
|
|
|
|
if (settings->bools.menu_content_show_history)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_HISTORY;
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
if (settings->bools.menu_content_show_images)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_IMAGES;
|
|
|
|
#endif
|
|
|
|
if (settings->bools.menu_content_show_music)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_MUSIC;
|
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
|
|
|
if (settings->bools.menu_content_show_video)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_VIDEO;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
if (settings->bools.menu_content_show_netplay)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_NETPLAY;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_LIBRETRODB
|
|
|
|
if (settings->bools.menu_content_show_add && !settings->bools.kiosk_mode_enable)
|
|
|
|
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_ADD;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
|
|
|
|
|
|
|
/* TODO/FIXME - we don't use framebuffer at all
|
|
|
|
* for XMB, we should refactor this dependency
|
|
|
|
* away. */
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_set_width(width);
|
|
|
|
menu_display_set_height(height);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_allocate_white_texture();
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->horizontal_list = (file_list_t*)calloc(1, sizeof(file_list_t));
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->horizontal_list)
|
|
|
|
xmb_init_horizontal_list(xmb);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_init_ribbon(xmb);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
return menu;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
error:
|
|
|
|
if (menu)
|
|
|
|
free(menu);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb)
|
|
|
|
{
|
|
|
|
if (xmb->selection_buf_old)
|
|
|
|
free(xmb->selection_buf_old);
|
|
|
|
xmb->selection_buf_old = NULL;
|
|
|
|
if (xmb->horizontal_list)
|
|
|
|
{
|
|
|
|
xmb_free_list_nodes(xmb->horizontal_list, false);
|
|
|
|
file_list_free(xmb->horizontal_list);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->horizontal_list = NULL;
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_free(void *data)
|
|
|
|
{
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
|
|
|
|
|
|
|
if (xmb)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->selection_buf_old)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_free_list_nodes(xmb->selection_buf_old, false);
|
|
|
|
file_list_free(xmb->selection_buf_old);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb->horizontal_list)
|
|
|
|
{
|
|
|
|
xmb_free_list_nodes(xmb->horizontal_list, false);
|
|
|
|
file_list_free(xmb->horizontal_list);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->selection_buf_old = NULL;
|
|
|
|
xmb->horizontal_list = NULL;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
video_coord_array_free(&xmb->raster_block.carr);
|
|
|
|
video_coord_array_free(&xmb->raster_block2.carr);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!string_is_empty(xmb->box_message))
|
|
|
|
free(xmb->box_message);
|
|
|
|
if (!string_is_empty(xmb->thumbnail_system))
|
|
|
|
free(xmb->thumbnail_system);
|
|
|
|
if (!string_is_empty(xmb->thumbnail_content))
|
|
|
|
free(xmb->thumbnail_content);
|
|
|
|
if (!string_is_empty(xmb->savestate_thumbnail_file_path))
|
|
|
|
free(xmb->savestate_thumbnail_file_path);
|
|
|
|
if (!string_is_empty(xmb->thumbnail_file_path))
|
|
|
|
free(xmb->thumbnail_file_path);
|
|
|
|
if (!string_is_empty(xmb->left_thumbnail_file_path))
|
|
|
|
free(xmb->left_thumbnail_file_path);
|
|
|
|
if (!string_is_empty(xmb->bg_file_path))
|
|
|
|
free(xmb->bg_file_path);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
font_driver_bind_block(NULL, NULL);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_context_bg_destroy(xmb_handle_t *xmb)
|
|
|
|
{
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
video_driver_texture_unload(&xmb->textures.bg);
|
|
|
|
video_driver_texture_unload(&menu_display_white_texture);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static bool xmb_load_image(void *userdata, void *data, enum menu_image_type type)
|
|
|
|
{
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)userdata;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!xmb || !data)
|
|
|
|
return false;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case MENU_IMAGE_NONE:
|
|
|
|
break;
|
|
|
|
case MENU_IMAGE_WALLPAPER:
|
|
|
|
xmb_context_bg_destroy(xmb);
|
|
|
|
video_driver_texture_unload(&xmb->textures.bg);
|
|
|
|
video_driver_texture_load(data,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR,
|
|
|
|
&xmb->textures.bg);
|
|
|
|
menu_display_allocate_white_texture();
|
|
|
|
break;
|
|
|
|
case MENU_IMAGE_THUMBNAIL:
|
|
|
|
{
|
|
|
|
struct texture_image *img = (struct texture_image*)data;
|
|
|
|
xmb->thumbnail_height = xmb->thumbnail_width
|
|
|
|
* (float)img->height / (float)img->width;
|
|
|
|
video_driver_texture_unload(&xmb->thumbnail);
|
|
|
|
video_driver_texture_load(data,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR, &xmb->thumbnail);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_IMAGE_LEFT_THUMBNAIL:
|
|
|
|
{
|
|
|
|
struct texture_image *img = (struct texture_image*)data;
|
|
|
|
xmb->left_thumbnail_height = xmb->left_thumbnail_width
|
|
|
|
* (float)img->height / (float)img->width;
|
|
|
|
video_driver_texture_unload(&xmb->left_thumbnail);
|
|
|
|
video_driver_texture_load(data,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR, &xmb->left_thumbnail);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
break;
|
|
|
|
case MENU_IMAGE_SAVESTATE_THUMBNAIL:
|
|
|
|
{
|
|
|
|
struct texture_image *img = (struct texture_image*)data;
|
|
|
|
xmb->savestate_thumbnail_height = xmb->savestate_thumbnail_width
|
|
|
|
* (float)img->height / (float)img->width;
|
|
|
|
video_driver_texture_unload(&xmb->savestate_thumbnail);
|
|
|
|
video_driver_texture_load(data,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR, &xmb->savestate_thumbnail);
|
|
|
|
}
|
|
|
|
break;
|
2018-10-09 20:30:20 -03:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
return true;
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static const char *xmb_texture_path(unsigned id)
|
|
|
|
{
|
|
|
|
switch (id)
|
2018-11-25 02:45:13 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_MAIN_MENU:
|
|
|
|
#if defined(HAVE_LAKKA)
|
2018-11-29 14:47:46 -03:00
|
|
|
return "lakka.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
#else
|
2018-11-29 14:47:46 -03:00
|
|
|
return "retroarch.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
#endif
|
|
|
|
case XMB_TEXTURE_SETTINGS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "settings.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_HISTORY:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "history.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_FAVORITES:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "favorites.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ADD_FAVORITE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "add-favorite.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_MUSICS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "musics.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
|
|
|
case XMB_TEXTURE_MOVIES:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "movies.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
case XMB_TEXTURE_IMAGES:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "images.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
#endif
|
|
|
|
case XMB_TEXTURE_SETTING:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "setting.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SUBSETTING:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "subsetting.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ARROW:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "arrow.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_RUN:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "run.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CLOSE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "close.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_RESUME:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "resume.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CLOCK:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "clock.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_BATTERY_FULL:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "battery-full.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_BATTERY_CHARGING:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "battery-charging.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_POINTER:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "pointer.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SAVESTATE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "savestate.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_LOADSTATE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "loadstate.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_UNDO:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "undo.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CORE_INFO:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "core-infos.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_WIFI:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "wifi.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CORE_OPTIONS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "core-options.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_REMAPPING_OPTIONS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "core-input-remapping-options.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CHEAT_OPTIONS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "core-cheat-options.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_DISK_OPTIONS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "core-disk-options.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SHADER_OPTIONS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "core-shader-options.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ACHIEVEMENT_LIST:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "achievement-list.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SCREENSHOT:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "screenshot.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_RELOAD:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "reload.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_RENAME:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "rename.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_FILE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "file.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_FOLDER:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "folder.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ZIP:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "zip.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_MUSIC:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "music.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_FAVORITE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "favorites-content.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_IMAGE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "image.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_MOVIE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "movie.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CORE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "core.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_RDB:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "database.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CURSOR:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "cursor.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SWITCH_ON:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "on.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SWITCH_OFF:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "off.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ADD:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "add.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
case XMB_TEXTURE_NETPLAY:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "netplay.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ROOM:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_room.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ROOM_LAN:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_room_lan.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ROOM_RELAY:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_room_relay.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
#endif
|
|
|
|
case XMB_TEXTURE_KEY:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "key.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_KEY_HOVER:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "key-hover.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_DIALOG_SLICE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "dialog-slice.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_ACHIEVEMENTS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_achievements.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_AUDIO:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_audio.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_DRIVERS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_drivers.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_EXIT:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_exit.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_FRAMESKIP:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_frameskip.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_HELP:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_help.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INFO:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_info.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_SETTINGS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "Libretro - Pad.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_LATENCY:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_latency.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_NETWORK:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_network.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_POWER:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_power.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_RECORD:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_record.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SAVING:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_saving.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_UPDATER:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_updater.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_VIDEO:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_video.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_MIXER:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_mixer.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_LOG:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_log.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_OSD:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_osd.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_UI:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_ui.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_USER:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_user.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_PRIVACY:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_privacy.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_PLAYLIST:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_playlist.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_QUICKMENU:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_quickmenu.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_REWIND:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_rewind.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_OVERLAY:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_overlay.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_OVERRIDE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_override.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_NOTIFICATIONS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_notifications.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_STREAM:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_stream.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_SHUTDOWN:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_shutdown.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_DPAD_U:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_DPAD-U.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_DPAD_D:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_DPAD-D.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_DPAD_L:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_DPAD-L.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_DPAD_R:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_DPAD-R.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_STCK_U:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_STCK-U.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_STCK_D:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_STCK-D.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_STCK_L:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_STCK-L.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_STCK_R:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_STCK-R.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_STCK_P:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_STCK-P.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_BTN_U:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_BTN-U.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_BTN_D:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_BTN-D.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_BTN_L:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_BTN-L.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_BTN_R:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_BTN-R.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_LB:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_LB.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_RB:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_RB.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_LT:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_LT.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_RT:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_RT.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_SELECT:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_SELECT.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_INPUT_START:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "input_START.png";
|
2019-01-03 11:02:15 -03:00
|
|
|
case XMB_TEXTURE_INPUT_ADC:
|
|
|
|
return "input_ADC.png";
|
|
|
|
case XMB_TEXTURE_INPUT_BIND_ALL:
|
|
|
|
return "input_BIND_ALL.png";
|
|
|
|
case XMB_TEXTURE_INPUT_MOUSE:
|
|
|
|
return "input_MOUSE.png";
|
|
|
|
case XMB_TEXTURE_INPUT_LGUN:
|
|
|
|
return "input_LGUN.png";
|
|
|
|
case XMB_TEXTURE_INPUT_TURBO:
|
|
|
|
return "input_TURBO.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_CHECKMARK:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_check.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_MENU_ADD:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_add.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_BRIGHTNESS:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_brightness.png";
|
2018-11-25 20:34:50 +01:00
|
|
|
case XMB_TEXTURE_PAUSE:
|
2018-11-29 14:47:46 -03:00
|
|
|
return "menu_pause.png";
|
|
|
|
case XMB_TEXTURE_DEFAULT:
|
|
|
|
return "default.png";
|
|
|
|
case XMB_TEXTURE_DEFAULT_CONTENT:
|
|
|
|
return "default-content.png";
|
2018-11-30 18:10:28 -03:00
|
|
|
case XMB_TEXTURE_MENU_APPLY_TOGGLE:
|
|
|
|
return "menu_apply_toggle.png";
|
|
|
|
case XMB_TEXTURE_MENU_APPLY_COG:
|
|
|
|
return "menu_apply_cog.png";
|
2018-11-25 02:45:13 +01:00
|
|
|
}
|
2018-11-29 14:47:46 -03:00
|
|
|
return NULL;
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_context_reset_textures(
|
|
|
|
xmb_handle_t *xmb, const char *iconpath)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
unsigned i;
|
|
|
|
settings_t *settings = config_get_ptr();
|
2018-11-29 14:47:46 -03:00
|
|
|
xmb->assets_missing = false;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-12-22 14:51:33 -08:00
|
|
|
menu_display_allocate_white_texture();
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
for (i = 0; i < XMB_TEXTURE_LAST; i++)
|
2018-11-17 10:34:37 -03:00
|
|
|
{
|
2018-11-22 15:45:52 +01:00
|
|
|
if (!menu_display_reset_textures_list(xmb_texture_path(i), iconpath, &xmb->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
2018-11-17 10:34:37 -03:00
|
|
|
{
|
2018-11-29 14:47:46 -03:00
|
|
|
RARCH_WARN("[XMB] Asset missing: %s%s\n", iconpath, xmb_texture_path(i));
|
|
|
|
/* If the icon is missing return the subsetting (because some themes are incomplete) */
|
|
|
|
if (!(i == XMB_TEXTURE_DIALOG_SLICE || i == XMB_TEXTURE_KEY_HOVER || i == XMB_TEXTURE_KEY))
|
|
|
|
{
|
|
|
|
/* OSD Warning only if subsetting icon is missing */
|
|
|
|
if (
|
2018-11-22 15:45:52 +01:00
|
|
|
!menu_display_reset_textures_list(xmb_texture_path(XMB_TEXTURE_SUBSETTING), iconpath, &xmb->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL)
|
2018-11-29 14:47:46 -03:00
|
|
|
&& !(settings->uints.menu_xmb_theme == XMB_ICON_THEME_CUSTOM)
|
|
|
|
)
|
|
|
|
{
|
2018-11-22 15:45:52 +01:00
|
|
|
runloop_msg_queue_push(msg_hash_to_str(MSG_MISSING_ASSETS), 1, 256, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
2018-11-29 14:47:46 -03:00
|
|
|
/* Do not draw icons if subsetting is missing */
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
/* Do not draw icons if this ones are is missing */
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
case XMB_TEXTURE_POINTER:
|
|
|
|
case XMB_TEXTURE_ARROW:
|
|
|
|
case XMB_TEXTURE_CLOCK:
|
|
|
|
case XMB_TEXTURE_BATTERY_CHARGING:
|
|
|
|
case XMB_TEXTURE_BATTERY_FULL:
|
|
|
|
case XMB_TEXTURE_DEFAULT:
|
|
|
|
case XMB_TEXTURE_DEFAULT_CONTENT:
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
2018-11-25 02:48:14 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-17 11:47:28 -03:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU];
|
|
|
|
xmb->main_menu_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->main_menu_node.zoom = xmb->categories_active_zoom;
|
2015-10-23 01:05:51 +07:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->settings_tab_node.icon = xmb->textures.list[XMB_TEXTURE_SETTINGS];
|
|
|
|
xmb->settings_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->settings_tab_node.zoom = xmb->categories_active_zoom;
|
2015-10-25 00:37:59 +07:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->history_tab_node.icon = xmb->textures.list[XMB_TEXTURE_HISTORY];
|
|
|
|
xmb->history_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->history_tab_node.zoom = xmb->categories_active_zoom;
|
2017-08-12 16:37:20 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->favorites_tab_node.icon = xmb->textures.list[XMB_TEXTURE_FAVORITES];
|
|
|
|
xmb->favorites_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->favorites_tab_node.zoom = xmb->categories_active_zoom;
|
2016-07-30 19:29:10 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->music_tab_node.icon = xmb->textures.list[XMB_TEXTURE_MUSICS];
|
|
|
|
xmb->music_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->music_tab_node.zoom = xmb->categories_active_zoom;
|
2016-07-30 19:29:10 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
|
|
|
xmb->video_tab_node.icon = xmb->textures.list[XMB_TEXTURE_MOVIES];
|
|
|
|
xmb->video_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->video_tab_node.zoom = xmb->categories_active_zoom;
|
|
|
|
#endif
|
2018-11-17 10:34:37 -03:00
|
|
|
|
2018-11-25 02:48:14 +01:00
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->images_tab_node.icon = xmb->textures.list[XMB_TEXTURE_IMAGES];
|
|
|
|
xmb->images_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->images_tab_node.zoom = xmb->categories_active_zoom;
|
2018-11-25 02:48:14 +01:00
|
|
|
#endif
|
2018-11-25 20:34:50 +01:00
|
|
|
|
|
|
|
xmb->add_tab_node.icon = xmb->textures.list[XMB_TEXTURE_ADD];
|
|
|
|
xmb->add_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->add_tab_node.zoom = xmb->categories_active_zoom;
|
|
|
|
|
2018-11-25 02:48:14 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb->netplay_tab_node.icon = xmb->textures.list[XMB_TEXTURE_NETPLAY];
|
|
|
|
xmb->netplay_tab_node.alpha = xmb->categories_active_alpha;
|
|
|
|
xmb->netplay_tab_node.zoom = xmb->categories_active_zoom;
|
2018-11-25 02:48:14 +01:00
|
|
|
#endif
|
2016-07-21 05:43:09 +02:00
|
|
|
|
2019-01-25 10:17:17 -03:00
|
|
|
/* Recolor */
|
|
|
|
if (
|
|
|
|
(settings->uints.menu_xmb_theme == XMB_ICON_THEME_MONOCHROME_INVERTED) ||
|
|
|
|
(settings->uints.menu_xmb_theme == XMB_ICON_THEME_AUTOMATIC_INVERTED)
|
|
|
|
)
|
|
|
|
memcpy(item_color, coord_black, sizeof(item_color));
|
|
|
|
else
|
2019-01-25 20:14:51 -03:00
|
|
|
{
|
|
|
|
if (
|
|
|
|
(settings->uints.menu_xmb_theme == XMB_ICON_THEME_MONOCHROME) ||
|
|
|
|
(settings->uints.menu_xmb_theme == XMB_ICON_THEME_AUTOMATIC)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
for (i=0;i<16;i++)
|
|
|
|
{
|
|
|
|
if ((i==3) || (i==7) || (i==11) || (i==15))
|
|
|
|
{
|
|
|
|
item_color[i] = 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
item_color[i] = 0.95;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
memcpy(item_color, coord_white, sizeof(item_color));
|
|
|
|
}
|
|
|
|
|
2018-11-29 14:47:46 -03:00
|
|
|
return;
|
|
|
|
|
|
|
|
error:
|
2018-12-22 14:51:33 -08:00
|
|
|
xmb->assets_missing = true;
|
2018-11-29 14:47:46 -03:00
|
|
|
RARCH_WARN("[XMB] Critical asset missing, no icons will be drawn\n");
|
|
|
|
return;
|
2018-11-25 20:34:50 +01:00
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_context_reset_background(const char *iconpath)
|
|
|
|
{
|
|
|
|
char *path = NULL;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
const char *path_menu_wp = settings->paths.path_menu_wallpaper;
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!string_is_empty(path_menu_wp))
|
|
|
|
path = strdup(path_menu_wp);
|
|
|
|
else if (!string_is_empty(iconpath))
|
|
|
|
{
|
|
|
|
path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
path[0] = '\0';
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
fill_pathname_join(path, iconpath, "bg.png",
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (filestream_exists(path))
|
|
|
|
task_push_image_load(path,
|
|
|
|
menu_display_handle_wallpaper_upload, NULL);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2019-01-03 15:22:14 +01:00
|
|
|
#ifdef ORBIS
|
2019-01-08 20:22:44 +01:00
|
|
|
/* To avoid weird behaviour on orbis with remote host */
|
2019-01-03 15:22:14 +01:00
|
|
|
RARCH_LOG("[XMB] after task\n");
|
|
|
|
sleep(5);
|
|
|
|
#endif
|
2018-11-25 20:34:50 +01:00
|
|
|
if (path)
|
|
|
|
free(path);
|
|
|
|
}
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_context_reset_internal(xmb_handle_t *xmb,
|
|
|
|
bool is_threaded, bool reinit_textures)
|
|
|
|
{
|
|
|
|
char bg_file_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
char *iconpath = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
iconpath[0] = '\0';
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
fill_pathname_application_special(bg_file_path,
|
|
|
|
sizeof(bg_file_path), APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG);
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!string_is_empty(bg_file_path))
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!string_is_empty(xmb->bg_file_path))
|
|
|
|
free(xmb->bg_file_path);
|
|
|
|
xmb->bg_file_path = strdup(bg_file_path);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2015-06-06 14:01:36 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
fill_pathname_application_special(iconpath,
|
|
|
|
PATH_MAX_LENGTH * sizeof(char),
|
|
|
|
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
|
2015-06-06 13:56:31 +02:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_layout(xmb);
|
|
|
|
if (xmb->font)
|
2017-09-12 04:47:37 +02:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
menu_display_font_free(xmb->font);
|
|
|
|
xmb->font = NULL;
|
|
|
|
}
|
|
|
|
if (xmb->font2)
|
|
|
|
{
|
|
|
|
menu_display_font_free(xmb->font2);
|
|
|
|
xmb->font2 = NULL;
|
|
|
|
}
|
|
|
|
xmb->font = menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
|
|
|
|
xmb->font_size,
|
|
|
|
is_threaded);
|
|
|
|
xmb->font2 = menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
|
|
|
|
xmb->font2_size,
|
|
|
|
is_threaded);
|
|
|
|
|
|
|
|
if (reinit_textures)
|
|
|
|
{
|
|
|
|
xmb_context_reset_textures(xmb, iconpath);
|
|
|
|
xmb_context_reset_background(iconpath);
|
|
|
|
}
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_context_reset_horizontal_list(xmb);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!string_is_equal(xmb_thumbnails_ident('R'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'R');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
2018-11-25 20:34:50 +01:00
|
|
|
if (!string_is_equal(xmb_thumbnails_ident('L'),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
|
|
{
|
|
|
|
xmb_update_thumbnail_path(xmb, 0, 'L');
|
|
|
|
xmb_update_thumbnail_image(xmb);
|
|
|
|
}
|
|
|
|
xmb_update_savestate_thumbnail_image(xmb);
|
2018-11-25 02:45:13 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
free(iconpath);
|
2018-11-25 03:01:41 +01:00
|
|
|
}
|
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
static void xmb_context_reset(void *data, bool is_threaded)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2018-11-25 03:01:41 +01:00
|
|
|
|
2018-11-25 20:34:50 +01:00
|
|
|
if (xmb)
|
2018-11-25 03:01:41 +01:00
|
|
|
{
|
2018-11-25 20:34:50 +01:00
|
|
|
xmb_context_reset_internal(xmb, is_threaded, true);
|
2017-09-12 04:47:37 +02:00
|
|
|
}
|
2014-10-09 01:21:22 +02:00
|
|
|
}
|
|
|
|
|
2015-12-10 17:24:56 +01:00
|
|
|
static void xmb_navigation_clear(void *data, bool pending_push)
|
2014-10-09 22:25:13 +02:00
|
|
|
{
|
2015-12-10 17:24:56 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-03-12 18:06:28 +01:00
|
|
|
if (!pending_push)
|
2015-12-10 16:14:53 +01:00
|
|
|
xmb_selection_pointer_changed(xmb, true);
|
2014-10-09 22:25:13 +02:00
|
|
|
}
|
|
|
|
|
2015-12-11 14:26:51 +01:00
|
|
|
static void xmb_navigation_pointer_changed(void *data)
|
2014-10-09 22:25:13 +02:00
|
|
|
{
|
2015-12-11 14:26:51 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-12-10 16:14:53 +01:00
|
|
|
xmb_selection_pointer_changed(xmb, true);
|
2014-10-09 22:25:13 +02:00
|
|
|
}
|
|
|
|
|
2015-12-11 14:26:51 +01:00
|
|
|
static void xmb_navigation_set(void *data, bool scroll)
|
2014-10-09 22:25:13 +02:00
|
|
|
{
|
2015-12-11 14:26:51 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-12-10 16:14:53 +01:00
|
|
|
xmb_selection_pointer_changed(xmb, true);
|
2014-10-09 22:25:13 +02:00
|
|
|
}
|
|
|
|
|
2015-12-11 14:26:51 +01:00
|
|
|
static void xmb_navigation_alphabet(void *data, size_t *unused)
|
2014-10-09 22:25:13 +02:00
|
|
|
{
|
2015-12-11 14:26:51 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-12-10 16:14:53 +01:00
|
|
|
xmb_selection_pointer_changed(xmb, true);
|
2014-10-09 22:25:13 +02:00
|
|
|
}
|
|
|
|
|
2015-12-10 19:08:28 +01:00
|
|
|
static void xmb_list_insert(void *userdata,
|
|
|
|
file_list_t *list,
|
2017-01-07 18:32:40 +01:00
|
|
|
const char *path,
|
|
|
|
const char *fullpath,
|
|
|
|
const char *unused,
|
2017-08-15 04:33:36 +02:00
|
|
|
size_t list_size,
|
|
|
|
unsigned entry_type)
|
2014-10-09 22:25:13 +02:00
|
|
|
{
|
2015-06-13 16:22:05 +02:00
|
|
|
int current = 0;
|
2017-02-26 10:33:03 +01:00
|
|
|
int i = (int)list_size;
|
2015-06-13 16:22:05 +02:00
|
|
|
xmb_node_t *node = NULL;
|
2015-12-10 19:08:28 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)userdata;
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2015-02-11 21:00:34 +01:00
|
|
|
|
2015-12-10 19:08:28 +01:00
|
|
|
if (!xmb || !list)
|
2015-02-11 21:00:34 +01:00
|
|
|
return;
|
2015-06-06 14:07:20 +02:00
|
|
|
|
2017-10-01 17:11:09 +02:00
|
|
|
node = (xmb_node_t*)file_list_get_userdata_at_offset(list, i);
|
2015-06-15 14:59:07 -03:00
|
|
|
|
|
|
|
if (!node)
|
2017-08-12 22:06:46 -03:00
|
|
|
node = xmb_alloc_node();
|
2014-10-10 22:08:11 +02:00
|
|
|
|
2015-06-11 20:14:59 +02:00
|
|
|
if (!node)
|
2014-10-12 00:33:17 +02:00
|
|
|
{
|
2014-10-10 22:08:11 +02:00
|
|
|
RARCH_ERR("XMB node could not be allocated.\n");
|
2014-10-12 00:33:17 +02:00
|
|
|
return;
|
|
|
|
}
|
2014-10-10 22:08:11 +02:00
|
|
|
|
2017-02-26 10:33:03 +01:00
|
|
|
current = (int)selection;
|
2017-01-07 18:32:40 +01:00
|
|
|
|
|
|
|
if (!string_is_empty(fullpath))
|
2017-08-29 22:19:19 -03:00
|
|
|
{
|
|
|
|
if (node->fullpath)
|
|
|
|
free(node->fullpath);
|
|
|
|
|
|
|
|
node->fullpath = strdup(fullpath);
|
|
|
|
}
|
2017-01-07 18:32:40 +01:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
node->alpha = xmb->items_passive_alpha;
|
|
|
|
node->zoom = xmb->items_passive_zoom;
|
2014-10-20 20:00:39 +02:00
|
|
|
node->label_alpha = node->alpha;
|
2015-02-11 05:33:53 +01:00
|
|
|
node->y = xmb_item_y(xmb, i, current);
|
2015-02-02 18:44:56 +01:00
|
|
|
node->x = 0;
|
|
|
|
|
|
|
|
if (i == current)
|
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
node->alpha = xmb->items_active_alpha;
|
|
|
|
node->label_alpha = xmb->items_active_alpha;
|
|
|
|
node->zoom = xmb->items_active_alpha;
|
2015-02-02 18:44:56 +01:00
|
|
|
}
|
2015-06-11 20:14:59 +02:00
|
|
|
|
2015-06-11 23:02:17 +02:00
|
|
|
file_list_set_userdata(list, i, node);
|
2014-10-09 22:25:13 +02:00
|
|
|
}
|
|
|
|
|
2015-06-15 14:59:07 -03:00
|
|
|
static void xmb_list_clear(file_list_t *list)
|
|
|
|
{
|
2017-08-11 01:16:03 +02:00
|
|
|
menu_animation_ctx_tag tag = (uintptr_t)list;
|
2017-08-13 18:44:50 -04:00
|
|
|
|
2018-10-17 06:49:24 +02:00
|
|
|
menu_animation_kill_by_tag(&tag);
|
2015-06-15 14:59:07 -03:00
|
|
|
|
2017-09-03 09:48:31 -03:00
|
|
|
xmb_free_list_nodes(list, false);
|
2015-06-15 14:59:07 -03:00
|
|
|
}
|
|
|
|
|
2017-09-03 15:45:18 +02:00
|
|
|
static void xmb_list_free(file_list_t *list, size_t a, size_t b)
|
|
|
|
{
|
|
|
|
xmb_list_clear(list);
|
|
|
|
}
|
|
|
|
|
2017-09-03 16:04:06 -03:00
|
|
|
static void xmb_list_deep_copy(const file_list_t *src, file_list_t *dst,
|
|
|
|
size_t first, size_t last)
|
2015-06-15 14:36:16 -03:00
|
|
|
{
|
2017-09-03 16:04:06 -03:00
|
|
|
size_t i, j = 0;
|
2017-08-11 01:16:03 +02:00
|
|
|
menu_animation_ctx_tag tag = (uintptr_t)dst;
|
2017-08-08 21:05:00 -03:00
|
|
|
|
2018-10-17 06:49:24 +02:00
|
|
|
menu_animation_kill_by_tag(&tag);
|
2015-06-15 14:36:16 -03:00
|
|
|
|
2017-09-03 09:48:31 -03:00
|
|
|
/* use true here because file_list_copy() doesn't free actiondata */
|
|
|
|
xmb_free_list_nodes(dst, true);
|
2015-06-15 14:36:16 -03:00
|
|
|
|
2017-09-03 16:04:06 -03:00
|
|
|
file_list_clear(dst);
|
|
|
|
file_list_reserve(dst, (last + 1) - first);
|
2015-09-28 18:44:28 +02:00
|
|
|
|
2017-09-03 16:04:06 -03:00
|
|
|
for (i = first; i <= last; ++i)
|
2015-06-15 14:36:16 -03:00
|
|
|
{
|
2017-09-03 16:04:06 -03:00
|
|
|
struct item_file *d = &dst->list[j];
|
|
|
|
struct item_file *s = &src->list[i];
|
|
|
|
|
|
|
|
void *src_udata = s->userdata;
|
|
|
|
void *src_adata = s->actiondata;
|
|
|
|
|
|
|
|
*d = *s;
|
|
|
|
d->alt = string_is_empty(d->alt) ? NULL : strdup(d->alt);
|
|
|
|
d->path = string_is_empty(d->path) ? NULL : strdup(d->path);
|
|
|
|
d->label = string_is_empty(d->label) ? NULL : strdup(d->label);
|
2015-06-15 14:36:16 -03:00
|
|
|
|
|
|
|
if (src_udata)
|
2017-09-03 23:39:25 -04:00
|
|
|
file_list_set_userdata(dst, j, (void*)xmb_copy_node((const xmb_node_t*)src_udata));
|
2015-06-15 14:36:16 -03:00
|
|
|
|
|
|
|
if (src_adata)
|
|
|
|
{
|
2017-08-07 00:14:37 +02:00
|
|
|
void *data = malloc(sizeof(menu_file_list_cbs_t));
|
2015-06-15 14:36:16 -03:00
|
|
|
memcpy(data, src_adata, sizeof(menu_file_list_cbs_t));
|
2017-09-03 16:04:06 -03:00
|
|
|
file_list_set_actiondata(dst, j, data);
|
2015-06-15 14:36:16 -03:00
|
|
|
}
|
2017-09-03 16:04:06 -03:00
|
|
|
|
|
|
|
++j;
|
2015-06-15 14:36:16 -03:00
|
|
|
}
|
2017-09-03 16:04:06 -03:00
|
|
|
|
|
|
|
dst->size = j;
|
2015-06-15 14:36:16 -03:00
|
|
|
}
|
|
|
|
|
2016-02-25 19:27:06 +01:00
|
|
|
static void xmb_list_cache(void *data, enum menu_list_type type, unsigned action)
|
2014-11-27 22:28:45 +07:00
|
|
|
{
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t stack_size, list_size;
|
2015-12-10 16:17:23 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-10-27 10:33:19 +01:00
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2015-10-27 10:10:33 +01:00
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2017-07-14 15:11:27 -04:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-02-13 19:00:34 +01:00
|
|
|
|
2014-11-27 23:03:27 +07:00
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
|
2017-09-03 16:04:06 -03:00
|
|
|
/* Check whether to enable the horizontal animation. */
|
|
|
|
if (settings->bools.menu_horizontal_animation)
|
|
|
|
{
|
|
|
|
unsigned first = 0, last = 0;
|
|
|
|
unsigned height = 0;
|
|
|
|
video_driver_get_size(NULL, &height);
|
|
|
|
|
2017-10-03 21:15:35 -03:00
|
|
|
/* FIXME: this shouldn't be happening at all */
|
|
|
|
if (selection >= selection_buf->size)
|
|
|
|
selection = selection_buf->size ? selection_buf->size - 1 : 0;
|
|
|
|
|
|
|
|
xmb->selection_ptr_old = selection;
|
|
|
|
|
2017-09-03 16:04:06 -03:00
|
|
|
xmb_calculate_visible_range(xmb, height, selection_buf->size,
|
2018-04-09 15:56:45 +02:00
|
|
|
(unsigned)xmb->selection_ptr_old, &first, &last);
|
2017-09-03 16:04:06 -03:00
|
|
|
|
|
|
|
xmb_list_deep_copy(selection_buf, xmb->selection_buf_old, first, last);
|
|
|
|
|
|
|
|
xmb->selection_ptr_old -= first;
|
|
|
|
last -= first;
|
|
|
|
first = 0;
|
|
|
|
}
|
2017-10-03 21:15:35 -03:00
|
|
|
else
|
|
|
|
xmb->selection_ptr_old = 0;
|
2017-09-03 16:04:06 -03:00
|
|
|
|
2016-03-09 16:17:18 -05:00
|
|
|
list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
|
2016-08-18 16:42:39 +02:00
|
|
|
+ xmb->system_tab_end;
|
2015-10-25 02:18:47 +07:00
|
|
|
|
2015-06-07 11:20:36 +02:00
|
|
|
switch (type)
|
2015-02-02 20:40:29 +01:00
|
|
|
{
|
2015-06-07 11:20:36 +02:00
|
|
|
case MENU_LIST_PLAIN:
|
2015-02-02 20:40:29 +01:00
|
|
|
break;
|
2015-06-07 11:20:36 +02:00
|
|
|
case MENU_LIST_HORIZONTAL:
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_selection_ptr_old = xmb->categories_selection_ptr;
|
2014-11-27 22:28:45 +07:00
|
|
|
|
2015-06-07 11:20:36 +02:00
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case MENU_ACTION_LEFT:
|
2017-09-28 08:42:12 +02:00
|
|
|
if (xmb->categories_selection_ptr == 0)
|
2015-10-25 02:18:47 +07:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_selection_ptr = list_size;
|
|
|
|
xmb->categories_active_idx = (unsigned)(list_size - 1);
|
2015-10-25 02:18:47 +07:00
|
|
|
}
|
|
|
|
else
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_selection_ptr--;
|
2015-06-07 11:20:36 +02:00
|
|
|
break;
|
|
|
|
default:
|
2017-09-28 08:42:12 +02:00
|
|
|
if (xmb->categories_selection_ptr == list_size)
|
2015-10-25 02:18:47 +07:00
|
|
|
{
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_selection_ptr = 0;
|
|
|
|
xmb->categories_active_idx = 1;
|
2015-10-25 02:18:47 +07:00
|
|
|
}
|
|
|
|
else
|
2017-09-28 08:42:12 +02:00
|
|
|
xmb->categories_selection_ptr++;
|
2015-06-07 11:20:36 +02:00
|
|
|
break;
|
|
|
|
}
|
2015-01-10 23:45:14 +01:00
|
|
|
|
2015-10-17 18:17:59 +02:00
|
|
|
stack_size = menu_stack->size;
|
2015-02-02 18:44:56 +01:00
|
|
|
|
2015-10-17 18:17:59 +02:00
|
|
|
if (menu_stack->list[stack_size - 1].label)
|
|
|
|
free(menu_stack->list[stack_size - 1].label);
|
|
|
|
menu_stack->list[stack_size - 1].label = NULL;
|
2015-06-07 11:20:36 +02:00
|
|
|
|
2017-09-28 08:42:12 +02:00
|
|
|
switch (xmb_get_system_tab(xmb, (unsigned)xmb->categories_selection_ptr))
|
2015-06-07 11:20:36 +02:00
|
|
|
{
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_MAIN:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_SETTINGS;
|
|
|
|
break;
|
|
|
|
case XMB_SYSTEM_TAB_SETTINGS:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_SETTINGS_TAB;
|
|
|
|
break;
|
2016-07-30 19:29:10 +02:00
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_IMAGES:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_IMAGES_TAB;
|
|
|
|
break;
|
2016-07-30 19:29:10 +02:00
|
|
|
#endif
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_MUSIC:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_MUSIC_TAB;
|
|
|
|
break;
|
2018-06-20 04:50:58 +02:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2016-12-12 03:54:53 -06:00
|
|
|
case XMB_SYSTEM_TAB_VIDEO:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_VIDEO_TAB;
|
|
|
|
break;
|
2016-07-30 19:29:10 +02:00
|
|
|
#endif
|
2016-08-17 15:07:17 +02:00
|
|
|
case XMB_SYSTEM_TAB_HISTORY:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_HISTORY_TAB;
|
|
|
|
break;
|
2017-08-12 16:37:20 +02:00
|
|
|
case XMB_SYSTEM_TAB_FAVORITES:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_FAVORITES_TAB;
|
|
|
|
break;
|
2017-01-22 17:57:49 -05:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-01-18 22:46:48 -05:00
|
|
|
case XMB_SYSTEM_TAB_NETPLAY:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_NETPLAY_TAB;
|
|
|
|
break;
|
2017-01-22 17:57:49 -05:00
|
|
|
#endif
|
2017-02-27 22:36:45 +01:00
|
|
|
case XMB_SYSTEM_TAB_ADD:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_ADD_TAB;
|
|
|
|
break;
|
2016-08-17 15:07:17 +02:00
|
|
|
default:
|
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
MENU_SETTING_HORIZONTAL_MENU;
|
|
|
|
break;
|
2015-06-07 11:20:36 +02:00
|
|
|
}
|
|
|
|
break;
|
2015-10-30 16:28:27 +07:00
|
|
|
default:
|
|
|
|
break;
|
2015-03-12 14:53:14 +01:00
|
|
|
}
|
2014-11-27 22:28:45 +07:00
|
|
|
}
|
|
|
|
|
2015-12-10 16:57:48 +01:00
|
|
|
static void xmb_context_destroy(void *data)
|
2015-01-26 23:45:16 +01:00
|
|
|
{
|
2015-03-16 17:40:05 +01:00
|
|
|
unsigned i;
|
2015-12-10 16:57:48 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
2015-01-26 23:45:16 +01:00
|
|
|
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
|
2015-06-07 13:09:35 +02:00
|
|
|
for (i = 0; i < XMB_TEXTURE_LAST; i++)
|
2016-03-02 22:17:05 +01:00
|
|
|
video_driver_texture_unload(&xmb->textures.list[i]);
|
2015-01-30 04:45:15 +01:00
|
|
|
|
2017-05-03 14:14:35 +01:00
|
|
|
video_driver_texture_unload(&xmb->thumbnail);
|
2018-03-25 12:27:17 -03:00
|
|
|
video_driver_texture_unload(&xmb->left_thumbnail);
|
2017-05-03 14:14:35 +01:00
|
|
|
video_driver_texture_unload(&xmb->savestate_thumbnail);
|
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
xmb_context_destroy_horizontal_list(xmb);
|
2015-12-23 13:47:40 +01:00
|
|
|
xmb_context_bg_destroy(xmb);
|
2015-02-02 18:44:56 +01:00
|
|
|
|
2016-10-18 20:36:54 -03:00
|
|
|
menu_display_font_free(xmb->font);
|
2016-10-20 09:52:17 +02:00
|
|
|
menu_display_font_free(xmb->font2);
|
2016-10-29 14:36:16 -03:00
|
|
|
|
|
|
|
xmb->font = NULL;
|
|
|
|
xmb->font2 = NULL;
|
2015-06-07 13:09:35 +02:00
|
|
|
}
|
2015-01-26 23:45:16 +01:00
|
|
|
|
2015-12-10 16:54:46 +01:00
|
|
|
static void xmb_toggle(void *userdata, bool menu_on)
|
2015-06-07 13:09:35 +02:00
|
|
|
{
|
2016-02-25 15:44:30 +01:00
|
|
|
menu_animation_ctx_entry_t entry;
|
2015-12-07 16:55:13 +01:00
|
|
|
bool tmp = false;
|
2015-12-10 16:54:46 +01:00
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*)userdata;
|
2015-06-07 13:09:35 +02:00
|
|
|
|
|
|
|
if (!xmb)
|
|
|
|
return;
|
|
|
|
|
2017-02-26 10:33:03 +01:00
|
|
|
xmb->depth = (int)xmb_list_get_size(xmb, MENU_LIST_PLAIN);
|
2015-06-07 13:09:35 +02:00
|
|
|
|
|
|
|
if (!menu_on)
|
|
|
|
{
|
|
|
|
xmb->alpha = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-04-22 18:11:39 +07:00
|
|
|
entry.duration = XMB_DELAY * 2;
|
2016-02-25 15:44:30 +01:00
|
|
|
entry.target_value = 1.0f;
|
|
|
|
entry.subject = &xmb->alpha;
|
2016-04-22 18:10:20 +07:00
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
2017-09-06 00:21:20 +02:00
|
|
|
/* TODO/FIXME - integer conversion resulted in change of sign */
|
2016-02-25 15:44:30 +01:00
|
|
|
entry.tag = -1;
|
|
|
|
entry.cb = NULL;
|
|
|
|
|
2017-08-11 01:20:57 +02:00
|
|
|
menu_animation_push(&entry);
|
2015-06-07 13:09:35 +02:00
|
|
|
|
2015-12-11 21:41:59 +01:00
|
|
|
tmp = !menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL);
|
2015-12-07 16:55:13 +01:00
|
|
|
|
|
|
|
if (tmp)
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
|
|
|
else
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
2015-06-07 13:09:35 +02:00
|
|
|
|
2015-12-10 15:28:05 +01:00
|
|
|
xmb_toggle_horizontal_list(xmb);
|
2015-06-07 13:09:35 +02:00
|
|
|
}
|
|
|
|
|
2018-11-13 12:54:06 +01:00
|
|
|
static int xmb_deferred_push_content_actions(menu_displaylist_info_t *info)
|
2015-06-08 16:13:02 +02:00
|
|
|
{
|
2016-03-09 16:17:18 -05:00
|
|
|
if (!menu_displaylist_ctl(
|
2018-04-23 12:03:50 +02:00
|
|
|
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info))
|
2016-02-24 23:05:54 +01:00
|
|
|
return -1;
|
2017-05-27 19:13:22 +02:00
|
|
|
menu_displaylist_process(info);
|
2017-09-10 22:57:26 +02:00
|
|
|
menu_displaylist_info_free(info);
|
2015-10-22 01:38:41 +02:00
|
|
|
return 0;
|
2015-06-08 16:13:02 +02:00
|
|
|
}
|
|
|
|
|
2016-07-01 20:59:51 +02:00
|
|
|
static int xmb_list_bind_init_compare_label(menu_file_list_cbs_t *cbs)
|
2015-06-08 16:13:02 +02:00
|
|
|
{
|
2016-06-20 00:31:13 +02:00
|
|
|
if (cbs && cbs->enum_idx != MSG_UNKNOWN)
|
2015-06-08 16:13:02 +02:00
|
|
|
{
|
2016-06-18 04:09:07 +02:00
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
|
|
|
case MENU_ENUM_LABEL_CONTENT_ACTIONS:
|
2018-11-13 12:54:06 +01:00
|
|
|
cbs->action_deferred_push = xmb_deferred_push_content_actions;
|
2016-06-18 04:09:07 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
2015-06-08 16:13:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-08 16:01:57 +02:00
|
|
|
static int xmb_list_bind_init(menu_file_list_cbs_t *cbs,
|
2016-07-01 20:59:51 +02:00
|
|
|
const char *path, const char *label, unsigned type, size_t idx)
|
2015-06-08 16:01:57 +02:00
|
|
|
{
|
2016-07-01 20:59:51 +02:00
|
|
|
if (xmb_list_bind_init_compare_label(cbs) == 0)
|
2015-06-08 16:13:02 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return -1;
|
2015-06-08 16:01:57 +02:00
|
|
|
}
|
|
|
|
|
2016-02-04 21:40:29 +01:00
|
|
|
static int xmb_list_push(void *data, void *userdata,
|
|
|
|
menu_displaylist_info_t *info, unsigned type)
|
2015-10-22 04:12:32 +02:00
|
|
|
{
|
2016-03-04 07:41:45 +01:00
|
|
|
menu_displaylist_ctx_parse_entry_t entry;
|
2018-03-01 22:28:26 +01:00
|
|
|
int ret = -1;
|
2017-08-16 01:10:27 +02:00
|
|
|
core_info_list_t *list = NULL;
|
|
|
|
menu_handle_t *menu = (menu_handle_t*)data;
|
2018-12-10 23:01:21 -05:00
|
|
|
const struct retro_subsystem_info* subsystem;
|
2015-10-22 04:46:05 +02:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
2017-08-16 01:10:27 +02:00
|
|
|
case DISPLAYLIST_LOAD_CONTENT_LIST:
|
|
|
|
{
|
2017-10-22 05:12:42 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2017-08-16 01:10:27 +02:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
|
|
|
|
|
|
|
menu_entries_append_enum(info->list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FAVORITES),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
|
|
|
MENU_ENUM_LABEL_FAVORITES,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
|
|
|
|
core_info_get_list(&list);
|
|
|
|
if (core_info_list_num_info_files(list))
|
|
|
|
{
|
|
|
|
menu_entries_append_enum(info->list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DOWNLOADED_FILE_DETECT_CORE_LIST),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST),
|
|
|
|
MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBRETRODB
|
|
|
|
menu_entries_append_enum(info->list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_COLLECTION_LIST),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST),
|
|
|
|
MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (frontend_driver_parse_drive_list(info->list, true) != 0)
|
2017-10-03 21:16:11 -03:00
|
|
|
menu_entries_append_enum(info->list, "/",
|
2017-08-16 01:10:27 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
|
|
|
MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
|
2017-10-11 11:30:53 +02:00
|
|
|
if (!settings->bools.kiosk_mode_enable)
|
|
|
|
{
|
|
|
|
menu_entries_append_enum(info->list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_MENU_FILE_BROWSER_SETTINGS),
|
|
|
|
MENU_ENUM_LABEL_MENU_FILE_BROWSER_SETTINGS,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
}
|
2017-08-16 01:10:27 +02:00
|
|
|
|
|
|
|
info->need_push = true;
|
|
|
|
info->need_refresh = true;
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-22 04:46:05 +02:00
|
|
|
case DISPLAYLIST_MAIN_MENU:
|
2017-05-28 17:21:57 +02:00
|
|
|
{
|
2017-10-02 22:06:32 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
2017-05-28 17:21:57 +02:00
|
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
2015-10-22 06:01:46 +02:00
|
|
|
|
2017-05-28 17:21:57 +02:00
|
|
|
entry.data = menu;
|
|
|
|
entry.info = info;
|
|
|
|
entry.parse_type = PARSE_ACTION;
|
|
|
|
entry.add_empty_entry = false;
|
2016-03-04 07:41:45 +01:00
|
|
|
|
2017-05-30 01:44:49 +02:00
|
|
|
if (!string_is_empty(system->info.library_name) &&
|
|
|
|
!string_is_equal(system->info.library_name,
|
2017-05-28 17:21:57 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-05-28 17:21:57 +02:00
|
|
|
}
|
2015-10-22 06:01:46 +02:00
|
|
|
|
2017-05-28 17:21:57 +02:00
|
|
|
if (system->load_no_content)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-05-28 17:21:57 +02:00
|
|
|
}
|
2016-07-30 19:44:42 +02:00
|
|
|
|
2016-02-03 12:31:29 +01:00
|
|
|
#ifndef HAVE_DYNAMIC
|
2017-05-28 17:21:57 +02:00
|
|
|
if (frontend_driver_has_fork())
|
2015-10-22 04:46:05 +02:00
|
|
|
#endif
|
2017-05-28 17:21:57 +02:00
|
|
|
{
|
2017-10-05 09:14:05 +02:00
|
|
|
if (settings->bools.menu_show_load_core)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-10-05 09:14:05 +02:00
|
|
|
}
|
2017-05-28 17:21:57 +02:00
|
|
|
}
|
2016-03-04 07:41:45 +01:00
|
|
|
|
2017-10-05 09:26:25 +02:00
|
|
|
if (settings->bools.menu_show_load_content)
|
|
|
|
{
|
2018-10-29 21:23:53 -05:00
|
|
|
|
2017-10-05 09:26:25 +02:00
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2018-12-10 23:01:21 -05:00
|
|
|
/* Core fully loaded, use the subsystem data */
|
|
|
|
if (system->subsystem.data)
|
|
|
|
subsystem = system->subsystem.data;
|
|
|
|
/* Core not loaded completely, use the data we peeked on load core */
|
|
|
|
else
|
|
|
|
subsystem = subsystem_data;
|
|
|
|
|
|
|
|
menu_subsystem_populate(subsystem, info);
|
2017-10-05 09:26:25 +02:00
|
|
|
}
|
2016-08-18 14:06:54 +02:00
|
|
|
|
2017-05-28 17:21:57 +02:00
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_ADD_CONTENT_LIST;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2018-08-17 19:38:18 -03:00
|
|
|
#ifdef HAVE_QT
|
|
|
|
if (settings->bools.desktop_menu_enable)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_SHOW_WIMP;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2018-08-17 19:38:18 -03:00
|
|
|
}
|
|
|
|
#endif
|
2016-08-02 15:26:19 +02:00
|
|
|
#if defined(HAVE_NETWORKING)
|
2018-08-27 10:45:07 -03:00
|
|
|
if (settings->bools.menu_show_online_updater && !settings->bools.kiosk_mode_enable)
|
2017-06-20 01:42:28 +02:00
|
|
|
{
|
2018-08-27 10:45:07 -03:00
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-06-20 01:42:28 +02:00
|
|
|
}
|
2015-10-22 04:46:05 +02:00
|
|
|
#endif
|
2018-01-01 10:38:16 -08:00
|
|
|
if (!settings->bools.menu_content_show_settings && !string_is_empty(settings->paths.menu_content_show_settings_password))
|
2017-09-26 14:41:07 +02:00
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_XMB_MAIN_MENU_ENABLE_SETTINGS;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-09-26 14:41:07 +02:00
|
|
|
}
|
|
|
|
|
2017-10-11 11:30:53 +02:00
|
|
|
if (settings->bools.kiosk_mode_enable && !string_is_empty(settings->paths.kiosk_mode_password))
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_MENU_DISABLE_KIOSK_MODE;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-10-11 11:30:53 +02:00
|
|
|
}
|
|
|
|
|
2017-10-05 14:30:15 +02:00
|
|
|
if (settings->bools.menu_show_information)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-10-05 14:30:15 +02:00
|
|
|
}
|
|
|
|
|
2018-11-29 18:42:44 +01:00
|
|
|
#if defined(HAVE_LAKKA_SWITCH) || defined(HAVE_LIBNX)
|
2018-10-06 14:52:44 +02:00
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_SWITCH_CPU_PROFILE;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2018-11-29 18:42:44 +01:00
|
|
|
#endif
|
2018-10-06 14:52:44 +02:00
|
|
|
|
2018-11-29 18:42:44 +01:00
|
|
|
#ifdef HAVE_LAKKA_SWITCH
|
2018-10-06 14:52:44 +02:00
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_SWITCH_GPU_PROFILE;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2018-10-06 14:52:44 +02:00
|
|
|
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_SWITCH_BACKLIGHT_CONTROL;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2018-10-06 14:52:44 +02:00
|
|
|
#endif
|
|
|
|
|
2015-10-22 04:46:05 +02:00
|
|
|
#ifndef HAVE_DYNAMIC
|
2017-05-28 17:21:57 +02:00
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_RESTART_RETROARCH;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2015-10-22 04:46:05 +02:00
|
|
|
#endif
|
2017-10-06 08:18:39 +02:00
|
|
|
|
2017-10-11 11:30:53 +02:00
|
|
|
if (settings->bools.menu_show_configurations && !settings->bools.kiosk_mode_enable)
|
2017-10-06 08:18:39 +02:00
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_CONFIGURATIONS_LIST;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-10-06 08:18:39 +02:00
|
|
|
}
|
2016-08-27 15:01:35 -07:00
|
|
|
|
2017-10-06 08:28:45 +02:00
|
|
|
if (settings->bools.menu_show_help)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-10-06 08:28:45 +02:00
|
|
|
}
|
2018-10-06 14:52:44 +02:00
|
|
|
|
2015-10-22 04:46:05 +02:00
|
|
|
#if !defined(IOS)
|
2017-10-06 09:27:42 +02:00
|
|
|
if (settings->bools.menu_show_quit_retroarch)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-10-06 09:27:42 +02:00
|
|
|
}
|
2015-10-22 04:46:05 +02:00
|
|
|
#endif
|
2017-10-06 09:40:41 +02:00
|
|
|
|
|
|
|
if (settings->bools.menu_show_reboot)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_REBOOT;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2017-10-06 09:40:41 +02:00
|
|
|
}
|
2016-03-04 07:41:45 +01:00
|
|
|
|
2018-06-23 12:01:13 +07:00
|
|
|
if (settings->bools.menu_show_shutdown)
|
|
|
|
{
|
|
|
|
entry.enum_idx = MENU_ENUM_LABEL_SHUTDOWN;
|
2018-10-17 05:33:22 +02:00
|
|
|
menu_displaylist_setting(&entry);
|
2018-06-23 12:01:13 +07:00
|
|
|
}
|
|
|
|
|
2017-05-28 17:21:57 +02:00
|
|
|
info->need_push = true;
|
|
|
|
ret = 0;
|
|
|
|
}
|
2015-10-22 04:46:05 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
2015-10-22 04:12:32 +02:00
|
|
|
}
|
|
|
|
|
2015-10-22 02:54:25 +02:00
|
|
|
static bool xmb_menu_init_list(void *data)
|
|
|
|
{
|
2017-04-27 01:27:02 +02:00
|
|
|
menu_displaylist_info_t info;
|
|
|
|
|
2016-12-14 16:47:10 +01:00
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2015-10-22 02:54:25 +02:00
|
|
|
|
2017-09-10 22:57:26 +02:00
|
|
|
menu_displaylist_info_init(&info);
|
|
|
|
|
2017-09-28 02:45:03 +02:00
|
|
|
info.label = strdup(
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU));
|
2017-10-03 21:16:11 -03:00
|
|
|
info.exts =
|
2017-09-28 01:37:39 +02:00
|
|
|
strdup(file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT));
|
2017-04-27 01:27:02 +02:00
|
|
|
info.type_default = FILE_TYPE_PLAIN;
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_MAIN_MENU;
|
2015-10-22 02:54:25 +02:00
|
|
|
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(menu_stack, info.path,
|
2016-06-15 14:41:26 +02:00
|
|
|
info.label,
|
2016-06-16 13:13:43 +02:00
|
|
|
MENU_ENUM_LABEL_MAIN_MENU,
|
2016-06-15 14:41:26 +02:00
|
|
|
info.type, info.flags, 0);
|
2015-10-22 02:54:25 +02:00
|
|
|
|
2015-10-22 03:02:03 +02:00
|
|
|
info.list = selection_buf;
|
2016-03-09 16:17:18 -05:00
|
|
|
|
2016-02-24 23:19:53 +01:00
|
|
|
if (!menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info))
|
2017-09-10 22:57:26 +02:00
|
|
|
goto error;
|
2015-10-22 03:02:03 +02:00
|
|
|
|
2015-10-22 02:54:25 +02:00
|
|
|
info.need_push = true;
|
|
|
|
|
2017-05-26 20:12:52 +02:00
|
|
|
if (!menu_displaylist_process(&info))
|
2017-09-10 22:57:26 +02:00
|
|
|
goto error;
|
2015-10-22 02:54:25 +02:00
|
|
|
|
2017-09-10 22:57:26 +02:00
|
|
|
menu_displaylist_info_free(&info);
|
2015-10-22 02:54:25 +02:00
|
|
|
return true;
|
2017-09-10 22:57:26 +02:00
|
|
|
|
|
|
|
error:
|
|
|
|
menu_displaylist_info_free(&info);
|
|
|
|
return false;
|
2015-10-22 02:54:25 +02:00
|
|
|
}
|
|
|
|
|
2015-12-10 16:26:40 +01:00
|
|
|
static int xmb_pointer_tap(void *userdata,
|
|
|
|
unsigned x, unsigned y, unsigned ptr,
|
2015-11-01 20:44:04 +01:00
|
|
|
menu_file_list_cbs_t *cbs,
|
2015-11-01 20:35:43 +01:00
|
|
|
menu_entry_t *entry, unsigned action)
|
2015-11-02 01:17:06 +07:00
|
|
|
{
|
2016-06-22 06:48:35 +02:00
|
|
|
unsigned header_height = menu_display_get_header_height();
|
2015-11-02 01:17:06 +07:00
|
|
|
|
2015-11-01 20:44:04 +01:00
|
|
|
if (y < header_height)
|
2015-11-02 01:17:06 +07:00
|
|
|
{
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2017-02-26 21:46:19 +01:00
|
|
|
return (unsigned)menu_entry_action(entry, (unsigned)selection, MENU_ACTION_CANCEL);
|
2015-11-02 01:17:06 +07:00
|
|
|
}
|
2015-11-01 20:44:04 +01:00
|
|
|
else if (ptr <= (menu_entries_get_size() - 1))
|
2015-11-02 01:17:06 +07:00
|
|
|
{
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2015-11-01 20:44:04 +01:00
|
|
|
if (ptr == selection && cbs && cbs->action_select)
|
2017-02-26 21:46:19 +01:00
|
|
|
return (unsigned)menu_entry_action(entry, (unsigned)selection, MENU_ACTION_SELECT);
|
2015-11-02 01:17:06 +07:00
|
|
|
|
2017-04-23 14:31:49 +02:00
|
|
|
menu_navigation_set_selection(ptr);
|
2017-05-15 07:56:22 +02:00
|
|
|
menu_driver_navigation_set(false);
|
2015-11-02 01:17:06 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-02-08 08:24:33 +01:00
|
|
|
#ifdef HAVE_MENU_WIDGETS
|
|
|
|
static bool xmb_get_load_content_animation_data(void *userdata, menu_texture_item *icon, char **playlist_name)
|
|
|
|
{
|
|
|
|
xmb_handle_t *xmb = (xmb_handle_t*) userdata;
|
|
|
|
|
|
|
|
if (xmb->categories_selection_ptr > xmb->system_tab_end)
|
|
|
|
{
|
|
|
|
xmb_node_t *node = file_list_get_userdata_at_offset(xmb->horizontal_list, xmb->categories_selection_ptr - xmb->system_tab_end-1);
|
|
|
|
|
|
|
|
*icon = node->icon;
|
|
|
|
*playlist_name = xmb->title_name;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*icon = xmb->textures.list[XMB_TEXTURE_QUICKMENU];
|
|
|
|
*playlist_name = "RetroArch";
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-10-09 01:21:22 +02:00
|
|
|
menu_ctx_driver_t menu_ctx_xmb = {
|
|
|
|
NULL,
|
2015-12-10 14:36:31 +01:00
|
|
|
xmb_messagebox,
|
2015-10-03 05:08:29 +02:00
|
|
|
generic_menu_iterate,
|
2015-03-08 19:15:24 +01:00
|
|
|
xmb_render,
|
2014-10-09 01:21:22 +02:00
|
|
|
xmb_frame,
|
|
|
|
xmb_init,
|
|
|
|
xmb_free,
|
|
|
|
xmb_context_reset,
|
2014-10-09 22:59:05 +02:00
|
|
|
xmb_context_destroy,
|
2014-10-09 19:06:07 +02:00
|
|
|
xmb_populate_entries,
|
2015-01-26 23:45:16 +01:00
|
|
|
xmb_toggle,
|
2014-10-09 22:25:13 +02:00
|
|
|
xmb_navigation_clear,
|
2015-06-07 00:23:40 +02:00
|
|
|
xmb_navigation_pointer_changed,
|
|
|
|
xmb_navigation_pointer_changed,
|
2014-10-09 22:25:13 +02:00
|
|
|
xmb_navigation_set,
|
2015-06-07 00:23:40 +02:00
|
|
|
xmb_navigation_pointer_changed,
|
2015-06-07 00:41:53 +02:00
|
|
|
xmb_navigation_alphabet,
|
|
|
|
xmb_navigation_alphabet,
|
2015-10-22 02:54:25 +02:00
|
|
|
xmb_menu_init_list,
|
2014-10-09 22:25:13 +02:00
|
|
|
xmb_list_insert,
|
2015-12-10 15:48:04 +01:00
|
|
|
NULL,
|
2017-09-03 15:45:18 +02:00
|
|
|
xmb_list_free,
|
2015-06-15 14:59:07 -03:00
|
|
|
xmb_list_clear,
|
2014-11-27 22:28:45 +07:00
|
|
|
xmb_list_cache,
|
2015-10-22 04:12:32 +02:00
|
|
|
xmb_list_push,
|
2015-06-15 19:00:52 +02:00
|
|
|
xmb_list_get_selection,
|
2015-06-07 15:43:03 +02:00
|
|
|
xmb_list_get_size,
|
2015-06-08 17:02:14 +02:00
|
|
|
xmb_list_get_entry,
|
2015-02-11 21:00:34 +01:00
|
|
|
NULL,
|
2015-06-08 16:01:57 +02:00
|
|
|
xmb_list_bind_init,
|
2015-06-04 10:39:48 +02:00
|
|
|
xmb_load_image,
|
2014-10-09 01:21:22 +02:00
|
|
|
"xmb",
|
2015-07-08 00:37:44 +02:00
|
|
|
xmb_environ,
|
2015-11-02 01:17:06 +07:00
|
|
|
xmb_pointer_tap,
|
2016-04-28 03:26:09 +07:00
|
|
|
xmb_update_thumbnail_path,
|
|
|
|
xmb_update_thumbnail_image,
|
2017-05-15 13:05:33 +02:00
|
|
|
xmb_set_thumbnail_system,
|
|
|
|
xmb_set_thumbnail_content,
|
2018-04-23 11:58:18 +02:00
|
|
|
menu_display_osk_ptr_at_pos,
|
2016-12-01 02:43:53 +01:00
|
|
|
xmb_update_savestate_thumbnail_path,
|
2018-11-22 15:45:52 +01:00
|
|
|
xmb_update_savestate_thumbnail_image,
|
2019-02-08 08:24:33 +01:00
|
|
|
NULL, /* pointer_down */
|
|
|
|
NULL, /* pointer_up */
|
|
|
|
#ifdef HAVE_MENU_WIDGETS
|
|
|
|
xmb_get_load_content_animation_data
|
|
|
|
#else
|
2019-02-08 07:26:43 +01:00
|
|
|
NULL
|
2019-02-08 08:24:33 +01:00
|
|
|
#endif
|
2014-10-09 01:21:22 +02:00
|
|
|
};
|