ref: gl: replace same struct type memcpys by assignments

This commit is contained in:
Alibek Omarov 2024-07-31 00:01:45 +03:00
parent 9ab0f04ba5
commit f6fa085fe4
3 changed files with 4 additions and 5 deletions

View file

@ -569,8 +569,8 @@ int EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t *engfuncs,
return 0; return 0;
// fill in our callbacks // fill in our callbacks
memcpy( funcs, &gReffuncs, sizeof( ref_interface_t )); *funcs = gReffuncs;
memcpy( &gEngfuncs, engfuncs, sizeof( ref_api_t )); gEngfuncs = *engfuncs;
gpGlobals = globals; gpGlobals = globals;
gp_cl = (ref_client_t *)ENGINE_GET_PARM( PARM_GET_CLIENT_PTR ); gp_cl = (ref_client_t *)ENGINE_GET_PARM( PARM_GET_CLIENT_PTR );

View file

@ -281,7 +281,6 @@ void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean trans_pass, f
{ {
ref_instance_t oldRI = RI; ref_instance_t oldRI = RI;
memcpy( &oldRI, &RI, sizeof( ref_instance_t ));
R_SetupRefParams( rvp ); R_SetupRefParams( rvp );
R_SetupFrustum(); R_SetupFrustum();
R_SetupGL( false ); // don't touch GL-states R_SetupGL( false ); // don't touch GL-states
@ -290,5 +289,5 @@ void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean trans_pass, f
gEngfuncs.CL_DrawEFX( frametime, trans_pass ); gEngfuncs.CL_DrawEFX( frametime, trans_pass );
// restore internal state // restore internal state
memcpy( &RI, &oldRI, sizeof( ref_instance_t )); RI = oldRI;
} }

View file

@ -54,7 +54,7 @@ static const byte *R_SpriteLoadFrame( model_t *mod, const void *pin, mspritefram
char texname[128]; char texname[128];
int bytes = 1; int bytes = 1;
memcpy( &pinframe, pin, sizeof(dspriteframe_t)); memcpy( &pinframe, pin, sizeof( dspriteframe_t ));
if( sprite_version == SPRITE_VERSION_32 ) if( sprite_version == SPRITE_VERSION_32 )
bytes = 4; bytes = 4;