fix DrawIndexedTriangles bug that caused uninited verticies to be drawn

This commit is contained in:
Chris Danford
2003-06-07 11:54:44 +00:00
parent 40cc0d7def
commit bf77ee902f
9 changed files with 29 additions and 33 deletions
+4 -4
View File
@@ -33,13 +33,13 @@ DancingCharacters::DancingCharacters()
if( PREFSMAN->m_bShowDancingCharacters )
{
m_Character[PLAYER_1].SetX( MODEL_X[PLAYER_1] );
m_Character[PLAYER_1].LoadMilkshapeAscii( "D:\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\char0000\\model.txt" );
m_Character[PLAYER_1].LoadMilkshapeAsciiBones( "D:\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\dance0001.bones.txt" );
m_Character[PLAYER_1].LoadMilkshapeAscii( "C:\\My Documents\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\char0000\\model.txt" );
m_Character[PLAYER_1].LoadMilkshapeAsciiBones( "C:\\My Documents\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\dance0001.bones.txt" );
this->AddChild( &m_Character[PLAYER_1] );
m_Character[PLAYER_2].SetX( MODEL_X[PLAYER_2] );
m_Character[PLAYER_2].LoadMilkshapeAscii( "D:\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\char0011\\model.txt" );
m_Character[PLAYER_2].LoadMilkshapeAsciiBones( "D:\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\dance0002.bones.txt" );
m_Character[PLAYER_2].LoadMilkshapeAscii( "C:\\My Documents\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\char0011\\model.txt" );
m_Character[PLAYER_2].LoadMilkshapeAsciiBones( "C:\\My Documents\\Dev\\ddrpc char hacking\\DDRPCRip\\models\\dance0002.bones.txt" );
this->AddChild( &m_Character[PLAYER_2] );
StartCameraSweep();
+1 -1
View File
@@ -794,7 +794,7 @@ void Model::DrawPrimitives()
}
}
DISPLAY->DrawIndexedTriangles( &TempVertices[0], (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 );
+1 -1
View File
@@ -171,7 +171,7 @@ public:
virtual void DrawFan( const RageVertex v[], int iNumVerts ) = 0;
virtual void DrawStrip( const RageVertex v[], int iNumVerts ) = 0;
virtual void DrawTriangles( const RageVertex v[], int iNumVerts ) = 0;
virtual void DrawIndexedTriangles( const RageVertex v[], const Uint16* pIndices, int iNumIndices ) = 0;
virtual void DrawIndexedTriangles( const RageVertex v[], int iNumVerts, const Uint16* pIndices, int iNumIndices ) = 0;
virtual void DrawLineStrip( const RageVertex v[], int iNumVerts, float LineWidth );
void DrawCircle( const RageVertex &v, float radius );
+1 -1
View File
@@ -644,7 +644,7 @@ void RageDisplay_D3D::DrawTriangles( const RageVertex v[], int iNumVerts )
StatsAddVerts( iNumVerts );
}
void RageDisplay_D3D::DrawIndexedTriangles( const RageVertex v[], const Uint16 pIndices[], int iNumIndices )
void RageDisplay_D3D::DrawIndexedTriangles( const RageVertex v[], int iNumVerts, const Uint16 pIndices[], int iNumIndices )
{
if( iNumIndices == 0 )
return;
+1 -1
View File
@@ -59,7 +59,7 @@ public:
void DrawFan( const RageVertex v[], int iNumVerts );
void DrawStrip( const RageVertex v[], int iNumVerts );
void DrawTriangles( const RageVertex v[], int iNumVerts );
void DrawIndexedTriangles( const RageVertex v[], const Uint16* pIndices, int iNumIndices );
void DrawIndexedTriangles( const RageVertex v[], int iNumVerts, const Uint16* pIndices, int iNumIndices );
// void DrawLineStrip( const RageVertex v[], int iNumVerts, float LineWidth );
void SaveScreenshot( CString sPath );
+1 -5
View File
@@ -596,7 +596,7 @@ void RageDisplay_OGL::DrawTriangles( const RageVertex v[], int iNumVerts )
StatsAddVerts( iNumVerts );
}
void RageDisplay_OGL::DrawIndexedTriangles( const RageVertex v[], const Uint16 pIndices[], int iNumIndices )
void RageDisplay_OGL::DrawIndexedTriangles( const RageVertex v[], int iNumVerts, const Uint16 pIndices[], int iNumIndices )
{
if( iNumIndices == 0 )
return;
@@ -607,10 +607,6 @@ void RageDisplay_OGL::DrawIndexedTriangles( const RageVertex v[], const Uint16 p
glMatrixMode( GL_MODELVIEW );
glLoadMatrixf( (const float*)GetModelViewTop() );
/* XXX: This is ugly. */
int iNumVerts = 0;
for(int i = 0; i < iNumIndices; ++i)
iNumVerts = max(iNumVerts, (int) pIndices[i]);
SetupVertices( v, iNumVerts );
// glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v );
glDrawElements( GL_TRIANGLES, iNumIndices, GL_UNSIGNED_SHORT, pIndices );
+1 -1
View File
@@ -56,7 +56,7 @@ public:
void DrawFan( const RageVertex v[], int iNumVerts );
void DrawStrip( const RageVertex v[], int iNumVerts );
void DrawTriangles( const RageVertex v[], int iNumVerts );
void DrawIndexedTriangles( const RageVertex v[], const Uint16* pIndices, int iNumIndices );
void DrawIndexedTriangles( const RageVertex v[], int iNumVerts, const Uint16* pIndices, int iNumIndices );
void DrawLineStrip( const RageVertex v[], int iNumVerts, float LineWidth );
void SaveScreenshot( CString sPath );
+4 -4
View File
@@ -27,7 +27,7 @@ enum {
BO_MODE,
BO_BRIGHTNESS,
BO_DANGER,
// BO_DANCING_CHARACTERS,
BO_DANCING_CHARACTERS,
BO_RANDOM_BACKGROUNDS,
NUM_BACKGROUND_OPTIONS_LINES
};
@@ -36,7 +36,7 @@ OptionRow g_BackgroundOptionsLines[NUM_BACKGROUND_OPTIONS_LINES] = {
OptionRow( "Mode", "OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES" ),
OptionRow( "Brightness", "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ),
OptionRow( "Danger", "HIDE","SHOW" ),
// OptionRow( "Dancing\nCharacters", "HIDE","SHOW" )
OptionRow( "Dancing\nCharacters", "HIDE","SHOW" ),
OptionRow( "Random\nBackgrounds", "5","10","15","20" ),
};
@@ -60,7 +60,7 @@ void ScreenBackgroundOptions::ImportOptions()
m_iSelectedOption[0][BO_MODE] = PREFSMAN->m_BackgroundMode;
m_iSelectedOption[0][BO_BRIGHTNESS] = (int)( PREFSMAN->m_fBGBrightness*10+0.5f );
m_iSelectedOption[0][BO_DANGER] = PREFSMAN->m_bShowDanger ? 1:0;
// m_iSelectedOption[0][BO_DANCING_CHARACTERS] = PREFSMAN->m_bShowDancingCharacters? 1:0;
m_iSelectedOption[0][BO_DANCING_CHARACTERS] = PREFSMAN->m_bShowDancingCharacters? 1:0;
m_iSelectedOption[0][BO_RANDOM_BACKGROUNDS] = clamp((PREFSMAN->m_iNumBackgrounds/5)-1, 0, 3);
}
@@ -69,7 +69,7 @@ void ScreenBackgroundOptions::ExportOptions()
(int&)PREFSMAN->m_BackgroundMode = m_iSelectedOption[0][BO_MODE];
PREFSMAN->m_fBGBrightness = m_iSelectedOption[0][BO_BRIGHTNESS] / 10.0f;
PREFSMAN->m_bShowDanger = m_iSelectedOption[0][BO_DANGER] == 1;
// PREFSMAN->m_bShowDancingCharacters = m_iSelectedOption[0][BO_DANCING_CHARACTERS] == 1;
PREFSMAN->m_bShowDancingCharacters = m_iSelectedOption[0][BO_DANCING_CHARACTERS] == 1;
PREFSMAN->m_iNumBackgrounds = (m_iSelectedOption[0][BO_RANDOM_BACKGROUNDS]+1) * 5;
}
+15 -15
View File
@@ -64,7 +64,7 @@ IntDir=.\../Debug6
TargetDir=\stepmania\stepmania
TargetName=StepMania-debug
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -82,25 +82,25 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania
# PROP Intermediate_Dir "StepMania___Xbox_Debug___VC6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
XBCP=xbecopy.exe
# ADD BASE XBCP /NOLOGO
# ADD XBCP /NOLOGO
XBE=imagebld.exe
# ADD BASE XBE /nologo /stack:0x10000 /debug
# ADD XBE /nologo /stack:0x10000 /debug
LINK32=link.exe
# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
XBE=imagebld.exe
# ADD BASE XBE /nologo /stack:0x10000 /debug
# ADD XBE /nologo /stack:0x10000 /debug
XBCP=xbecopy.exe
# ADD BASE XBCP /NOLOGO
# ADD XBCP /NOLOGO
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
CPP=cl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
# Begin Special Build Tool
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -140,7 +140,7 @@ IntDir=.\../Release6
TargetDir=\stepmania\stepmania
TargetName=StepMania
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool