diff options
Diffstat (limited to 'engines/wintermute/UI')
-rw-r--r-- | engines/wintermute/UI/UIButton.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/UI/UIEdit.cpp | 30 | ||||
-rw-r--r-- | engines/wintermute/UI/UIText.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/UI/UIWindow.cpp | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/engines/wintermute/UI/UIButton.cpp b/engines/wintermute/UI/UIButton.cpp index 759a37b4b3..7898b6f5c9 100644 --- a/engines/wintermute/UI/UIButton.cpp +++ b/engines/wintermute/UI/UIButton.cpp @@ -565,8 +565,8 @@ void CUIButton::CorrectSize() { if (_text) {
int text_height;
- if (_font) text_height = _font->GetTextHeight((byte *)_text, _width);
- else text_height = Game->_systemFont->GetTextHeight((byte *)_text, _width);
+ if (_font) text_height = _font->getTextHeight((byte *)_text, _width);
+ else text_height = Game->_systemFont->getTextHeight((byte *)_text, _width);
if (text_height > _height) _height = text_height;
}
@@ -634,8 +634,8 @@ HRESULT CUIButton::display(int OffsetX, int OffsetY) { if (image) image->Draw(ImageX + ((_press || _oneTimePress) && back ? 1 : 0), ImageY + ((_press || _oneTimePress) && back ? 1 : 0), _pixelPerfect ? this : NULL);
if (font && _text) {
- int text_offset = (_height - font->GetTextHeight((byte *)_text, _width)) / 2;
- font->DrawText((byte *)_text, OffsetX + _posX + ((_press || _oneTimePress) ? 1 : 0), OffsetY + _posY + text_offset + ((_press || _oneTimePress) ? 1 : 0), _width, _align);
+ int text_offset = (_height - font->getTextHeight((byte *)_text, _width)) / 2;
+ font->drawText((byte *)_text, OffsetX + _posX + ((_press || _oneTimePress) ? 1 : 0), OffsetY + _posY + text_offset + ((_press || _oneTimePress) ? 1 : 0), _width, _align);
}
if (!_pixelPerfect || !_image) Game->_renderer->_rectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + _posX, OffsetY + _posY, _width, _height, 100, 100, false));
diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp index 9a193b5c23..cab0be5ba8 100644 --- a/engines/wintermute/UI/UIEdit.cpp +++ b/engines/wintermute/UI/UIEdit.cpp @@ -573,13 +573,13 @@ HRESULT CUIEdit::display(int OffsetX, int OffsetY) { _selEnd = MIN((size_t)_selEnd, strlen(_text));
//int CursorWidth = font->GetCharWidth(_cursorChar[0]);
- int CursorWidth = font->GetTextWidth((byte *)_cursorChar);
+ int CursorWidth = font->getTextWidth((byte *)_cursorChar);
int s1, s2;
bool CurFirst;
// modify scroll offset
if (_selStart >= _selEnd) {
- while (font->GetTextWidth((byte *)_text + _scrollOffset, MAX(0, _selEnd - _scrollOffset)) > _width - CursorWidth - 2 * _frameWidth) {
+ while (font->getTextWidth((byte *)_text + _scrollOffset, MAX(0, _selEnd - _scrollOffset)) > _width - CursorWidth - 2 * _frameWidth) {
_scrollOffset++;
if (_scrollOffset >= (int)strlen(_text)) break;
}
@@ -590,8 +590,8 @@ HRESULT CUIEdit::display(int OffsetX, int OffsetY) { s2 = _selStart;
CurFirst = true;
} else {
- while (font->GetTextWidth((byte *)_text + _scrollOffset, MAX(0, _selStart - _scrollOffset)) +
- sfont->GetTextWidth((byte *)(_text + MAX(_scrollOffset, _selStart)), _selEnd - MAX(_scrollOffset, _selStart))
+ while (font->getTextWidth((byte *)_text + _scrollOffset, MAX(0, _selStart - _scrollOffset)) +
+ sfont->getTextWidth((byte *)(_text + MAX(_scrollOffset, _selStart)), _selEnd - MAX(_scrollOffset, _selStart))
> _width - CursorWidth - 2 * _frameWidth) {
_scrollOffset++;
@@ -616,7 +616,7 @@ HRESULT CUIEdit::display(int OffsetX, int OffsetY) { yyy = _posY + _frameWidth + OffsetY;
width = _posX + _width + OffsetX - _frameWidth;
- height = MAX(font->GetLetterHeight(), sfont->GetLetterHeight());
+ height = MAX(font->getLetterHeight(), sfont->getLetterHeight());
if (Game->_textRTL) xxx += AlignOffset;
@@ -625,9 +625,9 @@ HRESULT CUIEdit::display(int OffsetX, int OffsetY) { // unselected 1
if (s1 > _scrollOffset) {
- if (Count) font->DrawText((byte *)_text + _scrollOffset, xxx, yyy, width - xxx, Align, height, s1 - _scrollOffset);
- xxx += font->GetTextWidth((byte *)_text + _scrollOffset, s1 - _scrollOffset);
- AlignOffset += font->GetTextWidth((byte *)_text + _scrollOffset, s1 - _scrollOffset);
+ if (Count) font->drawText((byte *)_text + _scrollOffset, xxx, yyy, width - xxx, Align, height, s1 - _scrollOffset);
+ xxx += font->getTextWidth((byte *)_text + _scrollOffset, s1 - _scrollOffset);
+ AlignOffset += font->getTextWidth((byte *)_text + _scrollOffset, s1 - _scrollOffset);
}
// cursor
@@ -638,7 +638,7 @@ HRESULT CUIEdit::display(int OffsetX, int OffsetY) { _cursorVisible = !_cursorVisible;
}
if (_cursorVisible)
- font->DrawText((byte *)_cursorChar, xxx, yyy, width - xxx, Align, height, 1);
+ font->drawText((byte *)_cursorChar, xxx, yyy, width - xxx, Align, height, 1);
}
xxx += CursorWidth;
AlignOffset += CursorWidth;
@@ -648,9 +648,9 @@ HRESULT CUIEdit::display(int OffsetX, int OffsetY) { int s3 = MAX(s1, _scrollOffset);
if (s2 - s3 > 0) {
- if (Count) sfont->DrawText((byte *)_text + s3, xxx, yyy, width - xxx, Align, height, s2 - s3);
- xxx += sfont->GetTextWidth((byte *)_text + s3, s2 - s3);
- AlignOffset += sfont->GetTextWidth((byte *)_text + s3, s2 - s3);
+ if (Count) sfont->drawText((byte *)_text + s3, xxx, yyy, width - xxx, Align, height, s2 - s3);
+ xxx += sfont->getTextWidth((byte *)_text + s3, s2 - s3);
+ AlignOffset += sfont->getTextWidth((byte *)_text + s3, s2 - s3);
}
// cursor
@@ -661,15 +661,15 @@ HRESULT CUIEdit::display(int OffsetX, int OffsetY) { _cursorVisible = !_cursorVisible;
}
if (_cursorVisible)
- font->DrawText((byte *)_cursorChar, xxx, yyy, width - xxx, Align, height, 1);
+ font->drawText((byte *)_cursorChar, xxx, yyy, width - xxx, Align, height, 1);
}
xxx += CursorWidth;
AlignOffset += CursorWidth;
}
// unselected 2
- if (Count) font->DrawText((byte *)_text + s2, xxx, yyy, width - xxx, Align, height);
- AlignOffset += font->GetTextWidth((byte *)_text + s2);
+ if (Count) font->drawText((byte *)_text + s2, xxx, yyy, width - xxx, Align, height);
+ AlignOffset += font->getTextWidth((byte *)_text + s2);
AlignOffset = (_width - 2 * _frameWidth) - AlignOffset;
if (AlignOffset < 0) AlignOffset = 0;
diff --git a/engines/wintermute/UI/UIText.cpp b/engines/wintermute/UI/UIText.cpp index 5f11ebc964..afff0d204d 100644 --- a/engines/wintermute/UI/UIText.cpp +++ b/engines/wintermute/UI/UIText.cpp @@ -79,12 +79,12 @@ HRESULT CUIText::display(int OffsetX, int OffsetY) { text_offset = 0;
break;
case VAL_BOTTOM:
- text_offset = _height - font->GetTextHeight((byte *)_text, _width);
+ text_offset = _height - font->getTextHeight((byte *)_text, _width);
break;
default:
- text_offset = (_height - font->GetTextHeight((byte *)_text, _width)) / 2;
+ text_offset = (_height - font->getTextHeight((byte *)_text, _width)) / 2;
}
- font->DrawText((byte *)_text, OffsetX + _posX, OffsetY + _posY + text_offset, _width, _textAlign, _height);
+ font->drawText((byte *)_text, OffsetX + _posX, OffsetY + _posY + text_offset, _width, _textAlign, _height);
}
//Game->_renderer->_rectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + _posX, OffsetY + _posY, _width, _height, 100, 100, false));
@@ -392,7 +392,7 @@ HRESULT CUIText::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HeightToFit") == 0) {
Stack->CorrectParams(0);
- if (_font && _text) _height = _font->GetTextHeight((byte *)_text, _width);
+ if (_font && _text) _height = _font->getTextHeight((byte *)_text, _width);
Stack->PushNULL();
return S_OK;
}
@@ -480,8 +480,8 @@ HRESULT CUIText::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
HRESULT CUIText::SizeToFit() {
if (_font && _text) {
- _width = _font->GetTextWidth((byte *)_text);
- _height = _font->GetTextHeight((byte *)_text, _width);
+ _width = _font->getTextWidth((byte *)_text);
+ _height = _font->getTextHeight((byte *)_text, _width);
}
return S_OK;
}
diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp index 887d869076..d80f63a464 100644 --- a/engines/wintermute/UI/UIWindow.cpp +++ b/engines/wintermute/UI/UIWindow.cpp @@ -182,7 +182,7 @@ HRESULT CUIWindow::display(int OffsetX, int OffsetY) { if (image) image->Draw(_posX + OffsetX, _posY + OffsetY, _transparent ? NULL : this);
if (!CBPlatform::IsRectEmpty(&_titleRect) && font && _text) {
- font->DrawText((byte *)_text, _posX + OffsetX + _titleRect.left, _posY + OffsetY + _titleRect.top, _titleRect.right - _titleRect.left, _titleAlign, _titleRect.bottom - _titleRect.top);
+ font->drawText((byte *)_text, _posX + OffsetX + _titleRect.left, _posY + OffsetY + _titleRect.top, _titleRect.right - _titleRect.left, _titleAlign, _titleRect.bottom - _titleRect.top);
}
if (!_transparent && !image) Game->_renderer->_rectList.Add(new CBActiveRect(Game, this, NULL, _posX + OffsetX, _posY + OffsetY, _width, _height, 100, 100, false));
|