mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Fix shader parameter left/right toggle
This commit is contained in:
parent
b94d9aa284
commit
46ee5efbca
@ -26,13 +26,11 @@
|
|||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
|
|
||||||
static int generic_shader_action_parameter_left(unsigned type, const char *label,
|
static int generic_shader_action_parameter_left(
|
||||||
bool wraparound, unsigned param_id)
|
struct video_shader *shader, struct video_shader_parameter *param,
|
||||||
|
unsigned type, const char *label, bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
struct video_shader *shader = video_shader_driver_get_current_shader();
|
|
||||||
struct video_shader_parameter *param = &shader->parameters[type - param_id];
|
|
||||||
|
|
||||||
if (shader)
|
if (shader)
|
||||||
{
|
{
|
||||||
param->current -= param->step;
|
param->current -= param->step;
|
||||||
@ -45,15 +43,18 @@ static int generic_shader_action_parameter_left(unsigned type, const char *label
|
|||||||
static int shader_action_parameter_left(unsigned type, const char *label,
|
static int shader_action_parameter_left(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
return generic_shader_action_parameter_left(type, label, wraparound,
|
struct video_shader *shader = video_shader_driver_get_current_shader();
|
||||||
MENU_SETTINGS_SHADER_PARAMETER_0);
|
struct video_shader_parameter *param = &shader->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
|
||||||
|
return generic_shader_action_parameter_left(shader, param, type, label, wraparound);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shader_action_parameter_preset_left(unsigned type, const char *label,
|
static int shader_action_parameter_preset_left(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
return generic_shader_action_parameter_left(type, label, wraparound,
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
MENU_SETTINGS_SHADER_PRESET_PARAMETER_0);
|
struct video_shader *shader = menu ? menu->shader : NULL;
|
||||||
|
struct video_shader_parameter *param = &shader->parameters[type - MENU_SETTINGS_SHADER_PRESET_PARAMETER_0];
|
||||||
|
return generic_shader_action_parameter_left(shader, param, type, label, wraparound);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_left_cheat(unsigned type, const char *label,
|
static int action_left_cheat(unsigned type, const char *label,
|
||||||
|
@ -27,14 +27,13 @@
|
|||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
|
|
||||||
|
|
||||||
static int generic_shader_action_parameter_right(unsigned type, const char *label,
|
static int generic_shader_action_parameter_right(
|
||||||
bool wraparound, unsigned param_id)
|
struct video_shader *shader, struct video_shader_parameter *param,
|
||||||
|
unsigned type, const char *label, bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
||||||
struct video_shader *shader = video_shader_driver_get_current_shader();
|
|
||||||
struct video_shader_parameter *param = &shader->parameters[type - param_id];
|
|
||||||
|
|
||||||
if (!shader)
|
if (!shader)
|
||||||
return -1;
|
return -1;
|
||||||
@ -51,8 +50,9 @@ static int generic_shader_action_parameter_right(unsigned type, const char *labe
|
|||||||
int shader_action_parameter_right(unsigned type, const char *label, bool wraparound)
|
int shader_action_parameter_right(unsigned type, const char *label, bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
return generic_shader_action_parameter_right(type, label, wraparound,
|
struct video_shader *shader = video_shader_driver_get_current_shader();
|
||||||
MENU_SETTINGS_SHADER_PARAMETER_0);
|
struct video_shader_parameter *param = &shader->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
|
||||||
|
return generic_shader_action_parameter_right(shader, param, type, label, wraparound);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
@ -62,8 +62,10 @@ int shader_action_parameter_preset_right(unsigned type, const char *label,
|
|||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
return generic_shader_action_parameter_right(type, label, wraparound,
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
MENU_SETTINGS_SHADER_PRESET_PARAMETER_0);
|
struct video_shader *shader = menu ? menu->shader : NULL;
|
||||||
|
struct video_shader_parameter *param = &shader->parameters[type - MENU_SETTINGS_SHADER_PRESET_PARAMETER_0];
|
||||||
|
return generic_shader_action_parameter_right(shader, param, type, label, wraparound);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user