[Scummvm-cvs-logs] scummvm master -> 14f152997625320f0cd5cc9b92a2b1e9e6d2df00

bluegr bluegr at gmail.com
Fri Apr 26 17:22:42 CEST 2013


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
dfea40cc11 TOLTECS: Remove dead code
14f1529976 TOLTECS: Ignore invalid script opcodes (script bugs) - bug #3604025


Commit: dfea40cc11824935a7c25f4b8d49c0ba2afba727
    https://github.com/scummvm/scummvm/commit/dfea40cc11824935a7c25f4b8d49c0ba2afba727
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-04-26T08:21:23-07:00

Commit Message:
TOLTECS: Remove dead code

The clearSprites() method is a leftover from the older sprite drawing code

Changed paths:
    engines/toltecs/movie.cpp
    engines/toltecs/screen.cpp
    engines/toltecs/screen.h
    engines/toltecs/toltecs.cpp



diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp
index 8bc0051..20a4bdf 100644
--- a/engines/toltecs/movie.cpp
+++ b/engines/toltecs/movie.cpp
@@ -67,7 +67,6 @@ void MoviePlayer::playMovie(uint resIndex) {
 	memset(moviePalette, 0, sizeof(moviePalette));
 
 	_vm->_screen->finishTalkTextItems();
-	_vm->_screen->clearSprites();
 
 	_vm->_arc->openResource(resIndex);
 
diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp
index 1cd2373..5e12773 100644
--- a/engines/toltecs/screen.cpp
+++ b/engines/toltecs/screen.cpp
@@ -251,10 +251,6 @@ void Screen::addAnimatedSprite(int16 x, int16 y, int16 fragmentId, byte *data, i
 	}
 }
 
-void Screen::clearSprites() {
-
-}
-
 void Screen::blastSprite(int16 x, int16 y, int16 fragmentId, int16 resIndex, uint16 flags) {
 	DrawRequest drawRequest;
 	SpriteDrawItem sprite;
diff --git a/engines/toltecs/screen.h b/engines/toltecs/screen.h
index 52f4122..7b2149f 100644
--- a/engines/toltecs/screen.h
+++ b/engines/toltecs/screen.h
@@ -167,7 +167,6 @@ public:
 	// Sprite list
 	void addStaticSprite(byte *spriteItem);
 	void addAnimatedSprite(int16 x, int16 y, int16 fragmentId, byte *data, int16 *spriteArray, bool loop, int mode);
-	void clearSprites();
 
 	// Sprite drawing
 	void drawSprite(const SpriteDrawItem &sprite);
diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp
index 1a399da..188facd 100644
--- a/engines/toltecs/toltecs.cpp
+++ b/engines/toltecs/toltecs.cpp
@@ -153,7 +153,6 @@ Common::Error ToltecsEngine::run() {
 	_palette->loadAddPalette(9, 224);
 	_palette->setDeltaPalette(_palette->getMainPalette(), 7, 0, 31, 224);
 	_screen->finishTalkTextItems();
-	_screen->clearSprites();
 	_menuSystem->run();
 	/*
 	while (1) {
@@ -280,7 +279,6 @@ void ToltecsEngine::updateScreen() {
 		_flag01 = 1;
 		_counter02 = 1;
 	} else {
-		_screen->clearSprites();
 		_flag01 = 0;
 	}
 
@@ -425,8 +423,6 @@ void ToltecsEngine::setGuiHeight(int16 guiHeight) {
 void ToltecsEngine::setCamera(int16 x, int16 y) {
 	_screen->finishTalkTextItems();
 
-	_screen->clearSprites();
-
 	_cameraX = x;
 	_newCameraX = x;
 
@@ -646,7 +642,6 @@ void ToltecsEngine::showMenu(MenuID menuId) {
 	_palette->loadAddPalette(9, 224);
 	_palette->setDeltaPalette(_palette->getMainPalette(), 7, 0, 31, 224);
 	_screen->finishTalkTextItems();
-	_screen->clearSprites();
 	CursorMan.showMouse(true);
 	_menuSystem->run(menuId);
 	_keyState.reset();


Commit: 14f152997625320f0cd5cc9b92a2b1e9e6d2df00
    https://github.com/scummvm/scummvm/commit/14f152997625320f0cd5cc9b92a2b1e9e6d2df00
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-04-26T08:21:23-07:00

Commit Message:
TOLTECS: Ignore invalid script opcodes (script bugs) - bug #3604025

The original ignores invalid opcodes as well, according to johndoe

Changed paths:
    engines/toltecs/script.cpp



diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp
index 07d74ac..476c3a4 100644
--- a/engines/toltecs/script.cpp
+++ b/engines/toltecs/script.cpp
@@ -265,7 +265,7 @@ void ScriptInterpreter::execOpcode(byte opcode) {
 		_subCode = _code;
 		byte length = readByte();
 		if (length == 0) {
-			warning("Possible script bug detected - opcode length is 0 when calling script function");
+			warning("Opcode length is 0 when calling script function");
 			return;
 		}
 		debug(2, "length = %d", length);
@@ -484,7 +484,9 @@ void ScriptInterpreter::execOpcode(byte opcode) {
 		_code++;
 		break;
 	default:
-		error("Invalid opcode %d", opcode);
+		// Most likely a script bug. Throw a warning and ignore it.
+		// The original ignores invalid opcodes as well - bug #3604025.
+		warning("Invalid opcode %d", opcode);
 	}
 
 }






More information about the Scummvm-git-logs mailing list