aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler.cpp
diff options
context:
space:
mode:
authorRobin Watts2009-07-27 16:29:36 +0000
committerRobin Watts2009-07-27 16:29:36 +0000
commit816bd9a7ea4f99aaae67c6e82f686b88dd8c728f (patch)
treee25ba1c5d434a52731dbbafff0474ad8948a155d /graphics/scaler.cpp
parented763cccfe57774b803e0ae32606d7ec677b297b (diff)
downloadscummvm-rg350-816bd9a7ea4f99aaae67c6e82f686b88dd8c728f.tar.gz
scummvm-rg350-816bd9a7ea4f99aaae67c6e82f686b88dd8c728f.tar.bz2
scummvm-rg350-816bd9a7ea4f99aaae67c6e82f686b88dd8c728f.zip
Add ARM code version of Normal2x scaler.
Add ARM only aspect ratio correcting version of Normal2x scaler. Make WinCE port use Normal2x by default if the screen is large enough. Make WinCE port use aspect ratio correcting version if panel is hidden. svn-id: r42843
Diffstat (limited to 'graphics/scaler.cpp')
-rw-r--r--graphics/scaler.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp
index 11767848ed..7620e5b107 100644
--- a/graphics/scaler.cpp
+++ b/graphics/scaler.cpp
@@ -187,6 +187,61 @@ void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit
}
#ifndef DISABLE_SCALERS
+#ifdef USE_ARM_SCALER_ASM
+extern "C" void Normal2xAspectMask(const uint8 *srcPtr,
+ uint32 srcPitch,
+ uint8 *dstPtr,
+ uint32 dstPitch,
+ int width,
+ int height,
+ uint32 mask);
+
+void Normal2xAspect(const uint8 *srcPtr,
+ uint32 srcPitch,
+ uint8 *dstPtr,
+ uint32 dstPitch,
+ int width,
+ int height)
+{
+ if (gBitFormat == 565)
+ {
+ Normal2xAspectMask(srcPtr,
+ srcPitch,
+ dstPtr,
+ dstPitch,
+ width,
+ height,
+ 0x07e0F81F);
+ }
+ else
+ {
+ Normal2xAspectMask(srcPtr,
+ srcPitch,
+ dstPtr,
+ dstPitch,
+ width,
+ height,
+ 0x03e07C1F);
+ }
+}
+
+extern "C" void Normal2xARM(const uint8 *srcPtr,
+ uint32 srcPitch,
+ uint8 *dstPtr,
+ uint32 dstPitch,
+ int width,
+ int height);
+
+void Normal2x(const uint8 *srcPtr,
+ uint32 srcPitch,
+ uint8 *dstPtr,
+ uint32 dstPitch,
+ int width,
+ int height)
+{
+ Normal2xARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
+}
+#else
/**
* Trivial nearest-neighbour 2x scaler.
*/
@@ -210,6 +265,7 @@ void Normal2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit
dstPtr += dstPitch << 1;
}
}
+#endif
/**
* Trivial nearest-neighbour 3x scaler.