From 0fa8c04984454862baf0ec9bb26ce49ce28f4cce Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 23 Mar 2013 19:34:38 +0100 Subject: [PATCH] Remove menu_settings.c --- frontend/frontend_console.c | 3 +- frontend/menu/menu_settings.c | 70 ----------------------------------- frontend/menu/menu_settings.h | 36 ------------------ frontend/menu/rgui.c | 16 +++++--- frontend/menu/rmenu.c | 36 ++++++++++-------- frontend/menu/rmenu_xui.cpp | 36 +++++++++++------- griffin/griffin.c | 2 - 7 files changed, 56 insertions(+), 143 deletions(-) delete mode 100644 frontend/menu/menu_settings.c delete mode 100644 frontend/menu/menu_settings.h diff --git a/frontend/frontend_console.c b/frontend/frontend_console.c index 100b6f9738..44e16cfd93 100644 --- a/frontend/frontend_console.c +++ b/frontend/frontend_console.c @@ -22,7 +22,6 @@ #include "../config.def.h" #include "frontend_console.h" #include "menu/rmenu.h" -#include "menu/menu_settings.h" #if defined(__CELLOS_LV2__) #include "platform/platform_ps3_exec.c" @@ -214,7 +213,7 @@ begin_loop: { RARCH_ERR("rarch_main_init failed.\n"); g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU); - menu_settings_msg(S_MSG_ROM_LOADING_ERROR, 180); + msg_queue_push(g_extern.msg_queue, "ERROR - An error occurred during ROM loading.", 1, 180); } g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INIT); } diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c deleted file mode 100644 index 640720a72d..0000000000 --- a/frontend/menu/menu_settings.c +++ /dev/null @@ -1,70 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2013 - Hans-Kristian Arntzen - * Copyright (C) 2011-2013 - Daniel De Matteis - * - * 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 . - */ - -#include -#include -#include - -#include "../../general.h" -#include "../../gfx/gfx_common.h" -#include "../../file.h" -#include "menu_settings.h" - -void menu_settings_msg(unsigned setting, unsigned delay) -{ - char str[PATH_MAX]; - msg_queue_clear(g_extern.msg_queue); - - switch(setting) - { - case S_MSG_CHANGE_CONTROLS: - snprintf(str, sizeof(str), "INFO - Press LEFT/RIGHT to change the controls, and press\n[RetroPad Start] to reset a button to default values."); - break; - case S_MSG_LOADING_ROM: - { - char tmp[PATH_MAX]; - fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp)); - snprintf(str, sizeof(str), "INFO - Loading %s...", g_extern.fullpath); - } - break; - case S_MSG_DIR_LOADING_ERROR: - strlcpy(str, "ERROR - Failed to open directory.", sizeof(str)); - break; - case S_MSG_ROM_LOADING_ERROR: - strlcpy(str, "ERROR - An error occurred during ROM loading.", sizeof(str)); - break; - case S_MSG_NOT_IMPLEMENTED: - strlcpy(str, "TODO - Not yet implemented.", sizeof(str)); - break; - case S_MSG_RESIZE_SCREEN: - snprintf(str, sizeof(str), "INFO - Resize the screen by moving around the two analog sticks.\n"); - break; - case S_MSG_RESTART_RARCH: - strlcpy(str, "INFO - You need to restart RetroArch.", sizeof(str)); - break; - case S_MSG_SELECT_LIBRETRO_CORE: - strlcpy(str, "INFO - Select a Libretro core from the menu.", sizeof(str)); - break; - case S_MSG_SELECT_SHADER: - strlcpy(str, "INFO - Select a shader from the menu.", sizeof(str)); - break; - case S_MSG_SHADER_LOADING_SUCCEEDED: - strlcpy(str, "INFO - Shader successfully loaded.", sizeof(str)); - break; - } - - msg_queue_push(g_extern.msg_queue, str, 1, delay); -} diff --git a/frontend/menu/menu_settings.h b/frontend/menu/menu_settings.h deleted file mode 100644 index 89e4d8d96d..0000000000 --- a/frontend/menu/menu_settings.h +++ /dev/null @@ -1,36 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2013 - Hans-Kristian Arntzen - * Copyright (C) 2011-2013 - Daniel De Matteis - * - * 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 . - */ - -#ifndef CONSOLE_SETTINGS_H -#define CONSOLE_SETTINGS_H - -enum -{ - S_MSG_CHANGE_CONTROLS = 0, - S_MSG_LOADING_ROM, - S_MSG_DIR_LOADING_ERROR, - S_MSG_ROM_LOADING_ERROR, - S_MSG_NOT_IMPLEMENTED, - S_MSG_RESIZE_SCREEN, - S_MSG_RESTART_RARCH, - S_MSG_SELECT_LIBRETRO_CORE, - S_MSG_SELECT_SHADER, - S_MSG_SHADER_LOADING_SUCCEEDED -}; - -void menu_settings_msg(unsigned setting, unsigned delay); - -#endif diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 246c00e2aa..16f7eb01c6 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -23,7 +23,6 @@ #include "rgui.h" #include "utils/file_list.h" -#include "menu_settings.h" #include "../../general.h" #include "../../gfx/gfx_common.h" #include "../../config.def.h" @@ -1507,9 +1506,19 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action) else { fill_pathname_join(g_extern.fullpath, dir, path, sizeof(g_extern.fullpath)); + g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME); - menu_settings_msg(S_MSG_LOADING_ROM, 1); + if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) + { + char tmp[PATH_MAX]; + char str[PATH_MAX]; + + fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp)); + snprintf(str, sizeof(str), "INFO - Loading %s...", tmp); + msg_queue_push(g_extern.msg_queue, str, 1, 1); + } + rgui->need_refresh = true; // in case of zip extract rgui->msg_force = true; ret = -1; @@ -1642,9 +1651,6 @@ static int menu_input_process(void *data, void *state) { if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME)) { - if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_LOADING_ROM, 100); - if (g_extern.fullpath) g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT); diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index 461407865f..e315d47ece 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -28,7 +28,6 @@ #endif #include "../../console/rarch_console.h" -#include "menu_settings.h" #include "../../gfx/image.h" @@ -848,7 +847,7 @@ static void browser_update(void *data, uint64_t input, const char *extensions) ret = filebrowser_iterate(b, action); if(!ret) - menu_settings_msg(S_MSG_DIR_LOADING_ERROR, 180); + msg_queue_push(g_extern.msg_queue, "ERROR - Failed to open directory.", 1, 180); } void browser_render(void *data) @@ -958,7 +957,7 @@ int select_file(void *data, void *state) { driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, path, RARCH_SHADER_INDEX_PASS0); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180); + msg_queue_push(g_extern.msg_queue, "INFO - Shader successfully loaded.", 1, 180); } else RARCH_ERR("Shaders are unsupported on this platform.\n"); @@ -974,7 +973,7 @@ int select_file(void *data, void *state) { driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, path, RARCH_SHADER_INDEX_PASS1); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180); + msg_queue_push(g_extern.msg_queue, "INFO - Shader successfully loaded.", 1, 180); } else RARCH_ERR("Shaders are unsupported on this platform.\n"); @@ -1019,7 +1018,7 @@ int select_file(void *data, void *state) else { if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); } break; } @@ -1028,7 +1027,7 @@ int select_file(void *data, void *state) } if(!ret) - menu_settings_msg(S_MSG_DIR_LOADING_ERROR, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); } else if (input & (1ULL << RMENU_DEVICE_NAV_X)) menu_stack_pop(); @@ -1152,7 +1151,7 @@ int select_directory(void *data, void *state) } if(!ret) - menu_settings_msg(S_MSG_DIR_LOADING_ERROR, 180); + msg_queue_push(g_extern.msg_queue, "ERROR - Failed to open directory.", 1, 180); display_menubar(current_menu); @@ -1413,7 +1412,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) { driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, NULL, RARCH_SHADER_INDEX_PASS0); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180); + msg_queue_push(g_extern.msg_queue, "INFO - Shader successfully loaded.", 1, 180); } else RARCH_ERR("Shaders are unsupported on this platform.\n"); @@ -1433,7 +1432,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) { driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, NULL, RARCH_SHADER_INDEX_PASS1); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180); + msg_queue_push(g_extern.msg_queue, "INFO - Shader successfully loaded.", 1, 180); } else RARCH_ERR("Shaders are unsupported on this platform.\n"); @@ -1466,7 +1465,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); } } if(input & (1ULL << RMENU_DEVICE_NAV_START)) @@ -1479,7 +1478,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); } } } @@ -1920,14 +1919,14 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) { g_extern.console.sound.volume_level = !g_extern.console.sound.volume_level; if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); } if(input & (1ULL << RMENU_DEVICE_NAV_START)) { g_extern.console.sound.volume_level = 0; if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); } break; #endif @@ -2401,7 +2400,7 @@ int select_rom(void *data, void *state) bool ret = filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK); if(!ret) - menu_settings_msg(S_MSG_DIR_LOADING_ERROR, 180); + msg_queue_push(g_extern.msg_queue, "ERROR - Failed to open directory.", 1, 180); } else { @@ -3268,7 +3267,14 @@ int menu_input_process(void *data, void *state) if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME)) { if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_LOADING_ROM, 100); + { + char tmp[PATH_MAX]; + char str[PATH_MAX]; + + fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp)); + snprintf(str, sizeof(str), "INFO - Loading %s...", tmp); + msg_queue_push(g_extern.msg_queue, str, 1, 1); + } g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME); diff --git a/frontend/menu/rmenu_xui.cpp b/frontend/menu/rmenu_xui.cpp index 30c93e509e..f473938160 100644 --- a/frontend/menu/rmenu_xui.cpp +++ b/frontend/menu/rmenu_xui.cpp @@ -26,7 +26,6 @@ #include "utils/file_browser.h" #include "../../console/rarch_console.h" -#include "menu_settings.h" #include "../../gfx/gfx_common.h" #include "../../gfx/gfx_context.h" @@ -359,7 +358,7 @@ static void browser_update(filebrowser_t * b, uint64_t input, const char *extens ret = filebrowser_iterate(b, action); if(!ret) - menu_settings_msg(S_MSG_DIR_LOADING_ERROR, 180); + msg_queue_push(g_extern.msg_queue, "ERROR - Failed to open directory.", 1, 180); } HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) @@ -715,7 +714,7 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF"); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); break; case SETTING_EMU_REWIND_GRANULARITY: g_settings.rewind_granularity++; @@ -785,7 +784,8 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled hCur = app.hShaderBrowser; if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SELECT_SHADER, 180); + msg_queue_push(g_extern.msg_queue, + "INFO - Select a shader from the menu.", 1, 180); NavigateForward(app.hShaderBrowser); break; @@ -798,7 +798,8 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled hCur = app.hShaderBrowser; if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SELECT_SHADER, 180); + msg_queue_push(g_extern.msg_queue, + "INFO - Select a shader from the menu.", 1, 180); NavigateForward(app.hShaderBrowser); break; @@ -846,7 +847,7 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF"); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); break; case SETTING_EMU_REWIND_GRANULARITY: if (g_settings.rewind_granularity > 1) @@ -997,7 +998,7 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF"); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESTART_RARCH, 180); + msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch.", 1, 180); break; case SETTING_EMU_REWIND_GRANULARITY: g_settings.rewind_granularity++; @@ -1239,7 +1240,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled m_quickmenulist.SetText(MENU_XUI_ITEM_ASPECT_RATIO, strw_buffer); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_RESIZE_SCREEN, 270); + msg_queue_push(g_extern.msg_queue, "INFO - Resize the screen by moving around the two analog sticks.\n", 1, 270); break; case MENU_XUI_ITEM_FRAME_ADVANCE: if (g_extern.main_is_init) @@ -1313,7 +1314,7 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand { driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, g_settings.video.cg_shader_path, RARCH_SHADER_INDEX_PASS0); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180); + msg_queue_push(G_extern.msg_queue, "INFO - Shader successfully loaded.", 1, 180); XuiSceneNavigateBack(hCur, app.hMainScene, XUSER_INDEX_ANY); } else @@ -1328,7 +1329,7 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand { driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, g_settings.video.second_pass_shader, RARCH_SHADER_INDEX_PASS1); if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180); + msg_queue_push(G_extern.msg_queue, "INFO - Shader successfully loaded.", 1, 180); } else RARCH_ERR("Shaders are unsupported on this platform.\n"); @@ -1452,7 +1453,8 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled ) hCur = app.hControlsMenu; if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_CHANGE_CONTROLS, 180); + msg_queue_push(g_extern.msg_queue, + "INFO - Press LEFT/RIGHT to change the controls, and press\n[RetroPad Start] to reset a button to default values.", 1, 180); NavigateForward(app.hControlsMenu); } @@ -1465,7 +1467,8 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled ) hCur = app.hCoreBrowser; if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_SELECT_LIBRETRO_CORE, 180); + msg_queue_push(g_extern.msg_queue, + "INFO - Select a Libretro core from the menu.", 1, 180); NavigateForward(app.hCoreBrowser); } @@ -1620,7 +1623,14 @@ bool menu_iterate(void) if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME)) { if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) - menu_settings_msg(S_MSG_LOADING_ROM, 100); + { + char tmp[PATH_MAX]; + char str[PATH_MAX]; + + fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp)); + snprintf(str, sizeof(str), "INFO - Loading %s...", tmp); + msg_queue_push(g_extern.msg_queue, str, 1, 1); + } g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME); diff --git a/griffin/griffin.c b/griffin/griffin.c index fbc8e5dba4..af1ea4ae6a 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -444,8 +444,6 @@ MENU #include "../frontend/menu/rmenu_xui.cpp" #endif -#include "../frontend/menu/menu_settings.c" - #ifdef __cplusplus extern "C" { #endif