Browse Source

ref_soft: Viewmodel support

pull/2/head
mittorn 6 years ago
parent
commit
35e42a2295
  1. 5
      r_local.h
  2. 8
      r_main.c
  3. 4
      r_studio.c
  4. 2
      r_trialias.c

5
r_local.h

@ -640,8 +640,8 @@ void Mod_SpriteUnloadTextures( void *data ); @@ -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; @@ -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);

8
r_main.c

@ -1149,8 +1149,8 @@ void R_DrawEntitiesOnList( void ) @@ -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 ) @@ -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();

4
r_studio.c

@ -3477,7 +3477,7 @@ void R_DrawViewModel( void ) @@ -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 ) @@ -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 )

2
r_trialias.c

@ -19,7 +19,7 @@ float aliastransform[3][4]; @@ -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;

Loading…
Cancel
Save