aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorChris Warren-Smith2011-08-20 10:41:32 +1000
committerChris Warren-Smith2011-08-21 16:39:09 +1000
commit43059b18787cda6dfb6b13b90af276930c52d6d1 (patch)
tree104e7e619e0b98d017f28f025989215561f7bf7f /backends
parent773f61253ca1d921d78056e1bf777a5fd74c63e7 (diff)
downloadscummvm-rg350-43059b18787cda6dfb6b13b90af276930c52d6d1.tar.gz
scummvm-rg350-43059b18787cda6dfb6b13b90af276930c52d6d1.tar.bz2
scummvm-rg350-43059b18787cda6dfb6b13b90af276930c52d6d1.zip
BADA: Moved timer manager to backends/timer/bada
Diffstat (limited to 'backends')
-rw-r--r--backends/module.mk5
-rwxr-xr-xbackends/platform/bada/system.cpp2
-rwxr-xr-xbackends/timer/bada/timer.cpp (renamed from backends/platform/bada/timer.cpp)17
-rwxr-xr-xbackends/timer/bada/timer.h (renamed from backends/platform/bada/timer.h)2
4 files changed, 13 insertions, 13 deletions
diff --git a/backends/module.mk b/backends/module.mk
index 7a8aab8b6a..e38b039aa2 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -117,6 +117,11 @@ MODULE_OBJS += \
mixer/sdl13/sdl13-mixer.o
endif
+ifeq ($(BACKEND),bada)
+MODULE_OBJS += \
+ timer/bada/timer.o
+endif
+
ifeq ($(BACKEND),ds)
MODULE_OBJS += \
fs/ds/ds-fs.o \
diff --git a/backends/platform/bada/system.cpp b/backends/platform/bada/system.cpp
index 33318a1e61..4503b8fa6b 100755
--- a/backends/platform/bada/system.cpp
+++ b/backends/platform/bada/system.cpp
@@ -33,12 +33,12 @@
#include "backends/audiocd/default/default-audiocd.h"
#include "backends/mutex/mutex.h"
#include "backends/fs/fs-factory.h"
+#include "backends/timer/bada/timer.h"
#include "backends/platform/bada/form.h"
#include "backends/platform/bada/system.h"
#include "backends/platform/bada/graphics.h"
#include "backends/platform/bada/audio.h"
-#include "backends/platform/bada/timer.h"
using namespace Osp::Base;
using namespace Osp::Base::Runtime;
diff --git a/backends/platform/bada/timer.cpp b/backends/timer/bada/timer.cpp
index b98af897f8..8f5620401f 100755
--- a/backends/platform/bada/timer.cpp
+++ b/backends/timer/bada/timer.cpp
@@ -20,8 +20,9 @@
*
*/
-#include "backends/platform/bada/timer.h"
-#include "backends/platform/bada/system.h"
+#if defined (BADA)
+
+#include "backends/timer/bada/timer.h"
//
// TimerSlot
@@ -32,16 +33,12 @@ TimerSlot::TimerSlot(Common::TimerManager::TimerProc callback,
_callback(callback),
_interval(interval),
_refCon(refCon) {
- logEntered();
}
TimerSlot::~TimerSlot() {
- logEntered();
}
bool TimerSlot::OnStart() {
- logEntered();
-
_timer = new Osp::Base::Runtime::Timer();
if (!_timer || IsFailed(_timer->Construct(*this))) {
AppLog("Failed to create timer");
@@ -58,7 +55,7 @@ bool TimerSlot::OnStart() {
}
void TimerSlot::OnStop() {
- logEntered();
+ AppLog("timer stopped");
if (_timer) {
_timer->Cancel();
delete _timer;
@@ -75,11 +72,9 @@ void TimerSlot::OnTimerExpired(Timer &timer) {
// BadaTimerManager
//
BadaTimerManager::BadaTimerManager() {
- logEntered();
}
BadaTimerManager::~BadaTimerManager() {
- logEntered();
for (Common::List<TimerSlot>::iterator slot = _timers.begin();
slot != _timers.end(); ++slot) {
slot->Stop();
@@ -89,7 +84,6 @@ BadaTimerManager::~BadaTimerManager() {
bool BadaTimerManager::installTimerProc(TimerProc proc, int32 interval, void *refCon,
const Common::String &id) {
- logEntered();
TimerSlot *slot = new TimerSlot(proc, interval / 1000, refCon);
if (IsFailed(slot->Construct(THREAD_TYPE_EVENT_DRIVEN))) {
@@ -109,7 +103,6 @@ bool BadaTimerManager::installTimerProc(TimerProc proc, int32 interval, void *re
}
void BadaTimerManager::removeTimerProc(TimerProc proc) {
- logEntered();
for (Common::List<TimerSlot>::iterator slot = _timers.begin();
slot != _timers.end(); ++slot) {
if (slot->_callback == proc) {
@@ -118,3 +111,5 @@ void BadaTimerManager::removeTimerProc(TimerProc proc) {
}
}
}
+
+#endif
diff --git a/backends/platform/bada/timer.h b/backends/timer/bada/timer.h
index f9ed32c801..04ca771c26 100755
--- a/backends/platform/bada/timer.h
+++ b/backends/timer/bada/timer.h
@@ -55,7 +55,7 @@ public:
const Common::String &id);
void removeTimerProc(TimerProc proc);
- private:
+private:
Common::List<TimerSlot> _timers;
};