diff options
author | Paul Gilbert | 2019-01-02 18:18:11 -0800 |
---|---|---|
committer | Paul Gilbert | 2019-01-02 18:18:11 -0800 |
commit | f1d9722f3bd58f7883f3e76c19d4a0133da73489 (patch) | |
tree | 26986b085d83e597b10c3851fde9b49574c10586 /engines/glk/glk_api.cpp | |
parent | 3ed48e3de223259dd58f0c613c2d68d69848e5a2 (diff) | |
download | scummvm-rg350-f1d9722f3bd58f7883f3e76c19d4a0133da73489.tar.gz scummvm-rg350-f1d9722f3bd58f7883f3e76c19d4a0133da73489.tar.bz2 scummvm-rg350-f1d9722f3bd58f7883f3e76c19d4a0133da73489.zip |
GLK: FROTZ: Add support for pair windows to have more than 2 children
This is primarily for the V6 games, which have up to 8 windows
on-screen at the same time in arbitray positions
ext
Diffstat (limited to 'engines/glk/glk_api.cpp')
-rw-r--r-- | engines/glk/glk_api.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp index e2da31706a..6e0f33ea56 100644 --- a/engines/glk/glk_api.cpp +++ b/engines/glk/glk_api.cpp @@ -258,10 +258,11 @@ winid_t GlkAPI::glk_window_get_sibling(winid_t win) { if (!parentWin) return nullptr; - if (parentWin->_child1 == win) - return parentWin->_child2; - else if (parentWin->_child2 == win) - return parentWin->_child1; + int index = parentWin->_children.indexOf(win); + if (index == ((int)parentWin->_children.size() - 1)) + return parentWin->_children.front(); + else if (index >= 0) + return parentWin->_children[index + 1]; return nullptr; } |