Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

  1. /*************************************************
  2. * sprite.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. // sprite.h : header file
  8. //
  9. // CSprite class
  10. //
  11. //
  12. class CSprite : public CDIB
  13. {
  14. DECLARE_SERIAL(CSprite)
  15. public:
  16. CSprite();
  17. ~CSprite();
  18. virtual int GetX() { return m_x;} // get x
  19. virtual int GetY() { return m_y;} // get y
  20. virtual int GetZ() { return m_z;} // get z order
  21. virtual void Serialize(CArchive& ar);
  22. virtual void Render(CDIB* pDIB, CRect* pClipRect = NULL);
  23. virtual void Coverage(CDIB* pDIB);
  24. virtual BOOL Load(CFile *fp); // load from file
  25. virtual BOOL Load(char *pszFileName = NULL);// load DIB from disk file
  26. virtual BOOL Load(CBitmap *pszFileName = NULL);// load DIB from disk file
  27. virtual BOOL MapColorsToPalette(CPalette *pPal);
  28. virtual void GetRect(CRect* pRect);
  29. virtual BOOL HitTest(CPoint point);
  30. virtual void SetPosition(int x,
  31. int y);
  32. virtual void SetZ(int z);
  33. virtual void SetNotificationObject(CSpriteNotifyObj* pNO)
  34. {m_pNotifyObj = pNO;}
  35. virtual void Disappear();
  36. protected:
  37. int m_x; // X Coordinate of top-left corner
  38. int m_y; // Y Coordinate of top-left corner
  39. int m_z; // Z order for sprite
  40. BYTE m_bTransIndex; // transparency index value
  41. CSpriteNotifyObj *m_pNotifyObj; // ptr to a notification object
  42. virtual void Initialize(); // set initial state
  43. };