aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorPaul Gilbert2013-07-04 08:44:49 -0400
committerPaul Gilbert2013-07-04 08:44:49 -0400
commitfa737fd5af3763a152e92c4b74c114876b3a8573 (patch)
tree3e698f9c095ba692c6e305b35785a8f45f5e061b /backends/platform
parenta49a7d5ad4f4435ed8cee0934c94155586f2dd99 (diff)
parentbaafae672f3489b0eaf77c22be0c65ba31e6b73d (diff)
downloadscummvm-rg350-fa737fd5af3763a152e92c4b74c114876b3a8573.tar.gz
scummvm-rg350-fa737fd5af3763a152e92c4b74c114876b3a8573.tar.bz2
scummvm-rg350-fa737fd5af3763a152e92c4b74c114876b3a8573.zip
Merge branch 'master' into tsage_r2r
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/android/android.cpp2
-rw-r--r--backends/platform/android/android.h2
-rw-r--r--backends/platform/bada/system.cpp2
-rw-r--r--backends/platform/bada/system.h2
-rw-r--r--backends/platform/dc/dc.h2
-rw-r--r--backends/platform/dc/time.cpp2
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp2
-rw-r--r--backends/platform/ds/arm9/source/dsmain.h2
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp2
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h2
-rw-r--r--backends/platform/iphone/osys_main.cpp2
-rw-r--r--backends/platform/iphone/osys_main.h2
-rw-r--r--backends/platform/n64/osys_n64.h2
-rw-r--r--backends/platform/n64/osys_n64_base.cpp2
-rw-r--r--backends/platform/null/null.cpp2
-rw-r--r--backends/platform/ps2/systemps2.cpp2
-rw-r--r--backends/platform/ps2/systemps2.h2
-rw-r--r--backends/platform/psp/osys_psp.cpp2
-rw-r--r--backends/platform/psp/osys_psp.h2
-rw-r--r--backends/platform/psp/rtc.cpp2
-rw-r--r--backends/platform/psp/rtc.h2
-rw-r--r--backends/platform/sdl/sdl-sys.h3
-rw-r--r--backends/platform/sdl/sdl.cpp28
-rw-r--r--backends/platform/sdl/sdl.h3
-rw-r--r--backends/platform/wii/osystem.cpp2
-rw-r--r--backends/platform/wii/osystem.h2
26 files changed, 45 insertions, 35 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index f06e4be19e..ad80ea7f8c 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -450,7 +450,7 @@ bool OSystem_Android::getFeatureState(Feature f) {
}
}
-uint32 OSystem_Android::getMillis() {
+uint32 OSystem_Android::getMillis(bool skipRecord) {
timeval curTime;
gettimeofday(&curTime, 0);
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 5f2f40b726..b4813b3bdf 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -274,7 +274,7 @@ public:
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual bool pollEvent(Common::Event &event);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual MutexRef createMutex(void);
diff --git a/backends/platform/bada/system.cpp b/backends/platform/bada/system.cpp
index 3f862c2571..5c3c25c63d 100644
--- a/backends/platform/bada/system.cpp
+++ b/backends/platform/bada/system.cpp
@@ -373,7 +373,7 @@ bool BadaSystem::pollEvent(Common::Event &event) {
return _appForm->pollEvent(event);
}
-uint32 BadaSystem::getMillis() {
+uint32 BadaSystem::getMillis(bool skipRecord) {
long long result, ticks = 0;
SystemTime::GetTicks(ticks);
result = ticks - _epoch;
diff --git a/backends/platform/bada/system.h b/backends/platform/bada/system.h
index c28686cb3d..89394c58ec 100644
--- a/backends/platform/bada/system.h
+++ b/backends/platform/bada/system.h
@@ -83,7 +83,7 @@ private:
void updateScreen();
bool pollEvent(Common::Event &event);
- uint32 getMillis();
+ uint32 getMillis(bool skipRecord = false);
void delayMillis(uint msecs);
void getTimeAndDate(TimeDate &t) const;
void fatalError();
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index d41839d961..d62ced02e1 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -151,7 +151,7 @@ public:
void setShakePos(int shake_pos);
// Get the number of milliseconds since the program was started.
- uint32 getMillis();
+ uint32 getMillis(bool skipRecord = false);
// Delay for a specified amount of milliseconds
void delayMillis(uint msecs);
diff --git a/backends/platform/dc/time.cpp b/backends/platform/dc/time.cpp
index 8cc3a71e8d..1e5f44ec85 100644
--- a/backends/platform/dc/time.cpp
+++ b/backends/platform/dc/time.cpp
@@ -26,7 +26,7 @@
#include "dc.h"
-uint32 OSystem_Dreamcast::getMillis()
+uint32 OSystem_Dreamcast::getMillis(bool skipRecord)
{
static uint32 msecs=0;
static unsigned int t0=0;
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index 830c782b90..9dc66e80d7 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -2280,7 +2280,7 @@ void VBlankHandler(void) {
//REG_IF = IRQ_VBLANK;
}
-int getMillis() {
+int getMillis(bool skipRecord) {
return currentTimeMillis;
// return frameCount * FRAME_TIME;
}
diff --git a/backends/platform/ds/arm9/source/dsmain.h b/backends/platform/ds/arm9/source/dsmain.h
index ad49ae276d..5e91fae13a 100644
--- a/backends/platform/ds/arm9/source/dsmain.h
+++ b/backends/platform/ds/arm9/source/dsmain.h
@@ -88,7 +88,7 @@ void setGamma(int gamma);
// Timers
void setTimerCallback(OSystem_DS::TimerProc proc, int interval); // Setup a callback function at a regular interval
-int getMillis(); // Return the current runtime in milliseconds
+int getMillis(bool skipRecord = false); // Return the current runtime in milliseconds
void doTimerCallback(); // Call callback function if required
// Sound
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index a4b9c842fc..2f6358d8ee 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -656,7 +656,7 @@ bool OSystem_DS::pollEvent(Common::Event &event) {
return false;
}
-uint32 OSystem_DS::getMillis() {
+uint32 OSystem_DS::getMillis(bool skipRecord) {
return DS::getMillis();
}
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index a6001da764..4550e22b2c 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -117,7 +117,7 @@ public:
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual void getTimeAndDate(TimeDate &t) const;
diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp
index ed2c886213..460d3fd2ac 100644
--- a/backends/platform/iphone/osys_main.cpp
+++ b/backends/platform/iphone/osys_main.cpp
@@ -166,7 +166,7 @@ void OSystem_IPHONE::suspendLoop() {
_timeSuspended += getMillis() - startTime;
}
-uint32 OSystem_IPHONE::getMillis() {
+uint32 OSystem_IPHONE::getMillis(bool skipRecord) {
//printf("getMillis()\n");
struct timeval currentTime;
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 037125490d..811a8ddb2e 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -165,7 +165,7 @@ public:
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual bool pollEvent(Common::Event &event);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual MutexRef createMutex(void);
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index bc6b3cb1a5..10138b230a 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -184,7 +184,7 @@ public:
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual bool pollEvent(Common::Event &event);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual MutexRef createMutex(void);
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 1e2aca9e51..afd93f5e09 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -810,7 +810,7 @@ void OSystem_N64::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
return;
}
-uint32 OSystem_N64::getMillis() {
+uint32 OSystem_N64::getMillis(bool skipRecord) {
return getMilliTick();
}
diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp
index 4690a67c55..9e05539799 100644
--- a/backends/platform/null/null.cpp
+++ b/backends/platform/null/null.cpp
@@ -49,7 +49,7 @@ public:
virtual bool pollEvent(Common::Event &event);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual void getTimeAndDate(TimeDate &t) const {}
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index 5628658381..a7d782b07c 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -571,7 +571,7 @@ void OSystem_PS2::displayMessageOnOSD(const char *msg) {
printf("displayMessageOnOSD: %s\n", msg);
}
-uint32 OSystem_PS2::getMillis(void) {
+uint32 OSystem_PS2::getMillis(bool skipRecord) {
return msecCount;
}
diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h
index 99482d4da4..3ba40a70f9 100644
--- a/backends/platform/ps2/systemps2.h
+++ b/backends/platform/ps2/systemps2.h
@@ -82,7 +82,7 @@ public:
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = 0);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual bool pollEvent(Common::Event &event);
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index fb8c1c60bf..8559066e53 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -349,7 +349,7 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
return _inputHandler.getAllInputs(event);
}
-uint32 OSystem_PSP::getMillis() {
+uint32 OSystem_PSP::getMillis(bool skipRecord) {
return PspRtc::instance().getMillis();
}
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 2afdabd0fc..f4591e476d 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -125,7 +125,7 @@ public:
bool processInput(Common::Event &event);
// Time
- uint32 getMillis();
+ uint32 getMillis(bool skipRecord = false);
void delayMillis(uint msecs);
// Timer
diff --git a/backends/platform/psp/rtc.cpp b/backends/platform/psp/rtc.cpp
index cbbb7d3f80..4f15e45535 100644
--- a/backends/platform/psp/rtc.cpp
+++ b/backends/platform/psp/rtc.cpp
@@ -52,7 +52,7 @@ void PspRtc::init() { // init our starting ticks
// Note that after we fill up 32 bits ie 50 days we'll loop back to 0, which may cause
// unpredictable results
-uint32 PspRtc::getMillis() {
+uint32 PspRtc::getMillis(bool skipRecord) {
uint32 ticks[2];
sceRtcGetCurrentTick((u64 *)ticks); // can introduce weird thread delays
diff --git a/backends/platform/psp/rtc.h b/backends/platform/psp/rtc.h
index 45885c3e66..d2689681dd 100644
--- a/backends/platform/psp/rtc.h
+++ b/backends/platform/psp/rtc.h
@@ -40,7 +40,7 @@ public:
init();
}
void init();
- uint32 getMillis();
+ uint32 getMillis(bool skipRecord = false);
uint32 getMicros();
};
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h
index ca3c586e03..eccf73815d 100644
--- a/backends/platform/sdl/sdl-sys.h
+++ b/backends/platform/sdl/sdl-sys.h
@@ -35,8 +35,11 @@
// it with an alternate slightly less unfriendly override.
#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_FILE)
#undef FILE
+// Solaris has typedef __FILE FILE in several places already
+#if !defined(__sun)
typedef struct { int FAKE; } FAKE_FILE;
#define FILE FAKE_FILE
+#endif // (__sun)
#endif
#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp)
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index d54854352d..f55dd277c7 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -30,7 +30,7 @@
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
-#include "common/EventRecorder.h"
+#include "gui/EventRecorder.h"
#include "common/taskbar.h"
#include "common/textconsole.h"
@@ -97,7 +97,9 @@ OSystem_SDL::~OSystem_SDL() {
_audiocdManager = 0;
delete _mixerManager;
_mixerManager = 0;
- delete _timerManager;
+
+ delete g_eventRec.getTimerManager();
+
_timerManager = 0;
delete _mutexManager;
_mutexManager = 0;
@@ -131,9 +133,6 @@ void OSystem_SDL::init() {
if (_mutexManager == 0)
_mutexManager = new SdlMutexManager();
- if (_timerManager == 0)
- _timerManager = new SdlTimerManager();
-
#if defined(USE_TASKBAR)
if (_taskbarManager == 0)
_taskbarManager = new Common::TaskbarManager();
@@ -191,10 +190,12 @@ void OSystem_SDL::initBackend() {
if (_mixerManager == 0) {
_mixerManager = new SdlMixerManager();
-
// Setup and start mixer
_mixerManager->init();
}
+ g_eventRec.registerMixerManager(_mixerManager);
+
+ g_eventRec.registerTimerManager(new SdlTimerManager());
if (_audiocdManager == 0) {
// Audio CD support was removed with SDL 1.3
@@ -466,14 +467,15 @@ void OSystem_SDL::setupIcon() {
free(icon);
}
-uint32 OSystem_SDL::getMillis() {
+
+uint32 OSystem_SDL::getMillis(bool skipRecord) {
uint32 millis = SDL_GetTicks();
- g_eventRec.processMillis(millis);
+ g_eventRec.processMillis(millis, skipRecord);
return millis;
}
void OSystem_SDL::delayMillis(uint msecs) {
- if (!g_eventRec.processDelayMillis(msecs))
+ if (!g_eventRec.processDelayMillis())
SDL_Delay(msecs);
}
@@ -491,12 +493,16 @@ void OSystem_SDL::getTimeAndDate(TimeDate &td) const {
Audio::Mixer *OSystem_SDL::getMixer() {
assert(_mixerManager);
- return _mixerManager->getMixer();
+ return getMixerManager()->getMixer();
}
SdlMixerManager *OSystem_SDL::getMixerManager() {
assert(_mixerManager);
- return _mixerManager;
+ return g_eventRec.getMixerManager();
+}
+
+Common::TimerManager *OSystem_SDL::getTimerManager() {
+ return g_eventRec.getTimerManager();
}
#ifdef USE_OPENGL
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index f05207b482..840e73ff09 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -68,10 +68,11 @@ public:
virtual void setWindowCaption(const char *caption);
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual void getTimeAndDate(TimeDate &td) const;
virtual Audio::Mixer *getMixer();
+ virtual Common::TimerManager *getTimerManager();
protected:
bool _inited;
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index 22a6495f8f..9d3a7473e3 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -203,7 +203,7 @@ bool OSystem_Wii::getFeatureState(Feature f) {
}
}
-uint32 OSystem_Wii::getMillis() {
+uint32 OSystem_Wii::getMillis(bool skipRecord) {
return ticks_to_millisecs(diff_ticks(_startup_time, gettime()));
}
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index 5d6998d0b6..287c70ad6b 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -193,7 +193,7 @@ public:
const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
- virtual uint32 getMillis();
+ virtual uint32 getMillis(bool skipRecord = false);
virtual void delayMillis(uint msecs);
virtual MutexRef createMutex();