diff options
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/ad/ad_item.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/ad/ad_object.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/ad/ad_response_box.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/ad/ad_scene.cpp | 6 | ||||
-rw-r--r-- | engines/wintermute/base/base_game.h | 12 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_button.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_edit.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_text.cpp | 2 |
8 files changed, 24 insertions, 18 deletions
diff --git a/engines/wintermute/ad/ad_item.cpp b/engines/wintermute/ad/ad_item.cpp index 1bd7692820..8534956120 100644 --- a/engines/wintermute/ad/ad_item.cpp +++ b/engines/wintermute/ad/ad_item.cpp @@ -435,7 +435,7 @@ bool AdItem::display(int x, int y) { } amountX += _amountOffsetX; - BaseFont *font = _font ? _font : _gameRef->_systemFont; + BaseFont *font = _font ? _font : _gameRef->getSystemFont(); if (font) { if (_amountString) { font->drawText((byte *)_amountString, amountX, amountY, width, _amountAlign); diff --git a/engines/wintermute/ad/ad_object.cpp b/engines/wintermute/ad/ad_object.cpp index 2dddc6f5fc..a41ed9fbc3 100644 --- a/engines/wintermute/ad/ad_object.cpp +++ b/engines/wintermute/ad/ad_object.cpp @@ -907,7 +907,7 @@ void AdObject::talk(const char *text, const char *sound, uint32 duration, const _sentence->_align = Align; _sentence->_startTime = _gameRef->_timer; _sentence->_currentStance = -1; - _sentence->_font = _font == nullptr ? _gameRef->_systemFont : _font; + _sentence->_font = _font == nullptr ? _gameRef->getSystemFont() : _font; _sentence->_freezable = _freezable; // try to locate speech file automatically diff --git a/engines/wintermute/ad/ad_response_box.cpp b/engines/wintermute/ad/ad_response_box.cpp index c889f56c22..c891d2a019 100644 --- a/engines/wintermute/ad/ad_response_box.cpp +++ b/engines/wintermute/ad/ad_response_box.cpp @@ -163,8 +163,8 @@ bool AdResponseBox::createButtons() { // textual else { btn->setText(_responses[i]->_text); - btn->_font = (_font == nullptr) ? _gameRef->_systemFont : _font; - btn->_fontHover = (_fontHover == nullptr) ? _gameRef->_systemFont : _fontHover; + btn->_font = (_font == nullptr) ? _gameRef->getSystemFont() : _font; + btn->_fontHover = (_fontHover == nullptr) ? _gameRef->getSystemFont() : _fontHover; btn->_fontPress = btn->_fontHover; btn->_align = _align; diff --git a/engines/wintermute/ad/ad_scene.cpp b/engines/wintermute/ad/ad_scene.cpp index f0e26e7e37..f305c2f60e 100644 --- a/engines/wintermute/ad/ad_scene.cpp +++ b/engines/wintermute/ad/ad_scene.cpp @@ -1138,8 +1138,8 @@ bool AdScene::updateFreeObjects() { } - if (_autoScroll && _gameRef->_mainObject != nullptr) { - scrollToObject(_gameRef->_mainObject); + if (_autoScroll && _gameRef->getMainObject() != nullptr) { + scrollToObject(_gameRef->getMainObject()); } @@ -1285,7 +1285,7 @@ void AdScene::scrollTo(int offsetX, int offsetY) { _targetOffsetTop = MIN(_targetOffsetTop, _height - viewportHeight); - if (_gameRef->_mainObject && _gameRef->_mainObject->_is3D) { + if (_gameRef->getMainObject() && _gameRef->getMainObject()->_is3D) { if (abs(origOffsetLeft - _targetOffsetLeft) < 5) { _targetOffsetLeft = origOffsetLeft; } diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h index a902727f5f..5666fb818c 100644 --- a/engines/wintermute/base/base_game.h +++ b/engines/wintermute/base/base_game.h @@ -119,14 +119,15 @@ public: int _offsetX; float _offsetPercentX; float _offsetPercentY; - BaseObject *_mainObject; + + inline BaseObject *getMainObject() { return _mainObject; } + inline BaseFont *getSystemFont() { return _systemFont; } bool initInput(); bool initLoop(); uint32 _currentTime; uint32 _deltaTime; - BaseFont *_systemFont; - BaseFont *_videoFont; + bool initialize1(); bool initialize2(); bool initialize3(); @@ -249,6 +250,9 @@ public: bool _touchInterface; bool _constrainedMemory; protected: + BaseFont *_systemFont; + BaseFont *_videoFont; + BaseSprite *_loadingIcon; int _loadingIconX; int _loadingIconY; @@ -260,6 +264,8 @@ protected: VideoPlayer *_videoPlayer; VideoTheoraPlayer *_theoraPlayer; private: + BaseObject *_mainObject; + bool _mouseRightDown; bool _mouseMidlleDown; bool _settingsRequireAcceleration; diff --git a/engines/wintermute/ui/ui_button.cpp b/engines/wintermute/ui/ui_button.cpp index 2c356b2b7e..6ee577f009 100644 --- a/engines/wintermute/ui/ui_button.cpp +++ b/engines/wintermute/ui/ui_button.cpp @@ -622,15 +622,15 @@ void UIButton::correctSize() { } if (_text) { - int text_height; + int textHeight; if (_font) { - text_height = _font->getTextHeight((byte *)_text, _width); + textHeight = _font->getTextHeight((byte *)_text, _width); } else { - text_height = _gameRef->_systemFont->getTextHeight((byte *)_text, _width); + textHeight = _gameRef->getSystemFont()->getTextHeight((byte *)_text, _width); } - if (text_height > _height) { - _height = text_height; + if (textHeight > _height) { + _height = textHeight; } } @@ -717,7 +717,7 @@ bool UIButton::display(int offsetX, int offsetY) { if (_font) { font = _font; } else { - font = _gameRef->_systemFont; + font = _gameRef->getSystemFont(); } } diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp index 7728272ccd..0a2e6f13bc 100644 --- a/engines/wintermute/ui/ui_edit.cpp +++ b/engines/wintermute/ui/ui_edit.cpp @@ -589,7 +589,7 @@ bool UIEdit::display(int offsetX, int offsetY) { if (_font) { font = _font; } else { - font = _gameRef->_systemFont; + font = _gameRef->getSystemFont(); } if (_fontSelected) { diff --git a/engines/wintermute/ui/ui_text.cpp b/engines/wintermute/ui/ui_text.cpp index 5a1bffcdc0..3b5adf07b7 100644 --- a/engines/wintermute/ui/ui_text.cpp +++ b/engines/wintermute/ui/ui_text.cpp @@ -69,7 +69,7 @@ bool UIText::display(int offsetX, int offsetY) { BaseFont *font = _font; if (!font) { - font = _gameRef->_systemFont; + font = _gameRef->getSystemFont(); } if (_back) { |