Added (disabled by default) support for anti-aliasing (edit your config file to get it)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7985 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-03-17 23:13:33 +00:00
parent 76541e0265
commit d113bc4104
3 changed files with 22 additions and 1 deletions

View File

@ -347,7 +347,9 @@ namespace UserConfigParams
PARAM_PREFIX BoolUserConfigParam m_trilinear
PARAM_DEFAULT( BoolUserConfigParam(true, "trilinear", &m_graphics_quality,
"Whether trilinear filtering is allowed to be used (true or false)") );
PARAM_PREFIX BoolUserConfigParam m_fullscreen_antialiasing
PARAM_DEFAULT( BoolUserConfigParam(false, "fullscreen_antialiasing", &m_graphics_quality,
"Whether fullscreen antialiasing is enabled") );
// ---- Misc
PARAM_PREFIX BoolUserConfigParam m_minimal_race_gui

View File

@ -150,6 +150,7 @@ void IrrDriver::initDevice()
for (int bits=32; bits>15; bits -=8)
{
std::cout << "[IrrDriver] Trying to create device with " << bits << " bits\n";
/*
m_device = createDevice(type,
core::dimension2d<u32>(UserConfigParams::m_width,
UserConfigParams::m_height ),
@ -159,6 +160,21 @@ void IrrDriver::initDevice()
false, // vsync
this // event receiver
);
*/
SIrrlichtCreationParameters params;
params.DriverType = type;
params.WindowSize = core::dimension2d<u32>(UserConfigParams::m_width,
UserConfigParams::m_height);
params.Bits = bits;
params.EventReceiver = this;
params.Fullscreen = UserConfigParams::m_fullscreen;
if (UserConfigParams::m_fullscreen_antialiasing)
params.AntiAlias = 8;
m_device = createDeviceEx(params);
if(m_device) break;
} // for bits=32, 24, 16
if(m_device) break;

View File

@ -545,6 +545,9 @@ void Material::setMaterialProperties(video::SMaterial *m) const
m->ColorMaterial = video::ECM_NONE; // Override one above
}
#endif
if (UserConfigParams::m_fullscreen_antialiasing)
m->AntiAliasing = video::EAAM_LINE_SMOOTH;
} // setMaterialProperties