Codechange: use std::vector for _resolutions

This commit is contained in:
glx
2019-04-12 18:46:49 +02:00
committed by glx22
parent 25e534f3cf
commit 9195f2337a
10 changed files with 83 additions and 120 deletions

View File

@@ -1691,20 +1691,13 @@ bool ChangeResInGame(int width, int height)
bool ToggleFullScreen(bool fs)
{
bool result = VideoDriver::GetInstance()->ToggleFullscreen(fs);
if (_fullscreen != fs && _num_resolutions == 0) {
if (_fullscreen != fs && _resolutions.empty()) {
DEBUG(driver, 0, "Could not find a suitable fullscreen resolution");
}
return result;
}
static int CDECL compare_res(const Dimension *pa, const Dimension *pb)
void SortResolutions()
{
int x = pa->width - pb->width;
if (x != 0) return x;
return pa->height - pb->height;
}
void SortResolutions(int count)
{
QSortT(_resolutions, count, &compare_res);
std::sort(_resolutions.begin(), _resolutions.end());
}