[Scummvm-cvs-logs] SF.net SVN: scummvm: [23278] scummvm/trunk/base
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Jun 24 11:35:04 CEST 2006
Revision: 23278
Author: fingolfin
Date: 2006-06-24 02:34:49 -0700 (Sat, 24 Jun 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23278&view=rev
Log Message:
-----------
Renamed class Timer to TimerManager (the old name was somewhat incorrect/confusing)
Modified Paths:
--------------
scummvm/trunk/base/engine.h
scummvm/trunk/base/main.cpp
scummvm/trunk/common/timer.cpp
scummvm/trunk/common/timer.h
scummvm/trunk/engines/agi/agi.cpp
scummvm/trunk/sound/mididrv.h
scummvm/trunk/sound/mpu401.cpp
scummvm/trunk/sound/mpu401.h
scummvm/trunk/sound/softsynth/emumidi.h
scummvm/trunk/sound/softsynth/mt32.cpp
Modified: scummvm/trunk/base/engine.h
===================================================================
--- scummvm/trunk/base/engine.h 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/base/engine.h 2006-06-24 09:34:49 UTC (rev 23278)
@@ -32,14 +32,14 @@
}
namespace Common {
class SaveFileManager;
- class Timer;
+ class TimerManager;
}
class Engine {
public:
OSystem *_system;
Audio::Mixer *_mixer;
- Common::Timer * _timer;
+ Common::TimerManager * _timer;
protected:
const Common::String _targetName; // target name for saves
Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/base/main.cpp 2006-06-24 09:34:49 UTC (rev 23278)
@@ -317,7 +317,7 @@
system.initBackend();
// Create the timer services
- Common::g_timer = new Common::Timer(&system);
+ Common::g_timer = new Common::TimerManager(&system);
// Set initial window caption
system.setWindowCaption(gScummVMFullVersion);
Modified: scummvm/trunk/common/timer.cpp
===================================================================
--- scummvm/trunk/common/timer.cpp 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/common/timer.cpp 2006-06-24 09:34:49 UTC (rev 23278)
@@ -29,9 +29,9 @@
namespace Common {
-Timer *g_timer = NULL;
+TimerManager *g_timer = NULL;
-Timer::Timer(OSystem *system) :
+TimerManager::TimerManager(OSystem *system) :
_system(system),
_timerHandler(0),
_lastTime(0) {
@@ -51,10 +51,10 @@
}
-Timer::~Timer() {
+TimerManager::~TimerManager() {
// Remove the timer callback.
// Note: backends *must* gurantee that after this method call returns,
- // the handler is not in use anymore; else race condtions could occurs.
+ // the handler is not in use anymore; else race condtions could occur.
_system->setTimerCallback(0, 0);
{
@@ -67,13 +67,13 @@
}
}
-int Timer::timer_handler(int t) {
+int TimerManager::timer_handler(int t) {
if (g_timer)
return g_timer->handler(t);
return 0;
}
-int Timer::handler(int t) {
+int TimerManager::handler(int t) {
StackLock lock(_mutex);
uint32 interval, l;
@@ -97,7 +97,7 @@
return t;
}
-bool Timer::installTimerProc(TimerProc procedure, int32 interval, void *refCon) {
+bool TimerManager::installTimerProc(TimerProc procedure, int32 interval, void *refCon) {
assert(interval > 0);
StackLock lock(_mutex);
@@ -115,7 +115,7 @@
return false;
}
-void Timer::removeTimerProc(TimerProc procedure) {
+void TimerManager::removeTimerProc(TimerProc procedure) {
StackLock lock(_mutex);
for (int l = 0; l < MAX_TIMERS; l++) {
Modified: scummvm/trunk/common/timer.h
===================================================================
--- scummvm/trunk/common/timer.h 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/common/timer.h 2006-06-24 09:34:49 UTC (rev 23278)
@@ -36,7 +36,7 @@
namespace Common {
-class Timer {
+class TimerManager {
public:
typedef void (*TimerProc)(void *refCon);
@@ -55,8 +55,8 @@
} _timerSlots[MAX_TIMERS];
public:
- Timer(OSystem *system);
- ~Timer();
+ TimerManager(OSystem *system);
+ ~TimerManager();
/**
* Install a new timer callback. It will from now be called every interval microseconds.
@@ -82,7 +82,7 @@
int handler(int t);
};
-extern Timer *g_timer;
+extern TimerManager *g_timer;
} // End of namespace Common
Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/engines/agi/agi.cpp 2006-06-24 09:34:49 UTC (rev 23278)
@@ -269,9 +269,8 @@
return k;
}
-static uint32 agi_timer_function_low(uint32 i) {
+static void agi_timer_function_low(void *refCon) {
tick_timer++;
- return i;
}
static void init_pri_table() {
@@ -526,7 +525,7 @@
init_video();
tick_timer = 0;
- Common::g_timer->installTimerProc((Common::Timer::TimerProc) agi_timer_function_low, 10 * 1000, NULL);
+ Common::g_timer->installTimerProc(agi_timer_function_low, 10 * 1000, NULL);
game.ver = -1; /* Don't display the conf file warning */
Modified: scummvm/trunk/sound/mididrv.h
===================================================================
--- scummvm/trunk/sound/mididrv.h 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/sound/mididrv.h 2006-06-24 09:34:49 UTC (rev 23278)
@@ -190,7 +190,7 @@
virtual void metaEvent(byte type, byte *data, uint16 length) { }
// Timing functions - MidiDriver now operates timers
- virtual void setTimerCallback(void *timer_param, Common::Timer::TimerProc timer_proc) = 0;
+ virtual void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) = 0;
/** The time in microseconds between invocations of the timer callback. */
virtual uint32 getBaseTempo(void) = 0;
Modified: scummvm/trunk/sound/mpu401.cpp
===================================================================
--- scummvm/trunk/sound/mpu401.cpp 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/sound/mpu401.cpp 2006-06-24 09:34:49 UTC (rev 23278)
@@ -131,7 +131,7 @@
return NULL;
}
-void MidiDriver_MPU401::setTimerCallback(void *timer_param, Common::Timer::TimerProc timer_proc) {
+void MidiDriver_MPU401::setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) {
if (!_timer_proc || !timer_proc) {
if (_timer_proc)
Common::g_timer->removeTimerProc(_timer_proc);
Modified: scummvm/trunk/sound/mpu401.h
===================================================================
--- scummvm/trunk/sound/mpu401.h 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/sound/mpu401.h 2006-06-24 09:34:49 UTC (rev 23278)
@@ -71,14 +71,14 @@
class MidiDriver_MPU401 : public MidiDriver {
private:
MidiChannel_MPU401 _midi_channels[16];
- Common::Timer::TimerProc _timer_proc;
+ Common::TimerManager::TimerProc _timer_proc;
uint16 _channel_mask;
public:
MidiDriver_MPU401();
virtual void close();
- void setTimerCallback(void *timer_param, Common::Timer::TimerProc timer_proc);
+ void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc);
uint32 getBaseTempo(void) { return 10000; }
uint32 property(int prop, uint32 param);
Modified: scummvm/trunk/sound/softsynth/emumidi.h
===================================================================
--- scummvm/trunk/sound/softsynth/emumidi.h 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/sound/softsynth/emumidi.h 2006-06-24 09:34:49 UTC (rev 23278)
@@ -32,7 +32,7 @@
Audio::Mixer *_mixer;
private:
- Common::Timer::TimerProc _timerProc;
+ Common::TimerManager::TimerProc _timerProc;
void *_timerParam;
int _nextTick;
@@ -70,7 +70,7 @@
return 0;
}
- void setTimerCallback(void *timer_param, Common::Timer::TimerProc timer_proc) {
+ void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) {
_timerProc = timer_proc;
_timerParam = timer_param;
}
Modified: scummvm/trunk/sound/softsynth/mt32.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32.cpp 2006-06-24 09:34:24 UTC (rev 23277)
+++ scummvm/trunk/sound/softsynth/mt32.cpp 2006-06-24 09:34:49 UTC (rev 23278)
@@ -391,7 +391,7 @@
private:
OSystem::Mutex _eventMutex;
MidiEvent_MT32 *_events;
- Timer::TimerProc _timer_proc;
+ TimerManager::TimerProc _timer_proc;
void pushMidiEvent(MidiEvent_MT32 *event);
MidiEvent_MT32 *popMidiEvent();
@@ -405,7 +405,7 @@
void onTimer();
void close();
- void setTimerCallback(void *timer_param, Timer::TimerProc timer_proc);
+ void setTimerCallback(void *timer_param, TimerManager::TimerProc timer_proc);
};
@@ -421,7 +421,7 @@
}
}
-void MidiDriver_ThreadedMT32::setTimerCallback(void *timer_param, Timer::TimerProc timer_proc) {
+void MidiDriver_ThreadedMT32::setTimerCallback(void *timer_param, TimerManager::TimerProc timer_proc) {
if (!_timer_proc || !timer_proc) {
if (_timer_proc)
g_timer->removeTimerProc(_timer_proc);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list