home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d536 / chemesthetics.lha / Chemesthetics / Source / Source.LZH / logo.c < prev    next >
C/C++ Source or Header  |  1991-04-28  |  1KB  |  50 lines

  1. #include <intuition/intuitionbase.h>
  2. #include <exec/memory.h>
  3. #include <string.h>
  4. #ifdef LATTICE
  5. #include <proto/exec.h>
  6. #include <proto/intuition.h>
  7. #endif
  8. #include "logo.h"
  9. #include "messages.h"
  10. extern struct Window *Window1;
  11.  
  12. static struct Image LogoImage =
  13. {
  14.   0, 0, logo_iff_width, logo_iff_height, logo_iff_num_planes,
  15.   (USHORT *)logo_iff_data, 0xF, 0, NULL
  16. };
  17.  
  18. static USHORT *LogoBuffer=NULL;
  19.  
  20. extern long conwin;
  21. extern void WrConWin(long,char*);
  22.  
  23. void PrepareLogo(void)
  24. {
  25.   if(TypeOfMem(logo_iff_data) & MEMF_FAST)
  26.   {
  27.     LogoBuffer=(USHORT *)AllocMem(sizeof(logo_iff_data),
  28.                   MEMF_CHIP|MEMF_PUBLIC);
  29.     if(LogoBuffer==NULL)
  30.       WrConWin(conwin,NO_LOGO_MEM);
  31.     else
  32.     {
  33.       movmem(logo_iff_data,LogoBuffer,sizeof(logo_iff_data));
  34.       LogoImage.ImageData=LogoBuffer;
  35.     }
  36.   }
  37. }
  38.  
  39. void      Logo(void)
  40. {
  41.   DrawImage(Window1->RPort, &LogoImage, Window1->Width - logo_iff_width - 10,
  42.         Window1->Height - logo_iff_height - 2);
  43. }
  44.  
  45. void FreeLogo(void)
  46. {
  47.   if(LogoBuffer)
  48.     FreeMem(LogoBuffer,sizeof(logo_iff_data));
  49. }
  50.