Skip to content

Commit

Permalink
KYRA: (EOB) - fix char generator regression + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
athrxx authored and Johannes Schickel committed Dec 26, 2011
1 parent 68ed8b9 commit ac1aa43
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
6 changes: 3 additions & 3 deletions engines/kyra/chargen.cpp
Expand Up @@ -380,7 +380,7 @@ int CharacterGenerator::viewDeleteCharacter() {
int res = 0;
for (bool loop = true; loop && _characters[_activeBox].name[0] && !_vm->shouldQuit(); ) {
_vm->_gui->updateBoxFrameHighLight(_activeBox + 6);
int inputFlag =getInput(_vm->_activeButtons);
int inputFlag = getInput(_vm->_activeButtons);
int cbx = _activeBox;
_vm->removeInputTop();

Expand Down Expand Up @@ -517,7 +517,7 @@ int CharacterGenerator::classMenu(int raceSex) {

while (res == -1 && !_vm->shouldQuit()) {
updateMagicShapes();
int in = getInput(_vm->_activeButtons) & 0xff;
int in = getInput(0) & 0xff;
Common::Point mp = _vm->getMousePos();

if (in == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_b]) {
Expand Down Expand Up @@ -565,7 +565,7 @@ int CharacterGenerator::alignmentMenu(int cClass) {

while (res == -1 && !_vm->shouldQuit()) {
updateMagicShapes();
int in = getInput(_vm->_activeButtons) & 0xff;
int in = getInput(0) & 0xff;
Common::Point mp = _vm->getMousePos();

if (in == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_b]) {
Expand Down
18 changes: 15 additions & 3 deletions engines/kyra/text_eob.cpp
Expand Up @@ -55,13 +55,20 @@ TextDisplayer_Eob::TextDisplayer_Eob(LolEobBaseEngine *engine, Screen *sScreen)
_textDimData[i].column = d->unkE;
}

_table1 = new char[128];
memset(_table1, 0, 128);
_table2 = new char[16];
memset(_table2, 0, 16);

_waitButtonSpace = 0;
}

TextDisplayer_Eob::~TextDisplayer_Eob() {
delete[] _dialogueBuffer;
delete[] _currentLine;
delete[] _textDimData;
delete[] _table1;
delete[] _table2;
}

void TextDisplayer_Eob::setupField(int dim, bool mode) {
Expand Down Expand Up @@ -257,6 +264,7 @@ char TextDisplayer_Eob::parseCommand() {
}

void TextDisplayer_Eob::readNextPara() {
char c = 0;
char d = 0;

if (_tempString2) {
Expand All @@ -275,12 +283,16 @@ void TextDisplayer_Eob::readNextPara() {
_tempString1 = 0;
}

if (d & 0x80) {
warning("TextDisplayer_Eob::readNextPara():");
if ((_vm->game() != GI_LOL) && (d & 0x80)) {
d &= 0x7f;
c = d & 7;
d = (d & 0x78) >> 3;
c = _table1[(d << 3) + c];
d = _table2[d];
}

_ctrl[1] = d;
_ctrl[2] = 0;
_ctrl[2] = c;
}

void TextDisplayer_Eob::printLine(char *str) {
Expand Down
3 changes: 3 additions & 0 deletions engines/kyra/text_eob.h
Expand Up @@ -103,6 +103,9 @@ class TextDisplayer_Eob {
private:
LolEobBaseEngine *_vm;
Screen *_screen;

char *_table1;
char *_table2;
};

} // End of namespace Kyra
Expand Down

0 comments on commit ac1aa43

Please sign in to comment.