1
0
Fork 0

Moved Oliver's network stuff to his own subdir: NetworkOLK.

This commit is contained in:
curt 2000-01-12 18:09:35 +00:00
parent a93e97c438
commit fd48bdb9f2
4 changed files with 60 additions and 7 deletions

View file

@ -50,7 +50,7 @@
#include <Math/fg_random.h>
#include <Math/mat3.h>
#include <Math/polar3d.hxx>
#include <Network/network.h>
#include <NetworkOLK/network.h>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
@ -1274,6 +1274,13 @@ void fgUpdateHUD( void ) {
char *gmt_str = get_formated_gmt_time();
HUD_TextList.add( fgText(40, 10, gmt_str) );
#ifdef FG_NETWORK_OLK
if ( net_hud_display ) {
net_hud_update();
}
#endif
// temporary
extern bool fgAPAltitudeEnabled( void );
extern bool fgAPHeadingEnabled( void );

View file

@ -5,9 +5,18 @@ SERIAL_LIBS =
endif
if ENABLE_OLD_WEATHER
WEATHER_LIBS = $(top_builddir)/Simulator/Weather/libWeather.a
WEATHER_LIBS = $(top_builddir)/Simulator/Weather/libWeather.a
else
WEATHER_LIBS = $(top_builddir)/Simulator/WeatherCM/libWeatherCM.a
WEATHER_LIBS = $(top_builddir)/Simulator/WeatherCM/libWeatherCM.a
endif
if ENABLE_NETWORK_OLK
NETWORK_LIBS = \
$(top_builddir)/Simulator/Network/libNetwork.a \
$(top_builddir)/Simulator/NetworkOLK/libNetworkOLK.a
else
NETWORK_LIBS = \
$(top_builddir)/Simulator/Network/libNetwork.a
endif
if OLD_AUTOMAKE
@ -46,7 +55,7 @@ fgfs_LDADD = \
$(top_builddir)/Simulator/GUI/libGUI.a \
$(top_builddir)/Simulator/Scenery/libScenery.a \
$(top_builddir)/Simulator/Airports/libAirports.a \
$(top_builddir)/Simulator/Network/libNetwork.a \
$(NETWORK_LIBS) \
$(top_builddir)/Simulator/Objects/libObjects.a \
$(top_builddir)/Simulator/Clouds/libClouds.a \
$(top_builddir)/Simulator/Time/libTime.a \

View file

@ -82,7 +82,7 @@
#include <Math/fg_random.h>
#include <Misc/fgpath.hxx>
#ifdef FG_NETWORK_OLK
#include <Network/network.h>
#include <NetworkOLK/network.h>
#endif
#include <Objects/materialmgr.hxx>
#include <Scenery/scenery.hxx>
@ -144,6 +144,12 @@ ssgBranch *terrain = NULL;
ssgSelector *penguin_sel = NULL;
ssgTransform *penguin_pos = NULL;
#ifdef FG_NETWORK_OLK
ssgSelector *fgd_sel = NULL;
ssgTransform *fgd_pos = NULL;
//sgMat4 sgTUX;
#endif
// current fdm/position used for view
FGInterface cur_view_fdm;
@ -361,7 +367,11 @@ void fgRenderFrame( void ) {
}
// update fog params if visibility has changed
#ifndef FG_OLD_WEATHER
double cur_visibility = WeatherDatabase->getWeatherVisibility();
#else
double cur_visibility = current_weather.get_visibility();
#endif
double actual_visibility = cur_visibility;
if ( current_options.get_clouds() ) {
@ -541,6 +551,25 @@ void fgRenderFrame( void ) {
penguin_pos->setTransform( &tuxpos );
}
# ifdef FG_NETWORK_OLK
sgCoord fgdpos;
other = head->next; /* put listpointer to start */
while ( other != tail) { /* display all except myself */
if ( strcmp( other->ipadr, fgd_mcp_ip) != 0) {
other->fgd_sel->select(1);
sgSetCoord( &fgdpos, other->sgFGD_COORD );
other->fgd_pos->setTransform( &fgdpos );
}
other = other->next;
}
// fgd_sel->select(1);
// sgCopyMat4( sgTUX, current_view.sgVIEW);
// sgCoord fgdpos;
// sgSetCoord( &fgdpos, sgFGD_VIEW );
// fgd_pos->setTransform( &fgdpos);
# endif
ssgSetCamera( current_view.VIEW );
// position tile nodes and update range selectors
@ -703,6 +732,14 @@ static void fgMainLoop( void ) {
FG_LOG( FG_ALL, FG_DEBUG, "Running Main Loop");
FG_LOG( FG_ALL, FG_DEBUG, "======= ==== ====");
#ifdef FG_NETWORK_OLK
if ( net_is_registered == 0 ) { // We first have to reg. to fgd
// printf("FGD: Netupdate\n");
fgd_send_com( "A", FGFS_host); // Send Mat4 data
fgd_send_com( "B", FGFS_host); // Recv Mat4 data
}
#endif
#if defined( ENABLE_PLIB_JOYSTICK )
// Read joystick and update control settings
if ( current_options.get_control_mode() == fgOPTIONS::FG_JOYSTICK ) {
@ -1280,7 +1317,7 @@ int main( int argc, char **argv ) {
#ifdef FG_NETWORK_OLK
// Do the network intialization
printf("Multipilot mode %s\n", fg_net_init() );
printf("Multipilot mode %s\n", fg_net_init( scene ) );
#endif
scene->addKid( terrain );

View file

@ -45,7 +45,7 @@ bool global_fullscreen = true;
#include <Cockpit/cockpit.hxx>
#include <FDM/flight.hxx>
#ifdef FG_NETWORK_OLK
# include <Network/network.h>
# include <NetworkOLK/network.h>
#endif
#include <Time/fg_time.hxx>