aboutsummaryrefslogtreecommitdiff
path: root/sword1/mouse.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-20 09:12:54 +0000
committerRobert Göffringmann2003-12-20 09:12:54 +0000
commit59654b17191b99c23486f6a41076b9ed05a1c38f (patch)
treef088012a40319619f80b8e81082779bb6512f737 /sword1/mouse.cpp
parentaceafcbb484f18aedda914bf321585a9c113016a (diff)
downloadscummvm-rg350-59654b17191b99c23486f6a41076b9ed05a1c38f.tar.gz
scummvm-rg350-59654b17191b99c23486f6a41076b9ed05a1c38f.tar.bz2
scummvm-rg350-59654b17191b99c23486f6a41076b9ed05a1c38f.zip
added SwordControl (the control panel). Not yet finished.
svn-id: r11775
Diffstat (limited to 'sword1/mouse.cpp')
-rw-r--r--sword1/mouse.cpp41
1 files changed, 32 insertions, 9 deletions
diff --git a/sword1/mouse.cpp b/sword1/mouse.cpp
index 585fba3bc2..920c3f74cc 100644
--- a/sword1/mouse.cpp
+++ b/sword1/mouse.cpp
@@ -35,14 +35,6 @@ SwordMouse::SwordMouse(OSystem *system, ResMan *pResMan, ObjectMan *pObjMan) {
_resMan = pResMan;
_objMan = pObjMan;
_system = system;
- _numObjs = 0;
- _menuStatus = _mouseStatus = 0; // mouse off and unlocked
- _getOff = 0;
- _specialPtrId = 0;
- _inTopMenu = false;
-
- for (uint8 cnt = 0; cnt < 17; cnt++)
- _pointers[cnt] = (MousePtr*)_resMan->mouseResOpen(MSE_POINTER + cnt);
/*_resMan->resOpen(MSE_POINTER); // normal mouse (1 frame anim)
_resMan->resOpen(MSE_OPERATE);
_resMan->resOpen(MSE_PICKUP);
@@ -63,6 +55,37 @@ SwordMouse::SwordMouse(OSystem *system, ResMan *pResMan, ObjectMan *pObjMan) {
// luggage & chess stuff is opened dynamically
}
+void SwordMouse::initialize(void) {
+ _numObjs = 0;
+ _menuStatus = _mouseStatus = 0; // mouse off and unlocked
+ _getOff = 0;
+ _specialPtrId = 0;
+ _inTopMenu = false;
+
+ for (uint8 cnt = 0; cnt < 17; cnt++)
+ _pointers[cnt] = (MousePtr*)_resMan->mouseResOpen(MSE_POINTER + cnt);
+}
+
+void SwordMouse::controlPanel(bool on) { // true on entering cpanel, false when leaving
+ static uint32 savedPtrId = 0, savedSpecialId = 0;
+ static uint8 savedMouseStatus;
+ if (on) {
+ savedPtrId = _currentPtrId;
+ savedSpecialId = _specialPtrId;
+ savedMouseStatus = _mouseStatus;
+ _mouseStatus = 1;
+ setPointer(MSE_POINTER, 0);
+ } else {
+ _currentPtrId = savedPtrId;
+ _mouseStatus = savedMouseStatus;
+ _specialPtrId = savedSpecialId;
+ if (_specialPtrId)
+ setPointer(_specialPtrId, 0);
+ else
+ setPointer(_currentPtrId + MSE_POINTER, 0);
+ }
+}
+
void SwordMouse::useLogicAndMenu(SwordLogic *pLogic, SwordMenu *pMenu) {
_logic = pLogic;
_menu = pMenu;
@@ -186,7 +209,7 @@ void SwordMouse::setPointer(uint32 resId, uint32 rate) {
}
_frame = 0;
- if (resId == 0) {
+ if ((resId == 0) || (!(_mouseStatus & 1))) {
_system->set_mouse_cursor(NULL, 0, 0, 0, 0);
_system->show_mouse(false);
} else {