Fixed code that removed 15-bit color mode.

15-bit color mode is now removed on all platforms.
The removal of 15-bit color mode now happens before the sort.
Updated a variable name.
Changed list length calculation to use C++'s clever pointer
subtraction.
This commit is contained in:
Dan Sumorok 2013-05-05 16:20:37 -04:00
parent 57b9ad0d95
commit 241162f261
1 changed files with 4 additions and 5 deletions

View File

@ -1636,13 +1636,12 @@ bool VideoInit(bool classic)
ErrorAlert(STR_UNSUPP_DEPTH_ERR);
return false;
}
std::sort(avail_depths, avail_depths + num_depths);
#ifdef __APPLE__
// 15-bit color does not seem to work on OS X
int *last = std::remove(avail_depths, avail_depths + num_depths, 15);
num_depths = ( (size_t)last - (size_t)avail_depths ) / sizeof(int);
#endif
int *list_end = std::remove(avail_depths, avail_depths + num_depths,
15);
num_depths = list_end - avail_depths;
std::sort(avail_depths, avail_depths + num_depths);
#ifdef ENABLE_FBDEV_DGA
// Frame buffer name