[Scummvm-cvs-logs] CVS: scummvm gui.cpp,1.43,1.44 gui.h,1.21,1.22
Max Horn
fingolfin at users.sourceforge.net
Sun May 12 12:26:02 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv29970
Modified Files:
gui.cpp gui.h
Log Message:
restore old cursor after leaving save dialog (#548614)
Index: gui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- gui.cpp 12 May 2002 13:36:55 -0000 1.43
+++ gui.cpp 12 May 2002 19:25:44 -0000 1.44
@@ -947,17 +947,19 @@
void Gui::loop()
{
- /* FIXME - _active is a bool, so what was that code meant to do ? */
-#if OLD_WEIRD_CODE
- if (_active == 1) {
- _active++;
-#else
- if (_active) {
-#endif
+ if (_active && !_inited) {
+ _inited = true;
draw(0, 200); // was 100
_s->pauseSounds(true);
+ // Backup old cursor
+ memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor));
+ _old_cursorWidth = _s->_cursorWidth;
+ _old_cursorHeight = _s->_cursorHeight;
+ _old_cursorHotspotX = _s->_cursorHotspotX;
+ _old_cursorHotspotY = _s->_cursorHotspotY;
_old_cursor_mode = _s->_system->show_mouse(true);
+
_s->_cursorAnimate++;
_s->gdi._cursorActive = 1;
}
@@ -991,10 +993,20 @@
_s->_fullRedraw = true;
_s->_completeScreenRedraw = true;
_s->_cursorAnimate--;
+
+ // Restore old cursor
+ memcpy(_s->_grabbedCursor, _old_grabbedCursor, sizeof(_old_grabbedCursor));
+ _s->_cursorWidth = _old_cursorWidth;
+ _s->_cursorHeight = _old_cursorHeight;
+ _s->_cursorHotspotX = _old_cursorHotspotX;
+ _s->_cursorHotspotY = _old_cursorHotspotY;
+ _s->updateCursor();
+
_s->_system->show_mouse(_old_cursor_mode);
_s->pauseSounds(false);
_active = false;
+ _inited = false;
#ifdef _WIN32_WCE
Index: gui.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gui.h 8 May 2002 06:20:13 -0000 1.21
+++ gui.h 12 May 2002 19:25:44 -0000 1.22
@@ -52,14 +52,19 @@
int _return_to;
int _curX, _curY;
VirtScreen *_vs;
- bool _old_cursor_mode;
int _parentX, _parentY;
bool _active;
+ bool _inited;
byte _clickTimer;
byte _cur_page;
byte _dialog;
int _clickWidget;
char *_queryMess;
+
+ // mouse cursor state
+ bool _old_cursor_mode;
+ int _old_cursorHotspotX, _old_cursorHotspotY, _old_cursorWidth, _old_cursorHeight;
+ byte _old_grabbedCursor[2048];
// optiondialog specifics
int _gui_variables[100];
More information about the Scummvm-git-logs
mailing list