aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVincent Hamm2012-08-17 21:38:20 -0700
committerD G Turner2012-08-20 01:48:20 +0100
commitbd6751cb4a2cb5f34697392a82e8d5ab35a6a006 (patch)
tree2f895e1957d154bd2b3860b4f99739cb4172d1dc /engines
parenteccb55570e3ed27276573b23093ffedcf3e794cc (diff)
downloadscummvm-rg350-bd6751cb4a2cb5f34697392a82e8d5ab35a6a006.tar.gz
scummvm-rg350-bd6751cb4a2cb5f34697392a82e8d5ab35a6a006.tar.bz2
scummvm-rg350-bd6751cb4a2cb5f34697392a82e8d5ab35a6a006.zip
CINE: Fix drawing of sprite with mask.
Protects against cases where a non-existing script is referenced.
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/gfx.cpp6
-rw-r--r--engines/cine/script_fw.cpp17
2 files changed, 15 insertions, 8 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index cce8154d84..7a988227f6 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 a34bf7ba2c..9cbe3c3fab 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)();
+ }
}
}