aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/linuxmoto/linuxmoto-sdl.cpp
diff options
context:
space:
mode:
authorAlejandro Marzini2010-06-29 01:08:36 +0000
committerAlejandro Marzini2010-06-29 01:08:36 +0000
commitfd77e4b09c8ca80c8e449ad7266afaa494f98500 (patch)
tree232ce052cfecd5f4d32d15dabc6fc2d2e46e7a43 /backends/platform/linuxmoto/linuxmoto-sdl.cpp
parent494755cc36d4bd6bac46c63b6624fe5a294c493a (diff)
downloadscummvm-rg350-fd77e4b09c8ca80c8e449ad7266afaa494f98500.tar.gz
scummvm-rg350-fd77e4b09c8ca80c8e449ad7266afaa494f98500.tar.bz2
scummvm-rg350-fd77e4b09c8ca80c8e449ad7266afaa494f98500.zip
Modularized Linuxmoto port.
svn-id: r50474
Diffstat (limited to 'backends/platform/linuxmoto/linuxmoto-sdl.cpp')
-rw-r--r--backends/platform/linuxmoto/linuxmoto-sdl.cpp47
1 files changed, 10 insertions, 37 deletions
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.cpp b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
index ad1af455c3..696c339638 100644
--- a/backends/platform/linuxmoto/linuxmoto-sdl.cpp
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
@@ -25,44 +25,17 @@
#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
-void OSystem_LINUXMOTO::preprocessEvents(SDL_Event *event) {
- if (event->type == SDL_ACTIVEEVENT) {
- if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain) {
- suspendAudio();
- for (;;) {
- if (!SDL_WaitEvent(event)) {
- SDL_Delay(10);
- continue;
- }
- if (event->type == SDL_QUIT)
- return;
- if (event->type != SDL_ACTIVEEVENT)
- continue;
- if (event->active.state == SDL_APPINPUTFOCUS && event->active.gain) {
- resumeAudio();
- return;
- }
- }
- }
- }
-}
+#include "backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h"
+#include "backends/events/linuxmotosdl/linuxmotosdl-events.h"
-void OSystem_LINUXMOTO::suspendAudio() {
- SDL_CloseAudio();
- _audioSuspended = true;
-}
+void OSystem_LINUXMOTO::initBackend() {
+ // Create the backend custom managers
+ if (_eventsManager == 0)
+ _eventsManager = new LinuxmotoSdlEventManager();
-int OSystem_LINUXMOTO::resumeAudio() {
- if (!_audioSuspended)
- return -2;
- if (SDL_OpenAudio(&_obtainedRate, NULL) < 0){
- return -1;
- }
- SDL_PauseAudio(0);
- _audioSuspended = false;
- return 0;
-}
+ if (_graphicsManager == 0)
+ _graphicsManager = new LinuxmotoSdlGraphicsManager();
-void OSystem_LINUXMOTO::setupMixer() {
- OSystem_SDL::setupMixer();
+ // Call parent implementation of this method
+ OSystem_POSIX::initBackend();
}