[Scummvm-cvs-logs] CVS: scummvm/saga events.cpp,1.29,1.30 events.h,1.8,1.9 gfx.cpp,1.31,1.32 gfx.h,1.14,1.15 input.cpp,1.20,1.21 scene.cpp,1.52,1.53
Eugene Sandulenko
sev at users.sourceforge.net
Fri Nov 19 16:07:01 CET 2004
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15700
Modified Files:
events.cpp events.h gfx.cpp gfx.h input.cpp scene.cpp
Log Message:
o Restore cursor after walkthrough
o Add cursor events
o Hide cursor during intro
Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- events.cpp 30 Oct 2004 22:34:08 -0000 1.29
+++ events.cpp 20 Nov 2004 00:05:49 -0000 1.30
@@ -408,6 +408,17 @@
_vm->_script->SThreadCompleteThread();
break;
+ case CURSOR_EVENT:
+ switch (event->op) {
+ case EVENT_SHOW:
+ _vm->_gfx->showCursor(true);
+ break;
+ case EVENT_HIDE:
+ _vm->_gfx->showCursor(false);
+ break;
+ default:
+ break;
+ }
default:
break;
}
Index: events.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- events.h 27 Oct 2004 21:32:27 -0000 1.8
+++ events.h 20 Nov 2004 00:05:50 -0000 1.9
@@ -52,8 +52,9 @@
TRANSITION_EVENT,
INTERFACE_EVENT,
CONSOLE_EVENT,
- ACTOEVENT,
- SCRIPT_EVENT
+ ACTOR_EVENT,
+ SCRIPT_EVENT,
+ CURSOR_EVENT
};
enum EVENT_OPS {
@@ -83,6 +84,9 @@
// SCRIPT events
EVENT_BLOCKING = 1,
EVENT_NONBLOCKING = 2,
+ // CURSOR events
+ EVENT_SHOW = 1,
+ // EVENT_HIDE = 2, // reused
// CONTINUOUS events
// PALETTE events
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- gfx.cpp 30 Oct 2004 22:34:08 -0000 1.31
+++ gfx.cpp 20 Nov 2004 00:05:50 -0000 1.32
@@ -1029,6 +1029,11 @@
return SUCCESS;
}
+void Gfx::showCursor(bool state) {
+ updateCursor();
+ g_system->showMouse(state);
+}
+
void Gfx::setCursor(int best_white) {
int i;
byte keycolor = (best_white == 0) ? 1 : 0;
Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- gfx.h 30 Oct 2004 22:34:08 -0000 1.14
+++ gfx.h 20 Nov 2004 00:05:50 -0000 1.15
@@ -107,6 +107,8 @@
int getCurrentPal(PALENTRY *src_pal);
int palToBlack(SURFACE *surface, PALENTRY *src_pal, double percent);
int blackToPal(SURFACE *surface, PALENTRY *src_pal, double percent);
+ void updateCursor() { setCursor(getWhite()); }
+ void showCursor(bool state);
private:
void setCursor(int best_white);
Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/input.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- input.cpp 19 Nov 2004 22:30:17 -0000 1.20
+++ input.cpp 20 Nov 2004 00:05:50 -0000 1.21
@@ -42,8 +42,10 @@
switch (event.event_code) {
case OSystem::EVENT_KEYDOWN:
- if ((event.kbd.flags == OSystem::KBD_CTRL) && (event.kbd.keycode == 'w'))
+ if ((event.kbd.flags == OSystem::KBD_CTRL) && (event.kbd.keycode == 'w')) {
_walkthroughDialog->runModal();
+ _gfx->updateCursor();
+ }
if (_vm->_console->isActive()) {
in_char = event.kbd.ascii;
switch (event.kbd.keycode) {
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- scene.cpp 15 Nov 2004 03:03:47 -0000 1.52
+++ scene.cpp 20 Nov 2004 00:05:50 -0000 1.53
@@ -174,6 +174,7 @@
int Scene::startScene() {
YS_DL_NODE *node;
SCENE_QUEUE *scene_qdat;
+ EVENT event;
assert(_initialized);
@@ -187,6 +188,12 @@
return FAILURE;
}
+ // Hide cursor during intro
+ event.type = ONESHOT_EVENT;
+ event.code = CURSOR_EVENT;
+ event.op = EVENT_HIDE;
+ _vm->_events->queue(&event);
+
switch (GAME_GetGameType()) {
case GID_ITE:
ITEStartProc();
@@ -965,6 +972,7 @@
int Scene::defaultScene(int param, SCENE_INFO *scene_info) {
EVENT event;
+ EVENT *q_event;
switch (param) {
case SCENE_BEGIN:
@@ -1011,8 +1019,14 @@
event.op = EVENT_CYCLESTART;
event.time = 0;
- _vm->_events->queue(&event);
+ q_event = _vm->_events->queue(&event);
+ // Show cursor
+ event.type = ONESHOT_EVENT;
+ event.code = CURSOR_EVENT;
+ event.op = EVENT_SHOW;
+ _vm->_events->chain(q_event, &event);
+
// Start scene animations
_vm->_anim->setFlag(0, ANIM_LOOP);
_vm->_anim->play(0, 0);
More information about the Scummvm-git-logs
mailing list