libsdl-org / SDL-1.2

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!
https://libsdl.org
GNU Lesser General Public License v2.1
98 stars 81 forks source link

fix dynamic bpp-target when checking for supported video modes #855

Closed pionere closed 2 years ago

sezero commented 2 years ago

@icculus, @slouken: Comments?

icculus commented 2 years ago

I don't understand why this is being changed from 7 (the last element in the array) to 6.

I'm sure this is something obvious, but an explanation would be helpful here.

pionere commented 2 years ago

The [6] element (second last element) is supposed to be the place for the dynamic bpp. The [7] element (last element) is just a 'terminating' entry which must be zero, otherwise the loop might never end. The reason it worked till now is that the [6] element is never changed and stopped the loop prematurely.

sezero commented 2 years ago

@icculus ?