home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d115 / marketroid.lha / Marketroid / src / marketroid.h < prev    next >
C/C++ Source or Header  |  1987-11-22  |  3KB  |  96 lines

  1. /*  :ts=8 bk=0
  2.  *
  3.  * marketroid.h:    Data structure definitions for the program.
  4.  *
  5.  * Leo L. Schwab            8709.30        (415) 456-3960
  6.  */
  7. #ifndef GRAPHICS_GFX_H
  8. #include <graphics/gfx.h>
  9. #endif
  10.  
  11. #ifndef EXEC_LISTS_H
  12. #include <exec/lists.h>
  13. #endif
  14.  
  15.  
  16. /*
  17.  * The basic object description structures.  Yes, I could have used the
  18.  * animation/GEL software, but the code to utilize it would have been
  19.  * non-trivial.  [Oh.  And this *IS* trivial?]  Besides, the GEL routines
  20.  * would have made it impossible to perform certain special effects I need,
  21.  * whereas I can perform the necessary rape using BltBitMap() or ClipBlit().
  22.  */
  23. struct object {
  24.     struct BitMap    *bitmap;    /*  Pointer to bitmap with image  */
  25.     WORD        width, height;    /*  Size of figure within bitmap  */
  26.     WORD        nframes;    /*  # of frames for this figure   */
  27.     UBYTE        *animseq;    /*  Animation sequencing array      */
  28.     WORD        upx, upy,    /*  Offsets into the bitmap for   */
  29.             downx, downy,    /*   the frames of the figure      */
  30.             leftx, lefty,   /*   when it is walking in the      */
  31.             rightx, righty;    /*   specified direction.      */
  32.     WORD        incr;        /*  Suggested movement increment  */
  33.     WORD        framerate;    /*  # of video frames per "cel"      */
  34. };
  35.  
  36. struct obcontrol {
  37.     struct Node    node;        /*  For Enqueue()ing          */
  38.     struct object    *ob;        /*  Pointer to controlled object  */
  39.     UWORD        flags;        /*  Some help              */
  40.     WORD        xoff, yoff;    /*  Current offset into bitmap      */
  41.     WORD        x, y;        /*  Current On-screen position      */
  42.     WORD        dx, dy;        /*  Current X and Y increments      */
  43.     WORD        dir;        /*  Current direction          */
  44.     WORD        frame;        /*  Current frame number      */
  45.     WORD        delay;        /*  Countdown to next frame      */
  46. };
  47.  
  48. /*  Directions for obcontrol.dir  */
  49. #define    UP        0
  50. #define    DOWN        1
  51. #define    LEFT        2
  52. #define    RIGHT        3
  53.  
  54. /*  Definitions for obcontrol.flags  */
  55. #define    OFFSCREEN    1
  56. #define    FREEZE        (1<<1)
  57. #define    EXPLODING    (1<<2)
  58.  
  59.  
  60. /*
  61.  * Here is the color cycling command structure.
  62.  */
  63. struct cycle {
  64.     struct Node    node;
  65.     UWORD        type;        /*  Cycle type encoded here      */
  66.     UWORD        *colors;    /* Table to cycle through 1 entry */
  67.     WORD        ncolors;    /*  # of entries in above table   */
  68.     WORD        start, end;    /*  Start and end color entries   */
  69.     WORD        rate;        /*  # of VBLANKs for one cycle      */
  70.     WORD        count;        /*  Countdown to next rotation      */
  71. };
  72.  
  73. /*
  74.  * Structure used by the color cycling VBLANK routine
  75.  */
  76. struct interdat {
  77.     struct List    cycles;        /*  List of color cycles to do      */
  78.     void        *vp;        /*  Viewport to affect          */
  79.     WORD        stop;        /*  If non-zero, don't cycle      */
  80.     UWORD        *ctab;        /*  Master color table          */
  81.     UWORD        ncolors;    /*  # of entries in master table  */
  82. };
  83.  
  84. /*  Various kinds of cycling techniques  */
  85. #define    CYCLE_SIMPLE    0
  86. #define    CYCLE_THROUGH    1
  87. #define    CYCLE_RANDOM    2
  88.  
  89.  
  90. /*  Typecasting  */
  91. extern void    *OpenLibrary(), *OpenScreen(), *AllocMem(), *AllocRaster(),
  92.         *RemHead(), *CreatePort(), *CreateStdIO(), *CreateExtIO(),
  93.         *CreateTask(), *FindPort(), *GetMsg(), *OpenDiskFont(),
  94.         *OpenWindow();
  95. extern long    CheckIO(), OpenDevice(), TextLength(), SetSignal();
  96.