home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Game Guide / AmigaGameGuide_CD.iso / Amiga / PD-Games / DogFight! / Sources.lha / DogFight!_1.0.h < prev    next >
C/C++ Source or Header  |  1994-05-16  |  4KB  |  122 lines

  1. /********************************************************************
  2. ×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  3. ##
  4. ## Dogfight!4.h
  5. ##
  6. ## DogFight! definitions and globals.
  7. ##
  8. ## v0.0  24-Feb-94
  9. ## 
  10. ## v0.4  26-Feb-94   added MUI & doublebuffering
  11. ## v0.5  28-Feb-94   changed input to direct keyboard read
  12. ## v0.6  28-FEB-94   added screenmode requester
  13. ##
  14. ×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  15. *********************************************************************/
  16.  
  17. #ifndef DOGFIGHT_H
  18. #define DOGFIGHT_H
  19. #endif
  20.  
  21. #include <string.h>
  22. #include <stddef.h>
  23. #include <intuition/intuition.h>
  24. #include <libraries/mathffp.h>
  25.  
  26. #include <clib/graphics_protos.h>
  27. #include <clib/intuition_protos.h>
  28. #include <clib/mathffp_protos.h>
  29. #include <clib/mathtrans_protos.h>
  30. #include <clib/alib_protos.h>
  31.  
  32. // macros & stuff
  33.  
  34. #ifndef MAKE_ID
  35. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  36. #endif
  37.  
  38. LONG __stack = 9000;
  39.  
  40. // error IDs
  41. enum {ER_none, ER_GTL, ER_OS1, ER_GVI1,
  42.    ER_OS2, ER_GVI2, ER_ASBS,
  43.    ER_ASBC, ER_WIN1, ER_MATHTRANS,
  44.    ER_MATHFFP, ER_DBMP, ER_UPMP,
  45.    ER_WIN2, ER_APP, ER_MUIMAST, ER_CMSGPORT,
  46.    ER_CSTDIO, ER_OKBD, ER_ALLOCASL, ER_OPENASL,
  47.    ER_ASLBASE, ER_ALOCMBPTR,
  48.    ER_OPENMBWND, ER_BITMAP, ER_PLANEPTR,
  49.    ER_GRAPHICS, ER_INTUITION,
  50.    ER_ALLOCMEM};
  51.  
  52. // error string definitions
  53. const char *ERRORS[] =
  54.    {"None", "Open GadToolsLibrary", "Open Screen 1", "Get VisualInfo 1",
  55.    "Open Screen 2", "Get VisualInfo 2", "Allocate ScreenBuffer Screen",
  56.    "Allocate ScreenBuffer Copy", "Open window 1", "Open MathTrans.library v37",
  57.    "Open MathFFP.library v39", "Create dbuf MsgPort", "Create user MsgPort",
  58.    "Open Window 2", "Open app", "Open MUIMaster.library", "Create MsgPort", 
  59.    "Create StdIO", "Open keyboard.device", "Allocate ASL", "Open ASL",
  60.    "Open asl.library v39", "Allocate blank mouse pointer",
  61.    "Open blank mouse window", "Allocate BitMap", "Allocate PlanePTR",
  62.    "Open graphics.lirbrary v39", "Open intuition.library v39",
  63.    "Allocate memory"};
  64.  
  65. const char *SNDERRORS[] = {"No error", "Open sound file", 
  66.    "Read sound file", "Get audio channel", "Allocate memory"};
  67.  
  68. enum {PLAYER1, PLAYER2, PLAYER3, PLAYER4};
  69.  
  70. // predefine the screen sizes (they'll probably get changed later by the user)
  71. ULONG scrn_width_MAX    = 640;
  72. ULONG scrn_height_MAX   = 512;
  73. ULONG scrn_left, scrn_right, scrn_top, scrn_bottom;
  74.  
  75. // text descriptions of the Jet controls (with MUI text formatting commands)
  76. const char *controls[] = {
  77.    "\033cLeft: <\nFire: y\nRight: x",
  78.    "\033cLeft: b\nFire: n\nRight: m",
  79.    "\033cLeft: ö\nFire: ä\nRight: #",
  80.    "\033cLeft: 1\nFire: 2\nRight: 3",
  81.    NULL };
  82.  
  83. // for the MUI prefs window:
  84. //-------the pages
  85. const char *pages[] = {"1", "2", "3", "4", NULL};
  86. //-------the radio buttons for each player
  87. const char *radbutts[] = {"Compromise", "Speed",
  88.                            "Manueverability", NULL};
  89. //-------who is controlling the jet?...
  90. const char *control[] = {"Not in play", "Human", "Hector", NULL};
  91. //-------pointers to the various MUI objects that we watch
  92. APTR app, WI_setup, RG_main, RA_player[4], CY_player[4], BU_go;
  93. APTR TO_gameover, CH_speed, BU_quit, BU_save;
  94. APTR CH_vuln;
  95.  
  96. // MUI button and menu return IDs
  97. enum {ID_none, ID_gobutton, ID_save, ID_quit, ID_about, ID_screen};
  98.  
  99. // this is for the number in each Jet
  100. struct TextAttr topaz8 = {( STRPTR )"topaz.font", 8, 0x00, 0x01 };
  101. struct IntuiText PLT[] = {
  102.    {2, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"1", NULL },
  103.    {3, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"2", NULL },
  104.    {4, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"3", NULL },
  105.    {5, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"4", NULL }};
  106.  
  107. // speeds for each game setting.  The first number (in each array)
  108. // is for the "slow" setting (slidebar game_speed = 0), the second
  109. // for the fast setting.
  110. int game_speed = 0;                 // set by the slidebar
  111. BOOL vulnerability = FALSE;            // starting invuln. initializer
  112. const int slow[] = {2, 3};          // for a manueverable Jet
  113. const int medium[] = {3, 4};        // for a compromise Jet
  114. const int fast[] = {4, 6};          // for a speed Jet
  115. const int shotspeed[] = {8, 10};    // how fast the shot moves
  116.  
  117. // for the scores text in the prefs window
  118. char scores[125];
  119.  
  120. // this is where the keyboard status gets put by DoIO (for Jet control)
  121. UBYTE buff[16];
  122.