[Scummvm-cvs-logs] CVS: scummvm/sky text.cpp,1.48.2.1,1.48.2.2 text.h,1.24,1.24.2.1

Robert G?ffringmann lavosspawn at users.sourceforge.net
Thu Jul 31 15:00:02 CEST 2003


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

Modified Files:
      Tag: branch-0-5-0
	text.cpp text.h 
Log Message:
add patched messages to release branch, too.

Index: text.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/text.cpp,v
retrieving revision 1.48.2.1
retrieving revision 1.48.2.2
diff -u -d -r1.48.2.1 -r1.48.2.2
--- text.cpp	29 Jul 2003 01:03:51 -0000	1.48.2.1
+++ text.cpp	31 Jul 2003 21:59:10 -0000	1.48.2.2
@@ -116,6 +116,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
@@ -479,4 +483,49 @@
 		}
 	}
 }
+
+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.24
retrieving revision 1.24.2.1
diff -u -d -r1.24 -r1.24.2.1
--- text.h	12 Jul 2003 15:21:34 -0000	1.24
+++ text.h	31 Jul 2003 21:59:10 -0000	1.24.2.1
@@ -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);
@@ -51,6 +58,7 @@
 	bool getTBit();
 	void initHuffTree();
 	char getTextChar();
+	bool patchMessage(uint32 textNum);
 
 	SkyDisk *_skyDisk;
 	uint8	_inputValue;
@@ -95,6 +103,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