Skip to content

Commit

Permalink
ACCESS: Further cleanup of doEstablish parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 31, 2014
1 parent 78bf011 commit 2f5fb20
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion engines/access/access.cpp
Expand Up @@ -240,7 +240,7 @@ void AccessEngine::speakText(ASurface *s, Common::Array<Common::String> msgArr)
while (true) {
_sound->_soundTable[0] = _sound->loadSound(_narateFile + 99, _sndSubFile);
_sound->_soundPriority[0] = 1;
_sound->playSound(1);
_sound->playSound(0);
_scripts->cmdFreeSound();

_events->pollEvents();
Expand Down
18 changes: 9 additions & 9 deletions engines/access/amazon/amazon_game.cpp
Expand Up @@ -212,28 +212,28 @@ void AmazonEngine::setupGame() {
_player->_playerY = _player->_rawPlayer.y = TRAVEL_POS[_player->_roomNumber][1];
}

void AmazonEngine::establish(int esatabIndex, int sub) {
void AmazonEngine::establish(int screenId, int esatabIndex) {
_establishMode = 0;
_establishGroup = 0;
doEstablish(esatabIndex, sub);
doEstablish(screenId, esatabIndex);
}

void AmazonEngine::establishCenter(int esatabIndex, int sub) {
void AmazonEngine::establishCenter(int screenId, int esatabIndex) {
_establishMode = 1;
doEstablish(esatabIndex, sub);
doEstablish(screenId, esatabIndex);
}

const char *const _estTable[] = { "ETEXT0.DAT", "ETEXT1.DAT", "ETEXT2.DAT", "ETEXT3.DAT" };

void AmazonEngine::loadEstablish(int sub) {
void AmazonEngine::loadEstablish(int estabIndex) {
if (!_files->existFile("ETEXT.DAT")) {
int oldGroup = _establishGroup;
_establishGroup = 0;

_eseg = _files->loadFile(_estTable[oldGroup]);
_establishCtrlTblOfs = READ_LE_UINT16(_eseg->data());

int ofs = _establishCtrlTblOfs + (sub * 2);
int ofs = _establishCtrlTblOfs + (estabIndex * 2);
int idx = READ_LE_UINT16(_eseg->data() + ofs);
_narateFile = READ_LE_UINT16(_eseg->data() + idx);
_txtPages = READ_LE_UINT16(_eseg->data() + idx + 2);
Expand All @@ -253,15 +253,15 @@ void AmazonEngine::loadEstablish(int sub) {
}
}

void AmazonEngine::doEstablish(int estabIndex, int sub) {
void AmazonEngine::doEstablish(int screenId, int estabIndex) {
_establishMode = 1;

_screen->forceFadeOut();
_screen->clearScreen();
_screen->setPanel(3);

if (sub != -1) {
_files->loadScreen(95, sub);
if (screenId != -1) {
_files->loadScreen(95, screenId);
_buffer2.copyBuffer(_screen);
}

Expand Down
6 changes: 3 additions & 3 deletions engines/access/amazon/amazon_game.h
Expand Up @@ -99,9 +99,9 @@ class AmazonEngine : public AccessEngine {
*/
void setupGame();

void loadEstablish(int sub);
void doEstablish(int estabIndex, int sub);
void establishCenter(int esatabIndex, int sub);
void loadEstablish(int estabIndex);
void doEstablish(int screenId, int estabIndex);
void establishCenter(int screenId, int esatabIndex);

protected:
/**
Expand Down
2 changes: 1 addition & 1 deletion engines/access/char.cpp
Expand Up @@ -90,7 +90,7 @@ void CharManager::loadChar(int charId) {
_vm->_establishFlag = true;
if (!_vm->_establishTable[ce._estabIndex]) {
_vm->_establishTable[ce._estabIndex] = true;
_vm->establish(ce._estabIndex, 0);
_vm->establish(0, ce._estabIndex);
}
}

Expand Down
2 changes: 1 addition & 1 deletion engines/access/room.cpp
Expand Up @@ -171,7 +171,7 @@ void Room::loadRoomData(const byte *roomData) {
_vm->_establishFlag = true;
if (_vm->_establishTable[roomInfo._estIndex] != 1) {
_vm->_establishTable[roomInfo._estIndex] = 1;
_vm->establish(roomInfo._estIndex, 0);
_vm->establish(0, roomInfo._estIndex);
}
}

Expand Down

0 comments on commit 2f5fb20

Please sign in to comment.