aboutsummaryrefslogtreecommitdiff
path: root/common/scaler.cpp
diff options
context:
space:
mode:
authorMax Horn2002-09-19 16:06:51 +0000
committerMax Horn2002-09-19 16:06:51 +0000
commitbb57506d48e783027dbf09ab44c88b40ed7d2fa4 (patch)
treeed90efab26e7287627b2a5ce6c8c6d6909a5cf5d /common/scaler.cpp
parentb46b35b54470180a882d2732b75d64243857cb54 (diff)
downloadscummvm-rg350-bb57506d48e783027dbf09ab44c88b40ed7d2fa4.tar.gz
scummvm-rg350-bb57506d48e783027dbf09ab44c88b40ed7d2fa4.tar.bz2
scummvm-rg350-bb57506d48e783027dbf09ab44c88b40ed7d2fa4.zip
Added overlay to OSystem interface; implemented overlay in SDL backend (all other backends, including SDL_gl, still need to implement this!); changed NewGUI to make use of the overlay; added Cmd-Q as a shortcut for Quit on MacOS X
svn-id: r4971
Diffstat (limited to 'common/scaler.cpp')
-rw-r--r--common/scaler.cpp50
1 files changed, 24 insertions, 26 deletions
diff --git a/common/scaler.cpp b/common/scaler.cpp
index 9a98d1e8ef..c0a2e30ef4 100644
--- a/common/scaler.cpp
+++ b/common/scaler.cpp
@@ -747,16 +747,15 @@ void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint3
}
-/* 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;
+ uint16 *r;
while (height--) {
- r = dstPtr;
+ r = (uint16 *)dstPtr;
for (int i = 0; i < width; ++i, ++r) {
- uint8 color = *(srcPtr + i);
+ uint16 color = *(((uint16 *)srcPtr) + i);
*r = color;
}
@@ -765,7 +764,6 @@ void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32
}
}
-/* 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)
{
@@ -773,42 +771,42 @@ void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32
while (height--) {
r = dstPtr;
- for (int i = 0; i < width; ++i, r += 2) {
- uint8 color = *(srcPtr + i);
+ for (int i = 0; i < width; ++i, r += 4) {
+ uint16 color = *(((uint16 *)srcPtr) + i);
- *(r) = color;
- *(r + 1) = color;
- *(r + dstPitch) = color;
- *(r + dstPitch + 1) = color;
+ *(uint16 *)(r + 0) = color;
+ *(uint16 *)(r + 2) = color;
+ *(uint16 *)(r + 0 + dstPitch) = color;
+ *(uint16 *)(r + 2 + dstPitch) = 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;
+ uint32 dstPitch2 = dstPitch * 2;
+ uint32 dstPitch3 = dstPitch * 3;
while (height--) {
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;
+ for (int i = 0; i < width; ++i, r += 6) {
+ uint16 color = *(((uint16 *)srcPtr) + i);
+
+ *(uint16 *)(r + 0) = color;
+ *(uint16 *)(r + 2) = color;
+ *(uint16 *)(r + 4) = color;
+ *(uint16 *)(r + 0 + dstPitch) = color;
+ *(uint16 *)(r + 2 + dstPitch) = color;
+ *(uint16 *)(r + 4 + dstPitch) = color;
+ *(uint16 *)(r + 0 + dstPitch2) = color;
+ *(uint16 *)(r + 2 + dstPitch2) = color;
+ *(uint16 *)(r + 4 + dstPitch2) = color;
}
srcPtr += srcPitch;
- dstPtr += dstPitch * 3;
+ dstPtr += dstPitch3;
}
}