Browse Source

Bug fix & full translation support.

louyihua 8 years ago
parent
commit
0c445573ed
7 changed files with 228 additions and 66 deletions
  1. 41 0
      common.h
  2. 1 1
      global.c
  3. 23 1
      makemessage.py
  4. 37 43
      script.c
  5. 120 17
      text.c
  6. 5 3
      text.h
  7. 1 1
      ui.h

+ 41 - 0
common.h

@@ -116,6 +116,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_SWSURFACE | (gpGlobals->fFullScreen ? SDL_FULLSCREEN : 0))
 # endif
 
+# define PAL_PLATFORM         "  Symbian S60 \x79FB\x690D (c) 2009, netwan."
+# define PAL_CREDIT           "netwan"
+# define PAL_PORTYEAR         "2009"
+
 #elif defined (GEKKO)
 
 #define PAL_HAS_JOYSTICKS     1
@@ -132,6 +136,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_SWSURFACE | (gpGlobals->fFullScreen ? SDL_FULLSCREEN : 0))
 # endif
 
+# define PAL_PLATFORM         "Nintendo WII"
+# define PAL_CREDIT           "Rikku2000"
+# define PAL_PORTYEAR         "2012"
+
 #elif defined (PSP)
 
 #define PAL_HAS_JOYSTICKS     0
@@ -147,6 +155,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_SWSURFACE | SDL_FULLSCREEN)
 # endif
 
+# define PAL_PLATFORM         "Sony PSP"
+# define PAL_CREDIT           "(Unknown)"
+# define PAL_PORTYEAR         "2011"
+
 #elif defined(GPH) || defined(DINGOO)
 
 #define PAL_PREFIX            "./"
@@ -161,6 +173,14 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_SWSURFACE | SDL_FULLSCREEN)
 # endif
 
+# if defined(GPH)
+#  define PAL_PLATFORM         "GPH Caanoo & Wiz"
+# else
+#  define PAL_PLATFORM         "DINGOO & Dingux"
+# endif
+# define PAL_CREDIT           "Rikku2000"
+# define PAL_PORTYEAR         "2011"
+
 #elif defined(NDS)
 
 #define PAL_PREFIX            "./"
@@ -175,6 +195,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_SWSURFACE | SDL_FULLSCREEN)
 # endif
 
+# define PAL_PLATFORM         "Nintendo DS"
+# define PAL_CREDIT           "(Unknown)"
+# define PAL_PORTYEAR         "2012"
+
 #elif defined (__IOS__)
 
 #define PAL_PREFIX            UTIL_BasePath()
@@ -189,6 +213,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_HWSURFACE | SDL_FULLSCREEN)
 # endif
 
+# define PAL_PLATFORM         "Apple iOS"
+# define PAL_CREDIT           "(Unknown)"
+# define PAL_PORTYEAR         "2015"
+
 #elif defined (__ANDROID__)
 
 #define PAL_PREFIX            "/mnt/sdcard/sdlpal/"
@@ -203,6 +231,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_HWSURFACE | SDL_FULLSCREEN)
 # endif
 
+# define PAL_PLATFORM         "Android"
+# define PAL_CREDIT           "Rikku2000"
+# define PAL_PORTYEAR         "2013"
+
 #elif defined (__WINPHONE__)
 
 #define PAL_PREFIX            UTIL_BasePath()
@@ -218,6 +250,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_HWSURFACE | SDL_RESIZABLE | (gpGlobals->fFullScreen ? SDL_FULLSCREEN : 0))
 # endif
 
+# define PAL_PLATFORM         "Windows Phone"
+# define PAL_CREDIT           "(Unknown)"
+# define PAL_PORTYEAR         "2015"
+
 #else
 
 #define PAL_HAS_JOYSTICKS     1
@@ -240,6 +276,10 @@ extern "C"
 #  define PAL_VIDEO_INIT_FLAGS  (SDL_HWSURFACE | SDL_RESIZABLE | (gpGlobals->fFullScreen ? SDL_FULLSCREEN : 0))
 # endif
 
+# define PAL_PLATFORM         NULL
+# define PAL_CREDIT           NULL
+# define PAL_PORTYEAR         NULL
+
 #endif
 
 #ifndef PAL_DEFAULT_FULLSCREEN_HEIGHT
@@ -278,6 +318,7 @@ extern "C"
 #if defined(_MSC_VER)
 # if _MSC_VER < 1900
 #  define vsnprintf _vsnprintf
