MirGameMap.h
上传用户:marco7834
上传日期:2010-02-24
资源大小:82k
文件大小:2k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. // MirGameMap.h: interface for the CMirGameMap class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_MIRGAMEMAP_H__B9FBC32F_6149_4584_9845_4E26E7E71DE9__INCLUDED_)
  5. #define AFX_MIRGAMEMAP_H__B9FBC32F_6149_4584_9845_4E26E7E71DE9__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. enum __MAPOBJECT
  10. {
  11. MOBJ_PLAYER,
  12. MOBJ_NPC,
  13. MOBJ_MONSTER,
  14. MOBJ_ATTACKER,
  15. MOBJ_TARGET,
  16. MOBJ_GROUP,
  17. MOBJ_GUILD,
  18. MOBJ_TEACHER,
  19. MOBJ_STUDENT,
  20. MOBJ_HUSBAND,
  21. MOBJ_WIFE,
  22. MOBJ_UNREACH,
  23. MOBJ_CANREACH,
  24. MOBJ_TELEPORT,
  25. };
  26. typedef struct
  27. {
  28. short tile;
  29. short smtile;
  30. short object;
  31. char flag;
  32. char offset;
  33. char framecount;
  34. char delaytime;
  35. char objgroup;
  36. char unused;
  37. }MIRMAPBLOCK;
  38. typedef struct
  39. {
  40. WORD width;
  41. WORD height;
  42. char t[48];
  43. }MIRMAPHEADER;
  44. typedef struct
  45. {
  46. HBRUSH hbr;
  47. DWORD dwColor;
  48. }MAPDRAWCOLOR;
  49. class CMirGameMap  
  50. {
  51. public:
  52. BOOL TestMap( int x, int y );
  53. BOOL TestMapTo( int x, int y, int dir );
  54. void SetPersonInfo( DWORD x, DWORD y, DWORD dir );
  55. BOOL SetGameMap( char * mapname, DWORD x, DWORD y );
  56. void Draw( HDC dc, int dx, int dy);
  57. CMirGameMap();
  58. virtual ~CMirGameMap();
  59. private:
  60. MIRMAPBLOCK* Loadmap( char * map );
  61. MIRMAPHEADER m_Header;
  62. MIRMAPBLOCK * m_pData;
  63. DWORD m_xpos;
  64. DWORD m_ypos;
  65. DWORD m_dir;
  66. int m_DrawWidth;
  67. int m_DrawHeight;
  68. int m_DrawMapWidth;
  69. int m_DrawMapHeight;
  70. MAPDRAWCOLOR m_DrawColor[MOBJ_TELEPORT + 1];
  71. };
  72. #endif // !defined(AFX_MIRGAMEMAP_H__B9FBC32F_6149_4584_9845_4E26E7E71DE9__INCLUDED_)