added alternative paths, when files are not found
This commit is contained in:
@@ -431,11 +431,11 @@ void initCubeVBO ()
|
|||||||
{
|
{
|
||||||
//the filenames have additional path to make it easier for some platforms
|
//the filenames have additional path to make it easier for some platforms
|
||||||
if ( noVertexTextureSupport )
|
if ( noVertexTextureSupport )
|
||||||
cubeShader = new GLSL_ShaderPair ( "CubeShader", "../../Extras/GPUphysics/cubeShaderNoTexture.vert",
|
cubeShader = new GLSL_ShaderPair ( "CubeShader", "cubeShaderNoTexture.vert",
|
||||||
"../../Extras/GPUphysics/cubeShader.frag" ) ;
|
"cubeShader.frag" ) ;
|
||||||
else
|
else
|
||||||
cubeShader = new GLSL_ShaderPair ( "CubeShader", "../../Extras/GPUphysics/cubeShader.vert",
|
cubeShader = new GLSL_ShaderPair ( "CubeShader", "cubeShader.vert",
|
||||||
"../../Extras/GPUphysics/cubeShader.frag" ) ;
|
"cubeShader.frag" ) ;
|
||||||
assert ( cubeShader -> compiledOK () ) ;
|
assert ( cubeShader -> compiledOK () ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,24 @@ static char *readShaderText ( const char *fname )
|
|||||||
|
|
||||||
|
|
||||||
FILE *fd = fopen ( fname, "r" ) ;
|
FILE *fd = fopen ( fname, "r" ) ;
|
||||||
|
if (!fd)
|
||||||
|
{
|
||||||
|
//some platforms might require different path, try two additional locations
|
||||||
|
char newname[256];
|
||||||
|
sprintf(newname,"../../Extras/GPUphysics/%s",fname);
|
||||||
|
fd = fopen( newname ,"r");
|
||||||
|
if (!fd)
|
||||||
|
{
|
||||||
|
sprintf("Extras/GPUphysics/%s",fname);
|
||||||
|
fd = fopen( newname,"r");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fd)
|
||||||
|
{
|
||||||
|
printf("cannot open file %s\n",fname);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
int size = 0;
|
int size = 0;
|
||||||
/* File operations denied? ok, just close and return failure */
|
/* File operations denied? ok, just close and return failure */
|
||||||
|
|||||||
Reference in New Issue
Block a user