From e9e095b4c62f52d78ec29578c26826529ae81518 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sat, 2 Sep 2017 05:09:18 +0200 Subject: [PATCH] empty shader dir checking: some useful comments --- plugins/shaders/shaders.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index e125584c..e6dbde67 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -429,6 +429,10 @@ int WINAPI QERApp_LoadShadersFromDir( const char *path ){ continue; } + // - proceed if shader script base name is + // for example: "scripts/eerie.shader" with "eerie" path + // - proceed if shader script base name is and shader path starts with "textures/" + // for example: "scripts/eerie.shader" providing "textures/eerie/blackness" with "eerie" path if ( strstr( pShader->getShaderFileName(), around ) != NULL || g_str_has_prefix( pShader->getName(), prefix ) ) { count++; #ifdef _DEBUG @@ -467,6 +471,11 @@ bool WINAPI QERApp_IsDirContainingShaders( const char *path ){ for ( int i = 0; i < nSize; i++ ) { CShader *pShader = reinterpret_cast < CShader * >( g_Shaders[i] ); + + // - returns true if shader script basename is and shader path starts with "textures/" + // for example: "scripts/rockyvalley.shader" with "rockyvalley" path providing "textures/amethyst7/rockyvalley/rockyvalley_skybox/" + // - returns true if shader startswith "textures/" + // for example: "scripts/eerie.shader" with "eerie" path providing "textures/eerie/blackness" if ( ( strstr( pShader->getShaderFileName(), around ) != NULL && g_str_has_prefix( pShader->getName(), "textures/" ) ) || g_str_has_prefix( pShader->getName(), prefix ) ) { g_free(around); g_free(prefix);