Add config option for XML shader.

This commit is contained in:
Themaister 2011-01-05 17:32:30 +01:00
parent 633cc43949
commit 56e050f10d
6 changed files with 15 additions and 7 deletions

View File

@ -127,7 +127,7 @@ static const struct snes_keybind snes_keybinds_1[] = {
{ SNES_DEVICE_ID_JOYPAD_DOWN, GLFW_KEY_DOWN, 14, AXIS_NEG(1) },
{ SNES_DEVICE_ID_JOYPAD_START, GLFW_KEY_ENTER, 7, AXIS_NONE },
{ SNES_DEVICE_ID_JOYPAD_SELECT, GLFW_KEY_RSHIFT, 6, AXIS_NONE },
{ SNES_FAST_FORWARD_KEY, GLFW_KEY_SPACE, 10, AXIS_NONE },
{ SSNES_FAST_FORWARD_KEY, GLFW_KEY_SPACE, 10, AXIS_NONE },
{ -1 }
};

View File

@ -24,7 +24,7 @@
#include <stdint.h>
#include <unistd.h>
#define SNES_FAST_FORWARD_KEY 0x666 // Hurr, durr
#define SSNES_FAST_FORWARD_KEY 0x666 // Hurr, durr
void set_fast_forward_button(bool state);
struct snes_keybind

View File

@ -41,6 +41,7 @@ struct settings
bool smooth;
bool force_aspect;
char cg_shader_path[256];
char bsnes_shader_path[256];
unsigned filter;
} video;

View File

@ -150,7 +150,7 @@ static int16_t glfw_input_state(void *data, const struct snes_keybind **binds, b
// Checks if button is pressed, and sets fast-forwarding state
bool pressed = false;
for ( int i = 0; snes_keybinds[i].id != -1; i++ )
if ( snes_keybinds[i].id == SNES_FAST_FORWARD_KEY )
if ( snes_keybinds[i].id == SSNES_FAST_FORWARD_KEY )
set_fast_forward_button(glfw_is_pressed(port_num, &snes_keybinds[i], buttons, axes));
else if ( !pressed && snes_keybinds[i].id == (int)id )
pressed = glfw_is_pressed(port_num, &snes_keybinds[i], buttons, axes);

View File

@ -177,6 +177,12 @@ void parse_config(void)
free(tmp_str);
}
if (config_get_string(conf, "video_bsnes_shader", &tmp_str))
{
strncpy(g_settings.video.bsnes_shader_path, tmp_str, sizeof(g_settings.video.bsnes_shader_path));
free(tmp_str);
}
#ifdef HAVE_FILTER
if (config_get_string(conf, "video_filter", &tmp_str))
{
@ -263,8 +269,6 @@ void parse_config(void)
read_keybinds(conf);
// TODO: Keybinds.
config_file_free(conf);
}
@ -291,7 +295,7 @@ static const struct bind_map bind_maps[2][13] = {
{ "input_player1_right", "input_player1_right_btn", "input_player1_right_axis", SNES_DEVICE_ID_JOYPAD_RIGHT },
{ "input_player1_up", "input_player1_up_btn", "input_player1_up_axis", SNES_DEVICE_ID_JOYPAD_UP },
{ "input_player1_down", "input_player1_down_btn", "input_player1_down_axis", SNES_DEVICE_ID_JOYPAD_DOWN },
{ "input_toggle_fast_forward", "input_toggle_fast_forward_btn", NULL, SNES_FAST_FORWARD_KEY }
{ "input_toggle_fast_forward", "input_toggle_fast_forward_btn", NULL, SSNES_FAST_FORWARD_KEY }
},
{
{ "input_player2_a", "input_player2_a_btn", NULL, SNES_DEVICE_ID_JOYPAD_A },
@ -306,7 +310,7 @@ static const struct bind_map bind_maps[2][13] = {
{ "input_player2_right", "input_player2_right_btn", "input_player2_right_axis", SNES_DEVICE_ID_JOYPAD_RIGHT },
{ "input_player2_up", "input_player2_up_btn", "input_player2_up_axis", SNES_DEVICE_ID_JOYPAD_UP },
{ "input_player2_down", "input_player2_down_btn", "input_player2_down_axis", SNES_DEVICE_ID_JOYPAD_DOWN },
{ "input_toggle_fast_forward", "input_toggle_fast_forward_btn", NULL, SNES_FAST_FORWARD_KEY }
{ "input_toggle_fast_forward", "input_toggle_fast_forward_btn", NULL, SSNES_FAST_FORWARD_KEY }
}
};

View File

@ -28,6 +28,9 @@
# Path to Cg shader. If enabled
# video_cg_shader = "/path/to/cg/shader.cg"
# Path to bSNES-style XML shader. If both Cg shader path and XML shader path are defined, Cg shader will take priority.
# video_bsnes_shader = "/path/to/bsnes/xml/shader.shader"
# CPU-based filter. Valid ones are: hq2x, hq4x, grayscale, bleed, ntsc.
# video_filter = ntsc