+#  define snprintf _snprintf
 # endif
 # define strdup _strdup
 # pragma warning (disable:4244)

+ 1 - 1
global.c

@@ -208,7 +208,7 @@ PAL_InitGlobals(
 				   {
 					   int n = strlen(ptr);
 					   if (n > 0 && ptr[n - 1] == '\n') ptr[--n] = 0;
-					   if (n > 0 && ptr[n - 1] == '\r') end[--n] = 0;
+					   if (n > 0 && ptr[n - 1] == '\r') ptr[--n] = 0;
 					   if (n > 0) gpGlobals->pszMsgName = strdup(ptr);
 				   }
 #if USE_RIX_EXTRA_INIT

+ 23 - 1
makemessage.py

@@ -79,11 +79,33 @@ def main():
     if len(data_bytes) % options.wordwidth != 0:
         data_bytes += [0x20 for i in range(0, options.wordwidth - len(data_bytes) % options.wordwidth)]
 
-    output = "[BEGIN WORDS]\n"
+    output = "# All lines, except those inside [BEIGN MESSAGE] and [END MESSAGE], can be commented by adding the sharp '#' mark at the first of the line.\n\n"
+
+    output += "# This section contains the information that will be displayed when a user finishes the game.\n"
+    output += "# Only the keys listed here are valid. Other keys will be ignored.\n"
+    output += "[BEGIN CREDITS]\n"
+    output += "# Place the translated text of 'Classical special build' here in no more than 24 half-wide characters.\n"
+    output += "1= Classical special build\n"
+    output += "# Place the translated porting information template at the following two lines. Be aware that each replaced line will be truncated into at most 40 half-wide characters.\n"
+    output += "6= ${platform} port by ${author}, ${year}.\n"
+    output += "7=\n"
+    output += "# Place the translated GNU licensing information at the following three lines. Be aware that each line will be truncated into at most 40 half-wide characters.\n"
+    output += "8=   This is a free software and it is\n"
+    output += "9=   published under GNU General Public\n"
+    output += "10=    License v3.\n"
+    output += "# Place the translated text at the following line. Be aware that each line will be truncated into at most 40 half-wide characters.\n"
+    output += "11=    ...Press Enter to continue\n"
+    output += "[END CREDITS]\n\n"
+
+    output += "# This section contains the words used by the game.\n"
+    output += "[BEGIN WORDS]\n"
+    output += "# Each line is a pattern of 'key=value', where key is an integer and value is a string.\n"
     for i in range(0, len(data_bytes) / options.wordwidth):
         output += "%d=%s\n" % (i, data_bytes[i * options.wordwidth: (i + 1) * options.wordwidth].rstrip('\x20\x00').decode(options.encoding).encode('utf-8'))
     output += "[END WORDS]\n\n"
 
+    output += "# The following sections contain dialog/description texts used by the game.\n\n"
+
     print "Now Processing. Please wait..."
     
     for i in range(0, len(script_bytes) / 8):

+ 37 - 43
script.c

@@ -489,7 +489,7 @@ PAL_MonsterChasePlayer(
    PAL_NPCWalkOneStep(wEventObjectID, wMonsterSpeed);
 }
 
-static VOID
+VOID
 PAL_AdditionalCredits(
    VOID
 )
@@ -511,65 +511,59 @@ PAL_AdditionalCredits(
    LPCWSTR rgszcps[][CP_MAX] = {
 	   // Traditional Chinese, Simplified Chinese, Japanese
 	   { L"", L"", L"" },
-	   { L"       (\x7D93\x5178\x7279\x5225\x7BC7", L"       (\x7ECF\x5178\x7279\x522B\x7BC7", L"(\x30AF\x30E9\x30B7\x30C3\x30AF\x7279\x5225\x7DE8" },
+	   { L"          \x7D93\x5178\x7279\x5225\x7BC7  ",
+	     L"          \x7ECF\x5178\x7279\x522B\x7BC7  ",
+	     L"   \x30AF\x30E9\x30B7\x30C3\x30AF\x7279\x5225\x7DE8  "
+	   },
 	   { L"", L"", L"" },
 	   { L"", L"", L"" },
 	   { L"", L"", L"" },
-#if defined(__SYMBIAN32__) || defined(GPH) || defined(GEKKO) || defined(DINGOO) || defined(ANDROID)
 	   { L"", L"", L"" },
-#endif
 	   { L"", L"", L"" },
-	   { L"\x672C\x7A0B\x5F0F\x662F\x81EA\x7531\x8EDF\x9AD4\xFF0C\x6309\x7167 GNU General",
-	     L"\x672C\x7A0B\x5E8F\x662F\x81EA\x7531\x8F6F\x4EF6\xFF0C\x6309\x7167 GNU General",
-		 L"\x3053\x306E\x30D7\x30ED\x30B0\x30E9\x30E0\x306F\x81EA\x7531\x30BD\x30D5\x30C8\x30A6\x30A7\x30A2\x3067"
+	   { L"", L"", L"" },
+	   { L"   \x672C\x7A0B\x5F0F\x662F\x81EA\x7531\x8EDF\x9AD4\xFF0C\x6309\x7167 GNU General",
+	     L"   \x672C\x7A0B\x5E8F\x662F\x81EA\x7531\x8F6F\x4EF6\xFF0C\x6309\x7167 GNU General",
+		 L" \x3053\x306E\x30D7\x30ED\x30B0\x30E9\x30E0\x306F\x81EA\x7531\x30BD\x30D5\x30C8\x30A6\x30A7\x30A2\x3067\x3059\x3001"
+	   },
+	   { L"   Public License v3 \x767C\x4F48",
+	     L"   Public License v3 \x53D1\x5E03",
+	     L" GNU General Public License v3 \x306E\x4E0B\x3067"
+	   },
+	   { L"", L"", L" \x914D\x5E03\x3055\x308C\x3066\x3044\x307E\x3059\x3002" },
+	   { L"                    ...\x6309 Enter \x7D50\x675F",
+	     L"                    ...\x6309 Enter \x7ED3\x675F",
+	     L"      ...Enter\x30AD\x30FC\x3092\x62BC\x3057\x3066\x7D42\x4E86\x3057\x307E\x3059"
 	   },
-	   { L"Public License v3 \x767C\x4F48", L"Public License v3 \x53D1\x5E03", L"\x3059\x3001GNU General Public License v3" },
-	   { L"", L"", L"\x306E\x4E0B\x3067\x914D\x5E03\x3055\x308C\x3066\x3044\x307E\x3059\x3002" },
-	   { L"              ...\x6309 Enter \x7D50\x675F", L"              ...\x6309 Enter \x7ED3\x675F", L"...Enter\x30AD\x30FC\x3092\x62BC\x3057\x3066\x7D42\x4E86\x3057\x307E\x3059" }
    };
 
    LPCWSTR rgszStrings[] = {
-      L"SDLPAL (http://sdlpal.codeplex.com/)",
-#  ifdef PAL_CLASSIC
-	  L"  %s  " WIDETEXT(__DATE__) L")",
-#  else
-	  L"                    (" WIDETEXT(__DATE__) L")",
-#  endif
+      L"  SDLPAL (http://sdlpal.codeplex.com/)",
+#ifdef PAL_CLASSIC
+	  L"%s(" WIDETEXT(__DATE__) L")",
+#else
+	  L"                        (" WIDETEXT(__DATE__) L")",
+#endif
       L" ",
-	  L"  (c) 2009-2015, Wei Mingzhi",
-	  L"      <whistler_wmz@users.sf.net>.",
-#  ifdef __SYMBIAN32__
-	  L"  Symbian S60 \x79FB\x690D (c) 2009, netwan.",
-#  endif
-#  ifdef GPH
-	  L"  GPH Caanoo & Wiz \x79FB\x690D (c) 2011, Rikku2000.",
-#  endif
-#  ifdef GEKKO
-	  L"  Nintendo WII \x79FB\x690D (c) 2012, Rikku2000.",
-#  endif
-#  ifdef DINGOO
-	  L"  DINGOO & Dingux \x79FB\x690D (c) 2011, Rikku2000.",
-#  endif
-#  ifdef ANDROID
-	  L"  ANDROID \x79FB\x690D (c) 2013, Rikku2000.",
-#  endif
-	  L" ",
-	  L"%s",
-	  L"%s",
-	  L"%s",
-	  L"   %s",
-      NULL
+	  L"    (c) 2009-2011, Wei Mingzhi",
+	  L"        <whistler_wmz@users.sf.net>.",
+      L"    (c) 2011-2015, SDLPAL Team",
+	  L"%s",  // Porting information line 1
+	  L"%s",  // Porting information line 2
+	  L"%s",  // GNU line 1
+	  L"%s",  // GNU line 2
+	  L"%s",  // GNU line 3
+      L"%s",  // Press Enter to continue
    };
 
    int        i = 0;
 
    PAL_DrawOpeningMenuBackground();
 
-   for (i = 0; rgszStrings[i]; i++)
+   for (i = 0; i < 12; i++)
    {
-      WCHAR buffer[50];
-	  swprintf(buffer, 50, rgszStrings[i], rgszcps[i][gpGlobals->iCodePage]);
-	  PAL_DrawText(buffer, PAL_XY(25, 20 + i * 16), DESCTEXT_COLOR, TRUE, FALSE);
+      WCHAR buffer[48];
+	  swprintf(buffer, 48, rgszStrings[i], gpGlobals->pszMsgName ? g_rcCredits[i] : rgszcps[i][gpGlobals->iCodePage]);
+	  PAL_DrawText(buffer, PAL_XY(0, 2 + i * 16), DESCTEXT_COLOR, TRUE, FALSE);
    }
 
    PAL_SetPalette(0, FALSE);

+ 120 - 17
text.c

@@ -40,18 +40,23 @@ BOOL      g_fUpdatedInBattle      = FALSE;
 #include "codepage.h"
 
 #ifndef PAL_CLASSIC
-static const WCHAR* gc_rgszAdditionalWords[CP_MAX][6] = {
+static LPWSTR gc_rgszAdditionalWords[CP_MAX][PAL_ADDITIONAL_WORD_COUNT] = {
    { L"\x6230\x9B25\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
    { L"\x6218\x6597\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
    { L"\x6226\x95D8\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
 };
-static const WCHAR** g_rgszAdditionalWords;
+static LPWSTR gc_rgszDefaultAdditionalWords[PAL_ADDITIONAL_WORD_COUNT] = { NULL, L"1", "2", "3", L"4", L"5" };
 #endif
 
+LPWSTR g_rcCredits[12];
+
 typedef struct tagTEXTLIB
 {
    LPWSTR         *lpWordBuf;
    LPWSTR         *lpMsgBuf;
+#ifndef PAL_CLASSIC
+   LPWSTR         *lpExtraWordBuf;
+#endif
    int           **lpIndexBuf;
 
    int             nWords;
@@ -78,7 +83,8 @@ PAL_FORCE_INLINE int
 PAL_ParseLine(
 	char     *line,
 	char    **value,
-	int      *length
+	int      *length,
+	int       deltrail
 	)
 {
 	//
@@ -102,7 +108,7 @@ PAL_ParseLine(
 			LPSTR end = line + strlen(line);
 			int index;
 			if (end > line && end[-1] == '\n') *(--end) = 0;
-			while (end > line && iswspace(end[-1])) *(--end) = 0;
+			if (deltrail) while (end > line && iswspace(end[-1])) *(--end) = 0;
 
 			//
 			// Parse the index and pass out value
@@ -184,14 +190,19 @@ PAL_ReadMessageFile(
 	{
 		struct _word_list_entry *next;
 		wchar_t *value;
+		int index;
 	} whead = { NULL, NULL }, *witem = NULL;
 	enum _message_state
 	{
 		ST_OUTSIDE,
 		ST_DIALOG,
-		ST_WORD
+		ST_WORD,
+		ST_CREDIT
 	} state = ST_OUTSIDE;
 	int idx_cnt = 0, msg_cnt = 0, word_cnt = 0, sid, eid = -1;
+#ifndef PAL_CLASSIC
+	int extra_word_cnt = 0;
+#endif
 
 	while (!feof(fp))
 	{
@@ -235,6 +246,10 @@ PAL_ReadMessageFile(
 						//
 						witem = &whead;
 					}
+					else if (strncmp(buffer, "[BEGIN CREDITS]", 15) == 0 && !witem)
+					{
+						state = ST_CREDIT;
+					}
 					else
 					{
 						// Just ignore invalid lines
@@ -290,15 +305,82 @@ PAL_ReadMessageFile(
 				else
 				{
 					char *v;
-					int l, i = PAL_ParseLine(buffer, &v, &l);
-					if (i > 0)
+					int l, i = PAL_ParseLine(buffer, &v, &l, TRUE);
+					if (i > 0 && i <= PAL_ADDITIONAL_WORD_LAST)
 					{
 						int len = PAL_MultiByteToWideCharCP(CP_UTF_8, v, -1, NULL, 0);
 						struct _word_list_entry *val = (struct _word_list_entry *)malloc(sizeof(struct _word_list_entry));
 						val->value = (wchar_t *)malloc(len * sizeof(wchar_t));
 						PAL_MultiByteToWideCharCP(CP_UTF_8, v, -1, val->value, len);
-						val->next = NULL; witem->next = val; witem = witem->next;
-						if (word_cnt < i) word_cnt = i;
+						val->index = i; val->next = NULL;
+						witem->next = val; witem = witem->next;
+						if (i < PAL_ADDITIONAL_WORD_FIRST && word_cnt < i) word_cnt = i;
+#ifndef PAL_CLASSIC
+						if (i >= PAL_ADDITIONAL_WORD_FIRST && extra_word_cnt < i) extra_word_cnt = i;
+#endif
+					}
+				}
+				break;
+			case ST_CREDIT:
+				//
+				// Check if to end credit list
+				//
+				if (strncmp(buffer, "[END CREDITS]", 13) == 0)
+				{
+					// End credit list
+					state = ST_OUTSIDE;
+				}
+				else
+				{
+					char *v;
+					int l, i = PAL_ParseLine(buffer, &v, &l, FALSE);
+					if ((i == 1 || (i >= 6 && i <= 11)) && !g_rcCredits[i])
+					{
+						int limit = (i == 1) ? 24 * 8 : 40 * 8, w = 0, j = 0, len;
+						if (i == 6 || i == 7)
+						{
+							if (PAL_PLATFORM && PAL_CREDIT && PAL_PORTYEAR)
+							{
+								const char *templates[] = { "${platform}", "${author}", "${year}" };
+								const char *values[] = { PAL_PLATFORM, PAL_CREDIT, PAL_PORTYEAR };
+								const int matchlen[] = { 11, 9, 7 };
+								const int valuelen[] = { sizeof(PAL_PLATFORM) - 1, sizeof(PAL_CREDIT) - 1, sizeof(PAL_PORTYEAR) - 1 };
+								char *tmp = (char *)alloca(valuelen[0] + valuelen[1] + valuelen[2] + l + 1);
+								char *dst = tmp, *src = v;
+								while (*src)
+								{
+									if (*src == '$')
+									{
+										int k;
+										for (k = 0; k < 3 && strncmp(src, templates[k], matchlen[k]); k++);
+										if (k < 3)
+										{
+											strcpy(dst, values[k]);
+											dst += valuelen[k];
+											src += matchlen[k];
+											continue;
+										}
+									}
+									*dst++ = *src++;
+								}
+								*dst = 0;
+								len = PAL_MultiByteToWideCharCP(CP_UTF_8, tmp, -1, NULL, 0);
+								g_rcCredits[i] = (wchar_t *)malloc(len * sizeof(wchar_t));
+								PAL_MultiByteToWideCharCP(CP_UTF_8, tmp, -1, g_rcCredits[i], len);
+							}
+						}
+						else
+						{
+							len = PAL_MultiByteToWideCharCP(CP_UTF_8, v, -1, NULL, 0);
+							g_rcCredits[i] = (wchar_t *)malloc(len * sizeof(wchar_t));
+							PAL_MultiByteToWideCharCP(CP_UTF_8, v, -1, g_rcCredits[i], len);
+						}
+						if (g_rcCredits[i])
+						{
+							// Limit the length of texts
+							while (w < limit && j < len - 1) w += PAL_CharWidth(g_rcCredits[i][j++]);
+							if (w >= limit) g_rcCredits[i][w > limit ? j - 1 : j] = 0;
+						}
 					}
 				}
 				break;
@@ -344,20 +426,38 @@ PAL_ReadMessageFile(
 		}
 	}
 
+#ifndef PAL_CLASSIC
+	if (word_cnt > 0 && extra_word_cnt >= PAL_ADDITIONAL_WORD_FIRST && extra_word_cnt <= PAL_ADDITIONAL_WORD_LAST)
+#else
 	if (word_cnt > 0)
+#endif
 	{
 		//
 		// Move values from linked list to array
 		//
-		int index = 1;
+#ifndef PAL_CLASSIC
+		int i;
+		g_TextLib.lpExtraWordBuf = (LPWSTR *)calloc(PAL_ADDITIONAL_WORD_COUNT, sizeof(LPWSTR));
+#endif
 		g_TextLib.nWords = (word_cnt += 1);
 		g_TextLib.lpWordBuf = (LPWSTR *)calloc(word_cnt, sizeof(LPWSTR));
 		for (witem = whead.next; witem; )
 		{
 			struct _word_list_entry *temp = witem->next;
-			g_TextLib.lpWordBuf[index++] = witem->value;
+#ifndef PAL_CLASSIC
+			if (witem->index >= PAL_ADDITIONAL_WORD_FIRST)
+				g_TextLib.lpExtraWordBuf[witem->index - PAL_ADDITIONAL_WORD_FIRST] = witem->value;
+			else
+#else
+			g_TextLib.lpWordBuf[witem->index] = witem->value;
+#endif
 			free(witem); witem = temp;
 		}
+#ifndef PAL_CLASSIC
+		for (i = 1; i < PAL_ADDITIONAL_WORD_COUNT; i++)
+			if (!g_TextLib.lpExtraWordBuf[i])
+				g_TextLib.lpExtraWordBuf[i] = gc_rgszDefaultAdditionalWords[i];
+#endif
 	}
 
 	fclose(fp);
@@ -411,6 +511,11 @@ PAL_InitText(
 			   if (dwWordLength < n) dwWordLength = n;
 		   }
 		   gpGlobals->dwWordLength = dwWordLength;
+		   for (i = 0; i < 12; i++)
+		   {
+			   if (!g_rcCredits[i])
+				   g_rcCredits[i] = L"";
+		   }
 	   }
    }
    else
@@ -534,11 +639,11 @@ PAL_InitText(
 	   free(offsets);
 
 	   g_TextLib.lpIndexBuf = NULL;
-   }
 
 #ifndef PAL_CLASSIC
-   g_rgszAdditionalWords = gc_rgszAdditionalWords[gpGlobals->iCodePage];
+	   g_TextLib.lpExtraWordBuf = gc_rgszAdditionalWords[gpGlobals->iCodePage];
 #endif
+   }
 
    g_TextLib.bCurrentFontColor = FONT_COLOR_DEFAULT;
    g_TextLib.bIcon = 0;
@@ -625,11 +730,9 @@ PAL_GetWord(
 {
 #ifndef PAL_CLASSIC
    if (wNumWord >= PAL_ADDITIONAL_WORD_FIRST)
-   {
-      return g_rgszAdditionalWords[wNumWord - PAL_ADDITIONAL_WORD_FIRST];
-   }
+      return g_TextLib.lpExtraWordBuf[wNumWord];
+   else
 #endif
-
    return (iNumWord >= g_TextLib.nWords || !g_TextLib.lpWordBuf[iNumWord]) ? L"" : g_TextLib.lpWordBuf[iNumWord];
 }
 

+ 5 - 3
text.h

@@ -32,9 +32,11 @@ typedef enum tagDIALOGPOSITION
    kDialogCenterWindow
 } DIALOGLOCATION;
 
-#ifndef PAL_CLASSIC
-#define PAL_ADDITIONAL_WORD_FIRST           10000
-#endif
+#define PAL_ADDITIONAL_WORD_FIRST           65530
+#define PAL_ADDITIONAL_WORD_LAST            65535
+#define PAL_ADDITIONAL_WORD_COUNT           (PAL_ADDITIONAL_WORD_LAST - PAL_ADDITIONAL_WORD_FIRST + 1)
+
+extern LPWSTR g_rcCredits[12];
 
 INT
 PAL_InitText(

+ 1 - 1
ui.h

@@ -75,7 +75,7 @@ extern "C"
 #define SYSMENU_LABEL_MUSIC                13
 #define SYSMENU_LABEL_SOUND                14
 #define SYSMENU_LABEL_QUIT                 15
-#define SYSMENU_LABEL_BATTLEMODE           (PAL_ADDITIONAL_WORD_FIRST)
+#define SYSMENU_LABEL_BATTLEMODE           (PAL_ADDITIONAL_WORD_LAST)
 
 #define BATTLESPEEDMENU_LABEL_1            (PAL_ADDITIONAL_WORD_FIRST + 1)
 #define BATTLESPEEDMENU_LABEL_2            (PAL_ADDITIONAL_WORD_FIRST + 2)