adventuregamestudio/ags — pull request #147 by ivan-mogilko (2014-04-12 17:24:11+00:00)
Title: Improved range of supported display modes

Rewrote graphics mode selection. This enables relatively free letterbox/pillarbox modes, with certain restrictions.
This version is an intermediate between original AGS and planned custom resolutions feature; it's made trying to keep number of modified modules to minimum.

1. It should support running game at almost any resolution, provided that a) the resolution is not smaller than scaled up game, and b) its sizes are multiplies of scaling multiplier.
For example, if game scaling is 4, then window sizes should be multiplies of 4. If scaling is 3, window sizes should be multiple of 3, etc.
This restriction is implied by how black borders (letterboxing/sideborders) work in original AGS.
If scaling is 1 (no filter), window can have any size.
2. It should automatically find maximal supported nearest-neighbour scaling, if the requested scaling failed. In any case it searches for all combinations of sideborders/letterbox (depending on setup options). Therefore if you computer supports just any resolution equal or larger to game size, AGS must find and use one. Resolutions with desktop aspect ratio are given higher priority.