From 6927d6e47c3530eb05e9e3cb94d565eb79c934dd Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 5 Apr 2015 18:20:45 +0200 Subject: [PATCH] (D3D) Rename cg_shader to shader_path --- gfx/d3d/d3d.cpp | 20 ++++++++------------ gfx/d3d/d3d.h | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index 7f428b3208..61562370aa 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -607,7 +607,7 @@ static bool d3d_construct(d3d_video_t *d3d, enum rarch_shader_type type = video_shader_parse_type(settings->video.shader_path, RARCH_SHADER_NONE); 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)) return false; @@ -1140,7 +1140,7 @@ static bool d3d_init_multipass(d3d_video_t *d3d) unsigned i; bool use_extra_pass; 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) { @@ -1159,7 +1159,7 @@ static bool d3d_init_multipass(d3d_video_t *d3d) 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); @@ -1253,7 +1253,7 @@ static bool d3d_init_singlepass(d3d_video_t *d3d) pass->fbo.type_y = RARCH_SCALE_VIEWPORT; pass->fbo.scale_x = pass->fbo.scale_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)); #endif @@ -1264,7 +1264,7 @@ static bool d3d_process_shader(d3d_video_t *d3d) { #ifdef HAVE_FBO if (strcmp(path_get_extension( - d3d->cg_shader.c_str()), "cgp") == 0) + d3d->shader_path.c_str()), "cgp") == 0) return d3d_init_multipass(d3d); #endif @@ -1809,10 +1809,8 @@ static bool d3d_set_shader(void *data, break; } - std::string old_shader = d3d->cg_shader; -#ifdef HAVE_CG - d3d->cg_shader = shader; -#endif + std::string old_shader = d3d->shader_path; + d3d->shader_pat = shader; if (!d3d_process_shader(d3d) || !d3d_restore(d3d)) { @@ -1822,9 +1820,7 @@ static bool d3d_set_shader(void *data, if (restore_old) { -#ifdef HAVE_CG - d3d->cg_shader = old_shader; -#endif + d3d->shader_path = old_shader; d3d_process_shader(d3d); d3d_restore(d3d); } diff --git a/gfx/d3d/d3d.h b/gfx/d3d/d3d.h index 6bec6ec73b..b9252e5030 100644 --- a/gfx/d3d/d3d.h +++ b/gfx/d3d/d3d.h @@ -130,7 +130,7 @@ typedef struct d3d_video unsigned dev_rotation; D3DVIEWPORT final_viewport; - std::string cg_shader; + std::string shader_path; #ifndef _XBOX struct video_shader shader;