📄 hfloorcontainer.h
字号:
/*
* ============================================================================
* Name : CHFloorContainer from HFloorContainer.h
* Part of : HFloor
* Created : 2003-7-5 by 土匪般的脸
* Description:
* Declares container control for application.
* Version :
* Copyright:
* ============================================================================
*/
#ifndef HFLOORCONTAINER_H
#define HFLOORCONTAINER_H
// INCLUDES
#include <coecntrl.h>
#include <fbs.h>
#include <MdaAudioSamplePlayer.h>
#define BACKWIDTH 176
#define BACKHEIGHT 208
#define FLOORCNT 10
#define FLOOROFFPOSY 30
enum TGameStatus
{
APPLOGO,
GAMELOG,
GAMESTART,
GAMEOVER,
GAMEABOUT,
GAMEHELP
};
// FORWARD DECLARATIONS
class CFbsBitmap;
// CLASS DECLARATION
/**
* CHFloorContainer container control class.
*
*/
class CHFloorContainer : public CCoeControl, MCoeControlObserver, MMdaAudioPlayerCallback
{
public: // Constructors and destructor
/**
* EPOC default constructor.
* @param aRect Frame rectangle for container.
*/
void ConstructL(const TRect& aRect);
/**
* Destructor.
*/
~CHFloorContainer();
public: // New functions
TGameStatus GameStatus;
TInt MenuStatus;
TInt playercanmove, playerdir;
public: // Functions from base classes
void DrawDemo();
void DrawHelp();
void DrawAbout();
void MapcPlayComplete(TInt aError);
void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/);
void DrawLogo();
void DrawHitCnt();
void LoadScore();
void SaveScore();
void DrawTop();
void DrawGameOver();
TInt ChkGameOver();
void DrawScore();
void GameStart();
void DrawHP();
TInt ChkHit();
void PlayerMove(TInt playerdir);
void DrawPlayer();
TInt ConvertGB(TDes8& sString, TDes16& sRet) const;
void StartTimer();
private: // Functions from base classes
/**
* From CoeControl,SizeChanged.
*/
void SizeChanged();
/**
* From CoeControl,CountComponentControls.
*/
TInt CountComponentControls() const;
/**
* From CCoeControl,ComponentControl.
*/
//CCoeControl* ComponentControl(TInt aIndex) const;
/**
* From CCoeControl,Draw.
*/
void Draw(const TRect& aRect) const;
/**
* From ?base_class ?member_description
*/
// event handling section
// e.g Listbox events
void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
private: //data
void DrawFloor();
void DrawWall();
void DrawLog();
void DrawTitle();
void DrawMap();
void DrawFps();
void DrawBoarder();
void DoPeriodTask();
static TInt Period(TAny * aPtr);
CFbsBitmap * imgBackgroud;
CFbsBitmap* imgTitle;
CFbsBitmap* imgTitleMask;
CFbsBitmap* imgWall;
CFbsBitmap* imgBoarder;
CFbsBitmap* imgFloor;
CFbsBitmap* imgFloor2;
CFbsBitmap* imgFloor3;
CFbsBitmap* imgFloor4;
CFbsBitmap* imgFloor5;
CFbsBitmap* imgFloor6;
CFbsBitmap* imgFloor7;
CFbsBitmap* imgFloor8;
CFbsBitmap* imgFloor9;
CFbsBitmap* imgFloor10;
CFbsBitmap* imgFloor11;
CFbsBitmap* imgFloor12;
CFbsBitmap* imgHeart;
CFbsBitmap* imgLogo;
CFbsBitmap* imgTop;
CFbsBitmap* imgTopMask;
CFbsBitmap* imgPlayer[13];
CFbsBitmap* imgPlayerRed;
CFbsBitmap* imgPlayerMask[13];
CPeriodic * iPeriodicTimer;
TInt mapposx, mapposy, wallposy;
TInt bRunStatus;
TBuf16<16> menus, menuh, menua, menuq;
void UpdateDisplay();
TPoint arrfloor[FLOORCNT + 1];
TInt bfloorstatus[FLOORCNT + 1];
TInt bfloortype[FLOORCNT + 1];
TInt playerStatus, playerPosX, playerPosY;
TInt HP;
TInt HighScore, CurScore;
TInt NextFloor;
TInt FlashUserState;
TInt bJump, bJumpStatus;
TInt iCurFloorID;
TInt bfloordown;
TInt bfloorscroll[FLOORCNT + 1];
TInt iScoreStep;
TInt HitCnt;
TInt logoDelay;
TBuf<128> iMbmFileName;
TBuf<128> iSaveFileName;
TBuf<128> iHitWavFileName;
TBuf<128> iFallWavFileName;
TBuf<128> iBHitWavFileName;
TInt iIsOverTime;
CMdaAudioPlayerUtility* iMAPHit;
CMdaAudioPlayerUtility* iMAPBHit;
CMdaAudioPlayerUtility* iMAPFall;
/** off screen bitmap */
CFbsBitmap* iOffScreenBitmap;
/** off screen bitmap device */
CFbsBitmapDevice* iOffScreenBitmapDevice;
/** off screen bitmap gc */
CFbsBitGc* iOffScreenBitmapGc;
/** off player bitmap */
CFbsBitmap* iOffPlayerBitmap;
/** off player bitmap device */
CFbsBitmapDevice* iOffPlayerBitmapDevice;
/** off player bitmap gc */
CFbsBitGc* iOffPlayerBitmapGc;
};
#endif
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -