GUI improvements contributed by Norman Vine.
3dfx.sh wrapper script now sets voodoo2 variables as well.
Start of support for user defined texture scale.
Start of support for precalculated texture coordinates.
static puDialogBox *APAdjustDialog;
static puFrame *APAdjustFrame;
static puText *APAdjustDialogMessage;
+static puFont APAdjustLegendFont;
+static puFont APAdjustLabelFont;
static int DialogX = 40;
static int DialogY = 100;
MaxAileronValue = APData->MaxAileron / MaxAileronAdjust;
RollOutSmoothValue = APData->RollOutSmooth / RollOutSmoothAdjust;
+ puGetDefaultFonts ( &APAdjustLegendFont, &APAdjustLabelFont );
APAdjustDialog = new puDialogBox (DialogX, DialogY);
{
- int horiz_slider_height = puGetStringHeight () +
- puGetStringDescender () +
+ int horiz_slider_height = puGetStringHeight (APAdjustLabelFont) +
+ puGetStringDescender (APAdjustLabelFont) +
PUSTR_TGAP + PUSTR_BGAP+5;
APAdjustFrame = new puFrame (0,0,230, 85+4*horiz_slider_height);
static puOneShot *YNdialogBoxNoButton = 0;
// Accessor CallBacks for external PUI Objects
-extern void NewAltitude( puObject *cb );
-extern void NewHeading( puObject *cb );
+// extern void NewAltitude( puObject *cb );
+// extern void NewHeading( puObject *cb );
extern void fgAPAdjust( puObject * );
extern void fgLatLonFormatToggle( puObject *);
char *aircraftSubmenu [] = {
"Autopilot", "Heading", "Altitude", "Navigation", "Communication", NULL};
puCallback aircraftSubmenuCb [] = {
- fgAPAdjust, NewHeading, NewAltitude, fgLatLonFormatToggle, notCb, NULL };
+ fgAPAdjust, notCb, notCb, fgLatLonFormatToggle, notCb, NULL };
char *environmentSubmenu [] = {
"Airport", "Terrain", "Weather", NULL};
export SST_VGA_PASS=1
export SST_NOSHUTDOWN=1
+
+ export SSTV2_VGA_PASS=1
+ export SSTV2_NOSHUTDOWN=1
else
# full screen
export MESA_GLX_FX=fullscreen
unset SST_VGA_PASS
unset SST_NOSHUTDOWN
+
+ unset SSTV2_VGA_PASS
+ unset SSTV2_NOSHUTDOWN
fi
export FX_GLIDE_NO_SPLASH=1
export SST_GAMMA=1.0
export SST_SCREENREFRESH=60
+export SSTV2_FASTMEM=1
+export SSTV2_FASTPCIRD=1
+export SSTV2_GRXCLK=57
+export SSTV2_GAMMA=1.0
+export SSTV2_SCREENREFRESH=60
+
# Enable this if you wand solid vswap - disable to measure speeds
export SST_SWAP_EN_WAIT_ON_VSYNC=0
+export SSTV2_SWAP_EN_WAIT_ON_VSYNC=0
+
# export SST_SWA_EN_WAIT_ON_VSYNC=1
+# export SSTV2_SWA_EN_WAIT_ON_VSYNC=1
echo executing $*
#include "options.hxx"
#include "views.hxx"
-extern void NewAltitude( puObject *cb );
-extern void NewHeading( puObject *cb );
+// extern void NewAltitude( puObject *cb );
+// extern void NewHeading( puObject *cb );
// Force an update of the sky and lighting parameters
static void local_update_sky_and_lighting_params( void ) {
return;
case GLUT_KEY_F11: // F11 Altitude Dialog.
FG_LOG(FG_INPUT, FG_INFO, "Invoking Altitude call back function");
- NewAltitude( NULL );
+ // NewAltitude( NULL );
//exit(1);
return;
case GLUT_KEY_F12: // F12 Heading Dialog...
FG_LOG(FG_INPUT, FG_INFO, "Invoking Heading call back function");
- NewHeading( NULL );
+ // NewHeading( NULL );
return;
case GLUT_KEY_UP:
if( fgAPAltitudeEnabled() || fgAPTerrainFollowEnabled() ) {
// above values
fgFDMInit( current_options.get_flight_model(), cur_fdm_state,
- 1.0 / DEFAULT_MODEL_HZ );
+ 1.0 / DEFAULT_MODEL_HZ );
// I'm just sticking this here for now, it should probably move
// eventually
void fgReInitSubsystems( void )
{
FGInterface *f = current_aircraft.fdm_state;
-// fgLIGHT *l = &cur_light_params;
-// fgTIME *t = &cur_time_params;
FGView *v = ¤t_view;
-
- fgInitPosition();
+ FGTime *t = FGTime::cur_time_params;
+
+ int toggle_pause = t->getPause();
+
+ if( !toggle_pause )
+ t->togglePauseMode();
+
+ fgInitPosition();
if( fgTileMgrInit() ) {
- // Load the local scenery data
- fgTileMgrUpdate();
+ // Load the local scenery data
+ fgTileMgrUpdate();
} else {
FG_LOG( FG_GENERAL, FG_ALERT, "Error in Tile Manager initialization!" );
exit(-1);
(sea_level_radius_meters * METER_TO_FEET) );
f->set_Sea_level_radius( sea_level_radius_meters * METER_TO_FEET );
- f->set_sin_cos_longitude(f->get_Longitude());
- f->set_sin_cos_latitude(f->get_Latitude());
+ f->set_sin_cos_longitude(f->get_Longitude());
+ f->set_sin_cos_latitude(f->get_Latitude());
- f->set_sin_lat_geocentric(sin(lat_geoc));
- f->set_cos_lat_geocentric(cos(lat_geoc));
+ f->set_sin_lat_geocentric(sin(lat_geoc));
+ f->set_cos_lat_geocentric(cos(lat_geoc));
// The following section sets up the flight model EOM parameters
// and should really be read in from one or more files.
v->UpdateWorldToEye(f);
fgFDMInit( current_options.get_flight_model(), cur_fdm_state,
- 1.0 / DEFAULT_MODEL_HZ );
+ 1.0 / DEFAULT_MODEL_HZ );
scenery.cur_elev = f->get_Runway_altitude() * FEET_TO_METER;
f->set_Altitude( f->get_Runway_altitude() + 3.758099 );
}
- controls.reset_all();
- fgAPReset();
+ controls.reset_all();
+ fgAPReset();
+
+ if( !toggle_pause )
+ t->togglePauseMode();
}
void
fgOPTIONS::toggle_panel() {
-
+
+ FGTime *t = FGTime::cur_time_params;
+
+ int toggle_pause = t->getPause();
+
+ if( !toggle_pause )
+ t->togglePauseMode();
+
if( panel_status ) {
panel_status = false;
} else {
new FGPanel;
fov *= 0.4232;
} else {
- fov *= (1.0 /0.4232);
+ fov *= (1.0 / 0.4232);
}
fgReshape( xsize, ysize);
+
+ if( !toggle_pause )
+ t->togglePauseMode();
}
double
long int fgOPTIONS::parse_date( const string& date)
{
- struct tm gmt;
- char * date_str, num[256];
- int i;
- // initialize to zero
- gmt.tm_sec = 0;
- gmt.tm_min = 0;
- gmt.tm_hour = 0;
- gmt.tm_mday = 0;
- gmt.tm_mon = 0;
- gmt.tm_year = 0;
- gmt.tm_isdst = 0; // ignore daylight savingtime for the moment
- date_str = (char *)date.c_str();
- // get year
+ struct tm gmt;
+ char * date_str, num[256];
+ int i;
+ // initialize to zero
+ gmt.tm_sec = 0;
+ gmt.tm_min = 0;
+ gmt.tm_hour = 0;
+ gmt.tm_mday = 0;
+ gmt.tm_mon = 0;
+ gmt.tm_year = 0;
+ gmt.tm_isdst = 0; // ignore daylight savingtime for the moment
+ date_str = (char *)date.c_str();
+ // get year
if ( strlen(date_str) ) {
i = 0;
while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
num[i] = '\0';
gmt.tm_year = atoi(num) - 1900;
}
- // get month
+ // get month
if ( strlen(date_str) ) {
i = 0;
while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
in >> skipcomment;
- while ( !in.eof() )
- {
+ while ( !in.eof() ) {
string line;
#ifdef GETLINE_NEEDS_TERMINATOR
inline double *get_surface_south() { return surface_south; }
inline double *get_surface_east() { return surface_east; }
inline double *get_local_up() { return local_up; }
+ inline double *get_view_forward() { return view_forward; }
inline const MAT3mat *get_WORLD_TO_EYE() const { return &WORLD_TO_EYE; }
inline GLfloat *get_MODEL_VIEW() { return MODEL_VIEW; }
};
static double normals[FG_MAX_NODES][3];
+static double tex_coords[FG_MAX_NODES*3][3];
// given three points defining a triangle, calculate the normal
// GLfloat sgenparams[] = { 1.0, 0.0, 0.0, 0.0 };
GLint display_list = 0;
int shading;
- int in_fragment = 0, in_faces = 0, vncount;
+ int in_fragment = 0, in_faces = 0, vncount, vtcount;
int n1 = 0, n2 = 0, n3 = 0, n4 = 0;
+ int tex;
int last1 = 0, last2 = 0, odd = 0;
double (*nodes)[3];
Point3D center;
in_fragment = 0;
t->ncount = 0;
vncount = 0;
+ vtcount = 0;
t->bounding_radius = 0.0;
nodes = t->nodes;
center = t->center;
"Read too many vertex normals ... dying :-(" );
exit(-1);
}
+ } else if ( token == "vt" ) {
+ // vertex texture coordinate
+ if ( vtcount < FG_MAX_NODES*3 ) {
+ in >> tex_coords[vtcount][0]
+ >> tex_coords[vtcount][1];
+ vtcount++;
+ } else {
+ FG_LOG( FG_TERRAIN, FG_ALERT,
+ "Read too many vertex texture coords ... dying :-("
+ );
+ exit(-1);
+ }
} else if ( token == "v" ) {
// node (vertex)
if ( t->ncount < FG_MAX_NODES ) {
in >> n1;
xglNormal3dv(normals[n1]);
- pp = calc_tex_coords(nodes[n1], center);
- xglTexCoord2f(pp.lon(), pp.lat());
+ if ( in.get( c ) && c == '/' ) {
+ in >> tex;
+ pp.setx( tex_coords[tex][0] );
+ pp.sety( tex_coords[tex][1] );
+ } else {
+ in.putback( c );
+ pp = calc_tex_coords(nodes[n1], center);
+ }
+ xglTexCoord2f(pp.x(), pp.y());
xglVertex3dv(nodes[n1]);
in >> n2;
xglNormal3dv(normals[n2]);
- pp = calc_tex_coords(nodes[n2], center);
- xglTexCoord2f(pp.lon(), pp.lat());
+ if ( in.get( c ) && c == '/' ) {
+ in >> tex;
+ pp.setx( tex_coords[tex][0] );
+ pp.sety( tex_coords[tex][1] );
+ } else {
+ in.putback( c );
+ pp = calc_tex_coords(nodes[n2], center);
+ }
+ xglTexCoord2f(pp.x(), pp.y());
xglVertex3dv(nodes[n2]);
// read all subsequent numbers until next thing isn't a number
// << n1 << "," << n2 << "," << n3
// << endl;
xglNormal3dv(normals[n3]);
- pp = calc_tex_coords(nodes[n3], center);
- xglTexCoord2f(pp.lon(), pp.lat());
+ if ( in.get( c ) && c == '/' ) {
+ in >> tex;
+ pp.setx( tex_coords[tex][0] );
+ pp.sety( tex_coords[tex][1] );
+ } else {
+ in.putback( c );
+ pp = calc_tex_coords(nodes[n3], center);
+ }
+ xglTexCoord2f(pp.x(), pp.y());
xglVertex3dv(nodes[n3]);
fragment.add_face(n1, n2, n3);