mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 15:30:50 +00:00
Merge branch 'master' of ssh://kurogane/media/eee/bill/qf/quakeforge
This commit is contained in:
commit
516a841479
29 changed files with 116 additions and 434 deletions
|
@ -3,7 +3,8 @@ AUTOMAKE_OPTIONS= foreign
|
|||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS= RPM debian doc include libs hw nq qtv qw tools ruamoko pkg-config
|
||||
SUBDIRS=RPM debian desktop doc include libs hw nq qtv qw tools ruamoko \
|
||||
pkg-config
|
||||
|
||||
## configure.ac needs to be listed here for older autoconfs
|
||||
EXTRA_DIST= ChangeLog configure.ac \
|
||||
|
|
|
@ -89,3 +89,4 @@
|
|||
doc/man/Makefile
|
||||
|
||||
debian/Makefile
|
||||
desktop/Makefile
|
||||
|
|
|
@ -4,9 +4,9 @@ dnl ==================================================================
|
|||
|
||||
dnl XMMS Checks
|
||||
AC_ARG_ENABLE(xmms,
|
||||
[ --disable-xmms disable checking for XMMS],
|
||||
[ --enable-xmms enable checking for XMMS],
|
||||
)
|
||||
if test "x$mingw" != xyes -a "x$enable_xmms" != xno; then
|
||||
if test "x$mingw" != xyes -a "x$enable_xmms" == xyes; then
|
||||
AM_PATH_XMMS(0.9.5.1,
|
||||
HAVE_XMMS=yes,
|
||||
HAVE_XMMS=no)
|
||||
|
|
49
desktop/Makefile.am
Normal file
49
desktop/Makefile.am
Normal file
|
@ -0,0 +1,49 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
#
|
||||
# Makefile.am
|
||||
#
|
||||
# Automake-using build system for QuakeForge
|
||||
#
|
||||
# Copyright (C) 2000 Jeff Teunissen <deek@quakeforge.net>
|
||||
#
|
||||
# This Makefile is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to:
|
||||
#
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place - Suite 330
|
||||
# Boston, MA 02111-1307, USA
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
AUTOMAKE_OPTIONS= foreign
|
||||
|
||||
# Stuff that is common to both client and server
|
||||
# Desktop files
|
||||
if HAVE_XDG
|
||||
desktopdir=$(datarootdir)/applications
|
||||
desktop_DATA= @NQ_DESKTOP_DATA@ @QW_DESKTOP_DATA@
|
||||
endif
|
||||
|
||||
# Stuff that doesn't get linked into an executable NEEDS to be mentioned here,
|
||||
# or it won't be distributed with 'make dist'
|
||||
|
||||
EXTRA_DATA= quakeforge-nq-glx.desktop quakeforge-nq-sdl.desktop \
|
||||
quakeforge-nq-sdl32.desktop quakeforge-nq-sgl.desktop \
|
||||
quakeforge-nq-x11.desktop quakeforge-qw-glx.desktop \
|
||||
quakeforge-qw-sdl.desktop quakeforge-qw-sdl32.desktop \
|
||||
quakeforge-qw-sgl.desktop quakeforge-qw-x11.desktop
|
||||
|
||||
# Kill the temp files, hopefully.
|
||||
CLEANFILES = *.i *.s $(YACCLEX_CLEANFILES)
|
|
@ -157,7 +157,6 @@ typedef struct dplane_s {
|
|||
#define CONTENTS_CURRENT_DOWN -14
|
||||
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct dnode_s {
|
||||
int32_t planenum;
|
||||
int16_t children[2]; // negative numbers are -(leafs+1), not nodes
|
||||
|
|
|
@ -53,8 +53,7 @@
|
|||
|
||||
// BRUSH MODELS ===============================================================
|
||||
|
||||
typedef struct efrag_s
|
||||
{
|
||||
typedef struct efrag_s {
|
||||
struct mleaf_s *leaf;
|
||||
struct efrag_s *leafnext;
|
||||
struct entity_s *entity;
|
||||
|
@ -65,13 +64,11 @@ typedef struct efrag_s
|
|||
// in memory representation ===================================================
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
vec3_t position;
|
||||
} mvertex_t;
|
||||
|
||||
typedef struct texture_s
|
||||
{
|
||||
typedef struct texture_s {
|
||||
char name[16];
|
||||
unsigned int width, height;
|
||||
int gl_texturenum;
|
||||
|
@ -99,14 +96,12 @@ typedef struct texture_s
|
|||
#define SURF_LIGHTBOTHSIDES 0x800
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
unsigned short v[2];
|
||||
unsigned int cachededgeoffset;
|
||||
} medge_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
float vecs[2][4];
|
||||
float mipadjust;
|
||||
texture_t *texture;
|
||||
|
@ -115,8 +110,7 @@ typedef struct
|
|||
|
||||
#define VERTEXSIZE 7
|
||||
|
||||
typedef struct glpoly_s
|
||||
{
|
||||
typedef struct glpoly_s {
|
||||
struct glpoly_s *next;
|
||||
struct glpoly_s *chain;
|
||||
struct glpoly_s *fb_chain;
|
||||
|
@ -125,8 +119,7 @@ typedef struct glpoly_s
|
|||
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
|
||||
} glpoly_t;
|
||||
|
||||
typedef struct msurface_s
|
||||
{
|
||||
typedef struct msurface_s {
|
||||
int visframe; // should be drawn when node is crossed
|
||||
|
||||
mplane_t *plane;
|
||||
|
@ -159,8 +152,7 @@ typedef struct msurface_s
|
|||
byte *samples; // [numstyles*surfsize]
|
||||
} msurface_t;
|
||||
|
||||
typedef struct mnode_s
|
||||
{
|
||||
typedef struct mnode_s {
|
||||
// common with leaf
|
||||
int contents; // 0, to differentiate from leafs
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
@ -177,8 +169,7 @@ typedef struct mnode_s
|
|||
unsigned short numsurfaces;
|
||||
} mnode_t;
|
||||
|
||||
typedef struct mleaf_s
|
||||
{
|
||||
typedef struct mleaf_s {
|
||||
// common with node
|
||||
int contents; // wil be a negative contents number
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
@ -199,10 +190,13 @@ typedef struct mleaf_s
|
|||
byte ambient_sound_level[NUM_AMBIENTS];
|
||||
} mleaf_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct hull_s
|
||||
{
|
||||
dclipnode_t *clipnodes;
|
||||
typedef struct mclipnode_s {
|
||||
int planenum;
|
||||
int children[2];
|
||||
} mclipnode_t;
|
||||
|
||||
typedef struct hull_s {
|
||||
mclipnode_t *clipnodes;
|
||||
mplane_t *planes;
|
||||
int firstclipnode;
|
||||
int lastclipnode;
|
||||
|
@ -213,8 +207,7 @@ typedef struct hull_s
|
|||
// SPRITE MODELS ==============================================================
|
||||
|
||||
// FIXME: shorten these?
|
||||
typedef struct mspriteframe_s
|
||||
{
|
||||
typedef struct mspriteframe_s {
|
||||
int width;
|
||||
int height;
|
||||
float up, down, left, right;
|
||||
|
@ -222,21 +215,18 @@ typedef struct mspriteframe_s
|
|||
int gl_texturenum;
|
||||
} mspriteframe_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
int numframes;
|
||||
float *intervals;
|
||||
mspriteframe_t *frames[1];
|
||||
} mspritegroup_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
spriteframetype_t type;
|
||||
mspriteframe_t *frameptr;
|
||||
} mspriteframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
int type;
|
||||
int maxwidth;
|
||||
int maxheight;
|
||||
|
@ -251,8 +241,7 @@ typedef struct
|
|||
// Alias models are position independent, so the cache manager can move them.
|
||||
|
||||
// NOTE: the first three lines must match maliasgroupframedesc_t
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
|
@ -263,30 +252,26 @@ typedef struct
|
|||
char name[16];
|
||||
} maliasframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
aliasskintype_t type;
|
||||
int skin;
|
||||
int texnum;
|
||||
int fb_texnum;
|
||||
} maliasskindesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
} maliasgroupframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
int numframes;
|
||||
int intervals;
|
||||
maliasgroupframedesc_t frames[1];
|
||||
} maliasgroup_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
int numskins;
|
||||
int intervals;
|
||||
maliasskindesc_t skindescs[1];
|
||||
|
@ -340,8 +325,7 @@ typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
|||
#define EF_TRACER3 128 // purple trail
|
||||
#define EF_GLOWTRAIL 4096 // glowcolor particle trail
|
||||
|
||||
typedef struct model_s
|
||||
{
|
||||
typedef struct model_s {
|
||||
char name[MAX_QPATH];
|
||||
qboolean needload; // bmodels and sprites don't cache normally
|
||||
qboolean hasfullbrights;
|
||||
|
@ -397,7 +381,7 @@ typedef struct model_s
|
|||
int *surfedges;
|
||||
|
||||
int numclipnodes;
|
||||
dclipnode_t *clipnodes;
|
||||
mclipnode_t *clipnodes;
|
||||
|
||||
int nummarksurfaces;
|
||||
msurface_t **marksurfaces;
|
||||
|
|
|
@ -328,7 +328,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
*/
|
||||
#define G_FLOAT(p,o) G_var (p, o, float)
|
||||
|
||||
/** Access a integer global. Can be assigned to.
|
||||
/** Access an integer global. Can be assigned to.
|
||||
|
||||
\par QC type:
|
||||
\c integer
|
||||
|
@ -340,7 +340,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
*/
|
||||
#define G_INT(p,o) G_var (p, o, integer)
|
||||
|
||||
/** Access a unsigned integer global. Can be assigned to.
|
||||
/** Access an unsigned integer global. Can be assigned to.
|
||||
|
||||
\par QC type:
|
||||
\c uinteger
|
||||
|
@ -505,7 +505,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
*/
|
||||
#define P_FLOAT(p,n) P_var (p, n, float)
|
||||
|
||||
/** Access a integer parameter. Can be assigned to.
|
||||
/** Access an integer parameter. Can be assigned to.
|
||||
|
||||
\par QC type:
|
||||
\c integer
|
||||
|
@ -517,7 +517,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
*/
|
||||
#define P_INT(p,n) P_var (p, n, integer)
|
||||
|
||||
/** Access a unsigned integer parameter. Can be assigned to.
|
||||
/** Access an unsigned integer parameter. Can be assigned to.
|
||||
|
||||
\par QC type:
|
||||
\c uinteger
|
||||
|
@ -590,7 +590,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
*/
|
||||
#define P_EDICT(p,n) ((edict_t *)(PR_edicts (p) + P_INT (p, n)))
|
||||
|
||||
/** Access a entity parameter.
|
||||
/** Access an entity parameter.
|
||||
|
||||
\par QC type:
|
||||
\c entity
|
||||
|
@ -825,7 +825,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
*/
|
||||
#define E_FLOAT(e,o) E_var (e, o, float)
|
||||
|
||||
/** Access a integer entity field. Can be assigned to.
|
||||
/** Access an integer entity field. Can be assigned to.
|
||||
|
||||
\par QC type:
|
||||
\c integer
|
||||
|
@ -837,7 +837,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
*/
|
||||
#define E_INT(e,o) E_var (e, o, integer)
|
||||
|
||||
/** Access a unsigned integer entity field. Can be assigned to.
|
||||
/** Access an unsigned integer entity field. Can be assigned to.
|
||||
|
||||
\par QC type:
|
||||
\c uinteger
|
||||
|
|
|
@ -57,24 +57,4 @@
|
|||
#define pl_pad 18
|
||||
#define pl_size 20
|
||||
|
||||
// hull_t structure
|
||||
// !!! if this is changed, it must be changed in model.h too !!!
|
||||
#define hu_clipnodes 0
|
||||
#define hu_planes 4
|
||||
#define hu_firstclipnode 8
|
||||
#define hu_lastclipnode 12
|
||||
#define hu_clip_mins 16
|
||||
#define hu_clip_maxs 28
|
||||
#define hu_size 40
|
||||
|
||||
// dnode_t structure
|
||||
// !!! if this is changed, it must be changed in bspfile.h too !!!
|
||||
#define nd_planenum 0
|
||||
#define nd_children 4
|
||||
#define nd_mins 8
|
||||
#define nd_maxs 20
|
||||
#define nd_firstface 32
|
||||
#define nd_numfaces 36
|
||||
#define nd_size 40
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,7 +71,7 @@ typedef struct areanode_s {
|
|||
|
||||
extern areanode_t sv_areanodes[AREA_NODES];
|
||||
|
||||
void SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes);
|
||||
void SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes);
|
||||
|
||||
void SV_ClearWorld (void);
|
||||
// called after the world model has been loaded, before linking any entities
|
||||
|
|
|
@ -685,7 +685,8 @@ Mod_LoadLeafs (bsp_t *bsp)
|
|||
static void
|
||||
Mod_LoadClipnodes (bsp_t *bsp)
|
||||
{
|
||||
dclipnode_t *in, *out;
|
||||
dclipnode_t *in;
|
||||
mclipnode_t *out;
|
||||
hull_t *hull;
|
||||
int count, i;
|
||||
|
||||
|
@ -756,7 +757,7 @@ Mod_LoadClipnodes (bsp_t *bsp)
|
|||
static void
|
||||
Mod_MakeHull0 (void)
|
||||
{
|
||||
dclipnode_t *out;
|
||||
mclipnode_t *out;
|
||||
hull_t *hull;
|
||||
int count, i, j;
|
||||
mnode_t *in, *child;
|
||||
|
|
|
@ -47,7 +47,7 @@ MOD_Alloc_Hull (int nodes, int planes)
|
|||
int size, i;
|
||||
|
||||
size = sizeof (hull_t);
|
||||
size += sizeof (dclipnode_t) * nodes + sizeof (mplane_t) * planes;
|
||||
size += sizeof (mclipnode_t) * nodes + sizeof (mplane_t) * planes;
|
||||
size *= MAX_MAP_HULLS;
|
||||
size += sizeof (clip_hull_t);
|
||||
|
||||
|
@ -57,11 +57,11 @@ MOD_Alloc_Hull (int nodes, int planes)
|
|||
ch->hulls[0] = (hull_t *) &ch[1];
|
||||
for (i = 1; i < MAX_MAP_HULLS; i++)
|
||||
ch->hulls[i] = &ch->hulls[i - 1][1];
|
||||
ch->hulls[0]->clipnodes = (dclipnode_t *) &ch->hulls[i - 1][1];
|
||||
ch->hulls[0]->clipnodes = (mclipnode_t *) &ch->hulls[i - 1][1];
|
||||
ch->hulls[0]->planes = (mplane_t *) &ch->hulls[0]->clipnodes[nodes];
|
||||
for (i = 1; i < MAX_MAP_HULLS; i++) {
|
||||
ch->hulls[i]->clipnodes =
|
||||
(dclipnode_t *) &ch->hulls[i - 1]->planes[planes];
|
||||
(mclipnode_t *) &ch->hulls[i - 1]->planes[planes];
|
||||
ch->hulls[i]->planes = (mplane_t *) &ch->hulls[i]->clipnodes[nodes];
|
||||
}
|
||||
return ch;
|
||||
|
|
|
@ -101,7 +101,7 @@ MOD_TraceLine (hull_t *hull, int num,
|
|||
int side, empty, solid;
|
||||
tracestack_t *tstack;
|
||||
tracestack_t tracestack[256];
|
||||
dclipnode_t *node;
|
||||
mclipnode_t *node;
|
||||
mplane_t *plane, *split_plane;
|
||||
|
||||
VectorCopy (start_point, start);
|
||||
|
|
|
@ -33,28 +33,14 @@ AUTOMAKE_OPTIONS= foreign
|
|||
INCLUDES= -I$(top_srcdir)/include -I$(top_srcdir)/nq/include
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
|
||||
# Desktop files
|
||||
if HAVE_XDG
|
||||
desktopdir=$(datarootdir)/applications
|
||||
desktop_DATA= @NQ_DESKTOP_DATA@
|
||||
endif
|
||||
|
||||
bin_PROGRAMS= @NQ_TARGETS@
|
||||
|
||||
EXTRA_PROGRAMS= nq-fbdev nq-glx nq-mgl nq-sdl nq-sdl32 nq-sgl nq-svga nq-3dfx \
|
||||
nq-wgl nq-x11 nq-server
|
||||
|
||||
if ASM_ARCH
|
||||
asm= libasm.a
|
||||
else
|
||||
asm=
|
||||
endif
|
||||
noinst_LIBRARIES= @nq_libs@
|
||||
EXTRA_LIBRARIES=libnq_client.a libnq_common.a libnq_sdl.a libnq_server.a
|
||||
|
||||
noinst_LIBRARIES= @nq_libs@ $(asm)
|
||||
EXTRA_LIBRARIES=libasm.a libnq_client.a libnq_common.a libnq_sdl.a libnq_server.a
|
||||
|
||||
libasm_a_SOURCES= worlda.S
|
||||
libasm_la_CCASFLAGS=@PREFER_NON_PIC@
|
||||
libnq_common_a_SOURCES=game.c world.c com.c
|
||||
libnq_sdl_a_SOURCES= sys_sdl.c
|
||||
libnq_sdl_a_CFLAGS= $(SDL_CFLAGS)
|
||||
|
@ -75,7 +61,6 @@ server_LIBFILES= \
|
|||
$(top_builddir)/libs/models/libQFmodels.la
|
||||
|
||||
common_LIBFILES= \
|
||||
$(asm) \
|
||||
$(top_builddir)/libs/net/libnet_main.la \
|
||||
$(top_builddir)/libs/console/libQFconsole.la \
|
||||
$(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \
|
||||
|
|
|
@ -70,7 +70,7 @@ typedef struct {
|
|||
/* HULL BOXES */
|
||||
|
||||
static hull_t box_hull;
|
||||
static dclipnode_t box_clipnodes[6];
|
||||
static mclipnode_t box_clipnodes[6];
|
||||
static mplane_t box_planes[6];
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ static mplane_t box_planes[6];
|
|||
can just be stored out and get a proper hull_t structure.
|
||||
*/
|
||||
void
|
||||
SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes)
|
||||
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes)
|
||||
{
|
||||
int side, i;
|
||||
|
||||
|
@ -431,17 +431,16 @@ SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
|
|||
|
||||
/* POINT TESTING IN HULLS */
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
int
|
||||
SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||
{
|
||||
float d;
|
||||
dclipnode_t *node;
|
||||
mclipnode_t *node;
|
||||
mplane_t *plane;
|
||||
|
||||
while (num >= 0) {
|
||||
if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||
Sys_Error ("SV_HullPointContents: bad node number");
|
||||
//if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||
// Sys_Error ("SV_HullPointContents: bad node number");
|
||||
|
||||
node = hull->clipnodes + num;
|
||||
plane = hull->planes + node->planenum;
|
||||
|
@ -458,7 +457,6 @@ SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
|||
|
||||
return num;
|
||||
}
|
||||
#endif // !USE_INTEL_ASM
|
||||
|
||||
int
|
||||
SV_PointContents (const vec3_t p)
|
||||
|
|
|
@ -1,150 +0,0 @@
|
|||
/*
|
||||
worlda.S
|
||||
|
||||
x86 assembly-language server testing stuff
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "asm_i386.h"
|
||||
//#include "quakeasm.h"
|
||||
//include "d_ifacea.h"
|
||||
|
||||
#ifdef USE_INTEL_ASM
|
||||
|
||||
.data
|
||||
|
||||
Ltemp: .long 0
|
||||
|
||||
.text
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// hull-point test
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#define hull 4+8 // because only partially pushed
|
||||
#define num 8+4 // because only partially pushed
|
||||
#define p 12+12 // because only partially pushed
|
||||
|
||||
.align 4
|
||||
.globl C(SV_HullPointContents)
|
||||
C(SV_HullPointContents):
|
||||
pushl %edi // preserve register variables
|
||||
movl num(%esp),%eax
|
||||
testl %eax,%eax
|
||||
js Lhquickout
|
||||
|
||||
// float d;
|
||||
// dclipnode_t *node;
|
||||
// mplane_t *plane;
|
||||
|
||||
pushl %ebx
|
||||
movl hull(%esp),%ebx
|
||||
|
||||
pushl %ebp
|
||||
movl p(%esp),%edx
|
||||
|
||||
movl hu_clipnodes(%ebx),%edi
|
||||
movl hu_planes(%ebx),%ebp
|
||||
|
||||
subl %ebx,%ebx
|
||||
pushl %esi
|
||||
|
||||
// %ebx: 0
|
||||
// %eax: num
|
||||
// %edx: p
|
||||
// %edi: hull->clipnodes
|
||||
// %ebp: hull->planes
|
||||
|
||||
// while (num >= 0)
|
||||
// {
|
||||
|
||||
Lhloop:
|
||||
|
||||
// node = hull->clipnodes + num;
|
||||
// plane = hull->planes + node->planenum;
|
||||
// !!! if the size of dclipnode_t changes, the scaling of %eax needs to be
|
||||
// changed !!!
|
||||
movl nd_planenum(%edi,%eax,8),%ecx
|
||||
movl nd_children(%edi,%eax,8),%eax
|
||||
movl %eax,%esi
|
||||
rorl $16,%eax
|
||||
leal (%ecx,%ecx,4),%ecx
|
||||
|
||||
// if (plane->type < 3)
|
||||
// d = p[plane->type] - plane->dist;
|
||||
movb pl_type(%ebp,%ecx,4),%bl
|
||||
cmpb $3,%bl
|
||||
jb Lnodot
|
||||
|
||||
// else
|
||||
// d = DotProduct (plane->normal, p) - plane->dist;
|
||||
flds pl_normal(%ebp,%ecx,4)
|
||||
fmuls 0(%edx)
|
||||
flds pl_normal+4(%ebp,%ecx,4)
|
||||
fmuls 4(%edx)
|
||||
flds pl_normal+8(%ebp,%ecx,4)
|
||||
fmuls 8(%edx)
|
||||
fxch %st(1)
|
||||
faddp %st(0),%st(2)
|
||||
faddp %st(0),%st(1)
|
||||
fsubs pl_dist(%ebp,%ecx,4)
|
||||
jmp Lsub
|
||||
|
||||
Lnodot:
|
||||
flds pl_dist(%ebp,%ecx,4)
|
||||
fsubrs (%edx,%ebx,4)
|
||||
|
||||
Lsub:
|
||||
sarl $16,%eax
|
||||
sarl $16,%esi
|
||||
|
||||
// if (d < 0)
|
||||
// num = node->children[1];
|
||||
// else
|
||||
// num = node->children[0];
|
||||
fstps Ltemp
|
||||
movl Ltemp,%ecx
|
||||
sarl $31,%ecx
|
||||
andl %ecx,%esi
|
||||
xorl $0xFFFFFFFF,%ecx
|
||||
andl %ecx,%eax
|
||||
orl %esi,%eax
|
||||
jns Lhloop
|
||||
|
||||
// return num;
|
||||
Lhdone:
|
||||
popl %esi
|
||||
popl %ebp
|
||||
popl %ebx // restore register variables
|
||||
|
||||
Lhquickout:
|
||||
popl %edi
|
||||
|
||||
ret
|
||||
|
||||
#endif // USE_INTEL_ASM
|
||||
|
|
@ -33,30 +33,16 @@ AUTOMAKE_OPTIONS= foreign
|
|||
INCLUDES= -I$(top_srcdir)/include -I$(top_srcdir)/qw/include
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
|
||||
# Desktop files
|
||||
if HAVE_XDG
|
||||
desktopdir=$(datarootdir)/applications
|
||||
desktop_DATA= @QW_DESKTOP_DATA@
|
||||
endif
|
||||
|
||||
bin_PROGRAMS= @QW_TARGETS@
|
||||
|
||||
EXTRA_PROGRAMS= qw-client-fbdev qw-client-glx qw-client-mgl qw-client-sdl \
|
||||
qw-client-sdl32 qw-client-sgl qw-client-svga qw-client-3dfx \
|
||||
qw-client-wgl qw-client-x11 qw-server qw-master
|
||||
|
||||
if ASM_ARCH
|
||||
asm= libasm.a
|
||||
else
|
||||
asm=
|
||||
endif
|
||||
|
||||
noinst_LIBRARIES= @qw_libs@ $(asm)
|
||||
EXTRA_LIBRARIES=libasm.a libqw_client.a libqw_common.a libqw_sdl.a libqw_server.a
|
||||
noinst_LIBRARIES= @qw_libs@
|
||||
EXTRA_LIBRARIES=libqw_client.a libqw_common.a libqw_sdl.a libqw_server.a
|
||||
|
||||
|
||||
libasm_a_SOURCES= worlda.S
|
||||
libasm_la_CCASFLAGS=@PREFER_NON_PIC@
|
||||
libqw_common_a_SOURCES=\
|
||||
com.c game.c map_cfg.c pmove.c pmovetst.c net_packetlog.c
|
||||
libqw_sdl_a_SOURCES=cl_sys_sdl.c
|
||||
|
@ -93,9 +79,9 @@ qw_server_LIBS= \
|
|||
$(top_builddir)/libs/util/libQFutil.la
|
||||
|
||||
qw_server_SOURCES=
|
||||
qw_server_LDADD= libqw_server.a libqw_common.a $(asm) $(qw_server_LIBS) $(NET_LIBS) $(DL_LIBS) $(CURSES_LIBS)
|
||||
qw_server_LDADD= libqw_server.a libqw_common.a $(qw_server_LIBS) $(NET_LIBS) $(DL_LIBS) $(CURSES_LIBS)
|
||||
qw_server_LDFLAGS= $(common_ldflags)
|
||||
qw_server_DEPENDENCIES= libqw_common.a libqw_server.a $(asm) $(qw_server_LIBS)
|
||||
qw_server_DEPENDENCIES= libqw_common.a libqw_server.a $(qw_server_LIBS)
|
||||
|
||||
qw_master_SOURCES= master.c
|
||||
qw_master_LDADD= $(top_builddir)/libs/util/libQFutil.la $(NET_LIBS)
|
||||
|
@ -118,7 +104,7 @@ qw_client_LIBS= \
|
|||
$(top_builddir)/libs/util/libQFutil.la \
|
||||
$(top_builddir)/libs/gib/libQFgib.la
|
||||
|
||||
client_LIBS= $(asm) $(qw_client_LIBS)
|
||||
client_LIBS= $(qw_client_LIBS)
|
||||
client_libs= libqw_client.a libqw_common.a
|
||||
|
||||
libqw_client_a_SOURCES= \
|
||||
|
|
|
@ -48,7 +48,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "world.h"
|
||||
|
||||
static hull_t box_hull;
|
||||
static dclipnode_t box_clipnodes[6];
|
||||
static mclipnode_t box_clipnodes[6];
|
||||
static mplane_t box_planes[6];
|
||||
|
||||
|
||||
|
@ -108,7 +108,7 @@ inline int
|
|||
PM_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||
{
|
||||
float d;
|
||||
dclipnode_t *node;
|
||||
mclipnode_t *node;
|
||||
mplane_t *plane;
|
||||
|
||||
while (num >= 0) {
|
||||
|
@ -133,7 +133,7 @@ PM_PointContents (const vec3_t p)
|
|||
{
|
||||
float d;
|
||||
int num;
|
||||
dclipnode_t *node;
|
||||
mclipnode_t *node;
|
||||
hull_t *hull;
|
||||
mplane_t *plane;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ typedef struct {
|
|||
/* HULL BOXES */
|
||||
|
||||
static hull_t box_hull;
|
||||
static dclipnode_t box_clipnodes[6];
|
||||
static mclipnode_t box_clipnodes[6];
|
||||
static mplane_t box_planes[6];
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ static mplane_t box_planes[6];
|
|||
can just be stored out and get a proper hull_t structure.
|
||||
*/
|
||||
void
|
||||
SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes)
|
||||
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes)
|
||||
{
|
||||
int side, i;
|
||||
|
||||
|
@ -419,17 +419,16 @@ SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
|
|||
|
||||
/* POINT TESTING IN HULLS */
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
int
|
||||
SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||
{
|
||||
float d;
|
||||
dclipnode_t *node;
|
||||
mclipnode_t *node;
|
||||
mplane_t *plane;
|
||||
|
||||
while (num >= 0) {
|
||||
if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||
Sys_Error ("SV_HullPointContents: bad node number");
|
||||
//if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||
// Sys_Error ("SV_HullPointContents: bad node number");
|
||||
|
||||
node = hull->clipnodes + num;
|
||||
plane = hull->planes + node->planenum;
|
||||
|
@ -446,7 +445,6 @@ SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
|||
|
||||
return num;
|
||||
}
|
||||
#endif // !USE_INTEL_ASM
|
||||
|
||||
int
|
||||
SV_PointContents (const vec3_t p)
|
||||
|
|
|
@ -1,150 +0,0 @@
|
|||
/*
|
||||
worlda.S
|
||||
|
||||
x86 assembly-language server testing stuff
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "asm_i386.h"
|
||||
//#include "quakeasm.h"
|
||||
//include "d_ifacea.h"
|
||||
|
||||
#ifdef USE_INTEL_ASM
|
||||
|
||||
.data
|
||||
|
||||
Ltemp: .long 0
|
||||
|
||||
.text
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// hull-point test
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#define hull 4+8 // because only partially pushed
|
||||
#define num 8+4 // because only partially pushed
|
||||
#define p 12+12 // because only partially pushed
|
||||
|
||||
.align 4
|
||||
.globl C(SV_HullPointContents)
|
||||
C(SV_HullPointContents):
|
||||
pushl %edi // preserve register variables
|
||||
movl num(%esp),%eax
|
||||
testl %eax,%eax
|
||||
js Lhquickout
|
||||
|
||||
// float d;
|
||||
// dclipnode_t *node;
|
||||
// mplane_t *plane;
|
||||
|
||||
pushl %ebx
|
||||
movl hull(%esp),%ebx
|
||||
|
||||
pushl %ebp
|
||||
movl p(%esp),%edx
|
||||
|
||||
movl hu_clipnodes(%ebx),%edi
|
||||
movl hu_planes(%ebx),%ebp
|
||||
|
||||
subl %ebx,%ebx
|
||||
pushl %esi
|
||||
|
||||
// %ebx: 0
|
||||
// %eax: num
|
||||
// %edx: p
|
||||
// %edi: hull->clipnodes
|
||||
// %ebp: hull->planes
|
||||
|
||||
// while (num >= 0)
|
||||
// {
|
||||
|
||||
Lhloop:
|
||||
|
||||
// node = hull->clipnodes + num;
|
||||
// plane = hull->planes + node->planenum;
|
||||
// !!! if the size of dclipnode_t changes, the scaling of %eax needs to be
|
||||
// changed !!!
|
||||
movl nd_planenum(%edi,%eax,8),%ecx
|
||||
movl nd_children(%edi,%eax,8),%eax
|
||||
movl %eax,%esi
|
||||
rorl $16,%eax
|
||||
leal (%ecx,%ecx,4),%ecx
|
||||
|
||||
// if (plane->type < 3)
|
||||
// d = p[plane->type] - plane->dist;
|
||||
movb pl_type(%ebp,%ecx,4),%bl
|
||||
cmpb $3,%bl
|
||||
jb Lnodot
|
||||
|
||||
// else
|
||||
// d = DotProduct (plane->normal, p) - plane->dist;
|
||||
flds pl_normal(%ebp,%ecx,4)
|
||||
fmuls 0(%edx)
|
||||
flds pl_normal+4(%ebp,%ecx,4)
|
||||
fmuls 4(%edx)
|
||||
flds pl_normal+8(%ebp,%ecx,4)
|
||||
fmuls 8(%edx)
|
||||
fxch %st(1)
|
||||
faddp %st(0),%st(2)
|
||||
faddp %st(0),%st(1)
|
||||
fsubs pl_dist(%ebp,%ecx,4)
|
||||
jmp Lsub
|
||||
|
||||
Lnodot:
|
||||
flds pl_dist(%ebp,%ecx,4)
|
||||
fsubrs (%edx,%ebx,4)
|
||||
|
||||
Lsub:
|
||||
sarl $16,%eax
|
||||
sarl $16,%esi
|
||||
|
||||
// if (d < 0)
|
||||
// num = node->children[1];
|
||||
// else
|
||||
// num = node->children[0];
|
||||
fstps Ltemp
|
||||
movl Ltemp,%ecx
|
||||
sarl $31,%ecx
|
||||
andl %ecx,%esi
|
||||
xorl $0xFFFFFFFF,%ecx
|
||||
andl %ecx,%eax
|
||||
orl %esi,%eax
|
||||
jns Lhloop
|
||||
|
||||
// return num;
|
||||
Lhdone:
|
||||
popl %esi
|
||||
popl %ebp
|
||||
popl %ebx // restore register variables
|
||||
|
||||
Lhquickout:
|
||||
popl %edi
|
||||
|
||||
ret
|
||||
|
||||
#endif // USE_INTEL_ASM
|
||||
|
Loading…
Reference in a new issue