retrofax / garglk

Automatically exported from code.google.com/p/garglk
Other
0 stars 0 forks source link

Poor performance opening a new window splitting gg_mainwin left or right #195

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I'm writing a Glulx adventure (in Spanish) using Inform 6.

At the start of the game, in the first room, when the player types "TV", a side 
menu appears asking the player to select an option. That side menu is shown 
splitting the main text buffer (gg_mainwin) on the right side. The code for 
doing that is the following:

gg_menuwin = glk_window_open(gg_mainwin,
                             winmethod_Right + winmethod_Fixed,
                             25, wintype_TextGrid, GG_MENUWIN_ROCK);

The above code works well, and the side menu shows fast if the main text buffer 
contains a little amount of text. However, the appearance of the menu starts to 
become more and more slowly, as the main text buffer fills with more text.

To reproduce the issue:

1. Start the game.
2. Enter "TV" (without quotes): a menu appears almost immediately on the right 
side of the main window, which is the right behaviour.
3. Select "Q" from the side menu to close it and go back to the main window.
4. Enter "L" (to redescribe the current location) many many times (90 or more), 
in order to fill the main window with many text.
5. Enter "TV" again: you can see that the side menu now takes longer to appear.

Using latest Gargoyle 2011.1. Can be reproduced using any previous 
Gargoyle version, on any platform (Windows, Linux, Mac), using Gulxe or Git. 
Can't be reproduced using latest Windows Glulxe from ifarchive.org.

Original issue reported on code.google.com by ricp...@gmail.com on 11 Nov 2012 at 10:36

Attachments:

GoogleCodeExporter commented 8 years ago
In my PC computer (six years old), the issue is perfectly noticeable after 
typing "L" 40 or 50 times. In my newer iMac computer I need to fill the main 
window with many more text in order to get a noticeable delay in the side menu 
appearance.

Original comment by ricp...@gmail.com on 11 Nov 2012 at 10:39

GoogleCodeExporter commented 8 years ago
The issue can be reproduced using winmethod_Right or winmethod_Left, but NOT 
using winmethod_Above or winmethod_Below.

Original comment by ricp...@gmail.com on 11 Nov 2012 at 11:28

GoogleCodeExporter commented 8 years ago
The issue can also be reproduced using Gargoyle 2010.1.

Original comment by ricp...@gmail.com on 11 Nov 2012 at 8:55

GoogleCodeExporter commented 8 years ago
Essentially, the issue comes from the reflow() function, which is called inside 
win_textbuffer_rearrange(). The reflow of the text is done only when the window 
changes its width, regardless of its height.

Original comment by ricp...@gmail.com on 12 Nov 2012 at 7:07