From 2bec2527b4a875c7f34bca7c208781281fba7b39 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 4 Apr 2020 14:30:50 +0900 Subject: [PATCH] [gamecode] Re-expose PR_LoadStrings It's required for qfprogs now that PR_LoadDebug reads strings early. --- include/QF/progs.h | 7 +++++++ libs/gamecode/pr_strings.c | 2 +- tools/qfcc/source/qfprogs.c | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/QF/progs.h b/include/QF/progs.h index abc92f7f5..8a78926bf 100644 --- a/include/QF/progs.h +++ b/include/QF/progs.h @@ -1254,6 +1254,13 @@ int PR_RelocateBuiltins (progs_t *pr); */ void PR_Strings_Init (progs_t *pr); +/** Initialize the string tables using the strings supplied by the progs. + Called automatically during progs load. + \param pr pointer to ::progs_t VM struct + \return true for success, false for failure +*/ +int PR_LoadStrings (progs_t *pr); + /** Check the validity of a string index. \param pr pointer to ::progs_t VM struct \param num string index to be validated diff --git a/libs/gamecode/pr_strings.c b/libs/gamecode/pr_strings.c index 00a7d67df..89d5ee60f 100644 --- a/libs/gamecode/pr_strings.c +++ b/libs/gamecode/pr_strings.c @@ -229,7 +229,7 @@ pr_strings_clear (progs_t *pr, void *data) pr->pr_xtstr = 0; } -static int +VISIBLE int PR_LoadStrings (progs_t *pr) { prstr_resources_t *res = PR_Resources_Find (pr, "Strings"); diff --git a/tools/qfcc/source/qfprogs.c b/tools/qfcc/source/qfprogs.c index 8a8f2ffc0..787c9068a 100644 --- a/tools/qfcc/source/qfprogs.c +++ b/tools/qfcc/source/qfprogs.c @@ -289,6 +289,7 @@ load_progs (const char *name) return 0; PR_ResolveGlobals (&pr); + PR_LoadStrings (&pr); PR_LoadDebug (&pr); } for (i = 0; i < pr.progs->numfunctions; i++) {