DXIsoMap.h
上传用户:pfmy85
上传日期:2007-01-07
资源大小:22k
文件大小:3k
- // DXIsoMap.h: interface for the CDXIsoMap class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_DXISOMAP_H__8CA0F312_2B07_11D3_9B58_0080C8E05391__INCLUDED_)
- #define AFX_DXISOMAP_H__8CA0F312_2B07_11D3_9B58_0080C8E05391__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "IsoType.h"
- class CDDDevice;
- class CDDSurface;
- class CPackFileManager;
- struct TILE
- {
- BYTE index;
- BYTE flag;
- };
- struct CELL
- {
- TILE base;
- TILE fringe;
- };
- class CDXIsoMap
- {
- public:
- CDXIsoMap();
- virtual ~CDXIsoMap();
- public:
- bool Create(CDDSurface* pTiles,
- int nCellColumns, int nCellRows, int nFill);
- bool Create(CDDSurface* pTiles,
- LPCTSTR lpszFileName,
- CPackFileManager* pPackFileManager = NULL);
- bool Save(LPCTSTR lpszFileName);
- protected:
- bool Create(CDDSurface* pTiles,
- int nCellColumns, int nCellRows,
- CELL* pMapData);
- public:
- void SetViewRect(LPRECT lprcView);
- void Draw(CDDSurface* pDestSurface, LPRECT lprcDest=NULL);
- void MoveTo(int nPosX, int nPosY);
- void ScrollX(int nOffset);
- void ScrollY(int nOffset);
- void Scroll(DIRECTION eDir);
- void AbsoluteCell(int nPixelX, int nPixelY,
- int &nCellX, int &nCellY, BOOL bAbsolutePixel = TRUE);
- void Cell2Pixel(int nCellX, int nCellY,
- int &nPixelX, int &nPixelY,
- BOOL bAbsolute=TRUE);
- CELL* GetCell(int nTx, int nTy);
- void NextCell(int &x, int &y, int nDirection);
- void DrawColAbove(CDDSurface *pDest, int nX, int nY);
- void DrawAbove(CDDSurface *pDest, int nX, int nY);
- protected:
- void BltTile(CDDSurface* pDestSurface,
- int nDestX, int nDestY, CELL* pCell);
- void BltTileAbove(CDDSurface* pDestSurface,
- int nDestX, int nDestY, CELL* pCell, int nHeight);
- protected:
- int m_nTotalWidth;
- int m_nTotalHeight;
- int* m_pPassValues;
- static const CHAR m_CellFigue[16][32];
- public:
- static const int m_nCellWidth; // Width of tile in pixel
- static const int m_nCellHeight; // Height of tile in pixel
- static const int m_nCellWidthShift; // Width shift of tile in pixel
- static const int m_nCellHeightShift; // Height shift of tile in pixel
- static const BYTE m_CellIdxFlg; // Hight tile index bit
- static const BYTE m_CellRmrFlg; // Remora
- static const BYTE m_CellNpcFlg; // Npc locate here
- static const BYTE m_CellLnkFlg; // Link to other world
- protected:
- int m_nPosTX; // Current absolute tile position of the screen's
- int m_nPosTY; // origin(top-left), in tile map
- int m_nPosX; // Current absolute pixel position of the screen's
- int m_nPosY; // origin(top-left) in map
- int m_nOffX; // Offset from top-left of the tile,
- int m_nOffY; // in witch screen's origin locate
- RECT m_rcDest; // Clip rect
- int m_nColumns; // Columns of map in tile
- int m_nRows; // Rows of map in tile
- int m_nSrcSurfaceCellRows; // Tile source surface's width in tile
- CELL* m_pMapData;
- bool m_bAutoDelete;
- CDDSurface* m_pTiles;
- };
- #endif // !defined(AFX_DXISOMAP_H__8CA0F312_2B07_11D3_9B58_0080C8E05391__INCLUDED_)