aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/cursor.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-03-08 08:45:21 +0000
committerTravis Howell2009-03-08 08:45:21 +0000
commit2620d6836c001f2f295cb6efd6beab78f5a3c50f (patch)
tree81d5055b74abfc7b0be105bee13b39e6505fce91 /engines/agos/cursor.cpp
parent7bfab75a0814d0655a2504bf4c461df0000da0e4 (diff)
downloadscummvm-rg350-2620d6836c001f2f295cb6efd6beab78f5a3c50f.tar.gz
scummvm-rg350-2620d6836c001f2f295cb6efd6beab78f5a3c50f.tar.bz2
scummvm-rg350-2620d6836c001f2f295cb6efd6beab78f5a3c50f.zip
Add initial support for Personal Nightmare.
Thanks to dreammaster for file decompression and icon decoding code. NOTE: setjmp/longjmp code will require conversion for portability. svn-id: r39216
Diffstat (limited to 'engines/agos/cursor.cpp')
-rw-r--r--engines/agos/cursor.cpp74
1 files changed, 73 insertions, 1 deletions
diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp
index d8c5793ba2..d0481e8f5a 100644
--- a/engines/agos/cursor.cpp
+++ b/engines/agos/cursor.cpp
@@ -474,6 +474,71 @@ get_out:
_litBoxFlag = 0;
}
+void AGOSEngine_PN::handleMouseMoved() {
+ if (_mouseHideCount) {
+ CursorMan.showMouse(false);
+ return;
+ }
+
+ CursorMan.showMouse(true);
+ _mouse = _eventMan->getMousePos();
+
+ if (_leftClick == true) {
+ _leftClick = false;
+ if (_dragFlag != 0) {
+ _hitCalled = 4;
+ } else if (_lockWord & 0x10) {
+ if (_oneClick != 0) {
+ _hitCalled = 2;
+ _oneClick = 0;
+ } else {
+ _oneClick++;
+ }
+ } else {
+ _hitCalled = 1;
+ }
+ _mouseDown = 0;
+ }
+
+ if (_rightClick == true) {
+ _rightClick = false;
+ if (_hitCalled == 0)
+ _hitCalled = 5;
+ }
+
+ if (_mouse != _mouseOld)
+ _needHitAreaRecalc++;
+
+ if (_leftButton != 0) {
+ if (_mouseDown <= 20) {
+ _mouseDown++;
+ if (_mouseDown > 20) {
+ if (_lockWord & 0x10) {
+ if (_oneClick == 0)
+ _hitCalled = 3;
+ } else {
+ _hitCalled = 3;
+ }
+ }
+ }
+ } else if ((_lockWord & 0x10) && _oneClick != 0) {
+ _oneClick++;
+ if (_oneClick < 10) {
+ _hitCalled = 1;
+ _oneClick = 0;
+ }
+ }
+
+ if (!_wiped)
+ boxController(_mouse.x, _mouse.y, 0);
+
+ _mouseOld = _mouse;
+ drawMousePointer();
+
+ _needHitAreaRecalc = 0;
+ _litBoxFlag = 0;
+}
+
void AGOSEngine::handleMouseMoved() {
uint x;
@@ -721,8 +786,15 @@ void AGOSEngine::drawMousePointer() {
} else {
const uint16 *src;
int i, j;
+ uint8 color;
- const uint8 color = (getGameType() == GType_ELVIRA1) ? 15: 65;
+ if (getGameType() == GType_PN) {
+ color = (getPlatform() == Common::kPlatformPC) ? 15 : 14;
+ } else if (getGameType() == GType_ELVIRA1) {
+ color = 15;
+ } else {
+ color = 65;
+ }
memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight);
if (getGameType() == GType_WW) {