added extra file search path for cmake-generated msvc projectfiles (needs 4 levels back)
This commit is contained in:
@@ -181,6 +181,13 @@ void BspDemo::initPhysics(const char* bspfilename)
|
|||||||
file = fopen(bspfilename,"r");
|
file = fopen(bspfilename,"r");
|
||||||
}
|
}
|
||||||
if (!file)
|
if (!file)
|
||||||
|
{
|
||||||
|
|
||||||
|
//try again other path, cmake needs 4 levels deep back...
|
||||||
|
bspfilename = "../../../../BspDemo.bsp";
|
||||||
|
file = fopen(bspfilename,"r");
|
||||||
|
}
|
||||||
|
if (!file)
|
||||||
{
|
{
|
||||||
//try again other path,
|
//try again other path,
|
||||||
//sight... visual studio leaves the current working directory in the projectfiles folder
|
//sight... visual studio leaves the current working directory in the projectfiles folder
|
||||||
|
|||||||
@@ -103,6 +103,12 @@ void CharacterDemo::initPhysics()
|
|||||||
|
|
||||||
FILE* file = fopen(bspfilename,"r");
|
FILE* file = fopen(bspfilename,"r");
|
||||||
if (!file)
|
if (!file)
|
||||||
|
{
|
||||||
|
//cmake generated visual studio projects need 4 levels back
|
||||||
|
bspfilename = "../../../../BspDemo.bsp";
|
||||||
|
file = fopen(bspfilename,"r");
|
||||||
|
}
|
||||||
|
if (!file)
|
||||||
{
|
{
|
||||||
//visual studio leaves the current working directory in the projectfiles folder
|
//visual studio leaves the current working directory in the projectfiles folder
|
||||||
bspfilename = "../../BspDemo.bsp";
|
bspfilename = "../../BspDemo.bsp";
|
||||||
|
|||||||
@@ -169,6 +169,11 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
//when running this app from visual studio, the default starting folder is different, so make a second attempt...
|
//when running this app from visual studio, the default starting folder is different, so make a second attempt...
|
||||||
tcount = wo.loadObj("../../file.obj");
|
tcount = wo.loadObj("../../file.obj");
|
||||||
}
|
}
|
||||||
|
if (!tcount)
|
||||||
|
{
|
||||||
|
//cmake generated msvc files need 4 levels deep back... so make a 3rd attempt...
|
||||||
|
tcount = wo.loadObj("../../../../file.obj");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -260,9 +260,13 @@ void SerializeDemo::initPhysics()
|
|||||||
btBulletWorldImporter* fileLoader = new btBulletWorldImporter(m_dynamicsWorld);
|
btBulletWorldImporter* fileLoader = new btBulletWorldImporter(m_dynamicsWorld);
|
||||||
//fileLoader->setVerboseMode(true);
|
//fileLoader->setVerboseMode(true);
|
||||||
|
|
||||||
if (fileLoader->loadFile("testFile.bullet"))
|
if (!fileLoader->loadFile("testFile.bullet"))
|
||||||
{
|
{
|
||||||
printf("loaded fine\n");
|
//cmake generated msvc files need 4 levels deep back... so make a 3rd attempt...
|
||||||
|
if (fileLoader->loadFile("../../../../testFileOriginal.bullet"))
|
||||||
|
{
|
||||||
|
printf("loaded fine\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
testFileOriginal.bullet
Normal file
BIN
testFileOriginal.bullet
Normal file
Binary file not shown.
Reference in New Issue
Block a user