]> git.mxchange.org Git - flightgear.git/commitdiff
Bug #385 - enable the Ati viewport hack on next.
authorJames Turner <zakalawe@mac.com>
Mon, 28 Jan 2013 23:35:44 +0000 (23:35 +0000)
committerJames Turner <zakalawe@mac.com>
Mon, 28 Jan 2013 23:35:44 +0000 (23:35 +0000)
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 [new submodule]
src/Main/main.cxx

diff --git a/simgear b/simgear
new file mode 160000 (submodule)
index 0000000..d11db8a
--- /dev/null
+++ b/simgear
@@ -0,0 +1 @@
+Subproject commit d11db8a67ad43adff97a68b51a83570b2a5e02bf
index abb786253f4e27bf6f5becde0110505d91896977..b51bd01a044c7a3cb630a6089feb2a8d9bbcecb3 100644 (file)
@@ -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<osg::Camera> 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();