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.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index 7985597f22..4885ccd46e 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -40,12 +40,12 @@ FontManager::FontManager(HopkinsEngine *vm) {
}
FontManager::~FontManager() {
- _vm->_globals.freeMemory(_font);
- _vm->_globals.freeMemory(_zoneText);
+ _vm->_globals->freeMemory(_font);
+ _vm->_globals->freeMemory(_zoneText);
}
void FontManager::loadZoneText() {
- switch (_vm->_globals._language) {
+ switch (_vm->_globals->_language) {
case LANG_EN:
_zoneText = _vm->_fileManager->loadFile("ZONEAN.TXT");
break;
@@ -103,7 +103,7 @@ void FontManager::showText(int idx) {
txt._textOnFl = true;
txt._textLoadedFl = false;
- txt._textBlock = _vm->_globals.freeMemory(txt._textBlock);
+ txt._textBlock = _vm->_globals->freeMemory(txt._textBlock);
}
/**
@@ -116,7 +116,7 @@ void FontManager::hideText(int idx) {
TxtItem &txt = _text[idx - 5];
txt._textOnFl = false;
txt._textLoadedFl = false;
- txt._textBlock = _vm->_globals.freeMemory(txt._textBlock);
+ txt._textBlock = _vm->_globals->freeMemory(txt._textBlock);
}
/**
@@ -160,7 +160,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
error("Bad number for text");
_fontFixedWidth = 11;
- _vm->_globals._boxWidth = 11 * _text[idx]._length;
+ _vm->_globals->_boxWidth = 11 * _text[idx]._length;
if (_text[idx]._textLoadedFl) {
int textType = _text[idx]._textType;
if (textType != 6 && textType != 1 && textType != 3 && textType != 5) {
@@ -211,7 +211,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
bufSize = 2048;
f.seek(_index[messageId]);
- _tempText = _vm->_globals.allocMemory(2058);
+ _tempText = _vm->_globals->allocMemory(2058);
if (_tempText == g_PTRNUL)
error("Error allocating text");
@@ -220,7 +220,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
f.close();
} else {
bufSize = 100;
- _tempText = _vm->_globals.allocMemory(110);
+ _tempText = _vm->_globals->allocMemory(110);
Common::fill(&_tempText[0], &_tempText[110], 0);
memcpy(_tempText, _zoneText + _index[messageId], 96);
WRITE_LE_UINT16((uint16 *)_tempText + 48, READ_LE_INT16(_zoneText + _index[messageId] + 96));
@@ -254,29 +254,29 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
if (bufSize && bufSize > textLength) {
_text[idx]._length = textLength;
- _vm->_globals._boxWidth = 0;
+ _vm->_globals->_boxWidth = 0;
for (int curStrIdx = 0; curStrIdx < textLength + 1; curStrIdx++) {
byte curChar = _tempText[curStrIdx];
if (curChar <= 31)
curChar = ' ';
- _vm->_globals._boxWidth += _vm->_objectsManager.getWidth(_font, curChar - 32);
+ _vm->_globals->_boxWidth += _vm->_objectsManager.getWidth(_font, curChar - 32);
}
- _vm->_globals._boxWidth += 2;
- _text[idx]._pos.x = 320 - abs(_vm->_globals._boxWidth / 2);
+ _vm->_globals->_boxWidth += 2;
+ _text[idx]._pos.x = 320 - abs(_vm->_globals->_boxWidth / 2);
textPosX = _vm->_eventsManager->_startPos.x + _text[idx]._pos.x;
lineCount = 1;
_text[idx]._lines[0] = Common::String((const char *)_tempText, textLength);
} else {
- if (!_vm->_globals._boxWidth)
- _vm->_globals._boxWidth = 240;
+ if (!_vm->_globals->_boxWidth)
+ _vm->_globals->_boxWidth = 240;
int tempTextIdx = 0;
int lineSize;
byte curChar;
do {
int curLineSize = 0;
- int ptrb = _vm->_globals._boxWidth - 4;
+ int ptrb = _vm->_globals->_boxWidth - 4;
for (;;) {
lineSize = curLineSize;
do
@@ -330,12 +330,12 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
for (int i = 0; i <= 19; i++) {
if (_textSortArray[i])
- _vm->_globals._boxWidth = _textSortArray[i];
+ _vm->_globals->_boxWidth = _textSortArray[i];
}
if ((_text[idx]._textType < 2) || (_text[idx]._textType > 3)) {
int i;
- for (i = xp - _vm->_eventsManager->_startPos.x; _vm->_globals._boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2)
+ for (i = xp - _vm->_eventsManager->_startPos.x; _vm->_globals->_boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2)
;
_text[idx]._pos.x = i;
textPosX = _vm->_eventsManager->_startPos.x + i;
@@ -345,7 +345,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
}
int posX = textPosX;
int posY = yp;
- int saveWidth = _vm->_globals._boxWidth + 10;
+ int saveWidth = _vm->_globals->_boxWidth + 10;
int saveHeight = (_fontFixedHeight + 1) * lineCount + 12;
if (_text[idx]._textType == 6) {
_text[idx]._pos.x = 315 - abs(saveWidth / 2);
@@ -355,14 +355,14 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
int textType = _text[idx]._textType;
if (textType == 1 || textType == 3 || textType == 5 || textType == 6) {
int size = saveHeight * saveWidth;
- byte *ptrd = _vm->_globals.allocMemory(size);
+ byte *ptrd = _vm->_globals->allocMemory(size);
if (ptrd == g_PTRNUL)
error("Cutting a block for text box (%d)", size);
_vm->_graphicsManager.copySurfaceRect(_vm->_graphicsManager._vesaBuffer, ptrd, posX, posY, saveWidth, saveHeight);
_vm->_graphicsManager.Trans_bloc2(ptrd, _vm->_graphicsManager._colorTable, size);
_vm->_graphicsManager.restoreSurfaceRect(_vm->_graphicsManager._vesaBuffer, ptrd, posX, posY, saveWidth, saveHeight);
- _vm->_globals.freeMemory(ptrd);
+ _vm->_globals->freeMemory(ptrd);
_vm->_graphicsManager.drawHorizontalLine(_vm->_graphicsManager._vesaBuffer, posX, posY, saveWidth, (byte)-2);
_vm->_graphicsManager.drawHorizontalLine(_vm->_graphicsManager._vesaBuffer, posX, saveHeight + posY, saveWidth, (byte)-2);
@@ -384,9 +384,9 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
_text[idx]._height = blockHeight;
textType = _text[idx]._textType;
if (textType == 6 || textType == 1 || textType == 3 || textType == 5) {
- _text[idx]._textBlock = _vm->_globals.freeMemory(_text[idx]._textBlock);
+ _text[idx]._textBlock = _vm->_globals->freeMemory(_text[idx]._textBlock);
int blockSize = blockHeight * blockWidth;
- byte *ptre = _vm->_globals.allocMemory(blockSize + 20);
+ byte *ptre = _vm->_globals->allocMemory(blockSize + 20);
if (ptre == g_PTRNUL)
error("Cutting a block for text box (%d)", blockSize);
@@ -395,7 +395,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
_text[idx]._height = blockHeight;
_vm->_graphicsManager.copySurfaceRect(_vm->_graphicsManager._vesaBuffer, _text[idx]._textBlock, posX, posY, _text[idx]._width, blockHeight);
}
- _tempText = _vm->_globals.freeMemory(_tempText);
+ _tempText = _vm->_globals->freeMemory(_tempText);
}
}
@@ -478,12 +478,12 @@ void FontManager::renderTextDisplay(int xp, int yp, const Common::String &msg, i
charEndPosX += charWidth;
_vm->_graphicsManager.addDirtyRect(charStartPosX, yp, charEndPosX, yp + 12);
if (_vm->_eventsManager->_escKeyFl) {
- _vm->_globals.iRegul = 1;
+ _vm->_globals->iRegul = 1;
_vm->_eventsManager->refreshScreenAndEvents();
} else {
- _vm->_globals.iRegul = 4;
+ _vm->_globals->iRegul = 4;
_vm->_eventsManager->refreshScreenAndEvents();
- _vm->_globals.iRegul = 1;
+ _vm->_globals->iRegul = 1;
}
}
curChar = *srcP++;