From a8287f676fde28a533b5ff48f4b66cda6731e3c0 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 May 2016 04:46:18 +0000 Subject: [PATCH] KenBuild: Fix mul3 and sqr pragmas. git-svn-id: https://svn.eduke32.com/eduke32@5735 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/pragmas.h | 2 ++ polymer/eduke32/source/testgame/src/bstub.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/include/pragmas.h b/polymer/eduke32/build/include/pragmas.h index c61be75ba..c2032b710 100644 --- a/polymer/eduke32/build/include/pragmas.h +++ b/polymer/eduke32/build/include/pragmas.h @@ -136,6 +136,8 @@ FORCE_INLINE void swapptr(void *a, void *b) *(intptr_t*) b = t; } +FORCE_INLINE int32_t sqr(int32_t a) { return a * a; } + #if defined(__GNUC__) && defined(GEKKO) // GCC Inline Assembler version (PowerPC) diff --git a/polymer/eduke32/source/testgame/src/bstub.c b/polymer/eduke32/source/testgame/src/bstub.c index bfd31dc7f..cb967f1c3 100644 --- a/polymer/eduke32/source/testgame/src/bstub.c +++ b/polymer/eduke32/source/testgame/src/bstub.c @@ -371,7 +371,7 @@ void ExtCheckKeys(void) i = frameval[framecnt&(AVERAGEFRAMES-1)]; j = frameval[framecnt&(AVERAGEFRAMES-1)] = getticks(); framecnt++; - if (i != j) averagefps = ((mul3(averagefps)+((AVERAGEFRAMES*1000)/(j-i)))>>2); + if (i != j) averagefps = (averagefps*3 + (AVERAGEFRAMES*1000)/(j-i))>>2; Bsprintf((char *)tempbuf,"%d",averagefps); printext256(0L,0L,31,-1,(char *)tempbuf,1);