[Scummvm-cvs-logs] SF.net SVN: scummvm:[34999] scummvm/trunk/engines/tucker

cyx at users.sourceforge.net cyx at users.sourceforge.net
Tue Nov 11 00:29:09 CET 2008


Revision: 34999
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34999&view=rev
Author:   cyx
Date:     2008-11-10 23:29:08 +0000 (Mon, 10 Nov 2008)

Log Message:
-----------
fixed charset issues & wrong state for locations 13,16,23

Modified Paths:
--------------
    scummvm/trunk/engines/tucker/locations.cpp
    scummvm/trunk/engines/tucker/resource.cpp
    scummvm/trunk/engines/tucker/staticres.cpp
    scummvm/trunk/engines/tucker/tucker.cpp
    scummvm/trunk/engines/tucker/tucker.h

Modified: scummvm/trunk/engines/tucker/locations.cpp
===================================================================
--- scummvm/trunk/engines/tucker/locations.cpp	2008-11-10 22:32:21 UTC (rev 34998)
+++ scummvm/trunk/engines/tucker/locations.cpp	2008-11-10 23:29:08 UTC (rev 34999)
@@ -932,6 +932,7 @@
 		state = 6;
 	} else {
 		setCharacterAnimation(0, 0);
+		return;
 	}
 	_spritesTable[i].state = state;
 }
@@ -1123,20 +1124,21 @@
 		}
 	} else if (_csDataHandled) {
 		_spritesTable[0].needUpdate = 0;
-		if (r < 30000) {
-			state = 4;
-			_spritesTable[0].updateDelay = 5;
-		} else if (r < 31000) {
-			state = 4;
-			if (_xPosCurrent < 300) {
-				_miscSoundFxDelayCounter[0] = 2;
-				_soundsMapTable[0] = 9;
-			}
-		} else if (r < 32000) {
-			state = 5;
-		} else {
-			state = 6;
+		state = 4;
+		_spritesTable[0].updateDelay = 5;
+	} else if (r < 30000) {
+		state = 4;
+		_spritesTable[0].updateDelay = 5;
+	} else if (r < 31000) {
+		state = 4;
+		if (_xPosCurrent < 300) {
+			_miscSoundFxDelayCounter[0] = 2;
+			_soundsMapTable[0] = 9;
 		}
+	} else if (r < 32000) {
+		state = 5;
+	} else {
+		state = 6;
 	}
 	_spritesTable[i].state = state;
 }
@@ -1475,6 +1477,8 @@
 				state = (getRandomNumber() < 25000) ? 22 : 23;
 			}
 		}
+	} else {
+		state = 24;
 	}
 	_spritesTable[i].state = state;
 }

