fix some warnings in MSVC2008
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10563
d7cf8633-e32d-0410-b094-
e92efae38249
crypto->client_idfp[0] = 0;
crypto->server_keyfp[0] = 0;
crypto->server_idfp[0] = 0;
crypto->client_idfp[0] = 0;
crypto->server_keyfp[0] = 0;
crypto->server_idfp[0] = 0;
+ crypto->use_aes = aes != 0;
CLEAR_CDATA;
return Crypto_ClientError(data_out, len_out, "Server insists on plaintext too hard");
}
CLEAR_CDATA;
return Crypto_ClientError(data_out, len_out, "Server insists on plaintext too hard");
}
+ crypto->use_aes = aes != 0;
PutWithNul(&data_out_p, len_out, va("d0pk\\cnt\\2\\id\\%d", CDATA->cdata_id));
if(!qd0_blind_id_authenticate_with_private_id_challenge(CDATA->id, true, false, data_in, len_in, data_out_p, len_out, &status))
PutWithNul(&data_out_p, len_out, va("d0pk\\cnt\\2\\id\\%d", CDATA->cdata_id));
if(!qd0_blind_id_authenticate_with_private_id_challenge(CDATA->id, true, false, data_in, len_in, data_out_p, len_out, &status))
CLEAR_CDATA;
return Crypto_ClientError(data_out, len_out, "Server insists on plaintext too hard");
}
CLEAR_CDATA;
return Crypto_ClientError(data_out, len_out, "Server insists on plaintext too hard");
}
+ crypto->use_aes = aes != 0;
}
PutWithNul(&data_out_p, len_out, va("d0pk\\cnt\\6\\id\\%d", CDATA->cdata_id));
}
PutWithNul(&data_out_p, len_out, va("d0pk\\cnt\\6\\id\\%d", CDATA->cdata_id));
RelativePath=".\console.c"\r
>\r
</File>\r
RelativePath=".\console.c"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\crypto.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="0"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
<File\r
RelativePath=".\csprogs.c"\r
>\r
<File\r
RelativePath=".\csprogs.c"\r
>\r
RelativePath=".\meshqueue.c"\r
>\r
</File>\r
RelativePath=".\meshqueue.c"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_generic.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="0"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_sse.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="0"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
<File\r
RelativePath=".\model_alias.c"\r
>\r
<File\r
RelativePath=".\model_alias.c"\r
>\r
RelativePath=".\console.h"\r
>\r
</File>\r
RelativePath=".\console.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\crypto.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath=".\csprogs.h"\r
>\r
<File\r
RelativePath=".\csprogs.h"\r
>\r
RelativePath=".\meshqueue.h"\r
>\r
</File>\r
RelativePath=".\meshqueue.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_generic.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_sse.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath=".\model_alias.h"\r
>\r
<File\r
RelativePath=".\model_alias.h"\r
>\r
RelativePath=".\console.c"\r
>\r
</File>\r
RelativePath=".\console.c"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\crypto.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="0"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
<File\r
RelativePath=".\csprogs.c"\r
>\r
<File\r
RelativePath=".\csprogs.c"\r
>\r
RelativePath=".\meshqueue.c"\r
>\r
</File>\r
RelativePath=".\meshqueue.c"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_generic.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="0"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_sse.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="0"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
<File\r
RelativePath=".\model_alias.c"\r
>\r
<File\r
RelativePath=".\model_alias.c"\r
>\r
RelativePath=".\console.h"\r
>\r
</File>\r
RelativePath=".\console.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\crypto.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath=".\csprogs.h"\r
>\r
<File\r
RelativePath=".\csprogs.h"\r
>\r
RelativePath=".\meshqueue.h"\r
>\r
</File>\r
RelativePath=".\meshqueue.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_generic.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_sse.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath=".\model_alias.h"\r
>\r
<File\r
RelativePath=".\model_alias.h"\r
>\r
/>\r
</FileConfiguration>\r
</File>\r
/>\r
</FileConfiguration>\r
</File>\r
+ <File\r
+ RelativePath=".\crypto.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="2"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="2"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
<File\r
RelativePath=".\csprogs.c"\r
>\r
<File\r
RelativePath=".\csprogs.c"\r
>\r
/>\r
</FileConfiguration>\r
</File>\r
/>\r
</FileConfiguration>\r
</File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_generic.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="2"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="2"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_sse.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="2"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ CompileAs="2"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
<File\r
RelativePath=".\model_alias.c"\r
>\r
<File\r
RelativePath=".\model_alias.c"\r
>\r
RelativePath=".\console.h"\r
>\r
</File>\r
RelativePath=".\console.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\crypto.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath=".\csprogs.h"\r
>\r
<File\r
RelativePath=".\csprogs.h"\r
>\r
RelativePath=".\meshqueue.h"\r
>\r
</File>\r
RelativePath=".\meshqueue.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_generic.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\mod_skeletal_animatevertices_sse.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath=".\model_alias.h"\r
>\r
<File\r
RelativePath=".\model_alias.h"\r
>\r
void R_Mesh_SetRenderTargetsD3D9(IDirect3DSurface9 *depthsurface, IDirect3DSurface9 *colorsurface0, IDirect3DSurface9 *colorsurface1, IDirect3DSurface9 *colorsurface2, IDirect3DSurface9 *colorsurface3)
{
// LordHavoc: for some weird reason the redundant SetDepthStencilSurface calls are necessary (otherwise the lights fail depth test, as if they were using the shadowmap depth surface and render target still)
void R_Mesh_SetRenderTargetsD3D9(IDirect3DSurface9 *depthsurface, IDirect3DSurface9 *colorsurface0, IDirect3DSurface9 *colorsurface1, IDirect3DSurface9 *colorsurface2, IDirect3DSurface9 *colorsurface3)
{
// LordHavoc: for some weird reason the redundant SetDepthStencilSurface calls are necessary (otherwise the lights fail depth test, as if they were using the shadowmap depth surface and render target still)
-// if (gl_state.d3drt_depthsurface == depthsurface && gl_state.d3drt_colorsurfaces[0] == colorsurface0 && gl_state.d3drt_colorsurfaces[1] == colorsurface1 && gl_state.d3drt_colorsurfaces[2] == colorsurface2 && gl_state.d3drt_colorsurfaces[3] == colorsurface3)
-// return;
+ if (gl_state.d3drt_depthsurface == depthsurface && gl_state.d3drt_colorsurfaces[0] == colorsurface0 && gl_state.d3drt_colorsurfaces[1] == colorsurface1 && gl_state.d3drt_colorsurfaces[2] == colorsurface2 && gl_state.d3drt_colorsurfaces[3] == colorsurface3)
+ return;
gl_state.framebufferobject = depthsurface != gl_state.d3drt_backbufferdepthsurface || colorsurface0 != gl_state.d3drt_backbuffercolorsurface;
gl_state.framebufferobject = depthsurface != gl_state.d3drt_backbufferdepthsurface || colorsurface0 != gl_state.d3drt_backbuffercolorsurface;
-// if (gl_state.d3drt_depthsurface != depthsurface)
+ if (gl_state.d3drt_depthsurface != depthsurface)
{
gl_state.d3drt_depthsurface = depthsurface;
IDirect3DDevice9_SetDepthStencilSurface(vid_d3d9dev, gl_state.d3drt_depthsurface);
{
gl_state.d3drt_depthsurface = depthsurface;
IDirect3DDevice9_SetDepthStencilSurface(vid_d3d9dev, gl_state.d3drt_depthsurface);
"out float4 gl_FragColor : COLOR\n"
")\n"
"{\n"
"out float4 gl_FragColor : COLOR\n"
")\n"
"{\n"
-"// float3 temp = float3(Depth,Depth*(65536.0/255.0),Depth*(16777216.0/255.0));\n"
+"// float4 temp = float4(Depth,Depth*(65536.0/255.0),Depth*(16777216.0/255.0),0.0);\n"
" float4 temp = float4(Depth,Depth*256.0,Depth*65536.0,0.0);\n"
" temp.yz -= floor(temp.yz);\n"
" gl_FragColor = temp;\n"
" float4 temp = float4(Depth,Depth*256.0,Depth*65536.0,0.0);\n"
" temp.yz -= floor(temp.yz);\n"
" gl_FragColor = temp;\n"
if(r_shadow_glossexact.integer)
R_COMPILESHADER_STATICPARM_ENABLE(SHADERSTATICPARM_EXACTSPECULARMATH);
if(r_shadow_glossexact.integer)
R_COMPILESHADER_STATICPARM_ENABLE(SHADERSTATICPARM_EXACTSPECULARMATH);
- return memcmp(r_compileshader_staticparms, r_compileshader_staticparms_save, sizeof(r_compileshader_staticparms));
+ return memcmp(r_compileshader_staticparms, r_compileshader_staticparms_save, sizeof(r_compileshader_staticparms)) != 0;
}
#define R_COMPILESHADER_STATICPARM_EMIT(p, n) \
}
#define R_COMPILESHADER_STATICPARM_EMIT(p, n) \
// add static parms
R_CompileShader_AddStaticParms(mode, permutation);
// add static parms
R_CompileShader_AddStaticParms(mode, permutation);
- memcpy(vertstrings_list + vertstrings_count, shaderstaticparmstrings_list, sizeof(*vertstrings_list) * shaderstaticparms_count);
+ memcpy((char *)(vertstrings_list + vertstrings_count), shaderstaticparmstrings_list, sizeof(*vertstrings_list) * shaderstaticparms_count);
vertstrings_count += shaderstaticparms_count;
vertstrings_count += shaderstaticparms_count;
- memcpy(geomstrings_list + geomstrings_count, shaderstaticparmstrings_list, sizeof(*vertstrings_list) * shaderstaticparms_count);
+ memcpy((char *)(geomstrings_list + geomstrings_count), shaderstaticparmstrings_list, sizeof(*vertstrings_list) * shaderstaticparms_count);
geomstrings_count += shaderstaticparms_count;
geomstrings_count += shaderstaticparms_count;
- memcpy(fragstrings_list + fragstrings_count, shaderstaticparmstrings_list, sizeof(*vertstrings_list) * shaderstaticparms_count);
+ memcpy((char *)(fragstrings_list + fragstrings_count), shaderstaticparmstrings_list, sizeof(*vertstrings_list) * shaderstaticparms_count);
fragstrings_count += shaderstaticparms_count;
// now append the shader text itself
fragstrings_count += shaderstaticparms_count;
// now append the shader text itself
world->physics.ode_space = dQuadTreeSpaceCreate(NULL, center, extents, bound(1, physics_ode_quadtree_depth.integer, 10));
world->physics.ode_contactgroup = dJointGroupCreate(0);
if(physics_ode_world_erp.value >= 0)
world->physics.ode_space = dQuadTreeSpaceCreate(NULL, center, extents, bound(1, physics_ode_quadtree_depth.integer, 10));
world->physics.ode_contactgroup = dJointGroupCreate(0);
if(physics_ode_world_erp.value >= 0)
- dWorldSetERP(world->physics.ode_world, physics_ode_world_erp.value);
+ dWorldSetERP((dWorldID)world->physics.ode_world, physics_ode_world_erp.value);
if(physics_ode_world_cfm.value >= 0)
if(physics_ode_world_cfm.value >= 0)
- dWorldSetCFM(world->physics.ode_world, physics_ode_world_cfm.value);
+ dWorldSetCFM((dWorldID)world->physics.ode_world, physics_ode_world_cfm.value);
#ifdef USEODE
if (world->physics.ode)
{
#ifdef USEODE
if (world->physics.ode)
{
- dWorldDestroy(world->physics.ode_world);
- dSpaceDestroy(world->physics.ode_space);
- dJointGroupDestroy(world->physics.ode_contactgroup);
+ dWorldDestroy((dWorldID)world->physics.ode_world);
+ dSpaceDestroy((dSpaceID)world->physics.ode_space);
+ dJointGroupDestroy((dJointGroupID)world->physics.ode_contactgroup);
world->physics.ode = false;
}
#endif
world->physics.ode = false;
}
#endif
movetype = (int)val->_float;
if (movetype != MOVETYPE_PHYSICS)
{
movetype = (int)val->_float;
if (movetype != MOVETYPE_PHYSICS)
{
- val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.jointtype);if (val) jointtype = (int)val->_float;
+ jointtype = 0;val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.jointtype);if (val) jointtype = (int)val->_float;
switch(jointtype)
{
// TODO feed back data from physics
switch(jointtype)
{
// TODO feed back data from physics
VectorCopy(velocity, ed->priv.server->ode_velocity);
VectorCopy(angles, ed->priv.server->ode_angles);
VectorCopy(avelocity, ed->priv.server->ode_avelocity);
VectorCopy(velocity, ed->priv.server->ode_velocity);
VectorCopy(angles, ed->priv.server->ode_angles);
VectorCopy(avelocity, ed->priv.server->ode_avelocity);
- ed->priv.server->ode_gravity = dBodyGetGravityMode(body);
+ ed->priv.server->ode_gravity = dBodyGetGravityMode(body) != 0;
if(!strcmp(prog->name, "server")) // FIXME some better way?
{
if(!strcmp(prog->name, "server")) // FIXME some better way?
{
switch(jointtype)
{
case JOINTTYPE_POINT:
switch(jointtype)
{
case JOINTTYPE_POINT:
- j = dJointCreateBall(world->physics.ode_world, 0);
+ j = dJointCreateBall((dWorldID)world->physics.ode_world, 0);
break;
case JOINTTYPE_HINGE:
break;
case JOINTTYPE_HINGE:
- j = dJointCreateHinge(world->physics.ode_world, 0);
+ j = dJointCreateHinge((dWorldID)world->physics.ode_world, 0);
break;
case JOINTTYPE_SLIDER:
break;
case JOINTTYPE_SLIDER:
- j = dJointCreateSlider(world->physics.ode_world, 0);
+ j = dJointCreateSlider((dWorldID)world->physics.ode_world, 0);
break;
case JOINTTYPE_UNIVERSAL:
break;
case JOINTTYPE_UNIVERSAL:
- j = dJointCreateUniversal(world->physics.ode_world, 0);
+ j = dJointCreateUniversal((dWorldID)world->physics.ode_world, 0);
break;
case JOINTTYPE_HINGE2:
break;
case JOINTTYPE_HINGE2:
- j = dJointCreateHinge2(world->physics.ode_world, 0);
+ j = dJointCreateHinge2((dWorldID)world->physics.ode_world, 0);
break;
case JOINTTYPE_FIXED:
break;
case JOINTTYPE_FIXED:
- j = dJointCreateFixed(world->physics.ode_world, 0);
+ j = dJointCreateFixed((dWorldID)world->physics.ode_world, 0);
if(ed->priv.server->ode_joint)
{
//Con_Printf("deleted old joint %i\n", (int) (ed - prog->edicts));
if(ed->priv.server->ode_joint)
{
//Con_Printf("deleted old joint %i\n", (int) (ed - prog->edicts));
- dJointAttach(ed->priv.server->ode_joint, 0, 0);
- dJointDestroy(ed->priv.server->ode_joint);
+ dJointAttach((dJointID)ed->priv.server->ode_joint, 0, 0);
+ dJointDestroy((dJointID)ed->priv.server->ode_joint);
}
ed->priv.server->ode_joint = (void *) j;
ed->priv.server->ode_joint_type = jointtype;
}
ed->priv.server->ode_joint = (void *) j;
ed->priv.server->ode_joint_type = jointtype;
mempool = cls.levelmempool;
else
mempool = NULL;
mempool = cls.levelmempool;
else
mempool = NULL;
switch(solid)
{
case SOLID_BSP:
switch(solid)
{
case SOLID_BSP:
if (!model)
{
Con_Printf("entity %i (classname %s) has no model\n", PRVM_NUM_FOR_EDICT(ed), PRVM_GetString(PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.classname)->string));
if (!model)
{
Con_Printf("entity %i (classname %s) has no model\n", PRVM_NUM_FOR_EDICT(ed), PRVM_GetString(PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.classname)->string));
}
// add an optimized mesh to the model containing only the SUPERCONTENTS_SOLID surfaces
if (!model->brush.collisionmesh)
}
// add an optimized mesh to the model containing only the SUPERCONTENTS_SOLID surfaces
if (!model->brush.collisionmesh)
if (!model->brush.collisionmesh || !model->brush.collisionmesh->numtriangles)
{
Con_Printf("entity %i (classname %s) has no geometry\n", PRVM_NUM_FOR_EDICT(ed), PRVM_GetString(PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.classname)->string));
if (!model->brush.collisionmesh || !model->brush.collisionmesh->numtriangles)
{
Con_Printf("entity %i (classname %s) has no geometry\n", PRVM_NUM_FOR_EDICT(ed), PRVM_GetString(PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.classname)->string));
}
// ODE requires persistent mesh storage, so we need to copy out
// the data from the model because renderer restarts could free it
}
// ODE requires persistent mesh storage, so we need to copy out
// the data from the model because renderer restarts could free it
Matrix4x4_CreateTranslate(&ed->priv.server->ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]);
// now create the geom
dataID = dGeomTriMeshDataCreate();
Matrix4x4_CreateTranslate(&ed->priv.server->ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]);
// now create the geom
dataID = dGeomTriMeshDataCreate();
- dGeomTriMeshDataBuildSingle(dataID, (void*)ed->priv.server->ode_vertex3f, sizeof(float[3]), ed->priv.server->ode_numvertices, ed->priv.server->ode_element3i, ed->priv.server->ode_numtriangles*3, sizeof(int[3]));
- ed->priv.server->ode_geom = (void *)dCreateTriMesh(world->physics.ode_space, dataID, NULL, NULL, NULL);
+ dGeomTriMeshDataBuildSingle((dTriMeshDataID)dataID, (void*)ed->priv.server->ode_vertex3f, sizeof(float[3]), ed->priv.server->ode_numvertices, ed->priv.server->ode_element3i, ed->priv.server->ode_numtriangles*3, sizeof(int[3]));
+ ed->priv.server->ode_geom = (void *)dCreateTriMesh((dSpaceID)world->physics.ode_space, (dTriMeshDataID)dataID, NULL, NULL, NULL);
dMassSetBoxTotal(&mass, massval, geomsize[0], geomsize[1], geomsize[2]);
break;
case SOLID_BBOX:
case SOLID_SLIDEBOX:
case SOLID_CORPSE:
case SOLID_PHYSICS_BOX:
dMassSetBoxTotal(&mass, massval, geomsize[0], geomsize[1], geomsize[2]);
break;
case SOLID_BBOX:
case SOLID_SLIDEBOX:
case SOLID_CORPSE:
case SOLID_PHYSICS_BOX:
Matrix4x4_CreateTranslate(&ed->priv.server->ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]);
Matrix4x4_CreateTranslate(&ed->priv.server->ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]);
- ed->priv.server->ode_geom = (void *)dCreateBox(world->physics.ode_space, geomsize[0], geomsize[1], geomsize[2]);
+ ed->priv.server->ode_geom = (void *)dCreateBox((dSpaceID)world->physics.ode_space, geomsize[0], geomsize[1], geomsize[2]);
dMassSetBoxTotal(&mass, massval, geomsize[0], geomsize[1], geomsize[2]);
break;
case SOLID_PHYSICS_SPHERE:
Matrix4x4_CreateTranslate(&ed->priv.server->ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]);
dMassSetBoxTotal(&mass, massval, geomsize[0], geomsize[1], geomsize[2]);
break;
case SOLID_PHYSICS_SPHERE:
Matrix4x4_CreateTranslate(&ed->priv.server->ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]);
- ed->priv.server->ode_geom = (void *)dCreateSphere(world->physics.ode_space, geomsize[0] * 0.5f);
+ ed->priv.server->ode_geom = (void *)dCreateSphere((dSpaceID)world->physics.ode_space, geomsize[0] * 0.5f);
dMassSetSphereTotal(&mass, massval, geomsize[0] * 0.5f);
break;
case SOLID_PHYSICS_CAPSULE:
dMassSetSphereTotal(&mass, massval, geomsize[0] * 0.5f);
break;
case SOLID_PHYSICS_CAPSULE:
// because we want to support more than one axisindex, we have to
// create a transform, and turn on its cleanup setting (which will
// cause the child to be destroyed when it is destroyed)
// because we want to support more than one axisindex, we have to
// create a transform, and turn on its cleanup setting (which will
// cause the child to be destroyed when it is destroyed)
- ed->priv.server->ode_geom = (void *)dCreateCapsule(world->physics.ode_space, radius, length);
+ ed->priv.server->ode_geom = (void *)dCreateCapsule((dSpaceID)world->physics.ode_space, radius, length);
dMassSetCapsuleTotal(&mass, massval, axisindex+1, radius, length);
break;
default:
Sys_Error("World_Physics_BodyFromEntity: unrecognized solid value %i was accepted by filter\n", solid);
dMassSetCapsuleTotal(&mass, massval, axisindex+1, radius, length);
break;
default:
Sys_Error("World_Physics_BodyFromEntity: unrecognized solid value %i was accepted by filter\n", solid);
+ // this goto only exists to prevent warnings from the compiler
+ // about uninitialized variables (mass), while allowing it to
+ // catch legitimate uninitialized variable warnings
+ goto treatasbox;
}
Matrix4x4_Invert_Simple(&ed->priv.server->ode_offsetimatrix, &ed->priv.server->ode_offsetmatrix);
ed->priv.server->ode_massbuf = Mem_Alloc(mempool, sizeof(mass));
}
Matrix4x4_Invert_Simple(&ed->priv.server->ode_offsetimatrix, &ed->priv.server->ode_offsetmatrix);
ed->priv.server->ode_massbuf = Mem_Alloc(mempool, sizeof(mass));
}
if(ed->priv.server->ode_geom)
}
if(ed->priv.server->ode_geom)
- dGeomSetData(ed->priv.server->ode_geom, (void*)ed);
+ dGeomSetData((dGeomID)ed->priv.server->ode_geom, (void*)ed);
if (movetype == MOVETYPE_PHYSICS && ed->priv.server->ode_geom)
{
if (ed->priv.server->ode_body == NULL)
{
if (movetype == MOVETYPE_PHYSICS && ed->priv.server->ode_geom)
{
if (ed->priv.server->ode_body == NULL)
{
- ed->priv.server->ode_body = (void *)(body = dBodyCreate(world->physics.ode_world));
- dGeomSetBody(ed->priv.server->ode_geom, body);
+ ed->priv.server->ode_body = (void *)(body = dBodyCreate((dWorldID)world->physics.ode_world));
+ dGeomSetBody((dGeomID)ed->priv.server->ode_geom, body);
dBodySetData(body, (void*)ed);
dBodySetMass(body, (dMass *) ed->priv.server->ode_massbuf);
modified = true;
dBodySetData(body, (void*)ed);
dBodySetMass(body, (dMass *) ed->priv.server->ode_massbuf);
modified = true;
if (ed->priv.server->ode_body != NULL)
{
if(ed->priv.server->ode_geom)
if (ed->priv.server->ode_body != NULL)
{
if(ed->priv.server->ode_geom)
- dGeomSetBody(ed->priv.server->ode_geom, 0);
+ dGeomSetBody((dGeomID)ed->priv.server->ode_geom, 0);
dBodyDestroy((dBodyID) ed->priv.server->ode_body);
ed->priv.server->ode_body = NULL;
modified = true;
dBodyDestroy((dBodyID) ed->priv.server->ode_body);
ed->priv.server->ode_body = NULL;
modified = true;
modified = true;
// store the qc values into the physics engine
modified = true;
// store the qc values into the physics engine
- body = ed->priv.server->ode_body;
+ body = (dBodyID)ed->priv.server->ode_body;
if (modified && ed->priv.server->ode_geom)
{
dVector3 r[3];
if (modified && ed->priv.server->ode_geom)
{
dVector3 r[3];
{
if(movetype == MOVETYPE_PHYSICS)
{
{
if(movetype == MOVETYPE_PHYSICS)
{
- dGeomSetBody(ed->priv.server->ode_geom, body);
+ dGeomSetBody((dGeomID)ed->priv.server->ode_geom, body);
dBodySetPosition(body, origin[0], origin[1], origin[2]);
dBodySetRotation(body, r[0]);
dBodySetLinearVel(body, velocity[0], velocity[1], velocity[2]);
dBodySetPosition(body, origin[0], origin[1], origin[2]);
dBodySetRotation(body, r[0]);
dBodySetLinearVel(body, velocity[0], velocity[1], velocity[2]);
- dGeomSetBody(ed->priv.server->ode_geom, body);
+ dGeomSetBody((dGeomID)ed->priv.server->ode_geom, body);
dBodySetPosition(body, origin[0], origin[1], origin[2]);
dBodySetRotation(body, r[0]);
dBodySetLinearVel(body, velocity[0], velocity[1], velocity[2]);
dBodySetAngularVel(body, spinvelocity[0], spinvelocity[1], spinvelocity[2]);
dBodySetGravityMode(body, gravity);
dBodySetPosition(body, origin[0], origin[1], origin[2]);
dBodySetRotation(body, r[0]);
dBodySetLinearVel(body, velocity[0], velocity[1], velocity[2]);
dBodySetAngularVel(body, spinvelocity[0], spinvelocity[1], spinvelocity[2]);
dBodySetGravityMode(body, gravity);
- dGeomSetBody(ed->priv.server->ode_geom, 0);
+ dGeomSetBody((dGeomID)ed->priv.server->ode_geom, 0);
}
}
else
{
// no body... then let's adjust the parameters of the geom directly
}
}
else
{
// no body... then let's adjust the parameters of the geom directly
- dGeomSetBody(ed->priv.server->ode_geom, 0); // just in case we previously HAD a body (which should never happen)
- dGeomSetPosition(ed->priv.server->ode_geom, origin[0], origin[1], origin[2]);
- dGeomSetRotation(ed->priv.server->ode_geom, r[0]);
+ dGeomSetBody((dGeomID)ed->priv.server->ode_geom, 0); // just in case we previously HAD a body (which should never happen)
+ dGeomSetPosition((dGeomID)ed->priv.server->ode_geom, origin[0], origin[1], origin[2]);
+ dGeomSetRotation((dGeomID)ed->priv.server->ode_geom, r[0]);
bouncefactor1 = bouncefactor2;
}
}
bouncefactor1 = bouncefactor2;
}
}
- dWorldGetGravity(world->physics.ode_world, grav);
+ dWorldGetGravity((dWorldID)world->physics.ode_world, grav);
bouncestop1 *= fabs(grav[2]);
// generate contact points between the two non-space geoms
bouncestop1 *= fabs(grav[2]);
// generate contact points between the two non-space geoms
contact[i].surface.soft_cfm = physics_ode_contact_cfm.value;
contact[i].surface.bounce = bouncefactor1;
contact[i].surface.bounce_vel = bouncestop1;
contact[i].surface.soft_cfm = physics_ode_contact_cfm.value;
contact[i].surface.bounce = bouncefactor1;
contact[i].surface.bounce_vel = bouncestop1;
- c = dJointCreateContact(world->physics.ode_world, world->physics.ode_contactgroup, contact + i);
+ c = dJointCreateContact((dWorldID)world->physics.ode_world, (dJointGroupID)world->physics.ode_contactgroup, contact + i);
dJointAttach(c, b1, b2);
}
}
dJointAttach(c, b1, b2);
}
}
for (i = 0;i < world->physics.ode_iterations;i++)
{
// set the gravity
for (i = 0;i < world->physics.ode_iterations;i++)
{
// set the gravity
- dWorldSetGravity(world->physics.ode_world, 0, 0, -gravity);
+ dWorldSetGravity((dWorldID)world->physics.ode_world, 0, 0, -gravity);
// set the tolerance for closeness of objects
// set the tolerance for closeness of objects
- dWorldSetContactSurfaceLayer(world->physics.ode_world, max(0, physics_ode_contactsurfacelayer.value));
+ dWorldSetContactSurfaceLayer((dWorldID)world->physics.ode_world, max(0, physics_ode_contactsurfacelayer.value));
// run collisions for the current world state, creating JointGroup
// run collisions for the current world state, creating JointGroup
- dSpaceCollide(world->physics.ode_space, (void *)world, nearCallback);
+ dSpaceCollide((dSpaceID)world->physics.ode_space, (void *)world, nearCallback);
// run physics (move objects, calculate new velocities)
if (physics_ode_worldquickstep.integer)
{
// run physics (move objects, calculate new velocities)
if (physics_ode_worldquickstep.integer)
{
- dWorldSetQuickStepNumIterations(world->physics.ode_world, bound(1, physics_ode_worldquickstep_iterations.integer, 200));
- dWorldQuickStep(world->physics.ode_world, world->physics.ode_step);
+ dWorldSetQuickStepNumIterations((dWorldID)world->physics.ode_world, bound(1, physics_ode_worldquickstep_iterations.integer, 200));
+ dWorldQuickStep((dWorldID)world->physics.ode_world, world->physics.ode_step);
}
else if (physics_ode_worldstepfast.integer)
}
else if (physics_ode_worldstepfast.integer)
- dWorldStepFast1(world->physics.ode_world, world->physics.ode_step, bound(1, physics_ode_worldstepfast_iterations.integer, 200));
+ dWorldStepFast1((dWorldID)world->physics.ode_world, world->physics.ode_step, bound(1, physics_ode_worldstepfast_iterations.integer, 200));
- dWorldStep(world->physics.ode_world, world->physics.ode_step);
+ dWorldStep((dWorldID)world->physics.ode_world, world->physics.ode_step);
// clear the JointGroup now that we're done with it
// clear the JointGroup now that we're done with it
- dJointGroupEmpty(world->physics.ode_contactgroup);
+ dJointGroupEmpty((dJointGroupID)world->physics.ode_contactgroup);
}
// copy physics properties from physics engine to entities
}
// copy physics properties from physics engine to entities