ref: soft: replace skin texture num bound by a proper check, fixes wrong skin on flags in Adrenaline Gamer
This commit is contained in:
parent
9d3949a948
commit
5ac8f63741
1 changed files with 3 additions and 3 deletions
|
@ -2023,8 +2023,7 @@ static void R_StudioDrawPoints( void )
|
||||||
|
|
||||||
if( !m_pStudioHeader ) return;
|
if( !m_pStudioHeader ) return;
|
||||||
|
|
||||||
// safety bounding the skinnum
|
m_skinnum = RI.currententity->curstate.skin;
|
||||||
m_skinnum = bound( 0, RI.currententity->curstate.skin, ( m_pStudioHeader->numskinfamilies - 1 ));
|
|
||||||
ptexture = (mstudiotexture_t *)((byte *)m_pStudioHeader + m_pStudioHeader->textureindex);
|
ptexture = (mstudiotexture_t *)((byte *)m_pStudioHeader + m_pStudioHeader->textureindex);
|
||||||
pvertbone = ((byte *)m_pStudioHeader + m_pSubModel->vertinfoindex);
|
pvertbone = ((byte *)m_pStudioHeader + m_pSubModel->vertinfoindex);
|
||||||
pnormbone = ((byte *)m_pStudioHeader + m_pSubModel->norminfoindex);
|
pnormbone = ((byte *)m_pStudioHeader + m_pSubModel->norminfoindex);
|
||||||
|
@ -2034,7 +2033,8 @@ static void R_StudioDrawPoints( void )
|
||||||
pstudionorms = (vec3_t *)((byte *)m_pStudioHeader + m_pSubModel->normindex);
|
pstudionorms = (vec3_t *)((byte *)m_pStudioHeader + m_pSubModel->normindex);
|
||||||
|
|
||||||
pskinref = (short *)((byte *)m_pStudioHeader + m_pStudioHeader->skinindex);
|
pskinref = (short *)((byte *)m_pStudioHeader + m_pStudioHeader->skinindex);
|
||||||
if( m_skinnum != 0 ) pskinref += (m_skinnum * m_pStudioHeader->numskinref);
|
if( m_skinnum > 0 && m_skinnum < m_pStudioHeader->numskinfamilies )
|
||||||
|
pskinref += (m_skinnum * m_pStudioHeader->numskinref);
|
||||||
|
|
||||||
if( FBitSet( m_pStudioHeader->flags, STUDIO_HAS_BONEWEIGHTS ) && m_pSubModel->blendvertinfoindex != 0 && m_pSubModel->blendnorminfoindex != 0 )
|
if( FBitSet( m_pStudioHeader->flags, STUDIO_HAS_BONEWEIGHTS ) && m_pSubModel->blendvertinfoindex != 0 && m_pSubModel->blendnorminfoindex != 0 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue