[Scummvm-cvs-logs] scummvm master -> 7058daaed164934ba66a6554235e8b23a9ccf110
bluegr
bluegr at gmail.com
Sun Jan 6 21:25:30 CET 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7058daaed1 MT32: Remove the screen drawing code of the MUNT debug messages (bug #3599702)
Commit: 7058daaed164934ba66a6554235e8b23a9ccf110
https://github.com/scummvm/scummvm/commit/7058daaed164934ba66a6554235e8b23a9ccf110
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-01-06T12:24:27-08:00
Commit Message:
MT32: Remove the screen drawing code of the MUNT debug messages (bug #3599702)
The MUNT debug messages are called from an audio callback, which is not allowed to
update the screen, as per the OSystem documentation in common/system.h:401
Changed paths:
audio/softsynth/mt32.cpp
diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp
index 38cdaf1..6813363 100644
--- a/audio/softsynth/mt32.cpp
+++ b/audio/softsynth/mt32.cpp
@@ -50,8 +50,6 @@
#include "gui/message.h"
-static void drawMessage(int offset, const Common::String &text);
-
namespace MT32Emu {
class ReportHandlerScummVM : public ReportHandler {
@@ -64,16 +62,7 @@ protected:
// Callback for debug messages, in vprintf() format
void printDebug(const char *fmt, va_list list) {
- // Only show MUNT debug messages for debug level 4 and above
- if (gDebugLevel < 4)
- return;
-
- char buf[512];
-
- vsnprintf(buf, 512, fmt, list);
- buf[70] = 0; // Truncate to a reasonable length
-
- drawMessage(1, buf);
+ debug(4, fmt, list);
}
// Callbacks for reporting various errors and information
@@ -144,39 +133,6 @@ public:
int getRate() const { return _outputRate; }
};
-static void drawMessage(int offset, const Common::String &text) {
- const Graphics::Font &font(*FontMan.getFontByUsage(Graphics::FontManager::kGUIFont));
- Graphics::Surface *screen = g_system->lockScreen();
-
- assert(screen);
- assert(screen->pixels);
-
- Graphics::PixelFormat screenFormat = g_system->getScreenFormat();
-
- uint16 h = font.getFontHeight();
- uint16 y = g_system->getHeight() / 2 - h / 2 + offset * (h + 1);
-
- uint32 col;
-
- if (screenFormat.bytesPerPixel > 1)
- col = screenFormat.RGBToColor(0, 0, 0);
- else
- col = 0;
-
- Common::Rect r(0, y, screen->w, y + h);
- screen->fillRect(r, col);
-
- if (screenFormat.bytesPerPixel > 1)
- col = screenFormat.RGBToColor(0, 171, 0);
- else
- col = 1;
-
- font.drawString(screen, text, 0, y, screen->w, col, Graphics::kTextAlignCenter);
-
- g_system->unlockScreen();
- g_system->updateScreen();
-}
-
////////////////////////////////////////
//
// MidiDriver_MT32
@@ -246,7 +202,7 @@ int MidiDriver_MT32::open() {
}
_initializing = true;
- drawMessage(-1, _s("Initializing MT-32 Emulator"));
+ debug(4, _s("Initializing MT-32 Emulator"));
_controlFile = new Common::File();
if (!_controlFile->open("MT32_CONTROL.ROM"))
error("Error opening MT32_CONTROL.ROM");
More information about the Scummvm-git-logs
mailing list