📄 cmap.h
字号:
// Copyright 2002 Kenneth Guy,
//
// CMap.h
#ifndef _CMAP_H_
#define _CMAP_H_
/** \file CMap.h
defines class CMap */
#include <e32std.h>
#include <e32base.h>
class CGame;
/** Offscreen map.
This class handles the offscreen map a visible area of which is copied
to screen memory for each frame of the game. The area overlaps
the visible area so that we can scroll by moving the visible area
across the offscreen area. Drawing to this map should wrap at the
end of the memory area and start again at the beginning. The current
top left is defined by the point at which the copy to the screen
till take place which is returned by BlitStart()
The class processes map data to draw the background sprites adding
bad guys. See enum #TMapLineType for more information.
*/
class CMap : public CBase {
public:
static CMap* NewL(CGame &aGame,const TUint16* aMapSprites,
const TInt16* aMapData);
~CMap();
void ScrollMap();
void BlitAsm();
TUint16 *BlitStart();
TUint16 *DrawEnd();
TBool Finished();
private:
CMap(CGame &aGame,const TUint16* aMapSprites,const TInt16* aMapData);
void ConstructL();
void ProcessMapLine();
void PlotMapLineAsm();
private:
// these can't be reordered unless you change plotmap.s and blit.s
// note there is a vtable pointer before these.
const TInt16* iMapData; /**< Map data.
Must be the 1st member after the vtable pointer
for assembler functions. */
TUint16* iMapDrawPoint; /**< Places to draw next set of background sprites.
Must be the 2nd member after the vtable pointer
for assembler functions. */
TUint16* iDrawArea; /**< offscreen memory area.
Must be the 3rd member after the vtable pointer
for assembler functions. */
TUint16* iDrawEnd; /**< End of offscreen memory area.
Must be the 4th member after the vtable pointer
for assembler functions. */
TUint16* iScreenBase; /**< Base address of screen memory.
Must be the 5th member after the vtable pointer
for assembler functions. */
TUint16* iBlitStart; /**< Point to start copy to screen from
Must be the 6th member after the vtable pointer
for assembler functions. */
const TUint16* iMapSprites; /**< Background sprites
Must be the 7th member after the vtable pointer
for assembler functions. */
TInt iBlitPoint; /**< How far we have scrolled throw current line of sprites.
ie when we need to plot a new line of sprites.*/
CGame& iGame; ///< Game object for adding bad guys.
TBool iFinished; ///< Have we got to the end of the map.
TUint16* iOffScreenMap; /**< Offscreen memory area. */
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -