aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-05-04 00:05:45 +0000
committerMax Horn2002-05-04 00:05:45 +0000
commit479791a23e4f9453b6838cbbd36cdb7fffce42ca (patch)
treeb79227ed1147be51bdfd5cb64d965e138827a5b8
parentbcae301bf7e2489493b768e770938d0a293e9f85 (diff)
downloadscummvm-rg350-479791a23e4f9453b6838cbbd36cdb7fffce42ca.tar.gz
scummvm-rg350-479791a23e4f9453b6838cbbd36cdb7fffce42ca.tar.bz2
scummvm-rg350-479791a23e4f9453b6838cbbd36cdb7fffce42ca.zip
added some simple (8bit) 1x/2x/3x scalers, could probably be optimized
svn-id: r4187
-rw-r--r--2xsai.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/2xsai.cpp b/2xsai.cpp
index 992d424993..671eb73bdd 100644
--- a/2xsai.cpp
+++ b/2xsai.cpp
@@ -761,3 +761,67 @@ void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint3
q += nextlineDst << 1;
}
}
+
+
+/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */
+void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height)
+{
+ uint8* r;
+
+ for(int j = 0; j < height; ++j) {
+ r = dstPtr;
+ for(int i = 0; i < width; ++i, ++r) {
+ uint8 color = *(srcPtr + i );
+
+ *r = color;
+ }
+ srcPtr += srcPitch;
+ dstPtr += dstPitch;
+ }
+}
+
+/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */
+void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height)
+{
+ uint8* r;
+
+ for(int j = 0; j < height; ++j) {
+ r = dstPtr;
+ for(int i = 0; i < width; ++i, r+=2) {
+ uint8 color = *(srcPtr + i );
+
+ *(r) = color;
+ *(r + 1) = color;
+ *(r + dstPitch) = color;
+ *(r + dstPitch + 1) = color;
+ }
+ srcPtr += srcPitch;
+ dstPtr += dstPitch << 1;
+ }
+}
+
+/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */
+void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height)
+{
+ uint8* r;
+ uint32 dstPitch2 = dstPitch << 1;
+
+ for(int j = 0; j < height; ++j) {
+ r = dstPtr;
+ for(int i = 0; i < width; ++i, r+=3) {
+ uint8 color = *(srcPtr + i);
+
+ *(r + 0) = color;
+ *(r + 1) = color;
+ *(r + 2) = color;
+ *(r + 0 + dstPitch) = color;
+ *(r + 1 + dstPitch) = color;
+ *(r + 2 + dstPitch) = color;
+ *(r + 0 + dstPitch2) = color;
+ *(r + 1 + dstPitch2) = color;
+ *(r + 2 + dstPitch2) = color;
+ }
+ srcPtr += srcPitch;
+ dstPtr += dstPitch * 3;
+ }
+}