ref_soft: Viewmodel support

This commit is contained in:
mittorn 2019-03-26 22:57:34 +07:00
parent dbabb861f2
commit 35e42a2295
4 changed files with 10 additions and 9 deletions

View File

@ -640,8 +640,8 @@ void Mod_SpriteUnloadTextures( void *data );
void Mod_UnloadAliasModel( struct model_s *mod );
void Mod_AliasUnloadTextures( void *data );
void GL_SetRenderMode( int mode );
//void R_RunViewmodelEvents( void );
//void R_DrawViewModel( void );
void R_RunViewmodelEvents( void );
void R_DrawViewModel( void );
int R_GetSpriteTexture( const struct model_s *m_pSpriteModel, int frame );
void R_DecalShoot( int textureIndex, int entityIndex, int modelIndex, vec3_t pos, int flags, float scale );
void R_RemoveEfrags( struct cl_entity_s *ent );
@ -1267,6 +1267,7 @@ extern aliastriangleparms_t aliastriangleparms;
extern int r_aliasblendcolor;
extern float aliasxscale, aliasyscale, aliasxcenter, aliasycenter;
extern float s_ziscale;
void R_DrawTriangle( void );
//void R_DrawTriangle (finalvert_t *index0, finalvert_t *index1, finalvert_t *index2);

View File

@ -1149,8 +1149,8 @@ void R_DrawEntitiesOnList( void )
// pglDisable( GL_BLEND ); // Trinity Render issues
//if( !RI.onlyClientDraw )
//R_DrawViewModel();
if( !RI.onlyClientDraw )
R_DrawViewModel();
gEngfuncs.CL_ExtraUpdate();
//GL_CheckForErrors();
@ -1766,8 +1766,8 @@ int R_RenderFrame( const ref_viewpass_t *rvp )
}
tr.fCustomRendering = false;
// if( !RI.onlyClientDraw )
// R_RunViewmodelEvents();
if( !RI.onlyClientDraw )
R_RunViewmodelEvents();
tr.realframecount++; // right called after viewmodel events
R_RenderScene();

View File

@ -3477,7 +3477,7 @@ void R_DrawViewModel( void )
// adjust the depth range to prevent view model from poking into walls
//pglDepthRange( gldepthmin, gldepthmin + 0.3f * ( gldepthmax - gldepthmin ));
/// TODO: ziscale
s_ziscale = (float)0x8000 * (float)0x10000 * 3.0;
RI.currentmodel = RI.currententity->model;
// backface culling for left-handed weapons
@ -3500,7 +3500,7 @@ void R_DrawViewModel( void )
// restore depth range
//pglDepthRange( gldepthmin, gldepthmax );
/// ziscale
s_ziscale = (float)0x8000 * (float)0x10000;
// backface culling for left-handed weapons
if( R_AllowFlipViewModel( RI.currententity ) || g_iBackFaceCull )

View File

@ -19,7 +19,7 @@ float aliastransform[3][4];
float aliasworldtransform[3][4];
float aliasoldworldtransform[3][4];
static float s_ziscale;
float s_ziscale;
static vec3_t s_alias_forward, s_alias_right, s_alias_up;