aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-04 22:23:45 +0000
committerMartin Kiewitz2010-01-04 22:23:45 +0000
commita6aaeb70e6dfb3a9727e8861041601cf658aa5cd (patch)
treedf1510727c3dc67055d89f8c46a26c7d64bd7e1c /engines/sci/gui
parent05a16d7cba889c3daf947a727917ce2dc9bd1eab (diff)
downloadscummvm-rg350-a6aaeb70e6dfb3a9727e8861041601cf658aa5cd.tar.gz
scummvm-rg350-a6aaeb70e6dfb3a9727e8861041601cf658aa5cd.tar.bz2
scummvm-rg350-a6aaeb70e6dfb3a9727e8861041601cf658aa5cd.zip
SCI: fix crash due accessing invalid object (implemented deleteScreenitem)
svn-id: r46993
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui.cpp10
-rw-r--r--engines/sci/gui/gui.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 48f99ffa51..93a40bb378 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -844,6 +844,16 @@ void SciGui::addScreenItem(reg_t object) {
_screenItemCount++;
}
+void SciGui::deleteScreenItem(reg_t object) {
+ for (int itemNr = 0; itemNr < _screenItemCount; itemNr++) {
+ if (_screenItems[itemNr] == object) {
+ _screenItems.remove_at(itemNr);
+ _screenItemCount--;
+ return;
+ }
+ }
+}
+
void SciGui::frameOut() {
for (int itemNr = 0; itemNr < _screenItemCount; itemNr++) {
reg_t viewObj = _screenItems[itemNr];
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index 2017c1b1fe..a81e61d7e9 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -155,6 +155,7 @@ public:
// SCI32
virtual void addScreenItem(reg_t object);
+ virtual void deleteScreenItem(reg_t object);
virtual void frameOut();
virtual bool debugUndither(bool flag);