home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / intuition / eraseimage.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  2.2 KB  |  101 lines

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