Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void C_BulletManager::Render()
- {
- if ( r_drawothermodels.GetInt() )
- {
- for( int i = 0; i < m_Bullets.Count(); ++i )
- {
- C_Bulletlet * bullet = &m_Bullets[i];
- // Necessary for lighting blending
- bullet->CreateModelInstance();
- if ( !bullet->GetModel() )
- return;
- // Make sure hdr is valid for drawing
- if ( !bullet->GetModelPtr() )
- return;
- CMatRenderContextPtr pRenderContext( materials );
- ClientModelRenderInfo_t info;
- ClientModelRenderInfo_t *pInfo;
- pInfo = &info;
- pInfo->flags = STUDIO_WIREFRAME | STUDIO_RENDER;
- pInfo->pRenderable = (IClientRenderable*)bullet;
- pInfo->instance = bullet->GetModelInstance();
- pInfo->entity_index = bullet->GetOwner()->entindex();
- pInfo->pModel = bullet->GetModel();
- pInfo->origin = bullet->GetRenderOrigin();
- pInfo->angles = vec3_angle;
- pInfo->skin = 0;
- pInfo->body = 0;
- //pInfo->pModelToWorld = &bullet->GetOwner()->EntityToWorldTransform();
- //pInfo->hitboxset = m_nHitboxSet;
- // Assert( !pInfo->pModelToWorld);
- if ( !pInfo->pModelToWorld )
- {
- pInfo->pModelToWorld = &pInfo->modelToWorld;
- // Turns the origin + angles into a matrix
- AngleMatrix( pInfo->angles, pInfo->origin, pInfo->modelToWorld );
- }
- bool bMarkAsDrawn = false;
- // Suppress unlocking
- CMatRenderDataReference rd( pRenderContext );
- DrawModelState_t state;
- matrix3x4_t *pBoneToWorld;
- bMarkAsDrawn = modelrender->DrawModelSetup( *pInfo, &state, &pBoneToWorld );
- modelrender->DrawModelExecute( state, *pInfo, pBoneToWorld );
- return;
- }
- return;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement