diff --git a/Makefile.common b/Makefile.common index 07a2ea5bb5..10494e9e1a 100644 --- a/Makefile.common +++ b/Makefile.common @@ -753,6 +753,8 @@ ifeq ($(HAVE_LAKKA_SWITCH), 1) DEFINES += -DHAVE_LAKKA_SWITCH endif +OBJ += menu/menu_shader.o + ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/menu_driver.o \ menu/menu_content.o \ @@ -760,7 +762,6 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/menu_entries.o \ menu/menu_setting.o \ menu/menu_networking.o \ - menu/menu_shader.o \ menu/widgets/menu_filebrowser.o \ menu/widgets/menu_dialog.o \ menu/widgets/menu_input_dialog.o \ diff --git a/menu/menu_shader.c b/menu/menu_shader.c index 9b77c49bff..c547bfc26c 100644 --- a/menu/menu_shader.c +++ b/menu/menu_shader.c @@ -208,7 +208,9 @@ bool menu_shader_manager_set_preset(void *data, } config_file_free(conf); +#ifdef HAVE_MENU menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); +#endif return true; } @@ -394,7 +396,10 @@ int menu_shader_manager_clear_num_passes(void) if (shader->passes) shader->passes = 0; +#ifdef HAVE_MENU menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); +#endif + video_shader_resolve_parameters(NULL, shader); return 0; diff --git a/tasks/task_content.c b/tasks/task_content.c index 60e08e11da..4cd90e064a 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -61,9 +61,10 @@ #ifdef HAVE_MENU #include "../menu/menu_driver.h" -#include "../menu/menu_shader.h" #endif +#include "../menu/menu_shader.h" + #ifdef HAVE_CHEEVOS #include "../cheevos/cheevos.h" #endif @@ -290,11 +291,8 @@ static bool content_load(content_ctx_info_t *info) content_clear_subsystem(); } - -#ifdef HAVE_MENU - /* TODO/FIXME - can we get rid of this? */ menu_shader_manager_init(); -#endif + command_event(CMD_EVENT_HISTORY_INIT, NULL); command_event(CMD_EVENT_RESUME, NULL); command_event(CMD_EVENT_VIDEO_SET_ASPECT_RATIO, NULL); @@ -832,8 +830,6 @@ static bool content_file_init( return ret; } - -#ifdef HAVE_MENU static void menu_content_environment_get(int *argc, char *argv[], void *args, void *params_data) { @@ -867,7 +863,6 @@ static void menu_content_environment_get(int *argc, char *argv[], path_get(RARCH_PATH_CORE); } -#endif /** * task_load_content: @@ -1115,10 +1110,8 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info) if (!string_is_empty(settings->paths.directory_system)) content_ctx.directory_system = strdup(settings->paths.directory_system); -#ifdef HAVE_MENU if (!content_info->environ_get) content_info->environ_get = menu_content_environment_get; -#endif /* Clear content path */ path_clear(RARCH_PATH_CONTENT); @@ -1308,10 +1301,8 @@ bool task_push_start_current_core(content_ctx_info_t *content_info) if (!string_is_empty(settings->paths.directory_system)) content_ctx.directory_system = strdup(settings->paths.directory_system); -#ifdef HAVE_MENU if (!content_info->environ_get) content_info->environ_get = menu_content_environment_get; -#endif /* Clear content path */ path_clear(RARCH_PATH_CONTENT); @@ -1560,10 +1551,8 @@ static bool task_load_content_callback(content_ctx_info_t *content_info, if (!string_is_empty(settings->paths.directory_system)) content_ctx.directory_system = strdup(settings->paths.directory_system); -#ifdef HAVE_MENU if (!content_info->environ_get) content_info->environ_get = menu_content_environment_get; -#endif if (firmware_update_status(&content_ctx)) goto end; diff --git a/ui/drivers/qt/shaderparamsdialog.cpp b/ui/drivers/qt/shaderparamsdialog.cpp index d401779ab0..1124739723 100644 --- a/ui/drivers/qt/shaderparamsdialog.cpp +++ b/ui/drivers/qt/shaderparamsdialog.cpp @@ -28,9 +28,7 @@ extern "C" { #include "../../../retroarch.h" #include "../../../paths.h" #include "../../../file_path_special.h" -#ifdef HAVE_MENU #include "../../../menu/menu_shader.h" -#endif } enum @@ -169,7 +167,7 @@ void ShaderParamsDialog::clearLayout() void ShaderParamsDialog::getShaders(struct video_shader **menu_shader, struct video_shader **video_shader) { video_shader_ctx_t shader_info = {0}; -#ifdef HAVE_MENU + struct video_shader *shader = menu_shader_get(); if (menu_shader) @@ -195,7 +193,6 @@ void ShaderParamsDialog::getShaders(struct video_shader **menu_shader, struct vi *video_shader = NULL; } } -#endif if (video_shader) { @@ -491,7 +488,6 @@ void ShaderParamsDialog::onShaderPassMoveUpClicked() void ShaderParamsDialog::onShaderLoadPresetClicked() { -#ifdef HAVE_MENU QString path; QString filter; QByteArray pathArray; @@ -541,7 +537,6 @@ void ShaderParamsDialog::onShaderLoadPresetClicked() type = video_shader_parse_type(pathData, RARCH_SHADER_NONE); menu_shader_manager_set_preset(menu_shader, type, pathData); -#endif } void ShaderParamsDialog::onShaderResetPass(int pass) @@ -634,7 +629,6 @@ void ShaderParamsDialog::onShaderResetAllPasses() void ShaderParamsDialog::onShaderAddPassClicked() { -#ifdef HAVE_MENU QString path; QString filter; QByteArray pathArray; @@ -696,12 +690,10 @@ void ShaderParamsDialog::onShaderAddPassClicked() video_shader_resolve_parameters(NULL, menu_shader); command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL); -#endif } void ShaderParamsDialog::onShaderSavePresetAsClicked() { -#ifdef HAVE_MENU settings_t *settings = config_get_ptr(); QString path; QByteArray pathArray; @@ -716,7 +708,6 @@ void ShaderParamsDialog::onShaderSavePresetAsClicked() pathData = pathArray.constData(); saveShaderPreset(pathData, SHADER_PRESET_SAVE_NORMAL); -#endif } void ShaderParamsDialog::saveShaderPreset(const char *path, unsigned action_type) @@ -769,18 +760,15 @@ void ShaderParamsDialog::saveShaderPreset(const char *path, unsigned action_type strlcpy(file, path, sizeof(file)); break; } -#ifdef HAVE_MENU + if (menu_shader_manager_save_preset(file, false, true)) runloop_msg_queue_push( msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY), 1, 100, true); else -#endif - { runloop_msg_queue_push( msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET), 1, 100, true); - } } void ShaderParamsDialog::onShaderSaveCorePresetClicked() @@ -800,7 +788,6 @@ void ShaderParamsDialog::onShaderSaveGamePresetClicked() void ShaderParamsDialog::onShaderClearAllPassesClicked() { -#ifdef HAVE_MENU struct video_shader *menu_shader = NULL; struct video_shader *video_shader = NULL; @@ -813,12 +800,10 @@ void ShaderParamsDialog::onShaderClearAllPassesClicked() menu_shader_manager_decrement_amount_passes(); onShaderApplyClicked(); -#endif } void ShaderParamsDialog::onShaderRemovePassClicked() { -#ifdef HAVE_MENU int i; QVariant passVariant; QAction *action = qobject_cast(sender()); @@ -854,7 +839,6 @@ void ShaderParamsDialog::onShaderRemovePassClicked() menu_shader_manager_decrement_amount_passes(); onShaderApplyClicked(); -#endif } void ShaderParamsDialog::onShaderApplyClicked()