aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorJohannes Schickel2013-10-20 23:00:28 +0200
committerKamil Zbróg2013-10-24 12:59:16 +0100
commitb53770366bdc5a79c81a35b5c04bb7b1804f233f (patch)
tree5f70665853213a0a526530e9b7ca6b7d95cb1721 /backends/platform
parent2784901dac98f5972327a82bde147026cf7d7aee (diff)
downloadscummvm-rg350-b53770366bdc5a79c81a35b5c04bb7b1804f233f.tar.gz
scummvm-rg350-b53770366bdc5a79c81a35b5c04bb7b1804f233f.tar.bz2
scummvm-rg350-b53770366bdc5a79c81a35b5c04bb7b1804f233f.zip
SDL: Always initialize video subsystem in initSDL.
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/gph/gph-backend.cpp8
-rw-r--r--backends/platform/openpandora/op-backend.cpp8
-rw-r--r--backends/platform/sdl/sdl.cpp16
-rw-r--r--backends/platform/wince/wince-sdl.cpp5
4 files changed, 27 insertions, 10 deletions
diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp
index 485780b472..7239fdb2b4 100644
--- a/backends/platform/gph/gph-backend.cpp
+++ b/backends/platform/gph/gph-backend.cpp
@@ -172,7 +172,7 @@ void OSystem_GPH::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = SDL_INIT_EVENTTHREAD;
+ uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO;
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
@@ -180,6 +180,12 @@ void OSystem_GPH::initSDL() {
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
+ // Enable unicode support if possible
+ SDL_EnableUNICODE(1);
+
+ // Disable OS cursor
+ SDL_ShowCursor(SDL_DISABLE);
+
_initedSDL = true;
}
}
diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp
index 354aa24b24..4350d697e2 100644
--- a/backends/platform/openpandora/op-backend.cpp
+++ b/backends/platform/openpandora/op-backend.cpp
@@ -160,7 +160,7 @@ void OSystem_OP::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = SDL_INIT_EVENTTHREAD;
+ uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO;
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
@@ -168,6 +168,12 @@ void OSystem_OP::initSDL() {
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
+ // Enable unicode support if possible
+ SDL_EnableUNICODE(1);
+
+ // Disable OS cursor
+ SDL_ShowCursor(SDL_DISABLE);
+
_initedSDL = true;
}
}
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 84187f9638..e8a7f7b9af 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -262,16 +262,15 @@ void OSystem_SDL::engineDone() {
void OSystem_SDL::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = 0;
+ // We always initialize the video subsystem because we will need it to
+ // be initialized before the graphics managers to retrieve the desktop
+ // resolution, for example. WebOS also requires this initialization
+ // or otherwise the application won't start.
+ uint32 sdlFlags = SDL_INIT_VIDEO;
+
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
-#if defined(WEBOS) || defined(USE_OPENGL)
- // WebOS needs this flag or otherwise the application won't start.
- // OpenGL SDL needs this to query the desktop resolution on startup.
- sdlFlags |= SDL_INIT_VIDEO;
-#endif
-
// Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers)
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
@@ -279,6 +278,9 @@ void OSystem_SDL::initSDL() {
// Enable unicode support if possible
SDL_EnableUNICODE(1);
+ // Disable OS cursor
+ SDL_ShowCursor(SDL_DISABLE);
+
_initedSDL = true;
}
}
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 3897731db4..ea2bc42301 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -563,7 +563,7 @@ void OSystem_WINCE3::setGraphicsModeIntern() {
void OSystem_WINCE3::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = SDL_INIT_EVENTTHREAD;
+ uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO;
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
@@ -579,6 +579,9 @@ void OSystem_WINCE3::initSDL() {
// Enable unicode support if possible
SDL_EnableUNICODE(1);
+ // Disable OS cursor
+ SDL_ShowCursor(SDL_DISABLE);
+
_initedSDL = true;
}
}