Restore camera properties on reInit
From Tatsuhiro Nishioka
This commit is contained in:
parent
19d9287d3a
commit
5f7441f778
1 changed files with 14 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue