⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tilemap.h

📁 关于symbian OS S60 2.X平台
💻 H
字号:
////////////////////////////////////////////////////////////////////////
//
// Tilemap.h
//
// Copyright (c) 2003 Nokia Mobile Phones Ltd.  All rights reserved.
//
////////////////////////////////////////////////////////////////////////

#ifndef __TILEMAP_H
#define __TILEMAP_H

#include "RenderableFactory.h"

////////////////////////////////////////////////////////////////////////

class CTileset;

////////////////////////////////////////////////////////////////////////

class CTilemap : public CRenderable
	{
public:
	static CTilemap* NewL(TInt aTilesWide,TInt aTilesHigh,const TInt* aMapData,CTileset& aTileset);
	~CTilemap();
    void ConstructL(TInt aTilesWide,TInt aTilesHigh,const TInt* aMapData,CTileset& aTileset);

public:   
	void Render(const TPoint& aOrigin,const TRect& aScreenRect,CFbsBitGc* aCallerGc) const;		

private:
	TInt GetTileIndex(TInt aX,TInt aY) const;

	void AllocTilesL(TInt aTilesWide, TInt aTilesHigh);
	void FreeTiles();

	TPoint PixelToTile(const TPoint& aScreenCoord) const;
	TPoint TileToPixel(const TPoint& aScreenCoord) const;

private:
	TInt iTileLogWidth;
	TInt iTileLogHeight;
	TSize iTileSize;

	TSize iSizeInTiles;

	TInt iTilePosIdx;

	MRenderable** iTiles;
	};

////////////////////////////////////////////////////////////////////////

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -