LOL: - extended text displayer and added one more opcode

svn-id: r41100
This commit is contained in:
Florian Kagerer 2009-06-01 13:37:51 +00:00
parent 18f5ef8234
commit 660aa71662
3 changed files with 18 additions and 5 deletions

View File

@ -2722,7 +2722,7 @@ void LoLEngine::setupOpcodeTable() {
Opcode(olol_assignSpecialGuiShape);
Opcode(olol_findInventoryItem);
Opcode(olol_restoreFadePalette);
OpcodeUnImpl();
Opcode(olol_calcNewBlockPosition);
// 0xA8
OpcodeUnImpl();

View File

@ -578,15 +578,16 @@ int LoLEngine::selectionCharInfo(int character) {
void LoLEngine::selectionCharInfoIntro(char *file) {
int index = 0;
file[4] = '0';
bool processAnim = true;
while (_charSelectionInfoResult == -1 && !shouldQuit()) {
if (!_sound->isVoicePresent(file))
if (_speechFlag && !_sound->isVoicePresent(file))
break;
_sound->voicePlay(file, &_speechHandle);
int i = 0;
while (_sound->voiceIsPlaying(&_speechHandle) && _charSelectionInfoResult == -1 && !shouldQuit()) {
while ((!_speechFlag || (_speechFlag && _sound->voiceIsPlaying(&_speechHandle))) && _charSelectionInfoResult == -1 && !shouldQuit()) {
_screen->drawShape(0, _screen->getPtrToShape(_screen->getCPagePtr(9), _charInfoFrameTable[i]), 11, 130, 0, 0);
_screen->updateScreen();
@ -596,7 +597,10 @@ void LoLEngine::selectionCharInfoIntro(char *file) {
_system->delayMillis(10);
}
i = (i + 1) % 32;
if (_speechFlag || processAnim)
i = (i + 1) % 32;
if (i == 0)
processAnim = false;
}
_sound->voiceStop(&_speechHandle);

View File

@ -354,6 +354,8 @@ void TextDisplayer_LoL::displayText(char *str, ...) {
const ScreenDim *sd = _screen->_curDim;
int sdx = _screen->curDimIndex();
uint16 charsPerLine = (sd->w << 3) / (_screen->getFontWidth() + _screen->_charWidth);
while (c) {
char a = tolower(_ctrl[1]);
@ -372,6 +374,8 @@ void TextDisplayer_LoL::displayText(char *str, ...) {
c = parseCommand();
}
uint16 dv = _textDimData[sdx].column / (_screen->getFontWidth() + _screen->_charWidth);
switch (c - 1) {
case 0:
printLine(_currentLine);
@ -390,7 +394,12 @@ void TextDisplayer_LoL::displayText(char *str, ...) {
break;
case 8:
//TODO
printLine(_currentLine);
dv = _textDimData[sdx].column / (_screen->getFontWidth() + _screen->_charWidth);
dv = ((dv + 8) & 0xfff8) - 1;
if (dv >= charsPerLine)
dv = 0;
_textDimData[sdx].column = (_screen->getFontWidth() + _screen->_charWidth) * dv;
break;
case 11: