better check for null font

This commit is contained in:
Pawel Kolodziejski 2009-05-10 13:14:02 +00:00
parent d295ce01ea
commit 108efa4d20
2 changed files with 5 additions and 7 deletions

View File

@ -357,6 +357,9 @@ void Actor::sayLine(const char *msg, const char *msgId) {
_sayLineText = NULL;
}
if (!sayLineDefaults.font)
return;
_sayLineText = new TextObject(false);
_sayLineText->setDefaults(&sayLineDefaults);
_sayLineText->setText((char *)msg);
@ -373,10 +376,8 @@ void Actor::sayLine(const char *msg, const char *msgId) {
_sayLineText->setY(_winY1);
}
}
if (_sayLineText->isFontSet()) {
_sayLineText->createBitmap();
g_engine->registerTextObject(_sayLineText);
}
_sayLineText->createBitmap();
g_engine->registerTextObject(_sayLineText);
}
bool Actor::talking() {

View File

@ -70,9 +70,6 @@ public:
void setHeight(int height) { _height = height; }
void setFGColor(Color *fgColor) { _fgColor = fgColor; }
void setFont(Font *font) { _font = font; }
bool isFontSet() {
return _font != NULL;
}
void setJustify(int justify) { _justify = justify; }
void setDisabled(bool disabled) { _disabled = disabled; }
int getBitmapWidth();