(D3D) Rename cg_shader to shader_path

This commit is contained in:
twinaphex 2015-04-05 18:20:45 +02:00
parent 56145d279d
commit 6927d6e47c
2 changed files with 9 additions and 13 deletions

View File

@ -607,7 +607,7 @@ static bool d3d_construct(d3d_video_t *d3d,
enum rarch_shader_type type = enum rarch_shader_type type =
video_shader_parse_type(settings->video.shader_path, RARCH_SHADER_NONE); video_shader_parse_type(settings->video.shader_path, RARCH_SHADER_NONE);
if (settings->video.shader_enable && type == RARCH_SHADER_CG) if (settings->video.shader_enable && type == RARCH_SHADER_CG)
d3d->cg_shader = settings->video.shader_path; d3d->shader_path = settings->video.shader_path;
if (!d3d_process_shader(d3d)) if (!d3d_process_shader(d3d))
return false; return false;
@ -1140,7 +1140,7 @@ static bool d3d_init_multipass(d3d_video_t *d3d)
unsigned i; unsigned i;
bool use_extra_pass; bool use_extra_pass;
video_shader_pass *pass = NULL; video_shader_pass *pass = NULL;
config_file_t *conf = config_file_new(d3d->cg_shader.c_str()); config_file_t *conf = config_file_new(d3d->shader_path.c_str());
if (!conf) if (!conf)
{ {
@ -1159,7 +1159,7 @@ static bool d3d_init_multipass(d3d_video_t *d3d)
config_file_free(conf); config_file_free(conf);
video_shader_resolve_relative(&d3d->shader, d3d->cg_shader.c_str()); video_shader_resolve_relative(&d3d->shader, d3d->shader_path.c_str());
RARCH_LOG("[D3D9 Meta-Cg] Found %u shaders.\n", d3d->shader.passes); RARCH_LOG("[D3D9 Meta-Cg] Found %u shaders.\n", d3d->shader.passes);
@ -1253,7 +1253,7 @@ static bool d3d_init_singlepass(d3d_video_t *d3d)
pass->fbo.type_y = RARCH_SCALE_VIEWPORT; pass->fbo.type_y = RARCH_SCALE_VIEWPORT;
pass->fbo.scale_x = pass->fbo.scale_y; pass->fbo.scale_x = pass->fbo.scale_y;
pass->fbo.type_x = pass->fbo.type_y; pass->fbo.type_x = pass->fbo.type_y;
strlcpy(pass->source.path, d3d->cg_shader.c_str(), strlcpy(pass->source.path, d3d->shader_path.c_str(),
sizeof(pass->source.path)); sizeof(pass->source.path));
#endif #endif
@ -1264,7 +1264,7 @@ static bool d3d_process_shader(d3d_video_t *d3d)
{ {
#ifdef HAVE_FBO #ifdef HAVE_FBO
if (strcmp(path_get_extension( if (strcmp(path_get_extension(
d3d->cg_shader.c_str()), "cgp") == 0) d3d->shader_path.c_str()), "cgp") == 0)
return d3d_init_multipass(d3d); return d3d_init_multipass(d3d);
#endif #endif
@ -1809,10 +1809,8 @@ static bool d3d_set_shader(void *data,
break; break;
} }
std::string old_shader = d3d->cg_shader; std::string old_shader = d3d->shader_path;
#ifdef HAVE_CG d3d->shader_pat = shader;
d3d->cg_shader = shader;
#endif
if (!d3d_process_shader(d3d) || !d3d_restore(d3d)) if (!d3d_process_shader(d3d) || !d3d_restore(d3d))
{ {
@ -1822,9 +1820,7 @@ static bool d3d_set_shader(void *data,
if (restore_old) if (restore_old)
{ {
#ifdef HAVE_CG d3d->shader_path = old_shader;
d3d->cg_shader = old_shader;
#endif
d3d_process_shader(d3d); d3d_process_shader(d3d);
d3d_restore(d3d); d3d_restore(d3d);
} }

View File

@ -130,7 +130,7 @@ typedef struct d3d_video
unsigned dev_rotation; unsigned dev_rotation;
D3DVIEWPORT final_viewport; D3DVIEWPORT final_viewport;
std::string cg_shader; std::string shader_path;
#ifndef _XBOX #ifndef _XBOX
struct video_shader shader; struct video_shader shader;