Skip to content

Commit

Permalink
WIP: fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nillerusr committed Oct 26, 2023
1 parent 2011179 commit 91a76f2
Show file tree
Hide file tree
Showing 28 changed files with 1,666 additions and 19 deletions.
38 changes: 38 additions & 0 deletions game/public/game/client/IGameClientExports.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//

#ifndef IGAMECLIENTEXPORTS_H
#define IGAMECLIENTEXPORTS_H
#ifdef _WIN32
#pragma once
#endif

#include "interface.h"

//-----------------------------------------------------------------------------
// Purpose: Exports a set of functions for the GameUI interface to interact with the game client
//-----------------------------------------------------------------------------
abstract_class IGameClientExports : public IBaseInterface
{
public:
// ingame voice manipulation
virtual bool IsPlayerGameVoiceMuted(int playerIndex) = 0;
virtual void MutePlayerGameVoice(int playerIndex) = 0;
virtual void UnmutePlayerGameVoice(int playerIndex) = 0;

// notification of gameui state changes
virtual void OnGameUIActivated() = 0;
virtual void OnGameUIHidden() = 0;

// if true, the gameui applies the blur effect
virtual bool ClientWantsBlurEffect( void ) = 0;
};

#define GAMECLIENTEXPORTS_INTERFACE_VERSION "GameClientExports001"


#endif // IGAMECLIENTEXPORTS_H
41 changes: 41 additions & 0 deletions game/public/game/client/iclientrendertargets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Exposes interfaces to the engine which allow the client to setup their own render targets
// during the proper period of material system's init.
//
// $NoKeywords: $
//=============================================================================//

#ifndef ICLIENTRENDERTARGETS_H
#define ICLIENTRENDERTARGETS_H
#ifdef _WIN32
#pragma once
#endif

#include "interface.h" // For base interface

class IMaterialSystem;
class IMaterialSystemHardwareConfig;

//---------------------------------------------------------------------------------------------------
// Purpose: Exposes interfaces to the engine which allow the client to setup their own render targets
// during the proper period of material system's init.
//---------------------------------------------------------------------------------------------------
abstract_class IClientRenderTargets
{
public:
// Pass the material system interface to the client-- Their Material System singleton has not been created
// at the time they receive this call.
virtual void InitClientRenderTargets( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig ) = 0;

// Call shutdown on every created refrence-- Clients keep track of this themselves
// and should add shutdown code to this function whenever they add a new render target.
virtual void ShutdownClientRenderTargets( void ) = 0;

};

#define CLIENTRENDERTARGETS_INTERFACE_VERSION "ClientRenderTargets001"

extern IClientRenderTargets * g_pClientRenderTargets;

#endif // ICLIENTRENDERTARGETS_H
68 changes: 68 additions & 0 deletions game/public/game/client/iviewport.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//
#if !defined( IVIEWPORT_H )
#define IVIEWPORT_H
#ifdef _WIN32
#pragma once
#endif

#include <vgui/VGUI.h>

#include "viewport_panel_names.h"

class KeyValues;

abstract_class IViewPortPanel
{

public:
virtual ~IViewPortPanel() {};

virtual const char *GetName( void ) = 0;// return identifer name
virtual void SetData(KeyValues *data) = 0; // set ViewPortPanel data
virtual void Reset( void ) = 0; // clears internal state, deactivates it
virtual void Update( void ) = 0; // updates all (size, position, content, etc)
virtual bool NeedsUpdate( void ) = 0; // query panel if content needs to be updated
virtual bool HasInputElements( void ) = 0; // true if panel contains elments which accepts input
virtual void ReloadScheme( void ) {}
virtual bool CanReplace( const char *panelName ) const { return true; } // returns true if this panel can appear on top of the given panel
virtual bool CanBeReopened( void ) const { return true; } // returns true if this panel can be re-opened after being hidden by another panel

virtual void ShowPanel( bool state ) = 0; // activate VGUI Frame

// VGUI functions:
virtual vgui::VPANEL GetVPanel( void ) = 0; // returns VGUI panel handle
virtual bool IsVisible() = 0; // true if panel is visible
virtual void SetParent( vgui::VPANEL parent ) = 0;

virtual bool WantsBackgroundBlurred( void ) = 0;
};

abstract_class IViewPort
{
public:
virtual void UpdateAllPanels( void ) = 0;
virtual void ShowPanel( const char *pName, bool state, KeyValues *data, bool autoDeleteData = true ) = 0;
virtual void ShowPanel( const char *pName, bool state ) = 0;
virtual void ShowPanel( IViewPortPanel* pPanel, bool state ) = 0;
virtual void ShowBackGround(bool bShow) = 0;
virtual IViewPortPanel* FindPanelByName(const char *szPanelName) = 0;
virtual IViewPortPanel* GetActivePanel( void ) = 0;
virtual void RecreatePanel( const char *szPanelName ) = 0;
virtual void PostMessageToPanel( const char *pName, KeyValues *pKeyValues ) = 0;
};

extern IViewPort *GetViewPortInterface();
extern IViewPort *GetFullscreenViewPortInterface();

#endif // IVIEWPORT_H
198 changes: 198 additions & 0 deletions game/public/game/server/iplayerinfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: provides an interface for dlls to query information about players from the game dll
//
//=============================================================================//
#ifndef IPLAYERINFO_H
#define IPLAYERINFO_H
#ifdef _WIN32
#pragma once
#endif

#include "mathlib/vector.h"

// helper class for user commands
class CBotCmd
{
public:
CBotCmd()
{
Reset();
}

virtual ~CBotCmd() { };

void Reset()
{
command_number = 0;
tick_count = 0;
viewangles.Init();
forwardmove = 0.0f;
sidemove = 0.0f;
upmove = 0.0f;
buttons = 0;
impulse = 0;
weaponselect = 0;
weaponsubtype = 0;
random_seed = 0;
mousedx = 0;
mousedy = 0;

hasbeenpredicted = false;
}

CBotCmd& operator =( const CBotCmd& src )
{
if ( this == &src )
return *this;

command_number = src.command_number;
tick_count = src.tick_count;
viewangles = src.viewangles;
forwardmove = src.forwardmove;
sidemove = src.sidemove;
upmove = src.upmove;
buttons = src.buttons;
impulse = src.impulse;
weaponselect = src.weaponselect;
weaponsubtype = src.weaponsubtype;
random_seed = src.random_seed;
mousedx = src.mousedx;
mousedy = src.mousedy;
hasbeenpredicted = src.hasbeenpredicted;
return *this;
}

// For matching server and client commands for debugging
int command_number;

// the tick the client created this command
int tick_count;

// Player instantaneous view angles.
QAngle viewangles;
// Intended velocities
// forward velocity.
float forwardmove;
// sideways velocity.
float sidemove;
// upward velocity.
float upmove;
// Attack button states
int buttons;
// Impulse command issued.
byte impulse;
// Current weapon id
int weaponselect;
int weaponsubtype;

int random_seed; // For shared random functions

short mousedx; // mouse accum in x from create move
short mousedy; // mouse accum in y from create move

// Client only, tracks whether we've predicted this command at least once
bool hasbeenpredicted;
};




abstract_class IPlayerInfo
{
public:
// returns the players name (UTF-8 encoded)
virtual const char *GetName() = 0;
// returns the userid (slot number)
virtual int GetUserID() = 0;
// returns the string of their network (i.e Steam) ID
virtual const char *GetNetworkIDString() = 0;
// returns the team the player is on
virtual int GetTeamIndex() = 0;
// changes the player to a new team (if the game dll logic allows it)
virtual void ChangeTeam( int iTeamNum ) = 0;
// returns the number of kills this player has (exact meaning is mod dependent)
virtual int GetFragCount() = 0;
// returns the number of deaths this player has (exact meaning is mod dependent)
virtual int GetDeathCount() = 0;
// returns if this player slot is actually valid
virtual bool IsConnected() = 0;
// returns the armor/health of the player (exact meaning is mod dependent)
virtual int GetArmorValue() = 0;

// extensions added to V2

// various player flags
virtual bool IsHLTV() = 0;
#if defined( REPLAY_ENABLED )
virtual bool IsReplay() = 0;
#endif
virtual bool IsPlayer() = 0;
virtual bool IsFakeClient() = 0;
virtual bool IsDead() = 0;
virtual bool IsInAVehicle() = 0;
virtual bool IsObserver() = 0;

// player position and size
virtual const Vector GetAbsOrigin() = 0;
virtual const QAngle GetAbsAngles() = 0;
virtual const Vector GetPlayerMins() = 0;
virtual const Vector GetPlayerMaxs() = 0;
// the name of the weapon currently being carried
virtual const char *GetWeaponName() = 0;
// the name of the player model in use
virtual const char *GetModelName() = 0;
// current player health
virtual const int GetHealth() = 0;
// max health value
virtual const int GetMaxHealth() = 0;
// the last user input from this player
virtual CBotCmd GetLastUserCommand() = 0;
};


