home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / gfx / misc / getilbm / getilbm_proto.h < prev    next >
C/C++ Source or Header  |  1994-11-11  |  3KB  |  81 lines

  1. //===========================================================================
  2. // GETILBM_PROTO.H -- by Alex Matulich  matulich_alex@SEAA.NAVSEA.NAVY.MIL
  3. //
  4. // Prototypes for user-callable functions in getilbm.c.
  5. // Include this file in all external modules needing the ILBM routines.
  6. //
  7. // For SAS C/C++ 6.xx.  Compile with IGNORE=51 to disable warnings for
  8. // C++ comments (I got addicted to those C++ comments...)
  9. //
  10. // See the comments in getilbm.c for information on enabling or disabling
  11. // certain features.
  12. //===========================================================================
  13.  
  14. #ifndef GRAPHICS_GFX_H
  15. #include <graphics/gfx.h>  // for struct BitMap definition
  16. #endif
  17. #ifndef EXEC_PORTS_H
  18. #include <exec/ports.h>    // for struct MsgPort definition
  19. #endif
  20.  
  21. // The following error code is set in loadilbmScreen() and loadilbmBitMap().
  22. // The possible values used in AmigaDOS release 2.0 are:
  23.  
  24. // OSERR_NOMONITOR    (1) named monitor spec not available
  25. // OSERR_NOCHIPS      (2) you need newer custom chips
  26. // OSERR_NOMEM        (3) couldn't get normal memory
  27. // OSERR_NOCHIPMEM    (4) couldn't get chip memory
  28. // OSERR_PUBNOTUNIQUE (5) public screen name already used
  29. // OSERR_UNKNOWNMODE  (6) don't recognize mode asked for
  30.  
  31. extern long li_errcode;  // for your use; defined in getilbm.c
  32.  
  33. typedef struct { ULONG r, g, b; } Color32;
  34.  
  35. //---------------------------------------------------------------------------
  36.  
  37. // FUNCTIONS FOR LOADING AN IFF ILBM FILE INTO A SCREEN
  38. //
  39. // loadilbmScreen() is passed the IFF file name, and it attempts to create
  40. // a screen to fit the IFF file contents, loads the screen, and returns a
  41. // pointer to it.  The screen will be HIDDEN.  You must call ScreenToFront()
  42. // to make it visible.
  43. //
  44. // freeilbmScreen() deallocates a screen created by loadilbmScreen().
  45. // The MsgPort parameter is normally passed as NULL, or as the original
  46. // UserPort when loadilbmScreen() created the screen.
  47.  
  48. struct Screen *loadilbmScreen(char *filename);
  49. void freeilbmScreen(struct Screen *, struct MsgPort *);
  50.  
  51. //---------------------------------------------------------------------------
  52.  
  53. // FUNCTIONS FOR LOADING AN IFF ILBM FILE INTO A BITMAP
  54. //
  55. // loadilbmBitMap() is passed the IFF file name, and pointers to three
  56. // unsigned short integers.  The function creates a BitMap to hold the IFF
  57. // file contents.  The 3 integers will be set to the dimensions of the
  58. // BitMap, and a pointer to the BitMap is returned.
  59. //
  60. // freeBitmap() frees any BitMap.
  61. // USE_FREEBM must be defined for it to exist.
  62.  
  63. struct BitMap
  64.    *loadilbmBitMap(char *filename, USHORT *wide, USHORT *high, USHORT *deep);
  65. void freeBitMap(struct BitMap *);
  66.  
  67. //---------------------------------------------------------------------------
  68.  
  69. // The following function is useful too.  It allocates a BitMap of any size.
  70. // USE_GETBM must be #defined or getBitMap() won't exist.
  71.  
  72. struct BitMap *getBitMap(int wide, int high, int deep, short clear);
  73.  
  74. // The next function is user-supplied.  It gets called at various times
  75. // during the ILBM loading process.  It is intended to let your program
  76. // take care of time-critical things during a long load.
  77. // #define TIMECHECK if you need it, or just make check_for_switch() an
  78. // empty void function.
  79.  
  80. void check_for_switch(void);
  81.