mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 19:45:07 +00:00
SCI: now reusing window ids on kNewWindow
sq4cd recreates the inventory window several times, but also reuses old window ids, causing kernelSetActive errors. fixes bug #3044757 svn-id: r52079
This commit is contained in:
parent
512bf22af6
commit
f8697e20b5
@ -288,6 +288,16 @@ Window *GfxPorts::addWindow(const Common::Rect &dims, const Common::Rect *restor
|
||||
// Find an unused window/port id
|
||||
uint id = PORTS_FIRSTWINDOWID;
|
||||
while (id < _windowsById.size() && _windowsById[id]) {
|
||||
if (_windowsById[id]->counterTillFree) {
|
||||
// port that is already disposed, but not freed yet
|
||||
freeWindow((Window *)_windowsById[id]);
|
||||
_freeCounter--;
|
||||
break; // reuse the handle
|
||||
// we do this especially for sq4cd. it creates and disposes the
|
||||
// inventory window all the time, but reuses old handles as well
|
||||
// this worked somewhat under the original interpreter, because
|
||||
// it put the new window where the old was.
|
||||
}
|
||||
++id;
|
||||
}
|
||||
if (id == _windowsById.size())
|
||||
|
Loading…
x
Reference in New Issue
Block a user