aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-05-09 19:26:47 +0200
committerEinar Johan Trøan Sømåen2012-06-02 12:42:09 +0200
commit0b8ac2f3b44883875c9366cd965314257fc32ce7 (patch)
tree81a904fdda1654fc182ceedf009a7f29f600ef96 /engines
parent9355850d0728df266b33446e58ab0f330d34321d (diff)
downloadscummvm-rg350-0b8ac2f3b44883875c9366cd965314257fc32ce7.tar.gz
scummvm-rg350-0b8ac2f3b44883875c9366cd965314257fc32ce7.tar.bz2
scummvm-rg350-0b8ac2f3b44883875c9366cd965314257fc32ce7.zip
WINTERMUTE: Add a simple alpha-hack for rendering.
This is not pretty, but atleast it shows the entire first screen for 'Dirty Split' drawing fine.
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/BRenderSDL.cpp14
-rw-r--r--engines/wintermute/wintermute.cpp2
2 files changed, 11 insertions, 5 deletions
diff --git a/engines/wintermute/BRenderSDL.cpp b/engines/wintermute/BRenderSDL.cpp
index 1daf2aafc8..a8e18c74d2 100644
--- a/engines/wintermute/BRenderSDL.cpp
+++ b/engines/wintermute/BRenderSDL.cpp
@@ -161,7 +161,7 @@ HRESULT CBRenderSDL::InitRenderer(int width, int height, bool windowed) {
if (!_renderer) return E_FAIL;
#endif
_renderSurface = new Graphics::Surface();
- _renderSurface->create(640,480, g_system->getScreenFormat()); // TODO: Unhardcode this.
+ _renderSurface->create(g_system->getWidth(), g_system->getHeight(), g_system->getScreenFormat());
_active = true;
@@ -210,8 +210,7 @@ HRESULT CBRenderSDL::Flip() {
}
}
#endif
- // TODO, unhardcode.
- g_system->copyRectToScreen((byte*)_renderSurface->pixels, _renderSurface->pitch, 0, 0, 640, 480);
+ g_system->copyRectToScreen((byte*)_renderSurface->pixels, _renderSurface->pitch, 0, 0, _renderSurface->w, _renderSurface->h);
g_system->updateScreen();
//SDL_RenderPresent(_renderer);
@@ -277,7 +276,14 @@ void CBRenderSDL::drawFromSurface(Graphics::Surface *surf, Common::Rect *srcRect
for (int i = 0; i < srcRect->height(); i++) {
void *destPtr = _renderSurface->getBasePtr(dstRect->left, dstRect->top + i);
void *srcPtr = surf->getBasePtr(srcRect->left, srcRect->top + i);
- memcpy(destPtr, srcPtr, _renderSurface->format.bytesPerPixel * srcRect->width());
+ for (int j = 0; j < srcRect->width(); j++) {
+ // TODO: Replace this with something less ugly, and more portable.
+ if (((byte*)srcPtr)[0] == 255) {
+ memcpy(destPtr, srcPtr, _renderSurface->format.bytesPerPixel);
+ }
+ ((byte*)srcPtr)+=_renderSurface->format.bytesPerPixel;
+ ((byte*)destPtr)+=_renderSurface->format.bytesPerPixel;
+ }
}
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp
index 298e4a97c6..e6b273b291 100644
--- a/engines/wintermute/wintermute.cpp
+++ b/engines/wintermute/wintermute.cpp
@@ -72,7 +72,7 @@ namespace WinterMute {
Common::Error WinterMuteEngine::run() {
// Initialize graphics using following:
Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0);
- initGraphics(640, 480, false, &format);
+ initGraphics(800, 600, false, &format);
// You could use backend transactions directly as an alternative,
// but it isn't recommended, until you want to handle the error values