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
This commit is contained in:
Paul Gilbert 2019-01-02 18:18:11 -08:00
parent 3ed48e3de2
commit f1d9722f3b
8 changed files with 138 additions and 79 deletions

View file

@ -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;
}