From 2b126217969a9291cadda6fcfd5ae71433955d97 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 20 Jan 2011 19:48:16 +0100 Subject: [PATCH] fix compile --- qcsrc/client/Main.qc | 4 +++- qcsrc/common/util.qc | 24 ++++++++++++++++++++++++ qcsrc/common/util.qh | 6 ++++++ qcsrc/menu/menu.qh | 2 -- qcsrc/menu/xonotic/util.qc | 23 ----------------------- qcsrc/menu/xonotic/util.qh | 4 ---- 6 files changed, 33 insertions(+), 30 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 75e7320c9e..f87538a9ee 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -46,6 +46,8 @@ string cl_announcer_prev; void WaypointSprite_Load(); void CSQC_Init(void) { + prvm_language = cvar_string("prvm_language"); + #ifdef USE_FTE #pragma target ID __engine_check = checkextension("DP_SV_WRITEPICTURE"); @@ -57,7 +59,7 @@ void CSQC_Init(void) } #pragma target FTE #endif - + check_unacceptable_compiler_bugs(); #ifdef WATERMARK diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index dcdd74deef..5990f1c9d6 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1982,3 +1982,27 @@ float u8_strsize(string s) } return l; } + +// translation helpers +string language_filename(string s) +{ + string fn; + float fh; + fn = prvm_language; + if(fn == "" || fn == "dump") + return s; + fn = strcat(s, ".", fn); + if((fh = fopen(fn, FILE_READ)) >= 0) + { + fclose(fh); + return fn; + } + return s; +} +string CTX(string s) +{ + float p = strstrofs(s, "^", 0); + if(p < 0) + return s; + return substring(s, p+1, -1); +} diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 79b93d3ede..56cba34cc2 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -249,3 +249,9 @@ vector NearestPointOnBox(entity box, vector org); float vercmp(string v1, string v2); float u8_strsize(string s); + +// translation helpers +string prvm_language; +string language_filename(string s); +string CTX(string s); +#define ZCTX(s) strzone(CTX(s)) diff --git a/qcsrc/menu/menu.qh b/qcsrc/menu/menu.qh index 3188ef0b01..e42595e582 100644 --- a/qcsrc/menu/menu.qh +++ b/qcsrc/menu/menu.qh @@ -41,5 +41,3 @@ void SUB_Null(); float preMenuInit(); // you have to define this for pre-menu initialization. Return 0 if initialization needs to be retried a frame later, 1 if it succeeded. void preMenuDraw(); // this is run before the menu is drawn. You may put some stuff there that has to be done every frame. void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else. - -string prvm_language; diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index b9d6a08d5f..1d21ba4910 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -574,29 +574,6 @@ float GameType_GetCount() return i; } -string language_filename(string s) -{ - string fn; - float fh; - fn = prvm_language; - if(fn == "" || fn == "dump") - return s; - fn = strcat(s, ".", fn); - if((fh = fopen(fn, FILE_READ)) >= 0) - { - fclose(fh); - return fn; - } - return s; -} -string CTX(string s) -{ - float p = strstrofs(s, "^", 0); - if(p < 0) - return s; - return substring(s, p+1, -1); -} - void dialog_hudpanel_common_notoggle(entity me, string panelname) { float i; diff --git a/qcsrc/menu/xonotic/util.qh b/qcsrc/menu/xonotic/util.qh index 70fb1a11c2..0d31f0150a 100644 --- a/qcsrc/menu/xonotic/util.qh +++ b/qcsrc/menu/xonotic/util.qh @@ -48,7 +48,3 @@ void dialog_hudpanel_common_notoggle(entity me, string panelname); me.TR(me); \ me.TD(me, 1, 4, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable panel"))); \ DIALOG_HUDPANEL_COMMON_NOTOGGLE() - -string language_filename(string s); -string CTX(string s); -#define ZCTX(s) strzone(CTX(s)) -- 2.39.2