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.

70 lines
1.9 KiB

  1. /*************************************************
  2. * splstno.cpp *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. // splstno.cpp : implementation file
  8. //
  9. #include "stdafx.h"
  10. #include "dib.h"
  11. #include "dibpal.h"
  12. #include "spriteno.h"
  13. #include "splstno.h"
  14. #include "sprite.h"
  15. #include "phsprite.h"
  16. #include "myblock.h"
  17. #include "spritlst.h"
  18. #include "osbview.h"
  19. #include "blockvw.h"
  20. #ifdef _DEBUG
  21. #undef THIS_FILE
  22. static char BASED_CODE THIS_FILE[] = __FILE__;
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CSpriteListNotifyObj
  26. CSpriteListNotifyObj::CSpriteListNotifyObj()
  27. {
  28. m_pSpriteList = NULL;
  29. m_pBlockView = NULL;
  30. }
  31. CSpriteListNotifyObj::~CSpriteListNotifyObj()
  32. {
  33. }
  34. // Notification callback from a CSprite object
  35. void CSpriteListNotifyObj::Change(CSprite *pSprite,
  36. CHANGETYPE change,
  37. CRect* pRect1,
  38. CRect* pRect2)
  39. {
  40. if (change & CSpriteNotifyObj::ZORDER)
  41. {
  42. // reposition the sprite in the z-order list
  43. ASSERT(m_pSpriteList);
  44. m_pSpriteList->Reorder(pSprite);
  45. // Add the sprite position to the dirty list
  46. ASSERT(m_pBlockView);
  47. m_pBlockView->AddDirtyRegion(pRect1);
  48. }
  49. if (change & CSpriteNotifyObj::IMAGE)
  50. {
  51. ASSERT(m_pBlockView);
  52. m_pBlockView->AddDirtyRegion(pRect1);
  53. }
  54. if (change & CSpriteNotifyObj::POSITION)
  55. {
  56. // pRect1 and pRect2 point to old and new rect positions
  57. // add these rects to the dirty list
  58. ASSERT(m_pBlockView);
  59. m_pBlockView->AddDirtyRegion(pRect1);
  60. m_pBlockView->AddDirtyRegion(pRect2);
  61. }
  62. }