diff options
-rw-r--r-- | backends/maemo/Makefile | 18 | ||||
-rw-r--r-- | backends/maemo/maemo-sdl.cpp | 42 | ||||
-rw-r--r-- | backends/maemo/maemo-sdl.h | 41 | ||||
-rw-r--r-- | backends/maemo/main.cpp | 4 | ||||
-rw-r--r-- | backends/sdl/graphics.cpp | 14 | ||||
-rw-r--r-- | backends/sdl/sdl.cpp | 2 |
6 files changed, 114 insertions, 7 deletions
diff --git a/backends/maemo/Makefile b/backends/maemo/Makefile index dbe62fc59a..75ae01c430 100644 --- a/backends/maemo/Makefile +++ b/backends/maemo/Makefile @@ -5,13 +5,27 @@ #control build DISABLE_HQ_SCALERS = true +#DISABLE_SCUMM = 1 +#DISABLE_HE = 1 +DISABLE_SIMON = 1 +DISABLE_SKY = 1 +DISABLE_SWORD1 = 1 +DISABLE_SWORD2 = 1 +DISABLE_QUEEN = 1 +DISABLE_KYRA = 1 +DISABLE_SAGA = 1 +DISABLE_GOB = 1 +DISABLE_LURE = 1 +DISABLE_CINE = 1 +DISABLE_AGI = 1 + srcdir = ../.. VPATH = $(srcdir) CXX := g++ EXECUTABLE := scummvm -INCDIR = ../../ +INCDIR = ../../ . $(srcdir)/engines/ CXXFLAGS := -g -ansi -W -Wno-unused-parameter CXXFLAGS += `pkg-config --cflags gconf-2.0 hildon-libs gtk+-2.0 libosso gdk-2.0` @@ -40,7 +54,7 @@ RM := rm -f RM_REC := rm -f -r CP := cp -OBJS := main.o +OBJS := main.o maemo-sdl.o MODULE_DIRS += . diff --git a/backends/maemo/maemo-sdl.cpp b/backends/maemo/maemo-sdl.cpp new file mode 100644 index 0000000000..d53ff3c15b --- /dev/null +++ b/backends/maemo/maemo-sdl.cpp @@ -0,0 +1,42 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001-2006 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "backends/maemo/maemo-sdl.h" + + +void OSystem_MAEMO::loadGFXMode() { + if (_fullscreen || _screenHeight > 400) { + _overlayWidth = 800; + _overlayHeight = 480; + + _fullscreen = true; + } else { + _overlayWidth = 720; + _overlayHeight = 400; + } + + if (_screenHeight != 200) + _adjustAspectRatio = false; + + OSystem_SDL::loadGFXMode(); +} diff --git a/backends/maemo/maemo-sdl.h b/backends/maemo/maemo-sdl.h new file mode 100644 index 0000000000..eff02df21f --- /dev/null +++ b/backends/maemo/maemo-sdl.h @@ -0,0 +1,41 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001-2006 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef MAEMO_SDL_H +#define MAEMO_SDL_H + +#include "common/stdafx.h" +#include "backends/sdl/sdl-common.h" + +//#include "CEkeys.h" + +#include <SDL.h> + + +class OSystem_MAEMO : public OSystem_SDL { +public: + OSystem_MAEMO() {}; + + void loadGFXMode(); +}; + +#endif diff --git a/backends/maemo/main.cpp b/backends/maemo/main.cpp index 968641c0cc..2631d35000 100644 --- a/backends/maemo/main.cpp +++ b/backends/maemo/main.cpp @@ -28,7 +28,7 @@ #include <SDL/SDL.h> #include <SDL/SDL_syswm.h> -#include "backends/sdl/sdl-common.h" +#include "backends/maemo/maemo-sdl.h" #include "base/main.h" #include <hildon-widgets/hildon-app.h> #include <gtk/gtk.h> @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { set_doubling(0); - g_system = new OSystem_SDL(); + g_system = new OSystem_MAEMO(); assert(g_system); // Invoke the actual ScummVM main entry point: diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index 05bf1bc0e0..a14fa9e109 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -310,6 +310,9 @@ void OSystem_SDL::loadGFXMode() { _forceFull = true; _modeFlags |= DF_UPDATE_EXPAND_1_PIXEL; + int hwW, hwH; + +#ifndef __MAEMO__ _overlayWidth = _screenWidth * _scaleFactor; _overlayHeight = _screenHeight * _scaleFactor; @@ -319,6 +322,13 @@ void OSystem_SDL::loadGFXMode() { if (_adjustAspectRatio) _overlayHeight = real2Aspect(_overlayHeight); + hwW = _screenWidth * _scaleFactor; + hwH = effectiveScreenHeight(); +#else + hwW = _overlayWidth; + hwH = _overlayHeight; +#endif + // // Create the surface that contains the 8 bit game data // @@ -330,7 +340,7 @@ void OSystem_SDL::loadGFXMode() { // Create the surface that contains the scaled graphics in 16 bit mode // - _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor, effectiveScreenHeight(), 16, + _hwscreen = SDL_SetVideoMode(hwW, hwH, 16, _fullscreen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE ); if (_hwscreen == NULL) { @@ -703,7 +713,7 @@ void OSystem_SDL::setFullscreenMode(bool enable) { return; } -#if defined(MACOSX) && !SDL_VERSION_ATLEAST(1, 2, 6) +#if (defined(MACOSX) && !SDL_VERSION_ATLEAST(1, 2, 6)) || defined(__MAEMO__) // On OS X, SDL_WM_ToggleFullScreen is currently not implemented. Worse, // before SDL 1.2.6 it always returned -1 (which would indicate a // successful switch). So we simply don't call it at all and use diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 274ebec193..dce70bc780 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -144,7 +144,7 @@ void OSystem_SDL::initBackend() { _scaleFactor = 1; _scalerProc = Normal1x; -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && !defined(__MAEMO__) +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) _fullscreen = ConfMan.getBool("fullscreen"); #else _fullscreen = true; |