diff options
author | Tobia Tesan | 2017-04-30 00:57:32 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-04-30 09:48:08 +0200 |
commit | 132785ccb05db73da8d4cbe420acf55e2bc9e581 (patch) | |
tree | cd31cc0fb025b3f9e8a830c1a015a58c0823fbaa | |
parent | b6eb8a1a6697ba068590e50164cb5e4f37a1c1df (diff) | |
download | scummvm-rg350-132785ccb05db73da8d4cbe420acf55e2bc9e581.tar.gz scummvm-rg350-132785ccb05db73da8d4cbe420acf55e2bc9e581.tar.bz2 scummvm-rg350-132785ccb05db73da8d4cbe420acf55e2bc9e581.zip |
DIRECTOR: clean up renderText: move warning block down
This changes slightly the semantics of the method; however, I assume we
want to print (or not) the warning based on the width/height values that
will in fact be used *in* the method.
-rw-r--r-- | engines/director/frame.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 8911a60728..30be86739c 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -752,11 +752,6 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo else width = textCast->initialRect.width(); //_sprites[spriteId]->_width; - if (width == 0 || height == 0) { - warning("renderText: Requested to draw on an empty surface: %d x %d", width, height); - return; - } - if (_vm->getVersion() >= 4) { if (textSize == NULL) width = textCast->initialRect.right; @@ -771,7 +766,12 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo // textCast->fontId = _vm->_wm->_fontMan->getFontIdByName(_vm->getCurrentScore()->_fontMap[textCast->fontId]); } - Graphics::MacFont* macFont = new Graphics::MacFont(textCast->fontId, textCast->fontSize, textCast->textSlant); + if (width == 0 || height == 0) { + warning("renderText: Requested to draw on an empty surface: %d x %d", width, height); + return; + } + + Graphics::MacFont *macFont = new Graphics::MacFont(textCast->fontId, textCast->fontSize, textCast->textSlant); debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont)); |