Nearly everybody can run at least 16bit color depth so here is a way to get max color depth on everybody's computer...
Code:
ofstream filelog("log.txt");
set_color_depth(32);
if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) == 0)
{
filelog << "\nset_color_depth(32) initialized";
filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) initialized";
}
else if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) != 0)
{
filelog << "\nset_color_depth(32) failed";
filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) failed";
set_color_depth(24);
if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) == 0)
{
filelog << "\nset_color_depth(24) initialized";
filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) initialized";
}
else if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) != 0)
{
filelog << "\nset_color_depth(24) failed";
filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) failed";
set_color_depth(16);
if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) == 0)
{
filelog << "\nset_color_depth(16) initialized";
filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) initialized";
}
else if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) != 0)
{
filelog << "\nset_color_depth(16) failed";
filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) failed";
}
}
}
filelog.close();
Btw, I was only doing the filelog stuff because I wanted to see what color depth each computer would be going to.
Btw numero dos, I have no idea how effective this really is except that it hasn't failed on me once yet. It may cause problems under certain circumstances; I have no idea.