mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
should get default Cg path...
This commit is contained in:
parent
61a70bba6c
commit
423fe969d3
@ -65,7 +65,6 @@ static const bool video_smooth = true;
|
|||||||
|
|
||||||
// Path to custom Cg shader. If using custom shaders, it is recommended to disable video_smooth.
|
// Path to custom Cg shader. If using custom shaders, it is recommended to disable video_smooth.
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
extern char cg_shader_path[];
|
|
||||||
#define DEFAULT_CG_SHADER "hqflt/cg/quad.cg"
|
#define DEFAULT_CG_SHADER "hqflt/cg/quad.cg"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
4
gfx/gl.c
4
gfx/gl.c
@ -409,8 +409,8 @@ static void* gl_init(video_info_t *video, const input_driver_t **input)
|
|||||||
}
|
}
|
||||||
cgGLSetOptimalOptions(gl->cgFProf);
|
cgGLSetOptimalOptions(gl->cgFProf);
|
||||||
cgGLSetOptimalOptions(gl->cgVProf);
|
cgGLSetOptimalOptions(gl->cgVProf);
|
||||||
gl->cgFPrg = cgCreateProgramFromFile(gl->cgCtx, CG_SOURCE, cg_shader_path, gl->cgFProf, "main_fragment", 0);
|
gl->cgFPrg = cgCreateProgramFromFile(gl->cgCtx, CG_SOURCE, g_settings.video.cg_shader_path, gl->cgFProf, "main_fragment", 0);
|
||||||
gl->cgVPrg = cgCreateProgramFromFile(gl->cgCtx, CG_SOURCE, cg_shader_path, gl->cgVProf, "main_vertex", 0);
|
gl->cgVPrg = cgCreateProgramFromFile(gl->cgCtx, CG_SOURCE, g_settings.video.cg_shader_path, gl->cgVProf, "main_vertex", 0);
|
||||||
if (gl->cgFPrg == NULL || gl->cgVPrg == NULL)
|
if (gl->cgFPrg == NULL || gl->cgVPrg == NULL)
|
||||||
{
|
{
|
||||||
CGerror err = cgGetError();
|
CGerror err = cgGetError();
|
||||||
|
13
settings.c
13
settings.c
@ -57,7 +57,7 @@ static void set_defaults(void)
|
|||||||
g_settings.video.smooth = video_smooth;
|
g_settings.video.smooth = video_smooth;
|
||||||
g_settings.video.force_aspect = force_aspect;
|
g_settings.video.force_aspect = force_aspect;
|
||||||
#if HAVE_CG
|
#if HAVE_CG
|
||||||
strncpy(g_settings.video.cg_shader_path, cg_shader_path, sizeof(g_settings.video.cg_shader_path) - 1);
|
strncpy(g_settings.video.cg_shader_path, DEFAULT_CG_SHADER, sizeof(g_settings.video.cg_shader_path) - 1);
|
||||||
#endif
|
#endif
|
||||||
strncpy(g_settings.video.video_filter, "foo", sizeof(g_settings.video.video_filter) - 1);
|
strncpy(g_settings.video.video_filter, "foo", sizeof(g_settings.video.video_filter) - 1);
|
||||||
|
|
||||||
@ -78,6 +78,7 @@ static void set_defaults(void)
|
|||||||
g_settings.input.save_state_key = SAVE_STATE_KEY;
|
g_settings.input.save_state_key = SAVE_STATE_KEY;
|
||||||
g_settings.input.load_state_key = LOAD_STATE_KEY;
|
g_settings.input.load_state_key = LOAD_STATE_KEY;
|
||||||
g_settings.input.toggle_fullscreen_key = TOGGLE_FULLSCREEN;
|
g_settings.input.toggle_fullscreen_key = TOGGLE_FULLSCREEN;
|
||||||
|
g_settings.input.axis_threshold = AXIS_THRESHOLD;
|
||||||
}
|
}
|
||||||
|
|
||||||
void parse_config(void)
|
void parse_config(void)
|
||||||
@ -149,6 +150,10 @@ void parse_config(void)
|
|||||||
free(tmp_str);
|
free(tmp_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Input Settings.
|
||||||
|
if (config_get_double(conf, "input_axis_threshold", &tmp_double))
|
||||||
|
g_settings.input.axis_threshold = tmp_double;
|
||||||
|
|
||||||
// Audio settings.
|
// Audio settings.
|
||||||
if (config_get_bool(conf, "audio_enable", &tmp_bool))
|
if (config_get_bool(conf, "audio_enable", &tmp_bool))
|
||||||
g_settings.audio.enable = tmp_bool;
|
g_settings.audio.enable = tmp_bool;
|
||||||
@ -191,6 +196,12 @@ void parse_config(void)
|
|||||||
free(tmp_str);
|
free(tmp_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config_get_string(conf, "video_cg_shader_path", &tmp_str))
|
||||||
|
{
|
||||||
|
strncpy(g_settings.video.cg_shader_path, tmp_str, sizeof(g_settings.video.cg_shader_path) - 1);
|
||||||
|
free(tmp_str);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Keybinds.
|
// TODO: Keybinds.
|
||||||
|
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
|
15
ssnes.c
15
ssnes.c
@ -35,9 +35,6 @@
|
|||||||
struct global g_extern = {
|
struct global g_extern = {
|
||||||
.video_active = true,
|
.video_active = true,
|
||||||
.audio_active = true,
|
.audio_active = true,
|
||||||
#if HAVE_CG
|
|
||||||
.cg_shader_path = DEFAULT_CG_SHADER
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// To avoid continous switching if we hold the button down, we require that the button must go from pressed, unpressed back to pressed to be able to toggle between then.
|
// To avoid continous switching if we hold the button down, we require that the button must go from pressed, unpressed back to pressed to be able to toggle between then.
|
||||||
@ -202,6 +199,7 @@ static void print_help(void)
|
|||||||
puts("Usage: ssnes [rom file] [-h/--help | -s/--save]");
|
puts("Usage: ssnes [rom file] [-h/--help | -s/--save]");
|
||||||
puts("\t-h/--help: Show this help message");
|
puts("\t-h/--help: Show this help message");
|
||||||
puts("\t-s/--save: Path for save file (*.srm). Required when rom is input from stdin");
|
puts("\t-s/--save: Path for save file (*.srm). Required when rom is input from stdin");
|
||||||
|
puts("\t-c/--config: Path for config file. Defaults to $XDG_CONFIG_HOME/ssnes");
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
puts("\t-f/--shader: Path to Cg shader. Will be compiled at runtime.\n");
|
puts("\t-f/--shader: Path to Cg shader. Will be compiled at runtime.\n");
|
||||||
#endif
|
#endif
|
||||||
@ -220,6 +218,7 @@ static void parse_input(int argc, char *argv[])
|
|||||||
{ "help", 0, NULL, 'h' },
|
{ "help", 0, NULL, 'h' },
|
||||||
{ "save", 1, NULL, 's' },
|
{ "save", 1, NULL, 's' },
|
||||||
{ "verbose", 0, NULL, 'v' },
|
{ "verbose", 0, NULL, 'v' },
|
||||||
|
{ "config", 0, NULL, 'c' },
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
{ "shader", 1, NULL, 'f' },
|
{ "shader", 1, NULL, 'f' },
|
||||||
#endif
|
#endif
|
||||||
@ -228,9 +227,9 @@ static void parse_input(int argc, char *argv[])
|
|||||||
|
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
char optstring[] = "hs:vf:";
|
char optstring[] = "hs:vf:c:";
|
||||||
#else
|
#else
|
||||||
char optstring[] = "hs:v";
|
char optstring[] = "hs:vc:";
|
||||||
#endif
|
#endif
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
@ -260,6 +259,10 @@ static void parse_input(int argc, char *argv[])
|
|||||||
g_extern.verbose = true;
|
g_extern.verbose = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'c':
|
||||||
|
strncpy(g_extern.config_path, optarg, sizeof(g_extern.config_path) - 1);
|
||||||
|
break;
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
print_help();
|
print_help();
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -304,8 +307,8 @@ static void parse_input(int argc, char *argv[])
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
snes_init();
|
snes_init();
|
||||||
parse_input(argc, argv);
|
|
||||||
parse_config();
|
parse_config();
|
||||||
|
parse_input(argc, argv);
|
||||||
|
|
||||||
void *rom_buf;
|
void *rom_buf;
|
||||||
ssize_t rom_len = 0;
|
ssize_t rom_len = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user