FS#925 - Allow more windows than 22 at once

Attached to Project: OpenTTD
Opened by Bilbo (bilbo) - Saturday, 23 June 2007, 13:43 GMT
Last edited by Remko Bijker (Rubidium) - Monday, 12 January 2009, 00:01 GMT
Type Patch
Category Interface
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Only 25 windows are allowed at once (and 3 of them taken by toolbars etc, leaving only 22 available windows).
Since 1600x1200 screen can usefully accomodate more windows than that and some multiheaded configurations even more and
incoming newspaper tend to delete usually the most important ones (murphys laws :) it may be nice to increase this amount, optimally to unlimited number.

I have made a patch that will raise the number to 60 (giving 57 usable windows) which should be sufficient for most players and is close to maximum (63) that could be achieved without some "more significant" rewrite (i.e. more than 15 lines of code) of windowing system (maybe someone will do that later ... not me, since 57 windows is enough for me :).

Tried creating about 55 vehicles, each with its window and running them all at once.... it worked fine.
This task depends upon

Closed by  Remko Bijker (Rubidium)
Monday, 12 January 2009, 00:01 GMT
Reason for closing:  Out of date
Additional comments about closing:  Your memory's the limit
Comment by Patric Stout (TrueBrain) - Saturday, 23 June 2007, 13:48 GMT
Nice idea, but I wonder if we can make it dynamic (in other words: no limit anymore what so ever).
Comment by Bilbo (bilbo) - Saturday, 23 June 2007, 16:23 GMT
Maybe, the limit that is now causing problems is _active_viewports (in viewport.cpp) - it is bitmasked variable and since 1 window need one viewport, this is the one that is currently limiting it. Now it is int64 (64 bits), expanding the limit more will require to somehow redo the viewport things (and since windows and viewport are now in static array, it will be necessary to make them dynamic and alloc/realloc them or convert to linked list ...)

Not so easy to make it really unlimited, some things will need to be slightly rewritten. This is just a quick fix, but increasing limit of usable windows from 22 to 57 will do for most people for now (till someone really rewrite it to allow unlimited windows)
Comment by Bilbo (bilbo) - Saturday, 01 December 2007, 21:19 GMT
As belugas is going to raise the window limit by other means (to "unlimited" :) I suggest this task gets closed, as the patch will soon be obsolete.

See for belugas post.