fix Model bugs exposed by use in NoteDisplay
This commit is contained in:
+18
-2
@@ -590,10 +590,21 @@ void Model::DrawPrimitives()
|
|||||||
if(m_Meshes.empty())
|
if(m_Meshes.empty())
|
||||||
return; // bail early
|
return; // bail early
|
||||||
|
|
||||||
|
/* Don't if we're fully transparent */
|
||||||
|
if( m_temp.diffuse[0].a <= 0.001f )
|
||||||
|
return;
|
||||||
|
|
||||||
Actor::SetRenderStates(); // set Actor-specified render states
|
Actor::SetRenderStates(); // set Actor-specified render states
|
||||||
|
|
||||||
DISPLAY->Scale( 1, -1, 1 ); // flip Y so positive is up
|
DISPLAY->Scale( 1, -1, 1 ); // flip Y so positive is up
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////
|
||||||
|
// render the diffuse pass
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
|
DISPLAY->SetTextureModeModulate();
|
||||||
|
|
||||||
for (int i = 0; i < (int)m_Meshes.size(); i++)
|
for (int i = 0; i < (int)m_Meshes.size(); i++)
|
||||||
{
|
{
|
||||||
msMesh *pMesh = &m_Meshes[i];
|
msMesh *pMesh = &m_Meshes[i];
|
||||||
@@ -657,8 +668,13 @@ void Model::DrawPrimitives()
|
|||||||
DISPLAY->DrawIndexedTriangles( &TempVertices[0], pMesh->Vertices.size(), (Uint16*)&pMesh->Triangles[0], pMesh->Triangles.size()*3 );
|
DISPLAY->DrawIndexedTriangles( &TempVertices[0], pMesh->Vertices.size(), (Uint16*)&pMesh->Triangles[0], pMesh->Triangles.size()*3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY->SetZBuffer( false );
|
//////////////////////
|
||||||
|
// render the glow pass
|
||||||
|
//////////////////////
|
||||||
|
if( m_temp.glow.a > 0.0001f )
|
||||||
|
{
|
||||||
|
// TODO: Support glow.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Model::SetDefaultAnimation( CString sAnimation, float fPlayRate )
|
void Model::SetDefaultAnimation( CString sAnimation, float fPlayRate )
|
||||||
|
|||||||
@@ -266,7 +266,8 @@ void NoteDisplay::Load( int iColNum, PlayerNumber pn, CString NoteSkin, float fY
|
|||||||
void NoteDisplay::SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLengthInBeats, bool bVivid, bool bNoteColor )
|
void NoteDisplay::SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLengthInBeats, bool bVivid, bool bNoteColor )
|
||||||
{
|
{
|
||||||
const int iNumFrames = actorToSet.GetNumStates();
|
const int iNumFrames = actorToSet.GetNumStates();
|
||||||
ASSERT( iNumFrames );
|
if( iNumFrames == 0 ) // Model with no textures
|
||||||
|
return;
|
||||||
|
|
||||||
float fSongBeat = GAMESTATE->m_fSongBeat;
|
float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||||
float fPrecentIntoAnimation = fmodf(fSongBeat,fAnimationLengthInBeats) / fAnimationLengthInBeats;
|
float fPrecentIntoAnimation = fmodf(fSongBeat,fAnimationLengthInBeats) / fAnimationLengthInBeats;
|
||||||
|
|||||||
Reference in New Issue
Block a user