aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorBastien Bouclet2014-06-27 16:45:58 +0200
committerBastien Bouclet2015-12-15 20:10:19 +0100
commitb9a107499911873a0f5e5452d292f6541f0f001a (patch)
tree2236e84a6afa3908bf4d2d1dec657b5a81222085 /backends
parentd80c39bb29638bed4bff6453502878eaa5afbbf9 (diff)
downloadscummvm-rg350-b9a107499911873a0f5e5452d292f6541f0f001a.tar.gz
scummvm-rg350-b9a107499911873a0f5e5452d292f6541f0f001a.tar.bz2
scummvm-rg350-b9a107499911873a0f5e5452d292f6541f0f001a.zip
PS3: Make use of an updated SDL2 version
This version, available at https://bitbucket.org/bgK/sdl_psl1ght, is based on SDL 2.0.3.
Diffstat (limited to 'backends')
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.cpp4
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.h4
-rw-r--r--backends/events/ps3sdl/ps3sdl-events.cpp8
-rw-r--r--backends/events/sdl/sdl-events.cpp2
-rw-r--r--backends/mixer/sdl2/sdl2-mixer.cpp (renamed from backends/mixer/sdl13/sdl13-mixer.cpp)14
-rw-r--r--backends/mixer/sdl2/sdl2-mixer.h (renamed from backends/mixer/sdl13/sdl13-mixer.h)10
-rw-r--r--backends/module.mk6
-rw-r--r--backends/platform/sdl/ps3/ps3.cpp4
-rw-r--r--backends/platform/sdl/sdl.cpp8
9 files changed, 29 insertions, 31 deletions
diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp
index c7b089af09..ff50c56af3 100644
--- a/backends/audiocd/sdl/sdl-audiocd.cpp
+++ b/backends/audiocd/sdl/sdl-audiocd.cpp
@@ -26,7 +26,7 @@
#include "backends/audiocd/sdl/sdl-audiocd.h"
-#if !SDL_VERSION_ATLEAST(1, 3, 0)
+#if !SDL_VERSION_ATLEAST(2, 0, 0)
#include "common/textconsole.h"
@@ -136,6 +136,6 @@ void SdlAudioCDManager::updateCD() {
}
}
-#endif // !SDL_VERSION_ATLEAST(1, 3, 0)
+#endif // !SDL_VERSION_ATLEAST(2, 0, 0)
#endif
diff --git a/backends/audiocd/sdl/sdl-audiocd.h b/backends/audiocd/sdl/sdl-audiocd.h
index 783d4fe0f0..bfad7b6805 100644
--- a/backends/audiocd/sdl/sdl-audiocd.h
+++ b/backends/audiocd/sdl/sdl-audiocd.h
@@ -27,7 +27,7 @@
#include "backends/platform/sdl/sdl-sys.h"
-#if !SDL_VERSION_ATLEAST(1, 3, 0)
+#if !SDL_VERSION_ATLEAST(2, 0, 0)
/**
* The SDL audio cd manager. Implements real audio cd playback.
@@ -49,6 +49,6 @@ protected:
uint32 _cdEndTime, _cdStopTime;
};
-#endif // !SDL_VERSION_ATLEAST(1, 3, 0)
+#endif // !SDL_VERSION_ATLEAST(2, 0, 0)
#endif
diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp
index 0f6e01857b..1fc10559c2 100644
--- a/backends/events/ps3sdl/ps3sdl-events.cpp
+++ b/backends/events/ps3sdl/ps3sdl-events.cpp
@@ -126,8 +126,8 @@ bool PS3SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
* This pauses execution and keeps redrawing the screen until the XMB is closed.
*/
void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
- if (event->type == SDL_ACTIVEEVENT) {
- if (event->active.state == SDL_APPMOUSEFOCUS && !event->active.gain) {
+ if (event->type == SDL_WINDOWEVENT) {
+ if (event->window.event == SDL_WINDOWEVENT_LEAVE) {
// XMB opened
if (g_engine)
g_engine->pauseEngine(true);
@@ -145,9 +145,9 @@ void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
}
if (event->type == SDL_QUIT)
return;
- if (event->type != SDL_ACTIVEEVENT)
+ if (event->type != SDL_WINDOWEVENT)
continue;
- if (event->active.state == SDL_APPMOUSEFOCUS && event->active.gain) {
+ if (event->window.event == SDL_WINDOWEVENT_ENTER) {
// XMB closed
if (g_engine)
g_engine->pauseEngine(false);
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 038f61664f..745f398be6 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -314,7 +314,7 @@ Common::KeyCode SdlEventSource::SDLToOSystemKeycode(const SDLKey key) {
case SDLK_y: return Common::KEYCODE_y;
case SDLK_z: return Common::KEYCODE_z;
case SDLK_DELETE: return Common::KEYCODE_DELETE;
-#if SDL_VERSION_ATLEAST(1, 3, 0)
+#if SDL_VERSION_ATLEAST(2, 0, 0)
case SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_GRAVE): return Common::KEYCODE_TILDE;
#else
case SDLK_WORLD_16: return Common::KEYCODE_TILDE;
diff --git a/backends/mixer/sdl13/sdl13-mixer.cpp b/backends/mixer/sdl2/sdl2-mixer.cpp
index dc38242bde..96a1361a8c 100644
--- a/backends/mixer/sdl13/sdl13-mixer.cpp
+++ b/backends/mixer/sdl2/sdl2-mixer.cpp
@@ -24,7 +24,7 @@
#if defined(SDL_BACKEND)
-#include "backends/mixer/sdl13/sdl13-mixer.h"
+#include "backends/mixer/sdl2/sdl2-mixer.h"
#include "common/debug.h"
#include "common/system.h"
#include "common/config-manager.h"
@@ -36,14 +36,14 @@
#define SAMPLES_PER_SEC 44100
#endif
-Sdl13MixerManager::Sdl13MixerManager()
+Sdl2MixerManager::Sdl2MixerManager()
:
SdlMixerManager(),
_device(0) {
}
-Sdl13MixerManager::~Sdl13MixerManager() {
+Sdl2MixerManager::~Sdl2MixerManager() {
_mixer->setReady(false);
SDL_CloseAudioDevice(_device);
@@ -51,7 +51,7 @@ Sdl13MixerManager::~Sdl13MixerManager() {
delete _mixer;
}
-void Sdl13MixerManager::init() {
+void Sdl2MixerManager::init() {
// Start SDL Audio subsystem
if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) {
error("Could not initialize SDL: %s", SDL_GetError());
@@ -81,17 +81,17 @@ void Sdl13MixerManager::init() {
}
}
-void Sdl13MixerManager::startAudio() {
+void Sdl2MixerManager::startAudio() {
// Start the sound system
SDL_PauseAudioDevice(_device, 0);
}
-void Sdl13MixerManager::suspendAudio() {
+void Sdl2MixerManager::suspendAudio() {
SDL_CloseAudioDevice(_device);
_audioSuspended = true;
}
-int Sdl13MixerManager::resumeAudio() {
+int Sdl2MixerManager::resumeAudio() {
if (!_audioSuspended)
return -2;
diff --git a/backends/mixer/sdl13/sdl13-mixer.h b/backends/mixer/sdl2/sdl2-mixer.h
index ff2bb43084..ce2616d92b 100644
--- a/backends/mixer/sdl13/sdl13-mixer.h
+++ b/backends/mixer/sdl2/sdl2-mixer.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef BACKENDS_MIXER_SDL13_H
-#define BACKENDS_MIXER_SDL13_H
+#ifndef BACKENDS_MIXER_SDL2_H
+#define BACKENDS_MIXER_SDL2_H
#include "backends/mixer/sdl/sdl-mixer.h"
@@ -31,10 +31,10 @@
* the SDL audio subsystem and the callback for the
* audio mixer implementation.
*/
-class Sdl13MixerManager : public SdlMixerManager {
+class Sdl2MixerManager : public SdlMixerManager {
public:
- Sdl13MixerManager();
- virtual ~Sdl13MixerManager();
+ Sdl2MixerManager();
+ virtual ~Sdl2MixerManager();
/**
* Initialize and setups the mixer
diff --git a/backends/module.mk b/backends/module.mk
index e5e2905781..025d653ddd 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -72,13 +72,11 @@ MODULE_OBJS += \
plugins/sdl/sdl-provider.o \
timer/sdl/sdl-timer.o
-# SDL 1.3 removed audio CD support
-ifndef USE_SDL13
+# SDL 2 removed audio CD support
ifndef USE_SDL2
MODULE_OBJS += \
audiocd/sdl/sdl-audiocd.o
endif
-endif
ifdef USE_OPENGL
MODULE_OBJS += \
@@ -126,7 +124,7 @@ MODULE_OBJS += \
fs/posix/posix-fs-factory.o \
fs/ps3/ps3-fs-factory.o \
events/ps3sdl/ps3sdl-events.o \
- mixer/sdl13/sdl13-mixer.o
+ mixer/sdl2/sdl2-mixer.o
endif
ifeq ($(BACKEND),tizen)
diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp
index f111379794..e531d79fba 100644
--- a/backends/platform/sdl/ps3/ps3.cpp
+++ b/backends/platform/sdl/ps3/ps3.cpp
@@ -31,7 +31,7 @@
#include "backends/saves/default/default-saves.h"
#include "backends/fs/ps3/ps3-fs-factory.h"
#include "backends/events/ps3sdl/ps3sdl-events.h"
-#include "backends/mixer/sdl13/sdl13-mixer.h"
+#include "backends/mixer/sdl2/sdl2-mixer.h"
#include <dirent.h>
#include <sys/stat.h>
@@ -70,7 +70,7 @@ void OSystem_PS3::initBackend() {
// Create the mixer manager
if (_mixer == 0) {
- _mixerManager = new Sdl13MixerManager();
+ _mixerManager = new Sdl2MixerManager();
// Setup and start mixer
_mixerManager->init();
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 6d4dede212..fffb9d56d9 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -36,8 +36,8 @@
#include "backends/saves/default/default-saves.h"
-// Audio CD support was removed with SDL 1.3
-#if SDL_VERSION_ATLEAST(1, 3, 0)
+// Audio CD support was removed with SDL 2.0
+#if SDL_VERSION_ATLEAST(2, 0, 0)
#include "backends/audiocd/default/default-audiocd.h"
#else
#include "backends/audiocd/sdl/sdl-audiocd.h"
@@ -246,8 +246,8 @@ void OSystem_SDL::initBackend() {
#endif
if (_audiocdManager == 0) {
- // Audio CD support was removed with SDL 1.3
-#if SDL_VERSION_ATLEAST(1, 3, 0)
+ // Audio CD support was removed with SDL 2.0
+#if SDL_VERSION_ATLEAST(2, 0, 0)
_audiocdManager = new DefaultAudioCDManager();
#else
_audiocdManager = new SdlAudioCDManager();