From d9b596ad183e4784e9692ac439683dbf5f904dc2 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 20 Mar 2013 01:00:12 +0100 Subject: HOPKINS: Remove setParent() from FontManager --- engines/hopkins/computer.cpp | 42 +++++++++++------------ engines/hopkins/dialogs.cpp | 4 +-- engines/hopkins/events.cpp | 2 +- engines/hopkins/font.cpp | 7 ++-- engines/hopkins/font.h | 3 +- engines/hopkins/globals.cpp | 2 +- engines/hopkins/hopkins.cpp | 15 ++++---- engines/hopkins/hopkins.h | 2 +- engines/hopkins/lines.cpp | 6 ++-- engines/hopkins/objects.cpp | 82 ++++++++++++++++++++++---------------------- engines/hopkins/script.cpp | 32 ++++++++--------- engines/hopkins/talk.cpp | 48 +++++++++++++------------- 12 files changed, 121 insertions(+), 124 deletions(-) (limited to 'engines') diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index a9bc4880c1..d273050833 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -77,15 +77,15 @@ void ComputerManager::setTextMode() { _vm->_graphicsManager.unlockScreen(); _vm->_graphicsManager._lineNbr = SCREEN_WIDTH; - _vm->_fontManager._font = _vm->_globals.freeMemory(_vm->_fontManager._font); + _vm->_fontManager->_font = _vm->_globals.freeMemory(_vm->_fontManager->_font); Common::String filename = "STFONT.SPR"; Common::File f; if (!f.exists(filename)) filename = "FONTE.SPR"; // Used by the BeOS and OS/2 versions as an alternative - _vm->_fontManager._font = _vm->_fileManager->loadFile(filename); - _vm->_fontManager._fontFixedWidth = 8; - _vm->_fontManager._fontFixedHeight = 8; + _vm->_fontManager->_font = _vm->_fileManager->loadFile(filename); + _vm->_fontManager->_fontFixedWidth = 8; + _vm->_fontManager->_fontFixedHeight = 8; _vm->_graphicsManager.loadImage("WINTEXT"); _vm->_graphicsManager.fadeInLong(); @@ -405,7 +405,7 @@ void ComputerManager::displayMessage(int xp, int yp, int textIdx) { bool oldMouseFlag = _vm->_eventsManager->_mouseFl; _vm->_eventsManager->_mouseFl = false; - _vm->_fontManager.displayTextVesa(xp, yp, "_", 252); + _vm->_fontManager->displayTextVesa(xp, yp, "_", 252); do { curChar = _vm->_eventsManager->waitKeyPress(); if (_vm->shouldQuit()) @@ -421,28 +421,28 @@ void ComputerManager::displayMessage(int xp, int yp, int textIdx) { // BackSpace if (curChar == 8 && textIndex > 0) { _inputBuf[textIndex--] = 0; - x1 -= _vm->_fontManager._fontFixedWidth; - x2 = x1 + 2 * _vm->_fontManager._fontFixedWidth; - _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, 3 * _vm->_fontManager._fontFixedWidth, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); + x1 -= _vm->_fontManager->_fontFixedWidth; + x2 = x1 + 2 * _vm->_fontManager->_fontFixedWidth; + _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, 3 * _vm->_fontManager->_fontFixedWidth, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); _vm->_graphicsManager.addDirtyRect(x1, yp, x2, yp + 12); - _vm->_fontManager.displayTextVesa(x1, yp, "_", 252); + _vm->_fontManager->displayTextVesa(x1, yp, "_", 252); } if (mappedChar != '*') { char newChar = mappedChar; - _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, _vm->_fontManager._fontFixedWidth, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); - _vm->_graphicsManager.addDirtyRect(x1, yp, _vm->_fontManager._fontFixedWidth + x1, yp + 12); + _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, _vm->_fontManager->_fontFixedWidth, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); + _vm->_graphicsManager.addDirtyRect(x1, yp, _vm->_fontManager->_fontFixedWidth + x1, yp + 12); _inputBuf[textIndex] = newChar; Common::String charString = Common::String::format("%c_", newChar); - _vm->_fontManager.displayTextVesa(x1, yp, charString, 252); + _vm->_fontManager->displayTextVesa(x1, yp, charString, 252); ++textIndex; - x1 += _vm->_fontManager._fontFixedWidth; + x1 += _vm->_fontManager->_fontFixedWidth; } _vm->_eventsManager->refreshScreenAndEvents(); } while (textIndex != textIdx && curChar != 13); - _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, _vm->_fontManager._fontFixedWidth, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); - _vm->_graphicsManager.addDirtyRect(x1, yp, _vm->_fontManager._fontFixedWidth + x1, yp + 12); + _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, _vm->_fontManager->_fontFixedWidth, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); + _vm->_graphicsManager.addDirtyRect(x1, yp, _vm->_fontManager->_fontFixedWidth + x1, yp + 12); _vm->_eventsManager->refreshScreenAndEvents(); _inputBuf[textIndex] = 0; @@ -453,24 +453,24 @@ void ComputerManager::displayMessage(int xp, int yp, int textIdx) { * Outputs a text string */ void ComputerManager::outText(const Common::String &msg) { - _vm->_fontManager.renderTextDisplay(_textPosition.x, _textPosition.y, msg, _textColor); + _vm->_fontManager->renderTextDisplay(_textPosition.x, _textPosition.y, msg, _textColor); } /** * Outputs a text string */ void ComputerManager::outText2(const Common::String &msg) { - _vm->_fontManager.displayTextVesa(_textPosition.x, _textPosition.y, msg, _textColor); + _vm->_fontManager->displayTextVesa(_textPosition.x, _textPosition.y, msg, _textColor); } /** * Restores the scene for the FBI headquarters room */ void ComputerManager::restoreFBIRoom() { - _vm->_globals.freeMemory(_vm->_fontManager._font); - _vm->_fontManager._font = _vm->_fileManager->loadFile("FONTE3.SPR"); - _vm->_fontManager._fontFixedWidth = 12; - _vm->_fontManager._fontFixedHeight = 21; + _vm->_globals.freeMemory(_vm->_fontManager->_font); + _vm->_fontManager->_font = _vm->_fileManager->loadFile("FONTE3.SPR"); + _vm->_fontManager->_fontFixedWidth = 12; + _vm->_fontManager->_fontFixedHeight = 21; _vm->_eventsManager->_mouseFl = true; } diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 05a7e72dc6..7e3281e080 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -422,7 +422,7 @@ void DialogsManager::showInventory() { do _vm->_eventsManager->refreshScreenAndEvents(); while (!_vm->_globals._exitId && _vm->_eventsManager->getMouseButton() != 1); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); } if (_vm->_globals._exitId) { if (_vm->_globals._exitId == 2) { @@ -446,7 +446,7 @@ void DialogsManager::showInventory() { } } while (loopFl); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); if (_inventDisplayedFl) { _inventDisplayedFl = false; _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _inventX, 114, _inventWidth, _inventHeight, _vm->_graphicsManager._vesaBuffer, _inventX, 114); diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index af97e313a6..0f5135b6d1 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -458,7 +458,7 @@ void EventsManager::refreshScreenAndEvents() { if (_vm->_graphicsManager._oldScrollPosX == _vm->_graphicsManager._scrollPosX) { _vm->_graphicsManager.displayDirtyRects(); } else { - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); _vm->_graphicsManager.lockScreen(); _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaBuffer, _vm->_graphicsManager._scrollPosX, 20, SCREEN_WIDTH, 440, 0, 20); _vm->_graphicsManager.unlockScreen(); diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 38c69f4d9a..7985597f22 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -34,7 +34,8 @@ namespace Hopkins { -FontManager::FontManager() { +FontManager::FontManager(HopkinsEngine *vm) { + _vm = vm; clearAll(); } @@ -43,10 +44,6 @@ FontManager::~FontManager() { _vm->_globals.freeMemory(_zoneText); } -void FontManager::setParent(HopkinsEngine *vm) { - _vm = vm; -} - void FontManager::loadZoneText() { switch (_vm->_globals._language) { case LANG_EN: diff --git a/engines/hopkins/font.h b/engines/hopkins/font.h index 1a27efbd82..e9483bb256 100644 --- a/engines/hopkins/font.h +++ b/engines/hopkins/font.h @@ -77,9 +77,8 @@ public: TxtItem _text[12]; TxtItemList _textList[12]; - FontManager(); + FontManager(HopkinsEngine *vm); ~FontManager(); - void setParent(HopkinsEngine *vm); void clearAll(); void initData(); diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index 6b2d36151e..6c10807d8e 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -235,7 +235,7 @@ void Globals::clearAll() { _boxWidth = 0; - _vm->_fontManager.clearAll(); + _vm->_fontManager->clearAll(); initVBob(); _objectDataBuf = g_PTRNUL; diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 3108736716..1742294cdb 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -46,8 +46,8 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe _debugger = new Debugger(this); _eventsManager = new EventsManager(this); _fileManager = new FileManager(this); + _fontManager = new FontManager(this); - _fontManager.setParent(this); _globals.setParent(this); _graphicsManager.setParent(this); _linesManager.setParent(this); @@ -60,6 +60,7 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe } HopkinsEngine::~HopkinsEngine() { + delete _fontManager; delete _fileManager; delete _eventsManager; delete _debugger; @@ -1582,7 +1583,7 @@ void HopkinsEngine::initializeSystem() { _globals.clearAll(); _eventsManager->initMouseData(); - _fontManager.initData(); + _fontManager->initData(); _dialogsManager->_inventoryIcons = _fileManager->loadFile("ICONE.SPR"); _objectsManager._headSprites = _fileManager->loadFile("TETE.SPR"); @@ -2288,7 +2289,7 @@ void HopkinsEngine::drawBaseMap() { memcpy(_graphicsManager._vesaBuffer, _graphicsManager._vesaScreen, SCREEN_WIDTH * 2 * SCREEN_HEIGHT); // Write some explanatory text - _fontManager.displayText(40, 200, "ScummVM base map - select a square for different rooms", 255); + _fontManager->displayText(40, 200, "ScummVM base map - select a square for different rooms", 255); } int HopkinsEngine::handleBaseMap() { @@ -2438,7 +2439,7 @@ void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { if (!curChar) break; if (curChar > 31) - strWidth += _objectsManager.getWidth(_fontManager._font, curChar - 32); + strWidth += _objectsManager.getWidth(_fontManager->_font, curChar - 32); } int startPosX = 320 - strWidth / 2; int endPosX = strWidth + startPosX; @@ -2464,8 +2465,8 @@ void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { if (!curChar) break; if (curChar > 31) { - _graphicsManager.displayFont(_graphicsManager._vesaBuffer, _fontManager._font, startPosX, startPosY, curChar - 32, color); - startPosX += _objectsManager.getWidth(_fontManager._font, curChar - 32); + _graphicsManager.displayFont(_graphicsManager._vesaBuffer, _fontManager->_font, startPosX, startPosY, curChar - 32, color); + startPosX += _objectsManager.getWidth(_fontManager->_font, curChar - 32); } } } @@ -2533,7 +2534,7 @@ void HopkinsEngine::displayCredits() { } void HopkinsEngine::handleOceanMouseEvents() { - _fontManager.hideText(9); + _fontManager->hideText(9); if (_eventsManager->_mouseCursorId != 16) return; diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index b4385f0eb9..c751a666d4 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -148,8 +148,8 @@ public: Debugger *_debugger; EventsManager *_eventsManager; FileManager *_fileManager; + FontManager *_fontManager; - FontManager _fontManager; Globals _globals; GraphicsManager _graphicsManager; LinesManager _linesManager; diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index 1372520de6..2eaefb1a71 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -2850,7 +2850,7 @@ void LinesManager::checkZone() { _vm->_eventsManager->_mouseCursorId = 4; _vm->_eventsManager->changeMouseCursor(4); if (_vm->_globals._forceHideText) { - _vm->_fontManager.hideText(5); + _vm->_fontManager->hideText(5); _vm->_globals._forceHideText = false; return; } @@ -2862,8 +2862,8 @@ void LinesManager::checkZone() { ZONEP[zoneId]._verbFl7 || ZONEP[zoneId]._verbFl8 || ZONEP[zoneId]._verbFl9 || ZONEP[zoneId]._verbFl10) { if (_vm->_globals._oldMouseZoneId != zoneId) { - _vm->_fontManager.initTextBuffers(5, ZONEP[zoneId]._messageId, _vm->_globals._zoneFilename, 0, 430, 0, 0, 252); - _vm->_fontManager.showText(5); + _vm->_fontManager->initTextBuffers(5, ZONEP[zoneId]._messageId, _vm->_globals._zoneFilename, 0, 430, 0, 0, 252); + _vm->_fontManager->showText(5); _vm->_globals._forceHideText = true; } _vm->_globals._hotspotTextColor += 25; diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 55a50dcf98..fee2f66b0f 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -298,20 +298,20 @@ void ObjectsManager::displaySprite() { // Handle copying any background areas that text are going to be drawn on _vm->_globals._sortedDisplayCount = 0; for (int idx = 0; idx <= 10; ++idx) { - if (_vm->_fontManager._textList[idx]._enabledFl && _vm->_fontManager._text[idx]._textType != 2) { - clipX = _vm->_fontManager._textList[idx]._pos.x - 2; + if (_vm->_fontManager->_textList[idx]._enabledFl && _vm->_fontManager->_text[idx]._textType != 2) { + clipX = _vm->_fontManager->_textList[idx]._pos.x - 2; if (clipX < _vm->_graphicsManager._minX) clipX = _vm->_graphicsManager._minX; - clipY = _vm->_fontManager._textList[idx]._pos.y - 2; + clipY = _vm->_fontManager->_textList[idx]._pos.y - 2; if (clipY < _vm->_graphicsManager._minY) clipY = _vm->_graphicsManager._minY; _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, clipX, clipY, - _vm->_fontManager._textList[idx]._width + 4, _vm->_fontManager._textList[idx]._height + 4, + _vm->_fontManager->_textList[idx]._width + 4, _vm->_fontManager->_textList[idx]._height + 4, _vm->_graphicsManager._vesaBuffer, clipX, clipY); - _vm->_fontManager._textList[idx]._enabledFl = false; + _vm->_fontManager->_textList[idx]._enabledFl = false; } } @@ -450,39 +450,39 @@ void ObjectsManager::displaySprite() { // Loop to draw any on-screen text for (int idx = 0; idx <= 10; ++idx) { - if (_vm->_fontManager._text[idx]._textOnFl) { - if ((_vm->_fontManager._text[idx]._textType < 2) || (_vm->_fontManager._text[idx]._textType > 3)) - _vm->_fontManager.box(idx, - _vm->_fontManager._text[idx]._messageId, _vm->_fontManager._text[idx]._filename, - _vm->_eventsManager->_startPos.x + _vm->_fontManager._text[idx]._pos.x, _vm->_fontManager._text[idx]._pos.y); + if (_vm->_fontManager->_text[idx]._textOnFl) { + if ((_vm->_fontManager->_text[idx]._textType < 2) || (_vm->_fontManager->_text[idx]._textType > 3)) + _vm->_fontManager->box(idx, + _vm->_fontManager->_text[idx]._messageId, _vm->_fontManager->_text[idx]._filename, + _vm->_eventsManager->_startPos.x + _vm->_fontManager->_text[idx]._pos.x, _vm->_fontManager->_text[idx]._pos.y); else - _vm->_fontManager.box(idx, - _vm->_fontManager._text[idx]._messageId, _vm->_fontManager._text[idx]._filename, - _vm->_fontManager._text[idx]._pos.x, _vm->_fontManager._text[idx]._pos.y); - _vm->_fontManager._textList[idx]._enabledFl = true; + _vm->_fontManager->box(idx, + _vm->_fontManager->_text[idx]._messageId, _vm->_fontManager->_text[idx]._filename, + _vm->_fontManager->_text[idx]._pos.x, _vm->_fontManager->_text[idx]._pos.y); + _vm->_fontManager->_textList[idx]._enabledFl = true; - if ((_vm->_fontManager._text[idx]._textType < 2) || (_vm->_fontManager._text[idx]._textType > 3)) - _vm->_fontManager._textList[idx]._pos.x = _vm->_eventsManager->_startPos.x + _vm->_fontManager._text[idx]._pos.x; + if ((_vm->_fontManager->_text[idx]._textType < 2) || (_vm->_fontManager->_text[idx]._textType > 3)) + _vm->_fontManager->_textList[idx]._pos.x = _vm->_eventsManager->_startPos.x + _vm->_fontManager->_text[idx]._pos.x; else - _vm->_fontManager._textList[idx]._pos.x = _vm->_fontManager._text[idx]._pos.x; + _vm->_fontManager->_textList[idx]._pos.x = _vm->_fontManager->_text[idx]._pos.x; - _vm->_fontManager._textList[idx]._pos.y = _vm->_fontManager._text[idx]._pos.y; - _vm->_fontManager._textList[idx]._width = _vm->_fontManager._text[idx]._width; - _vm->_fontManager._textList[idx]._height = _vm->_fontManager._text[idx]._height; + _vm->_fontManager->_textList[idx]._pos.y = _vm->_fontManager->_text[idx]._pos.y; + _vm->_fontManager->_textList[idx]._width = _vm->_fontManager->_text[idx]._width; + _vm->_fontManager->_textList[idx]._height = _vm->_fontManager->_text[idx]._height; - if (_vm->_fontManager._textList[idx]._pos.x < _vm->_graphicsManager._minX) - _vm->_fontManager._textList[idx]._pos.x = _vm->_graphicsManager._minX - 1; - if (_vm->_fontManager._textList[idx]._pos.y < _vm->_graphicsManager._minY) - _vm->_fontManager._textList[idx]._pos.y = _vm->_graphicsManager._minY - 1; + if (_vm->_fontManager->_textList[idx]._pos.x < _vm->_graphicsManager._minX) + _vm->_fontManager->_textList[idx]._pos.x = _vm->_graphicsManager._minX - 1; + if (_vm->_fontManager->_textList[idx]._pos.y < _vm->_graphicsManager._minY) + _vm->_fontManager->_textList[idx]._pos.y = _vm->_graphicsManager._minY - 1; - int posX = _vm->_fontManager._textList[idx]._pos.x; - if (_vm->_fontManager._textList[idx]._width + posX > _vm->_graphicsManager._maxX) - _vm->_fontManager._textList[idx]._width = _vm->_graphicsManager._maxX - posX; - int posY = _vm->_fontManager._textList[idx]._pos.y; - if (_vm->_fontManager._textList[idx]._height + posY > _vm->_graphicsManager._maxY) - _vm->_fontManager._textList[idx]._height = _vm->_graphicsManager._maxY - posY; - if (_vm->_fontManager._textList[idx]._width <= 0 || _vm->_fontManager._textList[idx]._height <= 0) - _vm->_fontManager._textList[idx]._enabledFl = false; + int posX = _vm->_fontManager->_textList[idx]._pos.x; + if (_vm->_fontManager->_textList[idx]._width + posX > _vm->_graphicsManager._maxX) + _vm->_fontManager->_textList[idx]._width = _vm->_graphicsManager._maxX - posX; + int posY = _vm->_fontManager->_textList[idx]._pos.y; + if (_vm->_fontManager->_textList[idx]._height + posY > _vm->_graphicsManager._maxY) + _vm->_fontManager->_textList[idx]._height = _vm->_graphicsManager._maxY - posY; + if (_vm->_fontManager->_textList[idx]._width <= 0 || _vm->_fontManager->_textList[idx]._height <= 0) + _vm->_fontManager->_textList[idx]._enabledFl = false; } } @@ -1819,7 +1819,7 @@ void ObjectsManager::handleCityMap() { * Handle Left button */ void ObjectsManager::handleLeftButton() { - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); int destX = _vm->_eventsManager->getMouseX(); int destY = _vm->_eventsManager->getMouseY(); @@ -1943,7 +1943,7 @@ void ObjectsManager::handleLeftButton() { _vm->_globals._saveData->_data[svLastObjectIndex] = _curObjectIndex; _vm->_globals._actionMoveTo = true; } - _vm->_fontManager.hideText(5); + _vm->_fontManager->hideText(5); _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); if (_vm->_globals._screenId == 20 && _vm->_globals._saveData->_data[svField132] == 1 && _curObjectIndex == 20 && _zoneNum == 12 @@ -1958,7 +1958,7 @@ void ObjectsManager::handleLeftButton() { void ObjectsManager::PARADISE() { char result = _vm->_globals._saveData->_data[svLastMouseCursor]; if (result && _vm->_globals._saveData->_data[svLastZoneNum] && result != 4 && result > 3) { - _vm->_fontManager.hideText(5); + _vm->_fontManager->hideText(5); if (!_forestFl || _zoneNum < 20 || _zoneNum > 23) { if (_vm->_graphicsManager._largeScreenFl) { _vm->_graphicsManager._scrollStatus = 2; @@ -2048,8 +2048,8 @@ void ObjectsManager::PARADISE() { void ObjectsManager::clearScreen() { clearSprite(); _vm->_graphicsManager.endDisplayBob(); - _vm->_fontManager.hideText(5); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(5); + _vm->_fontManager->hideText(9); _vm->_globals.clearVBob(); _vm->_animationManager->clearAnim(); _vm->_linesManager.clearAllZones(); @@ -3214,11 +3214,11 @@ void ObjectsManager::sceneSpecialIni() { for (int i = 0; i <= 4; i++) _vm->_eventsManager->refreshScreenAndEvents(); VBOB(_vm->_globals.SPRITE_ECRAN, 5, 15, 28, 1); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { - _vm->_fontManager.initTextBuffers(9, 383, _vm->_globals._textFilename, 220, 72, 6, 36, 253); - _vm->_fontManager.showText(9); + _vm->_fontManager->initTextBuffers(9, 383, _vm->_globals._textFilename, 220, 72, 6, 36, 253); + _vm->_fontManager->showText(9); displayedTxtFl = true; } if (!_vm->_soundManager._voiceOffFl) @@ -3230,7 +3230,7 @@ void ObjectsManager::sceneSpecialIni() { for (int i = 0; i <= 199; i++) _vm->_eventsManager->refreshScreenAndEvents(); } - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); VBOB_OFF(5); for (int i = 0; i <= 3; i++) _vm->_eventsManager->refreshScreenAndEvents(); diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 41870ee15c..20bc7decc1 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -136,18 +136,18 @@ int ScriptManager::handleOpcode(byte *dataP) { if (!_vm->_soundManager._textOffFl) { int textPosX = READ_LE_INT16(dataP + 9); int textPosY = READ_LE_INT16(dataP + 11); - _vm->_fontManager.initTextBuffers(9, mesgId, _vm->_globals._textFilename, 2 * textPosX, 2 * textPosY + 40, 6, dataP[7], 253); - _vm->_fontManager.showText(9); + _vm->_fontManager->initTextBuffers(9, mesgId, _vm->_globals._textFilename, 2 * textPosX, 2 * textPosY + 40, 6, dataP[7], 253); + _vm->_fontManager->showText(9); displayedTxtFl = true; } if (!_vm->_soundManager._voiceOffFl) _vm->_soundManager.mixVoice(mesgId, 4, displayedTxtFl); } else { // if (_tempObjectFl) if (_vm->_globals._saveData->_data[svField356]) { - _vm->_fontManager.initTextBuffers(9, 635, _vm->_globals._textFilename, 55, 20, dataP[8], 35, 253); + _vm->_fontManager->initTextBuffers(9, 635, _vm->_globals._textFilename, 55, 20, dataP[8], 35, 253); bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { - _vm->_fontManager.showText(9); + _vm->_fontManager->showText(9); displayedTxtFl = true; } @@ -156,16 +156,16 @@ int ScriptManager::handleOpcode(byte *dataP) { } else { int textPosX = READ_LE_INT16(dataP + 9); if (_vm->_globals._language == LANG_FR && !_vm->_soundManager._textOffFl) - _vm->_fontManager.initTextBuffers(9, mesgId, "OBJET1.TXT", 2 * textPosX, 60, 6, dataP[7], 253); + _vm->_fontManager->initTextBuffers(9, mesgId, "OBJET1.TXT", 2 * textPosX, 60, 6, dataP[7], 253); else if (_vm->_globals._language == LANG_EN && !_vm->_soundManager._textOffFl) - _vm->_fontManager.initTextBuffers(9, mesgId, "OBJETAN.TXT", 2 * textPosX, 60, 6, dataP[7], 253); + _vm->_fontManager->initTextBuffers(9, mesgId, "OBJETAN.TXT", 2 * textPosX, 60, 6, dataP[7], 253); else if (_vm->_globals._language == LANG_SP && !_vm->_soundManager._textOffFl) { - _vm->_fontManager.initTextBuffers(9, mesgId, "OBJETES.TXT", 2 * textPosX, 60, 6, dataP[7], 253); + _vm->_fontManager->initTextBuffers(9, mesgId, "OBJETES.TXT", 2 * textPosX, 60, 6, dataP[7], 253); } bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { - _vm->_fontManager.showText(9); + _vm->_fontManager->showText(9); displayedTxtFl = true; } @@ -537,7 +537,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 12: - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); _vm->_eventsManager->refreshScreenAndEvents(); _vm->_eventsManager->refreshScreenAndEvents(); _vm->_talkManager.startAnimatedCharacterDialogue("bqetueur.pe2"); @@ -549,8 +549,8 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_graphicsManager.fadeOutLong(); _vm->_globals.disableHiding(); _vm->_objectsManager.removeSprite(0); - _vm->_fontManager.hideText(5); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(5); + _vm->_fontManager->hideText(9); _vm->_graphicsManager.endDisplayBob(); _vm->_objectsManager.clearScreen(); @@ -895,8 +895,8 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_graphicsManager.fadeOutLong(); _vm->_globals.disableHiding(); _vm->_objectsManager.removeSprite(0); - _vm->_fontManager.hideText(5); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(5); + _vm->_fontManager->hideText(9); _vm->_graphicsManager.endDisplayBob(); _vm->_graphicsManager.loadImage("IM20f"); _vm->_animationManager->loadAnim("ANIM20f"); @@ -2234,11 +2234,11 @@ int ScriptManager::handleOpcode(byte *dataP) { } while (_vm->_objectsManager.getBobAnimDataIdx(1) != 32); _vm->_objectsManager.stopBobAnimation(1); _vm->_objectsManager.setBobAnimation(2); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { - _vm->_fontManager.initTextBuffers(9, 617, _vm->_globals._textFilename, 91, 41, 3, 30, 253); - _vm->_fontManager.showText(9); + _vm->_fontManager->initTextBuffers(9, 617, _vm->_globals._textFilename, 91, 41, 3, 30, 253); + _vm->_fontManager->showText(9); displayedTxtFl = true; } if (!_vm->_soundManager._voiceOffFl) diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 05ad3e2190..ccbaf9e5e2 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -52,8 +52,8 @@ void TalkManager::setParent(HopkinsEngine *vm) { void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) { Common::String spriteFilename; - _vm->_fontManager.hideText(5); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(5); + _vm->_fontManager->hideText(9); _vm->_eventsManager->refreshScreenAndEvents(); _vm->_graphicsManager._scrollStatus = 1; bool oldDisableInventFl = _vm->_globals._disableInventFl; @@ -256,33 +256,33 @@ int TalkManager::dialogQuestion(bool animatedFl) { int sentence2PosY = sentence3PosY - 20 * sentence2LineNumb; int sentence1PosY = sentence2PosY - 20 * sentence1LineNumb; - _vm->_fontManager.initTextBuffers(5, _dialogueMesgId1, _questionsFilename, 5, sentence1PosY, 0, 65, 255); - _vm->_fontManager.initTextBuffers(6, _dialogueMesgId2, _questionsFilename, 5, sentence2PosY, 0, 65, 255); - _vm->_fontManager.initTextBuffers(7, _dialogueMesgId3, _questionsFilename, 5, sentence3PosY, 0, 65, 255); - _vm->_fontManager.initTextBuffers(8, _dialogueMesgId4, _questionsFilename, 5, sentence4PosY, 0, 65, 255); - _vm->_fontManager.showText(5); - _vm->_fontManager.showText(6); - _vm->_fontManager.showText(7); - _vm->_fontManager.showText(8); + _vm->_fontManager->initTextBuffers(5, _dialogueMesgId1, _questionsFilename, 5, sentence1PosY, 0, 65, 255); + _vm->_fontManager->initTextBuffers(6, _dialogueMesgId2, _questionsFilename, 5, sentence2PosY, 0, 65, 255); + _vm->_fontManager->initTextBuffers(7, _dialogueMesgId3, _questionsFilename, 5, sentence3PosY, 0, 65, 255); + _vm->_fontManager->initTextBuffers(8, _dialogueMesgId4, _questionsFilename, 5, sentence4PosY, 0, 65, 255); + _vm->_fontManager->showText(5); + _vm->_fontManager->showText(6); + _vm->_fontManager->showText(7); + _vm->_fontManager->showText(8); int retVal = -1; bool loopCond = false; do { int mousePosY = _vm->_eventsManager->getMouseY(); if (sentence1PosY < mousePosY && mousePosY < (sentence2PosY - 1)) { - _vm->_fontManager.setOptimalColor(6, 7, 8, 5); + _vm->_fontManager->setOptimalColor(6, 7, 8, 5); retVal = _dialogueMesgId1; } if (sentence2PosY < mousePosY && mousePosY < (sentence3PosY - 1)) { - _vm->_fontManager.setOptimalColor(5, 7, 8, 6); + _vm->_fontManager->setOptimalColor(5, 7, 8, 6); retVal = _dialogueMesgId2; } if (sentence3PosY < mousePosY && mousePosY < (sentence4PosY - 1)) { - _vm->_fontManager.setOptimalColor(5, 6, 8, 7); + _vm->_fontManager->setOptimalColor(5, 6, 8, 7); retVal = _dialogueMesgId3; } if (sentence4PosY < mousePosY && mousePosY < 419) { - _vm->_fontManager.setOptimalColor(5, 6, 7, 8); + _vm->_fontManager->setOptimalColor(5, 6, 7, 8); retVal = _dialogueMesgId4; } @@ -294,10 +294,10 @@ int TalkManager::dialogQuestion(bool animatedFl) { } while (!_vm->shouldQuit() && !loopCond); _vm->_soundManager.mixVoice(retVal, 1); - _vm->_fontManager.hideText(5); - _vm->_fontManager.hideText(6); - _vm->_fontManager.hideText(7); - _vm->_fontManager.hideText(8); + _vm->_fontManager->hideText(5); + _vm->_fontManager->hideText(6); + _vm->_fontManager->hideText(7); + _vm->_fontManager->hideText(8); if (animatedFl) { uint16 *bufPtr = (uint16 *)_characterBuffer + 48; @@ -380,8 +380,8 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) { bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { - _vm->_fontManager.initTextBuffers(9, mesgId, _answersFilename, mesgPosX, mesgPosY, 5, mesgLength, 252); - _vm->_fontManager.showText(9); + _vm->_fontManager->initTextBuffers(9, mesgId, _answersFilename, mesgPosX, mesgPosY, 5, mesgLength, 252); + _vm->_fontManager->showText(9); displayedTxtFl = true; } if (!_vm->_soundManager.mixVoice(mesgId, 1, displayedTxtFl)) { @@ -404,7 +404,7 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) { } if (!_vm->_soundManager._textOffFl) - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(9); if (animatedFl) { uint16 *bufPtr = (uint16 *)_characterBuffer + 43; int curVal = READ_LE_INT16(bufPtr); @@ -506,7 +506,7 @@ void TalkManager::dialogEndTalk() { } int TalkManager::countBoxLines(int idx, const Common::String &file) { - _vm->_fontManager._fontFixedWidth = 11; + _vm->_fontManager->_fontFixedWidth = 11; // Build up the filename Common::String filename; @@ -964,8 +964,8 @@ void TalkManager::REPONSE2(int zone, int verb) { } void TalkManager::animateObject(const Common::String &filename) { - _vm->_fontManager.hideText(5); - _vm->_fontManager.hideText(9); + _vm->_fontManager->hideText(5); + _vm->_fontManager->hideText(9); _vm->_eventsManager->refreshScreenAndEvents(); _vm->_graphicsManager._scrollStatus = 1; _vm->_linesManager.clearAllZones(); -- cgit v1.2.3