HOPKINS: Make engine less verbose by reducing some object names
This commit is contained in:
parent
ef12ba27e5
commit
55938b3975
17 changed files with 3881 additions and 3881 deletions
|
@ -61,9 +61,9 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
|
|||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
_vm->_eventsManager->mouseOff();
|
||||
_vm->_events->mouseOff();
|
||||
|
||||
byte *screenP = _vm->_graphicsManager->_backBuffer;
|
||||
byte *screenP = _vm->_graphicsMan->_backBuffer;
|
||||
|
||||
Common::String tmpStr;
|
||||
// The Windows 95 demo only contains the interlaced version of the BOMBE1 and BOMBE2 videos
|
||||
|
@ -77,48 +77,48 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
|
|||
error("File not found - %s", tmpStr.c_str());
|
||||
|
||||
f.skip(6);
|
||||
f.read(_vm->_graphicsManager->_palette, 800);
|
||||
f.read(_vm->_graphicsMan->_palette, 800);
|
||||
f.skip(4);
|
||||
size_t nbytes = f.readUint32LE();
|
||||
f.skip(14);
|
||||
f.read(screenP, nbytes);
|
||||
|
||||
if (_clearAnimationFl) {
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
}
|
||||
if (skipSeqFl) {
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
} else {
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
}
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_soundManager->loadAnimSound();
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_soundMan->loadAnimSound();
|
||||
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
// Do pre-animation delay
|
||||
do {
|
||||
if (_vm->_eventsManager->_escKeyFl)
|
||||
if (_vm->_events->_escKeyFl)
|
||||
break;
|
||||
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
} while (!_vm->shouldQuit() && _vm->_eventsManager->_rateCounter < rate1);
|
||||
_vm->_events->refreshEvents();
|
||||
} while (!_vm->shouldQuit() && _vm->_events->_rateCounter < rate1);
|
||||
}
|
||||
|
||||
if (!_vm->_eventsManager->_escKeyFl) {
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
if (!_vm->_events->_escKeyFl) {
|
||||
_vm->_events->_rateCounter = 0;
|
||||
int frameNumber = 0;
|
||||
while (!_vm->shouldQuit()) {
|
||||
++frameNumber;
|
||||
_vm->_soundManager->playAnimSound(frameNumber);
|
||||
_vm->_soundMan->playAnimSound(frameNumber);
|
||||
|
||||
byte imageStr[17];
|
||||
// Read frame header
|
||||
|
@ -132,49 +132,49 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
|
|||
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
do {
|
||||
if (_vm->_eventsManager->_escKeyFl)
|
||||
if (_vm->_events->_escKeyFl)
|
||||
break;
|
||||
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
} while (!_vm->shouldQuit() && _vm->_eventsManager->_rateCounter < rate2);
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
} while (!_vm->shouldQuit() && _vm->_events->_rateCounter < rate2);
|
||||
}
|
||||
|
||||
if (!_vm->_eventsManager->_escKeyFl) {
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
if (!_vm->_events->_escKeyFl) {
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
if (*screenP != kByteStop)
|
||||
_vm->_graphicsManager->copyVideoVbe16(screenP);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->copyVideoVbe16(screenP);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_vm->_globals->_eventMode == 1 && !_vm->_eventsManager->_escKeyFl) {
|
||||
if (_vm->_globals->_eventMode == 1 && !_vm->_events->_escKeyFl) {
|
||||
// Do post-animation delay
|
||||
do {
|
||||
if (_vm->_eventsManager->_escKeyFl)
|
||||
if (_vm->_events->_escKeyFl)
|
||||
break;
|
||||
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
} while (_vm->_eventsManager->_rateCounter < rate3);
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
} while (_vm->_events->_rateCounter < rate3);
|
||||
}
|
||||
|
||||
if (!_vm->_eventsManager->_escKeyFl) {
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
if (!_vm->_events->_escKeyFl) {
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
}
|
||||
|
||||
if (_vm->_graphicsManager->_fadingFl) {
|
||||
if (_vm->_graphicsMan->_fadingFl) {
|
||||
byte *screenCopy = _vm->_globals->allocMemory(307200);
|
||||
|
||||
f.seek(6);
|
||||
f.read(_vm->_graphicsManager->_palette, 800);
|
||||
f.read(_vm->_graphicsMan->_palette, 800);
|
||||
f.skip(4);
|
||||
nbytes = f.readUint32LE();
|
||||
f.skip(14);
|
||||
|
@ -193,17 +193,17 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
|
|||
|
||||
f.read(screenP, READ_LE_UINT32(imageStr + 8));
|
||||
if (*screenP != kByteStop)
|
||||
_vm->_graphicsManager->copyWinscanVbe3(screenP, screenCopy);
|
||||
_vm->_graphicsMan->copyWinscanVbe3(screenP, screenCopy);
|
||||
}
|
||||
_vm->_graphicsManager->fadeOutDefaultLength(screenCopy);
|
||||
_vm->_graphicsMan->fadeOutDefaultLength(screenCopy);
|
||||
_vm->_globals->freeMemory(screenCopy);
|
||||
}
|
||||
|
||||
_vm->_graphicsManager->_fadingFl = false;
|
||||
_vm->_graphicsMan->_fadingFl = false;
|
||||
f.close();
|
||||
_vm->_graphicsManager->_skipVideoLockFl = false;
|
||||
_vm->_graphicsMan->_skipVideoLockFl = false;
|
||||
|
||||
_vm->_eventsManager->mouseOn();
|
||||
_vm->_events->mouseOn();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -217,63 +217,63 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u
|
|||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
_vm->_eventsManager->mouseOff();
|
||||
_vm->_events->mouseOff();
|
||||
|
||||
while (!_vm->shouldQuit()) {
|
||||
memcpy(_vm->_graphicsManager->_oldPalette, _vm->_graphicsManager->_palette, 769);
|
||||
memcpy(_vm->_graphicsMan->_oldPalette, _vm->_graphicsMan->_palette, 769);
|
||||
|
||||
_vm->_graphicsManager->backupScreen();
|
||||
_vm->_graphicsMan->backupScreen();
|
||||
|
||||
if (!_vm->_graphicsManager->_lineNbr)
|
||||
_vm->_graphicsManager->_scrollOffset = 0;
|
||||
if (!_vm->_graphicsMan->_lineNbr)
|
||||
_vm->_graphicsMan->_scrollOffset = 0;
|
||||
|
||||
screenP = _vm->_graphicsManager->_backBuffer;
|
||||
screenP = _vm->_graphicsMan->_backBuffer;
|
||||
if (!f.open(filename))
|
||||
error("Error opening file - %s", filename.c_str());
|
||||
|
||||
f.skip(6);
|
||||
f.read(_vm->_graphicsManager->_palette, 800);
|
||||
f.read(_vm->_graphicsMan->_palette, 800);
|
||||
f.skip(4);
|
||||
size_t nbytes = f.readUint32LE();
|
||||
f.skip(14);
|
||||
|
||||
f.read(screenP, nbytes);
|
||||
|
||||
_vm->_graphicsManager->clearPalette();
|
||||
oldScrollPosX = _vm->_graphicsManager->_scrollPosX;
|
||||
_vm->_graphicsManager->setScreenWidth(SCREEN_WIDTH);
|
||||
_vm->_graphicsManager->scrollScreen(0);
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsManager->_maxX = SCREEN_WIDTH;
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->clearPalette();
|
||||
oldScrollPosX = _vm->_graphicsMan->_scrollPosX;
|
||||
_vm->_graphicsMan->setScreenWidth(SCREEN_WIDTH);
|
||||
_vm->_graphicsMan->scrollScreen(0);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
_vm->_graphicsMan->_maxX = SCREEN_WIDTH;
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_soundManager->loadAnimSound();
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_soundMan->loadAnimSound();
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
while (!_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate1) {
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
while (!_vm->_events->_escKeyFl && _vm->_events->_rateCounter < rate1) {
|
||||
_vm->_events->refreshEvents();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_vm->_eventsManager->_escKeyFl) {
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
if (!_vm->_events->_escKeyFl) {
|
||||
_vm->_events->_rateCounter = 0;
|
||||
int frameNumber = 0;
|
||||
for (;;) {
|
||||
if (_vm->_eventsManager->_escKeyFl)
|
||||
if (_vm->_events->_escKeyFl)
|
||||
break;
|
||||
++frameNumber;
|
||||
_vm->_soundManager->playAnimSound(frameNumber);
|
||||
_vm->_soundMan->playAnimSound(frameNumber);
|
||||
byte imageStr[17];
|
||||
if (f.read(imageStr, 16) != 16)
|
||||
break;
|
||||
|
@ -284,38 +284,38 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u
|
|||
|
||||
f.read(screenP, READ_LE_UINT32(imageStr + 8));
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
while (!_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate2) {
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
while (!_vm->_events->_escKeyFl && _vm->_events->_rateCounter < rate2) {
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
}
|
||||
}
|
||||
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
if (*screenP != kByteStop) {
|
||||
_vm->_graphicsManager->copyVideoVbe16(screenP);
|
||||
_vm->_graphicsMan->copyVideoVbe16(screenP);
|
||||
}
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
}
|
||||
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
while (!_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate3) {
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
while (!_vm->_events->_escKeyFl && _vm->_events->_rateCounter < rate3) {
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_vm->_graphicsManager->_skipVideoLockFl = false;
|
||||
_vm->_graphicsMan->_skipVideoLockFl = false;
|
||||
f.close();
|
||||
|
||||
if (_vm->_graphicsManager->_fadingFl) {
|
||||
if (_vm->_graphicsMan->_fadingFl) {
|
||||
f.seek(6);
|
||||
f.read(_vm->_graphicsManager->_palette, 800);
|
||||
f.read(_vm->_graphicsMan->_palette, 800);
|
||||
f.skip(4);
|
||||
size_t nbytes = f.readUint32LE();
|
||||
f.skip(14);
|
||||
|
@ -334,42 +334,42 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u
|
|||
|
||||
f.read(screenP, READ_LE_UINT32(imageStr + 8));
|
||||
if (*screenP != kByteStop)
|
||||
_vm->_graphicsManager->copyWinscanVbe3(screenP, ptra);
|
||||
_vm->_graphicsMan->copyWinscanVbe3(screenP, ptra);
|
||||
}
|
||||
_vm->_graphicsManager->fadeOutDefaultLength(ptra);
|
||||
_vm->_graphicsMan->fadeOutDefaultLength(ptra);
|
||||
ptra = _vm->_globals->freeMemory(ptra);
|
||||
}
|
||||
_vm->_graphicsManager->_fadingFl = false;
|
||||
_vm->_graphicsMan->_fadingFl = false;
|
||||
|
||||
_vm->_graphicsManager->restoreScreen();
|
||||
_vm->_graphicsMan->restoreScreen();
|
||||
|
||||
memcpy(_vm->_graphicsManager->_palette, _vm->_graphicsManager->_oldPalette, 769);
|
||||
_vm->_graphicsManager->clearPalette();
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
memcpy(_vm->_graphicsMan->_palette, _vm->_graphicsMan->_oldPalette, 769);
|
||||
_vm->_graphicsMan->clearPalette();
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->_scrollPosX = oldScrollPosX;
|
||||
_vm->_graphicsManager->scrollScreen(oldScrollPosX);
|
||||
if (_vm->_graphicsManager->_largeScreenFl) {
|
||||
_vm->_graphicsManager->setScreenWidth(2 * SCREEN_WIDTH);
|
||||
_vm->_graphicsManager->_maxX = 2 * SCREEN_WIDTH;
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(_vm->_graphicsManager->_frontBuffer, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->_scrollPosX = oldScrollPosX;
|
||||
_vm->_graphicsMan->scrollScreen(oldScrollPosX);
|
||||
if (_vm->_graphicsMan->_largeScreenFl) {
|
||||
_vm->_graphicsMan->setScreenWidth(2 * SCREEN_WIDTH);
|
||||
_vm->_graphicsMan->_maxX = 2 * SCREEN_WIDTH;
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(_vm->_graphicsMan->_frontBuffer, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
} else {
|
||||
_vm->_graphicsManager->setScreenWidth(SCREEN_WIDTH);
|
||||
_vm->_graphicsManager->_maxX = SCREEN_WIDTH;
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(_vm->_graphicsManager->_frontBuffer, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->setScreenWidth(SCREEN_WIDTH);
|
||||
_vm->_graphicsMan->_maxX = SCREEN_WIDTH;
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(_vm->_graphicsMan->_frontBuffer, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
}
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
|
||||
_vm->_graphicsManager->fadeInShort();
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->fadeInShort();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
|
||||
_vm->_eventsManager->mouseOn();
|
||||
_vm->_events->mouseOn();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -454,7 +454,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
|
|||
Bank[idx]._loadedFl = true;
|
||||
Bank[idx]._filename = filename;
|
||||
|
||||
byte *fileDataPtr = _vm->_fileManager->loadFile(filename);
|
||||
byte *fileDataPtr = _vm->_fileIO->loadFile(filename);
|
||||
|
||||
Bank[idx]._fileHeader = 0;
|
||||
if (fileDataPtr[1] == 'L' && fileDataPtr[2] == 'E')
|
||||
|
@ -472,8 +472,8 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
|
|||
|
||||
int objectDataIdx = 0;
|
||||
for(objectDataIdx = 0; objectDataIdx <= 249; objectDataIdx++) {
|
||||
int width = _vm->_objectsManager->getWidth(fileDataPtr, objectDataIdx);
|
||||
int height = _vm->_objectsManager->getHeight(fileDataPtr, objectDataIdx);
|
||||
int width = _vm->_objectsMan->getWidth(fileDataPtr, objectDataIdx);
|
||||
int height = _vm->_objectsMan->getHeight(fileDataPtr, objectDataIdx);
|
||||
if (!width && !height)
|
||||
break;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
|
|||
|
||||
Common::File f;
|
||||
if (f.exists(ofsFilename)) {
|
||||
byte *ofsData = _vm->_fileManager->loadFile(ofsFilename);
|
||||
byte *ofsData = _vm->_fileIO->loadFile(ofsFilename);
|
||||
byte *curOfsData = ofsData;
|
||||
for (int objIdx = 0; objIdx < Bank[idx]._objDataIdx; ++objIdx, curOfsData += 8) {
|
||||
int x1 = READ_LE_INT16(curOfsData);
|
||||
|
@ -503,9 +503,9 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
|
|||
int x2 = READ_LE_INT16(curOfsData + 4);
|
||||
int y2 = READ_LE_INT16(curOfsData + 6);
|
||||
|
||||
_vm->_objectsManager->setOffsetXY(Bank[idx]._data, objIdx, x1, y1, 0);
|
||||
_vm->_objectsMan->setOffsetXY(Bank[idx]._data, objIdx, x1, y1, 0);
|
||||
if (Bank[idx]._fileHeader == 2)
|
||||
_vm->_objectsManager->setOffsetXY(Bank[idx]._data, objIdx, x2, y2, 1);
|
||||
_vm->_objectsMan->setOffsetXY(Bank[idx]._data, objIdx, x2, y2, 1);
|
||||
}
|
||||
|
||||
_vm->_globals->freeMemory(ofsData);
|
||||
|
@ -567,22 +567,22 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
|
|||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
_vm->_eventsManager->_mouseFl = false;
|
||||
_vm->_events->_mouseFl = false;
|
||||
if (!noColFl) {
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
|
||||
_vm->_graphicsManager->backupScreen();
|
||||
_vm->_graphicsMan->backupScreen();
|
||||
|
||||
if (!_vm->_graphicsManager->_lineNbr)
|
||||
_vm->_graphicsManager->_scrollOffset = 0;
|
||||
if (!_vm->_graphicsMan->_lineNbr)
|
||||
_vm->_graphicsMan->_scrollOffset = 0;
|
||||
}
|
||||
byte *screenP = _vm->_graphicsManager->_backBuffer;
|
||||
byte *screenP = _vm->_graphicsMan->_backBuffer;
|
||||
Common::File f;
|
||||
if (!f.open(file))
|
||||
error("Error opening file - %s", file.c_str());
|
||||
|
||||
f.skip(6);
|
||||
f.read(_vm->_graphicsManager->_palette, 800);
|
||||
f.read(_vm->_graphicsMan->_palette, 800);
|
||||
f.skip(4);
|
||||
size_t nbytes = f.readUint32LE();
|
||||
f.skip(14);
|
||||
|
@ -590,44 +590,44 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
|
|||
|
||||
if (skipSeqFl) {
|
||||
if (!_vm->getIsDemo()) {
|
||||
_vm->_graphicsManager->setColorPercentage(252, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(251, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(254, 0, 0, 0);
|
||||
_vm->_graphicsMan->setColorPercentage(252, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(251, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(254, 0, 0, 0);
|
||||
}
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
} else {
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
}
|
||||
bool skipFl = false;
|
||||
if (noColFl)
|
||||
_vm->_graphicsManager->fadeInDefaultLength(screenP);
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_soundManager->loadAnimSound();
|
||||
_vm->_graphicsMan->fadeInDefaultLength(screenP);
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_soundMan->loadAnimSound();
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
do {
|
||||
if (_vm->shouldQuit() || (_vm->_eventsManager->_escKeyFl && !skipEscFl)) {
|
||||
if (_vm->shouldQuit() || (_vm->_events->_escKeyFl && !skipEscFl)) {
|
||||
skipFl = true;
|
||||
break;
|
||||
}
|
||||
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
} while (_vm->_eventsManager->_rateCounter < rate1);
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
} while (_vm->_events->_rateCounter < rate1);
|
||||
}
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_events->_rateCounter = 0;
|
||||
if (!skipFl) {
|
||||
int soundNumber = 0;
|
||||
for (;;) {
|
||||
++soundNumber;
|
||||
_vm->_soundManager->playAnimSound(soundNumber);
|
||||
_vm->_soundMan->playAnimSound(soundNumber);
|
||||
byte imageStr[17];
|
||||
if (f.read(imageStr, 16) != 16)
|
||||
break;
|
||||
|
@ -639,55 +639,55 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
|
|||
f.read(screenP, READ_LE_UINT32(imageStr + 8));
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
do {
|
||||
if (_vm->shouldQuit() || (_vm->_eventsManager->_escKeyFl && !skipEscFl)) {
|
||||
if (_vm->shouldQuit() || (_vm->_events->_escKeyFl && !skipEscFl)) {
|
||||
skipFl = true;
|
||||
break;
|
||||
}
|
||||
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
} while (_vm->_eventsManager->_rateCounter < rate2);
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
} while (_vm->_events->_rateCounter < rate2);
|
||||
}
|
||||
|
||||
if (skipFl)
|
||||
break;
|
||||
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
if (*screenP != kByteStop)
|
||||
_vm->_graphicsManager->copyVideoVbe16a(screenP);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->copyVideoVbe16a(screenP);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
}
|
||||
}
|
||||
|
||||
if (_vm->_globals->_eventMode == 1 && !skipFl) {
|
||||
do {
|
||||
if (_vm->shouldQuit() || (_vm->_eventsManager->_escKeyFl && !skipEscFl)) {
|
||||
if (_vm->shouldQuit() || (_vm->_events->_escKeyFl && !skipEscFl)) {
|
||||
skipFl = true;
|
||||
break;
|
||||
}
|
||||
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
} while (_vm->_eventsManager->_rateCounter < rate3);
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
} while (_vm->_events->_rateCounter < rate3);
|
||||
}
|
||||
|
||||
if (!skipFl)
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_events->_rateCounter = 0;
|
||||
|
||||
_vm->_graphicsManager->_skipVideoLockFl = false;
|
||||
_vm->_graphicsMan->_skipVideoLockFl = false;
|
||||
f.close();
|
||||
|
||||
if (!noColFl) {
|
||||
_vm->_graphicsManager->restoreScreen();
|
||||
_vm->_graphicsMan->restoreScreen();
|
||||
|
||||
_vm->_eventsManager->_mouseFl = true;
|
||||
_vm->_events->_mouseFl = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -703,47 +703,47 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
|
|||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
_vm->_eventsManager->_mouseFl = false;
|
||||
screenP = _vm->_graphicsManager->_backBuffer;
|
||||
_vm->_events->_mouseFl = false;
|
||||
screenP = _vm->_graphicsMan->_backBuffer;
|
||||
|
||||
if (!f.open(file))
|
||||
error("File not found - %s", file.c_str());
|
||||
|
||||
f.skip(6);
|
||||
f.read(_vm->_graphicsManager->_palette, 800);
|
||||
f.read(_vm->_graphicsMan->_palette, 800);
|
||||
f.skip(4);
|
||||
size_t nbytes = f.readUint32LE();
|
||||
f.skip(14);
|
||||
f.read(screenP, nbytes);
|
||||
|
||||
if (skipSeqFl) {
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
} else {
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->copy16BitRect(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
}
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_soundManager->loadAnimSound();
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_soundMan->loadAnimSound();
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
do {
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
} while (!_vm->shouldQuit() && !_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate1);
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
} while (!_vm->shouldQuit() && !_vm->_events->_escKeyFl && _vm->_events->_rateCounter < rate1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_vm->_eventsManager->_escKeyFl) {
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
if (!_vm->_events->_escKeyFl) {
|
||||
_vm->_events->_rateCounter = 0;
|
||||
frameNumber = 0;
|
||||
while (!_vm->shouldQuit()) {
|
||||
_vm->_soundManager->playAnimSound(frameNumber++);
|
||||
_vm->_soundMan->playAnimSound(frameNumber++);
|
||||
|
||||
byte imageStr[17];
|
||||
if (f.read(imageStr, 16) != 16)
|
||||
|
@ -756,37 +756,37 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
|
|||
f.read(screenP, READ_LE_UINT32(imageStr + 8));
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
do {
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
} while (!_vm->shouldQuit() && !_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate2);
|
||||
_vm->_events->refreshEvents();
|
||||
} while (!_vm->shouldQuit() && !_vm->_events->_escKeyFl && _vm->_events->_rateCounter < rate2);
|
||||
}
|
||||
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_events->_rateCounter = 0;
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
if (*screenP != kByteStop)
|
||||
_vm->_graphicsManager->copyVideoVbe16a(screenP);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->copyVideoVbe16a(screenP);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
}
|
||||
}
|
||||
|
||||
if (_vm->_globals->_eventMode == 1) {
|
||||
// Wait for third rate delay
|
||||
do {
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
} while (!_vm->shouldQuit() && !_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate3);
|
||||
_vm->_events->refreshEvents();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
} while (!_vm->shouldQuit() && !_vm->_events->_escKeyFl && _vm->_events->_rateCounter < rate3);
|
||||
}
|
||||
|
||||
_vm->_eventsManager->_rateCounter = 0;
|
||||
_vm->_events->_rateCounter = 0;
|
||||
|
||||
if (_vm->_graphicsManager->_fadingFl) {
|
||||
if (_vm->_graphicsMan->_fadingFl) {
|
||||
byte *ptra = _vm->_globals->allocMemory(307200);
|
||||
|
||||
f.seek(6);
|
||||
f.read(_vm->_graphicsManager->_palette, 800);
|
||||
f.read(_vm->_graphicsMan->_palette, 800);
|
||||
f.skip(4);
|
||||
size_t nbytes = f.readUint32LE();
|
||||
f.skip(14);
|
||||
|
@ -804,15 +804,15 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
|
|||
|
||||
f.read(screenP, READ_LE_UINT32(imageStr + 8));
|
||||
if (*screenP != kByteStop)
|
||||
_vm->_graphicsManager->copyWinscanVbe(screenP, ptra);
|
||||
_vm->_graphicsMan->copyWinscanVbe(screenP, ptra);
|
||||
}
|
||||
_vm->_graphicsManager->fadeOutDefaultLength(ptra);
|
||||
_vm->_graphicsMan->fadeOutDefaultLength(ptra);
|
||||
ptra = _vm->_globals->freeMemory(ptra);
|
||||
}
|
||||
_vm->_graphicsManager->_fadingFl = false;
|
||||
_vm->_graphicsMan->_fadingFl = false;
|
||||
|
||||
f.close();
|
||||
_vm->_eventsManager->_mouseFl = true;
|
||||
_vm->_events->_mouseFl = true;
|
||||
}
|
||||
|
||||
void AnimationManager::initAnimBqe() {
|
||||
|
|
|
@ -72,34 +72,34 @@ void ComputerManager::setVideoMode() {
|
|||
* Sets up Textual entry mode
|
||||
*/
|
||||
void ComputerManager::setTextMode() {
|
||||
_vm->_graphicsManager->clearPalette();
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsMan->clearPalette();
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->_lineNbr = SCREEN_WIDTH;
|
||||
_vm->_fontManager->_font = _vm->_globals->freeMemory(_vm->_fontManager->_font);
|
||||
_vm->_graphicsMan->_lineNbr = SCREEN_WIDTH;
|
||||
_vm->_fontMan->_font = _vm->_globals->freeMemory(_vm->_fontMan->_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->_fontMan->_font = _vm->_fileIO->loadFile(filename);
|
||||
_vm->_fontMan->_fontFixedWidth = 8;
|
||||
_vm->_fontMan->_fontFixedHeight = 8;
|
||||
|
||||
_vm->_graphicsManager->loadImage("WINTEXT");
|
||||
_vm->_graphicsManager->fadeInLong();
|
||||
_vm->_graphicsMan->loadImage("WINTEXT");
|
||||
_vm->_graphicsMan->fadeInLong();
|
||||
loadMenu();
|
||||
_vm->_eventsManager->_mouseFl = false;
|
||||
_vm->_events->_mouseFl = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the screen
|
||||
*/
|
||||
void ComputerManager::clearScreen() {
|
||||
_vm->_graphicsManager->loadImage("WINTEXT");
|
||||
_vm->_graphicsManager->fadeInLong();
|
||||
_vm->_graphicsMan->loadImage("WINTEXT");
|
||||
_vm->_graphicsMan->fadeInLong();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -125,8 +125,8 @@ void ComputerManager::setTextPosition(int yp, int xp) {
|
|||
* @param mode Which computer to display
|
||||
*/
|
||||
void ComputerManager::showComputer(ComputerEnum mode) {
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_graphicsManager->resetDirtyRects();
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_vm->_graphicsMan->resetDirtyRects();
|
||||
setVideoMode();
|
||||
setTextColor(4);
|
||||
setTextPosition(2, 4);
|
||||
|
@ -157,7 +157,7 @@ void ComputerManager::showComputer(ComputerEnum mode) {
|
|||
|
||||
if (passwordMatch) {
|
||||
while (!_vm->shouldQuit()) {
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
clearScreen();
|
||||
setTextColor(4);
|
||||
setTextPosition(2, 4);
|
||||
|
@ -199,7 +199,7 @@ void ComputerManager::showComputer(ComputerEnum mode) {
|
|||
bool numericFlag = false;
|
||||
char keyPressed;
|
||||
do {
|
||||
keyPressed = _vm->_eventsManager->waitKeyPress();
|
||||
keyPressed = _vm->_events->waitKeyPress();
|
||||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
|
@ -259,26 +259,26 @@ void ComputerManager::showComputer(ComputerEnum mode) {
|
|||
}
|
||||
}
|
||||
}
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
restoreFBIRoom();
|
||||
} else {
|
||||
// Password doesn't match - Access Denied
|
||||
setTextColor(4);
|
||||
setTextPosition(16, 25);
|
||||
outText(Common::String(_menuText[5]._line));
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_eventsManager->delay(1000);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_events->delay(1000);
|
||||
|
||||
memset(_vm->_graphicsManager->_frontBuffer, 0, 307199);
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
memset(_vm->_graphicsMan->_frontBuffer, 0, 307199);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
restoreFBIRoom();
|
||||
_vm->_eventsManager->mouseOff();
|
||||
_vm->_events->mouseOff();
|
||||
}
|
||||
|
||||
if (mode == COMPUTER_HOPKINS)
|
||||
|
@ -286,7 +286,7 @@ void ComputerManager::showComputer(ComputerEnum mode) {
|
|||
else // Free access or Samantha
|
||||
_vm->_globals->_exitId = 14;
|
||||
|
||||
_vm->_graphicsManager->resetDirtyRects();
|
||||
_vm->_graphicsMan->resetDirtyRects();
|
||||
}
|
||||
|
||||
static const char _englishText[] =
|
||||
|
@ -353,8 +353,8 @@ static const char _spanishText[] =
|
|||
*/
|
||||
void ComputerManager::loadMenu() {
|
||||
char *ptr;
|
||||
if (_vm->_fileManager->fileExists("COMPUTAN.TXT")) {
|
||||
ptr = (char *)_vm->_fileManager->loadFile("COMPUTAN.TXT");
|
||||
if (_vm->_fileIO->fileExists("COMPUTAN.TXT")) {
|
||||
ptr = (char *)_vm->_fileIO->loadFile("COMPUTAN.TXT");
|
||||
} else if (_vm->_globals->_language == LANG_FR) {
|
||||
ptr = (char *)_vm->_globals->allocMemory(sizeof(_frenchText));
|
||||
strcpy(ptr, _frenchText);
|
||||
|
@ -403,12 +403,12 @@ void ComputerManager::displayMessage(int xp, int yp, int textIdx) {
|
|||
int x2 = 0;
|
||||
|
||||
int textIndex = 0;
|
||||
bool oldMouseFlag = _vm->_eventsManager->_mouseFl;
|
||||
_vm->_eventsManager->_mouseFl = false;
|
||||
bool oldMouseFlag = _vm->_events->_mouseFl;
|
||||
_vm->_events->_mouseFl = false;
|
||||
|
||||
_vm->_fontManager->displayTextVesa(xp, yp, "_", 252);
|
||||
_vm->_fontMan->displayTextVesa(xp, yp, "_", 252);
|
||||
do {
|
||||
curChar = _vm->_eventsManager->waitKeyPress();
|
||||
curChar = _vm->_events->waitKeyPress();
|
||||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
|
@ -422,67 +422,67 @@ 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->copyRect(_vm->_graphicsManager->_backBuffer, x1, yp, 3 * _vm->_fontManager->_fontFixedWidth, 12, _vm->_graphicsManager->_frontBuffer, x1, yp);
|
||||
_vm->_graphicsManager->addDirtyRect(x1, yp, x2, yp + 12);
|
||||
_vm->_fontManager->displayTextVesa(x1, yp, "_", 252);
|
||||
x1 -= _vm->_fontMan->_fontFixedWidth;
|
||||
x2 = x1 + 2 * _vm->_fontMan->_fontFixedWidth;
|
||||
_vm->_graphicsMan->copyRect(_vm->_graphicsMan->_backBuffer, x1, yp, 3 * _vm->_fontMan->_fontFixedWidth, 12, _vm->_graphicsMan->_frontBuffer, x1, yp);
|
||||
_vm->_graphicsMan->addDirtyRect(x1, yp, x2, yp + 12);
|
||||
_vm->_fontMan->displayTextVesa(x1, yp, "_", 252);
|
||||
}
|
||||
if (mappedChar != '*') {
|
||||
char newChar = mappedChar;
|
||||
_vm->_graphicsManager->copyRect(_vm->_graphicsManager->_backBuffer, x1, yp, _vm->_fontManager->_fontFixedWidth, 12, _vm->_graphicsManager->_frontBuffer, x1, yp);
|
||||
_vm->_graphicsManager->addDirtyRect(x1, yp, _vm->_fontManager->_fontFixedWidth + x1, yp + 12);
|
||||
_vm->_graphicsMan->copyRect(_vm->_graphicsMan->_backBuffer, x1, yp, _vm->_fontMan->_fontFixedWidth, 12, _vm->_graphicsMan->_frontBuffer, x1, yp);
|
||||
_vm->_graphicsMan->addDirtyRect(x1, yp, _vm->_fontMan->_fontFixedWidth + x1, yp + 12);
|
||||
_inputBuf[textIndex] = newChar;
|
||||
|
||||
Common::String charString = Common::String::format("%c_", newChar);
|
||||
_vm->_fontManager->displayTextVesa(x1, yp, charString, 252);
|
||||
_vm->_fontMan->displayTextVesa(x1, yp, charString, 252);
|
||||
++textIndex;
|
||||
x1 += _vm->_fontManager->_fontFixedWidth;
|
||||
x1 += _vm->_fontMan->_fontFixedWidth;
|
||||
}
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (textIndex != textIdx && curChar != 13);
|
||||
|
||||
_vm->_graphicsManager->copyRect(_vm->_graphicsManager->_backBuffer, x1, yp, _vm->_fontManager->_fontFixedWidth, 12, _vm->_graphicsManager->_frontBuffer, x1, yp);
|
||||
_vm->_graphicsManager->addDirtyRect(x1, yp, _vm->_fontManager->_fontFixedWidth + x1, yp + 12);
|
||||
_vm->_graphicsMan->copyRect(_vm->_graphicsMan->_backBuffer, x1, yp, _vm->_fontMan->_fontFixedWidth, 12, _vm->_graphicsMan->_frontBuffer, x1, yp);
|
||||
_vm->_graphicsMan->addDirtyRect(x1, yp, _vm->_fontMan->_fontFixedWidth + x1, yp + 12);
|
||||
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_inputBuf[textIndex] = 0;
|
||||
_vm->_eventsManager->_mouseFl = oldMouseFlag;
|
||||
_vm->_events->_mouseFl = oldMouseFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs a text string
|
||||
*/
|
||||
void ComputerManager::outText(const Common::String &msg) {
|
||||
_vm->_fontManager->renderTextDisplay(_textPosition.x, _textPosition.y, msg, _textColor);
|
||||
_vm->_fontMan->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->_fontMan->displayTextVesa(_textPosition.x, _textPosition.y, msg, _textColor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores the scene for the FBI headquarters room
|
||||
*/
|
||||
void ComputerManager::restoreFBIRoom() {
|
||||
_vm->_graphicsManager->fadeOutShort();
|
||||
_vm->_graphicsMan->fadeOutShort();
|
||||
|
||||
_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->_fontMan->_font);
|
||||
_vm->_fontMan->_font = _vm->_fileIO->loadFile("FONTE3.SPR");
|
||||
_vm->_fontMan->_fontFixedWidth = 12;
|
||||
_vm->_fontMan->_fontFixedHeight = 21;
|
||||
|
||||
_vm->_eventsManager->_mouseFl = true;
|
||||
_vm->_events->_mouseFl = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display texts for the given menu entry
|
||||
*/
|
||||
void ComputerManager::readText(int idx) {
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
|
||||
Common::String filename;
|
||||
if (_vm->_globals->_language == LANG_EN)
|
||||
|
@ -492,8 +492,8 @@ void ComputerManager::readText(int idx) {
|
|||
else if (_vm->_globals->_language == LANG_SP)
|
||||
filename = "THOPKES.TXT";
|
||||
|
||||
byte *ptr = _vm->_fileManager->loadFile(filename);
|
||||
uint16 fileSize = _vm->_fileManager->fileSize(filename);
|
||||
byte *ptr = _vm->_fileIO->loadFile(filename);
|
||||
uint16 fileSize = _vm->_fileIO->fileSize(filename);
|
||||
int pos;
|
||||
for (pos = 0; pos < fileSize; pos++) {
|
||||
if (ptr[pos] == '%') {
|
||||
|
@ -516,7 +516,7 @@ void ComputerManager::readText(int idx) {
|
|||
outText(curStr);
|
||||
|
||||
++lineNum;
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
curStr = "";
|
||||
} else if (curChar != '%') {
|
||||
curStr += curChar;
|
||||
|
@ -525,7 +525,7 @@ void ComputerManager::readText(int idx) {
|
|||
assert(pos <= fileSize);
|
||||
} while (curChar != '%');
|
||||
|
||||
_vm->_eventsManager->waitKeyPress();
|
||||
_vm->_events->waitKeyPress();
|
||||
ptr = _vm->_globals->freeMemory(ptr);
|
||||
}
|
||||
|
||||
|
@ -533,13 +533,13 @@ void ComputerManager::readText(int idx) {
|
|||
* Display breakout when Games sub-menu is selected
|
||||
*/
|
||||
void ComputerManager::displayGamesSubMenu() {
|
||||
const byte *oldSpriteData = _vm->_objectsManager->_sprite[0]._spriteData;
|
||||
const byte *oldSpriteData = _vm->_objectsMan->_sprite[0]._spriteData;
|
||||
uint oldSpeed = _vm->_globals->_speed;
|
||||
|
||||
_vm->_globals->_speed = 1;
|
||||
_vm->_eventsManager->changeMouseCursor(0);
|
||||
_vm->_events->changeMouseCursor(0);
|
||||
_breakoutSpr = NULL;
|
||||
_vm->_eventsManager->_breakoutFl = true;
|
||||
_vm->_events->_breakoutFl = true;
|
||||
_breakoutLevel = (int16 *)NULL;
|
||||
_breakoutBrickNbr = 0;
|
||||
_breakoutScore = 0;
|
||||
|
@ -548,36 +548,36 @@ void ComputerManager::displayGamesSubMenu() {
|
|||
_ballRightFl = false;
|
||||
_ballUpFl = false;
|
||||
_breakoutLevelNbr = 0;
|
||||
_vm->_graphicsManager->_minY = 0;
|
||||
_vm->_graphicsManager->_maxX = 320;
|
||||
_vm->_graphicsManager->_maxY = 200;
|
||||
_vm->_soundManager->loadSample(1, "SOUND37.WAV");
|
||||
_vm->_soundManager->loadSample(2, "SOUND38.WAV");
|
||||
_vm->_soundManager->loadSample(3, "SOUND39.WAV");
|
||||
_breakoutSpr = _vm->_fileManager->loadFile("CASSE.SPR");
|
||||
_vm->_graphicsMan->_minY = 0;
|
||||
_vm->_graphicsMan->_maxX = 320;
|
||||
_vm->_graphicsMan->_maxY = 200;
|
||||
_vm->_soundMan->loadSample(1, "SOUND37.WAV");
|
||||
_vm->_soundMan->loadSample(2, "SOUND38.WAV");
|
||||
_vm->_soundMan->loadSample(3, "SOUND39.WAV");
|
||||
_breakoutSpr = _vm->_fileIO->loadFile("CASSE.SPR");
|
||||
loadHiscore();
|
||||
setModeVGA256();
|
||||
|
||||
newLevel();
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
|
||||
playBreakout();
|
||||
_vm->_graphicsManager->resetDirtyRects();
|
||||
_vm->_graphicsMan->resetDirtyRects();
|
||||
_breakoutSpr = _vm->_globals->freeMemory(_breakoutSpr);
|
||||
_breakoutLevel = (int16 *)_vm->_globals->freeMemory((byte *)_breakoutLevel);
|
||||
_vm->_objectsManager->_sprite[0]._spriteData = oldSpriteData;
|
||||
_vm->_objectsMan->_sprite[0]._spriteData = oldSpriteData;
|
||||
|
||||
_vm->_soundManager->removeSample(1);
|
||||
_vm->_soundManager->removeSample(2);
|
||||
_vm->_soundManager->removeSample(3);
|
||||
_vm->_soundMan->removeSample(1);
|
||||
_vm->_soundMan->removeSample(2);
|
||||
_vm->_soundMan->removeSample(3);
|
||||
_vm->_globals->_speed = oldSpeed;
|
||||
_vm->_eventsManager->_breakoutFl = false;
|
||||
_vm->_events->_breakoutFl = false;
|
||||
setVideoMode();
|
||||
setTextColor(15);
|
||||
clearScreen();
|
||||
_vm->_graphicsManager->_maxX = 680;
|
||||
_vm->_graphicsManager->_minY = 0;
|
||||
_vm->_graphicsManager->_maxY = 460;
|
||||
_vm->_graphicsMan->_maxX = 680;
|
||||
_vm->_graphicsMan->_minY = 0;
|
||||
_vm->_graphicsMan->_maxY = 460;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -585,7 +585,7 @@ void ComputerManager::displayGamesSubMenu() {
|
|||
*/
|
||||
void ComputerManager::loadHiscore() {
|
||||
byte *ptr = _vm->_globals->allocMemory(100);
|
||||
_vm->_saveLoadManager->load("HISCORE.DAT", ptr);
|
||||
_vm->_saveLoad->load("HISCORE.DAT", ptr);
|
||||
|
||||
for (int scoreIndex = 0; scoreIndex < 6; ++scoreIndex) {
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
|
@ -611,23 +611,23 @@ void ComputerManager::loadHiscore() {
|
|||
* VGA 256 col
|
||||
*/
|
||||
void ComputerManager::setModeVGA256() {
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->clearScreen();
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsManager->clearPalette();
|
||||
_vm->_graphicsManager->setScreenWidth(320);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->clearScreen();
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
_vm->_graphicsMan->clearPalette();
|
||||
_vm->_graphicsMan->setScreenWidth(320);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load new level
|
||||
*/
|
||||
void ComputerManager::newLevel() {
|
||||
_vm->_objectsManager->removeSprite(0);
|
||||
_vm->_objectsManager->removeSprite(1);
|
||||
_vm->_objectsMan->removeSprite(0);
|
||||
_vm->_objectsMan->removeSprite(1);
|
||||
++_breakoutLives;
|
||||
if (_breakoutLives > 11)
|
||||
_breakoutLives = 11;
|
||||
_vm->_graphicsManager->loadVgaImage("CASSEF.PCX");
|
||||
_vm->_graphicsMan->loadVgaImage("CASSEF.PCX");
|
||||
displayLives();
|
||||
_breakoutLevel = (int16 *)_vm->_globals->freeMemory((byte *)_breakoutLevel);
|
||||
|
||||
|
@ -643,19 +643,19 @@ void ComputerManager::newLevel() {
|
|||
}
|
||||
f.close();
|
||||
|
||||
_breakoutLevel = (int16 *)_vm->_fileManager->loadFile(file);
|
||||
_breakoutLevel = (int16 *)_vm->_fileIO->loadFile(file);
|
||||
displayBricks();
|
||||
|
||||
_vm->_objectsManager->addStaticSprite(_breakoutSpr, Common::Point(150, 192), 0, 13, 0, false, 0, 0);
|
||||
_vm->_objectsManager->addStaticSprite(_breakoutSpr, Common::Point(164, 187), 1, 14, 0, false, 0, 0);
|
||||
_vm->_objectsMan->addStaticSprite(_breakoutSpr, Common::Point(150, 192), 0, 13, 0, false, 0, 0);
|
||||
_vm->_objectsMan->addStaticSprite(_breakoutSpr, Common::Point(164, 187), 1, 14, 0, false, 0, 0);
|
||||
|
||||
_ballPosition = Common::Point(164, 187);
|
||||
_padPositionX = 150;
|
||||
_vm->_objectsManager->animateSprite(0);
|
||||
_vm->_objectsManager->animateSprite(1);
|
||||
_vm->_objectsMan->animateSprite(0);
|
||||
_vm->_objectsMan->animateSprite(1);
|
||||
|
||||
_vm->_eventsManager->mouseOn();
|
||||
_vm->_soundManager->playSample(3, 5);
|
||||
_vm->_events->mouseOn();
|
||||
_vm->_soundMan->playSample(3, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -681,25 +681,25 @@ void ComputerManager::displayBricks() {
|
|||
|
||||
switch (cellType) {
|
||||
case 1:
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 21);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 21);
|
||||
break;
|
||||
case 2:
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 22);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 22);
|
||||
break;
|
||||
case 3:
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 17);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 17);
|
||||
break;
|
||||
case 4:
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 20);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 20);
|
||||
break;
|
||||
case 5:
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 19);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 19);
|
||||
break;
|
||||
case 6:
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 18);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 18);
|
||||
break;
|
||||
case 31:
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 23);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellTop, 23);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -712,12 +712,12 @@ void ComputerManager::displayBricks() {
|
|||
*/
|
||||
void ComputerManager::displayLives() {
|
||||
for (int i = 0, xp = 10; i <= 11; i++, xp += 7)
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, xp, 10, 15);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, xp, 10, 15);
|
||||
|
||||
for (int i = 0, xp = 10; i < _breakoutLives - 1; i++, xp += 7)
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, xp, 10, 14);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, xp, 10, 14);
|
||||
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -728,27 +728,27 @@ void ComputerManager::playBreakout() {
|
|||
while (!_vm->shouldQuit()) {
|
||||
while (!_vm->shouldQuit()) {
|
||||
// Set up the racket and ball
|
||||
_vm->_eventsManager->mouseOff();
|
||||
_vm->_events->mouseOff();
|
||||
_ballPosition = Common::Point(_padPositionX + 14, 187);
|
||||
_vm->_objectsManager->setSpriteY(1, 187);
|
||||
_vm->_objectsManager->setSpriteX(1, _ballPosition.x);
|
||||
_vm->_objectsMan->setSpriteY(1, 187);
|
||||
_vm->_objectsMan->setSpriteX(1, _ballPosition.x);
|
||||
|
||||
_vm->_graphicsManager->resetDirtyRects();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_graphicsManager->fadeInBreakout();
|
||||
_vm->_graphicsMan->resetDirtyRects();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_graphicsMan->fadeInBreakout();
|
||||
|
||||
// Wait for mouse press to start playing
|
||||
do {
|
||||
_padPositionX = _vm->_eventsManager->getMouseX();
|
||||
if (_vm->_eventsManager->_mousePos.x <= 4)
|
||||
_padPositionX = _vm->_events->getMouseX();
|
||||
if (_vm->_events->_mousePos.x <= 4)
|
||||
_padPositionX = 5;
|
||||
if (_padPositionX > 282)
|
||||
_padPositionX = 282;
|
||||
_vm->_objectsManager->setSpriteX(0, _padPositionX);
|
||||
_vm->_objectsManager->setSpriteX(1, _padPositionX + 14);
|
||||
_vm->_objectsManager->setSpriteY(1, 187);
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
} while (!_vm->shouldQuit() && _vm->_eventsManager->getMouseButton() != 1);
|
||||
_vm->_objectsMan->setSpriteX(0, _padPositionX);
|
||||
_vm->_objectsMan->setSpriteX(1, _padPositionX + 14);
|
||||
_vm->_objectsMan->setSpriteY(1, 187);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (!_vm->shouldQuit() && _vm->_events->getMouseButton() != 1);
|
||||
|
||||
_breakoutSpeed = 1;
|
||||
_ballPosition = Common::Point(_padPositionX + 14, 187);
|
||||
|
@ -757,16 +757,16 @@ void ComputerManager::playBreakout() {
|
|||
|
||||
// Play loop
|
||||
do {
|
||||
_vm->_soundManager->checkSounds();
|
||||
_vm->_soundMan->checkSounds();
|
||||
|
||||
_padPositionX = _vm->_eventsManager->getMouseX();
|
||||
if (_vm->_eventsManager->_mousePos.x <= 4)
|
||||
_padPositionX = _vm->_events->getMouseX();
|
||||
if (_vm->_events->_mousePos.x <= 4)
|
||||
_padPositionX = 5;
|
||||
if (_padPositionX > 282)
|
||||
_padPositionX = 282;
|
||||
_vm->_objectsManager->setSpriteX(0, _padPositionX);
|
||||
_vm->_objectsMan->setSpriteX(0, _padPositionX);
|
||||
lastBreakoutEvent = moveBall();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (!_vm->shouldQuit() && !lastBreakoutEvent);
|
||||
if (lastBreakoutEvent != 1)
|
||||
break;
|
||||
|
@ -779,10 +779,10 @@ void ComputerManager::playBreakout() {
|
|||
continue;
|
||||
}
|
||||
|
||||
_vm->_graphicsManager->fadeOutBreakout();
|
||||
_vm->_eventsManager->mouseOn();
|
||||
_vm->_objectsManager->removeSprite(0);
|
||||
_vm->_objectsManager->removeSprite(1);
|
||||
_vm->_graphicsMan->fadeOutBreakout();
|
||||
_vm->_events->mouseOn();
|
||||
_vm->_objectsMan->removeSprite(0);
|
||||
_vm->_objectsMan->removeSprite(1);
|
||||
if (_breakoutScore > _breakoutHiscore)
|
||||
getScoreName();
|
||||
if (displayHiscores() != 1)
|
||||
|
@ -800,7 +800,7 @@ void ComputerManager::playBreakout() {
|
|||
}
|
||||
if (lastBreakoutEvent != 2)
|
||||
return;
|
||||
_vm->_graphicsManager->fadeOutBreakout();
|
||||
_vm->_graphicsMan->fadeOutBreakout();
|
||||
newLevel();
|
||||
}
|
||||
}
|
||||
|
@ -810,14 +810,14 @@ void ComputerManager::playBreakout() {
|
|||
* @return The selected button index: 1 = Game, 2 = Quit
|
||||
*/
|
||||
int ComputerManager::displayHiscores() {
|
||||
_vm->_graphicsManager->resetDirtyRects();
|
||||
_vm->_graphicsMan->resetDirtyRects();
|
||||
loadHiscore();
|
||||
_vm->_graphicsManager->loadVgaImage("HISCORE.PCX");
|
||||
byte *ptr = _vm->_fileManager->loadFile("ALPHA.SPR");
|
||||
_vm->_graphicsManager->setColorPercentage(252, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(251, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(254, 0, 0, 0);
|
||||
_vm->_graphicsMan->loadVgaImage("HISCORE.PCX");
|
||||
byte *ptr = _vm->_fileIO->loadFile("ALPHA.SPR");
|
||||
_vm->_graphicsMan->setColorPercentage(252, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(251, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(254, 0, 0, 0);
|
||||
|
||||
int yp;
|
||||
int xp;
|
||||
|
@ -835,24 +835,24 @@ int ComputerManager::displayHiscores() {
|
|||
displayHiscoreLine(ptr, 9 * i + 199, yp, _score[scoreIndex]._score[i]);
|
||||
}
|
||||
|
||||
_vm->_graphicsManager->fadeInBreakout();
|
||||
_vm->_graphicsManager->resetDirtyRects();
|
||||
_vm->_graphicsMan->fadeInBreakout();
|
||||
_vm->_graphicsMan->resetDirtyRects();
|
||||
int buttonIndex = 0;
|
||||
do {
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
xp = _vm->_eventsManager->getMouseX();
|
||||
yp = _vm->_eventsManager->getMouseY();
|
||||
_vm->_events->refreshEvents();
|
||||
xp = _vm->_events->getMouseX();
|
||||
yp = _vm->_events->getMouseY();
|
||||
|
||||
if (_vm->_eventsManager->getMouseButton() == 1 && ABS(xp - 79) <= 33 && ABS(yp - 396) <= 13)
|
||||
if (_vm->_events->getMouseButton() == 1 && ABS(xp - 79) <= 33 && ABS(yp - 396) <= 13)
|
||||
buttonIndex = 1;
|
||||
else if (_vm->_eventsManager->getMouseButton() == 1 && ABS(xp - 583) <= 32 && ABS(yp - 396) <= 13)
|
||||
else if (_vm->_events->getMouseButton() == 1 && ABS(xp - 583) <= 32 && ABS(yp - 396) <= 13)
|
||||
buttonIndex = 2;
|
||||
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (!buttonIndex && !_vm->shouldQuit());
|
||||
|
||||
_vm->_eventsManager->mouseOff();
|
||||
_vm->_graphicsManager->fadeOutBreakout();
|
||||
_vm->_events->mouseOff();
|
||||
_vm->_graphicsMan->fadeOutBreakout();
|
||||
_vm->_globals->freeMemory(ptr);
|
||||
return buttonIndex;
|
||||
}
|
||||
|
@ -861,17 +861,17 @@ int ComputerManager::displayHiscores() {
|
|||
* Display a screen to enter player name in the case of a new hiscore
|
||||
*/
|
||||
void ComputerManager::getScoreName() {
|
||||
_vm->_graphicsManager->loadVgaImage("NAME.PCX");
|
||||
_vm->_graphicsManager->setColorPercentage(252, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(251, 100, 100, 100);
|
||||
_vm->_graphicsManager->setColorPercentage(254, 0, 0, 0);
|
||||
byte *ptr = _vm->_fileManager->loadFile("ALPHA.SPR");
|
||||
_vm->_graphicsManager->fadeInBreakout();
|
||||
_vm->_graphicsMan->loadVgaImage("NAME.PCX");
|
||||
_vm->_graphicsMan->setColorPercentage(252, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(251, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage(254, 0, 0, 0);
|
||||
byte *ptr = _vm->_fileIO->loadFile("ALPHA.SPR");
|
||||
_vm->_graphicsMan->fadeInBreakout();
|
||||
for (int strPos = 0; strPos <= 4; strPos++) {
|
||||
displayHiscoreLine(ptr, 9 * strPos + 140, 78, 1);
|
||||
|
||||
char curChar = toupper(_vm->_eventsManager->waitKeyPress());
|
||||
char curChar = toupper(_vm->_events->waitKeyPress());
|
||||
if ((curChar < '0') && (curChar > 'Z'))
|
||||
curChar = ' ';
|
||||
if ((curChar > '9') && (curChar < 'A'))
|
||||
|
@ -881,7 +881,7 @@ void ComputerManager::getScoreName() {
|
|||
displayHiscoreLine(ptr, 9 * strPos + 140, 78, curChar);
|
||||
|
||||
for (int idx = 0; idx < 12; ++idx)
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
}
|
||||
_score[5]._score = " ";
|
||||
|
||||
|
@ -895,7 +895,7 @@ void ComputerManager::getScoreName() {
|
|||
for (int i = scoreLen, scorePos = 8; i >= 0; i--) {
|
||||
_score[5]._score.setChar(score[i], scorePos--);
|
||||
}
|
||||
_vm->_graphicsManager->fadeOutBreakout();
|
||||
_vm->_graphicsMan->fadeOutBreakout();
|
||||
_vm->_globals->freeMemory(ptr);
|
||||
saveScore();
|
||||
}
|
||||
|
@ -944,7 +944,7 @@ void ComputerManager::displayScoreChar(int charPos, int charDisp) {
|
|||
if (charDisp >= '0' && charDisp <= '9')
|
||||
idx = charDisp - 45;
|
||||
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, xp, 11, idx);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, xp, 11, idx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -995,7 +995,7 @@ void ComputerManager::saveScore() {
|
|||
ptr[curBufPtr + 15] = 0;
|
||||
}
|
||||
|
||||
_vm->_saveLoadManager->saveFile("HISCORE.DAT", ptr, 100);
|
||||
_vm->_saveLoad->saveFile("HISCORE.DAT", ptr, 100);
|
||||
_vm->_globals->freeMemory(ptr);
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ void ComputerManager::displayHiscoreLine(byte *objectData, int x, int y, int cur
|
|||
idx = curChar - 'A' + 10;
|
||||
else if (curChar == 1)
|
||||
idx = 37;
|
||||
_vm->_graphicsManager->fastDisplay2(objectData, x, y, idx);
|
||||
_vm->_graphicsMan->fastDisplay2(objectData, x, y, idx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1058,21 +1058,21 @@ int ComputerManager::moveBall() {
|
|||
|
||||
_lastBreakoutMoveSpeed = moveSpeed;
|
||||
if (_ballPosition.x <= 6) {
|
||||
_vm->_soundManager->playSample(2, 6);
|
||||
_vm->_soundMan->playSample(2, 6);
|
||||
_ballPosition.x = randVal + 6;
|
||||
_ballRightFl = !_ballRightFl;
|
||||
} else if (_ballPosition.x > 307) {
|
||||
_vm->_soundManager->playSample(2, 6);
|
||||
_vm->_soundMan->playSample(2, 6);
|
||||
_ballPosition.x = 307 - randVal;
|
||||
_ballRightFl = !_ballRightFl;
|
||||
}
|
||||
|
||||
if (_ballPosition.y <= 6) {
|
||||
_vm->_soundManager->playSample(2, 6);
|
||||
_vm->_soundMan->playSample(2, 6);
|
||||
_ballPosition.y = randVal + 7;
|
||||
_ballUpFl = !_ballUpFl;
|
||||
} else if (_ballPosition.y >= 186 && _ballPosition.y <= 194) {
|
||||
_vm->_soundManager->playSample(2, 6);
|
||||
_vm->_soundMan->playSample(2, 6);
|
||||
int ballPosXRight = _ballPosition.x + 6;
|
||||
if ((_ballPosition.x > _padPositionX - 2) && (ballPosXRight < _padPositionX + 36)) {
|
||||
_ballUpFl = false;
|
||||
|
@ -1097,8 +1097,8 @@ int ComputerManager::moveBall() {
|
|||
if (_ballPosition.y > 194)
|
||||
retVal = 1;
|
||||
checkBallCollisions();
|
||||
_vm->_objectsManager->setSpriteX(1, _ballPosition.x);
|
||||
_vm->_objectsManager->setSpriteY(1, _ballPosition.y);
|
||||
_vm->_objectsMan->setSpriteX(1, _ballPosition.x);
|
||||
_vm->_objectsMan->setSpriteY(1, _ballPosition.y);
|
||||
if (!_breakoutBrickNbr)
|
||||
retVal = 2;
|
||||
return retVal;
|
||||
|
@ -1183,10 +1183,10 @@ void ComputerManager::checkBallCollisions() {
|
|||
}
|
||||
if (collisionFl) {
|
||||
if (cellType == 31) {
|
||||
_vm->_soundManager->playSample(2, 6);
|
||||
_vm->_soundMan->playSample(2, 6);
|
||||
} else {
|
||||
_vm->_soundManager->playSample(1, 5);
|
||||
_vm->_graphicsManager->fastDisplay2(_breakoutSpr, cellLeft, cellUp, 16);
|
||||
_vm->_soundMan->playSample(1, 5);
|
||||
_vm->_graphicsMan->fastDisplay2(_breakoutSpr, cellLeft, cellUp, 16);
|
||||
switch (cellType) {
|
||||
case 1:
|
||||
_breakoutScore += 10;
|
||||
|
|
|
@ -42,7 +42,7 @@ bool Debugger::cmd_DirtyRects(int argc, const char **argv) {
|
|||
DebugPrintf("%s: [on | off]\n", argv[0]);
|
||||
return true;
|
||||
} else {
|
||||
_vm->_graphicsManager->_showDirtyRects = !strcmp(argv[1], "on");
|
||||
_vm->_graphicsMan->_showDirtyRects = !strcmp(argv[1], "on");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,24 +62,24 @@ void DialogsManager::clearAll() {
|
|||
}
|
||||
|
||||
void DialogsManager::loadIcons() {
|
||||
_inventoryIcons = _vm->_fileManager->loadFile("ICONE.SPR");
|
||||
_inventoryIcons = _vm->_fileIO->loadFile("ICONE.SPR");
|
||||
}
|
||||
|
||||
void DialogsManager::drawInvent(Common::Point oldBorder, int oldBorderSpriteIndex, Common::Point newBorder, int newBorderSpriteIndex) {
|
||||
if (!_inventDisplayedFl)
|
||||
return;
|
||||
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, _inventWin1, _inventX, _inventY, _inventWidth, _inventHeight);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, _inventWin1, _inventX, _inventY, _inventWidth, _inventHeight);
|
||||
if (oldBorder.x && oldBorder.y)
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _inventBuf2, oldBorder.x + 300, oldBorder.y + 300, oldBorderSpriteIndex + 1);
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _inventBuf2, oldBorder.x + 300, oldBorder.y + 300, oldBorderSpriteIndex + 1);
|
||||
if (newBorder.x && newBorder.y)
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _inventBuf2, newBorder.x + 300, newBorder.y + 300, newBorderSpriteIndex);
|
||||
_vm->_graphicsManager->addDirtyRect(_inventX, _inventY, _inventX + _inventWidth, _inventY + _inventHeight);
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _inventBuf2, newBorder.x + 300, newBorder.y + 300, newBorderSpriteIndex);
|
||||
_vm->_graphicsMan->addDirtyRect(_inventX, _inventY, _inventX + _inventWidth, _inventY + _inventHeight);
|
||||
}
|
||||
|
||||
void DialogsManager::showOptionsDialog() {
|
||||
_vm->_eventsManager->changeMouseCursor(0);
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->changeMouseCursor(0);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
Common::String filename;
|
||||
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
|
||||
filename = "OPTION.SPR";
|
||||
|
@ -92,119 +92,119 @@ void DialogsManager::showOptionsDialog() {
|
|||
filename = "OPTIES.SPR";
|
||||
}
|
||||
|
||||
_vm->_globals->_optionDialogSpr = _vm->_fileManager->loadFile(filename);
|
||||
_vm->_globals->_optionDialogSpr = _vm->_fileIO->loadFile(filename);
|
||||
_vm->_globals->_optionDialogFl = true;
|
||||
|
||||
int scrollOffset = _vm->_graphicsManager->_scrollOffset;
|
||||
int scrollOffset = _vm->_graphicsMan->_scrollOffset;
|
||||
bool doneFlag = false;
|
||||
do {
|
||||
if (_vm->_eventsManager->getMouseButton()) {
|
||||
Common::Point mousePos(_vm->_eventsManager->getMouseX(), _vm->_eventsManager->getMouseY());
|
||||
if (_vm->_events->getMouseButton()) {
|
||||
Common::Point mousePos(_vm->_events->getMouseX(), _vm->_events->getMouseY());
|
||||
|
||||
if (!_vm->_soundManager->_musicOffFl) {
|
||||
if (!_vm->_soundMan->_musicOffFl) {
|
||||
if (mousePos.x >= scrollOffset + 300 && mousePos.y > 113 && mousePos.x <= scrollOffset + 327 && mousePos.y <= 138) {
|
||||
// Change the music volume
|
||||
++_vm->_soundManager->_musicVolume;
|
||||
++_vm->_soundMan->_musicVolume;
|
||||
|
||||
if (_vm->_soundManager->_musicVolume <= 12)
|
||||
_vm->_soundManager->playSoundFile("bruit2.wav");
|
||||
if (_vm->_soundMan->_musicVolume <= 12)
|
||||
_vm->_soundMan->playSoundFile("bruit2.wav");
|
||||
else
|
||||
_vm->_soundManager->_musicVolume = 12;
|
||||
_vm->_soundManager->setMODMusicVolume(_vm->_soundManager->_musicVolume);
|
||||
_vm->_soundMan->_musicVolume = 12;
|
||||
_vm->_soundMan->setMODMusicVolume(_vm->_soundMan->_musicVolume);
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
|
||||
if (!_vm->_soundManager->_musicOffFl && mousePos.x >= scrollOffset + 331 && mousePos.y > 113 && mousePos.x <= scrollOffset + 358 && mousePos.y <= 138) {
|
||||
--_vm->_soundManager->_musicVolume;
|
||||
if (_vm->_soundManager->_musicVolume >= 0)
|
||||
_vm->_soundManager->playSoundFile("bruit2.wav");
|
||||
if (!_vm->_soundMan->_musicOffFl && mousePos.x >= scrollOffset + 331 && mousePos.y > 113 && mousePos.x <= scrollOffset + 358 && mousePos.y <= 138) {
|
||||
--_vm->_soundMan->_musicVolume;
|
||||
if (_vm->_soundMan->_musicVolume >= 0)
|
||||
_vm->_soundMan->playSoundFile("bruit2.wav");
|
||||
else
|
||||
_vm->_soundManager->_musicVolume = 0;
|
||||
_vm->_soundMan->_musicVolume = 0;
|
||||
|
||||
_vm->_soundManager->setMODMusicVolume(_vm->_soundManager->_musicVolume);
|
||||
_vm->_soundMan->setMODMusicVolume(_vm->_soundMan->_musicVolume);
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
}
|
||||
if (!_vm->_soundManager->_soundOffFl) {
|
||||
if (!_vm->_soundMan->_soundOffFl) {
|
||||
// increase volume
|
||||
if (mousePos.x >= scrollOffset + 300 && mousePos.y > 140 && mousePos.x <= scrollOffset + 327 && mousePos.y <= 165) {
|
||||
++_vm->_soundManager->_soundVolume;
|
||||
if (_vm->_soundManager->_soundVolume <= 16)
|
||||
_vm->_soundManager->playSoundFile("bruit2.wav");
|
||||
++_vm->_soundMan->_soundVolume;
|
||||
if (_vm->_soundMan->_soundVolume <= 16)
|
||||
_vm->_soundMan->playSoundFile("bruit2.wav");
|
||||
else
|
||||
_vm->_soundManager->_soundVolume = 16;
|
||||
_vm->_soundManager->setMODSampleVolume();
|
||||
_vm->_soundMan->_soundVolume = 16;
|
||||
_vm->_soundMan->setMODSampleVolume();
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
|
||||
// Decrease volume
|
||||
if (!_vm->_soundManager->_soundOffFl && mousePos.x >= scrollOffset + 331 && mousePos.y > 140 && mousePos.x <= scrollOffset + 358 && mousePos.y <= 165) {
|
||||
--_vm->_soundManager->_soundVolume;
|
||||
if (_vm->_soundManager->_soundVolume >= 0)
|
||||
_vm->_soundManager->playSoundFile("bruit2.wav");
|
||||
if (!_vm->_soundMan->_soundOffFl && mousePos.x >= scrollOffset + 331 && mousePos.y > 140 && mousePos.x <= scrollOffset + 358 && mousePos.y <= 165) {
|
||||
--_vm->_soundMan->_soundVolume;
|
||||
if (_vm->_soundMan->_soundVolume >= 0)
|
||||
_vm->_soundMan->playSoundFile("bruit2.wav");
|
||||
else
|
||||
_vm->_soundManager->_soundVolume = 0;
|
||||
_vm->_soundManager->setMODSampleVolume();
|
||||
_vm->_soundMan->_soundVolume = 0;
|
||||
_vm->_soundMan->setMODSampleVolume();
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
}
|
||||
|
||||
if (!_vm->_soundManager->_voiceOffFl) {
|
||||
if (!_vm->_soundMan->_voiceOffFl) {
|
||||
if (mousePos.x >= scrollOffset + 300 && mousePos.y > 167 && mousePos.x <= scrollOffset + 327 && mousePos.y <= 192) {
|
||||
++_vm->_soundManager->_voiceVolume;
|
||||
++_vm->_soundMan->_voiceVolume;
|
||||
|
||||
if (_vm->_soundManager->_voiceVolume <= 16)
|
||||
_vm->_soundManager->playSoundFile("bruit2.wav");
|
||||
if (_vm->_soundMan->_voiceVolume <= 16)
|
||||
_vm->_soundMan->playSoundFile("bruit2.wav");
|
||||
else
|
||||
_vm->_soundManager->_voiceVolume = 16;
|
||||
_vm->_soundManager->setMODVoiceVolume();
|
||||
_vm->_soundMan->_voiceVolume = 16;
|
||||
_vm->_soundMan->setMODVoiceVolume();
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
|
||||
if (!_vm->_soundManager->_voiceOffFl && mousePos.x >= scrollOffset + 331 && mousePos.y > 167 && mousePos.x <= scrollOffset + 358 && mousePos.y <= 192) {
|
||||
--_vm->_soundManager->_voiceVolume;
|
||||
if (_vm->_soundManager->_voiceVolume >= 0)
|
||||
_vm->_soundManager->playSoundFile("bruit2.wav");
|
||||
if (!_vm->_soundMan->_voiceOffFl && mousePos.x >= scrollOffset + 331 && mousePos.y > 167 && mousePos.x <= scrollOffset + 358 && mousePos.y <= 192) {
|
||||
--_vm->_soundMan->_voiceVolume;
|
||||
if (_vm->_soundMan->_voiceVolume >= 0)
|
||||
_vm->_soundMan->playSoundFile("bruit2.wav");
|
||||
else
|
||||
_vm->_soundManager->_voiceVolume = 0;
|
||||
_vm->_soundManager->setMODVoiceVolume();
|
||||
_vm->_soundMan->_voiceVolume = 0;
|
||||
_vm->_soundMan->setMODVoiceVolume();
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
}
|
||||
|
||||
if (mousePos.x >= scrollOffset + 431) {
|
||||
if (mousePos.y > 194 && mousePos.x <= scrollOffset + 489 && mousePos.y <= 219)
|
||||
_vm->_soundManager->_textOffFl = !_vm->_soundManager->_textOffFl;
|
||||
_vm->_soundMan->_textOffFl = !_vm->_soundMan->_textOffFl;
|
||||
|
||||
if (mousePos.x >= scrollOffset + 431) {
|
||||
if (mousePos.y > 167 && mousePos.x <= scrollOffset + 489 && mousePos.y <= 192) {
|
||||
_vm->_soundManager->_voiceOffFl = !_vm->_soundManager->_voiceOffFl;
|
||||
_vm->_soundMan->_voiceOffFl = !_vm->_soundMan->_voiceOffFl;
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
if (mousePos.x >= scrollOffset + 431) {
|
||||
if (mousePos.y > 113 && mousePos.x <= scrollOffset + 489 && mousePos.y <= 138) {
|
||||
if (_vm->_soundManager->_musicOffFl) {
|
||||
_vm->_soundManager->_musicOffFl = false;
|
||||
_vm->_soundManager->setMODMusicVolume(_vm->_soundManager->_musicVolume);
|
||||
if (_vm->_soundMan->_musicOffFl) {
|
||||
_vm->_soundMan->_musicOffFl = false;
|
||||
_vm->_soundMan->setMODMusicVolume(_vm->_soundMan->_musicVolume);
|
||||
} else {
|
||||
_vm->_soundManager->_musicOffFl = true;
|
||||
_vm->_soundManager->setMODMusicVolume(0);
|
||||
_vm->_soundMan->_musicOffFl = true;
|
||||
_vm->_soundMan->setMODMusicVolume(0);
|
||||
}
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
|
||||
if (mousePos.x >= scrollOffset + 431 && mousePos.y > 140 && mousePos.x <= scrollOffset + 489 && mousePos.y <= 165) {
|
||||
_vm->_soundManager->_soundOffFl = !_vm->_soundManager->_soundOffFl;
|
||||
_vm->_soundMan->_soundOffFl = !_vm->_soundMan->_soundOffFl;
|
||||
|
||||
_vm->_soundManager->updateScummVMSoundSettings();
|
||||
_vm->_soundMan->updateScummVMSoundSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,39 +217,39 @@ void DialogsManager::showOptionsDialog() {
|
|||
if (mousePos.x >= scrollOffset + 355 && mousePos.y > 285 && mousePos.x <= scrollOffset + 490 && mousePos.y <= 310)
|
||||
doneFlag = true;
|
||||
if (mousePos.x >= scrollOffset + 300 && mousePos.y > 194 && mousePos.x <= scrollOffset + 358 && mousePos.y <= 219) {
|
||||
switch (_vm->_graphicsManager->_scrollSpeed) {
|
||||
switch (_vm->_graphicsMan->_scrollSpeed) {
|
||||
case 1:
|
||||
_vm->_graphicsManager->_scrollSpeed = 2;
|
||||
_vm->_graphicsMan->_scrollSpeed = 2;
|
||||
break;
|
||||
case 2:
|
||||
_vm->_graphicsManager->_scrollSpeed = 4;
|
||||
_vm->_graphicsMan->_scrollSpeed = 4;
|
||||
break;
|
||||
case 4:
|
||||
_vm->_graphicsManager->_scrollSpeed = 8;
|
||||
_vm->_graphicsMan->_scrollSpeed = 8;
|
||||
break;
|
||||
case 8:
|
||||
_vm->_graphicsManager->_scrollSpeed = 16;
|
||||
_vm->_graphicsMan->_scrollSpeed = 16;
|
||||
break;
|
||||
case 16:
|
||||
_vm->_graphicsManager->_scrollSpeed = 32;
|
||||
_vm->_graphicsMan->_scrollSpeed = 32;
|
||||
break;
|
||||
case 32:
|
||||
_vm->_graphicsManager->_scrollSpeed = 48;
|
||||
_vm->_graphicsMan->_scrollSpeed = 48;
|
||||
break;
|
||||
case 48:
|
||||
_vm->_graphicsManager->_scrollSpeed = 64;
|
||||
_vm->_graphicsMan->_scrollSpeed = 64;
|
||||
break;
|
||||
case 64:
|
||||
_vm->_graphicsManager->_scrollSpeed = 128;
|
||||
_vm->_graphicsMan->_scrollSpeed = 128;
|
||||
break;
|
||||
case 128:
|
||||
_vm->_graphicsManager->_scrollSpeed = 160;
|
||||
_vm->_graphicsMan->_scrollSpeed = 160;
|
||||
break;
|
||||
case 160:
|
||||
_vm->_graphicsManager->_scrollSpeed = 320;
|
||||
_vm->_graphicsMan->_scrollSpeed = 320;
|
||||
break;
|
||||
case 320:
|
||||
_vm->_graphicsManager->_scrollSpeed = 1;
|
||||
_vm->_graphicsMan->_scrollSpeed = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -270,14 +270,14 @@ void DialogsManager::showOptionsDialog() {
|
|||
else if (_vm->_globals->_speed == 3)
|
||||
_vm->_globals->_menuSpeed = 4;
|
||||
|
||||
_vm->_globals->_menuTextOff = !_vm->_soundManager->_textOffFl ? 7 : 8;
|
||||
_vm->_globals->_menuVoiceOff = !_vm->_soundManager->_voiceOffFl ? 7 : 8;
|
||||
_vm->_globals->_menuSoundOff = !_vm->_soundManager->_soundOffFl ? 7 : 8;
|
||||
_vm->_globals->_menuMusicOff = !_vm->_soundManager->_musicOffFl ? 7 : 8;
|
||||
_vm->_globals->_menuTextOff = !_vm->_soundMan->_textOffFl ? 7 : 8;
|
||||
_vm->_globals->_menuVoiceOff = !_vm->_soundMan->_voiceOffFl ? 7 : 8;
|
||||
_vm->_globals->_menuSoundOff = !_vm->_soundMan->_soundOffFl ? 7 : 8;
|
||||
_vm->_globals->_menuMusicOff = !_vm->_soundMan->_musicOffFl ? 7 : 8;
|
||||
|
||||
_vm->_globals->_menuDisplayType = 9;
|
||||
|
||||
switch (_vm->_graphicsManager->_scrollSpeed) {
|
||||
switch (_vm->_graphicsMan->_scrollSpeed) {
|
||||
case 1:
|
||||
_vm->_globals->_menuScrollSpeed = 12;
|
||||
break;
|
||||
|
@ -316,12 +316,12 @@ void DialogsManager::showOptionsDialog() {
|
|||
break;
|
||||
}
|
||||
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (!doneFlag);
|
||||
|
||||
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_backBuffer, scrollOffset + 164,
|
||||
107, 335, 215, _vm->_graphicsManager->_frontBuffer, scrollOffset + 164, 107);
|
||||
_vm->_graphicsManager->addDirtyRect(scrollOffset + 164, 107, scrollOffset + 498, 320);
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, scrollOffset + 164,
|
||||
107, 335, 215, _vm->_graphicsMan->_frontBuffer, scrollOffset + 164, 107);
|
||||
_vm->_graphicsMan->addDirtyRect(scrollOffset + 164, 107, scrollOffset + 498, 320);
|
||||
|
||||
_vm->_globals->_optionDialogSpr = _vm->_globals->freeMemory(_vm->_globals->_optionDialogSpr);
|
||||
_vm->_globals->_optionDialogFl = false;
|
||||
|
@ -331,24 +331,24 @@ void DialogsManager::showInventory() {
|
|||
if (_removeInventFl || _inventDisplayedFl || _vm->_globals->_disableInventFl)
|
||||
return;
|
||||
|
||||
_vm->_graphicsManager->_scrollStatus = 1;
|
||||
_vm->_objectsManager->_eraseVisibleCounter = 4;
|
||||
_vm->_objectsManager->_visibleFl = false;
|
||||
_vm->_graphicsMan->_scrollStatus = 1;
|
||||
_vm->_objectsMan->_eraseVisibleCounter = 4;
|
||||
_vm->_objectsMan->_visibleFl = false;
|
||||
for (int i = 0; i <= 1; i++) {
|
||||
inventAnim();
|
||||
_vm->_eventsManager->getMouseX();
|
||||
_vm->_eventsManager->getMouseY();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->getMouseX();
|
||||
_vm->_events->getMouseY();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
}
|
||||
_inventWin1 = NULL;
|
||||
|
||||
bool loopFl;
|
||||
do {
|
||||
loopFl = false;
|
||||
_vm->_eventsManager->_curMouseButton = 0;
|
||||
_vm->_eventsManager->_mouseButton = 0;
|
||||
_vm->_events->_curMouseButton = 0;
|
||||
_vm->_events->_mouseButton = 0;
|
||||
_vm->_globals->_disableInventFl = true;
|
||||
_vm->_graphicsManager->setColorPercentage2(251, 100, 100, 100);
|
||||
_vm->_graphicsMan->setColorPercentage2(251, 100, 100, 100);
|
||||
|
||||
Common::String filename;
|
||||
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
|
||||
|
@ -373,17 +373,17 @@ void DialogsManager::showInventory() {
|
|||
|
||||
size_t filesize = f.size();
|
||||
_inventWin1 = _vm->_globals->allocMemory(filesize);
|
||||
_vm->_fileManager->readStream(f, _inventWin1, filesize);
|
||||
_vm->_fileIO->readStream(f, _inventWin1, filesize);
|
||||
f.close();
|
||||
|
||||
_inventBuf2 = _vm->_fileManager->loadFile("INVENT2.SPR");
|
||||
_inventBuf2 = _vm->_fileIO->loadFile("INVENT2.SPR");
|
||||
|
||||
_inventX = _vm->_graphicsManager->_scrollOffset + 152;
|
||||
_inventX = _vm->_graphicsMan->_scrollOffset + 152;
|
||||
_inventY = 114;
|
||||
_inventWidth = _vm->_objectsManager->getWidth(_inventWin1, 0);
|
||||
_inventHeight = _vm->_objectsManager->getHeight(_inventWin1, 0);
|
||||
_inventWidth = _vm->_objectsMan->getWidth(_inventWin1, 0);
|
||||
_inventHeight = _vm->_objectsMan->getHeight(_inventWin1, 0);
|
||||
|
||||
_vm->_graphicsManager->drawCompressedSprite(_vm->_graphicsManager->_frontBuffer, _inventWin1, _inventX + 300, 414, 0, 0, 0, false);
|
||||
_vm->_graphicsMan->drawCompressedSprite(_vm->_graphicsMan->_frontBuffer, _inventWin1, _inventX + 300, 414, 0, 0, 0, false);
|
||||
int curPosY = 0;
|
||||
int inventCount = 0;
|
||||
for (int inventLine = 1; inventLine <= 5; inventLine++) {
|
||||
|
@ -393,17 +393,17 @@ void DialogsManager::showInventory() {
|
|||
int inventIdx = _vm->_globals->_inventory[inventCount];
|
||||
// The last two zones are not reserved for the inventory: Options and Save/Load
|
||||
if (inventIdx && inventCount <= 29) {
|
||||
byte *obj = _vm->_objectsManager->loadObjectFromFile(inventIdx, false);
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, obj, _inventX + curPosX + 6,
|
||||
curPosY + 120, _vm->_objectsManager->getObjectWidth(), _vm->_objectsManager->getObjectHeight());
|
||||
byte *obj = _vm->_objectsMan->loadObjectFromFile(inventIdx, false);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, obj, _inventX + curPosX + 6,
|
||||
curPosY + 120, _vm->_objectsMan->getObjectWidth(), _vm->_objectsMan->getObjectHeight());
|
||||
_vm->_globals->freeMemory(obj);
|
||||
}
|
||||
curPosX += 54;
|
||||
};
|
||||
curPosY += 38;
|
||||
}
|
||||
_vm->_graphicsManager->copySurfaceRect(_vm->_graphicsManager->_frontBuffer, _inventWin1, _inventX, _inventY, _inventWidth, _inventHeight);
|
||||
_vm->_eventsManager->_curMouseButton = 0;
|
||||
_vm->_graphicsMan->copySurfaceRect(_vm->_graphicsMan->_frontBuffer, _inventWin1, _inventX, _inventY, _inventWidth, _inventHeight);
|
||||
_vm->_events->_curMouseButton = 0;
|
||||
int newInventoryItem = 0;
|
||||
|
||||
// Main loop to select an inventory item
|
||||
|
@ -411,39 +411,39 @@ void DialogsManager::showInventory() {
|
|||
// Turn on drawing the inventory dialog in the event manager
|
||||
_inventDisplayedFl = true;
|
||||
|
||||
int mousePosX = _vm->_eventsManager->getMouseX();
|
||||
int mousePosY = _vm->_eventsManager->getMouseY();
|
||||
int mouseButton = _vm->_eventsManager->getMouseButton();
|
||||
int mousePosX = _vm->_events->getMouseX();
|
||||
int mousePosY = _vm->_events->getMouseY();
|
||||
int mouseButton = _vm->_events->getMouseButton();
|
||||
int oldInventoryItem = newInventoryItem;
|
||||
newInventoryItem = _vm->_linesManager->checkInventoryHotspots(mousePosX, mousePosY);
|
||||
newInventoryItem = _vm->_linesMan->checkInventoryHotspots(mousePosX, mousePosY);
|
||||
if (newInventoryItem != oldInventoryItem)
|
||||
_vm->_objectsManager->initBorder(newInventoryItem);
|
||||
if (_vm->_eventsManager->_mouseCursorId != 1 && _vm->_eventsManager->_mouseCursorId != 2 && _vm->_eventsManager->_mouseCursorId != 3 && _vm->_eventsManager->_mouseCursorId != 16) {
|
||||
_vm->_objectsMan->initBorder(newInventoryItem);
|
||||
if (_vm->_events->_mouseCursorId != 1 && _vm->_events->_mouseCursorId != 2 && _vm->_events->_mouseCursorId != 3 && _vm->_events->_mouseCursorId != 16) {
|
||||
if (mouseButton == 2) {
|
||||
_vm->_objectsManager->nextObjectIcon(newInventoryItem);
|
||||
if (_vm->_eventsManager->_mouseCursorId != 23)
|
||||
_vm->_eventsManager->changeMouseCursor(_vm->_eventsManager->_mouseCursorId);
|
||||
_vm->_objectsMan->nextObjectIcon(newInventoryItem);
|
||||
if (_vm->_events->_mouseCursorId != 23)
|
||||
_vm->_events->changeMouseCursor(_vm->_events->_mouseCursorId);
|
||||
}
|
||||
}
|
||||
if (mouseButton == 1) {
|
||||
if (_vm->_eventsManager->_mouseCursorId == 1 || _vm->_eventsManager->_mouseCursorId == 2 || _vm->_eventsManager->_mouseCursorId == 3 || _vm->_eventsManager->_mouseCursorId == 16 || !_vm->_eventsManager->_mouseCursorId)
|
||||
if (_vm->_events->_mouseCursorId == 1 || _vm->_events->_mouseCursorId == 2 || _vm->_events->_mouseCursorId == 3 || _vm->_events->_mouseCursorId == 16 || !_vm->_events->_mouseCursorId)
|
||||
break;
|
||||
_vm->_objectsManager->takeInventoryObject(_vm->_globals->_inventory[newInventoryItem]);
|
||||
if (_vm->_eventsManager->_mouseCursorId == 8)
|
||||
_vm->_objectsMan->takeInventoryObject(_vm->_globals->_inventory[newInventoryItem]);
|
||||
if (_vm->_events->_mouseCursorId == 8)
|
||||
break;
|
||||
|
||||
_vm->_scriptManager->_tempObjectFl = true;
|
||||
_vm->_globals->_saveData->_data[svLastObjectIndex] = _vm->_objectsManager->_curObjectIndex;
|
||||
_vm->_script->_tempObjectFl = true;
|
||||
_vm->_globals->_saveData->_data[svLastObjectIndex] = _vm->_objectsMan->_curObjectIndex;
|
||||
_vm->_globals->_saveData->_data[svLastInventoryItem] = _vm->_globals->_inventory[newInventoryItem];
|
||||
_vm->_globals->_saveData->_data[svLastInvMouseCursor] = _vm->_eventsManager->_mouseCursorId;
|
||||
_vm->_objectsManager->loadObjectIniFile();
|
||||
_vm->_scriptManager->_tempObjectFl = false;
|
||||
_vm->_globals->_saveData->_data[svLastInvMouseCursor] = _vm->_events->_mouseCursorId;
|
||||
_vm->_objectsMan->loadObjectIniFile();
|
||||
_vm->_script->_tempObjectFl = false;
|
||||
|
||||
if (_vm->_soundManager->_voiceOffFl) {
|
||||
if (_vm->_soundMan->_voiceOffFl) {
|
||||
do
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
while (!_vm->_globals->_exitId && _vm->_eventsManager->getMouseButton() != 1);
|
||||
_vm->_fontManager->hideText(9);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
while (!_vm->_globals->_exitId && _vm->_events->getMouseButton() != 1);
|
||||
_vm->_fontMan->hideText(9);
|
||||
}
|
||||
if (_vm->_globals->_exitId) {
|
||||
if (_vm->_globals->_exitId == 2) {
|
||||
|
@ -461,36 +461,36 @@ void DialogsManager::showInventory() {
|
|||
}
|
||||
if (_removeInventFl)
|
||||
break;
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
if (_vm->_globals->_screenId >= 35 && _vm->_globals->_screenId <= 40)
|
||||
_vm->_objectsManager->handleSpecialGames();
|
||||
_vm->_objectsMan->handleSpecialGames();
|
||||
}
|
||||
} while (loopFl);
|
||||
|
||||
_vm->_fontManager->hideText(9);
|
||||
_vm->_fontMan->hideText(9);
|
||||
if (_inventDisplayedFl) {
|
||||
_inventDisplayedFl = false;
|
||||
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_backBuffer, _inventX, 114, _inventWidth, _inventHeight, _vm->_graphicsManager->_frontBuffer, _inventX, 114);
|
||||
_vm->_graphicsManager->addDirtyRect(_inventX, 114, _inventX + _inventWidth, _inventWidth + 114);
|
||||
_vm->_objectsManager->_refreshBobMode10Fl = true;
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, _inventX, 114, _inventWidth, _inventHeight, _vm->_graphicsMan->_frontBuffer, _inventX, 114);
|
||||
_vm->_graphicsMan->addDirtyRect(_inventX, 114, _inventX + _inventWidth, _inventWidth + 114);
|
||||
_vm->_objectsMan->_refreshBobMode10Fl = true;
|
||||
}
|
||||
|
||||
_inventWin1 = _vm->_globals->freeMemory(_inventWin1);
|
||||
_inventBuf2 = _vm->_globals->freeMemory(_inventBuf2);
|
||||
|
||||
if (_vm->_eventsManager->_mouseCursorId == 1)
|
||||
if (_vm->_events->_mouseCursorId == 1)
|
||||
showOptionsDialog();
|
||||
else if (_vm->_eventsManager->_mouseCursorId == 3)
|
||||
else if (_vm->_events->_mouseCursorId == 3)
|
||||
showLoadGame();
|
||||
else if (_vm->_eventsManager->_mouseCursorId == 2)
|
||||
else if (_vm->_events->_mouseCursorId == 2)
|
||||
showSaveGame();
|
||||
|
||||
_vm->_eventsManager->_mouseCursorId = 4;
|
||||
_vm->_eventsManager->changeMouseCursor(4);
|
||||
_vm->_objectsManager->_oldBorderPos = Common::Point(0, 0);
|
||||
_vm->_objectsManager->_borderPos = Common::Point(0, 0);
|
||||
_vm->_events->_mouseCursorId = 4;
|
||||
_vm->_events->changeMouseCursor(4);
|
||||
_vm->_objectsMan->_oldBorderPos = Common::Point(0, 0);
|
||||
_vm->_objectsMan->_borderPos = Common::Point(0, 0);
|
||||
_vm->_globals->_disableInventFl = false;
|
||||
_vm->_graphicsManager->_scrollStatus = 0;
|
||||
_vm->_graphicsMan->_scrollStatus = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -500,42 +500,42 @@ void DialogsManager::inventAnim() {
|
|||
if (_vm->_globals->_disableInventFl)
|
||||
return;
|
||||
|
||||
if (_vm->_objectsManager->_eraseVisibleCounter && !_vm->_objectsManager->_visibleFl) {
|
||||
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_backBuffer, _oldInventX, 27, 48, 38,
|
||||
_vm->_graphicsManager->_frontBuffer, _oldInventX, 27);
|
||||
_vm->_graphicsManager->addDirtyRect(_oldInventX, 27, _oldInventX + 48, 65);
|
||||
--_vm->_objectsManager->_eraseVisibleCounter;
|
||||
if (_vm->_objectsMan->_eraseVisibleCounter && !_vm->_objectsMan->_visibleFl) {
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, _oldInventX, 27, 48, 38,
|
||||
_vm->_graphicsMan->_frontBuffer, _oldInventX, 27);
|
||||
_vm->_graphicsMan->addDirtyRect(_oldInventX, 27, _oldInventX + 48, 65);
|
||||
--_vm->_objectsMan->_eraseVisibleCounter;
|
||||
}
|
||||
|
||||
if (_vm->_objectsManager->_visibleFl) {
|
||||
if (_vm->_objectsMan->_visibleFl) {
|
||||
if (_oldInventX <= 1)
|
||||
_oldInventX = 2;
|
||||
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_backBuffer, _oldInventX, 27, 48, 38,
|
||||
_vm->_graphicsManager->_frontBuffer, _oldInventX, 27);
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, _oldInventX, 27, 48, 38,
|
||||
_vm->_graphicsMan->_frontBuffer, _oldInventX, 27);
|
||||
|
||||
_vm->_graphicsManager->addDirtyRect(_oldInventX, 27, _oldInventX + 48, 65);
|
||||
int newOffset = _vm->_graphicsManager->_scrollOffset + 2;
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _inventoryIcons, newOffset + 300, 327, 0);
|
||||
_vm->_graphicsManager->addDirtyRect(newOffset, 27, newOffset + 45, 62);
|
||||
_vm->_graphicsMan->addDirtyRect(_oldInventX, 27, _oldInventX + 48, 65);
|
||||
int newOffset = _vm->_graphicsMan->_scrollOffset + 2;
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _inventoryIcons, newOffset + 300, 327, 0);
|
||||
_vm->_graphicsMan->addDirtyRect(newOffset, 27, newOffset + 45, 62);
|
||||
_oldInventX = newOffset;
|
||||
}
|
||||
|
||||
if (_vm->_globals->_saveData->_data[svField357] == 1) {
|
||||
if (_vm->_globals->_saveData->_data[svField353] == 1)
|
||||
_vm->_graphicsManager->drawCompressedSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_headSprites, 832, 325, 0, 0, 0, false);
|
||||
_vm->_graphicsMan->drawCompressedSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_headSprites, 832, 325, 0, 0, 0, false);
|
||||
if (_vm->_globals->_saveData->_data[svField355] == 1)
|
||||
_vm->_graphicsManager->drawCompressedSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_headSprites, 866, 325, 1, 0, 0, false);
|
||||
_vm->_graphicsManager->addDirtyRect(532, 25, 560, 60);
|
||||
_vm->_graphicsManager->addDirtyRect(566, 25, 594, 60);
|
||||
_vm->_graphicsMan->drawCompressedSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_headSprites, 866, 325, 1, 0, 0, false);
|
||||
_vm->_graphicsMan->addDirtyRect(532, 25, 560, 60);
|
||||
_vm->_graphicsMan->addDirtyRect(566, 25, 594, 60);
|
||||
}
|
||||
if (_vm->_globals->_saveData->_data[svField356] == 1) {
|
||||
_vm->_graphicsManager->drawCompressedSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_headSprites, 832, 325, 0, 0, 0, false);
|
||||
_vm->_graphicsManager->addDirtyRect(532, 25, 560, 60);
|
||||
_vm->_graphicsMan->drawCompressedSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_headSprites, 832, 325, 0, 0, 0, false);
|
||||
_vm->_graphicsMan->addDirtyRect(532, 25, 560, 60);
|
||||
}
|
||||
|
||||
if (_vm->_globals->_saveData->_data[svField354] == 1) {
|
||||
_vm->_graphicsManager->drawCompressedSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_headSprites, 832, 325, 0, 0, 0, false);
|
||||
_vm->_graphicsManager->addDirtyRect(532, 25, 560, 60);
|
||||
_vm->_graphicsMan->drawCompressedSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_headSprites, 832, 325, 0, 0, 0, false);
|
||||
_vm->_graphicsMan->addDirtyRect(532, 25, 560, 60);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -544,13 +544,13 @@ void DialogsManager::inventAnim() {
|
|||
*/
|
||||
void DialogsManager::testDialogOpening() {
|
||||
if (_vm->_globals->_cityMapEnabledFl)
|
||||
_vm->_eventsManager->_gameKey = KEY_NONE;
|
||||
_vm->_events->_gameKey = KEY_NONE;
|
||||
|
||||
if ((_vm->_eventsManager->_gameKey == KEY_NONE) || _inventFl)
|
||||
if ((_vm->_events->_gameKey == KEY_NONE) || _inventFl)
|
||||
return;
|
||||
|
||||
DIALOG_KEY key = _vm->_eventsManager->_gameKey;
|
||||
_vm->_eventsManager->_gameKey = KEY_NONE;
|
||||
DIALOG_KEY key = _vm->_events->_gameKey;
|
||||
_vm->_events->_gameKey = KEY_NONE;
|
||||
_inventFl = true;
|
||||
|
||||
switch (key) {
|
||||
|
@ -558,86 +558,86 @@ void DialogsManager::testDialogOpening() {
|
|||
showInventory();
|
||||
break;
|
||||
case KEY_OPTIONS:
|
||||
_vm->_graphicsManager->_scrollStatus = 1;
|
||||
_vm->_graphicsMan->_scrollStatus = 1;
|
||||
showOptionsDialog();
|
||||
_vm->_graphicsManager->_scrollStatus = 0;
|
||||
_vm->_graphicsMan->_scrollStatus = 0;
|
||||
break;
|
||||
case KEY_LOAD:
|
||||
_vm->_graphicsManager->_scrollStatus = 1;
|
||||
_vm->_graphicsMan->_scrollStatus = 1;
|
||||
showLoadGame();
|
||||
_vm->_graphicsManager->_scrollStatus = 0;
|
||||
_vm->_graphicsMan->_scrollStatus = 0;
|
||||
break;
|
||||
case KEY_SAVE:
|
||||
_vm->_graphicsManager->_scrollStatus = 1;
|
||||
_vm->_graphicsMan->_scrollStatus = 1;
|
||||
showSaveGame();
|
||||
_vm->_graphicsManager->_scrollStatus = 0;
|
||||
_vm->_graphicsMan->_scrollStatus = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_inventFl = false;
|
||||
_vm->_eventsManager->_gameKey = KEY_NONE;
|
||||
_vm->_events->_gameKey = KEY_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Game dialog
|
||||
*/
|
||||
void DialogsManager::showLoadGame() {
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
showSaveLoad(MODE_LOAD);
|
||||
|
||||
int slotNumber;
|
||||
do {
|
||||
slotNumber = searchSavegames();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
} while (!_vm->shouldQuit() && (!slotNumber || _vm->_eventsManager->getMouseButton() != 1));
|
||||
_vm->_objectsManager->_saveLoadFl = false;
|
||||
int16 startPosX = _vm->_eventsManager->_startPos.x + 183;
|
||||
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_backBuffer, startPosX, 60, 274, 353, _vm->_graphicsManager->_frontBuffer, startPosX, 60);
|
||||
_vm->_graphicsManager->addDirtyRect(startPosX, 60, startPosX + 274, 413);
|
||||
_vm->_objectsManager->_refreshBobMode10Fl = true;
|
||||
_vm->_objectsManager->_saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite);
|
||||
_vm->_objectsManager->_saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite2);
|
||||
_vm->_objectsManager->_saveLoadX = 0;
|
||||
_vm->_objectsManager->_saveLoadY = 0;
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (!_vm->shouldQuit() && (!slotNumber || _vm->_events->getMouseButton() != 1));
|
||||
_vm->_objectsMan->_saveLoadFl = false;
|
||||
int16 startPosX = _vm->_events->_startPos.x + 183;
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, startPosX, 60, 274, 353, _vm->_graphicsMan->_frontBuffer, startPosX, 60);
|
||||
_vm->_graphicsMan->addDirtyRect(startPosX, 60, startPosX + 274, 413);
|
||||
_vm->_objectsMan->_refreshBobMode10Fl = true;
|
||||
_vm->_objectsMan->_saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsMan->_saveLoadSprite);
|
||||
_vm->_objectsMan->_saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsMan->_saveLoadSprite2);
|
||||
_vm->_objectsMan->_saveLoadX = 0;
|
||||
_vm->_objectsMan->_saveLoadY = 0;
|
||||
|
||||
if (slotNumber != 7) {
|
||||
_vm->_saveLoadManager->loadGame(slotNumber);
|
||||
_vm->_saveLoad->loadGame(slotNumber);
|
||||
}
|
||||
|
||||
_vm->_objectsManager->changeObject(14);
|
||||
_vm->_objectsMan->changeObject(14);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Game dialog
|
||||
*/
|
||||
void DialogsManager::showSaveGame() {
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
|
||||
showSaveLoad(MODE_SAVE);
|
||||
int slotNumber;
|
||||
do {
|
||||
slotNumber = searchSavegames();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
} while (!_vm->shouldQuit() && (!slotNumber || _vm->_eventsManager->getMouseButton() != 1));
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (!_vm->shouldQuit() && (!slotNumber || _vm->_events->getMouseButton() != 1));
|
||||
|
||||
_vm->_objectsManager->_saveLoadFl = false;
|
||||
int16 startPosX = _vm->_eventsManager->_startPos.x + 183;
|
||||
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_backBuffer, startPosX, 60, 274, 353, _vm->_graphicsManager->_frontBuffer, startPosX, 60);
|
||||
_vm->_graphicsManager->addDirtyRect(startPosX, 60, startPosX + 274, 413);
|
||||
_vm->_objectsManager->_refreshBobMode10Fl = true;
|
||||
_vm->_objectsManager->_saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite);
|
||||
_vm->_objectsManager->_saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite2);
|
||||
_vm->_objectsManager->_saveLoadX = 0;
|
||||
_vm->_objectsManager->_saveLoadY = 0;
|
||||
_vm->_objectsMan->_saveLoadFl = false;
|
||||
int16 startPosX = _vm->_events->_startPos.x + 183;
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, startPosX, 60, 274, 353, _vm->_graphicsMan->_frontBuffer, startPosX, 60);
|
||||
_vm->_graphicsMan->addDirtyRect(startPosX, 60, startPosX + 274, 413);
|
||||
_vm->_objectsMan->_refreshBobMode10Fl = true;
|
||||
_vm->_objectsMan->_saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsMan->_saveLoadSprite);
|
||||
_vm->_objectsMan->_saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsMan->_saveLoadSprite2);
|
||||
_vm->_objectsMan->_saveLoadX = 0;
|
||||
_vm->_objectsMan->_saveLoadY = 0;
|
||||
|
||||
if (slotNumber != 7) {
|
||||
// Since the original GUI doesn't support save names, use a default name
|
||||
Common::String saveName = Common::String::format("Save #%d", slotNumber);
|
||||
|
||||
// Save the game
|
||||
_vm->_saveLoadManager->saveGame(slotNumber, saveName);
|
||||
_vm->_saveLoad->saveGame(slotNumber, saveName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -663,50 +663,50 @@ void DialogsManager::showSaveLoad(SaveLoadMode mode) {
|
|||
}
|
||||
}
|
||||
|
||||
_vm->_objectsManager->_saveLoadSprite = _vm->_objectsManager->loadSprite(filename);
|
||||
_vm->_objectsManager->_saveLoadSprite2 = _vm->_objectsManager->loadSprite("SAVE2.SPR");
|
||||
int16 startPosX = _vm->_eventsManager->_startPos.x;
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_saveLoadSprite, startPosX + 483, 360, 0);
|
||||
_vm->_objectsMan->_saveLoadSprite = _vm->_objectsMan->loadSprite(filename);
|
||||
_vm->_objectsMan->_saveLoadSprite2 = _vm->_objectsMan->loadSprite("SAVE2.SPR");
|
||||
int16 startPosX = _vm->_events->_startPos.x;
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_saveLoadSprite, startPosX + 483, 360, 0);
|
||||
|
||||
if (_vm->_globals->_language == LANG_FR) {
|
||||
if (mode == MODE_SAVE)
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_saveLoadSprite, startPosX + 525, 375, 1);
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_saveLoadSprite, startPosX + 525, 375, 1);
|
||||
else if (mode == MODE_LOAD)
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_saveLoadSprite, startPosX + 515, 375, 2);
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_saveLoadSprite, startPosX + 515, 375, 2);
|
||||
} else {
|
||||
if (mode == MODE_SAVE)
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_saveLoadSprite, startPosX + 535, 372, 1);
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_saveLoadSprite, startPosX + 535, 372, 1);
|
||||
else if (mode == MODE_LOAD)
|
||||
_vm->_graphicsManager->drawVesaSprite(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_saveLoadSprite, startPosX + 539, 372, 2);
|
||||
_vm->_graphicsMan->drawVesaSprite(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_saveLoadSprite, startPosX + 539, 372, 2);
|
||||
}
|
||||
|
||||
for (int slotNumber = 1; slotNumber <= 6; ++slotNumber) {
|
||||
hopkinsSavegameHeader header;
|
||||
if (_vm->_saveLoadManager->readSavegameHeader(slotNumber, header)) {
|
||||
if (_vm->_saveLoad->readSavegameHeader(slotNumber, header)) {
|
||||
Graphics::Surface thumb8;
|
||||
_vm->_saveLoadManager->convertThumb16To8(header._thumbnail, &thumb8);
|
||||
_vm->_saveLoad->convertThumb16To8(header._thumbnail, &thumb8);
|
||||
|
||||
byte *thumb = (byte *)thumb8.pixels;
|
||||
|
||||
int16 startPosX = _vm->_eventsManager->_startPos.x;
|
||||
int16 startPosX = _vm->_events->_startPos.x;
|
||||
switch (slotNumber) {
|
||||
case 1:
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, thumb, startPosX + 190, 112, 128, 87);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, thumb, startPosX + 190, 112, 128, 87);
|
||||
break;
|
||||
case 2:
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, thumb, startPosX + 323, 112, 128, 87);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, thumb, startPosX + 323, 112, 128, 87);
|
||||
break;
|
||||
case 3:
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, thumb, startPosX + 190, 203, 128, 87);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, thumb, startPosX + 190, 203, 128, 87);
|
||||
break;
|
||||
case 4:
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, thumb, startPosX + 323, 203, 128, 87);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, thumb, startPosX + 323, 203, 128, 87);
|
||||
break;
|
||||
case 5:
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, thumb, startPosX + 190, 294, 128, 87);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, thumb, startPosX + 190, 294, 128, 87);
|
||||
break;
|
||||
case 6:
|
||||
_vm->_graphicsManager->restoreSurfaceRect(_vm->_graphicsManager->_frontBuffer, thumb, startPosX + 323, 294, 128, 87);
|
||||
_vm->_graphicsMan->restoreSurfaceRect(_vm->_graphicsMan->_frontBuffer, thumb, startPosX + 323, 294, 128, 87);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -716,60 +716,60 @@ void DialogsManager::showSaveLoad(SaveLoadMode mode) {
|
|||
}
|
||||
}
|
||||
|
||||
_vm->_graphicsManager->copySurfaceRect(_vm->_graphicsManager->_frontBuffer, _vm->_objectsManager->_saveLoadSprite, _vm->_eventsManager->_startPos.x + 183, 60, 274, 353);
|
||||
_vm->_objectsManager->_saveLoadFl = true;
|
||||
_vm->_objectsManager->_saveLoadX = 0;
|
||||
_vm->_objectsManager->_saveLoadY = 0;
|
||||
_vm->_graphicsMan->copySurfaceRect(_vm->_graphicsMan->_frontBuffer, _vm->_objectsMan->_saveLoadSprite, _vm->_events->_startPos.x + 183, 60, 274, 353);
|
||||
_vm->_objectsMan->_saveLoadFl = true;
|
||||
_vm->_objectsMan->_saveLoadX = 0;
|
||||
_vm->_objectsMan->_saveLoadY = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search savegames
|
||||
*/
|
||||
int DialogsManager::searchSavegames() {
|
||||
int xp = _vm->_eventsManager->getMouseX();
|
||||
int yp = _vm->_eventsManager->getMouseY();
|
||||
int xp = _vm->_events->getMouseX();
|
||||
int yp = _vm->_events->getMouseY();
|
||||
|
||||
int16 startPosX = _vm->_graphicsManager->_scrollOffset = _vm->_eventsManager->_startPos.x;
|
||||
int16 startPosX = _vm->_graphicsMan->_scrollOffset = _vm->_events->_startPos.x;
|
||||
|
||||
int slotNumber = 0;
|
||||
if (yp >= 112 && yp <= 198) {
|
||||
if (xp > startPosX + 189 && xp < startPosX + 318) {
|
||||
slotNumber = 1;
|
||||
_vm->_objectsManager->_saveLoadX = 189;
|
||||
_vm->_objectsManager->_saveLoadY = 111;
|
||||
_vm->_objectsMan->_saveLoadX = 189;
|
||||
_vm->_objectsMan->_saveLoadY = 111;
|
||||
} else if (xp > startPosX + 322 && xp < startPosX + 452) {
|
||||
slotNumber = 2;
|
||||
_vm->_objectsManager->_saveLoadX = 322;
|
||||
_vm->_objectsManager->_saveLoadY = 111;
|
||||
_vm->_objectsMan->_saveLoadX = 322;
|
||||
_vm->_objectsMan->_saveLoadY = 111;
|
||||
}
|
||||
} else if (yp >= 203 && yp <= 289) {
|
||||
if (xp > startPosX + 189 && xp < startPosX + 318) {
|
||||
slotNumber = 3;
|
||||
_vm->_objectsManager->_saveLoadX = 189;
|
||||
_vm->_objectsManager->_saveLoadY = 202;
|
||||
_vm->_objectsMan->_saveLoadX = 189;
|
||||
_vm->_objectsMan->_saveLoadY = 202;
|
||||
} else if (xp > startPosX + 322 && xp < startPosX + 452) {
|
||||
slotNumber = 4;
|
||||
_vm->_objectsManager->_saveLoadX = 322;
|
||||
_vm->_objectsManager->_saveLoadY = 202;
|
||||
_vm->_objectsMan->_saveLoadX = 322;
|
||||
_vm->_objectsMan->_saveLoadY = 202;
|
||||
}
|
||||
} else if (yp >= 294 && yp <= 380) {
|
||||
if (xp > startPosX + 189 && xp < startPosX + 318) {
|
||||
slotNumber = 5;
|
||||
_vm->_objectsManager->_saveLoadX = 189;
|
||||
_vm->_objectsManager->_saveLoadY = 293;
|
||||
_vm->_objectsMan->_saveLoadX = 189;
|
||||
_vm->_objectsMan->_saveLoadY = 293;
|
||||
} else if (xp > startPosX + 322 && xp < startPosX + 452) {
|
||||
slotNumber = 6;
|
||||
_vm->_objectsManager->_saveLoadX = 322;
|
||||
_vm->_objectsManager->_saveLoadY = 293;
|
||||
_vm->_objectsMan->_saveLoadX = 322;
|
||||
_vm->_objectsMan->_saveLoadY = 293;
|
||||
}
|
||||
} else if (yp >= 388 && yp <= 404 && xp > startPosX + 273 && xp < startPosX + 355) {
|
||||
slotNumber = 7;
|
||||
_vm->_objectsManager->_saveLoadX = 0;
|
||||
_vm->_objectsManager->_saveLoadY = 0;
|
||||
_vm->_objectsMan->_saveLoadX = 0;
|
||||
_vm->_objectsMan->_saveLoadY = 0;
|
||||
} else {
|
||||
slotNumber = 0;
|
||||
_vm->_objectsManager->_saveLoadX = 0;
|
||||
_vm->_objectsManager->_saveLoadY = 0;
|
||||
_vm->_objectsMan->_saveLoadX = 0;
|
||||
_vm->_objectsMan->_saveLoadY = 0;
|
||||
}
|
||||
|
||||
return slotNumber;
|
||||
|
|
|
@ -84,18 +84,18 @@ void EventsManager::initMouseData() {
|
|||
switch (_vm->_globals->_language) {
|
||||
case LANG_EN:
|
||||
if (!_mouseLinuxFl)
|
||||
_mouseCursor = _vm->_fileManager->loadFile("SOUAN.SPR");
|
||||
_mouseCursor = _vm->_fileIO->loadFile("SOUAN.SPR");
|
||||
else
|
||||
_mouseCursor = _vm->_fileManager->loadFile("LSOUAN.SPR");
|
||||
_mouseCursor = _vm->_fileIO->loadFile("LSOUAN.SPR");
|
||||
break;
|
||||
case LANG_FR:
|
||||
if (!_mouseLinuxFl)
|
||||
_mouseCursor = _vm->_fileManager->loadFile("SOUFR.SPR");
|
||||
_mouseCursor = _vm->_fileIO->loadFile("SOUFR.SPR");
|
||||
else
|
||||
_mouseCursor = _vm->_fileManager->loadFile("LSOUFR.SPR");
|
||||
_mouseCursor = _vm->_fileIO->loadFile("LSOUFR.SPR");
|
||||
break;
|
||||
case LANG_SP:
|
||||
_mouseCursor = _vm->_fileManager->loadFile("SOUES.SPR");
|
||||
_mouseCursor = _vm->_fileIO->loadFile("SOUES.SPR");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ void EventsManager::changeMouseCursor(int id) {
|
|||
* Check Events
|
||||
*/
|
||||
void EventsManager::refreshEvents() {
|
||||
_vm->_soundManager->checkSounds();
|
||||
_vm->_soundMan->checkSounds();
|
||||
|
||||
pollEvents();
|
||||
}
|
||||
|
@ -227,10 +227,10 @@ void EventsManager::checkForNextFrameCounter() {
|
|||
if ((milli - _priorFrameTime) >= GAME_FRAME_TIME) {
|
||||
++_gameCounter;
|
||||
_priorFrameTime = milli;
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
|
||||
// Signal the ScummVM debugger
|
||||
_vm->_debugger->onFrame();
|
||||
_vm->_debug->onFrame();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,8 +297,8 @@ void EventsManager::handleKey(Common::Event &event) {
|
|||
// Check for debugger
|
||||
if ((event.kbd.keycode == Common::KEYCODE_d) && (event.kbd.flags & Common::KBD_CTRL)) {
|
||||
// Attach to the debugger
|
||||
_vm->_debugger->attach();
|
||||
_vm->_debugger->onFrame();
|
||||
_vm->_debug->attach();
|
||||
_vm->_debug->onFrame();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -372,28 +372,28 @@ void EventsManager::refreshScreenAndEvents() {
|
|||
width = _mouseSizeX;
|
||||
height = _mouseSizeY;
|
||||
if (_mouseCursorId == 23) {
|
||||
width = _vm->_objectsManager->getObjectWidth();
|
||||
height = _vm->_objectsManager->getObjectHeight();
|
||||
width = _vm->_objectsMan->getObjectWidth();
|
||||
height = _vm->_objectsMan->getObjectHeight();
|
||||
} else {
|
||||
if (_breakoutFl) {
|
||||
if (xp < _vm->_graphicsManager->_minX)
|
||||
xp = _vm->_graphicsManager->_minX;
|
||||
if (_mousePos.y < _vm->_graphicsManager->_minY)
|
||||
yp = _vm->_graphicsManager->_minY;
|
||||
if (_mouseSizeX + xp >= _vm->_graphicsManager->_maxX)
|
||||
width = _mouseSizeX - (_mouseSizeX + xp - _vm->_graphicsManager->_maxX);
|
||||
if (yp + _mouseSizeY >= _vm->_graphicsManager->_maxY)
|
||||
height = _vm->_graphicsManager->_maxY - yp;
|
||||
if (xp < _vm->_graphicsMan->_minX)
|
||||
xp = _vm->_graphicsMan->_minX;
|
||||
if (_mousePos.y < _vm->_graphicsMan->_minY)
|
||||
yp = _vm->_graphicsMan->_minY;
|
||||
if (_mouseSizeX + xp >= _vm->_graphicsMan->_maxX)
|
||||
width = _mouseSizeX - (_mouseSizeX + xp - _vm->_graphicsMan->_maxX);
|
||||
if (yp + _mouseSizeY >= _vm->_graphicsMan->_maxY)
|
||||
height = _vm->_graphicsMan->_maxY - yp;
|
||||
} else {
|
||||
if (xp < _vm->_graphicsManager->_minX)
|
||||
xp = _vm->_graphicsManager->_minX - mouseWidth;
|
||||
if (xp < _vm->_graphicsMan->_minX)
|
||||
xp = _vm->_graphicsMan->_minX - mouseWidth;
|
||||
mouseHeight = (int16)mouseHeight;
|
||||
if (_mousePos.y < _vm->_graphicsManager->_minY - mouseHeight)
|
||||
yp = _vm->_graphicsManager->_minY - mouseHeight;
|
||||
if (_mouseSizeX + xp >= _vm->_graphicsManager->_maxX)
|
||||
width = _mouseSizeX - (_mouseSizeX + xp - _vm->_graphicsManager->_maxX - mouseWidth);
|
||||
if (yp + _mouseSizeY >= mouseHeight + _vm->_graphicsManager->_maxY)
|
||||
height = _vm->_graphicsManager->_maxY - mouseHeight - yp;
|
||||
if (_mousePos.y < _vm->_graphicsMan->_minY - mouseHeight)
|
||||
yp = _vm->_graphicsMan->_minY - mouseHeight;
|
||||
if (_mouseSizeX + xp >= _vm->_graphicsMan->_maxX)
|
||||
width = _mouseSizeX - (_mouseSizeX + xp - _vm->_graphicsMan->_maxX - mouseWidth);
|
||||
if (yp + _mouseSizeY >= mouseHeight + _vm->_graphicsMan->_maxY)
|
||||
height = _vm->_graphicsMan->_maxY - mouseHeight - yp;
|
||||
}
|
||||
right = xp + width;
|
||||
bottom = yp + height;
|
||||
|
@ -401,22 +401,22 @@ void EventsManager::refreshScreenAndEvents() {
|
|||
}
|
||||
|
||||
if (!_vm->_globals->_linuxEndDemoFl)
|
||||
_vm->_objectsManager->displaySprite();
|
||||
_vm->_objectsMan->displaySprite();
|
||||
if (!_mouseFl) {
|
||||
updateCursor();
|
||||
} else if (_mouseCursorId == 23) {
|
||||
if (yp < _vm->_graphicsManager->_maxY && xp < _vm->_graphicsManager->_maxX) {
|
||||
if (width + xp > _vm->_graphicsManager->_maxX)
|
||||
width = _vm->_graphicsManager->_maxX - xp;
|
||||
if (yp + height > _vm->_graphicsManager->_maxY)
|
||||
height = _vm->_graphicsManager->_maxY - yp;
|
||||
if (yp < _vm->_graphicsMan->_maxY && xp < _vm->_graphicsMan->_maxX) {
|
||||
if (width + xp > _vm->_graphicsMan->_maxX)
|
||||
width = _vm->_graphicsMan->_maxX - xp;
|
||||
if (yp + height > _vm->_graphicsMan->_maxY)
|
||||
height = _vm->_graphicsMan->_maxY - yp;
|
||||
if (width > 1 && height > 1) {
|
||||
updateCursor();
|
||||
}
|
||||
}
|
||||
} else if (yp < _vm->_graphicsManager->_maxY && xp < _vm->_graphicsManager->_maxX && width > 1 && height > 1) {
|
||||
} else if (yp < _vm->_graphicsMan->_maxY && xp < _vm->_graphicsMan->_maxX && width > 1 && height > 1) {
|
||||
updateCursor();
|
||||
_vm->_graphicsManager->addDirtyRect(xp, yp, right, bottom);
|
||||
_vm->_graphicsMan->addDirtyRect(xp, yp, right, bottom);
|
||||
}
|
||||
|
||||
_vm->_globals->_speed = 2;
|
||||
|
@ -450,76 +450,76 @@ void EventsManager::refreshScreenAndEvents() {
|
|||
} while (!_vm->shouldQuit() && _vm->_globals->_eventMode == 3 && _rateCounter <= 15);
|
||||
_vm->_globals->_speed = 2;
|
||||
_rateCounter = 0;
|
||||
if (!_vm->_graphicsManager->_largeScreenFl || _vm->_graphicsManager->_scrollStatus == 1) {
|
||||
_vm->_graphicsManager->displayDirtyRects();
|
||||
if (!_vm->_graphicsMan->_largeScreenFl || _vm->_graphicsMan->_scrollStatus == 1) {
|
||||
_vm->_graphicsMan->displayDirtyRects();
|
||||
} else {
|
||||
if (_vm->_graphicsManager->_scrollStatus != 2) {
|
||||
if (getMouseX() > _vm->_graphicsManager->_scrollPosX + 620)
|
||||
_vm->_graphicsManager->_scrollPosX += _vm->_graphicsManager->_scrollSpeed;
|
||||
if (getMouseX() < _vm->_graphicsManager->_scrollPosX + 10)
|
||||
_vm->_graphicsManager->_scrollPosX -= _vm->_graphicsManager->_scrollSpeed;
|
||||
if (_vm->_graphicsMan->_scrollStatus != 2) {
|
||||
if (getMouseX() > _vm->_graphicsMan->_scrollPosX + 620)
|
||||
_vm->_graphicsMan->_scrollPosX += _vm->_graphicsMan->_scrollSpeed;
|
||||
if (getMouseX() < _vm->_graphicsMan->_scrollPosX + 10)
|
||||
_vm->_graphicsMan->_scrollPosX -= _vm->_graphicsMan->_scrollSpeed;
|
||||
}
|
||||
_vm->_graphicsManager->_scrollPosX = CLIP(_vm->_graphicsManager->_scrollPosX, 0, SCREEN_WIDTH);
|
||||
if (_vm->_graphicsManager->_oldScrollPosX == _vm->_graphicsManager->_scrollPosX) {
|
||||
_vm->_graphicsManager->displayDirtyRects();
|
||||
_vm->_graphicsMan->_scrollPosX = CLIP(_vm->_graphicsMan->_scrollPosX, 0, SCREEN_WIDTH);
|
||||
if (_vm->_graphicsMan->_oldScrollPosX == _vm->_graphicsMan->_scrollPosX) {
|
||||
_vm->_graphicsMan->displayDirtyRects();
|
||||
} else {
|
||||
_vm->_fontManager->hideText(9);
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(_vm->_graphicsManager->_frontBuffer, _vm->_graphicsManager->_scrollPosX, 20, SCREEN_WIDTH, 440, 0, 20);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_fontMan->hideText(9);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(_vm->_graphicsMan->_frontBuffer, _vm->_graphicsMan->_scrollPosX, 20, SCREEN_WIDTH, 440, 0, 20);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
|
||||
_vm->_graphicsManager->resetRefreshRects();
|
||||
_vm->_graphicsManager->addRefreshRect(0, 20, SCREEN_WIDTH, SCREEN_HEIGHT - 20);
|
||||
_vm->_graphicsMan->resetRefreshRects();
|
||||
_vm->_graphicsMan->addRefreshRect(0, 20, SCREEN_WIDTH, SCREEN_HEIGHT - 20);
|
||||
|
||||
_vm->_graphicsManager->resetDirtyRects();
|
||||
_vm->_graphicsMan->resetDirtyRects();
|
||||
|
||||
_startPos.x = _vm->_graphicsManager->_scrollPosX;
|
||||
_vm->_graphicsManager->_scrollOffset = _vm->_graphicsManager->_scrollPosX;
|
||||
_startPos.x = _vm->_graphicsMan->_scrollPosX;
|
||||
_vm->_graphicsMan->_scrollOffset = _vm->_graphicsMan->_scrollPosX;
|
||||
}
|
||||
_vm->_graphicsManager->_oldScrollPosX = _vm->_graphicsManager->_scrollPosX;
|
||||
_startPos.x = _vm->_graphicsManager->_scrollPosX;
|
||||
_vm->_graphicsManager->_scrollOffset = _vm->_graphicsManager->_scrollPosX;
|
||||
_vm->_graphicsMan->_oldScrollPosX = _vm->_graphicsMan->_scrollPosX;
|
||||
_startPos.x = _vm->_graphicsMan->_scrollPosX;
|
||||
_vm->_graphicsMan->_scrollOffset = _vm->_graphicsMan->_scrollPosX;
|
||||
}
|
||||
_curMouseButton = _mouseButton;
|
||||
_mouseButton = 0;
|
||||
_vm->_soundManager->checkSoundEnd();
|
||||
_vm->_soundMan->checkSoundEnd();
|
||||
refreshEvents();
|
||||
}
|
||||
|
||||
void EventsManager::updateCursor() {
|
||||
// Backup the current sprite clipping bounds and reset them
|
||||
Common::Rect clipBounds(_vm->_graphicsManager->_minX, _vm->_graphicsManager->_minY,
|
||||
_vm->_graphicsManager->_maxX, _vm->_graphicsManager->_maxY);
|
||||
_vm->_graphicsManager->_minX = _vm->_graphicsManager->_minY = 0;
|
||||
_vm->_graphicsManager->_maxX = _vm->_objectsManager->getObjectWidth();
|
||||
_vm->_graphicsManager->_maxY = _vm->_objectsManager->getObjectHeight();
|
||||
int pitch = _vm->_graphicsManager->_lineNbr2;
|
||||
_vm->_graphicsManager->_lineNbr2 = _vm->_objectsManager->getObjectWidth();
|
||||
Common::Rect clipBounds(_vm->_graphicsMan->_minX, _vm->_graphicsMan->_minY,
|
||||
_vm->_graphicsMan->_maxX, _vm->_graphicsMan->_maxY);
|
||||
_vm->_graphicsMan->_minX = _vm->_graphicsMan->_minY = 0;
|
||||
_vm->_graphicsMan->_maxX = _vm->_objectsMan->getObjectWidth();
|
||||
_vm->_graphicsMan->_maxY = _vm->_objectsMan->getObjectHeight();
|
||||
int pitch = _vm->_graphicsMan->_lineNbr2;
|
||||
_vm->_graphicsMan->_lineNbr2 = _vm->_objectsMan->getObjectWidth();
|
||||
|
||||
// Create the temporary cursor surface
|
||||
byte *cursorSurface = new byte[_vm->_objectsManager->getObjectHeight() * _vm->_objectsManager->getObjectWidth()];
|
||||
Common::fill(cursorSurface, cursorSurface + _vm->_objectsManager->getObjectHeight() * _vm->_objectsManager->getObjectWidth(), 0);
|
||||
byte *cursorSurface = new byte[_vm->_objectsMan->getObjectHeight() * _vm->_objectsMan->getObjectWidth()];
|
||||
Common::fill(cursorSurface, cursorSurface + _vm->_objectsMan->getObjectHeight() * _vm->_objectsMan->getObjectWidth(), 0);
|
||||
|
||||
if (_mouseCursorId != 23) {
|
||||
// Draw standard cursor
|
||||
_vm->_graphicsManager->drawVesaSprite(cursorSurface, _mouseCursor, 300, 300, _mouseSpriteId);
|
||||
_vm->_graphicsMan->drawVesaSprite(cursorSurface, _mouseCursor, 300, 300, _mouseSpriteId);
|
||||
} else {
|
||||
// Draw the active inventory object
|
||||
_vm->_graphicsManager->drawCompressedSprite(cursorSurface, _objectBuf, 300, 300, 0, 0, 0, false);
|
||||
_vm->_graphicsMan->drawCompressedSprite(cursorSurface, _objectBuf, 300, 300, 0, 0, 0, false);
|
||||
}
|
||||
|
||||
// Reset the clipping bounds
|
||||
_vm->_graphicsManager->_minX = clipBounds.left;
|
||||
_vm->_graphicsManager->_minY = clipBounds.top;
|
||||
_vm->_graphicsManager->_maxX = clipBounds.right;
|
||||
_vm->_graphicsManager->_maxY = clipBounds.bottom;
|
||||
_vm->_graphicsManager->_lineNbr2 = pitch;
|
||||
_vm->_graphicsMan->_minX = clipBounds.left;
|
||||
_vm->_graphicsMan->_minY = clipBounds.top;
|
||||
_vm->_graphicsMan->_maxX = clipBounds.right;
|
||||
_vm->_graphicsMan->_maxY = clipBounds.bottom;
|
||||
_vm->_graphicsMan->_lineNbr2 = pitch;
|
||||
|
||||
// Create a cursor palette
|
||||
Graphics::PixelFormat pixelFormat = g_system->getScreenFormat();
|
||||
|
||||
byte *cursorPalette = new byte[3 * PALETTE_SIZE];
|
||||
uint16 *paletteColors = (uint16 *)_vm->_graphicsManager->_palettePixels;
|
||||
uint16 *paletteColors = (uint16 *)_vm->_graphicsMan->_palettePixels;
|
||||
|
||||
for (int i = 0; i < PALETTE_SIZE; i++) {
|
||||
uint8 r, g, b;
|
||||
|
@ -534,7 +534,7 @@ void EventsManager::updateCursor() {
|
|||
|
||||
// Set the ScummVM cursor from the surface
|
||||
CursorMan.replaceCursorPalette(cursorPalette, 0, PALETTE_SIZE - 1);
|
||||
CursorMan.replaceCursor(cursorSurface, _vm->_objectsManager->getObjectWidth(), _vm->_objectsManager->getObjectHeight(),
|
||||
CursorMan.replaceCursor(cursorSurface, _vm->_objectsMan->getObjectWidth(), _vm->_objectsMan->getObjectHeight(),
|
||||
xOffset, 0, 0, true);
|
||||
|
||||
// Delete the cursor surface and palette
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,20 +168,20 @@ void Globals::setConfig() {
|
|||
}
|
||||
|
||||
void Globals::clearAll() {
|
||||
_vm->_fontManager->clearAll();
|
||||
_vm->_dialogsManager->clearAll();
|
||||
_vm->_fontMan->clearAll();
|
||||
_vm->_dialog->clearAll();
|
||||
_answerBuffer = NULL;
|
||||
_levelSpriteBuf = NULL;
|
||||
_saveData = NULL;
|
||||
_vm->_objectsManager->_curObjectIndex = 0;
|
||||
_vm->_objectsMan->_curObjectIndex = 0;
|
||||
|
||||
_vm->_linesManager->clearAll();
|
||||
_vm->_objectsManager->clearAll();
|
||||
_vm->_linesMan->clearAll();
|
||||
_vm->_objectsMan->clearAll();
|
||||
|
||||
_saveData = (Savegame *)malloc(sizeof(Savegame));
|
||||
memset(_saveData, 0, sizeof(Savegame));
|
||||
|
||||
_vm->_eventsManager->clearAll();
|
||||
_vm->_events->clearAll();
|
||||
}
|
||||
|
||||
void Globals::loadCharacterData() {
|
||||
|
@ -195,8 +195,8 @@ void Globals::loadCharacterData() {
|
|||
_hopkinsItem[idx]._speedY = *srcP++;
|
||||
}
|
||||
|
||||
_vm->_objectsManager->resetOldFrameIndex();
|
||||
_vm->_objectsManager->resetOldDirection();
|
||||
_vm->_objectsMan->resetOldFrameIndex();
|
||||
_vm->_objectsMan->resetOldDirection();
|
||||
}
|
||||
|
||||
byte *Globals::allocMemory(int count) {
|
||||
|
|
|
@ -202,7 +202,7 @@ void GraphicsManager::loadScreen(const Common::String &file) {
|
|||
|
||||
bool flag = true;
|
||||
bool fileFoundFl = false;
|
||||
_vm->_fileManager->searchCat(file, RES_PIC, fileFoundFl);
|
||||
_vm->_fileIO->searchCat(file, RES_PIC, fileFoundFl);
|
||||
if (!fileFoundFl) {
|
||||
if (!f.open(file))
|
||||
error("loadScreen - %s", file.c_str());
|
||||
|
@ -263,7 +263,7 @@ void GraphicsManager::initColorTable(int minIndex, int maxIndex, byte *palette)
|
|||
*/
|
||||
void GraphicsManager::scrollScreen(int amount) {
|
||||
int result = CLIP(amount, 0, SCREEN_WIDTH);
|
||||
_vm->_eventsManager->_startPos.x = result;
|
||||
_vm->_events->_startPos.x = result;
|
||||
_scrollOffset = result;
|
||||
_scrollPosX = result;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ void GraphicsManager::loadPCX640(byte *surface, const Common::String &file, byte
|
|||
// Load PCX from within the PIC resource
|
||||
if (!f.open("PIC.RES"))
|
||||
error("Error opening PIC.RES.");
|
||||
f.seek(_vm->_fileManager->_catalogPos);
|
||||
f.seek(_vm->_fileIO->_catalogPos);
|
||||
} else {
|
||||
// Load stand alone PCX file
|
||||
if (!f.open(file))
|
||||
|
@ -509,18 +509,18 @@ void GraphicsManager::fadeIn(const byte *palette, int step, const byte *surface)
|
|||
|
||||
// Set the transition palette and refresh the screen
|
||||
setPaletteVGA256(palData2);
|
||||
copy16BitRect(surface, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
copy16BitRect(surface, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
updateScreen();
|
||||
|
||||
// Added a delay in order to see the fading
|
||||
_vm->_eventsManager->delay(20);
|
||||
_vm->_events->delay(20);
|
||||
}
|
||||
|
||||
// Set the final palette
|
||||
setPaletteVGA256(palette);
|
||||
|
||||
// Refresh the screen
|
||||
copy16BitRect(surface, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
copy16BitRect(surface, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
updateScreen();
|
||||
}
|
||||
|
||||
|
@ -529,7 +529,7 @@ void GraphicsManager::fadeIn(const byte *palette, int step, const byte *surface)
|
|||
*/
|
||||
void GraphicsManager::fadeOut(const byte *palette, int step, const byte *surface) {
|
||||
byte palData[PALETTE_BLOCK_SIZE];
|
||||
if ((step > 1) && (palette) && (!_vm->_eventsManager->_escKeyFl)) {
|
||||
if ((step > 1) && (palette) && (!_vm->_events->_escKeyFl)) {
|
||||
int fadeStep = step;
|
||||
for (int fadeIndex = 0; fadeIndex < fadeStep; fadeIndex++) {
|
||||
for (int palOffset = 0; palOffset < PALETTE_BLOCK_SIZE; palOffset += 3) {
|
||||
|
@ -539,10 +539,10 @@ void GraphicsManager::fadeOut(const byte *palette, int step, const byte *surface
|
|||
}
|
||||
|
||||
setPaletteVGA256(palData);
|
||||
copy16BitRect(surface, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
copy16BitRect(surface, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
updateScreen();
|
||||
|
||||
_vm->_eventsManager->delay(20);
|
||||
_vm->_events->delay(20);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,7 +551,7 @@ void GraphicsManager::fadeOut(const byte *palette, int step, const byte *surface
|
|||
palData[i] = 0;
|
||||
|
||||
setPaletteVGA256(palData);
|
||||
copy16BitRect(surface, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
copy16BitRect(surface, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
|
||||
updateScreen();
|
||||
}
|
||||
|
@ -636,7 +636,7 @@ void GraphicsManager::setPaletteVGA256(const byte *palette) {
|
|||
|
||||
void GraphicsManager::setPaletteVGA256WithRefresh(const byte *palette, const byte *surface) {
|
||||
changePalette(palette);
|
||||
copy16BitRect(surface, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
copy16BitRect(surface, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
updateScreen();
|
||||
}
|
||||
|
||||
|
@ -1007,31 +1007,31 @@ void GraphicsManager::drawVesaSprite(byte *surface, const byte *spriteData, int
|
|||
|
||||
void GraphicsManager::endDisplayBob() {
|
||||
for (int idx = 1; idx <= 20; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsManager->hideBob(idx);
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsMan->hideBob(idx);
|
||||
}
|
||||
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
|
||||
for (int idx = 1; idx <= 20; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsManager->resetBob(idx);
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsMan->resetBob(idx);
|
||||
}
|
||||
|
||||
for (int idx = 1; idx <= 29; ++idx) {
|
||||
_vm->_objectsManager->_lockedAnims[idx]._enableFl = false;
|
||||
_vm->_objectsMan->_lockedAnims[idx]._enableFl = false;
|
||||
}
|
||||
|
||||
for (int idx = 1; idx <= 20; ++idx) {
|
||||
_vm->_animationManager->_animBqe[idx]._enabledFl = false;
|
||||
_vm->_animMan->_animBqe[idx]._enabledFl = false;
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsManager::displayAllBob() {
|
||||
for (int idx = 1; idx <= 20; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsManager->displayBob(idx);
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsMan->displayBob(idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1114,21 +1114,21 @@ void GraphicsManager::displayDirtyRects() {
|
|||
Common::Rect &r = _dirtyRects[idx];
|
||||
Common::Rect dstRect;
|
||||
|
||||
if (_vm->_eventsManager->_breakoutFl) {
|
||||
if (_vm->_events->_breakoutFl) {
|
||||
copy8BitRect(_frontBuffer, r.left, r.top, r.right - r.left, r.bottom - r.top, r.left, r.top);
|
||||
dstRect.left = r.left * 2;
|
||||
dstRect.top = r.top * 2 + 30;
|
||||
dstRect.setWidth((r.right - r.left) * 2);
|
||||
dstRect.setHeight((r.bottom - r.top) * 2);
|
||||
} else if (r.right > _vm->_eventsManager->_startPos.x && r.left < _vm->_eventsManager->_startPos.x + SCREEN_WIDTH) {
|
||||
r.left = MAX<int16>(r.left, _vm->_eventsManager->_startPos.x);
|
||||
r.right = MIN<int16>(r.right, (int16)_vm->_eventsManager->_startPos.x + SCREEN_WIDTH);
|
||||
} else if (r.right > _vm->_events->_startPos.x && r.left < _vm->_events->_startPos.x + SCREEN_WIDTH) {
|
||||
r.left = MAX<int16>(r.left, _vm->_events->_startPos.x);
|
||||
r.right = MIN<int16>(r.right, (int16)_vm->_events->_startPos.x + SCREEN_WIDTH);
|
||||
|
||||
// WORKAROUND: Original didn't lock the screen for access
|
||||
lockScreen();
|
||||
copy16BitRect(_frontBuffer, r.left, r.top, r.right - r.left, r.bottom - r.top, r.left - _vm->_eventsManager->_startPos.x, r.top);
|
||||
copy16BitRect(_frontBuffer, r.left, r.top, r.right - r.left, r.bottom - r.top, r.left - _vm->_events->_startPos.x, r.top);
|
||||
|
||||
dstRect.left = r.left - _vm->_eventsManager->_startPos.x;
|
||||
dstRect.left = r.left - _vm->_events->_startPos.x;
|
||||
dstRect.top = r.top;
|
||||
dstRect.setWidth(r.right - r.left);
|
||||
dstRect.setHeight(r.bottom - r.top);
|
||||
|
@ -1173,8 +1173,8 @@ void GraphicsManager::displayRefreshRects() {
|
|||
* Fast Display of either a compressed or vesa sprite
|
||||
*/
|
||||
void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex, bool addSegment) {
|
||||
int width = _vm->_objectsManager->getWidth(spriteData, spriteIndex);
|
||||
int height = _vm->_objectsManager->getHeight(spriteData, spriteIndex);
|
||||
int width = _vm->_objectsMan->getWidth(spriteData, spriteIndex);
|
||||
int height = _vm->_objectsMan->getHeight(spriteData, spriteIndex);
|
||||
|
||||
if (*spriteData == 78) {
|
||||
drawCompressedSprite(_backBuffer, spriteData, xp + 300, yp + 300, spriteIndex, 0, 0, false);
|
||||
|
@ -1188,8 +1188,8 @@ void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int sp
|
|||
}
|
||||
|
||||
void GraphicsManager::fastDisplay2(const byte *objectData, int xp, int yp, int idx, bool addSegment) {
|
||||
int width = _vm->_objectsManager->getWidth(objectData, idx);
|
||||
int height = _vm->_objectsManager->getHeight(objectData, idx);
|
||||
int width = _vm->_objectsMan->getWidth(objectData, idx);
|
||||
int height = _vm->_objectsMan->getHeight(objectData, idx);
|
||||
if (*objectData == 78) {
|
||||
drawCompressedSprite(_backBuffer, objectData, xp + 300, yp + 300, idx, 0, 0, false);
|
||||
drawCompressedSprite(_frontBuffer, objectData, xp + 300, yp + 300, idx, 0, 0, false);
|
||||
|
@ -1685,10 +1685,10 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init
|
|||
Common::String filename = file + ".ini";
|
||||
bool fileFoundFl = false;
|
||||
|
||||
byte *ptr = _vm->_fileManager->searchCat(filename, RES_INI, fileFoundFl);
|
||||
byte *ptr = _vm->_fileIO->searchCat(filename, RES_INI, fileFoundFl);
|
||||
|
||||
if (!fileFoundFl) {
|
||||
ptr = _vm->_fileManager->loadFile(filename);
|
||||
ptr = _vm->_fileIO->loadFile(filename);
|
||||
}
|
||||
|
||||
if (!mode) {
|
||||
|
@ -1696,11 +1696,11 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init
|
|||
_vm->_globals->_levelSpriteBuf = _vm->_globals->freeMemory(_vm->_globals->_levelSpriteBuf);
|
||||
if (initializeScreen) {
|
||||
fileFoundFl = false;
|
||||
_vm->_globals->_levelSpriteBuf = _vm->_fileManager->searchCat(filename, RES_SLI, fileFoundFl);
|
||||
_vm->_globals->_levelSpriteBuf = _vm->_fileIO->searchCat(filename, RES_SLI, fileFoundFl);
|
||||
if (!fileFoundFl) {
|
||||
_vm->_globals->_levelSpriteBuf = _vm->_fileManager->loadFile(filename);
|
||||
_vm->_globals->_levelSpriteBuf = _vm->_fileIO->loadFile(filename);
|
||||
} else {
|
||||
_vm->_globals->_levelSpriteBuf = _vm->_fileManager->loadFile("RES_SLI.RES");
|
||||
_vm->_globals->_levelSpriteBuf = _vm->_fileIO->loadFile("RES_SLI.RES");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1711,14 +1711,14 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init
|
|||
int dataOffset = 1;
|
||||
|
||||
do {
|
||||
int dataVal1 = _vm->_scriptManager->handleOpcode(ptr + 20 * dataOffset);
|
||||
int dataVal1 = _vm->_script->handleOpcode(ptr + 20 * dataOffset);
|
||||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
if (dataVal1 == 2)
|
||||
dataOffset = _vm->_scriptManager->handleGoto((ptr + 20 * dataOffset));
|
||||
dataOffset = _vm->_script->handleGoto((ptr + 20 * dataOffset));
|
||||
if (dataVal1 == 3)
|
||||
dataOffset = _vm->_scriptManager->handleIf(ptr, dataOffset);
|
||||
dataOffset = _vm->_script->handleIf(ptr, dataOffset);
|
||||
if (dataOffset == -1)
|
||||
error("Error, defective IFF");
|
||||
if (dataVal1 == 1 || dataVal1 == 4)
|
||||
|
@ -1732,13 +1732,13 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init
|
|||
|
||||
filename = file + ".rep";
|
||||
fileFoundFl = false;
|
||||
byte *dataP = _vm->_fileManager->searchCat(filename, RES_REP, fileFoundFl);
|
||||
byte *dataP = _vm->_fileIO->searchCat(filename, RES_REP, fileFoundFl);
|
||||
if (!fileFoundFl)
|
||||
dataP = _vm->_fileManager->loadFile(filename);
|
||||
dataP = _vm->_fileIO->loadFile(filename);
|
||||
|
||||
_vm->_globals->_answerBuffer = dataP;
|
||||
_vm->_objectsManager->_forceZoneFl = true;
|
||||
_vm->_objectsManager->_changeVerbFl = false;
|
||||
_vm->_objectsMan->_forceZoneFl = true;
|
||||
_vm->_objectsMan->_changeVerbFl = false;
|
||||
}
|
||||
|
||||
void GraphicsManager::displayScreen(bool initPalette) {
|
||||
|
@ -1751,7 +1751,7 @@ void GraphicsManager::displayScreen(bool initPalette) {
|
|||
fillSurface(_frontBuffer, _colorTable, SCREEN_WIDTH * SCREEN_HEIGHT * 2);
|
||||
|
||||
lockScreen();
|
||||
copy16BitRect(_frontBuffer, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
copy16BitRect(_frontBuffer, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
unlockScreen();
|
||||
|
||||
memcpy(_backBuffer, _frontBuffer, 614399);
|
||||
|
@ -1841,24 +1841,24 @@ void GraphicsManager::drawVerticalLine(byte *surface, int xp, int yp, int height
|
|||
*/
|
||||
void GraphicsManager::backupScreen() {
|
||||
// Allocate a new data block for the screen, if necessary
|
||||
if (_vm->_graphicsManager->_backupScreen == NULL)
|
||||
_vm->_graphicsManager->_backupScreen = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT);
|
||||
if (_vm->_graphicsMan->_backupScreen == NULL)
|
||||
_vm->_graphicsMan->_backupScreen = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT);
|
||||
|
||||
// Backup the screen
|
||||
Common::copy(_vm->_graphicsManager->_backBuffer, _vm->_graphicsManager->_backBuffer +
|
||||
SCREEN_WIDTH * 2 * SCREEN_HEIGHT, _vm->_graphicsManager->_backupScreen);
|
||||
Common::copy(_vm->_graphicsMan->_backBuffer, _vm->_graphicsMan->_backBuffer +
|
||||
SCREEN_WIDTH * 2 * SCREEN_HEIGHT, _vm->_graphicsMan->_backupScreen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore a previously backed up screen
|
||||
*/
|
||||
void GraphicsManager::restoreScreen() {
|
||||
assert(_vm->_graphicsManager->_backupScreen);
|
||||
assert(_vm->_graphicsMan->_backupScreen);
|
||||
|
||||
// Restore the screen and free the buffer
|
||||
Common::copy(_vm->_graphicsManager->_backupScreen, _vm->_graphicsManager->_backupScreen +
|
||||
SCREEN_WIDTH * 2 * SCREEN_HEIGHT, _vm->_graphicsManager->_backBuffer);
|
||||
_vm->_globals->freeMemory(_vm->_graphicsManager->_backupScreen);
|
||||
Common::copy(_vm->_graphicsMan->_backupScreen, _vm->_graphicsMan->_backupScreen +
|
||||
SCREEN_WIDTH * 2 * SCREEN_HEIGHT, _vm->_graphicsMan->_backBuffer);
|
||||
_vm->_globals->freeMemory(_vm->_graphicsMan->_backupScreen);
|
||||
_backupScreen = NULL;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -142,22 +142,22 @@ protected:
|
|||
virtual bool hasFeature(EngineFeature f) const;
|
||||
|
||||
public:
|
||||
AnimationManager *_animationManager;
|
||||
ComputerManager *_computerManager;
|
||||
DialogsManager *_dialogsManager;
|
||||
Debugger *_debugger;
|
||||
EventsManager *_eventsManager;
|
||||
FileManager *_fileManager;
|
||||
FontManager *_fontManager;
|
||||
AnimationManager *_animMan;
|
||||
ComputerManager *_computer;
|
||||
DialogsManager *_dialog;
|
||||
Debugger *_debug;
|
||||
EventsManager *_events;
|
||||
FileManager *_fileIO;
|
||||
FontManager *_fontMan;
|
||||
Globals *_globals;
|
||||
GraphicsManager *_graphicsManager;
|
||||
LinesManager *_linesManager;
|
||||
MenuManager *_menuManager;
|
||||
ObjectsManager *_objectsManager;
|
||||
SaveLoadManager *_saveLoadManager;
|
||||
ScriptManager *_scriptManager;
|
||||
SoundManager *_soundManager;
|
||||
TalkManager *_talkManager;
|
||||
GraphicsManager *_graphicsMan;
|
||||
LinesManager *_linesMan;
|
||||
MenuManager *_menuMan;
|
||||
ObjectsManager *_objectsMan;
|
||||
SaveLoadManager *_saveLoad;
|
||||
ScriptManager *_script;
|
||||
SoundManager *_soundMan;
|
||||
TalkManager *_talkMan;
|
||||
|
||||
public:
|
||||
HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDesc);
|
||||
|
|
|
@ -121,7 +121,7 @@ void LinesManager::loadLines(const Common::String &file) {
|
|||
resetLines();
|
||||
_linesNumb = 0;
|
||||
_lastLine = 0;
|
||||
byte *ptr = _vm->_fileManager->loadFile(file);
|
||||
byte *ptr = _vm->_fileIO->loadFile(file);
|
||||
for (int idx = 0; READ_LE_INT16((uint16 *)ptr + (idx * 5)) != -1; idx++) {
|
||||
addLine(idx,
|
||||
(Directions)READ_LE_INT16((uint16 *)ptr + (idx * 5)),
|
||||
|
@ -150,11 +150,11 @@ int LinesManager::checkInventoryHotspots(int posX, int posY) {
|
|||
hotspotId = checkInventoryHotspotsRow(posX, 19, false);
|
||||
if (posY >= 268 && posY <= 306)
|
||||
hotspotId = checkInventoryHotspotsRow(posX, 25, true);
|
||||
if (posY >= 268 && posY <= 288 && posX >= _vm->_graphicsManager->_scrollOffset + 424 && posX <= _vm->_graphicsManager->_scrollOffset + 478)
|
||||
if (posY >= 268 && posY <= 288 && posX >= _vm->_graphicsMan->_scrollOffset + 424 && posX <= _vm->_graphicsMan->_scrollOffset + 478)
|
||||
hotspotId = 30;
|
||||
if (posY >= 290 && posY <= 306 && posX >= _vm->_graphicsManager->_scrollOffset + 424 && posX <= _vm->_graphicsManager->_scrollOffset + 478)
|
||||
if (posY >= 290 && posY <= 306 && posX >= _vm->_graphicsMan->_scrollOffset + 424 && posX <= _vm->_graphicsMan->_scrollOffset + 478)
|
||||
hotspotId = 31;
|
||||
if (posY < 114 || posY > 306 || posX < _vm->_graphicsManager->_scrollOffset + 152 || posX > _vm->_graphicsManager->_scrollOffset + 484)
|
||||
if (posY < 114 || posY > 306 || posX < _vm->_graphicsMan->_scrollOffset + 152 || posX > _vm->_graphicsMan->_scrollOffset + 484)
|
||||
hotspotId = 32;
|
||||
|
||||
return hotspotId;
|
||||
|
@ -167,30 +167,30 @@ int LinesManager::checkInventoryHotspots(int posX, int posY) {
|
|||
int LinesManager::checkInventoryHotspotsRow(int posX, int minZoneNum, bool lastRow) {
|
||||
int result = minZoneNum;
|
||||
|
||||
if (posX >= _vm->_graphicsManager->_scrollOffset + 158 && posX < _vm->_graphicsManager->_scrollOffset + 208)
|
||||
if (posX >= _vm->_graphicsMan->_scrollOffset + 158 && posX < _vm->_graphicsMan->_scrollOffset + 208)
|
||||
return result;
|
||||
|
||||
if (posX >= _vm->_graphicsManager->_scrollOffset + 208 && posX < _vm->_graphicsManager->_scrollOffset + 266) {
|
||||
if (posX >= _vm->_graphicsMan->_scrollOffset + 208 && posX < _vm->_graphicsMan->_scrollOffset + 266) {
|
||||
result += 1;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (posX >= _vm->_graphicsManager->_scrollOffset + 266 && posX < _vm->_graphicsManager->_scrollOffset + 320) {
|
||||
if (posX >= _vm->_graphicsMan->_scrollOffset + 266 && posX < _vm->_graphicsMan->_scrollOffset + 320) {
|
||||
result += 2;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (posX >= _vm->_graphicsManager->_scrollOffset + 320 && posX < _vm->_graphicsManager->_scrollOffset + 370) {
|
||||
if (posX >= _vm->_graphicsMan->_scrollOffset + 320 && posX < _vm->_graphicsMan->_scrollOffset + 370) {
|
||||
result += 3;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (posX >= _vm->_graphicsManager->_scrollOffset + 370 && posX < _vm->_graphicsManager->_scrollOffset + 424) {
|
||||
if (posX >= _vm->_graphicsMan->_scrollOffset + 370 && posX < _vm->_graphicsMan->_scrollOffset + 424) {
|
||||
result += 4;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!lastRow && posX >= _vm->_graphicsManager->_scrollOffset + 424 && posX <= _vm->_graphicsManager->_scrollOffset + 478) {
|
||||
if (!lastRow && posX >= _vm->_graphicsMan->_scrollOffset + 424 && posX <= _vm->_graphicsMan->_scrollOffset + 478) {
|
||||
result += 5;
|
||||
return result;
|
||||
}
|
||||
|
@ -435,8 +435,8 @@ void LinesManager::initRoute() {
|
|||
|
||||
int curLineX = curLineData[2 * curDataIdx - 2];
|
||||
int curLineY = curLineData[2 * curDataIdx - 1];
|
||||
if (_vm->_graphicsManager->_maxX == curLineX || _vm->_graphicsManager->_maxY == curLineY ||
|
||||
_vm->_graphicsManager->_minX == curLineX || _vm->_graphicsManager->_minY == curLineY ||
|
||||
if (_vm->_graphicsMan->_maxX == curLineX || _vm->_graphicsMan->_maxY == curLineY ||
|
||||
_vm->_graphicsMan->_minX == curLineX || _vm->_graphicsMan->_minY == curLineY ||
|
||||
(lineX == curLineX && lineY == curLineY))
|
||||
break;
|
||||
if (lineIdx == MAX_LINES)
|
||||
|
@ -959,7 +959,7 @@ int LinesManager::computeRouteIdx(int lineIdx, int dataIdx, int fromX, int fromY
|
|||
|
||||
lineIdxRight = foundLineIdx;
|
||||
|
||||
if (_vm->_graphicsManager->_maxX <= curX || maxLineX <= curX)
|
||||
if (_vm->_graphicsMan->_maxX <= curX || maxLineX <= curX)
|
||||
break;
|
||||
}
|
||||
curX = destX;
|
||||
|
@ -1101,11 +1101,11 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
if (abs(fromX - destX) <= 4 && abs(fromY - clipDestY) <= 4)
|
||||
return NULL;
|
||||
|
||||
if (_oldZoneNum > 0 && _vm->_objectsManager->_zoneNum > 0 && _oldZoneNum == _vm->_objectsManager->_zoneNum)
|
||||
if (_oldZoneNum > 0 && _vm->_objectsMan->_zoneNum > 0 && _oldZoneNum == _vm->_objectsMan->_zoneNum)
|
||||
return NULL;
|
||||
}
|
||||
_vm->_globals->_checkDistanceFl = false;
|
||||
_oldZoneNum = _vm->_objectsManager->_zoneNum;
|
||||
_oldZoneNum = _vm->_objectsMan->_zoneNum;
|
||||
_oldRouteFromX = fromX;
|
||||
_oldRouteDestX = destX;
|
||||
_oldRouteFromY = fromY;
|
||||
|
@ -1116,8 +1116,8 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
clipDestX = 20;
|
||||
if (clipDestY <= 19)
|
||||
clipDestY = 20;
|
||||
if (clipDestX > _vm->_graphicsManager->_maxX - 10)
|
||||
clipDestX = _vm->_graphicsManager->_maxX - 10;
|
||||
if (clipDestX > _vm->_graphicsMan->_maxX - 10)
|
||||
clipDestX = _vm->_graphicsMan->_maxX - 10;
|
||||
if (clipDestY > _vm->_globals->_characterMaxPosY)
|
||||
clipDestY = _vm->_globals->_characterMaxPosY;
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
return _bestRoute;
|
||||
|
||||
int tmpDelta = 0;
|
||||
for (int tmpY = clipDestY; tmpY < _vm->_graphicsManager->_maxY; tmpY++, tmpDelta++) {
|
||||
for (int tmpY = clipDestY; tmpY < _vm->_graphicsMan->_maxY; tmpY++, tmpDelta++) {
|
||||
if (checkCollisionLine(clipDestX, tmpY, &collLineDataIdxArr[DIR_DOWN], &collLineIdxArr[DIR_DOWN], 0, _lastLine) && collLineIdxArr[DIR_DOWN] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_DOWN] = 0;
|
||||
|
@ -1144,7 +1144,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
deltaArr[DIR_DOWN] = tmpDelta;
|
||||
|
||||
tmpDelta = 0;
|
||||
for (int tmpY = clipDestY; tmpY > _vm->_graphicsManager->_minY; tmpY--, tmpDelta++) {
|
||||
for (int tmpY = clipDestY; tmpY > _vm->_graphicsMan->_minY; tmpY--, tmpDelta++) {
|
||||
if (checkCollisionLine(clipDestX, tmpY, &collLineDataIdxArr[DIR_UP], &collLineIdxArr[DIR_UP], 0, _lastLine) && collLineIdxArr[DIR_UP] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_UP] = 0;
|
||||
|
@ -1155,7 +1155,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
deltaArr[DIR_UP] = tmpDelta;
|
||||
|
||||
tmpDelta = 0;
|
||||
for (int tmpX = clipDestX; tmpX < _vm->_graphicsManager->_maxX; tmpX++) {
|
||||
for (int tmpX = clipDestX; tmpX < _vm->_graphicsMan->_maxX; tmpX++) {
|
||||
if (checkCollisionLine(tmpX, clipDestY, &collLineDataIdxArr[DIR_RIGHT], &collLineIdxArr[DIR_RIGHT], 0, _lastLine) && collLineIdxArr[DIR_RIGHT] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_RIGHT] = 0;
|
||||
|
@ -1169,7 +1169,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
deltaArr[DIR_RIGHT] = tmpDelta;
|
||||
|
||||
tmpDelta = 0;
|
||||
for (int tmpX = clipDestX; tmpX > _vm->_graphicsManager->_minX; tmpX--) {
|
||||
for (int tmpX = clipDestX; tmpX > _vm->_graphicsMan->_minX; tmpX--) {
|
||||
if (checkCollisionLine(tmpX, clipDestY, &collLineDataIdxArr[DIR_LEFT], &collLineIdxArr[DIR_LEFT], 0, _lastLine) && collLineIdxArr[DIR_LEFT] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_LEFT] = 0;
|
||||
|
@ -1225,7 +1225,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
}
|
||||
|
||||
tmpDelta = 0;
|
||||
for (int tmpY = fromY; tmpY < _vm->_graphicsManager->_maxY; tmpY++, tmpDelta++) {
|
||||
for (int tmpY = fromY; tmpY < _vm->_graphicsMan->_maxY; tmpY++, tmpDelta++) {
|
||||
if (checkCollisionLine(fromX, tmpY, &collLineDataIdxArr[DIR_DOWN], &collLineIdxArr[DIR_DOWN], 0, _lastLine) && collLineIdxArr[DIR_DOWN] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_DOWN] = 0;
|
||||
|
@ -1234,7 +1234,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
deltaArr[DIR_DOWN] = tmpDelta + 1;
|
||||
|
||||
tmpDelta = 0;
|
||||
for (int tmpY = fromY; tmpY > _vm->_graphicsManager->_minY; tmpY--) {
|
||||
for (int tmpY = fromY; tmpY > _vm->_graphicsMan->_minY; tmpY--) {
|
||||
if (checkCollisionLine(fromX, tmpY, &collLineDataIdxArr[DIR_UP], &collLineIdxArr[DIR_UP], 0, _lastLine) && collLineIdxArr[DIR_UP] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_UP] = 0;
|
||||
|
@ -1246,7 +1246,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
deltaArr[DIR_UP] = tmpDelta + 1;
|
||||
|
||||
tmpDelta = 0;
|
||||
for (int tmpX = fromX; tmpX < _vm->_graphicsManager->_maxX; tmpX++) {
|
||||
for (int tmpX = fromX; tmpX < _vm->_graphicsMan->_maxX; tmpX++) {
|
||||
if (checkCollisionLine(tmpX, fromY, &collLineDataIdxArr[DIR_RIGHT], &collLineIdxArr[DIR_RIGHT], 0, _lastLine) && collLineIdxArr[DIR_RIGHT] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_RIGHT] = 0;
|
||||
|
@ -1258,7 +1258,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
|
|||
deltaArr[DIR_RIGHT] = tmpDelta + 1;
|
||||
|
||||
tmpDelta = 0;
|
||||
for (int tmpX = fromX; tmpX > _vm->_graphicsManager->_minX; tmpX--) {
|
||||
for (int tmpX = fromX; tmpX > _vm->_graphicsMan->_minX; tmpX--) {
|
||||
if (checkCollisionLine(tmpX, fromY, &collLineDataIdxArr[DIR_LEFT], &collLineIdxArr[DIR_LEFT], 0, _lastLine) && collLineIdxArr[DIR_LEFT] <= _lastLine)
|
||||
break;
|
||||
collLineDataIdxArr[DIR_LEFT] = 0;
|
||||
|
@ -1996,13 +1996,13 @@ RouteItem *LinesManager::cityMapCarRoute(int x1, int y1, int x2, int y2) {
|
|||
clipX2 = 15;
|
||||
if (y2 <= 14)
|
||||
clipY2 = 15;
|
||||
if (clipX2 > _vm->_graphicsManager->_maxX - 10)
|
||||
clipX2 = _vm->_graphicsManager->_maxX - 10;
|
||||
if (clipX2 > _vm->_graphicsMan->_maxX - 10)
|
||||
clipX2 = _vm->_graphicsMan->_maxX - 10;
|
||||
if (clipY2 > 445)
|
||||
clipY2 = 440;
|
||||
|
||||
int delta = 0;
|
||||
for (delta = 0; clipY2 + delta < _vm->_graphicsManager->_maxY; delta++) {
|
||||
for (delta = 0; clipY2 + delta < _vm->_graphicsMan->_maxY; delta++) {
|
||||
if (checkCollisionLine(clipX2, clipY2 + delta, &arrDataIdx[DIR_DOWN], &arrLineIdx[DIR_DOWN], 0, _lastLine) && arrLineIdx[DIR_DOWN] <= _lastLine)
|
||||
break;
|
||||
arrDataIdx[DIR_DOWN] = 0;
|
||||
|
@ -2010,7 +2010,7 @@ RouteItem *LinesManager::cityMapCarRoute(int x1, int y1, int x2, int y2) {
|
|||
}
|
||||
arrDelta[DIR_DOWN] = delta;
|
||||
|
||||
for (delta = 0; clipY2 - delta > _vm->_graphicsManager->_minY; delta++) {
|
||||
for (delta = 0; clipY2 - delta > _vm->_graphicsMan->_minY; delta++) {
|
||||
if (checkCollisionLine(clipX2, clipY2 - delta , &arrDataIdx[DIR_UP], &arrLineIdx[DIR_UP], 0, _lastLine) && arrLineIdx[DIR_UP] <= _lastLine)
|
||||
break;
|
||||
arrDataIdx[DIR_UP] = 0;
|
||||
|
@ -2020,7 +2020,7 @@ RouteItem *LinesManager::cityMapCarRoute(int x1, int y1, int x2, int y2) {
|
|||
}
|
||||
arrDelta[DIR_UP] = delta;
|
||||
|
||||
for (delta = 0; clipX2 + delta < _vm->_graphicsManager->_maxX; delta++) {
|
||||
for (delta = 0; clipX2 + delta < _vm->_graphicsMan->_maxX; delta++) {
|
||||
if (checkCollisionLine(clipX2 + delta, clipY2, &arrDataIdx[DIR_RIGHT], &arrLineIdx[DIR_RIGHT], 0, _lastLine) && arrLineIdx[DIR_RIGHT] <= _lastLine)
|
||||
break;
|
||||
arrDataIdx[DIR_RIGHT] = 0;
|
||||
|
@ -2030,7 +2030,7 @@ RouteItem *LinesManager::cityMapCarRoute(int x1, int y1, int x2, int y2) {
|
|||
}
|
||||
arrDelta[DIR_RIGHT] = delta;
|
||||
|
||||
for (delta = 0; clipX2 - delta > _vm->_graphicsManager->_minX; delta++) {
|
||||
for (delta = 0; clipX2 - delta > _vm->_graphicsMan->_minX; delta++) {
|
||||
if (checkCollisionLine(clipX2 - delta, clipY2, &arrDataIdx[DIR_LEFT], &arrLineIdx[DIR_LEFT], 0, _lastLine) && arrLineIdx[DIR_LEFT] <= _lastLine)
|
||||
break;
|
||||
arrDataIdx[DIR_LEFT] = 0;
|
||||
|
@ -2212,11 +2212,11 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
|
|||
int realSpeedY = _vm->_globals->_hopkinsItem[hopkinsIdx]._speedY;
|
||||
int spriteSize = _vm->_globals->_spriteSize[curY];
|
||||
if (spriteSize < 0) {
|
||||
realSpeedX = _vm->_graphicsManager->zoomOut(realSpeedX, -spriteSize);
|
||||
realSpeedY = _vm->_graphicsManager->zoomOut(realSpeedY, -spriteSize);
|
||||
realSpeedX = _vm->_graphicsMan->zoomOut(realSpeedX, -spriteSize);
|
||||
realSpeedY = _vm->_graphicsMan->zoomOut(realSpeedY, -spriteSize);
|
||||
} else if (spriteSize > 0) {
|
||||
realSpeedX = _vm->_graphicsManager->zoomIn(realSpeedX, spriteSize);
|
||||
realSpeedY = _vm->_graphicsManager->zoomIn(realSpeedY, spriteSize);
|
||||
realSpeedX = _vm->_graphicsMan->zoomIn(realSpeedX, spriteSize);
|
||||
realSpeedY = _vm->_graphicsMan->zoomIn(realSpeedY, spriteSize);
|
||||
}
|
||||
for (int i = 0; i < realSpeedX; i++) {
|
||||
--curX;
|
||||
|
@ -2246,11 +2246,11 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
|
|||
int realSpeedY = _vm->_globals->_hopkinsItem[hopkinsIdx]._speedY;
|
||||
int spriteSize = _vm->_globals->_spriteSize[curY];
|
||||
if (spriteSize < 0) {
|
||||
realSpeedX = _vm->_graphicsManager->zoomOut(realSpeedX, -spriteSize);
|
||||
realSpeedY = _vm->_graphicsManager->zoomOut(realSpeedY, -spriteSize);
|
||||
realSpeedX = _vm->_graphicsMan->zoomOut(realSpeedX, -spriteSize);
|
||||
realSpeedY = _vm->_graphicsMan->zoomOut(realSpeedY, -spriteSize);
|
||||
} else if (spriteSize > 0) {
|
||||
realSpeedX = _vm->_graphicsManager->zoomIn(realSpeedX, spriteSize);
|
||||
realSpeedY = _vm->_graphicsManager->zoomIn(realSpeedY, spriteSize);
|
||||
realSpeedX = _vm->_graphicsMan->zoomIn(realSpeedX, spriteSize);
|
||||
realSpeedY = _vm->_graphicsMan->zoomIn(realSpeedY, spriteSize);
|
||||
}
|
||||
for (int i = 0; i < realSpeedX; i++) {
|
||||
++curX;
|
||||
|
@ -2276,8 +2276,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
|
|||
int smoothIdx = 0;
|
||||
int stepCount = 0;
|
||||
while (curX > destX && destY < curY) {
|
||||
int realSpeedX = _vm->_graphicsManager->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedX, 25);
|
||||
int realSpeedY = _vm->_graphicsManager->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedY, 25);
|
||||
int realSpeedX = _vm->_graphicsMan->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedX, 25);
|
||||
int realSpeedY = _vm->_graphicsMan->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedY, 25);
|
||||
int oldY = curY;
|
||||
for (int i = 0; i < realSpeedX; i++) {
|
||||
--curX;
|
||||
|
@ -2304,8 +2304,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
|
|||
int stepCount = 0;
|
||||
while (curX < destX && destY < curY) {
|
||||
int oldY = curY;
|
||||
int realSpeedX = _vm->_graphicsManager->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedX, 25);
|
||||
int realSpeedY = _vm->_graphicsManager->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedY, 25);
|
||||
int realSpeedX = _vm->_graphicsMan->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedX, 25);
|
||||
int realSpeedY = _vm->_graphicsMan->zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedY, 25);
|
||||
for (int i = 0; i < realSpeedX; i++) {
|
||||
++curX;
|
||||
_smoothRoute[smoothIdx]._posX = curX;
|
||||
|
@ -2490,9 +2490,9 @@ int LinesManager::computeYSteps(int idx) {
|
|||
|
||||
int retVal = 25;
|
||||
if (zoomPct < 0)
|
||||
retVal = _vm->_graphicsManager->zoomOut(25, -zoomPct);
|
||||
retVal = _vm->_graphicsMan->zoomOut(25, -zoomPct);
|
||||
else if (zoomPct > 0)
|
||||
retVal = _vm->_graphicsManager->zoomIn(25, zoomPct);
|
||||
retVal = _vm->_graphicsMan->zoomIn(25, zoomPct);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
@ -2546,22 +2546,22 @@ void LinesManager::optimizeRoute(RouteItem *route) {
|
|||
int LinesManager::getMouseZone() {
|
||||
int result;
|
||||
|
||||
int xp = _vm->_eventsManager->_mousePos.x + _vm->_eventsManager->_mouseOffset.x;
|
||||
int yp = _vm->_eventsManager->_mousePos.y + _vm->_eventsManager->_mouseOffset.y;
|
||||
if ((_vm->_eventsManager->_mousePos.y + _vm->_eventsManager->_mouseOffset.y) > 19) {
|
||||
int xp = _vm->_events->_mousePos.x + _vm->_events->_mouseOffset.x;
|
||||
int yp = _vm->_events->_mousePos.y + _vm->_events->_mouseOffset.y;
|
||||
if ((_vm->_events->_mousePos.y + _vm->_events->_mouseOffset.y) > 19) {
|
||||
for (int bobZoneId = 0; bobZoneId <= 48; bobZoneId++) {
|
||||
int bobId = _bobZone[bobZoneId];
|
||||
if (bobId && _bobZoneFl[bobZoneId] && _vm->_objectsManager->_bob[bobId]._bobMode && _vm->_objectsManager->_bob[bobId]._frameIndex != 250 &&
|
||||
!_vm->_objectsManager->_bob[bobId]._disabledAnimationFl && xp > _vm->_objectsManager->_bob[bobId]._oldX &&
|
||||
xp < _vm->_objectsManager->_bob[bobId]._oldWidth + _vm->_objectsManager->_bob[bobId]._oldX && yp > _vm->_objectsManager->_bob[bobId]._oldY) {
|
||||
if (yp < _vm->_objectsManager->_bob[bobId]._oldHeight + _vm->_objectsManager->_bob[bobId]._oldY) {
|
||||
if (bobId && _bobZoneFl[bobZoneId] && _vm->_objectsMan->_bob[bobId]._bobMode && _vm->_objectsMan->_bob[bobId]._frameIndex != 250 &&
|
||||
!_vm->_objectsMan->_bob[bobId]._disabledAnimationFl && xp > _vm->_objectsMan->_bob[bobId]._oldX &&
|
||||
xp < _vm->_objectsMan->_bob[bobId]._oldWidth + _vm->_objectsMan->_bob[bobId]._oldX && yp > _vm->_objectsMan->_bob[bobId]._oldY) {
|
||||
if (yp < _vm->_objectsMan->_bob[bobId]._oldHeight + _vm->_objectsMan->_bob[bobId]._oldY) {
|
||||
if (_zone[bobZoneId]._spriteIndex == -1) {
|
||||
_zone[bobZoneId]._destX = 0;
|
||||
_zone[bobZoneId]._destY = 0;
|
||||
}
|
||||
if (!_zone[bobZoneId]._destX && !_zone[bobZoneId]._destY) {
|
||||
_zone[bobZoneId]._destX = _vm->_objectsManager->_bob[bobId]._oldWidth + _vm->_objectsManager->_bob[bobId]._oldX;
|
||||
_zone[bobZoneId]._destY = _vm->_objectsManager->_bob[bobId]._oldHeight + _vm->_objectsManager->_bob[bobId]._oldY + 6;
|
||||
_zone[bobZoneId]._destX = _vm->_objectsMan->_bob[bobId]._oldWidth + _vm->_objectsMan->_bob[bobId]._oldX;
|
||||
_zone[bobZoneId]._destY = _vm->_objectsMan->_bob[bobId]._oldHeight + _vm->_objectsMan->_bob[bobId]._oldY + 6;
|
||||
_zone[bobZoneId]._spriteIndex = -1;
|
||||
}
|
||||
return bobZoneId;
|
||||
|
@ -2596,7 +2596,7 @@ int LinesManager::getMouseZone() {
|
|||
return -1;
|
||||
|
||||
int colRes2 = 0;
|
||||
for (int j = yp; j < _vm->_graphicsManager->_maxY; ++j) {
|
||||
for (int j = yp; j < _vm->_graphicsMan->_maxY; ++j) {
|
||||
colRes2 = checkCollision(xp, j);
|
||||
if (colRes2 != -1 && _zone[colRes1]._enabledFl)
|
||||
break;
|
||||
|
@ -2615,7 +2615,7 @@ int LinesManager::getMouseZone() {
|
|||
return -1;
|
||||
|
||||
int colRes4 = 0;
|
||||
for (int xCurrent = xp; _vm->_graphicsManager->_maxX > xCurrent; ++xCurrent) {
|
||||
for (int xCurrent = xp; _vm->_graphicsMan->_maxX > xCurrent; ++xCurrent) {
|
||||
colRes4 = checkCollision(xCurrent, yp);
|
||||
if (colRes4 != -1 && _zone[colRes1]._enabledFl)
|
||||
break;
|
||||
|
@ -2824,25 +2824,25 @@ void LinesManager::disableZone(int idx) {
|
|||
}
|
||||
|
||||
void LinesManager::checkZone() {
|
||||
int mouseX = _vm->_eventsManager->getMouseX();
|
||||
int mouseY = _vm->_eventsManager->getMouseY();
|
||||
int mouseX = _vm->_events->getMouseX();
|
||||
int mouseY = _vm->_events->getMouseY();
|
||||
int oldMouseY = mouseY;
|
||||
if (_vm->_globals->_cityMapEnabledFl
|
||||
|| _vm->_eventsManager->_startPos.x >= mouseX
|
||||
|| (mouseY = _vm->_graphicsManager->_scrollOffset + 54, mouseX >= mouseY)
|
||||
|| _vm->_events->_startPos.x >= mouseX
|
||||
|| (mouseY = _vm->_graphicsMan->_scrollOffset + 54, mouseX >= mouseY)
|
||||
|| (mouseY = oldMouseY - 1, mouseY < 0 || mouseY > 59)) {
|
||||
if (_vm->_objectsManager->_visibleFl)
|
||||
_vm->_objectsManager->_eraseVisibleCounter = 4;
|
||||
_vm->_objectsManager->_visibleFl = false;
|
||||
if (_vm->_objectsMan->_visibleFl)
|
||||
_vm->_objectsMan->_eraseVisibleCounter = 4;
|
||||
_vm->_objectsMan->_visibleFl = false;
|
||||
} else {
|
||||
_vm->_objectsManager->_visibleFl = true;
|
||||
_vm->_objectsMan->_visibleFl = true;
|
||||
}
|
||||
if (_vm->_objectsManager->_forceZoneFl) {
|
||||
if (_vm->_objectsMan->_forceZoneFl) {
|
||||
_zoneSkipCount = 100;
|
||||
_oldMouseZoneId = -1;
|
||||
_oldMouseX = -200;
|
||||
_oldMouseY = -220;
|
||||
_vm->_objectsManager->_forceZoneFl = false;
|
||||
_vm->_objectsMan->_forceZoneFl = false;
|
||||
}
|
||||
|
||||
_zoneSkipCount++;
|
||||
|
@ -2858,11 +2858,11 @@ void LinesManager::checkZone() {
|
|||
zoneId = _oldMouseZoneId;
|
||||
}
|
||||
if (_oldMouseZoneId != zoneId) {
|
||||
_vm->_graphicsManager->setColorPercentage2(251, 100, 100, 100);
|
||||
_vm->_eventsManager->_mouseCursorId = 4;
|
||||
_vm->_eventsManager->changeMouseCursor(4);
|
||||
_vm->_graphicsMan->setColorPercentage2(251, 100, 100, 100);
|
||||
_vm->_events->_mouseCursorId = 4;
|
||||
_vm->_events->changeMouseCursor(4);
|
||||
if (_forceHideText) {
|
||||
_vm->_fontManager->hideText(5);
|
||||
_vm->_fontMan->hideText(5);
|
||||
_forceHideText = false;
|
||||
return;
|
||||
}
|
||||
|
@ -2874,39 +2874,39 @@ void LinesManager::checkZone() {
|
|||
_zone[zoneId]._verbFl7 || _zone[zoneId]._verbFl8 ||
|
||||
_zone[zoneId]._verbFl9 || _zone[zoneId]._verbFl10) {
|
||||
if (_oldMouseZoneId != zoneId) {
|
||||
_vm->_fontManager->initTextBuffers(5, _zone[zoneId]._messageId, _vm->_globals->_zoneFilename, 0, 430, 0, 0, 252);
|
||||
_vm->_fontManager->showText(5);
|
||||
_vm->_fontMan->initTextBuffers(5, _zone[zoneId]._messageId, _vm->_globals->_zoneFilename, 0, 430, 0, 0, 252);
|
||||
_vm->_fontMan->showText(5);
|
||||
_forceHideText = true;
|
||||
}
|
||||
_hotspotTextColor += 25;
|
||||
if (_hotspotTextColor > 100)
|
||||
_hotspotTextColor = 0;
|
||||
_vm->_graphicsManager->setColorPercentage2(251, _hotspotTextColor, _hotspotTextColor, _hotspotTextColor);
|
||||
if (_vm->_eventsManager->_mouseCursorId == 4) {
|
||||
_vm->_graphicsMan->setColorPercentage2(251, _hotspotTextColor, _hotspotTextColor, _hotspotTextColor);
|
||||
if (_vm->_events->_mouseCursorId == 4) {
|
||||
if (_zone[zoneId]._verbFl1 == 2) {
|
||||
_vm->_eventsManager->changeMouseCursor(16);
|
||||
_vm->_eventsManager->_mouseCursorId = 16;
|
||||
_vm->_objectsManager->setVerb(16);
|
||||
_vm->_events->changeMouseCursor(16);
|
||||
_vm->_events->_mouseCursorId = 16;
|
||||
_vm->_objectsMan->setVerb(16);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_vm->_graphicsManager->setColorPercentage2(251, 100, 100, 100);
|
||||
_vm->_eventsManager->_mouseCursorId = 4;
|
||||
_vm->_eventsManager->changeMouseCursor(4);
|
||||
_vm->_graphicsMan->setColorPercentage2(251, 100, 100, 100);
|
||||
_vm->_events->_mouseCursorId = 4;
|
||||
_vm->_events->changeMouseCursor(4);
|
||||
}
|
||||
}
|
||||
_vm->_objectsManager->_zoneNum = zoneId;
|
||||
_vm->_objectsMan->_zoneNum = zoneId;
|
||||
_oldMouseX = mouseX;
|
||||
_oldMouseY = oldMouseY;
|
||||
_oldMouseZoneId = zoneId;
|
||||
if (_vm->_globals->_freezeCharacterFl && (_vm->_eventsManager->_mouseCursorId == 4)) {
|
||||
if (_vm->_globals->_freezeCharacterFl && (_vm->_events->_mouseCursorId == 4)) {
|
||||
if (zoneId != -1 && zoneId != 0)
|
||||
_vm->_objectsManager->handleRightButton();
|
||||
_vm->_objectsMan->handleRightButton();
|
||||
}
|
||||
if ((_vm->_globals->_cityMapEnabledFl && zoneId == -1) || !zoneId) {
|
||||
_vm->_objectsManager->setVerb(0);
|
||||
_vm->_eventsManager->_mouseCursorId = 0;
|
||||
_vm->_eventsManager->changeMouseCursor(0);
|
||||
_vm->_objectsMan->setVerb(0);
|
||||
_vm->_events->_mouseCursorId = 0;
|
||||
_vm->_events->changeMouseCursor(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ int MenuManager::menu() {
|
|||
|
||||
result = 0;
|
||||
while (!g_system->getEventManager()->shouldQuit()) {
|
||||
_vm->_objectsManager->_forestFl = false;
|
||||
_vm->_eventsManager->_breakoutFl = false;
|
||||
_vm->_objectsMan->_forestFl = false;
|
||||
_vm->_events->_breakoutFl = false;
|
||||
_vm->_globals->_disableInventFl = true;
|
||||
_vm->_globals->_exitId = 0;
|
||||
|
||||
|
@ -64,35 +64,35 @@ int MenuManager::menu() {
|
|||
_vm->_globals->_inventory[idx] = 0;
|
||||
|
||||
memset(_vm->_globals->_saveData, 0, 2000);
|
||||
_vm->_objectsManager->addObject(14);
|
||||
_vm->_objectsMan->addObject(14);
|
||||
memset(frameIndex, 0, sizeof(int) * ARRAYSIZE(frameIndex));
|
||||
|
||||
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
|
||||
_vm->_graphicsManager->loadImage("MENU");
|
||||
_vm->_graphicsMan->loadImage("MENU");
|
||||
else if (_vm->_globals->_language == LANG_EN)
|
||||
_vm->_graphicsManager->loadImage("MENUAN");
|
||||
_vm->_graphicsMan->loadImage("MENUAN");
|
||||
else if (_vm->_globals->_language == LANG_FR)
|
||||
_vm->_graphicsManager->loadImage("MENUFR");
|
||||
_vm->_graphicsMan->loadImage("MENUFR");
|
||||
else if (_vm->_globals->_language == LANG_SP)
|
||||
_vm->_graphicsManager->loadImage("MENUES");
|
||||
_vm->_graphicsMan->loadImage("MENUES");
|
||||
|
||||
_vm->_graphicsManager->fadeInLong();
|
||||
_vm->_graphicsMan->fadeInLong();
|
||||
|
||||
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
|
||||
spriteData = _vm->_objectsManager->loadSprite("MENU.SPR");
|
||||
spriteData = _vm->_objectsMan->loadSprite("MENU.SPR");
|
||||
else if (_vm->_globals->_language == LANG_EN)
|
||||
spriteData = _vm->_objectsManager->loadSprite("MENUAN.SPR");
|
||||
spriteData = _vm->_objectsMan->loadSprite("MENUAN.SPR");
|
||||
else if (_vm->_globals->_language == LANG_FR)
|
||||
spriteData = _vm->_objectsManager->loadSprite("MENUFR.SPR");
|
||||
spriteData = _vm->_objectsMan->loadSprite("MENUFR.SPR");
|
||||
else if (_vm->_globals->_language == LANG_SP)
|
||||
spriteData = _vm->_objectsManager->loadSprite("MENUES.SPR");
|
||||
spriteData = _vm->_objectsMan->loadSprite("MENUES.SPR");
|
||||
|
||||
_vm->_eventsManager->mouseOn();
|
||||
_vm->_eventsManager->changeMouseCursor(0);
|
||||
_vm->_eventsManager->_mouseCursorId = 0;
|
||||
_vm->_eventsManager->_mouseSpriteId = 0;
|
||||
_vm->_events->mouseOn();
|
||||
_vm->_events->changeMouseCursor(0);
|
||||
_vm->_events->_mouseCursorId = 0;
|
||||
_vm->_events->_mouseSpriteId = 0;
|
||||
|
||||
_vm->_soundManager->playSound(28);
|
||||
_vm->_soundMan->playSound(28);
|
||||
|
||||
// Loop to make menu selection
|
||||
bool selectionMade = false;
|
||||
|
@ -101,7 +101,7 @@ int MenuManager::menu() {
|
|||
return -1;
|
||||
|
||||
menuIndex = MENU_NONE;
|
||||
mousePos = Common::Point(_vm->_eventsManager->getMouseX(), _vm->_eventsManager->getMouseY());
|
||||
mousePos = Common::Point(_vm->_events->getMouseX(), _vm->_events->getMouseY());
|
||||
|
||||
if (mousePos.x >= 232 && mousePos.x <= 408) {
|
||||
if (mousePos.y >= 261 && mousePos.y <= 284)
|
||||
|
@ -120,21 +120,21 @@ int MenuManager::menu() {
|
|||
if (menuIndex > MENU_NONE)
|
||||
frameIndex[menuIndex - 1] = 1;
|
||||
|
||||
_vm->_graphicsManager->fastDisplay(spriteData, 230, 259, frameIndex[0]);
|
||||
_vm->_graphicsManager->fastDisplay(spriteData, 230, 291, frameIndex[1] + 2);
|
||||
_vm->_graphicsManager->fastDisplay(spriteData, 230, 322, frameIndex[2] + 4);
|
||||
_vm->_graphicsManager->fastDisplay(spriteData, 230, 354, frameIndex[3] + 6);
|
||||
_vm->_graphicsManager->fastDisplay(spriteData, 230, 386, frameIndex[4] + 8);
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_graphicsMan->fastDisplay(spriteData, 230, 259, frameIndex[0]);
|
||||
_vm->_graphicsMan->fastDisplay(spriteData, 230, 291, frameIndex[1] + 2);
|
||||
_vm->_graphicsMan->fastDisplay(spriteData, 230, 322, frameIndex[2] + 4);
|
||||
_vm->_graphicsMan->fastDisplay(spriteData, 230, 354, frameIndex[3] + 6);
|
||||
_vm->_graphicsMan->fastDisplay(spriteData, 230, 386, frameIndex[4] + 8);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
|
||||
if (_vm->_eventsManager->getMouseButton() == 1 && menuIndex != MENU_NONE)
|
||||
if (_vm->_events->getMouseButton() == 1 && menuIndex != MENU_NONE)
|
||||
selectionMade = true;
|
||||
} while (!selectionMade);
|
||||
|
||||
if (menuIndex > MENU_NONE) {
|
||||
_vm->_graphicsManager->fastDisplay(spriteData, 230, 259 + 32 * (menuIndex - 1), 10 + (menuIndex - 1));
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_eventsManager->delay(200);
|
||||
_vm->_graphicsMan->fastDisplay(spriteData, 230, 259 + 32 * (menuIndex - 1), 10 + (menuIndex - 1));
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_events->delay(200);
|
||||
}
|
||||
|
||||
if (menuIndex == PLAY_GAME) {
|
||||
|
@ -142,7 +142,7 @@ int MenuManager::menu() {
|
|||
break;
|
||||
} else if (menuIndex == LOAD_GAME) {
|
||||
_vm->_globals->_exitId = -1;
|
||||
_vm->_dialogsManager->showLoadGame();
|
||||
_vm->_dialog->showLoadGame();
|
||||
|
||||
if (_vm->_globals->_exitId != -1) {
|
||||
result = _vm->_globals->_exitId;
|
||||
|
@ -150,7 +150,7 @@ int MenuManager::menu() {
|
|||
}
|
||||
_vm->_globals->_exitId = 0;
|
||||
} else if (menuIndex == OPTIONS) {
|
||||
_vm->_dialogsManager->showOptionsDialog();
|
||||
_vm->_dialog->showOptionsDialog();
|
||||
} else if (menuIndex == INTRODUCTION) {
|
||||
_vm->playIntro();
|
||||
} else if (menuIndex == QUIT) {
|
||||
|
@ -161,7 +161,7 @@ int MenuManager::menu() {
|
|||
|
||||
_vm->_globals->freeMemory(spriteData);
|
||||
_vm->_globals->_disableInventFl = false;
|
||||
_vm->_graphicsManager->fadeOutLong();
|
||||
_vm->_graphicsMan->fadeOutLong();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -136,7 +136,7 @@ void SaveLoadManager::writeSavegameHeader(Common::OutSaveFile *out, hopkinsSaveg
|
|||
out->writeSint16LE(td.tm_mday);
|
||||
out->writeSint16LE(td.tm_hour);
|
||||
out->writeSint16LE(td.tm_min);
|
||||
out->writeUint32LE(_vm->_eventsManager->_gameCounter);
|
||||
out->writeUint32LE(_vm->_events->_gameCounter);
|
||||
}
|
||||
|
||||
Common::Error SaveLoadManager::saveGame(int slot, const Common::String &saveName) {
|
||||
|
@ -148,8 +148,8 @@ Common::Error SaveLoadManager::saveGame(int slot, const Common::String &saveName
|
|||
for (int i = 0; i < 35; ++i)
|
||||
_vm->_globals->_saveData->_inventory[i] = _vm->_globals->_inventory[i];
|
||||
|
||||
_vm->_globals->_saveData->_mapCarPosX = _vm->_objectsManager->_mapCarPosX;
|
||||
_vm->_globals->_saveData->_mapCarPosY = _vm->_objectsManager->_mapCarPosY;
|
||||
_vm->_globals->_saveData->_mapCarPosX = _vm->_objectsMan->_mapCarPosX;
|
||||
_vm->_globals->_saveData->_mapCarPosY = _vm->_objectsMan->_mapCarPosY;
|
||||
|
||||
/* Create the savegame */
|
||||
Common::OutSaveFile *savefile = g_system->getSavefileManager()->openForSaving(_vm->generateSaveName(slot));
|
||||
|
@ -207,8 +207,8 @@ Common::Error SaveLoadManager::loadGame(int slot) {
|
|||
_vm->_globals->_exitId = _vm->_globals->_saveData->_data[svLastScreenId];
|
||||
_vm->_globals->_saveData->_data[svLastPrevScreenId] = 0;
|
||||
_vm->_globals->_screenId = 0;
|
||||
_vm->_objectsManager->_mapCarPosX = _vm->_globals->_saveData->_mapCarPosX;
|
||||
_vm->_objectsManager->_mapCarPosY = _vm->_globals->_saveData->_mapCarPosY;
|
||||
_vm->_objectsMan->_mapCarPosX = _vm->_globals->_saveData->_mapCarPosX;
|
||||
_vm->_objectsMan->_mapCarPosY = _vm->_globals->_saveData->_mapCarPosY;
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
@ -228,14 +228,14 @@ bool SaveLoadManager::readSavegameHeader(int slot, hopkinsSavegameHeader &header
|
|||
#define REDUCE_AMOUNT 80
|
||||
|
||||
void SaveLoadManager::createThumbnail(Graphics::Surface *s) {
|
||||
int w = _vm->_graphicsManager->zoomOut(SCREEN_WIDTH, REDUCE_AMOUNT);
|
||||
int h = _vm->_graphicsManager->zoomOut(SCREEN_HEIGHT - 40, REDUCE_AMOUNT);
|
||||
int w = _vm->_graphicsMan->zoomOut(SCREEN_WIDTH, REDUCE_AMOUNT);
|
||||
int h = _vm->_graphicsMan->zoomOut(SCREEN_HEIGHT - 40, REDUCE_AMOUNT);
|
||||
|
||||
Graphics::Surface thumb8;
|
||||
thumb8.create(w, h, Graphics::PixelFormat::createFormatCLUT8());
|
||||
|
||||
_vm->_graphicsManager->reduceScreenPart(_vm->_graphicsManager->_frontBuffer, (byte *)thumb8.pixels,
|
||||
_vm->_eventsManager->_startPos.x, 20, SCREEN_WIDTH, SCREEN_HEIGHT - 40, 80);
|
||||
_vm->_graphicsMan->reduceScreenPart(_vm->_graphicsMan->_frontBuffer, (byte *)thumb8.pixels,
|
||||
_vm->_events->_startPos.x, 20, SCREEN_WIDTH, SCREEN_HEIGHT - 40, 80);
|
||||
|
||||
// Convert the 8-bit pixel to 16 bit surface
|
||||
s->create(w, h, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
|
||||
|
@ -249,7 +249,7 @@ void SaveLoadManager::createThumbnail(Graphics::Surface *s) {
|
|||
uint16 *lineDestP = destP;
|
||||
|
||||
for (int xp = 0; xp < w; ++xp)
|
||||
*lineDestP++ = *(uint16 *)&_vm->_graphicsManager->_palettePixels[*lineSrcP++ * 2];
|
||||
*lineDestP++ = *(uint16 *)&_vm->_graphicsMan->_palettePixels[*lineSrcP++ * 2];
|
||||
|
||||
// Move to the start of the next line
|
||||
srcP += w;
|
||||
|
@ -292,7 +292,7 @@ void SaveLoadManager::convertThumb16To8(Graphics::Surface *thumb16, Graphics::Su
|
|||
byte paletteG[PALETTE_SIZE];
|
||||
byte paletteB[PALETTE_SIZE];
|
||||
for (int palIndex = 0; palIndex < PALETTE_SIZE; ++palIndex) {
|
||||
uint16 p = READ_LE_UINT16(&_vm->_graphicsManager->_palettePixels[palIndex * 2]);
|
||||
uint16 p = READ_LE_UINT16(&_vm->_graphicsMan->_palettePixels[palIndex * 2]);
|
||||
pixelFormat16.colorToRGB(p, paletteR[palIndex], paletteG[palIndex], paletteB[palIndex]);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -518,7 +518,7 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
|
|||
filename = Common::String::format("%s%d", prefix.c_str(), mappedFileNumber);
|
||||
|
||||
bool fileFoundFl = false;
|
||||
_vm->_fileManager->searchCat(filename + ".WAV", RES_VOI, fileFoundFl);
|
||||
_vm->_fileIO->searchCat(filename + ".WAV", RES_VOI, fileFoundFl);
|
||||
if (fileFoundFl) {
|
||||
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
|
||||
filename = "ENG_VOI.RES";
|
||||
|
@ -530,10 +530,10 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
|
|||
else if (_vm->_globals->_language == LANG_SP)
|
||||
filename = "RES_VES.RES";
|
||||
|
||||
catPos = _vm->_fileManager->_catalogPos;
|
||||
catLen = _vm->_fileManager->_catalogSize;
|
||||
catPos = _vm->_fileIO->_catalogPos;
|
||||
catLen = _vm->_fileIO->_catalogSize;
|
||||
} else {
|
||||
_vm->_fileManager->searchCat(filename + ".APC", RES_VOI, fileFoundFl);
|
||||
_vm->_fileIO->searchCat(filename + ".APC", RES_VOI, fileFoundFl);
|
||||
if (fileFoundFl) {
|
||||
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
|
||||
filename = "ENG_VOI.RES";
|
||||
|
@ -545,10 +545,10 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
|
|||
else if (_vm->_globals->_language == LANG_SP)
|
||||
filename = "RES_VES.RES";
|
||||
|
||||
catPos = _vm->_fileManager->_catalogPos;
|
||||
catLen = _vm->_fileManager->_catalogSize;
|
||||
catPos = _vm->_fileIO->_catalogPos;
|
||||
catLen = _vm->_fileIO->_catalogSize;
|
||||
} else {
|
||||
_vm->_fileManager->searchCat(filename + ".RAW", RES_VOI, fileFoundFl);
|
||||
_vm->_fileIO->searchCat(filename + ".RAW", RES_VOI, fileFoundFl);
|
||||
if (fileFoundFl) {
|
||||
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
|
||||
filename = "ENG_VOI.RES";
|
||||
|
@ -560,8 +560,8 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
|
|||
else if (_vm->_globals->_language == LANG_SP)
|
||||
filename = "RES_VES.RES";
|
||||
|
||||
catPos = _vm->_fileManager->_catalogPos;
|
||||
catLen = _vm->_fileManager->_catalogSize;
|
||||
catPos = _vm->_fileIO->_catalogPos;
|
||||
catLen = _vm->_fileIO->_catalogSize;
|
||||
} else {
|
||||
if (!f.exists(filename + ".WAV")) {
|
||||
if (!f.exists(filename + ".APC"))
|
||||
|
@ -593,17 +593,17 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
|
|||
}
|
||||
playVoice();
|
||||
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
|
||||
// Loop for playing voice
|
||||
breakFlag = false;
|
||||
do {
|
||||
if (_specialSoundNum != 4 && !_skipRefreshFl)
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
if (_vm->_eventsManager->getMouseButton())
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
if (_vm->_events->getMouseButton())
|
||||
break;
|
||||
_vm->_eventsManager->refreshEvents();
|
||||
if (_vm->_eventsManager->_escKeyFl)
|
||||
_vm->_events->refreshEvents();
|
||||
if (_vm->_events->_escKeyFl)
|
||||
break;
|
||||
// We only check the voice status if the file has been loaded properly
|
||||
// This avoids skipping completely the talk animations in the Win95 UK Demo
|
||||
|
@ -624,7 +624,7 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
|
|||
if (!_musicOffFl && _musicVolume > 2) {
|
||||
setMODMusicVolume(_musicVolume);
|
||||
}
|
||||
_vm->_eventsManager->_escKeyFl = false;
|
||||
_vm->_events->_escKeyFl = false;
|
||||
_skipRefreshFl = false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -49,18 +49,18 @@ TalkManager::TalkManager(HopkinsEngine *vm) {
|
|||
void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) {
|
||||
Common::String spriteFilename;
|
||||
|
||||
_vm->_fontManager->hideText(5);
|
||||
_vm->_fontManager->hideText(9);
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_graphicsManager->_scrollStatus = 1;
|
||||
_vm->_fontMan->hideText(5);
|
||||
_vm->_fontMan->hideText(9);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_graphicsMan->_scrollStatus = 1;
|
||||
bool oldDisableInventFl = _vm->_globals->_disableInventFl;
|
||||
_vm->_globals->_disableInventFl = true;
|
||||
bool fileFoundFl = false;
|
||||
_characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER, fileFoundFl);
|
||||
_characterSize = _vm->_fileManager->_catalogSize;
|
||||
_characterBuffer = _vm->_fileIO->searchCat(filename, RES_PER, fileFoundFl);
|
||||
_characterSize = _vm->_fileIO->_catalogSize;
|
||||
if (!fileFoundFl) {
|
||||
_characterBuffer = _vm->_fileManager->loadFile(filename);
|
||||
_characterSize = _vm->_fileManager->fileSize(filename);
|
||||
_characterBuffer = _vm->_fileIO->loadFile(filename);
|
||||
_characterSize = _vm->_fileIO->fileSize(filename);
|
||||
}
|
||||
|
||||
_vm->_globals->_saveData->_data[svDialogField4] = 0;
|
||||
|
@ -78,28 +78,28 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename)
|
|||
_dialogueMesgId1 = READ_LE_INT16((uint16 *)_characterBuffer + 40);
|
||||
_paletteBufferIdx = 20 * READ_LE_INT16((uint16 *)_characterBuffer + 42) + 110;
|
||||
fileFoundFl = false;
|
||||
_characterSprite = _vm->_fileManager->searchCat(spriteFilename, RES_SAN, fileFoundFl);
|
||||
_characterSprite = _vm->_fileIO->searchCat(spriteFilename, RES_SAN, fileFoundFl);
|
||||
if (!fileFoundFl) {
|
||||
_characterSprite = _vm->_objectsManager->loadSprite(spriteFilename);
|
||||
_characterSprite = _vm->_objectsMan->loadSprite(spriteFilename);
|
||||
} else {
|
||||
_characterSprite = _vm->_objectsManager->loadSprite("RES_SAN.RES");
|
||||
_characterSprite = _vm->_objectsMan->loadSprite("RES_SAN.RES");
|
||||
}
|
||||
|
||||
_vm->_graphicsManager->backupScreen();
|
||||
_vm->_graphicsMan->backupScreen();
|
||||
|
||||
if (!_vm->_graphicsManager->_lineNbr)
|
||||
_vm->_graphicsManager->_scrollOffset = 0;
|
||||
_vm->_graphicsManager->displayScreen(true);
|
||||
_vm->_objectsManager->_charactersEnabledFl = true;
|
||||
if (!_vm->_graphicsMan->_lineNbr)
|
||||
_vm->_graphicsMan->_scrollOffset = 0;
|
||||
_vm->_graphicsMan->displayScreen(true);
|
||||
_vm->_objectsMan->_charactersEnabledFl = true;
|
||||
searchCharacterPalette(_paletteBufferIdx, false);
|
||||
startCharacterAnim0(_paletteBufferIdx, false);
|
||||
initCharacterAnim();
|
||||
_dialogueMesgId2 = _dialogueMesgId1 + 1;
|
||||
_dialogueMesgId3 = _dialogueMesgId1 + 2;
|
||||
_dialogueMesgId4 = _dialogueMesgId1 + 3;
|
||||
int oldMouseCursorId = _vm->_eventsManager->_mouseCursorId;
|
||||
_vm->_eventsManager->_mouseCursorId = 4;
|
||||
_vm->_eventsManager->changeMouseCursor(0);
|
||||
int oldMouseCursorId = _vm->_events->_mouseCursorId;
|
||||
_vm->_events->_mouseCursorId = 4;
|
||||
_vm->_events->changeMouseCursor(0);
|
||||
if (!_vm->_globals->_introSpeechOffFl) {
|
||||
int answer = 0;
|
||||
int dlgAnswer;
|
||||
|
@ -109,7 +109,7 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename)
|
|||
answer = dialogAnswer(dlgAnswer, false);
|
||||
if (answer == -1)
|
||||
dlgAnswer = _dialogueMesgId4;
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (dlgAnswer != _dialogueMesgId4);
|
||||
}
|
||||
if (_vm->_globals->_introSpeechOffFl) {
|
||||
|
@ -123,30 +123,30 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename)
|
|||
_vm->_globals->_introSpeechOffFl = false;
|
||||
_characterBuffer = _vm->_globals->freeMemory(_characterBuffer);
|
||||
_characterSprite = _vm->_globals->freeMemory(_characterSprite);
|
||||
_vm->_graphicsManager->displayScreen(false);
|
||||
_vm->_graphicsMan->displayScreen(false);
|
||||
|
||||
_vm->_graphicsManager->restoreScreen();
|
||||
_vm->_graphicsMan->restoreScreen();
|
||||
|
||||
_vm->_objectsManager->_charactersEnabledFl = false;
|
||||
_vm->_eventsManager->_mouseCursorId = oldMouseCursorId;
|
||||
_vm->_objectsMan->_charactersEnabledFl = false;
|
||||
_vm->_events->_mouseCursorId = oldMouseCursorId;
|
||||
|
||||
_vm->_eventsManager->changeMouseCursor(oldMouseCursorId);
|
||||
_vm->_graphicsManager->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_events->changeMouseCursor(oldMouseCursorId);
|
||||
_vm->_graphicsMan->setColorPercentage(253, 100, 100, 100);
|
||||
|
||||
if (_vm->getIsDemo() == false)
|
||||
_vm->_graphicsManager->setColorPercentage(254, 0, 0, 0);
|
||||
_vm->_graphicsMan->setColorPercentage(254, 0, 0, 0);
|
||||
|
||||
_vm->_graphicsManager->initColorTable(145, 150, _vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(_vm->_graphicsManager->_backBuffer, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
memcpy(_vm->_graphicsManager->_frontBuffer, _vm->_graphicsManager->_backBuffer, 614399);
|
||||
_vm->_graphicsMan->initColorTable(145, 150, _vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(_vm->_graphicsMan->_backBuffer, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
memcpy(_vm->_graphicsMan->_frontBuffer, _vm->_graphicsMan->_backBuffer, 614399);
|
||||
_vm->_globals->_disableInventFl = oldDisableInventFl;
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
for (int i = 0; i <= 4; i++)
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_graphicsManager->_scrollStatus = 0;
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_graphicsMan->_scrollStatus = 0;
|
||||
}
|
||||
|
||||
void TalkManager::startStaticCharacterDialogue(const Common::String &filename) {
|
||||
|
@ -154,11 +154,11 @@ void TalkManager::startStaticCharacterDialogue(const Common::String &filename) {
|
|||
bool oldDisableInventFl = _vm->_globals->_disableInventFl;
|
||||
_vm->_globals->_disableInventFl = true;
|
||||
bool fileFoundFl = false;
|
||||
_characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER, fileFoundFl);
|
||||
_characterSize = _vm->_fileManager->_catalogSize;
|
||||
_characterBuffer = _vm->_fileIO->searchCat(filename, RES_PER, fileFoundFl);
|
||||
_characterSize = _vm->_fileIO->_catalogSize;
|
||||
if (!fileFoundFl) {
|
||||
_characterBuffer = _vm->_fileManager->loadFile(filename);
|
||||
_characterSize = _vm->_fileManager->fileSize(filename);
|
||||
_characterBuffer = _vm->_fileIO->loadFile(filename);
|
||||
_characterSize = _vm->_fileIO->fileSize(filename);
|
||||
}
|
||||
|
||||
_vm->_globals->_saveData->_data[svDialogField4] = 0;
|
||||
|
@ -187,9 +187,9 @@ void TalkManager::startStaticCharacterDialogue(const Common::String &filename) {
|
|||
_dialogueMesgId2 = _dialogueMesgId1 + 1;
|
||||
_dialogueMesgId3 = _dialogueMesgId1 + 2;
|
||||
_dialogueMesgId4 = _dialogueMesgId1 + 3;
|
||||
int oldMouseCursorId = _vm->_eventsManager->_mouseCursorId;
|
||||
_vm->_eventsManager->_mouseCursorId = 4;
|
||||
_vm->_eventsManager->changeMouseCursor(0);
|
||||
int oldMouseCursorId = _vm->_events->_mouseCursorId;
|
||||
_vm->_events->_mouseCursorId = 4;
|
||||
_vm->_events->changeMouseCursor(0);
|
||||
|
||||
if (!_vm->_globals->_introSpeechOffFl) {
|
||||
int answer;
|
||||
|
@ -211,11 +211,11 @@ void TalkManager::startStaticCharacterDialogue(const Common::String &filename) {
|
|||
}
|
||||
|
||||
_characterBuffer = _vm->_globals->freeMemory(_characterBuffer);
|
||||
_vm->_eventsManager->_mouseCursorId = oldMouseCursorId;
|
||||
_vm->_events->_mouseCursorId = oldMouseCursorId;
|
||||
|
||||
_vm->_eventsManager->changeMouseCursor(oldMouseCursorId);
|
||||
_vm->_graphicsManager->initColorTable(145, 150, _vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_events->changeMouseCursor(oldMouseCursorId);
|
||||
_vm->_graphicsMan->initColorTable(145, 150, _vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
// TODO: The original re-enables the mouse cursor here
|
||||
_vm->_globals->_disableInventFl = oldDisableInventFl;
|
||||
}
|
||||
|
@ -229,15 +229,15 @@ int TalkManager::dialogQuestion(bool animatedFl) {
|
|||
uint16 *bufPtr = (uint16 *)_characterBuffer + 48;
|
||||
int curVal = READ_LE_INT16(bufPtr);
|
||||
if (curVal != 0)
|
||||
_vm->_objectsManager->setBobAnimation(curVal);
|
||||
_vm->_objectsMan->setBobAnimation(curVal);
|
||||
if (curVal != 1)
|
||||
_vm->_objectsManager->setBobAnimation(READ_LE_INT16(bufPtr + 1));
|
||||
_vm->_objectsMan->setBobAnimation(READ_LE_INT16(bufPtr + 1));
|
||||
if (curVal != 2)
|
||||
_vm->_objectsManager->setBobAnimation(READ_LE_INT16(bufPtr + 2));
|
||||
_vm->_objectsMan->setBobAnimation(READ_LE_INT16(bufPtr + 2));
|
||||
if (curVal != 3)
|
||||
_vm->_objectsManager->setBobAnimation(READ_LE_INT16(bufPtr + 3));
|
||||
_vm->_objectsMan->setBobAnimation(READ_LE_INT16(bufPtr + 3));
|
||||
if (curVal != 4)
|
||||
_vm->_objectsManager->setBobAnimation(READ_LE_INT16(bufPtr + 4));
|
||||
_vm->_objectsMan->setBobAnimation(READ_LE_INT16(bufPtr + 4));
|
||||
} else {
|
||||
dialogWait();
|
||||
}
|
||||
|
@ -252,76 +252,76 @@ 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->_fontMan->initTextBuffers(5, _dialogueMesgId1, _questionsFilename, 5, sentence1PosY, 0, 65, 255);
|
||||
_vm->_fontMan->initTextBuffers(6, _dialogueMesgId2, _questionsFilename, 5, sentence2PosY, 0, 65, 255);
|
||||
_vm->_fontMan->initTextBuffers(7, _dialogueMesgId3, _questionsFilename, 5, sentence3PosY, 0, 65, 255);
|
||||
_vm->_fontMan->initTextBuffers(8, _dialogueMesgId4, _questionsFilename, 5, sentence4PosY, 0, 65, 255);
|
||||
_vm->_fontMan->showText(5);
|
||||
_vm->_fontMan->showText(6);
|
||||
_vm->_fontMan->showText(7);
|
||||
_vm->_fontMan->showText(8);
|
||||
|
||||
int retVal = -1;
|
||||
bool loopCond = false;
|
||||
do {
|
||||
int mousePosY = _vm->_eventsManager->getMouseY();
|
||||
int mousePosY = _vm->_events->getMouseY();
|
||||
if (sentence1PosY < mousePosY && mousePosY < (sentence2PosY - 1)) {
|
||||
_vm->_fontManager->setOptimalColor(6, 7, 8, 5);
|
||||
_vm->_fontMan->setOptimalColor(6, 7, 8, 5);
|
||||
retVal = _dialogueMesgId1;
|
||||
}
|
||||
if (sentence2PosY < mousePosY && mousePosY < (sentence3PosY - 1)) {
|
||||
_vm->_fontManager->setOptimalColor(5, 7, 8, 6);
|
||||
_vm->_fontMan->setOptimalColor(5, 7, 8, 6);
|
||||
retVal = _dialogueMesgId2;
|
||||
}
|
||||
if (sentence3PosY < mousePosY && mousePosY < (sentence4PosY - 1)) {
|
||||
_vm->_fontManager->setOptimalColor(5, 6, 8, 7);
|
||||
_vm->_fontMan->setOptimalColor(5, 6, 8, 7);
|
||||
retVal = _dialogueMesgId3;
|
||||
}
|
||||
if (sentence4PosY < mousePosY && mousePosY < 419) {
|
||||
_vm->_fontManager->setOptimalColor(5, 6, 7, 8);
|
||||
_vm->_fontMan->setOptimalColor(5, 6, 7, 8);
|
||||
retVal = _dialogueMesgId4;
|
||||
}
|
||||
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
if (_vm->_eventsManager->getMouseButton())
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
if (_vm->_events->getMouseButton())
|
||||
loopCond = true;
|
||||
if (retVal == -1)
|
||||
loopCond = false;
|
||||
} 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->_soundMan->mixVoice(retVal, 1);
|
||||
_vm->_fontMan->hideText(5);
|
||||
_vm->_fontMan->hideText(6);
|
||||
_vm->_fontMan->hideText(7);
|
||||
_vm->_fontMan->hideText(8);
|
||||
|
||||
if (animatedFl) {
|
||||
uint16 *bufPtr = (uint16 *)_characterBuffer + 48;
|
||||
|
||||
int curVal = READ_LE_INT16(bufPtr);
|
||||
if (curVal != 0)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 1);
|
||||
if (curVal != 1)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 2);
|
||||
if (curVal != 2)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 3);
|
||||
if (curVal != 3)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 4);
|
||||
if (curVal != 4)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
} else {
|
||||
dialogTalk();
|
||||
}
|
||||
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
@ -353,75 +353,75 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) {
|
|||
uint16 *bufPtr = (uint16 *)_characterBuffer + 43;
|
||||
int curVal = READ_LE_INT16(bufPtr);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 1);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 2);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 3);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 4);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
} else {
|
||||
dialogAnim();
|
||||
}
|
||||
|
||||
bool displayedTxtFl = false;
|
||||
if (!_vm->_soundManager->_textOffFl) {
|
||||
_vm->_fontManager->initTextBuffers(9, mesgId, _answersFilename, mesgPosX, mesgPosY, 5, mesgLength, 252);
|
||||
_vm->_fontManager->showText(9);
|
||||
if (!_vm->_soundMan->_textOffFl) {
|
||||
_vm->_fontMan->initTextBuffers(9, mesgId, _answersFilename, mesgPosX, mesgPosY, 5, mesgLength, 252);
|
||||
_vm->_fontMan->showText(9);
|
||||
displayedTxtFl = true;
|
||||
}
|
||||
if (!_vm->_soundManager->mixVoice(mesgId, 1, displayedTxtFl)) {
|
||||
_vm->_eventsManager->_curMouseButton = 0;
|
||||
_vm->_eventsManager->_mouseButton = 0;
|
||||
if (!_vm->_soundMan->mixVoice(mesgId, 1, displayedTxtFl)) {
|
||||
_vm->_events->_curMouseButton = 0;
|
||||
_vm->_events->_mouseButton = 0;
|
||||
|
||||
if (_vm->getIsDemo()) {
|
||||
for (int i = 0; i < frameNumb; i++) {
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < frameNumb; i++) {
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
if (_vm->_eventsManager->_mouseButton || _vm->_eventsManager->_curMouseButton)
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
if (_vm->_events->_mouseButton || _vm->_events->_curMouseButton)
|
||||
break;
|
||||
if (_vm->_eventsManager->getMouseButton() && i + 1 > abs(frameNumb / 5))
|
||||
if (_vm->_events->getMouseButton() && i + 1 > abs(frameNumb / 5))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!_vm->_soundManager->_textOffFl)
|
||||
_vm->_fontManager->hideText(9);
|
||||
if (!_vm->_soundMan->_textOffFl)
|
||||
_vm->_fontMan->hideText(9);
|
||||
if (animatedFl) {
|
||||
uint16 *bufPtr = (uint16 *)_characterBuffer + 43;
|
||||
int curVal = READ_LE_INT16(bufPtr);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 1);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 2);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 3);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
|
||||
curVal = READ_LE_INT16(bufPtr + 4);
|
||||
if (curVal)
|
||||
_vm->_objectsManager->stopBobAnimation(curVal);
|
||||
_vm->_objectsMan->stopBobAnimation(curVal);
|
||||
} else {
|
||||
dialogEndTalk();
|
||||
}
|
||||
|
@ -463,46 +463,46 @@ void TalkManager::searchCharacterPalette(int startIdx, bool dark) {
|
|||
else
|
||||
_characterPalette[761] = 255;
|
||||
|
||||
_vm->_graphicsManager->setPaletteVGA256(_characterPalette);
|
||||
_vm->_graphicsManager->initColorTable(145, 150, _characterPalette);
|
||||
_vm->_graphicsMan->setPaletteVGA256(_characterPalette);
|
||||
_vm->_graphicsMan->initColorTable(145, 150, _characterPalette);
|
||||
}
|
||||
|
||||
void TalkManager::dialogWait() {
|
||||
for (int idx = 26; idx <= 30; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
displayBobDialogAnim(idx);
|
||||
}
|
||||
}
|
||||
|
||||
void TalkManager::dialogTalk() {
|
||||
for (int idx = 26; idx <= 30; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsManager->hideBob(idx);
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsMan->hideBob(idx);
|
||||
}
|
||||
|
||||
for (int idx = 26; idx <= 30; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsManager->resetBob(idx);
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsMan->resetBob(idx);
|
||||
}
|
||||
}
|
||||
|
||||
void TalkManager::dialogEndTalk() {
|
||||
for (int idx = 21; idx <= 25; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsManager->hideBob(idx);
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsMan->hideBob(idx);
|
||||
}
|
||||
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
|
||||
for (int idx = 21; idx <= 25; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsManager->resetBob(idx);
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
_vm->_objectsMan->resetBob(idx);
|
||||
}
|
||||
}
|
||||
|
||||
int TalkManager::countBoxLines(int idx, const Common::String &file) {
|
||||
_vm->_fontManager->_fontFixedWidth = 11;
|
||||
_vm->_fontMan->_fontFixedWidth = 11;
|
||||
|
||||
// Build up the filename
|
||||
Common::String filename;
|
||||
|
@ -591,30 +591,30 @@ int TalkManager::countBoxLines(int idx, const Common::String &file) {
|
|||
|
||||
void TalkManager::dialogAnim() {
|
||||
for (int idx = 21; idx <= 25; ++idx) {
|
||||
if (_vm->_animationManager->_animBqe[idx]._enabledFl)
|
||||
if (_vm->_animMan->_animBqe[idx]._enabledFl)
|
||||
displayBobDialogAnim(idx);
|
||||
}
|
||||
}
|
||||
|
||||
void TalkManager::displayBobDialogAnim(int idx) {
|
||||
_vm->_objectsManager->_priorityFl = true;
|
||||
if (!_vm->_objectsManager->_bob[idx]._bobMode) {
|
||||
_vm->_objectsManager->resetBob(idx);
|
||||
byte *bqeData = _vm->_animationManager->_animBqe[idx]._data;
|
||||
_vm->_objectsMan->_priorityFl = true;
|
||||
if (!_vm->_objectsMan->_bob[idx]._bobMode) {
|
||||
_vm->_objectsMan->resetBob(idx);
|
||||
byte *bqeData = _vm->_animMan->_animBqe[idx]._data;
|
||||
int newMode = READ_LE_INT16(bqeData + 2);
|
||||
if (!newMode)
|
||||
newMode = 1;
|
||||
if (READ_LE_INT16(bqeData + 24)) {
|
||||
_vm->_objectsManager->_bob[idx]._isSpriteFl = true;
|
||||
_vm->_objectsManager->_bob[idx]._zoomFactor = 0;
|
||||
_vm->_objectsManager->_bob[idx]._flipFl = false;
|
||||
_vm->_objectsManager->_bob[idx]._animData = _vm->_animationManager->_animBqe[idx]._data;
|
||||
_vm->_objectsManager->_bob[idx]._bobMode = 10;
|
||||
_vm->_objectsMan->_bob[idx]._isSpriteFl = true;
|
||||
_vm->_objectsMan->_bob[idx]._zoomFactor = 0;
|
||||
_vm->_objectsMan->_bob[idx]._flipFl = false;
|
||||
_vm->_objectsMan->_bob[idx]._animData = _vm->_animMan->_animBqe[idx]._data;
|
||||
_vm->_objectsMan->_bob[idx]._bobMode = 10;
|
||||
bqeData = _characterSprite;
|
||||
_vm->_objectsManager->_bob[idx]._spriteData = _characterSprite;
|
||||
_vm->_objectsManager->_bob[idx]._bobModeChange = newMode;
|
||||
_vm->_objectsManager->_bob[idx]._modeChangeCtr = -1;
|
||||
_vm->_objectsManager->_bob[idx]._modeChangeUnused = 0;
|
||||
_vm->_objectsMan->_bob[idx]._spriteData = _characterSprite;
|
||||
_vm->_objectsMan->_bob[idx]._bobModeChange = newMode;
|
||||
_vm->_objectsMan->_bob[idx]._modeChangeCtr = -1;
|
||||
_vm->_objectsMan->_bob[idx]._modeChangeUnused = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ void TalkManager::startCharacterAnim0(int startIdx, bool readOnlyFl) {
|
|||
if (!READ_LE_INT16(&_characterAnim[2 * idx + 4]))
|
||||
break;
|
||||
if (_vm->_globals->_speed != 501)
|
||||
_vm->_graphicsManager->fastDisplay(_characterSprite, _vm->_eventsManager->_startPos.x + READ_LE_INT16(&_characterAnim[2 * idx]),
|
||||
_vm->_graphicsMan->fastDisplay(_characterSprite, _vm->_events->_startPos.x + READ_LE_INT16(&_characterAnim[2 * idx]),
|
||||
READ_LE_INT16(&_characterAnim[2 * idx + 2]), _characterAnim[2 * idx + 8]);
|
||||
idx += 5;
|
||||
} while (_vm->_globals->_speed != 501);
|
||||
|
@ -694,8 +694,8 @@ void TalkManager::initCharacterAnim() {
|
|||
|
||||
void TalkManager::clearCharacterAnim() {
|
||||
for (int idx = 21; idx <= 34; ++idx) {
|
||||
_vm->_animationManager->_animBqe[idx]._data = _vm->_globals->freeMemory(_vm->_animationManager->_animBqe[idx]._data);
|
||||
_vm->_animationManager->_animBqe[idx]._enabledFl = false;
|
||||
_vm->_animMan->_animBqe[idx]._data = _vm->_globals->freeMemory(_vm->_animMan->_animBqe[idx]._data);
|
||||
_vm->_animMan->_animBqe[idx]._enabledFl = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -712,25 +712,25 @@ bool TalkManager::searchCharacterAnim(int idx, const byte *bufPerso, int animId,
|
|||
if (READ_BE_UINT32(curPtr) == MKTAG('A', 'N', 'I', 'M') || READ_BE_UINT24(curPtr) == MKTAG24('F', 'I', 'N'))
|
||||
loopCond = true;
|
||||
if (bufIndx > bufferSize) {
|
||||
_vm->_animationManager->_animBqe[idx]._enabledFl = false;
|
||||
_vm->_animationManager->_animBqe[idx]._data = NULL;
|
||||
_vm->_animMan->_animBqe[idx]._enabledFl = false;
|
||||
_vm->_animMan->_animBqe[idx]._data = NULL;
|
||||
return false;
|
||||
}
|
||||
++bufIndx;
|
||||
++animLength;
|
||||
++curPtr;
|
||||
} while (!loopCond);
|
||||
_vm->_animationManager->_animBqe[idx]._data = _vm->_globals->allocMemory(animLength + 50);
|
||||
_vm->_animationManager->_animBqe[idx]._enabledFl = true;
|
||||
memcpy(_vm->_animationManager->_animBqe[idx]._data, (const byte *)(bufPerso + bufPos + 5), 20);
|
||||
_vm->_animMan->_animBqe[idx]._data = _vm->_globals->allocMemory(animLength + 50);
|
||||
_vm->_animMan->_animBqe[idx]._enabledFl = true;
|
||||
memcpy(_vm->_animMan->_animBqe[idx]._data, (const byte *)(bufPerso + bufPos + 5), 20);
|
||||
int bqeVal = READ_LE_INT16(bufPos + bufPerso + 29);
|
||||
WRITE_LE_UINT16(_vm->_animationManager->_animBqe[idx]._data + 20, READ_LE_INT16(bufPos + bufPerso + 25));
|
||||
WRITE_LE_UINT16(_vm->_animationManager->_animBqe[idx]._data + 22, READ_LE_INT16(bufPos + bufPerso + 27));
|
||||
WRITE_LE_UINT16(_vm->_animationManager->_animBqe[idx]._data + 24, bqeVal);
|
||||
WRITE_LE_UINT16(_vm->_animationManager->_animBqe[idx]._data + 26, READ_LE_INT16(bufPos + bufPerso + 31));
|
||||
_vm->_animationManager->_animBqe[idx]._data[28] = bufPerso[bufPos + 33];
|
||||
_vm->_animationManager->_animBqe[idx]._data[29] = bufPerso[bufPos + 34];
|
||||
byte *bqeCurData = _vm->_animationManager->_animBqe[idx]._data + 20;
|
||||
WRITE_LE_UINT16(_vm->_animMan->_animBqe[idx]._data + 20, READ_LE_INT16(bufPos + bufPerso + 25));
|
||||
WRITE_LE_UINT16(_vm->_animMan->_animBqe[idx]._data + 22, READ_LE_INT16(bufPos + bufPerso + 27));
|
||||
WRITE_LE_UINT16(_vm->_animMan->_animBqe[idx]._data + 24, bqeVal);
|
||||
WRITE_LE_UINT16(_vm->_animMan->_animBqe[idx]._data + 26, READ_LE_INT16(bufPos + bufPerso + 31));
|
||||
_vm->_animMan->_animBqe[idx]._data[28] = bufPerso[bufPos + 33];
|
||||
_vm->_animMan->_animBqe[idx]._data[29] = bufPerso[bufPos + 34];
|
||||
byte *bqeCurData = _vm->_animMan->_animBqe[idx]._data + 20;
|
||||
const byte *curBufPerso = bufPos + bufPerso + 25;
|
||||
for (int i = 1; i < 5000; i++) {
|
||||
bqeCurData += 10;
|
||||
|
@ -821,16 +821,16 @@ void TalkManager::handleAnswer(int zone, int verb) {
|
|||
innerLoopCond = false;
|
||||
int lastOpcodeResult = 1;
|
||||
do {
|
||||
int opcodeType = _vm->_scriptManager->handleOpcode(ptr + 20 * lastOpcodeResult);
|
||||
int opcodeType = _vm->_script->handleOpcode(ptr + 20 * lastOpcodeResult);
|
||||
if (_vm->shouldQuit())
|
||||
return;
|
||||
|
||||
if (opcodeType == 2)
|
||||
// GOTO
|
||||
lastOpcodeResult = _vm->_scriptManager->handleGoto(ptr + 20 * lastOpcodeResult);
|
||||
lastOpcodeResult = _vm->_script->handleGoto(ptr + 20 * lastOpcodeResult);
|
||||
else if (opcodeType == 3)
|
||||
// IF
|
||||
lastOpcodeResult = _vm->_scriptManager->handleIf(ptr, lastOpcodeResult);
|
||||
lastOpcodeResult = _vm->_script->handleIf(ptr, lastOpcodeResult);
|
||||
|
||||
if (lastOpcodeResult == -1)
|
||||
error("Invalid IFF function");
|
||||
|
@ -844,8 +844,8 @@ void TalkManager::handleAnswer(int zone, int verb) {
|
|||
else if (opcodeType == 6) {
|
||||
// JUMP
|
||||
_vm->_globals->freeMemory(ptr);
|
||||
zoneObj = _vm->_objectsManager->_jumpZone;
|
||||
verbObj = _vm->_objectsManager->_jumpVerb;
|
||||
zoneObj = _vm->_objectsMan->_jumpZone;
|
||||
verbObj = _vm->_objectsMan->_jumpVerb;
|
||||
outerLoopFl = true;
|
||||
break;
|
||||
}
|
||||
|
@ -862,26 +862,26 @@ void TalkManager::handleForestAnswser(int zone, int verb) {
|
|||
return;
|
||||
|
||||
if (zone == 22 || zone == 23) {
|
||||
_vm->_objectsManager->setFlipSprite(0, false);
|
||||
_vm->_objectsManager->setSpriteIndex(0, 62);
|
||||
_vm->_objectsManager->showSpecialActionAnimationWithFlip(_vm->_objectsManager->_forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 4, false);
|
||||
_vm->_objectsMan->setFlipSprite(0, false);
|
||||
_vm->_objectsMan->setSpriteIndex(0, 62);
|
||||
_vm->_objectsMan->showSpecialActionAnimationWithFlip(_vm->_objectsMan->_forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 4, false);
|
||||
if (zone == 22) {
|
||||
_vm->_objectsManager->lockAnimX(6, _vm->_objectsManager->getBobPosX(3));
|
||||
_vm->_objectsManager->lockAnimX(8, _vm->_objectsManager->getBobPosX(3));
|
||||
_vm->_objectsMan->lockAnimX(6, _vm->_objectsMan->getBobPosX(3));
|
||||
_vm->_objectsMan->lockAnimX(8, _vm->_objectsMan->getBobPosX(3));
|
||||
} else { // zone == 23
|
||||
_vm->_objectsManager->lockAnimX(6, _vm->_objectsManager->getBobPosX(4));
|
||||
_vm->_objectsManager->lockAnimX(8, _vm->_objectsManager->getBobPosX(4));
|
||||
_vm->_objectsMan->lockAnimX(6, _vm->_objectsMan->getBobPosX(4));
|
||||
_vm->_objectsMan->lockAnimX(8, _vm->_objectsMan->getBobPosX(4));
|
||||
}
|
||||
_vm->_objectsManager->stopBobAnimation(3);
|
||||
_vm->_objectsManager->stopBobAnimation(4);
|
||||
_vm->_objectsManager->setBobAnimation(6);
|
||||
_vm->_soundManager->playSample(1);
|
||||
_vm->_objectsManager->showSpecialActionAnimation(_vm->_objectsManager->_forestSprite, "13,14,15,14,13,12,13,14,15,16,-1,", 4);
|
||||
_vm->_objectsMan->stopBobAnimation(3);
|
||||
_vm->_objectsMan->stopBobAnimation(4);
|
||||
_vm->_objectsMan->setBobAnimation(6);
|
||||
_vm->_soundMan->playSample(1);
|
||||
_vm->_objectsMan->showSpecialActionAnimation(_vm->_objectsMan->_forestSprite, "13,14,15,14,13,12,13,14,15,16,-1,", 4);
|
||||
do
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
while (_vm->_objectsManager->getBobAnimDataIdx(6) < 12);
|
||||
_vm->_objectsManager->stopBobAnimation(6);
|
||||
_vm->_objectsManager->setBobAnimation(8);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
while (_vm->_objectsMan->getBobAnimDataIdx(6) < 12);
|
||||
_vm->_objectsMan->stopBobAnimation(6);
|
||||
_vm->_objectsMan->setBobAnimation(8);
|
||||
|
||||
switch (_vm->_globals->_screenId) {
|
||||
case 35:
|
||||
|
@ -907,29 +907,29 @@ void TalkManager::handleForestAnswser(int zone, int verb) {
|
|||
break;
|
||||
}
|
||||
_vm->_globals->_saveData->_data[indx] = 2;
|
||||
_vm->_linesManager->disableZone(22);
|
||||
_vm->_linesManager->disableZone(23);
|
||||
_vm->_linesMan->disableZone(22);
|
||||
_vm->_linesMan->disableZone(23);
|
||||
} else if (zone == 20 || zone == 21) {
|
||||
_vm->_objectsManager->setFlipSprite(0, true);
|
||||
_vm->_objectsManager->setSpriteIndex(0, 62);
|
||||
_vm->_objectsManager->showSpecialActionAnimationWithFlip(_vm->_objectsManager->_forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 4, true);
|
||||
_vm->_objectsMan->setFlipSprite(0, true);
|
||||
_vm->_objectsMan->setSpriteIndex(0, 62);
|
||||
_vm->_objectsMan->showSpecialActionAnimationWithFlip(_vm->_objectsMan->_forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 4, true);
|
||||
if (zone == 20) {
|
||||
_vm->_objectsManager->lockAnimX(5, _vm->_objectsManager->getBobPosX(1));
|
||||
_vm->_objectsManager->lockAnimX(7, _vm->_objectsManager->getBobPosX(1));
|
||||
_vm->_objectsMan->lockAnimX(5, _vm->_objectsMan->getBobPosX(1));
|
||||
_vm->_objectsMan->lockAnimX(7, _vm->_objectsMan->getBobPosX(1));
|
||||
} else { // zone == 21
|
||||
_vm->_objectsManager->lockAnimX(5, _vm->_objectsManager->getBobPosX(2));
|
||||
_vm->_objectsManager->lockAnimX(7, _vm->_objectsManager->getBobPosX(2));
|
||||
_vm->_objectsMan->lockAnimX(5, _vm->_objectsMan->getBobPosX(2));
|
||||
_vm->_objectsMan->lockAnimX(7, _vm->_objectsMan->getBobPosX(2));
|
||||
}
|
||||
_vm->_objectsManager->stopBobAnimation(1);
|
||||
_vm->_objectsManager->stopBobAnimation(2);
|
||||
_vm->_objectsManager->setBobAnimation(5);
|
||||
_vm->_soundManager->playSample(1);
|
||||
_vm->_objectsManager->showSpecialActionAnimation(_vm->_objectsManager->_forestSprite, "13,14,15,14,13,12,13,14,15,16,-1,", 4);
|
||||
_vm->_objectsMan->stopBobAnimation(1);
|
||||
_vm->_objectsMan->stopBobAnimation(2);
|
||||
_vm->_objectsMan->setBobAnimation(5);
|
||||
_vm->_soundMan->playSample(1);
|
||||
_vm->_objectsMan->showSpecialActionAnimation(_vm->_objectsMan->_forestSprite, "13,14,15,14,13,12,13,14,15,16,-1,", 4);
|
||||
do
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
while (_vm->_objectsManager->getBobAnimDataIdx(5) < 12);
|
||||
_vm->_objectsManager->stopBobAnimation(5);
|
||||
_vm->_objectsManager->setBobAnimation(7);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
while (_vm->_objectsMan->getBobAnimDataIdx(5) < 12);
|
||||
_vm->_objectsMan->stopBobAnimation(5);
|
||||
_vm->_objectsMan->setBobAnimation(7);
|
||||
switch (_vm->_globals->_screenId) {
|
||||
case 35:
|
||||
indx = 200;
|
||||
|
@ -954,32 +954,32 @@ void TalkManager::handleForestAnswser(int zone, int verb) {
|
|||
break;
|
||||
}
|
||||
_vm->_globals->_saveData->_data[indx] = 2;
|
||||
_vm->_linesManager->disableZone(21);
|
||||
_vm->_linesManager->disableZone(20);
|
||||
_vm->_linesMan->disableZone(21);
|
||||
_vm->_linesMan->disableZone(20);
|
||||
}
|
||||
}
|
||||
|
||||
void TalkManager::animateObject(const Common::String &filename) {
|
||||
_vm->_fontManager->hideText(5);
|
||||
_vm->_fontManager->hideText(9);
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_graphicsManager->_scrollStatus = 1;
|
||||
_vm->_linesManager->clearAllZones();
|
||||
_vm->_linesManager->resetLines();
|
||||
_vm->_objectsManager->resetHidingItems();
|
||||
_vm->_fontMan->hideText(5);
|
||||
_vm->_fontMan->hideText(9);
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_graphicsMan->_scrollStatus = 1;
|
||||
_vm->_linesMan->clearAllZones();
|
||||
_vm->_linesMan->resetLines();
|
||||
_vm->_objectsMan->resetHidingItems();
|
||||
|
||||
for (int i = 0; i <= 44; i++)
|
||||
_vm->_linesManager->_bobZone[i] = 0;
|
||||
_vm->_linesMan->_bobZone[i] = 0;
|
||||
|
||||
_vm->_objectsManager->_zoneNum = -1;
|
||||
_vm->_eventsManager->_mouseCursorId = 4;
|
||||
_vm->_eventsManager->changeMouseCursor(0);
|
||||
_vm->_objectsMan->_zoneNum = -1;
|
||||
_vm->_events->_mouseCursorId = 4;
|
||||
_vm->_events->changeMouseCursor(0);
|
||||
bool fileFoundFl = false;
|
||||
_characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER, fileFoundFl);
|
||||
_characterSize = _vm->_fileManager->_catalogSize;
|
||||
_characterBuffer = _vm->_fileIO->searchCat(filename, RES_PER, fileFoundFl);
|
||||
_characterSize = _vm->_fileIO->_catalogSize;
|
||||
if (!fileFoundFl) {
|
||||
_characterBuffer = _vm->_fileManager->loadFile(filename);
|
||||
_characterSize = _vm->_fileManager->fileSize(filename);
|
||||
_characterBuffer = _vm->_fileIO->loadFile(filename);
|
||||
_characterSize = _vm->_fileIO->fileSize(filename);
|
||||
}
|
||||
Common::String screenFilename;
|
||||
Common::String spriteFilename;
|
||||
|
@ -992,47 +992,47 @@ void TalkManager::animateObject(const Common::String &filename) {
|
|||
curScreenFilename = Common::String::format("IM%d", _vm->_globals->_screenId);
|
||||
|
||||
fileFoundFl = false;
|
||||
_characterSprite = _vm->_fileManager->searchCat(spriteFilename, RES_SAN, fileFoundFl);
|
||||
_characterSprite = _vm->_fileIO->searchCat(spriteFilename, RES_SAN, fileFoundFl);
|
||||
if (!fileFoundFl)
|
||||
_characterSprite = _vm->_objectsManager->loadSprite(spriteFilename);
|
||||
_characterSprite = _vm->_objectsMan->loadSprite(spriteFilename);
|
||||
else
|
||||
_characterSprite = _vm->_objectsManager->loadSprite("RES_SAN.RES");
|
||||
_characterSprite = _vm->_objectsMan->loadSprite("RES_SAN.RES");
|
||||
|
||||
_vm->_graphicsManager->backupScreen();
|
||||
_vm->_graphicsMan->backupScreen();
|
||||
|
||||
if (!_vm->_graphicsManager->_lineNbr)
|
||||
_vm->_graphicsManager->_scrollOffset = 0;
|
||||
_vm->_graphicsManager->displayScreen(true);
|
||||
if (!_vm->_graphicsMan->_lineNbr)
|
||||
_vm->_graphicsMan->_scrollOffset = 0;
|
||||
_vm->_graphicsMan->displayScreen(true);
|
||||
_paletteBufferIdx = 20 * READ_LE_INT16((uint16 *)_characterBuffer + 42) + 110;
|
||||
_vm->_graphicsManager->displayScreen(true);
|
||||
_vm->_objectsManager->_charactersEnabledFl = true;
|
||||
_vm->_graphicsMan->displayScreen(true);
|
||||
_vm->_objectsMan->_charactersEnabledFl = true;
|
||||
searchCharacterPalette(_paletteBufferIdx, true);
|
||||
startCharacterAnim0(_paletteBufferIdx, false);
|
||||
byte *oldAnswerBufferPtr = _vm->_globals->_answerBuffer;
|
||||
_vm->_globals->_answerBuffer = NULL;
|
||||
_vm->_globals->_freezeCharacterFl = true;
|
||||
_vm->_objectsManager->loadLinkFile(screenFilename);
|
||||
_vm->_objectsManager->_charactersEnabledFl = true;
|
||||
_vm->_objectsMan->loadLinkFile(screenFilename);
|
||||
_vm->_objectsMan->_charactersEnabledFl = true;
|
||||
_vm->_globals->_actionMoveTo = false;
|
||||
_vm->_objectsManager->_zoneNum = -1;
|
||||
_vm->_objectsMan->_zoneNum = -1;
|
||||
initCharacterAnim();
|
||||
dialogAnim();
|
||||
dialogWait();
|
||||
_vm->_graphicsManager->initScreen(screenFilename, 2, true);
|
||||
_vm->_graphicsMan->initScreen(screenFilename, 2, true);
|
||||
_vm->_globals->_freezeCharacterFl = true;
|
||||
_vm->_objectsManager->_forceZoneFl = true;
|
||||
_vm->_objectsManager->_zoneNum = -1;
|
||||
_vm->_objectsMan->_forceZoneFl = true;
|
||||
_vm->_objectsMan->_zoneNum = -1;
|
||||
do {
|
||||
int mouseButton = _vm->_eventsManager->getMouseButton();
|
||||
int mouseButton = _vm->_events->getMouseButton();
|
||||
if (mouseButton == 1)
|
||||
_vm->_objectsManager->handleLeftButton();
|
||||
_vm->_objectsMan->handleLeftButton();
|
||||
else if (mouseButton == 2)
|
||||
_vm->_objectsManager->handleRightButton();
|
||||
_vm->_objectsMan->handleRightButton();
|
||||
|
||||
_vm->_linesManager->checkZone();
|
||||
_vm->_linesMan->checkZone();
|
||||
if (_vm->_globals->_actionMoveTo)
|
||||
_vm->_objectsManager->PARADISE();
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_objectsMan->PARADISE();
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
} while (!_vm->_globals->_exitId);
|
||||
dialogEndTalk();
|
||||
dialogTalk();
|
||||
|
@ -1041,45 +1041,45 @@ void TalkManager::animateObject(const Common::String &filename) {
|
|||
_vm->_globals->_introSpeechOffFl = false;
|
||||
_characterBuffer = _vm->_globals->freeMemory(_characterBuffer);
|
||||
_characterSprite = _vm->_globals->freeMemory(_characterSprite);
|
||||
_vm->_graphicsManager->displayScreen(false);
|
||||
_vm->_linesManager->clearAllZones();
|
||||
_vm->_linesManager->resetLines();
|
||||
_vm->_objectsManager->resetHidingItems();
|
||||
_vm->_graphicsMan->displayScreen(false);
|
||||
_vm->_linesMan->clearAllZones();
|
||||
_vm->_linesMan->resetLines();
|
||||
_vm->_objectsMan->resetHidingItems();
|
||||
for (int i = 0; i <= 44; i++)
|
||||
_vm->_linesManager->_bobZone[i] = 0;
|
||||
_vm->_linesMan->_bobZone[i] = 0;
|
||||
|
||||
_vm->_globals->freeMemory(_vm->_globals->_answerBuffer);
|
||||
_vm->_globals->_answerBuffer = oldAnswerBufferPtr;
|
||||
_vm->_objectsManager->_disableFl = true;
|
||||
_vm->_objectsManager->loadLinkFile(curScreenFilename);
|
||||
_vm->_graphicsManager->initScreen(curScreenFilename, 2, true);
|
||||
_vm->_objectsManager->_disableFl = false;
|
||||
_vm->_objectsMan->_disableFl = true;
|
||||
_vm->_objectsMan->loadLinkFile(curScreenFilename);
|
||||
_vm->_graphicsMan->initScreen(curScreenFilename, 2, true);
|
||||
_vm->_objectsMan->_disableFl = false;
|
||||
_vm->_globals->_freezeCharacterFl = false;
|
||||
if (_vm->_globals->_exitId == 101)
|
||||
_vm->_globals->_exitId = 0;
|
||||
|
||||
_vm->_graphicsManager->restoreScreen();
|
||||
_vm->_graphicsMan->restoreScreen();
|
||||
|
||||
_vm->_objectsManager->_charactersEnabledFl = false;
|
||||
_vm->_eventsManager->_mouseCursorId = 4;
|
||||
_vm->_eventsManager->changeMouseCursor(4);
|
||||
_vm->_graphicsManager->setColorPercentage(253, 100, 100, 100);
|
||||
_vm->_objectsMan->_charactersEnabledFl = false;
|
||||
_vm->_events->_mouseCursorId = 4;
|
||||
_vm->_events->changeMouseCursor(4);
|
||||
_vm->_graphicsMan->setColorPercentage(253, 100, 100, 100);
|
||||
|
||||
if (!_vm->getIsDemo())
|
||||
_vm->_graphicsManager->setColorPercentage(254, 0, 0, 0);
|
||||
_vm->_graphicsMan->setColorPercentage(254, 0, 0, 0);
|
||||
|
||||
_vm->_graphicsManager->initColorTable(145, 150, _vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
_vm->_graphicsManager->lockScreen();
|
||||
_vm->_graphicsManager->copy16BitRect(_vm->_graphicsManager->_backBuffer, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsManager->unlockScreen();
|
||||
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
|
||||
memcpy(_vm->_graphicsManager->_frontBuffer, _vm->_graphicsManager->_backBuffer, 614399);
|
||||
_vm->_graphicsMan->initColorTable(145, 150, _vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
_vm->_graphicsMan->lockScreen();
|
||||
_vm->_graphicsMan->copy16BitRect(_vm->_graphicsMan->_backBuffer, _vm->_events->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
_vm->_graphicsMan->unlockScreen();
|
||||
_vm->_graphicsMan->setPaletteVGA256(_vm->_graphicsMan->_palette);
|
||||
memcpy(_vm->_graphicsMan->_frontBuffer, _vm->_graphicsMan->_backBuffer, 614399);
|
||||
_vm->_globals->_disableInventFl = false;
|
||||
_vm->_graphicsManager->updateScreen();
|
||||
_vm->_graphicsMan->updateScreen();
|
||||
for (int i = 0; i <= 4; i++)
|
||||
_vm->_eventsManager->refreshScreenAndEvents();
|
||||
_vm->_graphicsManager->_scrollStatus = 0;
|
||||
_vm->_events->refreshScreenAndEvents();
|
||||
_vm->_graphicsMan->_scrollStatus = 0;
|
||||
}
|
||||
|
||||
} // End of namespace Hopkins
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue