remove ancient commented out code.
This commit is contained in:
@@ -516,32 +516,6 @@ void LifeMeterBar::Update( float fDeltaTime )
|
||||
|
||||
void LifeMeterBar::DrawPrimitives()
|
||||
{
|
||||
/*
|
||||
// set custom texture coords
|
||||
static RECT rectSize;
|
||||
rectSize.left = -m_iMeterWidth/2;
|
||||
rectSize.top = -m_iMeterHeight/2;
|
||||
rectSize.right = -m_iMeterWidth/2 + int(roundf(m_iMeterWidth*m_fTrailingLifePercentage));
|
||||
rectSize.bottom = +m_iMeterHeight/2;
|
||||
|
||||
float fPrecentOffset = RageTimer::GetTimeSinceStart();
|
||||
fPrecentOffset -= (int)fPrecentOffset;
|
||||
|
||||
RectF frectCustomTexCoords(
|
||||
0 - fPrecentOffset,
|
||||
0,
|
||||
m_fTrailingLifePercentage - fPrecentOffset,
|
||||
1 );
|
||||
|
||||
m_sprStreamNormal.StretchTo( &rectSize );
|
||||
m_sprStreamNormal.SetCustomTextureRect( frectCustomTexCoords );
|
||||
m_sprStreamHot.StretchTo( &rectSize );
|
||||
m_sprStreamHot.SetCustomTextureRect( frectCustomTexCoords );
|
||||
|
||||
m_sprStreamHot.SetDiffuse( RageColor(1,1,1,m_fHotAlpha) );
|
||||
|
||||
*/
|
||||
|
||||
m_pStream->m_fPercent = m_fTrailingLifePercentage;
|
||||
m_pStream->m_fHotAlpha = m_fHotAlpha;
|
||||
|
||||
@@ -630,142 +604,6 @@ void LifeMeterBar::UpdateNonstopLifebar(const int cleared,
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Chris: I'm making the coloring of the lifemeter a property
|
||||
of the theme. That's where it belongs anyway...
|
||||
|
||||
|
||||
const RageColor COLOR_EZ2NORMAL_1 = RageColor(0.7f,0.4f,0,1);
|
||||
const RageColor COLOR_EZ2NORMAL_2 = RageColor(0.8f,0.4f,0,1);
|
||||
const RageColor COLOR_EZ2NEARFULL_1 = RageColor(0.7f,0.6f,0,1);
|
||||
const RageColor COLOR_EZ2NEARFULL_2 = RageColor(0.8f,0.7f,0,1);
|
||||
const RageColor COLOR_EZ2NEARFAIL_1 = RageColor(0.9f,0.0f,0,1);
|
||||
const RageColor COLOR_EZ2NEARFAIL_2 = RageColor(0.8f,0.1f,0,1);
|
||||
const RageColor COLOR_EZ2FULL_1 = RageColor(0.3f,0.9f,0.4f,1);
|
||||
const RageColor COLOR_EZ2FULL_2 = RageColor(0.2f,0.7f,0.3f,1);
|
||||
const RageColor COLOR_NORMAL_1 = RageColor(1,1,1,1);
|
||||
const RageColor COLOR_NORMAL_2 = RageColor(0,1,0,1);
|
||||
const RageColor COLOR_FULL_1 = RageColor(1,0,0,1);
|
||||
const RageColor COLOR_FULL_2 = RageColor(1,1,0,1);
|
||||
|
||||
RageColor LifeStream::GetColor( float fPercentIntoSection )
|
||||
{
|
||||
float fPercentColor1 = fabsf( fPercentIntoSection*2 - 1 );
|
||||
fPercentColor1 *= fPercentColor1 * fPercentColor1 * fPercentColor1; // make the color bunch around one side
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
if( m_fLifePercentage == 1 )
|
||||
return COLOR_FULL_1 * fPercentColor1 + COLOR_FULL_2 * (1-fPercentColor1);
|
||||
else
|
||||
return COLOR_NORMAL_1 * fPercentColor1 + COLOR_NORMAL_2 * (1-fPercentColor1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_fLifePercentage == 1 )
|
||||
return COLOR_EZ2FULL_1 * fPercentColor1 + COLOR_EZ2FULL_2 * (1-fPercentColor1);
|
||||
else if ( m_fLifePercentage > 0.60 )
|
||||
return COLOR_EZ2NEARFULL_1 * fPercentColor1 + COLOR_EZ2NEARFULL_2 * (1-fPercentColor1);
|
||||
else if ( m_fLifePercentage < 0.25 )
|
||||
return COLOR_EZ2NEARFAIL_1 * fPercentColor1 + COLOR_EZ2NEARFAIL_2 * (1-fPercentColor1);
|
||||
else
|
||||
return COLOR_EZ2NORMAL_1 * fPercentColor1 + COLOR_EZ2NORMAL_2 * (1-fPercentColor1);
|
||||
}
|
||||
}
|
||||
|
||||
void LifeStream::DrawPrimitives()
|
||||
{
|
||||
// make the object in logical units centered at the origin
|
||||
LPDIRECT3DVERTEXBUFFER8 pVB = DISPLAY->GetVertexBuffer();
|
||||
RageSpriteVertex* v;
|
||||
pVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
|
||||
int iNumV = 0;
|
||||
|
||||
float fPercentIntoSection = (RageTimer::GetTimeSinceStart()/0.3f* (m_bIsHot ? 2 : 1) )*LIFE_STREAM_SECTION_WIDTH;
|
||||
fPercentIntoSection -= (int)fPercentIntoSection;
|
||||
fPercentIntoSection = 1-fPercentIntoSection;
|
||||
fPercentIntoSection -= (int)fPercentIntoSection;
|
||||
ASSERT( fPercentIntoSection >= 0 && fPercentIntoSection < 1 );
|
||||
float fX = - 0.5f;
|
||||
|
||||
|
||||
while( fX < m_fTrailingLifePercentage-0.5f )
|
||||
{
|
||||
//
|
||||
// draw middle
|
||||
//
|
||||
v[iNumV++].p = RageVector3( fX, -0.5f, 0 );
|
||||
v[iNumV++].p = RageVector3( fX, 0.5f, 0 );
|
||||
|
||||
iNumV -= 2;
|
||||
const RageColor color = GetColor( fPercentIntoSection );
|
||||
v[iNumV++].color = color;
|
||||
v[iNumV++].color = color;
|
||||
|
||||
|
||||
if( fPercentIntoSection < 0.5f )
|
||||
{
|
||||
const float fPercentToAdd = 0.5f-fPercentIntoSection;
|
||||
fPercentIntoSection += fPercentToAdd;
|
||||
fX += fPercentToAdd*LIFE_STREAM_SECTION_WIDTH;
|
||||
}
|
||||
else if( fPercentIntoSection < 1.0f )
|
||||
{
|
||||
const float fPercentToAdd = 1.0f-fPercentIntoSection;
|
||||
fPercentIntoSection = 0;
|
||||
fX += fPercentToAdd*LIFE_STREAM_SECTION_WIDTH;
|
||||
}
|
||||
else
|
||||
ASSERT( false );
|
||||
}
|
||||
|
||||
const float fXToSubtract = fX - (m_fTrailingLifePercentage-0.5f);
|
||||
fX -= fXToSubtract;
|
||||
fPercentIntoSection -= fXToSubtract/LIFE_STREAM_SECTION_WIDTH;
|
||||
if( fPercentIntoSection < 0 )
|
||||
fPercentIntoSection += 1;
|
||||
|
||||
//
|
||||
// draw right edge
|
||||
//
|
||||
v[iNumV++].p = RageVector3( fX, -0.5f, 0 );
|
||||
v[iNumV++].p = RageVector3( fX, 0.5f, 0 );
|
||||
|
||||
iNumV -= 2;
|
||||
const RageColor color = GetColor( fPercentIntoSection );
|
||||
v[iNumV++].color = color;
|
||||
v[iNumV++].color = color;
|
||||
|
||||
|
||||
|
||||
pVB->Unlock();
|
||||
|
||||
|
||||
LPDIRECT3DDEVICE8 pd3dDevice = DISPLAY->GetDevice();
|
||||
pd3dDevice->SetTexture( 0, NULL );
|
||||
|
||||
|
||||
|
||||
// set texture and alpha properties
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG2 );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2 );
|
||||
|
||||
pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
|
||||
pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
|
||||
|
||||
|
||||
// finally! Pump those triangles!
|
||||
pd3dDevice->SetVertexShader( D3DFVF_RageSpriteVertex );
|
||||
pd3dDevice->SetStreamSource( 0, pVB, sizeof(RageSpriteVertex) );
|
||||
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, iNumV-2 );
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
void LifeMeterBar::FillForHowToPlay(int NumPerfects, int NumMisses)
|
||||
{
|
||||
m_iProgressiveLifebar = 0; // disable progressive lifebar
|
||||
|
||||
Reference in New Issue
Block a user