Merge branch 'master' of git://git.quakeforge.net/gitroot/quake/quakeforge

This commit is contained in:
Bill Currie 2010-11-21 09:57:59 +09:00
commit 9b5277fca9
10 changed files with 113 additions and 67 deletions

View file

@ -49,15 +49,15 @@ if test -n "$lt" ; then
LTIZE_VER_MAJOR=`echo $LTIZE_VER | cut -f1 -d'.'`
LTIZE_VER_MINOR=`echo $LTIZE_VER | cut -f2 -d'.' | sed -e 's/[^0-9]//g'`
if test "$LTIZE_VER_MAJOR" -lt "2"; then
errors="Libtool 1.4 or greater needed to build configure.\n$errors"
if test "$LTIZE_VER_MAJOR" -lt "1"; then
errors="Libtool 1.5 or greater needed to build configure.\n$errors"
fi
if test "$LTIZE_VER_MAJOR" -eq "2" -a "$LTIZE_VER_MINOR" -lt "2" ; then
errors="Libtool 1.4 or greater needed to build configure.\n$errors"
if test "$LTIZE_VER_MAJOR" -eq "1" -a "$LTIZE_VER_MINOR" -lt "5" ; then
errors="Libtool 1.5 or greater needed to build configure.\n$errors"
fi
fi
else
errors="Libtool not found. QuakeForge CVS requires libtool to bootstrap itself.\n$errors"
errors="Libtool not found. QuakeForge git requires libtool to bootstrap itself.\n$errors"
fi
# Check Autoconf version
@ -69,15 +69,15 @@ if test -n "$ac" ; then
AC_VER_MINOR=`echo $AC_VER | cut -f2 -d'.' | sed 's/[^0-9]*$//'`
if test "$AC_VER_MAJOR" -lt "2" ; then
errors="Autoconf 2.67 or greater needed to build configure.\n$errors"
errors="Autoconf 2.61 or greater needed to build configure.\n$errors"
fi
if test "$AC_VER_MAJOR" -eq "2" -a "$AC_VER_MINOR" -lt "65" ; then
errors="Autoconf 2.65 or greater needed to build configure.\n$errors"
if test "$AC_VER_MAJOR" -eq "2" -a "$AC_VER_MINOR" -lt "61" ; then
errors="Autoconf 2.61 or greater needed to build configure.\n$errors"
fi
fi
else
errors="Autoconf not found. QuakeForge CVS requires autoconf to bootstrap itself.\n$errors"
errors="Autoconf not found. QuakeForge git requires autoconf to bootstrap itself.\n$errors"
fi
am=`which automake`
@ -87,14 +87,14 @@ if test -n "$am" ; then
AM_VER_MAJOR=`echo $AM_VER | cut -f1 -d.`
AM_VER_MINOR=`echo $AM_VER | cut -f2 -d.`
if test "$AM_VER_MAJOR" -lt "1"; then
errors="Automake 1.6 or greater needed to build makefiles.\n$errors"
errors="Automake 1.10 or greater needed to build makefiles.\n$errors"
fi
if test "$AM_VER_MAJOR" -eq "1" -a "$AM_VER_MINOR" -lt "11"; then
errors="Automake 1.11 or greater needed to build makefiles.\n$errors"
if test "$AM_VER_MAJOR" -eq "1" -a "$AM_VER_MINOR" -lt "10"; then
errors="Automake 1.10 or greater needed to build makefiles.\n$errors"
fi
fi
else
errors="Automake not found. QuakeForge CVS requires automake to bootstrap itself.\n$errors"
errors="Automake not found. QuakeForge git requires automake to bootstrap itself.\n$errors"
fi
if test -n "$errors" ; then

View file

@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.65)
AC_PREREQ(2.61)
dnl This is the only place where the package name and version appear
AC_INIT([QuakeForge], [git-master])
@ -10,7 +10,8 @@ if test "x${CFLAGS-unset}" = xunset; then
CFLAGS=""
fi
saved_CFLAGS="$CFLAGS"
LT_INIT([win32-dll])
dnl LT_INIT([win32-dll])
AM_PROG_LIBTOOL
CFLAGS="$saved_CFLAGS"
AC_REVISION([$Revision$]) dnl

2
debian/control vendored
View file

