Development > Newbie Coding
Change order of resolutions list
Duke:
Good findings, raster :)
I've looked it up in the code and can confirm that that 'magic number' vid_mode
- is stored in the config
- is used as an *index* into the array of videomodes.
That is, your original patch would leave all users that have an existing config and a new exe with the wrong resolution ==> no go.
I see two options:
1. *completely* get rid of vid_mode as Mattn suggested
This looks quite complicated and we would certainly need the help of a dev that is more familiar with the video code than I am.
2. make the code use vid_mode as a lookup-value instead of an index.
That looks fairly easy to me. We just need some accessor-functions and change very few places.
Raster, do you think you could provide such a patch ?
raster:
The lookup-value idea sounds very good. I'll try. I hope to have it in two days (I'm quite busy these days).
raster:
Well, here is the patch. It modifies both cl_main.c and cl_video.c, sorting the resolutions first by vertical, then by horizontal resolution, and keeping the old selection values to maintain compatibility with old configurations.
To add new resolutions, just add them in the right position and set the index value to the inmediately next free (23 in this case).
geever:
--- Quote from: raster on September 13, 2009, 09:53:50 pm ---Well, here is the patch. It modifies both cl_main.c and cl_video.c, sorting the resolutions first by vertical, then by horizontal resolution, and keeping the old selection values to maintain compatibility with old configurations.
To add new resolutions, just add them in the right position and set the index value to the inmediately next free (23 in this case).
--- End quote ---
Why vertical first?
-geever
Duke:
@geever:...because the lower the vertical resolution of your screen is, the less you'll see of the drop down list if it is displayed at a higher vertical res than yours ;)
@raster:
The patch looks good. Will take a closer look and commit tomorrow.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version