Tweaks to get things to compile with gcc-win32.
This commit is contained in:
parent
31519b5cd1
commit
3fe61cf7ef
7 changed files with 82 additions and 27 deletions
|
@ -551,6 +551,7 @@ Hptr fgHUDInit( struct AIRCRAFT current_aircraft, int color )
|
||||||
Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
|
Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
|
||||||
int hole_len, double (*load_value)() )
|
int hole_len, double (*load_value)() )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
struct HUD_horizon *horizon;
|
struct HUD_horizon *horizon;
|
||||||
struct HUD_instr *instrument;
|
struct HUD_instr *instrument;
|
||||||
HIptr tmp_first, tmp_next;
|
HIptr tmp_first, tmp_next;
|
||||||
|
@ -581,11 +582,13 @@ Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
|
||||||
hud->instruments = instrument;
|
hud->instruments = instrument;
|
||||||
|
|
||||||
return( hud );
|
return( hud );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
|
Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
|
||||||
int orientation, int with_min, int min_value, int width_units, double (*load_value)() )
|
int orientation, int with_min, int min_value, int width_units, double (*load_value)() )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
struct HUD_scale *scale;
|
struct HUD_scale *scale;
|
||||||
struct HUD_instr *instrument;
|
struct HUD_instr *instrument;
|
||||||
HIptr tmp_first, tmp_next;
|
HIptr tmp_first, tmp_next;
|
||||||
|
@ -622,11 +625,13 @@ Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, i
|
||||||
hud->instruments = instrument;
|
hud->instruments = instrument;
|
||||||
|
|
||||||
return( hud );
|
return( hud );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
|
Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
|
||||||
char *pre_str, char *post_str, char *format, double (*load_value)() )
|
char *pre_str, char *post_str, char *format, double (*load_value)() )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
struct HUD_label *label;
|
struct HUD_label *label;
|
||||||
struct HUD_instr *instrument;
|
struct HUD_instr *instrument;
|
||||||
HIptr tmp_first, tmp_next;
|
HIptr tmp_first, tmp_next;
|
||||||
|
@ -661,12 +666,14 @@ Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int jus
|
||||||
hud->instruments = instrument;
|
hud->instruments = instrument;
|
||||||
|
|
||||||
return( hud );
|
return( hud );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
|
Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
|
||||||
int hole_len, int div_units, int label_pos, int width_units, \
|
int hole_len, int div_units, int label_pos, int width_units, \
|
||||||
double (*load_roll)(), double (*load_pitch)() )
|
double (*load_roll)(), double (*load_pitch)() )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
struct HUD_ladder *ladder;
|
struct HUD_ladder *ladder;
|
||||||
struct HUD_instr *instrument;
|
struct HUD_instr *instrument;
|
||||||
HIptr tmp_first, tmp_next;
|
HIptr tmp_first, tmp_next;
|
||||||
|
@ -703,6 +710,7 @@ Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_heig
|
||||||
hud->instruments = instrument;
|
hud->instruments = instrument;
|
||||||
|
|
||||||
return( hud );
|
return( hud );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -799,9 +807,12 @@ void fgUpdateHUD( Hptr hud )
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.3 1997/09/05 14:17:26 curt
|
/* Revision 1.4 1997/09/23 00:29:32 curt
|
||||||
/* More tweaking with stars.
|
/* Tweaks to get things to compile with gcc-win32.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.3 1997/09/05 14:17:26 curt
|
||||||
|
* More tweaking with stars.
|
||||||
|
*
|
||||||
* Revision 1.2 1997/09/04 02:17:30 curt
|
* Revision 1.2 1997/09/04 02:17:30 curt
|
||||||
* Shufflin' stuff.
|
* Shufflin' stuff.
|
||||||
*
|
*
|
||||||
|
|
|
@ -192,7 +192,7 @@ static void fgUpdateViewParams() {
|
||||||
|
|
||||||
sky = 0.85 * pow(1.2, -x_8 / 20.0) + 0.15;
|
sky = 0.85 * pow(1.2, -x_8 / 20.0) + 0.15;
|
||||||
|
|
||||||
sky = 0.15; /* force a dark sky (for testing) */
|
/* sky = 0.15; */ /* to force a dark sky (for testing) */
|
||||||
|
|
||||||
if ( ambient < 0.1 ) { ambient = 0.1; }
|
if ( ambient < 0.1 ) { ambient = 0.1; }
|
||||||
if ( diffuse < 0.0 ) { diffuse = 0.0; }
|
if ( diffuse < 0.0 ) { diffuse = 0.0; }
|
||||||
|
@ -577,9 +577,12 @@ int main( int argc, char *argv[] ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.20 1997/09/22 14:44:19 curt
|
/* Revision 1.21 1997/09/23 00:29:38 curt
|
||||||
/* Continuing to try to align stars correctly.
|
/* Tweaks to get things to compile with gcc-win32.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.20 1997/09/22 14:44:19 curt
|
||||||
|
* Continuing to try to align stars correctly.
|
||||||
|
*
|
||||||
* Revision 1.19 1997/09/18 16:20:08 curt
|
* Revision 1.19 1997/09/18 16:20:08 curt
|
||||||
* At dusk/dawn add/remove stars in stages.
|
* At dusk/dawn add/remove stars in stages.
|
||||||
*
|
*
|
||||||
|
|
|
@ -111,8 +111,9 @@ void fgInitSubsystems( void ) {
|
||||||
/* FG_Latitude = ( 45.15 ) * DEG_TO_RAD; */
|
/* FG_Latitude = ( 45.15 ) * DEG_TO_RAD; */
|
||||||
/* FG_Altitude = FG_Runway_altitude + 3.758099; */
|
/* FG_Altitude = FG_Runway_altitude + 3.758099; */
|
||||||
|
|
||||||
FG_Longitude = ( -583200.00 / 3600.0 ) * DEG_TO_RAD;
|
/* A random test position */
|
||||||
FG_Latitude = ( 110808.41 / 3600.0 ) * DEG_TO_RAD;
|
/* FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD; */
|
||||||
|
/* FG_Latitude = ( 93312.00 / 3600.0 ) * DEG_TO_RAD; */
|
||||||
|
|
||||||
printf("Initial position is: (%.4f, %.4f, %.2f)\n",
|
printf("Initial position is: (%.4f, %.4f, %.2f)\n",
|
||||||
FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
|
FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
|
||||||
|
@ -215,9 +216,12 @@ void fgInitSubsystems( void ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.8 1997/09/22 14:44:20 curt
|
/* Revision 1.9 1997/09/23 00:29:39 curt
|
||||||
/* Continuing to try to align stars correctly.
|
/* Tweaks to get things to compile with gcc-win32.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.8 1997/09/22 14:44:20 curt
|
||||||
|
* Continuing to try to align stars correctly.
|
||||||
|
*
|
||||||
* Revision 1.7 1997/09/16 15:50:30 curt
|
* Revision 1.7 1997/09/16 15:50:30 curt
|
||||||
* Working on star alignment and time issues.
|
* Working on star alignment and time issues.
|
||||||
*
|
*
|
||||||
|
|
|
@ -213,7 +213,7 @@ void fgStarsRender() {
|
||||||
|
|
||||||
/* FG_PI_2 + 0.1 is about 6 degrees after sundown and before sunrise */
|
/* FG_PI_2 + 0.1 is about 6 degrees after sundown and before sunrise */
|
||||||
|
|
||||||
t->sun_angle = 3.0; /* force stars (for testing) */
|
/* t->sun_angle = 3.0; */ /* to force stars to be drawn (for testing) */
|
||||||
|
|
||||||
if ( t->sun_angle > (FG_PI_2 + 5 * DEG_TO_RAD ) ) {
|
if ( t->sun_angle > (FG_PI_2 + 5 * DEG_TO_RAD ) ) {
|
||||||
/* determine which star structure to draw */
|
/* determine which star structure to draw */
|
||||||
|
@ -254,9 +254,12 @@ void fgStarsRender() {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.11 1997/09/22 14:44:21 curt
|
/* Revision 1.12 1997/09/23 00:29:43 curt
|
||||||
/* Continuing to try to align stars correctly.
|
/* Tweaks to get things to compile with gcc-win32.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.11 1997/09/22 14:44:21 curt
|
||||||
|
* Continuing to try to align stars correctly.
|
||||||
|
*
|
||||||
* Revision 1.10 1997/09/20 03:34:32 curt
|
* Revision 1.10 1997/09/20 03:34:32 curt
|
||||||
* Still trying to get those durned stars aligned properly.
|
* Still trying to get those durned stars aligned properly.
|
||||||
*
|
*
|
||||||
|
|
|
@ -82,7 +82,7 @@ bin-tar: all
|
||||||
tar cvzf bin-$(VERSION).tar.gz FlightGear/fgtop FlightGear/fg0 \
|
tar cvzf bin-$(VERSION).tar.gz FlightGear/fgtop FlightGear/fg0 \
|
||||||
FlightGear/runfg FlightGear/COPYING FlightGear/Docs FlightGear/Thanks)
|
FlightGear/runfg FlightGear/COPYING FlightGear/Docs FlightGear/Thanks)
|
||||||
|
|
||||||
bin-zip: all
|
bin-zip:
|
||||||
cp GLUT/fg0.exe GLUT/runfg.bat GLUT/cygwin.dll ..
|
cp GLUT/fg0.exe GLUT/runfg.bat GLUT/cygwin.dll ..
|
||||||
(cd ../..; \
|
(cd ../..; \
|
||||||
zip -r bin-$(VERSION).zip FlightGear/fgtop FlightGear/fg0.exe \
|
zip -r bin-$(VERSION).zip FlightGear/fgtop FlightGear/fg0.exe \
|
||||||
|
@ -92,6 +92,9 @@ bin-zip: all
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.27 1997/09/23 00:29:27 curt
|
||||||
|
# Tweaks to get things to compile with gcc-win32.
|
||||||
|
#
|
||||||
# Revision 1.26 1997/09/04 02:17:18 curt
|
# Revision 1.26 1997/09/04 02:17:18 curt
|
||||||
# Shufflin' stuff.
|
# Shufflin' stuff.
|
||||||
#
|
#
|
||||||
|
|
|
@ -98,28 +98,31 @@ GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(VERSION)\"
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Linux/Mesa with the GLUT toolkit
|
# Linux/Mesa with the GLUT toolkit
|
||||||
#
|
#
|
||||||
INTERFACE_FLAGS = -DGLUT
|
# INTERFACE_FLAGS = -DGLUT
|
||||||
INTERFACE_LIBS = -lglut
|
# INTERFACE_LIBS = -lglut
|
||||||
INTERFACE_FILES = GLUTmain.c GLUTkey.c
|
# INTERFACE_FILES = GLUTmain.c GLUTkey.c
|
||||||
MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
|
# MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
|
||||||
X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
|
# X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
|
||||||
GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
|
# GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
|
||||||
FG_CFLAGS = $(GLOBAL_CFLAGS)
|
# FG_CFLAGS = $(GLOBAL_CFLAGS)
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Cygnus Win32 (gcc based) with a static version of the GLUT toolkit
|
# Cygnus Win32 (gcc based) with a static version of the GLUT toolkit
|
||||||
#
|
#
|
||||||
# INTERFACE_FLAGS = -DGLUT
|
INTERFACE_FLAGS = -DGLUT
|
||||||
# INTERFACE_LIBS = ../Win32/libglut.a
|
INTERFACE_LIBS = ../Win32/libglut.a
|
||||||
# INTERFACE_FILES = GLUTmain.c GLUTkey.c
|
INTERFACE_FILES = GLUTmain.c GLUTkey.c
|
||||||
# GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32
|
GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32
|
||||||
# FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND
|
FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.15 1997/09/23 00:29:27 curt
|
||||||
|
# Tweaks to get things to compile with gcc-win32.
|
||||||
|
#
|
||||||
# Revision 1.14 1997/09/16 22:14:47 curt
|
# Revision 1.14 1997/09/16 22:14:47 curt
|
||||||
# Tweaked time of day lighting equations. Don't draw stars during the day.
|
# Tweaked time of day lighting equations. Don't draw stars during the day.
|
||||||
#
|
#
|
||||||
|
|
|
@ -29,6 +29,11 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <sys/time.h> /* for gettimeofday() */
|
||||||
|
#include <unistd.h> /* for gettimeofday() */
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "fg_time.h"
|
#include "fg_time.h"
|
||||||
#include "../constants.h"
|
#include "../constants.h"
|
||||||
#include "../Flight/flight.h"
|
#include "../Flight/flight.h"
|
||||||
|
@ -152,6 +157,14 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
|
||||||
long int offset;
|
long int offset;
|
||||||
double diff, part, days, hours, lst;
|
double diff, part, days, hours, lst;
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
int daylight;
|
||||||
|
long int timezone;
|
||||||
|
|
||||||
|
struct timeval tv;
|
||||||
|
struct timezone tz;
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("COURSE: GMT = %d/%d/%2d %d:%02d:%02d\n",
|
printf("COURSE: GMT = %d/%d/%2d %d:%02d:%02d\n",
|
||||||
gmt->tm_mon, gmt->tm_mday, gmt->tm_year,
|
gmt->tm_mon, gmt->tm_mday, gmt->tm_year,
|
||||||
gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
|
gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
|
||||||
|
@ -165,6 +178,18 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
|
||||||
|
|
||||||
start = mktime(&mt);
|
start = mktime(&mt);
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
daylight = mt.tm_isdst;
|
||||||
|
gettimeofday(&tv, &tz);
|
||||||
|
timezone = tz.tz_minuteswest * 60;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ( daylight > 0 ) {
|
||||||
|
daylight = 1;
|
||||||
|
} else if ( daylight < 0 ) {
|
||||||
|
printf("OOOPS, big time problem in fg_time.c, no daylight savings info.\n");
|
||||||
|
}
|
||||||
|
|
||||||
offset = -(timezone / 3600 - daylight);
|
offset = -(timezone / 3600 - daylight);
|
||||||
|
|
||||||
printf("Raw time zone offset = %ld\n", timezone);
|
printf("Raw time zone offset = %ld\n", timezone);
|
||||||
|
@ -259,9 +284,12 @@ void fgTimeUpdate(struct FLIGHT *f, struct fgTIME *t) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.6 1997/09/20 03:34:34 curt
|
/* Revision 1.7 1997/09/23 00:29:50 curt
|
||||||
/* Still trying to get those durned stars aligned properly.
|
/* Tweaks to get things to compile with gcc-win32.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.6 1997/09/20 03:34:34 curt
|
||||||
|
* Still trying to get those durned stars aligned properly.
|
||||||
|
*
|
||||||
* Revision 1.5 1997/09/16 22:14:52 curt
|
* Revision 1.5 1997/09/16 22:14:52 curt
|
||||||
* Tweaked time of day lighting equations. Don't draw stars during the day.
|
* Tweaked time of day lighting equations. Don't draw stars during the day.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue