From 0d61f3bc550ab0fabe2f78ed01d5e112b2797ef2 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 19 Jun 2006 19:28:49 +0000 Subject: [PATCH] Minor gamevar stuff git-svn-id: https://svn.eduke32.com/eduke32@193 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 2 +- polymer/eduke32/source/duke3d.h | 6 +++-- polymer/eduke32/source/game.c | 14 ++++++++---- polymer/eduke32/source/gamedef.c | 39 +++++++++++++------------------- polymer/eduke32/source/global.c | 2 ++ 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index efaf378a4..20858d591 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -3283,7 +3283,7 @@ void movetransports(void) ps[p].jumping_toggle = 1; ps[p].jumping_counter = 0; -// ps[p].poszv += 1024; + // ps[p].poszv += 1024; } if(k == 1) diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index d33268095..775e873c5 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -252,7 +252,7 @@ enum weapons { #define ESCESCAPE if(KB_KeyPressed( sc_Escape ) ) gameexit(" "); #define IFWITHIN(B,E) if((PN)>=(B) && (PN)<=(E)) -#define KILLIT(KX) {ResetActorGameVars(KX);deletesprite(KX);goto BOLT;} +#define KILLIT(KX) {deletesprite(KX);goto BOLT;} #define IFMOVING if(ssp(i,CLIPMASK0)) @@ -517,6 +517,8 @@ extern long partime[MAXVOLUMES*11],designertime[MAXVOLUMES*11]; extern char volume_names[MAXVOLUMES][33]; extern char skill_names[5][33]; +extern int framerate; + #define MAXGAMETYPES 32 extern char gametype_names[MAXGAMETYPES][33]; extern int gametype_flags[MAXGAMETYPES]; @@ -705,7 +707,7 @@ enum gamevarflags { GAMEVAR_FLAG_USER_MASK = 3, GAMEVAR_FLAG_DEFAULT = 256, // allow override GAMEVAR_FLAG_SECRET = 512, // don't dump... - GAMEVAR_FLAG_NODEFAULT = 1024, // don't add to 'default' array. + GAMEVAR_FLAG_NODEFAULT = 1024, // don't reset on actor spawn GAMEVAR_FLAG_SYSTEM = 2048, // cannot change mode flags...(only default value) GAMEVAR_FLAG_READONLY = 4096, // values are read-only (no setvar allowed) GAMEVAR_FLAG_PLONG = 8192, // plValue is a pointer to a long diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 995360460..a991e3738 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2038,8 +2038,12 @@ void tics(void) if (i != frameval[framecnt]) { j=(TICRATE*AVERAGEFRAMES)/(i-frameval[framecnt]); - Bsprintf(b,"%ld",j>0?j:0); - minitext(320-strlen(b)*4,ud.screen_size!=0?(ud.multimode>1&&ud.multimode<5?9:(ud.multimode>4?17:1)):1,b,(TICRATE*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26); + if (ud.tickrate && !(ps[myconnectindex].gm&MODE_MENU)) + { + Bsprintf(b,"%ld",j>0?j:0); + minitext(320-strlen(b)*4,ud.screen_size!=0?(ud.multimode>1&&ud.multimode<5?9:(ud.multimode>4?17:1)):1,b,(TICRATE*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26); + } + framerate = j; frameval[framecnt] = i; } framecnt = ((framecnt+1)&(AVERAGEFRAMES-1)); @@ -3020,8 +3024,8 @@ void displayrest(long smoothratio) if(ud.coords) coords(screenpeek); - if(ud.tickrate&&!(ps[myconnectindex].gm&MODE_MENU)) - tics(); + + tics(); // JBF 20040124: display level stats in screen corner if(ud.levelstats && (ps[myconnectindex].gm&MODE_MENU) == 0) { @@ -3815,7 +3819,7 @@ short spawn( short j, short pn ) else { i = pn; - + ResetActorGameVars(i); hittype[i].picnum = PN; hittype[i].timetosleep = 0; hittype[i].extra = -1; diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index a13f98ac1..c13fb9863 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -81,7 +81,6 @@ MATTGAMEVAR aGameVars[MAXGAMEVARS]; int iGameVarCount=0; MATTGAMEVAR aDefaultGameVars[MAXGAMEVARS]; // the 'original' values -int iDefaultGameVarCount=0; void ReportError(int iError); void FreeGameVars(void); @@ -1229,13 +1228,14 @@ void ResetGameVars(void) //AddLog("Reset Game Vars"); FreeGameVars(); - for(i=0;i