diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index bb78e4ba4..22fe4cddb 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -7105,7 +7105,7 @@ int menuselect(void) if ((currentlist == 0 && findfiles) || (currentlist == 1 && finddirs)) currentlist = 1-currentlist; } - else if ((ch == 75) || (ch == 72)) + else if (keystatus[0xc8] /*(ch == 75) || (ch == 72)*/) { if (currentlist == 0) { @@ -7116,7 +7116,7 @@ int menuselect(void) if (findfileshigh && findfileshigh->prev) findfileshigh = findfileshigh->prev; } } - else if ((ch == 77) || (ch == 80)) + else if (keystatus[0xd0] /*(ch == 77) || (ch == 80)*/) { if (currentlist == 0) { diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 162393d13..42485bea5 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -4412,25 +4412,22 @@ static void Keys3d(void) // DoWater(horiz); - i = totalclock; - if (i != clockval[clockcnt]) + if (totalclock != clockval[clockcnt]) { - rate=(120<<4)/(i-clockval[clockcnt])-1; + rate=(120*AVERAGEFRAMES)/(totalclock-clockval[clockcnt]); + clockval[clockcnt] = totalclock; if (framerateon) { - int p = 8*4; + int x = (xdimgame <= 640); + int p = 32>>x; - Bsprintf(tempbuf,"%4d",rate); - if (xdimgame <= 640) p >>= 1; - - begindrawing(); - printext256(xdimgame-p-1,2,0,-1,tempbuf,!(xdimgame > 640)); - printext256(xdimgame-p-2,1,rate < 40?248:whitecol,-1,tempbuf,!(xdimgame > 640)); + Bsprintf(tempbuf,"%4d",max(rate,0)); + printext256(xdimgame-p-1+1,0+2,0,-1,tempbuf,x); + printext256(xdimgame-p-1,0+1,(rate < 40) ? COLOR_RED : COLOR_WHITE,-1,tempbuf,x); enddrawing(); } } - clockval[clockcnt] = i; - clockcnt = ((clockcnt+1)&15); + clockcnt = ((clockcnt+1)&(AVERAGEFRAMES-1)); tempbuf[0] = 0; if (bstatus&4 && !(bstatus&(1|2)) && !unrealedlook) //PK diff --git a/polymer/eduke32/source/mapster32.h b/polymer/eduke32/source/mapster32.h index a509541fa..34e49030b 100644 --- a/polymer/eduke32/source/mapster32.h +++ b/polymer/eduke32/source/mapster32.h @@ -47,7 +47,11 @@ extern short temppicnum, tempcstat, templotag, temphitag, tempextra; extern unsigned char temppal, tempvis, tempxrepeat, tempyrepeat, somethingintab; extern signed char tempshade; -static int ototalclock = 0, clockval[16], clockcnt = 0; +#define AVERAGEFRAMES 128 +#define COLOR_RED 248 +#define COLOR_WHITE 31 + +static int ototalclock = 0, clockval[AVERAGEFRAMES], clockcnt = 0; #define NUMOPTIONS 9 #define NUMKEYS 19