亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? particlesystem.cpp

?? symbian系統上的2D圖形游戲
?? CPP
字號:
////////////////////////////////////////////////////////////////////////
//
// ParticleSystem.cpp
//
// Copyright (c) 2003 Nokia Mobile Phones Ltd.  All rights reserved.
//
////////////////////////////////////////////////////////////////////////

#include <e32math.h>
#include "RenderableFactory.h"
#include "BaseAnim.h"
#include "ParticleSystem.h"

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

TVectorFP::TVectorFP()
	{
	iX = 0;
	iY = 0;
	}

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

TVectorFP::TVectorFP(const TPoint& aPoint)
	{
	iX = aPoint.iX;
	iY = aPoint.iY;
	}

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

TPoint TVectorFP::ScaleToPoint(TInt aFactor) const
	{
	TPoint result;

	result.iX = ( iX * aFactor ) >> 8;
	result.iY = ( iY * aFactor ) >> 8;

	return result;
	}

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

TParticle::TParticle()
	{
	Reset();
	}

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

void TParticle::Reset()
	{
	iVirtualFrameNum = -1;
	}

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

void TParticle::Start(TInt aVirtualFrameNum,TInt aDeltaVFN,TInt aMaxVFN,TPoint aPosition,TPoint aVelocity,TInt aDragRatio)
	{
	iVirtualFrameNum = aVirtualFrameNum;
	iDeltaVFN 		 = aDeltaVFN;        
	iMaxVFN 		 = aMaxVFN;          
	iPosition 		 = aPosition;        
	iVelocity 		 = aVelocity;        
	iDragRatio 		 = aDragRatio;
	}

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

void TParticle::Simulate()
	{
	if ( !IsActive() )
		{
		return;
		}
	else
		{
		iVirtualFrameNum += iDeltaVFN;

		// Have we finished yet?
		if (iVirtualFrameNum >= iMaxVFN)
			{
			// Yes, so switch off:
			Reset();
			}

		iPosition += iVelocity;
		iVelocity.iX = ( iVelocity.iX * iDragRatio ) >> dragRatioDownshift;
		iVelocity.iY = ( iVelocity.iY * iDragRatio ) >> dragRatioDownshift;
		}
	}

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

TBool TParticle::IsActive() const
	{
	return iVirtualFrameNum >= 0;
	}

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

void TParticle::Render(CBaseAnim& aAnim, const TPoint& aOrigin,const TRect& aScreenRect,CFbsBitGc* aCallerGc) const
	{
	if ( IsActive() )
		{
		TInt screenX = ( iPosition.iX >> 4 ) - aOrigin.iX;
		TInt screenY = ( iPosition.iY >> 4 ) - aOrigin.iY;

		TPoint screenPos( screenX, screenY );

		aAnim.RenderFrameCentered(iVirtualFrameNum >> 8,screenPos,aScreenRect,aCallerGc);
		}
	}

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

CParticleSystem::CParticleSystem(CBaseAnim& aAnim) :
iAnim(aAnim)
	{
	// A "don't care" value:
	iSeed = 3141592;
	}

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

CParticleSystem* CParticleSystem::NewL(TInt aMaxParticles,CBaseAnim& aAnim)
	{
	CParticleSystem* self = new(ELeave) CParticleSystem(aAnim);
	CleanupStack::PushL(self);
	self->ConstructL(aMaxParticles);
	CleanupStack::Pop();
	return self;
	}

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

CParticleSystem::~CParticleSystem()
	{
	delete[] iParticles;
	iParticles = NULL;
	}

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

void CParticleSystem::ConstructL(TInt aMaxParticles)
    {
	iMaxParticles = aMaxParticles;
	iParticles = new TParticle[ aMaxParticles ];
	User::LeaveIfNull(iParticles);
	Reset();
	}

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

void CParticleSystem::Reset()
	{
	for ( TInt p = 0 ; p < iMaxParticles ; p++ )
		{
		iParticles[ p ].Reset();
		}

	iNextParticleIndex = 0;
	}

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

void CParticleSystem::Simulate()
	{
	for ( TInt p = 0 ; p < iMaxParticles ; p++ )
		{
		iParticles[ p ].Simulate();
		}
	}

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

