home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume27
/
sfs
/
part16
< prev
next >
Wrap
Text File
|
1991-12-27
|
57KB
|
1,655 lines
Newsgroups: comp.sources.misc
From: tcamp@hercules.acpub.duke.edu (Ted Campbell)
Subject: v27i016: sfs - Space Flight Simulator, Part16/21
Message-ID: <1991Dec24.191827.20996@sparky.imd.sterling.com>
X-Md4-Signature: 0e23d7e2a70a6342d8faaa2ce0a799ce
Date: Tue, 24 Dec 1991 19:18:27 GMT
Approved: kent@sparky.imd.sterling.com
Submitted-by: tcamp@hercules.acpub.duke.edu (Ted Campbell)
Posting-number: Volume 27, Issue 16
Archive-name: sfs/part16
Environment: IBMPC && EGA/VGA, UNIX-PC && MGR, UNIX && X11,
#!/bin/sh
# do not concatenate these parts, unpack them in order with /bin/sh
# file sfs/doc/sfs.ro continued
#
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 16; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping sfs/doc/sfs.ro'
else
echo 'x - continuing file sfs/doc/sfs.ro'
sed 's/^X//' << 'SHAR_EOF' >> 'sfs/doc/sfs.ro' &&
corresponding to the version you wish to
build, and from there is all is well the script will carry
through the building of the program. Both od the scripts
("buildlib.bat" for MSDOS and "Buildlib.sh" for Unix) will
copy all appropriate header files and object libraries to
their appropriate storage directories ("./include" for header
files and "./lib" for object libraries).
.P
The file "buildsfs.bat" will build SFS on a
PC-compatible microcomputer on which the SFS code is properly
loaded, and on which Microsoft QuickC has been installed. The
script file "buildsfs.sh" will allow you to build the program
on three Unix platforms: the X Windows system, the AT&T Unix
PC using the TAM interface, and the AT&T Unix PC using the MGR
user interface. This latter (Unix) script should be run from
the "./sfs/sfs" directory as "sh buildsfs.sh". You will be
prompted for a number corresponding to the version you wish to
build, and from there is all is well the script will carry
through the building of the program.
.sp 2
.ne 5
.ce
4.3 \fBInclude Files\fR
.P
There are a number of include files for the input/output system
and the user interface that need to be available in the standard
include file directory. These are the following:
.TZ
.BA
.ne 9
\fIInclude Files\fR:
X
X ./io/bw/bw.h Bywater error-handling header
X ./io/gr/gr.h Graphics header
X ./io/kb/kb.h Keyboard header
X ./io/dr/dr.h Directory header
X ./io/ui/ui.h User interface header
X ./io/tw/tw.h Text Windows header (not used in SFS)
X
.BZ
.TA
These files should be copied to the SFS hierarchy's include
file directory in a user's system, i.e., "./include". The supplied
"buildlib" scripts (see above) will automatically copy the include
files to the appropriate directory.
.P
Programmers may note that the "bw.h" file does not stand for a
subsystem, but simply contains a few overhead lines for a
standard set of Bywater error-handling routines and data sets.
These allow us to generate error messages in low-level graphics
and input/output functions, which may be handled by applications
programs in a variety of ways.
.sp 2
.ne 5
.ls 1
.ce
4.4 \fBImplementing the Input/Output System\fR
.ce
\fBand the User Interface\fR
.ls 2
.P
Note to PC implementers: in order to implement the Space Flight
Simulator, you must use the LARGE memory model for compiling
all modules of the program. If you are interested in using the
User Interface or other libraries for other purposes, you may
be able to compile with other memory models.
.P
For each of the input/output subsystems, there will be a
specification file giving information on how specific functions
should perform. These are as follows:
.TZ
.BA
.ne 9
\fISpecification Files\fR:
X
X ./io/gr/gr_spec.c Graphics specification
X ./io/kb/kb_spec.c Keyboard specification
X ./io/dr/dr_spec.c Directory specification
X
.BZ
.TA
Existing implementations of the standards are in files labeled,
e.g., "kb_ibmpc.c" for the PC compatible implementation of the
keyboard standards, "gr_tam.c" for the implementation of the
graphics standards under the AT&T Unix PC's TAM system, and
"dr_unix.c" for a generic Unix implementation of the directory
standards.
.P
Since the specification files include the bare shells of
functions which must be implemented, programmers who want to
develop new implementations of the standards are encouraged to
copy the specification file to a new filename, and then to fill
in the function shells as appropriate. In each case there will
be a test program (for example, "gr_test.c") with a makefile to
test the standards. (Note that if you develop a newly named
implementation, the makefile[s] will have to be changed to
reflect the new names.) A suggested order for implementation is:
directory subsystem, keyboard subsystem, and graphics subsystem.
The graphics subsystem test program requires an implementation
of the keyboard subsystem. However, there are many cases (such
as the implementation under X Windows) where the graphics and
keyboard subsystems must be developed in tandem.
.sp 2
.ne 5
4.4.1 Implementing the Graphics (gr) System
.P
The graphics subsystem also includes pointer device (mouse)
routines, since these are usually intimately connected with
computer graphics systems. The graphics subsystem will be,
almost unquestionably, the most difficult to implement, and
requires that you know how to draw pixels, lines, rectangles
(filled in various ways), circles, and the like both to the
computer screen and to memory buffers which can be copied
(blitted) back and forth (from screen to memory and vice versa).
The graphics system must also be able to address text lines to
pixel-specific locations on the screen. Note that there are some
default routines (file "gr_def.c") for lines, rectangles, and
circles which can be built from a single pixel routines. These
may, however, be extremely slow. Use the file "gr_test.c" with
its associated makefile to test the graphics subsystem.
.sp 2
.ne 5
4.4.2 Implementing the Keyboard (kb) System
.P
The keyboard system may be rather more straightforward, but
should allow two critical abilities: (a) it needs to implement a
keyboard scan routine which will tell if a key has been pressed
\fIwithout\fR waiting for a key to be pressed, and (b) it should
return certain eight-bit codes (defined in "kb.h") for arrow
keys, function keys, and the like. Use the "kb_test.c" file with
its associated makefile to test the keyboard subsystem, or (if
developed in tandem with the graphics subsystem), use
"gr_test.c" to test both the keyboard and graphics subsystems
together.
.TZ
.BA
\fINote to Old-Timers\fR. Remember CP/M? CP/M had the keyboard
scan routine built into its operating system. Unix offers nothing
quite so straightforward.
.BZ
.TA
.sp 2
.ne 5
4.4.3 Implementing the Directory (dr) System
.P
The directory subsystem implements two simple subroutines (also
present to the CP/M operating system, but lacking from more
sophisticated machines): one gives the first file that matches
an ambiguous specification (like "*.c"), the other returns the
next file that matches that specification. Either routine may
return BW_ERROR, indicating that there are no files (or no more
files) matching the specification. Use the "dr_test.c" program
and its associated makefile to test the directory subsystem. The
existing implementation of the directory subsystem for Unix
machines simply breaks out to a shell, calls "ls -1c
[specifier]", and reads the files from a temporary file
containing the filenames. Clumsy, but it works.
.sp 2
.ne 5
4.4.4 Building the User Interface
.P
Once the graphics, keyboard, and directory subsystems have been
implemented, the user may proceed to build the Bywater User
Interface, using "ui_test.c" and its associated makefile.
Remember that specific filenames in the makefile may have to be
changed if a programmer has developed new implementations. The
"ui_test" program should illustrate all of the basic abilities
of the Bywater User Interface. Once the implementation is
completed, copy or move all the object files (except
"ui_test.o[bj]) to the library subdirectory (./sfs/lib) of the
SFS file hierarchy, where they will be used in building the
Space Flight Simulator itself.
.sp 2
.ne 5
.ce
4.5 \fBCompiling the Space Flight Simulator\fR
.P
Once the User Interface has been implemented, the hard work is
over. The Space Flight Simulator code is built from the
./sfs/sfs subdirectory of the SFS file hierarchy. (It will also
compile some files from the ./sfs/as directory, but normally one
does not have to switch to that directory.) Makefile systems
vary, and thus there are currently two forms of makefile for the
SFS program building process.
.P
For \fIPC compatible computers using Microsoft QuickC\fR, there
are separate makefiles for sfs (the program loader), sfsm (the
main menu and orbital modeling module), and sfsx (the simulation
module). Each of these must be built separately from the
"./sfs/sfs" subdirectory. \fIImportant notes\fR: When using
Microsoft QuickC, it is important that the global SPAWN should
be defined in the file "sfs.c". Moreover, once the files have
been built, they will exist in the ./sfs/sfs subdirectory as
"sfs.exe", "sfsm.exe", and "sfsx.exe". The file "sfs.exe" should
be copied as is to the ./sfs/bin subdirectory. The file
"sfsm.exe" should be copied to the ./sfs/bin subdirectory as
"sfsm.app". Similarly, the file "sfsx.exe" should be copied to
the ./sfs/bin subdirectory as "sfsx.app".
.TZ
.BA
\fIQuery: Why the name changes\fR? The files "sfsm" and "sfsx"
must be loaded from the program loader ("sfs") and the system
cpuld crash if they are not. For this reason, we have elected to
change the name of their binary files to "*.app" so as to
prevent them from being executed from the command line. It is
for this reason that it is important that the global "SPAWN"
should be defined in "sfs.h": this instructs the compiler to use
the spawn() routine which can execute the "*.app" files.
.BZ
.TA
.P
For \fIUnix\fR based computers, there will be a single makefile
for the SFS system. You
will have to edit the makefile if you want to include the
correct object filenames for your graphics, keyboard, and
directory subsystem files. Three makefiles supplied are
"makefile.x" for X Windows systems, "makefile.tam" for the
AT&T Unix PC using the TAM interface, and "makefile.mgr" for
the AT&T Unix PC using the MGR implementation. It is suggested
that you copy or move one of these
files to "makefile" (with no extension) to build the programs.
For new Unix or other implementations, you may have to do more
extensive editing to the makefiles. The Unix makefiles should
handle moving the binaries to the ./sfs/bin subdirectory. The
XX implementations have been tested only on DECstation 2100 and 3100
workstations, and may not prove adequate on other X platforms.
.PH "''''"
.SK
.sp 4
.ce
Chapter 5
.sp
.ce
SFS DATA FILE FORMATS
.PH "'SFS \*V'Chapter 5'Page #'"
.PF "''Page #''"
.sp 3
.TA
.na
.ne 5
.P
The Space Flight Simulator uses a number of data files which are
accessible to users as ASCII text files. Users may wish to alter
these files for use with SFS, or may find other applications for
the data. The data formats are described in the following
paragraphs. Users should note that in all SFS data files, lines
beginning with a semicolon (";") are discarded, and thus can be
used to enter comments into a data file.
.sp 2
.ne 5
5.1 SFS Program Files (*.sfs)
.P
Space Flight Simulator program files have the extension "*.sfs"
and give data describing particular orbits. These files can be
developed using the orbital modeling module. Each SFS program
file has a header of one line which contains the program title
(can be more than one word). From this point, the program file
is an interpreted language, in which any of the following
keywords may appear:
.TZ
.BA
.nf
.ne 6
The following apply to the program in general, and require
a single integer (i) following the keyword. They should appear
only once in a program file:
X
.ne 6
tfactor i time factor in multiples of real time
update i screen update interval in seconds
trig i trig precision level (1 = fast, 2 = accurate)
insertion i insertion point in seconds
X
.ne 6
The following apply to a specific orbit, and require both
an integral orbit number (o) and another argument which may
be a string (s), or a double-precision number (d). They may
appear once for each orbit in a program:
X
.ne 11
name o s name of spacecraft/orbit
focus o s name of focal data file for this orbit
periapsis o d periapsis in kilometers above the surface
apoapsis o d apoapsis in kilometers above the surface
inclination o d inclination in degrees
argper o d argument of the perigee in degrees
lonan o d longitude of the ascending node in degrees
orb o s spherical data file for orb
grid o s spherical data file for lat-lon grid
surface o s spherical data file for surface features
X
.fi
.BZ
.TA
Users might study examples of SFS program files before
attempting to alter them. Only the items "grid" and "orb" cannot
be specified from the orbital modeling module (and altering them
can have grotesque results). For this reason, users are
cautioned to use the modeling module, where more precautions are
available.
.sp 2
.ne 5
5.2 Focal Data Files (*.fd)
.P
Focal data files have the extension "*.fd" and describe a
particular orbital focus. They are rather more straightforward,
and have the following structure (elements must appear in this
order):
.TZ
.BA
.nf
.ne 4
\fIElements in a Focal Data File\fR:
X
.ne 6
the name of the orbital focus (a single word)
an adjective describing the focus (a single word)
the diameter of the focus in kilometers
the mass of the focus (earth = 1.0)
the sidereal period of the focus in seconds
X
.ne 4
\fIAn Example ("earth.fd")\fR:
X
.ne 6
Earth
terrestrial
6378
1.0
86164
X
.fi
.BZ
.TA
.PF "''''"
Again, users are advised to study existing focal data files
before creating new ones.
.sp 2
.ne 5
5.3 Spherical Projection Data Files (*.spd)
.P
Spherical projection data (SPD) files have the extension "*.spd"
and describe points in three-dimensional space by latitude,
longitude, and altitude. The spherical projection data format is
derived distantly from the binary format employed by the Micro
World Database (tm). The Space Flight Simulator uses spherical
projection data files to describe surface features of orbital
foci (for example, the earth's landmasses in "earth.spd"). Each
line in a SPD file describes a single point, and consists of the
following elements:
.sp
.nf
X code latitude longitude altitude
.fi
The code is either a number above 1000 indicating the beginning
of a new line, or a number below 1000 indicating the continuation
of a line.
.TZ
.BA
\fIAn Example\fR: The following is a simple spherical data file
("meridian.spd") that draws a central meridian on the surface of
a planet:
X
.ne 6
.nf
; meridian.spd
;
; display single central meridian
;
;
1001 -90.0 0.0 6000.0
5 -80.0 0.0 6000.0
5 -70.0 0.0 6000.0
5 -60.0 0.0 6000.0
5 -50.0 0.0 6000.0
5 -40.0 0.0 6000.0
5 -30.0 0.0 6000.0
5 -20.0 0.0 6000.0
5 -10.0 0.0 6000.0
5 0.0 0.0 6000.0
5 10.0 0.0 6000.0
5 20.0 0.0 6000.0
5 30.0 0.0 6000.0
5 40.0 0.0 6000.0
5 50.0 0.0 6000.0
5 60.0 0.0 6000.0
5 70.0 0.0 6000.0
5 80.0 0.0 6000.0
5 90.0 0.0 6000.0
X
.ne 6
.fi
\fIRoom for Improvement\fR: At present all codes for beginning a
new line are set to 1001 and all codes for continuing a line are
set to 5. Future versions of the software might develop a more
elaborate set of codes above 1000 which could indicate, e.g.,
gas forms (for describing gas giants such as Jupiter), landmass
delimiters, craters, mountains, rifts, and the like. Then the
program might assign various colors to different features. Also,
the SFS programs currently ignore the altitude, presuming that
all points are on the surface (thus, the altitude of each point
is set equal to the focal radius). Future versions might
recognize altitudes, thus enabling the display of irregular
orbital foci. Also, future versions of SPD files might allow a
comment or title at the end of a point, so that titles could be
shown on a focal surface.
.BZ
.TA
.PH "''''"
.SK
.sp 4
.ce
Chapter 6
.sp
.ce
The MAP Utility
.sp 2
.PH "'SFS \*V'Chapter 6'Page #'"
.PF "''Page #''"
.P
The MAP utility (source code and binaries are distributed
separately from the PC version of the SFS software) allows users
to enter spherical projection data points by pointing and
clicking the pointer device within a latitude-longitude grid.
The MAP utility thus requires the use of a pointer (mouse) device.
.P
The MAP utility is entered from the command line with an
optional argument specifying the SPD datafile to be worked on.
Thus the command line,
.nf
X map earth.spd
.fi
would enter the MAP utility and begin work on the file "earth.spd".
The filename "test.spd" is used as a default if no argument is
specified on the command line. Once the MAP utility has been
entered, the working file cannot be changed.
.P
The MAP utility utilizes the same user interface as the Space
Flight Simulator, and has a main menu that is accessible by pressing
the ESCAPE key or by clicking the pointer device on the top
(title) bar. The following are the options available in the main
MAP menu.
.sp 2
.ne 5
6.1 Change Position
.P
This option from the main menu allows the user to focus on a
particular position of the latitude-longitude grid, or to look at
the entire latitude-longitude grid. By pressing the arrow keys,
a dark outline of the selected area can be moved around. By
pressing the RETURN or ENTER key, the currently selected area is
chosen, and the screen will be redrawn accordingly.
.sp 2
.ne 5
6.2 Enter Title or Comments
.P
The Space Flight Simulator's Spherical Projection Data (SPD)
format allows for embedded title and comment lines. This option
from the main MAP utility menu allows the user to enter a line of
text that will be embedded in the working data file as a title or
comment. Since comment lines will not be entered at run time,
they are used solely for making sense of an SPD data file when it
is read by a text editor, and users are encouraged to document and
comment their SPD files as elaborately as possible.
.sp 2
.ne 5
6.3 Begin Sequence
.P
This is where the serious work of the MAP utility is done. This
option from the main MAP utility menu allows users to enter a
sequence of points on the latitude-longitude grid, which are
recorded in the working data file. After selecting this item,
the user points the pointer device at specific points on the
grid, and presses and releases the left button to mark the point.
At the next point entered, a line will be drawn from the previous
point to the new point, and so on. The sequence is ended by
clicking in the "QUIT" label in the top (title) bar.
.P
By pressing in the "BACKUP" label in the top (title) bar, the
user can erase the most recently added point. The user should be
careful, then, to check each point as it is entered, and BACKUP
if it has not been positioned correctly.
.P
Users of the MAP utility should remember that all of the points
in a sequence will be joined by direct lines. For this reason,
the user should only enter points in a particular sequence that
will be tied together. It is recommended that complex figures be
broken up into smaller units, even when unbroken sequences of
lines are desired (begin a new sequence at the last point of the
old one to carry through the appearance of unbrokenness).
.sp 2
.ne 5
6.4 Set Default Attitude
.P
Although the present version of the Space Flight Simulator takes
all surface points to be at the (average) radius of an orbital
focus, the SPD specification allows an altitude for the point to
be entered. This will eventually allow SFS to develop more
elaborate three-dimensional simulations. Typically, the altitude
is simply set to the radius of the rbital focus. This option
from the main MAP utility menu allows the user to specify a
default altitude that will be used for all subsequent points
entered.
.sp 2
.ne 5
6.5 Exit
.P
This item allows the user to exit from the MAP utility. The
current working data file is saved with all changes that have
been entered.
.BZ
.TA
.PH "''''"
.SK
.sp 4
.ce
Chapter 7
.sp
.ce
COMMUNICATIONS
.sp 3
.ls 1
.nf
Bywater Software
P. O. Box 4023
Duke Station
Durham, NC 27706
X
email: tcamp@hercules.acpub.duke.edu
.fi
.TA
.sp 2
.ne 6
About the author:
.sp
.P
Ted A. Campbell is an Assistant Professor of Church History at
the Divinity School, Duke University. Programming is an
avocational interest. In addition to books and articles in the
field of Church History, he is the author of the program
"Stardate," published by the National Collegiate Software
Clearinghouse.
.ls 2
.TZ
.. \"===================================================
.. \" end of sfs.ro
.. \"===================================================
SHAR_EOF
echo 'File sfs/doc/sfs.ro is complete' &&
chmod 0644 sfs/doc/sfs.ro ||
echo 'restore of sfs/doc/sfs.ro failed'
Wc_c="`wc -c < 'sfs/doc/sfs.ro'`"
test 73260 -eq "$Wc_c" ||
echo 'sfs/doc/sfs.ro: original size 73260, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= sfs/doc/tmac.m ==============
if test -f 'sfs/doc/tmac.m' -a X"$1" != X"-c"; then
echo 'x - skipping sfs/doc/tmac.m (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting sfs/doc/tmac.m (Binary)'
sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
begin 600 sfs/doc/tmac.m
M+BX)7"(]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T*+BX)7"(*+BX)7"()=&UA8RYM"BXN"5PB"BXN"5PB"71E
M>'0@;6%C<F]S(&9O<B!T:&4@(G)O(B!T97AT(&9O<FUA='1E<@HN+@E<(@EB
M>2!4960@02X@0V%M<&)E;&P*+BX)7"(*+BX)7"(]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T*+BX)7"(*+BX)
M7"(]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T*+BX)7"()4F5S970@=&]P(&%N9"!B;W1T;VT@;6%R9VEN(')E
M9VES=&5R<PHN33$@-@HN33(@,@HN33,@,@HN330@-@HN;&P@-C4*+G!O(#@*
M+BX)7"(]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T*+BX)7"()3G5M8F5R(')E9VES=&5R(")0(B`M+2!C=7)R
M96YT('!A9V4@;G5M8F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T]/3T]/3T]/3T]/0HN+@E<(@E-86-R;R`B0EHB("TM(&)L;V-K
M('-E9VUE;G0@96YD:6YG"BYD92!"6@HN:6X@+34*+FQL("LU"BXN"BXN"5PB
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]"BXN"5PB"BXN"5PB"45N9"!O9B!T;6%C+FT*+BX)7"(*+BX)7"(]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
&/3T]/3T*
`
end
SHAR_EOF
echo 'uudecoding file sfs/doc/tmac.m' &&
uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
chmod 0644 sfs/doc/tmac.m ||
echo 'restore of sfs/doc/tmac.m failed'
Wc_c="`wc -c < 'sfs/doc/tmac.m'`"
test 3741 -eq "$Wc_c" ||
echo 'sfs/doc/tmac.m: original size 3741, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= sfs/map/README.map ==============
if test ! -d 'sfs/map'; then
echo 'x - creating directory sfs/map'
mkdir 'sfs/map'
fi
if test -f 'sfs/map/README.map' -a X"$1" != X"-c"; then
echo 'x - skipping sfs/map/README.map (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting sfs/map/README.map (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'sfs/map/README.map' &&
X
X ------------------
X
X Bywater Software
X Release Notice
X
X Space Flight Simulator MAP Utility
X version 1.01
X (PC-Compatible Binaries)
X
X ------------------
X
Bywater Software is pleased to announce the public availability
of its Space Flight Simulator in its first complete release,
version 1.01. This software is copyright (c) 1991, Ted A.
Campbell, and is released under the terms of an agreement specified
in the file "sfs.ro".
X
Description: The map utility (source code and binaries are distributed
X separately from the PC version of the SFS software) allows
X users to enter spherical projection data points by pointing
X and clicking the mouse device within a latitude-longitude
X grid.
X
Requirements: This implementation of the Space Flight Simulator
X MAP utility requires an IBM PC or compatible
X microcomputer, with Hercules, EGA, or VGA graphics.
X The optional use of a pointer device (mouse) is
X supported. A fast cpu and a math coprocessor will
X also speed up and smooth out the overall display.
X The program requires one disk drive that has at
X least 700k of space available.
X
Documentation: Complete documentation for the MAP utility is in
X Chapter 6 of the file "sfs.ro", which is in a format
X compatible with the "ro" text formatter (supplied with
X the PC-compatible binaries for SFS).
X
Source Code: This release of the Space Flight Simulator will
X include source code for the complete Space Flight
X Simulator, the MAP utility, and their underlying User
X Interface (ui). The source code can be compiled on the
X PC-compatible microcomputers, the AT&T Unix PC, and on
X Unix Platforms which have implemented the X Windows
X system, version 11 (tested on DecStation 2100 and
X 3100).
X
Communications: Bywater Software
X P. O. Box 4023
X Duke Station
X Durham, NC 27707
X USA
X
X email: tcamp@hercules.acpub.duke.edu
X
SHAR_EOF
chmod 0644 sfs/map/README.map ||
echo 'restore of sfs/map/README.map failed'
Wc_c="`wc -c < 'sfs/map/README.map'`"
test 2002 -eq "$Wc_c" ||
echo 'sfs/map/README.map: original size 2002, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= sfs/map/makefile.tam ==============
if test -f 'sfs/map/makefile.tam' -a X"$1" != X"-c"; then
echo 'x - skipping sfs/map/makefile.tam (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting sfs/map/makefile.tam (Binary)'
sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
begin 600 sfs/map/makefile.tam
M(RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+0HC"B,);6%K969I;&4N=&%M"B,*(PE5;FEX
M($UA:V5F:6QE(&9O<B!3<&%C92!&;&EG:'0@4VEM=6QA=&]R"B,)36%P(%5T
M:6QI='D@+2T@050F5"!5;FEX(%!#+"!404T@:6YT97)F86-E"B,*(RTM+2TM
M+2TM+2TM+2TM+2TM+2T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A<"!U=&EL:71Y"@IM87`Z"0DD*$U!4"D@)"A!4U0I"@D)
M)"A#0RD@)"A#1DQ!1U,I("0H34%0*2`D*$%35"D@)"A,24)3*5P*("`@("`@
M("`@("`@("`@("UL=&%M("UL=&5R;6-A<"`M;&T@+6\@;6%P"@HC+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM"B,@4W!E8VEF:6,@9&5P96YD96YC:65S.@H*;6%P+F\Z
M"0H)"20H0T,I("0H0T9,04=3*2!M87`N8R`M8PH*;6%P7V1R+F\Z"0H)"20H
M0T,I("0H0T9,04=3*2!M87!?9'(N8R`M8PH*87-?;W)B:70N;SH*"0DD*$-#
M*2`D*$-&3$%'4RD@+BXO87,O87-?;W)B:70N8R`M8PH*87-?9F]C=7,N;SH*
M"0DD*$-#*2`D*$-&3$%'4RD@+BXO87,O87-?9F]C=7,N8R`M8PH*87-?=G!T
M+F\Z"@D))"A#0RD@)"A#1DQ!1U,I("XN+V%S+V%S7W9P="YC("UC"@IA<U]S
M<&HN;SH*"0DD*$-#*2`D*$-&3$%'4RD@+BXO87,O87-?<W!J+F,@+6,*"B,M
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2T*(R!%;F0@;V8@;6%K969I;&4N=&%M"B,M+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
2+2TM+2TM+2TM+2TM+2T*"@H:
`
end
SHAR_EOF
echo 'uudecoding file sfs/map/makefile.tam' &&
uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
chmod 0644 sfs/map/makefile.tam ||
echo 'restore of sfs/map/makefile.tam failed'
Wc_c="`wc -c < 'sfs/map/makefile.tam'`"
test 1593 -eq "$Wc_c" ||
echo 'sfs/map/makefile.tam: original size 1593, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= sfs/map/makefile.x ==============
if test -f 'sfs/map/makefile.x' -a X"$1" != X"-c"; then
echo 'x - skipping sfs/map/makefile.x (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting sfs/map/makefile.x (Binary)'
sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
begin 600 sfs/map/makefile.x
M(RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+0HC"B,);6%K969I;&4N>`HC"B,)56YI>"!-
M86ME9FEL92!F;W(@4W!A8V4@1FQI9VAT(%-I;75L871O<@HC"4UA<"!5=&EL
M:71Y("TM(%@@5VEN9&]W<R!V97(N(#$Q"B,*(RTM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+0H*(RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+0HC('5I(&%N9"!A<R!O8FIE8W0@9FEL
M97,*"DQ)0E,]"0DN+B\N+B]L:6(O=6E?8F]X97,N;R`N+B\N+B]L:6(O=6E?
M9&EA;"YO(%P*"0DN+B\N+B]L:6(O=6E?:6YI="YO("XN+RXN+VQI8B]U:5]L
M:7-T+F\@+BXO+BXO;&EB+W5I7W1E>'0N;R!<"@D)+BXO+BXO;&EB+W5I7V=E
M=',N;R`N+B\N+B]L:6(O=6E?<&)M+F]<"@D)+BXO+BXO;&EB+V=R7W@N;UP*
M("`@("`@("`@("`@("`@("XN+RXN+VQI8B]D<E]U;FEX+F\@+BXO+BXO;&EB
M+VMB7W@N;PH*05-4/0D)87-?;W)B:70N;R!A<U]F;V-U<RYO(&%S7W9P="YO
M(%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20H0T,I("0H0T9,04=3*2`N+B]A<R]A<U]S<&HN8R`M8PH*(RTM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+0HC($5N9"!O9B!M86ME9FEL92YX"B,M+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
/+2TM+2TM+2TM+2T*"@H:
`
end
SHAR_EOF
echo 'uudecoding file sfs/map/makefile.x' &&
uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
chmod 0644 sfs/map/makefile.x ||
echo 'restore of sfs/map/makefile.x failed'
Wc_c="`wc -c < 'sfs/map/makefile.x'`"
test 1545 -eq "$Wc_c" ||
echo 'sfs/map/makefile.x: original size 1545, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= sfs/map/map.c ==============
if test -f 'sfs/map/map.c' -a X"$1" != X"-c"; then
echo 'x - skipping sfs/map/map.c (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting sfs/map/map.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'sfs/map/map.c' &&
/***************************************************************
X
X map.c map utility for Space Flight Simulator
X
X Copyright (c) 1991, Ted A. Campbell
X
X Bywater Software
X P. O. Box 4023
X Duke Station
X Durham, NC 27706
X
X email: tcamp@hercules.acpub.duke.edu
X
X Copyright and Permissions Information:
X
X All U.S. and international copyrights are claimed by the
X author. The author grants permission to use this code
X and software based on it under the following conditions:
X (a) in general, the code and software based upon it may be
X used by individuals and by non-profit organizations; (b) it
X may also be utilized by governmental agencies in any country,
X with the exception of military agencies; (c) the code and/or
X software based upon it may not be sold for a profit without
X an explicit and specific permission from the author, except
X that a minimal fee may be charged for media on which it is
X copied, and for copying and handling; (d) the code must be
X distributed in the form in which it has been released by the
X author; and (e) the code and software based upon it may not
X be used for illegal activities.
X
***************************************************************/
X
#include "stdio.h"
#include "time.h"
#include "signal.h"
#include "ctype.h"
#include "math.h"
X
#include "bw.h"
#include "gr.h"
#include "kb.h"
#include "dr.h"
#include "ui.h"
#include "as.h"
X
#include "map.h"
X
#ifdef __STDC__
#include "malloc.h"
#else
extern char * malloc();
#endif
X
#ifndef __STDC__
#define time_t long
#define size_t int
#endif
X
extern int map_sigint();
X
/*** Colors */
X
int cl_mback; /* Main background color */
int cl_mfore; /* Main foreground color */
int cl_marker; /* Color for prompt markers */
int cl_grid; /* Color for planetary grid */
int cl_surface; /* Color for planetary surface */
X
struct spj_pt spd_start, spd_end; /* surface data pointers */
struct spj_pt new_start, new_end; /* new data pointers */
struct spj_pt *lastspj; /* pointer to last new spj point */
X
struct uiwindow *main_window; /* structure for main window */
struct uiwindow *map_window; /* structure for map window */
char bw_ebuf[ BW_EBUFSIZE ];
char map_tbuf[ BW_EBUFSIZE ];
char map_datafile[ 128 ];
int dr_xsize; /* Size of ground track map, x */
int dr_ysize; /* Size of ground track map, y */
int dr_mapbase; /* Bottom of dr map */
int dr_mapedge; /* Left edge of groundtrack map */
int mesg_y;
int map_curpos = 0; /* current position (default: full) */
double map_defalt = 0.0; /* default altitude */
FILE *outfile; /* file for output */
X
int map_pos[ 10 ][ 4 ] = {
X { -180, -90, 180, 90 }, /* 0 - full */
X { -180, -90, 0, 0 }, /* 1 - lower left */
X { -90, -90, 90, 0 }, /* 2 - lower middle */
X { 0, -90, 180, 0 }, /* 3 - lower right */
X { -180, -45, 0, 45 }, /* 4 - center left */
X { -90, -45, 90, 45 }, /* 5 - center middle */
X { 0, -45, 180, 45 }, /* 6 - center right */
X { -180, 0, 0, 90 }, /* 7 - upper left */
X { -90, 0, 90, 90 }, /* 8 - upper middle */
X { 0, 0, 180, 90 } }; /* 9 - upper right */
X
static struct uiwindow *dial_window;
static int dial_x1 = 0, dial_x2, dial_y1, dial_y2;
static int midx, midy, length, height;
static char buffer[ BW_EBUFSIZE ];
X
char *mm_titles[ MM_TITLES ] = {
X MM_POSITION,
X MM_ENTITLE,
X MM_SEQUENCE,
X MM_ALTITUDE,
X MM_EXIT };
X
extern int map_sigint();
X
/****************************************************************
X
X main()
X
****************************************************************/
X
main( argc, argv )
X int argc;
X char **argv;
X {
X int offs_y, offs_x, m_x1, m_y1, m_x2, m_y2;
X
X /*** set a signal handler so that a SIGINT */
X /*** (control-C under DOS, DEL under Unix) will */
X /*** exit gracefully */
X
X signal( SIGINT, map_sigint );
X
X /*** process argument 1 for data file */
X
X if ( argc > 1 )
X {
X strcpy( map_datafile, argv[ 1 ] );
X }
X else
X {
X strcpy( map_datafile, MAP_DEFAULTDATA );
X }
X
X /* Initialize the user interface */
X
X ui_init();
X
X if ( ui_ready != TRUE )
X {
X gr_deinit();
X fprintf( stderr, "Graphics system not initialized.\n" );
X exit( -1 );
X }
X
X if ( gr_ismouse != TRUE )
X {
X gr_deinit();
X fprintf( stderr,
X "The map utility requires the use of a pointer device (\"mouse\").\n" );
X exit( -1 );
X }
X
X map_colors(); /* Set colors */
X
X /* reset icon colors */
X
X if ( gr_colors > 2 )
X {
X ui_seticons( cl_mback, cl_marker );
X }
X
X /* Initialize variable-precision trig */
X
X vpt_init();
X
X map_font( 0 );
X
X /* Clear the screen */
X
X gr_cls( GR_PRIMARY );
X
X /* Draw main screen */
X
X sprintf( map_tbuf, MAP_TITLE, MAP_VERSION );
X main_window = ui_window( 0, 0, ui_grwind->xmax, ui_grwind->ymax,
X TRUE, cl_marker, cl_mfore,
X map_tbuf, TRUE, cl_mback,
X FALSE, BLACK, BLACK, SOLID );
X
X /* delimit message area */
X
X mesg_y = 5 + ui_grwind->fysize + 3;
X gr_line( GR_PRIMARY, main_window->u_x1, mesg_y,
X main_window->u_x2, mesg_y, WHITE, SOLID );
X
X /* read spd data */
X
X spj_readspd( map_datafile, &spd_start, &spd_end );
X
X /* initialize new data pointers */
X
X new_start.next = &new_end;
X lastspj = &new_start;
X
X /* open datafile for append */
X
X if ( ( outfile = fopen( map_datafile, "a" ) ) == NULL )
X {
X sprintf( bw_ebuf, "Cannot open file %s for append.",
X map_datafile );
X }
X
X /* set up display */
X
X offs_x = gr_strlen( " 000: " );
X offs_y = ui_grwind->fysize + 4;
X m_x1 = main_window->u_x1 + offs_x;
X m_y1 = mesg_y + offs_y;
X m_x2 = main_window->u_x2 - offs_x;
X m_y2 = main_window->u_y2 - offs_y;
X map_window = ui_window( m_x1, m_y1, m_x2, m_y2,
X FALSE, cl_marker, cl_mfore,
X map_tbuf, FALSE, cl_mback,
X FALSE, BLACK, BLACK, SOLID );
X
/* dr_draw( map_window, TRUE, &spd_start, &spd_end, 0 ); */
X map_draw( map_curpos );
X
X bw_message( MAP_HELP );
X while( TRUE )
X {
X map_poll();
X }
X }
X
/****************************************************************
X
X map_poll()
X
****************************************************************/
X
map_poll()
X {
X register int c;
X static int x, y, b;
X
X /* Check for keyboard input */
X
X if ( kb_rxstat() == TRUE )
X {
X c = kb_rx();
X if ( c == 0x1b )
X {
X map_esc();
X }
X }
X
X /* Check for mouse input */
X
X if ( gr_ismouse == TRUE )
X {
X if ( gr_mouse( SAMPLE, &x, &y, &b ) == TRUE )
X {
X
X gr_mouse( WAIT, &x, &y, &b ); /* click down */
X gr_mouse( WAIT, &x, &y, &b ); /* click up */
X
#ifdef OLD_DEBUG
X sprintf( sfsx_tbuf, "Mouse hit: %d %d", x, y );
X bw_debug( sfsx_tbuf );
#endif
X
X /* Is the release within bounds ? */
X
X if ( uil_bounds( x, y, main_window->tbar_x1, main_window->tbar_y1,
X main_window->tbar_x2, main_window->tbar_y2) == TRUE )
X {
X map_esc();
X }
X
X }
X }
X }
X
/****************************************************************
X
X map_esc()
X
****************************************************************/
X
map_esc()
X {
X static struct menu_box esc_box;
X static int x_x1 = 0, x_y1 = 0, x_x2 = 0, x_y2 = 0, item;
X static int x_ebuf;
X int xcenter, ycenter;
X
X ui_push(); /* save current ui screen */
X ui_setscreen( GR_PRIMARY ); /* set primary screen */
X if ( x_x1 == 0 )
X {
X xcenter = main_window->u_x1 +
X (( main_window->u_x2 - main_window->u_x1 ) / 2 );
X ycenter = main_window->u_y1 +
X (( main_window->u_y2 - main_window->u_y1 ) / 2 );
X x_x1 = (int) xcenter - ( ui_grwind->xmax / 4 );
X x_y1 = (int) ycenter - ( ui_grwind->fysize * 7 );
X x_x2 = (int) xcenter + ( ui_grwind->xmax / 4 );
X x_y2 = (int) ycenter + ( ui_grwind->fysize * 5 );
X }
X
X gr_imsave( GR_PRIMARY, TRUE, x_x1, x_y1, x_x2, x_y2, &x_ebuf );
X
X bw_message( MAP_MM );
X
X esc_box.is_drawn = FALSE;
X item = ui_list( MENU_SLIDERS, x_x1, x_y1, x_x2, x_y2,
X MM_TITLE, MM_TITLES,
X mm_titles, cl_mfore, cl_mback, cl_marker,
X &esc_box );
X
X gr_imsave( GR_PRIMARY, FALSE, x_x1, x_y1, x_x2, x_y2, &x_ebuf );
X gr_imfree( x_ebuf );
X bw_message( MAP_HELP );
X
X switch( item )
X {
X case 0:
X map_select();
X bw_message( MAP_HELP );
X break;
X case 1:
X map_entitle();
X bw_message( MAP_HELP );
X break;
X case 2:
X map_sequence();
X bw_message( MAP_HELP );
X break;
X case 3:
X map_altitude();
X bw_message( MAP_HELP );
X break;
X case 4:
X map_exit();
X exit(0);
X default:
X break;
X }
X
X ui_pop(); /* restore ui screen */
X
X }
X
/****************************************************************
X
X map_select()
X
****************************************************************/
X
map_select()
X {
X register int selpos, c;
X
X selpos = map_curpos;
X if ( selpos != 0 )
X {
X map_draw( 0 );
X }
X c = TRUE;
X bw_message( MAP_SELECT );
X while( c )
X {
X map_bound( TRUE, selpos );
X c = kb_rx();
X map_bound( FALSE, selpos );
X switch( c )
X {
X case KB_UP:
X if ( selpos < 7 )
X {
X selpos += 3;
X }
X break;
X case KB_DOWN:
X if ( selpos > 3 )
X {
X selpos -= 3;
X }
X break;
X case KB_RIGHT:
X ++selpos;
X selpos %= 10;
X break;
X case KB_LEFT:
X --selpos;
X selpos += 10;
X selpos %= 10;
X break;
X case CR:
X case LF:
X c = FALSE;
X map_curpos = selpos;
X break;
X }
X }
X map_draw( map_curpos );
X }
X
/****************************************************************
X
X map_draw()
X
****************************************************************/
X
map_draw( pos )
X int pos;
X {
X register int i, c;
X int x;
X
X /* Blank the whole area */
X
X ui_fbox( main_window->u_x1, mesg_y + 1, main_window->u_x2,
X main_window->u_y2, BLACK, SOLID );
X
X /* draw original lines */
X
X dr_draw( map_window, TRUE, &spd_start, &spd_end, pos );
X
X /* plot new (added) lines */
X
X dr_plot( &new_start, &new_end, cl_surface, SOLID, pos );
X
X /* write bounds */
X
X if ( pos == 0 )
X {
X i = 30;
X }
X else
X {
X i = 15;
X }
X
X /* write latitudes */
X
X x = dr_mapbase - ( ui_grwind->fysize / 2 );
X sprintf( map_tbuf, " %d ", map_pos[ pos ][ 1 ] );
X gr_text( GR_PRIMARY, dr_mapedge - ( gr_strlen( map_tbuf ) + 1 ),
X dr_mapbase, map_tbuf, BLACK, WHITE );
X gr_text( GR_PRIMARY, dr_mapedge + dr_xsize + 1,
X dr_mapbase, map_tbuf, BLACK, WHITE );
X x += dr_ysize
X / ( ( map_pos[ pos ][ 3 ] - map_pos[ pos ][ 1 ] ) / i );
X for ( c = map_pos[ pos ][ 1 ] + i; c < map_pos[ pos ][ 3 ]; c += i )
X {
X sprintf( map_tbuf, " %d ", c );
X gr_text( GR_PRIMARY, dr_mapedge - ( gr_strlen( map_tbuf ) + 2 ),
X x, map_tbuf, WHITE, BLACK );
X gr_text( GR_PRIMARY, dr_mapedge + dr_xsize + 1,
X x, map_tbuf, WHITE, BLACK );
X x += dr_ysize
X / ( ( map_pos[ pos ][ 3 ] - map_pos[ pos ][ 1 ] ) / i );
X }
X sprintf( map_tbuf, " %d ", map_pos[ pos ][ 3 ] );
X gr_text( GR_PRIMARY, dr_mapedge - gr_strlen( map_tbuf ) - 1,
X dr_mapbase + dr_ysize - ui_grwind->fysize, map_tbuf, BLACK, WHITE );
X gr_text( GR_PRIMARY, dr_mapedge + dr_xsize + 1,
X dr_mapbase + dr_ysize - ui_grwind->fysize, map_tbuf, BLACK, WHITE );
X
X /* write longitudes */
X
X x = dr_mapedge;
X
X sprintf( map_tbuf, " %d ", map_pos[ pos ][ 0 ] );
X gr_text( GR_PRIMARY, dr_mapedge,
X dr_mapbase - ( ui_grwind->fysize + 1 ), map_tbuf, BLACK, WHITE );
X gr_text( GR_PRIMARY, dr_mapedge,
X dr_mapbase + dr_ysize + 1, map_tbuf, BLACK, WHITE );
X x += dr_xsize
X / ( ( map_pos[ pos ][ 2 ] - map_pos[ pos ][ 0 ] ) / i );
X
X for ( c = map_pos[ pos ][ 0 ] + i; c < map_pos[ pos ][ 2 ]; c += i )
X {
X sprintf( map_tbuf, " %d ", c );
X gr_text( GR_PRIMARY, x - ( gr_strlen( map_tbuf ) / 2 ),
X dr_mapbase - ( ui_grwind->fysize + 1 ), map_tbuf, WHITE, BLACK );
X gr_text( GR_PRIMARY, x - ( gr_strlen( map_tbuf ) / 2 ),
X dr_mapbase + dr_ysize + 1, map_tbuf, WHITE, BLACK );
X x += dr_xsize
X / ( ( map_pos[ pos ][ 2 ] - map_pos[ pos ][ 0 ] ) / i );
X }
X sprintf( map_tbuf, " %d ", map_pos[ pos ][ 2 ] );
X gr_text( GR_PRIMARY, dr_mapedge + dr_xsize - gr_strlen( map_tbuf ),
X dr_mapbase - ( ui_grwind->fysize + 1 ), map_tbuf, BLACK, WHITE );
X gr_text( GR_PRIMARY, dr_mapedge + dr_xsize - gr_strlen( map_tbuf ),
X dr_mapbase + dr_ysize + 1, map_tbuf, BLACK, WHITE );
X }
X
/****************************************************************
X
X map_bound()
X
****************************************************************/
X
map_bound( highlight, pos )
X int highlight, pos;
X {
X int style;
X double x1, y1, x2, y2;
X
X if ( highlight == TRUE )
X {
X style = SOLID;
X }
X else
X {
X style = GRID;
X }
X
#ifdef OLD_DEBUG
X sprintf( map_tbuf, "highlight %d, position %d, style %d",
X highlight, pos, style );
X bw_debug( map_tbuf );
#endif
X
X x1 = map_pos[ pos ][ 0 ];
X y1 = map_pos[ pos ][ 1 ];
X x2 = map_pos[ pos ][ 0 ];
X y2 = map_pos[ pos ][ 3 ];
X dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
X dr_line( y1, x1, y2, x2, WHITE, style, 0 );
X
X x1 = map_pos[ pos ][ 2 ];
X y1 = map_pos[ pos ][ 1 ];
X x2 = map_pos[ pos ][ 2 ];
X y2 = map_pos[ pos ][ 3 ];
X dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
X dr_line( y1, x1, y2, x2, WHITE, style, 0 );
X
X x1 = map_pos[ pos ][ 0 ];
X y1 = map_pos[ pos ][ 1 ];
X x2 = map_pos[ pos ][ 2 ];
X y2 = map_pos[ pos ][ 1 ];
X dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
X dr_line( y1, x1, y2, x2, WHITE, style, 0 );
X
X x1 = map_pos[ pos ][ 0 ];
X y1 = map_pos[ pos ][ 3 ];
X x2 = map_pos[ pos ][ 2 ];
X y2 = map_pos[ pos ][ 3 ];
X dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
X dr_line( y1, x1, y2, x2, WHITE, style, 0 );
X
X gr_line( GR_PRIMARY, dr_mapedge, dr_mapbase, dr_mapedge,
X dr_mapbase + dr_ysize, cl_grid, SOLID );
X
X gr_line( GR_PRIMARY, dr_mapedge + dr_xsize, dr_mapbase,
X dr_mapedge + dr_xsize, dr_mapbase + dr_ysize,
X cl_grid, SOLID );
X
X gr_line( GR_PRIMARY, dr_mapedge, dr_mapbase,
X dr_mapedge + dr_xsize,
X dr_mapbase, cl_grid, SOLID );
X
X gr_line( GR_PRIMARY, dr_mapedge, dr_mapbase + dr_ysize,
X dr_mapedge + dr_xsize, dr_mapbase + dr_ysize,
X cl_grid, SOLID );
X
X }
X
/****************************************************************
X
X map_sequence()
X
****************************************************************/
X
map_sequence()
X {
X int qu_x1, qu_y1, qu_x2, qu_y2;
X int bu_x1, bu_y1, bu_x2, bu_y2;
X register int c;
X static int x, y, b;
X double xpos, ypos;
X double prevx, prevy, lastx, lasty;
X struct spj_pt *curspj;
X int n, allow_backup;
X
X bw_message( MAP_SEQM );
X
X if ( gr_ismouse != TRUE )
X {
X bw_error( ERR_MOUSE );
X return BW_ERROR;
X }
X
X /* calculate sizes for quit and backup spaces */
X
X qu_x1 = ( main_window->u_x2 - main_window->u_x1 ) / 2;
X qu_x2 = qu_x1 + ( ( main_window->u_x2 - main_window->u_x1 ) / 4 );
X qu_y1 = main_window->tbar_y1;
X qu_y2 = main_window->tbar_y2;
X bu_x1 = qu_x2 + 1;
X bu_x2 = main_window->u_x2;
X bu_y1 = main_window->tbar_y1;
X bu_y2 = main_window->tbar_y2;
X
X /* draw delimiters for quit and backup spaces */
X
X gr_line( GR_PRIMARY, qu_x1, qu_y1, qu_x1, qu_y2, BLACK, SOLID );
X gr_line( GR_PRIMARY, bu_x1, bu_y1, bu_x1, bu_y2, BLACK, SOLID );
X
X /* denote quit and backup spaces */
X
X gr_text( GR_PRIMARY, qu_x1 + 3, qu_y1, SEQ_QUIT, BLACK, WHITE );
X gr_text( GR_PRIMARY, bu_x1 + 3, bu_y1, SEQ_BACKUP, BLACK, WHITE );
X
X lastx = lasty = prevx = prevy = xpos = ypos = 0.0;
X n = 0;
X allow_backup = FALSE;
X c = TRUE;
X while ( c == TRUE )
X {
X
X gr_mouse( WAIT, &x, &y, &b ); /* click down */
X gr_mouse( WAIT, &x, &y, &b ); /* click up */
X
X /* Is the release within bounds of the map? */
X
X if ( uil_bounds( x, y, dr_mapedge, dr_mapbase,
X dr_mapedge + dr_xsize, dr_mapbase + dr_ysize ) == TRUE )
X {
X xpos = map_pos[ map_curpos ][ 0 ] +
X (( x - (double) dr_mapedge )
X / ( dr_xsize / (double) ( map_pos[ map_curpos ][ 2 ] - (double) map_pos[ map_curpos ][ 0 ] ) ));
X ypos = map_pos[ map_curpos ][ 1 ] +
X (( y - (double) dr_mapbase )
X / ( dr_ysize / ( (double) map_pos[ map_curpos ][ 3 ] - (double) map_pos[ map_curpos ][ 1 ] ) ));
X sprintf( map_tbuf, "Position: Latitude %lf Longitude %lf",
X ypos, xpos );
X bw_message( map_tbuf );
X
X if ( ( curspj = ( struct spj_pt *) malloc( sizeof( struct spj_pt ) )) == NULL )
X {
X sprintf( bw_ebuf, MEMERR_SEQ );
X bw_error( bw_ebuf );
X return BW_ERROR;
X }
X lastspj->next = curspj;
X curspj->next = &new_end;
X curspj->latitude = ypos;
X curspj->longitude = xpos;
X curspj->radius = map_defalt;
X
X if ( n == 0 )
X {
X dr_line( ypos, xpos, ypos, xpos,
X WHITE, SOLID, map_curpos );
X curspj->code = 1001;
X }
X else if ( n == 1 )
X {
X dr_line( ypos, xpos, prevy, prevx,
X WHITE, SOLID, map_curpos );
X curspj->code = 5;
X }
X else
X {
X dr_line( ypos, xpos, prevy, prevx,
X WHITE, SOLID, map_curpos );
X curspj->code = 5;
X if ( n == 2 )
X {
X fprintf( outfile, "1001\t%lf\t%lf\t%lf\n",
X lasty, lastx, map_defalt );
X }
X else
X {
X fprintf( outfile, "5\t%lf\t%lf\t%lf\n",
X lasty, lastx, map_defalt );
X }
X }
X
X /* Get storage for the point */
X
X lastspj = curspj;
X lastx = prevx;
X lasty = prevy;
X prevx = xpos;
X prevy = ypos;
X allow_backup == TRUE;
X ++n;
X }
X
X /* Is the release within bounds of quit area? */
X
X else if ( uil_bounds( x, y, qu_x1, qu_y1,
X qu_x2, qu_y2 ) == TRUE )
X {
X c = FALSE;
X }
X
X /* Is the release within bounds of backup area? */
X
X else if ( ( uil_bounds( x, y, bu_x1, bu_y1,
X bu_x2, bu_y2 ) == TRUE ) && ( allow_backup == TRUE ) )
X {
X xpos = prevx;
X ypos = prevy;
X prevx = lastx;
X prevy = lasty;
X allow_backup = FALSE;
X --n;
X if ( n == -1 )
X {
X n = 0;
X }
X else if ( n == 0 )
X {
X curspj = lastspj;
X curspj->next = &new_end;
X dr_line( ypos, xpos, ypos, xpos,
X BLACK, SOLID, map_curpos );
X }
X else
X {
X curspj = lastspj;
X curspj->next = &new_end;
X dr_line( ypos, xpos, prevy, prevx,
X BLACK, SOLID, map_curpos );
X }
X }
X
X else
X {
X bw_message( " " );
X }
X
X }
X
X switch ( n )
X {
X case 0:
X return -1;
X break;
X case 1:
X fprintf( outfile, "1001\t%lf\t%lf\t%lf\n",
X ypos, xpos, map_defalt );
X break;
X case 2:
X fprintf( outfile, "1001\t%lf\t%lf\t%lf\n",
SHAR_EOF
true || echo 'restore of sfs/map/map.c failed'
fi
echo 'End of part 16'
echo 'File sfs/map/map.c is continued in part 17'
echo 17 > _shar_seq_.tmp
exit 0
exit 0 # Just in case...
--
Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD UUCP: uunet!sparky!kent
Phone: (402) 291-8300 FAX: (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.