mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-10 12:01:10 +00:00
empty shader dir checking: some useful comments
This commit is contained in:
parent
a9583eb1e6
commit
e9e095b4c6
1 changed files with 9 additions and 0 deletions
|
@ -429,6 +429,10 @@ int WINAPI QERApp_LoadShadersFromDir( const char *path ){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - proceed if shader script base name is <path>
|
||||||
|
// for example: "scripts/eerie.shader" with "eerie" path
|
||||||
|
// - proceed if shader script base name is <path> and shader path starts with "textures/<path>"
|
||||||
|
// 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 ) ) {
|
if ( strstr( pShader->getShaderFileName(), around ) != NULL || g_str_has_prefix( pShader->getName(), prefix ) ) {
|
||||||
count++;
|
count++;
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
@ -467,6 +471,11 @@ bool WINAPI QERApp_IsDirContainingShaders( const char *path ){
|
||||||
for ( int i = 0; i < nSize; i++ )
|
for ( int i = 0; i < nSize; i++ )
|
||||||
{
|
{
|
||||||
CShader *pShader = reinterpret_cast < CShader * >( g_Shaders[i] );
|
CShader *pShader = reinterpret_cast < CShader * >( g_Shaders[i] );
|
||||||
|
|
||||||
|
// - returns true if shader script basename is <path> and shader path starts with "textures/"
|
||||||
|
// for example: "scripts/rockyvalley.shader" with "rockyvalley" path providing "textures/amethyst7/rockyvalley/rockyvalley_skybox/"
|
||||||
|
// - returns true if shader <path> startswith "textures/<path>"
|
||||||
|
// 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 ) ) {
|
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(around);
|
||||||
g_free(prefix);
|
g_free(prefix);
|
||||||
|
|
Loading…
Reference in a new issue