mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 08:25:35 +00:00
DIRECTOR: implement linespacing for text castmember, set line spacing default to 1 in D4
This commit is contained in:
parent
1492a06a84
commit
8c70bab234
@ -569,6 +569,9 @@ TextCastMember::TextCastMember(Cast *cast, uint16 castId, Common::SeekableReadSt
|
||||
_bgpalinfo1 = _bgpalinfo2 = _bgpalinfo3 = 0;
|
||||
_fgpalinfo1 = _fgpalinfo2 = _fgpalinfo3 = 0xff;
|
||||
|
||||
// seems like the line spacing is default to 1 in D4
|
||||
_lineSpacing = g_director->getVersion() >= 400 ? 1 : 0;
|
||||
|
||||
if (version < kFileVer400) {
|
||||
_flags1 = flags1; // region: 0 - auto, 1 - matte, 2 - disabled
|
||||
_borderSize = static_cast<SizeType>(stream.readByte());
|
||||
@ -790,11 +793,12 @@ void TextCastMember::setText(const char *text) {
|
||||
}
|
||||
}
|
||||
|
||||
// D4 dictionary book said this is line spacing
|
||||
int TextCastMember::getTextHeight() {
|
||||
if (_widget)
|
||||
return ((Graphics::MacText *)_widget)->getTextHeight();
|
||||
return ((Graphics::MacText *)_widget)->getLineSpacing();
|
||||
else
|
||||
warning("TextCastMember::getTextHeight: getting text height when there is no widget, returning 0");
|
||||
warning("TextCastMember::getTextHeight: getting text line spacing when there is no widget, returning 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -259,6 +259,7 @@ public:
|
||||
uint16 _fgpalinfo1, _fgpalinfo2, _fgpalinfo3;
|
||||
ButtonType _buttonType;
|
||||
bool _editable;
|
||||
int _lineSpacing;
|
||||
|
||||
Common::String _ftext;
|
||||
Common::String _ptext;
|
||||
|
@ -958,19 +958,21 @@ bool TextCastMember::setField(int field, const Datum &d) {
|
||||
|
||||
_textAlign = align;
|
||||
_modified = true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case kTheTextFont:
|
||||
warning("TextCastMember::setField(): Unprocessed setting field \"%s\" of field %d", g_lingo->field2str(field), _castId);
|
||||
return false;
|
||||
case kTheTextHeight:
|
||||
warning("TextCastMember::setField(): Unprocessed setting field \"%s\" of field %d", g_lingo->field2str(field), _castId);
|
||||
_lineSpacing = d.asInt();
|
||||
_modified = true;
|
||||
return false;
|
||||
case kTheTextSize:
|
||||
warning("TextCastMember::setField(): Unprocessed setting field \"%s\" of field %d", g_lingo->field2str(field), _castId);
|
||||
return false;
|
||||
case kTheTextStyle:
|
||||
warning("TextCastMember::setField(): Unprocessed setting field \"%s\" of field %d", g_lingo->field2str(field), _castId);
|
||||
_textSlant = d.asInt();
|
||||
_modified = true;
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user