[Scummvm-cvs-logs] scummvm master -> bd6751cb4a2cb5f34697392a82e8d5ab35a6a006

digitall dgturner at iee.org
Mon Aug 20 02:50:21 CEST 2012


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

Summary:
bd6751cb4a CINE: Fix drawing of sprite with mask.


Commit: bd6751cb4a2cb5f34697392a82e8d5ab35a6a006
    https://github.com/scummvm/scummvm/commit/bd6751cb4a2cb5f34697392a82e8d5ab35a6a006
Author: Vincent Hamm (vincent.hamm at gmail.com)
Date: 2012-08-19T17:48:20-07:00

Commit Message:
CINE: Fix drawing of sprite with mask.

Protects against cases where a non-existing script is referenced.

Changed paths:
    engines/cine/gfx.cpp
    engines/cine/script_fw.cpp



diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index cce8154..7a98822 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -1796,6 +1796,12 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
 	if(pMask) {
 		spritePtr = pMask;
 	}
+
+	// ignore transparent color in 1bpp
+	if (bpp == 1) {
+		transparentColor = 1;
+	}
+
 	{
 		for (int i = 0; i < height; i++) {
 			byte *destPtr = page + x + y * 320;
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index a34bf7b..9cbe3c3 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -533,7 +533,6 @@ void RawScript::setData(const FWScriptInfo &info, const byte *data) {
  * @return Precalculated script labels
  */
 const ScriptVars &RawScript::labels() const {
-	assert(_data);
 	return _labels;
 }
 
@@ -687,7 +686,7 @@ const char *FWScript::getNextString() {
  * @param pos Restored script position
  */
 void FWScript::load(const ScriptVars &labels, const ScriptVars &local, uint16 compare, uint16 pos) {
-	assert(pos < _script._size);
+	assert(pos <= _script._size);
 	_labels = labels;
 	_localVars = local;
 	_compare = compare;
@@ -705,13 +704,15 @@ void FWScript::load(const ScriptVars &labels, const ScriptVars &local, uint16 co
 int FWScript::execute() {
 	int ret = 0;
 
-	while (!ret) {
-		_line = _pos;
-		byte opcode = getNextByte();
-		OpFunc handler = _info->opcodeHandler(opcode);
+	if(_script._size) {
+		while (!ret) {
+			_line = _pos;
+			byte opcode = getNextByte();
+			OpFunc handler = _info->opcodeHandler(opcode);
 
-		if (handler) {
-			ret = (this->*handler)();
+			if (handler) {
+				ret = (this->*handler)();
+			}
 		}
 	}
 






More information about the Scummvm-git-logs mailing list