home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 223.dms / 223.adf / Source / star.h < prev    next >
C/C++ Source or Header  |  1988-07-25  |  4KB  |  130 lines

  1. /*==========================================================================
  2.   Star.h - This is a header file used for adding all the necessary includes,
  3.   some definition of structure types and some definitions of constants and
  4.   macros, for the StarChart program.
  5.   
  6.   Credits for Star Chart:
  7.        Robert L. Hill of the Orange County, CA. Amiga Friends User Group
  8.                       wrote the original version of StarChart in AmigaBasic
  9.                       The star data and many of the main functions of this
  10.                       version are derived from that program.
  11.  
  12.        Ray R. Larson  wrote the c version 1.0 of StarChart, 'intuitionizing'
  13.                       and enhancing the speed and functions of the original.
  14.  
  15.   Copyright (c) 1986 by Ray R. Larson
  16.   
  17.   This program may be freely distributed and copied, but may not be sold
  18.   without the permission of the author. If you modify or enhance it, 
  19.   please include the above credits (and please send me a copy!).
  20.  
  21. Ray R. Larson
  22. 6425 Central Ave. #304
  23. El Cerrito, CA 94530
  24.  
  25. BitNet  LARSON@UCBCMSA
  26. Well    rrl
  27. CServe  70446,766
  28. =========================================================================*/
  29.  
  30. /*  The usual lump of Amiga header files  */
  31. #include <stdio.h>
  32. #include <ctype.h>
  33. #include <exec/types.h>
  34. #include <exec/io.h>
  35. #include <intuition/intuition.h>
  36. #include <libraries/dosextens.h>
  37. #include <graphics/gfxbase.h>
  38. #include <graphics/gfx.h>
  39. #include <graphics/display.h>
  40. #include <graphics/text.h>
  41. #include <exec/memory.h>
  42. #include <workbench/workbench.h>
  43. #include <workbench/startup.h>
  44. #include <devices/narrator.h>
  45. #include <devices/audio.h>
  46. #include <devices/timer.h>
  47. #include <libraries/translator.h>
  48. #include <libraries/mathffp.h>
  49. #include <workbench/icon.h>
  50.  
  51.  
  52.  
  53. /* Mask bits */
  54. #define INTUITION 0x00000001
  55. #define GRAPHICS  0x00000002
  56. #define WINDOW    0x00000004
  57. #define MENU      0x00000008
  58. #define SCREEN    0x00000010 
  59. #define MATHLIB   0x00000020
  60. #define MATHTRANS 0x00000040
  61. #define TIMEPORT  0x00000080
  62. #define TIMEMSG   0x00000100
  63. #define COLORMAP  0x00000200
  64. #define ICONLIB   0x00000400
  65.  
  66. /* constants -  MAX cons leave a little extra space for temp values */
  67. /*              in arrays and search tables                         */
  68. #define MAXSTARS 610
  69. #define MAXGREEK 30
  70. #define MAXCONS  65
  71.  
  72. #define NumStars  598
  73. #define NumCons   60
  74. #define NumGreek  24
  75.  
  76. /* dimensions/coordinates of display area */
  77. #define CHARTLEFT 40L
  78. #define CHARTTOP 10L
  79. #define CHARTRIGHT 598L
  80. #define CHARTBOT 170L
  81.  
  82. /*macros*/
  83. #define INRANGE(n,nl,nh) ((n >= nl) && (n <= nh) ? 1:0)
  84. #define INBOX(x,y,xl,xr,yt,yb) ((INRANGE(x,xl,xr)) && (INRANGE(y,yt,yb)) ? 1:0)
  85. #define ONCHART(x,y) (INBOX(x,y,CHARTLEFT,CHARTRIGHT,CHARTTOP,CHARTBOT) ? 1:0)
  86.  
  87. struct star_rec {
  88.   char *StarName; /* Name of star or object */
  89.  
  90.   FLOAT Ra,Dc,Mag,Dist; /* Right Ascension, Declination, Magnitude */
  91.                     /* and distance in light years             */
  92.  
  93.   SHORT ConsNum, GreekNum; /* Constellation number, and Greek name */
  94.                /* These are indexes into the Constel & */
  95.                /* Greek arrays                         */
  96.   char *Comment;  /* color - comments or common names of the stars */ 
  97. };
  98.  
  99.  
  100. /* structure for holding constellation info */
  101. struct cons_rec {
  102.   char *ConsName;   /* name of constellation          */
  103.   char *ConsAbrv;   /* abbreviation for constellation */
  104.   char *ConsMean;   /* meaning of constellation name  */
  105.  };
  106.  
  107. /* structure to hold date, time and location parameters */
  108. struct ParamStruct {
  109.   SHORT LongitudeDeg,
  110.         LongitudeMin,
  111.         Latitude,
  112.         Month,
  113.         Day,
  114.         Year;
  115.   FLOAT Lst,
  116.         Gst;
  117.   SHORT Hr,
  118.         Mn,
  119.         Hour,
  120.         Minute,
  121.         Horizon;
  122.    };
  123.  
  124. /* coord structure to hold coordinates of star display positions on screen */
  125. struct Coord {
  126.    LONG x,y;
  127.    };
  128.  
  129.  
  130.