From 7729faaadff2e6f92d24f43e52d085f4b11be315 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Fri, 10 Oct 2008 17:48:27 +0000 Subject: Did a little bit of code cleanup (mostly from TMW changes) as well as properly implemented line wrapping. Now, there are no more visual artifacts for speech boxes, and it always chooses the most optimal box size (which required that npc_text use it also. Do any other gui classes use the textbox class?). --- src/animatedsprite.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/animatedsprite.cpp') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index dd43e0f1..34ea60f4 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -195,23 +195,11 @@ AnimatedSprite::setDirection(SpriteDirection direction) int AnimatedSprite::getWidth() const { - if (mFrame) - { - return mFrame->image->getWidth(); - } - else { - return 0; - } + return mframe ? mFrame->image->getWidth() : 0; } int AnimatedSprite::getHeight() const { - if (mFrame) - { - return mFrame->image->getHeight(); - } - else { - return 0; - } + return mFrame ? mFrame->image->getHeight() : 0; } -- cgit v1.2.3-60-g2f50