📄 spritehandler.h
字号:
/*
========================================================================
Name : SpriteManager.h
Author :
Copyright :
Description : Handles the sprite images (bitmaps) for the ingame graphics.
========================================================================
*/
#ifndef MOPOIDSPRITEHANDLER_H#define MOPOIDSPRITEHANDLER_H#include <e32std.h>#include "MopoidSharedData.h"
#include "CommonFunctions.h"
#include <akniconutils.h>
#include <MopoidGraphics.mbg>
/**
* Stores the sprite bitmaps and handles their references.
*/class CSpriteHandler : public CBase
{public: static CSpriteHandler* NewL(RFs& aFs);
/**
* Loads all sprites (hardcoded into this function).
*/ void ConstructL(RFs& aFs); CSpriteHandler(); ~CSpriteHandler();
/**
* Returns a reference to the specified sprite bitmap.
*/ inline CFbsBitmap* GetSprite(MopoidShared::TSpriteIds aSpriteId);
/**
* Set the size of a sprite to the specified pixel-size.
* If the size of the panel / the ball is set, the according
* mask is also scaled. When setting the size of the normal brick
* type, all the other bricks are scaled to the same size as well.
*
* @param aSpriteId id of the sprite to scale
* @param aNewSize new size in pixels that should be applied to the image.
*/
void SetSpriteSize(const MopoidShared::TSpriteIds aSpriteId, const TSize& aNewSize);
private:
/**
* Actually executes the API call to set the sprite size,
* with an additional check if the sprite exists.
* Called by SetSpriteSize().
*
* @param aSpriteId id of the sprite to scale
* @param aNewSize new size in pixels that should be applied to the image.
*/
void DoSetSpriteSize(const MopoidShared::TSpriteIds aSpriteId,
const TSize& aNewSize);
private:
/**
* Stores all sprite bitmaps.
*/ TFixedArray<CFbsBitmap*, MopoidShared::ENumSprites> iSprites;};inline CFbsBitmap* CSpriteHandler::GetSprite(MopoidShared::TSpriteIds aSpriteId){ return iSprites[aSpriteId];}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -