[Scummvm-cvs-logs] CVS: scummvm/sky text.cpp,1.51,1.52 text.h,1.25,1.26

Robert G?ffringmann lavosspawn at users.sourceforge.net
Thu Jul 31 14:27:05 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv12077/sky

Modified Files:
	text.cpp text.h 
Log Message:
added patched messages for BASS's mistranslations.
(also fixed bug about italian menu glitch)

Index: text.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/text.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- text.cpp	31 Jul 2003 17:24:51 -0000	1.51
+++ text.cpp	31 Jul 2003 21:26:27 -0000	1.52
@@ -222,6 +222,10 @@
 }
 
 void SkyText::getText(uint32 textNr) { //load text #"textNr" into textBuffer
+
+	if (patchMessage(textNr))
+		return ;
+
 	uint32 sectionNo = (textNr & 0x0F000) >> 12;
 	
 	if (SkyState::_itemList[FIRST_TEXT_SEC + sectionNo] == (void **)NULL) { //check if already loaded
@@ -586,3 +590,47 @@
 	}
 }
 
+bool SkyText::patchMessage(uint32 textNum) {
+
+	uint16 patchIdx = _patchLangIdx[SkyState::_systemVars.language];
+	uint16 patchNum = _patchLangNum[SkyState::_systemVars.language];
+	for (uint16 cnt = 0; cnt < patchNum; cnt++) {
+		if (_patchedMessages[cnt + patchIdx].textNr == textNum) {
+			strcpy(_textBuffer, _patchedMessages[cnt + patchIdx].text);
+			return true;
+		}		
+	}
+	return false;
+}
+
+const PatchMessage SkyText::_patchedMessages[NUM_PATCH_MSG] = {
+	{ 28724, "Testo e Parlato" }, // - italian
+	{ 28707, "Solo Testo" },
+	{ 28693, "Solo Parlato" }, 
+	{ 28724, "Text och tal" }, // - swedish
+	{ 28707, "Endast text" },
+	{ 28693, "Endast tal" },
+	{ 28686, "Musikvolym" }
+};
+
+const uint16 SkyText::_patchLangIdx[8] = {
+	0xFFFF, // SKY_ENGLISH
+	0xFFFF, // SKY_GERMAN
+	0xFFFF, // SKY_FRENCH
+	0xFFFF, // SKY_USA
+	3,		// SKY_SWEDISH
+	0,		// SKY_ITALIAN
+	0xFFFF, // SKY_PORTUGUESE
+	0xFFFF  // SKY_SPANISH
+};
+
+const uint16 SkyText::_patchLangNum[8] = {
+	0, // SKY_ENGLISH
+	0, // SKY_GERMAN
+	0, // SKY_FRENCH
+	0, // SKY_USA
+	4, // SKY_SWEDISH
+	3, // SKY_ITALIAN
+	0, // SKY_PORTUGUESE
+	0  // SKY_SPANISH
+};

Index: text.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/text.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- text.h	31 Jul 2003 02:08:00 -0000	1.25
+++ text.h	31 Jul 2003 21:26:27 -0000	1.26
@@ -31,6 +31,13 @@
 	unsigned char value;
 };
 
+#define NUM_PATCH_MSG 7
+
+struct PatchMessage {
+	uint32 textNr;
+	char text[100];
+};
+
 class SkyText {
 public:
 	SkyText(SkyDisk *skyDisk);
@@ -53,6 +60,7 @@
 	char getTextChar();
 	void patchChar(byte *charSetPtr, int width, int height, int c, const uint16 *data);
 	void patchLINCCharset();
+	bool patchMessage(uint32 textNum);
 
 	SkyDisk *_skyDisk;
 	uint8	_inputValue;
@@ -97,6 +105,10 @@
 	static const HuffTree _huffTree_00365[];
 	static const HuffTree _huffTree_00368[];
 	static const HuffTree _huffTree_00372[];
+
+	static const PatchMessage _patchedMessages[NUM_PATCH_MSG];
+	static const uint16 _patchLangIdx[8];
+	static const uint16 _patchLangNum[8];
 
 public:
 	uint32 _dtLetters;	//no of chars in message





More information about the Scummvm-git-logs mailing list