1
0
Fork 0

Added support for Pui/Gui.

Converted fog to GL_FOG_EXP2.
Link to static simulator parts.
Update runfg.bat to try to be a little smarter.
This commit is contained in:
curt 1998-06-12 00:57:38 +00:00
parent 7b98736e32
commit 9ebfc12526
4 changed files with 79 additions and 38 deletions

View file

@ -40,7 +40,9 @@
#include <Aircraft/aircraft.h>
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
#include <Debug/fg_debug.h>
#include <Gui/gui.h>
#include <Include/fg_constants.h>
#include <Pui/pu.h>
#include <Weather/weather.h>
#include "GLUTkey.hxx"
@ -58,6 +60,7 @@ void GLUTkey(unsigned char k, int x, int y) {
fgTIME *t;
fgVIEW *v;
struct fgWEATHER *w;
float tmp;
c = current_aircraft.controls;
o = &current_options;
@ -66,6 +69,7 @@ void GLUTkey(unsigned char k, int x, int y) {
w = &current_weather;
fgPrintf( FG_INPUT, FG_DEBUG, "Key hit = %d", k);
puKeyboard(k, PU_DOWN );
if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
@ -114,11 +118,9 @@ void GLUTkey(unsigned char k, int x, int y) {
v->update_fov = TRUE;
return;
case 90: /* Z key */
w->visibility /= 1.10;
xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
xglFogf(GL_FOG_END, w->visibility);
fgPrintf( FG_INPUT, FG_DEBUG,
"Fog density = %.4f\n", w->visibility );
tmp = fgWeatherGetVisibility(); /* in meters */
tmp /= 1.10;
fgWeatherSetVisibility( tmp );
return;
// autopilot additions
case 65: /* A key */
@ -183,11 +185,9 @@ void GLUTkey(unsigned char k, int x, int y) {
v->update_fov = TRUE;
return;
case 122: /* z key */
w->visibility *= 1.10;
xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
xglFogf(GL_FOG_END, w->visibility);
fgPrintf( FG_INPUT, FG_DEBUG,
"Fog density = %.4f\n", w->visibility);
tmp = fgWeatherGetVisibility(); /* in meters */
tmp *= 1.10;
fgWeatherSetVisibility( tmp );
return;
case 27: /* ESC */
// if( fg_DebugOutput ) {
@ -209,6 +209,7 @@ void GLUTspecialkey(int k, int x, int y) {
v = &current_view;
fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
puKeyboard(k + PU_KEY_GLUT_SPECIAL_OFFSET, PU_DOWN);
if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
@ -241,6 +242,13 @@ void GLUTspecialkey(int k, int x, int y) {
} else {
fgPrintf( FG_INPUT, FG_DEBUG, "\n");
switch (k) {
case GLUT_KEY_F10: /* F10 toggles menu on and off... */
printf("Invoking call back function");
hideMenuButton ->
setValue ((int) !(hideMenuButton -> getValue() ) );
hideMenuButton -> invokeCallback();
//exit(1);
return;
case GLUT_KEY_UP:
fgElevMove(0.05);
return;
@ -282,9 +290,15 @@ void GLUTspecialkey(int k, int x, int y) {
/* $Log$
/* Revision 1.10 1998/05/27 02:24:05 curt
/* View optimizations by Norman Vine.
/* Revision 1.11 1998/06/12 00:57:38 curt
/* Added support for Pui/Gui.
/* Converted fog to GL_FOG_EXP2.
/* Link to static simulator parts.
/* Update runfg.bat to try to be a little smarter.
/*
* Revision 1.10 1998/05/27 02:24:05 curt
* View optimizations by Norman Vine.
*
* Revision 1.9 1998/05/16 13:05:21 curt
* Added limits to fov.
*

View file

@ -58,10 +58,12 @@
#include <Cockpit/cockpit.hxx>
#include <Debug/fg_debug.h>
#include <Gui/gui.h>
#include <Joystick/joystick.h>
#include <Math/fg_geodesy.h>
#include <Math/mat3.h>
#include <Math/polar3d.h>
#include <Pui/pu.h>
#include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx>
#include <Time/event.hxx>
@ -138,10 +140,10 @@ static void fgInitVisuals( void ) {
xglEnable( GL_LIGHT0 );
xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
xglFogi (GL_FOG_MODE, GL_LINEAR);
xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
xglFogf (GL_FOG_END, w->visibility);
// xglFogf (GL_FOG_DENSITY, w->visibility);
// xglFogi (GL_FOG_MODE, GL_LINEAR);
xglFogi (GL_FOG_MODE, GL_EXP);
// Fog density is now set when the weather system is initialized
// xglFogf (GL_FOG_DENSITY, w->fog_density);
if ( o->shading ) {
xglHint (GL_FOG_HINT, GL_NICEST );
} else {
@ -282,6 +284,10 @@ static void fgRenderFrame( void ) {
t = &cur_time_params;
v = &current_view;
// this is just a temporary hack, to make me understand Pui
timerText -> setLabel (ctime (&t->cur_time));
// end of hack
// update view volume parameters
fgUpdateViewParams();
@ -388,7 +394,7 @@ static void fgRenderFrame( void ) {
if (displayInstruments) {
fgUpdateInstrViewParams();
}
puDisplay();
xglutSwapBuffers();
}
@ -616,6 +622,11 @@ int fgGlutInitEvents( void ) {
xglutKeyboardFunc( GLUTkey );
glutSpecialFunc( GLUTspecialkey );
// call guiMouseFunc() whenever our little rodent is used
glutMouseFunc ( guiMouseFunc );
glutMotionFunc (guiMotionFunc );
glutPassiveMotionFunc (guiMotionFunc );
// call fgMainLoop() whenever there is
// nothing else to do
xglutIdleFunc( fgMainLoop );
@ -705,6 +716,9 @@ int main( int argc, char **argv ) {
"GLUT event handler initialization failed ...\n" );
}
//Init the user interface
guiInit();
// Initialize audio support
#ifdef HAVE_OSS_AUDIO
audio_mixer . setMasterVolume ( 30 ) ; /* 50% of max volume. */
@ -736,6 +750,12 @@ int main( int argc, char **argv ) {
// $Log$
// Revision 1.24 1998/06/12 00:57:39 curt
// Added support for Pui/Gui.
// Converted fog to GL_FOG_EXP2.
// Link to static simulator parts.
// Update runfg.bat to try to be a little smarter.
//
// Revision 1.23 1998/06/08 17:57:04 curt
// Minor sound/startup position tweaks.
//

View file

@ -19,22 +19,24 @@ fg_SOURCES = \
views.cxx views.hxx
fg_LDADD = \
$(top_builddir)/Simulator/Aircraft/libAircraft.la \
$(top_builddir)/Simulator/Astro/libAstro.la \
$(top_builddir)/Simulator/Autopilot/libAutopilot.la \
$(top_builddir)/Simulator/Cockpit/libCockpit.la \
$(top_builddir)/Simulator/Controls/libControls.la \
$(top_builddir)/Simulator/Flight/libFlight.la \
$(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.la \
$(top_builddir)/Simulator/Flight/Slew/libSlew.la \
$(top_builddir)/Simulator/Scenery/libScenery.la \
$(top_builddir)/Simulator/Time/libTime.la \
$(top_builddir)/Simulator/Weather/libWeather.la \
$(top_builddir)/Simulator/Joystick/libJoystick.la \
$(top_builddir)/Simulator/Aircraft/libAircraft.a \
$(top_builddir)/Simulator/Astro/libAstro.a \
$(top_builddir)/Simulator/Autopilot/libAutopilot.a \
$(top_builddir)/Simulator/Cockpit/libCockpit.a \
$(top_builddir)/Simulator/Controls/libControls.a \
$(top_builddir)/Simulator/Flight/libFlight.a \
$(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.a \
$(top_builddir)/Simulator/Flight/Slew/libSlew.a \
$(top_builddir)/Simulator/Gui/libGui.a \
$(top_builddir)/Simulator/Scenery/libScenery.a \
$(top_builddir)/Simulator/Time/libTime.a \
$(top_builddir)/Simulator/Weather/libWeather.a \
$(top_builddir)/Simulator/Joystick/libJoystick.a \
$(AUDIO_LIBS) \
$(top_builddir)/Lib/Math/libMath.la \
$(top_builddir)/Lib/Bucket/libBucket.la \
$(top_builddir)/Lib/Debug/libDebug.la \
$(top_builddir)/Lib/Pui/libPui.la \
$(top_builddir)/Lib/zlib/libz.la
INCLUDES += \

View file

@ -1,23 +1,28 @@
REM @ECHO OFF
REM Skip ahead to CONT1 if FG_ROOT has a value
IF NOT %FG_ROOT%.==. GOTO CONT1
REM Skip ahead to RUN1 if %FG_ROOT%\BIN\FG.EXE exists
IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1
REM %FG_ROOT% wasn't set right so let's try "."
SET FG_ROOT=.
IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1
:CONT1
REM %FG_ROOT% wasn't set right so let's try ".."
SET FG_ROOT=..
IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1
REM Check for the existance of the executable
IF NOT EXIST %FG_ROOT%\BIN\FG.EXE GOTO ERROR1
REM %FG_ROOT% wasn't set right so let's try "@prefix@"
SET FG_ROOT=@prefix@
IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1
ECHO Cannot find %FG_ROOT%\BIN\FG.EXE
GOTO END
:RUN1
REM Now that FG_ROOT has been set, run the program
ECHO FG_ROOT = %FG_ROOT%
%FG_ROOT%\BIN\FG.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO END
:ERROR1
ECHO Cannot find %FG_ROOT%\BIN\FG.EXE
GOTO END
:END