Skip to content

Commit

Permalink
Timer message hooked. Made g_iIsAg variable wide available.
Browse files Browse the repository at this point in the history
  • Loading branch information
LevShisterov committed Mar 16, 2017
1 parent 5ffd8f4 commit 5b36c9c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 5 deletions.
2 changes: 0 additions & 2 deletions cl_dll/cdll_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ TeamFortressViewport *gViewPort = NULL;
PVOID hVehHandler = NULL;
bool g_bDllDetaching = false;

extern "C" int g_iIsAg;

void InitInput (void);
void ShutdownInput (void);
void EV_HookEvents( void );
Expand Down
2 changes: 2 additions & 0 deletions cl_dll/cl_dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf);
#include "../dlls/cdll_dll.h"

extern cl_enginefunc_t gEngfuncs;

extern "C" int g_iIsAg;
2 changes: 2 additions & 0 deletions cl_dll/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ class CHudTimer: public CHudBase
void Think(void);
int Draw(float flTime);

static int MsgFunc_Timer(const char *pszName, int iSize, void *pbuf);

void DoResync(void);
void ReadDemoTimerBuffer(int type, const unsigned char *buffer);
void CustomTimerCommand(void);
Expand Down
14 changes: 14 additions & 0 deletions cl_dll/hud_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ enum RulesRequestStatus
SOCKET g_timerSocket = NULL; // We will declare socket here to not include winsocks in hud.h


DECLARE_MESSAGE(m_Timer, Timer)

int CHudTimer::Init(void)
{
if (g_iIsAg)
HOOK_MESSAGE(Timer);

gHUD.AddHudElem(this);

m_iFlags |= HUD_ACTIVE;
Expand Down Expand Up @@ -86,6 +91,15 @@ int CHudTimer::VidInit(void)
return 1;
};

int CHudTimer::MsgFunc_Timer(const char *pszName, int iSize, void *pbuf)
{
//BEGIN_READ(pbuf, iSize);
//int timelimit = READ_LONG();
//int effectiveTime = READ_LONG();

return 1;
}

void CHudTimer::DoResync(void)
{
m_bDelayTimeleftReading = true;
Expand Down
1 change: 0 additions & 1 deletion cl_dll/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ extern "C"
float vecNewViewOrigin[3];
int iHasNewViewOrigin;
int iIsSpectator;
extern int g_iIsAg;
}

#ifndef M_PI
Expand Down
2 changes: 0 additions & 2 deletions dlls/h_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
enginefuncs_t g_engfuncs;
globalvars_t *gpGlobals;

extern "C" int g_iIsAg;

#ifdef _WIN32

// Required DLL entry point
Expand Down
1 change: 1 addition & 0 deletions dlls/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
inline void MESSAGE_BEGIN( int msg_dest, int msg_type, const float *pOrigin, entvars_t *ent ); // implementation later in this file

extern globalvars_t *gpGlobals;
extern "C" int g_iIsAg;

// Use this instead of ALLOC_STRING on constant strings
#define STRING(offset) (const char *)(gpGlobals->pStringBase + (int)offset)
Expand Down

0 comments on commit 5b36c9c

Please sign in to comment.