diff --git a/TODO b/TODO index 81593c26..4f9bf1eb 100644 --- a/TODO +++ b/TODO @@ -10,6 +10,7 @@ UI: changing resolution in floating-windows mode can screw up window positions. HalfLife: half-life maps saved in q1 map format are not supported - currently have to convert them to hammer map format using hammer editor. And vice versa. Entity: creating a new entity with all the brushes of another entity selected results in the latter entity having no brushes. SConscript: build fails if SETUP=1 +SConscript: svn.py fails if not using C locale - set LC_ALL? GUI: can't use arrow keys to navigate in camera view when capslock is enabled GUI: screensaver causes: gdkgc-win32.c: line 905 (gdk_win32_hdc_get): assertion failed: (win32_gc->hdc == NULL) diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index ba9b578c..e95adaff 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -1699,11 +1699,15 @@ CShader* Try_Shader_ForName(const char* name) return (*i).second; } } - - // not found, create it + // active shader was not found + + // find matching shader definition ShaderDefinitionMap::iterator i = g_shaderDefinitions.find(name); if(i == g_shaderDefinitions.end()) { + // shader definition was not found + + // create new shader definition from default shader template ShaderTemplatePointer shaderTemplate(new ShaderTemplate()); shaderTemplate->CreateDefault(name); g_shaderTemplates.insert(ShaderTemplateMap::value_type(shaderTemplate->getName(), shaderTemplate)); @@ -1711,6 +1715,7 @@ CShader* Try_Shader_ForName(const char* name) i = g_shaderDefinitions.insert(ShaderDefinitionMap::value_type(name, ShaderDefinition(shaderTemplate.get(), ShaderArguments(), ""))).first; } + // create shader from existing definition ShaderPointer pShader(new CShader((*i).second)); pShader->setName(name); g_ActiveShaders.insert(shaders_t::value_type(name, pShader));