engine: client: replace same struct type memcpys by assignments
This commit is contained in:
parent
712b354421
commit
47eb9e8c8f
8 changed files with 13 additions and 15 deletions
|
@ -95,8 +95,7 @@ static void CL_ResetPositions( cl_entity_t *ent )
|
|||
ent->current_position = 1;
|
||||
|
||||
memset( ent->ph, 0, sizeof( position_history_t ) * HISTORY_MAX );
|
||||
memcpy( &ent->ph[1], &store, sizeof( position_history_t ));
|
||||
memcpy( &ent->ph[0], &store, sizeof( position_history_t ));
|
||||
ent->ph[1] = ent->ph[0] = store;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -752,7 +751,7 @@ static void CL_DeltaEntity( sizebuf_t *msg, frame_t *frame, int newnum, entity_s
|
|||
|
||||
if( has_update )
|
||||
alive = MSG_ReadDeltaEntity( msg, old, state, newnum, delta_type, cl.mtime[0] );
|
||||
else memcpy( state, old, sizeof( entity_state_t ));
|
||||
else *state = *old;
|
||||
|
||||
if( !alive )
|
||||
{
|
||||
|
|
|
@ -1315,7 +1315,7 @@ qboolean UI_LoadProgs( void )
|
|||
gameui.use_extended_api = false;
|
||||
|
||||
// make local copy of engfuncs to prevent overwrite it with user dll
|
||||
memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs ));
|
||||
gpEngfuncs = gEngfuncs;
|
||||
|
||||
gameui.mempool = Mem_AllocPool( "Menu Pool" );
|
||||
|
||||
|
@ -1329,7 +1329,7 @@ qboolean UI_LoadProgs( void )
|
|||
}
|
||||
|
||||
// make local copy of engfuncs to prevent overwrite it with user dll
|
||||
memcpy( &gpExtendedfuncs, &gExtendedfuncs, sizeof( gExtendedfuncs ));
|
||||
gpExtendedfuncs = gExtendedfuncs;
|
||||
memset( &gameui.dllFuncs2, 0, sizeof( gameui.dllFuncs2 ));
|
||||
|
||||
// try to initialize new extended API
|
||||
|
|
|
@ -123,7 +123,7 @@ qboolean Mobile_Init( void )
|
|||
{
|
||||
static mobile_engfuncs_t mobile_engfuncs; // keep a copy, don't let user change engine pointers
|
||||
|
||||
memcpy( &mobile_engfuncs, &gMobileEngfuncs, sizeof( mobile_engfuncs ));
|
||||
mobile_engfuncs = gMobileEngfuncs;
|
||||
|
||||
if( !ExportToClient( &mobile_engfuncs ))
|
||||
{
|
||||
|
|
|
@ -251,7 +251,7 @@ void CL_ParseMovevars( sizebuf_t *msg )
|
|||
if( Q_strcmp( clgame.oldmovevars.skyName, clgame.movevars.skyName ) && cl.video_prepped )
|
||||
R_SetupSky( clgame.movevars.skyName );
|
||||
|
||||
memcpy( &clgame.oldmovevars, &clgame.movevars, sizeof( movevars_t ));
|
||||
clgame.oldmovevars = clgame.movevars;
|
||||
clgame.entities->curstate.scale = clgame.movevars.waveHeight;
|
||||
|
||||
// keep features an actual!
|
||||
|
@ -1403,7 +1403,7 @@ void CL_UpdateUserinfo( sizebuf_t *msg, qboolean legacy )
|
|||
if( !legacy )
|
||||
MSG_ReadBytes( msg, player->hashedcdkey, sizeof( player->hashedcdkey ));
|
||||
|
||||
if( slot == cl.playernum ) memcpy( &gameui.playerinfo, player, sizeof( player_info_t ));
|
||||
if( slot == cl.playernum ) gameui.playerinfo = *player;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -328,7 +328,7 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
|
|||
clgame.movevars.gravity = 800.0f; // quake doesn't write gravity in demos
|
||||
clgame.movevars.maxvelocity = 2000.0f;
|
||||
|
||||
memcpy( &clgame.oldmovevars, &clgame.movevars, sizeof( movevars_t ));
|
||||
clgame.oldmovevars = clgame.movevars;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -715,8 +715,7 @@ static void CL_ParseQuakeBaseline( sizebuf_t *msg )
|
|||
ent = CL_EDICT_NUM( newnum );
|
||||
ent->index = newnum;
|
||||
ent->player = CL_IsPlayerIndex( newnum );
|
||||
memcpy( &ent->baseline, &state, sizeof( entity_state_t ));
|
||||
memcpy( &ent->prevstate, &state, sizeof( entity_state_t ));
|
||||
ent->prevstate = ent->baseline = state;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -491,7 +491,7 @@ static qboolean R_LoadProgs( const char *name )
|
|||
}
|
||||
|
||||
// make local copy of engfuncs to prevent overwrite it with user dll
|
||||
memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs ));
|
||||
gpEngfuncs = gEngfuncs;
|
||||
|
||||
if( GetRefAPI( REF_API_VERSION, &ref.dllFuncs, &gpEngfuncs, &refState ) != REF_API_VERSION )
|
||||
{
|
||||
|
|
|
@ -282,7 +282,7 @@ qboolean VGui_LoadProgs( HINSTANCE hInstance )
|
|||
void (*F)( vguiapi_t* );
|
||||
qboolean client = hInstance != NULL;
|
||||
|
||||
memcpy( &vgui.dllFuncs, &gEngfuncs, sizeof( vgui.dllFuncs ));
|
||||
vgui.dllFuncs = gEngfuncs;
|
||||
|
||||
// not loading interface from client.dll, load vgui_support.dll instead
|
||||
if( !client )
|
||||
|
@ -373,7 +373,7 @@ void VGui_Shutdown( void )
|
|||
COM_FreeLibrary( vgui.hInstance );
|
||||
|
||||
// drop pointers to now unloaded vgui_support
|
||||
memcpy( &vgui.dllFuncs, &gEngfuncs, sizeof( vgui.dllFuncs ));
|
||||
vgui.dllFuncs = gEngfuncs;
|
||||
vgui.hInstance = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue