Sanity checks in the pixel ratio loading.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1258 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2010-01-16 17:27:15 +00:00
parent 655116bd37
commit c1800bb42d

View File

@ -846,6 +846,36 @@ int Load_INI(T_Config * conf)
if (!Load_INI_get_values (file, buffer,"Pixel_ratio",1,values))
{
Pixel_ratio = values[0];
switch(Pixel_ratio) {
case PIXEL_WIDE:
if(Video_mode[0].Width < 640)
Pixel_ratio = PIXEL_SIMPLE;
break;
case PIXEL_TALL:
if(Video_mode[0].Height < 400)
Pixel_ratio = PIXEL_SIMPLE;
break;
case PIXEL_DOUBLE:
if(Video_mode[0].Width < 640 || Video_mode[0].Height < 400)
Pixel_ratio = PIXEL_SIMPLE;
break;
case PIXEL_TRIPLE:
if(Video_mode[0].Width < 3*320 || Video_mode[0].Height < 3*200)
Pixel_ratio = PIXEL_SIMPLE;
break;
case PIXEL_WIDE2:
if(Video_mode[0].Width < 4*320 || Video_mode[0].Height < 2*200)
Pixel_ratio = PIXEL_SIMPLE;
break;
case PIXEL_TALL2:
if(Video_mode[0].Width < 2*320 || Video_mode[0].Height < 4*200)
Pixel_ratio = PIXEL_SIMPLE;
break;
case PIXEL_QUAD:
if(Video_mode[0].Width < 4*320 || Video_mode[0].Height < 4*200)
Pixel_ratio = PIXEL_SIMPLE;
break;
}
}
fclose(file);