Compare commits
250 Commits
RELEASE_0_
...
RELEASE_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cedfade08d | ||
|
|
eedbc7f436 | ||
|
|
b6a683eb6e | ||
|
|
df677ff8aa | ||
|
|
1d8b352d2d | ||
|
|
c8432e3763 | ||
|
|
b3f88735a8 | ||
|
|
789b56872c | ||
|
|
009ed26fd2 | ||
|
|
5ed0ce79ab | ||
|
|
8b8a82bb67 | ||
|
|
94c22fec46 | ||
|
|
8be760b594 | ||
|
|
42b4ec310f | ||
|
|
4ea676b229 | ||
|
|
dda676b1b2 | ||
|
|
f7a3dbc5ed | ||
|
|
1f3947ea4c | ||
|
|
cb7589cc95 | ||
|
|
2ca4b30553 | ||
|
|
bb238c4106 | ||
|
|
4b0b49d1ed | ||
|
|
dd080de16c | ||
|
|
1ae257944b | ||
|
|
a2c8cfb84d | ||
|
|
c01740d516 | ||
|
|
1ce5cd154a | ||
|
|
1fce27f0c3 | ||
|
|
4fc985b518 | ||
|
|
0e999f281b | ||
|
|
aadc802fdd | ||
|
|
d8a7589752 | ||
|
|
f1021ab820 | ||
|
|
8bd3cccc08 | ||
|
|
78fbfa1dde | ||
|
|
16dd841ce5 | ||
|
|
992de38184 | ||
|
|
835e86ad19 | ||
|
|
ef5fb7a98e | ||
|
|
e8cb3cbfa4 | ||
|
|
68b2c9e7d3 | ||
|
|
e78427483c | ||
|
|
25364aa2a6 | ||
|
|
525d2df3cc | ||
|
|
701031a473 | ||
|
|
1960e02ab7 | ||
|
|
ca2ed1c941 | ||
|
|
bde8528859 | ||
|
|
86392857c5 | ||
|
|
95c6c16851 | ||
|
|
ce4f0c4fee | ||
|
|
2d081e6ce6 | ||
|
|
000106200f | ||
|
|
2bb4274517 | ||
|
|
5cd81b8c92 | ||
|
|
5712053ad8 | ||
|
|
192db1c343 | ||
|
|
a3bd57489a | ||
|
|
d69e76959b | ||
|
|
6d784a1a7e | ||
|
|
11d2bca8a7 | ||
|
|
f922e84eb6 | ||
|
|
e2bca737f0 | ||
|
|
940ce98d2c | ||
|
|
72590e6b8f | ||
|
|
3e81ca7da5 | ||
|
|
c4fa7a965d | ||
|
|
1a6e14c3bb | ||
|
|
7379d8a54d | ||
|
|
b63464d239 | ||
|
|
1dac4b2dc1 | ||
|
|
44e7b36a8b | ||
|
|
a26c677df4 | ||
|
|
5d10dda5a1 | ||
|
|
0253a46dbb | ||
|
|
9593059258 | ||
|
|
3f0efc2a6f | ||
|
|
b9593adc7c | ||
|
|
6cf3b54b4b | ||
|
|
78411d29a7 | ||
|
|
f8a49c41ef | ||
|
|
a0a0c8e308 | ||
|
|
e5814dad73 | ||
|
|
f076594288 | ||
|
|
7dfe0bf9b2 | ||
|
|
d9ce8828c9 | ||
|
|
cb2df234ae | ||
|
|
7d73dc6602 | ||
|
|
16bd8cef38 | ||
|
|
f2567f9af4 | ||
|
|
c363758449 | ||
|
|
dfdeb8be9b | ||
|
|
d1c8f60ca9 | ||
|
|
2fb961c922 | ||
|
|
2e17b28994 | ||
|
|
c3f558b034 | ||
|
|
65ce1a04b2 | ||
|
|
3af4a19f76 | ||
|
|
5178f69f18 | ||
|
|
52e2005b3e | ||
|
|
94fa51e3f7 | ||
|
|
590547e12d | ||
|
|
c6832d2513 | ||
|
|
1fd63c30e9 | ||
|
|
f08ae9f2ea | ||
|
|
5c61e97358 | ||
|
|
87e38e2617 | ||
|
|
92e1856caa | ||
|
|
20c099b7ef | ||
|
|
7eb74c7e2a | ||
|
|
8d63c300e2 | ||
|
|
01ccdd3ae1 | ||
|
|
ab074726df | ||
|
|
ed26458a24 | ||
|
|
fcf1d34e55 | ||
|
|
19f99ea273 | ||
|
|
fe5bb76def | ||
|
|
7ecf508453 | ||
|
|
83e6e44eab | ||
|
|
69a93342c0 | ||
|
|
e17338622a | ||
|
|
a67fd7ea99 | ||
|
|
cf2b8afbe9 | ||
|
|
a1e7761384 | ||
|
|
d068915b42 | ||
|
|
adeb0d48fc | ||
|
|
55c89ea865 | ||
|
|
8bd07e358f | ||
|
|
01113e82f3 | ||
|
|
6d79582890 | ||
|
|
2ae3c89406 | ||
|
|
1818102ffe | ||
|
|
406d6dd6fc | ||
|
|
c8ef854f01 | ||
|
|
87dcaf5a00 | ||
|
|
c3bdd0e537 | ||
|
|
c23fd6e66f | ||
|
|
e809eee896 | ||
|
|
c44ef2126c | ||
|
|
e2bfb5633b | ||
|
|
064ee8ba8f | ||
|
|
a5c130446e | ||
|
|
4162817c0b | ||
|
|
81cab6e089 | ||
|
|
d78204d147 | ||
|
|
d8b523d067 | ||
|
|
c4cfad6069 | ||
|
|
5bddb88ce2 | ||
|
|
8c4ee69aeb | ||
|
|
b3a533f8ce | ||
|
|
a885314a39 | ||
|
|
0567a76445 | ||
|
|
d6dc2d6eab | ||
|
|
b75a694682 | ||
|
|
2e7e9b73a0 | ||
|
|
7a11523692 | ||
|
|
f85a9866fe | ||
|
|
9b05c27938 | ||
|
|
fd96729362 | ||
|
|
c57cc096f8 | ||
|
|
c8efd0a465 | ||
|
|
db60139845 | ||
|
|
cadefd323a | ||
|
|
baab88f42a | ||
|
|
767b74dd35 | ||
|
|
90e8287f43 | ||
|
|
d8b7e5b8fd | ||
|
|
7769447283 | ||
|
|
d6a790cf13 | ||
|
|
033c66363d | ||
|
|
3ff1789963 | ||
|
|
9737c0c4dd | ||
|
|
b201383a80 | ||
|
|
2253b82304 | ||
|
|
2581446d85 | ||
|
|
a6291b286c | ||
|
|
96a396bfcb | ||
|
|
0833a11686 | ||
|
|
9c7f7f3d32 | ||
|
|
7847fe8074 | ||
|
|
c57d25ac51 | ||
|
|
1341b5b9f8 | ||
|
|
fb54e9e103 | ||
|
|
3a835dde7d | ||
|
|
128a4a36ca | ||
|
|
255bb6dd07 | ||
|
|
786b1e3a30 | ||
|
|
d5f38a558e | ||
|
|
ce5d4b7db8 | ||
|
|
8c0b36fe9e | ||
|
|
c7e6459c64 | ||
|
|
86e31e696d | ||
|
|
be0b1bb994 | ||
|
|
03e74bfeb4 | ||
|
|
972223cd50 | ||
|
|
761b7b9354 | ||
|
|
6a3d1895d9 | ||
|
|
d1178a26ce | ||
|
|
8ffdfa3cb1 | ||
|
|
384e56b9b4 | ||
|
|
d198e962b0 | ||
|
|
0136fdadbb | ||
|
|
c616568830 | ||
|
|
995d2c1ede | ||
|
|
051a5e9a38 | ||
|
|
60d89097de | ||
|
|
6c35255549 | ||
|
|
c985d8846d | ||
|
|
9a8ab26381 | ||
|
|
711622fd5b | ||
|
|
96474823b5 | ||
|
|
bbf4b54613 | ||
|
|
9795c5dd6b | ||
|
|
addcace80d | ||
|
|
77e43a5fa8 | ||
|
|
b751188e56 | ||
|
|
1ad9a15864 | ||
|
|
d0d7878e0a | ||
|
|
be5d365348 | ||
|
|
a8e0002a64 | ||
|
|
bf75cf7225 | ||
|
|
c024b680bc | ||
|
|
c896475765 | ||
|
|
101fdb3598 | ||
|
|
b13505afdf | ||
|
|
9d96b171a0 | ||
|
|
8b5a0cde69 | ||
|
|
bed7593cdd | ||
|
|
9fed946567 | ||
|
|
4d0bc0ae39 | ||
|
|
f9824aa7de | ||
|
|
4d2522964a | ||
|
|
dbe4a59b8e | ||
|
|
918f8a3ed4 | ||
|
|
f645596606 | ||
|
|
d778dd081d | ||
|
|
f6ed02c3fb | ||
|
|
7fa5dd7a35 | ||
|
|
a3186af099 | ||
|
|
a2d95ac742 | ||
|
|
10715bbea7 | ||
|
|
89fcb12556 | ||
|
|
cc3d7ddee5 | ||
|
|
cc01f99acb | ||
|
|
62b75190bb | ||
|
|
520124c1be | ||
|
|
e251bfcbaf | ||
|
|
aef809348f | ||
|
|
2d4a8774b8 | ||
|
|
b55c8fd828 |
@@ -2,6 +2,7 @@ Makefile
|
||||
Makefile.in
|
||||
SimGear.spec
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
|
||||
16
Doxyfile
16
Doxyfile
@@ -22,7 +22,7 @@ PROJECT_NAME = SimGear
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.0.17
|
||||
PROJECT_NUMBER = 0.3.2
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
@@ -64,14 +64,14 @@ EXTRACT_STATIC = NO
|
||||
# various overviews, but no documentation section is generated.
|
||||
# This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
|
||||
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
||||
# undocumented classes that are normally visible in the class hierarchy.
|
||||
# If set to NO (the default) these class will be included in the various
|
||||
# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
|
||||
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
|
||||
# include brief member descriptions after the members that are listed in
|
||||
@@ -298,6 +298,7 @@ WARN_LOGFILE =
|
||||
# with spaces.
|
||||
|
||||
INPUT = \
|
||||
DoxygenMain.cxx \
|
||||
simgear/bucket \
|
||||
simgear/compiler.h \
|
||||
simgear/constants.h \
|
||||
@@ -308,12 +309,11 @@ INPUT = \
|
||||
simgear/math \
|
||||
simgear/misc \
|
||||
simgear/route \
|
||||
simgear/scene \
|
||||
simgear/screen \
|
||||
simgear/serial \
|
||||
simgear/sg_inlines.h \
|
||||
simgear/sg_traits.hxx \
|
||||
simgear/sg_zlib.h \
|
||||
simgear/sky \
|
||||
simgear/threads \
|
||||
simgear/timing \
|
||||
simgear/xml
|
||||
@@ -335,7 +335,7 @@ RECURSIVE = YES
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = simgear/metakit simgear/zlib
|
||||
EXCLUDE = simgear/scene/sky/clouds3d
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
||||
@@ -385,7 +385,7 @@ FILTER_SOURCE_FILES = NO
|
||||
# of all compounds will be generated. Enable this if the project
|
||||
# contains a lot of classes, structs, unions or interfaces.
|
||||
|
||||
ALPHABETICAL_INDEX = NO
|
||||
ALPHABETICAL_INDEX = YES
|
||||
|
||||
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
|
||||
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
||||
@@ -514,7 +514,7 @@ COMPACT_LATEX = NO
|
||||
# by the printer. Possible values are: a4, a4wide, letter, legal and
|
||||
# executive. If left blank a4wide will be used.
|
||||
|
||||
PAPER_TYPE = a4wide
|
||||
PAPER_TYPE = letter
|
||||
|
||||
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
|
||||
# packages that should be included in the LaTeX output.
|
||||
|
||||
78
DoxygenMain.cxx
Normal file
78
DoxygenMain.cxx
Normal file
@@ -0,0 +1,78 @@
|
||||
/* This is a dummy code file that only contains doxygen main page
|
||||
documentation. It has a .cxx extension so that emacs will happily
|
||||
autoindent correctly. */
|
||||
|
||||
/** \mainpage SimGear
|
||||
* Simulation, Visualization, and Game development libraries.
|
||||
|
||||
* \section intro Introduction
|
||||
*
|
||||
* SimGear is a collection of libraries which provide a variety of
|
||||
* functionality useful for building simulations, visualizations, and
|
||||
* even games. All the SimGear code is designed to be portable across
|
||||
* a wide variety of platforms and compilers. It has primarily been
|
||||
* developed in support of the FlightGear project, but as development
|
||||
* moves forward, we are generalizing the code to make more of it
|
||||
* useful for other types of applications.
|
||||
*
|
||||
* Some of the functionality provide includes
|
||||
*
|
||||
* - Compiler and platform abstractions for many tricky differences.
|
||||
* - A whole earth tiling/indexing scheme.
|
||||
* - A console debugging output scheme that tracks severity and
|
||||
* category that can be completely compiled out for a final build release.
|
||||
* - Code to manage "real" time and time zones.
|
||||
* - Code to calculate accurate positions of sun, moon, stars, and
|
||||
* planets for a given time, date, season, earth location, etc.
|
||||
* - Simple serial, file, and network I/O abstractions
|
||||
* - Code to calculate magnetic variation.
|
||||
* - A variety of coordinate conversion, vector, matrix type math routines.
|
||||
* - An abstraction to hide platform dependent path naming schemes.
|
||||
* - A C++ streams wrapper to handle compress input/output streams.
|
||||
* - An optimized "property manager" which associates ascii property
|
||||
* names with their corresponding value. This can be a great way to build
|
||||
* loose linkages between modules, or build linkages/connections that can
|
||||
* be determined from config files or at runtime.
|
||||
* - Scene management and drawing routines:
|
||||
* - material property management
|
||||
* - object management
|
||||
* - terrain tile management and paging
|
||||
* - sky dome rendering (with ephemeral objects)
|
||||
* - Code to handle screen dumps (and ultra-hires tile rendered screen dumps)
|
||||
* - A sound effects manager.
|
||||
* - A threading abstraction.
|
||||
* - A simple but highly functional XML parser that interfaces nicely
|
||||
* with the property manager.
|
||||
|
||||
* \section supports Supported Platforms
|
||||
* SimGear has been built on the following platforms:
|
||||
*
|
||||
* - Linux (x86)
|
||||
* - Windows (MSVC, Cygwin, Mingwin)
|
||||
* - SGI (native compilers)
|
||||
* - Mac OS X
|
||||
* - FreeBSD
|
||||
|
||||
* \section depends Dependencies
|
||||
*
|
||||
* SimGear depends on several other open source packages. These must
|
||||
* be installed before SimGear can be installed:
|
||||
*
|
||||
* - glut and opengl
|
||||
* - plib (http://plib.sf.net)
|
||||
* - metakit
|
||||
* - zlib
|
||||
* - libjpeg (optional)
|
||||
* - pthread (optional)
|
||||
|
||||
* \section license Licensing
|
||||
*
|
||||
* SimGear is licensed under the terms of the LGPL
|
||||
|
||||
* \section install Installation
|
||||
*
|
||||
* \subsection step1 Step 1: Opening the box
|
||||
*
|
||||
* etc...
|
||||
*/
|
||||
|
||||
16
Makefile.am
16
Makefile.am
@@ -1,15 +1,17 @@
|
||||
EXTRA_DIST = \
|
||||
acsite.m4 \
|
||||
acconfig.h \
|
||||
mksymlinks.sh \
|
||||
acinclude.m4 \
|
||||
autogen.sh \
|
||||
DoxygenMain.cxx
|
||||
README.MSVC \
|
||||
README.metakit \
|
||||
README.zlib \
|
||||
SimGear.dsp \
|
||||
SimGear.dsw \
|
||||
metakit-2.4.2-32.tar.gz \
|
||||
zlib-1.1.3.tar.gz
|
||||
SimGear.dsw
|
||||
|
||||
SUBDIRS = simgear
|
||||
SUBDIRS = src-libs simgear
|
||||
|
||||
dist-hook:
|
||||
(cd $(top_srcdir); $(HOME)/projects/FlightGear-0.7/admin/am2dsp.pl)
|
||||
|
||||
#
|
||||
# Rule to build RPM distribution package
|
||||
|
||||
110
NEWS
110
NEWS
@@ -1,10 +1,106 @@
|
||||
New in 0.3.2
|
||||
* June 2, 2003
|
||||
|
||||
* Moved quite a bit of low level model management and "state"
|
||||
management code from FlightGear into SimGear and did a substantial
|
||||
amount of restructuring and dependency clean up in the process.
|
||||
Created a "scene" subdirectory with sub-subdirectories for material
|
||||
management, basic model and model animation management, sky
|
||||
rendering, and low level loaders for the "TerraGear" tile object format.
|
||||
* Removed support of the flat shaded and non-textured material
|
||||
property varients. You can still do these things, but extra states
|
||||
are no longer set up automatically.
|
||||
* Removed 3d clouds from the default build ... these need a maintainer
|
||||
or better yet, a complete plib-based rewrite.
|
||||
* Moved the FlightGear sound effect manager code over to SimGear.
|
||||
* Updated the cloud layer surface to better follow the inverted bowl
|
||||
shape.
|
||||
* Much work on cloud/sky coloring, and also much work on
|
||||
sunset/sunrise coloring.
|
||||
* Fixed an obscure bug in cloud texture loading which caused each
|
||||
cloud texture to be loaded 5 times. Ouch!
|
||||
* Various class and function renaming to make them better fit into the
|
||||
standard SimGear naming scheme.
|
||||
* Added some additional convenience functions to the SGPath class.
|
||||
* Upgraded the distributed version of metakit.
|
||||
* FreeBSD fixes.
|
||||
* Irix fixes (better STL/ISO C++ header support.)
|
||||
* Mingwin fixes.
|
||||
* Better MacOS support
|
||||
* MSVC fixes.
|
||||
|
||||
|
||||
New in 0.3.1
|
||||
* December 4, 2002
|
||||
|
||||
* Fix a major packaging blunder with several missing files.
|
||||
|
||||
|
||||
New in 0.3.0
|
||||
* December 3, 2002
|
||||
|
||||
* removed interpreter subdir
|
||||
* NOMINAX fix for Cygwin/gcc-3.2
|
||||
* Added some prototype 3d clouds based on Mark Harris's demos.
|
||||
* Simplified the command manager interface
|
||||
* Allow an "include" attribute on root PropertyList element.
|
||||
|
||||
|
||||
New in 0.2.0
|
||||
* September 6, 2002
|
||||
|
||||
* Modernized the autoconf/make scripts, plus lots of tweaks and enhancements.
|
||||
* Removed efence support (in favor of valgrind.)
|
||||
|
||||
* Added a javascript interpreter.
|
||||
* SGSocket reimplimented on top of plib/net libs.
|
||||
* Added a new random number generation algorithm.
|
||||
* Total rewrite of the strutils package.
|
||||
|
||||
* Patch for the random number seed.
|
||||
* IA-64 w/ Intel compiler fixes.
|
||||
* MSVC/MINGW fixes.
|
||||
* Mac OS X fixes.
|
||||
* Irix fixes.
|
||||
* Code clean ups to remove warning messages.
|
||||
* Optimizations in sg_binobj to reduce the amout of memory copying
|
||||
needed when loading a binobj format file.
|
||||
* Fixed a couple places where variables could be used before they were
|
||||
initialized.
|
||||
* Various property manager fixes and improvements.
|
||||
* Fixes to cloud layer management code.
|
||||
* Made the sky dome more flexible to facilitate use in other applications.
|
||||
|
||||
|
||||
New in 0.0.18
|
||||
* April 20, 2002
|
||||
|
||||
* Created a src/libs subdirectory for several packages that need to be
|
||||
installed by the user but are used by many other packages and may already
|
||||
be installed. So we just bundle the source separately as a convenience
|
||||
if the user needs to build and install these.
|
||||
* Upgrade to zlib-1.1.4 (security fix)
|
||||
* Upgrade to metakit-2.4.2-32.tar.gz (latest upstream release)
|
||||
* Added support for point objects in the scenery file format.
|
||||
* Additions to the binary file format to make it *much* more flexible.
|
||||
For each major primative type: points, triangles, fans, and strips, you
|
||||
can specify an index list of vertices, normals, colors, and texture
|
||||
coordinates. You can skip any of these you like to save on space.
|
||||
* Added support for new file features in the binary -> ascii scenery file
|
||||
decoder.
|
||||
* Various code clean ups.
|
||||
* Separate XML I/O operations into a separate header file.
|
||||
* Major property manager rewrite, then lots of followup cleaning and
|
||||
improvements.
|
||||
|
||||
|
||||
New in 0.0.17 (final)
|
||||
* February 16, 2002
|
||||
|
||||
* Converted some cout's to SG_LOG's.
|
||||
* xplicitely reset the glBlendFunc() after drawing the moon for the
|
||||
* Explicitely reset the glBlendFunc() after drawing the moon for the
|
||||
Voodoo2 linux driver since it seems to have a bug in glPopAttrib().
|
||||
|
||||
|
||||
New in 0.0.17pre2
|
||||
* February 13, 2002
|
||||
|
||||
@@ -60,6 +156,7 @@ New in 0.0.16
|
||||
ultra-hires tiled screen dumps suitable for large format printers.
|
||||
(Norman Vine)
|
||||
|
||||
|
||||
New in 0.0.15
|
||||
* June 20, 2001
|
||||
* Various bug fixes, tweaks, and optimizations.
|
||||
@@ -88,6 +185,7 @@ New in 0.0.15
|
||||
* Fixed some critical null pointer bugs in property manager.
|
||||
* Magnetic variation can now be fetched for any arbitrary location.
|
||||
|
||||
|
||||
New in 0.0.14
|
||||
* December 14, 2000
|
||||
* Added a module to manage waypoints and routes, calculate bearing and
|
||||
@@ -109,6 +207,7 @@ New in 0.0.14
|
||||
* MacOS tweaks.
|
||||
* FreeBSD tweaks.
|
||||
|
||||
|
||||
New in 0.0.13
|
||||
* September 14, 2000
|
||||
* Added support for reading and writing xml files (easyxml)
|
||||
@@ -119,6 +218,7 @@ New in 0.0.13
|
||||
* MacOS tweaks.
|
||||
* MSVC tweaks.
|
||||
|
||||
|
||||
New in 0.0.12
|
||||
* July 19, 2000
|
||||
* Converted project license from GPL to LGPL.
|
||||
@@ -128,6 +228,7 @@ New in 0.0.12
|
||||
* Added a property manager (registry)
|
||||
* Some documentation added.
|
||||
|
||||
|
||||
New in 0.0.11
|
||||
* July 3, 2000
|
||||
* Replaced gdbm with metakit
|
||||
@@ -136,6 +237,7 @@ New in 0.0.11
|
||||
* MSVC5 fixes
|
||||
* Math/bucket/tiling tweaks from Norman Vine
|
||||
|
||||
|
||||
New in 0.0.7
|
||||
* March 29, 2000
|
||||
* Added support for RedHat package building contributed by Habibie
|
||||
@@ -148,18 +250,22 @@ New in 0.0.7
|
||||
* Optimizations and bullet proofing of magnetic variation code by Norman
|
||||
Vine and Ed Williams
|
||||
|
||||
|
||||
New in 0.0.6
|
||||
* March 27, 2000
|
||||
* Added Nima World Magnetic Model 2000 contributed by Ed Williams
|
||||
* Fixes for MSVC++
|
||||
|
||||
|
||||
New in 0.0.5
|
||||
* March 17, 2000
|
||||
* Restructured directory layout to facilitate windows/mac IDE builds.
|
||||
|
||||
|
||||
New in 0.0.4
|
||||
* Removed mat3.h and friends (we now use plib's sg lib for these sorts of
|
||||
things.)
|
||||
|
||||
|
||||
New in 0.0.3
|
||||
* Release that conincides with FlightGear-0.7.2
|
||||
|
||||
24
README.MSVC
Normal file
24
README.MSVC
Normal file
@@ -0,0 +1,24 @@
|
||||
This document describes how to build SimGear using the supplied workspace and
|
||||
project files.
|
||||
|
||||
Unpack the SimGear source file into your work directory. This creates a new
|
||||
subdirectory called SimGear-X.Y.Z. Rename this to SimGear. Before we can
|
||||
build SimGear you must unpack and build the third party libraries metakit and
|
||||
zlib. Sources for these are included in the SimGear/src-libs directory.
|
||||
Unpack these into the top level SimGear directory. At this point your
|
||||
directory structure should look something like this:
|
||||
|
||||
<work_dir>/
|
||||
SimGear/
|
||||
metakit-x.y.z/
|
||||
simgear/
|
||||
src-libs/
|
||||
zlib-x.y.z/
|
||||
|
||||
Now open the SimGear workspace. This workspace file contains projects for
|
||||
building metakit(mklib), SimGear and zlib. Select each project as the active
|
||||
project and build all. Order is unimportant since there are no dependencies
|
||||
between the projects.
|
||||
|
||||
The workspace and project files are generated by a perl script with extra
|
||||
input from the am2dsp.cfg file.
|
||||
@@ -1,6 +1,6 @@
|
||||
For your convenience (and with the author's permission) a copy of the
|
||||
MetaKit source is bundled with SimGear. You must have metakit
|
||||
installed before you can build SimGear.
|
||||
MetaKit source is bundled with SimGear in $(top_srcdir)/src-libs/.
|
||||
You must have metakit installed before you can build SimGear.
|
||||
|
||||
- Most linux distributions have a metakit package. For linux
|
||||
developers, we recommend ysou install your distributions package
|
||||
|
||||
16
README.plib
Normal file
16
README.plib
Normal file
@@ -0,0 +1,16 @@
|
||||
[This file is mirrored in both the FlightGear and SimGear packages.]
|
||||
|
||||
You *must* have plib version 1.6.0 or later installed on your system
|
||||
to build FlightGear!" Flight Gear is no longer compatible with the
|
||||
earlier versions of the library.
|
||||
|
||||
You can get the latest version of plib from:
|
||||
|
||||
http://plib.sourceforge.net
|
||||
|
||||
Build notes:
|
||||
|
||||
You should be able to just run "./configure" to configure the package
|
||||
and use all of plib's defaults. Then run "make" followed by "make
|
||||
install". By default, plib installs itself into /usr so if you don't
|
||||
like this, be sure to specify an alternate prefix such as --prefix=/usr/local
|
||||
66
README.zlib
66
README.zlib
@@ -1,7 +1,7 @@
|
||||
For your convenience and allowed by zlib's license terms:
|
||||
http://www.gzip.org/zlib/zlib_license.html a copy of the zlib source
|
||||
is bundled with SimGear. You must have zlib installed before you can
|
||||
build SimGear.
|
||||
is bundled with SimGear in $(top_srcdir)/src-libs/. You must have
|
||||
zlib installed before you can build SimGear.
|
||||
|
||||
- Most linux distributions have a zlib package. For linux
|
||||
developers, we recommend ysou install your distributions package
|
||||
@@ -23,10 +23,11 @@ We now send you to the official zlib README ...
|
||||
|
||||
=============================================================================
|
||||
|
||||
zlib 1.1.3 is a general purpose data compression library. All the code
|
||||
|
||||
zlib 1.1.4 is a general purpose data compression library. All the code
|
||||
is thread safe. The data format used by the zlib library
|
||||
is described by RFCs (Request for Comments) 1950 to 1952 in the files
|
||||
ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
|
||||
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
|
||||
format) and rfc1952.txt (gzip format). These documents are also available in
|
||||
other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
|
||||
|
||||
@@ -39,51 +40,50 @@ except example.c and minigzip.c.
|
||||
|
||||
To compile all files and run the test program, follow the instructions
|
||||
given at the top of Makefile. In short "make test; make install"
|
||||
should work for most machines. For Unix: "configure; make test; make install"
|
||||
should work for most machines. For Unix: "./configure; make test; make install"
|
||||
For MSDOS, use one of the special makefiles such as Makefile.msc.
|
||||
For VMS, use Make_vms.com or descrip.mms.
|
||||
|
||||
Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov>, or to
|
||||
Questions about zlib should be sent to <zlib@gzip.org>, or to
|
||||
Gilles Vollant <info@winimage.com> for the Windows DLL version.
|
||||
The zlib home page is http://www.cdrom.com/pub/infozip/zlib/
|
||||
The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/
|
||||
Before reporting a problem, please check those sites to verify that
|
||||
The zlib home page is http://www.zlib.org or http://www.gzip.org/zlib/
|
||||
Before reporting a problem, please check this site to verify that
|
||||
you have the latest version of zlib; otherwise get the latest version and
|
||||
check whether the problem still exists or not.
|
||||
|
||||
Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997
|
||||
PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html
|
||||
before asking for help.
|
||||
|
||||
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
|
||||
issue of Dr. Dobb's Journal; a copy of the article is available in
|
||||
http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
|
||||
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
|
||||
|
||||
The changes made in version 1.1.3 are documented in the file ChangeLog.
|
||||
The main changes since 1.1.2 are:
|
||||
The changes made in version 1.1.4 are documented in the file ChangeLog.
|
||||
The only changes made since 1.1.3 are bug corrections:
|
||||
|
||||
- fix "an inflate input buffer bug that shows up on rare but persistent
|
||||
occasions" (Mark)
|
||||
- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
|
||||
- fix gzseek(..., SEEK_SET) in write mode
|
||||
- fix crc check after a gzeek (Frank Faubert)
|
||||
- fix miniunzip when the last entry in a zip file is itself a zip file
|
||||
(J Lillge)
|
||||
- add contrib/asm586 and contrib/asm686 (Brian Raiter)
|
||||
See http://www.muppetlabs.com/~breadbox/software/assembly.html
|
||||
- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
|
||||
- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
|
||||
- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
|
||||
- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
|
||||
- added a FAQ file
|
||||
- ZFREE was repeated on same allocation on some error conditions.
|
||||
This creates a security problem described in
|
||||
http://www.zlib.org/advisory-2002-03-11.txt
|
||||
- Returned incorrect error (Z_MEM_ERROR) on some invalid data
|
||||
- Avoid accesses before window for invalid distances with inflate window
|
||||
less than 32K.
|
||||
- force windowBits > 8 to avoid a bug in the encoder for a window size
|
||||
of 256 bytes. (A complete fix will be available in 1.1.5).
|
||||
|
||||
The beta version 1.1.5beta includes many more changes. A new official
|
||||
version 1.1.5 will be released as soon as extensive testing has been
|
||||
completed on it.
|
||||
|
||||
plus many changes for portability.
|
||||
|
||||
Unsupported third party contributions are provided in directory "contrib".
|
||||
|
||||
A Java implementation of zlib is available in the Java Development Kit 1.1
|
||||
A Java implementation of zlib is available in the Java Development Kit
|
||||
http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
|
||||
See the zlib home page http://www.cdrom.com/pub/infozip/zlib/ for details.
|
||||
See the zlib home page http://www.zlib.org for details.
|
||||
|
||||
A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk>
|
||||
is in the CPAN (Comprehensive Perl Archive Network) sites, such as:
|
||||
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
|
||||
is in the CPAN (Comprehensive Perl Archive Network) sites
|
||||
http://www.cpan.org/modules/by-module/Compress/
|
||||
|
||||
A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
|
||||
is available in Python 1.5 and later versions, see
|
||||
@@ -142,7 +142,7 @@ Acknowledgments:
|
||||
|
||||
Copyright notice:
|
||||
|
||||
(C) 1995-1998 Jean-loup Gailly and Mark Adler
|
||||
(C) 1995-2002 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
905
SimGear.dsp
905
SimGear.dsp
File diff suppressed because it is too large
Load Diff
24
SimGear.dsw
24
SimGear.dsw
@@ -15,6 +15,30 @@ Package=<4>
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "mklib"=".\SimGear\metakit-2.4.3\win\msvc60\mklib.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "zlib"=".\SimGear\zlib.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
|
||||
1
TODO
Normal file
1
TODO
Normal file
@@ -0,0 +1 @@
|
||||
03/25/2001 - Resolve location of Sky dome implimentation documentation.
|
||||
327
acconfig.h
327
acconfig.h
@@ -1,327 +0,0 @@
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define if type char is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
#undef __CHAR_UNSIGNED__
|
||||
#endif
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
#undef CLOSEDIR_VOID
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
#undef DGUX
|
||||
|
||||
/* Define if you have <dirent.h>. */
|
||||
#undef DIRENT
|
||||
|
||||
/* Define to enable audio support */
|
||||
#undef ENABLE_AUDIO_SUPPORT
|
||||
|
||||
/* Define to enable GLUT joystick support (limited to 3 axes) */
|
||||
#undef ENABLE_GLUT_JOYSTICK
|
||||
|
||||
/* Define to enable plib joystick support (recommended) */
|
||||
#undef ENABLE_PLIB_JOYSTICK
|
||||
|
||||
/* Define to eliminate all trace of debugging messages such as for a
|
||||
release build */
|
||||
#undef FG_NDEBUG
|
||||
|
||||
/* Define to include Oliver's networking support */
|
||||
#undef FG_NETWORK_OLK
|
||||
|
||||
/* Define to avoid Christian's new weather code */
|
||||
#undef FG_OLD_WEATHER
|
||||
|
||||
/* Define if we are building FGFS (should always be defined) */
|
||||
#undef FGFS
|
||||
|
||||
/* Define to enable 3dfx/glide render in a window hack under unix.
|
||||
This probably won't work under windows. */
|
||||
#undef XMESA
|
||||
#undef FX
|
||||
|
||||
/* Define to the type of elements in the array set by `getgroups'.
|
||||
Usually this is either `int' or `gid_t'. */
|
||||
#undef GETGROUPS_T
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
#undef GETLOADAVG_PRIVILEGED
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
#undef GETPGRP_VOID
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you external variables daylight. */
|
||||
#undef HAVE_DAYLIGHT
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if your system has a working fnmatch function. */
|
||||
#undef HAVE_FNMATCH
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
#undef HAVE_GETLOADAVG
|
||||
|
||||
/* Define if you have getrusage() */
|
||||
#undef HAVE_GETRUSAGE
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
#undef HAVE_GETMNTENT
|
||||
|
||||
/* Define if you have the gpc library and headers installed. */
|
||||
#undef HAVE_GPC_H
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#undef HAVE_LONG_FILE_NAMES
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||
|
||||
/* Define if you have rint() which rounds to closest int but returns
|
||||
result as a double data type. */
|
||||
#undef HAVE_RINT
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#undef HAVE_ST_BLOCKS
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#undef HAVE_STRCOLL
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#undef HAVE_ST_RDEV
|
||||
|
||||
/* Define if you have the stdint.h include. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
|
||||
/* Define if you have <sys/param.h> */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have <sys/stat.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have timegm() */
|
||||
#undef HAVE_TIMEGM
|
||||
|
||||
/* Define if you external variables timezone. */
|
||||
#undef HAVE_TIMEZONE
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
#undef HAVE_TM_ZONE
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#undef HAVE_TZNAME
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define if int is 16 bits instead of 32. */
|
||||
#undef INT_16_BITS
|
||||
|
||||
/* Define if long int is 64 bits. */
|
||||
#undef LONG_64_BITS
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <mkdev.h>. */
|
||||
#undef MAJOR_IN_MKDEV
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
|
||||
#undef MAJOR_IN_SYSMACROS
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef mode_t
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <ndir.h>. */
|
||||
#undef NDIR
|
||||
|
||||
/* Define if you have <memory.h>, and <string.h> doesn't declare the
|
||||
mem* functions. */
|
||||
#undef NEED_MEMORY_H
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
#undef NLIST_NAME_UNION
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
#undef NLIST_STRUCT
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to package name */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if the `setpgrp' function takes no argument. */
|
||||
#undef SETPGRP_VOID
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
#undef SVR4
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
|
||||
#undef SYSDIR
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
|
||||
#undef SYSNDIR
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
#undef UMAX
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
#undef UMAX4_3
|
||||
|
||||
/* Define if you do not have <strings.h>, index, bzero, etc.. */
|
||||
#undef USG
|
||||
|
||||
/* Define to version number */
|
||||
#undef VERSION
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
#undef vfork
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
#undef VOID_CLOSEDIR
|
||||
|
||||
/* Define if compiling on a Winbloze (95, NT, etc.) platform */
|
||||
#undef WIN32
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
||||
|
||||
@@ -102,7 +102,7 @@ for exdir in $exdirs ; do
|
||||
mylibdir="${exdir}/lib${subexdir}"
|
||||
wi_EXTRA_LDIR($mylibdir)
|
||||
|
||||
progdir="${exdir}/bin${subexdirr}"
|
||||
progdir="${exdir}/bin${subexdir}"
|
||||
wi_EXTRA_PDIR($progdir)
|
||||
fi
|
||||
done
|
||||
23
am2dsp.cfg
23
am2dsp.cfg
@@ -1,40 +1,39 @@
|
||||
type = StaticLibrary,Multithreaded,
|
||||
exclude_dir = threads
|
||||
|
||||
include_path = .
|
||||
include_path = ..
|
||||
include_path = .\SimGear
|
||||
#include_path = \usr\include
|
||||
include_path = .\SimGear\metakit-2.4.3\include
|
||||
include_path = ..\SimGear\zlib-1.1.4
|
||||
|
||||
define = HAVE_CONFIG_H
|
||||
|
||||
#add_project = .\SimGear\simgear\metakit\win\msvc60\mklib.dsp
|
||||
add_project = .\SimGear\metakit-2.4.3\win\msvc60\mklib.dsp,mklib
|
||||
add_project = .\SimGear\zlib.dsp,zlib
|
||||
|
||||
# Rule to create simgear_config.h
|
||||
add_source_file = \
|
||||
# Begin Source File\
|
||||
add_source_file = SOURCE=.\simgear\simgear_config.h.vc5\
|
||||
\
|
||||
SOURCE = .\simgear\simgear_config.h.vc5\
|
||||
\
|
||||
!IF "$(CFG)" == "FlightGear - Win32 Release"\
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"\
|
||||
\
|
||||
# Begin Custom Build - Creating config.h\
|
||||
InputPath=.\simgear\simgear_config.h.vc5\
|
||||
\
|
||||
".\simgear\simgear_config.h": $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\
|
||||
".\simgear\simgear_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\
|
||||
copy .\simgear\simgear_config.h.vc5 .\simgear\simgear_config.h\
|
||||
\
|
||||
# End Custom Build\
|
||||
\
|
||||
!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug"\
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"\
|
||||
\
|
||||
# Begin Custom Build - Creating config.h\
|
||||
InputPath=.\simgear\simgear_config.h.vc5\
|
||||
\
|
||||
".\simgear\simgear_config.h": $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\
|
||||
".\simgear\simgear_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\
|
||||
copy .\simgear\simgear_config.h.vc5 .\simgear\simgear_config.h\
|
||||
\
|
||||
# End Custom Build\
|
||||
\
|
||||
!ENDIF\
|
||||
\
|
||||
# End Source File
|
||||
|
||||
|
||||
45
autogen.sh
45
autogen.sh
@@ -2,45 +2,40 @@
|
||||
|
||||
OSTYPE=`uname -s`
|
||||
MACHINE=`uname -m`
|
||||
AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\-p[0-9]$//' | sed -e 's/\.//'`
|
||||
AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\.\([0-9]*\).*/\1/'`
|
||||
if test $AUTO_MAKE_VERSION -lt 15; then
|
||||
echo ""
|
||||
echo "You need to upgrade to automake version 1.5 or greater."
|
||||
echo "Most distributions have packages available to install or you can"
|
||||
echo "find the source for the most recent version at"
|
||||
echo "ftp://ftp.gnu.org/gnu/automake"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Host info: $OSTYPE $MACHINE"
|
||||
echo -n " automake: `automake --version | head -1 | awk '{print $4}'`"
|
||||
echo " ($AUTO_MAKE_VERSION)"
|
||||
echo ""
|
||||
|
||||
ACLOCAL_OPTS=""
|
||||
if [ $AUTO_MAKE_VERSION -ge 14 ]; then
|
||||
if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then echo " -I ."
|
||||
ACLOCAL_OPTS="-I ."
|
||||
fi
|
||||
fi
|
||||
echo "Running aclocal $ACLOCAL_OPTS"
|
||||
aclocal $ACLOCAL_OPTS
|
||||
echo "Running aclocal"
|
||||
aclocal
|
||||
|
||||
echo "Running autoheader"
|
||||
autoheader
|
||||
if [ ! -e simgear/simgear_config.h.in ]; then
|
||||
echo "ERROR: autoheader didn't create simgear/simgear_config.h.in!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "Running automake"
|
||||
if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then
|
||||
echo " --add-missing --include-deps"
|
||||
automake --add-missing --include-deps
|
||||
else
|
||||
echo " --add-missing"
|
||||
automake --add-missing
|
||||
fi
|
||||
echo "Running automake --add-missing"
|
||||
automake --add-missing
|
||||
|
||||
echo "Running autoconf"
|
||||
autoconf
|
||||
|
||||
# fixup Makefiles for Irix
|
||||
if test "$OSTYPE" = "IRIX" -o "$OSTYPE" = "IRIX64"; then
|
||||
echo "Fixing Makefiles for Irix"
|
||||
for n in `find . -name Makefile.in`; do \
|
||||
mv -f $n $n.ar-new; \
|
||||
sed 's/$(AR) cru /$(AR) -o /g' $n.ar-new > $n; \
|
||||
rm -f $n.ar-new; \
|
||||
done;
|
||||
if [ ! -e configure ]; then
|
||||
echo "ERROR: configure was not created!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
dnl Process this file with aclocal ; automake -a ; autoconf to produce a
|
||||
dnl working configure script.
|
||||
dnl Process this file with autoget.sh to produce a working configure
|
||||
dnl script.
|
||||
dnl
|
||||
dnl $Id$
|
||||
|
||||
AC_INIT(simgear/bucket/newbucket.cxx)
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx])
|
||||
|
||||
# Require at least automake 2.13
|
||||
AC_PREREQ(2.13)
|
||||
dnl Require at least automake 2.52
|
||||
AC_PREREQ(2.52)
|
||||
|
||||
dnl Initialize the automake stuff
|
||||
AM_INIT_AUTOMAKE(SimGear, 0.0.17pre2)
|
||||
AM_INIT_AUTOMAKE(SimGear, 0.3.2)
|
||||
|
||||
dnl Specify KAI C++ compiler and flags.
|
||||
dnl Borrowed with slight modification from blitz distribution.
|
||||
@@ -37,14 +38,23 @@ AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
|
||||
dnl set the $host variable based on local machine/os
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
dnl Used on the Irix platform
|
||||
AR="ar"
|
||||
OS=`uname -s`
|
||||
if test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then
|
||||
ARFLAGS="cru"
|
||||
case "${host}" in
|
||||
*-*-irix*)
|
||||
if test "$CXX" = "CC"; then
|
||||
AR="CC -ar"
|
||||
AC_SUBST(AR)
|
||||
ARFLAGS="-o"
|
||||
CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(AR)
|
||||
AC_SUBST(ARFLAGS)
|
||||
|
||||
if echo $includedir | egrep "simgear$" > /dev/null; then
|
||||
echo "includedir is" $includedir "libdir is" $libdir
|
||||
@@ -53,25 +63,10 @@ else
|
||||
echo "includedir changed to" $includedir "libdir is" $libdir
|
||||
fi
|
||||
|
||||
# Determine version of automake ... important because of
|
||||
# incompatibilities between versions
|
||||
AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\-p[[0-9]]$//' | sed -e 's/\.//'`
|
||||
AM_CONDITIONAL(ANCIENT_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 14)
|
||||
AM_CONDITIONAL(OLD_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 15)
|
||||
|
||||
# set logging default value
|
||||
# with_logging=yes
|
||||
dnl set logging; default value of with_logging=yes
|
||||
AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
|
||||
if test "x$with_logging" = "xno" ; then
|
||||
AC_DEFINE(FG_NDEBUG)
|
||||
fi
|
||||
|
||||
dnl specify if we are building with "electric fence"
|
||||
AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
|
||||
|
||||
if test "x$with_efence" = "xyes" ; then
|
||||
echo "Building with efence"
|
||||
LIBS="$LIBS -lefence"
|
||||
AC_DEFINE([FG_NDEBUG], 1, [Define for no logging output])
|
||||
fi
|
||||
|
||||
# Specify if we want to build with Norman's jpeg image server support.
|
||||
@@ -97,38 +92,26 @@ fi
|
||||
AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$with_jpeg_factory" = "xyes")
|
||||
|
||||
|
||||
dnl Check for MS Windows environment
|
||||
AC_CHECK_HEADER(windows.h)
|
||||
dnl Determine an extra directories to add to include/lib search paths
|
||||
case "${host}" in
|
||||
*-apple-darwin* | *-*-mingw32*)
|
||||
echo no EXTRA_DIRS for $host
|
||||
;;
|
||||
|
||||
AC_EGREP_CPP(yes,
|
||||
[#ifdef __MINGW32__
|
||||
yes
|
||||
#endif
|
||||
],is_mingw=yes, is_mingw=no)
|
||||
|
||||
echo "IS_MINGW = $is_mingw"
|
||||
AM_CONDITIONAL(IS_MINGW, test "x$is_mingw" = "xyes")
|
||||
|
||||
AC_EGREP_CPP(yes,
|
||||
[#ifdef __CYGWIN__
|
||||
yes
|
||||
#endif
|
||||
],is_cygwin=yes, is_cygwin=no)
|
||||
|
||||
echo "IS_CYGWIN = $is_cygwin"
|
||||
AM_CONDITIONAL(IS_CYGWIN, test "x$is_cygwin" = "xyes")
|
||||
|
||||
if test "x$HOSTTYPE" != "xmacintosh" -a "x$is_mingw" != "xyes"; then
|
||||
dnl extra library and include directories
|
||||
EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
|
||||
|
||||
if test -d /opt/X11R6 ; then
|
||||
EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
|
||||
*)
|
||||
if test -d /usr/X11R6 ; then
|
||||
EXTRA_DIR1="/usr/X11R6"
|
||||
fi
|
||||
fi
|
||||
if test -d /opt/X11R6 ; then
|
||||
EXTRA_DIR2="/opt/X11R6"
|
||||
fi
|
||||
EXTRA_DIRS="$EXTRA_DIR1 $EXTRA_DIR2"
|
||||
;;
|
||||
|
||||
esac
|
||||
wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
|
||||
|
||||
|
||||
dnl Using AM_CONDITIONAL is a step out of the protected little
|
||||
dnl automake fold so it is potentially dangerous. But, we are
|
||||
dnl beginning to run into cases where the standard checks are not
|
||||
@@ -136,14 +119,18 @@ dnl enough. AM_CONDITIONALS are then referenced to conditionally
|
||||
dnl build a Makefile.in from a Makefile.am which lets us define custom
|
||||
dnl includes, compile alternative source files, etc.
|
||||
|
||||
dnl Enable serial support on Unix type systems
|
||||
AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
|
||||
dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want
|
||||
dnl to use it if it is.
|
||||
case "${host}" in
|
||||
*-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
|
||||
echo no fancy X11 check
|
||||
;;
|
||||
|
||||
dnl X11 might be installed on Mac OS X, don't want to use it if it is.
|
||||
if test "x$HOSTTYPE" != "xmacintosh" ; then
|
||||
dnl Check for X11 (fancy)
|
||||
*)
|
||||
AC_PATH_XTRA
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
@@ -160,12 +147,74 @@ if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h
|
||||
CXXFLAGS="$CXXFLAGS -D_REENTRANT"
|
||||
CFLAGS="$CFLAGS -D_REENTRANT"
|
||||
fi
|
||||
if test "x$ac_cv_lib_pthread_pthread_exit" != "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
|
||||
dnl FreeBSD: System has pthread.h, but -lpthread library check
|
||||
dnl fails. See if we need -pthread instead of -lpthread and look
|
||||
dnl for the functions in libc_r.
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CXXFLAGS="-pthread $CXXFLAGS"
|
||||
CFLAGS="-pthread $FLAGS"
|
||||
save_LIBS=$LIBS
|
||||
AC_CHECK_LIB(c_r, pthread_exit)
|
||||
if test "x$ac_cv_lib_c_r_pthread_exit" != "xyes"; then
|
||||
CXXFLAGS=$save_CXXFLAGS
|
||||
CFLAGS=$save_CFLAGS
|
||||
else
|
||||
dnl This is cheating a bit. pthread_exit comes with using -pthread, not -lpthread
|
||||
ac_cv_lib_pthread_pthread_exit="yes"
|
||||
fi
|
||||
LIBS=$save_LIBS
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes")
|
||||
|
||||
AC_CHECK_LIB(socket, socket)
|
||||
|
||||
dnl X11 might be installed, but we don't want to use it for OSX -dw-
|
||||
if test "x$HOSTTYPE" != "xmacintosh" ; then
|
||||
dnl check for glut location
|
||||
AC_CHECK_HEADER(GL/glut.h)
|
||||
if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
|
||||
AC_DEFINE([GLUT_H], "GL/glut.h", [Define as glut.h include location])
|
||||
else
|
||||
AC_CHECK_HEADER(GLUT/glut.h)
|
||||
if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
|
||||
AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location])
|
||||
else
|
||||
echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl check for OpenGL related libraries
|
||||
case "${host}" in
|
||||
*-*-cygwin* | *-*-mingw32*)
|
||||
dnl CygWin under Windoze.
|
||||
|
||||
echo Win32 specific hacks...
|
||||
AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
|
||||
AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
|
||||
|
||||
LIBS="$LIBS -lglut32 -lglu32 -lopengl32"
|
||||
LIBS="$LIBS -luser32 -lgdi32 -lwinmm"
|
||||
|
||||
dnl add -lwsock32 for mingwin
|
||||
case "${host}" in
|
||||
*-*-mingw32*)
|
||||
base_LIBS="$base_LIBS -lws2_32"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Will link apps with $LIBS"
|
||||
;;
|
||||
|
||||
*-apple-darwin*)
|
||||
dnl Mac OS X
|
||||
|
||||
LIBS="$LIBS -framework GLUT -framework OpenGL -framework Carbon -lobjc"
|
||||
;;
|
||||
|
||||
*)
|
||||
dnl X-Windows based machines
|
||||
|
||||
AC_CHECK_LIB(X11, XCreateWindow)
|
||||
AC_CHECK_LIB(Xext, XShmCreateImage)
|
||||
AC_CHECK_LIB(Xi, XGetExtensionVersion)
|
||||
@@ -173,16 +222,7 @@ if test "x$HOSTTYPE" != "xmacintosh" ; then
|
||||
AC_CHECK_LIB(SM, SmcOpenConnection)
|
||||
AC_CHECK_LIB(Xt, XtMalloc)
|
||||
AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
|
||||
fi
|
||||
|
||||
dnl check for OpenGL related libraries
|
||||
|
||||
if test "x$HOSTTYPE" = "xmacintosh" ; then
|
||||
dnl Macintosh OSX
|
||||
LIBS="$LIBS -framework OpenGL -framework GLUT"
|
||||
elif test "x$ac_cv_header_windows_h" != "xyes" ; then
|
||||
dnl Reasonable stuff for X-Windows based machines
|
||||
|
||||
|
||||
AC_CHECK_LIB(GLcore, glNewList)
|
||||
if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
|
||||
dnl if no GLcore, check for GL
|
||||
@@ -200,8 +240,8 @@ elif test "x$ac_cv_header_windows_h" != "xyes" ; then
|
||||
if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
|
||||
AC_CHECK_HEADER(GL/fxmesa.h)
|
||||
if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
|
||||
AC_DEFINE( XMESA )
|
||||
AC_DEFINE( FX )
|
||||
AC_DEFINE([XMESA], 1, [Define for fxmesa])
|
||||
AC_DEFINE([FX], 1, [Define for fxmesa])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -211,62 +251,10 @@ elif test "x$ac_cv_header_windows_h" != "xyes" ; then
|
||||
AC_CHECK_LIB(MesaGLU, gluLookAt)
|
||||
fi
|
||||
|
||||
dnl check for glut
|
||||
AC_CHECK_LIB(glut, glutGetModifiers)
|
||||
LIBS="$LIBS -lglut"
|
||||
;;
|
||||
|
||||
dnl test for glutGameModeString, but avoid adding glut a second time into
|
||||
dnl the list of libraries
|
||||
save_LIBS="$LIBS"
|
||||
AC_CHECK_LIB(glut, glutGameModeString)
|
||||
LIBS="$save_LIBS"
|
||||
else
|
||||
dnl Win32 libs
|
||||
|
||||
echo Win32 specific hacks...
|
||||
AC_DEFINE(WIN32)
|
||||
|
||||
dnl force a failed check since we will be building under windoze
|
||||
AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
|
||||
|
||||
dnl just define these to true and hope for the best
|
||||
ac_cv_lib_glut_glutGetModifiers="yes"
|
||||
ac_cv_lib_glut_glutGameModeString="yes"
|
||||
|
||||
if test "x$with_sgi_opengl" = "xyes" ; then
|
||||
echo "Building with glut.dll, glu.dll, and opengl.dll"
|
||||
WIN32_GLUT=glut
|
||||
WIN32_GLU=glu
|
||||
WIN32_OPENGL=opengl
|
||||
else
|
||||
echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
|
||||
WIN32_GLUT=glut32
|
||||
WIN32_GLU=glu32
|
||||
WIN32_OPENGL=opengl32
|
||||
fi
|
||||
|
||||
LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
|
||||
LIBS="$LIBS -luser32 -lgdi32"
|
||||
if test "x$is_mingw" = "xyes" ; then
|
||||
EXTRA_DIRS="${EXTRA_DIRS}"
|
||||
fi
|
||||
echo "Will link apps with $LIBS"
|
||||
fi
|
||||
|
||||
if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
|
||||
echo
|
||||
echo "Unable to find the necessary OpenGL or GLUT libraries."
|
||||
echo "See config.log for automated test details and results ..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
|
||||
echo
|
||||
echo "Your version of glut doesn't support game mode."
|
||||
echo "You need to fetch and install the latest version of glut from:"
|
||||
echo
|
||||
echo " http://reality.sgi.com/opengl/glut3/glut3.html"
|
||||
exit 1
|
||||
fi
|
||||
esac
|
||||
|
||||
opengl_LIBS="$LIBS"
|
||||
LIBS="$base_LIBS"
|
||||
@@ -274,14 +262,21 @@ LIBS="$base_LIBS"
|
||||
AC_SUBST(base_LIBS)
|
||||
AC_SUBST(opengl_LIBS)
|
||||
|
||||
AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
|
||||
dnl Check for MS Windows environment
|
||||
AC_CHECK_HEADER(windows.h)
|
||||
AM_CONDITIONAL(EXTGL_NEEDED, test "x$ac_cv_header_windows_h" = "xyes")
|
||||
|
||||
# The following are C++ items that need to be tested for with the c++
|
||||
# compiler
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
|
||||
dnl Check for "plib" without which we cannot go on
|
||||
AC_CHECK_HEADER(plib/pu.h)
|
||||
if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
|
||||
AC_CHECK_HEADER(plib/ul.h)
|
||||
if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
|
||||
echo
|
||||
echo "You *must* have the plib library installed on your system to build"
|
||||
echo "the FGFS simulator!"
|
||||
echo "SimGear!"
|
||||
echo
|
||||
echo "Please see README.plib for more details."
|
||||
echo
|
||||
@@ -289,33 +284,105 @@ if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
|
||||
exit
|
||||
fi
|
||||
|
||||
dnl Check for system installed metakit
|
||||
AC_MSG_CHECKING([for plib 1.6.0 or newer])
|
||||
AC_TRY_RUN([
|
||||
#include <plib/ul.h>
|
||||
|
||||
#define MIN_PLIB_VERSION 160
|
||||
|
||||
int main() {
|
||||
int major, minor, micro;
|
||||
|
||||
if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
],
|
||||
AC_MSG_RESULT(yes),
|
||||
[AC_MSG_RESULT(wrong version);
|
||||
AC_MSG_ERROR([Install plib 1.6.0 or later first...])],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
dnl Check for MetaKit
|
||||
AC_CHECK_HEADER(mk4.h)
|
||||
if test "x$ac_cv_header_mk4_h" != "xyes"; then
|
||||
echo "Metakit not found, you will need to install this first."
|
||||
echo "Please read the README.metakit for more information."
|
||||
echo
|
||||
echo "MetaKit library not found."
|
||||
echo
|
||||
echo "If your OS does not provide an installable package for MetaKit"
|
||||
echo "you will have to compile and install it first yourself. A copy"
|
||||
echo "of metakit-$(VERSION).tar.gz is included with SimGear. You will"
|
||||
echo "have to untar this source code, and follow its included instructions"
|
||||
echo "to compile and install on your system."
|
||||
echo
|
||||
echo "configure aborted."
|
||||
exit
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for metakit 2.4.3 or newer])
|
||||
saved_LIBS="$LIBS"
|
||||
LIBS="$saved_LIBS -lmk4"
|
||||
AC_TRY_RUN([
|
||||
#include <mk4.h>
|
||||
|
||||
dnl Specify if we want logging (testing build) or not (release build)
|
||||
#define MIN_MK4_VERSION 243
|
||||
|
||||
int main() {
|
||||
int major, minor, micro;
|
||||
|
||||
if ( d4_MetaKitLibraryVersion < MIN_MK4_VERSION ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
],
|
||||
AC_MSG_RESULT(yes),
|
||||
[AC_MSG_RESULT(wrong version);
|
||||
AC_MSG_ERROR([
|
||||
|
||||
Install metakit 2.4.3 or later first.
|
||||
|
||||
Or, the compiler may not be finding your libmk4.so library.
|
||||
Please check the config.log file for specific details of the
|
||||
failure if you believe you have the correct metakit version.
|
||||
Also, look up this issue in the FlightGear FAQ.])],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
LIBS="$saved_LIBS"
|
||||
|
||||
AC_LANG_POP
|
||||
|
||||
dnl Check for system installed zlib
|
||||
AC_CHECK_HEADER(zlib.h)
|
||||
if test "x$ac_cv_header_zlib_h" != "xyes"; then
|
||||
echo "zlib not found, you will need to install this first."
|
||||
echo "Please read the README.zlib for more information."
|
||||
exit
|
||||
echo
|
||||
echo "zlib library not found."
|
||||
echo
|
||||
echo "If your OS does not provide an installable package for zlib"
|
||||
echo "you will have to compile and install it first yourself. A copy"
|
||||
echo "of zlib-1.1.4.tar.gz is included with SimGear. You will"
|
||||
echo "have to untar this source code, and follow its included instructions"
|
||||
echo "to compile and install on your system."
|
||||
echo
|
||||
echo "configure aborted."
|
||||
echo
|
||||
fi
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS( \
|
||||
fcntl.h getopt.h malloc.h memory.h stdint.h stdlib.h sys/param.h \
|
||||
sys/stat.h sys/time.h sys/timeb.h unistd.h windows.h winbase.h values.h )
|
||||
sys/stat.h sys/time.h sys/timeb.h unistd.h values.h )
|
||||
|
||||
if test "x$ac_cv_header_stdint_h" = "xyes"; then
|
||||
AC_DEFINE( HAVE_STDINT_H )
|
||||
AC_DEFINE([HAVE_STDINT_H], 1, [Define if stdint.h exists])
|
||||
fi
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
@@ -327,16 +394,19 @@ AC_STRUCT_TM
|
||||
dnl Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
|
||||
random setitimer getitimer signal GetLocalTime rint getrusage )
|
||||
AC_CHECK_FUNCS( \
|
||||
ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
|
||||
random drand48 setitimer getitimer signal GetLocalTime rint getrusage )
|
||||
|
||||
AM_CONFIG_HEADER(simgear/simgear_config.h)
|
||||
|
||||
AC_OUTPUT( \
|
||||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
||||
SimGear.spec \
|
||||
src-libs/Makefile \
|
||||
simgear/Makefile \
|
||||
simgear/version.h \
|
||||
simgear/compatibility/Makefile \
|
||||
simgear/bucket/Makefile \
|
||||
simgear/debug/Makefile \
|
||||
simgear/ephemeris/Makefile \
|
||||
@@ -345,17 +415,23 @@ AC_OUTPUT( \
|
||||
simgear/math/Makefile \
|
||||
simgear/metar/Makefile \
|
||||
simgear/misc/Makefile \
|
||||
simgear/props/Makefile \
|
||||
simgear/route/Makefile \
|
||||
simgear/scene/Makefile \
|
||||
simgear/scene/material/Makefile \
|
||||
simgear/scene/model/Makefile \
|
||||
simgear/scene/sky/Makefile \
|
||||
simgear/scene/tgdb/Makefile \
|
||||
simgear/screen/Makefile \
|
||||
simgear/serial/Makefile \
|
||||
simgear/sky/Makefile \
|
||||
simgear/sound/Makefile \
|
||||
simgear/threads/Makefile \
|
||||
simgear/timing/Makefile \
|
||||
simgear/xgl/Makefile \
|
||||
simgear/xml/Makefile \
|
||||
)
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
# AC_OUTPUT_COMMANDS([])
|
||||
|
||||
echo ""
|
||||
echo "Configure Summary"
|
||||
@@ -369,15 +445,16 @@ else
|
||||
echo "Debug messages: yes"
|
||||
fi
|
||||
|
||||
if test "x$with_efence" != "x"; then
|
||||
echo "Electric fence: $with_efence"
|
||||
else
|
||||
echo "Electric fence: no"
|
||||
fi
|
||||
|
||||
echo -n "Automake version: ($AUTO_MAKE_VERSION) "
|
||||
echo -n "Automake version: "
|
||||
automake --version | head -1
|
||||
|
||||
if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
|
||||
echo "With GL/glut.h"
|
||||
fi
|
||||
if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
|
||||
echo "With GLUT/glut.h"
|
||||
fi
|
||||
|
||||
if test "x$with_jpeg_factory" = "xyes"; then
|
||||
echo "With JPEG Factory support"
|
||||
else
|
||||
@@ -389,3 +466,4 @@ if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h
|
||||
else
|
||||
echo "Threads: no threads (pthread lib not found.)"
|
||||
fi
|
||||
|
||||
Binary file not shown.
@@ -1,42 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
echo ""
|
||||
echo "running $0 to rebuild simgear include links"
|
||||
|
||||
# toast the old directory
|
||||
rm -rf src/simgear
|
||||
mkdir src/simgear
|
||||
mkdir src/simgear/bucket
|
||||
mkdir src/simgear/debug
|
||||
mkdir src/simgear/math
|
||||
mkdir src/simgear/misc
|
||||
mkdir src/simgear/screen
|
||||
mkdir src/simgear/serial
|
||||
mkdir src/simgear/xgl
|
||||
mkdir src/simgear/zlib
|
||||
|
||||
# build new links
|
||||
ln -s ../include/compiler.h src/simgear/compiler.h
|
||||
ln -s ../include/constants.h src/simgear/constants.h
|
||||
ln -s ../include/fg_traits.hxx src/simgear/fg_traits.hxx
|
||||
ln -s ../include/fg_zlib.h src/simgear/fg_zlib.h
|
||||
ln -s ../include/version.h src/simgear/version.h
|
||||
|
||||
ln -s ../../bucket/newbucket.hxx src/simgear/bucket/newbucket.hxx
|
||||
|
||||
ln -s ../../debug/debug_types.h src/simgear/debug/debug_types.h
|
||||
ln -s ../../debug/logstream.hxx src/simgear/debug/logstream.hxx
|
||||
|
||||
ln -s ../../math/fg_memory.h src/simgear/math/fg_memory.h
|
||||
ln -s ../../math/fg_types.hxx src/simgear/math/fg_types.hxx
|
||||
ln -s ../../math/point3d.hxx src/simgear/math/point3d.hxx
|
||||
ln -s ../../math/polar3d.hxx src/simgear/math/polar3d.hxx
|
||||
|
||||
ln -s ../../misc/fgpath.hxx src/simgear/misc/fgpath.hxx
|
||||
ln -s ../../misc/fgstream.hxx src/simgear/misc/fgstream.hxx
|
||||
ln -s ../../misc/zfstream.hxx src/simgear/misc/zfstream.hxx
|
||||
|
||||
ln -s ../../xgl/xgl.h src/simgear/xgl/xgl.h
|
||||
|
||||
ln -s ../../zlib/zlib.h src/simgear/zlib/zlib.h
|
||||
ln -s ../../zlib/zconf.h src/simgear/zlib/zconf.h
|
||||
@@ -1,6 +1,8 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
simgear_config.h
|
||||
simgear_config.h.in
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
version.h
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
if ENABLE_UNIX_SERIAL
|
||||
SERIAL_DIRS = serial
|
||||
else
|
||||
SERIAL_DIRS =
|
||||
endif
|
||||
|
||||
if HAVE_THREADS
|
||||
SGTHREAD_DIR = threads
|
||||
else
|
||||
@@ -16,9 +10,10 @@ METAR_DIRS = metar
|
||||
EXTRA_DIST = simgear_config.h.vc5 version.h.in
|
||||
|
||||
include_HEADERS = \
|
||||
compiler.h constants.h sg_inlines.h sg_traits.hxx sg_zlib.h version.h
|
||||
compiler.h constants.h sg_inlines.h sg_traits.hxx version.h
|
||||
|
||||
SUBDIRS = \
|
||||
compatibility \
|
||||
xml \
|
||||
debug \
|
||||
misc \
|
||||
@@ -28,11 +23,14 @@ SUBDIRS = \
|
||||
magvar \
|
||||
math \
|
||||
$(METAR_DIRS) \
|
||||
props \
|
||||
route \
|
||||
scene \
|
||||
screen \
|
||||
$(SERIAL_DIRS) \
|
||||
sky \
|
||||
serial \
|
||||
sound \
|
||||
$(SGTHREAD_DIR) \
|
||||
timing \
|
||||
xgl
|
||||
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
|
||||
@@ -14,8 +14,4 @@ libsgbucket_a_SOURCES = newbucket.cxx
|
||||
# $(top_builddir)/bucket/libsgbucket.a \
|
||||
# $(top_builddir)/misc/libsgmisc.a
|
||||
|
||||
if OLD_AUTOMAKE
|
||||
INCLUDES += -I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <simgear_config.h>
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
|
||||
@@ -54,10 +54,7 @@ SG_USING_STD(fabs);
|
||||
#include STL_STRING
|
||||
|
||||
SG_USING_STD(string);
|
||||
|
||||
#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
|
||||
SG_USING_STD(ostream);
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
|
||||
2
simgear/compatibility/.cvsignore
Normal file
2
simgear/compatibility/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
31
simgear/compatibility/Makefile.am
Normal file
31
simgear/compatibility/Makefile.am
Normal file
@@ -0,0 +1,31 @@
|
||||
includedir = @includedir@/compatibility
|
||||
|
||||
EXTRA_DIST = README
|
||||
|
||||
include_HEADERS = \
|
||||
cfloat \
|
||||
csetjmp \
|
||||
cstdio \
|
||||
cwchar \
|
||||
iostream \
|
||||
strstream \
|
||||
sstream \
|
||||
cassert \
|
||||
climits \
|
||||
csignal \
|
||||
cstdlib \
|
||||
cwctype \
|
||||
istream \
|
||||
cctype \
|
||||
clocale \
|
||||
cstdarg \
|
||||
cstring \
|
||||
fstream \
|
||||
iterator \
|
||||
cerrno \
|
||||
cmath \
|
||||
cstddef \
|
||||
ctime \
|
||||
iomanip \
|
||||
new \
|
||||
streambuf
|
||||
9
simgear/compatibility/README
Normal file
9
simgear/compatibility/README
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
The following header files where taken from the boost clib package
|
||||
(http://www.boost.org):
|
||||
|
||||
cassert climits csignal cstdlib cwctype
|
||||
cctype clocale cstdarg cstring
|
||||
cerrno cmath cstddef ctime
|
||||
cfloat csetjmp cstdio cwchar
|
||||
|
||||
10
simgear/compatibility/cassert
Normal file
10
simgear/compatibility/cassert
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CASSERT_HEADER
|
||||
#define __CASSERT_HEADER
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#endif // CASSERT_HEADER
|
||||
26
simgear/compatibility/cctype
Normal file
26
simgear/compatibility/cctype
Normal file
@@ -0,0 +1,26 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CCTYPE_HEADER
|
||||
#define __CCTYPE_HEADER
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
namespace std {
|
||||
using ::isalnum;
|
||||
using ::isdigit;
|
||||
using ::isprint;
|
||||
using ::isupper;
|
||||
using ::tolower;
|
||||
using ::isalpha;
|
||||
using ::isgraph;
|
||||
using ::ispunct;
|
||||
using ::isxdigit;
|
||||
using ::toupper;
|
||||
using ::iscntrl;
|
||||
using ::islower;
|
||||
using ::isspace;
|
||||
}
|
||||
|
||||
#endif // CCTYPE_HEADER
|
||||
10
simgear/compatibility/cerrno
Normal file
10
simgear/compatibility/cerrno
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CERRNO_HEADER
|
||||
#define __CERRNO_HEADER
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#endif // CERRNO_HEADER
|
||||
10
simgear/compatibility/cfloat
Normal file
10
simgear/compatibility/cfloat
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CFLOAT_HEADER
|
||||
#define __CFLOAT_HEADER
|
||||
|
||||
#include <float.h>
|
||||
|
||||
#endif // CFLOAT_HEADER
|
||||
10
simgear/compatibility/climits
Normal file
10
simgear/compatibility/climits
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CLIMITS_HEADER
|
||||
#define __CLIMITS_HEADER
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#endif // CLIMITS_HEADER
|
||||
16
simgear/compatibility/clocale
Normal file
16
simgear/compatibility/clocale
Normal file
@@ -0,0 +1,16 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CLOCALE_HEADER
|
||||
#define __CLOCALE_HEADER
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
namespace std {
|
||||
using ::lconv;
|
||||
using ::localeconv;
|
||||
using ::setlocale;
|
||||
}
|
||||
|
||||
#endif // CLOCALE_HEADER
|
||||
35
simgear/compatibility/cmath
Normal file
35
simgear/compatibility/cmath
Normal file
@@ -0,0 +1,35 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CMATH_HEADER
|
||||
#define __CMATH_HEADER
|
||||
|
||||
#include <math.h>
|
||||
|
||||
namespace std {
|
||||
using ::acos;
|
||||
using ::cos;
|
||||
using ::fmod;
|
||||
using ::modf;
|
||||
using ::tan;
|
||||
using ::asin;
|
||||
using ::cosh;
|
||||
using ::frexp;
|
||||
using ::pow;
|
||||
using ::tanh;
|
||||
using ::atan;
|
||||
using ::exp;
|
||||
using ::ldexp;
|
||||
using ::sin;
|
||||
using ::atan2;
|
||||
using ::fabs;
|
||||
using ::log;
|
||||
using ::sinh;
|
||||
using ::ceil;
|
||||
using ::floor;
|
||||
using ::log10;
|
||||
using ::sqrt;
|
||||
}
|
||||
|
||||
#endif // CMATH_HEADER
|
||||
15
simgear/compatibility/csetjmp
Normal file
15
simgear/compatibility/csetjmp
Normal file
@@ -0,0 +1,15 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CSETJMP_HEADER
|
||||
#define __CSETJMP_HEADER
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
namespace std {
|
||||
using ::jmp_buf;
|
||||
using ::longjmp;
|
||||
}
|
||||
|
||||
#endif // CSETJMP_HEADER
|
||||
16
simgear/compatibility/csignal
Normal file
16
simgear/compatibility/csignal
Normal file
@@ -0,0 +1,16 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CSIGNAL_HEADER
|
||||
#define __CSIGNAL_HEADER
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
namespace std {
|
||||
using ::sig_atomic_t;
|
||||
using ::raise;
|
||||
using ::signal;
|
||||
}
|
||||
|
||||
#endif // CSIGNAL_HEADER
|
||||
14
simgear/compatibility/cstdarg
Normal file
14
simgear/compatibility/cstdarg
Normal file
@@ -0,0 +1,14 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CSTDARG_HEADER
|
||||
#define __CSTDARG_HEADER
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
namespace std {
|
||||
using ::va_list;
|
||||
}
|
||||
|
||||
#endif // CSTDARG_HEADER
|
||||
15
simgear/compatibility/cstddef
Normal file
15
simgear/compatibility/cstddef
Normal file
@@ -0,0 +1,15 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CSTDDEF_HEADER
|
||||
#define __CSTDDEF_HEADER
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
namespace std {
|
||||
using ::ptrdiff_t;
|
||||
using ::size_t;
|
||||
}
|
||||
|
||||
#endif // CSTDDEF_HEADER
|
||||
57
simgear/compatibility/cstdio
Normal file
57
simgear/compatibility/cstdio
Normal file
@@ -0,0 +1,57 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CSTDIO_HEADER
|
||||
#define __CSTDIO_HEADER
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
namespace std {
|
||||
using ::FILE;
|
||||
using ::fpos_t;
|
||||
using ::size_t;
|
||||
using ::clearerr;
|
||||
using ::fgets;
|
||||
using ::fscanf;
|
||||
using ::gets;
|
||||
using ::rename;
|
||||
using ::tmpfile;
|
||||
using ::fclose;
|
||||
using ::fopen;
|
||||
using ::fseek;
|
||||
using ::perror;
|
||||
using ::rewind;
|
||||
using ::tmpnam;
|
||||
using ::feof;
|
||||
using ::fprintf;
|
||||
using ::fsetpos;
|
||||
using ::printf;
|
||||
using ::scanf;
|
||||
using ::ungetc;
|
||||
using ::ferror;
|
||||
using ::fputc;
|
||||
using ::ftell;
|
||||
using ::putc;
|
||||
using ::setbuf;
|
||||
using ::vfprintf;
|
||||
using ::fflush;
|
||||
using ::fputs;
|
||||
using ::fwrite;
|
||||
using ::putchar;
|
||||
using ::setvbuf;
|
||||
using ::vprintf;
|
||||
using ::fgetc;
|
||||
using ::fread;
|
||||
using ::getc;
|
||||
using ::puts;
|
||||
using ::sprintf;
|
||||
using ::vsprintf;
|
||||
using ::fgetpos;
|
||||
using ::freopen;
|
||||
using ::getchar;
|
||||
using ::remove;
|
||||
using ::sscanf;
|
||||
}
|
||||
|
||||
#endif // CSTDIO_HEADER
|
||||
43
simgear/compatibility/cstdlib
Normal file
43
simgear/compatibility/cstdlib
Normal file
@@ -0,0 +1,43 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CSTDLIB_HEADER
|
||||
#define __CSTDLIB_HEADER
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace std {
|
||||
using ::abort;
|
||||
using ::atexit;
|
||||
using ::exit;
|
||||
using ::getenv;
|
||||
using ::system;
|
||||
using ::calloc;
|
||||
using ::malloc;
|
||||
using ::free;
|
||||
using ::realloc;
|
||||
using ::atol;
|
||||
using ::mblen;
|
||||
using ::strtod;
|
||||
using ::wctomb;
|
||||
using ::atof;
|
||||
using ::mbstowcs;
|
||||
using ::strtol;
|
||||
using ::wcstombs;
|
||||
using ::atoi;
|
||||
using ::mbtowc;
|
||||
using ::strtoul;
|
||||
using ::bsearch;
|
||||
using ::qsort;
|
||||
using ::div_t;
|
||||
using ::ldiv_t;
|
||||
using ::abs;
|
||||
using ::labs;
|
||||
using ::srand;
|
||||
using ::div;
|
||||
using ::ldiv;
|
||||
using ::rand;
|
||||
}
|
||||
|
||||
#endif // CSTDLIB_HEADER
|
||||
36
simgear/compatibility/cstring
Normal file
36
simgear/compatibility/cstring
Normal file
@@ -0,0 +1,36 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CSTRING_HEADER
|
||||
#define __CSTRING_HEADER
|
||||
|
||||
#include <string.h>
|
||||
|
||||
namespace std {
|
||||
using ::size_t;
|
||||
using ::memchr;
|
||||
using ::strcat;
|
||||
using ::strcspn;
|
||||
using ::strncpy;
|
||||
using ::strtok;
|
||||
using ::memcmp;
|
||||
using ::strchr;
|
||||
using ::strerror;
|
||||
using ::strpbrk;
|
||||
using ::strxfrm;
|
||||
using ::memcpy;
|
||||
using ::strcmp;
|
||||
using ::strlen;
|
||||
using ::strrchr;
|
||||
using ::memmove;
|
||||
using ::strcoll;
|
||||
using ::strncat;
|
||||
using ::strspn;
|
||||
using ::memset;
|
||||
using ::strcpy;
|
||||
using ::strncmp;
|
||||
using ::strstr;
|
||||
}
|
||||
|
||||
#endif // CSTRING_HEADER
|
||||
26
simgear/compatibility/ctime
Normal file
26
simgear/compatibility/ctime
Normal file
@@ -0,0 +1,26 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CTIME_HEADER
|
||||
#define __CTIME_HEADER
|
||||
|
||||
#include <time.h>
|
||||
|
||||
namespace std {
|
||||
using ::size_t;
|
||||
using ::clock_t;
|
||||
using ::time_t;
|
||||
using ::tm;
|
||||
using ::asctime;
|
||||
using ::clock;
|
||||
using ::difftime;
|
||||
using ::localtime;
|
||||
using ::strftime;
|
||||
using ::ctime;
|
||||
using ::gmtime;
|
||||
using ::mktime;
|
||||
using ::time;
|
||||
}
|
||||
|
||||
#endif // CTIME_HEADER
|
||||
156
simgear/compatibility/cwchar
Normal file
156
simgear/compatibility/cwchar
Normal file
@@ -0,0 +1,156 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CWCHAR_HEADER
|
||||
#define __CWCHAR_HEADER
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
namespace std {
|
||||
using ::mbstate_t;
|
||||
using ::wint_t;
|
||||
using ::size_t;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::btowc;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::getwchar;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::ungetwc;
|
||||
#endif
|
||||
using ::wcscpy;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wcsrtombs;
|
||||
#endif
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wmemchr;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::fgetwc;
|
||||
#endif
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::mbrlen;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::vfwprintf;
|
||||
#endif
|
||||
#endif
|
||||
using ::wcscspn;
|
||||
using ::wcsspn;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wmemcmp;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::fgetws;
|
||||
#endif
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::mbrtowc;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::vswprintf;
|
||||
#endif
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::wcsftime;
|
||||
#endif
|
||||
using ::wcsstr;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wmemcpy;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::fputwc;
|
||||
#endif
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::mbsinit;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::vwprintf;
|
||||
#endif
|
||||
#endif
|
||||
using ::wcslen;
|
||||
using ::wcstod;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wmemmove;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::fputws;
|
||||
#endif
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::mbsrtowcs;
|
||||
#endif
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wcrtomb;
|
||||
#endif
|
||||
using ::wcsncat;
|
||||
using ::wcstok;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wmemset;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__DECCXX_VER) && __DECCXX_VER <= 60290024)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::fwide;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::putwc;
|
||||
#endif
|
||||
using ::wcscat;
|
||||
using ::wcsncmp;
|
||||
using ::wcstol;
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wprintf;
|
||||
#endif
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::fwprintf;
|
||||
#endif
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::putwchar;
|
||||
#endif
|
||||
using ::wcschr;
|
||||
using ::wcsncpy;
|
||||
using ::wcstoul;
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wscanf;
|
||||
#endif
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::fwscanf;
|
||||
#endif
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::swprintf;
|
||||
#endif
|
||||
#endif
|
||||
using ::wcscmp;
|
||||
using ::wcspbrk;
|
||||
using ::wcsxfrm;
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
using ::getwc;
|
||||
#endif
|
||||
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::swscanf;
|
||||
#endif
|
||||
#endif
|
||||
using ::wcscoll;
|
||||
using ::wcsrchr;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wctob;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // CWCHAR_HEADER
|
||||
39
simgear/compatibility/cwctype
Normal file
39
simgear/compatibility/cwctype
Normal file
@@ -0,0 +1,39 @@
|
||||
// This file is automatically generated. Do not edit.
|
||||
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
|
||||
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
|
||||
|
||||
#ifndef __CWCTYPE_HEADER
|
||||
#define __CWCTYPE_HEADER
|
||||
|
||||
#include <wctype.h>
|
||||
|
||||
namespace std {
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wctrans_t;
|
||||
#endif
|
||||
using ::wctype_t;
|
||||
using ::wint_t;
|
||||
using ::iswalnum;
|
||||
using ::iswctype;
|
||||
using ::iswlower;
|
||||
using ::iswspace;
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::towctrans;
|
||||
#endif
|
||||
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
|
||||
using ::wctrans;
|
||||
#endif
|
||||
using ::iswalpha;
|
||||
using ::iswdigit;
|
||||
using ::iswprint;
|
||||
using ::iswupper;
|
||||
using ::towlower;
|
||||
using ::wctype;
|
||||
using ::iswcntrl;
|
||||
using ::iswgraph;
|
||||
using ::iswpunct;
|
||||
using ::iswxdigit;
|
||||
using ::towupper;
|
||||
}
|
||||
|
||||
#endif // CWCTYPE_HEADER
|
||||
19
simgear/compatibility/fstream
Normal file
19
simgear/compatibility/fstream
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
#ifndef __SG_FSTREAM
|
||||
#define __SG_FSTREAM 1
|
||||
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
|
||||
# include <fstream.h>
|
||||
|
||||
namespace std {
|
||||
using ::fstream;
|
||||
using ::ifstream;
|
||||
using ::ofstream;
|
||||
};
|
||||
|
||||
|
||||
# endif
|
||||
|
||||
#endif // !__SG_FSTREAM
|
||||
|
||||
12
simgear/compatibility/iomanip
Normal file
12
simgear/compatibility/iomanip
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
#ifndef __SG_IOMANIP
|
||||
#define __SG_IOMANIP 1
|
||||
|
||||
# include <iomanip.h>
|
||||
|
||||
namespace std {
|
||||
using ::setw;
|
||||
};
|
||||
|
||||
#endif // !__SG_IOMANIP
|
||||
|
||||
40
simgear/compatibility/iostream
Normal file
40
simgear/compatibility/iostream
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
#ifndef __SG_IOSTREAM
|
||||
#define __SG_IOSTREAM 1
|
||||
|
||||
# include <fstream>
|
||||
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
|
||||
# include <iostream.h>
|
||||
|
||||
class ios_base : public ios {
|
||||
public:
|
||||
|
||||
typedef int openmode;
|
||||
typedef int seekdir;
|
||||
|
||||
enum { binary = 0 };
|
||||
};
|
||||
|
||||
namespace std {
|
||||
using ::cin;
|
||||
using ::cout;
|
||||
using ::cerr;
|
||||
using ::clog;
|
||||
using ::endl;
|
||||
|
||||
using ::ios;
|
||||
using ::ios_base;
|
||||
using ::iostream;
|
||||
using ::istream;
|
||||
using ::ostream;
|
||||
|
||||
using ::dec;
|
||||
using ::hex;
|
||||
};
|
||||
|
||||
# endif
|
||||
|
||||
#endif // !__SG_IOSTREAM
|
||||
|
||||
17
simgear/compatibility/istream
Normal file
17
simgear/compatibility/istream
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
#ifndef __SG_ISTREAM
|
||||
#define __SG_ISTREAM 1
|
||||
|
||||
# include <iostream>
|
||||
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
|
||||
# include <stream.h>
|
||||
# include <string>
|
||||
|
||||
using std::getline;
|
||||
|
||||
# endif
|
||||
|
||||
#endif // !__SG_ISTREAM
|
||||
|
||||
8
simgear/compatibility/iterator
Normal file
8
simgear/compatibility/iterator
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
#ifndef __SG_ITERATOR
|
||||
#define __SG_ITERATOR 1
|
||||
|
||||
# include <iterator.h>
|
||||
|
||||
#endif // !__SG_ITERATOR
|
||||
|
||||
12
simgear/compatibility/new
Normal file
12
simgear/compatibility/new
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
#ifndef __SG_NEW
|
||||
#define __SG_NEW 1
|
||||
|
||||
#if defined(sgi) && !defined(__GNUC__)
|
||||
|
||||
# include <new.h>
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !__SG_NEW
|
||||
|
||||
13
simgear/compatibility/sstream
Normal file
13
simgear/compatibility/sstream
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
#ifndef __SG_SSTREAM
|
||||
#define __SG_SSTREAM 1
|
||||
|
||||
# include <strstream>
|
||||
|
||||
namespace std {
|
||||
typedef ::ostrstream ostringstream;
|
||||
typedef ::istrstream istringstream;
|
||||
};
|
||||
|
||||
#endif // !__SG_SSTREAM
|
||||
|
||||
38
simgear/compatibility/streambuf
Normal file
38
simgear/compatibility/streambuf
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
#ifndef __SG_STREAMBUF
|
||||
#define __SG_STREAMBUF 1
|
||||
|
||||
# include <iostream>
|
||||
# include <char_traits.h>
|
||||
|
||||
//
|
||||
// Until we find a good way to rename the original streambuf class
|
||||
// and derive our own streambuf class from that, define this variable
|
||||
// for now so the code can inherit our streambuf class instead.
|
||||
//
|
||||
# define SG_NEED_STREAMBUF_HACK 1
|
||||
|
||||
class __streambuf : virtual public streambuf {
|
||||
public:
|
||||
|
||||
typedef std::char_traits<char> traits_type;
|
||||
typedef std::char_traits<char>::int_type int_type;
|
||||
|
||||
typedef streampos pos_type;
|
||||
typedef streamoff off_type;
|
||||
};
|
||||
|
||||
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
|
||||
# define pubsync sync
|
||||
|
||||
namespace std {
|
||||
using ::streambuf;
|
||||
using ::streampos;
|
||||
using ::streamoff;
|
||||
};
|
||||
# endif
|
||||
|
||||
#endif // !__SG_STREAMBUF
|
||||
|
||||
20
simgear/compatibility/strstream
Normal file
20
simgear/compatibility/strstream
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#ifndef __SG_STRSTREAM
|
||||
#define __SG_STRSTREAM 1
|
||||
|
||||
# include <strstream.h>
|
||||
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
|
||||
namespace std {
|
||||
using ::ends;
|
||||
|
||||
using ::strstream;
|
||||
using ::istrstream;
|
||||
using ::ostrstream;
|
||||
};
|
||||
|
||||
# endif
|
||||
|
||||
#endif // !__SG_STRSTREAM
|
||||
|
||||
@@ -71,6 +71,14 @@
|
||||
#ifndef _SG_COMPILER_H
|
||||
#define _SG_COMPILER_H
|
||||
|
||||
/*
|
||||
* Helper macro SG_STRINGIZE:
|
||||
* Converts the parameter X to a string after macro replacement
|
||||
* on X has been performed.
|
||||
*/
|
||||
#define SG_STRINGIZE(X) SG_DO_STRINGIZE(X)
|
||||
#define SG_DO_STRINGIZE(X) #X
|
||||
|
||||
#ifdef __GNUC__
|
||||
# if __GNUC__ == 2
|
||||
# if __GNUC_MINOR__ < 8
|
||||
@@ -133,15 +141,18 @@
|
||||
# define STL_STDEXCEPT <stdexcept>
|
||||
# define STL_STRING <string>
|
||||
# define STL_STRSTREAM <strstream>
|
||||
|
||||
# else
|
||||
# error Time to upgrade. GNU compilers < 2.7 not supported
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# define SG_COMPILER_STR "GNU C++ version " SG_STRINGIZE(__GNUC__) "." SG_STRINGIZE(__GNUC_MINOR__)
|
||||
|
||||
#endif // __GNUC__
|
||||
|
||||
#if defined( __MINGW32__ )
|
||||
# define bcopy(from, to, n) memcpy(to, from, n)
|
||||
# define FG_MEM_COPY(to,from,n) memcpy(to, from, n)
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
/* KAI C++ */
|
||||
@@ -162,7 +173,10 @@
|
||||
# define STL_STDEXCEPT <stdexcept>
|
||||
# define STL_STRING <string>
|
||||
# define STL_STRSTREAM <strstream>
|
||||
#endif
|
||||
|
||||
# define SG_COMPILER_STR "Kai C++ version " SG_STRINGIZE(__KCC_VERSION)
|
||||
|
||||
#endif // __KCC
|
||||
|
||||
//
|
||||
// Metrowerks
|
||||
@@ -193,7 +207,10 @@
|
||||
|
||||
// -dw- currently used glut has no game mode stuff
|
||||
# define GLUT_WRONG_VERSION
|
||||
#endif
|
||||
|
||||
# define SG_COMPILER_STR "Metrowerks CodeWarrior C++ version " SG_STRINGIZE(__MWERKS__)
|
||||
|
||||
#endif // __MWERKS__
|
||||
|
||||
//
|
||||
// Microsoft compilers.
|
||||
@@ -218,13 +235,19 @@
|
||||
# define STL_STRING <string>
|
||||
# define STL_STRSTREAM <strstream>
|
||||
|
||||
# define snprintf _snprintf
|
||||
|
||||
# pragma warning(disable: 4786) // identifier was truncated to '255' characters
|
||||
# pragma warning(disable: 4244) // conversion from double to float
|
||||
# pragma warning(disable: 4305) //
|
||||
|
||||
# else
|
||||
# error What version of MSVC++ is this?
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# define SG_COMPILER_STR "Microsoft Visual C++ version " SG_STRINGIZE(_MSC_VER)
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# if defined(HAVE_SGI_STL_PORT)
|
||||
@@ -256,6 +279,8 @@
|
||||
# define SG_NAMESPACES
|
||||
// # define SG_HAVE_STD
|
||||
|
||||
# define SG_COMPILER_STR "Borland C++ version " SG_STRINGIZE(__BORLANDC__)
|
||||
|
||||
#endif // __BORLANDC__
|
||||
|
||||
//
|
||||
@@ -266,58 +291,11 @@
|
||||
# define SG_HAVE_NATIVE_SGI_COMPILERS
|
||||
|
||||
# define SG_EXPLICIT_FUNCTION_TMPL_ARGS
|
||||
# define SG_CLASS_PARTIAL_SPECIALIZATION
|
||||
# define SG_NEED_AUTO_PTR
|
||||
# define SG_MEMBER_TEMPLATES
|
||||
# define SG_NAMESPACES
|
||||
# define SG_HAVE_STD
|
||||
# define SG_CLASS_PARTIAL_SPECIALIZATION
|
||||
# define SG_HAVE_TRAITS
|
||||
|
||||
# define STL_ALGORITHM <algorithm>
|
||||
# define STL_FUNCTIONAL <functional>
|
||||
# define STL_IOMANIP <iomanip.h>
|
||||
# define STL_IOSTREAM <iostream.h>
|
||||
# define STL_ITERATOR <iterator.h>
|
||||
# define STL_FSTREAM <fstream.h>
|
||||
# define STL_STDEXCEPT <stdexcept>
|
||||
# define STL_STRING <string>
|
||||
# define STL_STRSTREAM <strstream.h>
|
||||
|
||||
// # define __STL_FUNCTION_TMPL_PARTIAL_ORDER
|
||||
// typedef void PFNGLPOINTPARAMETERFEXTPROC
|
||||
|
||||
#define glPointParameterfEXT glPointParameterfSGIS
|
||||
#define glPointParameterfvEXT glPointParameterfvSGIS
|
||||
|
||||
#pragma set woff 1001,1012,1014,1116,1155,1172,1174
|
||||
#pragma set woff 1401,1460,1551,1552,1681
|
||||
|
||||
#ifdef __cplusplus
|
||||
#pragma set woff 1682,3303
|
||||
#endif
|
||||
|
||||
#endif // Native SGI compilers
|
||||
|
||||
|
||||
#if defined ( sun )
|
||||
# include <strings.h>
|
||||
# include <memory.h>
|
||||
# if defined ( __cplusplus )
|
||||
// typedef unsigned int size_t;
|
||||
extern "C" {
|
||||
extern void *memmove(void *, const void *, size_t);
|
||||
}
|
||||
# else
|
||||
extern void *memmove(void *, const void *, size_t);
|
||||
# endif // __cplusplus
|
||||
#endif // sun
|
||||
|
||||
//
|
||||
// Intel C++ Compiler
|
||||
//
|
||||
#if defined(__ICC)
|
||||
# define SG_NAMESPACES
|
||||
# define SG_HAVE_STD
|
||||
# define SG_HAVE_STREAMBUF
|
||||
# define SG_HAVE_TRAITS
|
||||
# define SG_HAVE_STD_INCLUDES
|
||||
@@ -331,6 +309,57 @@
|
||||
# define STL_STDEXCEPT <stdexcept>
|
||||
# define STL_STRING <string>
|
||||
# define STL_STRSTREAM <strstream>
|
||||
|
||||
#pragma set woff 1001,1012,1014,1116,1155,1172,1174
|
||||
#pragma set woff 1401,1460,1551,1552,1681
|
||||
|
||||
#ifdef __cplusplus
|
||||
#pragma set woff 1682,3303
|
||||
#endif
|
||||
|
||||
# define SG_COMPILER_STR "SGI MipsPro compiler version " SG_STRINGIZE(_COMPILER_VERSION)
|
||||
|
||||
#endif // Native SGI compilers
|
||||
|
||||
|
||||
#if defined ( sun )
|
||||
# include <strings.h>
|
||||
# include <memory.h>
|
||||
# if defined ( __cplusplus )
|
||||
// typedef unsigned int size_t;
|
||||
extern "C" {
|
||||
extern void *memmove(void *, const void *, size_t);
|
||||
}
|
||||
# else
|
||||
extern void *memmove(void *, const void *, size_t);
|
||||
# endif // __cplusplus
|
||||
|
||||
# define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
|
||||
|
||||
#endif // sun
|
||||
|
||||
//
|
||||
// Intel C++ Compiler
|
||||
//
|
||||
#if defined(__ICC) || defined (__ECC)
|
||||
# define SG_NAMESPACES
|
||||
# define SG_HAVE_STD
|
||||
# define SG_HAVE_STREAMBUF
|
||||
# define SG_HAVE_TRAITS
|
||||
# define SG_HAVE_STD_INCLUDES
|
||||
|
||||
# define STL_ALGORITHM <algorithm>
|
||||
# define STL_FUNCTIONAL <functional>
|
||||
# define STL_IOMANIP <iomanip>
|
||||
# define STL_IOSTREAM <iostream>
|
||||
# define STL_ITERATOR <iterator>
|
||||
# define STL_FSTREAM <fstream>
|
||||
# define STL_STDEXCEPT <stdexcept>
|
||||
# define STL_STRING <string>
|
||||
# define STL_STRSTREAM <strstream>
|
||||
|
||||
# define SG_COMPILER_STR "Intel C++ version " SG_STRINGIZE(__ICC)
|
||||
|
||||
#endif // __ICC
|
||||
|
||||
//
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
/** Highest binobj format version we know how to read/write. This starts at
|
||||
* 0 and can go up to 65535 */
|
||||
#define SG_BINOBJ_VERSION 5
|
||||
#define SG_BINOBJ_VERSION 6
|
||||
|
||||
/** for backwards compatibility */
|
||||
#define SG_SCENERY_FILE_FORMAT "0.4"
|
||||
|
||||
@@ -8,8 +8,4 @@ include_HEADERS = debug_types.h logstream.hxx
|
||||
|
||||
libsgdebug_a_SOURCES = logstream.cxx
|
||||
|
||||
if OLD_AUTOMAKE
|
||||
INCLUDES += -I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
@@ -23,7 +23,8 @@ typedef enum {
|
||||
SG_IO = 0x00001000,
|
||||
SG_CLIPPER = 0x00002000,
|
||||
SG_NETWORK = 0x00004000,
|
||||
SG_UNDEFD = 0x00008000, // For range checking
|
||||
SG_ATC = 0x00008000,
|
||||
SG_UNDEFD = 0x00010000, // For range checking
|
||||
|
||||
SG_ALL = 0xFFFFFFFF
|
||||
} sgDebugClass;
|
||||
@@ -33,11 +34,12 @@ typedef enum {
|
||||
* Define the possible logging priorities (and their order).
|
||||
*/
|
||||
typedef enum {
|
||||
SG_BULK, // For frequent messages
|
||||
SG_DEBUG, // Less frequent debug type messages
|
||||
SG_INFO, // Informatory messages
|
||||
SG_WARN, // Possible impending problem
|
||||
SG_ALERT // Very possible impending problem
|
||||
SG_BULK = 1, // For frequent messages
|
||||
SG_DEBUG, // Less frequent debug type messages
|
||||
SG_INFO, // Informatory messages
|
||||
SG_WARN, // Possible impending problem
|
||||
SG_ALERT // Very possible impending problem
|
||||
// SG_EXIT, // Problem (no core)
|
||||
// SG_ABORT // Abandon ship (core)
|
||||
} sgDebugPriority;
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "logstream.hxx"
|
||||
|
||||
logstream *global_logstream = NULL;
|
||||
|
||||
bool logbuf::logging_enabled = true;
|
||||
sgDebugClass logbuf::logClass = SG_NONE;
|
||||
sgDebugPriority logbuf::logPriority = SG_INFO;
|
||||
|
||||
@@ -28,11 +28,6 @@
|
||||
|
||||
#include <simgear/compiler.h>
|
||||
|
||||
// At least Irix needs this
|
||||
#ifdef SG_HAVE_NATIVE_SGI_COMPILERS
|
||||
#include <char_traits.h>
|
||||
#endif
|
||||
|
||||
#ifdef SG_HAVE_STD_INCLUDES
|
||||
# include <streambuf>
|
||||
# include <iostream>
|
||||
@@ -43,14 +38,11 @@
|
||||
|
||||
#include <simgear/debug/debug_types.h>
|
||||
|
||||
#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
|
||||
SG_USING_STD(streambuf);
|
||||
SG_USING_STD(ostream);
|
||||
SG_USING_STD(cout);
|
||||
SG_USING_STD(cerr);
|
||||
SG_USING_STD(endl);
|
||||
#else
|
||||
SG_USING_STD(char_traits);
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
SG_USING_STD(iostream);
|
||||
@@ -69,7 +61,11 @@ SG_USING_STD(iostream);
|
||||
* messages at runtime. Only messages with priority >= logbuf::logPriority
|
||||
* and debugClass == logbuf::logClass are output.
|
||||
*/
|
||||
#ifdef SG_NEED_STREAMBUF_HACK
|
||||
class logbuf : public __streambuf
|
||||
#else
|
||||
class logbuf : public streambuf
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -256,6 +252,7 @@ logstream::operator<< ( const loglevel& l )
|
||||
return *this;
|
||||
}
|
||||
|
||||
extern logstream *global_logstream;
|
||||
|
||||
/**
|
||||
* \relates logstream
|
||||
@@ -267,8 +264,22 @@ logstream::operator<< ( const loglevel& l )
|
||||
inline logstream&
|
||||
sglog()
|
||||
{
|
||||
static logstream logstrm( cerr );
|
||||
return logstrm;
|
||||
if (global_logstream == NULL) {
|
||||
|
||||
#ifdef __APPLE__
|
||||
/**
|
||||
* There appears to be a bug in the C++ runtime in Mac OS X that
|
||||
* will crash if certain funtions are called (in this case
|
||||
* cerr.rdbuf()) during static initialization of a class. This
|
||||
* print statement is hack to kick the library in the pants so it
|
||||
* won't crash when cerr.rdbuf() is first called -DW
|
||||
**/
|
||||
cout << "Using Mac OS X hack for initializing C++ stdio..." << endl;
|
||||
#endif
|
||||
global_logstream = new logstream (cerr);
|
||||
}
|
||||
|
||||
return *global_logstream;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
#include <string>
|
||||
#include "Debug/logstream.hxx"
|
||||
|
||||
class Test {
|
||||
|
||||
public:
|
||||
Test() {
|
||||
//cout << "Cout seems to work" << endl;
|
||||
//cerr << "Cerr seems to work" << endl;
|
||||
|
||||
sglog().setLogLevels( SG_ALL, SG_INFO );
|
||||
|
||||
SG_LOG(SG_EVENT, SG_INFO, "Test::Test" << "foo");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Test test;
|
||||
|
||||
int
|
||||
main( int argc, char* argv[] )
|
||||
{
|
||||
fglog().setLogLevels( SG_ALL, SG_INFO );
|
||||
sglog().setLogLevels( SG_ALL, SG_INFO );
|
||||
|
||||
SG_LOG( FG_TERRAIN, FG_BULK, "terrain::bulk" ); // shouldnt appear
|
||||
SG_LOG( FG_TERRAIN, SG_DEBUG, "terrain::debug" ); // shouldnt appear
|
||||
SG_LOG( FG_TERRAIN, SG_INFO, "terrain::info" );
|
||||
SG_LOG( FG_TERRAIN, FG_WARN, "terrain::warn" );
|
||||
SG_LOG( FG_TERRAIN, SG_ALERT, "terrain::alert" );
|
||||
//SG_LOG( FG_TERRAIN, FG_BULK, "terrain::bulk" ); // shouldnt appear
|
||||
//SG_LOG( FG_TERRAIN, SG_DEBUG, "terrain::debug" ); // shouldnt appear
|
||||
//SG_LOG( FG_TERRAIN, SG_INFO, "terrain::info" );
|
||||
//SG_LOG( FG_TERRAIN, FG_WARN, "terrain::warn" );
|
||||
//SG_LOG( FG_TERRAIN, SG_ALERT, "terrain::alert" );
|
||||
|
||||
int i = 12345;
|
||||
long l = 54321L;
|
||||
|
||||
@@ -31,8 +31,4 @@ libsgephem_a_SOURCES = \
|
||||
uranus.cxx \
|
||||
venus.cxx
|
||||
|
||||
if OLD_AUTOMAKE
|
||||
INCLUDES += -I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
@@ -158,22 +158,112 @@ double CelestialBody::sgCalcEccAnom(double M, double e)
|
||||
return eccAnom;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* inline CelestialBody::CelestialBody
|
||||
* public constructor for a generic celestialBody object.
|
||||
* initializes the 6 primary orbital elements. The elements are:
|
||||
* N: longitude of the ascending node
|
||||
* i: inclination to the ecliptic
|
||||
* w: argument of perihelion
|
||||
* a: semi-major axis, or mean distance from the sun
|
||||
* e: eccenticity
|
||||
* M: mean anomaly
|
||||
* Each orbital element consists of a constant part and a variable part that
|
||||
* gradually changes over time.
|
||||
*
|
||||
* Argumetns:
|
||||
* the 13 arguments to the constructor constitute the first, constant
|
||||
* ([NiwaeM]f) and the second variable ([NiwaeM]s) part of the orbital
|
||||
* elements. The 13th argument is the current time. Note that the inclination
|
||||
* is written with a capital (If, Is), because 'if' is a reserved word in the
|
||||
* C/C++ programming language.
|
||||
***************************************************************************/
|
||||
CelestialBody::CelestialBody(double Nf, double Ns,
|
||||
double If, double Is,
|
||||
double wf, double ws,
|
||||
double af, double as,
|
||||
double ef, double es,
|
||||
double Mf, double Ms, double mjd)
|
||||
{
|
||||
NFirst = Nf; NSec = Ns;
|
||||
iFirst = If; iSec = Is;
|
||||
wFirst = wf; wSec = ws;
|
||||
aFirst = af; aSec = as;
|
||||
eFirst = ef; eSec = es;
|
||||
MFirst = Mf; MSec = Ms;
|
||||
updateOrbElements(mjd);
|
||||
}
|
||||
|
||||
CelestialBody::CelestialBody(double Nf, double Ns,
|
||||
double If, double Is,
|
||||
double wf, double ws,
|
||||
double af, double as,
|
||||
double ef, double es,
|
||||
double Mf, double Ms)
|
||||
{
|
||||
NFirst = Nf; NSec = Ns;
|
||||
iFirst = If; iSec = Is;
|
||||
wFirst = wf; wSec = ws;
|
||||
aFirst = af; aSec = as;
|
||||
eFirst = ef; eSec = es;
|
||||
MFirst = Mf; MSec = Ms;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* inline void CelestialBody::updateOrbElements(double mjd)
|
||||
* given the current time, this private member calculates the actual
|
||||
* orbital elements
|
||||
*
|
||||
* Arguments: double mjd: the current modified julian date:
|
||||
*
|
||||
* return value: none
|
||||
***************************************************************************/
|
||||
void CelestialBody::updateOrbElements(double mjd)
|
||||
{
|
||||
double actTime = sgCalcActTime(mjd);
|
||||
M = SGD_DEGREES_TO_RADIANS * (MFirst + (MSec * actTime));
|
||||
w = SGD_DEGREES_TO_RADIANS * (wFirst + (wSec * actTime));
|
||||
N = SGD_DEGREES_TO_RADIANS * (NFirst + (NSec * actTime));
|
||||
i = SGD_DEGREES_TO_RADIANS * (iFirst + (iSec * actTime));
|
||||
e = eFirst + (eSec * actTime);
|
||||
a = aFirst + (aSec * actTime);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* inline double CelestialBody::sgCalcActTime(double mjd)
|
||||
* this private member function returns the offset in days from the epoch for
|
||||
* wich the orbital elements are calculated (Jan, 1st, 2000).
|
||||
*
|
||||
* Argument: the current time
|
||||
*
|
||||
* return value: the (fractional) number of days until Jan 1, 2000.
|
||||
****************************************************************************/
|
||||
double CelestialBody::sgCalcActTime(double mjd)
|
||||
{
|
||||
return (mjd - 36523.5);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* inline void CelestialBody::getPos(double* ra, double* dec)
|
||||
* gives public access to Right Ascension and declination
|
||||
*
|
||||
****************************************************************************/
|
||||
void CelestialBody::getPos(double* ra, double* dec)
|
||||
{
|
||||
*ra = rightAscension;
|
||||
*dec = declination;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* inline void CelestialBody::getPos(double* ra, double* dec, double* magnitude
|
||||
* gives public acces to the current Right ascension, declination, and
|
||||
* magnitude
|
||||
****************************************************************************/
|
||||
void CelestialBody::getPos(double* ra, double* dec, double* magn)
|
||||
{
|
||||
*ra = rightAscension;
|
||||
*dec = declination;
|
||||
*magn = magnitude;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -87,113 +87,6 @@ public:
|
||||
void updatePosition(double mjd, Star *ourSun);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* inline CelestialBody::CelestialBody
|
||||
* public constructor for a generic celestialBody object.
|
||||
* initializes the 6 primary orbital elements. The elements are:
|
||||
* N: longitude of the ascending node
|
||||
* i: inclination to the ecliptic
|
||||
* w: argument of perihelion
|
||||
* a: semi-major axis, or mean distance from the sun
|
||||
* e: eccenticity
|
||||
* M: mean anomaly
|
||||
* Each orbital element consists of a constant part and a variable part that
|
||||
* gradually changes over time.
|
||||
*
|
||||
* Argumetns:
|
||||
* the 13 arguments to the constructor constitute the first, constant
|
||||
* ([NiwaeM]f) and the second variable ([NiwaeM]s) part of the orbital
|
||||
* elements. The 13th argument is the current time. Note that the inclination
|
||||
* is written with a capital (If, Is), because 'if' is a reserved word in the
|
||||
* C/C++ programming language.
|
||||
***************************************************************************/
|
||||
inline CelestialBody::CelestialBody(double Nf, double Ns,
|
||||
double If, double Is,
|
||||
double wf, double ws,
|
||||
double af, double as,
|
||||
double ef, double es,
|
||||
double Mf, double Ms, double mjd)
|
||||
{
|
||||
NFirst = Nf; NSec = Ns;
|
||||
iFirst = If; iSec = Is;
|
||||
wFirst = wf; wSec = ws;
|
||||
aFirst = af; aSec = as;
|
||||
eFirst = ef; eSec = es;
|
||||
MFirst = Mf; MSec = Ms;
|
||||
updateOrbElements(mjd);
|
||||
}
|
||||
|
||||
inline CelestialBody::CelestialBody(double Nf, double Ns,
|
||||
double If, double Is,
|
||||
double wf, double ws,
|
||||
double af, double as,
|
||||
double ef, double es,
|
||||
double Mf, double Ms)
|
||||
{
|
||||
NFirst = Nf; NSec = Ns;
|
||||
iFirst = If; iSec = Is;
|
||||
wFirst = wf; wSec = ws;
|
||||
aFirst = af; aSec = as;
|
||||
eFirst = ef; eSec = es;
|
||||
MFirst = Mf; MSec = Ms;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* inline void CelestialBody::updateOrbElements(double mjd)
|
||||
* given the current time, this private member calculates the actual
|
||||
* orbital elements
|
||||
*
|
||||
* Arguments: double mjd: the current modified julian date:
|
||||
*
|
||||
* return value: none
|
||||
***************************************************************************/
|
||||
inline void CelestialBody::updateOrbElements(double mjd)
|
||||
{
|
||||
double actTime = sgCalcActTime(mjd);
|
||||
M = SGD_DEGREES_TO_RADIANS * (MFirst + (MSec * actTime));
|
||||
w = SGD_DEGREES_TO_RADIANS * (wFirst + (wSec * actTime));
|
||||
N = SGD_DEGREES_TO_RADIANS * (NFirst + (NSec * actTime));
|
||||
i = SGD_DEGREES_TO_RADIANS * (iFirst + (iSec * actTime));
|
||||
e = eFirst + (eSec * actTime);
|
||||
a = aFirst + (aSec * actTime);
|
||||
}
|
||||
/*****************************************************************************
|
||||
* inline double CelestialBody::sgCalcActTime(double mjd)
|
||||
* this private member function returns the offset in days from the epoch for
|
||||
* wich the orbital elements are calculated (Jan, 1st, 2000).
|
||||
*
|
||||
* Argument: the current time
|
||||
*
|
||||
* return value: the (fractional) number of days until Jan 1, 2000.
|
||||
****************************************************************************/
|
||||
inline double CelestialBody::sgCalcActTime(double mjd)
|
||||
{
|
||||
return (mjd - 36523.5);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* inline void CelestialBody::getPos(double* ra, double* dec)
|
||||
* gives public access to Right Ascension and declination
|
||||
*
|
||||
****************************************************************************/
|
||||
inline void CelestialBody::getPos(double* ra, double* dec)
|
||||
{
|
||||
*ra = rightAscension;
|
||||
*dec = declination;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* inline void CelestialBody::getPos(double* ra, double* dec, double* magnitude
|
||||
* gives public acces to the current Right ascension, declination, and
|
||||
* magnitude
|
||||
****************************************************************************/
|
||||
inline void CelestialBody::getPos(double* ra, double* dec, double* magn)
|
||||
{
|
||||
*ra = rightAscension;
|
||||
*dec = declination;
|
||||
*magn = magnitude;
|
||||
}
|
||||
|
||||
inline double CelestialBody::getRightAscension() { return rightAscension; }
|
||||
inline double CelestialBody::getDeclination() { return declination; }
|
||||
inline double CelestialBody::getMagnitude() { return magnitude; }
|
||||
@@ -210,14 +103,3 @@ inline double CelestialBody::getLat()
|
||||
|
||||
#endif // _CELESTIALBODY_H_
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "stardata.hxx"
|
||||
|
||||
#if defined (_MSC_VER) || defined (SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||
#if defined (_MSC_VER)
|
||||
SG_USING_STD(getline);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,3 +4,5 @@ Makefile.in
|
||||
decode_binobj
|
||||
lowtest
|
||||
socktest
|
||||
tcp_client
|
||||
tcp_server
|
||||
|
||||
@@ -20,19 +20,29 @@ libsgio_a_SOURCES = \
|
||||
sg_socket.cxx \
|
||||
sg_socket_udp.cxx
|
||||
|
||||
if OLD_AUTOMAKE
|
||||
INCLUDES += -I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
if IS_MINGW
|
||||
NETWORK_LIB = -lwsock32
|
||||
else
|
||||
NETWORK_LIB =
|
||||
endif
|
||||
noinst_PROGRAMS = decode_binobj socktest lowtest tcp_server tcp_client
|
||||
|
||||
noinst_PROGRAMS = decode_binobj socktest lowtest
|
||||
tcp_server_SOURCES = tcp_server.cxx
|
||||
|
||||
tcp_server_LDADD = \
|
||||
$(top_builddir)/simgear/io/libsgio.a \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(top_builddir)/simgear/bucket/libsgbucket.a \
|
||||
$(top_builddir)/simgear/misc/libsgmisc.a \
|
||||
$(top_builddir)/simgear/xml/libsgxml.a \
|
||||
-lplibnet -lplibul -lz
|
||||
|
||||
tcp_client_SOURCES = tcp_client.cxx
|
||||
|
||||
tcp_client_LDADD = \
|
||||
$(top_builddir)/simgear/io/libsgio.a \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(top_builddir)/simgear/bucket/libsgbucket.a \
|
||||
$(top_builddir)/simgear/misc/libsgmisc.a \
|
||||
$(top_builddir)/simgear/xml/libsgxml.a \
|
||||
-lplibnet -lplibul -lz
|
||||
|
||||
socktest_SOURCES = socktest.cxx
|
||||
|
||||
@@ -42,7 +52,7 @@ socktest_LDADD = \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(top_builddir)/simgear/misc/libsgmisc.a \
|
||||
$(top_builddir)/simgear/xml/libsgxml.a \
|
||||
-lz
|
||||
-lplibnet -lplibul -lz
|
||||
|
||||
lowtest_SOURCES = lowtest.cxx
|
||||
|
||||
@@ -57,4 +67,4 @@ decode_binobj_LDADD = \
|
||||
$(top_builddir)/simgear/misc/libsgmisc.a \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(top_builddir)/simgear/xml/libsgxml.a \
|
||||
$(NETWORK_LIB) -lz
|
||||
-lz
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
#include <unistd.h>
|
||||
#include STL_IOSTREAM
|
||||
|
||||
#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||
#include "sg_binobj.hxx"
|
||||
|
||||
SG_USING_STD(cout);
|
||||
SG_USING_STD(endl);
|
||||
#endif
|
||||
|
||||
#include "sg_binobj.hxx"
|
||||
|
||||
|
||||
int main( int argc, char **argv ) {
|
||||
@@ -58,25 +56,49 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
cout << endl;
|
||||
|
||||
cout << "# triangle groups" << endl;
|
||||
cout << "# geometry groups" << endl;
|
||||
cout << endl;
|
||||
|
||||
string material;
|
||||
int_list vertex_index;
|
||||
int_list normal_index;
|
||||
int_list tex_index;
|
||||
|
||||
// generate points
|
||||
string_list pt_materials = obj.get_pt_materials();
|
||||
group_list pts_v = obj.get_pts_v();
|
||||
group_list pts_n = obj.get_pts_n();
|
||||
for ( i = 0; i < (int)pts_v.size(); ++i ) {
|
||||
material = pt_materials[i];
|
||||
vertex_index = pts_v[i];
|
||||
normal_index = pts_n[i];
|
||||
cout << "# usemtl " << material << endl;
|
||||
cout << "pt ";
|
||||
for ( j = 0; j < (int)vertex_index.size(); ++j ) {
|
||||
cout << vertex_index[j] << "/" << normal_index[j] << " ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
// generate triangles
|
||||
string_list tri_materials = obj.get_tri_materials();
|
||||
group_list tris_v = obj.get_tris_v();
|
||||
group_list tris_n = obj.get_tris_n();
|
||||
group_list tris_tc = obj.get_tris_tc();
|
||||
for ( i = 0; i < (int)tris_v.size(); ++i ) {
|
||||
material = tri_materials[i];
|
||||
vertex_index = tris_v[i];
|
||||
normal_index = tris_n[i];
|
||||
tex_index = tris_tc[i];
|
||||
cout << "# usemtl " << material << endl;
|
||||
cout << "f ";
|
||||
for ( j = 0; j < (int)vertex_index.size(); ++j ) {
|
||||
cout << vertex_index[j] << "/" << tex_index[j] << " ";
|
||||
cout << vertex_index[j];
|
||||
if ( normal_index.size() ) {
|
||||
cout << "/" << normal_index[j];
|
||||
}
|
||||
cout << "/" << tex_index[j];
|
||||
cout << " ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
@@ -84,15 +106,21 @@ int main( int argc, char **argv ) {
|
||||
// generate strips
|
||||
string_list strip_materials = obj.get_strip_materials();
|
||||
group_list strips_v = obj.get_strips_v();
|
||||
group_list strips_n = obj.get_strips_n();
|
||||
group_list strips_tc = obj.get_strips_tc();
|
||||
for ( i = 0; i < (int)strips_v.size(); ++i ) {
|
||||
material = strip_materials[i];
|
||||
vertex_index = strips_v[i];
|
||||
normal_index = strips_n[i];
|
||||
tex_index = strips_tc[i];
|
||||
cout << "# usemtl " << material << endl;
|
||||
cout << "ts ";
|
||||
for ( j = 0; j < (int)vertex_index.size(); ++j ) {
|
||||
cout << vertex_index[j] << "/" << tex_index[j] << " ";
|
||||
cout << vertex_index[j];
|
||||
if ( normal_index.size() ) {
|
||||
cout << "/" << normal_index[j];
|
||||
}
|
||||
cout << "/" << tex_index[j] << " ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
@@ -100,15 +128,21 @@ int main( int argc, char **argv ) {
|
||||
// generate fans
|
||||
string_list fan_materials = obj.get_fan_materials();
|
||||
group_list fans_v = obj.get_fans_v();
|
||||
group_list fans_n = obj.get_fans_n();
|
||||
group_list fans_tc = obj.get_fans_tc();
|
||||
for ( i = 0; i < (int)fans_v.size(); ++i ) {
|
||||
material = fan_materials[i];
|
||||
vertex_index = fans_v[i];
|
||||
normal_index = fans_n[i];
|
||||
tex_index = fans_tc[i];
|
||||
cout << "# usemtl " << material << endl;
|
||||
cout << "tf ";
|
||||
for ( j = 0; j < (int)vertex_index.size(); ++j ) {
|
||||
cout << vertex_index[j] << "/" << tex_index[j] << " ";
|
||||
cout << vertex_index[j];
|
||||
if ( normal_index.size() ) {
|
||||
cout << "/" << normal_index[j];
|
||||
}
|
||||
cout << "/" << tex_index[j] << " ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
|
||||
|
||||
#include "iochannel.hxx"
|
||||
// #include "garmin.hxx"
|
||||
// #include "nmea.hxx"
|
||||
|
||||
|
||||
// constructor
|
||||
|
||||
@@ -3,16 +3,14 @@
|
||||
#include STL_IOSTREAM
|
||||
#include "lowlevel.hxx"
|
||||
|
||||
#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||
SG_USING_STD(cout);
|
||||
SG_USING_STD(endl);
|
||||
#endif
|
||||
|
||||
|
||||
static const int sgEndianTest = 1;
|
||||
#define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
|
||||
#define sgIsBigEndian (*((char *) &sgEndianTest ) == 0)
|
||||
|
||||
SG_USING_STD(cout);
|
||||
SG_USING_STD(endl);
|
||||
|
||||
|
||||
int main() {
|
||||
cout << "This machine is ";
|
||||
@@ -23,6 +21,8 @@ int main() {
|
||||
}
|
||||
cout << "endian" << endl;
|
||||
|
||||
cout << "sizeof(short) = " << sizeof(short) << endl;
|
||||
|
||||
short s = 1111;
|
||||
cout << "short s = " << s << endl;
|
||||
sgEndianSwap((unsigned short *)&s);
|
||||
|
||||
@@ -22,7 +22,12 @@
|
||||
//
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <simgear_config.h>
|
||||
#endif
|
||||
|
||||
#include <simgear/compiler.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
@@ -39,27 +44,34 @@
|
||||
SG_USING_STD( string );
|
||||
SG_USING_STD( vector );
|
||||
|
||||
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||
SG_USING_STD( cout );
|
||||
SG_USING_STD( endl );
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
SG_BOUNDING_SPHERE = 0,
|
||||
|
||||
SG_VERTEX_LIST = 1,
|
||||
SG_COLOR_LIST = 4,
|
||||
SG_NORMAL_LIST = 2,
|
||||
SG_TEXCOORD_LIST = 3,
|
||||
|
||||
SG_POINTS = 9,
|
||||
|
||||
SG_TRIANGLE_FACES = 10,
|
||||
SG_TRIANGLE_STRIPS = 11,
|
||||
SG_TRIANGLE_FANS = 12
|
||||
} tgObjectTypes;
|
||||
} sgObjectTypes;
|
||||
|
||||
enum {
|
||||
SG_MATERIAL = 0
|
||||
} tgPropertyTypes;
|
||||
SG_IDX_VERTICES = 0x01,
|
||||
SG_IDX_NORMALS = 0x02,
|
||||
SG_IDX_COLORS = 0x04,
|
||||
SG_IDX_TEXCOORDS = 0x08
|
||||
} sgIndexTypes;
|
||||
|
||||
enum {
|
||||
SG_MATERIAL = 0,
|
||||
SG_INDEX_TYPES = 1
|
||||
} sgPropertyTypes;
|
||||
|
||||
|
||||
|
||||
class sgSimpleBuffer {
|
||||
@@ -77,7 +89,7 @@ public:
|
||||
while ( size < s ) {
|
||||
size *= 2;
|
||||
}
|
||||
cout << "Creating a new buffer of size = " << size << endl;
|
||||
SG_LOG(SG_EVENT, SG_DEBUG, "Creating a new buffer of size = " << size);
|
||||
ptr = new char[size];
|
||||
}
|
||||
|
||||
@@ -95,7 +107,7 @@ public:
|
||||
while ( size < s ) {
|
||||
size *= 2;
|
||||
}
|
||||
cout << "resizing buffer to size = " << size << endl;
|
||||
SG_LOG(SG_EVENT, SG_DEBUG, "resizing buffer to size = " << size);
|
||||
ptr = new char[size];
|
||||
}
|
||||
}
|
||||
@@ -145,11 +157,131 @@ double sgCalcBoundingRadius( Point3D center, point_list& wgs84_nodes ) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// read object properties
|
||||
static void read_object( gzFile fp,
|
||||
int obj_type,
|
||||
int nproperties,
|
||||
int nelements,
|
||||
group_list *vertices,
|
||||
group_list *normals,
|
||||
group_list *colors,
|
||||
group_list *texcoords,
|
||||
string_list *materials )
|
||||
{
|
||||
unsigned int nbytes;
|
||||
unsigned char idx_mask;
|
||||
int idx_size;
|
||||
bool do_vertices, do_normals, do_colors, do_texcoords;
|
||||
int j, k, idx;
|
||||
static sgSimpleBuffer buf( 32768 ); // 32 Kb
|
||||
char material[256];
|
||||
|
||||
// default values
|
||||
if ( obj_type == SG_POINTS ) {
|
||||
idx_size = 1;
|
||||
idx_mask = SG_IDX_VERTICES;
|
||||
do_vertices = true;
|
||||
do_normals = false;
|
||||
do_colors = false;
|
||||
do_texcoords = false;
|
||||
} else {
|
||||
idx_size = 2;
|
||||
idx_mask = (char)(SG_IDX_VERTICES | SG_IDX_TEXCOORDS);
|
||||
do_vertices = true;
|
||||
do_normals = false;
|
||||
do_colors = false;
|
||||
do_texcoords = true;
|
||||
}
|
||||
|
||||
for ( j = 0; j < nproperties; ++j ) {
|
||||
char prop_type;
|
||||
sgReadChar( fp, &prop_type );
|
||||
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "property size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
if ( prop_type == SG_MATERIAL ) {
|
||||
strncpy( material, ptr, nbytes );
|
||||
material[nbytes] = '\0';
|
||||
// cout << "material type = " << material << endl;
|
||||
} else if ( prop_type == SG_INDEX_TYPES ) {
|
||||
idx_mask = ptr[0];
|
||||
// cout << "idx_mask = " << (int)idx_mask << endl;
|
||||
idx_size = 0;
|
||||
do_vertices = false;
|
||||
do_normals = false;
|
||||
do_colors = false;
|
||||
do_texcoords = false;
|
||||
if ( idx_mask & SG_IDX_VERTICES ) {
|
||||
do_vertices = true;
|
||||
++idx_size;
|
||||
}
|
||||
if ( idx_mask & SG_IDX_NORMALS ) {
|
||||
do_normals = true;
|
||||
++idx_size;
|
||||
}
|
||||
if ( idx_mask & SG_IDX_COLORS ) {
|
||||
do_colors = true;
|
||||
++idx_size;
|
||||
}
|
||||
if ( idx_mask & SG_IDX_TEXCOORDS ) {
|
||||
do_texcoords = true;
|
||||
++idx_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( j = 0; j < nelements; ++j ) {
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "element size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / (idx_size * sizeof(short));
|
||||
short *sptr = (short *)ptr;
|
||||
int_list vs; vs.clear();
|
||||
int_list ns; ns.clear();
|
||||
int_list cs; cs.clear();
|
||||
int_list tcs; tcs.clear();
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
if ( sgIsBigEndian() ) {
|
||||
for ( idx = 0; idx < idx_size; ++idx ) {
|
||||
sgEndianSwap( (unsigned short *)&(sptr[idx]) );
|
||||
}
|
||||
}
|
||||
idx = 0;
|
||||
if ( do_vertices ) {
|
||||
vs.push_back( sptr[idx++] );
|
||||
}
|
||||
if ( do_normals ) {
|
||||
ns.push_back( sptr[idx++] );
|
||||
}
|
||||
if ( do_colors ) {
|
||||
cs.push_back( sptr[idx++] );
|
||||
}
|
||||
if ( do_texcoords ) {
|
||||
tcs.push_back( sptr[idx++] );
|
||||
}
|
||||
// cout << sptr[0] << " ";
|
||||
sptr += idx_size;
|
||||
}
|
||||
// cout << endl;
|
||||
vertices->push_back( vs );
|
||||
normals->push_back( ns );
|
||||
colors->push_back( cs );
|
||||
texcoords->push_back( tcs );
|
||||
materials->push_back( material );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// read a binary file and populate the provided structures.
|
||||
bool SGBinObject::read_bin( const string& file ) {
|
||||
Point3D p;
|
||||
int i, j, k;
|
||||
char material[256];
|
||||
unsigned int nbytes;
|
||||
static sgSimpleBuffer buf( 32768 ); // 32 Kb
|
||||
|
||||
@@ -161,24 +293,36 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
normals.clear();
|
||||
texcoords.clear();
|
||||
|
||||
pts_v.clear();
|
||||
pts_n.clear();
|
||||
pts_c.clear();
|
||||
pts_tc.clear();
|
||||
pt_materials.clear();
|
||||
|
||||
tris_v.clear();
|
||||
tris_n.clear();
|
||||
tris_c.clear();
|
||||
tris_tc.clear();
|
||||
tri_materials.clear();
|
||||
|
||||
strips_v.clear();
|
||||
strips_n.clear();
|
||||
strips_c.clear();
|
||||
strips_tc.clear();
|
||||
strip_materials.clear();
|
||||
|
||||
fans_v.clear();
|
||||
fans_n.clear();
|
||||
fans_c.clear();
|
||||
fans_tc.clear();
|
||||
fan_materials.clear();
|
||||
|
||||
|
||||
gzFile fp;
|
||||
if ( (fp = gzopen( file.c_str(), "rb" )) == NULL ) {
|
||||
string filegz = file + ".gz";
|
||||
if ( (fp = gzopen( filegz.c_str(), "rb" )) == NULL ) {
|
||||
// cout << "ERROR: opening " << file << " or " << filegz
|
||||
// << "for reading!" << endl;
|
||||
SG_LOG( SG_EVENT, SG_ALERT,
|
||||
"ERROR: opening " << file << " or " << filegz << "for reading!");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -203,10 +347,11 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
}
|
||||
|
||||
// read creation time
|
||||
time_t calendar_time;
|
||||
sgReadLong( fp, &calendar_time );
|
||||
unsigned int foo_calendar_time;
|
||||
sgReadUInt( fp, &foo_calendar_time );
|
||||
|
||||
#if 0
|
||||
time_t calendar_time = foo_calendar_time;
|
||||
// The following code has a global effect on the host application
|
||||
// and can screws up the time elsewhere. It should be avoided
|
||||
// unless you need this for debugging in which case you should
|
||||
@@ -215,7 +360,7 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
local_tm = localtime( &calendar_time );
|
||||
char time_str[256];
|
||||
strftime( time_str, 256, "%a %b %d %H:%M:%S %Z %Y", local_tm);
|
||||
cout << "File created on " << time_str << endl;
|
||||
SG_LOG( SG_EVENT, SG_DEBUG, "File created on " << time_str);
|
||||
#endif
|
||||
|
||||
// read number of top level objects
|
||||
@@ -295,18 +440,51 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / (sizeof(float) * 3);
|
||||
float *fptr = (float *)ptr;
|
||||
wgs84_nodes.reserve( count );
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
if ( sgIsBigEndian() ) {
|
||||
sgEndianSwap( (unsigned int *)&(fptr[0]) );
|
||||
sgEndianSwap( (unsigned int *)&(fptr[1]) );
|
||||
sgEndianSwap( (unsigned int *)&(fptr[2]) );
|
||||
}
|
||||
p = Point3D( fptr[0], fptr[1], fptr[2] );
|
||||
// cout << "node = " << p << endl;
|
||||
wgs84_nodes.push_back( p );
|
||||
wgs84_nodes.push_back( Point3D(fptr[0], fptr[1], fptr[2]) );
|
||||
fptr += 3;
|
||||
}
|
||||
}
|
||||
} else if ( obj_type == SG_COLOR_LIST ) {
|
||||
// read color list properties
|
||||
for ( j = 0; j < nproperties; ++j ) {
|
||||
char prop_type;
|
||||
sgReadChar( fp, &prop_type );
|
||||
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "property size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
}
|
||||
|
||||
// read color list elements
|
||||
for ( j = 0; j < nelements; ++j ) {
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "element size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / (sizeof(float) * 4);
|
||||
float *fptr = (float *)ptr;
|
||||
colors.reserve(count);
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
if ( sgIsBigEndian() ) {
|
||||
sgEndianSwap( (unsigned int *)&(fptr[0]) );
|
||||
sgEndianSwap( (unsigned int *)&(fptr[1]) );
|
||||
sgEndianSwap( (unsigned int *)&(fptr[2]) );
|
||||
sgEndianSwap( (unsigned int *)&(fptr[3]) );
|
||||
}
|
||||
colors.push_back( Point3D( fptr[0], fptr[1], fptr[2] ) );
|
||||
fptr += 4;
|
||||
}
|
||||
}
|
||||
} else if ( obj_type == SG_NORMAL_LIST ) {
|
||||
// read normal list properties
|
||||
for ( j = 0; j < nproperties; ++j ) {
|
||||
@@ -328,6 +506,7 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
unsigned char *ptr = (unsigned char *)(buf.get_ptr());
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / 3;
|
||||
normals.reserve( count );
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
sgdVec3 normal;
|
||||
sgdSetVec3( normal,
|
||||
@@ -336,9 +515,7 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
(ptr[2]) / 127.5 - 1.0 );
|
||||
sgdNormalizeVec3( normal );
|
||||
|
||||
p = Point3D( normal[0], normal[1], normal[2] );
|
||||
// cout << "normal = " << p << endl;
|
||||
normals.push_back( p );
|
||||
normals.push_back(Point3D(normal[0], normal[1], normal[2]));
|
||||
ptr += 3;
|
||||
}
|
||||
}
|
||||
@@ -364,149 +541,33 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / (sizeof(float) * 2);
|
||||
float *fptr = (float *)ptr;
|
||||
texcoords.reserve(count);
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
if ( sgIsBigEndian() ) {
|
||||
sgEndianSwap( (unsigned int *)&(fptr[0]) );
|
||||
sgEndianSwap( (unsigned int *)&(fptr[1]) );
|
||||
}
|
||||
p = Point3D( fptr[0], fptr[1], 0 );
|
||||
// cout << "texcoord = " << p << endl;
|
||||
texcoords.push_back( p );
|
||||
texcoords.push_back( Point3D( fptr[0], fptr[1], 0 ) );
|
||||
fptr += 2;
|
||||
}
|
||||
}
|
||||
} else if ( obj_type == SG_POINTS ) {
|
||||
// read point elements
|
||||
read_object( fp, SG_POINTS, nproperties, nelements,
|
||||
&pts_v, &pts_n, &pts_c, &pts_tc, &pt_materials );
|
||||
} else if ( obj_type == SG_TRIANGLE_FACES ) {
|
||||
// read triangle face properties
|
||||
for ( j = 0; j < nproperties; ++j ) {
|
||||
char prop_type;
|
||||
sgReadChar( fp, &prop_type );
|
||||
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "property size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
if ( prop_type == SG_MATERIAL ) {
|
||||
strncpy( material, ptr, nbytes );
|
||||
material[nbytes] = '\0';
|
||||
// cout << "material type = " << material << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// read triangle face elements
|
||||
for ( j = 0; j < nelements; ++j ) {
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "element size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / (sizeof(short) * 2);
|
||||
short *sptr = (short *)ptr;
|
||||
int_list vs, tcs;
|
||||
vs.clear(); tcs.clear();
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
if ( sgIsBigEndian() ) {
|
||||
sgEndianSwap( (unsigned short *)&(sptr[0]) );
|
||||
sgEndianSwap( (unsigned short *)&(sptr[1]) );
|
||||
}
|
||||
vs.push_back( sptr[0] );
|
||||
tcs.push_back( sptr[1] );
|
||||
// cout << sptr[0] << "/" << sptr[1] << " ";
|
||||
sptr += 2;
|
||||
}
|
||||
// cout << endl;
|
||||
tris_v.push_back( vs );
|
||||
tris_tc.push_back( tcs );
|
||||
tri_materials.push_back( material );
|
||||
}
|
||||
read_object( fp, SG_TRIANGLE_FACES, nproperties, nelements,
|
||||
&tris_v, &tris_n, &tris_c, &tris_tc, &tri_materials );
|
||||
} else if ( obj_type == SG_TRIANGLE_STRIPS ) {
|
||||
// read triangle strip properties
|
||||
for ( j = 0; j < nproperties; ++j ) {
|
||||
char prop_type;
|
||||
sgReadChar( fp, &prop_type );
|
||||
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "property size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
if ( prop_type == SG_MATERIAL ) {
|
||||
strncpy( material, ptr, nbytes );
|
||||
material[nbytes] = '\0';
|
||||
// cout << "material type = " << material << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// read triangle strip elements
|
||||
for ( j = 0; j < nelements; ++j ) {
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "element size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / (sizeof(short) * 2);
|
||||
short *sptr = (short *)ptr;
|
||||
int_list vs, tcs;
|
||||
vs.clear(); tcs.clear();
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
if ( sgIsBigEndian() ) {
|
||||
sgEndianSwap( (unsigned short *)&(sptr[0]) );
|
||||
sgEndianSwap( (unsigned short *)&(sptr[1]) );
|
||||
}
|
||||
vs.push_back( sptr[0] );
|
||||
tcs.push_back( sptr[1] );
|
||||
// cout << sptr[0] << "/" << sptr[1] << " ";
|
||||
sptr += 2;
|
||||
}
|
||||
// cout << endl;
|
||||
strips_v.push_back( vs );
|
||||
strips_tc.push_back( tcs );
|
||||
strip_materials.push_back( material );
|
||||
}
|
||||
read_object( fp, SG_TRIANGLE_STRIPS, nproperties, nelements,
|
||||
&strips_v, &strips_n, &strips_c, &strips_tc,
|
||||
&strip_materials );
|
||||
} else if ( obj_type == SG_TRIANGLE_FANS ) {
|
||||
// read triangle fan properties
|
||||
for ( j = 0; j < nproperties; ++j ) {
|
||||
char prop_type;
|
||||
sgReadChar( fp, &prop_type );
|
||||
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "property size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
if ( prop_type == SG_MATERIAL ) {
|
||||
strncpy( material, ptr, nbytes );
|
||||
material[nbytes] = '\0';
|
||||
// cout << "material type = " << material << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// read triangle fan elements
|
||||
for ( j = 0; j < nelements; ++j ) {
|
||||
sgReadUInt( fp, &nbytes );
|
||||
// cout << "element size = " << nbytes << endl;
|
||||
if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
|
||||
char *ptr = buf.get_ptr();
|
||||
sgReadBytes( fp, nbytes, ptr );
|
||||
int count = nbytes / (sizeof(short) * 2);
|
||||
short *sptr = (short *)ptr;
|
||||
int_list vs, tcs;
|
||||
vs.clear(); tcs.clear();
|
||||
for ( k = 0; k < count; ++k ) {
|
||||
if ( sgIsBigEndian() ) {
|
||||
sgEndianSwap( (unsigned short *)&(sptr[0]) );
|
||||
sgEndianSwap( (unsigned short *)&(sptr[1]) );
|
||||
}
|
||||
vs.push_back( sptr[0] );
|
||||
tcs.push_back( sptr[1] );
|
||||
// cout << sptr[0] << "/" << sptr[1] << " ";
|
||||
sptr += 2;
|
||||
}
|
||||
// cout << endl;
|
||||
fans_v.push_back( vs );
|
||||
fans_tc.push_back( tcs );
|
||||
fan_materials.push_back( material );
|
||||
}
|
||||
read_object( fp, SG_TRIANGLE_FANS, nproperties, nelements,
|
||||
&fans_v, &fans_n, &fans_c, &fans_tc, &fan_materials );
|
||||
} else {
|
||||
// unknown object type, just skip
|
||||
|
||||
@@ -554,7 +615,10 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
Point3D p;
|
||||
sgVec2 t;
|
||||
sgVec3 pt;
|
||||
sgVec4 color;
|
||||
int i, j;
|
||||
unsigned char idx_mask;
|
||||
int idx_size;
|
||||
|
||||
string dir = base + "/" + b.gen_base_path();
|
||||
string command = "mkdir -p " + dir;
|
||||
@@ -575,6 +639,8 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
|
||||
sgClearWriteError();
|
||||
|
||||
cout << "points size = " << pts_v.size() << " pt_materials = "
|
||||
<< pt_materials.size() << endl;
|
||||
cout << "triangles size = " << tris_v.size() << " tri_materials = "
|
||||
<< tri_materials.size() << endl;
|
||||
cout << "strips size = " << strips_v.size() << " strip_materials = "
|
||||
@@ -582,7 +648,9 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
cout << "fans size = " << fans_v.size() << " fan_materials = "
|
||||
<< fan_materials.size() << endl;
|
||||
|
||||
cout << "points = " << wgs84_nodes.size() << endl;
|
||||
cout << "nodes = " << wgs84_nodes.size() << endl;
|
||||
cout << "colors = " << colors.size() << endl;
|
||||
cout << "normals = " << normals.size() << endl;
|
||||
cout << "tex coords = " << texcoords.size() << endl;
|
||||
|
||||
// write header magic
|
||||
@@ -597,9 +665,24 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
short nobjects = 0;
|
||||
nobjects++; // for gbs
|
||||
nobjects++; // for vertices
|
||||
nobjects++; // for colors
|
||||
nobjects++; // for normals
|
||||
nobjects++; // for texcoords
|
||||
|
||||
// points
|
||||
short npts = 0;
|
||||
start = 0; end = 1;
|
||||
while ( start < (int)pt_materials.size() ) {
|
||||
material = pt_materials[start];
|
||||
while ( (end < (int)pt_materials.size()) &&
|
||||
(material == pt_materials[end]) ) {
|
||||
end++;
|
||||
}
|
||||
npts++;
|
||||
start = end; end = start + 1;
|
||||
}
|
||||
nobjects += npts;
|
||||
|
||||
// tris
|
||||
short ntris = 0;
|
||||
start = 0; end = 1;
|
||||
@@ -667,6 +750,20 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
sgWriteVec3( fp, pt );
|
||||
}
|
||||
|
||||
// dump vertex color list
|
||||
sgWriteChar( fp, (char)SG_COLOR_LIST ); // type
|
||||
sgWriteShort( fp, 0 ); // nproperties
|
||||
sgWriteShort( fp, 1 ); // nelements
|
||||
sgWriteUInt( fp, colors.size() * sizeof(float) * 4 ); // nbytes
|
||||
for ( i = 0; i < (int)colors.size(); ++i ) {
|
||||
p = colors[i];
|
||||
// Right now we have a place holder for color alpha but we
|
||||
// need to update the interface so the calling program can
|
||||
// provide the info.
|
||||
sgSetVec4( color, p.x(), p.y(), p.z(), 1.0 );
|
||||
sgWriteVec4( fp, color );
|
||||
}
|
||||
|
||||
// dump vertex normal list
|
||||
sgWriteChar( fp, (char)SG_NORMAL_LIST ); // type
|
||||
sgWriteShort( fp, 0 ); // nproperties
|
||||
@@ -692,6 +789,66 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
sgWriteVec2( fp, t );
|
||||
}
|
||||
|
||||
// dump point groups if they exist
|
||||
if ( pts_v.size() > 0 ) {
|
||||
int start = 0;
|
||||
int end = 1;
|
||||
string material;
|
||||
while ( start < (int)pt_materials.size() ) {
|
||||
// find next group
|
||||
material = pt_materials[start];
|
||||
while ( (end < (int)pt_materials.size()) &&
|
||||
(material == pt_materials[end]) )
|
||||
{
|
||||
// cout << "end = " << end << endl;
|
||||
end++;
|
||||
}
|
||||
// cout << "group = " << start << " to " << end - 1 << endl;
|
||||
|
||||
// write group headers
|
||||
sgWriteChar( fp, (char)SG_POINTS ); // type
|
||||
sgWriteShort( fp, 2 ); // nproperties
|
||||
sgWriteShort( fp, end - start ); // nelements
|
||||
|
||||
sgWriteChar( fp, (char)SG_MATERIAL ); // property
|
||||
sgWriteUInt( fp, material.length() ); // nbytes
|
||||
sgWriteBytes( fp, material.length(), material.c_str() );
|
||||
|
||||
idx_mask = 0;
|
||||
idx_size = 0;
|
||||
if ( pts_v.size() ) { idx_mask |= SG_IDX_VERTICES; ++idx_size; }
|
||||
if ( pts_n.size() ) { idx_mask |= SG_IDX_NORMALS; ++idx_size; }
|
||||
if ( pts_c.size() ) { idx_mask |= SG_IDX_COLORS; ++idx_size; }
|
||||
if ( pts_tc.size() ) { idx_mask |= SG_IDX_TEXCOORDS; ++idx_size; }
|
||||
sgWriteChar( fp, (char)SG_INDEX_TYPES ); // property
|
||||
sgWriteUInt( fp, 1 ); // nbytes
|
||||
sgWriteChar( fp, idx_mask );
|
||||
|
||||
// write strips
|
||||
for ( i = start; i < end; ++i ) {
|
||||
// nbytes
|
||||
sgWriteUInt( fp, pts_v[i].size() * idx_size * sizeof(short) );
|
||||
for ( j = 0; j < (int)pts_v[i].size(); ++j ) {
|
||||
if ( pts_v.size() ) {
|
||||
sgWriteShort( fp, (short)pts_v[i][j] );
|
||||
}
|
||||
if ( pts_n.size() ) {
|
||||
sgWriteShort( fp, (short)pts_n[i][j] );
|
||||
}
|
||||
if ( pts_c.size() ) {
|
||||
sgWriteShort( fp, (short)pts_c[i][j] );
|
||||
}
|
||||
if ( pts_tc.size() ) {
|
||||
sgWriteShort( fp, (short)pts_tc[i][j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
start = end;
|
||||
end = start + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// dump individual triangles if they exist
|
||||
if ( tris_v.size() > 0 ) {
|
||||
int start = 0;
|
||||
@@ -710,20 +867,41 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
|
||||
// write group headers
|
||||
sgWriteChar( fp, (char)SG_TRIANGLE_FACES ); // type
|
||||
sgWriteShort( fp, 1 ); // nproperties
|
||||
sgWriteShort( fp, 2 ); // nproperties
|
||||
sgWriteShort( fp, 1 ); // nelements
|
||||
|
||||
sgWriteChar( fp, (char)SG_MATERIAL ); // property
|
||||
sgWriteUInt( fp, material.length() ); // nbytes
|
||||
sgWriteBytes( fp, material.length(), material.c_str() );
|
||||
|
||||
sgWriteUInt( fp, (end - start) * 3 * 2 * sizeof(short) ); // nbytes
|
||||
idx_mask = 0;
|
||||
idx_size = 0;
|
||||
if ( tris_v.size() ) { idx_mask |= SG_IDX_VERTICES; ++idx_size; }
|
||||
if ( tris_n.size() ) { idx_mask |= SG_IDX_NORMALS; ++idx_size; }
|
||||
if ( tris_c.size() ) { idx_mask |= SG_IDX_COLORS; ++idx_size; }
|
||||
if ( tris_tc.size() ) { idx_mask |= SG_IDX_TEXCOORDS; ++idx_size; }
|
||||
sgWriteChar( fp, (char)SG_INDEX_TYPES ); // property
|
||||
sgWriteUInt( fp, 1 ); // nbytes
|
||||
sgWriteChar( fp, idx_mask );
|
||||
|
||||
// nbytes
|
||||
sgWriteUInt( fp, (end - start) * 3 * idx_size * sizeof(short) );
|
||||
|
||||
// write group
|
||||
for ( i = start; i < end; ++i ) {
|
||||
for ( j = 0; j < 3; ++j ) {
|
||||
sgWriteShort( fp, (short)tris_v[i][j] );
|
||||
sgWriteShort( fp, (short)tris_tc[i][j] );
|
||||
if ( tris_v.size() ) {
|
||||
sgWriteShort( fp, (short)tris_v[i][j] );
|
||||
}
|
||||
if ( tris_n.size() ) {
|
||||
sgWriteShort( fp, (short)tris_n[i][j] );
|
||||
}
|
||||
if ( tris_c.size() ) {
|
||||
sgWriteShort( fp, (short)tris_c[i][j] );
|
||||
}
|
||||
if ( tris_tc.size() ) {
|
||||
sgWriteShort( fp, (short)tris_tc[i][j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -750,20 +928,40 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
|
||||
// write group headers
|
||||
sgWriteChar( fp, (char)SG_TRIANGLE_STRIPS ); // type
|
||||
sgWriteShort( fp, 1 ); // nproperties
|
||||
sgWriteShort( fp, 2 ); // nproperties
|
||||
sgWriteShort( fp, end - start ); // nelements
|
||||
|
||||
sgWriteChar( fp, (char)SG_MATERIAL ); // property
|
||||
sgWriteUInt( fp, material.length() ); // nbytes
|
||||
sgWriteBytes( fp, material.length(), material.c_str() );
|
||||
|
||||
idx_mask = 0;
|
||||
idx_size = 0;
|
||||
if ( strips_v.size() ) { idx_mask |= SG_IDX_VERTICES; ++idx_size; }
|
||||
if ( strips_n.size() ) { idx_mask |= SG_IDX_NORMALS; ++idx_size; }
|
||||
if ( strips_c.size() ) { idx_mask |= SG_IDX_COLORS; ++idx_size; }
|
||||
if ( strips_tc.size() ) { idx_mask |= SG_IDX_TEXCOORDS; ++idx_size;}
|
||||
sgWriteChar( fp, (char)SG_INDEX_TYPES ); // property
|
||||
sgWriteUInt( fp, 1 ); // nbytes
|
||||
sgWriteChar( fp, idx_mask );
|
||||
|
||||
// write strips
|
||||
for ( i = start; i < end; ++i ) {
|
||||
// nbytes
|
||||
sgWriteUInt( fp, strips_v[i].size() * 2 * sizeof(short) );
|
||||
sgWriteUInt( fp, strips_v[i].size() * idx_size * sizeof(short));
|
||||
for ( j = 0; j < (int)strips_v[i].size(); ++j ) {
|
||||
sgWriteShort( fp, (short)strips_v[i][j] );
|
||||
sgWriteShort( fp, (short)strips_tc[i][j] );
|
||||
if ( strips_v.size() ) {
|
||||
sgWriteShort( fp, (short)strips_v[i][j] );
|
||||
}
|
||||
if ( strips_n.size() ) {
|
||||
sgWriteShort( fp, (short)strips_n[i][j] );
|
||||
}
|
||||
if ( strips_c.size() ) {
|
||||
sgWriteShort( fp, (short)strips_c[i][j] );
|
||||
}
|
||||
if ( strips_tc.size() ) {
|
||||
sgWriteShort( fp, (short)strips_tc[i][j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,20 +988,40 @@ bool SGBinObject::write_bin( const string& base, const string& name,
|
||||
|
||||
// write group headers
|
||||
sgWriteChar( fp, (char)SG_TRIANGLE_FANS ); // type
|
||||
sgWriteShort( fp, 1 ); // nproperties
|
||||
sgWriteShort( fp, 2 ); // nproperties
|
||||
sgWriteShort( fp, end - start ); // nelements
|
||||
|
||||
sgWriteChar( fp, (char)SG_MATERIAL ); // property
|
||||
sgWriteUInt( fp, material.length() ); // nbytes
|
||||
sgWriteBytes( fp, material.length(), material.c_str() );
|
||||
|
||||
idx_mask = 0;
|
||||
idx_size = 0;
|
||||
if ( fans_v.size() ) { idx_mask |= SG_IDX_VERTICES; ++idx_size; }
|
||||
if ( fans_n.size() ) { idx_mask |= SG_IDX_NORMALS; ++idx_size; }
|
||||
if ( fans_c.size() ) { idx_mask |= SG_IDX_COLORS; ++idx_size; }
|
||||
if ( fans_tc.size() ) { idx_mask |= SG_IDX_TEXCOORDS; ++idx_size; }
|
||||
sgWriteChar( fp, (char)SG_INDEX_TYPES ); // property
|
||||
sgWriteUInt( fp, 1 ); // nbytes
|
||||
sgWriteChar( fp, idx_mask );
|
||||
|
||||
// write fans
|
||||
for ( i = start; i < end; ++i ) {
|
||||
// nbytes
|
||||
sgWriteUInt( fp, fans_v[i].size() * 2 * sizeof(short) );
|
||||
sgWriteUInt( fp, fans_v[i].size() * idx_size * sizeof(short) );
|
||||
for ( j = 0; j < (int)fans_v[i].size(); ++j ) {
|
||||
sgWriteShort( fp, (short)fans_v[i][j] );
|
||||
sgWriteShort( fp, (short)fans_tc[i][j] );
|
||||
if ( fans_v.size() ) {
|
||||
sgWriteShort( fp, (short)fans_v[i][j] );
|
||||
}
|
||||
if ( fans_n.size() ) {
|
||||
sgWriteShort( fp, (short)fans_n[i][j] );
|
||||
}
|
||||
if ( fans_c.size() ) {
|
||||
sgWriteShort( fp, (short)fans_c[i][j] );
|
||||
}
|
||||
if ( fans_tc.size() ) {
|
||||
sgWriteShort( fp, (short)fans_tc[i][j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ typedef group_list::const_iterator const_group_list_iterator;
|
||||
* - property: prop_typecode, nbytes, BYTE+
|
||||
*
|
||||
* - obj_typecode: bounding sphere | vertices | normals | texcoords |
|
||||
* triangles | fans | strips
|
||||
* points | triangles | fans | strips
|
||||
*
|
||||
* - prop_typecode: material_name | ???
|
||||
*
|
||||
@@ -91,58 +91,103 @@ class SGBinObject {
|
||||
|
||||
Point3D gbs_center;
|
||||
float gbs_radius;
|
||||
point_list wgs84_nodes;
|
||||
point_list normals;
|
||||
point_list texcoords;
|
||||
group_list tris_v;
|
||||
group_list tris_tc;
|
||||
string_list tri_materials;
|
||||
group_list strips_v;
|
||||
group_list strips_tc;
|
||||
string_list strip_materials;
|
||||
group_list fans_v;
|
||||
group_list fans_tc;
|
||||
string_list fan_materials;
|
||||
|
||||
point_list wgs84_nodes; // vertex list
|
||||
point_list colors; // color list
|
||||
point_list normals; // normal list
|
||||
point_list texcoords; // texture coordinate list
|
||||
|
||||
group_list pts_v; // points vertex index
|
||||
group_list pts_n; // points normal index
|
||||
group_list pts_c; // points color index
|
||||
group_list pts_tc; // points texture coordinate index
|
||||
string_list pt_materials; // points materials
|
||||
|
||||
group_list tris_v; // triangles vertex index
|
||||
group_list tris_n; // triangles normal index
|
||||
group_list tris_c; // triangles color index
|
||||
group_list tris_tc; // triangles texture coordinate index
|
||||
string_list tri_materials; // triangles materials
|
||||
|
||||
group_list strips_v; // tristrips vertex index
|
||||
group_list strips_n; // tristrips normal index
|
||||
group_list strips_c; // tristrips color index
|
||||
group_list strips_tc; // tristrips texture coordinate index
|
||||
string_list strip_materials;// tristrips materials
|
||||
|
||||
group_list fans_v; // fans vertex index
|
||||
group_list fans_n; // fans normal index
|
||||
group_list fans_c; // fans color index
|
||||
group_list fans_tc; // fans texture coordinate index
|
||||
string_list fan_materials; // fans materials
|
||||
|
||||
public:
|
||||
|
||||
inline unsigned short get_version() const { return version; }
|
||||
|
||||
inline Point3D get_gbs_center() const { return gbs_center; }
|
||||
inline void set_gbs_center( Point3D p ) { gbs_center = p; }
|
||||
inline const Point3D& get_gbs_center() const { return gbs_center; }
|
||||
inline void set_gbs_center( const Point3D& p ) { gbs_center = p; }
|
||||
|
||||
inline float get_gbs_radius() const { return gbs_radius; }
|
||||
inline void set_gbs_radius( float r ) { gbs_radius = r; }
|
||||
|
||||
inline point_list get_wgs84_nodes() const { return wgs84_nodes; }
|
||||
inline void set_wgs84_nodes( point_list n ) { wgs84_nodes = n; }
|
||||
inline const point_list& get_wgs84_nodes() const { return wgs84_nodes; }
|
||||
inline void set_wgs84_nodes( const point_list& n ) { wgs84_nodes = n; }
|
||||
|
||||
inline point_list get_normals() const { return normals; }
|
||||
inline void set_normals( point_list n ) { normals = n; }
|
||||
inline const point_list& get_colors() const { return colors; }
|
||||
inline void set_colors( const point_list& c ) { colors = c; }
|
||||
|
||||
inline point_list get_texcoords() const { return texcoords; }
|
||||
inline void set_texcoords( point_list t ) { texcoords = t; }
|
||||
inline const point_list& get_normals() const { return normals; }
|
||||
inline void set_normals( const point_list& n ) { normals = n; }
|
||||
|
||||
inline group_list get_tris_v() const { return tris_v; }
|
||||
inline void set_tris_v( group_list g ) { tris_v = g; }
|
||||
inline group_list get_tris_tc() const { return tris_tc; }
|
||||
inline void set_tris_tc( group_list g ) { tris_tc = g; }
|
||||
inline string_list get_tri_materials() const { return tri_materials; }
|
||||
inline void set_tri_materials( string_list s ) { tri_materials = s; }
|
||||
inline const point_list& get_texcoords() const { return texcoords; }
|
||||
inline void set_texcoords( const point_list& t ) { texcoords = t; }
|
||||
|
||||
inline const group_list& get_pts_v() const { return pts_v; }
|
||||
inline void set_pts_v( const group_list& g ) { pts_v = g; }
|
||||
inline const group_list& get_pts_n() const { return pts_n; }
|
||||
inline void set_pts_n( const group_list& g ) { pts_n = g; }
|
||||
inline const group_list& get_pts_c() const { return pts_c; }
|
||||
inline void set_pts_c( const group_list& g ) { pts_c = g; }
|
||||
inline const group_list& get_pts_tc() const { return pts_tc; }
|
||||
inline void set_pts_tc( const group_list& g ) { pts_tc = g; }
|
||||
inline const string_list& get_pt_materials() const { return pt_materials; }
|
||||
inline void set_pt_materials( const string_list& s ) { pt_materials = s; }
|
||||
|
||||
inline const group_list& get_tris_v() const { return tris_v; }
|
||||
inline void set_tris_v( const group_list& g ) { tris_v = g; }
|
||||
inline const group_list& get_tris_n() const { return tris_n; }
|
||||
inline void set_tris_n( const group_list& g ) { tris_n = g; }
|
||||
inline const group_list& get_tris_c() const { return tris_c; }
|
||||
inline void set_tris_c( const group_list& g ) { tris_c = g; }
|
||||
inline const group_list& get_tris_tc() const { return tris_tc; }
|
||||
inline void set_tris_tc( const group_list& g ) { tris_tc = g; }
|
||||
inline const string_list& get_tri_materials() const { return tri_materials; }
|
||||
inline void set_tri_materials( const string_list& s ) { tri_materials = s; }
|
||||
|
||||
inline group_list get_strips_v() const { return strips_v; }
|
||||
inline void set_strips_v( group_list g ) { strips_v = g; }
|
||||
inline group_list get_strips_tc() const { return strips_tc; }
|
||||
inline void set_strips_tc( group_list g ) { strips_tc = g; }
|
||||
inline string_list get_strip_materials() const { return strip_materials; }
|
||||
inline void set_strip_materials( string_list s ) { strip_materials = s; }
|
||||
inline const group_list& get_strips_v() const { return strips_v; }
|
||||
inline void set_strips_v( const group_list& g ) { strips_v = g; }
|
||||
inline const group_list& get_strips_n() const { return strips_n; }
|
||||
inline void set_strips_n( const group_list& g ) { strips_n = g; }
|
||||
inline const group_list& get_strips_c() const { return strips_c; }
|
||||
inline void set_strips_c( const group_list& g ) { strips_c = g; }
|
||||
|
||||
inline const group_list& get_strips_tc() const { return strips_tc; }
|
||||
inline void set_strips_tc( const group_list& g ) { strips_tc = g; }
|
||||
inline const string_list& get_strip_materials() const { return strip_materials; }
|
||||
inline void set_strip_materials( const string_list& s ) { strip_materials = s; }
|
||||
|
||||
inline group_list get_fans_v() const { return fans_v; }
|
||||
inline void set_fans_v( group_list g ) { fans_v = g; }
|
||||
inline group_list get_fans_tc() const { return fans_tc; }
|
||||
inline void set_fans_tc( group_list g ) { fans_tc = g; }
|
||||
inline string_list get_fan_materials() const { return fan_materials; }
|
||||
inline void set_fan_materials( string_list s ) { fan_materials = s; }
|
||||
inline const group_list& get_fans_v() const { return fans_v; }
|
||||
inline void set_fans_v( const group_list& g ) { fans_v = g; }
|
||||
inline const group_list& get_fans_n() const { return fans_n; }
|
||||
inline void set_fans_n( const group_list& g ) { fans_n = g; }
|
||||
inline const group_list& get_fans_c() const { return fans_c; }
|
||||
inline void set_fans_c( const group_list& g ) { fans_c = g; }
|
||||
|
||||
inline const group_list& get_fans_tc() const { return fans_tc; }
|
||||
inline void set_fans_tc( const group_list& g ) { fans_tc = g; }
|
||||
inline const string_list& get_fan_materials() const { return fan_materials; }
|
||||
inline void set_fan_materials( const string_list& s ) { fan_materials = s; }
|
||||
|
||||
/**
|
||||
* Read a binary file object and populate the provided structures.
|
||||
|
||||
@@ -55,7 +55,7 @@ class SGSerial : public SGIOChannel {
|
||||
|
||||
string device;
|
||||
string baud;
|
||||
FGSerialPort port;
|
||||
SGSerialPort port;
|
||||
|
||||
char save_buf[ 2 * SG_IO_MAX_MSG_SIZE ];
|
||||
int save_len;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// sg_socket.cxx -- Socket I/O routines
|
||||
//
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
// Modified by Bernie Bright <bbright@bigpond.net.au>, May 2002.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
//
|
||||
@@ -23,16 +24,6 @@
|
||||
|
||||
#include <simgear/compiler.h>
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__MINGW32__)
|
||||
# include <sys/time.h> // select()
|
||||
# include <sys/types.h> // socket(), bind(), select(), accept()
|
||||
# include <sys/socket.h> // socket(), bind(), listen(), accept()
|
||||
# include <netinet/in.h> // struct sockaddr_in
|
||||
# include <netdb.h> // gethostbyname()
|
||||
# include <unistd.h> // select(), fsync()/fdatasync(), fcntl()
|
||||
# include <fcntl.h> // fcntl()
|
||||
#endif
|
||||
|
||||
#if defined( sgi )
|
||||
#include <strings.h>
|
||||
#endif
|
||||
@@ -41,25 +32,30 @@
|
||||
|
||||
#include "sg_socket.hxx"
|
||||
|
||||
bool SGSocket::init = false;
|
||||
|
||||
SGSocket::SGSocket( const string& host, const string& port,
|
||||
SGSocket::SGSocket( const string& host, const string& port_,
|
||||
const string& style ) :
|
||||
hostname(host),
|
||||
port_str(port),
|
||||
save_len(0)
|
||||
port_str(port_),
|
||||
save_len(0),
|
||||
client(0),
|
||||
is_tcp(false),
|
||||
is_server(false),
|
||||
first_read(false)
|
||||
{
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
if (!wsock_init && !wsastartup()) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "Winsock not available");
|
||||
if (!init)
|
||||
{
|
||||
netInit(NULL, NULL); // plib-1.4.2 compatible
|
||||
init = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( style == "udp" ) {
|
||||
sock_style = SOCK_DGRAM;
|
||||
} else if ( style == "tcp" ) {
|
||||
sock_style = SOCK_STREAM;
|
||||
} else {
|
||||
sock_style = SOCK_DGRAM;
|
||||
if ( style == "tcp" )
|
||||
{
|
||||
is_tcp = true;
|
||||
}
|
||||
else if ( style != (string)"udp" )
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: SGSocket() unknown style = " << style );
|
||||
}
|
||||
@@ -68,126 +64,65 @@ SGSocket::SGSocket( const string& host, const string& port,
|
||||
}
|
||||
|
||||
|
||||
SGSocket::~SGSocket() {
|
||||
SGSocket::~SGSocket()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
|
||||
SGSocket::SocketType SGSocket::make_server_socket () {
|
||||
struct sockaddr_in name;
|
||||
|
||||
#if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) || defined( sgi ) || defined( _MSC_VER ) || defined(__MINGW32__) || defined( __APPLE__ )
|
||||
int length;
|
||||
#else
|
||||
socklen_t length;
|
||||
#endif
|
||||
|
||||
// Create the socket.
|
||||
sock = socket (PF_INET, sock_style, 0);
|
||||
if (sock == INVALID_SOCKET) {
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: socket() failed in make_server_socket()" );
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// Give the socket a name.
|
||||
name.sin_family = AF_INET;
|
||||
name.sin_addr.s_addr = INADDR_ANY;
|
||||
name.sin_port = htons(port); // set port to zero to let system pick
|
||||
name.sin_addr.s_addr = htonl (INADDR_ANY);
|
||||
if (bind (sock, (struct sockaddr *) &name, sizeof (name)) != 0) {
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: bind() failed in make_server_socket()" );
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// Find the assigned port number
|
||||
length = sizeof(struct sockaddr_in);
|
||||
if ( getsockname(sock, (struct sockaddr *) &name, &length) ) {
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: getsockname() failed in make_server_socket()" );
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
port = ntohs(name.sin_port);
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
||||
SGSocket::SocketType SGSocket::make_client_socket () {
|
||||
struct sockaddr_in name;
|
||||
struct hostent *hp;
|
||||
|
||||
SG_LOG( SG_IO, SG_INFO, "Make client socket()" );
|
||||
|
||||
// Create the socket.
|
||||
sock = socket (PF_INET, sock_style, 0);
|
||||
if (sock == INVALID_SOCKET) {
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: socket() failed in make_server_socket()" );
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// specify address family
|
||||
name.sin_family = AF_INET;
|
||||
|
||||
// get the hosts official name/info
|
||||
hp = gethostbyname( hostname.c_str() );
|
||||
if (hp == NULL) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error: hostname lookup failed" );
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// Connect this socket to the host and the port specified on the
|
||||
// command line
|
||||
#if defined( __CYGWIN__ ) || defined( __CYGWIN32__ )
|
||||
bcopy(hp->h_addr, (char *)(&(name.sin_addr.s_addr)), hp->h_length);
|
||||
#else
|
||||
bcopy(hp->h_addr, &(name.sin_addr.s_addr), hp->h_length);
|
||||
#endif
|
||||
name.sin_port = htons(port);
|
||||
|
||||
if ( connect(sock, (struct sockaddr *) &name,
|
||||
sizeof(struct sockaddr_in)) != 0 )
|
||||
bool
|
||||
SGSocket::make_server_socket()
|
||||
{
|
||||
if (!sock.open( is_tcp ))
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: socket() failed in make_server_socket()" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sock.bind( "", port ) < 0)
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: bind() failed in make_server_socket()" );
|
||||
sock.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SGSocket::make_client_socket()
|
||||
{
|
||||
if (!sock.open( is_tcp ))
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: socket() failed in make_client_socket()" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sock.connect( hostname.c_str(), port ) < 0)
|
||||
{
|
||||
closesocket(sock);
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: connect() failed in make_client_socket()" );
|
||||
return INVALID_SOCKET;
|
||||
sock.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return sock;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Wrapper functions
|
||||
size_t SGSocket::readsocket( int fd, void *buf, size_t count ) {
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
return ::recv( fd, (char *)buf, count, 0 );
|
||||
#else
|
||||
return ::read( fd, buf, count );
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t SGSocket::writesocket( int fd, const void *buf, size_t count ) {
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
return ::send( fd, (const char*)buf, count, 0 );
|
||||
#else
|
||||
return ::write( fd, buf, count );
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__MINGW32__)
|
||||
int SGSocket::closesocket( int fd ) {
|
||||
return ::close( fd );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// If specified as a server (in direction for now) open the master
|
||||
// listening socket. If specified as a client (out direction), open a
|
||||
// connection to a server.
|
||||
bool SGSocket::open( const SGProtocolDir d ) {
|
||||
set_dir( d );
|
||||
bool
|
||||
SGSocket::open( SGProtocolDir direction )
|
||||
{
|
||||
set_dir( direction );
|
||||
|
||||
is_server = is_tcp &&
|
||||
(direction == SG_IO_IN || direction == SG_IO_BI);
|
||||
|
||||
if ( port_str == "" || port_str == "any" ) {
|
||||
port = 0;
|
||||
@@ -195,69 +130,71 @@ bool SGSocket::open( const SGProtocolDir d ) {
|
||||
port = atoi( port_str.c_str() );
|
||||
}
|
||||
|
||||
// client_connections.clear();
|
||||
|
||||
if ( get_dir() == SG_IO_IN ) {
|
||||
if (direction == SG_IO_IN)
|
||||
{
|
||||
// this means server for now
|
||||
|
||||
// Setup socket to listen on. Set "port" before making this
|
||||
// call. A port of "0" indicates that we want to let the os
|
||||
// pick any available port.
|
||||
sock = make_server_socket();
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "socket creation failed" );
|
||||
if (!make_server_socket())
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT, "SG_IO_IN socket creation failed" );
|
||||
return false;
|
||||
}
|
||||
|
||||
SG_LOG( SG_IO, SG_INFO, "socket is connected to port = " << port );
|
||||
|
||||
if ( sock_style == SOCK_DGRAM ) {
|
||||
if ( !is_tcp )
|
||||
{
|
||||
// Non-blocking UDP
|
||||
nonblock();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Blocking TCP
|
||||
// Specify the maximum length of the connection queue
|
||||
listen( sock, SG_MAX_SOCKET_QUEUE );
|
||||
sock.listen( SG_MAX_SOCKET_QUEUE );
|
||||
}
|
||||
|
||||
} else if ( get_dir() == SG_IO_OUT ) {
|
||||
}
|
||||
else if (direction == SG_IO_OUT)
|
||||
{
|
||||
// this means client for now
|
||||
|
||||
sock = make_client_socket();
|
||||
// TODO: check for error.
|
||||
if (!make_client_socket())
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT, "SG_IO_OUT socket creation failed" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( sock_style == SOCK_DGRAM ) {
|
||||
if ( !is_tcp )
|
||||
{
|
||||
// Non-blocking UDP
|
||||
nonblock();
|
||||
}
|
||||
} else if ( get_dir() == SG_IO_BI && sock_style == SOCK_STREAM ) {
|
||||
}
|
||||
else if (direction == SG_IO_BI && is_tcp)
|
||||
{
|
||||
// this means server for TCP sockets
|
||||
|
||||
// Setup socket to listen on. Set "port" before making this
|
||||
// call. A port of "0" indicates that we want to let the os
|
||||
// pick any available port.
|
||||
sock = make_server_socket();
|
||||
// TODO: check for error.
|
||||
|
||||
SG_LOG( SG_IO, SG_INFO, "socket is connected to port = " << port );
|
||||
|
||||
if (!make_server_socket())
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT, "SG_IO_BI socket creation failed" );
|
||||
return false;
|
||||
}
|
||||
// Blocking TCP
|
||||
// Specify the maximum length of the connection queue
|
||||
listen( sock, SG_MAX_SOCKET_QUEUE );
|
||||
} else {
|
||||
sock.listen( SG_MAX_SOCKET_QUEUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: bidirection mode not available for UDP sockets." );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( sock < 0 ) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error opening socket: " << hostname
|
||||
<< ":" << port );
|
||||
return false;
|
||||
}
|
||||
|
||||
// extra SOCK_STREAM stuff
|
||||
msgsock = INVALID_SOCKET;
|
||||
first_read = false;
|
||||
|
||||
return true;
|
||||
@@ -266,40 +203,25 @@ bool SGSocket::open( const SGProtocolDir d ) {
|
||||
|
||||
// read data from socket (server)
|
||||
// read a block of data of specified size
|
||||
int SGSocket::read( char *buf, int length ) {
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
int
|
||||
SGSocket::read( char *buf, int length )
|
||||
{
|
||||
if (sock.getHandle() == -1 &&
|
||||
(client == 0 || client->getHandle() == -1))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
// check for potential input
|
||||
fd_set ready;
|
||||
FD_ZERO(&ready);
|
||||
FD_SET(sock, &ready);
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
// test for any input available on sock (returning immediately, even if
|
||||
// nothing)
|
||||
select(32, &ready, 0, 0, &tv);
|
||||
int result = poll();
|
||||
|
||||
if ( FD_ISSET(sock, &ready) ) {
|
||||
// cout << "data ready" << endl;
|
||||
if (result > 0)
|
||||
{
|
||||
result = sock.recv( buf, length );
|
||||
|
||||
if ( sock_style == SOCK_STREAM ) {
|
||||
if ( msgsock == INVALID_SOCKET ) {
|
||||
msgsock = accept(sock, 0, 0);
|
||||
closesocket(sock);
|
||||
sock = msgsock;
|
||||
} else {
|
||||
result = readsocket( sock, buf, length );
|
||||
}
|
||||
} else {
|
||||
result = readsocket( sock, buf, length );
|
||||
}
|
||||
|
||||
if ( result != length ) {
|
||||
if ( result != length )
|
||||
{
|
||||
SG_LOG( SG_IO, SG_INFO,
|
||||
"Warning: read() not enough bytes." );
|
||||
}
|
||||
@@ -310,92 +232,74 @@ int SGSocket::read( char *buf, int length ) {
|
||||
|
||||
|
||||
// read a line of data, length is max size of input buffer
|
||||
int SGSocket::readline( char *buf, int length ) {
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
int
|
||||
SGSocket::readline( char *buf, int length )
|
||||
{
|
||||
if (sock.getHandle() == -1 &&
|
||||
(client == 0 || client->getHandle() == -1))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// cout << "sock = " << sock << endl;
|
||||
|
||||
// check for potential input
|
||||
fd_set ready;
|
||||
FD_ZERO(&ready);
|
||||
FD_SET(sock, &ready);
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
// test for any input read on sock (returning immediately, even if
|
||||
// nothing)
|
||||
int result = select(32, &ready, 0, 0, &tv);
|
||||
// cout << "result = " << result << endl;
|
||||
int result = this->poll();
|
||||
|
||||
if ( FD_ISSET(sock, &ready) ) {
|
||||
// cout << "fd change state\n";
|
||||
if (result > 0)
|
||||
{
|
||||
// read a chunk, keep in the save buffer until we have the
|
||||
// requested amount read
|
||||
|
||||
if ( sock_style == SOCK_STREAM ) {
|
||||
// cout << "sock_stream\n";
|
||||
if ( msgsock == INVALID_SOCKET ) {
|
||||
// cout << "msgsock == invalid\n";
|
||||
msgsock = sock;
|
||||
sock = accept(msgsock, 0, 0);
|
||||
} else {
|
||||
// cout << "ready to read\n";
|
||||
char *buf_ptr = save_buf + save_len;
|
||||
result = readsocket( sock, buf_ptr, SG_IO_MAX_MSG_SIZE
|
||||
- save_len );
|
||||
// cout << "read result = " << result << endl;
|
||||
|
||||
if ( result > 0 ) {
|
||||
first_read = true;
|
||||
}
|
||||
|
||||
save_len += result;
|
||||
|
||||
// Try and detect that the remote end died. This
|
||||
// could cause problems so if you see connections
|
||||
// dropping for unexplained reasons, LOOK HERE!
|
||||
if ( result == 0 && save_len == 0 && first_read == true ) {
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Connection closed by foreign host." );
|
||||
close();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (is_tcp)
|
||||
{
|
||||
char *buf_ptr = save_buf + save_len;
|
||||
result = readsocket( sock, buf_ptr, SG_IO_MAX_MSG_SIZE - save_len );
|
||||
result = client->recv( buf_ptr, SG_IO_MAX_MSG_SIZE - save_len );
|
||||
|
||||
if ( result > 0 )
|
||||
{
|
||||
first_read = true;
|
||||
}
|
||||
|
||||
save_len += result;
|
||||
|
||||
// Try and detect that the remote end died. This
|
||||
// could cause problems so if you see connections
|
||||
// dropping for unexplained reasons, LOOK HERE!
|
||||
if (result == 0 && save_len == 0 && first_read == true)
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Connection closed by foreign host." );
|
||||
delete client;
|
||||
client = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char *buf_ptr = save_buf + save_len;
|
||||
result = sock.recv( buf_ptr, SG_IO_MAX_MSG_SIZE - save_len );
|
||||
save_len += result;
|
||||
}
|
||||
|
||||
// cout << "current read = " << buf_ptr << endl;
|
||||
// cout << "current save_buf = " << save_buf << endl;
|
||||
// cout << "save_len = " << save_len << endl;
|
||||
} else {
|
||||
// cout << "no data ready\n";
|
||||
}
|
||||
|
||||
// look for the end of line in save_buf
|
||||
int i;
|
||||
for ( i = 0; i < save_len && save_buf[i] != '\n'; ++i );
|
||||
for ( i = 0; i < save_len && save_buf[i] != '\n'; ++i )
|
||||
;
|
||||
if ( save_buf[i] == '\n' ) {
|
||||
result = i + 1;
|
||||
} else {
|
||||
// no end of line yet
|
||||
// cout << "no eol found" << endl;
|
||||
return 0;
|
||||
}
|
||||
// cout << "line length = " << result << endl;
|
||||
|
||||
// we found an end of line
|
||||
|
||||
// copy to external buffer
|
||||
strncpy( buf, save_buf, result );
|
||||
buf[result] = '\0';
|
||||
// cout << "sg_socket line = " << buf << endl;
|
||||
|
||||
|
||||
// shift save buffer
|
||||
//memmove( save_buf+, save_buf+, ? );
|
||||
for ( i = result; i < save_len; ++i ) {
|
||||
save_buf[ i - result ] = save_buf[i];
|
||||
}
|
||||
@@ -406,66 +310,23 @@ int SGSocket::readline( char *buf, int length ) {
|
||||
|
||||
|
||||
// write data to socket (client)
|
||||
int SGSocket::write( const char *buf, const int length ) {
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
int
|
||||
SGSocket::write( const char *buf, const int length )
|
||||
{
|
||||
netSocket* s = client == 0 ? &sock : client;
|
||||
if (s->getHandle() == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool error_condition = false;
|
||||
|
||||
if ( writesocket(sock, buf, length) < 0 ) {
|
||||
if ( s->send( buf, length ) < 0 )
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error writing to socket: " << port );
|
||||
error_condition = true;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// check for any new client connection requests
|
||||
fd_set ready;
|
||||
FD_ZERO(&ready);
|
||||
FD_SET(sock, &ready);
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
// test for any input on sock (returning immediately, even if
|
||||
// nothing)
|
||||
select(32, &ready, 0, 0, &tv);
|
||||
|
||||
// any new connections?
|
||||
if ( FD_ISSET(sock, &ready) ) {
|
||||
int msgsock = accept(sock, 0, 0);
|
||||
if ( msgsock < 0 ) {
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error: accept() failed in write()" );
|
||||
return 0;
|
||||
} else {
|
||||
client_connections.push_back( msgsock );
|
||||
}
|
||||
}
|
||||
|
||||
SG_LOG( SG_IO, SG_INFO, "Client connections = " <<
|
||||
client_connections.size() );
|
||||
for ( int i = 0; i < (int)client_connections.size(); ++i ) {
|
||||
int msgsock = client_connections[i];
|
||||
|
||||
// read and junk any possible incoming messages.
|
||||
// char junk[ SG_IO_MAX_MSG_SIZE ];
|
||||
// std::read( msgsock, junk, SG_IO_MAX_MSG_SIZE );
|
||||
|
||||
// write the interesting data to the socket
|
||||
if ( writesocket(msgsock, buf, length) == SOCKET_ERROR ) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error writing to socket: " << port );
|
||||
error_condition = true;
|
||||
} else {
|
||||
#ifdef _POSIX_SYNCHRONIZED_IO
|
||||
// fdatasync(msgsock);
|
||||
#else
|
||||
// fsync(msgsock);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( error_condition ) {
|
||||
return 0;
|
||||
}
|
||||
@@ -475,79 +336,62 @@ int SGSocket::write( const char *buf, const int length ) {
|
||||
|
||||
|
||||
// write null terminated string to socket (server)
|
||||
int SGSocket::writestring( const char *str ) {
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
SGSocket::writestring( const char *str )
|
||||
{
|
||||
int length = strlen( str );
|
||||
return write( str, length );
|
||||
return this->write( str, length );
|
||||
}
|
||||
|
||||
|
||||
// close the port
|
||||
bool SGSocket::close() {
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
return 0;
|
||||
}
|
||||
bool
|
||||
SGSocket::close()
|
||||
{
|
||||
delete client;
|
||||
client = 0;
|
||||
|
||||
closesocket( sock );
|
||||
if ( sock_style == SOCK_STREAM && msgsock != INVALID_SOCKET ) {
|
||||
sock = msgsock;
|
||||
msgsock = INVALID_SOCKET;
|
||||
}
|
||||
sock.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// configure the socket as non-blocking
|
||||
bool SGSocket::nonblock() {
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
bool
|
||||
SGSocket::nonblock()
|
||||
{
|
||||
if (sock.getHandle() == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sock.setBlocking( false );
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
SGSocket::poll()
|
||||
{
|
||||
netSocket* readers[2];
|
||||
|
||||
readers[0] = client != 0 ? client : &sock;
|
||||
readers[1] = 0;
|
||||
|
||||
netSocket* writers[1];
|
||||
writers[0] = 0;
|
||||
|
||||
int result = netSocket::select( readers, writers, 0 );
|
||||
|
||||
if (result > 0 && is_server && client == 0)
|
||||
{
|
||||
// Accept a new client connection
|
||||
netAddress addr;
|
||||
int new_fd = sock.accept( &addr );
|
||||
SG_LOG( SG_IO, SG_INFO, "Accepted connection from "
|
||||
<< addr.getHost() << ":" << addr.getPort() );
|
||||
client = new netSocket();
|
||||
client->setHandle( new_fd );
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
u_long arg = 1;
|
||||
if (ioctlsocket( sock, FIONBIO, &arg ) != 0) {
|
||||
int error_code = WSAGetLastError();
|
||||
SG_LOG( SG_IO, SG_ALERT,
|
||||
"Error " << error_code << ": unable to set non-blocking mode"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
fcntl( sock, F_SETFL, O_NONBLOCK );
|
||||
#endif
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
|
||||
bool SGSocket::wsock_init = false;
|
||||
|
||||
bool
|
||||
SGSocket::wsastartup() {
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
|
||||
//wVersionRequested = MAKEWORD( 2, 2 );
|
||||
wVersionRequested = MAKEWORD( 1, 1 );
|
||||
int err = WSAStartup( wVersionRequested, &wsaData );
|
||||
if (err != 0)
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error: Couldn't load winsock" );
|
||||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( LOBYTE( wsaData.wVersion ) != 2 ||
|
||||
HIBYTE( wsaData.wVersion ) != 2 ) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "Couldn't load a suitable winsock");
|
||||
WSACleanup( );
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
wsock_init = true;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -39,11 +39,9 @@
|
||||
#include <simgear/math/sg_types.hxx>
|
||||
#include <simgear/io/iochannel.hxx>
|
||||
|
||||
SG_USING_STD(string);
|
||||
#include <plib/netSocket.h>
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
# include <winsock.h>
|
||||
#endif
|
||||
SG_USING_STD(string);
|
||||
|
||||
#define SG_MAX_SOCKET_QUEUE 32
|
||||
|
||||
@@ -53,13 +51,6 @@ SG_USING_STD(string);
|
||||
*/
|
||||
class SGSocket : public SGIOChannel {
|
||||
public:
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
typedef SOCKET SocketType;
|
||||
#else
|
||||
typedef int SocketType;
|
||||
# define INVALID_SOCKET (-1)
|
||||
#endif
|
||||
|
||||
private:
|
||||
string hostname;
|
||||
string port_str;
|
||||
@@ -67,31 +58,23 @@ private:
|
||||
char save_buf[ 2 * SG_IO_MAX_MSG_SIZE ];
|
||||
int save_len;
|
||||
|
||||
SocketType sock;
|
||||
SocketType msgsock;
|
||||
short unsigned int port;
|
||||
int sock_style; // SOCK_STREAM or SOCK_DGRAM
|
||||
|
||||
netSocket sock;
|
||||
netSocket* client;
|
||||
unsigned short port;
|
||||
bool is_tcp;
|
||||
bool is_server;
|
||||
bool first_read;
|
||||
|
||||
static bool init;
|
||||
|
||||
// make a server (master listening) socket
|
||||
SocketType make_server_socket();
|
||||
bool make_server_socket();
|
||||
|
||||
// make a client socket
|
||||
SocketType make_client_socket();
|
||||
bool make_client_socket();
|
||||
|
||||
// wrapper functions
|
||||
size_t readsocket( int fd, void *buf, size_t count );
|
||||
size_t writesocket( int fd, const void *buf, size_t count );
|
||||
#if !defined(_MSC_VER) && !defined(__MINGW32__)
|
||||
int closesocket(int fd);
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
// Ensure winsock has been initialised.
|
||||
static bool wsock_init;
|
||||
static bool wsastartup();
|
||||
#endif
|
||||
// Poll for new connections or data to read.
|
||||
int poll();
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
#include "sg_socket.hxx"
|
||||
#include "lowlevel.hxx"
|
||||
|
||||
#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||
SG_USING_STD(cout);
|
||||
SG_USING_STD(endl);
|
||||
#endif
|
||||
|
||||
static const int sgEndianTest = 1;
|
||||
#define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
|
||||
#define sgIsBigEndian (*((char *) &sgEndianTest ) == 0)
|
||||
|
||||
SG_USING_STD(cout);
|
||||
SG_USING_STD(endl);
|
||||
|
||||
|
||||
int main() {
|
||||
|
||||
if ( sgIsLittleEndian ) {
|
||||
|
||||
86
simgear/io/tcp_client.cxx
Normal file
86
simgear/io/tcp_client.cxx
Normal file
@@ -0,0 +1,86 @@
|
||||
#include <simgear/compiler.h>
|
||||
#include STL_IOSTREAM
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include "sg_socket.hxx"
|
||||
|
||||
|
||||
class TcpClient
|
||||
{
|
||||
public:
|
||||
TcpClient( const char* host, const char* port );
|
||||
~TcpClient();
|
||||
|
||||
bool open();
|
||||
bool process();
|
||||
bool close();
|
||||
|
||||
private:
|
||||
SGIOChannel* channel;
|
||||
};
|
||||
|
||||
TcpClient::TcpClient( const char* host, const char* port )
|
||||
{
|
||||
channel = new SGSocket( host, port, "tcp" );
|
||||
}
|
||||
|
||||
TcpClient::~TcpClient()
|
||||
{
|
||||
delete channel;
|
||||
}
|
||||
|
||||
bool
|
||||
TcpClient::open()
|
||||
{
|
||||
return channel->open( SG_IO_OUT );
|
||||
}
|
||||
|
||||
bool
|
||||
TcpClient::process()
|
||||
{
|
||||
char wbuf[1024];
|
||||
|
||||
sprintf( wbuf, "hello world\n" );
|
||||
int length = channel->writestring( wbuf );
|
||||
cout << "writestring returned " << length << "\n";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TcpClient::close()
|
||||
{
|
||||
return channel->close();
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
sglog().setLogLevels( SG_ALL, SG_INFO );
|
||||
TcpClient client( "localhost", "5500" );
|
||||
if (!client.open())
|
||||
{
|
||||
cout << "client open failed\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
client.process();
|
||||
#ifdef _WIN32
|
||||
Sleep(1000);
|
||||
#else
|
||||
sleep(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
//client.close();
|
||||
return 0;
|
||||
}
|
||||
70
simgear/io/tcp_server.cxx
Normal file
70
simgear/io/tcp_server.cxx
Normal file
@@ -0,0 +1,70 @@
|
||||
#include <simgear/compiler.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include STL_STRING
|
||||
#include STL_IOSTREAM
|
||||
|
||||
#include "sg_socket.hxx"
|
||||
|
||||
SG_USING_STD(string);
|
||||
SG_USING_STD(cout);
|
||||
|
||||
class TcpServer
|
||||
{
|
||||
public:
|
||||
TcpServer();
|
||||
bool open();
|
||||
bool process();
|
||||
bool close();
|
||||
|
||||
private:
|
||||
SGIOChannel* channel;
|
||||
};
|
||||
|
||||
TcpServer::TcpServer()
|
||||
{
|
||||
channel = new SGSocket( "", "5500", "tcp" );
|
||||
}
|
||||
|
||||
bool
|
||||
TcpServer::open()
|
||||
{
|
||||
channel->open( SG_IO_BI );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TcpServer::process()
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
int len;
|
||||
while ((len = channel->readline( buf, sizeof(buf) )) > 0)
|
||||
{
|
||||
cout << len << ": " << buf;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TcpServer::close()
|
||||
{
|
||||
return channel->close();
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
sglog().setLogLevels( SG_ALL, SG_INFO );
|
||||
TcpServer server;
|
||||
server.open();
|
||||
SG_LOG( SG_IO, SG_INFO, "Created TCP server" );
|
||||
|
||||
while (1)
|
||||
{
|
||||
server.process();
|
||||
}
|
||||
|
||||
server.close();
|
||||
return 0;
|
||||
}
|
||||
@@ -14,8 +14,4 @@ testmagvar_SOURCES = testmagvar.cxx
|
||||
|
||||
testmagvar_LDADD = $(top_builddir)/simgear/magvar/libsgmagvar.a
|
||||
|
||||
if OLD_AUTOMAKE
|
||||
INCLUDES += -I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
@@ -29,7 +29,10 @@
|
||||
#include "magvar.hxx"
|
||||
|
||||
|
||||
SGMagVar::SGMagVar() {
|
||||
SGMagVar::SGMagVar()
|
||||
: magvar(0.0),
|
||||
magdip(0.0)
|
||||
{
|
||||
}
|
||||
|
||||
SGMagVar::~SGMagVar() {
|
||||
|
||||
@@ -24,8 +24,4 @@ libsgmath_a_SOURCES = \
|
||||
sg_random.c \
|
||||
vector.cxx
|
||||
|
||||
if OLD_AUTOMAKE
|
||||
INCLUDES += -I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
// depricated - #include <simgear/sg_zlib.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ mgcLinInterp2D<T>::mgcLinInterp2D (int _numPoints, double* x, double* y,
|
||||
return;
|
||||
}
|
||||
|
||||
cout << "[ 20%] allocating memory \r";
|
||||
// cout << "[ 20%] allocating memory \r";
|
||||
|
||||
point = new double*[numPoints];
|
||||
tmppoint = new double*[numPoints+3];
|
||||
@@ -66,7 +66,7 @@ mgcLinInterp2D<T>::mgcLinInterp2D (int _numPoints, double* x, double* y,
|
||||
f[i] = _f[i];
|
||||
}
|
||||
|
||||
cout << "[ 30%] creating delaunay diagram \r";
|
||||
// cout << "[ 30%] creating delaunay diagram \r";
|
||||
|
||||
Delaunay2D();
|
||||
}
|
||||
@@ -279,7 +279,7 @@ int mgcLinInterp2D<T>::Delaunay2D ()
|
||||
nts = 1; // number of triangles
|
||||
i4 = 1;
|
||||
|
||||
cout << "[ 40%] create triangulation \r";
|
||||
// cout << "[ 40%] create triangulation \r";
|
||||
|
||||
// compute triangulation
|
||||
for (i0 = 0; i0 < numPoints; i0++)
|
||||
@@ -372,7 +372,7 @@ Corner3:;
|
||||
}
|
||||
|
||||
// count the number of triangles
|
||||
cout << "[ 50%] count the number of triangles \r";
|
||||
// cout << "[ 50%] count the number of triangles \r";
|
||||
|
||||
numTriangles = 0;
|
||||
i0 = -1;
|
||||
@@ -394,7 +394,7 @@ Corner3:;
|
||||
}
|
||||
|
||||
// create the triangles
|
||||
cout << "[ 60%] create the triangles \r";
|
||||
// cout << "[ 60%] create the triangles \r";
|
||||
|
||||
triangle = new Triangle[numTriangles];
|
||||
|
||||
@@ -428,7 +428,7 @@ Corner3:;
|
||||
}
|
||||
|
||||
// build edge table
|
||||
cout << "[ 70%] build the edge table \r";
|
||||
// cout << "[ 70%] build the edge table \r";
|
||||
|
||||
numEdges = 0;
|
||||
edge = new Edge[3*numTriangles];
|
||||
@@ -436,8 +436,8 @@ Corner3:;
|
||||
int j, j0, j1;
|
||||
for (i = 0; i < numTriangles; i++)
|
||||
{
|
||||
if ( (i%500) == 0)
|
||||
cout << "[ 7" << 10*i/numTriangles << "%] build the edge table \r";
|
||||
// if ( (i%500) == 0)
|
||||
// cout << "[ 7" << 10*i/numTriangles << "%] build the edge table \r";
|
||||
|
||||
Triangle& t = triangle[i];
|
||||
|
||||
@@ -470,7 +470,7 @@ Corner3:;
|
||||
}
|
||||
|
||||
// establish links between adjacent triangles
|
||||
cout << "[ 80%] establishing links between adjacent triangles \r";
|
||||
// cout << "[ 80%] establishing links between adjacent triangles \r";
|
||||
|
||||
for (i = 0; i < numEdges; i++)
|
||||
{
|
||||
@@ -494,7 +494,7 @@ ExitDelaunay:;
|
||||
delete[] ccr[0];
|
||||
delete[] ccr;
|
||||
|
||||
cout << "[ 90%] finsishes delauney triangulation \r";
|
||||
// cout << "[ 90%] finsishes delauney triangulation \r";
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -61,10 +61,8 @@
|
||||
SG_USING_NAMESPACE(std);
|
||||
#endif
|
||||
|
||||
#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
|
||||
SG_USING_STD(ostream);
|
||||
SG_USING_STD(istream);
|
||||
#endif
|
||||
|
||||
|
||||
const double fgPoint3_Epsilon = 0.0000001;
|
||||
|
||||
@@ -27,12 +27,10 @@
|
||||
#include "localconsts.hxx"
|
||||
|
||||
|
||||
#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
|
||||
SG_USING_STD(cout);
|
||||
#endif
|
||||
|
||||
|
||||
#define DOMAIN_ERR_DEBUG 1
|
||||
// #define DOMAIN_ERR_DEBUG 1
|
||||
|
||||
|
||||
// sgGeocToGeod(lat_geoc, radius, *lat_geod, *alt, *sea_level_r)
|
||||
@@ -47,8 +45,8 @@ SG_USING_STD(cout);
|
||||
// local vertical (surface normal) of C.G. (meters)
|
||||
|
||||
|
||||
void sgGeocToGeod( double lat_geoc, double radius, double
|
||||
*lat_geod, double *alt, double *sea_level_r )
|
||||
void sgGeocToGeod( const double& lat_geoc, const double& radius,
|
||||
double *lat_geod, double *alt, double *sea_level_r )
|
||||
{
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
errno = 0; // start with error zero'd
|
||||
@@ -134,7 +132,7 @@ void sgGeocToGeod( double lat_geoc, double radius, double
|
||||
//
|
||||
|
||||
|
||||
void sgGeodToGeoc( double lat_geod, double alt, double *sl_radius,
|
||||
void sgGeodToGeoc( const double& lat_geod, const double& alt, double *sl_radius,
|
||||
double *lat_geoc )
|
||||
{
|
||||
double lambda_sl, sin_lambda_sl, cos_lambda_sl, sin_mu, cos_mu, px, py;
|
||||
@@ -184,7 +182,7 @@ void sgGeodToGeoc( double lat_geod, double alt, double *sl_radius,
|
||||
|
||||
// for WGS_84 a = 6378137.000, rf = 298.257223563;
|
||||
|
||||
static double M0( double e2 ) {
|
||||
static inline double M0( double e2 ) {
|
||||
//double e4 = e2*e2;
|
||||
return GEOD_INV_PI*(1.0 - e2*( 1.0/4.0 + e2*( 3.0/64.0 +
|
||||
e2*(5.0/256.0) )))/2.0;
|
||||
@@ -193,8 +191,10 @@ static double M0( double e2 ) {
|
||||
|
||||
// given, alt, lat1, lon1, az1 and distance (s), calculate lat2, lon2
|
||||
// and az2. Lat, lon, and azimuth are in degrees. distance in meters
|
||||
int geo_direct_wgs_84 ( double alt, double lat1, double lon1, double az1,
|
||||
double s, double *lat2, double *lon2, double *az2 )
|
||||
int geo_direct_wgs_84 ( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& az1,
|
||||
const double& s, double *lat2, double *lon2,
|
||||
double *az2 )
|
||||
{
|
||||
double a = 6378137.000, rf = 298.257223563;
|
||||
double RADDEG = (GEOD_INV_PI)/180.0, testv = 1.0E-10;
|
||||
@@ -275,7 +275,8 @@ int geo_direct_wgs_84 ( double alt, double lat1, double lon1, double az1,
|
||||
} else { // phi1 == 90 degrees, polar origin
|
||||
double dM = a*M0(e2) - s;
|
||||
double paz = ( phi1 < 0.0 ? 180.0 : 0.0 );
|
||||
return geo_direct_wgs_84( alt, 0.0, lon1, paz, dM,lat2,lon2,az2 );
|
||||
double zero = 0.0f;
|
||||
return geo_direct_wgs_84( alt, zero, lon1, paz, dM, lat2, lon2, az2 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,8 +284,10 @@ int geo_direct_wgs_84 ( double alt, double lat1, double lon1, double az1,
|
||||
// given alt, lat1, lon1, lat2, lon2, calculate starting and ending
|
||||
// az1, az2 and distance (s). Lat, lon, and azimuth are in degrees.
|
||||
// distance in meters
|
||||
int geo_inverse_wgs_84( double alt, double lat1, double lon1, double lat2,
|
||||
double lon2, double *az1, double *az2, double *s )
|
||||
int geo_inverse_wgs_84( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& lat2,
|
||||
const double& lon2, double *az1, double *az2,
|
||||
double *s )
|
||||
{
|
||||
double a = 6378137.000, rf = 298.257223563;
|
||||
int iter=0;
|
||||
@@ -311,8 +314,9 @@ int geo_inverse_wgs_84( double alt, double lat1, double lon1, double lat2,
|
||||
return 0;
|
||||
} else if( fabs(cosphi2) < testv ) {
|
||||
// terminal point is polar
|
||||
int k = geo_inverse_wgs_84( alt, lat1,lon1,lat1,lon1+180.0,
|
||||
az1,az2,s );
|
||||
double _lon1 = lon1 + 180.0f;
|
||||
int k = geo_inverse_wgs_84( alt, lat1, lon1, lat1, _lon1,
|
||||
az1, az2, s );
|
||||
k = k; // avoid compiler error since return result is unused
|
||||
*s /= 2.0;
|
||||
*az2 = *az1 + 180.0;
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
* @param sea_level_r (out) radius from earth center to sea level at
|
||||
* local vertical (surface normal) of C.G. (meters)
|
||||
*/
|
||||
void sgGeocToGeod( double lat_geoc, double radius, double
|
||||
*lat_geod, double *alt, double *sea_level_r );
|
||||
void sgGeocToGeod( const double& lat_geoc, const double& radius,
|
||||
double *lat_geod, double *alt, double *sea_level_r );
|
||||
|
||||
|
||||
/**
|
||||
@@ -43,8 +43,8 @@ void sgGeocToGeod( double lat_geoc, double radius, double
|
||||
* (add Altitude to get true distance from earth center.
|
||||
* @param lat_geoc (out) Geocentric latitude, radians, + = North
|
||||
*/
|
||||
void sgGeodToGeoc( double lat_geod, double alt, double *sl_radius,
|
||||
double *lat_geoc );
|
||||
void sgGeodToGeoc( const double& lat_geod, const double& alt,
|
||||
double *sl_radius, double *lat_geoc );
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,15 +82,19 @@ inline Point3D sgGeodToCart(const Point3D& geod) {
|
||||
* @param lon2 (out) degrees
|
||||
* @param az2 (out) return course in degrees
|
||||
*/
|
||||
int geo_direct_wgs_84 ( double alt, double lat1, double lon1, double az1,
|
||||
double s, double *lat2, double *lon2, double *az2 );
|
||||
int geo_direct_wgs_84 ( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& az1,
|
||||
const double& s, double *lat2, double *lon2,
|
||||
double *az2 );
|
||||
|
||||
|
||||
// given alt, lat1, lon1, lat2, lon2, calculate starting and ending
|
||||
// az1, az2 and distance (s). Lat, lon, and azimuth are in degrees.
|
||||
// distance in meters
|
||||
int geo_inverse_wgs_84( double alt, double lat1, double lon1, double lat2,
|
||||
double lon2, double *az1, double *az2, double *s );
|
||||
int geo_inverse_wgs_84( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& lat2,
|
||||
const double& lon2, double *az1, double *az2,
|
||||
double *s );
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
@@ -22,6 +22,51 @@
|
||||
// $Id$
|
||||
|
||||
|
||||
/*
|
||||
A C-program for MT19937, with initialization improved 2002/2/10.
|
||||
Coded by Takuji Nishimura and Makoto Matsumoto.
|
||||
This is a faster version by taking Shawn Cokus's optimization,
|
||||
Matthe Bellew's simplification, Isaku Wada's real version.
|
||||
|
||||
Before using, initialize the state by using init_genrand(seed)
|
||||
or init_by_array(init_key, key_length).
|
||||
|
||||
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The names of its contributors may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Any feedback is very welcome.
|
||||
http://www.math.keio.ac.jp/matumoto/emt.html
|
||||
email: matumoto@math.keio.ac.jp
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <simgear_config.h>
|
||||
#endif
|
||||
@@ -32,50 +77,87 @@
|
||||
|
||||
#include "sg_random.h"
|
||||
|
||||
#ifndef HAVE_RAND
|
||||
# ifdef sgi
|
||||
# undef RAND_MAX
|
||||
# define RAND_MAX 2147483647
|
||||
# endif
|
||||
#endif
|
||||
/* Period parameters */
|
||||
#define N 624
|
||||
#define M 397
|
||||
#define MATRIX_A 0x9908b0dfUL /* constant vector a */
|
||||
#define UMASK 0x80000000UL /* most significant w-r bits */
|
||||
#define LMASK 0x7fffffffUL /* least significant r bits */
|
||||
#define MIXBITS(u,v) ( ((u) & UMASK) | ((v) & LMASK) )
|
||||
#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL))
|
||||
|
||||
#ifdef __SUNPRO_CC
|
||||
extern "C" {
|
||||
long int random();
|
||||
void srandom(unsigned int seed);
|
||||
static unsigned long state[N]; /* the array for the state vector */
|
||||
static int left = 1;
|
||||
static int initf = 0;
|
||||
static unsigned long *next;
|
||||
|
||||
/* initializes state[N] with a seed */
|
||||
void init_genrand(unsigned long s)
|
||||
{
|
||||
int j;
|
||||
state[0]= s & 0xffffffffUL;
|
||||
for (j=1; j<N; j++) {
|
||||
state[j] = (1812433253UL * (state[j-1] ^ (state[j-1] >> 30)) + j);
|
||||
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
|
||||
/* In the previous versions, MSBs of the seed affect */
|
||||
/* only MSBs of the array state[]. */
|
||||
/* 2002/01/09 modified by Makoto Matsumoto */
|
||||
state[j] &= 0xffffffffUL; /* for >32 bit machines */
|
||||
}
|
||||
#endif
|
||||
left = 1; initf = 1;
|
||||
}
|
||||
|
||||
static void next_state(void)
|
||||
{
|
||||
unsigned long *p=state;
|
||||
int j;
|
||||
|
||||
/* if init_genrand() has not been called, */
|
||||
/* a default initial seed is used */
|
||||
if (initf==0) init_genrand(5489UL);
|
||||
|
||||
left = N;
|
||||
next = state;
|
||||
|
||||
for (j=N-M+1; --j; p++)
|
||||
*p = p[M] ^ TWIST(p[0], p[1]);
|
||||
|
||||
for (j=M; --j; p++)
|
||||
*p = p[M-N] ^ TWIST(p[0], p[1]);
|
||||
|
||||
*p = p[M-N] ^ TWIST(p[0], state[0]);
|
||||
}
|
||||
|
||||
// Seed the random number generater with time() so we don't see the
|
||||
// same sequence every time
|
||||
void sg_srandom_time() {
|
||||
#ifdef HAVE_RAND
|
||||
srand(time(NULL));
|
||||
#else
|
||||
srandom(time(NULL));
|
||||
#endif
|
||||
init_genrand(time(NULL));
|
||||
}
|
||||
|
||||
|
||||
// Seed the random number generater with your own seed so can set up
|
||||
// repeatable randomization.
|
||||
void sg_srandom( unsigned int seed ) {
|
||||
#ifdef HAVE_RAND
|
||||
srand( seed );
|
||||
#else
|
||||
srandom( seed );
|
||||
#endif
|
||||
init_genrand( seed );
|
||||
}
|
||||
|
||||
|
||||
// return a random number between [0.0, 1.0)
|
||||
double sg_random() {
|
||||
#ifdef HAVE_RAND
|
||||
return(rand() / (double)RAND_MAX);
|
||||
#else
|
||||
return(random() / (double)RAND_MAX);
|
||||
#endif
|
||||
unsigned long y;
|
||||
|
||||
if (--left == 0)
|
||||
next_state();
|
||||
y = *next++;
|
||||
|
||||
/* Tempering */
|
||||
y ^= (y >> 11);
|
||||
y ^= (y << 7) & 0x9d2c5680UL;
|
||||
y ^= (y << 15) & 0xefc60000UL;
|
||||
y ^= (y >> 18);
|
||||
|
||||
return (double)y * (1.0/4294967295.0);
|
||||
/* divided by 2^32-1 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@ typedef vector < int > int_list;
|
||||
typedef int_list::iterator int_list_iterator;
|
||||
typedef int_list::const_iterator const_int_list_iterator;
|
||||
|
||||
/** STL vector list of doubles */
|
||||
typedef vector < double > double_list;
|
||||
typedef double_list::iterator double_list_iterator;
|
||||
typedef double_list::const_iterator const_double_list_iterator;
|
||||
|
||||
/** STL vector list of Point3D */
|
||||
typedef vector < Point3D > point_list;
|
||||
typedef point_list::iterator point_list_iterator;
|
||||
|
||||
@@ -45,8 +45,8 @@ SphereInterpolate<T>::SphereInterpolate (int n, const double* x,
|
||||
// For complete spherical coverage, include the two antipodal points
|
||||
// (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
|
||||
|
||||
cout << "Initialising spherical interpolator.\n";
|
||||
cout << "[ 0%] Allocating memory \r";
|
||||
// cout << "Initialising spherical interpolator.\n";
|
||||
// cout << "[ 0%] Allocating memory \r";
|
||||
|
||||
theta = new double[3*n];
|
||||
phi = new double[3*n];
|
||||
@@ -63,7 +63,7 @@ SphereInterpolate<T>::SphereInterpolate (int n, const double* x,
|
||||
}
|
||||
|
||||
// use periodicity to get wrap-around in the Delaunay triangulation
|
||||
cout << "[ 10%] copying vertices for wrap-around\r";
|
||||
// cout << "[ 10%] copying vertices for wrap-around\r";
|
||||
int j, k;
|
||||
for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ SphereInterpolate<T>::SphereInterpolate (int n, const double* x,
|
||||
|
||||
pInterp = new mgcLinInterp2D<T>(3*n,theta,phi,func);
|
||||
|
||||
cout << "[100%] Finished initialising spherical interpolator. \n";
|
||||
// cout << "[100%] Finished initialising spherical interpolator. \n";
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -86,15 +86,15 @@ SphereInterpolate<T>::SphereInterpolate (int n, const sgVec2* p, const T* f)
|
||||
// Assumes (x[i],y[i],z[i]) is unit length for all 0 <= i < n.
|
||||
// For complete spherical coverage, include the two antipodal points
|
||||
// (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
|
||||
cout << "Initialising spherical interpolator.\n";
|
||||
cout << "[ 0%] Allocating memory \r";
|
||||
// cout << "Initialising spherical interpolator.\n";
|
||||
// cout << "[ 0%] Allocating memory \r";
|
||||
|
||||
theta = new double[3*n];
|
||||
phi = new double[3*n];
|
||||
func = new T[3*n];
|
||||
|
||||
// convert data to spherical coordinates
|
||||
cout << "[ 10%] copying vertices for wrap-around \r";
|
||||
// cout << "[ 10%] copying vertices for wrap-around \r";
|
||||
|
||||
int i, j, k;
|
||||
for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
|
||||
@@ -114,7 +114,7 @@ SphereInterpolate<T>::SphereInterpolate (int n, const sgVec2* p, const T* f)
|
||||
|
||||
pInterp = new mgcLinInterp2D<T>(3*n,theta,phi,func);
|
||||
|
||||
cout << "[100%] Finished initialising spherical interpolator. \n";
|
||||
// cout << "[100%] Finished initialising spherical interpolator. \n";
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
template<class T>
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
#pragma comment(compiler)
|
||||
#pragma comment(date)
|
||||
#pragma comment(timestamp)
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#pragma title("antoi - char array to integer")
|
||||
#pragma pagesize (80)
|
||||
|
||||
#pragma page(1)
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: antoi */
|
||||
@@ -78,4 +70,3 @@ int antoi(char * string, int len)
|
||||
|
||||
} /* end antoi */
|
||||
|
||||
#pragma page(1)
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
#pragma comment (compiler)
|
||||
//#pragma comment (date)
|
||||
//#pragma comment (timestamp)
|
||||
#pragma pagesize(80)
|
||||
|
||||
#include "Local.h" /* standard header file */
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("charcmp - characters compare with patterns ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: charcmp */
|
||||
@@ -34,7 +26,6 @@
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
bool charcmp(char *str, char *pattern)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
#pragma comment (compiler)
|
||||
//#pragma comment (date)
|
||||
//#pragma comment (timestamp)
|
||||
#pragma pagesize(80)
|
||||
|
||||
|
||||
#include "Local.h" /* standard header file */
|
||||
#include "Metar.h" /* standard header file */
|
||||
|
||||
@@ -11,9 +5,6 @@ float fracPart( char * );
|
||||
void DcdMTRmk( char **, Decoded_METAR * );
|
||||
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma subtitle("subtitle - Decode METAR report. ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: SaveTokenString */
|
||||
@@ -46,7 +37,6 @@ void DcdMTRmk( char **, Decoded_METAR * );
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static char **SaveTokenString ( char *string , char *delimeters )
|
||||
{
|
||||
@@ -99,9 +89,6 @@ static char **SaveTokenString ( char *string , char *delimeters )
|
||||
return token;
|
||||
|
||||
}
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma subtitle("subtitle - Decode METAR report. ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: freeTokens */
|
||||
@@ -124,7 +111,6 @@ static char **SaveTokenString ( char *string , char *delimeters )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static void freeTokens( char **token )
|
||||
{
|
||||
@@ -138,9 +124,6 @@ static void freeTokens( char **token )
|
||||
}
|
||||
return;
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: InitDcdMETAR */
|
||||
@@ -163,7 +146,6 @@ static void freeTokens( char **token )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static void InitDcdMETAR( Decoded_METAR *Mptr )
|
||||
{
|
||||
|
||||
@@ -439,9 +421,6 @@ static void InitDcdMETAR( Decoded_METAR *Mptr )
|
||||
return;
|
||||
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: ResetMETARGroup */
|
||||
@@ -475,8 +454,7 @@ static void InitDcdMETAR( Decoded_METAR *Mptr )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static int ResetMETARGroup( int StartGroup,
|
||||
/*static int ResetMETARGroup( int StartGroup,
|
||||
int SaveStartGroup )
|
||||
{
|
||||
|
||||
@@ -495,11 +473,8 @@ static int ResetMETARGroup( int StartGroup,
|
||||
return (++SaveStartGroup);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: CodedHgt2Meters */
|
||||
@@ -523,7 +498,6 @@ static int ResetMETARGroup( int StartGroup,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static int CodedHgt2Meters( char *token, Decoded_METAR *Mptr )
|
||||
{
|
||||
@@ -537,10 +511,6 @@ static int CodedHgt2Meters( char *token, Decoded_METAR *Mptr )
|
||||
return (hgt*30);
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPartObscur */
|
||||
@@ -574,7 +544,6 @@ static int CodedHgt2Meters( char *token, Decoded_METAR *Mptr )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isPartObscur( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -617,10 +586,6 @@ static bool isPartObscur( char **string, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isCldLayer */
|
||||
@@ -650,7 +615,6 @@ static bool isPartObscur( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isCldLayer( char *token )
|
||||
{
|
||||
@@ -671,10 +635,6 @@ static bool isCldLayer( char *token )
|
||||
nisdigit((token+3),3)) ? TRUE:FALSE;
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isCAVOK */
|
||||
@@ -701,7 +661,6 @@ static bool isCldLayer( char *token )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isCAVOK( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -718,9 +677,6 @@ static bool isCAVOK( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
}
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: parseCldData */
|
||||
@@ -742,7 +698,6 @@ static bool isCAVOK( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static void parseCldData( char *token, Decoded_METAR *Mptr, int next)
|
||||
{
|
||||
@@ -766,9 +721,6 @@ static void parseCldData( char *token, Decoded_METAR *Mptr, int next)
|
||||
}
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isSkyCond */
|
||||
@@ -790,7 +742,6 @@ static void parseCldData( char *token, Decoded_METAR *Mptr, int next)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isSkyCond( char **skycond, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -989,9 +940,6 @@ static bool isSkyCond( char **skycond, Decoded_METAR *Mptr,
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: prevailVSBY */
|
||||
@@ -1013,7 +961,6 @@ static bool isSkyCond( char **skycond, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static float prevailVSBY( char *visibility )
|
||||
{
|
||||
float Miles_vsby;
|
||||
@@ -1061,9 +1008,6 @@ static float prevailVSBY( char *visibility )
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isVisibility */
|
||||
@@ -1086,7 +1030,6 @@ static float prevailVSBY( char *visibility )
|
||||
/* */
|
||||
/********************************************************************/
|
||||
|
||||
#pragma page(1)
|
||||
|
||||
static bool isVisibility( char **visblty, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -1329,9 +1272,6 @@ static bool isVisibility( char **visblty, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: vrblVsby */
|
||||
@@ -1353,7 +1293,7 @@ static bool isVisibility( char **visblty, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
#if 0
|
||||
static bool vrblVsby( char *string1, char *string2,
|
||||
Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -1429,11 +1369,9 @@ static bool vrblVsby( char *string1, char *string2,
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isMinMaxWinDir */
|
||||
@@ -1455,7 +1393,6 @@ static bool vrblVsby( char *string1, char *string2,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isMinMaxWinDir( char *string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -1488,9 +1425,6 @@ static bool isMinMaxWinDir( char *string, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isRVR */
|
||||
@@ -1512,7 +1446,6 @@ static bool isMinMaxWinDir( char *string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isRVR( char *token, Decoded_METAR *Mptr, int *NDEX,
|
||||
int ndex )
|
||||
@@ -1575,9 +1508,6 @@ static bool isRVR( char *token, Decoded_METAR *Mptr, int *NDEX,
|
||||
}
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isAltimStng */
|
||||
@@ -1599,7 +1529,6 @@ static bool isRVR( char *token, Decoded_METAR *Mptr, int *NDEX,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isAltimStng( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -1648,9 +1577,6 @@ static bool isAltimStng( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
}
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isTempGroup */
|
||||
@@ -1672,7 +1598,6 @@ static bool isAltimStng( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isTempGroup( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -1768,9 +1693,6 @@ static bool isTempGroup( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isWxToken */
|
||||
@@ -1792,9 +1714,8 @@ static bool isTempGroup( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isWxToken( char *token )
|
||||
/*static bool isWxToken( char *token )
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1807,12 +1728,9 @@ static bool isWxToken( char *token )
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPresentWX */
|
||||
@@ -1834,7 +1752,6 @@ static bool isWxToken( char *token )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isPresentWX( char *token, Decoded_METAR *Mptr,
|
||||
int *NDEX, int *next )
|
||||
@@ -1929,9 +1846,6 @@ static bool isPresentWX( char *token, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isStnID */
|
||||
@@ -1953,7 +1867,6 @@ static bool isPresentWX( char *token, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isStnId( char *stnID, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -1976,9 +1889,6 @@ static bool isStnId( char *stnID, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isCodeName */
|
||||
@@ -2000,7 +1910,6 @@ static bool isStnId( char *stnID, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isCodeName( char *codename, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -2020,9 +1929,6 @@ static bool isCodeName( char *codename, Decoded_METAR *Mptr, int *NDEX)
|
||||
}
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isNIL */
|
||||
@@ -2044,7 +1950,6 @@ static bool isCodeName( char *codename, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isNIL( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -2063,9 +1968,6 @@ static bool isNIL( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isAUTO */
|
||||
@@ -2087,7 +1989,6 @@ static bool isNIL( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isAUTO( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -2106,9 +2007,6 @@ static bool isAUTO( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isCOR */
|
||||
@@ -2130,7 +2028,6 @@ static bool isAUTO( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isCOR ( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -2149,9 +2046,6 @@ static bool isCOR ( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isTimeUTC */
|
||||
@@ -2173,7 +2067,6 @@ static bool isCOR ( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isTimeUTC( char *UTC, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -2228,9 +2121,6 @@ static bool isTimeUTC( char *UTC, Decoded_METAR *Mptr, int *NDEX )
|
||||
}
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isWindData */
|
||||
@@ -2252,7 +2142,6 @@ static bool isTimeUTC( char *UTC, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isWindData( char *wind, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -2322,9 +2211,6 @@ static bool isWindData( char *wind, Decoded_METAR *Mptr, int *NDEX )
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma subtitle("subtitle - Decode METAR report. ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: DcdMETAR */
|
||||
@@ -2349,7 +2235,6 @@ static bool isWindData( char *wind, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
|
||||
int DcdMETAR( char *string , Decoded_METAR *Mptr )
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
#define SKY1_len 50
|
||||
float fracPart( char * );
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isTS_LOC */
|
||||
@@ -48,7 +45,6 @@ float fracPart( char * );
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isTS_LOC( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -134,9 +130,6 @@ static bool isTS_LOC( char **string, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isDVR */
|
||||
@@ -158,7 +151,6 @@ static bool isTS_LOC( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isDVR( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -217,9 +209,6 @@ static bool isDVR( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
}
|
||||
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isTornadicActiv */
|
||||
@@ -260,7 +249,6 @@ static bool isDVR( char *token, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isTornadicActiv( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -531,9 +519,6 @@ static bool isTornadicActiv( char **string, Decoded_METAR *Mptr,
|
||||
}
|
||||
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPartObscur */
|
||||
@@ -576,7 +561,6 @@ static bool isTornadicActiv( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isPartObscur( char **string, Decoded_METAR *Mptr,
|
||||
int ndex, int *NDEX )
|
||||
{
|
||||
@@ -677,9 +661,6 @@ static bool isPartObscur( char **string, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isA0indicator */
|
||||
@@ -720,7 +701,6 @@ static bool isPartObscur( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isA0indicator( char *indicator, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -763,9 +743,6 @@ static bool isA0indicator( char *indicator, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPeakWind */
|
||||
@@ -805,7 +782,6 @@ static bool isA0indicator( char *indicator, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isPeakWind( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -898,9 +874,6 @@ static bool isPeakWind( char **string, Decoded_METAR *Mptr,
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isWindShift */
|
||||
@@ -940,7 +913,6 @@ static bool isPeakWind( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isWindShift( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX)
|
||||
{
|
||||
@@ -1030,9 +1002,6 @@ static bool isWindShift( char **string, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isTowerVsby */
|
||||
@@ -1071,7 +1040,6 @@ static bool isWindShift( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isTowerVsby( char **token, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
|
||||
@@ -1186,9 +1154,6 @@ static bool isTowerVsby( char **token, Decoded_METAR *Mptr, int *NDEX)
|
||||
}
|
||||
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isSurfaceVsby */
|
||||
@@ -1227,7 +1192,6 @@ static bool isTowerVsby( char **token, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isSurfaceVsby( char **token, Decoded_METAR *Mptr,
|
||||
int *NDEX)
|
||||
{
|
||||
@@ -1344,9 +1308,6 @@ static bool isSurfaceVsby( char **token, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isVariableVsby */
|
||||
@@ -1386,7 +1347,6 @@ static bool isSurfaceVsby( char **token, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isVariableVsby( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -1596,9 +1556,6 @@ static bool isVariableVsby( char **string, Decoded_METAR *Mptr,
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isVsby2ndSite */
|
||||
@@ -1642,7 +1599,6 @@ static bool isVariableVsby( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isVsby2ndSite( char **token, Decoded_METAR *Mptr,
|
||||
int *NDEX)
|
||||
{
|
||||
@@ -1801,9 +1757,6 @@ static bool isVsby2ndSite( char **token, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isLTGfreq */
|
||||
@@ -1847,7 +1800,6 @@ static bool isVsby2ndSite( char **token, Decoded_METAR *Mptr,
|
||||
/* */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
bool static isLTGfreq( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -2088,16 +2040,8 @@ bool static isLTGfreq( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
|
||||
|
||||
|
||||
#pragma comment (compiler)
|
||||
//#pragma comment (date)
|
||||
//#pragma comment (timestamp)
|
||||
#pragma pagesize(80)
|
||||
|
||||
#include "Metar.h" /* standard header file */
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isRecentWx */
|
||||
@@ -2141,7 +2085,6 @@ bool static isLTGfreq( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isRecentWX( char **token, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -2478,9 +2421,6 @@ static bool isRecentWX( char **token, Decoded_METAR *Mptr,
|
||||
}
|
||||
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isVariableCIG */
|
||||
@@ -2511,7 +2451,6 @@ static bool isRecentWX( char **token, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isVariableCIG( char **token, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -2544,9 +2483,6 @@ static bool isVariableCIG( char **token, Decoded_METAR *Mptr,
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isCeil2ndSite */
|
||||
@@ -2581,7 +2517,6 @@ static bool isVariableCIG( char **token, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isCIG2ndSite( char **token, Decoded_METAR *Mptr,
|
||||
int *NDEX)
|
||||
{
|
||||
@@ -2620,9 +2555,6 @@ static bool isCIG2ndSite( char **token, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPRESFR */
|
||||
@@ -2671,7 +2603,6 @@ static bool isCIG2ndSite( char **token, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isPRESFR( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -2688,9 +2619,6 @@ static bool isPRESFR( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
}
|
||||
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPRESRR */
|
||||
@@ -2739,7 +2667,6 @@ static bool isPRESFR( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isPRESRR( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -2757,9 +2684,6 @@ static bool isPRESRR( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isSLP */
|
||||
@@ -2781,7 +2705,6 @@ static bool isPRESRR( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isSLP( char **token, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
@@ -2855,7 +2778,6 @@ static bool isSLP( char **token, Decoded_METAR *Mptr, int *NDEX )
|
||||
}
|
||||
|
||||
}
|
||||
#pragma page(1)
|
||||
static bool isSectorVsby( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -2933,9 +2855,6 @@ static bool isSectorVsby( char **string, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isGR */
|
||||
@@ -2984,7 +2903,6 @@ static bool isSectorVsby( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isGR( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
char *slash;
|
||||
@@ -3067,9 +2985,6 @@ static bool isGR( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
}
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isVIRGA */
|
||||
@@ -3118,7 +3033,6 @@ static bool isGR( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isVIRGA( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -3154,7 +3068,6 @@ static bool isVIRGA( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
static bool isSfcObscuration( char *string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -3242,7 +3155,6 @@ static bool isSfcObscuration( char *string, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
static bool isCeiling( char *string, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
|
||||
@@ -3282,7 +3194,6 @@ static bool isCeiling( char *string, Decoded_METAR *Mptr, int *NDEX )
|
||||
}
|
||||
|
||||
}
|
||||
#pragma page(1)
|
||||
static bool isVrbSky( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
static char *cldPtr[] = {"FEW", "SCT", "BKN", "OVC", NULL };
|
||||
@@ -3386,7 +3297,6 @@ static bool isVrbSky( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
static bool isObscurAloft( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -3470,7 +3380,6 @@ static bool isObscurAloft( char **string, Decoded_METAR *Mptr,
|
||||
}
|
||||
|
||||
}
|
||||
#pragma page(1)
|
||||
static bool isNOSPECI( char *string, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
|
||||
@@ -3485,7 +3394,6 @@ static bool isNOSPECI( char *string, Decoded_METAR *Mptr, int *NDEX )
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#pragma page(1)
|
||||
static bool isLAST( char *string, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
|
||||
@@ -3500,9 +3408,6 @@ static bool isLAST( char *string, Decoded_METAR *Mptr, int *NDEX )
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isSynopClouds */
|
||||
@@ -3524,7 +3429,6 @@ static bool isLAST( char *string, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isSynopClouds( char *token, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -3557,7 +3461,6 @@ static bool isSynopClouds( char *token, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
static bool isSNINCR( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
{
|
||||
|
||||
@@ -3596,9 +3499,6 @@ static bool isSNINCR( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isSnowDepth */
|
||||
@@ -3620,7 +3520,6 @@ static bool isSNINCR( char **string, Decoded_METAR *Mptr, int *NDEX )
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isSnowDepth( char *token, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -3644,7 +3543,6 @@ static bool isSnowDepth( char *token, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
static bool isWaterEquivSnow( char *string,
|
||||
Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -3666,7 +3564,6 @@ static bool isWaterEquivSnow( char *string,
|
||||
}
|
||||
|
||||
}
|
||||
#pragma page(1)
|
||||
static bool isSunshineDur( char *string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -3692,9 +3589,6 @@ static bool isSunshineDur( char *string, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isHourlyPrecip */
|
||||
@@ -3743,7 +3637,6 @@ static bool isSunshineDur( char *string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isHourlyPrecip( char **string, Decoded_METAR *Mptr,
|
||||
int *NDEX)
|
||||
@@ -3790,9 +3683,6 @@ static bool isHourlyPrecip( char **string, Decoded_METAR *Mptr,
|
||||
}
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isP6Precip */
|
||||
@@ -3841,7 +3731,6 @@ static bool isHourlyPrecip( char **string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isP6Precip( char *string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -3869,9 +3758,6 @@ static bool isP6Precip( char *string, Decoded_METAR *Mptr,
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isP24Precip */
|
||||
@@ -3920,7 +3806,6 @@ static bool isP6Precip( char *string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isP24Precip( char *string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -3946,9 +3831,6 @@ static bool isP24Precip( char *string, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isTTdTenths */
|
||||
@@ -3997,7 +3879,6 @@ static bool isP24Precip( char *string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isTTdTenths( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4058,9 +3939,6 @@ static bool isTTdTenths( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
}
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isMaxTemp */
|
||||
@@ -4082,7 +3960,6 @@ static bool isTTdTenths( char *token, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isMaxTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
char buf[ 6 ];
|
||||
@@ -4122,9 +3999,6 @@ static bool isMaxTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isMinTemp */
|
||||
@@ -4146,7 +4020,6 @@ static bool isMaxTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isMinTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
char buf[ 6 ];
|
||||
@@ -4185,9 +4058,6 @@ static bool isMinTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isT24MaxMinTemp */
|
||||
@@ -4209,7 +4079,6 @@ static bool isMinTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
static bool isT24MaxMinTemp( char *string, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
{
|
||||
@@ -4265,9 +4134,6 @@ static bool isT24MaxMinTemp( char *string, Decoded_METAR *Mptr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPtendency */
|
||||
@@ -4289,7 +4155,6 @@ static bool isT24MaxMinTemp( char *string, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isPtendency(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4330,9 +4195,6 @@ static bool isPtendency(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPWINO */
|
||||
@@ -4354,7 +4216,6 @@ static bool isPtendency(char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isPWINO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4373,9 +4234,6 @@ static bool isPWINO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isPNO */
|
||||
@@ -4397,7 +4255,6 @@ static bool isPWINO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isPNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4416,9 +4273,6 @@ static bool isPNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isRVRNO */
|
||||
@@ -4440,7 +4294,6 @@ static bool isPNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isRVRNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4458,9 +4311,6 @@ static bool isRVRNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isCHINO */
|
||||
@@ -4482,7 +4332,6 @@ static bool isRVRNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isCHINO( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4520,9 +4369,6 @@ static bool isCHINO( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isVISNO */
|
||||
@@ -4544,7 +4390,6 @@ static bool isCHINO( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isVISNO( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4581,9 +4426,6 @@ static bool isVISNO( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isFZRANO */
|
||||
@@ -4605,7 +4447,6 @@ static bool isVISNO( char **string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isFZRANO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4624,9 +4465,6 @@ static bool isFZRANO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isTSNO */
|
||||
@@ -4675,7 +4513,6 @@ static bool isFZRANO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isTSNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
{
|
||||
@@ -4693,9 +4530,6 @@ static bool isTSNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
|
||||
}
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: isDollarSign */
|
||||
@@ -4717,7 +4551,6 @@ static bool isTSNO( char *string, Decoded_METAR *Mptr, int *NDEX)
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
static bool isDollarSign( char *indicator, Decoded_METAR *Mptr,
|
||||
int *NDEX )
|
||||
@@ -4736,9 +4569,6 @@ static bool isDollarSign( char *indicator, Decoded_METAR *Mptr,
|
||||
}
|
||||
}
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: DcdMTRmk */
|
||||
@@ -4768,7 +4598,6 @@ static bool isDollarSign( char *indicator, Decoded_METAR *Mptr,
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
void DcdMTRmk( char **token, Decoded_METAR *Mptr )
|
||||
{
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include "Metar.h"
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: dRVMETAR */
|
||||
@@ -29,10 +26,8 @@
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
char bltn_prefix[20];
|
||||
static char *string[] =
|
||||
{
|
||||
"KAST 221156Z COR 09005KT 7SM -RA OVC026 09/08 A2996 RMK "
|
||||
@@ -516,7 +511,6 @@ NULL,
|
||||
Decoded_METAR *Mptr = &Metar;
|
||||
int j,
|
||||
ErReturn;
|
||||
static char *synopRTRN = NULL;
|
||||
|
||||
|
||||
/***************************************************/
|
||||
@@ -541,4 +535,5 @@ NULL,
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "Local.h" /* standard header file */
|
||||
#include "Metar.h"
|
||||
|
||||
#pragma subtitle(" ")
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: fracPart */
|
||||
@@ -26,7 +23,6 @@
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
float fracPart( char *string )
|
||||
{
|
||||
|
||||
@@ -11,8 +11,4 @@ libsgmetar_a_SOURCES = \
|
||||
MetarStation.cpp \
|
||||
Prtdmetr.cpp Stspack2.cpp Stspack3.cpp
|
||||
|
||||
if OLD_AUTOMAKE
|
||||
INCLUDES += -I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
@@ -7,10 +7,8 @@
|
||||
#include "MetarReport.h"
|
||||
#include "Metar.h"
|
||||
|
||||
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||
SG_USING_STD(endl);
|
||||
SG_USING_STD(ostream);
|
||||
#endif
|
||||
|
||||
CMetarReport::CMetarReport(
|
||||
char *s ) :
|
||||
|
||||
@@ -8,11 +8,9 @@
|
||||
#include "MetarStation.h"
|
||||
#include <algorithm>
|
||||
|
||||
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||
SG_USING_STD(ostream);
|
||||
SG_USING_STD(cout);
|
||||
SG_USING_STD(endl);
|
||||
#endif
|
||||
|
||||
|
||||
double CMetarStation::decodeDMS( char *b )
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
// Metar Library test
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <simgear_config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include GLUT_H
|
||||
|
||||
#include <iostream>
|
||||
#include "../MetarReport.h"
|
||||
#include "../MetarStation.h"
|
||||
#include <GL/glut.h>
|
||||
|
||||
static char *report[] =
|
||||
{
|
||||
@@ -546,4 +555,4 @@ main(
|
||||
testMetarReport();
|
||||
testMetarStation( argc, argv );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "Local.h" /* standard header file */
|
||||
#include "Metar.h"
|
||||
#pragma page(1)
|
||||
#pragma subtitle("subtitle - description ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: prtDMETR */
|
||||
@@ -25,7 +23,6 @@
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
void prtDMETR( Decoded_METAR *Mptr )
|
||||
{
|
||||
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
#pragma comment (compiler)
|
||||
//#pragma comment (date)
|
||||
//#pragma comment (timestamp)
|
||||
#pragma pagesize(80)
|
||||
|
||||
#include "Local.h" /* standard header file */
|
||||
|
||||
#pragma page(1)
|
||||
#pragma subtitle(" ")
|
||||
#pragma subtitle("stspack2 - Local string test functions ")
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: stspack2 */
|
||||
@@ -75,7 +67,6 @@
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
#pragma page(1)
|
||||
|
||||
int nisalnum(char *s, int n) {
|
||||
|
||||
@@ -208,4 +199,3 @@ int nisxdigi(char *s, int n) {
|
||||
|
||||
} /* end nisxdigi */
|
||||
|
||||
#pragma page(1)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user