diff options
author | Max Horn | 2002-08-21 16:07:07 +0000 |
---|---|---|
committer | Max Horn | 2002-08-21 16:07:07 +0000 |
commit | ce46866403fdcc479cf9d67e4d430409b15dadc3 (patch) | |
tree | 75ebfaa1ed13f549959d76d3ce101c3e66f5451b /common/timer.h | |
parent | 662256f25dbe43abf67077a804e225738765f009 (diff) | |
download | scummvm-rg350-ce46866403fdcc479cf9d67e4d430409b15dadc3.tar.gz scummvm-rg350-ce46866403fdcc479cf9d67e4d430409b15dadc3.tar.bz2 scummvm-rg350-ce46866403fdcc479cf9d67e4d430409b15dadc3.zip |
Initial revision
svn-id: r4785
Diffstat (limited to 'common/timer.h')
-rw-r--r-- | common/timer.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/common/timer.h b/common/timer.h new file mode 100644 index 0000000000..a4f4c7080d --- /dev/null +++ b/common/timer.h @@ -0,0 +1,66 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef TIMER_H +#define TIMER_H + +#include "scummsys.h" + +#define MAX_TIMERS 5 + +typedef void (*TimerProc)(Scumm *); + +#ifdef __MORPHOS__ +#include "morphos/morphos_timer.h" +#else + +class OSystem; + +class Timer { + +private: + OSystem *_osystem; + Scumm *_scumm; + bool _initialized; + bool _timerRunning; + void *_timerHandler; + int32 _thisTime; + int32 _lastTime; + + struct TimerSlots { + TimerProc procedure; + int32 interval; + int32 counter; + } _timerSlots[MAX_TIMERS]; + +public: + Timer(Scumm *system); + ~Timer(); + + int handler(int *t); + bool init(); + void release(); + bool installProcedure(TimerProc procedure, int32 interval); + void releaseProcedure(TimerProc procedure); +}; + +#endif + +#endif |