halflife-sdk/cl_dll/hud_update.cpp

55 lines
1.3 KiB
C++
Raw Normal View History

1999-04-07 00:00:00 +00:00
/***
*
* Copyright (c) 1999, 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
//
#include <math.h>
#include "hud.h"
2000-06-05 00:00:00 +00:00
#include "cl_util.h"
1999-04-07 00:00:00 +00:00
#include <stdlib.h>
2000-06-05 00:00:00 +00:00
#include <memory.h>
1999-04-07 00:00:00 +00:00
2000-06-05 00:00:00 +00:00
int CL_ButtonBits( int );
void CL_ResetButtonBits( int bits );
1999-04-07 00:00:00 +00:00
2000-06-05 00:00:00 +00:00
extern float v_idlescale;
float in_fov;
extern void HUD_SetCmdBits( int bits );
1999-04-07 00:00:00 +00:00
int CHud::UpdateClientData(client_data_t *cdata, float time)
{
memcpy(m_vecOrigin, cdata->origin, sizeof(vec3_t));
memcpy(m_vecAngles, cdata->viewangles, sizeof(vec3_t));
2000-06-05 00:00:00 +00:00
m_iKeyBits = CL_ButtonBits( 0 );
1999-04-07 00:00:00 +00:00
m_iWeaponBits = cdata->iWeaponBits;
2000-06-05 00:00:00 +00:00
in_fov = cdata->fov;
Think();
1999-04-07 00:00:00 +00:00
cdata->fov = m_iFOV;
2000-06-05 00:00:00 +00:00
v_idlescale = m_iConcussionEffect;
1999-04-07 00:00:00 +00:00
2000-06-05 00:00:00 +00:00
CL_ResetButtonBits( m_iKeyBits );
1999-04-07 00:00:00 +00:00
// return 1 if in anything in the client_data struct has been changed, 0 otherwise
return 1;
}