2001-04-22 17:00:08 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_WINDOWS_H
|
|
|
|
# include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2001-01-08 20:55:16 +00:00
|
|
|
#include <GL/glut.h> // needed before pu.h
|
|
|
|
#include <plib/pu.h> // plib include
|
|
|
|
|
2001-01-19 22:57:24 +00:00
|
|
|
#include <Main/globals.hxx>
|
2001-01-08 20:55:16 +00:00
|
|
|
#include <Main/fg_init.hxx>
|
2001-04-16 20:31:26 +00:00
|
|
|
#include <Main/fg_props.hxx>
|
2001-01-08 20:55:16 +00:00
|
|
|
|
|
|
|
#include "gui.h"
|
|
|
|
#include "trackball.h"
|
|
|
|
|
2001-04-16 20:31:26 +00:00
|
|
|
// from main.cxx
|
|
|
|
extern void fgReshape(int, int);
|
|
|
|
|
2001-01-08 20:55:16 +00:00
|
|
|
// FOR MOUSE VIEW MODE
|
|
|
|
// stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
|
|
|
|
static float _quat0[4];
|
|
|
|
|
|
|
|
float lastGuiQuat[4];
|
|
|
|
float curGuiQuat[4];
|
|
|
|
|
|
|
|
// To apply our mouse rotation quat to VIEW
|
|
|
|
// sgPreMultMat4( VIEW, GuiQuat_mat);
|
|
|
|
// This is here temporarily should be in views.hxx
|
|
|
|
float GuiQuat_mat[4][4];
|
|
|
|
|
|
|
|
void Quat0( void ) {
|
|
|
|
curGuiQuat[0] = _quat0[0];
|
|
|
|
curGuiQuat[1] = _quat0[1];
|
|
|
|
curGuiQuat[2] = _quat0[2];
|
|
|
|
curGuiQuat[3] = _quat0[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
void initMouseQuat(void) {
|
|
|
|
trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
|
|
|
|
Quat0();
|
|
|
|
build_rotmatrix(GuiQuat_mat, curGuiQuat);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void reInit(puObject *cb)
|
|
|
|
{
|
|
|
|
BusyCursor(0);
|
|
|
|
Quat0();
|
2001-04-16 20:31:26 +00:00
|
|
|
|
|
|
|
// in case user has changed window size as
|
|
|
|
// restoreInitialState() overwrites these
|
|
|
|
int xsize = fgGetInt("/sim/startup/xsize");
|
|
|
|
int ysize = fgGetInt("/sim/startup/ysize");
|
|
|
|
|
2001-01-08 20:55:16 +00:00
|
|
|
build_rotmatrix(GuiQuat_mat, curGuiQuat);
|
2001-01-19 22:57:24 +00:00
|
|
|
/* check */ globals->restoreInitialState();
|
2001-04-16 20:31:26 +00:00
|
|
|
|
2001-01-08 20:55:16 +00:00
|
|
|
fgReInitSubsystems();
|
2001-04-16 20:31:26 +00:00
|
|
|
|
|
|
|
fgReshape( xsize, ysize );
|
|
|
|
|
2001-01-08 20:55:16 +00:00
|
|
|
BusyCursor(1);
|
|
|
|
}
|
|
|
|
|