diff options
author | Nicola Mettifogo | 2008-02-06 15:38:33 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-02-06 15:38:33 +0000 |
commit | 509f2f6659de65f63aa85e8cb07840e02c4f84c2 (patch) | |
tree | 36fcbc325ed140998235e978a9979da58ed4d3de /engines/parallaction | |
parent | c03cb964c0a7c2fac7e39cc0035ab9aa030cf3e5 (diff) | |
download | scummvm-rg350-509f2f6659de65f63aa85e8cb07840e02c4f84c2.tar.gz scummvm-rg350-509f2f6659de65f63aa85e8cb07840e02c4f84c2.tar.bz2 scummvm-rg350-509f2f6659de65f63aa85e8cb07840e02c4f84c2.zip |
Enabled moving projector in Nippon Safes. This should fix long standing bug #1729309.
svn-id: r30811
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/callables_ns.cpp | 65 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 17 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 3 |
3 files changed, 38 insertions, 47 deletions
diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index db011cf892..6563262e24 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -617,51 +617,30 @@ void Parallaction_ns::_c_shade(void *parm) { } -void Parallaction_ns::_c_projector(void*) { - static int dword_16032 = 0; +int16 projectorProgram[] = { + 0, 50, 1, 50, 2, 49, 3, 49, 4, 48, 5, 48, 6, 47, 7, 47, 8, 46, 9, 46, 10, 45, 11, 45, + 12, 44, 13, 44, 14, 43, 15, 43, 16, 42, 17, 42, 18, 41, 19, 41, 20, 40, 21, 40, 22, 39, + 23, 39, 24, 38, 25, 38, 26, 37, 27, 37, 28, 36, 29, 36, 30, 35, 31, 35, 32, 34, 33, 34, + 34, 33, 35, 33, 36, 32, 37, 32, 38, 31, 39, 31, 40, 30, 41, 30, 42, 29, 43, 29, 44, 28, + 45, 28, 46, 27, 47, 27, 48, 26, 49, 26, 50, 25, 51, 25, 52, 24, 53, 24, 54, 23, 55, 23, + 56, 22, 57, 22, 58, 21, 59, 21, 60, 20, 61, 20, 62, 19, 63, 19, 64, 18, 65, 18, 66, 17, + 67, 17, 68, 16, 69, 16, 70, 15, 71, 15, 72, 14, 73, 14, 74, 13, 75, 13, 76, 12, 77, 12, + 78, 11, 79, 11, 80, 10, 81, 10, 82, 9, 83, 9, 84, 8, 85, 8, 86, 7, 87, 7, 88, 6, 89, 6, + 90, 5, 91, 5, 92, 4, 93, 4, 94, 3, 95, 3, 96, 2, 97, 2, 98, 1, 99, 1, 100, 0, 101, 0, + 102, 1, 103, 1, 104, 2, 105, 2, 106, 3, 107, 3, 108, 4, 109, 4, 110, 5, 111, 5, 112, 6, + 113, 6, 114, 7, 115, 7, 116, 8, 117, 8, 118, 9, 119, 9, 120, 10, 121, 10, 122, 11, 123, + 11, 124, 12, 125, 12, 126, 13, 127, 13, 128, 14, 129, 14, 130, 15, 131, 15, 132, 16, 133, + 16, 134, 17, 135, 17, 136, 18, 137, 18, 138, 19, 139, 19, 140, 20, 141, 20, 142, 21, 143, + 21, 144, 22, 145, 22, 146, 23, 147, 23, 148, 24, 149, 24, 150, 25, 149, 25, 148, 25, 147, + 25, 146, 25, 145, 25, 144, 25, 143, 25, 142, 25, 141, 25, 140, 25, 139, 25, 138, 25, 137, + 25, 136, 25, 135, 25, 134, 25, 133, 25, 132, 25, 131, 25, 130, 25, 129, 25, 128, 25, 127, + 25, 126, 25, 125, 25, 124, 25, 123, 25, 122, 25, 121, 25, 120, 25, 119, 25, 118, 25, 117, + 25, 116, 25, 115, 25, 114, 25, 113, 25, 112, 25, 111, 25, 110, 25, -1, -1 +}; +void Parallaction_ns::_c_projector(void*) { _gfx->setHalfbriteMode(true); - -// if (dword_16032 != 0) { - // keep drawing spotlight in its final place - _gfx->setProjectorPos(110, 25); - return; -// } -#ifdef HALFBRITE - // move spot light around the stage - int d7, d6; - for (d7 = 0; d7 < 150; d7++) { - - if (d7 < 100) { - int d1 = d7; - if (d1 < 0) - d1++; - - d1 >>= 1; - d6 = 50 - d1; - } else { - int d1 = d7 % 100; - if (d1 < 0) - d1++; - - d1 >>= 1; - d6 = d1; - } - - printf("%i, %i, ", d7+20, d6); -// BltBitMap(&bm, 0, 0, &_screen._bitMap, d7+20, d6, a3->??, a3->??, 0x20, 0x20); - } - - for (d7 = 50; d7 > -10; d7--) { - printf("%i, %i, ", d7+120, d6); -// BltBitMap(&bm, 0, 0, &_screen._bitMap, d7+120, d6, a3->??, a3->??, 0x20, 0x20); - } - - printf("%i, %i\n", d7+120, d6); -// BltBitMap(&bm, 0, 0, &_screen._bitMap, d7+120, d6, a3->??, a3->??, 0x20, 0x20); -#endif - dword_16032 = 1; - return; + _gfx->setProjectorProgram(projectorProgram); } void Parallaction_ns::_c_HBOff(void*) { diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 26da266611..3248113a5e 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -325,10 +325,7 @@ void Gfx::setHalfbriteMode(bool enable) { if (enable == _halfbrite) return; _halfbrite = !_halfbrite; - - if (!enable) { - _hbCircleRadius = 0; - } + _hbCircleRadius = 0; } #define HALFBRITE_CIRCLE_RADIUS 48 @@ -338,6 +335,9 @@ void Gfx::setProjectorPos(int x, int y) { _hbCirclePos.y = y + _hbCircleRadius; } +void Gfx::setProjectorProgram(int16 *data) { + _nextProjectorPos = data; +} void Gfx::drawInventory() { @@ -439,6 +439,15 @@ void Gfx::updateScreen() { for (int i = 0; i < surf->w*surf->h; i++) { *buf++ |= 0x20; } + if (_nextProjectorPos) { + int16 x = *_nextProjectorPos++; + int16 y = *_nextProjectorPos++; + if (x == -1 && y == -1) { + _nextProjectorPos = 0; + } else { + setProjectorPos(x, y); + } + } if (_hbCircleRadius > 0) { drawCircle(_hbCirclePos.x, _hbCirclePos.y, _hbCircleRadius, 0, &halfbritePixel, surf->pixels); } diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index d61cee2b76..02be8a2c4b 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -507,6 +507,9 @@ public: // amiga specific void setHalfbriteMode(bool enable); void setProjectorPos(int x, int y); + void setProjectorProgram(int16 *data); + int16 *_nextProjectorPos; + // init Gfx(Parallaction* vm); |