From 5c943d4ca92c89112d10f5c2d93135931e450a49 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 7 Jun 2002 19:41:13 +0000 Subject: [PATCH] this should speed up progs a little bit --- libs/gamecode/engine/pr_exec.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/gamecode/engine/pr_exec.c b/libs/gamecode/engine/pr_exec.c index 9e470d1db..b0e8b893c 100644 --- a/libs/gamecode/engine/pr_exec.c +++ b/libs/gamecode/engine/pr_exec.c @@ -268,9 +268,9 @@ PR_LeaveFunction (progs_t * pr) return pr->pr_stack[pr->pr_depth].s; } -#define OPA (pr->pr_globals[st->a]) -#define OPB (pr->pr_globals[st->b]) -#define OPC (pr->pr_globals[st->c]) +#define OPA (*op_a) +#define OPB (*op_b) +#define OPC (*op_c) /* This gets around the problem of needing to test for -0.0 but denormals @@ -312,12 +312,18 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum) startprofile = profile = 0; while (1) { + pr_type_t *op_a, *op_b, *op_c; + st++; if (++profile > 1000000 && !pr->no_exec_limit) { pr->pr_xstatement = st - pr->pr_statements; PR_RunError (pr, "runaway loop error"); } + op_a = pr->pr_globals + st->a; + op_b = pr->pr_globals + st->b; + op_c = pr->pr_globals + st->c; + if (pr->pr_trace) PR_PrintStatement (pr, st);