aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/gfx/osystem
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-25 20:00:58 +0200
committerEinar Johan Trøan Sømåen2012-07-25 20:00:58 +0200
commit6e55e32a381d1219dfbe8d3c1532d55b28291192 (patch)
treebe0675bdbb14236502a154dbd1fea229c9ef4176 /engines/wintermute/base/gfx/osystem
parent6331bea4231b5db86d01a8f21b5ff84e4b96d8f6 (diff)
downloadscummvm-rg350-6e55e32a381d1219dfbe8d3c1532d55b28291192.tar.gz
scummvm-rg350-6e55e32a381d1219dfbe8d3c1532d55b28291192.tar.bz2
scummvm-rg350-6e55e32a381d1219dfbe8d3c1532d55b28291192.zip
WINTERMUTE: Cleanup and comment BaseRenderer a bit
Diffstat (limited to 'engines/wintermute/base/gfx/osystem')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp34
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.h9
2 files changed, 13 insertions, 30 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index 2d2e62076c..09ee62c3b8 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -284,14 +284,14 @@ bool BaseRenderOSystem::fill(byte r, byte g, byte b, Common::Rect *rect) {
}
//////////////////////////////////////////////////////////////////////////
-bool BaseRenderOSystem::fade(uint16 Alpha) {
- uint32 dwAlpha = 255 - Alpha;
- return fadeToColor(dwAlpha << 24);
+void BaseRenderOSystem::fade(uint16 alpha) {
+ byte dwAlpha = (byte)(255 - alpha);
+ return fadeToColor(0, 0, 0, dwAlpha);
}
//////////////////////////////////////////////////////////////////////////
-bool BaseRenderOSystem::fadeToColor(uint32 Color, Common::Rect *rect) {
+void BaseRenderOSystem::fadeToColor(byte r, byte g, byte b, byte a, Common::Rect *rect) {
// This particular warning is rather messy, as this function is called a ton,
// thus we avoid printing it more than once.
static bool hasWarned = false;
@@ -318,11 +318,6 @@ bool BaseRenderOSystem::fadeToColor(uint32 Color, Common::Rect *rect) {
}
modTargetRect(&fillRect);
- byte r = RGBCOLGetR(Color);
- byte g = RGBCOLGetG(Color);
- byte b = RGBCOLGetB(Color);
- byte a = RGBCOLGetA(Color);
-
//TODO: This is only here until I'm sure about the final pixelformat
uint32 col = _renderSurface->format.ARGBToColor(a, r, g, b);
if (_disableDirtyRects)
@@ -342,8 +337,10 @@ bool BaseRenderOSystem::fadeToColor(uint32 Color, Common::Rect *rect) {
//SDL_SetRenderDrawColor(_renderer, r, g, b, a);
//SDL_SetRenderDrawBlendMode(_renderer, SDL_BLENDMODE_BLEND);
//SDL_RenderFillRect(_renderer, &fillRect);
+}
- return STATUS_OK;
+Graphics::PixelFormat BaseRenderOSystem::getPixelFormat() const {
+ return _renderSurface->format;
}
void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY) {
@@ -589,17 +586,8 @@ BaseImage *BaseRenderOSystem::takeScreenshot() {
}
//////////////////////////////////////////////////////////////////////////
-const char *BaseRenderOSystem::getName() {
- if (_name.empty()) {
-#if 0
- if (_renderer) {
- SDL_RendererInfo info;
- SDL_GetRendererInfo(_renderer, &info);
- _name = AnsiString(info.name);
- }
-#endif
- }
- return _name.c_str();
+Common::String BaseRenderOSystem::getName() const {
+ return "ScummVM-OSystem-renderer";
}
//////////////////////////////////////////////////////////////////////////
@@ -611,10 +599,6 @@ bool BaseRenderOSystem::setViewport(int left, int top, int right, int bottom) {
rect.right = (int16)((right - left) * _ratioX);
rect.bottom = (int16)((bottom - top) * _ratioY);
- // TODO fix this once viewports work correctly in SDL/landscape
-#ifndef __IPHONEOS__
- //SDL_RenderSetViewport(GetSdlRenderer(), &rect);
-#endif
return STATUS_OK;
}
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
index 3f4185dce2..b7507098da 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
@@ -62,14 +62,14 @@ public:
BaseRenderOSystem(BaseGame *inGame);
~BaseRenderOSystem();
- const char *getName();
+ Common::String getName() const;
bool initRenderer(int width, int height, bool windowed);
bool flip();
bool fill(byte r, byte g, byte b, Common::Rect *rect = NULL);
-
- bool fade(uint16 alpha);
- bool fadeToColor(uint32 color, Common::Rect *rect = NULL);
+ Graphics::PixelFormat getPixelFormat() const;
+ void fade(uint16 alpha);
+ void fadeToColor(byte r, byte g, byte b, byte a, Common::Rect *rect = NULL);
bool drawLine(int x1, int y1, int x2, int y2, uint32 color);
@@ -109,7 +109,6 @@ private:
uint32 _drawNum;
Common::Rect _renderRect;
Graphics::Surface *_renderSurface;
- AnsiString _name;
int _borderLeft;
int _borderTop;