home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 1 / CD_Magazyn_EXEC_nr_1.iso / Gry / battalion.lha / Battalion / source / battalion.h < prev    next >
C/C++ Source or Header  |  1999-12-23  |  27KB  |  1,049 lines

  1. /****************************************************************/
  2. /* code copyright 1995-1996 Andrew Johnson - ALL RIGHTS RESERVED*/
  3. /*                          ajohnson@eecs.uic.edu               */
  4. /*                                                              */
  5. /*                      Electronic Visualization Lab (M/C 154)  */
  6. /*                      University of Illinois at Chicago       */
  7. /*                      851 South Morgan St. Room 1120 SEO      */
  8. /*                      Chicago, IL 60607-7053                  */
  9. /*                                                              */
  10. /*                      (312) 996-3002     (312) 413-7585 FAX   */
  11. /***********************************************************************/
  12. /* header file v 1.4b2                                                  */
  13. /***********************************************************************/
  14.  
  15. #define RECONNECT_TIME          15
  16. #define IM_NOT_DEAD_YET_TIME    60
  17. #define IM_NOT_DEAD_SEND_TIME   19
  18. #define MAXLINE                 256
  19. #define COMPUTER_MONSTER        -1
  20. #define MONSTER_UPDATE_RATE     5
  21. #define DEFAULT_PORT            6000
  22. #define MAXCLIENTS              10
  23.  
  24. #define MESG_BUILDING           "bld"
  25. #define MESG_UPDATE             "upd"
  26. #define MESG_REQUEST            "req"
  27. #define MESG_NOTDEADYET         "Iliv"
  28. #define MESG_REAQUIRE           "yo"
  29. #define MESG_ACKNOWLEDGE        "ack"
  30. #define MESG_NEW_TANK           "newTank"
  31. #define MESG_UPDATE_TANK        "updateTank"
  32. #define MESG_CLIENT_CLIENT_UPDATE "client"
  33.  
  34. /* stuff to try and get the Mac version to compile and run */
  35. /* #define MACVERSION */
  36. /* #define DEBUG */
  37.  
  38.  
  39. #ifdef MACVERSION
  40. #define MESA_TK_VERSION
  41. #define MESAVERSION
  42. #endif
  43.  
  44. #include <stdlib.h>
  45. #include <stddef.h>
  46. #include <string.h>
  47. #include <math.h>
  48. #include <time.h>
  49.  
  50. #ifdef MACVERSION
  51. #include <GL/tk.h>
  52.  
  53. /*this next one was added to my tk.h */
  54.  
  55. #define TK_CONTROL_L 0x03
  56.  
  57. #include <utime.h>
  58. #include <sound.h>
  59. #include "SoundHelper.h"
  60. #endif
  61.  
  62. #ifndef MACVERSION
  63. #ifndef AMIGAVERSION
  64. #include <malloc.h>
  65. #include <pwd.h>
  66. #endif
  67. #endif
  68.  
  69. #include <stdio.h>
  70. #ifndef AMIGAVERSION
  71. #include <unistd.h>
  72. #endif
  73.  
  74. #ifndef MACVERSION
  75. #include <sys/types.h>
  76. #include <sys/socket.h>
  77. #include <sys/param.h>
  78. #include <netinet/in.h>
  79. #include <netdb.h>
  80. #ifndef AMIGAVERSION
  81. #include <netinet/tcp.h>
  82. #include <sys/uio.h>
  83. #include <arpa/inet.h>
  84. #include <fcntl.h>
  85. #include <sys/errno.h>
  86. #include <signal.h>
  87. #else
  88. #include <sys/ioctl.h>
  89. #include <errno.h>
  90. #endif
  91. #endif
  92.  
  93. #ifdef SGIVERSION
  94. #include <bstring.h>
  95. #endif
  96.  
  97. #ifdef SOLARIS
  98. /* from Johan Hagman <Johan.Hagman@mailbox.swipnet.se> */
  99. # include <sys/stat.h>
  100. # include <sys/file.h>
  101.  
  102. /* BSD compatibility */
  103. # define bzero(dst,len) memset(dst, 0, len)
  104. #endif
  105.  
  106. #ifdef SUNAUDIO
  107. /* Audio support */
  108. # include <multimedia/libaudio.h>
  109. # include <multimedia/audio_device.h>
  110. #endif
  111.  
  112. #ifdef HPVERSION
  113. /* to get non-blocking I/O under HP-UX */
  114. /* from Neil Harkin <T.N.Harkin@csc.liv.ac.uk> */
  115. #define FNDELAY O_NDELAY
  116. #endif
  117.  
  118. #ifdef AMIGAVERSION
  119. #include <exec/types.h>
  120. #include <exec/libraries.h>
  121. #include <devices/timer.h>
  122. #include <amitcp/socketbasetags.h>
  123. #include <proto/exec.h>
  124. #include <proto/dos.h>
  125. #include <proto/socket.h>
  126. #ifdef __PPC__
  127. #include <clib/powerpc_protos.h>
  128. #endif
  129. #define bzero(dst,len) memset(dst,0,len)
  130. #define MESA_TK_VERSION
  131. #define MESAVERSION
  132. #endif
  133.  
  134.  
  135. #include <GL/gl.h>
  136. #include <GL/glu.h>
  137.  
  138. #ifndef MACVERSION
  139. #ifndef AMIGAVERSION
  140. #include <GL/glx.h>
  141. #include "tk.h"
  142. #else
  143. #include "tk_amiga.h"
  144. #endif
  145. #endif
  146.  
  147. #ifndef MACVERSION
  148. #ifndef AMIGAVERSION
  149. #include <sys/time.h>
  150. #endif
  151. #endif
  152.  
  153. /* audio routines */
  154. /*****************/
  155.  
  156. #ifdef SGIVERSION
  157.  
  158. #include <audio.h>
  159. #include <audiofile.h>
  160.  
  161. #endif
  162.  
  163. /* added for the OpenGL version */
  164.  
  165. #ifndef TRUE
  166.     # define TRUE 1
  167. #endif
  168.  
  169. #ifndef FALSE
  170.     # define FALSE 0
  171. #endif
  172.  
  173. #define ENGLISH 0
  174. #define JAPANESE 1
  175.  
  176. #define MAXTARGETS          3
  177.  
  178. /************************************/
  179. /* to try and speed up computations */
  180. /************************************/
  181.  
  182. #ifdef SGIVERSION
  183.  
  184.     #define fabs fabsf
  185.     #define sqrt fsqrt
  186.     #define sin fsin
  187.     #define cos fcos
  188.     #define atan fatan
  189.     #define atan2 atan2f
  190.  
  191. #else
  192.  
  193.     #define amalloc(x,y)        malloc(x)
  194.     #define afree(x,y)  free(x)
  195.     #define acalloc(n,x,y)      calloc(n,x)
  196.  
  197. #endif
  198.  
  199. #ifdef MACVERSION
  200.     #define sqrt sqrtf
  201.     #define sin sinf
  202.     #define cos cosf    
  203.     #define atan atanf
  204.     #define atan2 atan2f
  205.  
  206. #endif
  207.  
  208. /******************/
  209. /* set up the fog */
  210. /******************/
  211.  
  212. #ifdef SGIVERSION
  213.  
  214.     #define MONSTERFOGSTART         2
  215.     #define MONSTERFOGEND           6.5
  216.  
  217.     #define ARMYFOGSTART            4
  218.     #define ARMYFOGEND              15
  219.  
  220.     #define OVERVIEWFOGSTART        4
  221.     #define OVERVIEWFOGEND          12
  222.  
  223. #else
  224.  
  225.     #define MONSTERFOGSTART         2.5
  226.     #define MONSTERFOGEND           6
  227.  
  228.     #define ARMYFOGSTART            4
  229.     #define ARMYFOGEND              12
  230.  
  231.     #define OVERVIEWFOGSTART        6
  232.     #define OVERVIEWFOGEND          12
  233.  
  234. #endif
  235.  
  236.  
  237.  
  238. /**********************/
  239. /* monster ID numbers */
  240. /**********************/
  241.  
  242. #define GOOGELON            0
  243. #define VAPOUR              1
  244. #define TECHS               2
  245. #define FLUTTER             3
  246.  
  247. /**********************/
  248. /* misc stuff         */
  249. /**********************/
  250.  
  251. #ifndef PI
  252.         #define PI          3.14159265
  253. #endif
  254.  
  255. #define TWOPI               6.2831853
  256.  
  257. #ifdef MESAVERSION
  258.  
  259.     #define     CYLINDERSIDES       6
  260.     #define     MORECYLINDERSIDES   12
  261.  
  262. #else
  263.  
  264.     #define     CYLINDERSIDES       12
  265.     #define     MORECYLINDERSIDES   20
  266.  
  267. #endif
  268.  
  269. #define CYLINDER_EPSILON    0.0001
  270. #define NEARZERO            0.0001
  271. #define BIGNUM              99999
  272.  
  273. #define ARMCOUNT            8
  274. #define NULLROAD            10
  275.  
  276. #define MAXSTRING           256
  277.  
  278. /**********************/
  279. /* game stuff         */
  280. /**********************/
  281.  
  282. #ifdef MESAVERSION
  283.  
  284.     #define MAXTRIBUTES     25
  285.  
  286. #else
  287.  
  288.     #define MAXTRIBUTES     45
  289.  
  290. #endif
  291.  
  292. #define ARRIVALRATE         62
  293. #define STARTACCURACY       200
  294. #define STARTFIRINGDELAY    43
  295.  
  296. #define GRAVITY             0.01
  297. #define BEAMKILL            0.31
  298.  
  299. #define BLASTR              0.5
  300. #define TREEBLASTR          0.25
  301. #define TREEBLASTHEIGHTR    1
  302. #define BLASTRX2            1
  303. #define BLASTRX04           0.2
  304. #define BLASTRX05           0.25
  305. #define BLASTRX06           0.3
  306. #define BLASTRX07           0.35
  307. #define BLASTRX075          0.375
  308.  
  309. #define TANKV               0.03
  310. #define MAXLIFE             100
  311. #define BLASTPOINTS         2
  312.  
  313. /**********************/
  314. /* stereo stuff       */
  315. /**********************/
  316.  
  317. #define YMAXSTEREO          491
  318. #define YOFFSET             532
  319.  
  320. /**********************/
  321. /* battlefield stuff  */
  322. /**********************/
  323.  
  324. #ifdef MESAVERSION
  325.  
  326.     #define PLANESIZE       6
  327.  
  328. #else
  329.  
  330.     #define PLANESIZE       8
  331.  
  332. #endif      
  333.  
  334.                                     /* height of the battlefield */
  335. #define PLANEY              -1
  336.                                     /* PLANEY + 0.003 */
  337. #define SHADOWS             -0.997
  338.                                     /* PLANEY + 0.001 */
  339. #define ROADS               -0.999
  340.  
  341. #define MAXROADSONPLANE     1000
  342. #define ROADLINETHICKNESS   0.04
  343. #define ROADLINELENGTH      0.13   
  344.  
  345. /**********************/
  346. /* views              */
  347. /**********************/
  348.  
  349. #define OMNISCIENTVIEW      0
  350. #define MONSTERVIEW         1
  351. #define ARMYVIEW            2
  352. #define MAPVIEW             4
  353.  
  354. #define NOTANKONPLANE       -9999
  355.  
  356. /**********************/
  357. /* modes              */
  358. /**********************/
  359.  
  360. #define DEMOMODE            0
  361. #define PLAYMODE            1
  362.  
  363. /**********************/
  364. /* sounds             */
  365. /**********************/
  366.  
  367. #define TANKFIRE            0
  368. #define HELOROCKET          1
  369. #define TANKMASER           2
  370. #define EXPLOSION           3
  371. #define MONSTERBEAM         4
  372. #define SLAG                5
  373. #define CRASH               6
  374. #define TECHSHOOT           7
  375. #define MUSIC               8   
  376.  
  377. /* #define MAXMUSIC 36 */
  378. #define MAXMUSIC 5
  379. #define MAXDEADMUSIC 5
  380.  
  381. #define MAXSOUNDS 25
  382.  
  383. /**********************/
  384. /*limits              */
  385. /**********************/
  386.             
  387. #define MAXTREESONPLANE     800
  388. #define MAXFIRESONPLANE     150
  389. #define MAXTANKSONPLANE     200
  390.  
  391. #define ARENASIZE           100000
  392.  
  393. #ifdef AIXVERSION
  394.  
  395. #ifdef MAXPATH
  396. #undef MAXPATH
  397. #endif 
  398.  
  399. #define MAXPATH             400
  400.  
  401. #endif
  402. #define MAXPATH             400
  403. #define MAXBEAMS             50
  404.  
  405. /**********************/
  406. /* conversions        */
  407. /**********************/
  408.  
  409. #define BIG_DEG_TO_RAD      0.0017453292
  410.                             /* (2 x pi) / 3600 */
  411. #define RAD_TO_BIG_DEG      572.9577951
  412.                             /* 360 / (2 x pi) */
  413. #define RAD_TO_SMALL_DEG    57.29577951
  414.                             /* 3600 / (2 x pi) */
  415. #define DEG_TO_RAD          0.0174532925
  416.                             /* Pi / 180 */
  417.  
  418. /**********************/
  419. /* vehicles           */
  420. /**********************/
  421.  
  422. #define TANK        0
  423. #define MASERTANK   1
  424. #define HELO        2
  425. #define MECHAG      3
  426. #define CHH         4
  427. #define HERO        5
  428. #define AIRPLANE    6
  429. #define LAUNCHER    7
  430. #define FIGHTER     8
  431.  
  432. #define PARTIALM  100
  433. #define PARTIALH  101
  434. #define PARTIALC  102
  435.  
  436. #define BUILDING    99
  437. #define MONSTER     75
  438.  
  439. /**********************/
  440. /* projectiles        */
  441. /**********************/
  442.  
  443. #define PROJTANK    0
  444. #define PROJROCKET  1
  445. #define PROJTECHS   2
  446. #define PROJFIRE    3
  447. #define PROJHERO    4
  448. #define PROJSCAR    5
  449. #define PROJWATER   6
  450.  
  451. #define  computeAngle(x, y, z, w) (atan2( (z - w) ,  (x - y)) + PI)
  452.  
  453. #define  randy(x) (((rand() % 2001) - 1000) * x * 0.001)
  454.  
  455.  
  456. struct projectile
  457.         {
  458.         struct projectile * next;   /* pointer to next projectile */
  459.         struct monsterInfo * mine;  /* pointer to ownder of projectile */
  460.         float x, y, z;              /* location of projectile */
  461.         float xv, yv, zv;           /* velocity of projectile */
  462.         char count;                 /* time after launch before arming */
  463.         char type;                  /* type of projectile */
  464.         };
  465.  
  466. struct boom
  467.         {
  468.         struct boom * next;         /* pointer to next explosion */
  469.         struct monsterInfo * mine;  /* pointer to ownder of boom */
  470.         float x, y, z;              /* location of explosion */
  471.         int count;                  /* explosion timer */
  472.         };
  473.  
  474. struct tree
  475.         {
  476.         struct tree * next;         /* pointer to next structure */
  477.         float x, y, z;              /* location of structure */
  478.         float rad,  theta;
  479.         float height;
  480.         int deathCount;
  481.         int death2;
  482.         int number;
  483.         char type; 
  484.         char treeshape; 
  485.         char intact;                /* is structure intact? */
  486.         };
  487.  
  488. struct tank
  489.         {
  490.         struct tank * next;
  491.         struct monsterInfo* goforit;
  492.         float x, y, z;              /* location of vehicle */
  493.         float xv, zv;               /* velocity of vehicle */
  494.         float range;                /* distance from vehicle to monster */
  495.         float minrange;             /* minimum range vehicle can fire */
  496.         float finalR;               /* final range vehicle is attempting */
  497.         float rad, theta;
  498.         float speed;                /* speed of vehicle */
  499.         float rand1, rand2, rand3;
  500.         int count; 
  501.         int maserCount;
  502.         int damage;                 /* amount of damage vehicle can take */
  503.         int walking;
  504.         int number;
  505.         char type;                  /* type of vehicle */
  506.         char subtype;               /* sub type (for hero) */
  507.         };
  508.  
  509. struct road
  510.         {
  511.         float x, y;                 /* location of road */
  512.         char type;                  /* type: 0 vert, 1 horz, 2 cross */
  513.         };
  514.  
  515. struct monsterInfo
  516.         {
  517.         float a[MAXTRIBUTES][5];    /* vapour particles */
  518.         float energyRemaining;      /* amount of energy remaining */
  519.         float rot1,rot2;
  520.         float speed;                /* movement speed */
  521.         float xspeed;               /* turning rate */
  522.         float moveCost;             /* energy loss from moving */
  523.         float height;               /* height of monster */
  524.         float width;                /* width of monster */
  525.         float bottom;               /* bottom of monster */
  526.         float regenRate;            /* rate of energy gain */
  527.         int moveCount;              /* for leg and wing rotation */
  528.         int monsterID;              /* code # of monster */
  529.         int headHorzRotate;         /* horizontal head angle */
  530.         int headVertRotate;         /* vertical head angle */
  531.         int monsterScore;           /* monster's score */
  532.         int deadCount;              /* time monster is dying */
  533.         int timeDead;               /* time monster has been dead */
  534.         int monster;                /* type of monster */
  535.         int monsterIsDead;          /* is monster alive or dead? */
  536.         int beamOn;                 /* is the energy weapon on */
  537.         int monsterGo;              /* is the monster going forward? */
  538.         int monsterBack;            /* is the monster going backward? */
  539.         int monsterMoving;          /* is the monster moving? */
  540.         };
  541.  
  542. struct targetInfo
  543.         {
  544.         struct monsterInfo monster;
  545.         struct targetInfo * next;
  546.         float x,z;
  547.         float net_energyRemaining;
  548.         float net_x,  net_z;
  549.         long net_clientFrom;
  550.         int net_headHorzRotate;
  551.         int net_headVertRotate;
  552.         int net_beamOn;
  553.         int lastUpdateFrame;
  554.         };
  555.  
  556. struct fireType
  557.         {
  558.         float x, z;                 /* location of flame */
  559.         float xwid, zwid;           /* width of flame */
  560.         float height;               /* height of flame */
  561.         float col;                  /* color of flame */
  562.         };
  563.  
  564. struct aSound
  565.         {
  566.         short *sampleBuffer;
  567.         long samplesPerFrame;
  568.         long numberSamples;
  569.         long samplesPerBuffer;
  570.         long audioRate;
  571.         };
  572.  
  573. struct sound
  574.         {
  575. #ifdef SGIVERSION
  576.         ALport audio_port;
  577. #endif
  578.         struct sound * next;
  579.         int type;
  580.         };
  581.  
  582. struct enemy
  583.         {
  584.         float r;                    /* range to enemy */
  585.         float y;                    /* height of enemy */
  586.         float ang;                  /* angle to enemy */
  587.         };
  588.         
  589. struct score
  590.         {
  591.         int number;
  592.         char name[256];
  593.         };
  594.  
  595. /***************************
  596.  * tk.c
  597.  * 
  598.  ***************************/
  599.  
  600. #if !defined(MACVERSION) && !defined(AMIGAVERSION)
  601. void tkCloseWindow(void);
  602. static GLenum DoNextEvent(void);
  603. void tkExec(void);
  604. void tkGetMouseLoc(int *x, int *y);
  605. static XVisualInfo *FindVisual(GLenum type);
  606. static int MakeVisualType(XVisualInfo *vi);
  607. static int WaitForMapNotify(Display *d, XEvent *e, char *arg);
  608. void tkInitPosition(int x, int y, int width, int height);
  609. void tkInitDisplayMode(GLenum type);
  610. GLenum tkInitWindow(char *title);
  611. static int Ignore(Display *parm1, XErrorEvent *parm2);
  612. void tkSetRGBMap(int size, float *rgb);
  613. void tkSwapBuffers(void);
  614. void unGrabPointer();
  615. void grabPointer();
  616.  
  617. #else
  618. void updateMonsterMenu(int);
  619. void updateDetailMenu(int);
  620. void enableViewMenu(void);
  621. void disableViewMenu(void);
  622.  
  623. #endif
  624.  
  625. /***************************
  626.  * font.c
  627.  * holds the font routines
  628.  ***************************/
  629.  
  630. extern GLenum tkCreateStrokeFont(GLuint);
  631. extern void tkDrawStr(GLuint, char *);
  632.  
  633. /***************************
  634.  * update.c
  635.  * holds the update routines
  636.  ***************************/
  637.  
  638. void showError(char *);
  639. float buildingHeight(int,  int);
  640. struct monsterInfo resetMonsterParameters(struct monsterInfo);
  641.  
  642. int same(char *, char *);
  643. int different(char *, char *);
  644.  
  645.  
  646. float centerText(char *,  float);
  647.  
  648. void updateGun(float, float, int, int, int,struct monsterInfo *);
  649. void updateVap(float, float, int,struct monsterInfo *);
  650. void updatetrees(struct tree *, int);
  651. void updateBeam(struct monsterInfo *, struct targetInfo *, float, float, struct tank *, struct tree **, int, struct monsterInfo *);
  652. void updateTanks(struct tank *, float, float, float, int, int, struct tank *, 
  653.                 float, int, int, struct monsterInfo *, struct targetInfo *);
  654. void updateSlagTanks(struct tank *);
  655. void updateBooms(struct boom *, struct tank *);
  656. int tankHit(struct tank *, float, float, float);
  657. void addNewTank(struct targetInfo *, float,  float,  int, struct tank *, struct tree *, int, int, struct monsterInfo *);
  658.  
  659.  
  660. /****************************************************
  661.  * audio.c
  662.  * holds audio routines for battalion
  663.  ****************************************************/
  664.  
  665. #ifdef MACVERSION
  666. void setSoundVolume(long);
  667. void processIdleAppSounds(void);
  668. #endif
  669.  
  670. void macEachFrameSound(void);
  671.  
  672. void turnSoundOff();
  673. void turnSoundOn();
  674. void toggleSound();
  675. int getSoundOn();
  676. void turnMusicOff();
  677. void turnMusicOn();
  678. void toggleMusic();
  679. int getMusicOn();
  680.  
  681. void checkSound(char *);
  682. void initSounds(void);
  683. void flushSounds(void);
  684. void soundKiller(int);
  685. void doSound(int);
  686. void InitAudio(char *,  char *, int);
  687. void OutAudio(int);
  688.  
  689.  
  690. /****************************************************
  691.  * battalion.c
  692.  * holds everything that hasnt been put somewhere else
  693.  ****************************************************/
  694.  
  695. void newPlayerName(char *);
  696. GLenum mouseKey(int, GLenum);
  697.  
  698.  
  699. void doMonsterView(void);
  700. void doOmniscientView(void);
  701. void doArmyView(void);
  702. void doMapView(void);
  703.         
  704. void goToHighDetail();
  705. void goToLowDetail();
  706.  
  707. void updateScores(char *, int, int, int, char *);
  708.  
  709. void quickTanks(void);
  710.  
  711. int checkForBlock(struct tank *, float rad, float theta, float y);
  712.  
  713. void addScore(int, struct monsterInfo *);
  714. void addBoom(float x, float y, float z,struct monsterInfo *);
  715. void addProjectile( float x, float y, float z, int type, 
  716.                     float xv, float yv, float zv, float accuracy,struct monsterInfo *);
  717. void updateProjectiles(void);
  718. void updatetrees(struct tree *, int);
  719. void updateTanks(struct tank *, float, float, float, int, int, 
  720.                 struct tank*, float, int, int,
  721.                 struct monsterInfo *, struct targetInfo *);
  722. void updateSlagTanks(struct tank *);
  723. void addNewTank(struct targetInfo *, float, float, int, struct tank *, 
  724.                 struct tree *, int, int, struct monsterInfo *);
  725. void updateBooms(struct boom *, struct tank *);
  726.  
  727. void buildHillPart(struct tree, int, float, float);
  728.  
  729. void setPlayConditions(void);
  730. void addRandomTarget(void);
  731.  
  732. void initialization(void);
  733.  
  734. void goto3d(void);
  735. void goto1d(void);
  736.  
  737. void checkMouse(void);
  738. void checkInput (void);
  739. GLenum MouseDown(int, int, GLenum);
  740. GLenum MouseUp(int, int, GLenum);
  741. void demoKeys(int);
  742. void playKeys(int);
  743. void playNoPauseKeys(int);
  744. GLenum processKey(int, GLenum);
  745. #ifndef AMIGAVERSION
  746. GLenum processKeyRelease(int);
  747. #else
  748. GLenum processKeyRelease(int,GLenum);
  749. #endif
  750. void checkInput (void);
  751.  
  752. void updateDeadMonster(float, float, struct monsterInfo * );
  753. void updateVapourLook(float a[MAXTRIBUTES][5], int);
  754. void updateTargets(void);
  755.  
  756. void doUpdate (void);
  757.  
  758. void goToMonsterView(int);
  759. void goToArmyView(int);
  760. void goToMapView(void);
  761. void goToOverView(int);
  762.  
  763. void drawAMonster(float, struct monsterInfo, float, int, int);
  764.  
  765. void doDrawing (int);
  766.  
  767. struct monsterInfo autopilot(float, float, struct monsterInfo);
  768.  
  769. void reshape( int, int);
  770. void id(void);
  771.  
  772. void showCommands(char *);
  773.  
  774. /*******************************
  775.  * net.c
  776.  * holds the network primitives
  777.  *******************************/
  778.  
  779. void turnBeamOnSinceLast(void);
  780. void setUnconnected(void);
  781. void setPortNumber(int);
  782. void setHostAddr(char *);
  783.  
  784. void addNewNetworkTank(char *, struct tank *, void *, int);
  785. void updateNetworkTank(char *, struct tank *);
  786. void tellAboutAllTanks(struct sockaddr_in *, int, struct tank *);
  787.  
  788. void updateClientMonster(char *, void *);
  789.  
  790.  
  791. int setUpClient(void);
  792. int setUpNetwork(void);
  793. void updateNetworkBuildings(char *, struct tree *);
  794. void updateNetworkMonsters(char *, long, void *);
  795. int sendMessage(char *, struct sockaddr_in *, int);
  796. void processClient(time_t, int, int, struct tree *, struct tank *,
  797.     void * arena, int sizeTank, struct monsterInfo, int, int *);
  798. void tellAboutAllDeadBuildings(struct sockaddr_in *, int, int, int *);
  799. void processNetwork(time_t, int, int, struct tree *, struct tank *,
  800.     void *, struct monsterInfo, int, int, int *, int *);
  801. void addNetworkTarget(long, int, float, float, float, float, float,
  802.     int, void *);
  803.  
  804. /*******************************
  805.  * gprim.c
  806.  * holds the graphics primitives
  807.  *******************************/
  808.  
  809. void drawCylinder(float *, float *, float, int,  int, int);
  810. void drawClosedCylinder(float *, float *,  int, int);
  811.  
  812. void drawCone(float *, float *, float, int,  int);
  813. void drawClosedCone(float *, float *,  int);
  814.  
  815. void maker(float tail2[8][3], float,  float,  float,
  816.                 float,  float,  float, 
  817.                 float *,  float,  float,  float,  float);
  818.  
  819. void makerVapour(float, float, float, float, float, float);
  820.  
  821. void makerP(float tail2[8][3], float *, float,  float,  float,
  822.                 float,  float,  float);
  823.  
  824. void makerFire(float c[4], float, float, float, float, float, float);
  825.  
  826. void makeitd(int,  float *,  float,  float,  float,
  827.                 float,  float,  float);
  828.  
  829. void makeitPyr(int,  float *,  float,  float,  float,
  830.                 float,  float,  float);
  831.  
  832. void makercube(float x,  float y,  float z,
  833.                 float u,  float v,  float w, 
  834.                 float c[4]);
  835.  
  836. void makerbluecube(float x,  float y,  float z,
  837.                 float u,  float v,  float w, 
  838.                 float c[4]);
  839.  
  840. void makercubenobacknotop(float x,  float y,  float z,
  841.                 float u,  float v,  float w, 
  842.                 float c[4]);
  843.  
  844. void makerlogo(float x,  float y,  float z,
  845.                 float u,  float v,  float w, int, int, int);
  846.                 
  847. void makercubeTopBack(float x,  float y,  float z,
  848.                 float u,  float v,  float w, 
  849.                 float c[4]);
  850.  
  851. void makercubenobtm(float x,  float y,  float z,
  852.                 float u,  float v,  float w, 
  853.                 float c[4]);
  854.  
  855. void makercubenobtmnotop(float x,  float y,  float z,
  856.                 float u,  float v,  float w, 
  857.                 float c[4]);
  858.  
  859. void makercubenobtmnotopTEX(float x,  float y,  float z,
  860.                 float u,  float v,  float w, 
  861.                 float c[4]);
  862.  
  863. void makerrotcubexy(float u,  float v,  float w, 
  864.                 float theta, float c[4]);
  865.                 
  866. void makerrotcubexyflat(float u,  float v,  float w, 
  867.                 float theta, float c[4]);
  868.  
  869.  
  870. /*****************************************
  871.  * objects.c
  872.  * holds the objects for the graphics routines
  873.  *****************************************/
  874.  
  875. GLuint makeMonsterLookat(void);
  876. GLuint makeOverviewLookat(void);
  877.  
  878. GLuint makeshell2(void);
  879. GLuint makeHeroShell(void);
  880. GLuint makeWaterShell(void);
  881.  
  882. GLuint makeTankShadow(void);
  883. GLuint makeFighterShadow(void);
  884. GLuint makePlaneShadow(void);
  885.  
  886. GLuint makeTank(void);
  887. GLuint makeSlagTank(void);
  888. GLuint makeLauncherTank(void);
  889. GLuint makeSlagLauncherTank(void);
  890. GLuint makeMaserTank(void);
  891. GLuint makeSlagMaserTank(void);
  892.  
  893. GLuint makeHelo(void);
  894. GLuint makeSlagHelo(void);
  895. GLuint makeBigRotor(void);
  896. GLuint makeSmallRotor(void);
  897. GLuint makePropeller(void);
  898. GLuint makeAirplaneBody(void);
  899. GLuint makeFighterBody(void);
  900.  
  901. GLuint makeLeg(void);
  902. GLuint makeHead(void);
  903. GLuint makeTail(void);
  904. GLuint makeSimpleHead(void);
  905. GLuint makeSimpleTail(void);
  906. GLuint makeBody(void);
  907.  
  908. GLuint makeFlutterHead(void);
  909. GLuint makeFlutterShadow(void);
  910. GLuint makeFlutterXMas(void);
  911. GLuint makeFlutterBody(void);
  912. GLuint makeFlutterWing1(void);
  913. GLuint makeFlutterWing2(void);
  914.  
  915. GLuint makeTechsBody(void);
  916. GLuint makeTechsHead(void);
  917. GLuint makeTechsSimpleBody(void);
  918. GLuint makeTechsSimpleHead(void);
  919. GLuint makeTechsShadow(void);
  920.  
  921. GLuint makePowerTower(void);
  922. GLuint makeGenericWindows(void);
  923. GLuint makebuilding1(int);
  924. GLuint makebuilding2(int);
  925. GLuint makebuilding5(int);
  926. GLuint makebuilding7(void);
  927. GLuint makebuilding9(int);
  928. GLuint makebuilding10(void);
  929. GLuint makebuilding12(int);
  930. GLuint makebuilding14(void);
  931. GLuint makebuilding19(int);
  932. GLuint makebuilding20(int);
  933. GLuint makebuilding21(int);
  934. GLuint makebuilding31(void);
  935. GLuint makebuilding32(void);
  936. GLuint makeStrip1(int);
  937. GLuint makeStrip2(int);
  938. GLuint makeStrip3(int);
  939.  
  940. GLuint makeTitles(int);
  941.  
  942. GLuint makeLowDPlane(void);
  943. GLuint makeHighDPlane(void);
  944. GLuint makeBigPlane(void);
  945. GLuint makePlaneDots(int);
  946.  
  947. GLuint makeRoundTreeShadow(void);
  948.  
  949. /*****************************************
  950.  * text.c
  951.  * holds the textual overlay routines
  952.  *****************************************/
  953.  
  954. void initFonts(void);
  955. void showText(struct targetInfo *, float,  int,  long, int, int);
  956. void showText2(long, int, int, int, int, int, int, int, int, int);
  957. void showText3(int);
  958. void showText4(void);
  959.  
  960. void doOptions(struct monsterInfo, long, int, int, float, int);
  961. void doSummary(int,  int, long, int,
  962.                 int, int, int,
  963.                 int, int, int, int, int, int, int,int);
  964.  
  965. void showScores(int, struct score*, struct score*, struct score*, struct score*, struct monsterInfo, int,float, int);
  966.  
  967. /*****************************************
  968.  * graphics.c
  969.  * holds the higher level graphics routines
  970.  *****************************************/
  971.  
  972. void doTexStuff(char *, char *, int, int, char *, GLuint *, int, int);
  973.  
  974. void makeObjects(char *);
  975.  
  976. void drawShadow (float, float, float, float);
  977.  
  978. void makeCHH(int);
  979. void drawHelo(float, int);
  980. void drawAirplane(int);
  981. void drawFighter();
  982.  
  983. void drawMonster(struct monsterInfo, int, int, int);
  984. void drawSimpleMonster(struct monsterInfo, int, int, int);
  985.  
  986. void drawVapour(struct monsterInfo, int, int);
  987.  
  988. void drawFlutter(struct monsterInfo, int, int, float, int, int);
  989. void drawTechs(struct monsterInfo, int);
  990. void drawSimpleTechs(struct monsterInfo, int);
  991. void drawHeroDude(int, int,  int, int, int);
  992. void drawHeroDude2(int, int,  int, int, int);
  993. void drawMechaMonster(int, int, int);
  994.  
  995. void wzminus(float,  float,  float,  float,  float);
  996. void wzplus(float,  float,  float,  float,  float);
  997. void wxplus(float,  float,  float,  float,  float);
  998. void wxminus(float,  float,  float,  float,  float);
  999.  
  1000.  
  1001. void makeBooms(void);
  1002.  
  1003. void drawBuilding0(float *, int);
  1004. void drawBuilding6(int, float *,  float *, int);
  1005. void drawBuilding8(float *,float *, int);
  1006. void drawBuilding11(int);
  1007. void drawBuilding15(float *,  float *, int);
  1008. void drawBuilding22(float *);
  1009. void drawBuilding25(void);
  1010. void drawBuilding26(int, int);
  1011. void drawBuilding29(int,int);
  1012. void drawBuilding33(int, int);
  1013. void drawBuilding34(float *);
  1014. void drawBuilding36(float *);
  1015. void drawBuilding37(float *, int);
  1016.  
  1017.  
  1018. void drawTower(int, int);
  1019. void drawCoolingTower(int);
  1020.  
  1021. void drawHills(int,int);
  1022. void drawWater(int,int);
  1023.  
  1024. void drawBattlefield(struct road *, float, float, int, int,int);
  1025.  
  1026. void drawLake0(int);
  1027. void drawLake1(int);
  1028. void drawHill0(int);
  1029. void drawHill1(int, int);
  1030. void drawHill2(int, int);
  1031. void drawHill3(int, int);
  1032.  
  1033. void drawtrees(struct tree *, int, int, int, int,int);
  1034.  
  1035. void drawSlagTanks(struct tank *, int, int);
  1036. void drawTanks(struct tank *, int, struct monsterInfo, struct targetInfo *, int, int,int);
  1037.  
  1038. void drawMaser(float, float, float, int, float, float, float, float, float, float, float, int, int, int);
  1039. void drawHeroWeapon(float, float, float, float, float, float *, float, float);
  1040.  
  1041. void drawBooms(struct boom *, int);
  1042. void drawBeam(float, float, int,  int, int, int);
  1043.  
  1044. void drawRoads(struct road *,  float,  float, int, int, int);
  1045. void drawProjectiles(struct projectile *, int, struct fireType*, int, int, int);
  1046.  
  1047. void andysphdraw(float loc[4], int);
  1048.  
  1049.