#define INTERFACEVERSION_PLAYERINFOMANAGER "PlayerInfoManager002"
abstract_class IPlayerInfoManager
{
public:
virtual IPlayerInfo *GetPlayerInfo( edict_t *pEdict ) = 0;
virtual CGlobalVars *GetGlobalVars() = 0;
};




abstract_class IBotController
{
public:
// change the bots position
virtual void SetAbsOrigin( Vector & vec ) = 0;
virtual void SetAbsAngles( QAngle & ang ) = 0;
virtual void SetLocalOrigin( const Vector& origin ) = 0;
virtual const Vector GetLocalOrigin( void ) = 0;
virtual void SetLocalAngles( const QAngle& angles ) = 0;
virtual const QAngle GetLocalAngles( void ) = 0;

// strip them of weapons, etc
virtual void RemoveAllItems( bool removeSuit ) = 0;
// give them a weapon
virtual void SetActiveWeapon( const char *WeaponName ) = 0;
// called after running a move command
virtual void PostClientMessagesSent( void ) = 0;
// check various effect flags
virtual bool IsEFlagSet( int nEFlagMask ) = 0;
// fire a virtual move command to the bot
virtual void RunPlayerMove( CBotCmd *ucmd ) = 0;
};


#define INTERFACEVERSION_PLAYERBOTMANAGER "BotManager001"
abstract_class IBotManager
{
public:
virtual IBotController *GetBotController( edict_t *pEdict ) = 0;
// create a new bot and spawn it into the server
virtual edict_t *CreateBot( const char *botname ) = 0;
};

#endif // IPLAYERINFO_H
2 changes: 1 addition & 1 deletion game/server/ai_behavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "ai_component.h"
#include "ai_basenpc.h"
#include "ai_default.h"
#include "AI_Criteria.h"
#include "ai_criteria.h"
#include "networkvar.h"
#include "delegates.h"
#include "tier1/utlvector.h"
Expand Down
2 changes: 1 addition & 1 deletion game/server/ai_expresserfollowup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "basemultiplayerplayer.h"
#include "ai_baseactor.h"
//#include "flex_expresser.h"
#include "scenefilecache/iscenefilecache.h"
#include "scenefilecache/ISceneFileCache.h"
/*
#include "engine/ienginesound.h"
#include "keyvalues.h"
Expand Down
1 change: 0 additions & 1 deletion game/server/nav_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ class CVisPairHashFuncs

unsigned int operator()( const NavVisPair_t &item ) const
{
COMPILE_TIME_ASSERT( sizeof(CNavArea *) == 4 );
int key[2] = { (int)item.pAreas[0] + item.pAreas[1]->GetID(), (int)item.pAreas[1] + item.pAreas[0]->GetID() };
return Hash8( key );
}
Expand Down
3 changes: 2 additions & 1 deletion game/server/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ def build(bld):

includes = [
'.',
'../public',
'../shared',
'../../utils/common',
'../shared/econ',
'NextBot',
'../../common',
'../../public/tier0',
'../../public/tier1',
'../../public'
'../../public',
]

defines = []
Expand Down
Loading

0 comments on commit 91a76f2

Please sign in to comment.