Fix a lot of warnings, thanks to ejtttje, Fixes issue 537
Fix soft body debug rendering
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -2155,7 +2155,7 @@ public:
|
||||
void set_text( const char *text );
|
||||
const char *get_text( void ) { return text.c_str(); }
|
||||
|
||||
void dump( FILE *out, char *text );
|
||||
void dump( FILE *out, const char *text );
|
||||
void set_tab_w(int w) { tab_width = w; }
|
||||
void set_start_line(int l) { start_line = l; }
|
||||
static void scrollbar_callback(GLUI_Control*);
|
||||
|
||||
@@ -931,7 +931,7 @@ int GLUI_EditText::special_handler( int key,int modifiers )
|
||||
int GLUI_EditText::find_word_break( int start, int direction )
|
||||
{
|
||||
int i, j;
|
||||
char *breaks = " :-.,";
|
||||
const char *breaks = " :-.,";
|
||||
int num_break_chars = (int)strlen(breaks), text_len = (int)text.length();
|
||||
int new_pt;
|
||||
|
||||
|
||||
@@ -1065,10 +1065,10 @@ void GLUI_TextBox::set_text( const char *new_text )
|
||||
|
||||
/*************************************** GLUI_TextBox::dump() **************/
|
||||
|
||||
void GLUI_TextBox::dump( FILE *out, char *name )
|
||||
void GLUI_TextBox::dump( FILE *out, const char *name )
|
||||
{
|
||||
fprintf( out,
|
||||
"%s (edittext@%p): line:%d ins_pt:%d subs:%d/%d sel:%d/%d len:%d\n",
|
||||
"%s (edittext@%p): line:%d ins_pt:%d subs:%d/%d sel:%d/%d len:%zu\n",
|
||||
name, this, curr_line,
|
||||
insertion_pt, substring_start, substring_end, sel_start, sel_end,
|
||||
text.length());
|
||||
|
||||
@@ -1414,7 +1414,7 @@ void btCollisionWorld::debugDrawWorld()
|
||||
}
|
||||
}
|
||||
|
||||
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
|
||||
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb)))
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1423,7 +1423,7 @@ void btCollisionWorld::debugDrawWorld()
|
||||
btCollisionObject* colObj = m_collisionObjects[i];
|
||||
if ((colObj->getCollisionFlags() & btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT)==0)
|
||||
{
|
||||
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
|
||||
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe))
|
||||
{
|
||||
btVector3 color(btScalar(1.),btScalar(1.),btScalar(1.));
|
||||
switch(colObj->getActivationState())
|
||||
|
||||
@@ -37,15 +37,15 @@ subject to the following restrictions:
|
||||
btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB,
|
||||
const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA)
|
||||
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
m_limit(),
|
||||
#endif
|
||||
m_angularOnly(false),
|
||||
m_enableAngularMotor(false),
|
||||
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
|
||||
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
|
||||
m_useReferenceFrameA(useReferenceFrameA),
|
||||
m_flags(0)
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
,m_limit()
|
||||
#endif
|
||||
{
|
||||
m_rbAFrame.getOrigin() = pivotInA;
|
||||
|
||||
@@ -93,14 +93,15 @@ btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const bt
|
||||
|
||||
|
||||
btHingeConstraint::btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA)
|
||||
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA), m_angularOnly(false), m_enableAngularMotor(false),
|
||||
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
m_limit(),
|
||||
#endif
|
||||
m_angularOnly(false), m_enableAngularMotor(false),
|
||||
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
|
||||
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
|
||||
m_useReferenceFrameA(useReferenceFrameA),
|
||||
m_flags(0)
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
,m_limit()
|
||||
#endif
|
||||
{
|
||||
|
||||
// since no frame is given, assume this to be zero angle and just pick rb transform axis
|
||||
@@ -142,15 +143,15 @@ m_flags(0)
|
||||
btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB,
|
||||
const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA)
|
||||
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame),
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
m_limit(),
|
||||
#endif
|
||||
m_angularOnly(false),
|
||||
m_enableAngularMotor(false),
|
||||
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
|
||||
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
|
||||
m_useReferenceFrameA(useReferenceFrameA),
|
||||
m_flags(0)
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
,m_limit()
|
||||
#endif
|
||||
{
|
||||
#ifndef _BT_USE_CENTER_LIMIT_
|
||||
//start with free
|
||||
@@ -168,15 +169,15 @@ m_flags(0)
|
||||
|
||||
btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFrame, bool useReferenceFrameA)
|
||||
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),m_rbAFrame(rbAFrame),m_rbBFrame(rbAFrame),
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
m_limit(),
|
||||
#endif
|
||||
m_angularOnly(false),
|
||||
m_enableAngularMotor(false),
|
||||
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
|
||||
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
|
||||
m_useReferenceFrameA(useReferenceFrameA),
|
||||
m_flags(0)
|
||||
#ifdef _BT_USE_CENTER_LIMIT_
|
||||
,m_limit()
|
||||
#endif
|
||||
{
|
||||
///not providing rigidbody B means implicitly using worldspace for body B
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rb
|
||||
:btTypedObject(type),
|
||||
m_userConstraintType(-1),
|
||||
m_userConstraintId(-1),
|
||||
m_breakingImpulseThreshold(SIMD_INFINITY),
|
||||
m_isEnabled(true),
|
||||
m_needsFeedback(false),
|
||||
m_rbA(rbA),
|
||||
m_rbB(getFixedBody()),
|
||||
m_appliedImpulse(btScalar(0.)),
|
||||
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
|
||||
m_breakingImpulseThreshold(SIMD_INFINITY),
|
||||
m_isEnabled(true)
|
||||
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rb
|
||||
:btTypedObject(type),
|
||||
m_userConstraintType(-1),
|
||||
m_userConstraintId(-1),
|
||||
m_breakingImpulseThreshold(SIMD_INFINITY),
|
||||
m_isEnabled(true),
|
||||
m_needsFeedback(false),
|
||||
m_rbA(rbA),
|
||||
m_rbB(rbB),
|
||||
m_appliedImpulse(btScalar(0.)),
|
||||
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
|
||||
m_breakingImpulseThreshold(SIMD_INFINITY),
|
||||
m_isEnabled(true)
|
||||
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ void btDiscreteDynamicsWorld::debugDrawWorld()
|
||||
|
||||
|
||||
|
||||
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
|
||||
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb)))
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
struct ThreadConstructionInfo
|
||||
{
|
||||
ThreadConstructionInfo(char* uniqueName,
|
||||
ThreadConstructionInfo(const char* uniqueName,
|
||||
PosixThreadFunc userThreadFunc,
|
||||
PosixlsMemorySetupFunc lsMemoryFunc,
|
||||
int numThreads=1,
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
char* m_uniqueName;
|
||||
const char* m_uniqueName;
|
||||
PosixThreadFunc m_userThreadFunc;
|
||||
PosixlsMemorySetupFunc m_lsMemoryFunc;
|
||||
int m_numThreads;
|
||||
|
||||
@@ -51,7 +51,7 @@ private:
|
||||
public:
|
||||
struct SequentialThreadConstructionInfo
|
||||
{
|
||||
SequentialThreadConstructionInfo (char* uniqueName,
|
||||
SequentialThreadConstructionInfo (const char* uniqueName,
|
||||
SequentialThreadFunc userThreadFunc,
|
||||
SequentiallsMemorySetupFunc lsMemoryFunc
|
||||
)
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
char* m_uniqueName;
|
||||
const char* m_uniqueName;
|
||||
SequentialThreadFunc m_userThreadFunc;
|
||||
SequentiallsMemorySetupFunc m_lsMemoryFunc;
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
struct Win32ThreadConstructionInfo
|
||||
{
|
||||
Win32ThreadConstructionInfo(char* uniqueName,
|
||||
Win32ThreadConstructionInfo(const char* uniqueName,
|
||||
Win32ThreadFunc userThreadFunc,
|
||||
Win32lsMemorySetupFunc lsMemoryFunc,
|
||||
int numThreads=1,
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
char* m_uniqueName;
|
||||
const char* m_uniqueName;
|
||||
Win32ThreadFunc m_userThreadFunc;
|
||||
Win32lsMemorySetupFunc m_lsMemoryFunc;
|
||||
int m_numThreads;
|
||||
|
||||
@@ -22,7 +22,7 @@ subject to the following restrictions:
|
||||
|
||||
//
|
||||
btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo,int node_count, const btVector3* x, const btScalar* m)
|
||||
:m_worldInfo(worldInfo),m_softBodySolver(0)
|
||||
:m_softBodySolver(0),m_worldInfo(worldInfo)
|
||||
{
|
||||
/* Init */
|
||||
initDefaults();
|
||||
|
||||
@@ -95,7 +95,7 @@ void btSoftBodyTriangleCallback::processTriangle(btVector3* triangle,int partId,
|
||||
ci.m_dispatcher1 = m_dispatcher;
|
||||
|
||||
///debug drawing of the overlapping triangles
|
||||
if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe)
|
||||
if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && (m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe))
|
||||
{
|
||||
btVector3 color(1,1,0);
|
||||
btTransform& tr = ob->getWorldTransform();
|
||||
|
||||
@@ -165,7 +165,7 @@ void btSoftRigidDynamicsWorld::debugDrawWorld()
|
||||
for ( i=0;i<this->m_softBodies.size();i++)
|
||||
{
|
||||
btSoftBody* psb=(btSoftBody*)this->m_softBodies[i];
|
||||
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))
|
||||
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)))
|
||||
{
|
||||
btSoftBodyHelpers::DrawFrame(psb,m_debugDrawer);
|
||||
btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags);
|
||||
|
||||
@@ -35,8 +35,8 @@ subject to the following restrictions:
|
||||
|
||||
//#define DEBUG_MINICL_KERNELS 1
|
||||
|
||||
static char* spPlatformID = "MiniCL, SCEA";
|
||||
static char* spDriverVersion= "1.0";
|
||||
static const char* spPlatformID = "MiniCL, SCEA";
|
||||
static const char* spDriverVersion= "1.0";
|
||||
|
||||
CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs(
|
||||
cl_uint num_entries,
|
||||
@@ -49,7 +49,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs(
|
||||
{
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
*((char**)platforms) = spPlatformID;
|
||||
*((const char**)platforms) = spPlatformID;
|
||||
}
|
||||
if(num_platforms != NULL)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetDeviceInfo(
|
||||
case CL_DEVICE_NAME:
|
||||
{
|
||||
char deviceName[] = "MiniCL CPU";
|
||||
unsigned int nameLen = strlen(deviceName)+1;
|
||||
unsigned int nameLen = (unsigned int)strlen(deviceName)+1;
|
||||
btAssert(param_value_size>strlen(deviceName));
|
||||
if (nameLen < param_value_size)
|
||||
{
|
||||
@@ -484,13 +484,13 @@ CL_API_ENTRY cl_int CL_API_CALL clSetKernelArg(cl_kernel clKernel ,
|
||||
btAssert(arg_size <= MINICL_MAX_ARGLENGTH);
|
||||
if (arg_index>MINI_CL_MAX_ARG)
|
||||
{
|
||||
printf("error: clSetKernelArg arg_index (%d) exceeds %d\n",arg_index,MINI_CL_MAX_ARG);
|
||||
printf("error: clSetKernelArg arg_index (%u) exceeds %u\n",arg_index,MINI_CL_MAX_ARG);
|
||||
} else
|
||||
{
|
||||
if (arg_size>MINICL_MAX_ARGLENGTH)
|
||||
//if (arg_size != MINICL_MAX_ARGLENGTH)
|
||||
{
|
||||
printf("error: clSetKernelArg argdata too large: %d (maximum is %d)\n",arg_size,MINICL_MAX_ARGLENGTH);
|
||||
printf("error: clSetKernelArg argdata too large: %zu (maximum is %zu)\n",arg_size,MINICL_MAX_ARGLENGTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -644,7 +644,7 @@ CL_API_ENTRY cl_context CL_API_CALL clCreateContextFromType(cl_context_propertie
|
||||
gMiniCLNumOutstandingTasks = maxNumOutstandingTasks;
|
||||
const int maxNumOfThreadSupports = 8;
|
||||
static int sUniqueThreadSupportIndex = 0;
|
||||
static char* sUniqueThreadSupportName[maxNumOfThreadSupports] =
|
||||
static const char* sUniqueThreadSupportName[maxNumOfThreadSupports] =
|
||||
{
|
||||
"MiniCL_0", "MiniCL_1", "MiniCL_2", "MiniCL_3", "MiniCL_4", "MiniCL_5", "MiniCL_6", "MiniCL_7"
|
||||
};
|
||||
@@ -660,8 +660,9 @@ CL_API_ENTRY cl_context CL_API_CALL clCreateContextFromType(cl_context_propertie
|
||||
|
||||
#if _WIN32
|
||||
btAssert(sUniqueThreadSupportIndex < maxNumOfThreadSupports);
|
||||
const char* bla = "MiniCL";
|
||||
threadSupport = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
|
||||
// "MiniCL",
|
||||
// bla,
|
||||
sUniqueThreadSupportName[sUniqueThreadSupportIndex++],
|
||||
processMiniCLTask, //processCollisionTask,
|
||||
createMiniCLLocalStoreMemory,//createCollisionLocalStoreMemory,
|
||||
|
||||
@@ -478,12 +478,12 @@ void MiniCLKernel::updateLauncher()
|
||||
struct MiniCLKernelDescEntry
|
||||
{
|
||||
void* pCode;
|
||||
char* pName;
|
||||
const char* pName;
|
||||
};
|
||||
static MiniCLKernelDescEntry spKernelDesc[256];
|
||||
static int sNumKernelDesc = 0;
|
||||
|
||||
MiniCLKernelDesc::MiniCLKernelDesc(void* pCode, char* pName)
|
||||
MiniCLKernelDesc::MiniCLKernelDesc(void* pCode, const char* pName)
|
||||
{
|
||||
for(int i = 0; i < sNumKernelDesc; i++)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
struct MiniCLKernelDesc
|
||||
{
|
||||
MiniCLKernelDesc(void* pCode, char* pName);
|
||||
MiniCLKernelDesc(void* pCode, const char* pName);
|
||||
};
|
||||
|
||||
#define MINICL_REGISTER(__kernel_func) static MiniCLKernelDesc __kernel_func##Desc((void*)__kernel_func, #__kernel_func);
|
||||
|
||||
Reference in New Issue
Block a user