rename ObsoleteDemos back to Demos
fix some relative path issues for loading assets
This commit is contained in:
@@ -44,10 +44,10 @@ IF(MSVC)
|
|||||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/INCREMENTAL:NO ${replacementFlags}" )
|
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/INCREMENTAL:NO ${replacementFlags}" )
|
||||||
MESSAGE("CMAKE_EXE_LINKER_FLAGS_DEBUG=${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
|
MESSAGE("CMAKE_EXE_LINKER_FLAGS_DEBUG=${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
|
||||||
|
|
||||||
# STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags2 ${CMAKE_EXE_LINKER_FLAGS})
|
STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags2 ${CMAKE_EXE_LINKER_FLAGS})
|
||||||
# SET(CMAKE_EXE_LINKER_FLAGS ${replacementFlag2})
|
SET(CMAKE_EXE_LINKER_FLAGS ${replacementFlag2})
|
||||||
# STRING(REPLACE "INCREMENTAL:YES" "" replacementFlags3 ${CMAKE_EXTRA_LINK_FLAGS})
|
STRING(REPLACE "INCREMENTAL:YES" "" replacementFlags3 ${CMAKE_EXTRA_LINK_FLAGS})
|
||||||
# SET(CMAKE_EXTRA_LINK_FLAGS ${replacementFlag3})
|
SET(CMAKE_EXTRA_LINK_FLAGS ${replacementFlag3})
|
||||||
|
|
||||||
|
|
||||||
STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags3 ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO})
|
STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags3 ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO})
|
||||||
@@ -188,13 +188,13 @@ IF (USE_GLUT)
|
|||||||
ADD_DEFINITIONS(-DBT_USE_FREEGLUT)
|
ADD_DEFINITIONS(-DBT_USE_FREEGLUT)
|
||||||
|
|
||||||
IF (CMAKE_CL_64)
|
IF (CMAKE_CL_64)
|
||||||
message("Win64 using static freeglut in ObsoleteDemos/Glut/glut64.lib")
|
message("Win64 using static freeglut in Demos/Glut/glut64.lib")
|
||||||
SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/ObsoleteDemos/Glut/glut64.lib glu32.lib gdi32.lib winmm.lib user32.lib)
|
SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Demos/Glut/glut64.lib glu32.lib gdi32.lib winmm.lib user32.lib)
|
||||||
ELSE(CMAKE_CL_64)
|
ELSE(CMAKE_CL_64)
|
||||||
message("Win32 using static freeglut in ObsoleteDemos/Glut/glut32.lib")
|
message("Win32 using static freeglut in Demos/Glut/glut32.lib")
|
||||||
SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/ObsoleteDemos/Glut/glut32.lib glu32.lib gdi32.lib winmm.lib user32.lib)
|
SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Demos/Glut/glut32.lib glu32.lib gdi32.lib winmm.lib user32.lib)
|
||||||
ENDIF (CMAKE_CL_64)
|
ENDIF (CMAKE_CL_64)
|
||||||
SET(GLUT_INCLUDE_DIR ${BULLET_PHYSICS_SOURCE_DIR}/ObsoleteDemos/Glut )
|
SET(GLUT_INCLUDE_DIR ${BULLET_PHYSICS_SOURCE_DIR}/Demos/Glut )
|
||||||
ELSE()
|
ELSE()
|
||||||
FIND_PACKAGE(GLUT)
|
FIND_PACKAGE(GLUT)
|
||||||
IF (GLUT_FOUND)
|
IF (GLUT_FOUND)
|
||||||
@@ -219,8 +219,8 @@ IF (USE_GLUT)
|
|||||||
ENDIF(USE_GLUT)
|
ENDIF(USE_GLUT)
|
||||||
|
|
||||||
|
|
||||||
IF(EXISTS ${BULLET_PHYSICS_SOURCE_DIR}/ObsoleteDemos AND IS_DIRECTORY ${BULLET_PHYSICS_SOURCE_DIR}/ObsoleteDemos)
|
IF(EXISTS ${BULLET_PHYSICS_SOURCE_DIR}/Demos AND IS_DIRECTORY ${BULLET_PHYSICS_SOURCE_DIR}/Demos)
|
||||||
SUBDIRS(ObsoleteDemos)
|
SUBDIRS(Demos)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(BUILD_OBSOLETE_DEMOS)
|
ENDIF(BUILD_OBSOLETE_DEMOS)
|
||||||
|
|
||||||
@@ -232,6 +232,10 @@ IF(BUILD_BULLET3_DEMOS)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(BUILD_BULLET3_DEMOS)
|
ENDIF(BUILD_BULLET3_DEMOS)
|
||||||
|
|
||||||
|
OPTION(BUILD_EXTRAS "Set when you want to build the extras" ON)
|
||||||
|
IF(BUILD_EXTRAS)
|
||||||
|
SUBDIRS(Extras)
|
||||||
|
ENDIF(BUILD_EXTRAS)
|
||||||
|
|
||||||
|
|
||||||
#Maya Dynamica plugin is moved to http://dynamica.googlecode.com
|
#Maya Dynamica plugin is moved to http://dynamica.googlecode.com
|
||||||
@@ -266,9 +270,9 @@ IF(INSTALL_LIBS)
|
|||||||
ENDIF(INSTALL_LIBS)
|
ENDIF(INSTALL_LIBS)
|
||||||
|
|
||||||
#INSTALL of other files requires CMake 2.6
|
#INSTALL of other files requires CMake 2.6
|
||||||
#IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
# OPTION(INSTALL_EXTRA_LIBS "Set when you want extra libraries installed" OFF)
|
OPTION(INSTALL_EXTRA_LIBS "Set when you want extra libraries installed" OFF)
|
||||||
#ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
|
|
||||||
OPTION(BUILD_UNIT_TESTS "Build Unit Tests" ON)
|
OPTION(BUILD_UNIT_TESTS "Build Unit Tests" ON)
|
||||||
|
|
||||||
|
|||||||
@@ -171,30 +171,22 @@ void BspDemo::initPhysics(const char* bspfilename)
|
|||||||
|
|
||||||
void* memoryBuffer = 0;
|
void* memoryBuffer = 0;
|
||||||
|
|
||||||
FILE* file = fopen(bspfilename,"r");
|
const char* filename = "BspDemo.bsp";
|
||||||
if (!file)
|
|
||||||
{
|
const char* prefix[]={"./","../","../../","../../../","../../../../", "BspDemo/", "Demos/BspDemo/",
|
||||||
//try again other path,
|
"../Demos/BspDemo/","../../Demos/BspDemo/"};
|
||||||
//sight... visual studio leaves the current working directory in the projectfiles folder
|
int numPrefixes = sizeof(prefix)/sizeof(const char*);
|
||||||
//instead of executable folder. who wants this default behaviour?!?
|
char relativeFileName[1024];
|
||||||
bspfilename = "../../BspDemo.bsp";
|
FILE* file=0;
|
||||||
file = fopen(bspfilename,"r");
|
|
||||||
}
|
for (int i=0;i<numPrefixes;i++)
|
||||||
if (!file)
|
{
|
||||||
{
|
sprintf(relativeFileName,"%s%s",prefix[i],filename);
|
||||||
|
file = fopen(relativeFileName,"r");
|
||||||
|
if (file)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//try again other path, cmake needs 4 levels deep back...
|
|
||||||
bspfilename = "../../../../BspDemo.bsp";
|
|
||||||
file = fopen(bspfilename,"r");
|
|
||||||
}
|
|
||||||
if (!file)
|
|
||||||
{
|
|
||||||
//try again other path,
|
|
||||||
//sight... visual studio leaves the current working directory in the projectfiles folder
|
|
||||||
//instead of executable folder. who wants this default behaviour?!?
|
|
||||||
bspfilename = "BspDemo.bsp";
|
|
||||||
file = fopen(bspfilename,"r");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
@@ -35,7 +35,7 @@ IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
|||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
TARGET AppBspPhysicsDemo
|
TARGET AppBspPhysicsDemo
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/ObsoleteDemos/BspDemo/BspDemo.bsp ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/BspDemo/BspDemo.bsp ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
|
||||||
@@ -47,7 +47,27 @@ void BulletXmlImportDemo::initPhysics()
|
|||||||
|
|
||||||
|
|
||||||
btBulletXmlWorldImporter* importer = new btBulletXmlWorldImporter(m_dynamicsWorld);
|
btBulletXmlWorldImporter* importer = new btBulletXmlWorldImporter(m_dynamicsWorld);
|
||||||
importer->loadFile("bullet_basic.xml");
|
static const char* filename = "bullet_basic.xml";
|
||||||
|
|
||||||
|
const char* prefix[]={"./","../","../../","../../../","../../../../", "BulletXmlImportDemo/", "Demos/BulletXmlImportDemo/",
|
||||||
|
"../Demos/BulletXmlImportDemo/","../../Demos/BulletXmlImportDemo/"};
|
||||||
|
int numPrefixes = sizeof(prefix)/sizeof(const char*);
|
||||||
|
char relativeFileName[1024];
|
||||||
|
bool fileFound = false;
|
||||||
|
|
||||||
|
for (int i=0;i<numPrefixes;i++)
|
||||||
|
{
|
||||||
|
sprintf(relativeFileName,"%s%s",prefix[i],filename);
|
||||||
|
FILE* f = fopen(relativeFileName,"r");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fclose(f);
|
||||||
|
fileFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
importer->loadFile(relativeFileName);
|
||||||
// importer->loadFile("bulletser.xml");
|
// importer->loadFile("bulletser.xml");
|
||||||
// importer->loadFile("bullet_constraints.xml");
|
// importer->loadFile("bullet_constraints.xml");
|
||||||
|
|
||||||
@@ -5,9 +5,9 @@ SUBDIRS( HelloWorld )
|
|||||||
IF (USE_GLUT)
|
IF (USE_GLUT)
|
||||||
IF (GLUT_FOUND)
|
IF (GLUT_FOUND)
|
||||||
IF(BUILD_CPU_DEMOS)
|
IF(BUILD_CPU_DEMOS)
|
||||||
# IF(BUILD_EXTRAS)
|
IF(BUILD_EXTRAS)
|
||||||
# SUBDIRS( BulletXmlImportDemo ConcaveDemo ConstraintDemo ConvexDecompositionDemo SerializeDemo )
|
SUBDIRS( BulletXmlImportDemo ConcaveDemo ConvexDecompositionDemo SerializeDemo )
|
||||||
# ENDIF()
|
ENDIF()
|
||||||
SET(SharedDemoSubdirs
|
SET(SharedDemoSubdirs
|
||||||
OpenGL
|
OpenGL
|
||||||
CcdPhysicsDemo ConstraintDemo SliderConstraintDemo GenericJointDemo Raytracer
|
CcdPhysicsDemo ConstraintDemo SliderConstraintDemo GenericJointDemo Raytracer
|
||||||
@@ -46,7 +46,7 @@ IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
|||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
TARGET AppCharacterDemo
|
TARGET AppCharacterDemo
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/ObsoleteDemos/BspDemo/BspDemo.bsp ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/BspDemo/BspDemo.bsp ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
|
||||||
@@ -101,35 +101,30 @@ void CharacterDemo::initPhysics()
|
|||||||
btTransform tr;
|
btTransform tr;
|
||||||
tr.setIdentity();
|
tr.setIdentity();
|
||||||
|
|
||||||
const char* bspfilename = "BspDemo.bsp";
|
const char* filename = "BspDemo.bsp";
|
||||||
|
|
||||||
|
const char* prefix[]={"./","../","../../","../../../","../../../../", "BspDemo/", "Demos/BspDemo/",
|
||||||
|
"../Demos/BspDemo/","../../Demos/BspDemo/"};
|
||||||
|
int numPrefixes = sizeof(prefix)/sizeof(const char*);
|
||||||
|
char relativeFileName[1024];
|
||||||
|
FILE* file=0;
|
||||||
|
|
||||||
|
for (int i=0;i<numPrefixes;i++)
|
||||||
|
{
|
||||||
|
sprintf(relativeFileName,"%s%s",prefix[i],filename);
|
||||||
|
file = fopen(relativeFileName,"r");
|
||||||
|
if (file)
|
||||||
|
break;
|
||||||
|
}
|
||||||
void* memoryBuffer = 0;
|
void* memoryBuffer = 0;
|
||||||
|
|
||||||
FILE* file = fopen(bspfilename,"r");
|
|
||||||
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
|
|
||||||
bspfilename = "../../BspDemo.bsp";
|
|
||||||
file = fopen(bspfilename,"r");
|
|
||||||
}
|
|
||||||
if (!file)
|
|
||||||
{
|
|
||||||
//visual studio leaves the current working directory in the projectfiles folder
|
|
||||||
bspfilename = "BspDemo.bsp";
|
|
||||||
file = fopen(bspfilename,"r");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
BspLoader bspLoader;
|
BspLoader bspLoader;
|
||||||
int size=0;
|
int size=0;
|
||||||
if (fseek(file, 0, SEEK_END) || (size = ftell(file)) == EOF || fseek(file, 0, SEEK_SET)) { /* File operations denied? ok, just close and return failure */
|
if (fseek(file, 0, SEEK_END) || (size = ftell(file)) == EOF || fseek(file, 0, SEEK_SET)) { /* File operations denied? ok, just close and return failure */
|
||||||
printf("Error: cannot get filesize from %s\n", bspfilename);
|
printf("Error: cannot get filesize from %s\n", filename);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
//how to detect file size?
|
//how to detect file size?
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# This is basically the overall name of the project in Visual Studio this is the name of the Solution File
|
# This is basically the overall name of the project in Visual Studio this is the name of the Solution File
|
||||||
|
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
|||||||
TARGET AppConvexDecompositionDemo
|
TARGET AppConvexDecompositionDemo
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/SerializeDemo/testFile.bullet ${CMAKE_CURRENT_BINARY_DIR}/testFile.bullet
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/SerializeDemo/testFile.bullet ${CMAKE_CURRENT_BINARY_DIR}/testFile.bullet
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/file.obj ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/ConvexDecompositionDemo/file.obj ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
|
||||||
@@ -178,20 +178,19 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
|
|
||||||
ConvexDecomposition::WavefrontObj wo;
|
ConvexDecomposition::WavefrontObj wo;
|
||||||
|
|
||||||
tcount = wo.loadObj(filename);
|
tcount = 0;
|
||||||
|
const char* prefix[]={"./","../","../../","../../../","../../../../", "ConvexDecompositionDemo/", "Demos/ConvexDecompositionDemo/",
|
||||||
if (!tcount)
|
"../Demos/ConvexDecompositionDemo/","../../Demos/ConvexDecompositionDemo/"};
|
||||||
{
|
int numPrefixes = sizeof(prefix)/sizeof(const char*);
|
||||||
//when running this app from visual studio, the default starting folder is different, so make a second attempt...
|
char relativeFileName[1024];
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
for (int i=0;i<numPrefixes;i++)
|
||||||
|
{
|
||||||
|
sprintf(relativeFileName,"%s%s",prefix[i],filename);
|
||||||
|
tcount = wo.loadObj(relativeFileName);
|
||||||
|
if (tcount)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3578
Demos/ConvexDecompositionDemo/file.obj
Normal file
3578
Demos/ConvexDecompositionDemo/file.obj
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user