From cac5110c0039ca108a000feeb32771979100a3e9 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 8 Mar 2012 14:01:06 +0000 Subject: [PATCH] fix checkextension based ODE detection for QC code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11744 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 6 +++++- world.c | 8 -------- world.h | 9 +++++++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/prvm_cmds.c b/prvm_cmds.c index 15a5e4c0..1cb40587 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -277,10 +277,14 @@ static qboolean checkextension(prvm_prog_t *prog, const char *name) // special sheck for ODE if (!strncasecmp("DP_PHYSICS_ODE", name, 14)) { -#ifdef USEODE +#ifdef ODE_DYNAMIC return ode_dll ? true : false; +#else +#ifdef ODE_STATIC + return true; #else return false; +#endif #endif } diff --git a/world.c b/world.c index 29a11b4b..0becd8a8 100644 --- a/world.c +++ b/world.c @@ -327,14 +327,6 @@ void World_LinkEdict(world_t *world, prvm_edict_t *ent, const vec3_t mins, const // physics engine support //============================================================================ -#ifndef ODE_STATIC -# define ODE_DYNAMIC 1 -#endif - -#if defined(ODE_STATIC) || defined(ODE_DYNAMIC) -#define USEODE 1 -#endif - #ifdef USEODE cvar_t physics_ode_quadtree_depth = {0, "physics_ode_quadtree_depth","5", "desired subdivision level of quadtree culling space"}; cvar_t physics_ode_allowconvex = {0, "physics_ode_allowconvex", "0", "allow usage of Convex Hull primitive type on trimeshes that have custom 'collisionconvex' mesh. If disabled, trimesh primitive type are used."}; diff --git a/world.h b/world.h index e43ebd14..18e9b001 100644 --- a/world.h +++ b/world.h @@ -119,6 +119,15 @@ int World_EntitiesInBox(world_t *world, const vec3_t mins, const vec3_t maxs, in void World_Start(world_t *world); void World_End(world_t *world); +// physics macros +#ifndef ODE_STATIC +# define ODE_DYNAMIC 1 +#endif + +#if defined(ODE_STATIC) || defined(ODE_DYNAMIC) +# define USEODE 1 +#endif + // update physics // this is called by SV_Physics void World_Physics_Frame(world_t *world, double frametime, double gravity); -- 2.39.2