@ -3,7 +3,7 @@ Section: contrib/games
Priority: optional
Maintainer: Jeff Teunissen <deek@debian.org>
Standards-Version: 3.1.1
Build-Depends: automake (>= 1.8) | automake1.8, autoconf, libtool, bison, flex, debhelper, libsdl1.2-dev, zlib1g-dev, libncurses5-dev, xorg-dev | xlibs-dev (>= 4), libasound2-dev, libogg-dev, libvorbis-dev, libflac-dev, libpng12-dev
Build-Depends: automake (>= 1.8) | automake1.8, autoconf, libtool, bison, flex, debhelper, libsdl1.2-dev, zlib1g-dev, libncurses5-dev, xorg-dev | xlibs-dev (>= 4), libasound2-dev, libogg-dev, libvorbis-dev, libflac-dev, libpng12-dev, libsamplerate0-dev, git-core, x11proto-xf86vidmode-dev
Package: quakeforge
Architecture: any

4
debian/rules vendored
View file

@ -38,7 +38,7 @@ configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
if test -d CVS; then ./bootstrap; fi
if test -d .git; then ./bootstrap; fi
./configure --prefix=/usr $(RETARGET) --bindir=/usr/games \
--without-fbdev \
--disable-xmms \
@ -60,7 +60,7 @@ build-stamp:
changelog-stamp:
dh_testdir
# Add here commands to build the changelog
if test -d CVS; then $(MAKE) changelog; fi
if test -d .git; then $(MAKE) changelog; fi
touch $@
clean:

View file

@ -302,6 +302,8 @@ I_OGGMus_Play (int track, qboolean looping)
if (playing)
I_OGGMus_Stop ();
if (!track)
return;
I_OGGMus_SetPlayList (track);
I_OGGMus_PlayNext (looping);
}

View file

@ -539,6 +539,8 @@ PR_DumpState (progs_t *pr)
PR_StackTrace (pr);
}
#define ISDENORM(x) ((x) && !((x) & 0x7f800000))
static const char *
value_string (progs_t *pr, etype_t type, pr_type_t *val)
{
@ -611,7 +613,10 @@ value_string (progs_t *pr, etype_t type, pr_type_t *val)
case ev_void:
return "void";
case ev_float:
dsprintf (line, "%g", val->float_var);
if (ISDENORM (val->integer_var) && val->uinteger_var != 0x80000000)
dsprintf (line, "<%08x>", val->integer_var);
else
dsprintf (line, "%g", val->float_var);
break;
case ev_vector:
dsprintf (line, "'%g %g %g'",
@ -882,6 +887,24 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents)
case 'O':
str = va ("%04x", addr + (short) opval);
break;
case 'E':
{
edict_t *ed;
opval = pr->pr_globals[s->a].entity_var;
parm_ind = pr->pr_globals[s->b].uinteger_var;
if (parm_ind < pr->progs->entityfields
&& opval >= 0
&& opval < pr->pr_edictareasize) {
ed = PROG_TO_EDICT (pr, opval);
opval = &ed->v[parm_ind] - pr->pr_globals;
} else {
str = "bad entity.field";
break;
}
str = global_string (pr, opval, optype, contents & 1);
str = va ("%d %d %s", s->a, s->b, str);
}
break;
default:
goto err;
}

View file

