]> git.mxchange.org Git - flightgear.git/commitdiff
Don't clone far camera; create a new one and initialize it from the near camera
authortimoore <timoore>
Tue, 30 Dec 2008 09:32:53 +0000 (09:32 +0000)
committerTim Moore <timoore@redhat.com>
Sat, 3 Jan 2009 22:55:44 +0000 (23:55 +0100)
The clone operation may be sharing things that shouldn't be shared.

src/Main/CameraGroup.cxx

index 938008967df26f7c23fdd7665b32ec22a9ab1647..9e848978d82ca9e40c68ed291a0c49ab14cc0a0f 100644 (file)
@@ -134,8 +134,11 @@ CameraInfo* CameraGroup::addCamera(unsigned flags, Camera* camera,
 
     Camera* farCamera = 0;
     if ((flags & (GUI | ORTHO)) == 0) {
-        farCamera = simgear::clone(camera);
+        farCamera = new Camera;
+        farCamera->setAllowEventFocus(camera->getAllowEventFocus());
         farCamera->setGraphicsContext(camera->getGraphicsContext());
+        farCamera->setCullingMode(camera->getCullingMode());
+        farCamera->setInheritanceMask(camera->getInheritanceMask());
         // Each camera's viewport is written when the window is
         // resized; if the the viewport isn't copied here, it gets updated
         // twice and ends up with the wrong value.