home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / intuition / eraseimage.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  2.4 KB  |  107 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: eraseimage.c,v 1.5 1997/01/27 00:36:37 ldp Exp $
  4.     $Log: eraseimage.c,v $
  5.     Revision 1.5  1997/01/27 00:36:37  ldp
  6.     Polish
  7.  
  8.     Revision 1.4  1996/12/10 14:00:03  aros
  9.     Moved #include into first column to allow makedepend to see it.
  10.  
  11.     Revision 1.3  1996/11/08 11:28:01  aros
  12.     All OS function use now Amiga types
  13.  
  14.     Moved intuition-driver protos to intuition_intern.h
  15.  
  16.     Revision 1.2  1996/10/24 15:51:19  aros
  17.     Use the official AROS macros over the __AROS versions.
  18.  
  19.     Revision 1.1  1996/10/23 15:33:51  aros
  20.     Three new functions: DrawImageState(), EraseImage() and PointInImage()
  21.     by C. Aldi.
  22.  
  23.     First version of IMAGECLASS by C. Aldi
  24.  
  25.  
  26.     Desc:
  27.     Lang: english
  28. */
  29. #include "intuition_intern.h"
  30. #include <intuition/classusr.h>
  31. #include <proto/graphics.h>
  32. #include <proto/alib.h>
  33.  
  34. /*****************************************************************************
  35.  
  36.     NAME */
  37. #include <graphics/rastport.h>
  38. #include <intuition/intuition.h>
  39. #include <intuition/imageclass.h>
  40. #include <proto/intuition.h>
  41.  
  42.     AROS_LH4(void, EraseImage,
  43.  
  44. /*  SYNOPSIS */
  45.     AROS_LHA(struct RastPort *, rp, A0),
  46.     AROS_LHA(struct Image    *, image, A1),
  47.     AROS_LHA(LONG             , leftOffset, D0),
  48.     AROS_LHA(LONG             , topOffset, D1),
  49.  
  50. /*  LOCATION */
  51.     struct IntuitionBase *, IntuitionBase, 105, Intuition)
  52.  
  53. /*  FUNCTION
  54.     Erase an image on the screen.
  55.  
  56.     INPUTS
  57.     rp - Render in this RastPort
  58.     image - Erase this image
  59.     leftOffset, topOffset - Add this offset the the position in the
  60.         image.
  61.  
  62.     RESULT
  63.     None.
  64.  
  65.     NOTES
  66.  
  67.     EXAMPLE
  68.  
  69.     BUGS
  70.  
  71.     SEE ALSO
  72.     DrawImage(), DrawImageState()
  73.  
  74.     INTERNALS
  75.  
  76.     HISTORY
  77.     29-10-95    digulla automatically created from
  78.                 intuition_lib.fd and clib/intuition_protos.h
  79.     23-10.96    aldi    commited the code
  80.  
  81. *****************************************************************************/
  82. {
  83.     AROS_LIBFUNC_INIT
  84.     AROS_LIBBASE_EXT_DECL(struct IntuitionBase *,IntuitionBase)
  85.  
  86.     if (image != NULL)
  87.     {
  88.     if (image->Depth == CUSTOMIMAGEDEPTH)
  89.     {
  90.         DoMethod ((Object *)image,
  91.             IM_ERASE, rp, (WORD)leftOffset, (WORD)topOffset
  92.         );
  93.     }
  94.     else
  95.     {
  96.         EraseRect (rp,
  97.         leftOffset + image->LeftEdge,
  98.         topOffset  + image->TopEdge,
  99.         leftOffset + image->LeftEdge + image->Width,
  100.         topOffset  + image->TopEdge  + image->Height
  101.         );
  102.     }
  103.     }
  104.  
  105.     AROS_LIBFUNC_EXIT
  106. } /* EraseImage */
  107.