home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume27 / sfs / part16 < prev    next >
Text File  |  1991-12-27  |  57KB  |  1,655 lines

  1. Newsgroups: comp.sources.misc
  2. From: tcamp@hercules.acpub.duke.edu (Ted Campbell)
  3. Subject:  v27i016:  sfs - Space Flight Simulator, Part16/21
  4. Message-ID: <1991Dec24.191827.20996@sparky.imd.sterling.com>
  5. X-Md4-Signature: 0e23d7e2a70a6342d8faaa2ce0a799ce
  6. Date: Tue, 24 Dec 1991 19:18:27 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: tcamp@hercules.acpub.duke.edu (Ted Campbell)
  10. Posting-number: Volume 27, Issue 16
  11. Archive-name: sfs/part16
  12. Environment: IBMPC && EGA/VGA, UNIX-PC && MGR, UNIX && X11,
  13.  
  14. #!/bin/sh
  15. # do not concatenate these parts, unpack them in order with /bin/sh
  16. # file sfs/doc/sfs.ro continued
  17. #
  18. if test ! -r _shar_seq_.tmp; then
  19.     echo 'Please unpack part 1 first!'
  20.     exit 1
  21. fi
  22. (read Scheck
  23.  if test "$Scheck" != 16; then
  24.     echo Please unpack part "$Scheck" next!
  25.     exit 1
  26.  else
  27.     exit 0
  28.  fi
  29. ) < _shar_seq_.tmp || exit 1
  30. if test ! -f _shar_wnt_.tmp; then
  31.     echo 'x - still skipping sfs/doc/sfs.ro'
  32. else
  33. echo 'x - continuing file sfs/doc/sfs.ro'
  34. sed 's/^X//' << 'SHAR_EOF' >> 'sfs/doc/sfs.ro' &&
  35. corresponding to the version you wish to
  36. build, and from there is all is well the script will carry
  37. through the building of the program. Both od the scripts 
  38. ("buildlib.bat" for MSDOS and "Buildlib.sh" for Unix) will
  39. copy all appropriate header files and object libraries to
  40. their appropriate storage directories ("./include" for header
  41. files and "./lib" for object libraries).
  42. .P
  43. The file "buildsfs.bat" will build SFS on a
  44. PC-compatible microcomputer on which the SFS code is properly
  45. loaded, and on which Microsoft QuickC has been installed. The
  46. script file "buildsfs.sh" will allow you to build the program
  47. on three Unix platforms: the X Windows system, the AT&T Unix
  48. PC using the TAM interface, and the AT&T Unix PC using the MGR
  49. user interface. This latter (Unix) script should be run from
  50. the "./sfs/sfs" directory as "sh buildsfs.sh". You will be
  51. prompted for a number corresponding to the version you wish to
  52. build, and from there is all is well the script will carry
  53. through the building of the program.
  54. .sp 2
  55. .ne 5
  56. .ce
  57. 4.3 \fBInclude Files\fR
  58. .P
  59. There are a number of include files for the input/output system
  60. and the user interface that need to be available in the standard
  61. include file directory. These are the following:
  62. .TZ
  63. .BA
  64. .ne 9
  65. \fIInclude Files\fR:
  66. X
  67. X    ./io/bw/bw.h    Bywater error-handling header
  68. X    ./io/gr/gr.h    Graphics header
  69. X    ./io/kb/kb.h    Keyboard header
  70. X    ./io/dr/dr.h    Directory header
  71. X    ./io/ui/ui.h    User interface header
  72. X    ./io/tw/tw.h    Text Windows header (not used in SFS)
  73. X
  74. .BZ
  75. .TA
  76. These files should be copied to the SFS hierarchy's include
  77. file directory in a user's system, i.e., "./include". The supplied
  78. "buildlib" scripts (see above) will automatically copy the include
  79. files to the appropriate directory.
  80. .P
  81. Programmers may note that the "bw.h" file does not stand for a
  82. subsystem, but simply contains a few overhead lines for a
  83. standard set of Bywater error-handling routines and data sets.
  84. These allow us to generate error messages in low-level graphics
  85. and input/output functions, which may be handled by applications
  86. programs in a variety of ways.
  87. .sp 2
  88. .ne 5
  89. .ls 1
  90. .ce
  91. 4.4 \fBImplementing the Input/Output System\fR
  92. .ce
  93. \fBand the User Interface\fR
  94. .ls 2
  95. .P
  96. Note to PC implementers: in order to implement the Space Flight
  97. Simulator, you must use the LARGE memory model for compiling
  98. all modules of the program. If you are interested in using the
  99. User Interface or other libraries for other purposes, you may
  100. be able to compile with other memory models.
  101. .P
  102. For each of the input/output subsystems, there will be a
  103. specification file giving information on how specific functions
  104. should perform. These are as follows:
  105. .TZ
  106. .BA
  107. .ne 9
  108. \fISpecification Files\fR:
  109. X
  110. X    ./io/gr/gr_spec.c    Graphics specification
  111. X    ./io/kb/kb_spec.c    Keyboard specification
  112. X    ./io/dr/dr_spec.c    Directory specification
  113. X
  114. .BZ
  115. .TA
  116. Existing implementations of the standards are in files labeled,
  117. e.g., "kb_ibmpc.c" for the PC compatible implementation of the
  118. keyboard standards, "gr_tam.c" for the implementation of the
  119. graphics standards under the AT&T Unix PC's TAM system, and
  120. "dr_unix.c" for a generic Unix implementation of the directory
  121. standards.
  122. .P
  123. Since the specification files include the bare shells of
  124. functions which must be implemented, programmers who want to
  125. develop new implementations of the standards are encouraged to
  126. copy the specification file to a new filename, and then to fill
  127. in the function shells as appropriate. In each case there will
  128. be a test program (for example, "gr_test.c") with a makefile to
  129. test the standards. (Note that if you develop a newly named
  130. implementation, the makefile[s] will have to be changed to
  131. reflect the new names.) A suggested order for implementation is:
  132. directory subsystem, keyboard subsystem, and graphics subsystem.
  133. The graphics subsystem test program requires an implementation
  134. of the keyboard subsystem. However, there are many cases (such
  135. as the implementation under X Windows) where the graphics and
  136. keyboard subsystems must be developed in tandem.
  137. .sp 2
  138. .ne 5
  139. 4.4.1 Implementing the Graphics (gr) System 
  140. .P
  141. The graphics subsystem also includes pointer device (mouse)
  142. routines, since these are usually intimately connected with
  143. computer graphics systems. The graphics subsystem will be,
  144. almost unquestionably, the most difficult to implement, and
  145. requires that you know how to draw pixels, lines, rectangles
  146. (filled in various ways), circles, and the like both to the
  147. computer screen and to memory buffers which can be copied
  148. (blitted) back and forth (from screen to memory and vice versa).
  149. The graphics system must also be able to address text lines to
  150. pixel-specific locations on the screen. Note that there are some
  151. default routines (file "gr_def.c") for lines, rectangles, and
  152. circles which can be built from a single pixel routines. These
  153. may, however, be extremely slow. Use the file "gr_test.c" with
  154. its associated makefile to test the graphics subsystem.
  155. .sp 2
  156. .ne 5
  157. 4.4.2 Implementing the Keyboard (kb) System
  158. .P
  159. The keyboard system may be rather more straightforward, but
  160. should allow two critical abilities: (a) it needs to implement a
  161. keyboard scan routine which will tell if a key has been pressed
  162. \fIwithout\fR waiting for a key to be pressed, and (b) it should
  163. return certain eight-bit codes (defined in "kb.h") for arrow
  164. keys, function keys, and the like. Use the "kb_test.c" file with
  165. its associated makefile to test the keyboard subsystem, or (if
  166. developed in tandem with the graphics subsystem), use
  167. "gr_test.c" to test both the keyboard and graphics subsystems
  168. together.
  169. .TZ
  170. .BA
  171. \fINote to Old-Timers\fR. Remember CP/M? CP/M had the keyboard
  172. scan routine built into its operating system. Unix offers nothing
  173. quite so straightforward. 
  174. .BZ
  175. .TA
  176. .sp 2
  177. .ne 5
  178. 4.4.3 Implementing the Directory (dr) System 
  179. .P
  180. The directory subsystem implements two simple subroutines (also
  181. present to the CP/M operating system, but lacking from more
  182. sophisticated machines): one gives the first file that matches
  183. an ambiguous specification (like "*.c"), the other returns the
  184. next file that matches that specification. Either routine may
  185. return BW_ERROR, indicating that there are no files (or no more
  186. files) matching the specification. Use the "dr_test.c" program
  187. and its associated makefile to test the directory subsystem. The
  188. existing implementation of the directory subsystem for Unix
  189. machines simply breaks out to a shell, calls "ls -1c
  190. [specifier]", and reads the files from a temporary file
  191. containing the filenames. Clumsy, but it works.
  192. .sp 2
  193. .ne 5
  194. 4.4.4 Building the User Interface
  195. .P
  196. Once the graphics, keyboard, and directory subsystems have been
  197. implemented, the user may proceed to build the Bywater User
  198. Interface, using "ui_test.c" and its associated makefile.
  199. Remember that specific filenames in the makefile may have to be
  200. changed if a programmer has developed new implementations. The
  201. "ui_test" program should illustrate all of the basic abilities
  202. of the Bywater User Interface. Once the implementation is
  203. completed, copy or move all the object files (except
  204. "ui_test.o[bj]) to the library subdirectory (./sfs/lib) of the
  205. SFS file hierarchy, where they will be used in building the
  206. Space Flight Simulator itself.
  207. .sp 2
  208. .ne 5
  209. .ce
  210. 4.5 \fBCompiling the Space Flight Simulator\fR
  211. .P
  212. Once the User Interface has been implemented, the hard work is
  213. over. The Space Flight Simulator code is built from the
  214. ./sfs/sfs subdirectory of the SFS file hierarchy. (It will also
  215. compile some files from the ./sfs/as directory, but normally one
  216. does not have to switch to that directory.) Makefile systems
  217. vary, and thus there are currently two forms of makefile for the
  218. SFS program building process. 
  219. .P
  220. For \fIPC compatible computers using Microsoft QuickC\fR, there
  221. are separate makefiles for sfs (the program loader), sfsm (the
  222. main menu and orbital modeling module), and sfsx (the simulation
  223. module). Each of these must be built separately from the
  224. "./sfs/sfs" subdirectory. \fIImportant notes\fR: When using
  225. Microsoft QuickC, it is important that the global SPAWN should
  226. be defined in the file "sfs.c". Moreover, once the files have
  227. been built, they will exist in the ./sfs/sfs subdirectory as
  228. "sfs.exe", "sfsm.exe", and "sfsx.exe". The file "sfs.exe" should
  229. be copied as is to the ./sfs/bin subdirectory. The file
  230. "sfsm.exe" should be copied to the ./sfs/bin subdirectory as
  231. "sfsm.app". Similarly, the file "sfsx.exe" should be copied to
  232. the ./sfs/bin subdirectory as "sfsx.app". 
  233. .TZ
  234. .BA
  235. \fIQuery: Why the name changes\fR? The files "sfsm" and "sfsx"
  236. must be loaded from the program loader ("sfs") and the system
  237. cpuld crash if they are not. For this reason, we have elected to
  238. change the name of their binary files to "*.app" so as to
  239. prevent them from being executed from the command line. It is
  240. for this reason that it is important that the global "SPAWN"
  241. should be defined in "sfs.h": this instructs the compiler to use
  242. the spawn() routine which can execute the "*.app" files.
  243. .BZ
  244. .TA
  245. .P
  246. For \fIUnix\fR based computers, there will be a single makefile
  247. for the SFS system. You
  248. will have to edit the makefile if you want to include the
  249. correct object filenames for your graphics, keyboard, and
  250. directory subsystem files. Three makefiles supplied are
  251. "makefile.x" for X Windows systems, "makefile.tam" for the
  252. AT&T Unix PC using the TAM interface, and "makefile.mgr" for
  253. the AT&T Unix PC using the MGR implementation. It is suggested
  254. that you copy or move one of these
  255. files to "makefile" (with no extension) to build the programs.
  256. For new Unix or other implementations, you may have to do more
  257. extensive editing to the makefiles. The Unix makefiles should
  258. handle moving the binaries to the ./sfs/bin subdirectory. The
  259. XX implementations have been tested only on DECstation 2100 and 3100
  260. workstations, and may not prove adequate on other X platforms.
  261. .PH "''''"
  262. .SK
  263. .sp 4
  264. .ce
  265. Chapter 5
  266. .sp
  267. .ce
  268. SFS DATA FILE FORMATS
  269. .PH "'SFS \*V'Chapter 5'Page #'"
  270. .PF "''Page  #''"
  271. .sp 3
  272. .TA
  273. .na
  274. .ne 5
  275. .P
  276. The Space Flight Simulator uses a number of data files which are
  277. accessible to users as ASCII text files. Users may wish to alter
  278. these files for use with SFS, or may find other applications for
  279. the data. The data formats are described in the following
  280. paragraphs. Users should note that in all SFS data files, lines
  281. beginning with a semicolon (";") are discarded, and thus can be
  282. used to enter comments into a data file. 
  283. .sp 2
  284. .ne 5
  285. 5.1 SFS Program Files (*.sfs)
  286. .P
  287. Space Flight Simulator program files have the extension "*.sfs"
  288. and give data describing particular orbits. These files can be
  289. developed using the orbital modeling module. Each SFS program
  290. file has a header of one line which contains the program title
  291. (can be more than one word). From this point, the program file
  292. is an interpreted language, in which any of the following
  293. keywords may appear:
  294. .TZ
  295. .BA
  296. .nf
  297. .ne 6
  298. The following apply to the program in general, and require
  299. a single integer (i) following the keyword. They should appear
  300. only once in a program file:
  301. X
  302. .ne 6
  303. tfactor     i  time factor in multiples of real time
  304. update      i  screen update interval in seconds
  305. trig        i  trig precision level (1 = fast, 2 = accurate)
  306. insertion   i  insertion point in seconds
  307. X
  308. .ne 6
  309. The following apply to a specific orbit, and require both
  310. an integral orbit number (o) and another argument which may
  311. be a string (s), or a double-precision number (d). They may
  312. appear once for each orbit in a program:
  313. X
  314. .ne 11
  315. name        o  s  name of spacecraft/orbit
  316. focus       o  s  name of focal data file for this orbit
  317. periapsis   o  d  periapsis in kilometers above the surface
  318. apoapsis    o  d  apoapsis in kilometers above the surface
  319. inclination o  d  inclination in degrees
  320. argper      o  d  argument of the perigee in degrees
  321. lonan       o  d  longitude of the ascending node in degrees
  322. orb         o  s  spherical data file for orb
  323. grid        o  s  spherical data file for lat-lon grid
  324. surface     o  s  spherical data file for surface features
  325. X
  326. .fi
  327. .BZ
  328. .TA
  329. Users might study examples of SFS program files before
  330. attempting to alter them. Only the items "grid" and "orb" cannot
  331. be specified from the orbital modeling module (and altering them
  332. can have grotesque results). For this reason, users are
  333. cautioned to use the modeling module, where more precautions are
  334. available.
  335. .sp 2
  336. .ne 5
  337. 5.2 Focal Data Files (*.fd)
  338. .P
  339. Focal data files have the extension "*.fd" and describe a
  340. particular orbital focus. They are rather more straightforward,
  341. and have the following structure (elements must appear in this
  342. order):
  343. .TZ
  344. .BA
  345. .nf
  346. .ne 4
  347. \fIElements in a Focal Data File\fR: 
  348. X
  349. .ne 6
  350. the name of the orbital focus (a single word)
  351. an adjective describing the focus (a single word)
  352. the diameter of the focus in kilometers
  353. the mass of the focus (earth = 1.0)
  354. the sidereal period of the focus in seconds
  355. X
  356. .ne 4
  357. \fIAn Example ("earth.fd")\fR:
  358. X
  359. .ne 6
  360. Earth
  361. terrestrial
  362. 6378
  363. 1.0
  364. 86164
  365. X
  366. .fi
  367. .BZ
  368. .TA
  369. .PF "''''"
  370. Again, users are advised to study existing focal data files
  371. before creating new ones. 
  372. .sp 2
  373. .ne 5
  374. 5.3 Spherical Projection Data Files (*.spd)
  375. .P
  376. Spherical projection data (SPD) files have the extension "*.spd"
  377. and describe points in three-dimensional space by latitude,
  378. longitude, and altitude. The spherical projection data format is
  379. derived distantly from the binary format employed by the Micro
  380. World Database (tm). The Space Flight Simulator uses spherical
  381. projection data files to describe surface features of orbital
  382. foci (for example, the earth's landmasses in "earth.spd"). Each
  383. line in a SPD file describes a single point, and consists of the
  384. following elements:
  385. .sp
  386. .nf
  387. X    code    latitude    longitude    altitude
  388. .fi
  389. The code is either a number above 1000 indicating the beginning
  390. of a new line, or a number below 1000 indicating the continuation
  391. of a line. 
  392. .TZ
  393. .BA
  394. \fIAn Example\fR: The following is a simple spherical data file
  395. ("meridian.spd") that draws a central meridian on the surface of
  396. a planet:
  397. X
  398. .ne 6
  399. .nf
  400. ;    meridian.spd
  401. ;
  402. ;    display single central meridian
  403. ;
  404. ;
  405. 1001    -90.0    0.0    6000.0
  406. 5    -80.0    0.0    6000.0
  407. 5    -70.0    0.0    6000.0
  408. 5    -60.0    0.0    6000.0
  409. 5    -50.0    0.0    6000.0
  410. 5    -40.0    0.0    6000.0
  411. 5    -30.0    0.0    6000.0
  412. 5    -20.0    0.0    6000.0
  413. 5    -10.0    0.0    6000.0
  414. 5    0.0    0.0    6000.0
  415. 5    10.0    0.0    6000.0
  416. 5    20.0    0.0    6000.0
  417. 5    30.0    0.0    6000.0
  418. 5    40.0    0.0    6000.0
  419. 5    50.0    0.0    6000.0
  420. 5    60.0    0.0    6000.0
  421. 5    70.0    0.0    6000.0
  422. 5    80.0    0.0    6000.0
  423. 5    90.0    0.0    6000.0
  424. X
  425. .ne 6
  426. .fi
  427. \fIRoom for Improvement\fR: At present all codes for beginning a
  428. new line are set to 1001 and all codes for continuing a line are
  429. set to 5. Future versions of the software might develop a more
  430. elaborate set of codes above 1000 which could indicate, e.g.,
  431. gas forms (for describing gas giants such as Jupiter), landmass
  432. delimiters, craters, mountains, rifts, and the like. Then the
  433. program might assign various colors to different features. Also,
  434. the SFS programs currently ignore the altitude, presuming that
  435. all points are on the surface (thus, the altitude of each point
  436. is set equal to the focal radius). Future versions might
  437. recognize altitudes, thus enabling the display of irregular
  438. orbital foci. Also, future versions of SPD files might allow a
  439. comment or title at the end of a point, so that titles could be
  440. shown on a focal surface.
  441. .BZ
  442. .TA
  443. .PH "''''"
  444. .SK
  445. .sp 4
  446. .ce
  447. Chapter 6
  448. .sp
  449. .ce
  450. The MAP Utility
  451. .sp 2
  452. .PH "'SFS \*V'Chapter 6'Page #'"
  453. .PF "''Page  #''"
  454. .P
  455. The MAP utility (source code and binaries are distributed
  456. separately from the PC version of the SFS software) allows users
  457. to enter spherical projection data points by pointing and
  458. clicking the pointer device within a latitude-longitude grid.
  459. The MAP utility thus requires the use of a pointer (mouse) device.
  460. .P
  461. The MAP utility is entered from the command line with an
  462. optional argument specifying the SPD datafile to be worked on.
  463. Thus the command line,
  464. .nf
  465. X    map earth.spd
  466. .fi
  467. would enter the MAP utility and begin work on the file "earth.spd".
  468. The filename "test.spd" is used as a default if no argument is
  469. specified on the command line. Once the MAP utility has been
  470. entered, the working file cannot be changed. 
  471. .P
  472. The MAP utility utilizes the same user interface as the Space
  473. Flight Simulator, and has a main menu that is accessible by pressing
  474. the ESCAPE key or by clicking the pointer device on the top
  475. (title) bar.  The following are the options available in the main
  476. MAP menu.
  477. .sp 2
  478. .ne 5
  479. 6.1 Change Position
  480. .P
  481. This option from the main menu allows the user to focus on a
  482. particular position of the latitude-longitude grid, or to look at
  483. the entire latitude-longitude grid.  By pressing the arrow keys,
  484. a dark outline of the selected area can be moved around.  By
  485. pressing the RETURN or ENTER key, the currently selected area is
  486. chosen, and the screen will be redrawn accordingly.
  487. .sp 2
  488. .ne 5
  489. 6.2 Enter Title or Comments
  490. .P
  491. The Space Flight Simulator's Spherical Projection Data (SPD)
  492. format allows for embedded title and comment lines.  This option
  493. from the main MAP utility menu allows the user to enter a line of
  494. text that will be embedded in the working data file as a title or
  495. comment. Since comment lines will not be entered at run time,
  496. they are used solely for making sense of an SPD data file when it
  497. is read by a text editor, and users are encouraged to document and
  498. comment their SPD files as elaborately as possible.
  499. .sp 2
  500. .ne 5
  501. 6.3 Begin Sequence
  502. .P
  503. This is where the serious work of the MAP utility is done. This
  504. option from the main MAP utility menu allows users to enter a
  505. sequence of points on the latitude-longitude grid, which are
  506. recorded in the working data file.  After selecting this item,
  507. the user points the pointer device at specific points on the
  508. grid, and presses and releases the left button to mark the point.
  509. At the next point entered, a line will be drawn from the previous
  510. point to the new point, and so on.  The sequence is ended by
  511. clicking in the "QUIT" label in the top (title) bar. 
  512. .P
  513. By pressing in the "BACKUP" label in the top (title) bar, the
  514. user can erase the most recently added point. The user should be
  515. careful, then, to check each point as it is entered, and BACKUP
  516. if it has not been positioned correctly. 
  517. .P
  518. Users of the MAP utility should remember that all of the points
  519. in a sequence will be joined by direct lines. For this reason,
  520. the user should only enter points in a particular sequence that
  521. will be tied together. It is recommended that complex figures be
  522. broken up into smaller units, even when unbroken sequences of
  523. lines are desired (begin a new sequence at the last point of the
  524. old one to carry through the appearance of unbrokenness).
  525. .sp 2
  526. .ne 5
  527. 6.4 Set Default Attitude
  528. .P
  529. Although the present version of the Space Flight Simulator takes
  530. all surface points to be at the (average) radius of an orbital
  531. focus, the SPD specification allows an altitude for the point to
  532. be entered.  This will eventually allow SFS to develop more
  533. elaborate three-dimensional simulations.  Typically, the altitude
  534. is simply set to the radius of the rbital focus.  This option
  535. from the main MAP utility menu allows the user to specify a
  536. default altitude that will be used for all subsequent points
  537. entered. 
  538. .sp 2
  539. .ne 5
  540. 6.5 Exit
  541. .P
  542. This item allows the user to exit from the MAP utility. The
  543. current working data file is saved with all changes that have
  544. been entered.
  545. .BZ
  546. .TA
  547. .PH "''''"
  548. .SK
  549. .sp 4
  550. .ce
  551. Chapter 7
  552. .sp
  553. .ce
  554. COMMUNICATIONS
  555. .sp 3
  556. .ls 1
  557. .nf
  558. Bywater Software
  559. P. O. Box 4023
  560. Duke Station
  561. Durham, NC  27706
  562. X
  563. email: tcamp@hercules.acpub.duke.edu
  564. .fi
  565. .TA
  566. .sp 2
  567. .ne 6
  568. About the author:
  569. .sp
  570. .P
  571. Ted A. Campbell is an Assistant Professor of Church History at
  572. the Divinity School, Duke University. Programming is an
  573. avocational interest. In addition to books and articles in the
  574. field of Church History, he is the author of the program
  575. "Stardate," published by the National Collegiate Software
  576. Clearinghouse. 
  577. .ls 2
  578. .TZ
  579. ..    \"===================================================
  580. ..    \"    end of sfs.ro
  581. ..    \"===================================================
  582. SHAR_EOF
  583. echo 'File sfs/doc/sfs.ro is complete' &&
  584. chmod 0644 sfs/doc/sfs.ro ||
  585. echo 'restore of sfs/doc/sfs.ro failed'
  586. Wc_c="`wc -c < 'sfs/doc/sfs.ro'`"
  587. test 73260 -eq "$Wc_c" ||
  588.     echo 'sfs/doc/sfs.ro: original size 73260, current size' "$Wc_c"
  589. rm -f _shar_wnt_.tmp
  590. fi
  591. # ============= sfs/doc/tmac.m ==============
  592. if test -f 'sfs/doc/tmac.m' -a X"$1" != X"-c"; then
  593.     echo 'x - skipping sfs/doc/tmac.m (File already exists)'
  594.     rm -f _shar_wnt_.tmp
  595. else
  596. > _shar_wnt_.tmp
  597. echo 'x - extracting sfs/doc/tmac.m (Binary)'
  598. sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
  599. begin 600 sfs/doc/tmac.m
  600. M+BX)7"(]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
  601. M/3T]/3T]/3T]/3T*+BX)7"(*+BX)7"()=&UA8RYM"BXN"5PB"BXN"5PB"71E
  602. M>'0@;6%C<F]S(&9O<B!T:&4@(G)O(B!T97AT(&9O<FUA='1E<@HN+@E<(@EB
  603. M>2!4960@02X@0V%M<&)E;&P*+BX)7"(*+BX)7"(]/3T]/3T]/3T]/3T]/3T]
  604. M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T*+BX)7"(*+BX)
  605. M7"(]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
  606. M/3T]/3T]/3T*+BX)7"()4F5S970@=&]P(&%N9"!B;W1T;VT@;6%R9VEN(')E
  607. M9VES=&5R<PHN33$@-@HN33(@,@HN33,@,@HN330@-@HN;&P@-C4*+G!O(#@*
  608. M+BX)7"(]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
  609. M/3T]/3T]/3T]/3T*+BX)7"()3G5M8F5R(')E9VES=&5R(")0(B`M+2!C=7)R
  610. M96YT('!A9V4@;G5M8F5R(`HN;G(@4"`P"BXN"5PB/3T]/3T]/3T]/3T]/3T]
  611. M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/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HN;G(@4&D@,`HN;G(@4',@,0HN:6X@*S4*+FQL("TU
  677. M"BYS<`HN+@HN+@E<(CT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
  678. M/3T]/3T]/3T]/3T]/3T]/3T]/0HN+@E<(@E-86-R;R`B0EHB("TM(&)L;V-K
  679. M('-E9VUE;G0@96YD:6YG"BYD92!"6@HN:6X@+34*+FQL("LU"BXN"BXN"5PB
  680. M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
  681. M/3T]/3T]"BXN"5PB"BXN"5PB"45N9"!O9B!T;6%C+FT*+BX)7"(*+BX)7"(]
  682. M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
  683. &/3T]/3T*
  684. `
  685. end
  686. SHAR_EOF
  687. echo 'uudecoding file sfs/doc/tmac.m' &&
  688. uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
  689. chmod 0644 sfs/doc/tmac.m ||
  690. echo 'restore of sfs/doc/tmac.m failed'
  691. Wc_c="`wc -c < 'sfs/doc/tmac.m'`"
  692. test 3741 -eq "$Wc_c" ||
  693.     echo 'sfs/doc/tmac.m: original size 3741, current size' "$Wc_c"
  694. rm -f _shar_wnt_.tmp
  695. fi
  696. # ============= sfs/map/README.map ==============
  697. if test ! -d 'sfs/map'; then
  698.     echo 'x - creating directory sfs/map'
  699.     mkdir 'sfs/map'
  700. fi
  701. if test -f 'sfs/map/README.map' -a X"$1" != X"-c"; then
  702.     echo 'x - skipping sfs/map/README.map (File already exists)'
  703.     rm -f _shar_wnt_.tmp
  704. else
  705. > _shar_wnt_.tmp
  706. echo 'x - extracting sfs/map/README.map (Text)'
  707. sed 's/^X//' << 'SHAR_EOF' > 'sfs/map/README.map' &&
  708. X
  709. X                     ------------------
  710. X
  711. X                      Bywater Software
  712. X                       Release Notice
  713. X
  714. X             Space Flight Simulator MAP Utility
  715. X                        version 1.01
  716. X                  (PC-Compatible Binaries)
  717. X
  718. X                     ------------------
  719. X
  720. Bywater Software is pleased to announce the public availability
  721. of its Space Flight Simulator in its first complete release, 
  722. version 1.01.  This software is copyright (c) 1991, Ted A. 
  723. Campbell, and is released under the terms of an agreement specified
  724. in the file "sfs.ro".  
  725. X
  726. Description:    The map utility (source code and binaries are distributed
  727. X        separately from the PC version of the SFS software) allows 
  728. X        users to enter spherical projection data points by pointing 
  729. X        and clicking the mouse device within a latitude-longitude 
  730. X        grid. 
  731. X
  732. Requirements:    This implementation of the Space Flight Simulator
  733. X        MAP utility requires an IBM PC or compatible 
  734. X        microcomputer, with Hercules, EGA, or VGA graphics.  
  735. X        The optional use of a pointer device (mouse) is 
  736. X        supported. A fast cpu and a math coprocessor will 
  737. X        also speed up and smooth out the overall display. 
  738. X        The program  requires one disk drive that has at 
  739. X        least 700k of space available. 
  740. X
  741. Documentation:    Complete documentation for the MAP utility is in 
  742. X        Chapter 6 of the file "sfs.ro", which is in a format 
  743. X        compatible with the "ro" text formatter (supplied with
  744. X        the PC-compatible binaries for SFS).
  745. X
  746. Source Code:    This release of the Space Flight Simulator will
  747. X        include source code for the complete Space Flight
  748. X        Simulator, the MAP utility, and their underlying User 
  749. X        Interface (ui). The source code can be compiled on the 
  750. X        PC-compatible microcomputers, the AT&T Unix PC, and on 
  751. X        Unix Platforms which have implemented the X Windows
  752. X        system, version 11 (tested on DecStation 2100 and
  753. X        3100).  
  754. X
  755. Communications:    Bywater Software
  756. X        P. O. Box 4023
  757. X        Duke Station
  758. X        Durham, NC  27707
  759. X        USA
  760. X
  761. X        email: tcamp@hercules.acpub.duke.edu
  762. X
  763. SHAR_EOF
  764. chmod 0644 sfs/map/README.map ||
  765. echo 'restore of sfs/map/README.map failed'
  766. Wc_c="`wc -c < 'sfs/map/README.map'`"
  767. test 2002 -eq "$Wc_c" ||
  768.     echo 'sfs/map/README.map: original size 2002, current size' "$Wc_c"
  769. rm -f _shar_wnt_.tmp
  770. fi
  771. # ============= sfs/map/makefile.tam ==============
  772. if test -f 'sfs/map/makefile.tam' -a X"$1" != X"-c"; then
  773.     echo 'x - skipping sfs/map/makefile.tam (File already exists)'
  774.     rm -f _shar_wnt_.tmp
  775. else
  776. > _shar_wnt_.tmp
  777. echo 'x - extracting sfs/map/makefile.tam (Binary)'
  778. sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
  779. begin 600 sfs/map/makefile.tam
  780. M(RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  781. M+2TM+2TM+2TM+2TM+2TM+2TM+0HC"B,);6%K969I;&4N=&%M"B,*(PE5;FEX
  782. M($UA:V5F:6QE(&9O<B!3<&%C92!&;&EG:'0@4VEM=6QA=&]R"B,)36%P(%5T
  783. M:6QI='D@+2T@050F5"!5;FEX(%!#+"!404T@:6YT97)F86-E"B,*(RTM+2TM
  784. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  785. M+2TM+2TM+2TM+2TM+0H*(RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  786. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+0HC('5I(&%N9"!A
  787. M<R!O8FIE8W0@9FEL97,*"DQ)0E,]"0DN+B\N+B]L:6(O=6E?8F]X97,N;R`N
  788. M+B\N+B]L:6(O=6E?9&EA;"YO(%P*"0DN+B\N+B]L:6(O=6E?:6YI="YO("XN
  789. M+RXN+VQI8B]U:5]L:7-T+F\@+BXO+BXO;&EB+W5I7W1E>'0N;R!<"@D)+BXO
  790. M+BXO;&EB+W5I7V=E=',N;R`N+B\N+B]L:6(O=6E?<&)M+F]<"@D)+BXO+BXO
  791. M;&EB+V=R7W1A;2YO("XN+RXN+VQI8B]G<E]D968N;UP*("`@("`@("`@("`@
  792. M("`@("XN+RXN+VQI8B]D<E]S>7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?9F]C=7,N;SH*
  809. M"0DD*$-#*2`D*$-&3$%'4RD@+BXO87,O87-?9F]C=7,N8R`M8PH*87-?=G!T
  810. M+F\Z"@D))"A#0RD@)"A#1DQ!1U,I("XN+V%S+V%S7W9P="YC("UC"@IA<U]S
  811. M<&HN;SH*"0DD*$-#*2`D*$-&3$%'4RD@+BXO87,O87-?<W!J+F,@+6,*"B,M
  812. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  813. M+2TM+2TM+2TM+2TM+2TM+2T*(R!%;F0@;V8@;6%K969I;&4N=&%M"B,M+2TM
  814. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  815. 2+2TM+2TM+2TM+2TM+2T*"@H:
  816. `
  817. end
  818. SHAR_EOF
  819. echo 'uudecoding file sfs/map/makefile.tam' &&
  820. uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
  821. chmod 0644 sfs/map/makefile.tam ||
  822. echo 'restore of sfs/map/makefile.tam failed'
  823. Wc_c="`wc -c < 'sfs/map/makefile.tam'`"
  824. test 1593 -eq "$Wc_c" ||
  825.     echo 'sfs/map/makefile.tam: original size 1593, current size' "$Wc_c"
  826. rm -f _shar_wnt_.tmp
  827. fi
  828. # ============= sfs/map/makefile.x ==============
  829. if test -f 'sfs/map/makefile.x' -a X"$1" != X"-c"; then
  830.     echo 'x - skipping sfs/map/makefile.x (File already exists)'
  831.     rm -f _shar_wnt_.tmp
  832. else
  833. > _shar_wnt_.tmp
  834. echo 'x - extracting sfs/map/makefile.x (Binary)'
  835. sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
  836. begin 600 sfs/map/makefile.x
  837. M(RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  838. M+2TM+2TM+2TM+2TM+2TM+2TM+0HC"B,);6%K969I;&4N>`H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'
  855. M4ST)"2U$1$5"54<@+4\@+4DN+B\N+B]I;F-L=61E"@HC+2TM+2TM+2TM+2TM
  856. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  857. M+2TM+2TM"B,@0G5I;&0@=&AE(&UA<"!U=&EL:71Y"@IM87`Z"0DD*$U!4"D@
  858. M)"A!4U0I"@D))"A#0RD@)"A#1DQ!1U,I("0H34%0*2`D*$%35"D@)"A,24)3
  859. M*5P*("`@("`@("`@("`@("`@("UL6#$Q("UL;2`M;R!M87`*"B,M+2TM+2TM
  860. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  861. M+2TM+2TM+2TM+2T*(R!3<&5C:69I8R!D97!E;F1E;F-I97,Z"@IM87`N;SH)
  862. M"@D))"A#0RD@)"A#1DQ!1U,I(&UA<"YC("UC"@IM87!?9'(N;SH)"@D))"A#
  863. M0RD@)"A#1DQ!1U,I(&UA<%]D<BYC("UC"@IA<U]O<F)I="YO.@H)"20H0T,I
  864. M("0H0T9,04=3*2`N+B]A<R]A<U]O<F)I="YC("UC"@IA<U]F;V-U<RYO.@H)
  865. M"20H0T,I("0H0T9,04=3*2`N+B]A<R]A<U]F;V-U<RYC("UC"@IA<U]V<'0N
  866. M;SH*"0DD*$-#*2`D*$-&3$%'4RD@+BXO87,O87-?=G!T+F,@+6,*"F%S7W-P
  867. M:BYO.@H)"20H0T,I("0H0T9,04=3*2`N+B]A<R]A<U]S<&HN8R`M8PH*(RTM
  868. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  869. M+2TM+2TM+2TM+2TM+2TM+0HC($5N9"!O9B!M86ME9FEL92YX"B,M+2TM+2TM
  870. M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
  871. /+2TM+2TM+2TM+2T*"@H:
  872. `
  873. end
  874. SHAR_EOF
  875. echo 'uudecoding file sfs/map/makefile.x' &&
  876. uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
  877. chmod 0644 sfs/map/makefile.x ||
  878. echo 'restore of sfs/map/makefile.x failed'
  879. Wc_c="`wc -c < 'sfs/map/makefile.x'`"
  880. test 1545 -eq "$Wc_c" ||
  881.     echo 'sfs/map/makefile.x: original size 1545, current size' "$Wc_c"
  882. rm -f _shar_wnt_.tmp
  883. fi
  884. # ============= sfs/map/map.c ==============
  885. if test -f 'sfs/map/map.c' -a X"$1" != X"-c"; then
  886.     echo 'x - skipping sfs/map/map.c (File already exists)'
  887.     rm -f _shar_wnt_.tmp
  888. else
  889. > _shar_wnt_.tmp
  890. echo 'x - extracting sfs/map/map.c (Text)'
  891. sed 's/^X//' << 'SHAR_EOF' > 'sfs/map/map.c' &&
  892. /***************************************************************
  893. X
  894. X    map.c           map utility for Space Flight Simulator
  895. X
  896. X            Copyright (c) 1991, Ted A. Campbell
  897. X
  898. X            Bywater Software
  899. X            P. O. Box 4023 
  900. X            Duke Station 
  901. X            Durham, NC  27706
  902. X
  903. X            email: tcamp@hercules.acpub.duke.edu
  904. X
  905. X    Copyright and Permissions Information:
  906. X
  907. X    All U.S. and international copyrights are claimed by the
  908. X    author. The author grants permission to use this code
  909. X    and software based on it under the following conditions:
  910. X    (a) in general, the code and software based upon it may be 
  911. X    used by individuals and by non-profit organizations; (b) it
  912. X    may also be utilized by governmental agencies in any country,
  913. X    with the exception of military agencies; (c) the code and/or
  914. X    software based upon it may not be sold for a profit without
  915. X    an explicit and specific permission from the author, except
  916. X    that a minimal fee may be charged for media on which it is
  917. X    copied, and for copying and handling; (d) the code must be 
  918. X    distributed in the form in which it has been released by the
  919. X    author; and (e) the code and software based upon it may not 
  920. X    be used for illegal activities. 
  921. X
  922. ***************************************************************/
  923. X
  924. #include "stdio.h"
  925. #include "time.h"
  926. #include "signal.h"
  927. #include "ctype.h"
  928. #include "math.h"
  929. X
  930. #include "bw.h"
  931. #include "gr.h"
  932. #include "kb.h"
  933. #include "dr.h"
  934. #include "ui.h"
  935. #include "as.h"
  936. X
  937. #include "map.h"
  938. X
  939. #ifdef __STDC__
  940. #include "malloc.h"
  941. #else
  942. extern char * malloc();
  943. #endif
  944. X
  945. #ifndef   __STDC__
  946. #define   time_t    long
  947. #define   size_t   int
  948. #endif
  949. X
  950. extern  int map_sigint();
  951. X
  952. /***    Colors */
  953. X
  954. int   cl_mback;      /* Main background color   */
  955. int   cl_mfore;      /* Main foreground color   */
  956. int   cl_marker;      /* Color for prompt markers   */
  957. int   cl_grid;      /* Color for planetary grid   */
  958. int   cl_surface;      /* Color for planetary surface   */
  959. X
  960. struct spj_pt spd_start, spd_end;       /* surface data pointers */
  961. struct spj_pt new_start, new_end;       /* new data pointers */
  962. struct spj_pt *lastspj;               /* pointer to last new spj point */
  963. X
  964. struct uiwindow *main_window;           /* structure for main window    */
  965. struct uiwindow *map_window;            /* structure for map window    */
  966. char bw_ebuf[ BW_EBUFSIZE ];
  967. char map_tbuf[ BW_EBUFSIZE ];
  968. char map_datafile[ 128 ];
  969. int dr_xsize;            /* Size of ground track map, x */
  970. int dr_ysize;            /* Size of ground track map, y */
  971. int dr_mapbase;          /* Bottom of dr map */
  972. int dr_mapedge;          /* Left edge of groundtrack map */
  973. int mesg_y;
  974. int map_curpos = 0;     /* current position (default: full) */
  975. double map_defalt = 0.0; /* default altitude */
  976. FILE *outfile;         /* file for output */
  977. X
  978. int map_pos[ 10 ][ 4 ] = {
  979. X    { -180,  -90,  180,   90 },         /* 0 - full          */
  980. X    { -180,  -90,    0,    0 },         /* 1 - lower left    */
  981. X    {  -90,  -90,   90,    0 },         /* 2 - lower middle  */
  982. X    {    0,  -90,  180,    0 },         /* 3 - lower right   */
  983. X    { -180,  -45,    0,   45 },         /* 4 - center left   */
  984. X    {  -90,  -45,   90,   45 },         /* 5 - center middle */
  985. X    {    0,  -45,  180,   45 },         /* 6 - center right  */
  986. X    { -180,    0,    0,   90 },         /* 7 - upper left    */
  987. X    {  -90,    0,   90,   90 },         /* 8 - upper middle  */
  988. X    {    0,    0,  180,   90 } };       /* 9 - upper right   */
  989. X
  990. static struct uiwindow *dial_window;
  991. static int dial_x1 = 0, dial_x2, dial_y1, dial_y2;
  992. static int midx, midy, length, height;
  993. static char buffer[ BW_EBUFSIZE ];
  994. X
  995. char *mm_titles[ MM_TITLES ] = {
  996. X     MM_POSITION,
  997. X     MM_ENTITLE,
  998. X         MM_SEQUENCE,
  999. X         MM_ALTITUDE,
  1000. X     MM_EXIT };
  1001. X
  1002. extern int map_sigint();
  1003. X
  1004. /****************************************************************
  1005. X
  1006. X    main()
  1007. X
  1008. ****************************************************************/
  1009. X
  1010. main( argc, argv )
  1011. X   int argc;
  1012. X   char **argv;
  1013. X   {
  1014. X   int offs_y, offs_x, m_x1, m_y1, m_x2, m_y2;
  1015. X
  1016. X   /***    set a signal handler so that a SIGINT           */
  1017. X   /***    (control-C under DOS, DEL under Unix) will      */
  1018. X   /***    exit gracefully                                 */
  1019. X
  1020. X   signal( SIGINT, map_sigint );
  1021. X
  1022. X   /***    process argument 1 for data file */
  1023. X
  1024. X   if ( argc > 1 )
  1025. X      {
  1026. X      strcpy( map_datafile, argv[ 1 ] );
  1027. X      }
  1028. X   else
  1029. X      {
  1030. X      strcpy( map_datafile, MAP_DEFAULTDATA );
  1031. X      }
  1032. X
  1033. X   /* Initialize the user interface */
  1034. X
  1035. X   ui_init();
  1036. X
  1037. X   if ( ui_ready != TRUE )
  1038. X      {
  1039. X      gr_deinit();
  1040. X      fprintf( stderr, "Graphics system not initialized.\n" );
  1041. X      exit( -1 );
  1042. X      }
  1043. X
  1044. X   if ( gr_ismouse != TRUE )
  1045. X      {
  1046. X      gr_deinit();
  1047. X      fprintf( stderr,
  1048. X     "The map utility requires the use of a pointer device (\"mouse\").\n" );
  1049. X      exit( -1 );
  1050. X      }
  1051. X
  1052. X   map_colors();         /* Set colors       */
  1053. X
  1054. X   /* reset icon colors */
  1055. X
  1056. X   if ( gr_colors > 2 )
  1057. X      {
  1058. X      ui_seticons( cl_mback, cl_marker );
  1059. X      }
  1060. X
  1061. X   /* Initialize variable-precision trig */
  1062. X
  1063. X   vpt_init();
  1064. X
  1065. X   map_font( 0 );
  1066. X
  1067. X   /* Clear the screen */
  1068. X
  1069. X   gr_cls( GR_PRIMARY );
  1070. X
  1071. X   /* Draw main screen */
  1072. X
  1073. X   sprintf( map_tbuf, MAP_TITLE, MAP_VERSION );
  1074. X   main_window = ui_window( 0, 0, ui_grwind->xmax, ui_grwind->ymax,
  1075. X      TRUE, cl_marker, cl_mfore,
  1076. X      map_tbuf, TRUE, cl_mback,
  1077. X      FALSE, BLACK, BLACK, SOLID );
  1078. X
  1079. X   /* delimit message area */
  1080. X
  1081. X   mesg_y = 5 + ui_grwind->fysize + 3;
  1082. X   gr_line( GR_PRIMARY, main_window->u_x1, mesg_y,
  1083. X      main_window->u_x2, mesg_y, WHITE, SOLID );
  1084. X
  1085. X   /* read spd data */
  1086. X
  1087. X   spj_readspd( map_datafile, &spd_start, &spd_end );
  1088. X
  1089. X   /* initialize new data pointers */
  1090. X
  1091. X   new_start.next = &new_end;
  1092. X   lastspj = &new_start;
  1093. X
  1094. X   /* open datafile for append */
  1095. X
  1096. X   if ( ( outfile = fopen( map_datafile, "a" ) ) == NULL )
  1097. X      {
  1098. X      sprintf( bw_ebuf, "Cannot open file %s for append.",
  1099. X         map_datafile );
  1100. X      }
  1101. X
  1102. X   /* set up display */
  1103. X
  1104. X   offs_x = gr_strlen( "  000: " );
  1105. X   offs_y = ui_grwind->fysize + 4;
  1106. X   m_x1 = main_window->u_x1 + offs_x;
  1107. X   m_y1 = mesg_y + offs_y;
  1108. X   m_x2 = main_window->u_x2 - offs_x;
  1109. X   m_y2 = main_window->u_y2 - offs_y;
  1110. X   map_window = ui_window( m_x1, m_y1, m_x2, m_y2,
  1111. X      FALSE, cl_marker, cl_mfore,
  1112. X      map_tbuf, FALSE, cl_mback,
  1113. X      FALSE, BLACK, BLACK, SOLID );
  1114. X
  1115. /*    dr_draw( map_window, TRUE, &spd_start, &spd_end, 0 ); */
  1116. X   map_draw( map_curpos );
  1117. X
  1118. X   bw_message( MAP_HELP );
  1119. X   while( TRUE )
  1120. X      {
  1121. X      map_poll();
  1122. X      }
  1123. X   }
  1124. X
  1125. /****************************************************************
  1126. X
  1127. X    map_poll()
  1128. X
  1129. ****************************************************************/
  1130. X
  1131. map_poll()
  1132. X   {
  1133. X   register int c;
  1134. X   static int x, y, b;
  1135. X
  1136. X   /* Check for keyboard input */
  1137. X
  1138. X   if ( kb_rxstat() == TRUE )
  1139. X      {
  1140. X      c = kb_rx();
  1141. X      if ( c == 0x1b )
  1142. X         {
  1143. X         map_esc();
  1144. X         }
  1145. X      }
  1146. X
  1147. X   /* Check for mouse input */
  1148. X
  1149. X   if ( gr_ismouse == TRUE )
  1150. X      {
  1151. X      if ( gr_mouse( SAMPLE, &x, &y, &b ) == TRUE )
  1152. X     {
  1153. X
  1154. X     gr_mouse( WAIT, &x, &y, &b );           /* click down */
  1155. X     gr_mouse( WAIT, &x, &y, &b );           /* click up */
  1156. X
  1157. #ifdef  OLD_DEBUG
  1158. X     sprintf( sfsx_tbuf, "Mouse hit: %d %d", x, y );
  1159. X     bw_debug( sfsx_tbuf );
  1160. #endif
  1161. X
  1162. X     /* Is the release within bounds ? */
  1163. X
  1164. X     if ( uil_bounds( x, y, main_window->tbar_x1, main_window->tbar_y1,
  1165. X        main_window->tbar_x2, main_window->tbar_y2) == TRUE )
  1166. X        {
  1167. X        map_esc();
  1168. X        }
  1169. X
  1170. X     }
  1171. X      }
  1172. X   }
  1173. X
  1174. /****************************************************************
  1175. X
  1176. X    map_esc()
  1177. X
  1178. ****************************************************************/
  1179. X
  1180. map_esc()
  1181. X   {
  1182. X   static struct menu_box esc_box;
  1183. X   static int x_x1 = 0, x_y1 = 0, x_x2 = 0, x_y2 = 0, item;
  1184. X   static int x_ebuf;
  1185. X   int xcenter, ycenter;
  1186. X   
  1187. X   ui_push();                   /* save current ui screen */
  1188. X   ui_setscreen( GR_PRIMARY );  /* set primary screen */
  1189. X   if ( x_x1 == 0 )
  1190. X      {
  1191. X      xcenter = main_window->u_x1 +
  1192. X         (( main_window->u_x2 - main_window->u_x1 ) / 2 );
  1193. X      ycenter = main_window->u_y1 +
  1194. X         (( main_window->u_y2 - main_window->u_y1 ) / 2 );
  1195. X      x_x1 = (int) xcenter - ( ui_grwind->xmax / 4 );
  1196. X      x_y1 = (int) ycenter - ( ui_grwind->fysize * 7 );
  1197. X      x_x2 = (int) xcenter + ( ui_grwind->xmax / 4 );
  1198. X      x_y2 = (int) ycenter + ( ui_grwind->fysize * 5 );
  1199. X      }
  1200. X
  1201. X   gr_imsave( GR_PRIMARY, TRUE, x_x1, x_y1, x_x2, x_y2, &x_ebuf );
  1202. X
  1203. X   bw_message( MAP_MM );
  1204. X
  1205. X   esc_box.is_drawn = FALSE;
  1206. X   item = ui_list( MENU_SLIDERS, x_x1, x_y1, x_x2, x_y2,
  1207. X      MM_TITLE, MM_TITLES,
  1208. X      mm_titles, cl_mfore, cl_mback, cl_marker,
  1209. X      &esc_box );
  1210. X
  1211. X   gr_imsave( GR_PRIMARY, FALSE, x_x1, x_y1, x_x2, x_y2, &x_ebuf );
  1212. X   gr_imfree( x_ebuf );
  1213. X   bw_message( MAP_HELP );
  1214. X
  1215. X   switch( item )
  1216. X      {
  1217. X      case 0:
  1218. X         map_select();
  1219. X         bw_message( MAP_HELP );
  1220. X     break;
  1221. X      case 1:
  1222. X     map_entitle();
  1223. X     bw_message( MAP_HELP );
  1224. X     break;
  1225. X      case 2:
  1226. X         map_sequence();
  1227. X         bw_message( MAP_HELP );
  1228. X         break;
  1229. X      case 3:
  1230. X         map_altitude();
  1231. X         bw_message( MAP_HELP );
  1232. X         break;
  1233. X      case 4:
  1234. X     map_exit();
  1235. X     exit(0);
  1236. X      default:
  1237. X         break;
  1238. X      }
  1239. X
  1240. X   ui_pop();                            /* restore ui screen */
  1241. X
  1242. X   }
  1243. X
  1244. /****************************************************************
  1245. X
  1246. X    map_select()
  1247. X
  1248. ****************************************************************/
  1249. X
  1250. map_select()
  1251. X   {
  1252. X   register int selpos, c;
  1253. X
  1254. X   selpos = map_curpos;
  1255. X   if ( selpos != 0 )
  1256. X      {
  1257. X      map_draw( 0 );
  1258. X      }
  1259. X   c = TRUE;
  1260. X   bw_message( MAP_SELECT );
  1261. X   while( c )
  1262. X      {
  1263. X      map_bound( TRUE, selpos );
  1264. X      c = kb_rx();
  1265. X      map_bound( FALSE, selpos );
  1266. X      switch( c )
  1267. X         {
  1268. X         case KB_UP:
  1269. X            if ( selpos < 7 )
  1270. X               {
  1271. X               selpos += 3;
  1272. X               }
  1273. X            break;
  1274. X         case KB_DOWN:
  1275. X            if ( selpos > 3 )
  1276. X               {
  1277. X               selpos -= 3;
  1278. X               }
  1279. X            break;
  1280. X         case KB_RIGHT:
  1281. X            ++selpos;
  1282. X            selpos %= 10;
  1283. X            break;
  1284. X         case KB_LEFT:
  1285. X            --selpos;
  1286. X            selpos += 10;
  1287. X            selpos %= 10;
  1288. X            break;
  1289. X         case CR:
  1290. X         case LF:
  1291. X            c = FALSE;
  1292. X            map_curpos = selpos;
  1293. X            break;
  1294. X         }
  1295. X      }
  1296. X   map_draw( map_curpos );
  1297. X   }
  1298. X
  1299. /****************************************************************
  1300. X
  1301. X    map_draw()
  1302. X
  1303. ****************************************************************/
  1304. X
  1305. map_draw( pos )
  1306. X   int pos;
  1307. X   {
  1308. X   register int i, c;
  1309. X   int x;
  1310. X
  1311. X   /* Blank the whole area */
  1312. X
  1313. X   ui_fbox( main_window->u_x1, mesg_y + 1, main_window->u_x2,
  1314. X      main_window->u_y2, BLACK, SOLID );
  1315. X
  1316. X   /* draw original lines */
  1317. X
  1318. X   dr_draw( map_window, TRUE, &spd_start, &spd_end, pos );
  1319. X
  1320. X   /* plot new (added) lines */
  1321. X
  1322. X   dr_plot( &new_start, &new_end, cl_surface, SOLID, pos );
  1323. X
  1324. X   /* write bounds */
  1325. X
  1326. X   if ( pos == 0 )
  1327. X      {
  1328. X      i = 30;
  1329. X      }
  1330. X   else
  1331. X      {
  1332. X      i = 15;
  1333. X      }
  1334. X
  1335. X   /* write latitudes */
  1336. X
  1337. X   x = dr_mapbase - ( ui_grwind->fysize / 2 );
  1338. X   sprintf( map_tbuf, " %d ", map_pos[ pos ][ 1 ] );
  1339. X   gr_text( GR_PRIMARY, dr_mapedge - ( gr_strlen( map_tbuf ) + 1 ),
  1340. X      dr_mapbase, map_tbuf, BLACK, WHITE );
  1341. X   gr_text( GR_PRIMARY, dr_mapedge + dr_xsize + 1,
  1342. X      dr_mapbase, map_tbuf, BLACK, WHITE );
  1343. X   x += dr_ysize
  1344. X      / ( ( map_pos[ pos ][ 3 ] - map_pos[ pos ][ 1 ] ) / i );
  1345. X   for ( c = map_pos[ pos ][ 1 ] + i; c < map_pos[ pos ][ 3 ]; c += i )
  1346. X      {
  1347. X      sprintf( map_tbuf, " %d ", c );
  1348. X      gr_text( GR_PRIMARY, dr_mapedge - ( gr_strlen( map_tbuf ) + 2 ),
  1349. X     x, map_tbuf, WHITE, BLACK );
  1350. X      gr_text( GR_PRIMARY, dr_mapedge + dr_xsize + 1,
  1351. X     x, map_tbuf, WHITE, BLACK );
  1352. X      x += dr_ysize
  1353. X     / ( ( map_pos[ pos ][ 3 ] - map_pos[ pos ][ 1 ] ) / i );
  1354. X      }
  1355. X   sprintf( map_tbuf, " %d ", map_pos[ pos ][ 3 ] );
  1356. X   gr_text( GR_PRIMARY, dr_mapedge - gr_strlen( map_tbuf ) - 1,
  1357. X      dr_mapbase + dr_ysize - ui_grwind->fysize, map_tbuf, BLACK, WHITE );
  1358. X   gr_text( GR_PRIMARY, dr_mapedge + dr_xsize + 1,
  1359. X      dr_mapbase + dr_ysize - ui_grwind->fysize, map_tbuf, BLACK, WHITE );
  1360. X
  1361. X   /* write longitudes */
  1362. X
  1363. X   x = dr_mapedge;
  1364. X
  1365. X   sprintf( map_tbuf, " %d ", map_pos[ pos ][ 0 ] );
  1366. X   gr_text( GR_PRIMARY, dr_mapedge,
  1367. X      dr_mapbase - ( ui_grwind->fysize + 1 ), map_tbuf, BLACK, WHITE );
  1368. X   gr_text( GR_PRIMARY, dr_mapedge,
  1369. X      dr_mapbase + dr_ysize + 1, map_tbuf, BLACK, WHITE );
  1370. X   x += dr_xsize
  1371. X      / ( ( map_pos[ pos ][ 2 ] - map_pos[ pos ][ 0 ] ) / i );
  1372. X
  1373. X   for ( c = map_pos[ pos ][ 0 ] + i; c < map_pos[ pos ][ 2 ]; c += i )
  1374. X      {
  1375. X      sprintf( map_tbuf, " %d ", c );
  1376. X      gr_text( GR_PRIMARY, x - ( gr_strlen( map_tbuf ) / 2 ),
  1377. X     dr_mapbase - ( ui_grwind->fysize + 1 ), map_tbuf, WHITE, BLACK );
  1378. X      gr_text( GR_PRIMARY, x - ( gr_strlen( map_tbuf ) / 2 ),
  1379. X     dr_mapbase + dr_ysize + 1, map_tbuf, WHITE, BLACK );
  1380. X      x += dr_xsize
  1381. X     / ( ( map_pos[ pos ][ 2 ] - map_pos[ pos ][ 0 ] ) / i );
  1382. X      }
  1383. X   sprintf( map_tbuf, " %d ", map_pos[ pos ][ 2 ] );
  1384. X   gr_text( GR_PRIMARY, dr_mapedge + dr_xsize - gr_strlen( map_tbuf ),
  1385. X      dr_mapbase - ( ui_grwind->fysize + 1 ), map_tbuf, BLACK, WHITE );
  1386. X   gr_text( GR_PRIMARY, dr_mapedge + dr_xsize - gr_strlen( map_tbuf ),
  1387. X      dr_mapbase + dr_ysize + 1, map_tbuf, BLACK, WHITE );
  1388. X   }
  1389. X
  1390. /****************************************************************
  1391. X
  1392. X    map_bound()
  1393. X
  1394. ****************************************************************/
  1395. X
  1396. map_bound( highlight, pos )
  1397. X   int highlight, pos;
  1398. X   {
  1399. X   int style;
  1400. X   double x1, y1, x2, y2;
  1401. X
  1402. X   if ( highlight == TRUE )
  1403. X      {
  1404. X      style = SOLID;
  1405. X      }
  1406. X   else
  1407. X      {
  1408. X      style = GRID;
  1409. X      }
  1410. X
  1411. #ifdef OLD_DEBUG
  1412. X   sprintf( map_tbuf, "highlight %d, position %d, style %d",
  1413. X      highlight, pos, style );
  1414. X   bw_debug( map_tbuf );
  1415. #endif
  1416. X
  1417. X   x1 = map_pos[ pos ][ 0 ];
  1418. X   y1 = map_pos[ pos ][ 1 ];
  1419. X   x2 = map_pos[ pos ][ 0 ];
  1420. X   y2 = map_pos[ pos ][ 3 ];
  1421. X   dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
  1422. X   dr_line( y1, x1, y2, x2, WHITE, style, 0 );
  1423. X
  1424. X   x1 = map_pos[ pos ][ 2 ];
  1425. X   y1 = map_pos[ pos ][ 1 ];
  1426. X   x2 = map_pos[ pos ][ 2 ];
  1427. X   y2 = map_pos[ pos ][ 3 ];
  1428. X   dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
  1429. X   dr_line( y1, x1, y2, x2, WHITE, style, 0 );
  1430. X
  1431. X   x1 = map_pos[ pos ][ 0 ];
  1432. X   y1 = map_pos[ pos ][ 1 ];
  1433. X   x2 = map_pos[ pos ][ 2 ];
  1434. X   y2 = map_pos[ pos ][ 1 ];
  1435. X   dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
  1436. X   dr_line( y1, x1, y2, x2, WHITE, style, 0 );
  1437. X
  1438. X   x1 = map_pos[ pos ][ 0 ];
  1439. X   y1 = map_pos[ pos ][ 3 ];
  1440. X   x2 = map_pos[ pos ][ 2 ];
  1441. X   y2 = map_pos[ pos ][ 3 ];
  1442. X   dr_line( y1, x1, y2, x2, BLACK, SOLID, 0 );
  1443. X   dr_line( y1, x1, y2, x2, WHITE, style, 0 );
  1444. X
  1445. X   gr_line( GR_PRIMARY, dr_mapedge, dr_mapbase, dr_mapedge,
  1446. X      dr_mapbase + dr_ysize, cl_grid, SOLID );
  1447. X
  1448. X   gr_line( GR_PRIMARY, dr_mapedge + dr_xsize, dr_mapbase,
  1449. X      dr_mapedge + dr_xsize, dr_mapbase + dr_ysize,
  1450. X      cl_grid, SOLID );
  1451. X
  1452. X   gr_line( GR_PRIMARY, dr_mapedge, dr_mapbase,
  1453. X      dr_mapedge + dr_xsize,
  1454. X      dr_mapbase, cl_grid, SOLID );
  1455. X
  1456. X   gr_line( GR_PRIMARY, dr_mapedge, dr_mapbase + dr_ysize,
  1457. X      dr_mapedge + dr_xsize, dr_mapbase + dr_ysize,
  1458. X      cl_grid, SOLID );
  1459. X
  1460. X   }
  1461. X
  1462. /****************************************************************
  1463. X
  1464. X    map_sequence()
  1465. X
  1466. ****************************************************************/
  1467. X
  1468. map_sequence()
  1469. X   {
  1470. X   int qu_x1, qu_y1, qu_x2, qu_y2;
  1471. X   int bu_x1, bu_y1, bu_x2, bu_y2;
  1472. X   register int c;
  1473. X   static int x, y, b;
  1474. X   double xpos, ypos;
  1475. X   double prevx, prevy, lastx, lasty;
  1476. X   struct spj_pt *curspj;
  1477. X   int n, allow_backup;
  1478. X
  1479. X   bw_message( MAP_SEQM );
  1480. X
  1481. X   if ( gr_ismouse != TRUE )
  1482. X      {
  1483. X      bw_error( ERR_MOUSE );
  1484. X      return BW_ERROR;
  1485. X      }
  1486. X
  1487. X   /* calculate sizes for quit and backup spaces */
  1488. X
  1489. X   qu_x1 = ( main_window->u_x2 - main_window->u_x1 ) / 2;
  1490. X   qu_x2 = qu_x1 + ( ( main_window->u_x2 - main_window->u_x1 ) / 4 );
  1491. X   qu_y1 = main_window->tbar_y1;
  1492. X   qu_y2 = main_window->tbar_y2;
  1493. X   bu_x1 = qu_x2 + 1;
  1494. X   bu_x2 = main_window->u_x2;
  1495. X   bu_y1 = main_window->tbar_y1;
  1496. X   bu_y2 = main_window->tbar_y2;
  1497. X
  1498. X   /* draw delimiters for quit and backup spaces */
  1499. X
  1500. X   gr_line( GR_PRIMARY, qu_x1, qu_y1, qu_x1, qu_y2, BLACK, SOLID );
  1501. X   gr_line( GR_PRIMARY, bu_x1, bu_y1, bu_x1, bu_y2, BLACK, SOLID );
  1502. X
  1503. X   /* denote quit and backup spaces */
  1504. X
  1505. X   gr_text( GR_PRIMARY, qu_x1 + 3, qu_y1, SEQ_QUIT, BLACK, WHITE );
  1506. X   gr_text( GR_PRIMARY, bu_x1 + 3, bu_y1, SEQ_BACKUP, BLACK, WHITE );
  1507. X
  1508. X   lastx = lasty = prevx = prevy = xpos = ypos = 0.0;
  1509. X   n = 0;
  1510. X   allow_backup = FALSE;
  1511. X   c = TRUE;
  1512. X   while ( c == TRUE )
  1513. X      {
  1514. X
  1515. X      gr_mouse( WAIT, &x, &y, &b );           /* click down */
  1516. X      gr_mouse( WAIT, &x, &y, &b );           /* click up */
  1517. X
  1518. X      /* Is the release within bounds of the map? */
  1519. X
  1520. X      if ( uil_bounds( x, y, dr_mapedge, dr_mapbase,
  1521. X         dr_mapedge + dr_xsize, dr_mapbase + dr_ysize ) == TRUE )
  1522. X         {
  1523. X         xpos = map_pos[ map_curpos ][ 0 ] +
  1524. X        (( x - (double) dr_mapedge )
  1525. X        / ( dr_xsize / (double) ( map_pos[ map_curpos ][ 2 ] - (double) map_pos[ map_curpos ][ 0 ] ) ));
  1526. X         ypos = map_pos[ map_curpos ][ 1 ] +
  1527. X        (( y - (double) dr_mapbase )
  1528. X        / ( dr_ysize / ( (double) map_pos[ map_curpos ][ 3 ] - (double) map_pos[ map_curpos ][ 1 ] ) ));
  1529. X         sprintf( map_tbuf, "Position: Latitude %lf  Longitude %lf",
  1530. X            ypos, xpos );
  1531. X         bw_message( map_tbuf );
  1532. X
  1533. X         if ( ( curspj = ( struct spj_pt  *) malloc( sizeof( struct spj_pt ) )) == NULL )
  1534. X            {
  1535. X            sprintf( bw_ebuf, MEMERR_SEQ );
  1536. X            bw_error( bw_ebuf );
  1537. X            return BW_ERROR;
  1538. X            }
  1539. X         lastspj->next = curspj;
  1540. X         curspj->next = &new_end;
  1541. X         curspj->latitude = ypos;
  1542. X         curspj->longitude = xpos;
  1543. X         curspj->radius = map_defalt;
  1544. X
  1545. X         if ( n == 0 )
  1546. X            {
  1547. X            dr_line( ypos, xpos, ypos, xpos,
  1548. X               WHITE, SOLID, map_curpos );
  1549. X            curspj->code = 1001;
  1550. X            }
  1551. X         else if ( n == 1 )
  1552. X            {
  1553. X            dr_line( ypos, xpos, prevy, prevx,
  1554. X               WHITE, SOLID, map_curpos );
  1555. X            curspj->code = 5;
  1556. X            }
  1557. X         else
  1558. X            {
  1559. X            dr_line( ypos, xpos, prevy, prevx,
  1560. X               WHITE, SOLID, map_curpos );
  1561. X            curspj->code = 5;
  1562. X            if ( n == 2 )
  1563. X               {
  1564. X               fprintf( outfile, "1001\t%lf\t%lf\t%lf\n",
  1565. X                  lasty, lastx, map_defalt );
  1566. X               }
  1567. X            else
  1568. X               {
  1569. X               fprintf( outfile, "5\t%lf\t%lf\t%lf\n",
  1570. X                  lasty, lastx, map_defalt );
  1571. X               }
  1572. X            }
  1573. X
  1574. X         /* Get storage for the point */
  1575. X
  1576. X         lastspj = curspj;
  1577. X         lastx = prevx;
  1578. X         lasty = prevy;
  1579. X         prevx = xpos;
  1580. X     prevy = ypos;
  1581. X     allow_backup == TRUE;
  1582. X         ++n;
  1583. X         }
  1584. X
  1585. X      /* Is the release within bounds of quit area? */
  1586. X
  1587. X      else if ( uil_bounds( x, y, qu_x1, qu_y1,
  1588. X     qu_x2, qu_y2 ) == TRUE )
  1589. X         {
  1590. X         c = FALSE;
  1591. X         }
  1592. X
  1593. X      /* Is the release within bounds of backup area? */
  1594. X
  1595. X      else if ( ( uil_bounds( x, y, bu_x1, bu_y1,
  1596. X     bu_x2, bu_y2 ) == TRUE ) && ( allow_backup == TRUE ) )
  1597. X     {
  1598. X     xpos = prevx;
  1599. X     ypos = prevy;
  1600. X     prevx = lastx;
  1601. X     prevy = lasty;
  1602. X     allow_backup = FALSE;
  1603. X     --n;
  1604. X     if ( n == -1 )
  1605. X        {
  1606. X        n = 0;
  1607. X        }
  1608. X     else if ( n == 0 )
  1609. X        {
  1610. X        curspj = lastspj;
  1611. X        curspj->next = &new_end;
  1612. X        dr_line( ypos, xpos, ypos, xpos,
  1613. X           BLACK, SOLID, map_curpos );
  1614. X        }
  1615. X     else
  1616. X        {
  1617. X        curspj = lastspj;
  1618. X        curspj->next = &new_end;
  1619. X        dr_line( ypos, xpos, prevy, prevx,
  1620. X           BLACK, SOLID, map_curpos );
  1621. X        }
  1622. X     }
  1623. X
  1624. X      else
  1625. X         {
  1626. X         bw_message( " " );
  1627. X     }
  1628. X
  1629. X      }
  1630. X
  1631. X   switch ( n )
  1632. X      {
  1633. X      case 0:
  1634. X         return -1;
  1635. X         break;
  1636. X      case 1:
  1637. X         fprintf( outfile, "1001\t%lf\t%lf\t%lf\n",
  1638. X            ypos, xpos, map_defalt );
  1639. X         break;
  1640. X      case 2:
  1641. X         fprintf( outfile, "1001\t%lf\t%lf\t%lf\n",
  1642. SHAR_EOF
  1643. true || echo 'restore of sfs/map/map.c failed'
  1644. fi
  1645. echo 'End of  part 16'
  1646. echo 'File sfs/map/map.c is continued in part 17'
  1647. echo 17 > _shar_seq_.tmp
  1648. exit 0
  1649. exit 0 # Just in case...
  1650. -- 
  1651. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1652. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1653. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1654. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1655.