Loading

Paste #pnevu0dgk

  1. /*!
  2.     Base class for a linked list of drawable objects.
  3.     Note that "object" is used as a generic term, not in specific reference to
  4.     game objects (though they are the most common thing in drawing lists).
  5. */
  6. struct THDrawable : public THLinkList
  7. {
  8.     //! Draw the object at a specific point on a render target
  9.     /*!
  10.         Can also "draw" the object to the speakers, i.e. play sounds.
  11.     */
  12.     void (*m_fnDraw)(THDrawable* pSelf, THRenderTarget* pCanvas, int iDestX, int iDestY);
  13.  
  14.     //! Perform a hit test against the object
  15.     /*!
  16.         Should return true if when the object is drawn at (iDestX, iDestY) on a canvas,
  17.         the point (iTestX, iTestY) is within / on the object.
  18.     */
  19.     bool (*m_fnHitTest)(THDrawable* pSelf, int iDestX, int iDestY, int iTestX, int iTestY);
  20.  
  21.     //! Drawing flags (zero or more list flags from #THDrawFlags).
  22.     uint32_t m_iFlags;
  23.  
  24.     /** Returns true if instance is a multiple frame animation.
  25.         Should be overloaded in derived class.
  26.     */
  27.     bool (*m_fnIsMultipleFrameAnimation)(THDrawable *pSelf);
  28. };

Comments