aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hopkins/font.cpp')
-rw-r--r--engines/hopkins/font.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index 7765c5c579..611327e9a8 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -47,13 +47,13 @@ FontManager::~FontManager() {
void FontManager::loadZoneText() {
switch (_vm->_globals->_language) {
case LANG_EN:
- _zoneText = _vm->_fileManager->loadFile("ZONEAN.TXT");
+ _zoneText = _vm->_fileIO->loadFile("ZONEAN.TXT");
break;
case LANG_FR:
- _zoneText = _vm->_fileManager->loadFile("ZONE01.TXT");
+ _zoneText = _vm->_fileIO->loadFile("ZONE01.TXT");
break;
case LANG_SP:
- _zoneText = _vm->_fileManager->loadFile("ZONEES.TXT");
+ _zoneText = _vm->_fileIO->loadFile("ZONEES.TXT");
break;
}
}
@@ -89,7 +89,7 @@ void FontManager::clearAll() {
}
void FontManager::initData() {
- _font = _vm->_fileManager->loadFile("FONTE3.SPR");
+ _font = _vm->_fileIO->loadFile("FONTE3.SPR");
_fontFixedWidth = 12;
_fontFixedHeight = 21;
loadZoneText();
@@ -174,14 +174,14 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
} else {
int height = _text[idx]._height;
int width = _text[idx]._width;
- _vm->_graphicsManager->restoreSurfaceRect(
- _vm->_graphicsManager->_frontBuffer,
+ _vm->_graphicsMan->restoreSurfaceRect(
+ _vm->_graphicsMan->_frontBuffer,
_text[idx]._textBlock,
xp,
yp,
_text[idx]._width,
_text[idx]._height);
- _vm->_graphicsManager->addDirtyRect(xp, yp, xp + width, yp + height);
+ _vm->_graphicsMan->addDirtyRect(xp, yp, xp + width, yp + height);
}
} else {
int lineCount = 0;
@@ -262,12 +262,12 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
byte curChar = _tempText[curStrIdx];
if (curChar <= 31)
curChar = ' ';
- _boxWidth += _vm->_objectsManager->getWidth(_font, curChar - 32);
+ _boxWidth += _vm->_objectsMan->getWidth(_font, curChar - 32);
}
_boxWidth += 2;
_text[idx]._pos.x = 320 - abs(_boxWidth / 2);
- textPosX = _vm->_eventsManager->_startPos.x + _text[idx]._pos.x;
+ textPosX = _vm->_events->_startPos.x + _text[idx]._pos.x;
lineCount = 1;
_text[idx]._lines[0] = Common::String((const char *)_tempText, textLength);
} else {
@@ -318,7 +318,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
byte curChar2 = (curIdx >= (int)line.size()) ? '\0' : line.c_str()[curIdx];
if (curChar2 <= 31)
curChar2 = ' ';
- ptrc += _vm->_objectsManager->getWidth(_font, (byte)curChar2 - 32);
+ ptrc += _vm->_objectsMan->getWidth(_font, (byte)curChar2 - 32);
}
_textSortArray[i] = ptrc;
}
@@ -337,10 +337,10 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
if ((_text[idx]._textType < 2) || (_text[idx]._textType > 3)) {
int i;
- for (i = xp - _vm->_eventsManager->_startPos.x; _boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2)
+ for (i = xp - _vm->_events->_startPos.x; _boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2)
;
_text[idx]._pos.x = i;
- textPosX = _vm->_eventsManager->_startPos.x + i;
+ textPosX = _vm->_events->_startPos.x + i;
} else {
_text[idx]._pos.x = textPosX;
}
@@ -351,7 +351,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
int saveHeight = (_fontFixedHeight + 1) * lineCount + 12;
if (_text[idx]._textType == 6) {
_text[idx]._pos.x = 315 - abs(saveWidth / 2);
- textPosX = posX = _vm->_eventsManager->_startPos.x + _text[idx]._pos.x;
+ textPosX = posX = _vm->_events->_startPos.x + _text[idx]._pos.x;
_text[idx]._pos.y = posY = 50;
}
int textType = _text[idx]._textType;
@@ -361,15 +361,15 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
if (ptrd == NULL)
error("Cutting a block for text box (%d)", size);
- _vm->_graphicsManager->copySurfaceRect(_vm->_graphicsManager->_frontBuffer, ptrd, posX, posY, saveWidth, saveHeight);
- _vm->_graphicsManager->fillSurface(ptrd, _vm->_graphicsManager->_colorTable, size);
- _vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, ptrd, posX, posY, saveWidth, saveHeight);
+ _vm->_graphicsMan->copySurfaceRect(_vm->_graphicsMan->_frontBuffer, ptrd, posX, posY, saveWidth, saveHeight);
+ _vm->_graphicsMan->fillSurface(ptrd, _vm->_graphicsMan->_colorTable, size);
+ _vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, ptrd, posX, posY, saveWidth, saveHeight);
_vm->_globals->freeMemory(ptrd);
- _vm->_graphicsManager->drawHorizontalLine(_vm->_graphicsManager->_frontBuffer, posX, posY, saveWidth, (byte)-2);
- _vm->_graphicsManager->drawHorizontalLine(_vm->_graphicsManager->_frontBuffer, posX, saveHeight + posY, saveWidth, (byte)-2);
- _vm->_graphicsManager->drawVerticalLine(_vm->_graphicsManager->_frontBuffer, posX, posY, saveHeight, (byte)-2);
- _vm->_graphicsManager->drawVerticalLine(_vm->_graphicsManager->_frontBuffer, saveWidth + posX, posY, saveHeight, (byte)-2);
+ _vm->_graphicsMan->drawHorizontalLine(_vm->_graphicsMan->_frontBuffer, posX, posY, saveWidth, (byte)-2);
+ _vm->_graphicsMan->drawHorizontalLine(_vm->_graphicsMan->_frontBuffer, posX, saveHeight + posY, saveWidth, (byte)-2);
+ _vm->_graphicsMan->drawVerticalLine(_vm->_graphicsMan->_frontBuffer, posX, posY, saveHeight, (byte)-2);
+ _vm->_graphicsMan->drawVerticalLine(_vm->_graphicsMan->_frontBuffer, saveWidth + posX, posY, saveHeight, (byte)-2);
}
_text[idx]._lineCount = lineCount;
int textPosY = posY + 5;
@@ -395,7 +395,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
_text[idx]._textBlock = ptre;
_text[idx]._width = blockWidth;
_text[idx]._height = blockHeight;
- _vm->_graphicsManager->copySurfaceRect(_vm->_graphicsManager->_frontBuffer, _text[idx]._textBlock, posX, posY, _text[idx]._width, blockHeight);
+ _vm->_graphicsMan->copySurfaceRect(_vm->_graphicsMan->_frontBuffer, _text[idx]._textBlock, posX, posY, _text[idx]._width, blockHeight);
}
_tempText = _vm->_globals->freeMemory(_tempText);
}
@@ -415,12 +415,12 @@ void FontManager::displayTextVesa(int xp, int yp, const Common::String &message,
break;
if (currChar >= 32) {
charIndex = currChar - 32;
- _vm->_graphicsManager->displayFont(_vm->_graphicsManager->_frontBuffer, _font, currentX, yp, currChar - 32, col);
- currentX += _vm->_objectsManager->getWidth(_font, charIndex);
+ _vm->_graphicsMan->displayFont(_vm->_graphicsMan->_frontBuffer, _font, currentX, yp, currChar - 32, col);
+ currentX += _vm->_objectsMan->getWidth(_font, charIndex);
}
}
- _vm->_graphicsManager->addDirtyRect(xp, yp, currentX, yp + 12);
+ _vm->_graphicsMan->addDirtyRect(xp, yp, currentX, yp + 12);
}
/**
@@ -432,8 +432,8 @@ void FontManager::displayText(int xp, int yp, const Common::String &message, int
if (currentChar > 31) {
int characterIndex = currentChar - 32;
- _vm->_graphicsManager->displayFont(_vm->_graphicsManager->_frontBuffer, _font, xp, yp, characterIndex, col);
- xp += _vm->_objectsManager->getWidth(_font, characterIndex);
+ _vm->_graphicsMan->displayFont(_vm->_graphicsMan->_frontBuffer, _font, xp, yp, characterIndex, col);
+ xp += _vm->_objectsMan->getWidth(_font, characterIndex);
}
}
}
@@ -459,7 +459,7 @@ void FontManager::renderTextDisplay(int xp, int yp, const Common::String &msg, i
break;
if (curChar >= 32) {
byte printChar = curChar - 32;
- _vm->_graphicsManager->displayFont(_vm->_graphicsManager->_frontBuffer, _font, charEndPosX, yp, printChar, fontCol);
+ _vm->_graphicsMan->displayFont(_vm->_graphicsMan->_frontBuffer, _font, charEndPosX, yp, printChar, fontCol);
// UGLY HACK: For some obscure reason, the BeOS and OS/2 versions use another font file, which doesn't have variable width.
// All the fonts have a length of 9, which results in completely broken text in the computer.
@@ -468,23 +468,23 @@ void FontManager::renderTextDisplay(int xp, int yp, const Common::String &msg, i
int charWidth;
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) {
if ((curChar >= 'A' && curChar <= 'Z') || (curChar >= 'a' && curChar <= 'z' && curChar != 'm' && curChar != 'w') || (curChar >= '0' && curChar <= '9') || curChar == '*' || (curChar >= 128 && curChar <= 168))
- charWidth = _vm->_objectsManager->getWidth(_font, printChar) - 1;
+ charWidth = _vm->_objectsMan->getWidth(_font, printChar) - 1;
else if (curChar == 'm' || curChar == 'w')
- charWidth = _vm->_objectsManager->getWidth(_font, printChar);
+ charWidth = _vm->_objectsMan->getWidth(_font, printChar);
else
charWidth = 6;
} else
- charWidth = _vm->_objectsManager->getWidth(_font, printChar);
+ charWidth = _vm->_objectsMan->getWidth(_font, printChar);
int charStartPosX = charEndPosX;
charEndPosX += charWidth;
- _vm->_graphicsManager->addDirtyRect(charStartPosX, yp, charEndPosX, yp + 12);
- if (_vm->_eventsManager->_escKeyFl) {
+ _vm->_graphicsMan->addDirtyRect(charStartPosX, yp, charEndPosX, yp + 12);
+ if (_vm->_events->_escKeyFl) {
_vm->_globals->_eventMode = EVENTMODE_IGNORE;
- _vm->_eventsManager->refreshScreenAndEvents();
+ _vm->_events->refreshScreenAndEvents();
} else {
_vm->_globals->_eventMode = EVENTMODE_ALT;
- _vm->_eventsManager->refreshScreenAndEvents();
+ _vm->_events->refreshScreenAndEvents();
_vm->_globals->_eventMode = EVENTMODE_IGNORE;
}
}