diff options
author | Kostas Nakos | 2006-06-20 18:03:02 +0000 |
---|---|---|
committer | Kostas Nakos | 2006-06-20 18:03:02 +0000 |
commit | a7908a01bf75254c4c430457cf6647e68d8aa1c1 (patch) | |
tree | 4ed2fe607ece2fb6b44e014e5123012a82867437 | |
parent | f6c3de48b5abd5ca96f6d714581d17fa42cee389 (diff) | |
download | scummvm-rg350-a7908a01bf75254c4c430457cf6647e68d8aa1c1.tar.gz scummvm-rg350-a7908a01bf75254c4c430457cf6647e68d8aa1c1.tar.bz2 scummvm-rg350-a7908a01bf75254c4c430457cf6647e68d8aa1c1.zip |
fix vga device overlays and invalid mouse cursor calls
svn-id: r23192
-rw-r--r-- | backends/wince/wince-sdl.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp index 5464b60f08..eb4be9b203 100644 --- a/backends/wince/wince-sdl.cpp +++ b/backends/wince/wince-sdl.cpp @@ -1185,14 +1185,21 @@ void OSystem_WINCE3::loadGFXMode() { // Overlay - _overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth, _overlayHeight, 16, 0, 0, 0, 0); - if (_overlayscreen == NULL) - error("_overlayscreen failed"); - _tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth + 3, _overlayHeight + 3, 16, 0, 0, 0, 0); - if (_tmpscreen2 == NULL) - error("_tmpscreen2 failed"); - - + if (CEDevice::hasDesktopResolution()) { + _overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth * _scaleFactorXm / _scaleFactorXd, _overlayHeight * _scaleFactorYm / _scaleFactorYd, 16, 0, 0, 0, 0); + if (_overlayscreen == NULL) + error("_overlayscreen failed"); + _tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth * _scaleFactorXm / _scaleFactorXd + 3, _overlayHeight * _scaleFactorYm / _scaleFactorYd + 3, 16, 0, 0, 0, 0); + if (_tmpscreen2 == NULL) + error("_tmpscreen2 failed"); + } else { + _overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth, _overlayHeight, 16, 0, 0, 0, 0); + if (_overlayscreen == NULL) + error("_overlayscreen failed"); + _tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth + 3, _overlayHeight + 3, 16, 0, 0, 0, 0); + if (_tmpscreen2 == NULL) + error("_tmpscreen2 failed"); + } // Toolbar uint16 *toolbar_screen = (uint16 *)calloc(320 * 40, sizeof(uint16)); @@ -1445,8 +1452,8 @@ void OSystem_WINCE3::internUpdateScreen() { } // clip inside platform screen (landscape,bottom only) - if (_orientationLandscape && !_zoomDown && dst_y+dst_h > _platformScreenWidth) - dst_h = _platformScreenWidth - dst_y; + if (_orientationLandscape && !_zoomDown && dst_y+dst_h > _screenHeight) + dst_h = _screenHeight - dst_y; if (!_zoomDown) _scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, @@ -1698,6 +1705,8 @@ void OSystem_WINCE3::copyRectToScreen(const byte *src, int pitch, int x, int y, void OSystem_WINCE3::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) { undrawMouse(); + if (w == 0 || h == 0) + return; assert(w <= MAX_MOUSE_W); assert(h <= MAX_MOUSE_H); |