9 #include <GL/glut.h> // needed before pu.h
10 #include <plib/pu.h> // plib include
12 #include <FDM/flight.hxx>
14 #include <Main/globals.hxx>
15 #include <Main/fg_init.hxx>
16 #include <Main/fg_props.hxx>
17 #include <Scenery/tilemgr.hxx>
18 #include <Time/light.hxx>
21 #include "trackball.h"
24 extern void fgReshape(int, int);
26 // FOR MOUSE VIEW MODE
27 // stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
28 static float _quat0[4];
33 // To apply our mouse rotation quat to VIEW
34 // sgPreMultMat4( VIEW, GuiQuat_mat);
35 // This is here temporarily should be in views.hxx
36 float GuiQuat_mat[4][4];
39 curGuiQuat[0] = _quat0[0];
40 curGuiQuat[1] = _quat0[1];
41 curGuiQuat[2] = _quat0[2];
42 curGuiQuat[3] = _quat0[3];
45 void initMouseQuat(void) {
46 trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
48 build_rotmatrix(GuiQuat_mat, curGuiQuat);
52 void reInit(puObject *cb)
57 static const SGPropertyNode *master_freeze
58 = fgGetNode("/sim/freeze/master");
60 bool freeze = master_freeze->getBoolValue();
62 fgSetBool("/sim/freeze/master", true);
65 cur_fdm_state->unbind();
67 // in case user has changed window size as
68 // restoreInitialState() overwrites these
69 int xsize = fgGetInt("/sim/startup/xsize");
70 int ysize = fgGetInt("/sim/startup/ysize");
72 build_rotmatrix(GuiQuat_mat, curGuiQuat);
74 globals->restoreInitialState();
76 // Unsuccessful KLUDGE to fix the 'every other time'
77 // problem when doing a 'reset' after a 'goto airport'
79 // string AptId( fgGetString("/sim/startup/airport-id") );
80 // if( AptId.c_str() != "\0" )
81 // fgSetPosFromAirportID( AptId );
83 SGTime *t = globals->get_time_params();
86 globals->set_time_params( t );
90 // reduntant(fgReInitSubsystems) ?
91 double visibility_meters = fgGetDouble("/environment/visibility-m");
92 global_tile_mgr.update( fgGetDouble("/position/longitude-deg"),
93 fgGetDouble("/position/latitude-deg"),visibility_meters );
95 cur_light_params.Update();
97 fgReshape( xsize, ysize );
102 fgSetBool("/sim/freeze/master", false);