Skip to content
Permalink
Browse files

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.
  • Loading branch information...
tobiatesan authored and sev- committed Apr 29, 2017
1 parent b6eb8a1 commit 132785ccb05db73da8d4cbe420acf55e2bc9e581
Showing with 6 additions and 6 deletions.
  1. +6 −6 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));

0 comments on commit 132785c

Please sign in to comment.
You can’t perform that action at this time.