aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorNicolas Bacca2004-01-27 01:29:30 +0000
committerNicolas Bacca2004-01-27 01:29:30 +0000
commit86d5cb7204c9afd378edce0cc83d0aa5d0697d25 (patch)
tree0c6069913f099bbfe7fc2fde34669fcb7f3b54e1 /backends
parentb1274d70d9fba33b20088e87e3271077e39491c2 (diff)
downloadscummvm-rg350-86d5cb7204c9afd378edce0cc83d0aa5d0697d25.tar.gz
scummvm-rg350-86d5cb7204c9afd378edce0cc83d0aa5d0697d25.tar.bz2
scummvm-rg350-86d5cb7204c9afd378edce0cc83d0aa5d0697d25.zip
Fix 640x480, part 1, perfect fix tomorrow probably :p
svn-id: r12632
Diffstat (limited to 'backends')
-rw-r--r--backends/wince/CEScaler.cpp9
-rw-r--r--backends/wince/wince-sdl.cpp23
2 files changed, 25 insertions, 7 deletions
diff --git a/backends/wince/CEScaler.cpp b/backends/wince/CEScaler.cpp
index 5a2a51031d..e1469ce466 100644
--- a/backends/wince/CEScaler.cpp
+++ b/backends/wince/CEScaler.cpp
@@ -53,9 +53,10 @@ void PocketPCHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 ds
int width, int height) {
uint8 *work;
int i;
+ int dec;
uint16 srcPitch16 = (uint16)(srcPitch / sizeof(uint16));
- while (height--) {
+ while ((height-=2) >= 0) {
i = 0;
work = dstPtr;
@@ -66,10 +67,10 @@ void PocketPCHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 ds
uint16 color3 = *(((const uint16 *)srcPtr) + (i + srcPitch16));
*(((uint16 *)work) + 0) = interpolate16_3<565, 2, 1, 1>(color1, color2, color3);
-
- work += 2 * sizeof(uint16);
+
+ work += sizeof(uint16);
}
- srcPtr += 2 * srcPitch;
+ srcPtr += 2 * srcPitch;
dstPtr += dstPitch;
}
}
diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp
index c79157a338..47eb010908 100644
--- a/backends/wince/wince-sdl.cpp
+++ b/backends/wince/wince-sdl.cpp
@@ -653,9 +653,10 @@ void OSystem_WINCE3::update_screen() {
register int dst_h = 0;
register int orig_dst_y = 0;
- // Check if the toolbar is overwritten
+ // Check if the toolbar is overwritten
if (!_forceFull && toolbarVisible && r->y + r->h >= 200)
_toolbarHandler.forceRedraw();
+
if (dst_y < _screenHeight) {
dst_h = r->h;
@@ -669,7 +670,7 @@ void OSystem_WINCE3::update_screen() {
orig_dst_y = dst_y;
dst_y = real2Aspect(dst_y);
}
-
+
_scaler_proc((byte *)_tmpscreen->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
(byte *)_hwscreen->pixels + (r->x * 2 * _scaleFactorXm / _scaleFactorXd) + dst_y * dstPitch, dstPitch, r->w, dst_h);
}
@@ -678,7 +679,7 @@ void OSystem_WINCE3::update_screen() {
r->x /= _scaleFactorXd;
r->y = dst_y;
r->w *= _scaleFactorXm;
- r->w *= _scaleFactorXd;
+ r->w /= _scaleFactorXd;
r->h = dst_h * _scaleFactorYm / _scaleFactorYd;
/*if (_adjustAspectRatio && orig_dst_y / _scaleFactor < _screenHeight)
@@ -877,6 +878,22 @@ void OSystem_WINCE3::add_dirty_rect(int x, int y, int w, int h) {
}
while (w % 4) w++;
}
+ else
+ if (_scaler_proc == PocketPCHalf) {
+ // Align on a 2x2 square
+ if (x != 0) {
+ while (x % 2) {
+ x--;
+ w++;
+ }
+ while (y % 2) {
+ y--;
+ h++;
+ }
+ while (w % 2) w++;
+ while (h % 2) h++;
+ }
+ }
OSystem_SDL_Common::add_dirty_rect(x, y, w, h);
}