From 4ca85f265358aa34b83f310869feb6ab7948722e Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 28 Jan 2013 23:35:44 +0000 Subject: [PATCH] Bug #385 - enable the Ati viewport hack on next. Enabling this hack by default, to assess the impact for everyone. Should fix the issue for Ati Catalyst 11.5 users, and hopefully no impact for everyone else. All feedback appreciated. Set /sim/ati-viewport-hack to false if you think this option might be causing issues for you (and then tell James, ASAP) --- simgear | 1 + src/Main/main.cxx | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 160000 simgear diff --git a/simgear b/simgear new file mode 160000 index 000000000..d11db8a67 --- /dev/null +++ b/simgear @@ -0,0 +1 @@ +Subproject commit d11db8a67ad43adff97a68b51a83570b2a5e02bf diff --git a/src/Main/main.cxx b/src/Main/main.cxx index abb786253..b51bd01a0 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -262,6 +262,16 @@ static void upper_case_property(const char *name) p->addChangeListener(new FGMakeUpperCase); } +// see http://code.google.com/p/flightgear-bugs/issues/detail?id=385 +// for the details of this. +static void ATIScreenSizeHack() +{ + osg::ref_ptr hackCam = new osg::Camera; + hackCam->setRenderOrder(osg::Camera::PRE_RENDER); + int prettyMuchAnyInt = 1; + hackCam->setViewport(0, 0, prettyMuchAnyInt, prettyMuchAnyInt); + globals->get_renderer()->addCamera(hackCam, false); +} // Main top level initialization int fgMainInit( int argc, char **argv ) { @@ -320,6 +330,11 @@ int fgMainInit( int argc, char **argv ) { fntInit(); fgSplashInit(); + if (fgGetBool("/sim/ati-viewport-hack", true)) { + SG_LOG(SG_GENERAL, SG_ALERT, "Enabling ATI viewport hack"); + ATIScreenSizeHack(); + } + // pass control off to the master event handler int result = fgOSMainLoop(); -- 2.39.5