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

📄 retroengine.h

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

#ifndef __RETROENGINE_H__
#define __RETROENGINE_H__

#include <w32std.h>
#include "GameTimerObserver.h"

class TKeyHandler;
class CImageFactory;
class CDoubleBufferedArea;
class CFbsBitmap;
class CGameTimer;

class CTilemap;
class MTileset;
class CShipAnim; 
class CFireAnim; 
class CRetroLeafTileset;
class CRetroNodeTileset;
class CParticleSystem;
class TVectorFP;

class CRetroEngine : public CBase, public MGameTimerObserver, public MDirectScreenAccess
    {
    public:

        static CRetroEngine* NewL(RWsSession& aClient, CWsScreenDevice& aScreenDevice, RWindow& aWindow,TKeyHandler& aKeyHandler, CImageFactory& aImageFactory, const TSize& aSize);
        static CRetroEngine* NewLC(RWsSession& aClient, CWsScreenDevice& aScreenDevice, RWindow& aWindow,TKeyHandler& aKeyHandler, CImageFactory& aImageFactory, const TSize& aSize);
        ~CRetroEngine();

		void StartGameL();
		void StartFirstGameL();
		void StopGame();


		// Are we in play
		inline TBool Playing(){return iPlaying;}

	private:
		TInt DoGameFrame();	
		void PauseFrame();

	private:
		// MDirectScreenAccess 
		void Restart(RDirectScreenAccess::TTerminationReasons aReason);
		void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);

		void SetupDirectScreenAccessL();
        
    private:
        CRetroEngine(RWsSession& aClient, CWsScreenDevice& aScreenDevice, RWindow& aWindow,TKeyHandler& aKeyHandler, CImageFactory& aImageFactory, const TSize& aSize);
        void ConstructL();

		void ConstructSimpleMapL();
		void ConstructCompoundMapL();
		void ConstructShipL();

		void Simulate();
		void UpdatePosition();
		void Render(const TRect& aRect,CFbsBitGc* aCallerGc) const;

    private:


		//Timer
		CGameTimer* iGameTimer;

		// Window server handling
		RWsSession& iClient;
		CWsScreenDevice& iScreenDevice;
		RWindow& iWindow;

		// Direct Screen Access
		CDirectScreenAccess* iDirectScreenAccess;
		CFbsBitGc* iGc;
		RRegion* iRegion;        
		
		// Offscreen area for double buffering
		CDoubleBufferedArea* iDoubleBufferedArea;
		CFbsBitGc* iOffscreenContext;
		
		//Game stuff
        TKeyHandler& iKeyHandler;
		CImageFactory& iImageFactory;
		
		TPoint iShipScreenPos;
		TPoint iShipScreenPosUp4;
		TPoint iShipWorldPos;
		TPoint iShipVelocity;

		CTilemap* iMap;
		CRetroLeafTileset* iLeafFactory;
		CRetroNodeTileset* iNodeFactory;
		TRect  iShipBounds;
		TPoint iMapWindowTopLeft;

		TInt iShipFrame;
		CShipAnim* iShipAnim;
		CFireAnim* iFireAnim;
		CParticleSystem* iEngineExhaust;
		TVectorFP* iShipVectors;

		TInt iThrust;
		TInt iGravity;
		TInt iDragRatio;
		TInt iDragDownshift;

		TSize iSize;

		TBool iDropRenderFrames;

		TBool iPlaying;
		TBool iPaused;
		TRect iGameDawingArea;
		TInt iFrameCounter;

    };
#endif

⌨️ 快捷键说明

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