X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=pr_exec.c;h=640140f2148cfc209f2972859df10ba0ba32cab1;hb=c369fcf631b61d72c598ae37b01fc89a318044ae;hp=a631a7e3259ac66d5aa3f34da98c4631998caea7;hpb=d634ac06383b4927e3354605e5261902eed22e99;p=xonotic%2Fdarkplaces.git diff --git a/pr_exec.c b/pr_exec.c index a631a7e3..640140f2 100644 --- a/pr_exec.c +++ b/pr_exec.c @@ -27,7 +27,7 @@ typedef struct dfunction_t *f; } prstack_t; -#define MAX_STACK_DEPTH 32 +#define MAX_STACK_DEPTH 256 prstack_t pr_stack[MAX_STACK_DEPTH]; int pr_depth = 0; @@ -36,7 +36,7 @@ int localstack[LOCALSTACK_SIZE]; int localstack_used; -qboolean pr_trace; +int pr_trace; dfunction_t *pr_xfunction; int pr_xstatement; @@ -146,7 +146,7 @@ PR_PrintStatement void PR_PrintStatement (dstatement_t *s) { int i; - + if ( (unsigned)s->op < sizeof(pr_opnames)/sizeof(pr_opnames[0])) { Con_Printf ("%s ", pr_opnames[s->op]); @@ -154,7 +154,7 @@ void PR_PrintStatement (dstatement_t *s) for ( ; i<10 ; i++) Con_Printf (" "); } - + if (s->op == OP_IF || s->op == OP_IFNOT) Con_Printf ("%sbranch %i",PR_GlobalString((unsigned short) s->a),s->b); else if (s->op == OP_GOTO) @@ -163,15 +163,15 @@ void PR_PrintStatement (dstatement_t *s) } else if ( (unsigned)(s->op - OP_STORE_F) < 6) { - Con_Printf ("%s",PR_GlobalString((unsigned short) s->a)); + Con_Printf ("%s", PR_GlobalString((unsigned short) s->a)); Con_Printf ("%s", PR_GlobalStringNoContents((unsigned short) s->b)); } else { if (s->a) - Con_Printf ("%s",PR_GlobalString((unsigned short) s->a)); + Con_Printf ("%s", PR_GlobalString((unsigned short) s->a)); if (s->b) - Con_Printf ("%s",PR_GlobalString((unsigned short) s->b)); + Con_Printf ("%s", PR_GlobalString((unsigned short) s->b)); if (s->c) Con_Printf ("%s", PR_GlobalStringNoContents((unsigned short) s->c)); } @@ -197,7 +197,7 @@ void PR_StackTrace (void) if (!f) Con_Printf ("\n"); else - Con_Printf ("%12s : %s : statement %i\n", pr_strings + f->s_file, pr_strings + f->s_name, pr_stack[i].s - f->first_statement); + Con_Printf ("%12s : %s : statement %i\n", PR_GetString(f->s_file), PR_GetString(f->s_name), pr_stack[i].s - f->first_statement); } } @@ -232,7 +232,7 @@ void PR_Profile_f (void) if (best) { if (num < 10) - Con_Printf ("%7i %s\n", best->profile, pr_strings+best->s_name); + Con_Printf ("%7i %s\n", best->profile, PR_GetString(best->s_name)); num++; best->profile = 0; } @@ -243,7 +243,7 @@ void PR_Profile_f (void) void PR_Crash(void) { int i; - if (!pr_depth) + if (pr_depth < 1) { // kill the stack just to be sure pr_depth = 0; @@ -348,11 +348,14 @@ int PR_LeaveFunction (void) return pr_stack[pr_depth].s; } +void PR_ReInitStrings (void); void PR_Execute_ProgsLoaded(void) { // dump the stack pr_depth = 0; localstack_used = 0; + // reset the string table + PR_ReInitStrings(); } /* @@ -424,3 +427,6 @@ chooseexecprogram: } } +void PR_ReInitStrings (void) +{ +}