void CParticleSystem::Render(const TPoint& aOrigin,const TRect& aScreenRect,CFbsBitGc* aCallerGc) const
	{
	//
	// We take care to maintain a consistent drawing order,
	// oldest ( == least recently started ) first:
	//
	TInt p;

	for ( p = iNextParticleIndex - 1 ; p >= 0 ; p-- )
		{
		iParticles[ p ].Render(iAnim,aOrigin,aScreenRect,aCallerGc);
		}

	for ( p = iMaxParticles - 1 ; p >= iNextParticleIndex ; p-- )
		{
		iParticles[ p ].Render(iAnim,aOrigin,aScreenRect,aCallerGc);
		}
	}

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

void CParticleSystem::Generate(const TPoint& aWorldPos, const TVectorFP& aVector, const TPoint& aGeneratorVelocity,
									const TInt aRadius, const TInt aSpeed)
	{
	TParticle * p_particle = &iParticles[ iNextParticleIndex ];
	iNextParticleIndex++;
	if (iNextParticleIndex >= iMaxParticles)
		{
		iNextParticleIndex = 0;
		}

	// We start the particle downrange from the notional point of origin:
	TPoint position = aWorldPos + aVector.ScaleToPoint(aRadius);

	// The particle's initial velocity includes a component from the generator's own motion:
	TPoint velocity = aGeneratorVelocity + aVector.ScaleToPoint(aSpeed);

	// Generate a (pseudo-)random integer for use in setting 
	// parameters for the new particle. We only want the topmost
	// few bits of the Math::Rand() result, since these have the 
	// least "pattern" to them:
	TInt random = Math::Rand(iSeed) >> 22;

	// Decide how fast to run the animation for the new particle.
	// A deltaVFN of 0x0100 implies an animation rate of one frame
	// per simulation cycle (that is, we will get a rate of between 
	// 1 and 1.5 frames per simulation cycle):
	TInt randDeltaVFN = 0x0100 + ( random & 0x7f );

	// Decide which animation frame to start our particle on.
	// A VFN of 0x0100 corresponds to frame #1 (that is, we skip
	// frame #0 of the animation 50% of the time):
	TInt randVFN = random & 0x0100;

	p_particle->Start(randVFN,randDeltaVFN,0x0fff,position,velocity,0x00e0);
	}

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


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人aaaa| 亚洲乱码国产乱码精品精小说 | 国产精品网站一区| 久久久精品人体av艺术| 久久婷婷成人综合色| 2023国产精品| 成人免费小视频| 亚洲激情男女视频| 亚洲国产综合在线| 久久超碰97中文字幕| 精品一区二区久久| 粉嫩aⅴ一区二区三区四区五区| 成人av在线影院| 色94色欧美sute亚洲线路一ni| 丁香一区二区三区| 91麻豆123| 亚洲视频在线观看一区| 亚洲一区二区三区视频在线播放| 日韩av不卡一区二区| 韩国av一区二区三区在线观看| 国内外精品视频| 日本大香伊一区二区三区| 91精品国产综合久久婷婷香蕉| 26uuu色噜噜精品一区二区| 国产精品视频一二三区| 亚洲国产精品自拍| 国产精品一二二区| 色婷婷久久综合| 精品精品欲导航| 中文字幕在线播放不卡一区| 日韩一区欧美二区| 成人午夜av电影| 欧美日韩午夜在线视频| 欧美v日韩v国产v| 亚洲精品久久久久久国产精华液| 免费观看一级欧美片| 成人av综合在线| 91精品国产综合久久福利软件 | 国产成人免费视频网站高清观看视频 | 午夜日韩在线电影| 国产丶欧美丶日本不卡视频| 色综合久久中文综合久久牛| 日韩欧美亚洲国产精品字幕久久久| 国产亚洲一区二区三区| 综合久久久久久| 日韩成人精品视频| 91视视频在线观看入口直接观看www | 欧美色图片你懂的| 欧美极品少妇xxxxⅹ高跟鞋| 免费的国产精品| 色哟哟亚洲精品| 久久综合九色欧美综合狠狠| 一区二区在线观看视频| 国产精品一区二区在线观看不卡| 欧美日韩国产综合视频在线观看| 1区2区3区国产精品| 国产一区二区调教| 91精品国产乱| 亚洲风情在线资源站| 国产精品一卡二| 欧美日韩免费电影| 亚洲天堂精品视频| 成人在线一区二区三区| 日韩精品一区二区三区在线播放| 亚洲资源中文字幕| 99久久99久久久精品齐齐| 精品久久久久久久人人人人传媒| 日韩国产精品久久| 成人天堂资源www在线| 日韩写真欧美这视频| 亚洲综合在线视频| 日韩一二三区不卡| 午夜精品免费在线观看| 在线欧美日韩精品| 一区二区三区中文字幕精品精品| 成人激情免费网站| 久久―日本道色综合久久| 久久精品久久综合| 3751色影院一区二区三区| 亚洲国产日产av| 在线观看国产精品网站| 亚洲男人的天堂av| 色哟哟在线观看一区二区三区| 精品av综合导航| 丝袜亚洲另类丝袜在线| 欧美色欧美亚洲另类二区| 亚洲精品免费一二三区| 91色porny蝌蚪| 亚洲男人的天堂在线观看| 91久久精品一区二区二区| 亚洲日本一区二区三区| 色婷婷综合中文久久一本| 亚洲免费观看高清完整版在线观看熊| 99精品国产99久久久久久白柏| 国产精品进线69影院| 波多野洁衣一区| 国产精品卡一卡二| 91小视频在线免费看| 亚洲精品国产视频| 在线亚洲免费视频| 亚洲va国产va欧美va观看| 欧美视频在线一区| 亚洲综合在线免费观看| 制服丝袜av成人在线看| 蜜桃久久av一区| 日韩午夜av电影| 久久精品国产久精国产| 蜜桃一区二区三区在线观看| 911国产精品| 久色婷婷小香蕉久久| 国产视频亚洲色图| 99精品久久只有精品| 五月天婷婷综合| 日韩欧美中文字幕一区| 国产成人在线影院| 亚洲欧美自拍偷拍| 在线看日韩精品电影| 日本人妖一区二区| 26uuu欧美| 色综合天天综合狠狠| 午夜欧美电影在线观看| 日韩片之四级片| 精品一区二区三区欧美| 国产午夜精品在线观看| 一本久道久久综合中文字幕| 午夜免费欧美电影| 欧美精品一区二区高清在线观看| 成人国产亚洲欧美成人综合网| 亚洲综合色区另类av| 欧美成人一区二区三区片免费| 成人黄色软件下载| 亚洲成av人片一区二区梦乃| 26uuu国产在线精品一区二区| av影院午夜一区| 日韩国产高清影视| 国产精品女主播av| 欧美群妇大交群的观看方式| 国产在线一区二区| 亚洲免费资源在线播放| 欧美电影免费观看高清完整版在线| 成人高清av在线| 一区二区三区在线观看动漫 | 亚洲日本一区二区三区| 欧美一区二区三区在线视频| 懂色av中文字幕一区二区三区| 亚洲国产日韩a在线播放| 久久久久一区二区三区四区| 色成人在线视频| 日本美女一区二区| 国产精品色在线观看| 欧美三级中文字| 精品中文字幕一区二区小辣椒| 国产女人水真多18毛片18精品视频| 91在线观看地址| 韩国午夜理伦三级不卡影院| 亚洲一二三级电影| 国产欧美一区二区精品性色超碰| 欧美电影一区二区三区| 不卡的av中国片| 精品系列免费在线观看| 亚洲高清免费观看| 国产精品久久久久久久蜜臀| 日韩午夜av电影| 欧美丝袜丝交足nylons图片| 99精品国产91久久久久久| 国产制服丝袜一区| 日韩电影在线看| 国产精品私房写真福利视频| 日韩欧美一区二区不卡| 欧美精品日日鲁夜夜添| 欧美丰满美乳xxx高潮www| 欧美理论在线播放| 欧美日本免费一区二区三区| 欧美午夜在线观看| 在线中文字幕一区| 色婷婷精品久久二区二区蜜臂av | 专区另类欧美日韩| 国产精品美女久久久久久久网站| 国产亚洲短视频| 国产精品欧美精品| 亚洲图片激情小说| 亚洲欧美经典视频| 亚洲午夜一二三区视频| 婷婷久久综合九色综合绿巨人| 日韩av网站免费在线| 蜜桃视频在线一区| 狠狠色丁香婷婷综合| 国产**成人网毛片九色| 99在线热播精品免费| 99免费精品在线| 欧美调教femdomvk| 91麻豆精品久久久久蜜臀| 欧美大片一区二区三区| 欧美xxx久久| 欧美国产日本韩| 亚洲欧美日韩国产综合在线| 亚洲国产乱码最新视频| 日本视频在线一区| 国产真实乱子伦精品视频| 丁香六月综合激情|