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:
parent
7b98736e32
commit
9ebfc12526
4 changed files with 79 additions and 38 deletions
|
@ -40,7 +40,9 @@
|
||||||
#include <Aircraft/aircraft.h>
|
#include <Aircraft/aircraft.h>
|
||||||
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
|
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
|
#include <Gui/gui.h>
|
||||||
#include <Include/fg_constants.h>
|
#include <Include/fg_constants.h>
|
||||||
|
#include <Pui/pu.h>
|
||||||
#include <Weather/weather.h>
|
#include <Weather/weather.h>
|
||||||
|
|
||||||
#include "GLUTkey.hxx"
|
#include "GLUTkey.hxx"
|
||||||
|
@ -58,6 +60,7 @@ void GLUTkey(unsigned char k, int x, int y) {
|
||||||
fgTIME *t;
|
fgTIME *t;
|
||||||
fgVIEW *v;
|
fgVIEW *v;
|
||||||
struct fgWEATHER *w;
|
struct fgWEATHER *w;
|
||||||
|
float tmp;
|
||||||
|
|
||||||
c = current_aircraft.controls;
|
c = current_aircraft.controls;
|
||||||
o = ¤t_options;
|
o = ¤t_options;
|
||||||
|
@ -66,6 +69,7 @@ void GLUTkey(unsigned char k, int x, int y) {
|
||||||
w = ¤t_weather;
|
w = ¤t_weather;
|
||||||
|
|
||||||
fgPrintf( FG_INPUT, FG_DEBUG, "Key hit = %d", k);
|
fgPrintf( FG_INPUT, FG_DEBUG, "Key hit = %d", k);
|
||||||
|
puKeyboard(k, PU_DOWN );
|
||||||
|
|
||||||
if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
|
if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
|
||||||
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
|
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
|
||||||
|
@ -114,11 +118,9 @@ void GLUTkey(unsigned char k, int x, int y) {
|
||||||
v->update_fov = TRUE;
|
v->update_fov = TRUE;
|
||||||
return;
|
return;
|
||||||
case 90: /* Z key */
|
case 90: /* Z key */
|
||||||
w->visibility /= 1.10;
|
tmp = fgWeatherGetVisibility(); /* in meters */
|
||||||
xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
|
tmp /= 1.10;
|
||||||
xglFogf(GL_FOG_END, w->visibility);
|
fgWeatherSetVisibility( tmp );
|
||||||
fgPrintf( FG_INPUT, FG_DEBUG,
|
|
||||||
"Fog density = %.4f\n", w->visibility );
|
|
||||||
return;
|
return;
|
||||||
// autopilot additions
|
// autopilot additions
|
||||||
case 65: /* A key */
|
case 65: /* A key */
|
||||||
|
@ -183,11 +185,9 @@ void GLUTkey(unsigned char k, int x, int y) {
|
||||||
v->update_fov = TRUE;
|
v->update_fov = TRUE;
|
||||||
return;
|
return;
|
||||||
case 122: /* z key */
|
case 122: /* z key */
|
||||||
w->visibility *= 1.10;
|
tmp = fgWeatherGetVisibility(); /* in meters */
|
||||||
xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
|
tmp *= 1.10;
|
||||||
xglFogf(GL_FOG_END, w->visibility);
|
fgWeatherSetVisibility( tmp );
|
||||||
fgPrintf( FG_INPUT, FG_DEBUG,
|
|
||||||
"Fog density = %.4f\n", w->visibility);
|
|
||||||
return;
|
return;
|
||||||
case 27: /* ESC */
|
case 27: /* ESC */
|
||||||
// if( fg_DebugOutput ) {
|
// if( fg_DebugOutput ) {
|
||||||
|
@ -209,6 +209,7 @@ void GLUTspecialkey(int k, int x, int y) {
|
||||||
v = ¤t_view;
|
v = ¤t_view;
|
||||||
|
|
||||||
fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
|
fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
|
||||||
|
puKeyboard(k + PU_KEY_GLUT_SPECIAL_OFFSET, PU_DOWN);
|
||||||
|
|
||||||
if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
|
if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
|
||||||
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
|
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
|
||||||
|
@ -241,6 +242,13 @@ void GLUTspecialkey(int k, int x, int y) {
|
||||||
} else {
|
} else {
|
||||||
fgPrintf( FG_INPUT, FG_DEBUG, "\n");
|
fgPrintf( FG_INPUT, FG_DEBUG, "\n");
|
||||||
switch (k) {
|
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:
|
case GLUT_KEY_UP:
|
||||||
fgElevMove(0.05);
|
fgElevMove(0.05);
|
||||||
return;
|
return;
|
||||||
|
@ -282,9 +290,15 @@ void GLUTspecialkey(int k, int x, int y) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.10 1998/05/27 02:24:05 curt
|
/* Revision 1.11 1998/06/12 00:57:38 curt
|
||||||
/* View optimizations by Norman Vine.
|
/* 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
|
* Revision 1.9 1998/05/16 13:05:21 curt
|
||||||
* Added limits to fov.
|
* Added limits to fov.
|
||||||
*
|
*
|
||||||
|
|
|
@ -58,10 +58,12 @@
|
||||||
|
|
||||||
#include <Cockpit/cockpit.hxx>
|
#include <Cockpit/cockpit.hxx>
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
|
#include <Gui/gui.h>
|
||||||
#include <Joystick/joystick.h>
|
#include <Joystick/joystick.h>
|
||||||
#include <Math/fg_geodesy.h>
|
#include <Math/fg_geodesy.h>
|
||||||
#include <Math/mat3.h>
|
#include <Math/mat3.h>
|
||||||
#include <Math/polar3d.h>
|
#include <Math/polar3d.h>
|
||||||
|
#include <Pui/pu.h>
|
||||||
#include <Scenery/scenery.hxx>
|
#include <Scenery/scenery.hxx>
|
||||||
#include <Scenery/tilemgr.hxx>
|
#include <Scenery/tilemgr.hxx>
|
||||||
#include <Time/event.hxx>
|
#include <Time/event.hxx>
|
||||||
|
@ -138,10 +140,10 @@ static void fgInitVisuals( void ) {
|
||||||
xglEnable( GL_LIGHT0 );
|
xglEnable( GL_LIGHT0 );
|
||||||
xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
|
xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
|
||||||
|
|
||||||
xglFogi (GL_FOG_MODE, GL_LINEAR);
|
// xglFogi (GL_FOG_MODE, GL_LINEAR);
|
||||||
xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
|
xglFogi (GL_FOG_MODE, GL_EXP);
|
||||||
xglFogf (GL_FOG_END, w->visibility);
|
// Fog density is now set when the weather system is initialized
|
||||||
// xglFogf (GL_FOG_DENSITY, w->visibility);
|
// xglFogf (GL_FOG_DENSITY, w->fog_density);
|
||||||
if ( o->shading ) {
|
if ( o->shading ) {
|
||||||
xglHint (GL_FOG_HINT, GL_NICEST );
|
xglHint (GL_FOG_HINT, GL_NICEST );
|
||||||
} else {
|
} else {
|
||||||
|
@ -282,6 +284,10 @@ static void fgRenderFrame( void ) {
|
||||||
t = &cur_time_params;
|
t = &cur_time_params;
|
||||||
v = ¤t_view;
|
v = ¤t_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
|
// update view volume parameters
|
||||||
fgUpdateViewParams();
|
fgUpdateViewParams();
|
||||||
|
|
||||||
|
@ -388,7 +394,7 @@ static void fgRenderFrame( void ) {
|
||||||
if (displayInstruments) {
|
if (displayInstruments) {
|
||||||
fgUpdateInstrViewParams();
|
fgUpdateInstrViewParams();
|
||||||
}
|
}
|
||||||
|
puDisplay();
|
||||||
xglutSwapBuffers();
|
xglutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,6 +622,11 @@ int fgGlutInitEvents( void ) {
|
||||||
xglutKeyboardFunc( GLUTkey );
|
xglutKeyboardFunc( GLUTkey );
|
||||||
glutSpecialFunc( GLUTspecialkey );
|
glutSpecialFunc( GLUTspecialkey );
|
||||||
|
|
||||||
|
// call guiMouseFunc() whenever our little rodent is used
|
||||||
|
glutMouseFunc ( guiMouseFunc );
|
||||||
|
glutMotionFunc (guiMotionFunc );
|
||||||
|
glutPassiveMotionFunc (guiMotionFunc );
|
||||||
|
|
||||||
// call fgMainLoop() whenever there is
|
// call fgMainLoop() whenever there is
|
||||||
// nothing else to do
|
// nothing else to do
|
||||||
xglutIdleFunc( fgMainLoop );
|
xglutIdleFunc( fgMainLoop );
|
||||||
|
@ -705,6 +716,9 @@ int main( int argc, char **argv ) {
|
||||||
"GLUT event handler initialization failed ...\n" );
|
"GLUT event handler initialization failed ...\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Init the user interface
|
||||||
|
guiInit();
|
||||||
|
|
||||||
// Initialize audio support
|
// Initialize audio support
|
||||||
#ifdef HAVE_OSS_AUDIO
|
#ifdef HAVE_OSS_AUDIO
|
||||||
audio_mixer . setMasterVolume ( 30 ) ; /* 50% of max volume. */
|
audio_mixer . setMasterVolume ( 30 ) ; /* 50% of max volume. */
|
||||||
|
@ -736,6 +750,12 @@ int main( int argc, char **argv ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $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
|
// Revision 1.23 1998/06/08 17:57:04 curt
|
||||||
// Minor sound/startup position tweaks.
|
// Minor sound/startup position tweaks.
|
||||||
//
|
//
|
||||||
|
|
|
@ -19,22 +19,24 @@ fg_SOURCES = \
|
||||||
views.cxx views.hxx
|
views.cxx views.hxx
|
||||||
|
|
||||||
fg_LDADD = \
|
fg_LDADD = \
|
||||||
$(top_builddir)/Simulator/Aircraft/libAircraft.la \
|
$(top_builddir)/Simulator/Aircraft/libAircraft.a \
|
||||||
$(top_builddir)/Simulator/Astro/libAstro.la \
|
$(top_builddir)/Simulator/Astro/libAstro.a \
|
||||||
$(top_builddir)/Simulator/Autopilot/libAutopilot.la \
|
$(top_builddir)/Simulator/Autopilot/libAutopilot.a \
|
||||||
$(top_builddir)/Simulator/Cockpit/libCockpit.la \
|
$(top_builddir)/Simulator/Cockpit/libCockpit.a \
|
||||||
$(top_builddir)/Simulator/Controls/libControls.la \
|
$(top_builddir)/Simulator/Controls/libControls.a \
|
||||||
$(top_builddir)/Simulator/Flight/libFlight.la \
|
$(top_builddir)/Simulator/Flight/libFlight.a \
|
||||||
$(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.la \
|
$(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.a \
|
||||||
$(top_builddir)/Simulator/Flight/Slew/libSlew.la \
|
$(top_builddir)/Simulator/Flight/Slew/libSlew.a \
|
||||||
$(top_builddir)/Simulator/Scenery/libScenery.la \
|
$(top_builddir)/Simulator/Gui/libGui.a \
|
||||||
$(top_builddir)/Simulator/Time/libTime.la \
|
$(top_builddir)/Simulator/Scenery/libScenery.a \
|
||||||
$(top_builddir)/Simulator/Weather/libWeather.la \
|
$(top_builddir)/Simulator/Time/libTime.a \
|
||||||
$(top_builddir)/Simulator/Joystick/libJoystick.la \
|
$(top_builddir)/Simulator/Weather/libWeather.a \
|
||||||
|
$(top_builddir)/Simulator/Joystick/libJoystick.a \
|
||||||
$(AUDIO_LIBS) \
|
$(AUDIO_LIBS) \
|
||||||
$(top_builddir)/Lib/Math/libMath.la \
|
$(top_builddir)/Lib/Math/libMath.la \
|
||||||
$(top_builddir)/Lib/Bucket/libBucket.la \
|
$(top_builddir)/Lib/Bucket/libBucket.la \
|
||||||
$(top_builddir)/Lib/Debug/libDebug.la \
|
$(top_builddir)/Lib/Debug/libDebug.la \
|
||||||
|
$(top_builddir)/Lib/Pui/libPui.la \
|
||||||
$(top_builddir)/Lib/zlib/libz.la
|
$(top_builddir)/Lib/zlib/libz.la
|
||||||
|
|
||||||
INCLUDES += \
|
INCLUDES += \
|
||||||
|
|
|
@ -1,23 +1,28 @@
|
||||||
REM @ECHO OFF
|
REM @ECHO OFF
|
||||||
|
|
||||||
REM Skip ahead to CONT1 if FG_ROOT has a value
|
REM Skip ahead to RUN1 if %FG_ROOT%\BIN\FG.EXE exists
|
||||||
IF NOT %FG_ROOT%.==. GOTO CONT1
|
IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1
|
||||||
|
|
||||||
|
REM %FG_ROOT% wasn't set right so let's try "."
|
||||||
SET FG_ROOT=.
|
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
|
REM %FG_ROOT% wasn't set right so let's try "@prefix@"
|
||||||
IF NOT EXIST %FG_ROOT%\BIN\FG.EXE GOTO ERROR1
|
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
|
REM Now that FG_ROOT has been set, run the program
|
||||||
ECHO FG_ROOT = %FG_ROOT%
|
ECHO FG_ROOT = %FG_ROOT%
|
||||||
%FG_ROOT%\BIN\FG.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9
|
%FG_ROOT%\BIN\FG.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
|
||||||
GOTO END
|
GOTO END
|
||||||
|
|
||||||
:ERROR1
|
|
||||||
ECHO Cannot find %FG_ROOT%\BIN\FG.EXE
|
|
||||||
GOTO END
|
|
||||||
|
|
||||||
:END
|
:END
|
||||||
|
|
Loading…
Add table
Reference in a new issue