From a365fa4daedfcac66cd4f85319559c83f6289d4e Mon Sep 17 00:00:00 2001 From: blub0 Date: Sun, 13 Jul 2008 18:22:27 +0000 Subject: [PATCH] Changed mapvoting to use %i. instead of %i) as SavageX requested :P Added pre.qh which enables the FTE target if -DUSE_FTE is added which automagically adds an engine check, which should be updated once the FTE instructions make it into DP. Updated the Makefile for that too. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3820 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/Makefile | 11 +++-------- data/qcsrc/client/Main.qc | 20 +++++++++----------- data/qcsrc/client/mapvoting.qc | 12 ++++++------ data/qcsrc/client/pre.qh | 3 +++ data/qcsrc/client/progs.src | 1 + 5 files changed, 22 insertions(+), 25 deletions(-) create mode 100644 data/qcsrc/client/pre.qh diff --git a/data/Makefile b/data/Makefile index 38c60b2a1..0a4908fd5 100644 --- a/data/Makefile +++ b/data/Makefile @@ -3,14 +3,9 @@ PERL ?= perl PK3NAME ?= `date +../data%Y%m%d.pk3` ZIP ?= 7za a -tzip -mx=9 -# -Fparm: define PARM0, RETURN, etc. for use in asm{} -# This will make it possible to make a non-FTE asm{} block -# checking if the client's engine supports -TFTE. -# At some point CSQC should use -TFTE too, and then, for at least -# some time, it would be useful to have a well-formatted error message -# followed by localcmd("disconnect") if the client doesn't support -TFTE -# instead of letting him guess what the huge QCVM error message means... -QCFLAGS_CSQC ?= -Fparm +# NOTE: use -DUSE_FTE instead of -TFTE here! +# It will automagically add an engine check with -TID and then change back to -TFTE +QCFLAGS_CSQC ?= # to be enabled when possible # QCFLAGS_SVQC ?= -TFTE diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index b1b37811b..5802ad272 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -27,18 +27,16 @@ void testpassedyay() { void CSQC_Init(void) { -#if 0 - asm { - STORE_F "DP_SV_WRITEPICTURE" PARM0; - CALL1 checkextension; - STORE_F RETURN __engine_check; - IF __engine_check 6; - STORE_F "^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n" PARM0; - CALL1 print; - STORE_F "\ndisconnect\n" PARM0; - CALL1 localcmd; - DONE; +#ifdef USE_FTE +#pragma target ID + __engine_check = checkextension("DP_SV_WRITEPICTURE"); + if(!__engine_check) + { + print("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n"); + localcmd("\ndisconnect\n"); + return; } +#pragma target FTE #else __engine_check = true; #endif diff --git a/data/qcsrc/client/mapvoting.qc b/data/qcsrc/client/mapvoting.qc index 863b372b9..865f4e70c 100644 --- a/data/qcsrc/client/mapvoting.qc +++ b/data/qcsrc/client/mapvoting.qc @@ -24,9 +24,9 @@ void MapVote_DrawMapItem(vector pos, float isize, string map, string pic, float pos_y += img_size_y*0.5; if(id == mv_ownvote) - drawstring(pos - '40 0', strcat(ftos(id+1), ")"), img_size, '1 1 0', 1, DRAWFLAG_NORMAL); + drawstring(pos - '40 0', strcat(ftos(id+1), "."), img_size, '1 1 0', 1, DRAWFLAG_NORMAL); else - drawstring(pos - '40 0', strcat(ftos(id+1), ")"), img_size, '1 1 1', 1, DRAWFLAG_NORMAL); + drawstring(pos - '40 0', strcat(ftos(id+1), "."), img_size, '1 1 1', 1, DRAWFLAG_NORMAL); // half again for the mapname img_size = img_size * 0.5; // *= broken??? @@ -57,9 +57,9 @@ void MapVote_DrawMapNotAvailable(vector pos, float isize, string map, float coun pos_y += img_size_y*0.5; if(id == mv_ownvote) - drawstring(pos - '40 0', strcat(ftos(id+1), ")"), img_size, '1 1 0', 1, DRAWFLAG_NORMAL); + drawstring(pos - '40 0', strcat(ftos(id+1), "."), img_size, '1 1 0', 1, DRAWFLAG_NORMAL); else - drawstring(pos - '40 0', strcat(ftos(id+1), ")"), img_size, '1 1 1', 1, DRAWFLAG_NORMAL); + drawstring(pos - '40 0', strcat(ftos(id+1), "."), img_size, '1 1 1', 1, DRAWFLAG_NORMAL); img_size = img_size * 0.5; // *= broken??? pos_y += img_size_y*0.5; @@ -81,9 +81,9 @@ void MapVote_DrawAbstain(vector pos, float isize, float count, float id) pos_y += img_size_y*0.5; if(id == mv_ownvote) - drawstring(pos - '40 0', strcat(ftos(id+1), ")"), img_size, '1 1 0', 1, DRAWFLAG_NORMAL); + drawstring(pos - '40 0', strcat(ftos(id+1), "."), img_size, '1 1 0', 1, DRAWFLAG_NORMAL); else - drawstring(pos - '40 0', strcat(ftos(id+1), ")"), img_size, '1 1 1', 1, DRAWFLAG_NORMAL); + drawstring(pos - '40 0', strcat(ftos(id+1), "."), img_size, '1 1 1', 1, DRAWFLAG_NORMAL); img_size = img_size * 0.5; // *= broken??? pos_y += img_size_y*0.5; diff --git a/data/qcsrc/client/pre.qh b/data/qcsrc/client/pre.qh new file mode 100644 index 000000000..706da5ed1 --- /dev/null +++ b/data/qcsrc/client/pre.qh @@ -0,0 +1,3 @@ +#ifdef USE_FTE +#pragma target FTE +#endif diff --git a/data/qcsrc/client/progs.src b/data/qcsrc/client/progs.src index ca960441b..40b27d5b4 100644 --- a/data/qcsrc/client/progs.src +++ b/data/qcsrc/client/progs.src @@ -1,4 +1,5 @@ ../../csprogs.dat +pre.qh Defs.qc csqc_constants.qc -- 2.39.2