1
0
Fork 0

Restore camera properties on reInit

From Tatsuhiro Nishioka
This commit is contained in:
timoore 2008-11-25 22:50:20 +00:00
parent 19d9287d3a
commit 5f7441f778

View file

@ -1784,6 +1784,14 @@ void reInit(void) // from gui_local.cxx -- TODO merge with fgReInitSubsystems()
int xsize = fgGetInt("/sim/startup/xsize");
int ysize = fgGetInt("/sim/startup/ysize");
// viewports also needs to be saved/restored as
// restoreInitialState() overwrites these
SGPropertyNode *guiNode = new SGPropertyNode;
SGPropertyNode *cameraNode = new SGPropertyNode;
SGPropertyNode *cameraGroupNode = fgGetNode("/sim/rendering/camera-group");
copyProperties(cameraGroupNode->getChild("camera"), cameraNode);
copyProperties(cameraGroupNode->getChild("gui"), guiNode);
globals->restoreInitialState();
// update our position based on current presets
@ -1794,6 +1802,12 @@ void reInit(void) // from gui_local.cxx -- TODO merge with fgReInitSubsystems()
fgSetInt("/sim/startup/xsize", xsize);
fgSetInt("/sim/startup/ysize", ysize);
copyProperties(cameraNode, cameraGroupNode->getChild("camera"));
copyProperties(guiNode, cameraGroupNode->getChild("gui"));
delete guiNode;
delete cameraNode;
SGTime *t = globals->get_time_params();
delete t;
t = fgInitTime();