TileSelector.h
上传用户:pfmy85
上传日期:2007-01-07
资源大小:22k
文件大小:2k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // TileSelector.h: interface for the CTileSelector class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_TILESELECTOR_H__2C8B50C1_3A87_11D3_9B58_0080C8E05391__INCLUDED_)
  5. #define AFX_TILESELECTOR_H__2C8B50C1_3A87_11D3_9B58_0080C8E05391__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "DXMap.h"
  10. #include "DDDIBSurface.h"
  11. // Tile selector class.
  12. // this class is displayed at the top of the screen,
  13. // it only call scroll up and down, it also use
  14. // tiles in size of 32*16.
  15. class CTileSelector  
  16. {
  17. public:
  18. CTileSelector(); // default constructor
  19. virtual ~CTileSelector(); // default destructor
  20. // creation member function
  21. bool Create(CDDDevice *pDevice, // DirectDraw device
  22. CDDSurface* pTiles, // tile source
  23. int nTileWidthShift,
  24. int nTileHeightShift,
  25. LPRECT lpRect, // Display rectangle
  26. LPCTSTR lpName, // arrors bitmap file name
  27. CPackFileManager* pPackFileManager = NULL); // Packfile manager
  28. void Draw(CDDSurface* pSurface);
  29. bool ProcessMouse(int x, int y, // mouse position
  30. CDIMouseState::MOUSE_BUTTON_STATE eMouseState); // mouse button state
  31. void Up();
  32. void Down();
  33. //void PageUp();
  34. //void PageDown();
  35. int GetCurTile(){return m_nCurTile;};
  36. protected:
  37. CDDSurface* m_pTiles; // 
  38. int m_nTileWidthShift;
  39. int m_nTileHeightShift;
  40. int m_nTileWidth;
  41. int m_nTileHeight;
  42. int m_nTotalHeight; // =m_nTileCnt*16
  43. int m_nTileCnt; // Tiles sumary
  44. int m_nSrcSurfaceCellRows;
  45. CDDDIBSurface* m_pArrows; // Arrors surface
  46. int m_nArrowWidth;
  47. int m_nArrowHeight;
  48. CRect m_rect; // rectangle to display the whole selector
  49. CRect m_rcTiles; // rectangle to display tiles
  50. BOOL m_bTop; // is at top most position
  51. BOOL m_bBottom; // is at bottom most position
  52. int m_nCurPos;
  53. int m_nCurTile;
  54. };
  55. #endif // !defined(AFX_TILESELECTOR_H__2C8B50C1_3A87_11D3_9B58_0080C8E05391__INCLUDED_)