2016-06-04 15:24:23 +02:00
|
|
|
/***
|
|
|
|
*
|
|
|
|
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
|
|
|
*
|
|
|
|
* This product contains software technology licensed from Id
|
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use, distribution, and modification of this source code and/or resulting
|
|
|
|
* object code is restricted to non-commercial enhancements to products from
|
|
|
|
* Valve LLC. All other use, distribution, or modification is prohibited
|
|
|
|
* without written permission from Valve LLC.
|
|
|
|
*
|
|
|
|
****/
|
|
|
|
//
|
|
|
|
// hud_update.cpp
|
|
|
|
//
|
|
|
|
|
2019-10-13 15:37:32 +02:00
|
|
|
#include <cmath>
|
2016-06-04 15:24:23 +02:00
|
|
|
#include "hud.h"
|
|
|
|
#include "cl_util.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int CL_ButtonBits( int );
|
|
|
|
void CL_ResetButtonBits( int bits );
|
|
|
|
|
|
|
|
extern float v_idlescale;
|
|
|
|
float in_fov;
|
|
|
|
extern void HUD_SetCmdBits( int bits );
|
|
|
|
|
2016-07-03 15:39:55 +02:00
|
|
|
int CHud::UpdateClientData( client_data_t *cdata, float time )
|
2016-06-04 15:24:23 +02:00
|
|
|
{
|
2016-07-03 15:39:55 +02:00
|
|
|
memcpy( m_vecOrigin, cdata->origin, sizeof(vec3_t) );
|
|
|
|
memcpy( m_vecAngles, cdata->viewangles, sizeof(vec3_t) );
|
|
|
|
|
2016-06-04 15:24:23 +02:00
|
|
|
m_iKeyBits = CL_ButtonBits( 0 );
|
|
|
|
m_iWeaponBits = cdata->iWeaponBits;
|
|
|
|
|
|
|
|
in_fov = cdata->fov;
|
|
|
|
|
|
|
|
Think();
|
|
|
|
|
|
|
|
cdata->fov = m_iFOV;
|
2016-07-03 15:39:55 +02:00
|
|
|
|
2016-06-04 15:24:23 +02:00
|
|
|
v_idlescale = m_iConcussionEffect;
|
|
|
|
|
|
|
|
CL_ResetButtonBits( m_iKeyBits );
|
|
|
|
|
|
|
|
// return 1 if in anything in the client_data struct has been changed, 0 otherwise
|
|
|
|
return 1;
|
|
|
|
}
|