1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * String resource managment routines 22 */ 23 24 #ifndef TINSEL_STRRES_H 25 #define TINSEL_STRRES_H 26 27 #include "common/scummsys.h" 28 #include "tinsel/dw.h" 29 30 namespace Tinsel { 31 32 #define STRINGS_PER_CHUNK 64 // number of strings per chunk in the language text files 33 #define FIRST_STR_ID 1 // id number of first string in string table 34 #define MAX_STRING_SIZE 255 // maximum size of a string in the resource table 35 #define MAX_STRRES_SIZE 300000 // maximum size of string resource file 36 37 // Set if we're handling 2-byte characters. 38 extern bool g_bMultiByte; 39 40 /*----------------------------------------------------------------------*\ 41 |* Function Prototypes *| 42 \*----------------------------------------------------------------------*/ 43 44 /** 45 * Called to load a resource file for a different language 46 * @param newLang The new language 47 */ 48 void ChangeLanguage(LANGUAGE newLang); 49 50 /** 51 * Loads a string resource identified by id. 52 * @param id identifier of string to be loaded 53 * @param pBuffer points to buffer that receives the string 54 * @param bufferMax maximum number of chars to be copied to the buffer 55 */ 56 int LoadStringRes(int id, char *pBuffer, int bufferMax); 57 58 /** 59 * Loads a string resource identified by id 60 * @param id identifier of string to be loaded 61 * @param sub sub-string number 62 * @param pBuffer points to buffer that receives the string 63 * @param bufferMax maximum number of chars to be copied to the buffer 64 */ 65 int LoadSubString(int id, int sub, char *pBuffer, int bufferMax); 66 67 int SubStringCount(int id); // identifier of string to be tested 68 69 /** 70 * Frees the text buffer allocated from ChangeLanguage() 71 */ 72 void FreeTextBuffer(); 73 74 /** 75 * Called from TINLIB.C from DeclareLanguage(). 76 */ 77 78 void LanguageFacts(int language, SCNHANDLE hDescription, SCNHANDLE hFlagFilm); 79 80 /** 81 * Gets the current subtitles language 82 */ 83 LANGUAGE TextLanguage(); 84 85 /** 86 * Gets the current voice language 87 */ 88 LANGUAGE SampleLanguage(); 89 90 int NumberOfLanguages(); 91 LANGUAGE NextLanguage(LANGUAGE thisOne); 92 LANGUAGE PrevLanguage(LANGUAGE thisOne); 93 SCNHANDLE LanguageDesc(LANGUAGE thisOne); 94 SCNHANDLE LanguageFlag(LANGUAGE thisOne); 95 96 } // End of namespace Tinsel 97 98 #endif 99