From 092d36f39204df71038a1567c0d4d55bf854b523 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 22 Oct 2013 12:24:20 +0200 Subject: SDL: Reduce code duplication a bit. Now instead of initializing this in OSystem_SDL::initSDL (and in subclasses overwriting this) we simply initialize it in OSystem_SDL::init. --- backends/platform/gph/gph-backend.cpp | 6 ------ backends/platform/openpandora/op-backend.cpp | 6 ------ backends/platform/sdl/sdl.cpp | 12 ++++++------ backends/platform/wince/wince-sdl.cpp | 6 ------ 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index 7239fdb2b4..e51d7d0781 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -180,12 +180,6 @@ 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 4350d697e2..60c3cc7191 100644 --- a/backends/platform/openpandora/op-backend.cpp +++ b/backends/platform/openpandora/op-backend.cpp @@ -168,12 +168,6 @@ 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 3272033df9..c240727069 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -126,6 +126,12 @@ void OSystem_SDL::init() { // Initialize SDL initSDL(); + // Enable unicode support if possible + SDL_EnableUNICODE(1); + + // Disable OS cursor + SDL_ShowCursor(SDL_DISABLE); + if (!_logger) _logger = new Backends::Log::Log(this); @@ -268,12 +274,6 @@ void OSystem_SDL::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/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index ea2bc42301..1c5cd5565b 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -576,12 +576,6 @@ void OSystem_WINCE3::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; } } -- cgit v1.2.3