]> git.mxchange.org Git - flightgear.git/blob - src/NetworkOLK/net_hud.cxx
Code reorganization.
[flightgear.git] / src / NetworkOLK / net_hud.cxx
1 // network.cxx -- data structures for managing network.
2 //
3 // Written by Oliver Delise, started May 1999.
4 //
5 // Copyleft (C) 1999  Oliver Delise - delise@mail.isis.de
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifdef HAVE_CONFIG_H
25 #  include <config.h>
26 #endif
27
28 /*
29
30 #ifdef HAVE_WINDOWS_H
31 #  include <windows.h>
32 #endif
33
34 #ifdef __BORLANDC__
35 #  define exception c_exception
36 #endif
37 #include <math.h>
38
39 #include <GL/glut.h>
40 #include <stdlib.h>
41 #include <string.h>
42
43 #ifdef HAVE_VALUES_H
44 #  include <values.h>  // for MAXINT
45 #endif
46
47 #include <simgear/logstream.hxx>
48 #include <simgear/constants.h>
49 #include <simgear/fg_random.h>
50 #include <simgear/mat3.h>
51 #include <simgear/polar3d.hxx>
52
53 #include <Aircraft/aircraft.hxx>
54 #include <GUI/gui.h>
55 #include <Main/options.hxx>
56 #include <Scenery/scenery.hxx>
57 #include <Time/fg_timer.hxx>
58
59 #if defined ( __sun__ ) || defined ( __sgi )
60 extern "C" {
61   extern void *memmove(void *, const void *, size_t);
62 }
63 #endif
64
65 */
66
67 #include <Main/options.hxx>
68 #include <Cockpit/hud.hxx>
69 #include <NetworkOLK/network.h>
70
71 extern char *fgd_callsign;
72
73
74 void net_hud_update(){
75  static char fgd_str[80];
76  static float fgd_lon, fgd_lat, fgd_alt;
77  int LinePos;
78  
79   fgd_lon = get_longitude();
80   fgd_lat = get_latitude();
81   fgd_alt = get_altitude();
82 //  sprintf(fgd_str,"Found %s %3.3f %3.3f", net_callsign, fgd_lat, fgd_lon);
83 //  HUD_TextList.add( fgText( 40, 18, fgd_str) );
84   other = head->next;
85   LinePos = 38;
86   while ( other != tail) {
87      if ( strcmp( other->ipadr, fgd_mcp_ip) != 0 ) {
88         sprintf( fgd_str, "%-16s%-16s", other->callsign, other->ipadr);
89         HUD_TextList.add( fgText( 40, LinePos, fgd_str) );
90         LinePos += 13;
91      }
92      other = other->next;
93   }
94   sprintf(fgd_str,"%-16s%-16s", fgd_callsign, fgd_mcp_ip);
95   HUD_TextList.add( fgText( 40, LinePos ,fgd_str) );
96   sprintf(fgd_str,"Callsign        IP");
97   HUD_TextList.add( fgText( 40, LinePos + 13 ,fgd_str) );
98 }