diff options
author | Travis Howell | 2009-03-08 13:18:07 +0000 |
---|---|---|
committer | Travis Howell | 2009-03-08 13:18:07 +0000 |
commit | 1937dca584ab38db4af7084649a59ccd3c3bf1ca (patch) | |
tree | c85975feb80ed97afb6e878f16cc4de7b480a278 | |
parent | 275cf8a383a58262c939b7662f1b7ec02f69cb86 (diff) | |
download | scummvm-rg350-1937dca584ab38db4af7084649a59ccd3c3bf1ca.tar.gz scummvm-rg350-1937dca584ab38db4af7084649a59ccd3c3bf1ca.tar.bz2 scummvm-rg350-1937dca584ab38db4af7084649a59ccd3c3bf1ca.zip |
Cleanup.
svn-id: r39222
-rw-r--r-- | engines/agos/agos.cpp | 1 | ||||
-rw-r--r-- | engines/agos/agos.h | 7 | ||||
-rw-r--r-- | engines/agos/cursor.cpp | 8 | ||||
-rw-r--r-- | engines/agos/verb.cpp | 2 | ||||
-rw-r--r-- | engines/agos/vga.cpp | 53 | ||||
-rw-r--r-- | engines/agos/vga_pn.cpp | 35 | ||||
-rw-r--r-- | engines/agos/vga_s2.cpp | 18 |
7 files changed, 61 insertions, 63 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 10014bcdae..1dd5cb0d7e 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -291,7 +291,6 @@ AGOSEngine::AGOSEngine(OSystem *syst) _initMouse = 0; _leftButtonDown = 0; - _mouseDown = 0; _rightButtonDown = 0; _clickOnly = 0; _oneClick = 0; diff --git a/engines/agos/agos.h b/engines/agos/agos.h index d4a0adc4c9..5c66a9f747 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -409,11 +409,10 @@ protected: uint16 _mouseHideCount; bool _mouseToggle; - byte _leftButtonDown; + byte _leftButtonDown, _rightButtonDown; byte _leftButton, _leftButtonCount, _leftButtonOld; - byte _mouseDown; - byte _rightButtonDown; - bool _clickOnly, _oneClick; + byte _oneClick; + bool _clickOnly; bool _leftClick, _rightClick; bool _noRightClick; diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp index 88c0105fc1..e6231abd62 100644 --- a/engines/agos/cursor.cpp +++ b/engines/agos/cursor.cpp @@ -497,7 +497,7 @@ void AGOSEngine_PN::handleMouseMoved() { } else { _hitCalled = 1; } - _mouseDown = 0; + _dragCount = 0; } if (_rightClick == true) { @@ -510,9 +510,9 @@ void AGOSEngine_PN::handleMouseMoved() { _needHitAreaRecalc++; if (_leftButton != 0) { - if (_mouseDown <= 20) { - _mouseDown++; - if (_mouseDown > 20) { + if (_dragCount <= 20) { + _dragCount++; + if (_dragCount > 20) { if (_videoLockOut & 0x10) { if (_oneClick == 0) _hitCalled = 3; diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp index c6fc1d193f..263c8ed806 100644 --- a/engines/agos/verb.cpp +++ b/engines/agos/verb.cpp @@ -1112,7 +1112,7 @@ void AGOSEngine_PN::execMouseHit(HitArea *ha) { _dragFlag = 0; _hitCalled = 0; _oneClick = 0; - _mouseDown = 0; + _dragCount = 0; _needHitAreaRecalc++; if (ha != 0) { if (ha->flags & kOBFInventoryBox) diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index d00c9ceb34..f40ddf1be5 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -177,27 +177,6 @@ void AGOSEngine::runVgaScript() { } } -bool AGOSEngine_PN::ifObjectHere(uint16 a) { - if (getFeatures() & GF_DEMO) - return 0; - else - return _variableArray[39] == getptr(_quickptr[11] + a * _quickshort[4] + 2); -} - -bool AGOSEngine_PN::ifObjectAt(uint16 a, uint16 b) { - if (getFeatures() & GF_DEMO) - return 0; - else - return b == getptr(_quickptr[11] + a * _quickshort[4] + 2); -} - -bool AGOSEngine_PN::ifObjectState(uint16 a, int16 b) { - if (getFeatures() & GF_DEMO) - return 0; - else - return b == getptr(_quickptr[0] + a * _quickshort[0] + 2); -} - bool AGOSEngine::ifObjectHere(uint16 a) { Item *item; @@ -1247,38 +1226,6 @@ void AGOSEngine::clearVideoBackGround(uint16 num, uint16 color) { } } -void AGOSEngine_PN::clearVideoWindow(uint16 num, uint16 color) { - const uint16 *vlut = &_videoWindows[num * 4]; - uint16 xoffs = vlut[0] * 16; - uint16 yoffs = vlut[1]; - - Graphics::Surface *screen = _system->lockScreen(); - byte *dst = (byte *)screen->pixels + xoffs + yoffs * screen->pitch; - for (uint h = 0; h < vlut[3]; h++) { - memset(dst, color, vlut[2] * 16); - dst += screen->pitch; - } - _system->unlockScreen(); -} - -void AGOSEngine_Simon2::clearVideoWindow(uint16 num, uint16 color) { - const uint16 *vlut = &_videoWindows[num * 4]; - - uint16 xoffs = vlut[0] * 16; - uint16 yoffs = vlut[1]; - uint16 dstWidth = _videoWindows[18] * 16; - byte *dst = _window4BackScn + xoffs + yoffs * dstWidth; - - setMoveRect(0, 0, vlut[2] * 16, vlut[3]); - - for (uint h = 0; h < vlut[3]; h++) { - memset(dst, color, vlut[2] * 16); - dst += dstWidth; - } - - _window4Flag = 1; -} - void AGOSEngine::clearVideoWindow(uint16 num, uint16 color) { if (getGameType() == GType_ELVIRA1) { if (num == 2 || num == 6) diff --git a/engines/agos/vga_pn.cpp b/engines/agos/vga_pn.cpp index ae9bb8eac4..eafac6e1a2 100644 --- a/engines/agos/vga_pn.cpp +++ b/engines/agos/vga_pn.cpp @@ -88,6 +88,27 @@ void AGOSEngine_PN::setupVideoOpcodes(VgaOpcodeProc *op) { op[55] = &AGOSEngine::vc55_scanFlag; } +bool AGOSEngine_PN::ifObjectHere(uint16 a) { + if (getFeatures() & GF_DEMO) + return 0; + else + return _variableArray[39] == getptr(_quickptr[11] + a * _quickshort[4] + 2); +} + +bool AGOSEngine_PN::ifObjectAt(uint16 a, uint16 b) { + if (getFeatures() & GF_DEMO) + return 0; + else + return b == getptr(_quickptr[11] + a * _quickshort[4] + 2); +} + +bool AGOSEngine_PN::ifObjectState(uint16 a, int16 b) { + if (getFeatures() & GF_DEMO) + return 0; + else + return b == getptr(_quickptr[0] + a * _quickshort[0] + 2); +} + void AGOSEngine::vc36_pause() { const char *message1 = "Press any key to continue"; bool oldWiped = _wiped; @@ -185,4 +206,18 @@ void AGOSEngine::vc55_scanFlag() { _scanFlag = 1; } +void AGOSEngine_PN::clearVideoWindow(uint16 num, uint16 color) { + const uint16 *vlut = &_videoWindows[num * 4]; + uint16 xoffs = vlut[0] * 16; + uint16 yoffs = vlut[1]; + + Graphics::Surface *screen = _system->lockScreen(); + byte *dst = (byte *)screen->pixels + xoffs + yoffs * screen->pitch; + for (uint h = 0; h < vlut[3]; h++) { + memset(dst, color, vlut[2] * 16); + dst += screen->pitch; + } + _system->unlockScreen(); +} + } // End of namespace AGOS diff --git a/engines/agos/vga_s2.cpp b/engines/agos/vga_s2.cpp index e823a43852..96d24620bb 100644 --- a/engines/agos/vga_s2.cpp +++ b/engines/agos/vga_s2.cpp @@ -217,4 +217,22 @@ void AGOSEngine::vc74_clearMark() { _marks &= ~(1 << vcReadNextWord()); } +void AGOSEngine_Simon2::clearVideoWindow(uint16 num, uint16 color) { + const uint16 *vlut = &_videoWindows[num * 4]; + + uint16 xoffs = vlut[0] * 16; + uint16 yoffs = vlut[1]; + uint16 dstWidth = _videoWindows[18] * 16; + byte *dst = _window4BackScn + xoffs + yoffs * dstWidth; + + setMoveRect(0, 0, vlut[2] * 16, vlut[3]); + + for (uint h = 0; h < vlut[3]; h++) { + memset(dst, color, vlut[2] * 16); + dst += dstWidth; + } + + _window4Flag = 1; +} + } // End of namespace AGOS |