diff options
author | Filippos Karapetis | 2008-04-24 17:32:24 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-04-24 17:32:24 +0000 |
commit | 5cf618937fa24bb010fd5a10d420974b3ca8e648 (patch) | |
tree | 718be186e38fef681c10ac63531a89c4e1229300 /engines/cine | |
parent | 103e944fa4c6191f6cce8a9c498f3af7d2a7e139 (diff) | |
download | scummvm-rg350-5cf618937fa24bb010fd5a10d420974b3ca8e648.tar.gz scummvm-rg350-5cf618937fa24bb010fd5a10d420974b3ca8e648.tar.bz2 scummvm-rg350-5cf618937fa24bb010fd5a10d420974b3ca8e648.zip |
Fixed regression: CINE games crashed when a message box appeared (patch by next_ghost)
svn-id: r31696
Diffstat (limited to 'engines/cine')
-rw-r--r-- | engines/cine/various.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index b288cd2a47..a6bd9964c0 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -1748,14 +1748,15 @@ void drawMessage(const char *messagePtr, int16 x, int16 y, int16 width, int16 co void drawDialogueMessage(byte msgIdx, int16 x, int16 y, int16 width, int16 color) { if (msgIdx >= messageTable.size()) { - removeOverlay(msgIdx, 2); +// removeOverlay(msgIdx, 2); return; } _messageLen += messageTable[msgIdx].size(); drawMessage(messageTable[msgIdx].c_str(), x, y, width, color); - removeOverlay(msgIdx, 2); + // this invalidates the iterator in drawOverlays() +// removeOverlay(msgIdx, 2); } void drawFailureMessage(byte cmd) { @@ -1777,7 +1778,8 @@ void drawFailureMessage(byte cmd) { drawMessage(messagePtr, x, y, width, color); - removeOverlay(cmd, 3); + // this invalidates the iterator in drawOverlays() +// removeOverlay(cmd, 3); } void drawOverlays(void) { @@ -1901,6 +1903,14 @@ void drawOverlays(void) { break; } } + + for (it = overlayList.begin(); it != overlayList.end(); ) { + if (it->type == 2 || it->type == 3) { + it = overlayList.erase(it); + } else { + ++it; + } + } } uint16 processKeyboard(uint16 param) { |