本文整理汇总了C++中CVideo::EnableTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ CVideo::EnableTexture方法的具体用法?C++ CVideo::EnableTexture怎么用?C++ CVideo::EnableTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVideo
的用法示例。
在下文中一共展示了CVideo::EnableTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
//--------------------------------------------------------------------
// Función: CParticles::Update
// Creador: Nacho (AMD)
// Fecha: Wednesday 14/02/2007 19:48:41
//--------------------------------------------------------------------
void CParticles::Update(float dt, CLevel* pTheLevel, CSound* pSoundPlayer)
{
CVideo * pVideo = CVideo::GetSingleton();
m_fAngType3 += (240.0f * dt);
m_fAngType3 = MAT_NormalizarAngulo360(m_fAngType3);
CBall* pBall = pTheLevel->GetBall();
CSmoke* pSmoke = pTheLevel->GetSmoke();
VECTOR3 vecBallPos = pBall->GetPosition();
VECTOR2 vecBallVel = pBall->GetVelocity();
float fBallRadius = pBall->GetRadius();
sceGuEnable(GU_BLEND);
sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
ENEMY* pEnemies = pTheLevel->GetEnemies();
int iNumEnemies = pTheLevel->GetNumEnemies();
///--- TIPO 0: Disparo amarillo
//////////////////////////////////////////////////////////////////////
pVideo->EnableTexture(m_pTexture[0]);
for (int i=0; i<MAX_PARTICLES; i++)
{
if (m_pParticleArray[0][i].enable)
{
m_pParticleArray[0][i].timeStamp += dt;
if (m_pParticleArray[0][i].timeStamp >= 5.0f)
{
m_pParticleArray[0][i].enable = false;
m_pParticleArray[0][i].next = m_iFreeSlot[0];
m_iFreeSlot[0] = i;
continue;
}
m_pParticleArray[0][i].pos.x += m_pParticleArray[0][i].vel.x * dt;
m_pParticleArray[0][i].pos.y += m_pParticleArray[0][i].vel.y * dt;
stCollisionData data;
data.radius = 1.0f;
data.x = m_pParticleArray[0][i].pos.x;
data.y = m_pParticleArray[0][i].pos.y;
data.velX = m_pParticleArray[0][i].vel.x;
data.velY = m_pParticleArray[0][i].vel.y;
if (pTheLevel->TestCollision(&data, false))
{
m_pParticleArray[0][i].pos.x = data.x;
m_pParticleArray[0][i].pos.y = data.y;
m_pParticleArray[0][i].vel.x = data.velX;
m_pParticleArray[0][i].vel.y = data.velY;
}
for (int a=0; a<iNumEnemies; a++)
{
if (pEnemies[a].active)
{
///--- sierra
///--- rebota
if ((pEnemies[a].type == 0) || (pEnemies[a].type == 3))
{
VECTOR3 vDis;
VECTOR3 vTemp = {m_pParticleArray[0][i].pos.x, m_pParticleArray[0][i].pos.y, 4.0f};
VECTOR3 vTemp2 = {pEnemies[a].posX + 4.0f, pEnemies[a].posY + 4.0f, 4.0f};
MAT_VectorSubtract(&vDis, &vTemp2, &vTemp);
float length = MAT_VectorQuadraticLength(&vDis);
if (length < 6.25f)
{
m_pParticleArray[0][i].enable = false;
m_pParticleArray[0][i].next = m_iFreeSlot[0];
m_iFreeSlot[0] = i;
pSmoke->AddExplosion(vTemp2, 20.0f, true);
pEnemies[a].active = false;
pSoundPlayer->Play(SOUND_ENE_EXPLO);
break;
}
}
///--- dirigidos
///--- rectos
else if ((pEnemies[a].type == 1) || (pEnemies[a].type == 2))
//.........这里部分代码省略.........