aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/linuxmoto
diff options
context:
space:
mode:
authorMax Horn2009-11-18 15:22:15 +0000
committerMax Horn2009-11-18 15:22:15 +0000
commit8aa4083bc9b41b49c582b1d342392c7e5d92dca8 (patch)
tree45ff592f8eb644ac5e716b673bf0c02732710d4e /backends/platform/linuxmoto
parent974b49ebfe6f71f45f38f70d12395bf1b3124888 (diff)
downloadscummvm-rg350-8aa4083bc9b41b49c582b1d342392c7e5d92dca8.tar.gz
scummvm-rg350-8aa4083bc9b41b49c582b1d342392c7e5d92dca8.tar.bz2
scummvm-rg350-8aa4083bc9b41b49c582b1d342392c7e5d92dca8.zip
Modify WinCE, LinuxMoto and GP2xWiz backends to use graphics/scaler/downscaler* code (untested as of now)
svn-id: r45975
Diffstat (limited to 'backends/platform/linuxmoto')
-rw-r--r--backends/platform/linuxmoto/linuxmoto-graphics.cpp8
-rw-r--r--backends/platform/linuxmoto/linuxmoto-scaler.cpp39
-rw-r--r--backends/platform/linuxmoto/linuxmoto-scaler.h42
-rw-r--r--backends/platform/linuxmoto/linuxmoto-sdl.h6
-rw-r--r--backends/platform/linuxmoto/module.mk8
5 files changed, 11 insertions, 92 deletions
diff --git a/backends/platform/linuxmoto/linuxmoto-graphics.cpp b/backends/platform/linuxmoto/linuxmoto-graphics.cpp
index 592d991a7f..ed6606b46c 100644
--- a/backends/platform/linuxmoto/linuxmoto-graphics.cpp
+++ b/backends/platform/linuxmoto/linuxmoto-graphics.cpp
@@ -24,13 +24,13 @@
*/
#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
-#include "backends/platform/linuxmoto/linuxmoto-scaler.h" // TODO: Make GFX_HALF/HalfScale generic.
#include "common/mutex.h"
#include "graphics/font.h"
#include "graphics/fontman.h"
#include "graphics/scaler.h"
#include "graphics/scaler/intern.h"
+#include "graphics/scaler/downscaler.h"
#include "graphics/surface.h"
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
@@ -91,7 +91,7 @@ void OSystem_LINUXMOTO::setGraphicsModeIntern() {
newScalerProc = Normal1x;
break;
case GFX_HALF:
- newScalerProc = HalfScale;
+ newScalerProc = DownscaleAllByHalf;
break;
default:
@@ -386,7 +386,7 @@ void OSystem_LINUXMOTO::internUpdateScreen() {
assert(scalerProc != NULL);
- if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale) {
+ if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
if (dst_x%2==1) {
dst_x--;
@@ -411,7 +411,7 @@ void OSystem_LINUXMOTO::internUpdateScreen() {
(byte *)_hwscreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h);
}
- if (_videoMode.mode == GFX_HALF && scalerProc == HalfScale) {
+ if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
r->w = r->w / 2;
r->h = dst_h / 2;
} else {
diff --git a/backends/platform/linuxmoto/linuxmoto-scaler.cpp b/backends/platform/linuxmoto/linuxmoto-scaler.cpp
deleted file mode 100644
index 9aa814bdf4..0000000000
--- a/backends/platform/linuxmoto/linuxmoto-scaler.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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 "graphics/scaler/intern.h"
-#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
-
-extern "C" {
- void PocketPCHalfARM(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int mask, int round);
- // Rounding constants and masks used for different pixel formats
- int roundingconstants[] = { 0x00200802, 0x00201002 };
- int redbluegreenMasks[] = { 0x03E07C1F, 0x07E0F81F };
-}
-
-void HalfScale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
- int maskUsed = (gBitFormat == 565);
- PocketPCHalfARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height, redbluegreenMasks[maskUsed],roundingconstants[maskUsed]);
-}
diff --git a/backends/platform/linuxmoto/linuxmoto-scaler.h b/backends/platform/linuxmoto/linuxmoto-scaler.h
deleted file mode 100644
index 03d4bec82f..0000000000
--- a/backends/platform/linuxmoto/linuxmoto-scaler.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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 LINUXMOTO_SCALER_H
-#define LINUXMOTO_SCALER_H
-
-#include "common/scummsys.h"
-#include "common/system.h"
-#include "graphics/scaler.h"
-#include "graphics/scaler/intern.h"
-
-// FIXME: For now keep hacks in this header to save polluting the SDL backend.
-enum {
- GFX_HALF = 12
-};
-
-// TODO/FIXME: Move this platform specific scaler into /graphics/scaler and properly merge with the WinCE PocketPCHalf that it is based on.
-DECLARE_SCALER(HalfScale);
-
-#endif
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.h b/backends/platform/linuxmoto/linuxmoto-sdl.h
index 57d1dc8972..c01d375603 100644
--- a/backends/platform/linuxmoto/linuxmoto-sdl.h
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.h
@@ -27,9 +27,11 @@
#define LINUXMOTO_SDL
#include "backends/platform/sdl/sdl.h"
-#include "backends/platform/linuxmoto/linuxmoto-scaler.h"
-#include <SDL.h>
+// FIXME: For now keep hacks in this header to save polluting the SDL backend.
+enum {
+ GFX_HALF = 12
+};
class OSystem_LINUXMOTO : public OSystem_SDL {
private:
diff --git a/backends/platform/linuxmoto/module.mk b/backends/platform/linuxmoto/module.mk
index 967a55f249..8123d6e2ac 100644
--- a/backends/platform/linuxmoto/module.mk
+++ b/backends/platform/linuxmoto/module.mk
@@ -1,13 +1,11 @@
MODULE := backends/platform/linuxmoto
MODULE_OBJS := \
- linuxmoto-main.o \
linuxmoto-events.o \
- linuxmoto-sdl.o \
- linuxmoto-scaler.o \
linuxmoto-graphics.o \
- hardwarekeys.o \
- ../wince/ARMscaler.o
+ linuxmoto-main.o \
+ linuxmoto-sdl.o \
+ hardwarekeys.o
MODULE_DIRS += \
backends/platform/linuxmoto/