Skip to content

Commit

Permalink
ACCESS: Modify speakText so it takes a string array as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Aug 25, 2014
1 parent 33cdeb7 commit 8c059ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions engines/access/access.cpp
Expand Up @@ -199,7 +199,6 @@ void AccessEngine::dummyLoop() {
_events->setCursor((cursorId == CURSOR_HELP) ? CURSOR_ARROW : (CursorType)(cursorId + 1));
}
}

}

int AccessEngine::getRandomNumber(int maxNumber) {
Expand Down Expand Up @@ -264,21 +263,17 @@ void AccessEngine::loadEstablish(int sub) {
_countTbl[i] = READ_LE_UINT16(_eseg + idx + 6 + (2 * i));
}

void AccessEngine::speakText(int idx) {
void AccessEngine::speakText(Common::Array<Common::String> msgArr) {
int curPage = 0;
int soundsLeft = 0;

Common::String msg;
for (int i = idx; _eseg[i] != 0; ++i)
msg += _eseg[i];

while(true) {
soundsLeft = _countTbl[curPage];
_events->zeroKeys();

Common::String line;
int width = 0;
bool lastLine = _fonts._font2.getLine(msg, _bubbleBox->_maxChars * 6, line, width);
bool lastLine = _fonts._font2.getLine(msgArr[curPage], _bubbleBox->_maxChars * 6, line, width);
// Set font colors
_fonts._font2._fontColors[0] = 0;
_fonts._font2._fontColors[1] = 28;
Expand Down Expand Up @@ -372,15 +367,20 @@ void AccessEngine::doEstablish(int esatabIndex, int sub) {
_screen->_printOrg = _screen->_printStart = Common::Point(48, 35);
loadEstablish(sub);
_et = sub;
warning("CHECKME: Use of di");
uint16 msgOffset = READ_LE_UINT16(_eseg + (sub * 2) + 2);
Common::String msg((const char *)_eseg + msgOffset);

_printEnd = 155;
if (_txtPages == 0) {
Common::String msg((const char *)_eseg + msgOffset);
_fonts._font2.printText(_screen, msg);
} else {
// speakText(msg);
Common::Array<Common::String> msgArr;
for (int i = 0; i < _txtPages; ++i) {
Common::String msg((const char *)_eseg + msgOffset);
msgOffset += msg.size() + 1;
msgArr.push_back(msg);
}
speakText(msgArr);
}

_screen->forceFadeOut();
Expand Down
2 changes: 1 addition & 1 deletion engines/access/access.h
Expand Up @@ -92,7 +92,7 @@ class AccessEngine : public Engine {

void dummyLoop();

void speakText(int idx);
void speakText(Common::Array<Common::String>msgArr);

void doEstablish(int esatabIndex, int sub);
protected:
Expand Down

0 comments on commit 8c059ad

Please sign in to comment.