@ -100,11 +100,13 @@ free_progs_mem (progs_t *pr, void *mem)
}
VISIBLE void
PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone)
PR_LoadProgsFile (progs_t *pr, QFile *file, int size, int edicts, int zone)
{
size_t i;
int mem_size;
int offset_tweak;
dprograms_t progs;
byte *base;
if (!pr->file_error)
pr->file_error = file_error;
@ -152,8 +154,13 @@ PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone)
}
}
// Some compilers (eg, FTE) put extra data between the header and the
// strings section. What's worse, they de-align the data.
offset_tweak = progs.ofs_strings % sizeof (pr_int_t);
offset_tweak = (sizeof (pr_int_t) - offset_tweak) % sizeof (pr_int_t);
// size of progs themselves
pr->progs_size = size;
pr->progs_size = size + offset_tweak;
Sys_DPrintf ("Programs occupy %iK.\n", size / 1024);
// round off to next highest whole word address (esp for Alpha)
// this ensures that pointers in the engine data area are always
@ -187,9 +194,10 @@ PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone)
((byte *) pr->progs)[mem_size] = 0;
memcpy (pr->progs, &progs, sizeof (progs));
Qread (file, pr->progs + 1, size - sizeof (progs));
CRC_ProcessBlock ((byte *)(pr->progs + 1), &pr->crc,
size - sizeof (progs));
base = (byte *) (pr->progs + 1) + offset_tweak;
Qread (file, base, size - sizeof (progs));
CRC_ProcessBlock (base, &pr->crc, size - sizeof (progs));
base -= sizeof (progs); // offsets are from file start
if (pr->edicts)
*pr->edicts = (edict_t *)((byte *) pr->progs + pr->progs_size);
@ -199,18 +207,14 @@ PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone)
PR_Zone_Init (pr);
pr->pr_functions =
(dfunction_t *) ((byte *) pr->progs + pr->progs->ofs_functions);
pr->pr_strings = (char *) pr->progs + pr->progs->ofs_strings;
pr->pr_stringsize = (char *) pr->zone + pr->zone_size - (char *) pr->progs;
pr->pr_globaldefs =
(ddef_t *) ((byte *) pr->progs + pr->progs->ofs_globaldefs);
pr->pr_fielddefs =
(ddef_t *) ((byte *) pr->progs + pr->progs->ofs_fielddefs);
pr->pr_statements =
(dstatement_t *) ((byte *) pr->progs + pr->progs->ofs_statements);
(dfunction_t *) (base + pr->progs->ofs_functions);
pr->pr_strings = (char *) base + pr->progs->ofs_strings;
pr->pr_stringsize = (char *) pr->zone + pr->zone_size - (char *) base;
pr->pr_globaldefs = (ddef_t *) (base + pr->progs->ofs_globaldefs);
pr->pr_fielddefs = (ddef_t *) (base + pr->progs->ofs_fielddefs);
pr->pr_statements = (dstatement_t *) (base + pr->progs->ofs_statements);
pr->pr_globals =
(pr_type_t *) ((byte *) pr->progs + pr->progs->ofs_globals);
pr->pr_globals = (pr_type_t *) (base + pr->progs->ofs_globals);
pr->globals_size = (pr_type_t*)((byte *) pr->zone + pr->zone_size)
- pr->pr_globals;

View file

@ -98,6 +98,7 @@ VISIBLE const char *pr_type_name[ev_type_count] = {
// P function parameter
// F function (must come before any P)
// R return value
// E entity + field (%Eab)
//
// a operand a
// b operand b
@ -266,52 +267,52 @@ VISIBLE opcode_t pr_opcodes[] = {
{".", "load.f", OP_LOAD_F, false,
ev_entity, ev_field, ev_float,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",//FIXME %E more flexible?
},
{".", "load.v", OP_LOAD_V, false,
ev_entity, ev_field, ev_vector,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.q", OP_LOAD_Q, false,
ev_entity, ev_field, ev_quat,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.s", OP_LOAD_S, false,
ev_entity, ev_field, ev_string,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.ent", OP_LOAD_ENT, false,
ev_entity, ev_field, ev_entity,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.fld", OP_LOAD_FLD, false,
ev_entity, ev_field, ev_field,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.fn", OP_LOAD_FN, false,
ev_entity, ev_field, ev_func,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.i", OP_LOAD_I, false,
ev_entity, ev_field, ev_integer,
PROG_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.u", OP_LOAD_U, false,
ev_entity, ev_field, ev_uinteger,
PROG_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "load.p", OP_LOAD_P, false,
ev_entity, ev_field, ev_pointer,
PROG_VERSION,
"%Ga.%Gb, %gc",
"%Ga.%Gb(%Ec), %gc",
},
{".", "loadb.f", OP_LOADB_F, false,
@ -419,6 +420,7 @@ VISIBLE opcode_t pr_opcodes[] = {
{"&", "address", OP_ADDRESS, false,
ev_entity, ev_field, ev_pointer,
PROG_ID_VERSION,
"%Ga.%Gb, %gc",
},
{"&", "address.f", OP_ADDRESS_F, false,
@ -1202,9 +1204,10 @@ check_branch (progs_t *pr, dstatement_t *st, opcode_t *op, short offset)
static inline void
check_global (progs_t *pr, dstatement_t *st, opcode_t *op, etype_t type,
unsigned short operand)
unsigned short operand, int check_denorm)
{
const char *msg;
ddef_t *def;
switch (type) {
case ev_short:
@ -1221,11 +1224,19 @@ check_global (progs_t *pr, dstatement_t *st, opcode_t *op, etype_t type,
msg = "out of bounds global index";
goto error;
}
if (type == ev_float)
if (ISDENORM (G_INT (pr, operand))
&& !pr->denorm_found) {
if (type != ev_float || !check_denorm)
break;
if (!ISDENORM (G_INT (pr, operand))
|| G_UINT(pr, operand) == 0x80000000)
break;
if ((def = PR_GlobalAtOfs (pr, operand))
&& (def->type & ~DEF_SAVEGLOBAL) != ev_float) {
// FTEqcc uses store.f parameters of most types :/
break;
}
if (!pr->denorm_found) {
pr->denorm_found = 1;
if (pr_boundscheck-> int_val) {
if (pr_boundscheck->int_val) {
Sys_Printf ("DENORMAL floats detected, these progs might "
"not work. Good luck.\n");
return;
@ -1303,7 +1314,7 @@ PR_Check_Opcodes (progs_t *pr)
switch (st->op) {
case OP_IF:
case OP_IFNOT:
check_global (pr, st, op, op->type_a, st->a);
check_global (pr, st, op, op->type_a, st->a, 1);
check_branch (pr, st, op, st->b);
break;
case OP_GOTO:
@ -1311,12 +1322,12 @@ PR_Check_Opcodes (progs_t *pr)
break;
case OP_DONE:
case OP_RETURN:
check_global (pr, st, op, ev_integer, st->a);
check_global (pr, st, op, ev_void, st->b);
check_global (pr, st, op, ev_void, st->c);
check_global (pr, st, op, ev_integer, st->a, 1);
check_global (pr, st, op, ev_void, st->b, 0);
check_global (pr, st, op, ev_void, st->c, 0);
break;
case OP_RCALL1:
check_global (pr, st, op, ev_void, st->c);
check_global (pr, st, op, ev_void, st->c, 1);
case OP_RCALL2:
case OP_RCALL3:
case OP_RCALL4:
@ -1325,9 +1336,9 @@ PR_Check_Opcodes (progs_t *pr)
case OP_RCALL7:
case OP_RCALL8:
if (st->op > OP_RCALL1)
check_global (pr, st, op, ev_integer, st->c);
check_global (pr, st, op, ev_integer, st->b);
check_global (pr, st, op, ev_func, st->a);
check_global (pr, st, op, ev_integer, st->c, 1);
check_global (pr, st, op, ev_integer, st->b, 1);
check_global (pr, st, op, ev_func, st->a, 1);
break;
case OP_STATE:
case OP_STATE_F:
@ -1335,18 +1346,19 @@ PR_Check_Opcodes (progs_t *pr)
PR_Error (pr, "PR_Check_Opcodes: %s used with missing "
"fields or globals", op->opname);
}
check_global (pr, st, op, op->type_a, st->a);
check_global (pr, st, op, op->type_b, st->b);
check_global (pr, st, op, op->type_c, st->c);
check_global (pr, st, op, op->type_a, st->a, 1);
check_global (pr, st, op, op->type_b, st->b, 1);
check_global (pr, st, op, op->type_c, st->c, 1);
break;
case OP_MOVE:
check_global_size (pr, st, op, st->b, st->a);
check_global_size (pr, st, op, st->b, st->c);
break;
default:
check_global (pr, st, op, op->type_a, st->a);
check_global (pr, st, op, op->type_b, st->b);
check_global (pr, st, op, op->type_c, st->c);
check_global (pr, st, op, op->type_a, st->a, 1);
check_global (pr, st, op, op->type_b, st->b,
op->opcode != OP_STORE_F);
check_global (pr, st, op, op->type_c, st->c, 0);
break;
}
}

View file

@ -1090,7 +1090,7 @@ Draw_FadeScreen (void)
((byte *) vid.buffer + vid.rowbytes * y);
pbuf = (unsigned short *) vid.buffer + (vid.rowbytes >> 1) * y;
for (x = 0; x < vid.conwidth; x++)
pbuf[x] = (pbuf[x] >>= 1) & 0x7BEF;
pbuf[x] = (pbuf[x] >> 1) & 0x7BEF;
}
}
break;
@ -1100,7 +1100,7 @@ Draw_FadeScreen (void)
unsigned int *pbuf = (unsigned int *)
((byte *) vid.buffer + vid.rowbytes * y);
for (x = 0; x < vid.conwidth; x++)
pbuf[x] = (pbuf[x] >>= 1) & 0x7F7F7F7F;
pbuf[x] = (pbuf[x] >> 1) & 0x7F7F7F7F;
}
}
break;

View file

@ -55,7 +55,11 @@ static __attribute__ ((used)) const char rcsid[] =
#endif
#ifdef HAVE_VIDMODE
# include <X11/extensions/xf86vmode.h>
# include <X11/extensions/xf86vmproto.h>
# ifdef DGA_OLD_HEADERS
# include <X11/extensions/xf86vmstr.h>
# else
# include <X11/extensions/xf86vmproto.h>
# endif
#endif
#include "QF/sys.h"