diff options
author | Johannes Schickel | 2011-12-26 19:31:28 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-12-26 19:32:05 +0100 |
commit | 463aa52ac6bad2f5d15c1daed613396e5c0e149b (patch) | |
tree | 50070d1208de100a44871e328989d6a6bf5c98fc | |
parent | 487e73bd218775dec22818477ad75dd230d97052 (diff) | |
download | scummvm-rg350-463aa52ac6bad2f5d15c1daed613396e5c0e149b.tar.gz scummvm-rg350-463aa52ac6bad2f5d15c1daed613396e5c0e149b.tar.bz2 scummvm-rg350-463aa52ac6bad2f5d15c1daed613396e5c0e149b.zip |
KYRA: Cleanup va_arg use in drawShape.
Thanks to wjp for noticing this.
-rw-r--r-- | engines/kyra/screen.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index fa1daa2b1a..b6383c82cc 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -1335,6 +1335,8 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int if ((flags & 0x2000) && _vm->game() != GI_KYRA1) _dsTable5 = va_arg(args, uint8 *); + va_end(args); + static const DsMarginSkipFunc dsMarginFunc[] = { &Screen::drawShapeMarginNoScaleUpwind, &Screen::drawShapeMarginNoScaleDownwind, @@ -1420,7 +1422,6 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int warning("Missing drawShape plotting method type %d", ppc); if (dsPlot3 != dsPlot2 && !dsPlot3) warning("Missing drawShape plotting method type %d", (((flags >> 8) & 0xF7) & 0x3F)); - va_end(args); return; } @@ -1453,10 +1454,8 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int shapeHeight = (shapeHeight * _dsScaleH) >> 8; shpWidthScaled1 = shpWidthScaled2 = (shapeWidth * _dsScaleW) >> 8; - if (!shapeHeight || !shpWidthScaled1) { - va_end(args); + if (!shapeHeight || !shpWidthScaled1) return; - } } if (flags & DSF_CENTER) { @@ -1486,7 +1485,6 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int if (t < 0) { shapeHeight += t; if (shapeHeight <= 0) { - va_end(args); return; } @@ -1520,10 +1518,8 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int } t = (flags & 2) ? y + shapeHeight - y1 : y2 - y; - if (t <= 0) { - va_end(args); + if (t <= 0) return; - } if (t < shapeHeight) { shapeHeight = t; @@ -1535,20 +1531,16 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int if (x < 0) { shpWidthScaled1 += x; _dsOffscreenLeft = -x; - if (_dsOffscreenLeft >= shpWidthScaled2) { - va_end(args); + if (_dsOffscreenLeft >= shpWidthScaled2) return; - } x = 0; } _dsOffscreenRight = 0; t = x2 - x; - if (t <= 0) { - va_end(args); + if (t <= 0) return; - } if (t < shpWidthScaled1) { shpWidthScaled1 = t; @@ -1628,8 +1620,6 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int scaleCounterV -= 0x100; } while (scaleCounterV & 0xFF00); } - - va_end(args); } int Screen::drawShapeMarginNoScaleUpwind(uint8 *&dst, const uint8 *&src, int &cnt) { |