Add project files.
This commit is contained in:
parent
0f707d3e9c
commit
cc97077a9c
1862 changed files with 459070 additions and 0 deletions
43
LICENSE
Normal file
43
LICENSE
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
SOURCE 1 SDK LICENSE
|
||||
|
||||
Source SDK Copyright(c) Valve Corp.
|
||||
|
||||
THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE
|
||||
CORPORATION ("Valve"). PLEASE READ IT BEFORE DOWNLOADING OR USING
|
||||
THE SOURCE ENGINE SDK ("SDK"). BY DOWNLOADING AND/OR USING THE
|
||||
SOURCE ENGINE SDK YOU ACCEPT THIS LICENSE. IF YOU DO NOT AGREE TO
|
||||
THE TERMS OF THIS LICENSE PLEASE DON’T DOWNLOAD OR USE THE SDK.
|
||||
|
||||
You may, free of charge, download and use the SDK to develop a modified Valve game
|
||||
running on the Source engine. You may distribute your modified Valve game in source and
|
||||
object code form, but only for free. Terms of use for Valve games are found in the Steam
|
||||
Subscriber Agreement located here: http://store.steampowered.com/subscriber_agreement/
|
||||
|
||||
You may copy, modify, and distribute the SDK and any modifications you make to the
|
||||
SDK in source and object code form, but only for free. Any distribution of this SDK must
|
||||
include this LICENSE file and thirdpartylegalnotices.txt.
|
||||
|
||||
Any distribution of the SDK or a substantial portion of the SDK must include the above
|
||||
copyright notice and the following:
|
||||
|
||||
DISCLAIMER OF WARRANTIES. THE SOURCE SDK AND ANY
|
||||
OTHER MATERIAL DOWNLOADED BY LICENSEE IS PROVIDED
|
||||
"AS IS". VALVE AND ITS SUPPLIERS DISCLAIM ALL
|
||||
WARRANTIES WITH RESPECT TO THE SDK, EITHER EXPRESS
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT,
|
||||
TITLE AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
LIMITATION OF LIABILITY. IN NO EVENT SHALL VALVE OR
|
||||
ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER
|
||||
(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
|
||||
BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
|
||||
BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
|
||||
ARISING OUT OF THE USE OF OR INABILITY TO USE THE
|
||||
ENGINE AND/OR THE SDK, EVEN IF VALVE HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
|
||||
If you would like to use the SDK for a commercial purpose, please contact Valve at
|
||||
sourceengine@valvesoftware.com.
|
||||
121
common/GameUI/IGameUI.h
Normal file
121
common/GameUI/IGameUI.h
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef IGAMEUI_H
|
||||
#define IGAMEUI_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "interface.h"
|
||||
#include "vgui/IPanel.h"
|
||||
|
||||
#if !defined( _X360 )
|
||||
#include "xbox/xboxstubs.h"
|
||||
#endif
|
||||
|
||||
// reasons why the user can't connect to a game server
|
||||
enum ESteamLoginFailure
|
||||
{
|
||||
STEAMLOGINFAILURE_NONE,
|
||||
STEAMLOGINFAILURE_BADTICKET,
|
||||
STEAMLOGINFAILURE_NOSTEAMLOGIN,
|
||||
STEAMLOGINFAILURE_VACBANNED,
|
||||
STEAMLOGINFAILURE_LOGGED_IN_ELSEWHERE
|
||||
};
|
||||
|
||||
enum ESystemNotify
|
||||
{
|
||||
SYSTEMNOTIFY_STORAGEDEVICES_CHANGED,
|
||||
SYSTEMNOTIFY_USER_SIGNEDIN,
|
||||
SYSTEMNOTIFY_USER_SIGNEDOUT,
|
||||
SYSTEMNOTIFY_XUIOPENING,
|
||||
SYSTEMNOTIFY_XUICLOSED,
|
||||
SYSTEMNOTIFY_INVITE_SHUTDOWN, // Cross-game invite is causing us to shutdown
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: contains all the functions that the GameUI dll exports
|
||||
//-----------------------------------------------------------------------------
|
||||
abstract_class IGameUI
|
||||
{
|
||||
public:
|
||||
// initialization/shutdown
|
||||
virtual void Initialize( CreateInterfaceFn appFactory ) = 0;
|
||||
virtual void PostInit() = 0;
|
||||
|
||||
// connect to other interfaces at the same level (gameui.dll/server.dll/client.dll)
|
||||
virtual void Connect( CreateInterfaceFn gameFactory ) = 0;
|
||||
|
||||
virtual void Start() = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// notifications
|
||||
virtual void OnGameUIActivated() = 0;
|
||||
virtual void OnGameUIHidden() = 0;
|
||||
|
||||
// OLD: Use OnConnectToServer2
|
||||
virtual void OLD_OnConnectToServer(const char *game, int IP, int port) = 0;
|
||||
|
||||
virtual void OnDisconnectFromServer_OLD( uint8 eSteamLoginFailure, const char *username ) = 0;
|
||||
virtual void OnLevelLoadingStarted(bool bShowProgressDialog) = 0;
|
||||
virtual void OnLevelLoadingFinished(bool bError, const char *failureReason, const char *extendedReason) = 0;
|
||||
|
||||
// level loading progress, returns true if the screen needs updating
|
||||
virtual bool UpdateProgressBar(float progress, const char *statusText) = 0;
|
||||
// Shows progress desc, returns previous setting... (used with custom progress bars )
|
||||
virtual bool SetShowProgressText( bool show ) = 0;
|
||||
|
||||
// !!!!!!!!!members added after "GameUI011" initial release!!!!!!!!!!!!!!!!!!!
|
||||
virtual void ShowNewGameDialog( int chapter ) = 0;
|
||||
|
||||
// Xbox 360
|
||||
virtual void SessionNotification( const int notification, const int param = 0 ) = 0;
|
||||
virtual void SystemNotification( const int notification ) = 0;
|
||||
virtual void ShowMessageDialog( const uint nType, vgui::Panel *pOwner ) = 0;
|
||||
virtual void UpdatePlayerInfo( uint64 nPlayerId, const char *pName, int nTeam, byte cVoiceState, int nPlayersNeeded, bool bHost ) = 0;
|
||||
virtual void SessionSearchResult( int searchIdx, void *pHostData, XSESSION_SEARCHRESULT *pResult, int ping ) = 0;
|
||||
virtual void OnCreditsFinished( void ) = 0;
|
||||
|
||||
// inserts specified panel as background for level load dialog
|
||||
virtual void SetLoadingBackgroundDialog( vgui::VPANEL panel ) = 0;
|
||||
|
||||
// Bonus maps interfaces
|
||||
virtual void BonusMapUnlock( const char *pchFileName = NULL, const char *pchMapName = NULL ) = 0;
|
||||
virtual void BonusMapComplete( const char *pchFileName = NULL, const char *pchMapName = NULL ) = 0;
|
||||
virtual void BonusMapChallengeUpdate( const char *pchFileName, const char *pchMapName, const char *pchChallengeName, int iBest ) = 0;
|
||||
virtual void BonusMapChallengeNames( char *pchFileName, char *pchMapName, char *pchChallengeName ) = 0;
|
||||
virtual void BonusMapChallengeObjectives( int &iBronze, int &iSilver, int &iGold ) = 0;
|
||||
virtual void BonusMapDatabaseSave( void ) = 0;
|
||||
virtual int BonusMapNumAdvancedCompleted( void ) = 0;
|
||||
virtual void BonusMapNumMedals( int piNumMedals[ 3 ] ) = 0;
|
||||
|
||||
virtual void OnConnectToServer2(const char *game, int IP, int connectionPort, int queryPort) = 0;
|
||||
|
||||
// X360 Storage device validation:
|
||||
// returns true right away if storage device has been previously selected.
|
||||
// otherwise returns false and will set the variable pointed by pStorageDeviceValidated to 1
|
||||
// once the storage device is selected by user.
|
||||
virtual bool ValidateStorageDevice( int *pStorageDeviceValidated ) = 0;
|
||||
|
||||
virtual void SetProgressOnStart() = 0;
|
||||
virtual void OnDisconnectFromServer( uint8 eSteamLoginFailure ) = 0;
|
||||
|
||||
virtual void OnConfirmQuit( void ) = 0;
|
||||
|
||||
virtual bool IsMainMenuVisible( void ) = 0;
|
||||
|
||||
// Client DLL is providing us with a panel that it wants to replace the main menu with
|
||||
virtual void SetMainMenuOverride( vgui::VPANEL panel ) = 0;
|
||||
// Client DLL is telling us that a main menu command was issued, probably from its custom main menu panel
|
||||
virtual void SendMainMenuCommand( const char *pszCommand ) = 0;
|
||||
};
|
||||
|
||||
#define GAMEUI_INTERFACE_VERSION "GameUI011"
|
||||
|
||||
#endif // IGAMEUI_H
|
||||
703
common/SteamCommon.h
Normal file
703
common/SteamCommon.h
Normal file
|
|
@ -0,0 +1,703 @@
|
|||
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
/*
|
||||
** The copyright to the contents herein is the property of Valve Corporation.
|
||||
** The contents may be used and/or copied only with the written permission of
|
||||
** Valve, or in accordance with the terms and conditions stipulated in
|
||||
** the agreement/contract under which the contents have been supplied.
|
||||
**
|
||||
*******************************************************************************
|
||||
**
|
||||
** Contents:
|
||||
**
|
||||
** Common types used in the Steam DLL interface.
|
||||
**
|
||||
** This file is distributed to Steam application developers.
|
||||
**
|
||||
**
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef INCLUDED_STEAM_COMMON_STEAMCOMMON_H
|
||||
#define INCLUDED_STEAM_COMMON_STEAMCOMMON_H
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER > 1000)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Applications should not define STEAM_EXPORTS. */
|
||||
|
||||
#if defined ( _WIN32 )
|
||||
|
||||
#ifdef STEAM_EXPORTS
|
||||
#define STEAM_API __declspec(dllexport)
|
||||
#else
|
||||
#define STEAM_API __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#define STEAM_CALL __cdecl
|
||||
|
||||
#else
|
||||
|
||||
#define STEAM_API /* */
|
||||
#define STEAM_CALL /* */
|
||||
|
||||
#endif
|
||||
|
||||
typedef void (STEAM_CALL *KeyValueIteratorCallback_t )(const char *Key, const char *Val, void *pvParam);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Exported macros and constants
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/* DEPRECATED -- these are ignored now, all API access is granted on SteamStartup */
|
||||
#define STEAM_USING_FILESYSTEM (0x00000001)
|
||||
#define STEAM_USING_LOGGING (0x00000002)
|
||||
#define STEAM_USING_USERID (0x00000004)
|
||||
#define STEAM_USING_ACCOUNT (0x00000008)
|
||||
#define STEAM_USING_ALL (0x0000000f)
|
||||
/* END DEPRECATED */
|
||||
|
||||
#define STEAM_MAX_PATH (255)
|
||||
#define STEAM_QUESTION_MAXLEN (255)
|
||||
#define STEAM_SALT_SIZE (8)
|
||||
#define STEAM_PROGRESS_PERCENT_SCALE (0x00001000)
|
||||
|
||||
/* These are maximum significant string lengths, excluding nul-terminator. */
|
||||
#define STEAM_CARD_NUMBER_SIZE (17)
|
||||
#define STEAM_CARD_HOLDERNAME_SIZE (100)
|
||||
#define STEAM_CARD_EXPYEAR_SIZE (4)
|
||||
#define STEAM_CARD_EXPMONTH_SIZE (2)
|
||||
#define STEAM_CARD_CVV2_SIZE (5)
|
||||
#define STEAM_BILLING_ADDRESS1_SIZE (128)
|
||||
#define STEAM_BILLING_ADDRESS2_SIZE (128)
|
||||
#define STEAM_BILLING_CITY_SIZE (50)
|
||||
#define STEAM_BILLING_ZIP_SIZE (16)
|
||||
#define STEAM_BILLING_STATE_SIZE (32)
|
||||
#define STEAM_BILLING_COUNTRY_SIZE (32)
|
||||
#define STEAM_BILLING_PHONE_SIZE (20)
|
||||
#define STEAM_BILLING_EMAIL_ADDRESS_SIZE (100)
|
||||
#define STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE (20)
|
||||
#define STEAM_PROOF_OF_PURCHASE_TOKEN_SIZE (200)
|
||||
#define STEAM_EXTERNAL_ACCOUNTNAME_SIZE (100)
|
||||
#define STEAM_EXTERNAL_ACCOUNTPASSWORD_SIZE (80)
|
||||
#define STEAM_BILLING_CONFIRMATION_CODE_SIZE (22)
|
||||
#define STEAM_BILLING_CARD_APPROVAL_CODE_SIZE (100)
|
||||
#define STEAM_BILLING_TRANS_DATE_SIZE (9) // mm/dd/yy
|
||||
#define STEAM_BILLING_TRANS_TIME_SIZE (9) // hh:mm:ss
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Scalar type and enumerated type definitions.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
typedef unsigned int SteamHandle_t;
|
||||
|
||||
typedef void * SteamUserIDTicketValidationHandle_t;
|
||||
|
||||
typedef unsigned int SteamCallHandle_t;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
typedef unsigned __int64 SteamUnsigned64_t;
|
||||
#else
|
||||
typedef unsigned long long SteamUnsigned64_t;
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamSeekMethodSet = 0,
|
||||
eSteamSeekMethodCur = 1,
|
||||
eSteamSeekMethodEnd = 2
|
||||
} ESteamSeekMethod;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamBufferMethodFBF = 0,
|
||||
eSteamBufferMethodNBF = 1
|
||||
} ESteamBufferMethod;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamErrorNone = 0,
|
||||
eSteamErrorUnknown = 1,
|
||||
eSteamErrorLibraryNotInitialized = 2,
|
||||
eSteamErrorLibraryAlreadyInitialized = 3,
|
||||
eSteamErrorConfig = 4,
|
||||
eSteamErrorContentServerConnect = 5,
|
||||
eSteamErrorBadHandle = 6,
|
||||
eSteamErrorHandlesExhausted = 7,
|
||||
eSteamErrorBadArg = 8,
|
||||
eSteamErrorNotFound = 9,
|
||||
eSteamErrorRead = 10,
|
||||
eSteamErrorEOF = 11,
|
||||
eSteamErrorSeek = 12,
|
||||
eSteamErrorCannotWriteNonUserConfigFile = 13,
|
||||
eSteamErrorCacheOpen = 14,
|
||||
eSteamErrorCacheRead = 15,
|
||||
eSteamErrorCacheCorrupted = 16,
|
||||
eSteamErrorCacheWrite = 17,
|
||||
eSteamErrorCacheSession = 18,
|
||||
eSteamErrorCacheInternal = 19,
|
||||
eSteamErrorCacheBadApp = 20,
|
||||
eSteamErrorCacheVersion = 21,
|
||||
eSteamErrorCacheBadFingerPrint = 22,
|
||||
|
||||
eSteamErrorNotFinishedProcessing = 23,
|
||||
eSteamErrorNothingToDo = 24,
|
||||
eSteamErrorCorruptEncryptedUserIDTicket = 25,
|
||||
eSteamErrorSocketLibraryNotInitialized = 26,
|
||||
eSteamErrorFailedToConnectToUserIDTicketValidationServer = 27,
|
||||
eSteamErrorBadProtocolVersion = 28,
|
||||
eSteamErrorReplayedUserIDTicketFromClient = 29,
|
||||
eSteamErrorReceiveResultBufferTooSmall = 30,
|
||||
eSteamErrorSendFailed = 31,
|
||||
eSteamErrorReceiveFailed = 32,
|
||||
eSteamErrorReplayedReplyFromUserIDTicketValidationServer = 33,
|
||||
eSteamErrorBadSignatureFromUserIDTicketValidationServer = 34,
|
||||
eSteamErrorValidationStalledSoAborted = 35,
|
||||
eSteamErrorInvalidUserIDTicket = 36,
|
||||
eSteamErrorClientLoginRateTooHigh = 37,
|
||||
eSteamErrorClientWasNeverValidated = 38,
|
||||
eSteamErrorInternalSendBufferTooSmall = 39,
|
||||
eSteamErrorInternalReceiveBufferTooSmall = 40,
|
||||
eSteamErrorUserTicketExpired = 41,
|
||||
eSteamErrorCDKeyAlreadyInUseOnAnotherClient = 42,
|
||||
|
||||
eSteamErrorNotLoggedIn = 101,
|
||||
eSteamErrorAlreadyExists = 102,
|
||||
eSteamErrorAlreadySubscribed = 103,
|
||||
eSteamErrorNotSubscribed = 104,
|
||||
eSteamErrorAccessDenied = 105,
|
||||
eSteamErrorFailedToCreateCacheFile = 106,
|
||||
eSteamErrorCallStalledSoAborted = 107,
|
||||
eSteamErrorEngineNotRunning = 108,
|
||||
eSteamErrorEngineConnectionLost = 109,
|
||||
eSteamErrorLoginFailed = 110,
|
||||
eSteamErrorAccountPending = 111,
|
||||
eSteamErrorCacheWasMissingRetry = 112,
|
||||
eSteamErrorLocalTimeIncorrect = 113,
|
||||
eSteamErrorCacheNeedsDecryption = 114,
|
||||
eSteamErrorAccountDisabled = 115,
|
||||
eSteamErrorCacheNeedsRepair = 116,
|
||||
eSteamErrorRebootRequired = 117,
|
||||
|
||||
eSteamErrorNetwork = 200,
|
||||
eSteamErrorOffline = 201
|
||||
|
||||
|
||||
} ESteamError;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eNoDetailedErrorAvailable,
|
||||
eStandardCerrno,
|
||||
eWin32LastError,
|
||||
eWinSockLastError,
|
||||
eDetailedPlatformErrorCount
|
||||
} EDetailedPlatformErrorType;
|
||||
|
||||
typedef enum /* Filter elements returned by SteamFind{First,Next} */
|
||||
{
|
||||
eSteamFindLocalOnly, /* limit search to local filesystem */
|
||||
eSteamFindRemoteOnly, /* limit search to remote repository */
|
||||
eSteamFindAll /* do not limit search (duplicates allowed) */
|
||||
} ESteamFindFilter;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Exported structure and complex type definitions.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ESteamError eSteamError;
|
||||
EDetailedPlatformErrorType eDetailedErrorType;
|
||||
int nDetailedErrorCode;
|
||||
char szDesc[STEAM_MAX_PATH];
|
||||
} TSteamError;
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int bIsDir; /* If non-zero, element is a directory; if zero, element is a file */
|
||||
unsigned int uSizeOrCount; /* If element is a file, this contains size of file in bytes */
|
||||
int bIsLocal; /* If non-zero, reported item is a standalone element on local filesystem */
|
||||
char cszName[STEAM_MAX_PATH]; /* Base element name (no path) */
|
||||
long lLastAccessTime; /* Seconds since 1/1/1970 (like time_t) when element was last accessed */
|
||||
long lLastModificationTime; /* Seconds since 1/1/1970 (like time_t) when element was last modified */
|
||||
long lCreationTime; /* Seconds since 1/1/1970 (like time_t) when element was created */
|
||||
} TSteamElemInfo;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int uNumSubscriptions;
|
||||
unsigned int uMaxNameChars;
|
||||
unsigned int uMaxApps;
|
||||
|
||||
} TSteamSubscriptionStats;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int uNumApps;
|
||||
unsigned int uMaxNameChars;
|
||||
unsigned int uMaxInstallDirNameChars;
|
||||
unsigned int uMaxVersionLabelChars;
|
||||
unsigned int uMaxLaunchOptions;
|
||||
unsigned int uMaxLaunchOptionDescChars;
|
||||
unsigned int uMaxLaunchOptionCmdLineChars;
|
||||
unsigned int uMaxNumIcons;
|
||||
unsigned int uMaxIconSize;
|
||||
unsigned int uMaxDependencies;
|
||||
|
||||
} TSteamAppStats;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *szLabel;
|
||||
unsigned int uMaxLabelChars;
|
||||
unsigned int uVersionId;
|
||||
int bIsNotAvailable;
|
||||
} TSteamAppVersion;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *szDesc;
|
||||
unsigned int uMaxDescChars;
|
||||
char *szCmdLine;
|
||||
unsigned int uMaxCmdLineChars;
|
||||
unsigned int uIndex;
|
||||
unsigned int uIconIndex;
|
||||
int bNoDesktopShortcut;
|
||||
int bNoStartMenuShortcut;
|
||||
int bIsLongRunningUnattended;
|
||||
|
||||
} TSteamAppLaunchOption;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *szName;
|
||||
unsigned int uMaxNameChars;
|
||||
char *szLatestVersionLabel;
|
||||
unsigned int uMaxLatestVersionLabelChars;
|
||||
char *szCurrentVersionLabel;
|
||||
unsigned int uMaxCurrentVersionLabelChars;
|
||||
char *szInstallDirName;
|
||||
unsigned int uMaxInstallDirNameChars;
|
||||
unsigned int uId;
|
||||
unsigned int uLatestVersionId;
|
||||
unsigned int uCurrentVersionId;
|
||||
unsigned int uMinCacheFileSizeMB;
|
||||
unsigned int uMaxCacheFileSizeMB;
|
||||
unsigned int uNumLaunchOptions;
|
||||
unsigned int uNumIcons;
|
||||
unsigned int uNumVersions;
|
||||
unsigned int uNumDependencies;
|
||||
|
||||
} TSteamApp;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eNoCost = 0,
|
||||
eBillOnceOnly = 1,
|
||||
eBillMonthly = 2,
|
||||
eProofOfPrepurchaseOnly = 3,
|
||||
eGuestPass = 4,
|
||||
eHardwarePromo = 5,
|
||||
eNumBillingTypes,
|
||||
} EBillingType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *szName;
|
||||
unsigned int uMaxNameChars;
|
||||
unsigned int *puAppIds;
|
||||
unsigned int uMaxAppIds;
|
||||
unsigned int uId;
|
||||
unsigned int uNumApps;
|
||||
EBillingType eBillingType;
|
||||
unsigned int uCostInCents;
|
||||
unsigned int uNumDiscounts;
|
||||
int bIsPreorder;
|
||||
int bRequiresShippingAddress;
|
||||
unsigned int uDomesticShippingCostInCents;
|
||||
unsigned int uInternationalShippingCostInCents;
|
||||
bool bIsCyberCafeSubscription;
|
||||
unsigned int uGameCode;
|
||||
char szGameCodeDesc[STEAM_MAX_PATH];
|
||||
bool bIsDisabled;
|
||||
bool bRequiresCD;
|
||||
unsigned int uTerritoryCode;
|
||||
bool bIsSteam3Subscription;
|
||||
|
||||
} TSteamSubscription;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char szName[STEAM_MAX_PATH];
|
||||
unsigned int uDiscountInCents;
|
||||
unsigned int uNumQualifiers;
|
||||
|
||||
} TSteamSubscriptionDiscount;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char szName[STEAM_MAX_PATH];
|
||||
unsigned int uRequiredSubscription;
|
||||
int bIsDisqualifier;
|
||||
|
||||
} TSteamDiscountQualifier;
|
||||
|
||||
typedef struct TSteamProgress
|
||||
{
|
||||
int bValid; /* non-zero if call provides progress info */
|
||||
unsigned int uPercentDone; /* 0 to 100 * STEAM_PROGRESS_PERCENT_SCALE if bValid */
|
||||
char szProgress[STEAM_MAX_PATH]; /* additional progress info */
|
||||
} TSteamProgress;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamNotifyTicketsWillExpire,
|
||||
eSteamNotifyAccountInfoChanged,
|
||||
eSteamNotifyContentDescriptionChanged,
|
||||
eSteamNotifyPleaseShutdown,
|
||||
eSteamNotifyNewContentServer,
|
||||
eSteamNotifySubscriptionStatusChanged,
|
||||
eSteamNotifyContentServerConnectionLost,
|
||||
eSteamNotifyCacheLoadingCompleted,
|
||||
eSteamNotifyCacheNeedsDecryption,
|
||||
eSteamNotifyCacheNeedsRepair
|
||||
} ESteamNotificationCallbackEvent;
|
||||
|
||||
|
||||
typedef void(*SteamNotificationCallback_t)(ESteamNotificationCallbackEvent eEvent, unsigned int nData);
|
||||
|
||||
|
||||
typedef char SteamPersonalQuestion_t[ STEAM_QUESTION_MAXLEN + 1 ];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char uchSalt[STEAM_SALT_SIZE];
|
||||
} SteamSalt_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eVisa = 1,
|
||||
eMaster = 2,
|
||||
eAmericanExpress = 3,
|
||||
eDiscover = 4,
|
||||
eDinnersClub = 5,
|
||||
eJCB = 6
|
||||
} ESteamPaymentCardType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ESteamPaymentCardType eCardType;
|
||||
char szCardNumber[ STEAM_CARD_NUMBER_SIZE +1 ];
|
||||
char szCardHolderName[ STEAM_CARD_HOLDERNAME_SIZE + 1];
|
||||
char szCardExpYear[ STEAM_CARD_EXPYEAR_SIZE + 1 ];
|
||||
char szCardExpMonth[ STEAM_CARD_EXPMONTH_SIZE+ 1 ];
|
||||
char szCardCVV2[ STEAM_CARD_CVV2_SIZE + 1 ];
|
||||
char szBillingAddress1[ STEAM_BILLING_ADDRESS1_SIZE + 1 ];
|
||||
char szBillingAddress2[ STEAM_BILLING_ADDRESS2_SIZE + 1 ];
|
||||
char szBillingCity[ STEAM_BILLING_CITY_SIZE + 1 ];
|
||||
char szBillingZip[ STEAM_BILLING_ZIP_SIZE + 1 ];
|
||||
char szBillingState[ STEAM_BILLING_STATE_SIZE + 1 ];
|
||||
char szBillingCountry[ STEAM_BILLING_COUNTRY_SIZE + 1 ];
|
||||
char szBillingPhone[ STEAM_BILLING_PHONE_SIZE + 1 ];
|
||||
char szBillingEmailAddress[ STEAM_BILLING_EMAIL_ADDRESS_SIZE + 1 ];
|
||||
unsigned int uExpectedCostInCents;
|
||||
unsigned int uExpectedTaxInCents;
|
||||
/* If the TSteamSubscription says that shipping info is required, */
|
||||
/* then the following fields must be filled out. */
|
||||
/* If szShippingName is empty, then assumes so are the rest. */
|
||||
char szShippingName[ STEAM_CARD_HOLDERNAME_SIZE + 1];
|
||||
char szShippingAddress1[ STEAM_BILLING_ADDRESS1_SIZE + 1 ];
|
||||
char szShippingAddress2[ STEAM_BILLING_ADDRESS2_SIZE + 1 ];
|
||||
char szShippingCity[ STEAM_BILLING_CITY_SIZE + 1 ];
|
||||
char szShippingZip[ STEAM_BILLING_ZIP_SIZE + 1 ];
|
||||
char szShippingState[ STEAM_BILLING_STATE_SIZE + 1 ];
|
||||
char szShippingCountry[ STEAM_BILLING_COUNTRY_SIZE + 1 ];
|
||||
char szShippingPhone[ STEAM_BILLING_PHONE_SIZE + 1 ];
|
||||
unsigned int uExpectedShippingCostInCents;
|
||||
|
||||
} TSteamPaymentCardInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char szTypeOfProofOfPurchase[ STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE + 1 ];
|
||||
|
||||
/* A ProofOfPurchase token is not necessarily a nul-terminated string; it may be binary data
|
||||
(perhaps encrypted). Hence we need a length and an array of bytes. */
|
||||
unsigned int uLengthOfBinaryProofOfPurchaseToken;
|
||||
char cBinaryProofOfPurchaseToken[ STEAM_PROOF_OF_PURCHASE_TOKEN_SIZE + 1 ];
|
||||
} TSteamPrepurchaseInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char szAccountName[ STEAM_EXTERNAL_ACCOUNTNAME_SIZE + 1 ];
|
||||
char szPassword[ STEAM_EXTERNAL_ACCOUNTPASSWORD_SIZE + 1 ];
|
||||
} TSteamExternalBillingInfo;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ePaymentCardInfo = 1,
|
||||
ePrepurchasedInfo = 2,
|
||||
eAccountBillingInfo = 3,
|
||||
eExternalBillingInfo = 4, /* indirect billing via ISP etc (not supported yet) */
|
||||
ePaymentCardReceipt = 5,
|
||||
ePrepurchaseReceipt = 6,
|
||||
eEmptyReceipt = 7
|
||||
} ESteamSubscriptionBillingInfoType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ESteamSubscriptionBillingInfoType eBillingInfoType;
|
||||
union {
|
||||
TSteamPaymentCardInfo PaymentCardInfo;
|
||||
TSteamPrepurchaseInfo PrepurchaseInfo;
|
||||
TSteamExternalBillingInfo ExternalBillingInfo;
|
||||
char bUseAccountBillingInfo;
|
||||
};
|
||||
|
||||
} TSteamSubscriptionBillingInfo;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* Subscribed */
|
||||
eSteamSubscriptionOK = 0, /* Subscribed */
|
||||
eSteamSubscriptionPending = 1, /* Awaiting transaction completion */
|
||||
eSteamSubscriptionPreorder = 2, /* Is currently a pre-order */
|
||||
eSteamSubscriptionPrepurchaseTransferred = 3, /* hop to this account */
|
||||
/* Unusbscribed */
|
||||
eSteamSubscriptionPrepurchaseInvalid = 4, /* Invalid cd-key */
|
||||
eSteamSubscriptionPrepurchaseRejected = 5, /* hopped out / banned / etc */
|
||||
eSteamSubscriptionPrepurchaseRevoked = 6, /* hop away from this account */
|
||||
eSteamSubscriptionPaymentCardDeclined = 7, /* CC txn declined */
|
||||
eSteamSubscriptionCancelledByUser = 8, /* Cancelled by client */
|
||||
eSteamSubscriptionCancelledByVendor = 9, /* Cancelled by us */
|
||||
eSteamSubscriptionPaymentCardUseLimit = 10, /* Card used too many times, potential fraud */
|
||||
eSteamSubscriptionPaymentCardAlert = 11, /* Got a "pick up card" or the like from bank */
|
||||
eSteamSubscriptionFailed = 12, /* Other Error in subscription data or transaction failed/lost */
|
||||
eSteamSubscriptionPaymentCardAVSFailure = 13, /* Card failed Address Verification check */
|
||||
eSteamSubscriptionPaymentCardInsufficientFunds = 14, /* Card failed due to insufficient funds */
|
||||
eSteamSubscriptionRestrictedCountry = 15 /* The subscription is not available in the user's country */
|
||||
|
||||
} ESteamSubscriptionStatus;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ESteamPaymentCardType eCardType;
|
||||
char szCardLastFourDigits[ 4 + 1 ];
|
||||
char szCardHolderName[ STEAM_CARD_HOLDERNAME_SIZE + 1];
|
||||
char szBillingAddress1[ STEAM_BILLING_ADDRESS1_SIZE + 1 ];
|
||||
char szBillingAddress2[ STEAM_BILLING_ADDRESS2_SIZE + 1 ];
|
||||
char szBillingCity[ STEAM_BILLING_CITY_SIZE + 1 ];
|
||||
char szBillingZip[ STEAM_BILLING_ZIP_SIZE + 1 ];
|
||||
char szBillingState[ STEAM_BILLING_STATE_SIZE + 1 ];
|
||||
char szBillingCountry[ STEAM_BILLING_COUNTRY_SIZE + 1 ];
|
||||
|
||||
// The following are only available after the subscription leaves "pending" status
|
||||
char szCardApprovalCode[ STEAM_BILLING_CARD_APPROVAL_CODE_SIZE + 1];
|
||||
char szTransDate[ STEAM_BILLING_TRANS_DATE_SIZE + 1]; /* mm/dd/yy */
|
||||
char szTransTime[ STEAM_BILLING_TRANS_TIME_SIZE + 1]; /* hh:mm:ss */
|
||||
unsigned int uPriceWithoutTax;
|
||||
unsigned int uTaxAmount;
|
||||
unsigned int uShippingCost;
|
||||
|
||||
} TSteamPaymentCardReceiptInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char szTypeOfProofOfPurchase[ STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE + 1 ];
|
||||
} TSteamPrepurchaseReceiptInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ESteamSubscriptionStatus eStatus;
|
||||
ESteamSubscriptionStatus ePreviousStatus;
|
||||
ESteamSubscriptionBillingInfoType eReceiptInfoType;
|
||||
char szConfirmationCode[ STEAM_BILLING_CONFIRMATION_CODE_SIZE + 1];
|
||||
union {
|
||||
TSteamPaymentCardReceiptInfo PaymentCardReceiptInfo;
|
||||
TSteamPrepurchaseReceiptInfo PrepurchaseReceiptInfo;
|
||||
};
|
||||
|
||||
} TSteamSubscriptionReceipt;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ePhysicalBytesReceivedThisSession = 1,
|
||||
eAppReadyToLaunchStatus = 2,
|
||||
eAppPreloadStatus = 3,
|
||||
eAppEntireDepot = 4,
|
||||
eCacheBytesPresent = 5
|
||||
} ESteamAppUpdateStatsQueryType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SteamUnsigned64_t uBytesTotal;
|
||||
SteamUnsigned64_t uBytesPresent;
|
||||
} TSteamUpdateStats;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamUserAdministrator = 0x00000001, /* May subscribe, unsubscribe, etc */
|
||||
eSteamUserDeveloper = 0x00000002, /* Steam or App developer */
|
||||
eSteamUserCyberCafe = 0x00000004 /* CyberCafe, school, etc -- UI should ask for password */
|
||||
/* before allowing logout, unsubscribe, etc */
|
||||
} ESteamUserTypeFlags;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamAccountStatusDefault = 0x00000000,
|
||||
eSteamAccountStatusEmailVerified = 0x00000001,
|
||||
/* Note: Mask value 0x2 is reserved for future use. (Some, but not all, public accounts already have this set.) */
|
||||
eSteamAccountDisabled = 0x00000004
|
||||
} ESteamAccountStatusBitFields ;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamBootstrapperError = -1,
|
||||
eSteamBootstrapperDontCheckForUpdate = 0,
|
||||
eSteamBootstrapperCheckForUpdateAndRerun = 7
|
||||
|
||||
} ESteamBootStrapperClientAppResult;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamOnline = 0,
|
||||
eSteamOffline = 1,
|
||||
eSteamNoAuthMode = 2,
|
||||
eSteamBillingOffline = 3
|
||||
} eSteamOfflineStatus;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int eOfflineNow;
|
||||
int eOfflineNextSession;
|
||||
} TSteamOfflineStatus;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int uAppId;
|
||||
int bIsSystemDefined;
|
||||
char szMountPath[STEAM_MAX_PATH];
|
||||
} TSteamAppDependencyInfo;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamOpenFileRegular = 0x0,
|
||||
eSteamOpenFileIgnoreLocal = 0x1,
|
||||
eSteamOpenFileChecksumReads = 0x2
|
||||
} ESteamOpenFileFlags;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSteamValveCDKeyValidationServer = 0,
|
||||
eSteamHalfLifeMasterServer = 1,
|
||||
eSteamFriendsServer = 2,
|
||||
eSteamCSERServer = 3,
|
||||
eSteamHalfLife2MasterServer = 4,
|
||||
eSteamRDKFMasterServer = 5,
|
||||
eMaxServerTypes = 6
|
||||
} ESteamServerType;
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** More exported constants
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
const SteamHandle_t STEAM_INVALID_HANDLE = 0;
|
||||
const SteamCallHandle_t STEAM_INVALID_CALL_HANDLE = 0;
|
||||
const SteamUserIDTicketValidationHandle_t STEAM_INACTIVE_USERIDTICKET_VALIDATION_HANDLE = 0;
|
||||
const unsigned int STEAM_USE_LATEST_VERSION = 0xFFFFFFFF;
|
||||
|
||||
#else
|
||||
|
||||
#define STEAM_INVALID_HANDLE ((SteamHandle_t)(0))
|
||||
#define STEAM_INVALID_CALL_HANDLE ((SteamCallHandle_t)(0))
|
||||
#define STEAM_INACTIVE_USERIDTICKET_VALIDATION_HANDLE ((SteamUserIDTicketValidationHandle_t)(0))
|
||||
#define STEAM_USE_LATEST_VERSION (0xFFFFFFFFu);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Each Steam instance (licensed Steam Service Provider) has a unique SteamInstanceID_t.
|
||||
**
|
||||
** Each Steam instance as its own DB of users.
|
||||
** Each user in the DB has a unique SteamLocalUserID_t (a serial number, with possible
|
||||
** rare gaps in the sequence).
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
typedef unsigned short SteamInstanceID_t; // MUST be 16 bits
|
||||
|
||||
|
||||
#if defined ( _WIN32 )
|
||||
typedef unsigned __int64 SteamLocalUserID_t; // MUST be 64 bits
|
||||
#else
|
||||
typedef unsigned long long SteamLocalUserID_t; // MUST be 64 bits
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Applications need to be able to authenticate Steam users from ANY instance.
|
||||
** So a SteamIDTicket contains SteamGlobalUserID, which is a unique combination of
|
||||
** instance and user id.
|
||||
**
|
||||
** SteamLocalUserID is an unsigned 64-bit integer.
|
||||
** For platforms without 64-bit int support, we provide access via a union that splits it into
|
||||
** high and low unsigned 32-bit ints. Such platforms will only need to compare LocalUserIDs
|
||||
** for equivalence anyway - not perform arithmetic with them.
|
||||
**
|
||||
********************************************************************************/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int Low32bits;
|
||||
unsigned int High32bits;
|
||||
} TSteamSplitLocalUserID;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SteamInstanceID_t m_SteamInstanceID;
|
||||
|
||||
union
|
||||
{
|
||||
SteamLocalUserID_t As64bits;
|
||||
TSteamSplitLocalUserID Split;
|
||||
} m_SteamLocalUserID;
|
||||
|
||||
} TSteamGlobalUserID;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
370
common/hl2orange.spa.h
Normal file
370
common/hl2orange.spa.h
Normal file
|
|
@ -0,0 +1,370 @@
|
|||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// hl2orange.spa.h
|
||||
//
|
||||
// Auto-generated on Thursday, 13 September 2007 at 16:59:17
|
||||
// XLAST project version 1.0.402.0
|
||||
// SPA Compiler version 2.0.6274.0
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __THE_ORANGE_BOX_SPA_H__
|
||||
#define __THE_ORANGE_BOX_SPA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// Title info
|
||||
//
|
||||
|
||||
#define TITLEID_THE_ORANGE_BOX 0x4541080F
|
||||
|
||||
//
|
||||
// Context ids
|
||||
//
|
||||
// These values are passed as the dwContextId to XUserSetContext.
|
||||
//
|
||||
|
||||
#define CONTEXT_CHAPTER_HL2 0
|
||||
#define CONTEXT_SCENARIO 1
|
||||
#define CONTEXT_GAME 2
|
||||
#define CONTEXT_CHAPTER_EP1 3
|
||||
#define CONTEXT_CHAPTER_EP2 4
|
||||
#define CONTEXT_CHAPTER_PORTAL 5
|
||||
|
||||
//
|
||||
// Context values
|
||||
//
|
||||
// These values are passed as the dwContextValue to XUserSetContext.
|
||||
//
|
||||
|
||||
// Values for CONTEXT_CHAPTER_HL2
|
||||
|
||||
#define CONTEXT_CHAPTER_HL2_POINT_INSERTION 0
|
||||
#define CONTEXT_CHAPTER_HL2_A_RED_LETTER_DAY 1
|
||||
#define CONTEXT_CHAPTER_HL2_ROUTE_KANAL 2
|
||||
#define CONTEXT_CHAPTER_HL2_WATER_HAZARD 3
|
||||
#define CONTEXT_CHAPTER_HL2_BLACK_MESA_EAST 4
|
||||
#define CONTEXT_CHAPTER_HL2_RAVENHOLM 5
|
||||
#define CONTEXT_CHAPTER_HL2_HIGHWAY_17 6
|
||||
#define CONTEXT_CHAPTER_HL2_SANDTRAPS 7
|
||||
#define CONTEXT_CHAPTER_HL2_NOVA_PROSPEKT 8
|
||||
#define CONTEXT_CHAPTER_HL2_ENTANGLEMENT 9
|
||||
#define CONTEXT_CHAPTER_HL2_ANTICITIZEN_ONE 10
|
||||
#define CONTEXT_CHAPTER_HL2_FOLLOW_FREEMAN 11
|
||||
#define CONTEXT_CHAPTER_HL2_OUR_BENEFACTORS 12
|
||||
#define CONTEXT_CHAPTER_HL2_DARK_ENERGY 13
|
||||
|
||||
// Values for CONTEXT_SCENARIO
|
||||
|
||||
#define CONTEXT_SCENARIO_CTF_2FORT 0
|
||||
#define CONTEXT_SCENARIO_CP_DUSTBOWL 1
|
||||
#define CONTEXT_SCENARIO_CP_GRANARY 2
|
||||
#define CONTEXT_SCENARIO_CP_WELL 3
|
||||
#define CONTEXT_SCENARIO_CP_GRAVELPIT 4
|
||||
#define CONTEXT_SCENARIO_TC_HYDRO 5
|
||||
#define CONTEXT_SCENARIO_CTF_CLOAK 6
|
||||
#define CONTEXT_SCENARIO_CP_CLOAK 7
|
||||
|
||||
// Values for CONTEXT_GAME
|
||||
|
||||
#define CONTEXT_GAME_GAME_HALF_LIFE_2 0
|
||||
#define CONTEXT_GAME_GAME_EPISODE_ONE 1
|
||||
#define CONTEXT_GAME_GAME_EPISODE_TWO 2
|
||||
#define CONTEXT_GAME_GAME_PORTAL 3
|
||||
#define CONTEXT_GAME_GAME_TEAM_FORTRESS 4
|
||||
|
||||
// Values for CONTEXT_CHAPTER_EP1
|
||||
|
||||
#define CONTEXT_CHAPTER_EP1_UNDUE_ALARM 0
|
||||
#define CONTEXT_CHAPTER_EP1_DIRECT_INTERVENTION 1
|
||||
#define CONTEXT_CHAPTER_EP1_LOWLIFE 2
|
||||
#define CONTEXT_CHAPTER_EP1_URBAN_FLIGHT 3
|
||||
#define CONTEXT_CHAPTER_EP1_EXIT_17 4
|
||||
|
||||
// Values for CONTEXT_CHAPTER_EP2
|
||||
|
||||
#define CONTEXT_CHAPTER_EP2_TO_THE_WHITE_FOREST 0
|
||||
#define CONTEXT_CHAPTER_EP2_THIS_VORTAL_COIL 1
|
||||
#define CONTEXT_CHAPTER_EP2_FREEMAN_PONTIFEX 2
|
||||
#define CONTEXT_CHAPTER_EP2_RIDING_SHOTGUN 3
|
||||
#define CONTEXT_CHAPTER_EP2_UNDER_THE_RADAR 4
|
||||
#define CONTEXT_CHAPTER_EP2_OUR_MUTUAL_FIEND 5
|
||||
#define CONTEXT_CHAPTER_EP2_T_MINUS_ONE 6
|
||||
|
||||
// Values for CONTEXT_CHAPTER_PORTAL
|
||||
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_00 0
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_04 1
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_08 2
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_10 3
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_13 4
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_14 5
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_15 6
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_16 7
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_17 8
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_18 9
|
||||
#define CONTEXT_CHAPTER_PORTAL_TESTCHAMBER_19 10
|
||||
|
||||
// Values for X_CONTEXT_PRESENCE
|
||||
|
||||
#define CONTEXT_PRESENCE_TF_CP 0
|
||||
#define CONTEXT_PRESENCE_TF_CTF_LOSING 1
|
||||
#define CONTEXT_PRESENCE_TF_CTF_TIED 2
|
||||
#define CONTEXT_PRESENCE_TF_CTF_WINNING 3
|
||||
#define CONTEXT_PRESENCE_APPCHOOSER 4
|
||||
#define CONTEXT_PRESENCE_MENU 5
|
||||
#define CONTEXT_PRESENCE_EP1_INGAME 6
|
||||
#define CONTEXT_PRESENCE_HL2_INGAME 7
|
||||
#define CONTEXT_PRESENCE_EP2_INGAME 8
|
||||
#define CONTEXT_PRESENCE_PORTAL_INGAME 9
|
||||
#define CONTEXT_PRESENCE_COMMENTARY 10
|
||||
#define CONTEXT_PRESENCE_IDLE 11
|
||||
|
||||
// Values for X_CONTEXT_GAME_MODE
|
||||
|
||||
#define CONTEXT_GAME_MODE_MULTIPLAYER 0
|
||||
#define CONTEXT_GAME_MODE_SINGLEPLAYER 1
|
||||
|
||||
//
|
||||
// Property ids
|
||||
//
|
||||
// These values are passed as the dwPropertyId value to XUserSetProperty
|
||||
// and as the dwPropertyId value in the XUSER_PROPERTY structure.
|
||||
//
|
||||
|
||||
#define PROPERTY_CAPS_OWNED 0x10000000
|
||||
#define PROPERTY_CAPS_TOTAL 0x10000001
|
||||
#define PROPERTY_PLAYER_TEAM_SCORE 0x10000002
|
||||
#define PROPERTY_OPPONENT_TEAM_SCORE 0x10000003
|
||||
#define PROPERTY_FLAG_CAPTURE_LIMIT 0x1000000B
|
||||
#define PROPERTY_NUMBER_OF_ROUNDS 0x1000000C
|
||||
#define PROPERTY_GAME_SIZE 0x1000000D
|
||||
#define PROPERTY_AUTOBALANCE 0x1000000E
|
||||
#define PROPERTY_PRIVATE_SLOTS 0x1000000F
|
||||
#define PROPERTY_MAX_GAME_TIME 0x10000010
|
||||
#define PROPERTY_NUMBER_OF_KILLS 0x10000011
|
||||
#define PROPERTY_DAMAGE_DEALT 0x10000012
|
||||
#define PROPERTY_PLAY_TIME 0x10000013
|
||||
#define PROPERTY_POINT_CAPTURES 0x10000014
|
||||
#define PROPERTY_POINT_DEFENSES 0x10000015
|
||||
#define PROPERTY_DOMINATIONS 0x10000016
|
||||
#define PROPERTY_REVENGE 0x10000017
|
||||
#define PROPERTY_BUILDINGS_DESTROYED 0x10000019
|
||||
#define PROPERTY_HEADSHOTS 0x1000001A
|
||||
#define PROPERTY_HEALTH_POINTS_HEALED 0x1000001B
|
||||
#define PROPERTY_INVULNS 0x1000001C
|
||||
#define PROPERTY_KILL_ASSISTS 0x1000001D
|
||||
#define PROPERTY_BACKSTABS 0x1000001E
|
||||
#define PROPERTY_HEALTH_POINTS_LEACHED 0x1000001F
|
||||
#define PROPERTY_BUILDINGS_BUILT 0x10000020
|
||||
#define PROPERTY_SENTRY_KILLS 0x10000021
|
||||
#define PROPERTY_TELEPORTS 0x10000022
|
||||
#define PROPERTY_KILLS 0x10000023
|
||||
#define PROPERTY_NUMBER_OF_TEAMS 0x10000025
|
||||
#define PROPERTY_TEAM_RED 0x10000026
|
||||
#define PROPERTY_TEAM_BLUE 0x10000027
|
||||
#define PROPERTY_TEAM_SPECTATOR 0x10000028
|
||||
#define PROPERTY_TEAM 0x10000029
|
||||
#define PROPERTY_WIN_LIMIT 0x1000002A
|
||||
#define PROPERTY_RANKING_TEST 0x2000000A
|
||||
#define PROPERTY_POINTS_SCORED 0x20000018
|
||||
|
||||
//
|
||||
// Achievement ids
|
||||
//
|
||||
// These values are used in the dwAchievementId member of the
|
||||
// XUSER_ACHIEVEMENT structure that is used with
|
||||
// XUserWriteAchievements and XUserCreateAchievementEnumerator.
|
||||
//
|
||||
|
||||
#define ACHIEVEMENT_HLX_KILL_ENEMIES_WITHPHYSICS 43
|
||||
#define ACHIEVEMENT_HLX_KILL_ENEMY_WITHHOPPERMINE 44
|
||||
#define ACHIEVEMENT_HLX_KILL_ENEMIES_WITHMANHACK 45
|
||||
#define ACHIEVEMENT_HLX_KILL_SOLDIER_WITHHISGRENADE 46
|
||||
#define ACHIEVEMENT_HLX_KILL_ENEMIES_WITHONEENERGYBALL 47
|
||||
#define ACHIEVEMENT_HLX_KILL_ELITESOLDIER_WITHHISENERGYBALL 48
|
||||
#define ACHIEVEMENT_EPX_GET_ZOMBINEGRENADE 50
|
||||
#define ACHIEVEMENT_EPX_KILL_ZOMBIES_WITHFLARES 51
|
||||
#define ACHIEVEMENT_HL2_HIT_CANCOP_WITHCAN 52
|
||||
#define ACHIEVEMENT_HL2_PUT_CANINTRASH 53
|
||||
#define ACHIEVEMENT_HL2_ESCAPE_APARTMENTRAID 54
|
||||
#define ACHIEVEMENT_HL2_BREAK_MINITELEPORTER 55
|
||||
#define ACHIEVEMENT_HL2_GET_CROWBAR 56
|
||||
#define ACHIEVEMENT_HL2_KILL_BARNACLESWITHBARREL 57
|
||||
#define ACHIEVEMENT_HL2_GET_AIRBOAT 58
|
||||
#define ACHIEVEMENT_HL2_GET_AIRBOATGUN 60
|
||||
#define ACHIEVEMENT_HL2_FIND_VORTIGAUNTCAVE 61
|
||||
#define ACHIEVEMENT_HL2_KILL_CHOPPER 62
|
||||
#define ACHIEVEMENT_HL2_FIND_HEVFACEPLATE 63
|
||||
#define ACHIEVEMENT_HL2_GET_GRAVITYGUN 64
|
||||
#define ACHIEVEMENT_HL2_MAKEABASKET 65
|
||||
#define ACHIEVEMENT_HL2_BEAT_RAVENHOLM_NOWEAPONS 66
|
||||
#define ACHIEVEMENT_HL2_BEAT_CEMETERY 67
|
||||
#define ACHIEVEMENT_HL2_KILL_ENEMIES_WITHCRANE 68
|
||||
#define ACHIEVEMENT_HL2_PIN_SOLDIER_TOBILLBOARD 69
|
||||
#define ACHIEVEMENT_HL2_KILL_ODESSAGUNSHIP 70
|
||||
#define ACHIEVEMENT_HL2_KILL_THREEGUNSHIPS 71
|
||||
#define ACHIEVEMENT_HL2_BEAT_DONTTOUCHSAND 72
|
||||
#define ACHIEVEMENT_HL2_KILL_ENEMIES_WITHANTLIONS 74
|
||||
#define ACHIEVEMENT_HL2_KILL_ENEMY_WITHTOILET 75
|
||||
#define ACHIEVEMENT_HL2_BEAT_TURRETSTANDOFF2 76
|
||||
#define ACHIEVEMENT_HL2_BEAT_TOXICTUNNEL 78
|
||||
#define ACHIEVEMENT_HL2_BEAT_PLAZASTANDOFF 79
|
||||
#define ACHIEVEMENT_HL2_KILL_ALLC1709SNIPERS 80
|
||||
#define ACHIEVEMENT_HL2_BEAT_SUPRESSIONDEVICE 81
|
||||
#define ACHIEVEMENT_HL2_BEAT_C1713STRIDERSTANDOFF 82
|
||||
#define ACHIEVEMENT_HL2_BEAT_GAME 84
|
||||
#define ACHIEVEMENT_HL2_FIND_ALLLAMBDAS 86
|
||||
#define ACHIEVEMENT_EP1_BEAT_MAINELEVATOR 87
|
||||
#define ACHIEVEMENT_EP1_BEAT_CITADELCORE 88
|
||||
#define ACHIEVEMENT_EP1_BEAT_CITADELCORE_NOSTALKERKILLS 89
|
||||
#define ACHIEVEMENT_EP1_KILL_ANTLIONS_WITHCARS 90
|
||||
#define ACHIEVEMENT_EP1_BEAT_GARAGEELEVATORSTANDOFF 91
|
||||
#define ACHIEVEMENT_EP1_KILL_ENEMIES_WITHSNIPERALYX 92
|
||||
#define ACHIEVEMENT_EP1_BEAT_HOSPITALATTICGUNSHIP 93
|
||||
#define ACHIEVEMENT_EP1_BEAT_CITIZENESCORT_NOCITIZENDEATHS 94
|
||||
#define ACHIEVEMENT_EP1_BEAT_GAME 95
|
||||
#define ACHIEVEMENT_EP1_BEAT_GAME_ONEBULLET 96
|
||||
#define ACHIEVEMENT_EP2_KILL_POISONANTLION 97
|
||||
#define ACHIEVEMENT_EP2_KILL_ALLGRUBS 98
|
||||
#define ACHIEVEMENT_EP2_BREAK_ALLWEBS 99
|
||||
#define ACHIEVEMENT_EP2_BEAT_ANTLIONINVASION 100
|
||||
#define ACHIEVEMENT_EP2_BEAT_ANTLIONGUARDS 101
|
||||
#define ACHIEVEMENT_EP2_KILL_ENEMIES_WITHCAR 102
|
||||
#define ACHIEVEMENT_EP2_BEAT_HUNTERAMBUSH 103
|
||||
#define ACHIEVEMENT_EP2_KILL_CHOPPER_NOMISSES 104
|
||||
#define ACHIEVEMENT_EP2_KILL_COMBINECANNON 105
|
||||
#define ACHIEVEMENT_EP2_FIND_ALLRADARCACHES 106
|
||||
#define ACHIEVEMENT_EP2_BEAT_ROCKETCACHEPUZZLE 107
|
||||
#define ACHIEVEMENT_EP2_BEAT_RACEWITHDOG 108
|
||||
#define ACHIEVEMENT_EP2_BEAT_WHITEFORESTINN 109
|
||||
#define ACHIEVEMENT_EP2_PUT_ITEMINROCKET 110
|
||||
#define ACHIEVEMENT_EP2_BEAT_MISSILESILO2 111
|
||||
#define ACHIEVEMENT_EP2_BEAT_OUTLAND12_NOBUILDINGSDESTROYED 112
|
||||
#define ACHIEVEMENT_EP2_BEAT_GAME 113
|
||||
#define ACHIEVEMENT_EP2_KILL_HUNTER_WITHFLECHETTES 114
|
||||
#define ACHIEVEMENT_PORTAL_GET_PORTALGUNS 115
|
||||
#define ACHIEVEMENT_PORTAL_KILL_COMPANIONCUBE 116
|
||||
#define ACHIEVEMENT_PORTAL_ESCAPE_TESTCHAMBERS 117
|
||||
#define ACHIEVEMENT_PORTAL_BEAT_GAME 118
|
||||
#define ACHIEVEMENT_PORTAL_INFINITEFALL 119
|
||||
#define ACHIEVEMENT_PORTAL_LONGJUMP 120
|
||||
#define ACHIEVEMENT_PORTAL_BEAT_2ADVANCEDMAPS 121
|
||||
#define ACHIEVEMENT_PORTAL_BEAT_4ADVANCEDMAPS 122
|
||||
#define ACHIEVEMENT_PORTAL_BEAT_6ADVANCEDMAPS 123
|
||||
#define ACHIEVEMENT_PORTAL_GET_ALLBRONZE 124
|
||||
#define ACHIEVEMENT_PORTAL_GET_ALLSILVER 125
|
||||
#define ACHIEVEMENT_PORTAL_GET_ALLGOLD 126
|
||||
#define ACHIEVEMENT_TF_GET_TURRETKILLS 127
|
||||
#define ACHIEVEMENT_TF_KILL_NEMESIS 128
|
||||
#define ACHIEVEMENT_TF_GET_CONSECUTIVEKILLS_NODEATHS 129
|
||||
#define ACHIEVEMENT_TF_GET_HEALED_BYENEMY 130
|
||||
#define ACHIEVEMENT_TF_PLAY_GAME_FRIENDSONLY 131
|
||||
#define ACHIEVEMENT_TF_WIN_MULTIPLEGAMES 132
|
||||
#define ACHIEVEMENT_TF_GET_MULTIPLEKILLS 133
|
||||
#define ACHIEVEMENT_TF_WIN_2FORT_NOENEMYCAPS 134
|
||||
#define ACHIEVEMENT_TF_WIN_WELL_MINIMUMTIME 135
|
||||
#define ACHIEVEMENT_TF_WIN_HYDRO_NOENEMYCAPS 136
|
||||
#define ACHIEVEMENT_TF_WIN_DUSTBOWL_NOENEMYCAPS 137
|
||||
#define ACHIEVEMENT_TF_WIN_GRAVELPIT_NOENEMYCAPS 138
|
||||
#define ACHIEVEMENT_TF_PLAY_GAME_EVERYCLASS 139
|
||||
#define ACHIEVEMENT_TF_PLAY_GAME_EVERYMAP 140
|
||||
#define ACHIEVEMENT_TF_GET_HEALPOINTS 141
|
||||
#define ACHIEVEMENT_TF_BURN_PLAYERSINMINIMIMTIME 142
|
||||
#define ACHIEVEMENT_HL2_DISINTEGRATE_SOLDIERSINFIELD 143
|
||||
#define ACHIEVEMENT_HL2_FOLLOW_FREEMAN 144
|
||||
#define ACHIEVEMENT_TF_GET_HEADSHOTS 145
|
||||
#define ACHIEVEMENT_PORTAL_DETACH_ALL_CAMERAS 146
|
||||
#define ACHIEVEMENT_PORTAL_HIT_TURRET_WITH_TURRET 148
|
||||
|
||||
#ifndef _XBOX
|
||||
#define ACHIEVEMENT_PORTAL_TRANSMISSION_RECEIVED 149
|
||||
#define ACHIEVEMENT_TF_GENERAL_KILL_ENEMIES_AFTER_TELEPORTING 150
|
||||
#endif // _XBOX
|
||||
|
||||
#define ACHIEVEMENT_TF_LAST_ORANGEBOX 150
|
||||
|
||||
//
|
||||
// Stats view ids
|
||||
//
|
||||
// These are used in the dwViewId member of the XUSER_STATS_SPEC structure
|
||||
// passed to the XUserReadStats* and XUserCreateStatsEnumerator* functions.
|
||||
//
|
||||
|
||||
// Skill leaderboards for ranked game modes
|
||||
|
||||
#define STATS_VIEW_SKILL_RANKED_MULTIPLAYER 0xFFFF0000
|
||||
#define STATS_VIEW_SKILL_RANKED_SINGLEPLAYER 0xFFFF0001
|
||||
|
||||
// Skill leaderboards for unranked (standard) game modes
|
||||
|
||||
#define STATS_VIEW_SKILL_STANDARD_MULTIPLAYER 0xFFFE0000
|
||||
#define STATS_VIEW_SKILL_STANDARD_SINGLEPLAYER 0xFFFE0001
|
||||
|
||||
// Title defined leaderboards
|
||||
|
||||
#define STATS_VIEW_PLAYER_MAX_UNRANKED 1
|
||||
#define STATS_VIEW_PLAYER_MAX_RANKED 2
|
||||
|
||||
//
|
||||
// Stats view column ids
|
||||
//
|
||||
// These ids are used to read columns of stats views. They are specified in
|
||||
// the rgwColumnIds array of the XUSER_STATS_SPEC structure. Rank, rating
|
||||
// and gamertag are not retrieved as custom columns and so are not included
|
||||
// in the following definitions. They can be retrieved from each row's
|
||||
// header (e.g., pStatsResults->pViews[x].pRows[y].dwRank, etc.).
|
||||
//
|
||||
|
||||
// Column ids for PLAYER_MAX_UNRANKED
|
||||
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_POINTS_SCORED 2
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_KILLS 3
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_POINTS_CAPPED 1
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_DAMAGE_DEALT 4
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_PLAY_TIME 5
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_POINT_DEFENSES 6
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_DOMINATIONS 7
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_REVENGE 8
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_BUILDINGS_DESTROYED 9
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_HEADSHOTS 10
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_HEALTH_POINTS_HEALED 11
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_INVULNS 12
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_KILL_ASSISTS 13
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_BACKSTABS 14
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_HEALTH_POINTS_LEACHED 15
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_BUILDINGS_BUILT 16
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_SENTRY_KILLS 17
|
||||
#define STATS_COLUMN_PLAYER_MAX_UNRANKED_TELEPORTS 18
|
||||
|
||||
// Column ids for PLAYER_MAX_RANKED
|
||||
|
||||
#define STATS_COLUMN_PLAYER_MAX_RANKED_POINTS_SCORED 2
|
||||
|
||||
//
|
||||
// Matchmaking queries
|
||||
//
|
||||
// These values are passed as the dwProcedureIndex parameter to
|
||||
// XSessionSearch to indicate which matchmaking query to run.
|
||||
//
|
||||
|
||||
#define SESSION_MATCH_QUERY_PLAYER_MATCH 0
|
||||
|
||||
//
|
||||
// Gamer pictures
|
||||
//
|
||||
// These ids are passed as the dwPictureId parameter to XUserAwardGamerTile.
|
||||
//
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __THE_ORANGE_BOX_SPA_H__
|
||||
|
||||
|
||||
56
common/language.h
Normal file
56
common/language.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: represent a canonical list of the languages we support,
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef LANG_H
|
||||
#define LANG_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// if you change this enum also change language.cpp:s_LanguageNames
|
||||
enum ELanguage
|
||||
{
|
||||
k_Lang_None = -1,
|
||||
k_Lang_First = 0,
|
||||
k_Lang_English = 0,
|
||||
k_Lang_German,
|
||||
k_Lang_French,
|
||||
k_Lang_Italian,
|
||||
k_Lang_Korean,
|
||||
k_Lang_Spanish,
|
||||
k_Lang_Simplified_Chinese,
|
||||
k_Lang_Traditional_Chinese,
|
||||
k_Lang_Russian,
|
||||
k_Lang_Thai,
|
||||
k_Lang_Japanese,
|
||||
k_Lang_Portuguese,
|
||||
k_Lang_Polish,
|
||||
k_Lang_Danish,
|
||||
k_Lang_Dutch,
|
||||
k_Lang_Finnish,
|
||||
k_Lang_Norwegian,
|
||||
k_Lang_Swedish,
|
||||
k_Lang_Romanian,
|
||||
k_Lang_Turkish,
|
||||
k_Lang_Hungarian,
|
||||
k_Lang_Czech,
|
||||
k_Lang_Brazilian,
|
||||
k_Lang_Bulgarian,
|
||||
k_Lang_Greek,
|
||||
k_Lang_Ukrainian,
|
||||
k_Lang_MAX
|
||||
};
|
||||
|
||||
#define FOR_EACH_LANGUAGE( eLang ) for ( int eLang = (int)k_Lang_First; eLang < k_Lang_MAX; ++eLang )
|
||||
|
||||
ELanguage PchLanguageToELanguage(const char *pchShortName, ELanguage eDefault = k_Lang_English);
|
||||
ELanguage PchLanguageICUCodeToELanguage( const char *pchICUCode, ELanguage eDefault = k_Lang_English );
|
||||
const char *GetLanguageShortName( ELanguage eLang );
|
||||
const char *GetLanguageICUName( ELanguage eLang );
|
||||
const char *GetLanguageVGUILocalization( ELanguage eLang );
|
||||
const char *GetLanguageName( ELanguage eLang );
|
||||
|
||||
#endif /* LANG_H */
|
||||
53
common/lzma/lzma.h
Normal file
53
common/lzma/lzma.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: LZMA Glue. Designed for Tool time Encoding/Decoding.
|
||||
//
|
||||
// LZMA Codec interface for engine. Based largely on LzmaUtil.c in SDK
|
||||
//
|
||||
// LZMA SDK 9.38 beta
|
||||
// 2015-01-03 : Igor Pavlov : Public domain
|
||||
// http://www.7-zip.org/
|
||||
//
|
||||
//====================================================================================//
|
||||
|
||||
#ifndef LZMA_H
|
||||
#define LZMA_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// These routines are designed for TOOL TIME encoding/decoding on the PC!
|
||||
// They have not been made to encode/decode on the PPC and lack big endian awarnesss.
|
||||
// Lightweight GAME TIME Decoding is part of tier1.lib, via CLZMA.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Encoding glue. Returns non-null Compressed buffer if successful.
|
||||
// Caller must free.
|
||||
//-----------------------------------------------------------------------------
|
||||
unsigned char *LZMA_Compress(
|
||||
unsigned char *pInput,
|
||||
unsigned int inputSize,
|
||||
unsigned int *pOutputSize );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Decoding glue. Returns TRUE if succesful.
|
||||
//-----------------------------------------------------------------------------
|
||||
bool LZMA_Uncompress(
|
||||
unsigned char *pInput,
|
||||
unsigned char **ppOutput,
|
||||
unsigned int *pOutputSize );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Decoding helper, returns TRUE if buffer is LZMA compressed.
|
||||
//-----------------------------------------------------------------------------
|
||||
bool LZMA_IsCompressed( unsigned char *pInput );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Decoding helper, returns non-zero size of data when uncompressed, otherwise 0.
|
||||
//-----------------------------------------------------------------------------
|
||||
unsigned int LZMA_GetActualSize( unsigned char *pInput );
|
||||
|
||||
#endif
|
||||
49
common/proto_version.h
Normal file
49
common/proto_version.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
#if !defined( PROTO_VERSION_H )
|
||||
#define PROTO_VERSION_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// The current network protocol version. Changing this makes clients and servers incompatible
|
||||
#define PROTOCOL_VERSION 24
|
||||
|
||||
#define DEMO_BACKWARDCOMPATABILITY
|
||||
|
||||
// For backward compatibility of demo files (NET_MAX_PAYLOAD_BITS went away)
|
||||
#define PROTOCOL_VERSION_23 23
|
||||
|
||||
// For backward compatibility of demo files (sound index bits used to = 13 )
|
||||
#define PROTOCOL_VERSION_22 22
|
||||
|
||||
// For backward compatibility of demo files (before the special DSP was shipped to public)
|
||||
#define PROTOCOL_VERSION_21 21
|
||||
|
||||
// For backward compatibility of demo files (old-style dynamic model loading)
|
||||
#define PROTOCOL_VERSION_20 20
|
||||
|
||||
// For backward compatibility of demo files (post Halloween sound flag extra bit)
|
||||
#define PROTOCOL_VERSION_19 19
|
||||
|
||||
// For backward compatibility of demo files (pre Halloween sound flag extra bit)
|
||||
#define PROTOCOL_VERSION_18 18
|
||||
|
||||
// For backward compatibility of demo files (MD5 in map version)
|
||||
#define PROTOCOL_VERSION_17 17
|
||||
|
||||
// For backward compatibility of demo files (create string tables compression flag)
|
||||
#define PROTOCOL_VERSION_14 14
|
||||
|
||||
// For backward compatibility of demo files
|
||||
#define PROTOCOL_VERSION_12 12
|
||||
|
||||
// The PROTOCOL_VERSION when replay shipped to public
|
||||
#define PROTOCOL_VERSION_REPLAY 16
|
||||
|
||||
#endif
|
||||
35
common/qlimits.h
Normal file
35
common/qlimits.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef QLIMITS_H
|
||||
#define QLIMITS_H
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// DATA STRUCTURE INFO
|
||||
|
||||
#define MAX_NUM_ARGVS 50
|
||||
|
||||
// SYSTEM INFO
|
||||
#define MAX_QPATH 96 // max length of a game pathname
|
||||
#define MAX_OSPATH 260 // max length of a filesystem pathname
|
||||
|
||||
#define ON_EPSILON 0.1 // point on plane side epsilon
|
||||
|
||||
|
||||
// Resource counts;
|
||||
#define MAX_MODEL_INDEX_BITS 12 // sent as a short
|
||||
#define MAX_MODELS (1<<MAX_MODEL_INDEX_BITS)
|
||||
|
||||
#define MAX_GENERIC_INDEX_BITS 9
|
||||
#define MAX_GENERIC (1<<MAX_GENERIC_INDEX_BITS)
|
||||
#define MAX_DECAL_INDEX_BITS 9
|
||||
#define MAX_BASE_DECALS (1<<MAX_DECAL_INDEX_BITS)
|
||||
|
||||
#endif // QLIMITS_H
|
||||
43
common/replay/basereplayserializeable.h
Normal file
43
common/replay/basereplayserializeable.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef REPLAYSERIALIIZEABLE_H
|
||||
#define REPLAYSERIALIIZEABLE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "replay/ireplayserializeable.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CBaseReplaySerializeable : public IReplaySerializeable
|
||||
{
|
||||
public:
|
||||
CBaseReplaySerializeable();
|
||||
|
||||
virtual void SetHandle( ReplayHandle_t h );
|
||||
virtual ReplayHandle_t GetHandle() const;
|
||||
virtual bool Read( KeyValues *pIn );
|
||||
virtual void Write( KeyValues *pOut );
|
||||
virtual const char *GetFilename() const;
|
||||
virtual const char *GetFullFilename() const;
|
||||
virtual const char *GetDebugName() const;
|
||||
virtual void SetLocked( bool bLocked );
|
||||
virtual bool IsLocked() const;
|
||||
virtual void OnDelete();
|
||||
virtual void OnUnload();
|
||||
virtual void OnAddedToDirtyList();
|
||||
|
||||
private:
|
||||
ReplayHandle_t m_hThis;
|
||||
bool m_bLocked;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // REPLAYSERIALIIZEABLE_H
|
||||
64
common/replay/iclientreplay.h
Normal file
64
common/replay/iclientreplay.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef ICLIENTREPLAY_H
|
||||
#define ICLIENTREPLAY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define CLIENT_REPLAY_INTERFACE_VERSION "ClientReplay001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayFactory;
|
||||
class IReplayScreenshotSystem;
|
||||
class IReplayPerformancePlaybackHandler;
|
||||
class KeyValues;
|
||||
class IReplayCamera;
|
||||
class CReplayPerformance;
|
||||
struct RenderMovieParams_t;
|
||||
class IGameEvent;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Allows the replay and engine DLL's to talk to the client.
|
||||
//
|
||||
class IClientReplay : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual uint64 GetServerSessionId() = 0;
|
||||
virtual bool CacheReplayRagdolls( const char* pFilename, int nStartTick ) = 0; // Cache replay ragdolls
|
||||
virtual IReplayScreenshotSystem *GetReplayScreenshotSystem() = 0; // Get the client's replay screenshot system
|
||||
virtual IReplayPerformancePlaybackHandler *GetPerformancePlaybackHandler() = 0;
|
||||
virtual IReplayCamera *GetReplayCamera() = 0;
|
||||
virtual void DisplayReplayMessage( const char *pLocalizeStr, bool bUrgent, bool bDlg, const char *pSound ) = 0;
|
||||
virtual void DisplayReplayMessage( const wchar_t *pText, bool bUrgent, bool bDlg, const char *pSound ) = 0;
|
||||
virtual void InitPerformanceEditor( ReplayHandle_t hReplay ) = 0;
|
||||
virtual void HidePerformanceEditor() = 0;
|
||||
virtual bool ShouldRender() = 0;
|
||||
virtual void PlaySound( const char *pSound ) = 0;
|
||||
virtual void UploadOgsData( KeyValues *pData, bool bIncludeTimeField ) = 0;
|
||||
virtual bool ShouldCompletePendingReplay( IGameEvent *pEvent ) = 0;
|
||||
|
||||
virtual void OnSaveReplay( ReplayHandle_t hNewReplay, bool bShowInputDlg ) = 0;
|
||||
virtual void OnDeleteReplay( ReplayHandle_t hReplay ) = 0; // Called before replay is actually removed from the replay manager
|
||||
virtual void OnPlaybackComplete( ReplayHandle_t hReplay, int iPerformance ) = 0;
|
||||
virtual void OnRenderStart() = 0;
|
||||
virtual void OnRenderComplete( const RenderMovieParams_t &RenderParams, bool bCancelled, bool bSuccess, bool bShowBrowser ) = 0;
|
||||
virtual bool OnConfirmQuit() = 0;
|
||||
virtual bool OnEndOfReplayReached() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // ICLIENTREPLAY_H
|
||||
58
common/replay/iclientreplaycontext.h
Normal file
58
common/replay/iclientreplaycontext.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef ICLIENTREPLAYCONTEXT_H
|
||||
#define ICLIENTREPLAYCONTEXT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "replay/ireplaycontext.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define REPLAYHISTORYMANAGER_INTERFACE_VERSION_CLIENT "VENGINE_CLIENT_REPLAY_HISTORY_MANAGER_001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
class CReplayPerformance;
|
||||
class IReplayManager;
|
||||
class IReplayMovieManager;
|
||||
class IReplayMovieRenderer;
|
||||
class IReplayScreenshotManager;
|
||||
class IReplayPerformanceManager;
|
||||
class IReplayPerformanceController;
|
||||
class IReplayRenderQueue;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IClientReplayContext : public IReplayContext
|
||||
{
|
||||
public:
|
||||
virtual CReplay *GetReplay( ReplayHandle_t hReplay ) = 0; // Shorthand to GetReplayManager()->GetReplay()
|
||||
virtual IReplayManager *GetReplayManager() = 0;
|
||||
virtual IReplayMovieRenderer *GetMovieRenderer() = 0;
|
||||
virtual IReplayMovieManager *GetMovieManager() = 0;
|
||||
virtual IReplayScreenshotManager *GetScreenshotManager() = 0;
|
||||
virtual IReplayPerformanceManager *GetPerformanceManager() = 0;
|
||||
virtual IReplayPerformanceController *GetPerformanceController() = 0;
|
||||
virtual IReplayRenderQueue *GetRenderQueue() = 0;
|
||||
virtual void SetMovieRenderer( IReplayMovieRenderer *pRenderer ) = 0; // Set to be the panel that renders replay movies, or NULL when nothing is rendering
|
||||
virtual void OnSignonStateFull() = 0;
|
||||
virtual void OnClientSideDisconnect() = 0; // Called when client disconnects
|
||||
virtual void PlayReplay( ReplayHandle_t hReplay, int iPerformance, bool bPlaySound ) = 0; // Play the given replay, from spawn tick to death tick
|
||||
virtual bool ReconstructReplayIfNecessary( CReplay *pReplay ) = 0;
|
||||
virtual void OnPlayerSpawn() = 0; // Called on the client when player is spawned
|
||||
virtual void OnPlayerClassChanged() = 0; // Called when the player's class changes - we use this instead of an event for immediacy
|
||||
virtual void GetPlaybackTimes( float &flOutTime, float &flOutLength, const CReplay *pReplay, const CReplayPerformance *pPerformance ) = 0; // Calculate the current time and length of a replay or performance - takes in tick and out tick into account for performances - flCurTime should be gpGlobals->curtime. pPerformance can be NULL.
|
||||
virtual uint64 GetServerSessionId( ReplayHandle_t hReplay ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // ICLIENTREPLAYCONTEXT_H
|
||||
104
common/replay/iclientreplayhistorymanager.h
Normal file
104
common/replay/iclientreplayhistorymanager.h
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef ICLIENTREPLAYHISTORYMANAGER_H
|
||||
#define ICLIENTREPLAYHISTORYMANAGER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "replay/replayhandle.h"
|
||||
#include "replay/screenshot.h"
|
||||
#include "interface.h"
|
||||
#include "qlimits.h"
|
||||
#include "convar.h"
|
||||
#include "engine/http.h"
|
||||
#include "tier1/utllinkedlist.h"
|
||||
#include "tier1/checksum_crc.h"
|
||||
#include <time.h>
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayDownloadGroup;
|
||||
class IReplayDownloadGroupHelper;
|
||||
class CDmxElement;
|
||||
class KeyValues;
|
||||
struct CaptureScreenshotParams_t;
|
||||
struct RenderMovieParams_t;
|
||||
class CBaseReplay;
|
||||
class CReplay;
|
||||
class IReplayMovieRenderer;
|
||||
class IReplayMovieManager;
|
||||
class IReplayMovie;
|
||||
class IReplayPerformanceManager;
|
||||
class IGameEvent;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IClientReplayHistoryManager : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual bool Init( CreateInterfaceFn fnCreateFactory ) = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
virtual void Think() = 0;
|
||||
|
||||
virtual bool IsInitialized() const = 0;
|
||||
virtual bool Commit( CBaseReplay *pNewReplay ) = 0;
|
||||
|
||||
virtual void Save() = 0; // Write the entire index and any replays/groups/movies that are marked as dirty
|
||||
virtual void FlagReplayForFlush( CBaseReplay *pReplay, bool bForceImmediateWrite ) = 0; // Mark the given replay as dirty - flush to disk at the next opportunity (see CBaseReplayHistoryManager::FlushThink())
|
||||
|
||||
virtual void Nuke() = 0;
|
||||
|
||||
virtual void DeleteReplay( ReplayHandle_t hReplay, bool bNotifyUI ) = 0;
|
||||
virtual CBaseReplay *GetReplay( ReplayHandle_t hReplay ) = 0;
|
||||
|
||||
virtual const char *GetBaseDirectory() = 0; // Returns full directory to wherever replays.dmx lives, e.g. c:\program files (x86)\steam\steamapps\someuser\team fortress 2\game\tf\replays\client\ (or server\) - NOTE: includes trailing slash
|
||||
virtual const char *GetReplaysSubDir() = 0; // Returns "client" or "server"
|
||||
|
||||
// For loop through all replays - indices should not be cached
|
||||
virtual int GetReplayCount() const = 0;
|
||||
// virtual CBaseReplay *GetReplayAtIndex( int nIndex ) = 0;
|
||||
|
||||
virtual const char *GetFullReplayPath() = 0; // Get c:\...\game\tf\replays\<client or server>\
|
||||
|
||||
// Client-specific
|
||||
virtual int GetAdjustedDeathTick( CReplay *pReplay ) = 0;
|
||||
virtual void FlagDownloadGroupForFlush( IReplayDownloadGroup *pGroup, bool bForceImmediate ) = 0;
|
||||
virtual void FlagMovieForFlush( IReplayMovie *pMovie, bool bForceImmediate ) = 0; // Flag the movie for flush - if pMovie is NULL, mark the index for flush
|
||||
virtual void SetMovieRenderer( IReplayMovieRenderer *pRenderer ) = 0; // Set to be the panel that renders replay movies, or NULL when nothing is rendering
|
||||
virtual bool ShouldGameRenderView() = 0; // Called from V_RenderView() to determine whether the game should render - used during movie rendering
|
||||
virtual int GetUnrenderedReplayCount() = 0; // Get the number of unrendered replays
|
||||
virtual void UpdateCurrentReplayDataFromServer() = 0; // Updates start tick, current file url, demo filename
|
||||
virtual void LinkReplayToDownloadGroup() = 0;
|
||||
virtual void CaptureScreenshot( CaptureScreenshotParams_t ¶ms ) = 0; // Schedules a screenshot capture at flDelay seconds in the future
|
||||
virtual void DoCaptureScreenshot() = 0; // Takes the screenshot right now
|
||||
virtual bool ShouldCaptureScreenshot() = 0; // Is screenshot scheduled to be taken right now?
|
||||
virtual void GetUnpaddedScreenshotSize( int &nWidth, int &nHeight ) = 0; // Get the dimensions for a screenshot if we take one right now, based on replay_screenshotresolution and the current aspect ratio
|
||||
virtual void DeleteScreenshotsForReplay( CReplay *pReplay ) = 0; // Deletes all screenshots associated with the given replay
|
||||
virtual void PlayReplay( ReplayHandle_t hReplay ) = 0; // Play the given replay, from spawn tick to death tick
|
||||
virtual void RenderMovie( RenderMovieParams_t const& params ) = 0; // Renders the given replay - or if params.hReplay is -1, render all unrendered replays
|
||||
virtual void CompleteRender( bool bSuccess ) = 0;
|
||||
virtual void OnClientSideDisconnect() = 0; // Called when client disconnects
|
||||
virtual void OnSignonStateFull() = 0;
|
||||
virtual void OnPlayerSpawn() = 0; // Called on the client when player is spawned
|
||||
virtual void OnPlayerClassChanged() = 0; // Called when the player's class changes - we use this instead of an event for immediacy
|
||||
virtual void OnReplayRecordingCvarChanged() = 0; // Called (on client only) when replay_recording is set to 1
|
||||
virtual void OnGroupDeleted() = 0;
|
||||
virtual CReplay *GetPlayingReplay() = 0; // Get the currently playing replay, otherwise NULL if one isn't playing
|
||||
virtual CReplay *GetReplayForCurrentLife() = 0; // Gets the current replay (constant from local player spawn until next spawn/disconnect/exit)
|
||||
virtual bool IsRendering() = 0; // Are we currently rendering a movie?
|
||||
virtual void CancelRender() = 0; // If we're currently rendering, cancel
|
||||
virtual IReplayMovieManager *GetMovieManager() = 0;
|
||||
virtual IReplayMovieRenderer *GetMovieRenderer() = 0;
|
||||
virtual const RenderMovieParams_t *GetRenderSettings() = 0;
|
||||
virtual IReplayDownloadGroupHelper *GetDownloadGroupHelper() = 0;
|
||||
virtual IReplayPerformanceManager *GetPerformanceManager() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // ICLIENTREPLAYHISTORYMANAGER_H
|
||||
116
common/replay/ienginereplay.h
Normal file
116
common/replay/ienginereplay.h
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IENGINEREPLAY_H
|
||||
#define IENGINEREPLAY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define ENGINE_REPLAY_INTERFACE_VERSION "EngineReplay001"
|
||||
|
||||
#if !defined( DEDICATED )
|
||||
# define ENGINE_REPLAY_CLIENT_INTERFACE_VERSION "EngineClientReplay001"
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IServer;
|
||||
class INetChannel;
|
||||
class IReplayServer;
|
||||
class IClientEntityList;
|
||||
class IClientReplay;
|
||||
struct demoheader_t;
|
||||
class CGlobalVarsBase;
|
||||
class IDemoBuffer;
|
||||
class CBaseRecordingSessionBlock;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Allows the replay, client & server DLL's to talk to the engine
|
||||
//
|
||||
class IEngineReplay : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual bool IsSupportedModAndPlatform() = 0;
|
||||
|
||||
virtual float GetHostTime() = 0;
|
||||
virtual int GetHostTickCount() = 0;
|
||||
virtual int TimeToTicks( float flTime ) = 0;
|
||||
virtual float TicksToTime( int nTick ) = 0;
|
||||
|
||||
virtual bool ReadDemoHeader( const char *pFilename, demoheader_t &header ) = 0;
|
||||
virtual const char *GetGameDir() = 0;
|
||||
virtual void Cbuf_AddText( const char *pCmd ) = 0;
|
||||
virtual void Cbuf_Execute() = 0;
|
||||
virtual void Host_Disconnect( bool bShowMainMenu ) = 0;
|
||||
virtual void HostState_Shutdown() = 0;
|
||||
virtual const char *GetModDir() = 0;
|
||||
|
||||
virtual bool CopyFile( const char *pSource, const char *pDest ) = 0;
|
||||
|
||||
virtual bool LZSS_Compress( char *pDest, unsigned int *pDestLen, const char *pSource, unsigned int nSourceLen ) = 0;
|
||||
virtual bool LZSS_Decompress( char *pDest, unsigned int *pDestLen, const char *pSource, unsigned int nSourceLen ) = 0;
|
||||
|
||||
virtual bool MD5_HashBuffer( unsigned char pDigest[16], const unsigned char *pBuffer, int nSize, unsigned int pSeed[4] ) = 0;
|
||||
|
||||
// Server-specific
|
||||
virtual IReplayServer *GetReplayServer() = 0;
|
||||
virtual IServer *GetReplayServerAsIServer() = 0;
|
||||
virtual IServer *GetGameServer() = 0;
|
||||
virtual bool GetSessionRecordBuffer( uint8 **ppSessionBuffer, int *pSize ) = 0;
|
||||
virtual bool IsDedicated() = 0;
|
||||
virtual void ResetReplayRecordBuffer() = 0;
|
||||
virtual demoheader_t *GetReplayDemoHeader() = 0;
|
||||
virtual void RecalculateTags() = 0;
|
||||
virtual bool NET_GetHostnameAsIP( const char *pHostname, char *pOut, int nOutSize ) = 0;
|
||||
};
|
||||
|
||||
//
|
||||
// Allows the replay and client DLL's to talk to the engine
|
||||
//
|
||||
#if !defined( DEDICATED )
|
||||
class IEngineClientReplay : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual INetChannel *GetNetChannel() = 0;
|
||||
virtual bool IsConnected() = 0;
|
||||
virtual bool IsListenServer() = 0;
|
||||
virtual float GetLastServerTickTime() = 0;
|
||||
virtual const char *GetLevelName() = 0;
|
||||
virtual const char *GetLevelNameShort() = 0;
|
||||
virtual int GetPlayerSlot() = 0;
|
||||
virtual bool IsPlayingReplayDemo() = 0;
|
||||
virtual IClientEntityList *GetClientEntityList() = 0;
|
||||
virtual IClientReplay *GetClientReplayInt() = 0;
|
||||
virtual uint32 GetClientSteamID() = 0;
|
||||
virtual void Con_NPrintf( int nPos, PRINTF_FORMAT_STRING const char *pFormat, ... ) = 0;
|
||||
virtual CGlobalVarsBase *GetClientGlobalVars() = 0;
|
||||
virtual void VGui_PlaySound( const char *pSound ) = 0;
|
||||
virtual void EngineVGui_ConfirmQuit() = 0;
|
||||
virtual int GetScreenWidth() = 0;
|
||||
virtual int GetScreenHeight() = 0;
|
||||
virtual bool IsDemoPlayingBack() = 0;
|
||||
virtual bool IsGamePathValidAndSafeForDownload( const char *pGamePath ) = 0;
|
||||
virtual bool IsInGame() = 0;
|
||||
|
||||
virtual void InitSoundRecord() = 0;
|
||||
|
||||
virtual void Wave_CreateTmpFile( const char *pFilename ) = 0;
|
||||
virtual void Wave_AppendTmpFile( const char *pFilename, void *pBuffer, int nNumSamples ) = 0;
|
||||
virtual void Wave_FixupTmpFile( const char *pFilename ) = 0;
|
||||
|
||||
};
|
||||
#endif // !defined( DEDICATED )
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IENGINEREPLAY_H
|
||||
46
common/replay/iqueryablereplayitem.h
Normal file
46
common/replay/iqueryablereplayitem.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IQUERYABLEREPLAYITEM_H
|
||||
#define IQUERYABLEREPLAYITEM_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "iqueryablereplayitem.h"
|
||||
#include "replay/replayhandle.h"
|
||||
#include "replay/replaytime.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
typedef int QueryableReplayItemHandle_t;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IQueryableReplayItem : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual const CReplayTime &GetItemDate() const = 0;
|
||||
virtual bool IsItemRendered() const = 0;
|
||||
virtual CReplay *GetItemReplay() = 0;
|
||||
virtual ReplayHandle_t GetItemReplayHandle() const = 0;
|
||||
virtual QueryableReplayItemHandle_t GetItemHandle() const = 0; // Get the handle of this item
|
||||
virtual const wchar_t *GetItemTitle() const = 0;
|
||||
virtual void SetItemTitle( const wchar_t *pTitle ) = 0;
|
||||
virtual float GetItemLength() const = 0;
|
||||
virtual void *GetUserData() = 0;
|
||||
virtual void SetUserData( void *pUserData ) = 0;
|
||||
virtual bool IsItemAMovie() const = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IQUERYABLEREPLAYITEM_H
|
||||
27
common/replay/irecordingsession.h
Normal file
27
common/replay/irecordingsession.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IRECORDINGSESSION_H
|
||||
#define IRECORDINGSESSION_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CBaseRecordingSessionBlock;
|
||||
|
||||
class IRecordingSession : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void AddBlock( CBaseRecordingSessionBlock *pBlock ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IRECORDINGSESSION_H
|
||||
30
common/replay/irecordingsessionblockmanager.h
Normal file
30
common/replay/irecordingsessionblockmanager.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IRECORDINGSESSIONBLOCKMANAGER_H
|
||||
#define IRECORDINGSESSIONBLOCKMANAGER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IRecordingSessionBlockManager : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual CBaseRecordingSessionBlock *GetBlock( ReplayHandle_t hBlock ) = 0;
|
||||
virtual void DeleteBlock( CBaseRecordingSessionBlock *pBlock ) = 0;
|
||||
virtual void UnloadBlock( CBaseRecordingSessionBlock *pBlock ) = 0;
|
||||
virtual const char *GetBlockPath() const = 0;
|
||||
virtual void LoadBlockFromFileName( const char *pFilename, IRecordingSession *pSession ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IRECORDINGSESSIONBLOCKMANAGER_H
|
||||
33
common/replay/irecordingsessionmanager.h
Normal file
33
common/replay/irecordingsessionmanager.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IRECORDINGSESSIONMANAGER_H
|
||||
#define IRECORDINGSESSIONMANAGER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CBaseRecordingSession;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IRecordingSessionManager : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual CBaseRecordingSession *FindSession( ReplayHandle_t hSession ) = 0;
|
||||
virtual const CBaseRecordingSession *FindSession( ReplayHandle_t hSession ) const = 0;
|
||||
virtual void FlagSessionForFlush( CBaseRecordingSession *pSession, bool bForceImmediate ) = 0;
|
||||
virtual int GetServerStartTickForSession( ReplayHandle_t hSession ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IRECORDINGSESSIONMANAGER_H
|
||||
25
common/replay/ireplaycamera.h
Normal file
25
common/replay/ireplaycamera.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef IREPLAYCAMERA_H
|
||||
#define IREPLAYCAMERA_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplayCamera : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void ClearOverrideView() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYCAMERA_H
|
||||
47
common/replay/ireplaycontext.h
Normal file
47
common/replay/ireplaycontext.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYCONTEXT_H
|
||||
#define IREPLAYCONTEXT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IRecordingSessionManager;
|
||||
class IRecordingSessionBlockManager;
|
||||
class IRecordingSession;
|
||||
class IReplayErrorSystem;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayContext : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual bool Init( CreateInterfaceFn fnCreateFactory ) = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
virtual void Think() = 0;
|
||||
|
||||
virtual bool IsInitialized() const = 0;
|
||||
|
||||
virtual const char *GetRelativeBaseDir() const = 0; // Returns path to wherever the index .dmx lives relative to the game path, e.g. "replay\client\"
|
||||
virtual const char *GetBaseDir() const = 0; // Returns full directory to wherever the index .dmx lives, e.g. c:\program files (x86)\steam\steamapps\<username>\team fortress 2\tf\replays\<client|server>\ -- NOTE: includes trailing slash
|
||||
virtual const char *GetReplaySubDir() const = 0; // Returns "client" or "server"
|
||||
|
||||
virtual IReplayErrorSystem *GetErrorSystem() = 0;
|
||||
virtual IRecordingSessionManager *GetRecordingSessionManager() = 0;
|
||||
virtual IRecordingSessionBlockManager *GetRecordingSessionBlockManager() = 0;
|
||||
virtual IRecordingSession *GetRecordingSession( ReplayHandle_t hSession ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYCONTEXT_H
|
||||
42
common/replay/ireplaydemoplayer.h
Normal file
42
common/replay/ireplaydemoplayer.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYDEMOPLAYER_H
|
||||
#define IREPLAYDEMOPLAYER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replay.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define INTERFACEVERSION_REPLAYDEMOPLAYER "ReplayDemoPlayer001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Interface for replay demo player
|
||||
//
|
||||
class IReplayDemoPlayer : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void PlayReplay( ReplayHandle_t hReplay, int iPerformance ) = 0;
|
||||
virtual void PlayNextReplay() = 0;
|
||||
virtual void ClearReplayList() = 0;
|
||||
virtual void AddReplayToList( ReplayHandle_t hReplay, int iPerformance ) = 0;
|
||||
virtual CReplay *GetCurrentReplay() = 0;
|
||||
virtual CReplayPerformance *GetCurrentPerformance() = 0; // The playing replay, or NULL if playing the original replay
|
||||
virtual void PauseReplay() = 0;
|
||||
virtual bool IsReplayPaused() = 0;
|
||||
virtual void ResumeReplay() = 0;
|
||||
virtual void OnSignonStateFull() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYDEMOPLAYER_H
|
||||
33
common/replay/ireplayerrorsystem.h
Normal file
33
common/replay/ireplayerrorsystem.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYERRORSYSYTEM_H
|
||||
#define IREPLAYERRORSYSYTEM_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class KeyValues;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Replay error system
|
||||
//
|
||||
class IReplayErrorSystem : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void AddErrorFromTokenName( const char *pToken ) = 0;
|
||||
virtual void AddFormattedErrorFromTokenName( const char *pFormatToken, KeyValues *pFormatArgs ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYERRORSYSYTEM_H
|
||||
31
common/replay/ireplayfactory.h
Normal file
31
common/replay/ireplayfactory.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYFACTORY_H
|
||||
#define IREPLAYFACTORY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplayFactory : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual CReplay *Create() = 0;
|
||||
};
|
||||
|
||||
#define INTERFACE_VERSION_REPLAY_FACTORY "IReplayFactory001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYFACTORY_H
|
||||
42
common/replay/ireplaymanager.h
Normal file
42
common/replay/ireplaymanager.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYMANAGER_H
|
||||
#define IREPLAYMANAGER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replayhandle.h"
|
||||
#include "utllinkedlist.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
class IQueryableReplayItem;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayManager : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual CReplay *GetReplay( ReplayHandle_t hReplay ) = 0;
|
||||
virtual CReplay *GetPlayingReplay() = 0;
|
||||
virtual CReplay *GetReplayForCurrentLife() = 0;
|
||||
virtual void FlagReplayForFlush( CReplay *pReplay, bool bForceImmediate ) = 0;
|
||||
virtual void DeleteReplay( ReplayHandle_t hReplay, bool bNotifyUI ) = 0;
|
||||
virtual int GetReplayCount() const = 0;
|
||||
virtual int GetUnrenderedReplayCount() = 0; // Get the number of unrendered replays
|
||||
virtual void GetReplays( CUtlLinkedList< CReplay *, int > &lstReplays ) = 0;
|
||||
virtual void GetReplaysAsQueryableItems( CUtlLinkedList< IQueryableReplayItem *, int > &lstReplays ) = 0;
|
||||
virtual float GetDownloadProgress( const CReplay *pReplay ) = 0;
|
||||
virtual const char *GetReplaysDir() const = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYMANAGER_H
|
||||
42
common/replay/ireplaymovie.h
Normal file
42
common/replay/ireplaymovie.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYMOVIE_H
|
||||
#define IREPLAYMOVIE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "iqueryablereplayitem.h"
|
||||
#include "replay/rendermovieparams.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplayMovie : public IQueryableReplayItem
|
||||
{
|
||||
public:
|
||||
virtual ReplayHandle_t GetMovieHandle() const = 0;
|
||||
virtual ReplayHandle_t GetReplayHandle() const = 0;
|
||||
virtual const ReplayRenderSettings_t &GetRenderSettings() = 0;
|
||||
virtual void GetFrameDimensions( int &nWidth, int &nHeight ) = 0;
|
||||
virtual void SetIsRendered( bool bIsRendered ) = 0;
|
||||
virtual void SetMovieFilename( const char *pFilename ) = 0;
|
||||
virtual const char *GetMovieFilename() const = 0;
|
||||
virtual void SetMovieTitle( const wchar_t *pTitle ) = 0;
|
||||
virtual void SetRenderTime( float flRenderTime ) = 0;
|
||||
virtual float GetRenderTime() const = 0;
|
||||
virtual void CaptureRecordTime() = 0;
|
||||
virtual void SetLength( float flLength ) = 0;
|
||||
|
||||
virtual bool IsUploaded() const = 0;
|
||||
virtual void SetUploaded( bool bUploaded ) = 0;
|
||||
virtual void SetUploadURL( const char *pURL ) = 0;
|
||||
virtual const char *GetUploadURL() const = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYMOVIE_H
|
||||
56
common/replay/ireplaymoviemanager.h
Normal file
56
common/replay/ireplaymoviemanager.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYMOVIEMANAGER_H
|
||||
#define IREPLAYMOVIEMANAGER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "utlstring.h"
|
||||
#include "utllinkedlist.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayMovie;
|
||||
class CReplay;
|
||||
struct RenderMovieParams_t;
|
||||
class IQueryableReplayItem;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplayMovieManager : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual int GetMovieCount() = 0;
|
||||
virtual void GetMovieList( CUtlLinkedList< IReplayMovie * > &list ) = 0; // Fills the list with all movies
|
||||
virtual IReplayMovie *GetMovie( ReplayHandle_t hMovie ) = 0;
|
||||
virtual IReplayMovie *CreateAndAddMovie( ReplayHandle_t hReplay ) = 0; // Creates and adds a movie based on the given replay
|
||||
virtual void DeleteMovie( ReplayHandle_t hMovie ) = 0; // Delete a movie
|
||||
virtual int GetNumMoviesDependentOnReplay( const CReplay *pReplay ) = 0; // Get the number of movies that depend on the given replay
|
||||
virtual void GetCachedMovieTitleAndClear( wchar_t *pOut, int nOutBufLength ) = 0; // TODO: This is a hack - fix this
|
||||
virtual void SetPendingMovie( IReplayMovie *pMovie ) = 0;
|
||||
virtual IReplayMovie *GetPendingMovie() = 0;
|
||||
virtual void FlagMovieForFlush( IReplayMovie *pMovie, bool bImmediate ) = 0;
|
||||
virtual void GetMoviesAsQueryableItems( CUtlLinkedList< IQueryableReplayItem *, int > &lstMovies ) = 0;
|
||||
virtual const char *GetRenderDir() const = 0;
|
||||
virtual const char *GetRawExportDir() const = 0;
|
||||
|
||||
// TODO: Is this the best place for code that actually manages rendering?
|
||||
virtual bool IsRendering() const = 0;
|
||||
virtual bool RenderingCancelled() const = 0;
|
||||
virtual void RenderMovie( RenderMovieParams_t const& params ) = 0; // Renders the given replay - or if params.hReplay is -1, render all unrendered replays
|
||||
virtual void RenderNextMovie() = 0;
|
||||
virtual void CompleteRender( bool bSuccess, bool bShowBrowser ) = 0;
|
||||
virtual void CancelRender() = 0;
|
||||
virtual void ClearRenderCancelledFlag() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYMOVIEMANAGER_H
|
||||
33
common/replay/ireplaymovierenderer.h
Normal file
33
common/replay/ireplaymovierenderer.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYMOVIERENDERER_H
|
||||
#define IREPLAYMOVIERENDERER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayMovie;
|
||||
struct RenderMovieParams_t;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplayMovieRenderer : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual bool SetupRenderer( RenderMovieParams_t ¶ms, IReplayMovie *pMovie ) = 0;
|
||||
virtual void ShutdownRenderer() = 0;
|
||||
virtual void RenderVideo() = 0;
|
||||
virtual void RenderAudio( unsigned char *pBuffer, int nSize, int nNumSamples ) = 0;
|
||||
|
||||
virtual void SetAudioSyncFrame( bool isSync = false ) = 0;
|
||||
virtual bool IsAudioSyncFrame() = 0;
|
||||
virtual float GetRecordingFrameDuration() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYMOVIERENDERER_H
|
||||
107
common/replay/ireplayperformancecontroller.h
Normal file
107
common/replay/ireplayperformancecontroller.h
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYPERFORMANCECONTROLLER_H
|
||||
#define IREPLAYPERFORMANCECONTROLLER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "tier1/strtools.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayPerformanceEditor;
|
||||
class CReplay;
|
||||
class Vector;
|
||||
class QAngle;
|
||||
class CReplayPerformance;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
// These values are what we use to represent
|
||||
|
||||
struct SetViewParams_t
|
||||
{
|
||||
SetViewParams_t() { V_memset( this, 0, sizeof( SetViewParams_t ) ); }
|
||||
SetViewParams_t( float flTime, Vector *pOrigin, QAngle *pAngles, float flFov, float flAccel,
|
||||
float flSpeed, float flRotFilter )
|
||||
: m_flTime( flTime ),
|
||||
m_pOrigin( pOrigin ),
|
||||
m_pAngles( pAngles ),
|
||||
m_flFov( flFov ),
|
||||
m_flAccel( flAccel ),
|
||||
m_flSpeed( flSpeed ),
|
||||
m_flRotationFilter( flRotFilter )
|
||||
{
|
||||
}
|
||||
|
||||
float m_flTime;
|
||||
Vector *m_pOrigin;
|
||||
QAngle *m_pAngles;
|
||||
float m_flFov;
|
||||
|
||||
// Right now only used for updating UI during playback:
|
||||
float m_flAccel;
|
||||
float m_flSpeed;
|
||||
float m_flRotationFilter;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayPerformanceController : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void SetEditor( IReplayPerformanceEditor *pEditor ) = 0;
|
||||
|
||||
virtual bool IsPlaybackDataLeft() = 0;
|
||||
|
||||
virtual void StartRecording( CReplay *pReplay, bool bSnip ) = 0;
|
||||
virtual void NotifyRewinding() = 0;
|
||||
|
||||
virtual void Stop() = 0;
|
||||
virtual bool SaveAsync() = 0;
|
||||
virtual bool SaveAsAsync( const wchar *pTitle ) = 0;
|
||||
|
||||
virtual bool IsSaving() const = 0;
|
||||
|
||||
virtual void SaveThink() = 0;
|
||||
|
||||
virtual bool GetLastSaveStatus() const = 0;
|
||||
|
||||
virtual bool IsRecording() const = 0;
|
||||
virtual bool IsPlaying() const = 0;
|
||||
|
||||
virtual bool IsDirty() const = 0;
|
||||
virtual void NotifyDirty() = 0;
|
||||
|
||||
virtual CReplayPerformance *GetPerformance() = 0;
|
||||
virtual CReplayPerformance *GetSavedPerformance() = 0;
|
||||
virtual bool HasSavedPerformance() = 0;
|
||||
|
||||
virtual void NotifyPauseState( bool bPaused ) = 0;
|
||||
|
||||
virtual void ClearRewinding() = 0;
|
||||
|
||||
virtual void OnSignonStateFull() = 0;
|
||||
|
||||
virtual float GetPlaybackTimeScale() const = 0;
|
||||
|
||||
//
|
||||
// Recorder-specific:
|
||||
//
|
||||
virtual void AddEvent_Camera_Change_FirstPerson( float flTime, int nEntityIndex ) = 0;
|
||||
virtual void AddEvent_Camera_Change_ThirdPerson( float flTime, int nEntityIndex ) = 0;
|
||||
virtual void AddEvent_Camera_Change_Free( float flTime ) = 0;
|
||||
virtual void AddEvent_Camera_ChangePlayer( float flTime, int nEntIndex ) = 0;
|
||||
virtual void AddEvent_Camera_SetView( const SetViewParams_t ¶ms ) = 0;
|
||||
virtual void AddEvent_TimeScale( float flTime, float flScale ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYPERFORMANCECONTROLLER_H
|
||||
33
common/replay/ireplayperformanceeditor.h
Normal file
33
common/replay/ireplayperformanceeditor.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYPERFORMANCEEDITOR_H
|
||||
#define IREPLAYPERFORMANCEEDITOR_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Interface to allow the replay DLL to talk to the actual UI.
|
||||
//
|
||||
class IReplayPerformanceEditor : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual CReplay *GetReplay() = 0;
|
||||
virtual void OnRewindComplete() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYPERFORMANCEEDITOR_H
|
||||
36
common/replay/ireplayperformancemanager.h
Normal file
36
common/replay/ireplayperformancemanager.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYPERFORMANCEMANAGER_H
|
||||
#define IREPLAYPERFORMANCEMANAGER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplayPerformance;
|
||||
class CReplay;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayPerformanceManager : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual CReplayPerformance *CreatePerformance( CReplay *pReplay ) = 0;
|
||||
virtual void DeletePerformance( CReplayPerformance *pPerformance ) = 0;
|
||||
|
||||
virtual const char *GetRelativePath() const = 0;
|
||||
virtual const char *GetFullPath() const = 0;
|
||||
|
||||
virtual const char *GeneratePerformanceFilename( CReplay *pReplay ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYPERFORMANCEMANAGER_H
|
||||
36
common/replay/ireplayperformanceplaybackhandler.h
Normal file
36
common/replay/ireplayperformanceplaybackhandler.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYPERFORMANCEPLAYBACKHANDLER_H
|
||||
#define IREPLAYPERFORMANCEPLAYBACKHANDLER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/ireplayperformancecontroller.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class Vector;
|
||||
class QAngle;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayPerformancePlaybackHandler : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void OnEvent_Camera_Change_FirstPerson( float flTime, int nEntityIndex ) = 0;
|
||||
virtual void OnEvent_Camera_Change_ThirdPerson( float flTime, int nEntityIndex ) = 0;
|
||||
virtual void OnEvent_Camera_Change_Free( float flTime ) = 0;
|
||||
virtual void OnEvent_Camera_ChangePlayer( float flTime, int nEntIndex ) = 0;
|
||||
virtual void OnEvent_Camera_SetView( const SetViewParams_t ¶ms ) = 0;
|
||||
virtual void OnEvent_TimeScale( float flTime, float flScale ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYPERFORMANCEPLAYBACKHANDLER_H
|
||||
33
common/replay/ireplayperformanceplayer.h
Normal file
33
common/replay/ireplayperformanceplayer.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYPERFORMANCEPLAYER_H
|
||||
#define IREPLAYPERFORMANCEPLAYER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
class CReplayPerformance;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayPerformancePlayer : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void BeginPerformancePlay( CReplayPerformance *pPerformance ) = 0;
|
||||
virtual void EndPerformancePlay() = 0;
|
||||
|
||||
virtual bool IsPlaying() const = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYPERFORMANCEPLAYER_H
|
||||
49
common/replay/ireplayperformancerecorder.h
Normal file
49
common/replay/ireplayperformancerecorder.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYPERFORMANCERECORDER_H
|
||||
#define IREPLAYPERFORMANCERECORDER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
class Vector;
|
||||
class QAngle;
|
||||
class CReplayPerformance;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayPerformanceRecorder : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void BeginPerformanceRecord( CReplay *pReplay ) = 0;
|
||||
virtual void EndPerformanceRecord() = 0;
|
||||
|
||||
virtual void NotifyPauseState( bool bPaused ) = 0;
|
||||
|
||||
virtual CReplayPerformance *GetPerformance() = 0;
|
||||
virtual bool IsRecording() const = 0;
|
||||
|
||||
virtual void SnipAtTime( float flTime ) = 0;
|
||||
virtual void NotifySkipping() = 0;
|
||||
virtual void ClearSkipping() = 0;
|
||||
|
||||
virtual void AddEvent_Camera_Change_FirstPerson( float flTime, int nEntityIndex ) = 0;
|
||||
virtual void AddEvent_Camera_Change_ThirdPerson( float flTime, int nEntityIndex ) = 0;
|
||||
virtual void AddEvent_Camera_Change_Free( float flTime ) = 0;
|
||||
virtual void AddEvent_Camera_ChangePlayer( float flTime, int nEntIndex ) = 0;
|
||||
virtual void AddEvent_Camera_SetView( float flTime, const Vector& origin, const QAngle &angles, float fov ) = 0;
|
||||
virtual void AddEvent_Slowmo( float flTime, float flScale ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYPERFORMANCERECORDER_H
|
||||
41
common/replay/ireplayplayercache.h
Normal file
41
common/replay/ireplayplayercache.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef IREPLAYPLAYERCACHE_H
|
||||
#define IREPLAYPLAYERCACHE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define REPLAYPLAYERCACHE_INTERFACE_VERSION "VENGINE_REPLAY_PLAYER_CACHE_001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplayPlayerCache : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual bool Init() = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
virtual void SetupPlayer( int nEntIndex ) = 0;
|
||||
virtual void DeletePlayerEntry( int nEntIndex ) = 0;
|
||||
|
||||
virtual bool PlayerHasCacheEntry( int nEntIndex ) = 0;
|
||||
|
||||
virtual void SetPlayerClass( int nEntIndex, const char *pPlayerClass ) = 0;
|
||||
virtual void SetPlayerSpawnTick( int nEntIndex, int nTick ) = 0;
|
||||
virtual void SetPlayerDeathTick( int nEntIndex, int nTick ) = 0;
|
||||
|
||||
virtual const char *GetPlayerClass( int nEntIndex ) = 0;
|
||||
virtual int GetPlayerSpawnTick( int nEntIndex ) = 0;
|
||||
virtual int GetPlayerDeathTick( int nEntIndex ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYPLAYERCACHE_H
|
||||
32
common/replay/ireplayrenderqueue.h
Normal file
32
common/replay/ireplayrenderqueue.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYRENDERQUEUE_H
|
||||
#define IREPLAYRENDERQUEUE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplayRenderQueue : IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void Add( ReplayHandle_t hReplay, int iPerformance ) = 0;
|
||||
virtual void Remove( ReplayHandle_t hReplay, int iPerformance ) = 0;
|
||||
virtual void Clear() = 0;
|
||||
|
||||
virtual int GetCount() const = 0;
|
||||
virtual bool GetEntryData( int iIndex, ReplayHandle_t *pHandleOut, int *pPerformanceOut ) const = 0;
|
||||
virtual bool IsInQueue( ReplayHandle_t hReplay, int iPerformance ) const = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYRENDERQUEUE_H
|
||||
32
common/replay/ireplayscreenshotmanager.h
Normal file
32
common/replay/ireplayscreenshotmanager.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYSCREENSHOTMANAGER_H
|
||||
#define IREPLAYSCREENSHOTMANAGER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
struct CaptureScreenshotParams_t;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayScreenshotManager : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void CaptureScreenshot( CaptureScreenshotParams_t& params ) = 0;
|
||||
virtual void GetUnpaddedScreenshotSize( int &nOutWidth, int &nOutHeight ) = 0;
|
||||
virtual void DeleteScreenshotsForReplay( CReplay *pReplay ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYSCREENSHOTMANAGER_H
|
||||
34
common/replay/ireplayscreenshotsystem.h
Normal file
34
common/replay/ireplayscreenshotsystem.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYSCREENSHOTSYSTEM_H
|
||||
#define IREPLAYSCREENSHOTSYSTEM_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
struct WriteReplayScreenshotParams_t;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Implementation lives in the client - allows replay to tell the client to grab a
|
||||
// screenshot or update the cache.
|
||||
//
|
||||
class IReplayScreenshotSystem : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void WriteReplayScreenshot( WriteReplayScreenshotParams_t ¶ms ) = 0;
|
||||
virtual void UpdateReplayScreenshotCache() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYSCREENSHOTSYSTEM_H
|
||||
48
common/replay/ireplayserializeable.h
Normal file
48
common/replay/ireplayserializeable.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYSERIALIIZEABLE_H
|
||||
#define IREPLAYSERIALIIZEABLE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
#include "replay/replayhandle.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class KeyValues;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplaySerializeable : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void SetHandle( ReplayHandle_t h ) = 0;
|
||||
virtual ReplayHandle_t GetHandle() const = 0;
|
||||
|
||||
virtual bool Read( KeyValues *pIn ) = 0;
|
||||
virtual void Write( KeyValues *pOut ) = 0;
|
||||
|
||||
virtual const char *GetSubKeyTitle() const = 0;
|
||||
virtual const char *GetFilename() const = 0;
|
||||
virtual const char *GetPath() const = 0;
|
||||
|
||||
virtual const char *GetFullFilename() const = 0;
|
||||
|
||||
virtual void SetLocked( bool bLocked ) = 0;
|
||||
virtual bool IsLocked() const = 0;
|
||||
|
||||
virtual void OnDelete() = 0;
|
||||
virtual void OnUnload() = 0;
|
||||
|
||||
virtual const char *GetDebugName() const = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYSERIALIIZEABLE_H
|
||||
48
common/replay/ireplayserver.h
Normal file
48
common/replay/ireplayserver.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef IREPLAYSERVER_H
|
||||
#define IREPLAYSERVER_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class IServer;
|
||||
class IReplayDirector;
|
||||
class IGameEvent;
|
||||
struct netadr_s;
|
||||
class CServerReplay;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Interface the Replay module exposes to the engine
|
||||
//-----------------------------------------------------------------------------
|
||||
#define INTERFACEVERSION_REPLAYSERVER "ReplayServer001"
|
||||
|
||||
class IReplayServer : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual ~IReplayServer() {}
|
||||
|
||||
virtual IServer *GetBaseServer() = 0; // get Replay base server interface
|
||||
virtual IReplayDirector *GetDirector() = 0; // get director interface
|
||||
virtual int GetReplaySlot() = 0; // return entity index-1 of Replay in game
|
||||
virtual float GetOnlineTime() = 0; // seconds since broadcast started
|
||||
virtual void BroadcastEvent(IGameEvent *event) = 0; // send a director command to all specs
|
||||
virtual bool IsRecording() = 0;
|
||||
virtual void StartRecording() = 0;
|
||||
virtual void StopRecording() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
27
common/replay/ireplaysessionrecorder.h
Normal file
27
common/replay/ireplaysessionrecorder.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYSESSIONRECORDER_H
|
||||
#define IREPLAYSESSIONRECORDER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplaySessionRecorder : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void StartRecording() = 0;
|
||||
virtual void StopRecording( bool bAborting ) = 0;
|
||||
virtual void SetCurrentRecordingStartTick( int nStartTick ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYSESSIONRECORDER_H
|
||||
60
common/replay/ireplaysystem.h
Normal file
60
common/replay/ireplaysystem.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef IREPLAYSYSTEM_H
|
||||
#define IREPLAYSYSTEM_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "appframework/IAppSystem.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IClientReplayContext;
|
||||
class IServerReplayContext;
|
||||
class IGameEvent;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
abstract_class IReplaySystem : public IAppSystem
|
||||
{
|
||||
public:
|
||||
// IAppSystem:
|
||||
virtual bool Connect( CreateInterfaceFn fnFactory ) = 0;
|
||||
virtual void Disconnect() = 0;
|
||||
virtual InitReturnVal_t Init() = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
// To be called client- & server-side
|
||||
virtual void Think() = 0;
|
||||
virtual bool IsReplayEnabled() = 0;
|
||||
virtual bool IsRecording() = 0;
|
||||
|
||||
// To be called client-side only - on dedicated servers, only subs defined
|
||||
virtual bool CL_Init( CreateInterfaceFn fnClientFactory ) = 0;
|
||||
virtual void CL_Shutdown() = 0;
|
||||
virtual void CL_Render() = 0;
|
||||
virtual IClientReplayContext *CL_GetContext() = 0;
|
||||
|
||||
// To be called server-side only
|
||||
virtual bool SV_Init( CreateInterfaceFn fnFactory ) = 0;
|
||||
virtual void SV_Shutdown() = 0;
|
||||
virtual void SV_EndRecordingSession( bool bForceSynchronousPublish = false ) = 0;
|
||||
virtual void SV_SendReplayEvent( const char *pEventName, int nClientSlot ) = 0;
|
||||
virtual void SV_SendReplayEvent( IGameEvent *pEvent, int nClientSlot ) = 0;
|
||||
virtual bool SV_ShouldBeginRecording( bool bIsInWaitingForPlayers ) = 0;
|
||||
virtual void SV_NotifyReplayRequested() = 0;
|
||||
virtual IServerReplayContext *SV_GetContext() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define REPLAY_INTERFACE_VERSION "ReplaySystem001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // IREPLAYSYSTEM_H
|
||||
27
common/replay/iserverengine.h
Normal file
27
common/replay/iserverengine.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef ISERVERENGINE_H
|
||||
#define ISERVERENGINE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayServerEngine : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void EndReplayRecordingSession() = 0;
|
||||
virtual bool IsReplayRecording() = 0;
|
||||
virtual bool IsReplay() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // ISERVERENGINE_H
|
||||
37
common/replay/iserverreplay.h
Normal file
37
common/replay/iserverreplay.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef ISERVERREPLAY_H
|
||||
#define ISERVERREPLAY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define SERVER_REPLAY_INTERFACE_VERSION "ServerReplay001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayFactory;
|
||||
class KeyValues;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Allows the replay DLL to talk to the server
|
||||
//
|
||||
class IServerReplay : public IBaseInterface
|
||||
{
|
||||
public:
|
||||
virtual void UploadOgsData( KeyValues *pData, bool bIncludeTimeField ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // ISERVERREPLAY_H
|
||||
38
common/replay/iserverreplaycontext.h
Normal file
38
common/replay/iserverreplaycontext.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef ISERVERREPLAYCONTEXT_H
|
||||
#define ISERVERREPLAYCONTEXT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "replay/ireplaycontext.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IGameEvent;
|
||||
class IReplaySessionRecorder;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define REPLAYHISTORYMANAGER_INTERFACE_VERSION_SERVER "VENGINE_SERVER_REPLAY_HISTORY_MANAGER_001"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IServerReplayContext : public IReplayContext
|
||||
{
|
||||
public:
|
||||
virtual void FlagForConVarSanityCheck() = 0; // Checks replay_enable / replay_local_fileserver_path / replay_downloadurlport / replay_downloadurlpath
|
||||
virtual IGameEvent *CreateReplaySessionInfoEvent() = 0; // Create "replay_sessioninfo" event w/ appropriate fields filled in
|
||||
virtual IReplaySessionRecorder *GetSessionRecorder() = 0;
|
||||
virtual const char *GetLocalFileServerPath() const = 0; // Returns the local path where session blocks and such should be published for download
|
||||
virtual void CreateSessionOnClient( int nClientSlot ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // ISERVERREPLAYCONTEXT_H
|
||||
63
common/replay/performance.h
Normal file
63
common/replay/performance.h
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef REPLAYPERFORMANCE_H
|
||||
#define REPLAYPERFORMANCE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "shared_defs.h"
|
||||
#include "qlimits.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay;
|
||||
class KeyValues;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplayPerformance
|
||||
{
|
||||
public:
|
||||
CReplayPerformance( CReplay *pReplay );
|
||||
|
||||
inline bool HasInTick() const { return m_nTickIn >= 0; }
|
||||
inline bool HasOutTick() const { return m_nTickOut >= 0; }
|
||||
|
||||
inline int GetTickIn() const { return m_nTickIn; }
|
||||
inline int GetTickOut() const { return m_nTickOut; }
|
||||
|
||||
void Copy( const CReplayPerformance *pSrc );
|
||||
void CopyTicks( const CReplayPerformance *pSrc );
|
||||
|
||||
void SetFilename( const char *pFilename );
|
||||
const char *GetFullPerformanceFilename();
|
||||
|
||||
void AutoNameIfHasNoTitle( const char *pMapName );
|
||||
void SetTitle( const wchar_t *pTitle );
|
||||
|
||||
// NOTE: Doesn't copy exactly - gets a valid filename for the returned performance.
|
||||
CReplayPerformance *MakeCopy() const;
|
||||
|
||||
void Read( KeyValues *pIn );
|
||||
void Write( KeyValues *pOut );
|
||||
|
||||
// NOTE: Any changes made here should be reflected in the copy constructor
|
||||
// (which is called from MakeCopy()).
|
||||
wchar_t m_wszTitle[MAX_TAKE_TITLE_LENGTH];
|
||||
char m_szBaseFilename[ MAX_OSPATH ];
|
||||
CReplay *m_pReplay;
|
||||
int m_nTickIn;
|
||||
int m_nTickOut;
|
||||
|
||||
private:
|
||||
CReplayPerformance( const CReplayPerformance *pPerformance );
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // REPLAYPERFORMANCE_H
|
||||
62
common/replay/rendermovieparams.h
Normal file
62
common/replay/rendermovieparams.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef RENDERMOVIEPARAMS_H
|
||||
#define RENDERMOVIEPARAMS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier1/strtools.h"
|
||||
#include "replay/replayhandle.h"
|
||||
#include "replay/shared_defs.h"
|
||||
#include "video/ivideoservices.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
typedef unsigned int MovieHandle_t;
|
||||
|
||||
struct RenderMovieParams_t
|
||||
{
|
||||
inline RenderMovieParams_t() : m_iPerformance( -1 ) { V_memset( this, 0, sizeof( RenderMovieParams_t ) ); m_Settings.m_FPS.SetFPS( 0, false ); }
|
||||
|
||||
ReplayHandle_t m_hReplay;
|
||||
int m_iPerformance; // -1 for default view, otherwise this is an index into the replay's m_vecPerformances vector.
|
||||
wchar_t m_wszTitle[MAX_REPLAY_TITLE_LENGTH];
|
||||
char m_szVideoPreset[64];
|
||||
char m_szExtension[16]; // File extension
|
||||
bool m_bQuitWhenFinished;
|
||||
bool m_bExportRaw; // Export movie as raw TGA frames and a .WAV
|
||||
float m_flEngineFps;
|
||||
|
||||
struct ReplayRenderSettings_t
|
||||
{
|
||||
uint16 m_nWidth;
|
||||
uint16 m_nHeight;
|
||||
int8 m_nMotionBlurQuality; // [0,MAX_MOTION_BLUR_QUALITY]
|
||||
VideoFrameRate_t m_FPS; // Actual framerate can be calculated with m_FPS.GetFps()
|
||||
VideoEncodeCodec_t m_Codec;
|
||||
bool m_bMotionBlurEnabled; // Motion blur enabled?
|
||||
bool m_bAAEnabled; // Antialiasing enabled?
|
||||
int8 m_nEncodingQuality; // [0,100]
|
||||
bool m_bRaw; // This movie was exported as raw TGA frames and a .WAV file?
|
||||
}
|
||||
m_Settings;
|
||||
};
|
||||
|
||||
typedef RenderMovieParams_t::ReplayRenderSettings_t ReplayRenderSettings_t;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define MAX_DOF_QUALITY 2
|
||||
#define MAX_MOTION_BLUR_QUALITY 3
|
||||
#define SUBPIXEL_JITTER_SAMPLES 16
|
||||
#define CHEAP_DOF_SAMPLES 4
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // RENDERMOVIEPARAMS_H
|
||||
146
common/replay/replay.h
Normal file
146
common/replay/replay.h
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef REPLAY_H
|
||||
#define REPLAY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "replay/iqueryablereplayitem.h"
|
||||
#include "replay/replaytime.h"
|
||||
#include "replay/basereplayserializeable.h"
|
||||
#include "qlimits.h"
|
||||
#include "utlstring.h"
|
||||
#include "utlvector.h"
|
||||
#include "replay/shared_defs.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IReplayDownloadEventHandler;
|
||||
class CReplayScreenshot;
|
||||
class CReplayPerformance;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplay : public CBaseReplaySerializeable,
|
||||
public IQueryableReplayItem
|
||||
{
|
||||
typedef CBaseReplaySerializeable BaseClass;
|
||||
|
||||
public:
|
||||
enum ReplayStatus_t
|
||||
{
|
||||
REPLAYSTATUS_INVALID,
|
||||
REPLAYSTATUS_ERROR,
|
||||
REPLAYSTATUS_DOWNLOADPHASE, // Multiple sub-states during download state
|
||||
REPLAYSTATUS_READYTOCONVERT, // Download is complete, ready to convert
|
||||
REPLAYSTATUS_RENDERING, // Currently rendering the file
|
||||
REPLAYSTATUS_RENDERED,
|
||||
REPLAYSTATUS_MAX
|
||||
};
|
||||
|
||||
CReplay();
|
||||
virtual ~CReplay() {}
|
||||
|
||||
//
|
||||
// IReplaySerializeable
|
||||
//
|
||||
virtual const char *GetSubKeyTitle() const;
|
||||
virtual const char *GetPath() const;
|
||||
virtual void OnDelete();
|
||||
virtual bool Read( KeyValues *pIn );
|
||||
virtual void Write( KeyValues *pOut );
|
||||
|
||||
virtual void DumpGameSpecificData() const {}
|
||||
|
||||
virtual void Update() {}
|
||||
|
||||
// Hooks to allow replays to setup event listeners, etc.
|
||||
virtual void OnBeginRecording() {}
|
||||
virtual void OnEndRecording() {}
|
||||
|
||||
// Called when a replay is "completed"
|
||||
virtual void OnComplete();
|
||||
|
||||
// Should we allow this replay to be deleted?
|
||||
virtual bool ShouldAllowDelete() const { return true; }
|
||||
|
||||
void AutoNameTitleIfEmpty();
|
||||
|
||||
void AddScreenshot( int nWidth, int nHeight, const char *pBaseFilename );
|
||||
|
||||
bool HasReconstructedReplay() const;
|
||||
bool IsSignificantBlock( int iBlockReconstruction ) const; // Does this replay care about the given block?
|
||||
|
||||
CReplayPerformance *AddNewPerformance( bool bGenTitle = true, bool bGenFilename = true );
|
||||
void AddPerformance( KeyValues *pIn );
|
||||
void AddPerformance( CReplayPerformance *pPerformance );
|
||||
|
||||
// Accessors:
|
||||
inline int GetScreenshotCount() const { return m_vecScreenshots.Count(); }
|
||||
inline const CReplayScreenshot *GetScreenshot( int i ) const { return m_vecScreenshots[ i ]; }
|
||||
bool IsDownloaded() const;
|
||||
inline int GetPerformanceCount() const { return m_vecPerformances.Count(); }
|
||||
CReplayPerformance *GetPerformance( int i );
|
||||
const CReplayPerformance *GetPerformance( int i ) const;
|
||||
inline bool HasPerformance( CReplayPerformance *pPerformance ) { return m_vecPerformances.Find( pPerformance ) != m_vecPerformances.InvalidIndex(); }
|
||||
bool FindPerformance( CReplayPerformance *pPerformance, int &iResult );
|
||||
CReplayPerformance *GetPerformanceWithTitle( const wchar_t *pTitle );
|
||||
inline const char *GetMapName() const { return m_szMapName; }
|
||||
inline int GetSpawnTick() const { return m_nSpawnTick; }
|
||||
inline int GetDeathTick() const { return m_nDeathTick; }
|
||||
|
||||
// IQueryableReplayItem implementation:
|
||||
virtual const CReplayTime &GetItemDate() const;
|
||||
virtual bool IsItemRendered() const;
|
||||
virtual CReplay *GetItemReplay();
|
||||
virtual ReplayHandle_t GetItemReplayHandle() const;
|
||||
virtual QueryableReplayItemHandle_t GetItemHandle() const;
|
||||
virtual const wchar_t *GetItemTitle() const;
|
||||
virtual void SetItemTitle( const wchar_t *pTitle );
|
||||
virtual float GetItemLength() const;
|
||||
virtual void *GetUserData();
|
||||
virtual void SetUserData( void* pUserData );
|
||||
virtual bool IsItemAMovie() const;
|
||||
|
||||
// Non-persistent data
|
||||
mutable IReplayDownloadEventHandler *m_pDownloadEventHandler; // Implemented by replay browser - the reason we've got one per replay rather than
|
||||
// one per download group is because the browser needs to receive events per-thumbnail
|
||||
bool m_bSaved; // True as soon as the replay is saved to disk for the first time
|
||||
bool m_bRequestedByUser; // Did the user request to save this replay?
|
||||
bool m_bComplete; // Indicates whether the replay is done recording - this should be false
|
||||
// until the player dies, the round ends, or the level changes
|
||||
void *m_pUserData;
|
||||
float m_flNextUpdateTime;
|
||||
bool m_bDirty;
|
||||
|
||||
// Persistent data
|
||||
ReplayHandle_t m_hSession; // The recording session in which this replay was recorded
|
||||
char m_szMapName[MAX_OSPATH];
|
||||
ReplayStatus_t m_nStatus;
|
||||
const char* m_pFileURL; // In the form <protocol>://<server address>:<port number>/path/file - points to the string in the download group
|
||||
wchar_t m_wszTitle[MAX_REPLAY_TITLE_LENGTH];
|
||||
CUtlString m_strKilledBy; // Name of player who killed, if any
|
||||
int m_nDeathTime;
|
||||
int m_nSpawnTick;
|
||||
int m_nDeathTick;
|
||||
float m_flLength; // The length of the entire replay, including the post-death time, in seconds
|
||||
bool m_bRendered; // Has the replay been rendered yet?
|
||||
int m_nPlayerSlot; // Player slot (+1), used to determine which player recorded the demo during playback
|
||||
int m_nPostDeathRecordTime; // replay_postdeathrecordtime at the time of record
|
||||
CUtlVector< CReplayScreenshot * > m_vecScreenshots;
|
||||
CUtlVector< CReplayPerformance * > m_vecPerformances;
|
||||
int m_iMaxSessionBlockRequired; // The maximum session block required to reconstruct a viewable .dem file from spawn tick until length
|
||||
CReplayTime m_RecordTime; // Contains time/date when spawn tick was recorded
|
||||
float m_flStartTime; // Start time (uses engine's host_time)
|
||||
CUtlString m_strReconstructedFilename;
|
||||
bool m_bSavedDuringThisSession;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // REPLAY_H
|
||||
25
common/replay/replayhandle.h
Normal file
25
common/replay/replayhandle.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef REPLAYHANDLE_H
|
||||
#define REPLAYHANDLE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
typedef uint32 ReplayHandle_t;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define REPLAY_HANDLE_INVALID ( (ReplayHandle_t)-1 )
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // REPLAYHANDLE_H
|
||||
21
common/replay/replaylib.h
Normal file
21
common/replay/replaylib.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef REPLAYLIB_H
|
||||
#define REPLAYLIB_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class IClientReplayContext;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
bool ReplayLib_Init( const char *pGameDir, IClientReplayContext *pClientReplayContext );
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // REPLAYLIB_H
|
||||
57
common/replay/replaytime.h
Normal file
57
common/replay/replaytime.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef REPLAYTIME_H
|
||||
#define REPLAYTIME_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class KeyValues;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "vgui/ILocalize.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplayTime
|
||||
{
|
||||
public:
|
||||
CReplayTime();
|
||||
|
||||
void InitDateAndTimeToNow();
|
||||
|
||||
void Read( KeyValues *pIn );
|
||||
void Write( KeyValues *pOut );
|
||||
|
||||
// Modifiers:
|
||||
void SetDate( int nDay, int nMonth, int nYear );
|
||||
void SetTime( int nHour, int nMin, int nSec );
|
||||
inline void SetRawDate( int nRawDate ) { m_fDate = nRawDate; }
|
||||
inline void SetRawTime( int nRawTime ) { m_fTime = nRawTime; }
|
||||
|
||||
// Accessors:
|
||||
void GetTime( int &nHour, int &nMin, int &nSec ) const;
|
||||
void GetDate( int &nDay, int &nMonth, int &nYear ) const;
|
||||
|
||||
static const char *FormatTimeString( int nSecs );
|
||||
static const char *FormatPreciseTimeString( float flSecs );
|
||||
static const wchar_t *GetLocalizedMonth( vgui::ILocalize *pLocalize, int nMonth );
|
||||
static const wchar_t *GetLocalizedDay( vgui::ILocalize *pLocalize, int nDay );
|
||||
static const wchar_t *GetLocalizedYear( vgui::ILocalize *pLocalize, int nYear );
|
||||
static const wchar_t *GetLocalizedTime( vgui::ILocalize *pLocalize, int nHour, int nMin, int nSec );
|
||||
static const wchar_t *GetLocalizedDate( vgui::ILocalize *pLocalize, int nDay, int nMonth, int nYear,
|
||||
int *pHour = NULL, int *pMin = NULL, int *pSec = NULL, bool bForceFullFormat = false ); // bForceFullFormat true will keep from returning "today" or "yesterday"
|
||||
static const wchar_t *GetLocalizedDate( vgui::ILocalize *pLocalize, const CReplayTime &t, bool bForceFullFormat = false );
|
||||
|
||||
int m_fDate; // Representation of a date (bitfield)
|
||||
int m_fTime; // Representation of time (bitfield)
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // REPLAYTIME_H
|
||||
43
common/replay/replayutils.h
Normal file
43
common/replay/replayutils.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef REPLAYUTILS_H
|
||||
#define REPLAYUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "utlstring.h"
|
||||
|
||||
void Replay_GetFirstAvailableFilename( char *pDst, int nDstLen, const char *pIdealFilename, const char *pExt,
|
||||
const char *pFilePath, int nStartIndex );
|
||||
|
||||
void Replay_ConstructReplayFilenameString( CUtlString &strOut, const char *pReplaySubDir, const char *pFilename, const char *pGameDir );
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Util function, copied from src/engine/common.cpp
|
||||
//----------------------------------------------------------------------------------------
|
||||
char *Replay_va( PRINTF_FORMAT_STRING const char *format, ... );
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Return the base dir, e.g. "c:\...\game\tf\replays\"
|
||||
//----------------------------------------------------------------------------------------
|
||||
const char *Replay_GetBaseDir();
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Set the game directory (only to be called from ReplayLib_Init())
|
||||
//----------------------------------------------------------------------------------------
|
||||
void Replay_SetGameDir( const char *pGameDir );
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Return the base dir, e.g. "c:\...\game\tf\replays\"
|
||||
//----------------------------------------------------------------------------------------
|
||||
const char *Replay_GetGameDir();
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Get a name of the format "<map>: <current date & time>" - used for replays and takes.
|
||||
//----------------------------------------------------------------------------------------
|
||||
void Replay_GetAutoName( OUT_Z_BYTECAP(nDestSizeInBytes) wchar_t *pDest, int nDestSizeInBytes, const char *pMapName );
|
||||
|
||||
#endif // REPLAY_H
|
||||
72
common/replay/screenshot.h
Normal file
72
common/replay/screenshot.h
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef SCREENSHOT_H
|
||||
#define SCREENSHOT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "replay/basereplayserializeable.h"
|
||||
#include "mathlib/vector.h"
|
||||
#include "qlimits.h"
|
||||
#include "strtools.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define SUBDIR_SCREENSHOTS "screenshots"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
class CReplayScreenshot : public CBaseReplaySerializeable
|
||||
{
|
||||
public:
|
||||
inline CReplayScreenshot( int nWidth = 0, int nHeight = 0, const char *pBaseFilename = NULL )
|
||||
: m_nWidth( nWidth ), m_nHeight( nHeight )
|
||||
{
|
||||
if ( pBaseFilename )
|
||||
{
|
||||
V_strncpy( m_szBaseFilename, pBaseFilename, sizeof( m_szBaseFilename ) );
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool Read( KeyValues *pIn );
|
||||
virtual void Write( KeyValues *pOut );
|
||||
virtual const char *GetSubKeyTitle() const;
|
||||
virtual const char *GetPath() const;
|
||||
|
||||
int m_nWidth; // Screenshot width (does not include power-of-2 padding)
|
||||
int m_nHeight; // Screenshot height (does not include power-of-2 padding)
|
||||
char m_szBaseFilename[ MAX_OSPATH ];
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
struct CaptureScreenshotParams_t // To be passed from the client into IReplayHistoryManager::CaptureScreenshot()
|
||||
{
|
||||
float m_flDelay; // Delay from now (in seconds) when we will take the screenshot
|
||||
int m_nEntity; // Should be 0 if no camera adjustment is needed, otherwise should be the index of the entity index from which m_posCamera will be based
|
||||
Vector m_posCamera; // Local position, relative to entity's index (if m_nEntity > 0) for camera position
|
||||
QAngle m_angCamera; // World angles of camera - used if m_bUseCameraAngles is true
|
||||
bool m_bUseCameraAngles; // Should we use m_angCamera - m_nEntity can't be 0
|
||||
bool m_bIgnoreMinTimeBetweenScreenshots; // Force screenshot, regardless of replay_mintimebetweenscreenshots?
|
||||
bool m_bPrimary; // Only set to true for the primary screenshot, which is taken when the user saves their replay
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
struct WriteReplayScreenshotParams_t // Passed from the engine into the client to take a screenshot
|
||||
{
|
||||
const char *m_pFilename;
|
||||
int m_nWidth;
|
||||
int m_nHeight;
|
||||
Vector *m_pOrigin; // Perspective origin from which to render. Can be NULL
|
||||
QAngle *m_pAngles; // Perspective angles from which to render. Can be NULL
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // SCREENSHOT_H
|
||||
73
common/replay/shared_defs.h
Normal file
73
common/replay/shared_defs.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//=======================================================================================//
|
||||
|
||||
#ifndef SHARED_DEFS_H
|
||||
#define SHARED_DEFS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define SUBDIR_REPLAY "replay"
|
||||
#define SUBDIR_REPLAYS "replays"
|
||||
#define SUBDIR_SESSIONS "sessions"
|
||||
#define SUBDIR_BLOCKS "blocks"
|
||||
#define SUBDIR_CLIENT "client"
|
||||
#define SUBDIR_MOVIES "movies"
|
||||
#define SUBDIR_PERFORMANCES "edits"
|
||||
#define SUBDIR_SERVER "server"
|
||||
#define SUBDIR_RENDERED "rendered"
|
||||
#define SUBDIR_TMP "tmp"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define BLOCK_FILE_EXTENSION "block"
|
||||
#define GENERIC_FILE_EXTENSION "dmx"
|
||||
#define DEMO_FILE_EXTENSION "dem"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define MOVIE_HANDLE_BASE 10000 // 10,000
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define BUILD_CURL ( defined( WIN32 ) && !defined( _X360 ) ) || defined( POSIX )
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define MIN_SERVER_DUMP_INTERVAL 10
|
||||
#define MAX_SERVER_DUMP_INTERVAL 30
|
||||
|
||||
#define DOWNLOAD_TIMEOUT_THRESHOLD 90 // Timeout for a replay download - if no blocks
|
||||
// are added or updated after this many seconds,
|
||||
// the replay will be put in the error state.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define MAX_TIMES_TO_SHOW_REPLAY_WELCOME_DLG 1
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define MAX_SESSIONNAME_LENGTH 260
|
||||
#define MAX_REPLAY_TITLE_LENGTH 256
|
||||
#define MAX_TAKE_TITLE_LENGTH 256
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define DEFAULT_COMPRESSOR_TYPE COMPRESSORTYPE_BZ2
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#define JOB_FAILED ( (JobStatus_t) -1 )
|
||||
|
||||
#define DOWNLOAD_MAX_SIZE ( 8 * 1024 * 1024 ) // 8 MB
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#endif // SHARED_DEFS_H
|
||||
38
common/studiobyteswap.h
Normal file
38
common/studiobyteswap.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: StudioMDL byteswapping functions.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
#ifndef STUDIOBYTESWAP_H
|
||||
#define STUDIOBYTESWAP_H
|
||||
|
||||
#if defined(_WIN32)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "byteswap.h"
|
||||
struct studiohdr_t;
|
||||
class IPhysicsCollision;
|
||||
|
||||
namespace StudioByteSwap
|
||||
{
|
||||
typedef bool (*CompressFunc_t)( const void *pInput, int inputSize, void **pOutput, int *pOutputSize );
|
||||
|
||||
//void SetTargetBigEndian( bool bigEndian );
|
||||
void ActivateByteSwapping( bool bActivate );
|
||||
void SourceIsNative( bool bActivate );
|
||||
void SetVerbose( bool bVerbose );
|
||||
void SetCollisionInterface( IPhysicsCollision *pPhysicsCollision );
|
||||
|
||||
int ByteswapStudioFile( const char *pFilename, void *pOutBase, const void *pFileBase, int fileSize, studiohdr_t *pHdr, CompressFunc_t pCompressFunc = NULL );
|
||||
int ByteswapPHY( void *pOutBase, const void *pFileBase, int fileSize );
|
||||
int ByteswapANI( studiohdr_t* pHdr, void *pOutBase, const void *pFileBase, int filesize );
|
||||
int ByteswapVVD( void *pOutBase, const void *pFileBase, int fileSize );
|
||||
int ByteswapVTX( void *pOutBase, const void *pFileBase, int fileSize );
|
||||
int ByteswapMDL( void *pOutBase, const void *pFileBase, int fileSize );
|
||||
|
||||
#define BYTESWAP_ALIGNMENT_PADDING 4096
|
||||
}
|
||||
|
||||
#endif // STUDIOBYTESWAP_H
|
||||
32
common/userid.h
Normal file
32
common/userid.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef USERID_H
|
||||
#define USERID_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "strtools.h"
|
||||
#include "steam/steamclientpublic.h"
|
||||
#if !defined( INCLUDED_STEAM_STEAMUSERIDTYPES_H )
|
||||
#define INCLUDED_STEAM2_USERID_STRUCTS
|
||||
#include "SteamCommon.h"
|
||||
#endif
|
||||
|
||||
#define IDTYPE_WON 0
|
||||
#define IDTYPE_STEAM 1
|
||||
#define IDTYPE_VALVE 2
|
||||
#define IDTYPE_HLTV 3
|
||||
#define IDTYPE_REPLAY 4
|
||||
typedef struct USERID_s
|
||||
{
|
||||
int idtype;
|
||||
CSteamID steamid;
|
||||
} USERID_t;
|
||||
|
||||
#endif // USERID_H
|
||||
237
common/xbox/xboxstubs.h
Normal file
237
common/xbox/xboxstubs.h
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Win32 replacements for XBox.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#if !defined( XBOXSTUBS_H ) && !defined( _X360 )
|
||||
#define XBOXSTUBS_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "tier0/platform.h"
|
||||
|
||||
// Content creation/open flags
|
||||
#define XCONTENTFLAG_NONE 0x00
|
||||
#define XCONTENTFLAG_CREATENEW 0x00
|
||||
#define XCONTENTFLAG_CREATEALWAYS 0x00
|
||||
#define XCONTENTFLAG_OPENEXISTING 0x00
|
||||
#define XCONTENTFLAG_OPENALWAYS 0x00
|
||||
#define XCONTENTFLAG_TRUNCATEEXISTING 0x00
|
||||
|
||||
// Content attributes
|
||||
#define XCONTENTFLAG_NOPROFILE_TRANSFER 0x00
|
||||
#define XCONTENTFLAG_NODEVICE_TRANSFER 0x00
|
||||
#define XCONTENTFLAG_STRONG_SIGNED 0x00
|
||||
#define XCONTENTFLAG_ALLOWPROFILE_TRANSFER 0x00
|
||||
#define XCONTENTFLAG_MOVEONLY_TRANSFER 0x00
|
||||
|
||||
// Console device ports
|
||||
#define XDEVICE_PORT0 0
|
||||
#define XDEVICE_PORT1 1
|
||||
#define XDEVICE_PORT2 2
|
||||
#define XDEVICE_PORT3 3
|
||||
#define XUSER_MAX_COUNT 4
|
||||
#define XUSER_INDEX_NONE 0x000000FE
|
||||
|
||||
#define XBX_CLR_DEFAULT 0xFF000000
|
||||
#define XBX_CLR_WARNING 0x0000FFFF
|
||||
#define XBX_CLR_ERROR 0x000000FF
|
||||
|
||||
#define XBOX_MINBORDERSAFE 0
|
||||
#define XBOX_MAXBORDERSAFE 0
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XK_NULL,
|
||||
XK_BUTTON_UP,
|
||||
XK_BUTTON_DOWN,
|
||||
XK_BUTTON_LEFT,
|
||||
XK_BUTTON_RIGHT,
|
||||
XK_BUTTON_START,
|
||||
XK_BUTTON_BACK,
|
||||
XK_BUTTON_STICK1,
|
||||
XK_BUTTON_STICK2,
|
||||
XK_BUTTON_A,
|
||||
XK_BUTTON_B,
|
||||
XK_BUTTON_X,
|
||||
XK_BUTTON_Y,
|
||||
XK_BUTTON_LEFT_SHOULDER,
|
||||
XK_BUTTON_RIGHT_SHOULDER,
|
||||
XK_BUTTON_LTRIGGER,
|
||||
XK_BUTTON_RTRIGGER,
|
||||
XK_STICK1_UP,
|
||||
XK_STICK1_DOWN,
|
||||
XK_STICK1_LEFT,
|
||||
XK_STICK1_RIGHT,
|
||||
XK_STICK2_UP,
|
||||
XK_STICK2_DOWN,
|
||||
XK_STICK2_LEFT,
|
||||
XK_STICK2_RIGHT,
|
||||
XK_MAX_KEYS,
|
||||
} xKey_t;
|
||||
|
||||
//typedef enum
|
||||
//{
|
||||
// XVRB_NONE, // off
|
||||
// XVRB_ERROR, // fatal error
|
||||
// XVRB_ALWAYS, // no matter what
|
||||
// XVRB_WARNING, // non-fatal warnings
|
||||
// XVRB_STATUS, // status reports
|
||||
// XVRB_ALL,
|
||||
//} xverbose_e;
|
||||
|
||||
typedef unsigned short WORD;
|
||||
#ifndef POSIX
|
||||
typedef unsigned long DWORD;
|
||||
typedef void* HANDLE;
|
||||
typedef unsigned __int64 ULONGLONG;
|
||||
#endif
|
||||
|
||||
#ifdef POSIX
|
||||
typedef DWORD COLORREF;
|
||||
#endif
|
||||
|
||||
#ifndef INVALID_HANDLE_VALUE
|
||||
#define INVALID_HANDLE_VALUE ((HANDLE)-1)
|
||||
#endif
|
||||
|
||||
// typedef struct {
|
||||
// IN_ADDR ina; // IP address (zero if not static/DHCP)
|
||||
// IN_ADDR inaOnline; // Online IP address (zero if not online)
|
||||
// WORD wPortOnline; // Online port
|
||||
// BYTE abEnet[6]; // Ethernet MAC address
|
||||
// BYTE abOnline[20]; // Online identification
|
||||
// } XNADDR;
|
||||
|
||||
typedef int XNADDR;
|
||||
typedef uint64 XUID;
|
||||
|
||||
typedef struct {
|
||||
BYTE ab[8]; // xbox to xbox key identifier
|
||||
} XNKID;
|
||||
|
||||
typedef struct {
|
||||
BYTE ab[16]; // xbox to xbox key exchange key
|
||||
} XNKEY;
|
||||
|
||||
typedef struct _XSESSION_INFO
|
||||
{
|
||||
XNKID sessionID; // 8 bytes
|
||||
XNADDR hostAddress; // 36 bytes
|
||||
XNKEY keyExchangeKey; // 16 bytes
|
||||
} XSESSION_INFO, *PXSESSION_INFO;
|
||||
|
||||
typedef struct _XUSER_DATA
|
||||
{
|
||||
BYTE type;
|
||||
|
||||
union
|
||||
{
|
||||
int nData; // XUSER_DATA_TYPE_INT32
|
||||
int64 i64Data; // XUSER_DATA_TYPE_INT64
|
||||
double dblData; // XUSER_DATA_TYPE_DOUBLE
|
||||
struct // XUSER_DATA_TYPE_UNICODE
|
||||
{
|
||||
uint cbData; // Includes null-terminator
|
||||
char * pwszData;
|
||||
} string;
|
||||
float fData; // XUSER_DATA_TYPE_FLOAT
|
||||
struct // XUSER_DATA_TYPE_BINARY
|
||||
{
|
||||
uint cbData;
|
||||
char * pbData;
|
||||
} binary;
|
||||
};
|
||||
} XUSER_DATA, *PXUSER_DATA;
|
||||
|
||||
typedef struct _XUSER_PROPERTY
|
||||
{
|
||||
DWORD dwPropertyId;
|
||||
XUSER_DATA value;
|
||||
} XUSER_PROPERTY, *PXUSER_PROPERTY;
|
||||
|
||||
typedef struct _XUSER_CONTEXT
|
||||
{
|
||||
DWORD dwContextId;
|
||||
DWORD dwValue;
|
||||
} XUSER_CONTEXT, *PXUSER_CONTEXT;
|
||||
|
||||
typedef struct _XSESSION_SEARCHRESULT
|
||||
{
|
||||
XSESSION_INFO info;
|
||||
DWORD dwOpenPublicSlots;
|
||||
DWORD dwOpenPrivateSlots;
|
||||
DWORD dwFilledPublicSlots;
|
||||
DWORD dwFilledPrivateSlots;
|
||||
DWORD cProperties;
|
||||
DWORD cContexts;
|
||||
PXUSER_PROPERTY pProperties;
|
||||
PXUSER_CONTEXT pContexts;
|
||||
} XSESSION_SEARCHRESULT, *PXSESSION_SEARCHRESULT;
|
||||
|
||||
typedef struct _XSESSION_SEARCHRESULT_HEADER
|
||||
{
|
||||
DWORD dwSearchResults;
|
||||
XSESSION_SEARCHRESULT *pResults;
|
||||
} XSESSION_SEARCHRESULT_HEADER, *PXSESSION_SEARCHRESULT_HEADER;
|
||||
|
||||
typedef struct _XSESSION_REGISTRANT
|
||||
{
|
||||
uint64 qwMachineID;
|
||||
DWORD bTrustworthiness;
|
||||
DWORD bNumUsers;
|
||||
XUID *rgUsers;
|
||||
|
||||
} XSESSION_REGISTRANT;
|
||||
|
||||
typedef struct _XSESSION_REGISTRATION_RESULTS
|
||||
{
|
||||
DWORD wNumRegistrants;
|
||||
XSESSION_REGISTRANT *rgRegistrants;
|
||||
} XSESSION_REGISTRATION_RESULTS, *PXSESSION_REGISTRATION_RESULTS;
|
||||
|
||||
typedef struct {
|
||||
BYTE bFlags;
|
||||
BYTE bReserved;
|
||||
WORD cProbesXmit;
|
||||
WORD cProbesRecv;
|
||||
WORD cbData;
|
||||
BYTE * pbData;
|
||||
WORD wRttMinInMsecs;
|
||||
WORD wRttMedInMsecs;
|
||||
DWORD dwUpBitsPerSec;
|
||||
DWORD dwDnBitsPerSec;
|
||||
} XNQOSINFO;
|
||||
|
||||
typedef struct {
|
||||
uint cxnqos;
|
||||
uint cxnqosPending;
|
||||
XNQOSINFO axnqosinfo[1];
|
||||
} XNQOS;
|
||||
|
||||
#define XSESSION_CREATE_HOST 0
|
||||
#define XUSER_DATA_TYPE_INT32 0
|
||||
#define XSESSION_CREATE_USES_ARBITRATION 0
|
||||
#define XNET_QOS_LISTEN_ENABLE 0
|
||||
#define XNET_QOS_LISTEN_DISABLE 0
|
||||
#define XNET_QOS_LISTEN_SET_DATA 0
|
||||
|
||||
FORCEINLINE void XBX_ProcessEvents() {}
|
||||
FORCEINLINE unsigned int XBX_GetSystemTime() { return 0; }
|
||||
FORCEINLINE int XBX_GetPrimaryUserId() { return 0; }
|
||||
FORCEINLINE void XBX_SetPrimaryUserId( DWORD idx ) {}
|
||||
FORCEINLINE int XBX_GetStorageDeviceId() { return 0; }
|
||||
FORCEINLINE void XBX_SetStorageDeviceId( DWORD idx ) {}
|
||||
FORCEINLINE const char *XBX_GetLanguageString() { return ""; }
|
||||
FORCEINLINE bool XBX_IsLocalized() { return false; }
|
||||
|
||||
#define XCONTENT_MAX_DISPLAYNAME_LENGTH 128
|
||||
#define XCONTENT_MAX_FILENAME_LENGTH 42
|
||||
|
||||
#define XBX_INVALID_STORAGE_ID ((DWORD) -1)
|
||||
#define XBX_STORAGE_DECLINED ((DWORD) -2)
|
||||
|
||||
#endif // XBOXSTUBS_H
|
||||
65
game/client/C_Env_Projected_Texture.h
Normal file
65
game/client/C_Env_Projected_Texture.h
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_ENVPROJECTEDTEXTURE_H
|
||||
#define C_ENVPROJECTEDTEXTURE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_baseentity.h"
|
||||
#include "basetypes.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_EnvProjectedTexture : public C_BaseEntity
|
||||
{
|
||||
DECLARE_CLASS( C_EnvProjectedTexture, C_BaseEntity );
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_EnvProjectedTexture();
|
||||
~C_EnvProjectedTexture();
|
||||
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
void ShutDownLightHandle( void );
|
||||
|
||||
virtual void Simulate();
|
||||
|
||||
void UpdateLight( bool bForceUpdate );
|
||||
|
||||
bool ShadowsEnabled();
|
||||
|
||||
float GetFOV();
|
||||
|
||||
private:
|
||||
|
||||
ClientShadowHandle_t m_LightHandle;
|
||||
|
||||
EHANDLE m_hTargetEntity;
|
||||
|
||||
bool m_bState;
|
||||
float m_flLightFOV;
|
||||
bool m_bEnableShadows;
|
||||
bool m_bLightOnlyTarget;
|
||||
bool m_bLightWorld;
|
||||
bool m_bCameraSpace;
|
||||
color32 m_cLightColor;
|
||||
float m_flAmbient;
|
||||
char m_SpotlightTextureName[ MAX_PATH ];
|
||||
int m_nSpotlightTextureFrame;
|
||||
int m_nShadowQuality;
|
||||
bool m_bCurrentShadow;
|
||||
|
||||
public:
|
||||
C_EnvProjectedTexture *m_pNext;
|
||||
};
|
||||
|
||||
C_EnvProjectedTexture* GetEnvProjectedTextureList();
|
||||
|
||||
#endif // C_ENVPROJECTEDTEXTURE_H
|
||||
88
game/client/ScreenSpaceEffects.h
Normal file
88
game/client/ScreenSpaceEffects.h
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=====================================================================================//
|
||||
|
||||
#ifndef SCREENSPACEEFFECTS_H
|
||||
#define SCREENSPACEEFFECTS_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
class KeyValues;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Simple base class for screen space post-processing effects
|
||||
//------------------------------------------------------------------------------
|
||||
abstract_class IScreenSpaceEffect
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void Init( ) = 0;
|
||||
virtual void Shutdown( ) = 0;
|
||||
|
||||
virtual void SetParameters( KeyValues *params ) = 0;
|
||||
|
||||
virtual void Render( int x, int y, int w, int h ) = 0;
|
||||
|
||||
virtual void Enable( bool bEnable ) = 0;
|
||||
virtual bool IsEnabled( ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Interface class for managing screen space post-processing effects
|
||||
//------------------------------------------------------------------------------
|
||||
abstract_class IScreenSpaceEffectManager
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void InitScreenSpaceEffects( ) = 0;
|
||||
virtual void ShutdownScreenSpaceEffects( ) = 0;
|
||||
|
||||
virtual IScreenSpaceEffect *GetScreenSpaceEffect( const char *pEffectName ) = 0;
|
||||
|
||||
virtual void SetScreenSpaceEffectParams( const char *pEffectName, KeyValues *params ) = 0;
|
||||
virtual void SetScreenSpaceEffectParams( IScreenSpaceEffect *pEffect, KeyValues *params ) = 0;
|
||||
|
||||
virtual void EnableScreenSpaceEffect( const char *pEffectName ) = 0;
|
||||
virtual void EnableScreenSpaceEffect( IScreenSpaceEffect *pEffect ) = 0;
|
||||
|
||||
virtual void DisableScreenSpaceEffect( const char *pEffectName ) = 0;
|
||||
virtual void DisableScreenSpaceEffect( IScreenSpaceEffect *pEffect ) = 0;
|
||||
|
||||
virtual void DisableAllScreenSpaceEffects( ) = 0;
|
||||
|
||||
virtual void RenderEffects( int x, int y, int w, int h ) = 0;
|
||||
};
|
||||
|
||||
extern IScreenSpaceEffectManager *g_pScreenSpaceEffects;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Registration class for adding screen space effects to the IScreenSpaceEffectManager
|
||||
//-------------------------------------------------------------------------------------
|
||||
class CScreenSpaceEffectRegistration
|
||||
{
|
||||
public:
|
||||
CScreenSpaceEffectRegistration( const char *pName, IScreenSpaceEffect *pEffect );
|
||||
|
||||
const char *m_pEffectName;
|
||||
IScreenSpaceEffect *m_pEffect;
|
||||
|
||||
CScreenSpaceEffectRegistration *m_pNext;
|
||||
|
||||
static CScreenSpaceEffectRegistration *s_pHead;
|
||||
};
|
||||
|
||||
#define ADD_SCREENSPACE_EFFECT( CEffect, pEffectName ) CEffect pEffectName##_effect; \
|
||||
CScreenSpaceEffectRegistration pEffectName##_reg( #pEffectName, &pEffectName##_effect );
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
80
game/client/TeamBitmapImage.h
Normal file
80
game/client/TeamBitmapImage.h
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: This is a panel which is rendered image on top of an entity
|
||||
//
|
||||
// $Revision: $
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef TEAMBITMAPIMAGE_H
|
||||
#define TEAMBITMAPIMAGE_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//#include "tf_shareddefs.h"
|
||||
|
||||
#include <vgui/VGUI.h>
|
||||
|
||||
namespace vgui
|
||||
{
|
||||
class Panel;
|
||||
}
|
||||
|
||||
class BitmapImage;
|
||||
class C_BaseEntity;
|
||||
class KeyValues;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// A multiplexer bitmap that chooses a bitmap based on team
|
||||
//-----------------------------------------------------------------------------
|
||||
class CTeamBitmapImage
|
||||
{
|
||||
public:
|
||||
// construction, destruction
|
||||
CTeamBitmapImage();
|
||||
~CTeamBitmapImage();
|
||||
|
||||
// initialization
|
||||
bool Init( vgui::Panel *pParent, KeyValues* pInitData, C_BaseEntity* pEntity );
|
||||
|
||||
// Alpha override...
|
||||
void SetAlpha( float alpha );
|
||||
|
||||
// Paint the sucka. Paint it the size of the parent panel
|
||||
void Paint( float yaw = 0.0f );
|
||||
|
||||
protected:
|
||||
// Wrapper so we can implement this with EHANDLES some day
|
||||
C_BaseEntity *GetEntity() { return m_pEntity; }
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
// NOTE: Was MAX_TF_TEAMS not 4, but I don't like the dependency here.
|
||||
BITMAP_COUNT = 4 + 1
|
||||
};
|
||||
|
||||
BitmapImage *m_ppImage[ BITMAP_COUNT ];
|
||||
C_BaseEntity *m_pEntity;
|
||||
float m_Alpha;
|
||||
bool m_bRelativeTeams;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helper method to initialize a team image from KeyValues data..
|
||||
// KeyValues contains the bitmap data. pSectionName, if it exists,
|
||||
// indicates which subsection of pInitData should be looked at to get at the
|
||||
// image data. The final argument is the bitmap image to initialize.
|
||||
// The function returns true if it succeeded.
|
||||
//
|
||||
// NOTE: This function looks for the key values 'material' and 'color'
|
||||
// and uses them to set up the material + modulation color of the image
|
||||
//-----------------------------------------------------------------------------
|
||||
bool InitializeTeamImage( KeyValues *pInitData, const char* pSectionName,
|
||||
vgui::Panel *pParent, C_BaseEntity *pEntity, CTeamBitmapImage* pBitmapImage );
|
||||
|
||||
|
||||
#endif // TEAMBITMAPIMAGE_H
|
||||
56
game/client/ViewConeImage.h
Normal file
56
game/client/ViewConeImage.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: This is a panel which draws a viewcone
|
||||
//
|
||||
// $Revision: $
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef VIEWCONEIMAGE_H
|
||||
#define VIEWCONEIMAGE_H
|
||||
|
||||
#include "shareddefs.h"
|
||||
#include "vgui_bitmapimage.h"
|
||||
|
||||
namespace vgui
|
||||
{
|
||||
class Panel;
|
||||
}
|
||||
|
||||
class C_BaseEntity;
|
||||
class KeyValues;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// A bitmap that renders a view cone based on angles
|
||||
//-----------------------------------------------------------------------------
|
||||
class CViewConeImage
|
||||
{
|
||||
public:
|
||||
// initialization
|
||||
bool Init( vgui::Panel *pParent, KeyValues* pInitData );
|
||||
|
||||
// Paint the sucka
|
||||
void Paint( float yaw );
|
||||
|
||||
void SetColor( int r, int g, int b );
|
||||
|
||||
private:
|
||||
BitmapImage m_Image;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helper method to initialize a view cone image from KeyValues data..
|
||||
// KeyValues contains the bitmap data, pSectionName, if it exists,
|
||||
// indicates which subsection of pInitData should be looked at to get at the
|
||||
// image data. The final argument is the bitmap image to initialize.
|
||||
// The function returns true if it succeeded.
|
||||
//
|
||||
// NOTE: This function looks for the key values 'material' and 'color'
|
||||
// and uses them to set up the material + modulation color of the image
|
||||
//-----------------------------------------------------------------------------
|
||||
bool InitializeViewConeImage( KeyValues *pInitData, const char* pSectionName,
|
||||
vgui::Panel *pParent, CViewConeImage* pViewConeImage );
|
||||
|
||||
|
||||
#endif // VIEWCONEIMAGE_H
|
||||
57
game/client/achievement_notification_panel.h
Normal file
57
game/client/achievement_notification_panel.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef ACHIEVEMENT_NOTIFICATION_PANEL_H
|
||||
#define ACHIEVEMENT_NOTIFICATION_PANEL_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <vgui_controls/EditablePanel.h>
|
||||
#include "hudelement.h"
|
||||
|
||||
using namespace vgui;
|
||||
|
||||
class CAchievementNotificationPanel : public CHudElement, public EditablePanel
|
||||
{
|
||||
DECLARE_CLASS_SIMPLE( CAchievementNotificationPanel, EditablePanel );
|
||||
|
||||
public:
|
||||
CAchievementNotificationPanel( const char *pElementName );
|
||||
|
||||
virtual void Init();
|
||||
virtual void ApplySchemeSettings( IScheme *scheme );
|
||||
virtual bool ShouldDraw( void );
|
||||
virtual void PerformLayout( void );
|
||||
virtual void LevelInit( void ) { m_flHideTime = 0; }
|
||||
virtual void FireGameEvent( IGameEvent * event );
|
||||
virtual void OnTick( void );
|
||||
|
||||
void AddNotification( const char *szIconBaseName, const wchar_t *pHeading, const wchar_t *pTitle );
|
||||
|
||||
private:
|
||||
void ShowNextNotification();
|
||||
void SetXAndWide( Panel *pPanel, int x, int wide );
|
||||
|
||||
float m_flHideTime;
|
||||
|
||||
Label *m_pLabelHeading;
|
||||
Label *m_pLabelTitle;
|
||||
EditablePanel *m_pPanelBackground;
|
||||
ImagePanel *m_pIcon;
|
||||
|
||||
struct Notification_t
|
||||
{
|
||||
char szIconBaseName[255];
|
||||
wchar_t szHeading[255];
|
||||
wchar_t szTitle[255];
|
||||
};
|
||||
|
||||
CUtlLinkedList<Notification_t> m_queueNotification;
|
||||
};
|
||||
|
||||
#endif // ACHIEVEMENT_NOTIFICATION_PANEL_H
|
||||
213
game/client/animationlayer.h
Normal file
213
game/client/animationlayer.h
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef ANIMATIONLAYER_H
|
||||
#define ANIMATIONLAYER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
#include "rangecheckedvar.h"
|
||||
#include "lerp_functions.h"
|
||||
#include "networkvar.h"
|
||||
|
||||
class C_AnimationLayer
|
||||
{
|
||||
public:
|
||||
|
||||
// This allows the datatables to access private members.
|
||||
ALLOW_DATATABLES_PRIVATE_ACCESS();
|
||||
|
||||
C_AnimationLayer();
|
||||
void Reset();
|
||||
|
||||
void SetOrder( int order );
|
||||
|
||||
public:
|
||||
|
||||
bool IsActive( void );
|
||||
|
||||
CRangeCheckedVar<int, -1, 65535, 0> m_nSequence;
|
||||
CRangeCheckedVar<float, -2, 2, 0> m_flPrevCycle;
|
||||
CRangeCheckedVar<float, -5, 5, 0> m_flWeight;
|
||||
int m_nOrder;
|
||||
|
||||
// used for automatic crossfades between sequence changes
|
||||
CRangeCheckedVar<float, -50, 50, 1> m_flPlaybackRate;
|
||||
CRangeCheckedVar<float, -2, 2, 0> m_flCycle;
|
||||
|
||||
float GetFadeout( float flCurTime );
|
||||
|
||||
void BlendWeight();
|
||||
|
||||
float m_flLayerAnimtime;
|
||||
float m_flLayerFadeOuttime;
|
||||
|
||||
float m_flBlendIn;
|
||||
float m_flBlendOut;
|
||||
|
||||
bool m_bClientBlend;
|
||||
};
|
||||
#ifdef CLIENT_DLL
|
||||
#define CAnimationLayer C_AnimationLayer
|
||||
#endif
|
||||
|
||||
inline C_AnimationLayer::C_AnimationLayer()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
inline void C_AnimationLayer::Reset()
|
||||
{
|
||||
m_nSequence = 0;
|
||||
m_flPrevCycle = 0;
|
||||
m_flWeight = 0;
|
||||
m_flPlaybackRate = 0;
|
||||
m_flCycle = 0;
|
||||
m_flLayerAnimtime = 0;
|
||||
m_flLayerFadeOuttime = 0;
|
||||
m_flBlendIn = 0;
|
||||
m_flBlendOut = 0;
|
||||
m_bClientBlend = false;
|
||||
}
|
||||
|
||||
|
||||
inline void C_AnimationLayer::SetOrder( int order )
|
||||
{
|
||||
m_nOrder = order;
|
||||
}
|
||||
|
||||
inline float C_AnimationLayer::GetFadeout( float flCurTime )
|
||||
{
|
||||
float s;
|
||||
|
||||
if (m_flLayerFadeOuttime <= 0.0f)
|
||||
{
|
||||
s = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// blend in over 0.2 seconds
|
||||
s = 1.0 - (flCurTime - m_flLayerAnimtime) / m_flLayerFadeOuttime;
|
||||
if (s > 0 && s <= 1.0)
|
||||
{
|
||||
// do a nice spline curve
|
||||
s = 3 * s * s - 2 * s * s * s;
|
||||
}
|
||||
else if ( s > 1.0f )
|
||||
{
|
||||
// Shouldn't happen, but maybe curtime is behind animtime?
|
||||
s = 1.0f;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
inline C_AnimationLayer LoopingLerp( float flPercent, C_AnimationLayer& from, C_AnimationLayer& to )
|
||||
{
|
||||
C_AnimationLayer output;
|
||||
|
||||
output.m_nSequence = to.m_nSequence;
|
||||
output.m_flCycle = LoopingLerp( flPercent, (float)from.m_flCycle, (float)to.m_flCycle );
|
||||
output.m_flPrevCycle = to.m_flPrevCycle;
|
||||
output.m_flWeight = Lerp( flPercent, from.m_flWeight, to.m_flWeight );
|
||||
output.m_nOrder = to.m_nOrder;
|
||||
|
||||
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
|
||||
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
|
||||
return output;
|
||||
}
|
||||
|
||||
inline C_AnimationLayer Lerp( float flPercent, const C_AnimationLayer& from, const C_AnimationLayer& to )
|
||||
{
|
||||
C_AnimationLayer output;
|
||||
|
||||
output.m_nSequence = to.m_nSequence;
|
||||
output.m_flCycle = Lerp( flPercent, from.m_flCycle, to.m_flCycle );
|
||||
output.m_flPrevCycle = to.m_flPrevCycle;
|
||||
output.m_flWeight = Lerp( flPercent, from.m_flWeight, to.m_flWeight );
|
||||
output.m_nOrder = to.m_nOrder;
|
||||
|
||||
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
|
||||
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
|
||||
return output;
|
||||
}
|
||||
|
||||
inline C_AnimationLayer LoopingLerp_Hermite( float flPercent, C_AnimationLayer& prev, C_AnimationLayer& from, C_AnimationLayer& to )
|
||||
{
|
||||
C_AnimationLayer output;
|
||||
|
||||
output.m_nSequence = to.m_nSequence;
|
||||
output.m_flCycle = LoopingLerp_Hermite( flPercent, (float)prev.m_flCycle, (float)from.m_flCycle, (float)to.m_flCycle );
|
||||
output.m_flPrevCycle = to.m_flPrevCycle;
|
||||
output.m_flWeight = Lerp( flPercent, from.m_flWeight, to.m_flWeight );
|
||||
output.m_nOrder = to.m_nOrder;
|
||||
|
||||
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
|
||||
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
|
||||
return output;
|
||||
}
|
||||
|
||||
// YWB: Specialization for interpolating euler angles via quaternions...
|
||||
inline C_AnimationLayer Lerp_Hermite( float flPercent, const C_AnimationLayer& prev, const C_AnimationLayer& from, const C_AnimationLayer& to )
|
||||
{
|
||||
C_AnimationLayer output;
|
||||
|
||||
output.m_nSequence = to.m_nSequence;
|
||||
output.m_flCycle = Lerp_Hermite( flPercent, prev.m_flCycle, from.m_flCycle, to.m_flCycle );
|
||||
output.m_flPrevCycle = to.m_flPrevCycle;
|
||||
output.m_flWeight = Lerp( flPercent, from.m_flWeight, to.m_flWeight );
|
||||
output.m_nOrder = to.m_nOrder;
|
||||
|
||||
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
|
||||
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
|
||||
return output;
|
||||
}
|
||||
|
||||
inline void Lerp_Clamp( C_AnimationLayer &val )
|
||||
{
|
||||
Lerp_Clamp( val.m_nSequence );
|
||||
Lerp_Clamp( val.m_flCycle );
|
||||
Lerp_Clamp( val.m_flPrevCycle );
|
||||
Lerp_Clamp( val.m_flWeight );
|
||||
Lerp_Clamp( val.m_nOrder );
|
||||
Lerp_Clamp( val.m_flLayerAnimtime );
|
||||
Lerp_Clamp( val.m_flLayerFadeOuttime );
|
||||
}
|
||||
|
||||
inline void C_AnimationLayer::BlendWeight()
|
||||
{
|
||||
if ( !m_bClientBlend )
|
||||
return;
|
||||
|
||||
m_flWeight = 1;
|
||||
|
||||
// blend in?
|
||||
if ( m_flBlendIn != 0.0f )
|
||||
{
|
||||
if (m_flCycle < m_flBlendIn)
|
||||
{
|
||||
m_flWeight = m_flCycle / m_flBlendIn;
|
||||
}
|
||||
}
|
||||
|
||||
// blend out?
|
||||
if ( m_flBlendOut != 0.0f )
|
||||
{
|
||||
if (m_flCycle > 1.0 - m_flBlendOut)
|
||||
{
|
||||
m_flWeight = (1.0 - m_flCycle) / m_flBlendOut;
|
||||
}
|
||||
}
|
||||
|
||||
m_flWeight = 3.0 * m_flWeight * m_flWeight - 2.0 * m_flWeight * m_flWeight * m_flWeight;
|
||||
if (m_nSequence == 0)
|
||||
m_flWeight = 0;
|
||||
}
|
||||
|
||||
#endif // ANIMATIONLAYER_H
|
||||
47
game/client/baseanimatedtextureproxy.h
Normal file
47
game/client/baseanimatedtextureproxy.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef BASEANIMATEDTEXTUREPROXY
|
||||
#define BASEANIMATEDTEXTUREPROXY
|
||||
|
||||
#include "materialsystem/imaterialproxy.h"
|
||||
|
||||
class IMaterial;
|
||||
class IMaterialVar;
|
||||
|
||||
#pragma warning (disable : 4100)
|
||||
|
||||
class CBaseAnimatedTextureProxy : public IMaterialProxy
|
||||
{
|
||||
public:
|
||||
CBaseAnimatedTextureProxy();
|
||||
virtual ~CBaseAnimatedTextureProxy();
|
||||
|
||||
virtual bool Init( IMaterial *pMaterial, KeyValues *pKeyValues );
|
||||
virtual void OnBind( void *pC_BaseEntity );
|
||||
virtual void Release( void ) { delete this; }
|
||||
virtual IMaterial *GetMaterial();
|
||||
|
||||
protected:
|
||||
// derived classes must implement this; it returns the time
|
||||
// that the animation began
|
||||
virtual float GetAnimationStartTime( void* pBaseEntity ) = 0;
|
||||
|
||||
// Derived classes may implement this if they choose;
|
||||
// this method is called whenever the animation wraps...
|
||||
virtual void AnimationWrapped( void* pBaseEntity ) {}
|
||||
|
||||
protected:
|
||||
void Cleanup();
|
||||
|
||||
IMaterialVar *m_AnimatedTextureVar;
|
||||
IMaterialVar *m_AnimatedTextureFrameNumVar;
|
||||
float m_FrameRate;
|
||||
bool m_WrapAnimation;
|
||||
};
|
||||
|
||||
#endif // BASEANIMATEDTEXTUREPROXY
|
||||
64
game/client/baseclientrendertargets.h
Normal file
64
game/client/baseclientrendertargets.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Has init functions for all the standard render targets used by most games.
|
||||
// Mods who wish to make their own render targets can inherit from this class
|
||||
// and in the 'InitClientRenderTargets' interface called by the engine, set up
|
||||
// their own render targets as well as calling the init functions for various
|
||||
// common render targets provided by this class.
|
||||
//
|
||||
// Note: Unless the client defines a singleton interface by inheriting from
|
||||
// this class and exposing the singleton instance, these init and shutdown
|
||||
// functions WILL NOT be called by the engine.
|
||||
//
|
||||
//
|
||||
// $Workfile: $
|
||||
// $Date: $
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#ifndef CLIENTRENDERTARTETS_H_
|
||||
#define CLIENTRENDERTARTETS_H_
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "game/client/iclientrendertargets.h" // base class with interfaces called by the engine
|
||||
#include "materialsystem/imaterialsystem.h" // for material system classes and interfaces
|
||||
|
||||
|
||||
// Externs
|
||||
class IMaterialSystem;
|
||||
class IMaterialSystemHardwareConfig;
|
||||
|
||||
class CBaseClientRenderTargets : public IClientRenderTargets
|
||||
{
|
||||
// no networked vars
|
||||
DECLARE_CLASS_GAMEROOT( CBaseClientRenderTargets, IClientRenderTargets );
|
||||
public:
|
||||
// Interface called by engine during material system startup.
|
||||
virtual void InitClientRenderTargets ( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig, int iWaterTextureSize = 1024, int iCameraTextureSize = 256 );
|
||||
// Shutdown all custom render targets here.
|
||||
virtual void ShutdownClientRenderTargets ( void );
|
||||
|
||||
protected:
|
||||
|
||||
// Standard render textures used by most mods-- Classes inheriting from
|
||||
// this can choose to init these or not depending on their needs.
|
||||
|
||||
// For reflective and refracting water
|
||||
CTextureReference m_WaterReflectionTexture;
|
||||
CTextureReference m_WaterRefractionTexture;
|
||||
|
||||
// Used for monitors
|
||||
CTextureReference m_CameraTexture;
|
||||
|
||||
// Used for the HUD in stereo and head tracking mode
|
||||
CTextureReference m_UITexture;
|
||||
|
||||
// Init functions for the common render targets
|
||||
ITexture* CreateWaterReflectionTexture( IMaterialSystem* pMaterialSystem, int iSize = 1024 );
|
||||
ITexture* CreateWaterRefractionTexture( IMaterialSystem* pMaterialSystem, int iSize = 1024 );
|
||||
ITexture* CreateCameraTexture( IMaterialSystem* pMaterialSystem, int iSize = 256 );
|
||||
|
||||
};
|
||||
|
||||
#endif // CLIENTRENDERTARTETS_H_
|
||||
55
game/client/basepresence.h
Normal file
55
game/client/basepresence.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Base implementation of the IPresence interface
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef BASEPRESENCE_H
|
||||
#define BASEPRESENCE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "ipresence.h"
|
||||
#include "igamesystem.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Common implementation for setting user contexts and properties.
|
||||
// Each client should inherit from this to implement mod-specific presence info.
|
||||
//-----------------------------------------------------------------------------
|
||||
class CBasePresence : public IPresence, public CAutoGameSystemPerFrame
|
||||
{
|
||||
public:
|
||||
// CBaseGameSystemPerFrame overrides
|
||||
virtual bool Init( void );
|
||||
virtual void Shutdown( void );
|
||||
virtual void Update( float frametime );
|
||||
virtual char const *Name( void ) { return "presence"; }
|
||||
|
||||
// IPresence Interface
|
||||
virtual void UserSetContext( unsigned int nUserIndex, unsigned int nContextId, unsigned int nContextValue, bool bAsync = false );
|
||||
virtual void UserSetProperty( unsigned int nUserIndex, unsigned int nPropertyId, unsigned int nBytes, const void *pvValue, bool bAsync = false );
|
||||
virtual void SetupGameProperties( CUtlVector< XUSER_CONTEXT > &contexts, CUtlVector< XUSER_PROPERTY > &properties );
|
||||
virtual uint GetPresenceID( const char *pIdName );
|
||||
virtual void GetPropertyDisplayString( uint id, uint value, char *pOutput, int nBytes );
|
||||
virtual const char *GetPropertyIdString( const uint id );
|
||||
|
||||
// Stats reporting
|
||||
virtual void StartStatsReporting( HANDLE handle, bool bArbitrated );
|
||||
virtual void SetStat( uint iPropertyId, int iPropertyValue, int dataType );
|
||||
virtual void UploadStats();
|
||||
|
||||
protected:
|
||||
bool m_bArbitrated;
|
||||
bool m_bReportingStats;
|
||||
HANDLE m_hSession;
|
||||
CUtlVector< XUSER_PROPERTY > m_PlayerStats;
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Debug support
|
||||
//---------------------------------------------------------
|
||||
CON_COMMAND_MEMBER_F( CBasePresence, "user_context", DebugUserSetContext, "Set a Rich Presence Context: user_context <context id> <context value>", 0 )
|
||||
CON_COMMAND_MEMBER_F( CBasePresence, "user_property", DebugUserSetProperty, "Set a Rich Presence Property: user_property <property id>", 0 )
|
||||
};
|
||||
|
||||
#endif // BASEPRESENCE_H
|
||||
173
game/client/beamdraw.h
Normal file
173
game/client/beamdraw.h
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//===========================================================================//
|
||||
#if !defined( BEAMDRAW_H )
|
||||
#define BEAMDRAW_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "materialsystem/imaterial.h"
|
||||
#include "materialsystem/imesh.h"
|
||||
#include "mathlib/vector.h"
|
||||
#include "tier2/beamsegdraw.h"
|
||||
#include "c_pixel_visibility.h"
|
||||
|
||||
#define NOISE_DIVISIONS 128
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
struct model_t;
|
||||
struct BeamTrail_t;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Beams fill out this data structure
|
||||
// This is also used for rendering
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class Beam_t : public CDefaultClientRenderable
|
||||
{
|
||||
public:
|
||||
Beam_t();
|
||||
|
||||
// Methods of IClientRenderable
|
||||
virtual const Vector& GetRenderOrigin( void );
|
||||
virtual const QAngle& GetRenderAngles( void );
|
||||
virtual const matrix3x4_t &RenderableToWorldTransform();
|
||||
virtual void GetRenderBounds( Vector& mins, Vector& maxs );
|
||||
virtual bool ShouldDraw( void );
|
||||
virtual bool IsTransparent( void );
|
||||
virtual int DrawModel( int flags );
|
||||
virtual void ComputeFxBlend( );
|
||||
virtual int GetFxBlend( );
|
||||
|
||||
// Resets the beam state
|
||||
void Reset();
|
||||
|
||||
// Method to computing the bounding box
|
||||
void ComputeBounds();
|
||||
|
||||
// Bounding box...
|
||||
Vector m_Mins;
|
||||
Vector m_Maxs;
|
||||
pixelvis_handle_t *m_queryHandleHalo;
|
||||
float m_haloProxySize;
|
||||
|
||||
// Data is below..
|
||||
|
||||
// Next beam in list
|
||||
Beam_t* next;
|
||||
|
||||
// Type of beam
|
||||
int type;
|
||||
int flags;
|
||||
|
||||
// Control points for the beam
|
||||
int numAttachments;
|
||||
Vector attachment[MAX_BEAM_ENTS];
|
||||
Vector delta;
|
||||
|
||||
// 0 .. 1 over lifetime of beam
|
||||
float t;
|
||||
float freq;
|
||||
|
||||
// Time when beam should die
|
||||
float die;
|
||||
float width;
|
||||
float endWidth;
|
||||
float fadeLength;
|
||||
float amplitude;
|
||||
float life;
|
||||
|
||||
// Color
|
||||
float r, g, b;
|
||||
float brightness;
|
||||
|
||||
// Speed
|
||||
float speed;
|
||||
|
||||
// Animation
|
||||
float frameRate;
|
||||
float frame;
|
||||
int segments;
|
||||
|
||||
// Attachment entities for the beam
|
||||
EHANDLE entity[MAX_BEAM_ENTS];
|
||||
int attachmentIndex[MAX_BEAM_ENTS];
|
||||
|
||||
// Model info
|
||||
int modelIndex;
|
||||
int haloIndex;
|
||||
|
||||
float haloScale;
|
||||
int frameCount;
|
||||
|
||||
float rgNoise[NOISE_DIVISIONS+1];
|
||||
|
||||
// Popcorn trail for beam follows to use
|
||||
BeamTrail_t* trail;
|
||||
|
||||
// for TE_BEAMRINGPOINT
|
||||
float start_radius;
|
||||
float end_radius;
|
||||
|
||||
// for FBEAM_ONLYNOISEONCE
|
||||
bool m_bCalculatedNoise;
|
||||
|
||||
float m_flHDRColorScale;
|
||||
|
||||
#ifdef PORTAL
|
||||
bool m_bDrawInMainRender;
|
||||
bool m_bDrawInPortalRender;
|
||||
#endif //#ifdef PORTAL
|
||||
};
|
||||
|
||||
|
||||
int ScreenTransform( const Vector& point, Vector& screen );
|
||||
|
||||
void DrawSegs( int noise_divisions, float *prgNoise, const model_t* spritemodel,
|
||||
float frame, int rendermode, const Vector& source, const Vector& delta,
|
||||
float startWidth, float endWidth, float scale, float freq, float speed, int segments,
|
||||
int flags, float* color, float fadeLength, float flHDRColorScale = 1.0f );
|
||||
void DrawTeslaSegs( int noise_divisions, float *prgNoise, const model_t* spritemodel,
|
||||
float frame, int rendermode, const Vector& source, const Vector& delta,
|
||||
float startWidth, float endWidth, float scale, float freq, float speed, int segments,
|
||||
int flags, float* color, float fadeLength, float flHDRColorScale = 1.0f );
|
||||
void DrawSplineSegs( int noise_divisions, float *prgNoise,
|
||||
const model_t* beammodel, const model_t* halomodel, float flHaloScale,
|
||||
float frame, int rendermode, int numAttachments, Vector* attachment,
|
||||
float startWidth, float endWidth, float scale, float freq, float speed, int segments,
|
||||
int flags, float* color, float fadeLength, float flHDRColorScale = 1.0f );
|
||||
void DrawHalo(IMaterial* pMaterial, const Vector& source, float scale, float const* color, float flHDRColorScale = 1.0f );
|
||||
void BeamDrawHalo( const model_t* spritemodel, float frame, int rendermode, const Vector& source,
|
||||
float scale, float* color, float flHDRColorScale = 1.0f );
|
||||
void DrawDisk( int noise_divisions, float *prgNoise, const model_t* spritemodel,
|
||||
float frame, int rendermode, const Vector& source, const Vector& delta,
|
||||
float width, float scale, float freq, float speed,
|
||||
int segments, float* color, float flHDRColorScale = 1.0f );
|
||||
void DrawCylinder( int noise_divisions, float *prgNoise, const model_t* spritemodel,
|
||||
float frame, int rendermode, const Vector& source,
|
||||
const Vector& delta, float width, float scale, float freq,
|
||||
float speed, int segments, float* color, float flHDRColorScale = 1.0f );
|
||||
void DrawRing( int noise_divisions, float *prgNoise, void (*pfnNoise)( float *noise, int divs, float scale ),
|
||||
const model_t* spritemodel, float frame, int rendermode,
|
||||
const Vector& source, const Vector& delta, float width, float amplitude,
|
||||
float freq, float speed, int segments, float* color, float flHDRColorScale = 1.0f );
|
||||
void DrawBeamFollow( const model_t* spritemodel, BeamTrail_t* pHead, int frame, int rendermode, Vector& delta,
|
||||
Vector& screen, Vector& screenLast, float die, const Vector& source,
|
||||
int flags, float width, float amplitude, float freq, float* color, float flHDRColorScale = 1.0f );
|
||||
|
||||
void DrawBeamQuadratic( const Vector &start, const Vector &control, const Vector &end, float width, const Vector &color, float scrollOffset, float flHDRColorScale = 1.0f );
|
||||
class CEngineSprite *Draw_SetSpriteTexture( const model_t *pSpriteModel, int frame, int rendermode );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Assumes the material has already been bound
|
||||
//-----------------------------------------------------------------------------
|
||||
void DrawSprite( const Vector &vecOrigin, float flWidth, float flHeight, color32 color );
|
||||
|
||||
#endif // BEAMDRAW_H
|
||||
85
game/client/bone_merge_cache.h
Normal file
85
game/client/bone_merge_cache.h
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef BONE_MERGE_CACHE_H
|
||||
#define BONE_MERGE_CACHE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
class C_BaseAnimating;
|
||||
class CStudioHdr;
|
||||
|
||||
|
||||
#include "mathlib/vector.h"
|
||||
|
||||
|
||||
class CBoneMergeCache
|
||||
{
|
||||
public:
|
||||
|
||||
CBoneMergeCache();
|
||||
|
||||
void Init( C_BaseAnimating *pOwner );
|
||||
|
||||
// Updates the lookups that let it merge bones quickly.
|
||||
void UpdateCache();
|
||||
|
||||
// This copies the transform from all bones in the followed entity that have
|
||||
// names that match our bones.
|
||||
void MergeMatchingBones( int boneMask );
|
||||
|
||||
// copy bones instead of matrices
|
||||
void CopyParentToChild( const Vector parentPos[], const Quaternion parentQ[], Vector childPos[], Quaternion childQ[], int boneMask );
|
||||
void CopyChildToParent( const Vector childPos[], const Quaternion childQ[], Vector parentPos[], Quaternion parentQ[], int boneMask );
|
||||
|
||||
// Returns true if the specified bone is one that gets merged in MergeMatchingBones.
|
||||
int IsBoneMerged( int iBone ) const;
|
||||
|
||||
// Gets the origin for the first merge bone on the parent.
|
||||
bool GetAimEntOrigin( Vector *pAbsOrigin, QAngle *pAbsAngles );
|
||||
|
||||
bool GetRootBone( matrix3x4_t &rootBone );
|
||||
|
||||
private:
|
||||
|
||||
// This is the entity that we're keeping the cache updated for.
|
||||
C_BaseAnimating *m_pOwner;
|
||||
|
||||
// All the cache data is based off these. When they change, the cache data is regenerated.
|
||||
// These are either all valid pointers or all NULL.
|
||||
C_BaseAnimating *m_pFollow;
|
||||
CStudioHdr *m_pFollowHdr;
|
||||
const studiohdr_t *m_pFollowRenderHdr;
|
||||
CStudioHdr *m_pOwnerHdr;
|
||||
|
||||
// This is the mask we need to use to set up bones on the followed entity to do the bone merge
|
||||
int m_nFollowBoneSetupMask;
|
||||
|
||||
// Cache data.
|
||||
class CMergedBone
|
||||
{
|
||||
public:
|
||||
unsigned short m_iMyBone;
|
||||
unsigned short m_iParentBone;
|
||||
};
|
||||
|
||||
CUtlVector<CMergedBone> m_MergedBones;
|
||||
CUtlVector<unsigned char> m_BoneMergeBits; // One bit for each bone. The bit is set if the bone gets merged.
|
||||
};
|
||||
|
||||
|
||||
inline int CBoneMergeCache::IsBoneMerged( int iBone ) const
|
||||
{
|
||||
if ( m_pOwnerHdr )
|
||||
return m_BoneMergeBits[iBone >> 3] & ( 1 << ( iBone & 7 ) );
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif // BONE_MERGE_CACHE_H
|
||||
71
game/client/bonetoworldarray.h
Normal file
71
game/client/bonetoworldarray.h
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef BONETOWORLDARRAY_H
|
||||
#define BONETOWORLDARRAY_H
|
||||
|
||||
#include "tier0/tslist.h"
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "tier0/memdbgon.h" // for _aligned_malloc usage below
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
template <int NUM_ARRAYS>
|
||||
class CBoneToWorldArrays
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
ALIGNMENT = 128,
|
||||
};
|
||||
|
||||
CBoneToWorldArrays()
|
||||
{
|
||||
const int SIZE_ARRAY = AlignValue( sizeof(matrix3x4_t) * MAXSTUDIOBONES, ALIGNMENT );
|
||||
m_pBase = (matrix3x4_t *)_aligned_malloc( SIZE_ARRAY * NUM_ARRAYS, ALIGNMENT );
|
||||
for ( int i = 0; i < NUM_ARRAYS; i++ )
|
||||
{
|
||||
matrix3x4_t *pArray = (matrix3x4_t *)((byte *)m_pBase + SIZE_ARRAY * i);
|
||||
Assert( (size_t)pArray % ALIGNMENT == 0 );
|
||||
Free( pArray );
|
||||
}
|
||||
}
|
||||
|
||||
~CBoneToWorldArrays()
|
||||
{
|
||||
_aligned_free( m_pBase );
|
||||
}
|
||||
|
||||
int NumArrays()
|
||||
{
|
||||
return NUM_ARRAYS;
|
||||
}
|
||||
|
||||
matrix3x4_t *Alloc( bool bBlock = true )
|
||||
{
|
||||
TSLNodeBase_t *p;
|
||||
while ( ( p = m_Free.Pop() ) == NULL && bBlock )
|
||||
{
|
||||
ThreadPause();
|
||||
}
|
||||
return (matrix3x4_t *)p;
|
||||
}
|
||||
|
||||
void Free( matrix3x4_t *p )
|
||||
{
|
||||
m_Free.Push( (TSLNodeBase_t *) p );
|
||||
}
|
||||
|
||||
private:
|
||||
CTSListBase m_Free;
|
||||
matrix3x4_t *m_pBase;
|
||||
};
|
||||
|
||||
#endif // BONETOWORLDARRAY_H
|
||||
21
game/client/bsp_utils.h
Normal file
21
game/client/bsp_utils.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Exposes bsp tools to game for e.g. workshop use
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//===========================================================================//
|
||||
|
||||
#include "../utils/common/bsplib.h"
|
||||
#include "ibsppack.h"
|
||||
|
||||
// Loads bsppack module (IBSPPack) and calls RepackBSP()
|
||||
bool BSP_SyncRepack( const char *pszInputMapFile,
|
||||
const char *pszOutputMapFile,
|
||||
IBSPPack::eRepackBSPFlags eRepackFlags = (IBSPPack::eRepackBSPFlags) ( IBSPPack::eRepackBSP_CompressLumps |
|
||||
IBSPPack::eRepackBSP_CompressPackfile ) );
|
||||
|
||||
// Helper to spawn a background thread that runs SyncRepack
|
||||
void BSP_BackgroundRepack( const char *pszInputMapFile,
|
||||
const char *pszOutputMapFile,
|
||||
IBSPPack::eRepackBSPFlags eRepackFlags = (IBSPPack::eRepackBSPFlags) ( IBSPPack::eRepackBSP_CompressLumps |
|
||||
IBSPPack::eRepackBSP_CompressPackfile ) );
|
||||
61
game/client/c_ai_basenpc.h
Normal file
61
game/client/c_ai_basenpc.h
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_AI_BASENPC_H
|
||||
#define C_AI_BASENPC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
#include "c_basecombatcharacter.h"
|
||||
|
||||
// NOTE: Moved all controller code into c_basestudiomodel
|
||||
class C_AI_BaseNPC : public C_BaseCombatCharacter
|
||||
{
|
||||
DECLARE_CLASS( C_AI_BaseNPC, C_BaseCombatCharacter );
|
||||
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_AI_BaseNPC();
|
||||
virtual unsigned int PhysicsSolidMaskForEntity( void ) const;
|
||||
virtual bool IsNPC( void ) { return true; }
|
||||
bool IsMoving( void ){ return m_bIsMoving; }
|
||||
bool ShouldAvoidObstacle( void ){ return m_bPerformAvoidance; }
|
||||
virtual bool AddRagdollToFadeQueue( void ) { return m_bFadeCorpse; }
|
||||
|
||||
virtual bool GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt ) OVERRIDE;
|
||||
|
||||
int GetDeathPose( void ) { return m_iDeathPose; }
|
||||
|
||||
bool ShouldModifyPlayerSpeed( void ) { return m_bSpeedModActive; }
|
||||
int GetSpeedModifyRadius( void ) { return m_iSpeedModRadius; }
|
||||
int GetSpeedModifySpeed( void ) { return m_iSpeedModSpeed; }
|
||||
|
||||
void ClientThink( void );
|
||||
void OnDataChanged( DataUpdateType_t type );
|
||||
bool ImportantRagdoll( void ) { return m_bImportanRagdoll; }
|
||||
|
||||
private:
|
||||
C_AI_BaseNPC( const C_AI_BaseNPC & ); // not defined, not accessible
|
||||
float m_flTimePingEffect;
|
||||
int m_iDeathPose;
|
||||
int m_iDeathFrame;
|
||||
|
||||
int m_iSpeedModRadius;
|
||||
int m_iSpeedModSpeed;
|
||||
|
||||
bool m_bPerformAvoidance;
|
||||
bool m_bIsMoving;
|
||||
bool m_bFadeCorpse;
|
||||
bool m_bSpeedModActive;
|
||||
bool m_bImportanRagdoll;
|
||||
};
|
||||
|
||||
|
||||
#endif // C_AI_BASENPC_H
|
||||
813
game/client/c_baseanimating.h
Normal file
813
game/client/c_baseanimating.h
Normal file
|
|
@ -0,0 +1,813 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $Workfile: $
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#ifndef C_BASEANIMATING_H
|
||||
#define C_BASEANIMATING_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_baseentity.h"
|
||||
#include "studio.h"
|
||||
#include "utlvector.h"
|
||||
#include "ragdoll.h"
|
||||
#include "mouthinfo.h"
|
||||
// Shared activities
|
||||
#include "ai_activity.h"
|
||||
#include "animationlayer.h"
|
||||
#include "sequence_Transitioner.h"
|
||||
#include "bone_accessor.h"
|
||||
#include "bone_merge_cache.h"
|
||||
#include "ragdoll_shared.h"
|
||||
#include "tier0/threadtools.h"
|
||||
#include "datacache/idatacache.h"
|
||||
|
||||
#define LIPSYNC_POSEPARAM_NAME "mouth"
|
||||
#define NUM_HITBOX_FIRES 10
|
||||
|
||||
/*
|
||||
class C_BaseClientShader
|
||||
{
|
||||
virtual void RenderMaterial( C_BaseEntity *pEntity, int count, const vec4_t *verts, const vec4_t *normals, const vec2_t *texcoords, vec4_t *lightvalues );
|
||||
};
|
||||
*/
|
||||
|
||||
class IRagdoll;
|
||||
class CIKContext;
|
||||
class CIKState;
|
||||
class ConVar;
|
||||
class C_RopeKeyframe;
|
||||
class CBoneBitList;
|
||||
class CBoneList;
|
||||
class KeyValues;
|
||||
class CJiggleBones;
|
||||
class IBoneSetup;
|
||||
FORWARD_DECLARE_HANDLE( memhandle_t );
|
||||
typedef unsigned short MDLHandle_t;
|
||||
|
||||
extern ConVar vcollide_wireframe;
|
||||
|
||||
|
||||
struct ClientModelRenderInfo_t : public ModelRenderInfo_t
|
||||
{
|
||||
// Added space for lighting origin override. Just allocated space, need to set base pointer
|
||||
matrix3x4_t lightingOffset;
|
||||
|
||||
// Added space for model to world matrix. Just allocated space, need to set base pointer
|
||||
matrix3x4_t modelToWorld;
|
||||
};
|
||||
|
||||
struct RagdollInfo_t
|
||||
{
|
||||
bool m_bActive;
|
||||
float m_flSaveTime;
|
||||
int m_nNumBones;
|
||||
Vector m_rgBonePos[MAXSTUDIOBONES];
|
||||
Quaternion m_rgBoneQuaternion[MAXSTUDIOBONES];
|
||||
};
|
||||
|
||||
|
||||
class CAttachmentData
|
||||
{
|
||||
public:
|
||||
matrix3x4_t m_AttachmentToWorld;
|
||||
QAngle m_angRotation;
|
||||
Vector m_vOriginVelocity;
|
||||
int m_nLastFramecount : 31;
|
||||
int m_bAnglesComputed : 1;
|
||||
};
|
||||
|
||||
|
||||
typedef unsigned int ClientSideAnimationListHandle_t;
|
||||
|
||||
#define INVALID_CLIENTSIDEANIMATION_LIST_HANDLE (ClientSideAnimationListHandle_t)~0
|
||||
|
||||
|
||||
class C_BaseAnimating : public C_BaseEntity, private IModelLoadCallback
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( C_BaseAnimating, C_BaseEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
DECLARE_INTERPOLATION();
|
||||
|
||||
enum
|
||||
{
|
||||
NUM_POSEPAREMETERS = 24,
|
||||
NUM_BONECTRLS = 4
|
||||
};
|
||||
|
||||
C_BaseAnimating();
|
||||
~C_BaseAnimating();
|
||||
|
||||
virtual C_BaseAnimating* GetBaseAnimating() { return this; }
|
||||
|
||||
bool UsesPowerOfTwoFrameBufferTexture( void );
|
||||
|
||||
virtual bool Interpolate( float currentTime );
|
||||
virtual void Simulate();
|
||||
virtual void Release();
|
||||
|
||||
float GetAnimTimeInterval( void ) const;
|
||||
|
||||
virtual unsigned char GetClientSideFade( void );
|
||||
|
||||
// Get bone controller values.
|
||||
virtual void GetBoneControllers(float controllers[MAXSTUDIOBONECTRLS]);
|
||||
virtual float SetBoneController ( int iController, float flValue );
|
||||
|
||||
LocalFlexController_t GetNumFlexControllers( void );
|
||||
const char *GetFlexDescFacs( int iFlexDesc );
|
||||
const char *GetFlexControllerName( LocalFlexController_t iFlexController );
|
||||
const char *GetFlexControllerType( LocalFlexController_t iFlexController );
|
||||
|
||||
virtual void GetAimEntOrigin( IClientEntity *pAttachedTo, Vector *pAbsOrigin, QAngle *pAbsAngles );
|
||||
|
||||
// Computes a box that surrounds all hitboxes
|
||||
bool ComputeHitboxSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs );
|
||||
bool ComputeEntitySpaceHitboxSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs );
|
||||
|
||||
// Gets the hitbox-to-world transforms, returns false if there was a problem
|
||||
bool HitboxToWorldTransforms( matrix3x4_t *pHitboxToWorld[MAXSTUDIOBONES] );
|
||||
|
||||
// base model functionality
|
||||
float ClampCycle( float cycle, bool isLooping );
|
||||
virtual void GetPoseParameters( CStudioHdr *pStudioHdr, float poseParameter[MAXSTUDIOPOSEPARAM] );
|
||||
virtual void BuildTransformations( CStudioHdr *pStudioHdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed );
|
||||
virtual void ApplyBoneMatrixTransform( matrix3x4_t& transform );
|
||||
virtual int VPhysicsGetObjectList( IPhysicsObject **pList, int listMax );
|
||||
|
||||
// model specific
|
||||
virtual bool SetupBones( matrix3x4_t *pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime );
|
||||
virtual void UpdateIKLocks( float currentTime );
|
||||
virtual void CalculateIKLocks( float currentTime );
|
||||
virtual bool ShouldDraw();
|
||||
virtual int DrawModel( int flags );
|
||||
virtual int InternalDrawModel( int flags );
|
||||
virtual bool OnInternalDrawModel( ClientModelRenderInfo_t *pInfo );
|
||||
virtual bool OnPostInternalDrawModel( ClientModelRenderInfo_t *pInfo );
|
||||
void DoInternalDrawModel( ClientModelRenderInfo_t *pInfo, DrawModelState_t *pState, matrix3x4_t *pBoneToWorldArray = NULL );
|
||||
|
||||
//
|
||||
virtual CMouthInfo *GetMouth();
|
||||
virtual void ControlMouth( CStudioHdr *pStudioHdr );
|
||||
|
||||
// override in sub-classes
|
||||
virtual void DoAnimationEvents( CStudioHdr *pStudio );
|
||||
virtual void FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
|
||||
virtual void FireObsoleteEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
|
||||
virtual const char* ModifyEventParticles( const char* token ) { return token; }
|
||||
|
||||
// Parses and distributes muzzle flash events
|
||||
virtual bool DispatchMuzzleEffect( const char *options, bool isFirstPerson );
|
||||
|
||||
// virtual void AllocateMaterials( void );
|
||||
// virtual void FreeMaterials( void );
|
||||
|
||||
virtual void ValidateModelIndex( void );
|
||||
virtual CStudioHdr *OnNewModel( void );
|
||||
CStudioHdr *GetModelPtr() const;
|
||||
void InvalidateMdlCache();
|
||||
|
||||
virtual void SetPredictable( bool state );
|
||||
void UseClientSideAnimation();
|
||||
|
||||
// C_BaseClientShader **p_ClientShaders;
|
||||
|
||||
virtual void StandardBlendingRules( CStudioHdr *pStudioHdr, Vector pos[], Quaternion q[], float currentTime, int boneMask );
|
||||
void UnragdollBlend( CStudioHdr *hdr, Vector pos[], Quaternion q[], float currentTime );
|
||||
|
||||
void MaintainSequenceTransitions( IBoneSetup &boneSetup, float flCycle, Vector pos[], Quaternion q[] );
|
||||
virtual void AccumulateLayers( IBoneSetup &boneSetup, Vector pos[], Quaternion q[], float currentTime );
|
||||
|
||||
virtual void ChildLayerBlend( Vector pos[], Quaternion q[], float currentTime, int boneMask );
|
||||
|
||||
// Attachments
|
||||
int LookupAttachment( const char *pAttachmentName );
|
||||
int LookupRandomAttachment( const char *pAttachmentNameSubstring );
|
||||
|
||||
int LookupPoseParameter( CStudioHdr *pStudioHdr, const char *szName );
|
||||
inline int LookupPoseParameter( const char *szName ) { return LookupPoseParameter(GetModelPtr(), szName); }
|
||||
|
||||
float SetPoseParameter( CStudioHdr *pStudioHdr, const char *szName, float flValue );
|
||||
inline float SetPoseParameter( const char *szName, float flValue ) { return SetPoseParameter( GetModelPtr(), szName, flValue ); }
|
||||
float SetPoseParameter( CStudioHdr *pStudioHdr, int iParameter, float flValue );
|
||||
inline float SetPoseParameter( int iParameter, float flValue ) { return SetPoseParameter( GetModelPtr(), iParameter, flValue ); }
|
||||
|
||||
float GetPoseParameter( int iPoseParameter );
|
||||
|
||||
bool GetPoseParameterRange( int iPoseParameter, float &minValue, float &maxValue );
|
||||
|
||||
int LookupBone( const char *szName );
|
||||
void GetBonePosition( int iBone, Vector &origin, QAngle &angles );
|
||||
void GetBoneTransform( int iBone, matrix3x4_t &pBoneToWorld );
|
||||
|
||||
//=============================================================================
|
||||
// HPE_BEGIN:
|
||||
// [menglish] Finds the bone associated with the given hitbox
|
||||
//=============================================================================
|
||||
|
||||
int GetHitboxBone( int hitboxIndex );
|
||||
|
||||
//=============================================================================
|
||||
// HPE_END
|
||||
//=============================================================================
|
||||
|
||||
// Bone attachments
|
||||
virtual void AttachEntityToBone( C_BaseAnimating* attachTarget, int boneIndexAttached=-1, Vector bonePosition=Vector(0,0,0), QAngle boneAngles=QAngle(0,0,0) );
|
||||
void AddBoneAttachment( C_BaseAnimating* newBoneAttachment );
|
||||
void RemoveBoneAttachment( C_BaseAnimating* boneAttachment );
|
||||
void RemoveBoneAttachments();
|
||||
void DestroyBoneAttachments();
|
||||
void MoveBoneAttachments( C_BaseAnimating* attachTarget );
|
||||
int GetNumBoneAttachments();
|
||||
C_BaseAnimating* GetBoneAttachment( int i );
|
||||
virtual void NotifyBoneAttached( C_BaseAnimating* attachTarget );
|
||||
virtual void UpdateBoneAttachments( void );
|
||||
|
||||
//bool solveIK(float a, float b, const Vector &Foot, const Vector &Knee1, Vector &Knee2);
|
||||
//void DebugIK( mstudioikchain_t *pikchain );
|
||||
|
||||
virtual void PreDataUpdate( DataUpdateType_t updateType );
|
||||
virtual void PostDataUpdate( DataUpdateType_t updateType );
|
||||
virtual int RestoreData( const char *context, int slot, int type );
|
||||
|
||||
virtual void NotifyShouldTransmit( ShouldTransmitState_t state );
|
||||
virtual void OnPreDataChanged( DataUpdateType_t updateType );
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual void AddEntity( void );
|
||||
|
||||
// This can be used to force client side animation to be on. Only use if you know what you're doing!
|
||||
// Normally, the server entity should set this.
|
||||
void ForceClientSideAnimationOn();
|
||||
|
||||
void AddToClientSideAnimationList();
|
||||
void RemoveFromClientSideAnimationList( bool bBeingDestroyed = false );
|
||||
|
||||
virtual bool IsSelfAnimating();
|
||||
virtual void ResetLatched();
|
||||
|
||||
// implements these so ragdolls can handle frustum culling & leaf visibility
|
||||
virtual void GetRenderBounds( Vector& theMins, Vector& theMaxs );
|
||||
virtual const Vector& GetRenderOrigin( void );
|
||||
virtual const QAngle& GetRenderAngles( void );
|
||||
|
||||
virtual bool GetSoundSpatialization( SpatializationInfo_t& info );
|
||||
|
||||
// Attachments.
|
||||
bool GetAttachment( const char *szName, Vector &absOrigin );
|
||||
bool GetAttachment( const char *szName, Vector &absOrigin, QAngle &absAngles );
|
||||
|
||||
// Inherited from C_BaseEntity
|
||||
virtual bool GetAttachment( int number, Vector &origin );
|
||||
virtual bool GetAttachment( int number, Vector &origin, QAngle &angles );
|
||||
virtual bool GetAttachment( int number, matrix3x4_t &matrix );
|
||||
virtual bool GetAttachmentVelocity( int number, Vector &originVel, Quaternion &angleVel );
|
||||
|
||||
// Returns the attachment in local space
|
||||
bool GetAttachmentLocal( int iAttachment, matrix3x4_t &attachmentToLocal );
|
||||
bool GetAttachmentLocal( int iAttachment, Vector &origin, QAngle &angles );
|
||||
bool GetAttachmentLocal( int iAttachment, Vector &origin );
|
||||
|
||||
bool GetRootBone( matrix3x4_t &rootBone );
|
||||
|
||||
// Should this object cast render-to-texture shadows?
|
||||
virtual ShadowType_t ShadowCastType();
|
||||
|
||||
// Should we collide?
|
||||
virtual CollideType_t GetCollideType( void );
|
||||
|
||||
virtual bool TestCollision( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr );
|
||||
virtual bool TestHitboxes( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr );
|
||||
|
||||
// returns true if we're currently being ragdolled
|
||||
bool IsRagdoll() const;
|
||||
bool IsAboutToRagdoll() const;
|
||||
virtual C_BaseAnimating *BecomeRagdollOnClient();
|
||||
C_BaseAnimating *CreateRagdollCopy();
|
||||
bool InitAsClientRagdoll( const matrix3x4_t *pDeltaBones0, const matrix3x4_t *pDeltaBones1, const matrix3x4_t *pCurrentBonePosition, float boneDt, bool bFixedConstraints=false );
|
||||
void IgniteRagdoll( C_BaseAnimating *pSource );
|
||||
void TransferDissolveFrom( C_BaseAnimating *pSource );
|
||||
virtual void SaveRagdollInfo( int numbones, const matrix3x4_t &cameraTransform, CBoneAccessor &pBoneToWorld );
|
||||
virtual bool RetrieveRagdollInfo( Vector *pos, Quaternion *q );
|
||||
virtual void Clear( void );
|
||||
void ClearRagdoll();
|
||||
void CreateUnragdollInfo( C_BaseAnimating *pRagdoll );
|
||||
bool ForceSetupBonesAtTime( matrix3x4_t *pBonesOut, float flTime );
|
||||
virtual bool GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt );
|
||||
|
||||
// For shadows rendering the correct body + sequence...
|
||||
virtual int GetBody() { return m_nBody; }
|
||||
virtual int GetSkin() { return m_nSkin; }
|
||||
|
||||
bool IsOnFire() { return ( (GetFlags() & FL_ONFIRE) != 0 ); }
|
||||
|
||||
inline float GetPlaybackRate();
|
||||
inline void SetPlaybackRate( float rate );
|
||||
|
||||
void SetModelScale( float scale, float change_duration = 0.0f );
|
||||
float GetModelScale() const { return m_flModelScale; }
|
||||
inline bool IsModelScaleFractional() const; /// very fast way to ask if the model scale is < 1.0f (faster than if (GetModelScale() < 1.0f) )
|
||||
inline bool IsModelScaled() const;
|
||||
void UpdateModelScale( void );
|
||||
virtual void RefreshCollisionBounds( void );
|
||||
|
||||
int GetSequence();
|
||||
virtual void SetSequence(int nSequence);
|
||||
inline void ResetSequence(int nSequence);
|
||||
float GetSequenceGroundSpeed( CStudioHdr *pStudioHdr, int iSequence );
|
||||
inline float GetSequenceGroundSpeed( int iSequence ) { return GetSequenceGroundSpeed(GetModelPtr(), iSequence); }
|
||||
bool IsSequenceLooping( CStudioHdr *pStudioHdr, int iSequence );
|
||||
inline bool IsSequenceLooping( int iSequence ) { return IsSequenceLooping(GetModelPtr(),iSequence); }
|
||||
float GetSequenceMoveDist( CStudioHdr *pStudioHdr, int iSequence );
|
||||
void GetSequenceLinearMotion( int iSequence, Vector *pVec );
|
||||
void GetBlendedLinearVelocity( Vector *pVec );
|
||||
int LookupSequence ( const char *label );
|
||||
int LookupActivity( const char *label );
|
||||
char const *GetSequenceName( int iSequence );
|
||||
char const *GetSequenceActivityName( int iSequence );
|
||||
Activity GetSequenceActivity( int iSequence );
|
||||
KeyValues *GetSequenceKeyValues( int iSequence );
|
||||
virtual void StudioFrameAdvance(); // advance animation frame to some time in the future
|
||||
|
||||
// Clientside animation
|
||||
virtual float FrameAdvance( float flInterval = 0.0f );
|
||||
virtual float GetSequenceCycleRate( CStudioHdr *pStudioHdr, int iSequence );
|
||||
virtual void UpdateClientSideAnimation();
|
||||
void ClientSideAnimationChanged();
|
||||
virtual unsigned int ComputeClientSideAnimationFlags();
|
||||
|
||||
virtual void ResetClientsideFrame( void ) { SetCycle( 0 ); }
|
||||
|
||||
void SetCycle( float flCycle );
|
||||
float GetCycle() const;
|
||||
|
||||
void SetBodygroup( int iGroup, int iValue );
|
||||
int GetBodygroup( int iGroup );
|
||||
|
||||
const char *GetBodygroupName( int iGroup );
|
||||
int FindBodygroupByName( const char *name );
|
||||
int GetBodygroupCount( int iGroup );
|
||||
int GetNumBodyGroups( void );
|
||||
|
||||
class CBoneCache *GetBoneCache( CStudioHdr *pStudioHdr );
|
||||
void SetHitboxSet( int setnum );
|
||||
void SetHitboxSetByName( const char *setname );
|
||||
int GetHitboxSet( void );
|
||||
char const *GetHitboxSetName( void );
|
||||
int GetHitboxSetCount( void );
|
||||
void DrawClientHitboxes( float duration = 0.0f, bool monocolor = false );
|
||||
|
||||
C_BaseAnimating* FindFollowedEntity();
|
||||
|
||||
virtual bool IsActivityFinished( void ) { return m_bSequenceFinished; }
|
||||
inline bool IsSequenceFinished( void );
|
||||
inline bool SequenceLoops( void ) { return m_bSequenceLoops; }
|
||||
|
||||
// All view model attachments origins are stretched so you can place entities at them and
|
||||
// they will match up with where the attachment winds up being drawn on the view model, since
|
||||
// the view models are drawn with a different FOV.
|
||||
//
|
||||
// If you're drawing something inside of a view model's DrawModel() function, then you want the
|
||||
// original attachment origin instead of the adjusted one. To get that, call this on the
|
||||
// adjusted attachment origin.
|
||||
virtual void UncorrectViewModelAttachment( Vector &vOrigin ) {}
|
||||
|
||||
// Call this if SetupBones() has already been called this frame but you need to move the
|
||||
// entity and rerender.
|
||||
void InvalidateBoneCache();
|
||||
bool IsBoneCacheValid() const; // Returns true if the bone cache is considered good for this frame.
|
||||
void GetCachedBoneMatrix( int boneIndex, matrix3x4_t &out );
|
||||
|
||||
// Wrappers for CBoneAccessor.
|
||||
const matrix3x4_t& GetBone( int iBone ) const;
|
||||
matrix3x4_t& GetBoneForWrite( int iBone );
|
||||
|
||||
// Used for debugging. Will produce asserts if someone tries to setup bones or
|
||||
// attachments before it's allowed.
|
||||
// Use the "AutoAllowBoneAccess" class to auto push/pop bone access.
|
||||
// Use a distinct "tag" when pushing/popping - asserts when push/pop tags do not match.
|
||||
struct AutoAllowBoneAccess
|
||||
{
|
||||
AutoAllowBoneAccess( bool bAllowForNormalModels, bool bAllowForViewModels );
|
||||
~AutoAllowBoneAccess( void );
|
||||
};
|
||||
static void PushAllowBoneAccess( bool bAllowForNormalModels, bool bAllowForViewModels, char const *tagPush );
|
||||
static void PopBoneAccess( char const *tagPop );
|
||||
static void ThreadedBoneSetup();
|
||||
static void InitBoneSetupThreadPool();
|
||||
static void ShutdownBoneSetupThreadPool();
|
||||
|
||||
// Invalidate bone caches so all SetupBones() calls force bone transforms to be regenerated.
|
||||
static void InvalidateBoneCaches();
|
||||
|
||||
// Purpose: My physics object has been updated, react or extract data
|
||||
virtual void VPhysicsUpdate( IPhysicsObject *pPhysics );
|
||||
|
||||
void DisableMuzzleFlash(); // Turn off the muzzle flash (ie: signal that we handled the server's event).
|
||||
virtual void DoMuzzleFlash(); // Force a muzzle flash event. Note: this only QUEUES an event, so
|
||||
// ProcessMuzzleFlashEvent will get called later.
|
||||
bool ShouldMuzzleFlash() const; // Is the muzzle flash event on?
|
||||
|
||||
// This is called to do the actual muzzle flash effect.
|
||||
virtual void ProcessMuzzleFlashEvent();
|
||||
|
||||
// Update client side animations
|
||||
static void UpdateClientSideAnimations();
|
||||
|
||||
// Load the model's keyvalues section and create effects listed inside it
|
||||
void InitModelEffects( void );
|
||||
|
||||
// Sometimes the server wants to update the client's cycle to get the two to run in sync (for proper hit detection)
|
||||
virtual void SetServerIntendedCycle( float intended ) { (void)intended; }
|
||||
virtual float GetServerIntendedCycle( void ) { return -1.0f; }
|
||||
|
||||
// For prediction
|
||||
int SelectWeightedSequence ( int activity );
|
||||
int SelectWeightedSequenceFromModifiers( Activity activity, CUtlSymbol *pActivityModifiers, int iModifierCount );
|
||||
void ResetSequenceInfo( void );
|
||||
float SequenceDuration( void );
|
||||
float SequenceDuration( CStudioHdr *pStudioHdr, int iSequence );
|
||||
inline float SequenceDuration( int iSequence ) { return SequenceDuration(GetModelPtr(), iSequence); }
|
||||
int FindTransitionSequence( int iCurrentSequence, int iGoalSequence, int *piDir );
|
||||
|
||||
void RagdollMoved( void );
|
||||
|
||||
virtual void GetToolRecordingState( KeyValues *msg );
|
||||
virtual void CleanupToolRecordingState( KeyValues *msg );
|
||||
|
||||
void SetReceivedSequence( void );
|
||||
virtual bool ShouldResetSequenceOnNewModel( void );
|
||||
|
||||
virtual bool IsViewModel() const;
|
||||
virtual void UpdateOnRemove( void );
|
||||
|
||||
protected:
|
||||
// View models scale their attachment positions to account for FOV. To get the unmodified
|
||||
// attachment position (like if you're rendering something else during the view model's DrawModel call),
|
||||
// use TransformViewModelAttachmentToWorld.
|
||||
virtual void FormatViewModelAttachment( int nAttachment, matrix3x4_t &attachmentToWorld ) {}
|
||||
|
||||
// View models say yes to this.
|
||||
bool IsBoneAccessAllowed() const;
|
||||
CMouthInfo& MouthInfo();
|
||||
|
||||
// Models used in a ModelPanel say yes to this
|
||||
virtual bool IsMenuModel() const;
|
||||
|
||||
// Allow studio models to tell C_BaseEntity what their m_nBody value is
|
||||
virtual int GetStudioBody( void ) { return m_nBody; }
|
||||
|
||||
virtual bool CalcAttachments();
|
||||
|
||||
private:
|
||||
// This method should return true if the bones have changed + SetupBones needs to be called
|
||||
virtual float LastBoneChangedTime() { return FLT_MAX; }
|
||||
|
||||
CBoneList* RecordBones( CStudioHdr *hdr, matrix3x4_t *pBoneState );
|
||||
|
||||
bool PutAttachment( int number, const matrix3x4_t &attachmentToWorld );
|
||||
void TermRopes();
|
||||
|
||||
void DelayedInitModelEffects( void );
|
||||
|
||||
void UpdateRelevantInterpolatedVars();
|
||||
void AddBaseAnimatingInterpolatedVars();
|
||||
void RemoveBaseAnimatingInterpolatedVars();
|
||||
|
||||
public:
|
||||
CRagdoll *m_pRagdoll;
|
||||
|
||||
// Texture group to use
|
||||
int m_nSkin;
|
||||
|
||||
// Object bodygroup
|
||||
int m_nBody;
|
||||
|
||||
// Hitbox set to use (default 0)
|
||||
int m_nHitboxSet;
|
||||
|
||||
CSequenceTransitioner m_SequenceTransitioner;
|
||||
|
||||
protected:
|
||||
CIKContext *m_pIk;
|
||||
|
||||
int m_iEyeAttachment;
|
||||
|
||||
// Animation playback framerate
|
||||
float m_flPlaybackRate;
|
||||
|
||||
// Decomposed ragdoll info
|
||||
bool m_bStoreRagdollInfo;
|
||||
RagdollInfo_t *m_pRagdollInfo;
|
||||
Vector m_vecForce;
|
||||
int m_nForceBone;
|
||||
|
||||
// Is bone cache valid
|
||||
// bone transformation matrix
|
||||
unsigned long m_iMostRecentModelBoneCounter;
|
||||
unsigned long m_iMostRecentBoneSetupRequest;
|
||||
int m_iPrevBoneMask;
|
||||
int m_iAccumulatedBoneMask;
|
||||
|
||||
CBoneAccessor m_BoneAccessor;
|
||||
CThreadFastMutex m_BoneSetupLock;
|
||||
|
||||
ClientSideAnimationListHandle_t m_ClientSideAnimationListHandle;
|
||||
|
||||
// Client-side animation
|
||||
bool m_bClientSideFrameReset;
|
||||
|
||||
// Bone attachments. Used for attaching one BaseAnimating to another's bones.
|
||||
// Client side only.
|
||||
CUtlVector<CHandle<C_BaseAnimating> > m_BoneAttachments;
|
||||
int m_boneIndexAttached;
|
||||
Vector m_bonePosition;
|
||||
QAngle m_boneAngles;
|
||||
CHandle<C_BaseAnimating> m_pAttachedTo;
|
||||
|
||||
protected:
|
||||
|
||||
float m_fadeMinDist;
|
||||
float m_fadeMaxDist;
|
||||
float m_flFadeScale;
|
||||
|
||||
private:
|
||||
|
||||
float m_flGroundSpeed; // computed linear movement rate for current sequence
|
||||
float m_flLastEventCheck; // cycle index of when events were last checked
|
||||
bool m_bSequenceFinished;// flag set when StudioAdvanceFrame moves across a frame boundry
|
||||
bool m_bSequenceLoops; // true if the sequence loops
|
||||
|
||||
// Mouth lipsync/envelope following values
|
||||
CMouthInfo m_mouth;
|
||||
|
||||
CNetworkVar( float, m_flModelScale );
|
||||
|
||||
// Animation blending factors
|
||||
float m_flPoseParameter[MAXSTUDIOPOSEPARAM];
|
||||
CInterpolatedVarArray< float, MAXSTUDIOPOSEPARAM > m_iv_flPoseParameter;
|
||||
float m_flOldPoseParameters[MAXSTUDIOPOSEPARAM];
|
||||
|
||||
int m_nPrevSequence;
|
||||
int m_nRestoreSequence;
|
||||
|
||||
// Ropes that got spawned when the model was created.
|
||||
CUtlLinkedList<C_RopeKeyframe*,unsigned short> m_Ropes;
|
||||
|
||||
// event processing info
|
||||
float m_flPrevEventCycle;
|
||||
int m_nEventSequence;
|
||||
|
||||
float m_flEncodedController[MAXSTUDIOBONECTRLS];
|
||||
CInterpolatedVarArray< float, MAXSTUDIOBONECTRLS > m_iv_flEncodedController;
|
||||
float m_flOldEncodedController[MAXSTUDIOBONECTRLS];
|
||||
|
||||
// Clientside animation
|
||||
bool m_bClientSideAnimation;
|
||||
bool m_bLastClientSideFrameReset;
|
||||
|
||||
int m_nNewSequenceParity;
|
||||
int m_nResetEventsParity;
|
||||
|
||||
int m_nPrevNewSequenceParity;
|
||||
int m_nPrevResetEventsParity;
|
||||
|
||||
bool m_builtRagdoll;
|
||||
Vector m_vecPreRagdollMins;
|
||||
Vector m_vecPreRagdollMaxs;
|
||||
|
||||
// Current animation sequence
|
||||
int m_nSequence;
|
||||
bool m_bReceivedSequence;
|
||||
|
||||
// Current cycle location from server
|
||||
protected:
|
||||
float m_flCycle;
|
||||
CInterpolatedVar< float > m_iv_flCycle;
|
||||
float m_flOldCycle;
|
||||
bool m_bNoModelParticles;
|
||||
|
||||
private:
|
||||
float m_flOldModelScale;
|
||||
int m_nOldSequence;
|
||||
CBoneMergeCache *m_pBoneMergeCache; // This caches the strcmp lookups that it has to do
|
||||
// when merg
|
||||
|
||||
CUtlVector< matrix3x4_t > m_CachedBoneData; // never access this directly. Use m_BoneAccessor.
|
||||
memhandle_t m_hitboxBoneCacheHandle;
|
||||
float m_flLastBoneSetupTime;
|
||||
CJiggleBones *m_pJiggleBones;
|
||||
|
||||
// Calculated attachment points
|
||||
CUtlVector<CAttachmentData> m_Attachments;
|
||||
|
||||
bool SetupBones_AttachmentHelper( CStudioHdr *pStudioHdr );
|
||||
|
||||
EHANDLE m_hLightingOrigin;
|
||||
EHANDLE m_hLightingOriginRelative;
|
||||
|
||||
// These are compared against each other to determine if the entity should muzzle flash.
|
||||
CNetworkVar( unsigned char, m_nMuzzleFlashParity );
|
||||
unsigned char m_nOldMuzzleFlashParity;
|
||||
|
||||
bool m_bInitModelEffects;
|
||||
|
||||
// Dynamic models
|
||||
bool m_bDynamicModelAllowed;
|
||||
bool m_bDynamicModelPending;
|
||||
bool m_bResetSequenceInfoOnLoad;
|
||||
CRefCountedModelIndex m_AutoRefModelIndex;
|
||||
public:
|
||||
void EnableDynamicModels() { m_bDynamicModelAllowed = true; }
|
||||
bool IsDynamicModelLoading() const { return m_bDynamicModelPending; }
|
||||
private:
|
||||
virtual void OnModelLoadComplete( const model_t* pModel );
|
||||
|
||||
private:
|
||||
void LockStudioHdr();
|
||||
void UnlockStudioHdr();
|
||||
mutable CStudioHdr *m_pStudioHdr;
|
||||
mutable MDLHandle_t m_hStudioHdr;
|
||||
CThreadFastMutex m_StudioHdrInitLock;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
RAGDOLL_FRICTION_OFF = -2,
|
||||
RAGDOLL_FRICTION_NONE,
|
||||
RAGDOLL_FRICTION_IN,
|
||||
RAGDOLL_FRICTION_HOLD,
|
||||
RAGDOLL_FRICTION_OUT,
|
||||
};
|
||||
|
||||
class C_ClientRagdoll : public C_BaseAnimating, public IPVSNotify
|
||||
{
|
||||
|
||||
public:
|
||||
C_ClientRagdoll( bool bRestoring = true );
|
||||
DECLARE_CLASS( C_ClientRagdoll, C_BaseAnimating );
|
||||
DECLARE_DATADESC();
|
||||
|
||||
// inherited from IPVSNotify
|
||||
virtual void OnPVSStatusChanged( bool bInPVS );
|
||||
|
||||
virtual void Release( void );
|
||||
virtual void SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights );
|
||||
virtual void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
|
||||
void ClientThink( void );
|
||||
void ReleaseRagdoll( void ) { m_bReleaseRagdoll = true; }
|
||||
bool ShouldSavePhysics( void ) { return true; }
|
||||
virtual void OnSave();
|
||||
virtual void OnRestore();
|
||||
virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() | FCAP_SAVE_NON_NETWORKABLE; }
|
||||
virtual IPVSNotify* GetPVSNotifyInterface() { return this; }
|
||||
|
||||
void HandleAnimatedFriction( void );
|
||||
virtual void SUB_Remove( void );
|
||||
|
||||
void FadeOut( void );
|
||||
virtual float LastBoneChangedTime();
|
||||
|
||||
bool m_bFadeOut;
|
||||
bool m_bImportant;
|
||||
float m_flEffectTime;
|
||||
|
||||
private:
|
||||
int m_iCurrentFriction;
|
||||
int m_iMinFriction;
|
||||
int m_iMaxFriction;
|
||||
float m_flFrictionModTime;
|
||||
float m_flFrictionTime;
|
||||
|
||||
int m_iFrictionAnimState;
|
||||
bool m_bReleaseRagdoll;
|
||||
|
||||
bool m_bFadingOut;
|
||||
|
||||
float m_flScaleEnd[NUM_HITBOX_FIRES];
|
||||
float m_flScaleTimeStart[NUM_HITBOX_FIRES];
|
||||
float m_flScaleTimeEnd[NUM_HITBOX_FIRES];
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Serves the 90% case of calling SetSequence / ResetSequenceInfo.
|
||||
//-----------------------------------------------------------------------------
|
||||
inline void C_BaseAnimating::ResetSequence(int nSequence)
|
||||
{
|
||||
SetSequence( nSequence );
|
||||
ResetSequenceInfo();
|
||||
}
|
||||
|
||||
inline float C_BaseAnimating::GetPlaybackRate()
|
||||
{
|
||||
return m_flPlaybackRate;
|
||||
}
|
||||
|
||||
inline void C_BaseAnimating::SetPlaybackRate( float rate )
|
||||
{
|
||||
m_flPlaybackRate = rate;
|
||||
}
|
||||
|
||||
inline const matrix3x4_t& C_BaseAnimating::GetBone( int iBone ) const
|
||||
{
|
||||
return m_BoneAccessor.GetBone( iBone );
|
||||
}
|
||||
|
||||
inline matrix3x4_t& C_BaseAnimating::GetBoneForWrite( int iBone )
|
||||
{
|
||||
return m_BoneAccessor.GetBoneForWrite( iBone );
|
||||
}
|
||||
|
||||
|
||||
inline bool C_BaseAnimating::ShouldMuzzleFlash() const
|
||||
{
|
||||
return m_nOldMuzzleFlashParity != m_nMuzzleFlashParity;
|
||||
}
|
||||
|
||||
inline float C_BaseAnimating::GetCycle() const
|
||||
{
|
||||
return m_flCycle;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: return a pointer to an updated studiomdl cache cache
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline CStudioHdr *C_BaseAnimating::GetModelPtr() const
|
||||
{
|
||||
if ( IsDynamicModelLoading() )
|
||||
return NULL;
|
||||
|
||||
#ifdef _DEBUG
|
||||
// GetModelPtr() is often called before OnNewModel() so go ahead and set it up first chance.
|
||||
// static IDataCacheSection *pModelCache = datacache->FindSection( "ModelData" );
|
||||
// AssertOnce( pModelCache->IsFrameLocking() );
|
||||
#endif
|
||||
if ( !m_pStudioHdr )
|
||||
{
|
||||
const_cast<C_BaseAnimating *>(this)->LockStudioHdr();
|
||||
}
|
||||
Assert( m_pStudioHdr ? m_pStudioHdr->GetRenderHdr() == mdlcache->GetStudioHdr(m_hStudioHdr) : m_hStudioHdr == MDLHANDLE_INVALID );
|
||||
return m_pStudioHdr;
|
||||
}
|
||||
|
||||
|
||||
inline void C_BaseAnimating::InvalidateMdlCache()
|
||||
{
|
||||
UnlockStudioHdr();
|
||||
}
|
||||
|
||||
inline bool C_BaseAnimating::IsModelScaleFractional() const
|
||||
{
|
||||
return ( m_flModelScale < 1.0f );
|
||||
}
|
||||
|
||||
inline bool C_BaseAnimating::IsModelScaled() const
|
||||
{
|
||||
return ( m_flModelScale > 1.0f+FLT_EPSILON || m_flModelScale < 1.0f-FLT_EPSILON );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sequence access
|
||||
//-----------------------------------------------------------------------------
|
||||
inline int C_BaseAnimating::GetSequence()
|
||||
{
|
||||
return m_nSequence;
|
||||
}
|
||||
|
||||
inline bool C_BaseAnimating::IsSequenceFinished( void )
|
||||
{
|
||||
return m_bSequenceFinished;
|
||||
}
|
||||
|
||||
inline float C_BaseAnimating::SequenceDuration( void )
|
||||
{
|
||||
return SequenceDuration( GetSequence() );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Mouth
|
||||
//-----------------------------------------------------------------------------
|
||||
inline CMouthInfo& C_BaseAnimating::MouthInfo()
|
||||
{
|
||||
return m_mouth;
|
||||
}
|
||||
|
||||
|
||||
// FIXME: move these to somewhere that makes sense
|
||||
void GetColumn( matrix3x4_t& src, int column, Vector &dest );
|
||||
void SetColumn( Vector &src, int column, matrix3x4_t& dest );
|
||||
|
||||
EXTERN_RECV_TABLE(DT_BaseAnimating);
|
||||
|
||||
|
||||
extern void DevMsgRT( PRINTF_FORMAT_STRING char const* pMsg, ... );
|
||||
|
||||
#endif // C_BASEANIMATING_H
|
||||
67
game/client/c_baseanimatingoverlay.h
Normal file
67
game/client/c_baseanimatingoverlay.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_BASEANIMATINGOVERLAY_H
|
||||
#define C_BASEANIMATINGOVERLAY_H
|
||||
#pragma once
|
||||
|
||||
#include "c_baseanimating.h"
|
||||
|
||||
// For shared code.
|
||||
#define CBaseAnimatingOverlay C_BaseAnimatingOverlay
|
||||
|
||||
|
||||
class C_BaseAnimatingOverlay : public C_BaseAnimating
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( C_BaseAnimatingOverlay, C_BaseAnimating );
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
DECLARE_INTERPOLATION();
|
||||
|
||||
|
||||
C_BaseAnimatingOverlay();
|
||||
|
||||
virtual CStudioHdr *OnNewModel();
|
||||
|
||||
C_AnimationLayer* GetAnimOverlay( int i );
|
||||
void SetNumAnimOverlays( int num ); // This makes sure there is space for this # of layers.
|
||||
int GetNumAnimOverlays() const;
|
||||
|
||||
virtual void GetRenderBounds( Vector& theMins, Vector& theMaxs );
|
||||
|
||||
void CheckForLayerChanges( CStudioHdr *hdr, float currentTime );
|
||||
|
||||
// model specific
|
||||
virtual void AccumulateLayers( IBoneSetup &boneSetup, Vector pos[], Quaternion q[], float currentTime );
|
||||
virtual void DoAnimationEvents( CStudioHdr *pStudioHdr );
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_OVERLAYS = 15,
|
||||
};
|
||||
|
||||
CUtlVector < C_AnimationLayer > m_AnimOverlay;
|
||||
|
||||
CUtlVector < CInterpolatedVar< C_AnimationLayer > > m_iv_AnimOverlay;
|
||||
|
||||
float m_flOverlayPrevEventCycle[ MAX_OVERLAYS ];
|
||||
|
||||
private:
|
||||
C_BaseAnimatingOverlay( const C_BaseAnimatingOverlay & ); // not defined, not accessible
|
||||
};
|
||||
|
||||
|
||||
EXTERN_RECV_TABLE(DT_BaseAnimatingOverlay);
|
||||
|
||||
|
||||
#endif // C_BASEANIMATINGOVERLAY_H
|
||||
|
||||
|
||||
|
||||
|
||||
199
game/client/c_basecombatcharacter.h
Normal file
199
game/client/c_basecombatcharacter.h
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Defines the client-side representation of CBaseCombatCharacter.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_BASECOMBATCHARACTER_H
|
||||
#define C_BASECOMBATCHARACTER_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "shareddefs.h"
|
||||
#include "c_baseflex.h"
|
||||
#ifdef GLOWS_ENABLE
|
||||
#include "glow_outline_effect.h"
|
||||
#endif // GLOWS_ENABLE
|
||||
|
||||
class C_BaseCombatWeapon;
|
||||
class C_WeaponCombatShield;
|
||||
|
||||
#define BCC_DEFAULT_LOOK_TOWARDS_TOLERANCE 0.9f
|
||||
|
||||
class C_BaseCombatCharacter : public C_BaseFlex
|
||||
{
|
||||
DECLARE_CLASS( C_BaseCombatCharacter, C_BaseFlex );
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
|
||||
C_BaseCombatCharacter( void );
|
||||
virtual ~C_BaseCombatCharacter( void );
|
||||
|
||||
virtual void OnPreDataChanged( DataUpdateType_t updateType );
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
|
||||
virtual bool IsBaseCombatCharacter( void ) { return true; };
|
||||
virtual C_BaseCombatCharacter *MyCombatCharacterPointer( void ) { return this; }
|
||||
|
||||
// -----------------------
|
||||
// Vision
|
||||
// -----------------------
|
||||
enum FieldOfViewCheckType { USE_FOV, DISREGARD_FOV };
|
||||
bool IsAbleToSee( const CBaseEntity *entity, FieldOfViewCheckType checkFOV ); // Visible starts with line of sight, and adds all the extra game checks like fog, smoke, camo...
|
||||
bool IsAbleToSee( C_BaseCombatCharacter *pBCC, FieldOfViewCheckType checkFOV ); // Visible starts with line of sight, and adds all the extra game checks like fog, smoke, camo...
|
||||
|
||||
virtual bool IsLookingTowards( const CBaseEntity *target, float cosTolerance = BCC_DEFAULT_LOOK_TOWARDS_TOLERANCE ) const; // return true if our view direction is pointing at the given target, within the cosine of the angular tolerance. LINE OF SIGHT IS NOT CHECKED.
|
||||
virtual bool IsLookingTowards( const Vector &target, float cosTolerance = BCC_DEFAULT_LOOK_TOWARDS_TOLERANCE ) const; // return true if our view direction is pointing at the given target, within the cosine of the angular tolerance. LINE OF SIGHT IS NOT CHECKED.
|
||||
|
||||
virtual bool IsInFieldOfView( CBaseEntity *entity ) const; // Calls IsLookingAt with the current field of view.
|
||||
virtual bool IsInFieldOfView( const Vector &pos ) const;
|
||||
|
||||
enum LineOfSightCheckType
|
||||
{
|
||||
IGNORE_NOTHING,
|
||||
IGNORE_ACTORS
|
||||
};
|
||||
virtual bool IsLineOfSightClear( CBaseEntity *entity, LineOfSightCheckType checkType = IGNORE_NOTHING ) const;// strictly LOS check with no other considerations
|
||||
virtual bool IsLineOfSightClear( const Vector &pos, LineOfSightCheckType checkType = IGNORE_NOTHING, CBaseEntity *entityToIgnore = NULL ) const;
|
||||
|
||||
|
||||
// -----------------------
|
||||
// Ammo
|
||||
// -----------------------
|
||||
void RemoveAmmo( int iCount, int iAmmoIndex );
|
||||
void RemoveAmmo( int iCount, const char *szName );
|
||||
void RemoveAllAmmo( );
|
||||
int GetAmmoCount( int iAmmoIndex ) const;
|
||||
int GetAmmoCount( char *szName ) const;
|
||||
|
||||
C_BaseCombatWeapon* Weapon_OwnsThisType( const char *pszWeapon, int iSubType = 0 ) const; // True if already owns a weapon of this class
|
||||
virtual bool Weapon_Switch( C_BaseCombatWeapon *pWeapon, int viewmodelindex = 0 );
|
||||
virtual bool Weapon_CanSwitchTo(C_BaseCombatWeapon *pWeapon);
|
||||
|
||||
// I can't use my current weapon anymore. Switch me to the next best weapon.
|
||||
bool SwitchToNextBestWeapon(C_BaseCombatWeapon *pCurrent);
|
||||
|
||||
virtual C_BaseCombatWeapon *GetActiveWeapon( void ) const;
|
||||
int WeaponCount() const;
|
||||
C_BaseCombatWeapon *GetWeapon( int i ) const;
|
||||
|
||||
// This is a sort of hack back-door only used by physgun!
|
||||
void SetAmmoCount( int iCount, int iAmmoIndex );
|
||||
|
||||
float GetNextAttack() const { return m_flNextAttack; }
|
||||
void SetNextAttack( float flWait ) { m_flNextAttack = flWait; }
|
||||
|
||||
virtual int BloodColor();
|
||||
|
||||
// Blood color (see BLOOD_COLOR_* macros in baseentity.h)
|
||||
void SetBloodColor( int nBloodColor );
|
||||
|
||||
virtual void DoMuzzleFlash();
|
||||
|
||||
#ifdef GLOWS_ENABLE
|
||||
CGlowObject *GetGlowObject( void ){ return m_pGlowEffect; }
|
||||
virtual void GetGlowEffectColor( float *r, float *g, float *b );
|
||||
// void EnableGlowEffect( float r, float g, float b );
|
||||
|
||||
void SetClientSideGlowEnabled( bool bEnabled ){ m_bClientSideGlowEnabled = bEnabled; UpdateGlowEffect(); }
|
||||
bool IsClientSideGlowEnabled( void ){ return m_bClientSideGlowEnabled; }
|
||||
#endif // GLOWS_ENABLE
|
||||
|
||||
public:
|
||||
|
||||
float m_flNextAttack;
|
||||
|
||||
protected:
|
||||
|
||||
#ifdef GLOWS_ENABLE
|
||||
virtual void UpdateGlowEffect( void );
|
||||
virtual void DestroyGlowEffect( void );
|
||||
#endif // GLOWS_ENABLE
|
||||
|
||||
int m_bloodColor; // color of blood particless
|
||||
|
||||
private:
|
||||
bool ComputeLOS( const Vector &vecEyePosition, const Vector &vecTarget ) const;
|
||||
|
||||
CNetworkArray( int, m_iAmmo, MAX_AMMO_TYPES );
|
||||
|
||||
CHandle<C_BaseCombatWeapon> m_hMyWeapons[MAX_WEAPONS];
|
||||
CHandle< C_BaseCombatWeapon > m_hActiveWeapon;
|
||||
|
||||
#ifdef GLOWS_ENABLE
|
||||
bool m_bClientSideGlowEnabled; // client-side only value used for spectator
|
||||
bool m_bGlowEnabled; // networked value
|
||||
bool m_bOldGlowEnabled;
|
||||
CGlowObject *m_pGlowEffect;
|
||||
#endif // GLOWS_ENABLE
|
||||
|
||||
private:
|
||||
C_BaseCombatCharacter( const C_BaseCombatCharacter & ); // not defined, not accessible
|
||||
|
||||
|
||||
//-----------------------
|
||||
#ifdef INVASION_CLIENT_DLL
|
||||
public:
|
||||
virtual void Release( void );
|
||||
virtual void SetDormant( bool bDormant );
|
||||
virtual void OnPreDataChanged( DataUpdateType_t updateType );
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual void ClientThink( void );
|
||||
|
||||
// TF2 Powerups
|
||||
virtual bool CanBePoweredUp( void ) { return true; }
|
||||
bool HasPowerup( int iPowerup ) { return ( m_iPowerups & (1 << iPowerup) ) != 0; };
|
||||
virtual void PowerupStart( int iPowerup, bool bInitial );
|
||||
virtual void PowerupEnd( int iPowerup );
|
||||
void RemoveAllPowerups( void );
|
||||
|
||||
// Powerup effects
|
||||
void AddEMPEffect( float flSize );
|
||||
void AddBuffEffect( float flSize );
|
||||
|
||||
C_WeaponCombatShield *GetShield( void );
|
||||
|
||||
public:
|
||||
int m_iPowerups;
|
||||
int m_iPrevPowerups;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
inline C_BaseCombatCharacter *ToBaseCombatCharacter( C_BaseEntity *pEntity )
|
||||
{
|
||||
if ( !pEntity || !pEntity->IsBaseCombatCharacter() )
|
||||
return NULL;
|
||||
|
||||
#if _DEBUG
|
||||
return dynamic_cast<C_BaseCombatCharacter *>( pEntity );
|
||||
#else
|
||||
return static_cast<C_BaseCombatCharacter *>( pEntity );
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
inline int C_BaseCombatCharacter::WeaponCount() const
|
||||
{
|
||||
return MAX_WEAPONS;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Input : i -
|
||||
//-----------------------------------------------------------------------------
|
||||
inline C_BaseCombatWeapon *C_BaseCombatCharacter::GetWeapon( int i ) const
|
||||
{
|
||||
Assert( (i >= 0) && (i < MAX_WEAPONS) );
|
||||
return m_hMyWeapons[i].Get();
|
||||
}
|
||||
|
||||
EXTERN_RECV_TABLE(DT_BaseCombatCharacter);
|
||||
|
||||
#endif // C_BASECOMBATCHARACTER_H
|
||||
26
game/client/c_basecombatweapon.h
Normal file
26
game/client/c_basecombatweapon.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Client's CBaseCombatWeapon entity
|
||||
//
|
||||
// $Workfile: $
|
||||
// $Date: $
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#ifndef C_BASECOMBATWEAPON_H
|
||||
#define C_BASECOMBATWEAPON_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "basecombatweapon_shared.h"
|
||||
#include "weapons_resource.h"
|
||||
|
||||
class CViewSetup;
|
||||
class C_BaseViewModel;
|
||||
|
||||
// Accessors for local weapons
|
||||
C_BaseCombatWeapon *GetActiveWeapon( void );
|
||||
|
||||
|
||||
#endif // C_BASECOMBATWEAPON
|
||||
32
game/client/c_basedoor.h
Normal file
32
game/client/c_basedoor.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#if !defined( C_BASEDOOR_H )
|
||||
#define C_BASEDOOR_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_baseentity.h"
|
||||
|
||||
#if defined( CLIENT_DLL )
|
||||
#define CBaseDoor C_BaseDoor
|
||||
#endif
|
||||
|
||||
class C_BaseDoor : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( C_BaseDoor, C_BaseEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_BaseDoor( void );
|
||||
~C_BaseDoor( void );
|
||||
|
||||
public:
|
||||
float m_flWaveHeight;
|
||||
};
|
||||
|
||||
#endif // C_BASEDOOR_H
|
||||
2265
game/client/c_baseentity.h
Normal file
2265
game/client/c_baseentity.h
Normal file
File diff suppressed because it is too large
Load diff
341
game/client/c_baseflex.h
Normal file
341
game/client/c_baseflex.h
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//===========================================================================//
|
||||
// Client-side CBasePlayer
|
||||
|
||||
#ifndef C_STUDIOFLEX_H
|
||||
#define C_STUDIOFLEX_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "c_baseanimating.h"
|
||||
#include "c_baseanimatingoverlay.h"
|
||||
#include "sceneentity_shared.h"
|
||||
|
||||
#include "utlvector.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Item in list of loaded scene files
|
||||
//-----------------------------------------------------------------------------
|
||||
class CFlexSceneFile
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
MAX_FLEX_FILENAME = 128,
|
||||
};
|
||||
|
||||
char filename[ MAX_FLEX_FILENAME ];
|
||||
void *buffer;
|
||||
};
|
||||
|
||||
// For phoneme emphasis track
|
||||
struct Emphasized_Phoneme;
|
||||
class CSentence;
|
||||
|
||||
enum
|
||||
{
|
||||
PHONEME_CLASS_WEAK = 0,
|
||||
PHONEME_CLASS_NORMAL,
|
||||
PHONEME_CLASS_STRONG,
|
||||
|
||||
NUM_PHONEME_CLASSES
|
||||
};
|
||||
|
||||
// Mapping for each loaded scene file used by this actor
|
||||
struct FS_LocalToGlobal_t
|
||||
{
|
||||
explicit FS_LocalToGlobal_t() :
|
||||
m_Key( 0 ),
|
||||
m_nCount( 0 ),
|
||||
m_Mapping( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
explicit FS_LocalToGlobal_t( const flexsettinghdr_t *key ) :
|
||||
m_Key( key ),
|
||||
m_nCount( 0 ),
|
||||
m_Mapping( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
void SetCount( int count )
|
||||
{
|
||||
Assert( !m_Mapping );
|
||||
Assert( count > 0 );
|
||||
m_nCount = count;
|
||||
m_Mapping = new int[ m_nCount ];
|
||||
Q_memset( m_Mapping, 0, m_nCount * sizeof( int ) );
|
||||
}
|
||||
|
||||
FS_LocalToGlobal_t( const FS_LocalToGlobal_t& src )
|
||||
{
|
||||
m_Key = src.m_Key;
|
||||
delete m_Mapping;
|
||||
m_Mapping = new int[ src.m_nCount ];
|
||||
Q_memcpy( m_Mapping, src.m_Mapping, src.m_nCount * sizeof( int ) );
|
||||
|
||||
m_nCount = src.m_nCount;
|
||||
}
|
||||
|
||||
~FS_LocalToGlobal_t()
|
||||
{
|
||||
delete m_Mapping;
|
||||
m_nCount = 0;
|
||||
m_Mapping = 0;
|
||||
}
|
||||
|
||||
const flexsettinghdr_t *m_Key;
|
||||
int m_nCount;
|
||||
int *m_Mapping;
|
||||
};
|
||||
|
||||
bool FlexSettingLessFunc( const FS_LocalToGlobal_t& lhs, const FS_LocalToGlobal_t& rhs );
|
||||
|
||||
class IHasLocalToGlobalFlexSettings
|
||||
{
|
||||
public:
|
||||
virtual void EnsureTranslations( const flexsettinghdr_t *pSettinghdr ) = 0;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
struct Emphasized_Phoneme
|
||||
{
|
||||
// Global fields, setup at start
|
||||
char classname[ 64 ];
|
||||
bool required;
|
||||
// Global fields setup first time tracks played
|
||||
bool basechecked;
|
||||
const flexsettinghdr_t *base;
|
||||
const flexsetting_t *exp;
|
||||
|
||||
// Local fields, processed for each sentence
|
||||
bool valid;
|
||||
float amount;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_BaseFlex : public C_BaseAnimatingOverlay, public IHasLocalToGlobalFlexSettings
|
||||
{
|
||||
DECLARE_CLASS( C_BaseFlex, C_BaseAnimatingOverlay );
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
DECLARE_INTERPOLATION();
|
||||
|
||||
C_BaseFlex();
|
||||
virtual ~C_BaseFlex();
|
||||
|
||||
virtual void Spawn();
|
||||
|
||||
virtual void InitPhonemeMappings();
|
||||
|
||||
void SetupMappings( char const *pchFileRoot );
|
||||
|
||||
virtual CStudioHdr *OnNewModel( void );
|
||||
|
||||
virtual void StandardBlendingRules( CStudioHdr *hdr, Vector pos[], Quaternion q[], float currentTime, int boneMask );
|
||||
|
||||
virtual void OnThreadedDrawSetup();
|
||||
|
||||
// model specific
|
||||
virtual void BuildTransformations( CStudioHdr *pStudioHdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed );
|
||||
static void LinkToGlobalFlexControllers( CStudioHdr *hdr );
|
||||
virtual void SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights );
|
||||
virtual bool SetupGlobalWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights );
|
||||
static void RunFlexDelay( int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights, float &flFlexDelayTime );
|
||||
virtual void SetupLocalWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights );
|
||||
virtual bool UsesFlexDelayedWeights();
|
||||
|
||||
static void RunFlexRules( CStudioHdr *pStudioHdr, float *dest );
|
||||
|
||||
virtual Vector SetViewTarget( CStudioHdr *pStudioHdr );
|
||||
|
||||
virtual bool GetSoundSpatialization( SpatializationInfo_t& info );
|
||||
|
||||
virtual void GetToolRecordingState( KeyValues *msg );
|
||||
|
||||
// Called at the lowest level to actually apply a flex animation
|
||||
void AddFlexAnimation( CSceneEventInfo *info );
|
||||
|
||||
void SetFlexWeight( LocalFlexController_t index, float value );
|
||||
float GetFlexWeight( LocalFlexController_t index );
|
||||
|
||||
// Look up flex controller index by global name
|
||||
LocalFlexController_t FindFlexController( const char *szName );
|
||||
|
||||
public:
|
||||
Vector m_viewtarget;
|
||||
CInterpolatedVar< Vector > m_iv_viewtarget;
|
||||
// indexed by model local flexcontroller
|
||||
float m_flexWeight[MAXSTUDIOFLEXCTRL];
|
||||
CInterpolatedVarArray< float, MAXSTUDIOFLEXCTRL > m_iv_flexWeight;
|
||||
|
||||
int m_blinktoggle;
|
||||
|
||||
static int AddGlobalFlexController( const char *szName );
|
||||
static char const *GetGlobalFlexControllerName( int idx );
|
||||
|
||||
// bah, this should be unified with all prev/current stuff.
|
||||
|
||||
public:
|
||||
|
||||
// Keep track of what scenes are being played
|
||||
void StartChoreoScene( CChoreoScene *scene );
|
||||
void RemoveChoreoScene( CChoreoScene *scene );
|
||||
|
||||
// Start the specifics of an scene event
|
||||
virtual bool StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, C_BaseEntity *pTarget );
|
||||
|
||||
// Manipulation of events for the object
|
||||
// Should be called by think function to process all scene events
|
||||
// The default implementation resets m_flexWeight array and calls
|
||||
// AddSceneEvents
|
||||
virtual void ProcessSceneEvents( bool bFlexEvents );
|
||||
|
||||
// Assumes m_flexWeight array has been set up, this adds the actual currently playing
|
||||
// expressions to the flex weights and adds other scene events as needed
|
||||
virtual bool ProcessSceneEvent( bool bFlexEvents, CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event );
|
||||
|
||||
virtual bool ProcessSequenceSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event );
|
||||
|
||||
// Remove all playing events
|
||||
void ClearSceneEvents( CChoreoScene *scene, bool canceled );
|
||||
|
||||
// Stop specifics of event
|
||||
virtual bool ClearSceneEvent( CSceneEventInfo *info, bool fastKill, bool canceled );
|
||||
|
||||
// Add the event to the queue for this actor
|
||||
void AddSceneEvent( CChoreoScene *scene, CChoreoEvent *event, C_BaseEntity *pTarget = NULL, bool bClientSide = false );
|
||||
|
||||
// Remove the event from the queue for this actor
|
||||
void RemoveSceneEvent( CChoreoScene *scene, CChoreoEvent *event, bool fastKill );
|
||||
|
||||
// Checks to see if the event should be considered "completed"
|
||||
bool CheckSceneEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event );
|
||||
|
||||
// Checks to see if a event should be considered "completed"
|
||||
virtual bool CheckSceneEventCompletion( CSceneEventInfo *info, float currenttime, CChoreoScene *scene, CChoreoEvent *event );
|
||||
|
||||
int FlexControllerLocalToGlobal( const flexsettinghdr_t *pSettinghdr, int key );
|
||||
|
||||
// IHasLocalToGlobalFlexSettings
|
||||
virtual void EnsureTranslations( const flexsettinghdr_t *pSettinghdr );
|
||||
|
||||
// For handling scene files
|
||||
void *FindSceneFile( const char *filename );
|
||||
|
||||
private:
|
||||
|
||||
bool RequestStartSequenceSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, CBaseEntity *pTarget );
|
||||
|
||||
bool ProcessFlexAnimationSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event );
|
||||
bool ProcessFlexSettingSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event );
|
||||
void AddFlexSetting( const char *expr, float scale,
|
||||
const flexsettinghdr_t *pSettinghdr, bool newexpression );
|
||||
|
||||
// Array of active SceneEvents, in order oldest to newest
|
||||
CUtlVector < CSceneEventInfo > m_SceneEvents;
|
||||
CUtlVector < CChoreoScene * > m_ActiveChoreoScenes;
|
||||
|
||||
bool HasSceneEvents() const;
|
||||
|
||||
private:
|
||||
CUtlRBTree< FS_LocalToGlobal_t, unsigned short > m_LocalToGlobal;
|
||||
|
||||
float m_blinktime;
|
||||
int m_prevblinktoggle;
|
||||
|
||||
int m_iBlink;
|
||||
LocalFlexController_t m_iEyeUpdown;
|
||||
LocalFlexController_t m_iEyeRightleft;
|
||||
bool m_bSearchedForEyeFlexes;
|
||||
int m_iMouthAttachment;
|
||||
|
||||
float m_flFlexDelayTime;
|
||||
float *m_flFlexDelayedWeight;
|
||||
int m_cFlexDelayedWeight;
|
||||
|
||||
// shared flex controllers
|
||||
static int g_numflexcontrollers;
|
||||
static char *g_flexcontroller[MAXSTUDIOFLEXCTRL*4]; // room for global set of flexcontrollers
|
||||
static float g_flexweight[MAXSTUDIOFLEXDESC];
|
||||
|
||||
protected:
|
||||
|
||||
Emphasized_Phoneme m_PhonemeClasses[ NUM_PHONEME_CLASSES ];
|
||||
|
||||
private:
|
||||
|
||||
C_BaseFlex( const C_BaseFlex & ); // not defined, not accessible
|
||||
|
||||
const flexsetting_t *FindNamedSetting( const flexsettinghdr_t *pSettinghdr, const char *expr );
|
||||
|
||||
void ProcessVisemes( Emphasized_Phoneme *classes );
|
||||
void AddVisemesForSentence( Emphasized_Phoneme *classes, float emphasis_intensity, CSentence *sentence, float t, float dt, bool juststarted );
|
||||
void AddViseme( Emphasized_Phoneme *classes, float emphasis_intensity, int phoneme, float scale, bool newexpression );
|
||||
bool SetupEmphasisBlend( Emphasized_Phoneme *classes, int phoneme );
|
||||
void ComputeBlendedSetting( Emphasized_Phoneme *classes, float emphasis_intensity );
|
||||
|
||||
#ifdef HL2_CLIENT_DLL
|
||||
public:
|
||||
|
||||
Vector m_vecLean;
|
||||
CInterpolatedVar< Vector > m_iv_vecLean;
|
||||
Vector m_vecShift;
|
||||
CInterpolatedVar< Vector > m_iv_vecShift;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class CFlexSceneFileManager : CAutoGameSystem
|
||||
{
|
||||
public:
|
||||
|
||||
CFlexSceneFileManager() : CAutoGameSystem( "CFlexSceneFileManager" )
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool Init();
|
||||
virtual void Shutdown();
|
||||
|
||||
void EnsureTranslations( IHasLocalToGlobalFlexSettings *instance, const flexsettinghdr_t *pSettinghdr );
|
||||
void *FindSceneFile( IHasLocalToGlobalFlexSettings *instance, const char *filename, bool allowBlockingIO );
|
||||
|
||||
private:
|
||||
void DeleteSceneFiles();
|
||||
|
||||
CUtlVector< CFlexSceneFile * > m_FileList;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Do we have active expressions?
|
||||
//-----------------------------------------------------------------------------
|
||||
inline bool C_BaseFlex::HasSceneEvents() const
|
||||
{
|
||||
return m_SceneEvents.Count() != 0;
|
||||
}
|
||||
|
||||
|
||||
EXTERN_RECV_TABLE(DT_BaseFlex);
|
||||
|
||||
float *GetVisemeWeights( int phoneme );
|
||||
|
||||
|
||||
#endif // C_STUDIOFLEX_H
|
||||
|
||||
|
||||
|
||||
|
||||
699
game/client/c_baseplayer.h
Normal file
699
game/client/c_baseplayer.h
Normal file
|
|
@ -0,0 +1,699 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Client-side CBasePlayer.
|
||||
//
|
||||
// - Manages the player's flashlight effect.
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_BASEPLAYER_H
|
||||
#define C_BASEPLAYER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_playerlocaldata.h"
|
||||
#include "c_basecombatcharacter.h"
|
||||
#include "PlayerState.h"
|
||||
#include "usercmd.h"
|
||||
#include "shareddefs.h"
|
||||
#include "timedevent.h"
|
||||
#include "smartptr.h"
|
||||
#include "fx_water.h"
|
||||
#include "hintsystem.h"
|
||||
#include "SoundEmitterSystem/isoundemittersystembase.h"
|
||||
#include "c_env_fog_controller.h"
|
||||
#include "igameevents.h"
|
||||
#include "GameEventListener.h"
|
||||
|
||||
#if defined USES_ECON_ITEMS
|
||||
#include "econ_item.h"
|
||||
#include "game_item_schema.h"
|
||||
#include "econ_item_view.h"
|
||||
#endif
|
||||
|
||||
class C_BaseCombatWeapon;
|
||||
class C_BaseViewModel;
|
||||
class C_FuncLadder;
|
||||
class CFlashlightEffect;
|
||||
class C_EconWearable;
|
||||
|
||||
extern int g_nKillCamMode;
|
||||
extern int g_nKillCamTarget1;
|
||||
extern int g_nKillCamTarget2;
|
||||
|
||||
class C_CommandContext
|
||||
{
|
||||
public:
|
||||
bool needsprocessing;
|
||||
|
||||
CUserCmd cmd;
|
||||
int command_number;
|
||||
};
|
||||
|
||||
class C_PredictionError
|
||||
{
|
||||
public:
|
||||
float time;
|
||||
Vector error;
|
||||
};
|
||||
|
||||
#define CHASE_CAM_DISTANCE_MIN 16.0f
|
||||
#define CHASE_CAM_DISTANCE_MAX 96.0f
|
||||
#define WALL_OFFSET 6.0f
|
||||
|
||||
|
||||
bool IsInFreezeCam( void );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base Player class
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_BasePlayer : public C_BaseCombatCharacter, public CGameEventListener
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( C_BasePlayer, C_BaseCombatCharacter );
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
DECLARE_INTERPOLATION();
|
||||
|
||||
C_BasePlayer();
|
||||
virtual ~C_BasePlayer();
|
||||
|
||||
virtual void Spawn( void );
|
||||
virtual void SharedSpawn(); // Shared between client and server.
|
||||
virtual bool GetSteamID( CSteamID *pID );
|
||||
|
||||
// IClientEntity overrides.
|
||||
virtual void OnPreDataChanged( DataUpdateType_t updateType );
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
|
||||
virtual void PreDataUpdate( DataUpdateType_t updateType );
|
||||
virtual void PostDataUpdate( DataUpdateType_t updateType );
|
||||
|
||||
virtual void ReceiveMessage( int classID, bf_read &msg );
|
||||
|
||||
virtual void OnRestore();
|
||||
|
||||
virtual void AddEntity( void );
|
||||
|
||||
virtual void MakeTracer( const Vector &vecTracerSrc, const trace_t &tr, int iTracerType );
|
||||
|
||||
virtual void GetToolRecordingState( KeyValues *msg );
|
||||
|
||||
virtual float GetPlayerMaxSpeed();
|
||||
|
||||
void SetAnimationExtension( const char *pExtension );
|
||||
|
||||
C_BaseViewModel *GetViewModel( int viewmodelindex = 0, bool bObserverOK=true );
|
||||
C_BaseCombatWeapon *GetActiveWeapon( void ) const;
|
||||
const char *GetTracerType( void );
|
||||
|
||||
// View model prediction setup
|
||||
virtual void CalcView( Vector &eyeOrigin, QAngle &eyeAngles, float &zNear, float &zFar, float &fov );
|
||||
virtual void CalcViewModelView( const Vector& eyeOrigin, const QAngle& eyeAngles);
|
||||
|
||||
|
||||
// Handle view smoothing when going up stairs
|
||||
void SmoothViewOnStairs( Vector& eyeOrigin );
|
||||
virtual float CalcRoll (const QAngle& angles, const Vector& velocity, float rollangle, float rollspeed);
|
||||
void CalcViewRoll( QAngle& eyeAngles );
|
||||
void CreateWaterEffects( void );
|
||||
|
||||
virtual void SetPlayerUnderwater( bool state );
|
||||
void UpdateUnderwaterState( void );
|
||||
bool IsPlayerUnderwater( void ) { return m_bPlayerUnderwater; }
|
||||
|
||||
virtual Vector Weapon_ShootPosition();
|
||||
virtual void Weapon_DropPrimary( void ) {}
|
||||
|
||||
virtual Vector GetAutoaimVector( float flScale );
|
||||
void SetSuitUpdate(const char *name, int fgroup, int iNoRepeat);
|
||||
|
||||
// Input handling
|
||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *pCmd );
|
||||
virtual void AvoidPhysicsProps( CUserCmd *pCmd );
|
||||
|
||||
virtual void PlayerUse( void );
|
||||
CBaseEntity *FindUseEntity( void );
|
||||
virtual bool IsUseableEntity( CBaseEntity *pEntity, unsigned int requiredCaps );
|
||||
|
||||
// Data handlers
|
||||
virtual bool IsPlayer( void ) const { return true; }
|
||||
virtual int GetHealth() const { return m_iHealth; }
|
||||
|
||||
int GetBonusProgress() const { return m_iBonusProgress; }
|
||||
int GetBonusChallenge() const { return m_iBonusChallenge; }
|
||||
|
||||
// observer mode
|
||||
virtual int GetObserverMode() const;
|
||||
void SetObserverMode ( int iNewMode );
|
||||
virtual CBaseEntity *GetObserverTarget() const;
|
||||
void SetObserverTarget( EHANDLE hObserverTarget );
|
||||
|
||||
bool AudioStateIsUnderwater( Vector vecMainViewOrigin );
|
||||
|
||||
bool IsObserver() const;
|
||||
bool IsHLTV() const;
|
||||
bool IsReplay() const;
|
||||
void ResetObserverMode();
|
||||
bool IsBot( void ) const { return false; }
|
||||
|
||||
// Eye position..
|
||||
virtual Vector EyePosition();
|
||||
virtual const QAngle &EyeAngles(); // Direction of eyes
|
||||
void EyePositionAndVectors( Vector *pPosition, Vector *pForward, Vector *pRight, Vector *pUp );
|
||||
virtual const QAngle &LocalEyeAngles(); // Direction of eyes
|
||||
|
||||
// This can be overridden to return something other than m_pRagdoll if the mod uses separate
|
||||
// entities for ragdolls.
|
||||
virtual IRagdoll* GetRepresentativeRagdoll() const;
|
||||
|
||||
// override the initial bone position for ragdolls
|
||||
virtual bool GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt ) OVERRIDE;
|
||||
|
||||
// Returns eye vectors
|
||||
void EyeVectors( Vector *pForward, Vector *pRight = NULL, Vector *pUp = NULL );
|
||||
void CacheVehicleView( void ); // Calculate and cache the position of the player in the vehicle
|
||||
|
||||
|
||||
bool IsSuitEquipped( void ) { return m_Local.m_bWearingSuit; };
|
||||
|
||||
// Team handlers
|
||||
virtual void TeamChange( int iNewTeam );
|
||||
|
||||
// Flashlight
|
||||
void Flashlight( void );
|
||||
void UpdateFlashlight( void );
|
||||
|
||||
// Weapon selection code
|
||||
virtual bool IsAllowedToSwitchWeapons( void ) { return !IsObserver(); }
|
||||
virtual C_BaseCombatWeapon *GetActiveWeaponForSelection( void );
|
||||
|
||||
// Returns the view model if this is the local player. If you're in third person or
|
||||
// this is a remote player, it returns the active weapon
|
||||
// (and its appropriate left/right weapon if this is TF2).
|
||||
virtual C_BaseAnimating* GetRenderedWeaponModel();
|
||||
|
||||
virtual bool IsOverridingViewmodel( void ) { return false; };
|
||||
virtual int DrawOverriddenViewmodel( C_BaseViewModel *pViewmodel, int flags ) { return 0; };
|
||||
|
||||
virtual float GetDefaultAnimSpeed( void ) { return 1.0; }
|
||||
|
||||
void SetMaxSpeed( float flMaxSpeed ) { m_flMaxspeed = flMaxSpeed; }
|
||||
float MaxSpeed() const { return m_flMaxspeed; }
|
||||
|
||||
// Should this object cast shadows?
|
||||
virtual ShadowType_t ShadowCastType() { return SHADOWS_NONE; }
|
||||
|
||||
virtual bool ShouldReceiveProjectedTextures( int flags )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool IsLocalPlayer( void ) const;
|
||||
|
||||
// Global/static methods
|
||||
virtual void ThirdPersonSwitch( bool bThirdperson );
|
||||
static bool LocalPlayerInFirstPersonView();
|
||||
static bool ShouldDrawLocalPlayer();
|
||||
static C_BasePlayer *GetLocalPlayer( void );
|
||||
int GetUserID( void );
|
||||
virtual bool CanSetSoundMixer( void );
|
||||
virtual int GetVisionFilterFlags( bool bWeaponsCheck = false ) { return 0x00; }
|
||||
bool HasVisionFilterFlags( int nFlags, bool bWeaponsCheck = false ) { return ( GetVisionFilterFlags( bWeaponsCheck ) & nFlags ) == nFlags; }
|
||||
virtual void CalculateVisionUsingCurrentFlags( void ) {}
|
||||
void BuildFirstPersonMeathookTransformations( CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed, const char *pchHeadBoneName );
|
||||
|
||||
// Specific queries about this player.
|
||||
bool InFirstPersonView();
|
||||
bool ShouldDrawThisPlayer();
|
||||
|
||||
// Called by the view model if its rendering is being overridden.
|
||||
virtual bool ViewModel_IsTransparent( void );
|
||||
virtual bool ViewModel_IsUsingFBTexture( void );
|
||||
|
||||
#if !defined( NO_ENTITY_PREDICTION )
|
||||
void AddToPlayerSimulationList( C_BaseEntity *other );
|
||||
void SimulatePlayerSimulatedEntities( void );
|
||||
void RemoveFromPlayerSimulationList( C_BaseEntity *ent );
|
||||
void ClearPlayerSimulationList( void );
|
||||
#endif
|
||||
|
||||
virtual void PhysicsSimulate( void );
|
||||
virtual unsigned int PhysicsSolidMaskForEntity( void ) const { return MASK_PLAYERSOLID; }
|
||||
|
||||
// Prediction stuff
|
||||
virtual bool ShouldPredict( void );
|
||||
|
||||
virtual void PreThink( void );
|
||||
virtual void PostThink( void );
|
||||
|
||||
virtual void ItemPreFrame( void );
|
||||
virtual void ItemPostFrame( void );
|
||||
virtual void AbortReload( void );
|
||||
|
||||
virtual void SelectLastItem(void);
|
||||
virtual void Weapon_SetLast( C_BaseCombatWeapon *pWeapon );
|
||||
virtual bool Weapon_ShouldSetLast( C_BaseCombatWeapon *pOldWeapon, C_BaseCombatWeapon *pNewWeapon ) { return true; }
|
||||
virtual bool Weapon_ShouldSelectItem( C_BaseCombatWeapon *pWeapon );
|
||||
virtual bool Weapon_Switch( C_BaseCombatWeapon *pWeapon, int viewmodelindex = 0 ); // Switch to given weapon if has ammo (false if failed)
|
||||
virtual C_BaseCombatWeapon *GetLastWeapon( void ) { return m_hLastWeapon.Get(); }
|
||||
void ResetAutoaim( void );
|
||||
virtual void SelectItem( const char *pstr, int iSubType = 0 );
|
||||
|
||||
virtual void UpdateClientData( void );
|
||||
|
||||
virtual float GetFOV( void );
|
||||
int GetDefaultFOV( void ) const;
|
||||
virtual bool IsZoomed( void ) { return false; }
|
||||
bool SetFOV( CBaseEntity *pRequester, int FOV, float zoomRate = 0.0f, int iZoomStart = 0 );
|
||||
void ClearZoomOwner( void );
|
||||
|
||||
float GetFOVDistanceAdjustFactor();
|
||||
|
||||
virtual void ViewPunch( const QAngle &angleOffset );
|
||||
void ViewPunchReset( float tolerance = 0 );
|
||||
|
||||
void UpdateButtonState( int nUserCmdButtonMask );
|
||||
int GetImpulse( void ) const;
|
||||
|
||||
virtual void Simulate();
|
||||
|
||||
virtual bool ShouldInterpolate();
|
||||
|
||||
virtual bool ShouldDraw();
|
||||
virtual int DrawModel( int flags );
|
||||
|
||||
// Called when not in tactical mode. Allows view to be overriden for things like driving a tank.
|
||||
virtual void OverrideView( CViewSetup *pSetup );
|
||||
|
||||
// returns the player name
|
||||
const char * GetPlayerName();
|
||||
virtual const Vector GetPlayerMins( void ) const; // uses local player
|
||||
virtual const Vector GetPlayerMaxs( void ) const; // uses local player
|
||||
|
||||
// Is the player dead?
|
||||
bool IsPlayerDead();
|
||||
bool IsPoisoned( void ) { return m_Local.m_bPoisoned; }
|
||||
|
||||
C_BaseEntity *GetUseEntity();
|
||||
|
||||
// Vehicles...
|
||||
IClientVehicle *GetVehicle();
|
||||
|
||||
bool IsInAVehicle() const { return ( NULL != m_hVehicle.Get() ) ? true : false; }
|
||||
virtual void SetVehicleRole( int nRole );
|
||||
void LeaveVehicle( void );
|
||||
|
||||
bool UsingStandardWeaponsInVehicle( void );
|
||||
|
||||
virtual void SetAnimation( PLAYER_ANIM playerAnim );
|
||||
|
||||
float GetTimeBase( void ) const;
|
||||
float GetFinalPredictedTime() const;
|
||||
|
||||
bool IsInVGuiInputMode() const;
|
||||
bool IsInViewModelVGuiInputMode() const;
|
||||
|
||||
C_CommandContext *GetCommandContext();
|
||||
|
||||
// Get the command number associated with the current usercmd we're running (if in predicted code).
|
||||
int CurrentCommandNumber() const;
|
||||
const CUserCmd *GetCurrentUserCommand() const;
|
||||
|
||||
const QAngle& GetPunchAngle();
|
||||
void SetPunchAngle( const QAngle &angle );
|
||||
|
||||
float GetWaterJumpTime() const;
|
||||
void SetWaterJumpTime( float flWaterJumpTime );
|
||||
float GetSwimSoundTime( void ) const;
|
||||
void SetSwimSoundTime( float flSwimSoundTime );
|
||||
|
||||
float GetDeathTime( void ) { return m_flDeathTime; }
|
||||
|
||||
void SetPreviouslyPredictedOrigin( const Vector &vecAbsOrigin );
|
||||
const Vector &GetPreviouslyPredictedOrigin() const;
|
||||
|
||||
// CS wants to allow small FOVs for zoomed-in AWPs.
|
||||
virtual float GetMinFOV() const;
|
||||
|
||||
virtual void DoMuzzleFlash();
|
||||
virtual void PlayPlayerJingle();
|
||||
|
||||
virtual void UpdateStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity );
|
||||
virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
|
||||
virtual surfacedata_t * GetFootstepSurface( const Vector &origin, const char *surfaceName );
|
||||
virtual void GetStepSoundVelocities( float *velwalk, float *velrun );
|
||||
virtual void SetStepSoundTime( stepsoundtimes_t iStepSoundTime, bool bWalking );
|
||||
virtual const char *GetOverrideStepSound( const char *pszBaseStepSoundName ) { return pszBaseStepSoundName; }
|
||||
|
||||
virtual void OnEmitFootstepSound( const CSoundParameters& params, const Vector& vecOrigin, float fVolume ) {}
|
||||
|
||||
// Called by prediction when it detects a prediction correction.
|
||||
// vDelta is the line from where the client had predicted the player to at the usercmd in question,
|
||||
// to where the server says the client should be at said usercmd.
|
||||
void NotePredictionError( const Vector &vDelta );
|
||||
|
||||
// Called by the renderer to apply the prediction error smoothing.
|
||||
void GetPredictionErrorSmoothingVector( Vector &vOffset );
|
||||
|
||||
virtual void ExitLadder() {}
|
||||
surfacedata_t *GetLadderSurface( const Vector &origin );
|
||||
|
||||
surfacedata_t *GetSurfaceData( void ) { return m_pSurfaceData; }
|
||||
|
||||
void SetLadderNormal( Vector vecLadderNormal ) { m_vecLadderNormal = vecLadderNormal; }
|
||||
|
||||
// Hints
|
||||
virtual CHintSystem *Hints( void ) { return NULL; }
|
||||
bool ShouldShowHints( void ) { return Hints() ? Hints()->ShouldShowHints() : false; }
|
||||
bool HintMessage( int hint, bool bForce = false, bool bOnlyIfClear = false ) { return Hints() ? Hints()->HintMessage( hint, bForce, bOnlyIfClear ) : false; }
|
||||
void HintMessage( const char *pMessage ) { if (Hints()) Hints()->HintMessage( pMessage ); }
|
||||
|
||||
virtual IMaterial *GetHeadLabelMaterial( void );
|
||||
|
||||
// Fog
|
||||
fogparams_t *GetFogParams( void ) { return &m_CurrentFog; }
|
||||
void FogControllerChanged( bool bSnap );
|
||||
void UpdateFogController( void );
|
||||
void UpdateFogBlend( void );
|
||||
|
||||
float GetFOVTime( void ){ return m_flFOVTime; }
|
||||
|
||||
virtual void OnAchievementAchieved( int iAchievement ) {}
|
||||
|
||||
bool ShouldAnnounceAchievement( void ){ return m_flNextAchievementAnnounceTime < gpGlobals->curtime; }
|
||||
void SetNextAchievementAnnounceTime( float flTime ){ m_flNextAchievementAnnounceTime = flTime; }
|
||||
|
||||
#if defined USES_ECON_ITEMS
|
||||
// Wearables
|
||||
virtual void UpdateWearables();
|
||||
C_EconWearable *GetWearable( int i ) { return m_hMyWearables[i]; }
|
||||
int GetNumWearables( void ) { return m_hMyWearables.Count(); }
|
||||
#endif
|
||||
|
||||
bool HasFiredWeapon( void ) { return m_bFiredWeapon; }
|
||||
void SetFiredWeapon( bool bFlag ) { m_bFiredWeapon = bFlag; }
|
||||
|
||||
virtual bool CanUseFirstPersonCommand( void ){ return true; }
|
||||
|
||||
protected:
|
||||
fogparams_t m_CurrentFog;
|
||||
EHANDLE m_hOldFogController;
|
||||
|
||||
public:
|
||||
int m_StuckLast;
|
||||
|
||||
// Data for only the local player
|
||||
CNetworkVarEmbedded( CPlayerLocalData, m_Local );
|
||||
|
||||
#if defined USES_ECON_ITEMS
|
||||
CNetworkVarEmbedded( CAttributeList, m_AttributeList );
|
||||
#endif
|
||||
|
||||
// Data common to all other players, too
|
||||
CPlayerState pl;
|
||||
|
||||
// Player FOV values
|
||||
int m_iFOV; // field of view
|
||||
int m_iFOVStart; // starting value of the FOV changing over time (client only)
|
||||
float m_flFOVTime; // starting time of the FOV zoom
|
||||
int m_iDefaultFOV; // default FOV if no other zooms are occurring
|
||||
EHANDLE m_hZoomOwner; // This is a pointer to the entity currently controlling the player's zoom
|
||||
// Only this entity can change the zoom state once it has ownership
|
||||
|
||||
// For weapon prediction
|
||||
bool m_fOnTarget; //Is the crosshair on a target?
|
||||
|
||||
char m_szAnimExtension[32];
|
||||
|
||||
int m_afButtonLast;
|
||||
int m_afButtonPressed;
|
||||
int m_afButtonReleased;
|
||||
|
||||
int m_nButtons;
|
||||
|
||||
CUserCmd *m_pCurrentCommand;
|
||||
|
||||
// Movement constraints
|
||||
EHANDLE m_hConstraintEntity;
|
||||
Vector m_vecConstraintCenter;
|
||||
float m_flConstraintRadius;
|
||||
float m_flConstraintWidth;
|
||||
float m_flConstraintSpeedFactor;
|
||||
|
||||
protected:
|
||||
|
||||
void CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||
void CalcVehicleView(IClientVehicle *pVehicle, Vector& eyeOrigin, QAngle& eyeAngles,
|
||||
float& zNear, float& zFar, float& fov );
|
||||
virtual void CalcObserverView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||
virtual Vector GetChaseCamViewOffset( CBaseEntity *target );
|
||||
void CalcChaseCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||
virtual void CalcInEyeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||
|
||||
virtual float GetDeathCamInterpolationTime();
|
||||
|
||||
virtual void CalcDeathCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||
void CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float& fov);
|
||||
virtual void CalcFreezeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
|
||||
|
||||
// Check to see if we're in vgui input mode...
|
||||
void DetermineVguiInputMode( CUserCmd *pCmd );
|
||||
|
||||
// Used by prediction, sets the view angles for the player
|
||||
virtual void SetLocalViewAngles( const QAngle &viewAngles );
|
||||
virtual void SetViewAngles( const QAngle& ang );
|
||||
|
||||
// used by client side player footsteps
|
||||
surfacedata_t* GetGroundSurface();
|
||||
|
||||
virtual void FireGameEvent( IGameEvent *event );
|
||||
|
||||
protected:
|
||||
// Did we just enter a vehicle this frame?
|
||||
bool JustEnteredVehicle();
|
||||
|
||||
// DATA
|
||||
int m_iObserverMode; // if in spectator mode != 0
|
||||
EHANDLE m_hObserverTarget; // current observer target
|
||||
float m_flObserverChaseDistance; // last distance to observer traget
|
||||
Vector m_vecFreezeFrameStart;
|
||||
float m_flFreezeFrameStartTime; // Time at which we entered freeze frame observer mode
|
||||
float m_flFreezeFrameDistance;
|
||||
bool m_bWasFreezeFraming;
|
||||
float m_flDeathTime; // last time player died
|
||||
|
||||
float m_flStepSoundTime;
|
||||
bool m_IsFootprintOnLeft;
|
||||
|
||||
private:
|
||||
// Make sure no one calls this...
|
||||
C_BasePlayer& operator=( const C_BasePlayer& src );
|
||||
C_BasePlayer( const C_BasePlayer & ); // not defined, not accessible
|
||||
|
||||
// Vehicle stuff.
|
||||
EHANDLE m_hVehicle;
|
||||
EHANDLE m_hOldVehicle;
|
||||
EHANDLE m_hUseEntity;
|
||||
|
||||
float m_flMaxspeed;
|
||||
|
||||
int m_iBonusProgress;
|
||||
int m_iBonusChallenge;
|
||||
|
||||
CInterpolatedVar< Vector > m_iv_vecViewOffset;
|
||||
|
||||
// Not replicated
|
||||
Vector m_vecWaterJumpVel;
|
||||
float m_flWaterJumpTime; // used to be called teleport_time
|
||||
int m_nImpulse;
|
||||
|
||||
float m_flSwimSoundTime;
|
||||
Vector m_vecLadderNormal;
|
||||
|
||||
QAngle m_vecOldViewAngles;
|
||||
|
||||
bool m_bWasFrozen;
|
||||
int m_flPhysics;
|
||||
|
||||
int m_nTickBase;
|
||||
int m_nFinalPredictedTick;
|
||||
|
||||
EHANDLE m_pCurrentVguiScreen;
|
||||
|
||||
bool m_bFiredWeapon;
|
||||
|
||||
|
||||
// Player flashlight dynamic light pointers
|
||||
CFlashlightEffect *m_pFlashlight;
|
||||
|
||||
typedef CHandle<C_BaseCombatWeapon> CBaseCombatWeaponHandle;
|
||||
CNetworkVar( CBaseCombatWeaponHandle, m_hLastWeapon );
|
||||
|
||||
#if !defined( NO_ENTITY_PREDICTION )
|
||||
CUtlVector< CHandle< C_BaseEntity > > m_SimulatedByThisPlayer;
|
||||
#endif
|
||||
|
||||
// players own view models, left & right hand
|
||||
CHandle< C_BaseViewModel > m_hViewModel[ MAX_VIEWMODELS ];
|
||||
|
||||
float m_flOldPlayerZ;
|
||||
float m_flOldPlayerViewOffsetZ;
|
||||
|
||||
Vector m_vecVehicleViewOrigin; // Used to store the calculated view of the player while riding in a vehicle
|
||||
QAngle m_vecVehicleViewAngles; // Vehicle angles
|
||||
float m_flVehicleViewFOV;
|
||||
int m_nVehicleViewSavedFrame; // Used to mark which frame was the last one the view was calculated for
|
||||
|
||||
// For UI purposes...
|
||||
int m_iOldAmmo[ MAX_AMMO_TYPES ];
|
||||
|
||||
C_CommandContext m_CommandContext;
|
||||
|
||||
// For underwater effects
|
||||
float m_flWaterSurfaceZ;
|
||||
bool m_bResampleWaterSurface;
|
||||
TimedEvent m_tWaterParticleTimer;
|
||||
CSmartPtr<WaterDebrisEffect> m_pWaterEmitter;
|
||||
|
||||
bool m_bPlayerUnderwater;
|
||||
|
||||
friend class CPrediction;
|
||||
|
||||
// HACK FOR TF2 Prediction
|
||||
friend class CTFGameMovementRecon;
|
||||
friend class CGameMovement;
|
||||
friend class CTFGameMovement;
|
||||
friend class CHL1GameMovement;
|
||||
friend class CCSGameMovement;
|
||||
friend class CHL2GameMovement;
|
||||
friend class CDODGameMovement;
|
||||
friend class CPortalGameMovement;
|
||||
|
||||
// Accessors for gamemovement
|
||||
float GetStepSize( void ) const { return m_Local.m_flStepSize; }
|
||||
|
||||
float m_flNextAvoidanceTime;
|
||||
float m_flAvoidanceRight;
|
||||
float m_flAvoidanceForward;
|
||||
float m_flAvoidanceDotForward;
|
||||
float m_flAvoidanceDotRight;
|
||||
|
||||
protected:
|
||||
virtual bool IsDucked( void ) const { return m_Local.m_bDucked; }
|
||||
virtual bool IsDucking( void ) const { return m_Local.m_bDucking; }
|
||||
virtual float GetFallVelocity( void ) { return m_Local.m_flFallVelocity; }
|
||||
bool ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOut, float curtimeOffset );
|
||||
|
||||
float m_flLaggedMovementValue;
|
||||
|
||||
// These are used to smooth out prediction corrections. They're most useful when colliding with
|
||||
// vphysics objects. The server will be sending constant prediction corrections, and these can help
|
||||
// the errors not be so jerky.
|
||||
Vector m_vecPredictionError;
|
||||
float m_flPredictionErrorTime;
|
||||
|
||||
Vector m_vecPreviouslyPredictedOrigin; // Used to determine if non-gamemovement game code has teleported, or tweaked the player's origin
|
||||
|
||||
char m_szLastPlaceName[MAX_PLACE_NAME_LENGTH]; // received from the server
|
||||
|
||||
// Texture names and surface data, used by CGameMovement
|
||||
int m_surfaceProps;
|
||||
surfacedata_t* m_pSurfaceData;
|
||||
float m_surfaceFriction;
|
||||
char m_chTextureType;
|
||||
|
||||
bool m_bSentFreezeFrame;
|
||||
float m_flFreezeZOffset;
|
||||
|
||||
float m_flNextAchievementAnnounceTime;
|
||||
|
||||
int m_nForceVisionFilterFlags; // Force our vision filter to a specific setting
|
||||
int m_nLocalPlayerVisionFlags;
|
||||
|
||||
#if defined USES_ECON_ITEMS
|
||||
// Wearables
|
||||
CUtlVector<CHandle<C_EconWearable > > m_hMyWearables;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
struct StepSoundCache_t
|
||||
{
|
||||
StepSoundCache_t() : m_usSoundNameIndex( 0 ) {}
|
||||
CSoundParameters m_SoundParameters;
|
||||
unsigned short m_usSoundNameIndex;
|
||||
};
|
||||
// One for left and one for right side of step
|
||||
StepSoundCache_t m_StepSoundCache[ 2 ];
|
||||
|
||||
public:
|
||||
|
||||
const char *GetLastKnownPlaceName( void ) const { return m_szLastPlaceName; } // return the last nav place name the player occupied
|
||||
|
||||
float GetLaggedMovementValue( void ){ return m_flLaggedMovementValue; }
|
||||
bool ShouldGoSouth( Vector vNPCForward, Vector vNPCRight ); //Such a bad name.
|
||||
|
||||
void SetOldPlayerZ( float flOld ) { m_flOldPlayerZ = flOld; }
|
||||
};
|
||||
|
||||
EXTERN_RECV_TABLE(DT_BasePlayer);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Inline methods
|
||||
//-----------------------------------------------------------------------------
|
||||
inline C_BasePlayer *ToBasePlayer( C_BaseEntity *pEntity )
|
||||
{
|
||||
if ( !pEntity || !pEntity->IsPlayer() )
|
||||
return NULL;
|
||||
|
||||
#if _DEBUG
|
||||
Assert( dynamic_cast<C_BasePlayer *>( pEntity ) != NULL );
|
||||
#endif
|
||||
|
||||
return static_cast<C_BasePlayer *>( pEntity );
|
||||
}
|
||||
|
||||
inline C_BaseEntity *C_BasePlayer::GetUseEntity()
|
||||
{
|
||||
return m_hUseEntity;
|
||||
}
|
||||
|
||||
|
||||
inline IClientVehicle *C_BasePlayer::GetVehicle()
|
||||
{
|
||||
C_BaseEntity *pVehicleEnt = m_hVehicle.Get();
|
||||
return pVehicleEnt ? pVehicleEnt->GetClientVehicle() : NULL;
|
||||
}
|
||||
|
||||
inline bool C_BasePlayer::IsObserver() const
|
||||
{
|
||||
return (GetObserverMode() != OBS_MODE_NONE);
|
||||
}
|
||||
|
||||
inline int C_BasePlayer::GetImpulse( void ) const
|
||||
{
|
||||
return m_nImpulse;
|
||||
}
|
||||
|
||||
|
||||
inline C_CommandContext* C_BasePlayer::GetCommandContext()
|
||||
{
|
||||
return &m_CommandContext;
|
||||
}
|
||||
|
||||
inline int CBasePlayer::CurrentCommandNumber() const
|
||||
{
|
||||
Assert( m_pCurrentCommand );
|
||||
return m_pCurrentCommand->command_number;
|
||||
}
|
||||
|
||||
inline const CUserCmd *CBasePlayer::GetCurrentUserCommand() const
|
||||
{
|
||||
Assert( m_pCurrentCommand );
|
||||
return m_pCurrentCommand;
|
||||
}
|
||||
|
||||
#endif // C_BASEPLAYER_H
|
||||
122
game/client/c_basetempentity.h
Normal file
122
game/client/c_basetempentity.h
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_BASETEMPENTITY_H
|
||||
#define C_BASETEMPENTITY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
#include "client_class.h"
|
||||
#include "iclientnetworkable.h"
|
||||
#include "c_recipientfilter.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base class for TEs. All TEs should derive from this and at
|
||||
// least implement OnDataChanged to be notified when the TE has been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_BaseTempEntity : public IClientUnknown, public IClientNetworkable
|
||||
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_NOBASE( C_BaseTempEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_BaseTempEntity( void );
|
||||
virtual ~C_BaseTempEntity( void );
|
||||
|
||||
|
||||
// IClientUnknown implementation.
|
||||
public:
|
||||
|
||||
virtual void SetRefEHandle( const CBaseHandle &handle ) { Assert( false ); }
|
||||
virtual const CBaseHandle& GetRefEHandle() const { return *((CBaseHandle*)0); }
|
||||
|
||||
virtual IClientUnknown* GetIClientUnknown() { return this; }
|
||||
virtual ICollideable* GetCollideable() { return 0; }
|
||||
virtual IClientNetworkable* GetClientNetworkable() { return this; }
|
||||
virtual IClientRenderable* GetClientRenderable() { return 0; }
|
||||
virtual IClientEntity* GetIClientEntity() { return 0; }
|
||||
virtual C_BaseEntity* GetBaseEntity() { return 0; }
|
||||
virtual IClientThinkable* GetClientThinkable() { return 0; }
|
||||
|
||||
|
||||
// IClientNetworkable overrides.
|
||||
public:
|
||||
|
||||
virtual void Release();
|
||||
virtual void NotifyShouldTransmit( ShouldTransmitState_t state );
|
||||
virtual void PreDataUpdate( DataUpdateType_t updateType );
|
||||
virtual void PostDataUpdate( DataUpdateType_t updateType );
|
||||
virtual void OnDataUnchangedInPVS( void ) { }
|
||||
virtual void OnPreDataChanged( DataUpdateType_t updateType );
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual void SetDormant( bool bDormant );
|
||||
virtual bool IsDormant( void );
|
||||
virtual int entindex( void ) const;
|
||||
virtual void ReceiveMessage( int classID, bf_read &msg );
|
||||
virtual void* GetDataTableBasePtr();
|
||||
virtual void SetDestroyedOnRecreateEntities( void );
|
||||
|
||||
public:
|
||||
|
||||
// Dummy for CNetworkVars.
|
||||
void NetworkStateChanged() {}
|
||||
void NetworkStateChanged( void *pVar ) {}
|
||||
|
||||
virtual bool Init(int entnum, int iSerialNum);
|
||||
|
||||
virtual void Precache( void );
|
||||
|
||||
// For dynamic entities, return true to allow destruction
|
||||
virtual bool ShouldDestroy( void ) { return false; };
|
||||
|
||||
C_BaseTempEntity *GetNext( void );
|
||||
|
||||
// Get list of tempentities
|
||||
static C_BaseTempEntity *GetList( void );
|
||||
|
||||
C_BaseTempEntity *GetNextDynamic( void );
|
||||
|
||||
// Determine the color modulation amount
|
||||
void GetColorModulation( float* color )
|
||||
{
|
||||
assert(color);
|
||||
color[0] = color[1] = color[2] = 1.0f;
|
||||
}
|
||||
|
||||
// Should this object be able to have shadows cast onto it?
|
||||
virtual bool ShouldReceiveProjectedTextures( int flags ) { return false; }
|
||||
|
||||
// Static members
|
||||
public:
|
||||
// List of dynamically allocated temp entis
|
||||
static C_BaseTempEntity *GetDynamicList();
|
||||
|
||||
// Called at startup to allow temp entities to precache any models/sounds that they need
|
||||
static void PrecacheTempEnts( void );
|
||||
|
||||
static void ClearDynamicTempEnts( void );
|
||||
|
||||
static void CheckDynamicTempEnts( void );
|
||||
|
||||
private:
|
||||
|
||||
// Next in chain
|
||||
C_BaseTempEntity *m_pNext;
|
||||
C_BaseTempEntity *m_pNextDynamic;
|
||||
|
||||
// TEs add themselves to this list for the executable.
|
||||
static C_BaseTempEntity *s_pTempEntities;
|
||||
static C_BaseTempEntity *s_pDynamicEntities;
|
||||
};
|
||||
|
||||
|
||||
#endif // C_BASETEMPENTITY_H
|
||||
19
game/client/c_baseviewmodel.h
Normal file
19
game/client/c_baseviewmodel.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Client side view model implementation. Responsible for drawing
|
||||
// the view model.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_BASEVIEWMODEL_H
|
||||
#define C_BASEVIEWMODEL_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_baseanimating.h"
|
||||
#include "utlvector.h"
|
||||
#include "baseviewmodel_shared.h"
|
||||
|
||||
#endif // C_BASEVIEWMODEL_H
|
||||
30
game/client/c_breakableprop.h
Normal file
30
game/client/c_breakableprop.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_BREAKABLEPROP_H
|
||||
#define C_BREAKABLEPROP_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_BreakableProp : public C_BaseAnimating
|
||||
{
|
||||
typedef C_BaseAnimating BaseClass;
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_BreakableProp();
|
||||
|
||||
virtual void SetFadeMinMax( float fademin, float fademax );
|
||||
|
||||
// Copy fade from another breakable prop
|
||||
void CopyFadeFrom( C_BreakableProp *pSource );
|
||||
};
|
||||
|
||||
#endif // C_BREAKABLEPROP_H
|
||||
18
game/client/c_effects.h
Normal file
18
game/client/c_effects.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_EFFECTS_H
|
||||
#define C_EFFECTS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
// Draw rain effects.
|
||||
void DrawPrecipitation();
|
||||
|
||||
|
||||
#endif // C_EFFECTS_H
|
||||
82
game/client/c_entitydissolve.h
Normal file
82
game/client/c_entitydissolve.h
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_ENTITY_DISSOLVE_H
|
||||
#define C_ENTITY_DISSOLVE_H
|
||||
|
||||
#include "cbase.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Entity Dissolve, client-side implementation
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_EntityDissolve : public C_BaseEntity, public IMotionEvent
|
||||
{
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_CLASS( C_EntityDissolve, C_BaseEntity );
|
||||
|
||||
C_EntityDissolve( void );
|
||||
|
||||
// Inherited from C_BaseEntity
|
||||
virtual void GetRenderBounds( Vector& theMins, Vector& theMaxs );
|
||||
virtual int DrawModel( int flags );
|
||||
virtual bool ShouldDraw() { return true; }
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual void UpdateOnRemove( void );
|
||||
|
||||
virtual Vector GetEffectColor( void ) { return m_vEffectColor; }
|
||||
virtual void SetEffectColor( Vector v ) { m_vEffectColor = v; }
|
||||
|
||||
// Inherited from IMotionEvent
|
||||
virtual simresult_e Simulate( IPhysicsMotionController *pController, IPhysicsObject *pObject, float deltaTime, Vector &linear, AngularImpulse &angular );
|
||||
|
||||
void SetupEmitter( void );
|
||||
|
||||
void ClientThink( void );
|
||||
|
||||
void SetServerLinkState( bool state ) { m_bLinkedToServerEnt = state; }
|
||||
|
||||
float m_flStartTime;
|
||||
float m_flFadeOutStart;
|
||||
float m_flFadeOutLength;
|
||||
float m_flFadeOutModelStart;
|
||||
float m_flFadeOutModelLength;
|
||||
float m_flFadeInStart;
|
||||
float m_flFadeInLength;
|
||||
int m_nDissolveType;
|
||||
float m_flNextSparkTime;
|
||||
|
||||
Vector m_vEffectColor;
|
||||
|
||||
Vector m_vDissolverOrigin;
|
||||
int m_nMagnitude;
|
||||
|
||||
bool m_bCoreExplode;
|
||||
|
||||
protected:
|
||||
|
||||
float GetFadeInPercentage( void ); // Fade in amount (entity fading to black)
|
||||
float GetFadeOutPercentage( void ); // Fade out amount (particles fading away)
|
||||
float GetModelFadeOutPercentage( void );// Mode fade out amount
|
||||
|
||||
// Compute the bounding box's center, size, and basis
|
||||
void ComputeRenderInfo( mstudiobbox_t *pHitBox, const matrix3x4_t &hitboxToWorld,
|
||||
Vector *pVecAbsOrigin, Vector *pXVec, Vector *pYVec );
|
||||
void BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4_t &hitboxToWorld, bool bRandom, float flYawOffset );
|
||||
|
||||
void DoSparks( mstudiohitboxset_t *set, matrix3x4_t *hitboxbones[MAXSTUDIOBONES] );
|
||||
|
||||
private:
|
||||
|
||||
CSmartPtr<CSimpleEmitter> m_pEmitter;
|
||||
|
||||
bool m_bLinkedToServerEnt;
|
||||
IPhysicsMotionController *m_pController;
|
||||
};
|
||||
|
||||
#endif // C_ENTITY_DISSOLVE_H
|
||||
|
||||
33
game/client/c_env_fog_controller.h
Normal file
33
game/client/c_env_fog_controller.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_ENV_FOG_CONTROLLER_H
|
||||
#define C_ENV_FOG_CONTROLLER_H
|
||||
|
||||
#define CFogController C_FogController
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Class Fog Controller:
|
||||
// Compares a set of integer inputs to the one main input
|
||||
// Outputs true if they are all equivalant, false otherwise
|
||||
//
|
||||
class C_FogController : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_NETWORKCLASS();
|
||||
DECLARE_CLASS( C_FogController, C_BaseEntity );
|
||||
|
||||
C_FogController();
|
||||
|
||||
public:
|
||||
|
||||
fogparams_t m_fog;
|
||||
};
|
||||
|
||||
|
||||
#endif // C_ENV_FOG_CONTROLLER_H
|
||||
302
game/client/c_fire_smoke.h
Normal file
302
game/client/c_fire_smoke.h
Normal file
|
|
@ -0,0 +1,302 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
#ifndef C_FIRE_SMOKE_H
|
||||
#define C_FIRE_SMOKE_H
|
||||
|
||||
#include "particles_simple.h"
|
||||
#include "tempent.h"
|
||||
#include "glow_overlay.h"
|
||||
#include "view.h"
|
||||
#include "particle_litsmokeemitter.h"
|
||||
|
||||
class CFireOverlay;
|
||||
|
||||
class C_FireSprite : public C_Sprite
|
||||
{
|
||||
DECLARE_CLASS( C_FireSprite, C_Sprite );
|
||||
|
||||
private:
|
||||
virtual int DrawModel( int flags )
|
||||
{
|
||||
if ( m_bFadeFromAbove )
|
||||
{
|
||||
// The sprites become less visible the more you look down or up at them
|
||||
Vector vToPos = GetLocalOrigin() - CurrentViewOrigin();
|
||||
VectorNormalize( vToPos );
|
||||
|
||||
float fUpAmount = vToPos.z;
|
||||
|
||||
int iAlpha = 255;
|
||||
|
||||
if ( fUpAmount < -0.75f )
|
||||
iAlpha = 0;
|
||||
else if ( fUpAmount < -0.65f )
|
||||
iAlpha = 255 - (int)( ( fUpAmount + 0.65f ) * 10.0f * -255.0f );
|
||||
else if ( fUpAmount > 0.85f )
|
||||
iAlpha = 0;
|
||||
else if ( fUpAmount > 0.75f )
|
||||
iAlpha = 255 - (int)( ( fUpAmount - 0.75f ) * 10.0f * 255.0f );
|
||||
|
||||
SetColor( iAlpha, iAlpha, iAlpha );
|
||||
}
|
||||
|
||||
return BaseClass::DrawModel( flags );
|
||||
}
|
||||
|
||||
public:
|
||||
Vector m_vecMoveDir;
|
||||
bool m_bFadeFromAbove;
|
||||
};
|
||||
|
||||
class C_FireFromAboveSprite : public C_Sprite
|
||||
{
|
||||
DECLARE_CLASS( C_FireFromAboveSprite, C_Sprite );
|
||||
|
||||
virtual int DrawModel( int flags )
|
||||
{
|
||||
// The sprites become more visible the more you look down or up at them
|
||||
Vector vToPos = GetLocalOrigin() - CurrentViewOrigin();
|
||||
VectorNormalize( vToPos );
|
||||
|
||||
float fUpAmount = vToPos.z;
|
||||
|
||||
int iAlpha = 0;
|
||||
|
||||
if ( fUpAmount < -0.85f )
|
||||
iAlpha = 255;
|
||||
else if ( fUpAmount < -0.65f )
|
||||
iAlpha = (int)( ( fUpAmount + 0.65f ) * 5.0f * -255.0f );
|
||||
else if ( fUpAmount > 0.75f )
|
||||
iAlpha = 255;
|
||||
else if ( fUpAmount > 0.55f )
|
||||
iAlpha = (int)( ( fUpAmount - 0.55f ) * 5.0f * 255.0f );
|
||||
|
||||
SetColor( iAlpha, iAlpha, iAlpha );
|
||||
|
||||
return BaseClass::DrawModel( flags );
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef _XBOX
|
||||
// XBox reduces the flame count
|
||||
#define NUM_CHILD_FLAMES 1
|
||||
#else
|
||||
#define NUM_CHILD_FLAMES 4
|
||||
#endif
|
||||
|
||||
#define SMOKE_RISE_RATE 92.0f
|
||||
#define SMOKE_LIFETIME 2.0f
|
||||
#define EMBER_LIFETIME 2.0f
|
||||
|
||||
#define FLAME_CHILD_SPREAD 64.0f
|
||||
#define FLAME_SOURCE_HEIGHT 128.0f
|
||||
#define FLAME_FROM_ABOVE_SOURCE_HEIGHT 32.0f
|
||||
|
||||
//==================================================
|
||||
// C_FireSmoke
|
||||
//==================================================
|
||||
|
||||
//NOTENOTE: Mirrored in dlls/fire_smoke.h
|
||||
#define bitsFIRESMOKE_NONE 0x00000000
|
||||
#define bitsFIRESMOKE_ACTIVE 0x00000001
|
||||
#define bitsFIRESMOKE_SMOKE 0x00000002
|
||||
#define bitsFIRESMOKE_SMOKE_COLLISION 0x00000004
|
||||
#define bitsFIRESMOKE_GLOW 0x00000008
|
||||
#define bitsFIRESMOKE_VISIBLE_FROM_ABOVE 0x00000010
|
||||
|
||||
#define OVERLAY_MAX_VISIBLE_RANGE 512.0f
|
||||
|
||||
|
||||
class C_FireSmoke : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_CLASS( C_FireSmoke, C_BaseEntity );
|
||||
|
||||
C_FireSmoke();
|
||||
~C_FireSmoke();
|
||||
|
||||
void Start( void );
|
||||
void Simulate( void );
|
||||
|
||||
void StartClientOnly( void );
|
||||
void RemoveClientOnly( void );
|
||||
|
||||
protected:
|
||||
void Update( void );
|
||||
void UpdateAnimation( void );
|
||||
void UpdateScale( void );
|
||||
void UpdateFlames( void );
|
||||
void AddFlames( void );
|
||||
void SpawnSmoke( void );
|
||||
void FindClipPlane( void );
|
||||
|
||||
//C_BaseEntity
|
||||
public:
|
||||
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual bool ShouldDraw();
|
||||
|
||||
float GetScale( void ) const { return m_flScaleRegister; }
|
||||
|
||||
//From the server
|
||||
public:
|
||||
float m_flStartScale;
|
||||
float m_flScale;
|
||||
float m_flScaleTime;
|
||||
int m_nFlags;
|
||||
int m_nFlameModelIndex;
|
||||
int m_nFlameFromAboveModelIndex;
|
||||
|
||||
//Client-side only
|
||||
public:
|
||||
float m_flScaleRegister;
|
||||
float m_flScaleStart;
|
||||
float m_flScaleEnd;
|
||||
float m_flScaleTimeStart;
|
||||
float m_flScaleTimeEnd;
|
||||
float m_flChildFlameSpread;
|
||||
|
||||
VPlane m_planeClip;
|
||||
float m_flClipPerc;
|
||||
bool m_bClipTested;
|
||||
|
||||
bool m_bFadingOut;
|
||||
|
||||
protected:
|
||||
|
||||
void UpdateEffects( void );
|
||||
|
||||
//CSmartPtr<CEmberEffect> m_pEmberEmitter;
|
||||
CSmartPtr<CLitSmokeEmitter> m_pSmokeEmitter;
|
||||
|
||||
C_FireSprite m_entFlames[NUM_CHILD_FLAMES];
|
||||
C_FireFromAboveSprite m_entFlamesFromAbove[NUM_CHILD_FLAMES];
|
||||
float m_entFlameScales[NUM_CHILD_FLAMES];
|
||||
|
||||
TimedEvent m_tParticleSpawn;
|
||||
|
||||
CFireOverlay *m_pFireOverlay;
|
||||
|
||||
// New Particle Fire Effect
|
||||
CNewParticleEffect *m_hEffect;
|
||||
private:
|
||||
C_FireSmoke( const C_FireSmoke & );
|
||||
};
|
||||
|
||||
//Fire overlay
|
||||
class CFireOverlay : public CGlowOverlay
|
||||
{
|
||||
public:
|
||||
|
||||
//Constructor
|
||||
CFireOverlay( C_FireSmoke *owner )
|
||||
{
|
||||
m_pOwner = owner;
|
||||
m_flScale = 0.0f;
|
||||
m_nGUID = random->RandomInt( -999999, 999999 );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Generate a flicker value
|
||||
// Output : scalar value
|
||||
//-----------------------------------------------------------------------------
|
||||
float GetFlickerScale( void )
|
||||
{
|
||||
float result = 0.0f;
|
||||
|
||||
float time = Helper_GetTime() + m_nGUID;
|
||||
|
||||
result = sin( time * 1000.0f );
|
||||
result += 0.5f * sin( time * 2000.0f );
|
||||
result -= 0.5f * cos( time * 8000.0f );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Update the overlay
|
||||
//-----------------------------------------------------------------------------
|
||||
virtual bool Update( void )
|
||||
{
|
||||
if ( m_pOwner == NULL )
|
||||
return false;
|
||||
|
||||
float scale = m_pOwner->GetScale();
|
||||
float dscale = scale - m_flScale;
|
||||
|
||||
m_vPos[2] += dscale * FLAME_SOURCE_HEIGHT;
|
||||
m_flScale = scale;
|
||||
|
||||
scale *= 0.75f;
|
||||
|
||||
float flickerScale = GetFlickerScale();
|
||||
|
||||
float newScale = scale + ( scale * flickerScale * 0.1f );
|
||||
|
||||
m_Sprites[0].m_flHorzSize = ( newScale * 0.2f ) + ( m_Sprites[0].m_flHorzSize * 0.8f );
|
||||
m_Sprites[0].m_flVertSize = m_Sprites[0].m_flHorzSize * 1.5f;
|
||||
|
||||
float cameraDistance = ( CurrentViewOrigin() - (m_pOwner->GetAbsOrigin())).Length();
|
||||
|
||||
C_BasePlayer *local = C_BasePlayer::GetLocalPlayer();
|
||||
if ( local )
|
||||
{
|
||||
cameraDistance *= local->GetFOVDistanceAdjustFactor();
|
||||
}
|
||||
|
||||
if ( cameraDistance > OVERLAY_MAX_VISIBLE_RANGE )
|
||||
cameraDistance = OVERLAY_MAX_VISIBLE_RANGE;
|
||||
|
||||
float alpha = 1.0f - ( cameraDistance / OVERLAY_MAX_VISIBLE_RANGE );
|
||||
|
||||
Vector newColor = m_vBaseColors[0] + ( m_vBaseColors[0] * flickerScale * 0.5f );
|
||||
m_Sprites[0].m_vColor = ( newColor * 0.1f ) + ( m_Sprites[0].m_vColor * 0.9f ) * alpha;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
C_FireSmoke *m_pOwner;
|
||||
Vector m_vBaseColors[MAX_SUN_LAYERS];
|
||||
float m_flScale;
|
||||
int m_nGUID;
|
||||
};
|
||||
|
||||
//
|
||||
// Entity flame, client-side implementation
|
||||
//
|
||||
|
||||
#define NUM_FLAMELETS 5
|
||||
|
||||
class C_EntityFlame : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_CLASS( C_EntityFlame, C_BaseEntity );
|
||||
|
||||
C_EntityFlame( void );
|
||||
~C_EntityFlame( void );
|
||||
|
||||
virtual void Simulate( void );
|
||||
virtual void UpdateOnRemove( void );
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual void ClientThink( void );
|
||||
|
||||
CNewParticleEffect *m_hEffect;
|
||||
EHANDLE m_hEntAttached; // The entity that we are burning (attached to).
|
||||
EHANDLE m_hOldAttached;
|
||||
|
||||
protected:
|
||||
|
||||
void CreateEffect( void );
|
||||
void StopEffect( void );
|
||||
};
|
||||
|
||||
#endif //C_FIRE_SMOKE_H
|
||||
112
game/client/c_func_dust.h
Normal file
112
game/client/c_func_dust.h
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_FUNC_DUST_H
|
||||
#define C_FUNC_DUST_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
#include "c_baseentity.h"
|
||||
#include "particles_simple.h"
|
||||
#include "particle_util.h"
|
||||
#include "bspflags.h"
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------ //
|
||||
// CDustEffect particle renderer.
|
||||
// ------------------------------------------------------------------------------------ //
|
||||
|
||||
class C_Func_Dust;
|
||||
|
||||
class CFuncDustParticle : public Particle
|
||||
{
|
||||
public:
|
||||
Vector m_vVelocity;
|
||||
float m_flLifetime;
|
||||
float m_flDieTime;
|
||||
float m_flSize;
|
||||
color32 m_Color;
|
||||
};
|
||||
|
||||
class CDustEffect : public CParticleEffect
|
||||
{
|
||||
public:
|
||||
CDustEffect( const char *pDebugName ) : CParticleEffect( pDebugName ) {}
|
||||
|
||||
virtual void RenderParticles( CParticleRenderIterator *pIterator );
|
||||
virtual void SimulateParticles( CParticleSimulateIterator *pIterator );
|
||||
|
||||
C_Func_Dust *m_pDust;
|
||||
|
||||
private:
|
||||
CDustEffect( const CDustEffect & ); // not defined, not accessible
|
||||
};
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------ //
|
||||
// C_Func_Dust class.
|
||||
// ------------------------------------------------------------------------------------ //
|
||||
|
||||
class C_Func_Dust : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( C_Func_Dust, C_BaseEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_Func_Dust();
|
||||
virtual ~C_Func_Dust();
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual void ClientThink();
|
||||
virtual bool ShouldDraw();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void AttemptSpawnNewParticle();
|
||||
|
||||
|
||||
|
||||
// Vars from server.
|
||||
public:
|
||||
|
||||
color32 m_Color;
|
||||
int m_SpawnRate;
|
||||
|
||||
float m_flSizeMin;
|
||||
float m_flSizeMax;
|
||||
|
||||
int m_SpeedMax;
|
||||
|
||||
int m_LifetimeMin;
|
||||
int m_LifetimeMax;
|
||||
|
||||
int m_DistMax;
|
||||
|
||||
float m_FallSpeed; // extra 'gravity'
|
||||
|
||||
|
||||
public:
|
||||
|
||||
int m_DustFlags; // Combination of DUSTFLAGS_
|
||||
|
||||
|
||||
|
||||
public:
|
||||
CDustEffect m_Effect;
|
||||
PMaterialHandle m_hMaterial;
|
||||
TimedEvent m_Spawner;
|
||||
|
||||
private:
|
||||
C_Func_Dust( const C_Func_Dust & ); // not defined, not accessible
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // C_FUNC_DUST_H
|
||||
27
game/client/c_func_reflective_glass.h
Normal file
27
game/client/c_func_reflective_glass.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//===========================================================================//
|
||||
|
||||
#ifndef C_FUNC_REFLECTIVE_GLASS
|
||||
#define C_FUNC_REFLECTIVE_GLASS
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
struct cplane_t;
|
||||
class CViewSetup;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Do we have reflective glass in view? If so, what's the reflection plane?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool IsReflectiveGlassInView( const CViewSetup& view, cplane_t &plane );
|
||||
|
||||
|
||||
#endif // C_FUNC_REFLECTIVE_GLASS
|
||||
|
||||
|
||||
64
game/client/c_gib.h
Normal file
64
game/client/c_gib.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_GIB_H
|
||||
#define C_GIB_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define DEFAULT_GIB_LIFETIME 4.0f
|
||||
|
||||
// Base client gibs
|
||||
|
||||
class C_Gib : public C_BaseAnimating
|
||||
{
|
||||
typedef C_BaseAnimating BaseClass;
|
||||
public:
|
||||
|
||||
~C_Gib( void );
|
||||
|
||||
static C_Gib *CreateClientsideGib( const char *pszModelName, Vector vecOrigin, Vector vecForceDir, AngularImpulse vecAngularImp, float flLifetime = DEFAULT_GIB_LIFETIME );
|
||||
|
||||
bool InitializeGib( const char *pszModelName, Vector vecOrigin, Vector vecForceDir, AngularImpulse vecAngularImp, float flLifetime = DEFAULT_GIB_LIFETIME );
|
||||
void ClientThink( void );
|
||||
void StartTouch( C_BaseEntity *pOther );
|
||||
|
||||
virtual void HitSurface( C_BaseEntity *pOther );
|
||||
|
||||
protected:
|
||||
|
||||
float m_flTouchDelta; // Amount of time that must pass before another touch function can be called
|
||||
};
|
||||
|
||||
#ifdef HL2_CLIENT_DLL
|
||||
class CAntlionGibManager : public CAutoGameSystemPerFrame
|
||||
{
|
||||
public:
|
||||
CAntlionGibManager( char const *name ) : CAutoGameSystemPerFrame( name )
|
||||
{
|
||||
}
|
||||
|
||||
// Methods of IGameSystem
|
||||
virtual void Update( float frametime );
|
||||
virtual void LevelInitPreEntity( void );
|
||||
|
||||
void AddGib( C_BaseEntity *pEntity );
|
||||
void RemoveGib( C_BaseEntity *pEntity );
|
||||
|
||||
private:
|
||||
typedef CHandle<C_BaseEntity> CGibHandle;
|
||||
CUtlLinkedList< CGibHandle > m_LRU;
|
||||
|
||||
};
|
||||
|
||||
|
||||
extern CAntlionGibManager s_AntlionGibManager;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // C_GIB_H
|
||||
108
game/client/c_impact_effects.h
Normal file
108
game/client/c_impact_effects.h
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_IMPACT_EFFECTS_H
|
||||
#define C_IMPACT_EFFECTS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: DustParticle emitter
|
||||
//-----------------------------------------------------------------------------
|
||||
class CDustParticle : public CSimpleEmitter
|
||||
{
|
||||
public:
|
||||
|
||||
CDustParticle( const char *pDebugName ) : CSimpleEmitter( pDebugName ) {}
|
||||
|
||||
//Create
|
||||
static CDustParticle *Create( const char *pDebugName="dust" )
|
||||
{
|
||||
return new CDustParticle( pDebugName );
|
||||
}
|
||||
|
||||
//Roll
|
||||
virtual float UpdateRoll( SimpleParticle *pParticle, float timeDelta )
|
||||
{
|
||||
pParticle->m_flRoll += pParticle->m_flRollDelta * timeDelta;
|
||||
|
||||
pParticle->m_flRollDelta += pParticle->m_flRollDelta * ( timeDelta * -8.0f );
|
||||
|
||||
#ifdef _XBOX
|
||||
//Cap the minimum roll
|
||||
if ( fabs( pParticle->m_flRollDelta ) < 0.1f )
|
||||
{
|
||||
pParticle->m_flRollDelta = ( pParticle->m_flRollDelta > 0.0f ) ? 0.1f : -0.1f;
|
||||
}
|
||||
#else
|
||||
if ( fabs( pParticle->m_flRollDelta ) < 0.5f )
|
||||
{
|
||||
pParticle->m_flRollDelta = ( pParticle->m_flRollDelta > 0.0f ) ? 0.5f : -0.5f;
|
||||
}
|
||||
#endif // _XBOX
|
||||
|
||||
return pParticle->m_flRoll;
|
||||
}
|
||||
|
||||
//Velocity
|
||||
virtual void UpdateVelocity( SimpleParticle *pParticle, float timeDelta )
|
||||
{
|
||||
Vector saveVelocity = pParticle->m_vecVelocity;
|
||||
|
||||
//Decellerate
|
||||
static float dtime;
|
||||
static float decay;
|
||||
|
||||
if ( dtime != timeDelta )
|
||||
{
|
||||
dtime = timeDelta;
|
||||
float expected = 0.5;
|
||||
decay = exp( log( 0.0001f ) * dtime / expected );
|
||||
}
|
||||
|
||||
pParticle->m_vecVelocity = pParticle->m_vecVelocity * decay;
|
||||
|
||||
#ifdef _XBOX
|
||||
//Cap the minimum speed
|
||||
if ( pParticle->m_vecVelocity.LengthSqr() < (8.0f*8.0f) )
|
||||
{
|
||||
VectorNormalize( saveVelocity );
|
||||
pParticle->m_vecVelocity = saveVelocity * 8.0f;
|
||||
}
|
||||
#else
|
||||
if ( pParticle->m_vecVelocity.LengthSqr() < (32.0f*32.0f) )
|
||||
{
|
||||
VectorNormalize( saveVelocity );
|
||||
pParticle->m_vecVelocity = saveVelocity * 32.0f;
|
||||
}
|
||||
#endif // _XBOX
|
||||
}
|
||||
|
||||
//Alpha
|
||||
virtual float UpdateAlpha( const SimpleParticle *pParticle )
|
||||
{
|
||||
float tLifetime = pParticle->m_flLifetime / pParticle->m_flDieTime;
|
||||
float ramp = 1.0f - tLifetime;
|
||||
|
||||
//Non-linear fade
|
||||
if ( ramp < 0.75f )
|
||||
ramp *= ramp;
|
||||
|
||||
return ramp;
|
||||
}
|
||||
|
||||
private:
|
||||
CDustParticle( const CDustParticle & ); // not defined, not accessible
|
||||
};
|
||||
|
||||
void GetColorForSurface( trace_t *trace, Vector *color );
|
||||
|
||||
#include "tier0/memdbgoff.h"
|
||||
|
||||
#endif // C_IMPACT_EFFECTS_H
|
||||
39
game/client/c_physbox.h
Normal file
39
game/client/c_physbox.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
|
||||
|
||||
// Client-side CBasePlayer
|
||||
|
||||
#ifndef C_PHYSBOX_H
|
||||
#define C_PHYSBOX_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "c_baseentity.h"
|
||||
|
||||
|
||||
class C_PhysBox : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( C_PhysBox, C_BaseEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_PhysBox();
|
||||
virtual ~C_PhysBox();
|
||||
virtual ShadowType_t ShadowCastType();
|
||||
|
||||
public:
|
||||
float m_mass; // TEST..
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
34
game/client/c_physicsprop.h
Normal file
34
game/client/c_physicsprop.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_PHYSICSPROP_H
|
||||
#define C_PHYSICSPROP_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_breakableprop.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_PhysicsProp : public C_BreakableProp
|
||||
{
|
||||
typedef C_BreakableProp BaseClass;
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_PhysicsProp();
|
||||
~C_PhysicsProp();
|
||||
|
||||
virtual bool OnInternalDrawModel( ClientModelRenderInfo_t *pInfo );
|
||||
|
||||
protected:
|
||||
// Networked vars.
|
||||
bool m_bAwake;
|
||||
bool m_bAwakeLastTime;
|
||||
};
|
||||
|
||||
#endif // C_PHYSICSPROP_H
|
||||
55
game/client/c_pixel_visibility.h
Normal file
55
game/client/c_pixel_visibility.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_PIXEL_VISIBILITY_H
|
||||
#define C_PIXEL_VISIBILITY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
const float PIXELVIS_DEFAULT_PROXY_SIZE = 2.0f;
|
||||
const float PIXELVIS_DEFAULT_FADE_TIME = 0.0625f;
|
||||
|
||||
typedef int pixelvis_handle_t;
|
||||
struct pixelvis_queryparams_t
|
||||
{
|
||||
pixelvis_queryparams_t()
|
||||
{
|
||||
bSetup = false;
|
||||
}
|
||||
|
||||
void Init( const Vector &origin, float proxySizeIn = PIXELVIS_DEFAULT_PROXY_SIZE, float proxyAspectIn = 1.0f, float fadeTimeIn = PIXELVIS_DEFAULT_FADE_TIME )
|
||||
{
|
||||
position = origin;
|
||||
proxySize = proxySizeIn;
|
||||
proxyAspect = proxyAspectIn;
|
||||
fadeTime = fadeTimeIn;
|
||||
bSetup = true;
|
||||
bSizeInScreenspace = false;
|
||||
}
|
||||
|
||||
Vector position;
|
||||
float proxySize;
|
||||
float proxyAspect;
|
||||
float fadeTime;
|
||||
bool bSetup;
|
||||
bool bSizeInScreenspace;
|
||||
};
|
||||
|
||||
float PixelVisibility_FractionVisible( const pixelvis_queryparams_t ¶ms, pixelvis_handle_t *queryHandle );
|
||||
float StandardGlowBlend( const pixelvis_queryparams_t ¶ms, pixelvis_handle_t *queryHandle, int rendermode, int renderfx, int alpha, float *pscale );
|
||||
|
||||
void PixelVisibility_ShiftVisibilityViews( int iSourceViewID, int iDestViewID ); //mainly needed by portal mod to avoid a pop in visibility when teleporting the player
|
||||
|
||||
void PixelVisibility_EndCurrentView();
|
||||
void PixelVisibility_EndScene();
|
||||
float GlowSightDistance( const Vector &glowOrigin, bool bShouldTrace );
|
||||
|
||||
// returns true if the video hardware is doing the tests, false is traceline is doing so.
|
||||
bool PixelVisibility_IsAvailable();
|
||||
|
||||
#endif // C_PIXEL_VISIBILITY_H
|
||||
80
game/client/c_playerlocaldata.h
Normal file
80
game/client/c_playerlocaldata.h
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Defines the player specific data that is sent only to the player
|
||||
// to whom it belongs.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_PLAYERLOCALDATA_H
|
||||
#define C_PLAYERLOCALDATA_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "basetypes.h"
|
||||
#include "mathlib/vector.h"
|
||||
#include "playernet_vars.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Player specific data ( sent only to local player, too )
|
||||
//-----------------------------------------------------------------------------
|
||||
class CPlayerLocalData
|
||||
{
|
||||
public:
|
||||
DECLARE_PREDICTABLE();
|
||||
DECLARE_CLASS_NOBASE( CPlayerLocalData );
|
||||
DECLARE_EMBEDDED_NETWORKVAR();
|
||||
|
||||
CPlayerLocalData() :
|
||||
m_iv_vecPunchAngle( "CPlayerLocalData::m_iv_vecPunchAngle" ),
|
||||
m_iv_vecPunchAngleVel( "CPlayerLocalData::m_iv_vecPunchAngleVel" )
|
||||
{
|
||||
m_iv_vecPunchAngle.Setup( &m_vecPunchAngle.m_Value, LATCH_SIMULATION_VAR );
|
||||
m_iv_vecPunchAngleVel.Setup( &m_vecPunchAngleVel.m_Value, LATCH_SIMULATION_VAR );
|
||||
m_flFOVRate = 0;
|
||||
}
|
||||
|
||||
unsigned char m_chAreaBits[MAX_AREA_STATE_BYTES]; // Area visibility flags.
|
||||
unsigned char m_chAreaPortalBits[MAX_AREA_PORTAL_STATE_BYTES];// Area portal visibility flags.
|
||||
|
||||
int m_iHideHUD; // bitfields containing sections of the HUD to hide
|
||||
|
||||
float m_flFOVRate; // rate at which the FOV changes
|
||||
|
||||
|
||||
bool m_bDucked;
|
||||
bool m_bDucking;
|
||||
bool m_bInDuckJump;
|
||||
float m_flDucktime;
|
||||
float m_flDuckJumpTime;
|
||||
float m_flJumpTime;
|
||||
int m_nStepside;
|
||||
float m_flFallVelocity;
|
||||
int m_nOldButtons;
|
||||
// Base velocity that was passed in to server physics so
|
||||
// client can predict conveyors correctly. Server zeroes it, so we need to store here, too.
|
||||
Vector m_vecClientBaseVelocity;
|
||||
CNetworkQAngle( m_vecPunchAngle ); // auto-decaying view angle adjustment
|
||||
CInterpolatedVar< QAngle > m_iv_vecPunchAngle;
|
||||
|
||||
CNetworkQAngle( m_vecPunchAngleVel ); // velocity of auto-decaying view angle adjustment
|
||||
CInterpolatedVar< QAngle > m_iv_vecPunchAngleVel;
|
||||
bool m_bDrawViewmodel;
|
||||
bool m_bWearingSuit;
|
||||
bool m_bPoisoned;
|
||||
float m_flStepSize;
|
||||
bool m_bAllowAutoMovement;
|
||||
|
||||
// 3d skybox
|
||||
sky3dparams_t m_skybox3d;
|
||||
// fog params
|
||||
fogplayerparams_t m_PlayerFog;
|
||||
// audio environment
|
||||
audioparams_t m_audio;
|
||||
|
||||
bool m_bSlowMovement;
|
||||
|
||||
};
|
||||
|
||||
#endif // C_PLAYERLOCALDATA_H
|
||||
79
game/client/c_playerresource.h
Normal file
79
game/client/c_playerresource.h
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Entity that propagates general data needed by clients for every player.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_PLAYERRESOURCE_H
|
||||
#define C_PLAYERRESOURCE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "shareddefs.h"
|
||||
#include "const.h"
|
||||
#include "c_baseentity.h"
|
||||
#include <igameresources.h>
|
||||
|
||||
#define PLAYER_UNCONNECTED_NAME "unconnected"
|
||||
#define PLAYER_ERROR_NAME "ERRORNAME"
|
||||
|
||||
class C_PlayerResource : public C_BaseEntity, public IGameResources
|
||||
{
|
||||
DECLARE_CLASS( C_PlayerResource, C_BaseEntity );
|
||||
public:
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
|
||||
C_PlayerResource();
|
||||
virtual ~C_PlayerResource();
|
||||
|
||||
public : // IGameResources intreface
|
||||
|
||||
// Team data access
|
||||
virtual int GetTeamScore( int index );
|
||||
virtual const char *GetTeamName( int index );
|
||||
virtual const Color&GetTeamColor( int index );
|
||||
|
||||
// Player data access
|
||||
virtual bool IsConnected( int index );
|
||||
virtual bool IsAlive( int index );
|
||||
virtual bool IsFakePlayer( int index );
|
||||
virtual bool IsLocalPlayer( int index );
|
||||
virtual bool IsHLTV(int index);
|
||||
virtual bool IsReplay(int index);
|
||||
|
||||
virtual const char *GetPlayerName( int index );
|
||||
virtual int GetPing( int index );
|
||||
// virtual int GetPacketloss( int index );
|
||||
virtual int GetPlayerScore( int index );
|
||||
virtual int GetDeaths( int index );
|
||||
virtual int GetTeam( int index );
|
||||
virtual int GetFrags( int index );
|
||||
virtual int GetHealth( int index );
|
||||
|
||||
virtual void ClientThink();
|
||||
virtual void OnDataChanged(DataUpdateType_t updateType);
|
||||
|
||||
protected:
|
||||
void UpdatePlayerName( int slot );
|
||||
|
||||
// Data for each player that's propagated to all clients
|
||||
// Stored in individual arrays so they can be sent down via datatables
|
||||
string_t m_szName[MAX_PLAYERS+1];
|
||||
int m_iPing[MAX_PLAYERS+1];
|
||||
int m_iScore[MAX_PLAYERS+1];
|
||||
int m_iDeaths[MAX_PLAYERS+1];
|
||||
bool m_bConnected[MAX_PLAYERS+1];
|
||||
int m_iTeam[MAX_PLAYERS+1];
|
||||
bool m_bAlive[MAX_PLAYERS+1];
|
||||
int m_iHealth[MAX_PLAYERS+1];
|
||||
Color m_Colors[MAX_TEAMS];
|
||||
string_t m_szUnconnectedName;
|
||||
|
||||
};
|
||||
|
||||
extern C_PlayerResource *g_PR;
|
||||
|
||||
#endif // C_PLAYERRESOURCE_H
|
||||
60
game/client/c_point_camera.h
Normal file
60
game/client/c_point_camera.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_POINTCAMERA_H
|
||||
#define C_POINTCAMERA_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_baseentity.h"
|
||||
#include "basetypes.h"
|
||||
|
||||
class C_PointCamera : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( C_PointCamera, C_BaseEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
public:
|
||||
C_PointCamera();
|
||||
~C_PointCamera();
|
||||
|
||||
bool IsActive();
|
||||
|
||||
// C_BaseEntity.
|
||||
virtual bool ShouldDraw();
|
||||
|
||||
float GetFOV();
|
||||
float GetResolution();
|
||||
bool IsFogEnabled();
|
||||
void GetFogColor( unsigned char &r, unsigned char &g, unsigned char &b );
|
||||
float GetFogStart();
|
||||
float GetFogMaxDensity();
|
||||
float GetFogEnd();
|
||||
bool UseScreenAspectRatio() const { return m_bUseScreenAspectRatio; }
|
||||
|
||||
virtual void GetToolRecordingState( KeyValues *msg );
|
||||
|
||||
private:
|
||||
float m_FOV;
|
||||
float m_Resolution;
|
||||
bool m_bFogEnable;
|
||||
color32 m_FogColor;
|
||||
float m_flFogStart;
|
||||
float m_flFogEnd;
|
||||
float m_flFogMaxDensity;
|
||||
bool m_bActive;
|
||||
bool m_bUseScreenAspectRatio;
|
||||
|
||||
public:
|
||||
C_PointCamera *m_pNext;
|
||||
};
|
||||
|
||||
C_PointCamera *GetPointCameraList();
|
||||
|
||||
#endif // C_POINTCAMERA_H
|
||||
134
game/client/c_prop_vehicle.h
Normal file
134
game/client/c_prop_vehicle.h
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_PROP_VEHICLE_H
|
||||
#define C_PROP_VEHICLE_H
|
||||
#pragma once
|
||||
|
||||
#include "iclientvehicle.h"
|
||||
#include "vehicle_viewblend_shared.h"
|
||||
class C_PropVehicleDriveable : public C_BaseAnimating, public IClientVehicle
|
||||
{
|
||||
|
||||
DECLARE_CLASS( C_PropVehicleDriveable, C_BaseAnimating );
|
||||
|
||||
public:
|
||||
|
||||
DECLARE_CLIENTCLASS();
|
||||
DECLARE_INTERPOLATION();
|
||||
DECLARE_DATADESC();
|
||||
|
||||
C_PropVehicleDriveable();
|
||||
~C_PropVehicleDriveable();
|
||||
|
||||
// IVehicle overrides.
|
||||
public:
|
||||
|
||||
virtual C_BaseCombatCharacter* GetPassenger( int nRole );
|
||||
virtual int GetPassengerRole( C_BaseCombatCharacter *pEnt );
|
||||
virtual bool IsPassengerUsingStandardWeapons( int nRole = VEHICLE_ROLE_DRIVER ) { return false; }
|
||||
virtual void GetVehicleViewPosition( int nRole, Vector *pOrigin, QAngle *pAngles, float *pFOV = NULL );
|
||||
|
||||
virtual void SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move ) {}
|
||||
virtual void ProcessMovement( C_BasePlayer *pPlayer, CMoveData *pMoveData ) {}
|
||||
virtual void FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move ) {}
|
||||
|
||||
virtual void ItemPostFrame( C_BasePlayer *pPlayer ) {}
|
||||
|
||||
// IClientVehicle overrides.
|
||||
public:
|
||||
|
||||
virtual void GetVehicleFOV( float &flFOV ) { flFOV = m_flFOV; }
|
||||
virtual void DrawHudElements();
|
||||
virtual void UpdateViewAngles( C_BasePlayer *pLocalPlayer, CUserCmd *pCmd );
|
||||
virtual void DampenEyePosition( Vector &vecVehicleEyePos, QAngle &vecVehicleEyeAngles );
|
||||
virtual void GetVehicleClipPlanes( float &flZNear, float &flZFar ) const;
|
||||
|
||||
#ifdef HL2_CLIENT_DLL
|
||||
virtual int GetPrimaryAmmoType() const { return -1; }
|
||||
virtual int GetPrimaryAmmoCount() const { return -1; }
|
||||
virtual int GetPrimaryAmmoClip() const { return -1; }
|
||||
virtual bool PrimaryAmmoUsesClips() const { return false; }
|
||||
#endif
|
||||
|
||||
virtual bool IsPredicted() const { return false; }
|
||||
virtual int GetJoystickResponseCurve() const;
|
||||
|
||||
// C_BaseEntity overrides.
|
||||
public:
|
||||
|
||||
virtual IClientVehicle* GetClientVehicle() { return this; }
|
||||
virtual C_BaseEntity *GetVehicleEnt() { return this; }
|
||||
virtual bool IsSelfAnimating() { return false; };
|
||||
|
||||
virtual void OnPreDataChanged( DataUpdateType_t updateType );
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
|
||||
// Should this object cast render-to-texture shadows?
|
||||
virtual ShadowType_t ShadowCastType();
|
||||
|
||||
// Mark the shadow as dirty while the vehicle is being driven
|
||||
virtual void ClientThink( void );
|
||||
|
||||
// C_PropVehicleDriveable
|
||||
public:
|
||||
|
||||
bool IsRunningEnterExitAnim( void ) { return m_bEnterAnimOn || m_bExitAnimOn; }
|
||||
// NVNT added to check if the vehicle needs to aim
|
||||
virtual bool HasGun(void){return m_bHasGun;}
|
||||
|
||||
protected:
|
||||
|
||||
virtual void OnEnteredVehicle( C_BaseCombatCharacter *pPassenger );
|
||||
// NVNT added to notify haptics system of vehicle exit.
|
||||
virtual void OnExitedVehicle( C_BaseCombatCharacter *pPassenger );
|
||||
|
||||
virtual void RestrictView( float *pYawBounds, float *pPitchBounds, float *pRollBounds, QAngle &vecViewAngles );
|
||||
virtual void SetVehicleFOV( float flFOV ) { m_flFOV = flFOV; }
|
||||
|
||||
protected:
|
||||
|
||||
CHandle<C_BasePlayer> m_hPlayer;
|
||||
int m_nSpeed;
|
||||
int m_nRPM;
|
||||
float m_flThrottle;
|
||||
int m_nBoostTimeLeft;
|
||||
int m_nHasBoost;
|
||||
int m_nScannerDisabledWeapons;
|
||||
int m_nScannerDisabledVehicle;
|
||||
|
||||
// timers/flags for flashing icons on hud
|
||||
int m_iFlashTimer;
|
||||
bool m_bLockedDim;
|
||||
bool m_bLockedIcon;
|
||||
|
||||
int m_iScannerWepFlashTimer;
|
||||
bool m_bScannerWepDim;
|
||||
bool m_bScannerWepIcon;
|
||||
|
||||
int m_iScannerVehicleFlashTimer;
|
||||
bool m_bScannerVehicleDim;
|
||||
bool m_bScannerVehicleIcon;
|
||||
|
||||
float m_flSequenceChangeTime;
|
||||
bool m_bEnterAnimOn;
|
||||
bool m_bExitAnimOn;
|
||||
float m_flFOV;
|
||||
|
||||
Vector m_vecGunCrosshair;
|
||||
CInterpolatedVar<Vector> m_iv_vecGunCrosshair;
|
||||
Vector m_vecEyeExitEndpoint;
|
||||
bool m_bHasGun;
|
||||
bool m_bUnableToFire;
|
||||
|
||||
// Used to smooth view entry
|
||||
CHandle<C_BasePlayer> m_hPrevPlayer;
|
||||
|
||||
ViewSmoothingData_t m_ViewSmoothingData;
|
||||
};
|
||||
|
||||
|
||||
#endif // C_PROP_VEHICLE_H
|
||||
45
game/client/c_props.h
Normal file
45
game/client/c_props.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef C_PROPS_H
|
||||
#define C_PROPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_breakableprop.h"
|
||||
#include "props_shared.h"
|
||||
|
||||
#define CDynamicProp C_DynamicProp
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_DynamicProp : public C_BreakableProp
|
||||
{
|
||||
DECLARE_CLASS( C_DynamicProp, C_BreakableProp );
|
||||
public:
|
||||
DECLARE_NETWORKCLASS();
|
||||
|
||||
// constructor, destructor
|
||||
C_DynamicProp( void );
|
||||
~C_DynamicProp( void );
|
||||
|
||||
void GetRenderBounds( Vector& theMins, Vector& theMaxs );
|
||||
unsigned int ComputeClientSideAnimationFlags();
|
||||
bool TestBoneFollowers( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr );
|
||||
bool TestCollision( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr );
|
||||
|
||||
private:
|
||||
C_DynamicProp( const C_DynamicProp & );
|
||||
|
||||
bool m_bUseHitboxesForRenderBox;
|
||||
int m_iCachedFrameCount;
|
||||
Vector m_vecCachedRenderMins;
|
||||
Vector m_vecCachedRenderMaxs;
|
||||
};
|
||||
|
||||
#endif // C_PROPS_H
|
||||
189
game/client/c_recipientfilter.h
Normal file
189
game/client/c_recipientfilter.h
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_RECIPIENTFILTER_H
|
||||
#define C_RECIPIENTFILTER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "irecipientfilter.h"
|
||||
#include "utlvector.h"
|
||||
#include "c_baseentity.h"
|
||||
#include "soundflags.h"
|
||||
#include "bitvec.h"
|
||||
|
||||
class C_BasePlayer;
|
||||
class C_Team;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_RecipientFilter : public IRecipientFilter
|
||||
{
|
||||
public:
|
||||
C_RecipientFilter();
|
||||
virtual ~C_RecipientFilter();
|
||||
|
||||
virtual bool IsReliable( void ) const;
|
||||
|
||||
virtual int GetRecipientCount( void ) const;
|
||||
virtual int GetRecipientIndex( int slot ) const;
|
||||
|
||||
virtual bool IsInitMessage( void ) const { return false; };
|
||||
|
||||
public:
|
||||
|
||||
void CopyFrom( const C_RecipientFilter& src );
|
||||
|
||||
void Reset( void );
|
||||
|
||||
void MakeReliable( void );
|
||||
|
||||
void AddAllPlayers( void );
|
||||
void AddRecipientsByPVS( const Vector& origin );
|
||||
void AddRecipientsByPAS( const Vector& origin );
|
||||
void AddRecipient( C_BasePlayer *player );
|
||||
void RemoveRecipient( C_BasePlayer *player );
|
||||
void AddRecipientsByTeam( C_Team *team );
|
||||
void RemoveRecipientsByTeam( C_Team *team );
|
||||
|
||||
void UsePredictionRules( void );
|
||||
bool IsUsingPredictionRules( void ) const;
|
||||
|
||||
bool IgnorePredictionCull( void ) const;
|
||||
void SetIgnorePredictionCull( bool ignore );
|
||||
|
||||
void AddPlayersFromBitMask( CBitVec< ABSOLUTE_PLAYER_LIMIT >& playerbits );
|
||||
|
||||
//private:
|
||||
|
||||
bool m_bReliable;
|
||||
bool m_bInitMessage;
|
||||
CUtlVector< int > m_Recipients;
|
||||
// If using prediction rules, the filter itself suppresses local player
|
||||
bool m_bUsingPredictionRules;
|
||||
// If ignoring prediction cull, then external systems can determine
|
||||
// whether this is a special case where culling should not occur
|
||||
bool m_bIgnorePredictionCull;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Simple class to create a filter for a single player
|
||||
//-----------------------------------------------------------------------------
|
||||
class CSingleUserRecipientFilter : public C_RecipientFilter
|
||||
{
|
||||
public:
|
||||
CSingleUserRecipientFilter( C_BasePlayer *player )
|
||||
{
|
||||
AddRecipient( player );
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Simple class to create a filter for all players, unreliable
|
||||
//-----------------------------------------------------------------------------
|
||||
class CBroadcastRecipientFilter : public C_RecipientFilter
|
||||
{
|
||||
public:
|
||||
CBroadcastRecipientFilter( void )
|
||||
{
|
||||
AddAllPlayers();
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Simple class to create a filter for all players, reliable
|
||||
//-----------------------------------------------------------------------------
|
||||
class CReliableBroadcastRecipientFilter : public CBroadcastRecipientFilter
|
||||
{
|
||||
public:
|
||||
CReliableBroadcastRecipientFilter( void )
|
||||
{
|
||||
MakeReliable();
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Simple class to create a filter for a single player
|
||||
//-----------------------------------------------------------------------------
|
||||
class CPASFilter : public C_RecipientFilter
|
||||
{
|
||||
public:
|
||||
CPASFilter( const Vector& origin )
|
||||
{
|
||||
AddRecipientsByPAS( origin );
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
class CPASAttenuationFilter : public CPASFilter
|
||||
{
|
||||
public:
|
||||
CPASAttenuationFilter( C_BaseEntity *entity, float attenuation = ATTN_NORM ) :
|
||||
CPASFilter( entity->GetAbsOrigin() )
|
||||
{
|
||||
}
|
||||
|
||||
CPASAttenuationFilter( const Vector& origin, float attenuation = ATTN_NORM ) :
|
||||
CPASFilter( origin )
|
||||
{
|
||||
}
|
||||
|
||||
CPASAttenuationFilter( C_BaseEntity *entity, const char *lookupSound ) :
|
||||
CPASFilter( entity->GetAbsOrigin() )
|
||||
{
|
||||
}
|
||||
|
||||
CPASAttenuationFilter( const Vector& origin, const char *lookupSound ) :
|
||||
CPASFilter( origin )
|
||||
{
|
||||
}
|
||||
|
||||
CPASAttenuationFilter( C_BaseEntity *entity, const char *lookupSound, HSOUNDSCRIPTHANDLE& handle ) :
|
||||
CPASFilter( entity->GetAbsOrigin() )
|
||||
{
|
||||
}
|
||||
|
||||
CPASAttenuationFilter( const Vector& origin, const char *lookupSound, HSOUNDSCRIPTHANDLE& handle ) :
|
||||
CPASFilter( origin )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Simple class to create a filter for a single player
|
||||
//-----------------------------------------------------------------------------
|
||||
class CPVSFilter : public C_RecipientFilter
|
||||
{
|
||||
public:
|
||||
CPVSFilter( const Vector& origin )
|
||||
{
|
||||
AddRecipientsByPVS( origin );
|
||||
}
|
||||
};
|
||||
|
||||
class CLocalPlayerFilter : public C_RecipientFilter
|
||||
{
|
||||
public:
|
||||
CLocalPlayerFilter( void );
|
||||
};
|
||||
|
||||
class CUIFilter : public C_RecipientFilter
|
||||
{
|
||||
public:
|
||||
CUIFilter( void )
|
||||
{
|
||||
m_Recipients.AddToTail( 1 );
|
||||
// AddRecipient( 0 );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // C_RECIPIENTFILTER_H
|
||||
261
game/client/c_rope.h
Normal file
261
game/client/c_rope.h
Normal file
|
|
@ -0,0 +1,261 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_ROPE_H
|
||||
#define C_ROPE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "c_baseentity.h"
|
||||
#include "rope_physics.h"
|
||||
#include "materialsystem/imaterial.h"
|
||||
#include "rope_shared.h"
|
||||
#include "bitvec.h"
|
||||
|
||||
|
||||
class KeyValues;
|
||||
class C_BaseAnimating;
|
||||
struct RopeSegData_t;
|
||||
|
||||
#define MAX_ROPE_SUBDIVS 8
|
||||
#define MAX_ROPE_SEGMENTS (ROPE_MAX_SEGMENTS+(ROPE_MAX_SEGMENTS-1)*MAX_ROPE_SUBDIVS)
|
||||
|
||||
//=============================================================================
|
||||
class C_RopeKeyframe : public C_BaseEntity
|
||||
{
|
||||
public:
|
||||
|
||||
DECLARE_CLASS( C_RopeKeyframe, C_BaseEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
class CPhysicsDelegate : public CSimplePhysics::IHelper
|
||||
{
|
||||
public:
|
||||
virtual void GetNodeForces( CSimplePhysics::CNode *pNodes, int iNode, Vector *pAccel );
|
||||
virtual void ApplyConstraints( CSimplePhysics::CNode *pNodes, int nNodes );
|
||||
|
||||
C_RopeKeyframe *m_pKeyframe;
|
||||
};
|
||||
|
||||
friend class CPhysicsDelegate;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
C_RopeKeyframe();
|
||||
~C_RopeKeyframe();
|
||||
|
||||
// This can be used for client-only ropes.
|
||||
static C_RopeKeyframe* Create(
|
||||
C_BaseEntity *pStartEnt,
|
||||
C_BaseEntity *pEndEnt,
|
||||
int iStartAttachment=0,
|
||||
int iEndAttachment=0,
|
||||
float ropeWidth = 2,
|
||||
const char *pMaterialName = "cable/cable", // Note: whoever creates the rope must
|
||||
// use PrecacheModel for whatever material
|
||||
// it specifies here.
|
||||
int numSegments = 5,
|
||||
int ropeFlags = ROPE_SIMULATE
|
||||
);
|
||||
|
||||
// Create a client-only rope and initialize it with the parameters from the KeyValues.
|
||||
static C_RopeKeyframe* CreateFromKeyValues( C_BaseAnimating *pEnt, KeyValues *pValues );
|
||||
|
||||
// Find ropes (with both endpoints connected) that intersect this AABB. This is just an approximation.
|
||||
static int GetRopesIntersectingAABB( C_RopeKeyframe **pRopes, int nMaxRopes, const Vector &vAbsMin, const Vector &vAbsMax );
|
||||
|
||||
// Set the slack.
|
||||
void SetSlack( int slack );
|
||||
|
||||
void SetRopeFlags( int flags );
|
||||
int GetRopeFlags() const;
|
||||
|
||||
void SetupHangDistance( float flHangDist );
|
||||
|
||||
// Change which entities the rope is connected to.
|
||||
void SetStartEntity( C_BaseEntity *pEnt );
|
||||
void SetEndEntity( C_BaseEntity *pEnt );
|
||||
|
||||
C_BaseEntity* GetStartEntity() const;
|
||||
C_BaseEntity* GetEndEntity() const;
|
||||
|
||||
// Hook the physics. Pass in your own implementation of CSimplePhysics::IHelper. The
|
||||
// default implementation is returned so you can call through to it if you want.
|
||||
CSimplePhysics::IHelper* HookPhysics( CSimplePhysics::IHelper *pHook );
|
||||
|
||||
// Attach to things (you can also just lock the endpoints down yourself if you hook the physics).
|
||||
|
||||
// Client-only right now. This could be moved to the server if there was a good reason.
|
||||
void SetColorMod( const Vector &vColorMod );
|
||||
|
||||
// Use this when rope length and slack change to recompute the spring length.
|
||||
void RecomputeSprings();
|
||||
|
||||
void ShakeRope( const Vector &vCenter, float flRadius, float flMagnitude );
|
||||
|
||||
// Get the attachment position of one of the endpoints.
|
||||
bool GetEndPointPos( int iPt, Vector &vPos );
|
||||
|
||||
// Get the rope material data.
|
||||
IMaterial *GetSolidMaterial( void );
|
||||
IMaterial *GetBackMaterial( void );
|
||||
|
||||
struct BuildRopeQueuedData_t
|
||||
{
|
||||
Vector *m_pPredictedPositions;
|
||||
Vector *m_pLightValues;
|
||||
int m_iNodeCount;
|
||||
Vector m_vColorMod;
|
||||
float m_RopeLength;
|
||||
float m_Slack;
|
||||
};
|
||||
|
||||
void BuildRope( RopeSegData_t *pRopeSegment, const Vector &vCurrentViewForward, const Vector &vCurrentViewOrigin, BuildRopeQueuedData_t *pQueuedData, bool bQueued );
|
||||
|
||||
// C_BaseEntity overrides.
|
||||
public:
|
||||
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
virtual void ClientThink();
|
||||
virtual int DrawModel( int flags );
|
||||
virtual bool ShouldDraw();
|
||||
virtual const Vector& WorldSpaceCenter() const;
|
||||
|
||||
// Specify ROPE_ATTACHMENT_START_POINT or ROPE_ATTACHMENT_END_POINT for the attachment.
|
||||
virtual bool GetAttachment( int number, Vector &origin, QAngle &angles );
|
||||
virtual bool GetAttachment( int number, matrix3x4_t &matrix );
|
||||
virtual bool GetAttachment( int number, Vector &origin );
|
||||
virtual bool GetAttachmentVelocity( int number, Vector &originVel, Quaternion &angleVel );
|
||||
|
||||
private:
|
||||
|
||||
void FinishInit( const char *pMaterialName );
|
||||
|
||||
void RunRopeSimulation( float flSeconds );
|
||||
Vector ConstrainNode( const Vector &vNormal, const Vector &vNodePosition, const Vector &vMidpiont, float fNormalLength );
|
||||
void ConstrainNodesBetweenEndpoints( void );
|
||||
|
||||
bool AnyPointsMoved();
|
||||
|
||||
bool DidEndPointMove( int iPt );
|
||||
bool DetectRestingState( bool &bApplyWind );
|
||||
|
||||
void UpdateBBox();
|
||||
bool InitRopePhysics();
|
||||
|
||||
bool GetEndPointAttachment( int iPt, Vector &vPos, QAngle &angle );
|
||||
|
||||
Vector *GetRopeSubdivVectors( int *nSubdivs );
|
||||
void CalcLightValues();
|
||||
|
||||
void ReceiveMessage( int classID, bf_read &msg );
|
||||
bool CalculateEndPointAttachment( C_BaseEntity *pEnt, int iAttachment, Vector &vPos, QAngle *pAngles );
|
||||
|
||||
|
||||
private:
|
||||
// Track which links touched something last frame. Used to prevent wind from gusting on them.
|
||||
CBitVec<ROPE_MAX_SEGMENTS> m_LinksTouchingSomething;
|
||||
int m_nLinksTouchingSomething;
|
||||
bool m_bApplyWind;
|
||||
int m_fPrevLockedPoints; // Which points are locked down.
|
||||
int m_iForcePointMoveCounter;
|
||||
|
||||
// Used to control resting state.
|
||||
bool m_bPrevEndPointPos[2];
|
||||
Vector m_vPrevEndPointPos[2];
|
||||
|
||||
float m_flCurScroll; // for scrolling texture.
|
||||
float m_flScrollSpeed;
|
||||
|
||||
int m_RopeFlags; // Combo of ROPE_ flags.
|
||||
int m_iRopeMaterialModelIndex; // Index of sprite model with the rope's material.
|
||||
|
||||
CRopePhysics<ROPE_MAX_SEGMENTS> m_RopePhysics;
|
||||
Vector m_LightValues[ROPE_MAX_SEGMENTS]; // light info when the rope is created.
|
||||
|
||||
int m_nSegments; // Number of segments.
|
||||
|
||||
EHANDLE m_hStartPoint; // StartPoint/EndPoint are entities
|
||||
EHANDLE m_hEndPoint;
|
||||
short m_iStartAttachment; // StartAttachment/EndAttachment are attachment points.
|
||||
short m_iEndAttachment;
|
||||
|
||||
unsigned char m_Subdiv; // Number of subdivions in between segments.
|
||||
|
||||
int m_RopeLength; // Length of the rope, used for tension.
|
||||
int m_Slack; // Extra length the rope is given.
|
||||
float m_TextureScale; // pixels per inch
|
||||
|
||||
int m_fLockedPoints; // Which points are locked down.
|
||||
|
||||
float m_Width;
|
||||
|
||||
CPhysicsDelegate m_PhysicsDelegate;
|
||||
|
||||
IMaterial *m_pMaterial;
|
||||
IMaterial *m_pBackMaterial; // Optional translucent background material for the rope to help reduce aliasing.
|
||||
|
||||
int m_TextureHeight; // Texture height, for texture scale calculations.
|
||||
|
||||
// Instantaneous force
|
||||
Vector m_flImpulse;
|
||||
Vector m_flPreviousImpulse;
|
||||
|
||||
// Simulated wind gusts.
|
||||
float m_flCurrentGustTimer;
|
||||
float m_flCurrentGustLifetime; // How long will the current gust last?
|
||||
|
||||
float m_flTimeToNextGust; // When will the next wind gust be?
|
||||
Vector m_vWindDir; // What direction does the current gust go in?
|
||||
|
||||
Vector m_vColorMod; // Color modulation on all verts?
|
||||
|
||||
Vector m_vCachedEndPointAttachmentPos[2];
|
||||
QAngle m_vCachedEndPointAttachmentAngle[2];
|
||||
|
||||
// In network table, can't bit-compress
|
||||
bool m_bConstrainBetweenEndpoints; // Simulated segment points won't stretch beyond the endpoints
|
||||
|
||||
bool m_bEndPointAttachmentPositionsDirty : 1;
|
||||
bool m_bEndPointAttachmentAnglesDirty : 1;
|
||||
bool m_bNewDataThisFrame : 1; // Set to true in OnDataChanged so that we simulate that frame
|
||||
bool m_bPhysicsInitted : 1; // It waits until all required entities are
|
||||
// present to start simulating and rendering.
|
||||
|
||||
friend class CRopeManager;
|
||||
};
|
||||
|
||||
|
||||
// Profiling info.
|
||||
void Rope_ResetCounters();
|
||||
//void Rope_ShowRSpeeds();
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Rope Manager
|
||||
//
|
||||
abstract_class IRopeManager
|
||||
{
|
||||
public:
|
||||
virtual ~IRopeManager() {}
|
||||
virtual void ResetRenderCache( void ) = 0;
|
||||
virtual void AddToRenderCache( C_RopeKeyframe *pRope ) = 0;
|
||||
virtual void DrawRenderCache( bool bShadowDepth ) = 0;
|
||||
virtual void OnRenderStart( void ) = 0;
|
||||
virtual void SetHolidayLightMode( bool bHoliday ) = 0;
|
||||
virtual bool IsHolidayLightMode( void ) = 0;
|
||||
virtual int GetHolidayLightStyle( void ) = 0;
|
||||
};
|
||||
|
||||
IRopeManager *RopeManager();
|
||||
|
||||
#endif // C_ROPE_H
|
||||
18
game/client/c_rumble.h
Normal file
18
game/client/c_rumble.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Rumble effects mixer for XBox
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
#pragma once
|
||||
#ifndef C_RUMBLE_H
|
||||
#define C_RUMBLE_H
|
||||
|
||||
extern void RumbleEffect( unsigned char effectIndex, unsigned char rumbleData, unsigned char rumbleFlags );
|
||||
extern void UpdateRumbleEffects();
|
||||
extern void UpdateScreenShakeRumble( float shake, float balance = 0 );
|
||||
extern void EnableRumbleOutput( bool bEnable );
|
||||
|
||||
#endif//C_RUMBLE_H
|
||||
|
||||
134
game/client/c_sceneentity.h
Normal file
134
game/client/c_sceneentity.h
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef C_SCENEENTITY_H
|
||||
#define C_SCENEENTITY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "ichoreoeventcallback.h"
|
||||
#include "choreoscene.h"
|
||||
|
||||
class C_SceneEntity : public C_BaseEntity, public IChoreoEventCallback
|
||||
{
|
||||
friend class CChoreoEventCallback;
|
||||
|
||||
public:
|
||||
DECLARE_CLASS( C_SceneEntity, C_BaseEntity );
|
||||
DECLARE_CLIENTCLASS();
|
||||
|
||||
C_SceneEntity( void );
|
||||
~C_SceneEntity( void );
|
||||
|
||||
// From IChoreoEventCallback
|
||||
virtual void StartEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event );
|
||||
virtual void EndEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event );
|
||||
virtual void ProcessEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event );
|
||||
virtual bool CheckEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event );
|
||||
|
||||
|
||||
virtual void PostDataUpdate( DataUpdateType_t updateType );
|
||||
virtual void PreDataUpdate( DataUpdateType_t updateType );
|
||||
|
||||
virtual void StopClientOnlyScene();
|
||||
virtual void SetupClientOnlyScene( const char *pszFilename, C_BaseFlex *pOwner = NULL , bool bMultiplayer = false );
|
||||
|
||||
virtual void ClientThink();
|
||||
|
||||
void OnResetClientTime();
|
||||
|
||||
CHandle< C_BaseFlex > GetActor( int i ){ return ( i < m_hActorList.Count() ) ? m_hActorList[i] : NULL; }
|
||||
|
||||
virtual void DispatchStartSpeak( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event, soundlevel_t iSoundlevel );
|
||||
virtual void DispatchEndSpeak( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
|
||||
bool IsClientOnly( void ){ return m_bClientOnly; }
|
||||
|
||||
private:
|
||||
|
||||
void ResetActorFlexesForScene();
|
||||
|
||||
// Scene load/unload
|
||||
CChoreoScene *LoadScene( const char *filename );
|
||||
void LoadSceneFromFile( const char *filename );
|
||||
void UnloadScene( void );
|
||||
void PrefetchAnimBlocks( CChoreoScene *pScene );
|
||||
|
||||
C_BaseFlex *FindNamedActor( CChoreoActor *pChoreoActor );
|
||||
|
||||
virtual void DispatchStartFlexAnimation( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchEndFlexAnimation( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchStartExpression( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchEndExpression( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchStartGesture( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchProcessGesture( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchEndGesture( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchStartSequence( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchProcessSequence( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
virtual void DispatchEndSequence( CChoreoScene *scene, C_BaseFlex *actor, CChoreoEvent *event );
|
||||
void DispatchProcessLoop( CChoreoScene *scene, CChoreoEvent *event );
|
||||
|
||||
char const *GetSceneFileName();
|
||||
|
||||
void DoThink( float frametime );
|
||||
|
||||
void ClearSceneEvents( CChoreoScene *scene, bool canceled );
|
||||
void SetCurrentTime( float t, bool forceClientSync );
|
||||
|
||||
bool GetHWMorphSceneFileName( const char *pFilename, char *pHWMFilename );
|
||||
|
||||
private:
|
||||
|
||||
void CheckQueuedEvents();
|
||||
void WipeQueuedEvents();
|
||||
void QueueStartEvent( float starttime, CChoreoScene *scene, CChoreoEvent *event );
|
||||
|
||||
bool m_bIsPlayingBack;
|
||||
bool m_bPaused;
|
||||
bool m_bMultiplayer;
|
||||
float m_flCurrentTime;
|
||||
float m_flForceClientTime;
|
||||
int m_nSceneStringIndex;
|
||||
bool m_bClientOnly;
|
||||
|
||||
CHandle< C_BaseFlex > m_hOwner; // if set, this overrides the m_hActorList in FindNamedActor()
|
||||
|
||||
CUtlVector< CHandle< C_BaseFlex > > m_hActorList;
|
||||
|
||||
private:
|
||||
bool m_bWasPlaying;
|
||||
|
||||
CChoreoScene *m_pScene;
|
||||
|
||||
struct QueuedEvents_t
|
||||
{
|
||||
float starttime;
|
||||
CChoreoScene *scene;
|
||||
CChoreoEvent *event;
|
||||
};
|
||||
|
||||
CUtlVector< QueuedEvents_t > m_QueuedEvents;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Binary compiled VCDs get their strings from a pool
|
||||
//-----------------------------------------------------------------------------
|
||||
class CChoreoStringPool : public IChoreoStringPool
|
||||
{
|
||||
public:
|
||||
short FindOrAddString( const char *pString )
|
||||
{
|
||||
// huh?, no compilation at run time, only fetches
|
||||
Assert( 0 );
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool GetString( short stringId, char *buff, int buffSize );
|
||||
};
|
||||
|
||||
#endif // C_SCENEENTITY_H
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue