Fix a lot of warnings, thanks to ejtttje, Fixes issue 537

Fix soft body debug rendering
This commit is contained in:
erwin.coumans
2011-09-15 01:17:34 +00:00
parent 0c01816375
commit a13d22dc84
26 changed files with 80 additions and 74 deletions

View File

@@ -312,7 +312,7 @@ void SimulationLoop()
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
{
btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i];
if (softWorld->getDebugDrawer() && !softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))
if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)))
{
btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer());
btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags());

View File

@@ -63,7 +63,7 @@ void initCL( void* glCtx, void* glDC )
break;
default:
printf("createContextFromType(unknown device type %d\n",deviceType);
printf("createContextFromType(unknown device type %d\n",(int)deviceType);
};
//#endif

View File

@@ -50,7 +50,7 @@ subject to the following restrictions:
#define LOAD_FROM_MEMORY
#ifdef LOAD_FROM_MEMORY
#define MSTRINGIFY(A) #A
static char* source=
static const char* source=
#include "ParticlesOCL.cl"
#endif //LOAD_FROM_MEMORY
@@ -363,7 +363,7 @@ void btParticlesDynamicsWorld::initCLKernels(int argc, char** argv)
printf("OpenCL compiles ParticlesOCL.cl ... ");
#else
char* fileName = "ParticlesOCL.cl";
const char* fileName = "ParticlesOCL.cl";
FILE * fp = fopen(fileName, "rb");
char newFileName[512];
@@ -426,7 +426,7 @@ void btParticlesDynamicsWorld::initCLKernels(int argc, char** argv)
// Build the program with 'mad' Optimization option
#ifdef MAC
char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -cl-mad-enable -DMAC -DGUID_ARG";
const char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -cl-mad-enable -DMAC -DGUID_ARG";
#else
const char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -DGUID_ARG= ";
#endif
@@ -1024,7 +1024,7 @@ void btParticlesDynamicsWorld::runFindCellStartKernel()
}
void btParticlesDynamicsWorld::initKernel(int kernelId, char* pName)
void btParticlesDynamicsWorld::initKernel(int kernelId, const char* pName)
{
cl_int ciErrNum;

View File

@@ -78,7 +78,7 @@ struct btKernelInfo
{
int m_Id;
cl_kernel m_kernel;
char* m_name;
const char* m_name;
int m_workgroupSize;
};
@@ -168,7 +168,7 @@ public:
void runFindCellStartKernel();
void runCollideParticlesKernel();
void initKernel(int kernelId, char* pName);
void initKernel(int kernelId, const char* pName);
void runKernelWithWorkgroupSize(int kernelId, int globalSize);
void bitonicSortNv(cl_mem pKey, unsigned int batch, unsigned int arrayLength, unsigned int dir);

View File

@@ -431,7 +431,6 @@ public:
if (sbp && *sbp)
{
btSoftBody* sb = *sbp;
int i;
for (int i=0;i<softBodyData->m_numJoints;i++)
{
btSoftBodyJointData* sbjoint = &softBodyData->m_joints[i];
@@ -625,7 +624,7 @@ void SerializeDemo::initPhysics()
btDefaultSerializer* serializer = new btDefaultSerializer(maxSerializeBufferSize);
static char* groundName = "GroundName";
static const char* groundName = "GroundName";
serializer->registerNameForPointer(groundObject, groundName);
for (int i=0;i<m_collisionShapes.size();i++)

View File

@@ -18,7 +18,7 @@ subject to the following restrictions:
#include "btOclCommon.h"
static char* spPlatformVendor =
static const char* spPlatformVendor =
#if defined(CL_PLATFORM_MINI_CL)
"MiniCL, SCEA";
#elif defined(CL_PLATFORM_INTEL)

View File

@@ -255,17 +255,17 @@ void btOclPrintDevInfo(cl_device_id device)
// CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
size_t workitem_dims;
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(workitem_dims), &workitem_dims, NULL);
printf(" CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:\t%u\n", workitem_dims);
printf(" CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:\t%zu\n", workitem_dims);
// CL_DEVICE_MAX_WORK_ITEM_SIZES
size_t workitem_size[3];
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(workitem_size), &workitem_size, NULL);
printf(" CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%u / %u / %u \n", workitem_size[0], workitem_size[1], workitem_size[2]);
printf(" CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%zu / %zu / %zu \n", workitem_size[0], workitem_size[1], workitem_size[2]);
// CL_DEVICE_MAX_WORK_GROUP_SIZE
size_t workgroup_size;
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(workgroup_size), &workgroup_size, NULL);
printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE:\t%u\n", workgroup_size);
printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE:\t%zu\n", workgroup_size);
// CL_DEVICE_MAX_CLOCK_FREQUENCY
cl_uint clock_frequency;
@@ -332,15 +332,15 @@ void btOclPrintDevInfo(cl_device_id device)
size_t szMaxDims[5];
printf("\n CL_DEVICE_IMAGE <dim>");
clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof(size_t), &szMaxDims[0], NULL);
printf("\t\t\t2D_MAX_WIDTH\t %u\n", szMaxDims[0]);
printf("\t\t\t2D_MAX_WIDTH\t %zu\n", szMaxDims[0]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[1], NULL);
printf("\t\t\t\t\t2D_MAX_HEIGHT\t %u\n", szMaxDims[1]);
printf("\t\t\t\t\t2D_MAX_HEIGHT\t %zu\n", szMaxDims[1]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof(size_t), &szMaxDims[2], NULL);
printf("\t\t\t\t\t3D_MAX_WIDTH\t %u\n", szMaxDims[2]);
printf("\t\t\t\t\t3D_MAX_WIDTH\t %zu\n", szMaxDims[2]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[3], NULL);
printf("\t\t\t\t\t3D_MAX_HEIGHT\t %u\n", szMaxDims[3]);
printf("\t\t\t\t\t3D_MAX_HEIGHT\t %zu\n", szMaxDims[3]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof(size_t), &szMaxDims[4], NULL);
printf("\t\t\t\t\t3D_MAX_DEPTH\t %u\n", szMaxDims[4]);
printf("\t\t\t\t\t3D_MAX_DEPTH\t %zu\n", szMaxDims[4]);
// CL_DEVICE_EXTENSIONS: get device extensions, and if any then parse & log the string onto separate lines
clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(device_string), &device_string, NULL);

View File

@@ -1539,11 +1539,16 @@ void SoftDemo::renderme()
glDisable(GL_LIGHTING);
m_dynamicsWorld->debugDrawWorld();
int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1;
btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld;
btIDebugDraw* sdraw = softWorld ->getDebugDrawer();
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
{
btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i];
if (softWorld->getDebugDrawer() && !softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))
if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)))
{
btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer());
btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags());

View File

@@ -29,10 +29,10 @@ size_t wgSize;
#ifndef USE_MINICL
#define MSTRINGIFY(A) #A
char* stringifiedSourceCL =
const char* stringifiedSourceCL =
#include "VectorAddKernels.cl"
#else
char* stringifiedSourceCL = "";
const char* stringifiedSourceCL = "";
#endif
@@ -103,7 +103,7 @@ void printDevInfo(cl_device_id device)
// CL_DEVICE_MAX_WORK_GROUP_SIZE
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(workitem_size), &workitem_size, NULL);
printf( " CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%d / %d / %d \n", workitem_size[0], workitem_size[1], workitem_size[2]);
printf( " CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%zu / %zu / %zu \n", workitem_size[0], workitem_size[1], workitem_size[2]);
}
@@ -226,9 +226,9 @@ int main(int argc, char **argv)
const char* cPathAndName = cSourceFile;
#ifdef LOAD_FROM_FILE
size_t szKernelLength;
char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength);
const char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength);
#else
char* cSourceCL = stringifiedSourceCL;
const char* cSourceCL = stringifiedSourceCL;
size_t szKernelLength = strlen(stringifiedSourceCL);
#endif //LOAD_FROM_FILE

View File

@@ -87,11 +87,11 @@ btScalar suspensionRestLength(0.6);
VehicleDemo::VehicleDemo()
:
m_carChassis(0),
m_indexVertexArrays(0),
m_vertices(0),
m_cameraHeight(4.f),
m_minCameraDistance(3.f),
m_maxCameraDistance(10.f),
m_indexVertexArrays(0),
m_vertices(0)
m_maxCameraDistance(10.f)
{
m_vehicle = 0;
m_wheelShape = 0;