home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff256.lzh / BlitDemons / bdemon.h < prev    next >
C/C++ Source or Header  |  1989-10-19  |  4KB  |  149 lines

  1. /*******************************************************************************
  2.  *   BlitDemons  by Walt Strickler
  3.  *   This program and all its source code are in the public domain and are
  4.  * freely distributable and usable for any purpose, private or commercial.
  5.  ******************************************************************************/
  6.  
  7.  
  8. #include <stdio.h>
  9. #include <assert.h>
  10. #include <intuition/intuition.h>
  11. #include <intuition/screens.h>
  12. #include <libraries/dos.h>
  13. /* #include <exec/types.h> */           /* INCLUDED by intuition.h */
  14. /* #include <exec/nodes.h> */           /* INCLUDED by intuition.h */
  15. /* #include <graphics/gfx.h> */         /* INCLUDED by intuition.h */  
  16. /* #include <graphics/rastport.h> */    /* INCLUDED by intuition.h */
  17. #include <proto/intuition.h>
  18. #include <proto/exec.h>
  19. #include <proto/graphics.h>
  20. #include <proto/dos.h>
  21.  
  22. #define NUM_PLANES 4
  23. #define NUM_COLORS 16
  24.  
  25. struct BDMainStruct
  26.     {
  27.     WORD *Display[NUM_PLANES],  /* Pointers to first usable line of display */
  28.          *Incr[NUM_PLANES],  /* Pointers to incremented bitplanes */
  29.           *Equal,    /* Pointer to 'Equal' bitplane */
  30.           *Temp;   /* Pointer to 'Temp' bitplane */
  31.     struct DoBlitNode *BDBlitNodes;
  32.     int    XSize,  /* Width of area to be blitted in pixels */
  33.            YSize,  /* Height of area to be blitted lines z*/
  34.            Mod,  /* Difference between size of screen and that of window */
  35.            LRBorder;  /* Max(BorderLeft, BorderRight) */
  36.            /*   Note: Top and bottom borders are taken into account in
  37.             * Display and YSize. 
  38.             */
  39.     };
  40.  
  41.  
  42. /*    This is the pseudo-bltnode passed to DoBlit().  Note that it does not 
  43.  *  contain a struct bltnode.  It contains only the information necessary
  44.  *  for one blit.
  45.  */
  46. struct DoBlitNode
  47.     {
  48.     WORD con0,
  49.          con1,    
  50.          afwm,    
  51.          alwm,
  52.          *csource, *bsource, *asource, *dsource,
  53.          bltsize,
  54.          cmod, bmod, amod, dmod;
  55.     };
  56.  
  57.  
  58. /* Function return #defines */
  59. /* InitIntui() */
  60. #define INTUI_OK  0
  61. #define NO_INTUI  1
  62. #define NO_GFX    2
  63. #define NO_SCREEN 3
  64. #define NO_WIN    4
  65.  
  66. /* InitPlanes()   Non-OK return mut. excl with InitIntui() */
  67. #define PLANES_OK    0
  68. #define PLANES_CHOKE 5   
  69.  
  70. /* MainLoop()     Non-OK return mut. excl with InitIntui() and InitPlanes() */
  71. #define ML_OK          0
  72. #define ABOUT_CHOKE    6
  73.  
  74. /* main() */
  75. #define INIT_BLIT_CHOKE 7
  76. #define WBI_CHOKE       8
  77.     
  78. /* Randomize */
  79. #define RAND_OK          0
  80. #define RAND_QUIT        1
  81. #define RAND_ABOUT_CHOKE 2
  82.  
  83. /* DisplayAbout() */
  84. #define DA_OK    0
  85. #define DA_CHOKE 1
  86.  
  87. /* CheckMsg() */
  88. #define NO_MSG    0
  89. #define NEW       1
  90. #define QUIT      2
  91. #define CLOSE_WIN 3
  92. #define STOP      4
  93. #define START     5
  94. #define ABOUT     6
  95.  
  96. /* DoMenus() */
  97. #define NO_MENU  0
  98. /* See CheckMsg() for other DoMenus() defines */
  99.  
  100. /* Defines for function arguments */
  101. /* CheckMsg() */
  102. #define WAIT    0
  103. #define NO_WAIT 1
  104.  
  105. /* BlitCompare */
  106. #define UP_NEIGHBOR    0
  107. #define LEFT_NEIGHBOR  1
  108. #define RIGHT_NEIGHBOR 2
  109. #define DOWN_NEIGHBOR  3
  110. #define TO_EQUAL       0
  111. #define TO_TEMP        1
  112.  
  113.  
  114. /*******************************************************************************
  115.  *  Some useful external items
  116.  ******************************************************************************/
  117. extern struct Window *BDWindow;
  118. extern struct Screen *BDScreen;
  119.  
  120.  
  121. /*******************************************************************************
  122.  *  Prototypes for my functions
  123.  ******************************************************************************/
  124. /* BDemon.c */
  125. int MainLoop(struct BDMainStruct *);
  126. int DisplayAbout();
  127. struct window *DisplayOne(struct NewWindow *, struct IntuiText *);
  128. int Randomize(struct BDMainStruct *, struct Window *);
  129. int InitPlanes(struct BDMainStruct *, struct Window *);
  130. void KillPlanes(struct BDMainStruct *);
  131. void ErrorMsgs(int);
  132.  
  133. /* BDIntui.c */
  134. int InitIntui();
  135. void SetPalette();
  136. int CheckMsg(int);
  137. int DoMenus(struct IntuiMessage *);
  138. void ClearScreen();
  139. void OnStart();
  140. void OffStart();
  141. void OnStop();
  142. void OffStop();
  143. void SetBDMenu();
  144. void ClearBDMenu();
  145.  
  146. /* BDBlit.c */
  147. void OneGen(struct BDMainStruct *);
  148. struct DoBlitNode *InitBlits(struct BDMainStruct *);
  149.