diff --git a/Demos/CcdPhysicsDemo/ibmsdk/Makefile b/Demos/CcdPhysicsDemo/ibmsdk/Makefile index 9ddf87a54..846bd25ad 100755 --- a/Demos/CcdPhysicsDemo/ibmsdk/Makefile +++ b/Demos/CcdPhysicsDemo/ibmsdk/Makefile @@ -26,13 +26,23 @@ PROGRAM_ppu := CcdPhysicsDemo ###################################################################### OBJS = CcdPhysicsDemo.o main.o -CELL_TOP ?= /opt/ibm/cell-sdk/prototype +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + CELL_SYSROOT = /opt/cell/sysroot + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + CELL_SYSROOT = $(CELL_TOP)/sysroot + include $(CELL_TOP)/make.footer +endif ######################################################################## # Libraries, Include paths, Defines ######################################################################## INCLUDE = -DUSE_LIBSPE2 \ - -I$(CELL_TOP)/sysroot/usr/include \ + -I$(CELL_SYSROOT)/usr/include \ -I../ \ -I$(ROOT)/src \ -I$(ROOT)/Demos/OpenGL \ @@ -55,7 +65,6 @@ INSTALL_FILES = $(PROGRAM_ppu) ######################################################################## -include $(CELL_TOP)/make.footer $(PPMS): cp textures/$@ . diff --git a/Demos/CellSpuDemo/BasicDemo2.cpp b/Demos/CellSpuDemo/BasicDemo2.cpp index 53d4edb6a..0a0d8e9bd 100644 --- a/Demos/CellSpuDemo/BasicDemo2.cpp +++ b/Demos/CellSpuDemo/BasicDemo2.cpp @@ -90,13 +90,9 @@ void BasicDemo::clientMoveAndDisplay() if (ms > minFPS) ms = minFPS; - printf("step\n"); - if (m_dynamicsWorld) m_dynamicsWorld->stepSimulation(ms / 1000000.f); - printf("step finished\n"); - renderme(); glFlush(); @@ -175,6 +171,8 @@ void BasicDemo::initPhysics() #else m_dispatcher = new btCollisionDispatcher(collisionConfiguration); #endif //USE_PARALLEL_DISPATCHER + m_collisionConfiguration = new btDefaultCollisionConfiguration(); + #define USE_SWEEP_AND_PRUNE 1 #ifdef USE_SWEEP_AND_PRUNE @@ -200,7 +198,7 @@ void BasicDemo::initPhysics() sol->setSolverMode(btSequentialImpulseConstraintSolver::SOLVER_RANDMIZE_ORDER); m_dynamicsWorld = new btSimpleDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver); #else - m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver); + m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration); #endif //USE_SIMPLE_DYNAMICS_WORLD m_dynamicsWorld->getDispatchInfo().m_enableSPU = true; @@ -288,7 +286,7 @@ void BasicDemo::exitPhysics() //delete dispatcher delete m_dispatcher; - + delete m_collisionConfiguration; } diff --git a/Demos/CellSpuDemo/BasicDemo2.h b/Demos/CellSpuDemo/BasicDemo2.h index 2f36266ab..b530c6292 100644 --- a/Demos/CellSpuDemo/BasicDemo2.h +++ b/Demos/CellSpuDemo/BasicDemo2.h @@ -34,7 +34,7 @@ class BasicDemo : public DemoApplication btBroadphaseInterface* m_overlappingPairCache; btCollisionDispatcher* m_dispatcher; - + btDefaultCollisionConfiguration* m_collisionConfiguration; btConstraintSolver* m_solver; btCollisionAlgorithmCreateFunc* m_sphereSphereCF; diff --git a/Demos/CellSpuDemo/ibmsdk/Makefile b/Demos/CellSpuDemo/ibmsdk/Makefile index d4bd6e24a..cdc1351d4 100755 --- a/Demos/CellSpuDemo/ibmsdk/Makefile +++ b/Demos/CellSpuDemo/ibmsdk/Makefile @@ -51,9 +51,17 @@ INSTALL_FILES = $(PROGRAM_ppu) # make.footer ######################################################################## -CELL_TOP ?= /opt/ibm/cell-sdk/prototype -include $(CELL_TOP)/make.footer +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif + $(PPMS): cp textures/$@ . diff --git a/Demos/CollisionDemo/ibmsdk/Makefile b/Demos/CollisionDemo/ibmsdk/Makefile index 67cd72830..e7c929f33 100755 --- a/Demos/CollisionDemo/ibmsdk/Makefile +++ b/Demos/CollisionDemo/ibmsdk/Makefile @@ -50,9 +50,15 @@ INSTALL_FILES = $(PROGRAM_ppu) # make.footer ######################################################################## -CELL_TOP ?= /opt/ibm/cell-sdk/prototype +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) -include $(CELL_TOP)/make.footer +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif $(PPMS): cp textures/$@ . diff --git a/Demos/OpenGL/ibmsdk/Makefile b/Demos/OpenGL/ibmsdk/Makefile index b21039e13..ee1962e13 100644 --- a/Demos/OpenGL/ibmsdk/Makefile +++ b/Demos/OpenGL/ibmsdk/Makefile @@ -32,5 +32,13 @@ RenderTexture.o #### Install directories INSTALL_DIR = $(ROOT)/lib/ibmsdk/ INSTALL_FILES = $(LIBRARY) -CELL_TOP ?= /opt/ibm/cell-sdk/prototype -include $(CELL_TOP)/make.footer + +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif diff --git a/Extras/BulletMultiThreaded/Makefile b/Extras/BulletMultiThreaded/Makefile index aae5ac8f3..08ee49d91 100644 --- a/Extras/BulletMultiThreaded/Makefile +++ b/Extras/BulletMultiThreaded/Makefile @@ -4,13 +4,25 @@ __ARCH_BITS__ := 32 NARROWPHASEDIR=./SpuNarrowPhaseCollisionTask SPU_TASKFILE=$(NARROWPHASEDIR)/SpuGatheringCollisionTask +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + CELL_SYSROOT := /opt/cell/sysroot + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + CELL_SYSROOT := $(CELL_TOP)/sysroot + include $(CELL_TOP)/make.footer +endif + + RM=rm -f OUTDIR=./out DEBUGFLAG=-DNDEBUG LIBOUTDIR=../../lib/ibmsdk COLLISIONDIR=../../src/BulletCollision MATHDIR=../../src/LinearMath -CELLSDKDIR=/opt/ibm/cell-sdk ARCHITECTUREFLAG=-m$(__ARCH_BITS__) ifeq "$(__ARCH_BITS__)" "64" SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ -DUSE_ADDR64 @@ -18,7 +30,7 @@ else SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ endif SPU_GCC=/usr/bin/spu-gcc -SPU_INCLUDEDIR= -I. -I$(CELLSDKDIR)/prototype/sysroot/usr/spu/include -I../../src -I$(NARROWPHASEDIR) +SPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/spu/include -I../../src -I$(NARROWPHASEDIR) #SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -Os -c -include spu_intrinsics.h -include stdbool.h SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -O3 -mbranch-hints -fomit-frame-pointer -ftree-vectorize -finline-functions -ftree-vect-loop-version -ftree-loop-optimize -ffast-math -fno-rtti -fno-exceptions -c -include spu_intrinsics.h -include stdbool.h @@ -37,9 +49,9 @@ else endif PPU_CFLAGS= $(ARCHITECTUREFLAG) $(DEBUGFLAG) -W -Wall -Winline -O3 -c -mabi=altivec -maltivec -include altivec.h -include stdbool.h -PPU_INCLUDEDIR= -I. -I$(CELLSDKDIR)/prototype/sysroot/usr/include -I../../src -I$(NARROWPHASEDIR) +PPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/include -I../../src -I$(NARROWPHASEDIR) PPU_LFLAGS= $(ARCHITECTUREFLAG) -Wl,-m,elf$(__ARCH_BITS__)ppc -PPU_LIBRARIES= -lstdc++ -lsupc++ -lgcc -lgcov -lspe2 -lpthread -L../../lib/ibmsdk -lbulletcollision -lbulletdynamics -lbulletmath -L$(CELLSDKDIR)/prototype/sysroot/usr/lib$(__ARCH_BITS__) -R$(CELLSDKDIR)/prototype/sysroot/usr/lib +PPU_LIBRARIES= -lstdc++ -lsupc++ -lgcc -lgcov -lspe2 -lpthread -L../../lib/ibmsdk -lbulletcollision -lbulletdynamics -lbulletmath -L$(CELL_SYSROOT)/usr/lib$(__ARCH_BITS__) -R$(CELL_SYSROOT)/usr/lib PPU_AR=/usr/bin/ar MakeOut : diff --git a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp index b8486d8cc..a99a284ed 100644 --- a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp +++ b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp @@ -760,7 +760,7 @@ SIMD_FORCE_INLINE int getShapeTypeSize(int shapeType) default: btAssert(0); //unsupported shapetype, please add here - break; + return 0; } } diff --git a/Extras/BulletMultiThreaded/btThreadSupportInterface.cpp b/Extras/BulletMultiThreaded/btThreadSupportInterface.cpp index 02c0e6d14..8192aa468 100644 --- a/Extras/BulletMultiThreaded/btThreadSupportInterface.cpp +++ b/Extras/BulletMultiThreaded/btThreadSupportInterface.cpp @@ -18,4 +18,5 @@ subject to the following restrictions: btThreadSupportInterface::~btThreadSupportInterface() { -} \ No newline at end of file +} + diff --git a/Extras/BulletMultiThreaded/btThreadSupportInterface.h b/Extras/BulletMultiThreaded/btThreadSupportInterface.h index 27ac4f8a0..5d4a0162d 100644 --- a/Extras/BulletMultiThreaded/btThreadSupportInterface.h +++ b/Extras/BulletMultiThreaded/btThreadSupportInterface.h @@ -39,4 +39,5 @@ public: virtual void stopSPU()=0; }; -#endif //THREAD_SUPPORT_INTERFACE_H \ No newline at end of file +#endif //THREAD_SUPPORT_INTERFACE_H + diff --git a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h index f0b1ce58d..763578bd3 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h +++ b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h @@ -70,6 +70,7 @@ public: btPersistentManifold(void* body0,void* body1,int bla) : m_body0(body0),m_body1(body1),m_cachedPoints(0) { + (void)bla; } SIMD_FORCE_INLINE void* getBody0() { return m_body0;} diff --git a/src/BulletCollision/ibmsdk/Makefile b/src/BulletCollision/ibmsdk/Makefile index ad04ef1d2..7f3aab3f0 100644 --- a/src/BulletCollision/ibmsdk/Makefile +++ b/src/BulletCollision/ibmsdk/Makefile @@ -91,5 +91,14 @@ btUniformScalingShape.o #### Install directories INSTALL_DIR = $(ROOT)/lib/ibmsdk INSTALL_FILES = $(LIBRARY_ppu) -CELL_TOP ?= /opt/ibm/cell-sdk/prototype -include $(CELL_TOP)/make.footer + +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif + diff --git a/src/BulletDynamics/ibmsdk/Makefile b/src/BulletDynamics/ibmsdk/Makefile index b599a0fd9..57505d835 100644 --- a/src/BulletDynamics/ibmsdk/Makefile +++ b/src/BulletDynamics/ibmsdk/Makefile @@ -40,6 +40,14 @@ btWheelInfo.o #### Install directories INSTALL_DIR = $(ROOT)/lib/ibmsdk INSTALL_FILES = $(LIBRARY_ppu) -CELL_TOP ?= /opt/ibm/cell-sdk/prototype -include $(CELL_TOP)/make.footer +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif + diff --git a/src/LinearMath/ibmsdk/Makefile b/src/LinearMath/ibmsdk/Makefile index 3642abd3a..a80570aea 100644 --- a/src/LinearMath/ibmsdk/Makefile +++ b/src/LinearMath/ibmsdk/Makefile @@ -26,5 +26,14 @@ btQuickprof.o #### Install directories INSTALL_DIR = $(ROOT)/lib/ibmsdk INSTALL_FILES = $(LIBRARY_ppu) -CELL_TOP ?= /opt/ibm/cell-sdk/prototype -include $(CELL_TOP)/make.footer + +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif + diff --git a/src/ibmsdk/Makefile b/src/ibmsdk/Makefile index 768fffd35..1a0453eef 100644 --- a/src/ibmsdk/Makefile +++ b/src/ibmsdk/Makefile @@ -1,10 +1,16 @@ #### Visit Bullet library ibmsdk dirs and build code -CELL_TOP ?= /opt/ibm/cell-sdk/prototype -DIRS := \ -../BulletCollision/ibmsdk \ -../BulletDynamics/ibmsdk \ +DIRS := \ +../BulletCollision/ibmsdk \ +../BulletDynamics/ibmsdk \ ../LinearMath/ibmsdk +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) -include $(CELL_TOP)/make.footer +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif