summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-08-15 21:10:45 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-08-15 21:10:45 +0000
commit973f693af765ecfb2007398fb023a07bc4685030 (patch)
treef7610f12a0ad02ce95661d3d0757346f69308769
parentd876b69b388528fd3236f2f05caac22345a798f4 (diff)
Added --hard-link option to configure.
Link in assembly version of BoxOnPlaneSide. Added simple game DLL interface for describing enhanced features. Changed some renderer algorithms to do half of the recurion path in simple cylce.
-rw-r--r--asm/math.s78
-rw-r--r--build/q2pro.mk46
-rw-r--r--build/q2proded.mk4
-rw-r--r--build/ref_gl.mk5
-rw-r--r--build/ref_soft.mk4
-rwxr-xr-xconfigure20
-rw-r--r--source/cl_ui.c4
-rw-r--r--source/cmodel.c2
-rw-r--r--source/g_public.h11
-rw-r--r--source/gl_tess.c2
-rw-r--r--source/gl_world.c199
-rw-r--r--source/q_shared.c12
-rw-r--r--source/q_shared.h16
-rw-r--r--source/sv_ents.c16
-rw-r--r--source/sv_game.c32
-rw-r--r--source/sv_local.h1
-rw-r--r--source/sw_main.c2
-rw-r--r--source/sw_protect.c1
18 files changed, 218 insertions, 237 deletions
diff --git a/asm/math.s b/asm/math.s
index 4d56128..fe3c65d 100644
--- a/asm/math.s
+++ b/asm/math.s
@@ -9,83 +9,12 @@
.data
-#if 0
.align 4
Ljmptab: .long Lcase0, Lcase1, Lcase2, Lcase3
.long Lcase4, Lcase5, Lcase6, Lcase7
-#endif
.text
-// TODO: rounding needed?
-// stack parameter offset
-#define val 4
-
-.globl C(Invert24To16)
-C(Invert24To16):
-
- movl val(%esp),%ecx
- movl $0x100,%edx // 0x10000000000 as dividend
- cmpl %edx,%ecx
- jle LOutOfRange
-
- subl %eax,%eax
- divl %ecx
-
- ret
-
-LOutOfRange:
- movl $0xFFFFFFFF,%eax
- ret
-
-#define in 4
-#define out 8
-
- .align 2
-.globl C(TransformVector)
-C(TransformVector):
- movl in(%esp),%eax
- movl out(%esp),%edx
-
- flds (%eax) // in[0]
- fmuls C(vright) // in[0]*vright[0]
- flds (%eax) // in[0] | in[0]*vright[0]
- fmuls C(vup) // in[0]*vup[0] | in[0]*vright[0]
- flds (%eax) // in[0] | in[0]*vup[0] | in[0]*vright[0]
- fmuls C(vpn) // in[0]*vpn[0] | in[0]*vup[0] | in[0]*vright[0]
-
- flds 4(%eax) // in[1] | ...
- fmuls C(vright)+4 // in[1]*vright[1] | ...
- flds 4(%eax) // in[1] | in[1]*vright[1] | ...
- fmuls C(vup)+4 // in[1]*vup[1] | in[1]*vright[1] | ...
- flds 4(%eax) // in[1] | in[1]*vup[1] | in[1]*vright[1] | ...
- fmuls C(vpn)+4 // in[1]*vpn[1] | in[1]*vup[1] | in[1]*vright[1] | ...
- fxch %st(2) // in[1]*vright[1] | in[1]*vup[1] | in[1]*vpn[1] | ...
-
- faddp %st(0),%st(5) // in[1]*vup[1] | in[1]*vpn[1] | ...
- faddp %st(0),%st(3) // in[1]*vpn[1] | ...
- faddp %st(0),%st(1) // vpn_accum | vup_accum | vright_accum
-
- flds 8(%eax) // in[2] | ...
- fmuls C(vright)+8 // in[2]*vright[2] | ...
- flds 8(%eax) // in[2] | in[2]*vright[2] | ...
- fmuls C(vup)+8 // in[2]*vup[2] | in[2]*vright[2] | ...
- flds 8(%eax) // in[2] | in[2]*vup[2] | in[2]*vright[2] | ...
- fmuls C(vpn)+8 // in[2]*vpn[2] | in[2]*vup[2] | in[2]*vright[2] | ...
- fxch %st(2) // in[2]*vright[2] | in[2]*vup[2] | in[2]*vpn[2] | ...
-
- faddp %st(0),%st(5) // in[2]*vup[2] | in[2]*vpn[2] | ...
- faddp %st(0),%st(3) // in[2]*vpn[2] | ...
- faddp %st(0),%st(1) // vpn_accum | vup_accum | vright_accum
-
- fstps 8(%edx) // out[2]
- fstps 4(%edx) // out[1]
- fstps (%edx) // out[0]
-
- ret
-
-#if 0 // in C
-
#define EMINS 4+4
#define EMAXS 4+8
#define P 4+12
@@ -104,7 +33,7 @@ C(BoxOnPlaneSide):
jge Lerror
flds pl_normal(%edx) // p->normal[0]
fld %st(0) // p->normal[0] | p->normal[0]
- jmp Ljmptab(,%eax,4)
+ jmp *Ljmptab(,%eax,4)
//dist1= p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
@@ -395,8 +324,7 @@ LSetSides:
Lerror:
- call C(BOPS_Error)
-
-#endif
+ xorl %eax,%eax
+ ret
#endif // USE_ASM
diff --git a/build/q2pro.mk b/build/q2pro.mk
index 22123de..1aeb9bf 100644
--- a/build/q2pro.mk
+++ b/build/q2pro.mk
@@ -19,6 +19,50 @@ SRCFILES=cmd.c cmodel.c common.c prompt.c crc.c cvar.c \
cl_scrn.c cl_tent.c cl_ui.c cl_view.c cl_console.c cl_keys.c \
snd_main.c snd_mem.c snd_mix.c
+ifdef REF_HARD_LINKED
+SRCFILES+=r_images.c \
+ r_bsp.c \
+ gl_draw.c \
+ gl_images.c \
+ gl_models.c \
+ gl_world.c \
+ gl_mesh.c \
+ gl_main.c \
+ gl_state.c \
+ gl_surf.c \
+ gl_tess.c \
+ gl_sky.c \
+ qgl_api.c
+endif
+
+ifdef UI_HARD_LINKED
+SRCFILES+=ui_addressbook.c \
+ ui_atoms.c \
+ ui_confirm.c \
+ ui_controls.c \
+ ui_credits.c \
+ ui_demos.c \
+ ui_dmoptions.c \
+ ui_download.c \
+ ui_game.c \
+ ui_ingame.c \
+ ui_interface.c \
+ ui_keys.c \
+ ui_loadgame.c \
+ ui_loading.c \
+ ui_main.c \
+ ui_menu.c \
+ ui_mods.c \
+ ui_multiplayer.c \
+ ui_network.c \
+ ui_options.c \
+ ui_playerconfig.c \
+ ui_playermodels.c \
+ ui_savegame.c \
+ ui_startserver.c \
+ ui_video.c
+endif
+
ifdef USE_ZLIB
SRCFILES+=ioapi.c unzip.c
LDFLAGS+=$(ZLIB_LDFLAGS)
@@ -26,7 +70,7 @@ CFLAGS+=$(ZLIB_CFLAGS)
endif
ifdef USE_ASM
-ASMFILES+=snd_mixa.s
+ASMFILES+=snd_mixa.s math.s
endif
ifdef MINGW
diff --git a/build/q2proded.mk b/build/q2proded.mk
index 2b6e2ab..4748b03 100644
--- a/build/q2proded.mk
+++ b/build/q2proded.mk
@@ -32,5 +32,9 @@ SRCFILES+=sys_unix.c
LDFLAGS+=-ldl
endif
+ifdef USE_ASM
+ASMFILES=math.s
+endif
+
include $(SRCDIR)/build/target.mk
diff --git a/build/ref_gl.mk b/build/ref_gl.mk
index a83d839..6a0c285 100644
--- a/build/ref_gl.mk
+++ b/build/ref_gl.mk
@@ -20,7 +20,6 @@ CFLAGS+=$(PNG_CFLAGS)
endif
ifdef MINGW
-#OBJFILES+=ref_gl.def
RESFILES+=ref_gl.rc
else
CFLAGS+=-fPIC
@@ -42,5 +41,9 @@ SRCFILES=q_shared.c \
gl_sky.c \
qgl_api.c
+ifdef USE_ASM
+ASMFILES=math.s
+endif
+
include $(SRCDIR)/build/target.mk
diff --git a/build/ref_soft.mk b/build/ref_soft.mk
index bc7bb3a..08a4d89 100644
--- a/build/ref_soft.mk
+++ b/build/ref_soft.mk
@@ -41,11 +41,11 @@ ASMFILES=r_aclipa.s \
r_surf8.s \
r_varsa.s \
d_polysa.s \
- fpu.s
+ fpu.s \
+ math.s
endif
ifdef MINGW
-#OBJFILES+=ref_soft.def
RESFILES=ref_soft.rc
else
LDFLAGS+=-fPIC
diff --git a/configure b/configure
index b035401..8f6bb5f 100755
--- a/configure
+++ b/configure
@@ -31,6 +31,7 @@ sdl="yes"
help="no"
modules="ref_soft ref_gl mod_ui openffa"
executables="q2pro q2proded"
+hardlink="no"
asm="no"
gldriver="libGL.so"
homedir=".q2pro"
@@ -111,6 +112,8 @@ for opt do
;;
--target-executables=*) executables=${opt#--target-executables=}
;;
+ --hardlink) hardlink="yes"
+ ;;
--enable-dsound) dsound="yes"
;;
--enable-dinput) dinput="yes"
@@ -140,6 +143,7 @@ echo " --make=MAKE use MAKE processor [$make]"
echo " --windres=WINDRES use RC compiler [$windres]"
echo " --target-modules=LIST target modules to build [$modules]"
echo " --target-executables=LIST target executables to build [$executables]"
+echo " --hardlink build hard linked client"
echo " --enable-mingw enable Windows build"
echo " --enable-dsound enable DirectSound driver"
echo " --enable-dinput enable DirectInput driver"
@@ -265,6 +269,7 @@ if [ "$mingw" = "no" ]; then
fi
echo "#define EXPORTED $exported" >> $config_h
+echo "#define QDECL" >> $config_h
echo "GAMELIB=$gamelib" >> $config_mk
echo "#define GAMELIB \"$gamelib\"" >> $config_h
@@ -283,7 +288,6 @@ echo "#define PATH_SEP_CHAR '$pathsep'" >> $config_h
echo "#define PATH_SEP_STRING \"$pathsep\"" >> $config_h
echo "#define DEFAULT_OPENGL_DRIVER \"$gldriver\"" >> $config_h
-echo "#define DEFAULT_REFRESH_DRIVER \"soft\"" >> $config_h
if [ "$zlib" = "yes" ]; then
echo "USE_ZLIB=yes" >> $config_mk
@@ -338,6 +342,20 @@ if [ "$asm" = "yes" ]; then
echo "#define USE_ASM 1" >> $config_h
fi
+if [ "$hardlink" = "yes" ]; then
+ echo "REF_HARD_LINKED=yes" >> $config_mk
+ echo "#define REF_HARD_LINKED 1" >> $config_h
+
+ echo "UI_HARD_LINKED=yes" >> $config_mk
+ echo "#define UI_HARD_LINKED 1" >> $config_h
+
+ echo "#define OPENGL_RENDERER 1" >> $config_h
+ echo "#define TRUECOLOR_RENDERER 1" >> $config_h
+ echo "#define DEFAULT_REFRESH_DRIVER \"gl\"" >> $config_h
+else
+ echo "#define DEFAULT_REFRESH_DRIVER \"soft\"" >> $config_h
+fi
+
for target in $modules $executables ; do
mkdir -p .$target ;
done
diff --git a/source/cl_ui.c b/source/cl_ui.c
index f5ba46d..6dcdb4a 100644
--- a/source/cl_ui.c
+++ b/source/cl_ui.c
@@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
uiAPI_t ui;
-static void *ui_library;
-
#ifdef UI_HARD_LINKED
void CL_ShutdownUI( void ) {
@@ -56,6 +54,8 @@ void CL_InitUI( void ) {
#else
+static void *ui_library;
+
/*
==============
CL_UISetupCallback
diff --git a/source/cmodel.c b/source/cmodel.c
index 8bc4ea0..f44ccbd 100644
--- a/source/cmodel.c
+++ b/source/cmodel.c
@@ -1072,7 +1072,7 @@ static void CM_BoxLeafs_r( cnode_t *node ) {
return;
}
- s = BoxOnPlaneSide( leaf_mins, leaf_maxs, plane );
+ s = BoxOnPlaneSideFast( leaf_mins, leaf_maxs, plane );
if( s == 1 ) {
node = node->children[0];
} else if( s == 2 ) {
diff --git a/source/g_public.h b/source/g_public.h
index e8b3b8b..abbdc00 100644
--- a/source/g_public.h
+++ b/source/g_public.h
@@ -38,6 +38,10 @@ SOLID_BBOX, // touch on edge
SOLID_BSP // bsp clip, touch on edge
} solid_t;
+// extended features
+
+#define GAME_FEATURE_CLIENTNUM 1
+
//===============================================================
// link_t is only used for entity area links now
@@ -234,10 +238,3 @@ typedef struct
int max_edicts;
} game_export_t;
-#define CLIENT_EXT_NUMBER 1
-
-// extended API
-typedef struct gameAPI_s {
- int client_ext;
-} gameAPI_t;
-
diff --git a/source/gl_tess.c b/source/gl_tess.c
index adbd27e..4a77363 100644
--- a/source/gl_tess.c
+++ b/source/gl_tess.c
@@ -165,7 +165,7 @@ static float r_turbsin[256] = {
#include "warpsin.h"
};
-static qboolean WouldOverflow( drawSurf_t *surf ) {
+static inline qboolean WouldOverflow( drawSurf_t *surf ) {
bspPoly_t *poly;
int numVerts, numIndices;
diff --git a/source/gl_world.c b/source/gl_world.c
index f08b4ed..ea05f5c 100644
--- a/source/gl_world.c
+++ b/source/gl_world.c
@@ -174,51 +174,50 @@ static void GL_MarkLights_r( bspNode_t *node, dlight_t *light ) {
int lightbit, count;
bspSurface_t *face;
- if( !( plane = node->plane ) ) {
- return;
- }
+ while( ( plane = node->plane ) != NULL ) {
+ switch( plane->type ) {
+ case PLANE_X:
+ dot = light->transformed[0] - plane->dist;
+ break;
+ case PLANE_Y:
+ dot = light->transformed[1] - plane->dist;
+ break;
+ case PLANE_Z:
+ dot = light->transformed[2] - plane->dist;
+ break;
+ default:
+ dot = DotProduct( light->transformed, plane->normal ) - plane->dist;
+ break;
+ }
- switch( plane->type ) {
- case PLANE_X:
- dot = light->transformed[0] - plane->dist;
- break;
- case PLANE_Y:
- dot = light->transformed[1] - plane->dist;
- break;
- case PLANE_Z:
- dot = light->transformed[2] - plane->dist;
- break;
- default:
- dot = DotProduct( light->transformed, plane->normal ) - plane->dist;
- break;
- }
+ if( dot > light->intensity ) {
+ node = node->children[0];
+ continue;
+ }
+ if( dot < -light->intensity ) {
+ node = node->children[1];
+ continue;
+ }
- if( dot > light->intensity ) {
+ lightbit = 1 << light->index;
+ face = node->firstFace;
+ count = node->numFaces;
+ while( count-- ) {
+ if( !( face->texinfo->flags & NOLIGHT_MASK ) ) {
+ if( face->dlightframe != glr.drawframe ) {
+ face->dlightframe = glr.drawframe;
+ face->dlightbits = 0;
+ }
+
+ face->dlightbits |= lightbit;
+ }
+ face++;
+ }
+
GL_MarkLights_r( node->children[0], light );
- return;
- }
- if( dot < -light->intensity ) {
- GL_MarkLights_r( node->children[1], light );
- return;
- }
- lightbit = 1 << light->index;
- face = node->firstFace;
- count = node->numFaces;
- while( count-- ) {
- if( !( face->texinfo->flags & NOLIGHT_MASK ) ) {
- if( face->dlightframe != glr.drawframe ) {
- face->dlightframe = glr.drawframe;
- face->dlightbits = 0;
- }
-
- face->dlightbits |= lightbit;
- }
- face++;
+ node = node->children[1];
}
-
- GL_MarkLights_r( node->children[0], light );
- GL_MarkLights_r( node->children[1], light );
}
void GL_MarkLights( void ) {
@@ -356,21 +355,21 @@ finish:
#define NODE_CLIPPED 0
#define NODE_UNCLIPPED 15
-static qboolean GL_ClipNodeToFrustum( bspNode_t *node, int *clipflags ) {
+static inline qboolean GL_ClipNodeToFrustum( bspNode_t *node, int *clipflags ) {
int flags = *clipflags;
- int i, bits;
+ int i, bits, mask;
- for( i = 0; i < 4; i++ ) {
- if( flags & ( 1 << i ) ) {
+ for( i = 0, mask = 1; i < 4; i++, mask <<= 1 ) {
+ if( flags & mask ) {
continue;
}
bits = BoxOnPlaneSide( node->mins, node->maxs,
- &glr.frustumPlanes[i] );
+ &glr.frustumPlanes[i] );
if( bits == BOX_BEHIND ) {
return qfalse;
}
if( bits == BOX_INFRONT ) {
- flags |= 1 << i;
+ flags |= mask;
}
}
@@ -496,68 +495,68 @@ static void GL_WorldNode_r( bspNode_t *node, int clipflags ) {
vec_t dot;
uint32 type;
- if( node->visframe != glr.visframe ) {
- return;
- }
-
- if( gl_cull_nodes->integer && clipflags != NODE_UNCLIPPED &&
+ while( node->visframe == glr.visframe ) {
+ if( gl_cull_nodes->integer && clipflags != NODE_UNCLIPPED &&
GL_ClipNodeToFrustum( node, &clipflags ) == qfalse )
- {
- c.nodesCulled++;
- return;
- }
-
- if( !node->plane ) {
- /* found a leaf */
- leaf = ( bspLeaf_t * )node;
- if( leaf->contents == CONTENTS_SOLID ) {
- return;
- }
- area = leaf->area;
- if( !glr.fd.areabits || Q_IsBitSet( glr.fd.areabits, area ) ) {
- leafFace = leaf->firstLeafFace;
- count = leaf->numLeafFaces;
- while( count-- ) {
- face = *leafFace++;
- face->drawframe = glr.drawframe;
- }
- }
- return;
- }
+ {
+ c.nodesCulled++;
+ break;
+ }
- plane = node->plane;
- type = plane->type;
- if( type < 3 ) {
- dot = modelViewOrigin[type] - plane->dist;
- } else {
- dot = DotProduct( modelViewOrigin, plane->normal ) - plane->dist;
- }
+ if( !node->plane ) {
+ /* found a leaf */
+ leaf = ( bspLeaf_t * )node;
+ if( leaf->contents == CONTENTS_SOLID ) {
+ break;
+ }
+ area = leaf->area;
+ if( !glr.fd.areabits || Q_IsBitSet( glr.fd.areabits, area ) ) {
+ leafFace = leaf->firstLeafFace;
+ count = leaf->numLeafFaces;
+ while( count-- ) {
+ face = *leafFace++;
+ face->drawframe = glr.drawframe;
+ }
+ }
+ break;
+ }
- side = dot < 0;
-
- GL_WorldNode_r( node->children[side], clipflags );
+ plane = node->plane;
+ type = plane->type;
+ if( type < 3 ) {
+ dot = modelViewOrigin[type] - plane->dist;
+ } else {
+ dot = DotProduct( modelViewOrigin, plane->normal ) - plane->dist;
+ }
- face = node->firstFace;
- count = node->numFaces;
- while( count-- ) {
- if( face->drawframe == glr.drawframe ) {
- if( face->side == side ) {
- if( face->texinfo->flags & (SURF_TRANS33|SURF_TRANS66) ) {
- face->next = alphaFaces;
- alphaFaces = face;
- } else {
- drawFaceFunc( face );
- }
- c.facesDrawn++;
- } else {
- c.facesCulled++;
+ side = dot < 0;
+
+ GL_WorldNode_r( node->children[side], clipflags );
+
+ face = node->firstFace;
+ count = node->numFaces;
+ while( count-- ) {
+ if( face->drawframe == glr.drawframe ) {
+ if( face->side == side ) {
+ if( face->texinfo->flags & (SURF_TRANS33|SURF_TRANS66) ) {
+ face->next = alphaFaces;
+ alphaFaces = face;
+ } else {
+ drawFaceFunc( face );
+ }
+ c.facesDrawn++;
+ } else {
+ c.facesCulled++;
+ }
}
+ face++;
}
- face++;
+
+ c.nodesDrawn++;
+
+ node = node->children[ side ^ 1 ];
}
- GL_WorldNode_r( node->children[ side ^ 1 ], clipflags );
- c.nodesDrawn++;
}
void GL_DrawWorld( void ) {
diff --git a/source/q_shared.c b/source/q_shared.c
index 4a144e1..3dc313e 100644
--- a/source/q_shared.c
+++ b/source/q_shared.c
@@ -461,20 +461,11 @@ BoxOnPlaneSide
Returns 1, 2, or 1 + 2
==================
*/
+#ifndef USE_ASM
int BoxOnPlaneSide( vec3_t emins, vec3_t emaxs, cplane_t *p )
{
float dist1, dist2;
int sides;
-
-// fast axial cases
- if (p->type < 3)
- {
- if (p->dist <= emins[p->type])
- return 1;
- if (p->dist >= emaxs[p->type])
- return 2;
- return 3;
- }
// general case
switch (p->signbits)
@@ -524,6 +515,7 @@ dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
return sides;
}
+#endif // USE_ASM
void ClearBounds (vec3_t mins, vec3_t maxs)
{
diff --git a/source/q_shared.h b/source/q_shared.h
index 5e022db..325b518 100644
--- a/source/q_shared.h
+++ b/source/q_shared.h
@@ -275,7 +275,6 @@ void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
-int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *plane);
static inline float LerpAngle( float a2, float a1, float frac ) {
if (a1 - a2 > 180)
@@ -720,6 +719,21 @@ void SetPlaneSignbits( cplane_t *plane );
int BoxOnPlaneSide( vec3_t emins, vec3_t emaxs, cplane_t *p );
+static inline int BoxOnPlaneSideFast( vec3_t emins, vec3_t emaxs, cplane_t *p ) {
+ // fast axial cases
+ if( p->type < 3 ) {
+ if( p->dist <= emins[p->type] )
+ return 1;
+ if( p->dist >= emaxs[p->type] )
+ return 2;
+ return 3;
+ }
+
+ // slow generic case
+ return BoxOnPlaneSide( emins, emaxs, p );
+}
+
+
typedef struct csurface_s
{
char name[16];
diff --git a/source/sv_ents.c b/source/sv_ents.c
index 4f91e61..3acb156 100644
--- a/source/sv_ents.c
+++ b/source/sv_ents.c
@@ -444,12 +444,11 @@ void SV_BuildClientFrame( client_t *client ) {
svs.nextPlayerStates++;
// grab the current clientNum
-#if 1
- frame->clientNum = clent->client->clientNum;
-#else
- // TODO: support from game DLL required
- frame->clientNum = client->number;
-#endif
+ if( gameFeatures & GAME_FEATURE_CLIENTNUM ) {
+ frame->clientNum = clent->client->clientNum;
+ } else {
+ frame->clientNum = client->number;
+ }
clientpvs = CM_FatPVS( &sv.cm, org );
clientphs = CM_ClusterPHS( &sv.cm, clientcluster );
@@ -535,14 +534,13 @@ void SV_BuildClientFrame( client_t *client ) {
}
}
- // TODO: support from game DLL required
-#if 1
+ // XXX: hide this enitity from renderer
if( client->protocol != PROTOCOL_VERSION_Q2PRO &&
+ ( gameFeatures & GAME_FEATURE_CLIENTNUM ) &&
e == frame->clientNum + 1 )
{
state->modelindex = 0;
}
-#endif
// don't mark players missiles as solid
if( ent->owner == client->edict )
diff --git a/source/sv_game.c b/source/sv_game.c
index 50a5b5a..5c7d011 100644
--- a/source/sv_game.c
+++ b/source/sv_game.c
@@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//void PF_error (const char *fmt, ...) q_noreturn;
game_export_t *ge;
+int gameFeatures;
/*
@@ -729,6 +730,7 @@ void SV_ShutdownGameProgs (void)
return;
ge->Shutdown ();
ge = NULL;
+ gameFeatures = 0;
if( game_library ) {
Sys_FreeLibrary( game_library );
game_library = NULL;
@@ -775,6 +777,7 @@ void SV_InitGameProgs ( void )
game_import_t import;
char path[MAX_OSPATH];
game_export_t *(*entry)( game_import_t * ) = NULL;
+ int (*ggf)( int );
/*moduleEntry_t moduleEntry;
moduleInfo_t info;
moduleCapability_t caps;
@@ -891,32 +894,11 @@ void SV_InitGameProgs ( void )
ge->apiversion, GAME_API_VERSION);
}
-#if 0
- // get extended API
- moduleEntry = Sys_GetProcAddress( game_library, "moduleEntry" );
- if( moduleEntry ) {
- moduleEntry( MQ_GETINFO, &info );
- if( info.api_version != MODULES_APIVERSION ) {
- Com_DPrintf( "Game DLL has incompatible extended "
- "api_version: %d, should be %d\n",
- info.api_version, MODULES_APIVERSION );
- } else {
- caps = ( moduleCapability_t )moduleEntry( MQ_GETCAPS, NULL );
- if( !( caps & MCP_GAME ) ) {
- Com_DPrintf( "Game DLL doesn't have GAME capability\n" );
- } else {
- callback = ( APISetupCallback_t )moduleEntry( MQ_SETUPAPI,
- ( void * )SV_GameSetupCallback );
- if( !callback ) {
- Com_DPrintf( "Game DLL returned NULL callback\n" );
- } else {
- callback( API_GAME, &game_api );
- Com_DPrintf( "Extended game API initialized\n" );
- }
- }
- }
+ // get features
+ ggf = Sys_GetProcAddress( game_library, "GetGameFeatures" );
+ if( ggf ) {
+// gameFeatures = ggf( GAME_FEATURE_CLIENTNUM );
}
-#endif
// initialize
ge->Init ();
diff --git a/source/sv_local.h b/source/sv_local.h
index 804240d..d4336c6 100644
--- a/source/sv_local.h
+++ b/source/sv_local.h
@@ -498,6 +498,7 @@ qboolean SV_EdictPV( edict_t *ent, byte *mask );
// sv_game.c
//
extern game_export_t *ge;
+extern int gameFeatures;
void SV_InitGameProgs( void );
void SV_ShutdownGameProgs (void);
diff --git a/source/sw_main.c b/source/sw_main.c
index d0e9d8c..0cc9272 100644
--- a/source/sw_main.c
+++ b/source/sw_main.c
@@ -729,7 +729,7 @@ mnode_t *R_FindTopnode (vec3_t mins, vec3_t maxs)
}
splitplane = node->plane;
- sides = BoxOnPlaneSide(mins, maxs, (cplane_t *)splitplane);
+ sides = BoxOnPlaneSideFast(mins, maxs, (cplane_t *)splitplane);
if (sides == 3)
return node; // this is the splitter
diff --git a/source/sw_protect.c b/source/sw_protect.c
index 7c6e5c2..8fdf813 100644
--- a/source/sw_protect.c
+++ b/source/sw_protect.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "q_shared.h"
#ifdef _WIN32