From 0b14f6aa1787c3be6c402f6a541a659c88a790a6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 17:26:04 +0200 Subject: SDL: Properly setup internal Surface formats. --- backends/graphics/sdl/sdl-graphics.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'backends/graphics/sdl/sdl-graphics.cpp') diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 67b979a830..5279af9896 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -1288,8 +1288,10 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() { _framebuffer.pitch = _screen->pitch; #ifdef USE_RGB_COLOR _framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel; + _framebuffer.format = _screenFormat; #else _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); #endif return &_framebuffer; @@ -2055,6 +2057,11 @@ void SdlGraphicsManager::displayMessageOnOSD(const char *msg) { dst.h = _osdSurface->h; dst.pitch = _osdSurface->pitch; dst.bytesPerPixel = _osdSurface->format->BytesPerPixel; + dst.format = Graphics::PixelFormat(_osdSurface->format->BytesPerPixel, + 8 - _osdSurface->format->Rloss, 8 - _osdSurface->format->Gloss, + 8 - _osdSurface->format->Bloss, 8 - _osdSurface->format->Aloss, + _osdSurface->format->Rshift, _osdSurface->format->Gshift, + _osdSurface->format->Bshift, _osdSurface->format->Ashift); // The font we are going to use: const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kOSDFont); -- cgit v1.2.3 From da734a4af024a72ee155bc25d6e45f994de6b060 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 21:27:34 +0200 Subject: ALL/GRAPHICS: Remove Surface::bytesPerPixel. --- backends/graphics/sdl/sdl-graphics.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'backends/graphics/sdl/sdl-graphics.cpp') diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 5279af9896..6b20c2f9c2 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -1287,10 +1287,8 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() { _framebuffer.h = _screen->h; _framebuffer.pitch = _screen->pitch; #ifdef USE_RGB_COLOR - _framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel; _framebuffer.format = _screenFormat; #else - _framebuffer.bytesPerPixel = 1; _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); #endif @@ -2056,7 +2054,6 @@ void SdlGraphicsManager::displayMessageOnOSD(const char *msg) { dst.w = _osdSurface->w; dst.h = _osdSurface->h; dst.pitch = _osdSurface->pitch; - dst.bytesPerPixel = _osdSurface->format->BytesPerPixel; dst.format = Graphics::PixelFormat(_osdSurface->format->BytesPerPixel, 8 - _osdSurface->format->Rloss, 8 - _osdSurface->format->Gloss, 8 - _osdSurface->format->Bloss, 8 - _osdSurface->format->Aloss, -- cgit v1.2.3 From 9414d7a6e287ff8abfb5746b564e92c8f0e6de58 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sun, 24 Apr 2011 11:34:27 +0300 Subject: JANITORIAL: Reduce header dependencies in shared code Some backends may break as I only compiled SDL --- backends/graphics/sdl/sdl-graphics.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'backends/graphics/sdl/sdl-graphics.cpp') diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 67b979a830..41f5c2acbb 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -32,6 +32,7 @@ #include "backends/platform/sdl/sdl.h" #include "common/config-manager.h" #include "common/mutex.h" +#include "common/textconsole.h" #include "common/translation.h" #include "common/util.h" #ifdef USE_RGB_COLOR -- cgit v1.2.3 From 59e77ed66779d33a14a5f4d2a5885a70b793f36f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 2 May 2011 14:42:08 +0200 Subject: ALL: Mark printf and various other symbols as forbidden Right now, a few places in the frontend code still use printf and consorts. We mark the affected files with a FIXME for now, and add a dedicated exception for each. To be fixed! Also tweak FORBIDDEN_SYMBOL_REPLACEMENT to hopefully really always enforce a compiler error --- backends/graphics/sdl/sdl-graphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/graphics/sdl/sdl-graphics.cpp') diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index b3e1138e77..3ae9597f1c 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -2279,9 +2279,9 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) { SDL_RWclose(file); } if (saveScreenshot(filename)) - printf("Saved '%s'\n", filename); + debug("Saved screenshot '%s'", filename); else - printf("Could not save screenshot!\n"); + warning("Could not save screenshot"); return true; } -- cgit v1.2.3