diff --git a/engine/client/cl_frame.c b/engine/client/cl_frame.c index dcd27323..4943d711 100644 --- a/engine/client/cl_frame.c +++ b/engine/client/cl_frame.c @@ -981,15 +981,8 @@ qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType ) if( !draw_player ) return false; - if( entityType == ET_BEAM ) - { - ref.dllFuncs.CL_AddCustomBeam( ent ); - return true; - } - else if( !ref.dllFuncs.R_AddEntity( ent, entityType )) - { + if( !ref.dllFuncs.R_AddEntity( ent, entityType )) return false; - } // because pTemp->entity.curstate.effects // is already occupied by FTENT_FLICKER diff --git a/engine/ref_api.h b/engine/ref_api.h index cdbd7008..43f2a793 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -62,7 +62,9 @@ GNU General Public License for more details. // 11. Added size argument to Mod_ProcessRenderData // 12. Added Image_CalcImageSize // 13. Removed ignore_flags argument from GetCvarPointer -#define REF_API_VERSION 13 +// 14. Removed reserved functions, they are leftover from RenderAPI +// Removed CL_AddCustomBeam, it's now handled through R_AddEntity +#define REF_API_VERSION 14 #define TF_SKY (TF_SKYSIDE|TF_NOMIPMAP|TF_ALLOW_NEAREST) #define TF_FONT (TF_NOMIPMAP|TF_CLAMP|TF_ALLOW_NEAREST) @@ -533,7 +535,6 @@ typedef struct ref_interface_s void (*GL_SetRenderMode)( int renderMode ); qboolean (*R_AddEntity)( struct cl_entity_s *clent, int type ); - void (*CL_AddCustomBeam)( cl_entity_t *pEnvBeam ); void (*R_ProcessEntData)( qboolean allocate, cl_entity_t *entities, unsigned int max_entities ); void (*R_Flush)( unsigned int flush_flags ); @@ -632,8 +633,6 @@ typedef struct ref_interface_s void (*GL_TextureTarget)( unsigned int target ); // change texture unit mode without bind texture void (*GL_TexCoordArrayMode)( unsigned int texmode ); void (*GL_UpdateTexSize)( int texnum, int width, int height, int depth ); // recalc statistics - void (*GL_Reserved0)( void ); // for potential interface expansion without broken compatibility - void (*GL_Reserved1)( void ); // Misc renderer functions void (*GL_DrawParticles)( const struct ref_viewpass_s *rvp, qboolean trans_pass, float frametime ); diff --git a/ref/gl/gl_beams.c b/ref/gl/gl_beams.c index 14b9820a..e4989b1a 100644 --- a/ref/gl/gl_beams.c +++ b/ref/gl/gl_beams.c @@ -151,28 +151,6 @@ qboolean R_BeamCull( const vec3_t start, const vec3_t end, qboolean pvsOnly ) return true; } -/* -================ -CL_AddCustomBeam - -Add the beam that encoded as custom entity -================ -*/ -void CL_AddCustomBeam( cl_entity_t *pEnvBeam ) -{ - if( tr.draw_list->num_beam_entities >= MAX_VISIBLE_PACKET ) - { - gEngfuncs.Con_Printf( S_ERROR "Too many beams %d!\n", tr.draw_list->num_beam_entities ); - return; - } - - if( pEnvBeam ) - { - tr.draw_list->beam_entities[tr.draw_list->num_beam_entities] = pEnvBeam; - tr.draw_list->num_beam_entities++; - } -} - /* ============================================================== diff --git a/ref/gl/gl_context.c b/ref/gl/gl_context.c index de7cb04f..bee22475 100644 --- a/ref/gl/gl_context.c +++ b/ref/gl/gl_context.c @@ -452,7 +452,6 @@ static const ref_interface_t gReffuncs = GL_SetRenderMode, R_AddEntity, - CL_AddCustomBeam, R_ProcessEntData, R_Flush, @@ -531,8 +530,6 @@ static const ref_interface_t gReffuncs = GL_TextureTarget, GL_SetTexCoordArrayMode, GL_UpdateTexSize, - NULL, - NULL, CL_DrawParticlesExternal, R_LightVec, diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index 6c9a29c3..143c858d 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -538,7 +538,6 @@ int R_CreateDecalList( decallist_t *pList ); void R_ClearAllDecals( void ); byte *Mod_GetCurrentVis( void ); void Mod_SetOrthoBounds( const float *mins, const float *maxs ); -void CL_AddCustomBeam( cl_entity_t *pEnvBeam ); // // gl_opengl.c diff --git a/ref/gl/gl_rmain.c b/ref/gl/gl_rmain.c index 43373c2c..3bd188d5 100644 --- a/ref/gl/gl_rmain.c +++ b/ref/gl/gl_rmain.c @@ -243,9 +243,6 @@ qboolean R_AddEntity( struct cl_entity_s *clent, int type ) if( !r_drawentities->value ) return false; // not allow to drawing - if( !clent || !clent->model ) - return false; // if set to invisible, skip - if( FBitSet( clent->curstate.effects, EF_NODRAW )) return false; // done @@ -260,10 +257,22 @@ qboolean R_AddEntity( struct cl_entity_s *clent, int type ) case ET_TEMPENTITY: r_stats.c_active_tents_count++; break; - default: break; } - if( R_OpaqueEntity( clent )) + if( type == ET_BEAM ) + { + if( tr.draw_list->num_beam_entities >= MAX_VISIBLE_PACKET ) + { + gEngfuncs.Con_Printf( S_ERROR "Too many beams %d!\n", tr.draw_list->num_beam_entities ); + return false; + } + + tr.draw_list->beam_entities[tr.draw_list->num_beam_entities] = clent; + tr.draw_list->num_beam_entities++; + + return true; + } + else if( R_OpaqueEntity( clent )) { // opaque if( tr.draw_list->num_solid_entities >= MAX_VISIBLE_PACKET ) diff --git a/ref/null/r_context.c b/ref/null/r_context.c index 9d87e9fc..0367bc15 100644 --- a/ref/null/r_context.c +++ b/ref/null/r_context.c @@ -75,11 +75,6 @@ static qboolean R_AddEntity( struct cl_entity_s *clent, int type ) return true; } -static void CL_AddCustomBeam( cl_entity_t *pEnvBeam ) -{ - ; -} - static void R_ProcessEntData( qboolean allocate, cl_entity_t *entities, unsigned int max_entities ) { ; @@ -460,7 +455,6 @@ static const ref_interface_t gReffuncs = .GL_SetRenderMode = R_SimpleStubInt, .R_AddEntity = R_AddEntity, - .CL_AddCustomBeam = CL_AddCustomBeam, .R_ProcessEntData = R_ProcessEntData, .R_Flush = R_SimpleStubUInt, @@ -539,8 +533,6 @@ static const ref_interface_t gReffuncs = .GL_TextureTarget = R_SimpleStubUInt, .GL_TexCoordArrayMode = R_SimpleStubUInt, .GL_UpdateTexSize = GL_UpdateTexSize, - .GL_Reserved0 = NULL, - .GL_Reserved1 = NULL, .GL_DrawParticles = GL_DrawParticles, .LightVec = LightVec, diff --git a/ref/soft/r_beams.c b/ref/soft/r_beams.c index 3a3f2748..4fd107a0 100644 --- a/ref/soft/r_beams.c +++ b/ref/soft/r_beams.c @@ -122,29 +122,6 @@ qboolean GAME_EXPORT R_BeamCull( const vec3_t start, const vec3_t end, qboolean return false; } -/* -================ -CL_AddCustomBeam - -Add the beam that encoded as custom entity -================ -*/ -void GAME_EXPORT CL_AddCustomBeam( cl_entity_t *pEnvBeam ) -{ - if( tr.draw_list->num_beam_entities >= MAX_VISIBLE_PACKET ) - { - gEngfuncs.Con_Printf( S_ERROR "Too many beams %d!\n", tr.draw_list->num_beam_entities ); - return; - } - - if( pEnvBeam ) - { - tr.draw_list->beam_entities[tr.draw_list->num_beam_entities] = pEnvBeam; - tr.draw_list->num_beam_entities++; - } -} - - /* ============================================================== diff --git a/ref/soft/r_context.c b/ref/soft/r_context.c index 00723ae5..4f5b3dcf 100644 --- a/ref/soft/r_context.c +++ b/ref/soft/r_context.c @@ -438,7 +438,6 @@ static const ref_interface_t gReffuncs = GL_SetRenderMode, R_AddEntity, - CL_AddCustomBeam, R_ProcessEntData, R_Flush, @@ -517,8 +516,6 @@ static const ref_interface_t gReffuncs = GL_TextureTarget, GL_SetTexCoordArrayMode, GL_UpdateTexSize, - NULL, - NULL, CL_DrawParticlesExternal, R_LightVec, diff --git a/ref/soft/r_local.h b/ref/soft/r_local.h index 117e0c2c..b1f7b306 100644 --- a/ref/soft/r_local.h +++ b/ref/soft/r_local.h @@ -529,7 +529,6 @@ void R_ClearAllDecals( void ); byte *Mod_GetCurrentVis( void ); void Mod_SetOrthoBounds( const float *mins, const float *maxs ); void R_NewMap( void ); -void CL_AddCustomBeam( cl_entity_t *pEnvBeam ); // // gl_triapi.c diff --git a/ref/soft/r_main.c b/ref/soft/r_main.c index c93f3475..abc54a28 100644 --- a/ref/soft/r_main.c +++ b/ref/soft/r_main.c @@ -319,9 +319,6 @@ qboolean GAME_EXPORT R_AddEntity( struct cl_entity_s *clent, int type ) if( !r_drawentities->value ) return false; // not allow to drawing - if( !clent || !clent->model ) - return false; // if set to invisible, skip - if( FBitSet( clent->curstate.effects, EF_NODRAW )) return false; // done @@ -331,7 +328,20 @@ qboolean GAME_EXPORT R_AddEntity( struct cl_entity_s *clent, int type ) if( type == ET_FRAGMENTED ) r_stats.c_client_ents++; - if( R_OpaqueEntity( clent )) + if( type == ET_BEAM ) + { + if( tr.draw_list->num_beam_entities >= MAX_VISIBLE_PACKET ) + { + gEngfuncs.Con_Printf( S_ERROR "Too many beams %d!\n", tr.draw_list->num_beam_entities ); + return false; + } + + tr.draw_list->beam_entities[tr.draw_list->num_beam_entities] = clent; + tr.draw_list->num_beam_entities++; + + return true; + } + else if( R_OpaqueEntity( clent )) { if( clent->model->type == mod_brush ) {