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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: drawimagestate.c,v 1.5 1997/01/27 00:36:37 ldp Exp $
  4.     $Log: drawimagestate.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:02  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/alib.h>
  32.  
  33. /*****************************************************************************
  34.  
  35.     NAME */
  36. #include <graphics/rastport.h>
  37. #include <intuition/intuition.h>
  38. #include <intuition/imageclass.h>
  39. #include <proto/intuition.h>
  40.  
  41.     AROS_LH6(void, DrawImageState,
  42.  
  43. /*  SYNOPSIS */
  44.     AROS_LHA(struct RastPort *, rp,         A0),
  45.     AROS_LHA(struct Image    *, image,      A1),
  46.     AROS_LHA(LONG             , leftOffset, D0),
  47.     AROS_LHA(LONG             , topOffset,  D1),
  48.     AROS_LHA(ULONG            , state,      D2),
  49.     AROS_LHA(struct DrawInfo *, drawInfo,   A2),
  50.  
  51. /*  LOCATION */
  52.     struct IntuitionBase *, IntuitionBase, 103, Intuition)
  53.  
  54. /*  FUNCTION
  55.     This function renders an image in a certain state.
  56.  
  57.     INPUTS
  58.     rp - Render in this RastPort
  59.     image - Render this image
  60.     leftOffset, topOffset - Add this offset to the position stored in the
  61.         image.
  62.     state - Which state (see intuition/imageclass.h for possible
  63.         valued).
  64.     drawInfo - The DrawInfo from the screen.
  65.  
  66.     RESULT
  67.     None.
  68.  
  69.     NOTES
  70.     DrawImageState(), handles both boopsi and conventional images.
  71.  
  72.     EXAMPLE
  73.  
  74.     BUGS
  75.  
  76.     SEE ALSO
  77.  
  78.     INTERNALS
  79.  
  80.     HISTORY
  81.     29-10-95    digulla automatically created from
  82.                 intuition_lib.fd and clib/intuition_protos.h
  83.  
  84. *****************************************************************************/
  85. {
  86.     AROS_LIBFUNC_INIT
  87.     AROS_LIBBASE_EXT_DECL(struct IntuitionBase *,IntuitionBase)
  88.  
  89.     if (image != NULL)
  90.     {
  91.     if (image->Depth == CUSTOMIMAGEDEPTH)
  92.     {
  93.         DoMethod ((Object *)image
  94.         , IM_DRAW
  95.         , rp
  96.         , (WORD)leftOffset
  97.         , (WORD)topOffset
  98.         , state
  99.         , drawInfo
  100.         );
  101.     }
  102.     else
  103.     {
  104.         DrawImage (rp, image, leftOffset, topOffset);
  105.     }
  106.     }
  107.  
  108.     AROS_LIBFUNC_EXIT
  109. } /* DrawImageState */
  110.