mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
some Font fixes
svn-id: r19668
This commit is contained in:
parent
88379e7dbe
commit
6c828a1c17
@ -624,7 +624,7 @@ void Font::textDrawRect(FontId fontId, Surface *ds, const char *text, const Comm
|
||||
}
|
||||
}
|
||||
|
||||
FontId Font::knownFont2FontIdx(KnownFont font) {
|
||||
Font::FontId Font::knownFont2FontIdx(KnownFont font) {
|
||||
FontId fontId = kSmallFont;
|
||||
|
||||
if (_vm->getGameType() == GType_ITE) {
|
||||
|
23
saga/font.h
23
saga/font.h
@ -53,16 +53,6 @@ namespace Saga {
|
||||
#define TEXT_MARGIN 10
|
||||
#define TEXT_LINESPACING 2
|
||||
|
||||
enum FontId {
|
||||
kSmallFont,
|
||||
kMediumFont,
|
||||
kBigFont,
|
||||
kIHNMUnknown,
|
||||
kIHNMFont8,
|
||||
kIHNMUnknown2,
|
||||
kIHNMMainFont
|
||||
};
|
||||
|
||||
enum FontEffectFlags {
|
||||
kFontNormal = 0,
|
||||
kFontOutline = 1 << 0,
|
||||
@ -151,7 +141,17 @@ class Font {
|
||||
}
|
||||
|
||||
private:
|
||||
FontId knownFont2FontIdx(KnownFont font);
|
||||
enum FontId {
|
||||
kSmallFont,
|
||||
kMediumFont,
|
||||
kBigFont,
|
||||
kIHNMUnknown,
|
||||
kIHNMFont8,
|
||||
kIHNMUnknown2,
|
||||
kIHNMMainFont
|
||||
};
|
||||
|
||||
Font::FontId knownFont2FontIdx(KnownFont font);
|
||||
|
||||
int getStringWidth(FontId fontId, const char *text, size_t count, FontEffectFlags flags);
|
||||
int getHeight(FontId fontId, const char *text, int width, FontEffectFlags flags);
|
||||
@ -168,7 +168,6 @@ class Font {
|
||||
return _fonts[fontId];
|
||||
}
|
||||
|
||||
public:
|
||||
int getHeight(FontId fontId) {
|
||||
return getFont(fontId)->normal.header.charHeight;
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ void Interface::drawOption() {
|
||||
_optionPanel.calcPanelButtonRect(_optionSaveFilePanel, rect);
|
||||
rect.top++;
|
||||
rect2 = rect;
|
||||
fontHeight = _vm->_font->getHeight(kSmallFont);
|
||||
fontHeight = _vm->_font->getHeight(kKnownFontSmall);
|
||||
for (j = 0; j < _vm->getDisplayInfo().optionSaveFileVisible; j++) {
|
||||
bgColor = kITEColorDarkGrey0C;
|
||||
fgColor = kITEColorBrightWhite;
|
||||
@ -1041,7 +1041,7 @@ void Interface::drawTextInput(Surface *ds, InterfacePanel *panel, PanelButton *p
|
||||
drawButtonBox(ds, rect, kEdit, _textInput);
|
||||
rect.left += 4;
|
||||
rect.top += 4;
|
||||
rect.setHeight(_vm->_font->getHeight(kSmallFont));
|
||||
rect.setHeight(_vm->_font->getHeight(kKnownFontSmall));
|
||||
|
||||
i = 0;
|
||||
while ((ch[0] = _textInputString[i++]) != 0) {
|
||||
@ -1251,7 +1251,7 @@ void Interface::handleOptionClick(const Point& mousePoint) {
|
||||
} else {
|
||||
if (_optionPanel.currentButton == _optionSaveFilePanel) {
|
||||
_optionPanel.calcPanelButtonRect(_optionSaveFilePanel, rect);
|
||||
_optionSaveFileTitleNumber = (mousePoint.y - rect.top) / (_vm->_font->getHeight(kSmallFont) + 1);
|
||||
_optionSaveFileTitleNumber = (mousePoint.y - rect.top) / (_vm->_font->getHeight(kKnownFontSmall) + 1);
|
||||
|
||||
if (_optionSaveFileTitleNumber >= _vm->getDisplayInfo().optionSaveFileVisible) {
|
||||
_optionSaveFileTitleNumber = _vm->getDisplayInfo().optionSaveFileVisible - 1;
|
||||
|
@ -1308,7 +1308,7 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) {
|
||||
textEntry.color = kITEColorBrightWhite;
|
||||
textEntry.effectColor = kITEColorBlack;
|
||||
textEntry.point.x = _vm->getDisplayWidth() / 2;
|
||||
textEntry.point.y = (_vm->_scene->getHeight() - _vm->_font->getHeight(kMediumFont)) / 2;
|
||||
textEntry.point.y = (_vm->_scene->getHeight() - _vm->_font->getHeight(kKnownFontMedium)) / 2;
|
||||
textEntry.font = kKnownFontMedium;
|
||||
textEntry.flags = (FontEffectFlags)(kFontOutline | kFontCentered);
|
||||
textEntry.text = thread->_strings->getString(stringId);
|
||||
|
Loading…
Reference in New Issue
Block a user