1 /*
2 ===========================================================================
3 Copyright (C) 2000 - 2013, Raven Software, Inc.
4 Copyright (C) 2001 - 2013, Activision, Inc.
5 Copyright (C) 2013 - 2015, OpenJK contributors
6
7 This file is part of the OpenJK source code.
8
9 OpenJK is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License version 2 as
11 published by the Free Software Foundation.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 ===========================================================================
21 */
22
23 #ifndef __STRIPPUB_H
24 #define __STRIPPUB_H
25
26
27 #define STRIP_VERSION 1
28
29 #define MAX_LANGUAGES 10
30 #define MAX_STRINGS 256
31 #define MAX_ID 255
32
33 enum
34 {
35 SP_LANGUAGE_ENGLISH = 0,
36 SP_LANGUAGE_FRENCH,
37 SP_LANGUAGE_GERMAN,
38 SP_LANGUAGE_BRITISH,
39 SP_LANGUAGE_KOREAN,
40 SP_LANGUAGE_TAIWANESE,
41 SP_LANGUAGE_ITALIAN,
42 SP_LANGUAGE_SPANISH,
43 SP_LANGUAGE_JAPANESE,
44 SP_LANGUAGE_10,
45 SP_LANGUGAGE_MAX,
46 SP_LANGUAGE_ALL = 255
47 };
48
49
50 #define SP_PACKAGE 0xff00
51 #define SP_STRING 0x00ff
52
53 #define SP_GET_PACKAGE(x) ( (x & SP_PACKAGE) >> 8 )
54
55 // Flags
56 #define SP_FLAG1 0x00000001 // CENTERED
57 #define SP_FLAG2 0x00000002
58 #define SP_FLAG3 0x00000004
59 #define SP_FLAG4 0x00000008
60 #define SP_FLAG5 0x00000010
61 #define SP_FLAG6 0x00000020
62 #define SP_FLAG7 0x00000040
63 #define SP_FLAG8 0x00000080
64 #define SP_FLAG9 0x00000100
65 #define SP_FLAG_ORIGINAL 0x00000200
66
67 // Registration
68 #define SP_REGISTER_CLIENT (0x01)
69 #define SP_REGISTER_SERVER (0x02)
70 #define SP_REGISTER_MENU (0x04)
71 #define SP_REGISTER_REQUIRED (0x08)
72
73
74 // Registration
75 qboolean JK2SP_Register(const char *Package, unsigned char Registration);
76 void JK2SP_Unload(unsigned char Registration);
77
78 // Direct string functions
79 int JK2SP_GetStringID(const char *Reference);
80 #ifdef _DEBUG
81 const char *SP_GetReferenceText(unsigned short ID, const char *&psPackageName, const char *&psPackageReference, const char *&psText);
82 #endif
83 const char *JK2SP_GetStringText(unsigned short ID);
84 const char *JK2SP_GetStringTextString(const char *Reference);
85
86 // Initialization
87 void JK2SP_Init(void);
88 void JK2SP_CheckForLanguageUpdates(void);
JK2SP_Shutdown(void)89 inline void JK2SP_Shutdown(void)
90 {
91 JK2SP_Unload(SP_REGISTER_CLIENT | SP_REGISTER_SERVER | SP_REGISTER_MENU | SP_REGISTER_REQUIRED );
92 }
93
94 extern cvar_t *sp_language;
95 // query function from font code
96 //
97 /*inline qboolean Language_IsKorean(void)
98 {
99 return (sp_language && sp_language->integer == SP_LANGUAGE_KOREAN);
100 }
101
102 inline qboolean Language_IsTaiwanese(void)
103 {
104 return (sp_language && sp_language->integer == SP_LANGUAGE_TAIWANESE);
105 }
106
107 inline qboolean Language_IsJapanese(void)
108 {
109 return (sp_language && sp_language->integer == SP_LANGUAGE_JAPANESE);
110 }
111 */
Language_GetIntegerValue(void)112 inline int Language_GetIntegerValue(void)
113 {
114 if (sp_language)
115 {
116 return sp_language->integer;
117 }
118
119 return 0;
120 }
121
122
123
124 #endif // __STRIPPUB_H
125