From: Rudolf Polzer Date: Thu, 20 Jan 2011 18:48:16 +0000 (+0100) Subject: fix compile X-Git-Tag: xonotic-v0.5.0~316^2~45 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=2b126217969a9291cadda6fcfd5ae71433955d97;p=xonotic%2Fxonotic-data.pk3dir.git fix compile --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 75e7320c9..f87538a9e 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 dcdd74dee..5990f1c9d 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 79b93d3ed..56cba34cc 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 3188ef0b0..e42595e58 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 b9d6a08d5..1d21ba491 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 70fb1a11c..0d31f0150 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))