diff options
author | Johannes Schickel | 2009-06-29 19:02:15 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-06-29 19:02:15 +0000 |
commit | e15502d38157498f3cc8dca0014e3099ff6625c4 (patch) | |
tree | c43a7cee9b157d2b8362fee5e9532ea40315d078 /engines | |
parent | 3919bd2aed36cf31ca33da26aac186e76efc7610 (diff) | |
download | scummvm-rg350-e15502d38157498f3cc8dca0014e3099ff6625c4.tar.gz scummvm-rg350-e15502d38157498f3cc8dca0014e3099ff6625c4.tar.bz2 scummvm-rg350-e15502d38157498f3cc8dca0014e3099ff6625c4.zip |
Fix bug in drawShape, which caused invisibility in Kyra1 to be displayed incorrectly.
svn-id: r41962
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/screen.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 7f47fd9cf3..bb9ce666b8 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -38,6 +38,11 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system) _cursorColorKey((vm->gameFlags().gameID == GI_KYRA1) ? 0xFF : 0x00) { _debugEnabled = false; _maskMinY = _maskMaxY = -1; + + _drawShapeVar1 = 0; + _drawShapeVar3 = 1; + _drawShapeVar4 = 0; + _drawShapeVar5 = 0; } Screen::~Screen() { @@ -1193,8 +1198,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int if (!shapeData) return; - int f = _vm->gameFlags().useAltShapeHeader ? 2 : 0; - if (shapeData[f] & 1) + if (_vm->gameFlags().useAltShapeHeader) + shapeData += 2; + + if (*shapeData & 1) flags |= 0x400; va_list args; @@ -1204,11 +1211,6 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int 1, 3, 2, 5, 4, 3, 2, 1 }; - _drawShapeVar1 = 0; - _drawShapeVar3 = 1; - _drawShapeVar4 = 0; - _drawShapeVar5 = 0; - _dsTable = 0; _dsTableLoopCount = 0; _dsTable2 = 0; @@ -1234,8 +1236,8 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int } if (flags & 0x200) { - _drawShapeVar1 += 1; - _drawShapeVar1 &= 7; + ++_drawShapeVar1; + _drawShapeVar1 &= (_vm->gameFlags().gameID == GI_KYRA1) ? 0x7 : 0xF; _drawShapeVar3 = drawShapeVar2[_drawShapeVar1]; _drawShapeVar4 = 0; _drawShapeVar5 = 256; @@ -1326,12 +1328,12 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int int scaleCounterV = 0; - f = flags & 0x0f; - _dsProcessMargin = dsMarginFunc[f]; - _dsScaleSkip = dsSkipFunc[f]; - _dsProcessLine = dsLineFunc[f]; + const int drawFunc = flags & 0x0f; + _dsProcessMargin = dsMarginFunc[drawFunc]; + _dsScaleSkip = dsSkipFunc[drawFunc]; + _dsProcessLine = dsLineFunc[drawFunc]; - int ppc = (flags >> 8) & 0x3F; + const int ppc = (flags >> 8) & 0x3F; _dsPlot = dsPlotFunc[ppc]; DsPlotFunc dsPlot2 = dsPlotFunc[ppc], dsPlot3 = dsPlotFunc[ppc]; if (flags & 0x800) @@ -1363,8 +1365,6 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int int y2 = y1 + dsDim->h; - if (_vm->gameFlags().useAltShapeHeader) - src += 2; uint16 shapeFlags = READ_LE_UINT16(src); src += 2; int shapeHeight = *src++; |