Modified: scummvm/trunk/engines/tucker/resource.cpp
===================================================================
--- scummvm/trunk/engines/tucker/resource.cpp	2008-11-10 22:32:21 UTC (rev 34998)
+++ scummvm/trunk/engines/tucker/resource.cpp	2008-11-10 23:29:08 UTC (rev 34999)
@@ -163,10 +163,12 @@
 
 uint8 *TuckerEngine::loadFile(uint8 *p) {
 	_fileLoadSize = 0;
+	bool decode = false;
 	if (_useEnc) {
 		char *ext = strrchr(_fileToLoad, '.');
 		if (ext && strcmp(ext + 1, "c") == 0) {
 			strcpy(ext + 1, "enc");
+			decode = true;
 		}
 	}
 	Common::File f;
@@ -179,7 +181,7 @@
 	}
 	if (p) {
 		f.read(p, sz);
-		if (_useEnc) {
+		if (decode) {
 			decodeData(p, sz);
 		}
 		_fileLoadSize = sz;
@@ -258,9 +260,7 @@
 void TuckerEngine::loadCharset2() {
 	_charWidthTable[58] = 7;
 	_charWidthTable[32] = 15;
-	for (int i = 0; i < 58; ++i) {
-		_charWidthTable[65 + i] = _charWidthCharset2[i];
-	}
+	memcpy(_charWidthTable + 65, _charWidthCharset2, 58);
 	strcpy(_fileToLoad, "char2.pcx");
 	loadImage(_loadTempBuf, 0);
 	loadCharsetHelper(kCharSet2CharW, kCharSet2CharH, 16, 6);
@@ -278,11 +278,15 @@
 void TuckerEngine::loadCharSizeDta() {
 	strcpy(_fileToLoad, "charsize.dta");
 	loadFile(_loadTempBuf);
-	DataTokenizer t(_loadTempBuf, _fileLoadSize, true);
-	for (int i = 0; i < 256; ++i) {
-		_charWidthTable[i] = t.getNextInteger();
+	if (_fileLoadSize != 0) {
+		DataTokenizer t(_loadTempBuf, _fileLoadSize, true);
+		for (int i = 0; i < 256; ++i) {
+			_charWidthTable[i] = t.getNextInteger();
+		}
+		_charWidthTable[225] = 0;
+	} else {
+		memcpy(_charWidthTable + 32, _charWidthCharset1, 224);
 	}
-	_charWidthTable[225] = 0;
 }
 
 void TuckerEngine::loadPanel() {

Modified: scummvm/trunk/engines/tucker/staticres.cpp
===================================================================
--- scummvm/trunk/engines/tucker/staticres.cpp	2008-11-10 22:32:21 UTC (rev 34998)
+++ scummvm/trunk/engines/tucker/staticres.cpp	2008-11-10 23:29:08 UTC (rev 34999)
@@ -209,7 +209,24 @@
 	1, 1, 1, 1, 0, 0,
 };
 
-const int TuckerEngine::_charWidthCharset2[58] = {
+const uint8 TuckerEngine::_charWidthCharset1[224] = {
+	0x06, 0x06, 0x04, 0x06, 0x07, 0x08, 0x08, 0x02, 0x04, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x07, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x07, 0x07, 0x08, 0x04, 0x04, 0x04, 0x04, 0x07,
+	0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x07, 0x07, 0x03, 0x05, 0x07, 0x04, 0x08, 0x07, 0x07,
+	0x07, 0x08, 0x07, 0x07, 0x04, 0x07, 0x07, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x07, 0x04, 0x07, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08,
+	0x08, 0x04, 0x08, 0x08, 0x07, 0x07, 0x06, 0x05, 0x07, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+	0x07, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+	0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
+};
+
+const uint8 TuckerEngine::_charWidthCharset2[58] = {
 	0x13, 0x0F, 0x10, 0x10, 0x10, 0x0E, 0x11, 0x10, 0x0D, 0x0A, 0x11, 0x0D, 0x14, 0x13, 0x13, 0x11,
 	0x13, 0x12, 0x10, 0x11, 0x13, 0x14, 0x14, 0x10, 0x13, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x13, 0x0F, 0x10, 0x10, 0x10, 0x0E, 0x11, 0x10, 0x0D, 0x0A, 0x11, 0x0D, 0x14, 0x13, 0x13, 0x11,

Modified: scummvm/trunk/engines/tucker/tucker.cpp
===================================================================
--- scummvm/trunk/engines/tucker/tucker.cpp	2008-11-10 22:32:21 UTC (rev 34998)
+++ scummvm/trunk/engines/tucker/tucker.cpp	2008-11-10 23:29:08 UTC (rev 34999)
@@ -328,12 +328,8 @@
 	strcpy(_fileToLoad, "csdata.c");
 	_csDataBuf = loadFile();
 	_csDataSize = _fileLoadSize;
-	strcpy(_fileToLoad, "nofiles.dta");
-	loadFile(_loadTempBuf);
-	if (_fileLoadSize > 1) {
-		_maxSaveGameSlot = _loadTempBuf[0];
-		_currentSaveGameSlot = _loadTempBuf[4];
-	}
+	_currentSaveGameSlot = _firstSaveGameSlot = 1;
+	_maxSaveGameSlot = _lastSaveGameSlot = 99;
 	loadBudSpr(0);
 	loadCursor();
 	setCursorNum(_cursorNum);
@@ -927,7 +923,7 @@
 	}
 	_system->setPalette(pal, 0, colorsCount);
 	_system->updateScreen();
-	_system->delayMillis(20);
+	waitForTimer(1);
 }
 
 void TuckerEngine::fadeInPalette(int colorsCount) {
@@ -941,7 +937,7 @@
 	}
 	_system->setPalette(pal, 0, colorsCount);
 	_system->updateScreen();
-	_system->delayMillis(20);
+	waitForTimer(1);
 }
 
 void TuckerEngine::fadePaletteColor(int color, int step) {

Modified: scummvm/trunk/engines/tucker/tucker.h
===================================================================
--- scummvm/trunk/engines/tucker/tucker.h	2008-11-10 22:32:21 UTC (rev 34998)
+++ scummvm/trunk/engines/tucker/tucker.h	2008-11-10 23:29:08 UTC (rev 34999)
@@ -794,7 +794,8 @@
 	static int _objectKeysPosYTable[80];
 	static int _objectKeysLocationTable[80];
 	static int _mapSequenceFlagsLocationTable[70];
-	static const int _charWidthCharset2[58];
+	static const uint8 _charWidthCharset1[224];
+	static const uint8 _charWidthCharset2[58];
 };
 
 } // namespace Tucker


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list