diff options
author | Max Horn | 2002-05-04 00:05:45 +0000 |
---|---|---|
committer | Max Horn | 2002-05-04 00:05:45 +0000 |
commit | 479791a23e4f9453b6838cbbd36cdb7fffce42ca (patch) | |
tree | b79227ed1147be51bdfd5cb64d965e138827a5b8 | |
parent | bcae301bf7e2489493b768e770938d0a293e9f85 (diff) | |
download | scummvm-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.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
@@ -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; + } +} |