[Scummvm-cvs-logs] CVS: scummvm/common system.h,1.57,1.58 timer.cpp,1.26,1.27
Max Horn
fingolfin at users.sourceforge.net
Sun Mar 14 18:42:50 CET 2004
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8561
Modified Files:
system.h timer.cpp
Log Message:
Renamed OSystem::set_timer() to setTimerCallback(); more OSystem Doxygen changes
Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- system.h 15 Mar 2004 00:55:43 -0000 1.57
+++ system.h 15 Mar 2004 01:18:46 -0000 1.58
@@ -339,10 +339,11 @@
* can be passed to poll_event.
*/
struct Event {
+ /** The type of the event. */
EventCode event_code;
/**
- * Keyboard data; only valid for keyboard events (i.e. EVENT_KEYDOWN
- * and EVENT_KEYUP). For all other event types, content is undefined.
+ * Keyboard data; only valid for keyboard events (EVENT_KEYDOWN and
+ * EVENT_KEYUP). For all other event types, content is undefined.
*/
struct {
/**
@@ -367,6 +368,12 @@
*/
byte flags;
} kbd;
+ /**
+ * The mouse coordinates, in virtual screen coordinates. Only valid
+ * for mouse events.
+ * Virtual screen coordinatest means: the coordinate system of the
+ * screen area as defined by the most recent call to initSize().
+ */
Common::Point mouse;
};
@@ -384,10 +391,19 @@
virtual void delay_msecs(uint msecs) = 0;
/**
- * Set the timer callback.
+ * Set the timer callback, a function which is periodically invoked by the
+ * backend. This can for example be done via a background thread.
+ * There is at most one active timer; if this method is called while there
+ * is already an active timer, then the new timer callback should replace
+ * the previous one. In particular, passing a callback pointer value of 0
+ * is legal and can be used to clear the current timer callback.
* @see Common::Timer
+ *
+ * @param callback pointer to the callback. May be 0 to reset the timer
+ * @param interval the intervall (in milliseconds) between invocations
+ * of the callback
*/
- virtual void set_timer(TimerProc callback, int interval) = 0;
+ virtual void setTimerCallback(TimerProc callback, int interval) = 0;
//@}
Index: timer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/timer.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- timer.cpp 28 Feb 2004 12:57:52 -0000 1.26
+++ timer.cpp 15 Mar 2004 01:18:47 -0000 1.27
@@ -46,12 +46,12 @@
_thisTime = _system->get_msecs();
// Set the timer last, after everything has been initialised
- _system->set_timer(&timer_handler, 10);
+ _system->setTimerCallback(&timer_handler, 10);
}
Timer::~Timer() {
- _system->set_timer(0, 0);
+ _system->setTimerCallback(0, 0);
{
Common::StackLock lock(_mutex);
@@ -64,8 +64,8 @@
// FIXME: There is still a potential race condition here, depending on how
- // the system backend implements set_timer: If timers are done using
- // threads, and if set_timer does *not* gurantee that after it terminates
+ // the system backend implements setTimerCallback: If timers are done using
+ // threads, and if setTimerCallback does *not* gurantee that after it terminates
// that timer thread is not run anymore, we are fine. However, if the timer
// is still running in parallel to this destructor, then it might be that
// it is still waiting for the _mutex. So, again depending on the backend,
More information about the Scummvm-git-logs
mailing list