aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public
diff options
context:
space:
mode:
authorMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
committerMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
commit55ed12f8d1eb6887d348be03aee5573d44177ffb (patch)
tree3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/public
parent* Added support for Visual C++ 2013 Express to VPC (diff)
downloadsource-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz
source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/public')
-rw-r--r--mp/src/public/XUnzip.cpp10
-rw-r--r--mp/src/public/XZip.cpp20
-rw-r--r--mp/src/public/bone_setup.cpp42
-rw-r--r--mp/src/public/datamodel/dmattribute.h4
-rw-r--r--mp/src/public/datamodel/dmattributetypes.h1
-rw-r--r--mp/src/public/edict.h2
-rw-r--r--mp/src/public/eiface.h13
-rw-r--r--mp/src/public/engine/IEngineSound.h2
-rw-r--r--mp/src/public/filesystem.h50
-rw-r--r--mp/src/public/filesystem_init.cpp2
-rw-r--r--mp/src/public/filesystem_passthru.h11
-rw-r--r--mp/src/public/gamebspfile.h78
-rw-r--r--mp/src/public/html/htmlmessages.h116
-rw-r--r--mp/src/public/html/htmlprotobuf.cpp70
-rw-r--r--mp/src/public/html/htmlprotobuf.h71
-rw-r--r--mp/src/public/html/ichromehtmlwrapper.h63
-rw-r--r--mp/src/public/html/ihtmlchrome.h120
-rw-r--r--mp/src/public/html/ipainthtml.h54
-rw-r--r--mp/src/public/iclientnetworkable.h2
-rw-r--r--mp/src/public/icvar.h6
-rw-r--r--mp/src/public/istudiorender.h12
-rw-r--r--mp/src/public/materialsystem/hardwaretexels.h87
-rw-r--r--mp/src/public/materialsystem/imaterialsystem.h4
-rw-r--r--mp/src/public/materialsystem/imesh.h2
-rw-r--r--mp/src/public/mathlib/mathlib.h2
-rw-r--r--mp/src/public/mathlib/vmatrix.h6
-rw-r--r--mp/src/public/p4lib/ip4.h16
-rw-r--r--mp/src/public/pixelwriter.h8
-rw-r--r--mp/src/public/saverestoretypes.h4
-rw-r--r--mp/src/public/sentence.cpp2
-rw-r--r--mp/src/public/shaderapi/ishaderdynamic.h6
-rw-r--r--mp/src/public/shaderlib/BaseShader.h2
-rw-r--r--mp/src/public/shaderlib/cshader.h54
-rw-r--r--mp/src/public/sourcevr/isourcevirtualreality.h5
-rw-r--r--mp/src/public/steam/isteamapplist.h4
-rw-r--r--mp/src/public/steam/isteamclient.h112
-rw-r--r--mp/src/public/steam/isteamhtmlsurface.h476
-rw-r--r--mp/src/public/steam/isteammatchmaking.h2
-rw-r--r--mp/src/public/steam/isteammusic.h2
-rw-r--r--mp/src/public/steam/isteammusicremote.h126
-rw-r--r--mp/src/public/steam/isteamremotestorage.h9
-rw-r--r--mp/src/public/steam/isteamugc.h71
-rw-r--r--mp/src/public/steam/steam_api.h25
-rw-r--r--mp/src/public/steam/steam_gameserver.h4
-rw-r--r--mp/src/public/steam/steamclientpublic.h62
-rw-r--r--mp/src/public/steam/steamcontrollerpublic.h11
-rw-r--r--mp/src/public/steam/steamhttpenums.h1
-rw-r--r--mp/src/public/steam/steamtypes.h6
-rw-r--r--mp/src/public/steam/steamvr.h21
-rw-r--r--mp/src/public/studio.cpp2
-rw-r--r--mp/src/public/tier0/annotations.h3
-rw-r--r--mp/src/public/tier0/cpumonitoring.h33
-rw-r--r--mp/src/public/tier0/dbg.h15
-rw-r--r--mp/src/public/tier0/fasttimer.h2
-rw-r--r--mp/src/public/tier0/icommandline.h2
-rw-r--r--mp/src/public/tier0/memoverride.cpp3
-rw-r--r--mp/src/public/tier0/platform.h31
-rw-r--r--mp/src/public/tier0/threadtools.h6
-rw-r--r--mp/src/public/tier0/tmapi_dummy.h6
-rw-r--r--mp/src/public/tier0/vprof.h18
-rw-r--r--mp/src/public/tier0/vprof_telemetry.h965
-rw-r--r--mp/src/public/tier1/KeyValues.h2
-rw-r--r--mp/src/public/tier1/UtlSortVector.h1
-rw-r--r--mp/src/public/tier1/convar.h2
-rw-r--r--mp/src/public/tier1/fmtstr.h2
-rw-r--r--mp/src/public/tier1/ilocalize.h29
-rw-r--r--mp/src/public/tier1/snappy-sinksource.h1
-rw-r--r--mp/src/public/tier1/snappy-stubs-public.h98
-rw-r--r--mp/src/public/tier1/snappy.h63
-rw-r--r--mp/src/public/tier1/strtools.h1
-rw-r--r--mp/src/public/tier1/utlbinaryblock.h107
-rw-r--r--mp/src/public/tier1/utlmemory.h8
-rw-r--r--mp/src/public/tier1/utlrbtree.h2
-rw-r--r--mp/src/public/tier1/utlstring.h316
-rw-r--r--mp/src/public/tier1/utlvector.h21
-rw-r--r--mp/src/public/tier2/p4helpers.h27
-rw-r--r--mp/src/public/togl/linuxwin/cglmprogram.h2
-rw-r--r--mp/src/public/togl/osx/glmgrbasics.h598
-rw-r--r--mp/src/public/toolframework/itoolentity.h29
-rw-r--r--mp/src/public/vallocator.h10
-rw-r--r--mp/src/public/vgui/ISurface.h3
-rw-r--r--mp/src/public/vgui_controls/HTML.h106
-rw-r--r--mp/src/public/vgui_controls/ImagePanel.h1
-rw-r--r--mp/src/public/vgui_controls/Panel.h31
-rw-r--r--mp/src/public/zip_utils.cpp4
85 files changed, 2282 insertions, 2147 deletions
diff --git a/mp/src/public/XUnzip.cpp b/mp/src/public/XUnzip.cpp
index fbeb595e..e58f55b2 100644
--- a/mp/src/public/XUnzip.cpp
+++ b/mp/src/public/XUnzip.cpp
@@ -1810,16 +1810,16 @@ uInt *v) // working area: values in order of bit length
uInt f; // i repeats in table every f entries
int g; // maximum code length
int h; // table level
- register uInt i; // counter, current code
- register uInt j; // counter
- register int k; // number of bits in current code
+ uInt i; // counter, current code
+ uInt j; // counter
+ int k; // number of bits in current code
int l; // bits per table (returned in m)
uInt mask; // (1 << w) - 1, to avoid cc -O bug on HP
- register uInt *p; // pointer into c[], b[], or v[]
+ uInt *p; // pointer into c[], b[], or v[]
inflate_huft *q; // points to current table
struct inflate_huft_s r; // table entry for structure assignment
inflate_huft *u[BMAX]; // table stack
- register int w; // bits before this table == (l * h)
+ int w; // bits before this table == (l * h)
uInt x[BMAX+1]; // bit offsets, then code stack
uInt *xp; // pointer into x
int y; // number of dummy codes added
diff --git a/mp/src/public/XZip.cpp b/mp/src/public/XZip.cpp
index 2b187a85..2aab2135 100644
--- a/mp/src/public/XZip.cpp
+++ b/mp/src/public/XZip.cpp
@@ -1470,7 +1470,7 @@ void send_bits(TState &state,int value, int length)
*/
unsigned bi_reverse(unsigned code, int len)
{
- register unsigned res = 0;
+ unsigned res = 0;
do {
res |= code & 1;
code >>= 1, res <<= 1;
@@ -1571,7 +1571,7 @@ int longest_match (TState &state,IPos cur_match);
*/
void lm_init (TState &state, int pack_level, ush *flags)
{
- register unsigned j;
+ unsigned j;
Assert(state,pack_level>=1 && pack_level<=8,"bad pack level");
@@ -1642,9 +1642,9 @@ void lm_init (TState &state, int pack_level, ush *flags)
int longest_match(TState &state,IPos cur_match)
{
unsigned chain_length = state.ds.max_chain_length; /* max hash chain length */
- register uch far *scan = state.ds.window + state.ds.strstart; /* current string */
- register uch far *match; /* matched string */
- register int len; /* length of current match */
+ uch far *scan = state.ds.window + state.ds.strstart; /* current string */
+ uch far *match; /* matched string */
+ int len; /* length of current match */
int best_len = state.ds.prev_length; /* best match length so far */
IPos limit = state.ds.strstart > (IPos)MAX_DIST ? state.ds.strstart - (IPos)MAX_DIST : NIL;
/* Stop when cur_match becomes <= limit. To simplify the code,
@@ -1657,9 +1657,9 @@ int longest_match(TState &state,IPos cur_match)
- register uch far *strend = state.ds.window + state.ds.strstart + MAX_MATCH;
- register uch scan_end1 = scan[best_len-1];
- register uch scan_end = scan[best_len];
+ uch far *strend = state.ds.window + state.ds.strstart + MAX_MATCH;
+ uch scan_end1 = scan[best_len-1];
+ uch scan_end = scan[best_len];
/* Do not waste too much time if we already have a good match: */
if (state.ds.prev_length >= state.ds.good_match) {
@@ -1747,7 +1747,7 @@ int longest_match(TState &state,IPos cur_match)
*/
void fill_window(TState &state)
{
- register unsigned n, m;
+ unsigned n, m;
unsigned more; /* Amount of free space at the end of the window. */
do {
@@ -1916,7 +1916,7 @@ ulg deflate(TState &state)
IPos prev_match; /* previous match */
int flush; /* set if current block must be flushed */
int match_available = 0; /* set if previous match exists */
- register unsigned match_length = MIN_MATCH-1; /* length of best match */
+ unsigned match_length = MIN_MATCH-1; /* length of best match */
if (state.level <= 3) return deflate_fast(state); /* optimized for speed */
diff --git a/mp/src/public/bone_setup.cpp b/mp/src/public/bone_setup.cpp
index 250133d5..4630c730 100644
--- a/mp/src/public/bone_setup.cpp
+++ b/mp/src/public/bone_setup.cpp
@@ -5894,28 +5894,32 @@ int Studio_FindRandomAttachment( const CStudioHdr *pStudioHdr, const char *pAtta
int Studio_BoneIndexByName( const CStudioHdr *pStudioHdr, const char *pName )
{
- // binary search for the bone matching pName
- int start = 0, end = pStudioHdr->numbones()-1;
- const byte *pBoneTable = pStudioHdr->GetBoneTableSortedByName();
- mstudiobone_t *pbones = pStudioHdr->pBone( 0 );
- while (start <= end)
- {
- int mid = (start + end) >> 1;
- int cmp = Q_stricmp( pbones[pBoneTable[mid]].pszName(), pName );
-
- if ( cmp < 0 )
- {
- start = mid + 1;
- }
- else if ( cmp > 0 )
- {
- end = mid - 1;
- }
- else
+ if ( pStudioHdr )
+ {
+ // binary search for the bone matching pName
+ int start = 0, end = pStudioHdr->numbones()-1;
+ const byte *pBoneTable = pStudioHdr->GetBoneTableSortedByName();
+ mstudiobone_t *pbones = pStudioHdr->pBone( 0 );
+ while (start <= end)
{
- return pBoneTable[mid];
+ int mid = (start + end) >> 1;
+ int cmp = Q_stricmp( pbones[pBoneTable[mid]].pszName(), pName );
+
+ if ( cmp < 0 )
+ {
+ start = mid + 1;
+ }
+ else if ( cmp > 0 )
+ {
+ end = mid - 1;
+ }
+ else
+ {
+ return pBoneTable[mid];
+ }
}
}
+
return -1;
}
diff --git a/mp/src/public/datamodel/dmattribute.h b/mp/src/public/datamodel/dmattribute.h
index e4441ff9..e383eabf 100644
--- a/mp/src/public/datamodel/dmattribute.h
+++ b/mp/src/public/datamodel/dmattribute.h
@@ -357,7 +357,7 @@ inline void CDmAttribute::SetValue( char *pValue )
inline void CDmAttribute::SetValue( const void *pValue, size_t nSize )
{
- CUtlBinaryBlock buf( pValue, nSize );
+ CUtlBinaryBlock buf( pValue, (int)nSize );
return SetValue( buf );
}
@@ -599,7 +599,7 @@ inline CDmAttribute* CDmElement::SetValue( const char *pAttributeName, char *pVa
inline CDmAttribute* CDmElement::SetValue( const char *pAttributeName, const void *pValue, size_t nSize )
{
- CUtlBinaryBlock buf( pValue, nSize );
+ CUtlBinaryBlock buf( pValue, (int)nSize );
return SetValue( pAttributeName, buf );
}
diff --git a/mp/src/public/datamodel/dmattributetypes.h b/mp/src/public/datamodel/dmattributetypes.h
index fbff3ef7..3a29caa5 100644
--- a/mp/src/public/datamodel/dmattributetypes.h
+++ b/mp/src/public/datamodel/dmattributetypes.h
@@ -11,6 +11,7 @@
#endif
#include "tier1/utlvector.h"
+#include "tier1/utlbinaryblock.h"
#include "tier1/utlstring.h"
#include "tier1/uniqueid.h"
#include "Color.h"
diff --git a/mp/src/public/edict.h b/mp/src/public/edict.h
index 67c558cd..37c701b4 100644
--- a/mp/src/public/edict.h
+++ b/mp/src/public/edict.h
@@ -343,6 +343,8 @@ inline void CBaseEdict::SetFree()
m_fStateFlags |= FL_EDICT_FREE;
}
+// WARNING: Make sure you don't really want to call ED_ClearFreeFlag which will also
+// remove this edict from the g_FreeEdicts bitset.
inline void CBaseEdict::ClearFree()
{
m_fStateFlags &= ~FL_EDICT_FREE;
diff --git a/mp/src/public/eiface.h b/mp/src/public/eiface.h
index 2dc83a22..0311ee8b 100644
--- a/mp/src/public/eiface.h
+++ b/mp/src/public/eiface.h
@@ -59,6 +59,7 @@ class CGamestatsData;
class CSteamID;
class IReplayFactory;
class IReplaySystem;
+class IServer;
typedef struct player_info_s player_info_t;
@@ -72,7 +73,9 @@ typedef struct player_info_s player_info_t;
#define DLLEXPORT /* */
#endif
-#define INTERFACEVERSION_VENGINESERVER "VEngineServer021"
+#define INTERFACEVERSION_VENGINESERVER_VERSION_21 "VEngineServer021"
+#define INTERFACEVERSION_VENGINESERVER "VEngineServer022"
+#define INTERFACEVERSION_VENGINESERVER_INT 22
struct bbox_t
{
@@ -410,8 +413,13 @@ public:
// Get sv.GetTime()
virtual float GetServerTime() const = 0;
+
+ // Exposed for server plugin authors
+ virtual IServer *GetIServer() = 0;
};
+typedef IVEngineServer IVEngineServer021;
+
#define INTERFACEVERSION_SERVERGAMEDLL_VERSION_8 "ServerGameDLL008"
#define INTERFACEVERSION_SERVERGAMEDLL "ServerGameDLL009"
@@ -543,6 +551,9 @@ public:
// Get gamedata string to send to the master serer updater.
virtual const char *GetServerBrowserGameData() = 0;
+
+ // Called to add output to the status command
+ virtual void Status( void (*print) (const char *fmt, ...) ) = 0;
};
typedef IServerGameDLL IServerGameDLL008;
diff --git a/mp/src/public/engine/IEngineSound.h b/mp/src/public/engine/IEngineSound.h
index f4f83a9c..ce8ac15b 100644
--- a/mp/src/public/engine/IEngineSound.h
+++ b/mp/src/public/engine/IEngineSound.h
@@ -43,7 +43,7 @@ class Vector;
#define SNDLEVEL_FROM_COMPATIBILITY_MODE( x ) ((soundlevel_t)(int)( (x) - 256 ))
// Tells if the given sndlevel is marked as compatibility mode.
-#define SNDLEVEL_IS_COMPATIBILITY_MODE( x ) ( (x) >= 256 )
+#define SNDLEVEL_IS_COMPATIBILITY_MODE( x ) ( (x) >= soundlevel_t(256) )
diff --git a/mp/src/public/filesystem.h b/mp/src/public/filesystem.h
index 9ae55bcb..8571eb59 100644
--- a/mp/src/public/filesystem.h
+++ b/mp/src/public/filesystem.h
@@ -5,6 +5,10 @@
// $NoKeywords: $
//===========================================================================//
+#ifndef FILESYSTEM_H
+#define FILESYSTEM_H
+#pragma once
+
#include <limits.h>
#include "tier0/threadtools.h"
@@ -17,9 +21,6 @@
#include "tier1/checksum_md5.h"
#include "tier1/refcount.h"
-#ifndef FILESYSTEM_H
-#define FILESYSTEM_H
-
#ifdef _WIN32
#pragma once
#endif
@@ -581,10 +582,20 @@ public:
virtual void MarkPathIDByRequestOnly( const char *pPathID, bool bRequestOnly ) = 0;
// converts a partial path into a full path
- virtual const char *RelativePathToFullPath( const char *pFileName, const char *pPathID, char *pLocalPath, int localPathBufferSize, PathTypeFilter_t pathFilter = FILTER_NONE, PathTypeQuery_t *pPathType = NULL ) = 0;
+ // Prefer using the RelativePathToFullPath_safe template wrapper to calling this directly
+ virtual const char *RelativePathToFullPath( const char *pFileName, const char *pPathID, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars, PathTypeFilter_t pathFilter = FILTER_NONE, PathTypeQuery_t *pPathType = NULL ) = 0;
+ template <size_t maxLenInChars> const char *RelativePathToFullPath_safe( const char *pFileName, const char *pPathID, OUT_Z_ARRAY char (&pDest)[maxLenInChars], PathTypeFilter_t pathFilter = FILTER_NONE, PathTypeQuery_t *pPathType = NULL )
+ {
+ return RelativePathToFullPath( pFileName, pPathID, pDest, (int)maxLenInChars, pathFilter, pPathType );
+ }
// Returns the search path, each path is separated by ;s. Returns the length of the string returned
- virtual int GetSearchPath( const char *pathID, bool bGetPackFiles, char *pPath, int nMaxLen ) = 0;
+ // Prefer using the GetSearchPath_safe template wrapper to calling this directly
+ virtual int GetSearchPath( const char *pathID, bool bGetPackFiles, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) = 0;
+ template <size_t maxLenInChars> int GetSearchPath_safe( const char *pathID, bool bGetPackFiles, OUT_Z_ARRAY char (&pDest)[maxLenInChars] )
+ {
+ return GetSearchPath( pathID, bGetPackFiles, pDest, (int)maxLenInChars );
+ }
// interface for custom pack files > 4Gb
virtual bool AddPackFile( const char *fullpath, const char *pathID ) = 0;
@@ -651,11 +662,21 @@ public:
// FIXME: This method is obsolete! Use RelativePathToFullPath instead!
// converts a partial path into a full path
- virtual const char *GetLocalPath( const char *pFileName, char *pLocalPath, int localPathBufferSize ) = 0;
+ // Prefer using the GetLocalPath_safe template wrapper to calling this directly
+ virtual const char *GetLocalPath( const char *pFileName, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) = 0;
+ template <size_t maxLenInChars> const char *GetLocalPath_safe( const char *pFileName, OUT_Z_ARRAY char (&pDest)[maxLenInChars] )
+ {
+ return GetLocalPath( pFileName, pDest, (int)maxLenInChars );
+ }
// Returns true on success ( based on current list of search paths, otherwise false if
// it can't be resolved )
- virtual bool FullPathToRelativePath( const char *pFullpath, char *pRelative, int maxlen ) = 0;
+ // Prefer using the FullPathToRelativePath_safe template wrapper to calling this directly
+ virtual bool FullPathToRelativePath( const char *pFullpath, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) = 0;
+ template <size_t maxLenInChars> bool FullPathToRelativePath_safe( const char *pFullpath, OUT_Z_ARRAY char (&pDest)[maxLenInChars] )
+ {
+ return FullPathToRelativePath( pFullpath, pDest, (int)maxLenInChars );
+ }
// Gets the current working directory
virtual bool GetCurrentDirectory( char* pDirectory, int maxlen ) = 0;
@@ -815,7 +836,12 @@ public:
virtual void EndMapAccess() = 0;
// Returns true on success, otherwise false if it can't be resolved
- virtual bool FullPathToRelativePathEx( const char *pFullpath, const char *pPathId, char *pRelative, int maxlen ) = 0;
+ // Prefer using the FullPathToRelativePathEx_safe template wrapper to calling this directly
+ virtual bool FullPathToRelativePathEx( const char *pFullpath, const char *pPathId, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) = 0;
+ template <size_t maxLenInChars> bool FullPathToRelativePathEx_safe( const char *pFullpath, OUT_Z_ARRAY char (&pDest)[maxLenInChars] )
+ {
+ return FullPathToRelativePathEx( pFullpath, pDest, (int)maxLenInChars );
+ }
virtual int GetPathIndex( const FileNameHandle_t &handle ) = 0;
virtual long GetPathTime( const char *pPath, const char *pPathID ) = 0;
@@ -892,6 +918,14 @@ public:
// Called when we unload a file, to remove that file's info for pure server purposes.
virtual void NotifyFileUnloaded( const char *pszFilename, const char *pPathId ) = 0;
+
+ // Returns true on successfully retrieve case-sensitive full path, otherwise false
+ // Prefer using the GetCaseCorrectFullPath template wrapper to calling this directly
+ virtual bool GetCaseCorrectFullPath_Ptr( const char *pFullPath, OUT_Z_CAP( maxLenInChars ) char *pDest, int maxLenInChars ) = 0;
+ template <size_t maxLenInChars> bool GetCaseCorrectFullPath( const char *pFullPath, OUT_Z_ARRAY char( &pDest )[maxLenInChars] )
+ {
+ return GetCaseCorrectFullPath_Ptr( pFullPath, pDest, (int)maxLenInChars );
+ }
};
//-----------------------------------------------------------------------------
diff --git a/mp/src/public/filesystem_init.cpp b/mp/src/public/filesystem_init.cpp
index 36b484f5..4b2799fe 100644
--- a/mp/src/public/filesystem_init.cpp
+++ b/mp/src/public/filesystem_init.cpp
@@ -86,7 +86,7 @@ public:
if ( pValue )
{
m_bExisted = true;
- m_OriginalValue.SetSize( strlen( pValue ) + 1 );
+ m_OriginalValue.SetSize( Q_strlen( pValue ) + 1 );
memcpy( m_OriginalValue.Base(), pValue, m_OriginalValue.Count() );
}
else
diff --git a/mp/src/public/filesystem_passthru.h b/mp/src/public/filesystem_passthru.h
index b6f1d2c7..f4478b8d 100644
--- a/mp/src/public/filesystem_passthru.h
+++ b/mp/src/public/filesystem_passthru.h
@@ -120,8 +120,9 @@ public:
virtual const char *FindNext( FileFindHandle_t handle ) { return m_pFileSystemPassThru->FindNext( handle ); }
virtual bool FindIsDirectory( FileFindHandle_t handle ) { return m_pFileSystemPassThru->FindIsDirectory( handle ); }
virtual void FindClose( FileFindHandle_t handle ) { m_pFileSystemPassThru->FindClose( handle ); }
- virtual const char *GetLocalPath( const char *pFileName, char *pLocalPath, int localPathBufferSize ) { return m_pFileSystemPassThru->GetLocalPath( pFileName, pLocalPath, localPathBufferSize ); }
- virtual bool FullPathToRelativePath( const char *pFullpath, char *pRelative, int maxlen ) { return m_pFileSystemPassThru->FullPathToRelativePath( pFullpath, pRelative, maxlen ); }
+ virtual const char *GetLocalPath( const char *pFileName, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) { return m_pFileSystemPassThru->GetLocalPath( pFileName, pDest, maxLenInChars ); }
+ virtual bool FullPathToRelativePath( const char *pFullpath, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) { return m_pFileSystemPassThru->FullPathToRelativePath( pFullpath, pDest, maxLenInChars ); }
+ virtual bool GetCaseCorrectFullPath_Ptr( const char *pFullPath, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) { return m_pFileSystemPassThru->GetCaseCorrectFullPath_Ptr( pFullPath, pDest, maxLenInChars ); }
virtual bool GetCurrentDirectory( char* pDirectory, int maxlen ) { return m_pFileSystemPassThru->GetCurrentDirectory( pDirectory, maxlen ); }
virtual void PrintOpenedFiles( void ) { m_pFileSystemPassThru->PrintOpenedFiles(); }
virtual void PrintSearchPaths( void ) { m_pFileSystemPassThru->PrintSearchPaths(); }
@@ -174,8 +175,8 @@ public:
virtual FSAsyncStatus_t AsyncSetPriority(FSAsyncControl_t hControl, int newPriority) { return m_pFileSystemPassThru->AsyncSetPriority(hControl, newPriority); }
virtual bool AsyncSuspend() { return m_pFileSystemPassThru->AsyncSuspend(); }
virtual bool AsyncResume() { return m_pFileSystemPassThru->AsyncResume(); }
- virtual const char *RelativePathToFullPath( const char *pFileName, const char *pPathID, char *pLocalPath, int localPathBufferSize, PathTypeFilter_t pathFilter = FILTER_NONE, PathTypeQuery_t *pPathType = NULL ) { return m_pFileSystemPassThru->RelativePathToFullPath( pFileName, pPathID, pLocalPath, localPathBufferSize, pathFilter, pPathType ); }
- virtual int GetSearchPath( const char *pathID, bool bGetPackFiles, char *pPath, int nMaxLen ) { return m_pFileSystemPassThru->GetSearchPath( pathID, bGetPackFiles, pPath, nMaxLen ); }
+ virtual const char *RelativePathToFullPath( const char *pFileName, const char *pPathID, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars, PathTypeFilter_t pathFilter = FILTER_NONE, PathTypeQuery_t *pPathType = NULL ) { return m_pFileSystemPassThru->RelativePathToFullPath( pFileName, pPathID, pDest, maxLenInChars, pathFilter, pPathType ); }
+ virtual int GetSearchPath( const char *pathID, bool bGetPackFiles, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) { return m_pFileSystemPassThru->GetSearchPath( pathID, bGetPackFiles, pDest, maxLenInChars ); }
virtual FileHandle_t OpenEx( const char *pFileName, const char *pOptions, unsigned flags = 0, const char *pathID = 0, char **ppszResolvedFilename = NULL ) { return m_pFileSystemPassThru->OpenEx( pFileName, pOptions, flags, pathID, ppszResolvedFilename );}
virtual int ReadEx( void* pOutput, int destSize, int size, FileHandle_t file ) { return m_pFileSystemPassThru->ReadEx( pOutput, destSize, size, file ); }
@@ -208,7 +209,7 @@ public:
virtual void EndMapAccess() { m_pFileSystemPassThru->EndMapAccess(); }
virtual bool ReadToBuffer( FileHandle_t hFile, CUtlBuffer &buf, int nMaxBytes = 0, FSAllocFunc_t pfnAlloc = NULL ) { return m_pFileSystemPassThru->ReadToBuffer( hFile, buf, nMaxBytes, pfnAlloc ); }
- virtual bool FullPathToRelativePathEx( const char *pFullPath, const char *pPathId, char *pRelative, int nMaxLen ) { return m_pFileSystemPassThru->FullPathToRelativePathEx( pFullPath, pPathId, pRelative, nMaxLen ); }
+ virtual bool FullPathToRelativePathEx( const char *pFullPath, const char *pPathId, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) { return m_pFileSystemPassThru->FullPathToRelativePathEx( pFullPath, pPathId, pDest, maxLenInChars ); }
virtual int GetPathIndex( const FileNameHandle_t &handle ) { return m_pFileSystemPassThru->GetPathIndex( handle ); }
virtual long GetPathTime( const char *pPath, const char *pPathID ) { return m_pFileSystemPassThru->GetPathTime( pPath, pPathID ); }
diff --git a/mp/src/public/gamebspfile.h b/mp/src/public/gamebspfile.h
index f8029bae..0b34c122 100644
--- a/mp/src/public/gamebspfile.h
+++ b/mp/src/public/gamebspfile.h
@@ -36,7 +36,7 @@ enum
{
GAMELUMP_DETAIL_PROPS_VERSION = 4,
GAMELUMP_DETAIL_PROP_LIGHTING_VERSION = 0,
- GAMELUMP_STATIC_PROPS_VERSION = 6,
+ GAMELUMP_STATIC_PROPS_VERSION = 7,
GAMELUMP_STATIC_PROP_LIGHTING_VERSION = 0,
GAMELUMP_DETAIL_PROP_LIGHTING_HDR_VERSION = 0,
};
@@ -139,7 +139,9 @@ enum
STATIC_PROP_NO_SELF_SHADOWING = 0x80, // disable self shadowing in vrad
- STATIC_PROP_WC_MASK = 0xd8, // all flags settable in hammer (?)
+ STATIC_PROP_NO_PER_TEXEL_LIGHTING = 0x100, // whether we should do per-texel lightmaps in vrad.
+
+ STATIC_PROP_WC_MASK = 0x1d8, // all flags settable in hammer (?)
};
struct StaticPropDictLump_t
@@ -183,7 +185,7 @@ struct StaticPropLumpV5_t
// int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
};
-struct StaticPropLump_t
+struct StaticPropLumpV6_t
{
DECLARE_BYTESWAP_DATADESC();
Vector m_Origin;
@@ -203,6 +205,76 @@ struct StaticPropLump_t
// int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
};
+struct StaticPropLump_t
+{
+ DECLARE_BYTESWAP_DATADESC();
+ Vector m_Origin;
+ QAngle m_Angles;
+ unsigned short m_PropType;
+ unsigned short m_FirstLeaf;
+ unsigned short m_LeafCount;
+ unsigned char m_Solid;
+ int m_Skin;
+ float m_FadeMinDist;
+ float m_FadeMaxDist;
+ Vector m_LightingOrigin;
+ float m_flForcedFadeScale;
+ unsigned short m_nMinDXLevel;
+ unsigned short m_nMaxDXLevel;
+ // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
+ unsigned int m_Flags;
+ unsigned short m_nLightmapResolutionX;
+ unsigned short m_nLightmapResolutionY;
+
+
+ StaticPropLump_t& operator=(const StaticPropLumpV4_t& _rhs)
+ {
+ m_Origin = _rhs.m_Origin;
+ m_Angles = _rhs.m_Angles;
+ m_PropType = _rhs.m_PropType;
+ m_FirstLeaf = _rhs.m_FirstLeaf;
+ m_LeafCount = _rhs.m_LeafCount;
+ m_Solid = _rhs.m_Solid;
+ m_Flags = _rhs.m_Flags;
+ m_Skin = _rhs.m_Skin;
+ m_FadeMinDist = _rhs.m_FadeMinDist;
+ m_FadeMaxDist = _rhs.m_FadeMaxDist;
+ m_LightingOrigin = _rhs.m_LightingOrigin;
+
+ // These get potentially set twice--once here and once in the caller.
+ // Value judgement: This makes the code easier to work with, so unless it's a perf issue...
+ m_flForcedFadeScale = 1.0f;
+ m_nMinDXLevel = 0;
+ m_nMaxDXLevel = 0;
+ m_nLightmapResolutionX = 0;
+ m_nLightmapResolutionY = 0;
+
+ // Older versions don't want this.
+ m_Flags |= STATIC_PROP_NO_PER_TEXEL_LIGHTING;
+ return *this;
+ }
+
+ StaticPropLump_t& operator=(const StaticPropLumpV5_t& _rhs)
+ {
+ (*this) = reinterpret_cast<const StaticPropLumpV4_t&>(_rhs);
+
+ m_flForcedFadeScale = _rhs.m_flForcedFadeScale;
+ return *this;
+ }
+
+ StaticPropLump_t& operator=(const StaticPropLumpV6_t& _rhs)
+ {
+ (*this) = reinterpret_cast<const StaticPropLumpV5_t&>(_rhs);
+
+ m_nMinDXLevel = _rhs.m_nMinDXLevel;
+ m_nMaxDXLevel = _rhs.m_nMaxDXLevel;
+ return *this;
+ }
+};
+
+
+
+
struct StaticPropLeafLump_t
{
DECLARE_BYTESWAP_DATADESC();
diff --git a/mp/src/public/html/htmlmessages.h b/mp/src/public/html/htmlmessages.h
deleted file mode 100644
index bfdc3475..00000000
--- a/mp/src/public/html/htmlmessages.h
+++ /dev/null
@@ -1,116 +0,0 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//=============================================================================//
-
-#ifndef HTMLMESSAGES_H
-#define HTMLMESSAGES_H
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-//-----------------------------------------------------------------------------
-// Purpose: Commands we IPC across to the html thread and get responses for
-//-----------------------------------------------------------------------------
-enum EHTMLCommands
-{
- // input events
- eHTMLCommands_KeyUp,
- eHTMLCommands_KeyDown,
- eHTMLCommands_KeyChar,
- eHTMLCommands_MouseDown,
- eHTMLCommands_MouseUp,
- eHTMLCommands_MouseDblClick,
- eHTMLCommands_MouseWheel,
- eHTMLCommands_MouseMove,
- eHTMLCommands_MouseLeave,
-
- // command events
- eHTMLCommands_BrowserCreate,
- eHTMLCommands_BrowserRemove,
- eHTMLCommands_BrowserErrorStrings,
- eHTMLCommands_BrowserSize,
- eHTMLCommands_BrowserPosition,
- eHTMLCommands_PostURL,
- eHTMLCommands_StopLoad,
- eHTMLCommands_Reload,
- eHTMLCommands_GoForward,
- eHTMLCommands_GoBack,
- eHTMLCommands_Copy,
- eHTMLCommands_Paste,
- eHTMLCommands_ExecuteJavaScript,
- eHTMLCommands_SetFocus,
- eHTMLCommands_HorizontalScrollBarSize,
- eHTMLCommands_VerticalScrollBarSize,
- eHTMLCommands_Find,
- eHTMLCommands_StopFind,
- eHTMLCommands_SetHorizontalScroll,
- eHTMLCommands_SetVerticalScroll,
- eHTMLCommands_SetZoomLevel,
- eHTMLCommands_ViewSource,
- eHTMLCommands_NeedsPaintResponse,
- eHTMLCommands_AddHeader,
- eHTMLCommands_GetZoom,
- eHTMLCommands_FileLoadDialogResponse,
- eHTMLCommands_LinkAtPosition,
- eHTMLCommands_ZoomToElementAtPosition,
- eHTMLCommands_SavePageToJPEG,
- eHTMLCommands_JSAlert,
- eHTMLCommands_JSConfirm,
- eHTMLCommands_CanGoBackandForward,
- eHTMLCommands_OpenSteamURL,
- eHTMLCommands_SizePopup,
- eHTMLCommands_SetCookie,
- eHTMLCommands_SetTargetFrameRate,
- eHTMLCommands_FullRepaint,
- eHTMLCommands_SetPageScale,
- eHTMLCommands_RequestFullScreen,
- eHTMLCommands_ExitFullScreen,
- eHTMLCommands_GetCookiesForURL,
- eHTMLCommands_ZoomToCurrentlyFocusedNode,
- eHTMLCommands_CloseFullScreenFlashIfOpen,
- eHTMLCommands_PauseFullScreenFlashMovieIfOpen,
- eHTMLCommands_GetFocusedNodeValue,
-
- // output back to the main thread
- eHTMLCommands_BrowserCreateResponse,
- eHTMLCommands_BrowserReady,
- eHTMLCommands_URLChanged,
- eHTMLCommands_FinishedRequest,
- eHTMLCommands_StartRequest,
- eHTMLCommands_ShowPopup,
- eHTMLCommands_HidePopup,
- eHTMLCommands_OpenNewTab,
- eHTMLCommands_PopupHTMLWindow,
- eHTMLCommands_PopupHTMLWindowResponse,
- eHTMLCommands_SetHTMLTitle,
- eHTMLCommands_LoadingResource,
- eHTMLCommands_StatusText,
- eHTMLCommands_SetCursor,
- eHTMLCommands_FileLoadDialog,
- eHTMLCommands_ShowToolTip,
- eHTMLCommands_UpdateToolTip,
- eHTMLCommands_HideToolTip,
- eHTMLCommands_SearchResults,
- eHTMLCommands_Close,
- eHTMLCommands_VerticalScrollBarSizeResponse,
- eHTMLCommands_HorizontalScrollBarSizeResponse,
- eHTMLCommands_GetZoomResponse,
- eHTMLCommands_StartRequestResponse,
- eHTMLCommands_NeedsPaint,
- eHTMLCommands_LinkAtPositionResponse,
- eHTMLCommands_ZoomToElementAtPositionResponse,
- eHTMLCommands_JSDialogResponse,
- eHTMLCommands_ScaleToValueResponse,
- eHTMLCommands_RequestFullScreenResponse,
- eHTMLCommands_GetCookiesForURLResponse,
- eHTMLCommands_NodeGotFocus,
- eHTMLCommands_SavePageToJPEGResponse,
- eHTMLCommands_GetFocusedNodeValueResponse,
-
- eHTMLCommands_None,
-
-};
-
-#endif // HTMLMESSAGES_H \ No newline at end of file
diff --git a/mp/src/public/html/htmlprotobuf.cpp b/mp/src/public/html/htmlprotobuf.cpp
deleted file mode 100644
index 19822273..00000000
--- a/mp/src/public/html/htmlprotobuf.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//=============================================================================//
-
-
-#include "html/htmlprotobuf.h"
-#include "tier0/vprof.h"
-#include "tier0/valve_minmax_off.h"
-
-
-#ifdef _WIN64
-// disable 64-bit warnings for the google headers
-#pragma warning(push)
-#pragma warning(disable:4244) // warning C4244: 'return' : conversion from '__int64' to 'int', possible loss of data
-#pragma warning(disable:4267) // warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
-#endif
-
-#include "tier0/memdbgoff.h"
-#include "protobuf-2.3.0/src/google/protobuf/message_lite.h"
-#include "tier0/memdbgon.h"
-
-#ifdef _WIN64
-#pragma warning(pop)
-#endif
-
-//-----------------------------------------------------------------------------
-// Purpose: serialize a protobuf into a utlbuffer
-//-----------------------------------------------------------------------------
-void CHTMLBaseProtoBufMsg::SerializeCrossProc( CUtlBuffer *pBuffer ) const
-{
- VPROF_BUDGET( "CUIProtoBufMsg::SerializeCrossProc", VPROF_BUDGETGROUP_OTHER_VGUI );
- uint32 unSize = ((google::protobuf::MessageLite *)m_pMsg)->ByteSize();
-
- // Ensure enough for type, size, and serialized data
- pBuffer->EnsureCapacity( pBuffer->TellPut() + sizeof(uint32) * 3 + unSize ); // bugbug cboyd - drop to * 2 whenpassthrough is removed below
-
- pBuffer->PutUnsignedInt( unSize );
-
- if ( unSize == 0 )
- return;
-
- uint8 *pBody = (uint8*)pBuffer->Base()+pBuffer->TellPut();
- ((google::protobuf::MessageLite *)m_pMsg)->SerializeWithCachedSizesToArray( pBody );
- pBuffer->SeekPut( CUtlBuffer::SEEK_CURRENT, unSize );
-}
-
-
-//-----------------------------------------------------------------------------
-// Purpose: grab a previously serialized protobuf
-//-----------------------------------------------------------------------------
-bool CHTMLBaseProtoBufMsg::BDeserializeCrossProc( CUtlBuffer *pBuffer )
-{
- VPROF_BUDGET( "CUIProtoBufMsg::BDeserialize", VPROF_BUDGETGROUP_OTHER_VGUI );
- if ( pBuffer->GetBytesRemaining() < (int)sizeof(uint32) )
- return false;
- uint32 unSize = pBuffer->GetUnsignedInt();
-
- if ( unSize == 0 )
- return true;
-
- if ( pBuffer->GetBytesRemaining() < (int)unSize )
- return false;
-
- bool bSucccess = ((google::protobuf::MessageLite *)m_pMsg)->ParseFromArray( (uint8*)pBuffer->Base()+pBuffer->TellGet(), unSize );
- pBuffer->SeekGet( CUtlBuffer::SEEK_CURRENT, unSize );
-
- return bSucccess;
-}
-
diff --git a/mp/src/public/html/htmlprotobuf.h b/mp/src/public/html/htmlprotobuf.h
deleted file mode 100644
index 35d1d1d9..00000000
--- a/mp/src/public/html/htmlprotobuf.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//=============================================================================//
-
-#ifndef HTML_PROTOBUF
-#define HTML_PROTOBUF
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include "tier1/utlbuffer.h"
-#include "html/htmlmessages.h"
-
-namespace google
-{
- namespace protobuf
- {
- class MessageLite;
- }
-}
-
-class CHTMLBaseProtoBufMsg
-{
-public:
- void SerializeCrossProc( CUtlBuffer *pBuffer ) const;
- bool BDeserializeCrossProc( CUtlBuffer *pBuffer );
-
-protected:
- void *m_pMsg;
- bool m_bIsValid;
-};
-
-
-//-----------------------------------------------------------------------------
-// Purpose: Base class for protobuf objects
-//-----------------------------------------------------------------------------
-template< typename PB_OBJECT_TYPE >
-class CHTMLProtoBufMsg : public CHTMLBaseProtoBufMsg
-{
-public:
- CHTMLProtoBufMsg( EHTMLCommands eMsg )
- {
- m_pMsg = new PB_OBJECT_TYPE;
- m_bIsValid = true;
- }
-
- // Construct and deserialize in one
- CHTMLProtoBufMsg( CUtlBuffer *pBuffer )
- {
- m_pMsg = NULL;
- m_bIsValid = BDeserializeCrossProc( pBuffer );
- }
-
- // Destructor
- virtual ~CHTMLProtoBufMsg()
- {
- delete (PB_OBJECT_TYPE *)m_pMsg;
- }
-
- bool BIsValid() { return m_bIsValid; }
-
- // Accessors
- PB_OBJECT_TYPE &Body() { return *((PB_OBJECT_TYPE*)( (google::protobuf::MessageLite *)m_pMsg )); }
- const PB_OBJECT_TYPE &BodyConst() const { return *((const PB_OBJECT_TYPE*)( (google::protobuf::MessageLite *)m_pMsg )); }
-
-};
-
-
-#endif // HTML_PROTOBUF
diff --git a/mp/src/public/html/ichromehtmlwrapper.h b/mp/src/public/html/ichromehtmlwrapper.h
deleted file mode 100644
index d606ba05..00000000
--- a/mp/src/public/html/ichromehtmlwrapper.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#ifndef ICHROMEHTMLWRAPPER_H
-#define ICHROMEHTMLWRAPPER_H
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include <html/htmlmessages.h>
-
-class CUtlString;
-class IHTMLResponses;
-struct HTMLCommandBuffer_t;
-
-
-//------------------------------------------------------------- ----------------
-// Purpose: wrapper for HTML functionality
-//-----------------------------------------------------------------------------
-class IHTMLChromeController
-{
-public:
- virtual ~IHTMLChromeController() {}
-
- virtual bool Init( const char *pchHTMLCacheDir, const char *pchCookiePath ) = 0;
- virtual void Shutdown() = 0;
- virtual bool RunFrame() = 0;
-
-
- // set a cookie in the CEF instance. pchPath is typically "/". If nExpires is 0 then it is a session only cookie, other wise it is saved.
- virtual void SetWebCookie( const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath, RTime32 nExpires = 0 ) = 0;
- virtual void GetWebCookiesForURL( CUtlString *pstrValue, const char *pchURL, const char *pchName ) = 0;
-
- virtual void SetClientBuildID( uint64 ulBuildID ) = 0;
-
- virtual bool BHasPendingMessages() = 0;
-
- virtual void CreateBrowser( IHTMLResponses *pBrowser, bool bPopupWindow, const char *pchUserAgentIdentifier ) = 0;
- virtual void RemoveBrowser( IHTMLResponses *pBrowser ) = 0;
-
- virtual void WakeThread() = 0;
- virtual HTMLCommandBuffer_t *GetFreeCommandBuffer( EHTMLCommands eCmd, int iBrowser ) = 0;
- virtual void PushCommand( HTMLCommandBuffer_t * ) = 0;
-
-#ifdef DBGFLAG_VALIDATE
- virtual void Validate( CValidator &validator, const char *pchName ) = 0;
-
- virtual bool ChromePrepareForValidate() = 0;
- virtual bool ChromeResumeFromValidate() = 0;
-#endif
-
- virtual void SetCefThreadTargetFrameRate( uint32 nFPS ) = 0;
-};
-
-#define CHROMEHTML_CONTROLLER_INTERFACE_VERSION "ChromeHTML_Controller_001"
-
-
-#endif // ICHROMEHTMLWRAPPER_H \ No newline at end of file
diff --git a/mp/src/public/html/ihtmlchrome.h b/mp/src/public/html/ihtmlchrome.h
deleted file mode 100644
index b4b74355..00000000
--- a/mp/src/public/html/ihtmlchrome.h
+++ /dev/null
@@ -1,120 +0,0 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//=============================================================================//
-
-#ifndef IHTMLCHROME_H
-#define IHTMLCHROME_H
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include "htmlmessages.h"
-#include "tier1/utlbuffer.h"
-
-// prototypes for all the protobuf messages, so we don't need to include all of protobuf
-class CMsgBrowserReady;
-class CMsgNeedsPaint;
-class CMsgStartRequest;
-class CMsgURLChanged;
-class CMsgFinishedRequest;
-class CMsgShowPopup;
-class CMsgHidePopup;
-class CMsgOpenNewTab;
-class CMsgPopupHTMLWindow;
-class CMsgSetHTMLTitle;
-class CMsgLoadingResource;
-class CMsgStatusText;
-class CMsgSetCursor;
-class CMsgFileLoadDialog;
-class CMsgShowToolTip;
-class CMsgUpdateToolTip;
-class CMsgHideToolTip;
-class CMsgSearchResults;
-class CMsgClose;
-class CMsgHorizontalScrollBarSizeResponse;
-class CMsgVerticalScrollBarSizeResponse;
-class CMsgGetZoomResponse;
-class CMsgLinkAtPositionResponse;
-class CMsgZoomToElementAtPositionResponse;
-class CMsgJSAlert;
-class CMsgJSConfirm;
-class CMsgCanGoBackAndForward;
-class CMsgOpenSteamURL;
-class CMsgSizePopup;
-class CMsgScalePageToValueResponse;
-class CMsgRequestFullScreen;
-class CMsgExitFullScreen;
-class CMsgGetCookiesForURLResponse;
-class CMsgNodeHasFocus;
-class CMsgSavePageToJPEGResponse;
-class CMsgFocusedNodeTextResponse;
-
-//-----------------------------------------------------------------------------
-// Purpose: a single IPC packet for the html thread (in and out)
-//-----------------------------------------------------------------------------
-struct HTMLCommandBuffer_t
-{
- EHTMLCommands m_eCmd;
- int m_iBrowser;
- CUtlBuffer m_Buffer;
-#ifdef DBGFLAG_VALIDATE
- virtual void Validate( CValidator &validator, const tchar *pchName )
- {
- VALIDATE_SCOPE();
- ValidateObj( m_Buffer );
- }
-#endif
-};
-
-
-//-----------------------------------------------------------------------------
-// Purpose: callback interfaces for messages from the html thread
-//-----------------------------------------------------------------------------
-class IHTMLResponses
-{
-public:
- virtual ~IHTMLResponses() {}
-
- virtual void BrowserSetIndex( int idx ) = 0;
- virtual int BrowserGetIndex() = 0;
- virtual void BrowserReady( const CMsgBrowserReady *pCmd ) = 0;
- virtual void BrowserNeedsPaint( const CMsgNeedsPaint *pCmd ) = 0;
- virtual void BrowserStartRequest( const CMsgStartRequest *pCmd ) = 0;
- virtual void BrowserURLChanged( const CMsgURLChanged *pCmd ) = 0;
- virtual void BrowserFinishedRequest( const CMsgFinishedRequest *pCmd ) = 0;
- virtual void BrowserShowPopup( const CMsgShowPopup *pCmd ) = 0;
- virtual void BrowserHidePopup( const CMsgHidePopup *pCmd ) = 0;
- virtual void BrowserOpenNewTab( const CMsgOpenNewTab *pCmd ) = 0;
- virtual void BrowserPopupHTMLWindow( const CMsgPopupHTMLWindow *pCmd ) = 0;
- virtual void BrowserSetHTMLTitle( const CMsgSetHTMLTitle *pCmd ) = 0;
- virtual void BrowserLoadingResource( const CMsgLoadingResource *pCmd ) = 0;
- virtual void BrowserStatusText( const CMsgStatusText *pCmd ) = 0;
- virtual void BrowserSetCursor( const CMsgSetCursor *pCmd ) = 0;
- virtual void BrowserFileLoadDialog( const CMsgFileLoadDialog *pCmd ) = 0;
- virtual void BrowserShowToolTip( const CMsgShowToolTip *pCmd ) = 0;
- virtual void BrowserUpdateToolTip( const CMsgUpdateToolTip *pCmd ) = 0;
- virtual void BrowserHideToolTip( const CMsgHideToolTip *pCmd ) = 0;
- virtual void BrowserSearchResults( const CMsgSearchResults *pCmd ) = 0;
- virtual void BrowserClose( const CMsgClose *pCmd ) = 0;
- virtual void BrowserHorizontalScrollBarSizeResponse( const CMsgHorizontalScrollBarSizeResponse *pCmd ) = 0;
- virtual void BrowserVerticalScrollBarSizeResponse( const CMsgVerticalScrollBarSizeResponse *pCmd ) = 0;
- virtual void BrowserGetZoomResponse( const CMsgGetZoomResponse *pCmd ) = 0;
- virtual void BrowserLinkAtPositionResponse( const CMsgLinkAtPositionResponse *pCmd ) = 0;
- virtual void BrowserZoomToElementAtPositionResponse( const CMsgZoomToElementAtPositionResponse *pCmd ) = 0;
- virtual void BrowserJSAlert( const CMsgJSAlert *pCmd ) = 0;
- virtual void BrowserJSConfirm( const CMsgJSConfirm *pCmd ) = 0;
- virtual void BrowserCanGoBackandForward( const CMsgCanGoBackAndForward *pCmd ) = 0;
- virtual void BrowserOpenSteamURL( const CMsgOpenSteamURL *pCmd ) = 0;
- virtual void BrowserSizePopup( const CMsgSizePopup *pCmd ) = 0;
- virtual void BrowserScalePageToValueResponse( const CMsgScalePageToValueResponse *pCmd ) = 0;
- virtual void BrowserRequestFullScreen( const CMsgRequestFullScreen *pCmd ) = 0;
- virtual void BrowserExitFullScreen( const CMsgExitFullScreen *pCmd ) = 0;
- virtual void BrowserGetCookiesForURLResponse( const CMsgGetCookiesForURLResponse *pCmd ) = 0;
- virtual void BrowserNodeGotFocus( const CMsgNodeHasFocus *pCmd ) = 0;
- virtual void BrowserSavePageToJPEGResponse( const CMsgSavePageToJPEGResponse *pCmd ) = 0;
- virtual void BrowserFocusedNodeValueResponse( const CMsgFocusedNodeTextResponse *pCmd ) = 0;
-};
-
-#endif // IHTMLCHROME_H
diff --git a/mp/src/public/html/ipainthtml.h b/mp/src/public/html/ipainthtml.h
deleted file mode 100644
index 9e47e23f..00000000
--- a/mp/src/public/html/ipainthtml.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-#ifndef IPAINTHTML_H
-#define IPAINTHTML_H
-
-class IPaintHTML
-{
-public:
- enum EPaintTarget
- {
- ePaintBrowser,
- ePaintPopup,
- ePaintMAX
- };
- // returns the texture id used, pass in -1 to create a new texture
- virtual int DrawSubTextureRGBA( EPaintTarget eTarget, int textureID, int x, int y, const unsigned char *pRGBA, int updateWide, int updateTall, int fullTextureWide, int fullTextureTall ) = 0;
- virtual void DeleteTexture( EPaintTarget eTarget, int textureID ) = 0;
-};
-
-class IInputEventHTML
-{
-public:
- enum EMouseButton
- {
- eButtonLeft,
- eButtonMiddle,
- eButtonRight
- };
-
- virtual bool ChromeHandleMouseClick( EMouseButton eButton, bool bUp, int nClickCount ) = 0;
- virtual bool ChromeHandleMouseMove( int x, int y ) = 0;
- virtual bool ChromeHandleMouseWheel( int delta ) = 0;
-
- enum EKeyType
- {
- KeyDown,
- KeyUp,
- Char
- };
- enum EKeyModifier
- {
- AltDown = 1,
- CrtlDown = 2,
- ShiftDown = 4,
- };
-
- virtual bool ChromeHandleKeyEvent( EKeyType type, int key, int modifiers, bool bKeyUp ) = 0;
-};
-
-#endif // IPAINTHTML_H \ No newline at end of file
diff --git a/mp/src/public/iclientnetworkable.h b/mp/src/public/iclientnetworkable.h
index 434a276b..6ecb362b 100644
--- a/mp/src/public/iclientnetworkable.h
+++ b/mp/src/public/iclientnetworkable.h
@@ -99,6 +99,8 @@ public:
// Tells the entity that it's about to be destroyed due to the client receiving
// an uncompressed update that's caused it to destroy all entities & recreate them.
virtual void SetDestroyedOnRecreateEntities( void ) = 0;
+
+ virtual void OnDataUnchangedInPVS() = 0;
};
diff --git a/mp/src/public/icvar.h b/mp/src/public/icvar.h
index 369adc58..8eaa48a5 100644
--- a/mp/src/public/icvar.h
+++ b/mp/src/public/icvar.h
@@ -87,9 +87,9 @@ public:
// Install a console printer
virtual void InstallConsoleDisplayFunc( IConsoleDisplayFunc* pDisplayFunc ) = 0;
virtual void RemoveConsoleDisplayFunc( IConsoleDisplayFunc* pDisplayFunc ) = 0;
- virtual void ConsoleColorPrintf( const Color& clr, PRINTF_FORMAT_STRING const char *pFormat, ... ) const = 0;
- virtual void ConsolePrintf( PRINTF_FORMAT_STRING const char *pFormat, ... ) const = 0;
- virtual void ConsoleDPrintf( PRINTF_FORMAT_STRING const char *pFormat, ... ) const = 0;
+ virtual void ConsoleColorPrintf( const Color& clr, PRINTF_FORMAT_STRING const char *pFormat, ... ) const FMTFUNCTION( 3, 4 ) = 0;
+ virtual void ConsolePrintf( PRINTF_FORMAT_STRING const char *pFormat, ... ) const FMTFUNCTION( 2, 3 ) = 0;
+ virtual void ConsoleDPrintf( PRINTF_FORMAT_STRING const char *pFormat, ... ) const FMTFUNCTION( 2, 3 ) = 0;
// Reverts cvars which contain a specific flag
virtual void RevertFlaggedConVars( int nFlag ) = 0;
diff --git a/mp/src/public/istudiorender.h b/mp/src/public/istudiorender.h
index f0af6115..6be93c90 100644
--- a/mp/src/public/istudiorender.h
+++ b/mp/src/public/istudiorender.h
@@ -178,6 +178,16 @@ struct DrawModelResults_t
CUtlVectorFixed<IMaterial *,MAX_DRAW_MODEL_INFO_MATERIALS> m_Materials;
};
+struct ColorTexelsInfo_t
+{
+ int m_nWidth;
+ int m_nHeight;
+ int m_nMipmapCount;
+ ImageFormat m_ImageFormat;
+ int m_nByteCount;
+ byte* m_pTexelData;
+};
+
struct ColorMeshInfo_t
{
// A given color mesh can own a unique Mesh, or it can use a shared Mesh
@@ -186,6 +196,8 @@ struct ColorMeshInfo_t
IPooledVBAllocator * m_pPooledVBAllocator;
int m_nVertOffsetInBytes;
int m_nNumVerts;
+ ITexture * m_pLightmap;
+ ColorTexelsInfo_t * m_pLightmapData;
};
struct DrawModelInfo_t
diff --git a/mp/src/public/materialsystem/hardwaretexels.h b/mp/src/public/materialsystem/hardwaretexels.h
new file mode 100644
index 00000000..0821b41b
--- /dev/null
+++ b/mp/src/public/materialsystem/hardwaretexels.h
@@ -0,0 +1,87 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Hardware Texels
+//
+// Contains texture data that was encoded with the map. The initial use case
+// is for per-texel lightmaps to allow static props to match the lighting
+// of the surrounding BSP geometry.
+//
+//=============================================================================//
+
+#ifndef HARDWARETEXELS_H
+#define HARDWARETEXELS_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "bitmap/imageformat.h"
+#include "datamap.h"
+
+// valve hardware texels
+#define VHT_VERSION 0
+
+namespace HardwareTexels
+{
+#pragma pack(1)
+
+// ------------------------------------------------------------------------------------------------
+struct MeshHeader_t
+{
+ DECLARE_BYTESWAP_DATADESC();
+
+ // this mesh is part of this lod
+ unsigned int m_nLod;
+
+ // starting at this offset
+ unsigned int m_nOffset;
+
+ // this mesh consumes this many bytes
+ unsigned int m_nBytes;
+
+ // with this width and height
+ unsigned int m_nWidth;
+ unsigned int m_nHeight;
+
+ unsigned int m_nUnused[3];
+};
+
+// ------------------------------------------------------------------------------------------------
+struct FileHeader_t
+{
+ DECLARE_BYTESWAP_DATADESC();
+
+ // file version as defined by VHV_VERSION
+ int m_nVersion;
+
+ // must match checkSum in the .mdl header
+ unsigned int m_nChecksum;
+
+ // all texels are encoded in the same format
+ // This is a value from ImageFormat.
+ unsigned int m_nTexelFormat;
+
+ // Number of meshes
+ int m_nMeshes;
+
+ inline MeshHeader_t *pMesh( int nMesh ) const
+ {
+ Assert(nMesh < m_nMeshes);
+
+ return (MeshHeader_t *)(((byte *)this) + sizeof(FileHeader_t)) + nMesh;
+ };
+
+ inline void *pTexelBase( int nMesh ) const
+ {
+ return (void *)((byte *)this + pMesh( nMesh )->m_nOffset);
+ };
+
+ unsigned int m_nUnused[4];
+};
+
+#pragma pack()
+
+}; // end namespace
+
+#endif // HARDWARETEXELS_H
+
diff --git a/mp/src/public/materialsystem/imaterialsystem.h b/mp/src/public/materialsystem/imaterialsystem.h
index 812eb262..3f3563b6 100644
--- a/mp/src/public/materialsystem/imaterialsystem.h
+++ b/mp/src/public/materialsystem/imaterialsystem.h
@@ -1039,6 +1039,10 @@ public:
// returns the display device name that matches the adapter index we were started with
virtual char *GetDisplayDeviceName() const = 0;
+
+ // creates a texture suitable for use with materials from a raw stream of bits.
+ // The bits will be retained by the material system and can be freed upon return.
+ virtual ITexture* CreateTextureFromBits(int w, int h, int mips, ImageFormat fmt, int srcBufferSize, byte* srcBits) = 0;
};
diff --git a/mp/src/public/materialsystem/imesh.h b/mp/src/public/materialsystem/imesh.h
index b71be4d9..3da443b4 100644
--- a/mp/src/public/materialsystem/imesh.h
+++ b/mp/src/public/materialsystem/imesh.h
@@ -3329,6 +3329,8 @@ inline void CMeshBuilder::ComputeNumVertsAndIndices( int *pMaxVertices, int *pMa
break;
default:
+ *pMaxVertices = 0;
+ *pMaxIndices = 0;
Assert(0);
}
diff --git a/mp/src/public/mathlib/mathlib.h b/mp/src/public/mathlib/mathlib.h
index f734ae68..bd6f3027 100644
--- a/mp/src/public/mathlib/mathlib.h
+++ b/mp/src/public/mathlib/mathlib.h
@@ -457,7 +457,7 @@ void inline SinCos( float radians, float *sine, float *cosine )
*sine = sin( radians );
*cosine = cos( radians );
#elif defined( POSIX )
- register double __cosr, __sinr;
+ double __cosr, __sinr;
__asm ("fsincos" : "=t" (__cosr), "=u" (__sinr) : "0" (radians));
*sine = __sinr;
diff --git a/mp/src/public/mathlib/vmatrix.h b/mp/src/public/mathlib/vmatrix.h
index c18e4822..e49a888d 100644
--- a/mp/src/public/mathlib/vmatrix.h
+++ b/mp/src/public/mathlib/vmatrix.h
@@ -107,7 +107,6 @@ public:
void PreTranslate(const Vector &vTrans);
void PostTranslate(const Vector &vTrans);
- matrix3x4_t& As3x4();
const matrix3x4_t& As3x4() const;
void CopyFrom3x4( const matrix3x4_t &m3x4 );
void Set3x4( matrix3x4_t& matrix3x4 ) const;
@@ -630,11 +629,6 @@ inline const matrix3x4_t& VMatrix::As3x4() const
return *((const matrix3x4_t*)this);
}
-inline matrix3x4_t& VMatrix::As3x4()
-{
- return *((matrix3x4_t*)this);
-}
-
inline void VMatrix::CopyFrom3x4( const matrix3x4_t &m3x4 )
{
memcpy( m, m3x4.Base(), sizeof( matrix3x4_t ) );
diff --git a/mp/src/public/p4lib/ip4.h b/mp/src/public/p4lib/ip4.h
index 37a9bab7..d37ab396 100644
--- a/mp/src/public/p4lib/ip4.h
+++ b/mp/src/public/p4lib/ip4.h
@@ -39,6 +39,7 @@ struct P4File_t
CUtlSymbol m_sDepotFile; // the name in the depot
CUtlSymbol m_sClientFile; // the name on the client in Perforce syntax
CUtlSymbol m_sLocalFile; // the name on the client in local syntax
+ CUtlSymbol m_sFileType; // the type according to the server, see p4 help filetypes
int m_iHeadRevision; // head revision number
int m_iHaveRevision; // the revision the clientspec has synced locally
bool m_bDir; // directory
@@ -78,9 +79,7 @@ struct P4Client_t
//-----------------------------------------------------------------------------
// Purpose: Interface to accessing P4 commands
//-----------------------------------------------------------------------------
-#define P4_INTERFACE_VERSION "VP4001"
-// Vitaliy - 09-Feb-'07: if anybody ups the version of this interface, please
-// move the method "SetOpenFileChangeList" into the appropriate section.
+#define P4_INTERFACE_VERSION "VP4002"
abstract_class IP4 : public IAppSystem
{
@@ -116,6 +115,9 @@ public:
// changes the clientspec to remove the specified path (cloaking)
virtual void RemovePathFromActiveClientspec( const char *path ) = 0;
+ // sets the name of the changelist to open files under, NULL for "Default" changelist
+ virtual void SetOpenFileChangeList(const char *pChangeListName) = 0;
+
// file manipulation
virtual bool OpenFileForAdd( const char *pFullPath ) = 0;
virtual bool OpenFileForEdit( const char *pFullPath ) = 0;
@@ -173,15 +175,17 @@ public:
// Returns file information for a single file
virtual bool GetFileInfo( const char *pFullPath, P4File_t *pFileInfo ) = 0;
+ // Reopens a file for edit or add with the specified filetype. To see the valid strings for
+ // filetypes, see p4 help fileinfo. Perforce has to know about files before the filetype can
+ // be changed (so for new files, they must be added first, then the filetype modified).
+ virtual bool SetFileType( const char *pFullPath, const char *pFileType ) = 0;
+
// retreives the list of files in a path, using a known client spec
virtual CUtlVector<P4File_t> &GetFileListUsingClientSpec( const char *pPath, const char *pClientSpec ) = 0;
// retrieves the last error from the last op (which is likely to span multiple lines)
// this is only valid after OpenFile[s]For{Add,Edit,Delete} or {Submit,Revert}File[s]
virtual const char *GetLastError() = 0;
-
- // sets the name of the changelist to open files under, NULL for "Default" changelist
- virtual void SetOpenFileChangeList( const char *pChangeListName ) = 0;
};
diff --git a/mp/src/public/pixelwriter.h b/mp/src/public/pixelwriter.h
index c2d31d67..5c510553 100644
--- a/mp/src/public/pixelwriter.h
+++ b/mp/src/public/pixelwriter.h
@@ -331,6 +331,14 @@ FORCEINLINE_PIXEL void CPixelWriter::SetPixelMemory( ImageFormat format, void* p
format_error_printed[format] = true;
}
m_Size = 0; // set to zero so that we don't stomp memory for formats that we don't understand.
+ m_RShift = 0;
+ m_GShift = 0;
+ m_BShift = 0;
+ m_AShift = 0;
+ m_RMask = 0x00;
+ m_GMask = 0x00;
+ m_BMask = 0x00;
+ m_AMask = 0x00;
}
break;
}
diff --git a/mp/src/public/saverestoretypes.h b/mp/src/public/saverestoretypes.h
index b92a77c7..08a35361 100644
--- a/mp/src/public/saverestoretypes.h
+++ b/mp/src/public/saverestoretypes.h
@@ -514,8 +514,8 @@ inline const char *CSaveRestoreSegment::StringFromSymbol( int token )
#ifndef _WIN32
inline unsigned CSaveRestoreSegment::_rotr ( unsigned val, int shift)
{
- register unsigned lobit; /* non-zero means lo bit set */
- register unsigned num = val; /* number to rotate */
+ unsigned lobit; /* non-zero means lo bit set */
+ unsigned num = val; /* number to rotate */
shift &= 0x1f; /* modulo 32 -- this will also make
negative shifts work */
diff --git a/mp/src/public/sentence.cpp b/mp/src/public/sentence.cpp
index 49c24c3c..1afba9b9 100644
--- a/mp/src/public/sentence.cpp
+++ b/mp/src/public/sentence.cpp
@@ -1678,7 +1678,7 @@ bool CSentence::ShouldSplitWord( char in )
if ( in <= 32 )
return true;
- if ( in >= 128 )
+ if ( (unsigned char)in > SCHAR_MAX )
return true;
if ( ispunct( in ) )
diff --git a/mp/src/public/shaderapi/ishaderdynamic.h b/mp/src/public/shaderapi/ishaderdynamic.h
index 4d1d2d2d..b78942d2 100644
--- a/mp/src/public/shaderapi/ishaderdynamic.h
+++ b/mp/src/public/shaderapi/ishaderdynamic.h
@@ -36,7 +36,8 @@ struct LightState_t
{
int m_nNumLights;
bool m_bAmbientLight;
- bool m_bStaticLight;
+ bool m_bStaticLightVertex;
+ bool m_bStaticLightTexel;
inline int HasDynamicLight() { return (m_bAmbientLight || (m_nNumLights > 0)) ? 1 : 0; }
};
@@ -106,6 +107,9 @@ enum StandardTextureId_t
// A snapshot of the frame buffer's depth. Currently only valid on the 360
TEXTURE_IDENTITY_LIGHTWARP,
+ // Equivalent to the debug material for mat_luxels, in convenient texture form.
+ TEXTURE_DEBUG_LUXELS,
+
TEXTURE_MAX_STD_TEXTURES = 32
};
diff --git a/mp/src/public/shaderlib/BaseShader.h b/mp/src/public/shaderlib/BaseShader.h
index 93a38c4f..6119183d 100644
--- a/mp/src/public/shaderlib/BaseShader.h
+++ b/mp/src/public/shaderlib/BaseShader.h
@@ -168,6 +168,8 @@ public:
void BindTexture( Sampler_t sampler1, ITexture *pTexture, int nFrame = 0 );
void BindTexture( Sampler_t sampler1, Sampler_t sampler2, ITexture *pTexture, int nFrame = 0 );
+ void GetTextureDimensions( float* pOutWidth, float* pOutHeight, int nTextureVar );
+
// Is the texture translucent?
bool TextureIsTranslucent( int textureVar, bool isBaseTexture );
diff --git a/mp/src/public/shaderlib/cshader.h b/mp/src/public/shaderlib/cshader.h
index 868e34c2..9c693638 100644
--- a/mp/src/public/shaderlib/cshader.h
+++ b/mp/src/public/shaderlib/cshader.h
@@ -312,10 +312,12 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// FIXME: There's a compiler bug preventing this from working.
// Maybe it'll work under VC7!
+/*
//#define BEGIN_INHERITED_SHADER( name, _baseclass, help ) \
// namespace _baseclass \
// {\
// __BEGIN_SHADER_INTERNAL( _baseclass::CShader, name, help )
+*/
//#define END_INHERITED_SHADER END_SHADER }
@@ -352,14 +354,14 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// psh ## shader is used here to generate a warning if you don't ever call SET_DYNAMIC_PIXEL_SHADER
#define DECLARE_DYNAMIC_PIXEL_SHADER( shader ) \
int declaredynpixshader_ ## shader ## _missingcurlybraces = 0; \
- declaredynpixshader_ ## shader ## _missingcurlybraces = declaredynpixshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( declaredynpixshader_ ## shader ## _missingcurlybraces ); \
shader ## _Dynamic_Index _pshIndex; \
int psh ## shader = 0
// vsh ## shader is used here to generate a warning if you don't ever call SET_DYNAMIC_VERTEX_SHADER
#define DECLARE_DYNAMIC_VERTEX_SHADER( shader ) \
int declaredynvertshader_ ## shader ## _missingcurlybraces = 0; \
- declaredynvertshader_ ## shader ## _missingcurlybraces = declaredynvertshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( declaredynvertshader_ ## shader ## _missingcurlybraces ); \
shader ## _Dynamic_Index _vshIndex; \
int vsh ## shader = 0
@@ -367,14 +369,14 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// psh ## shader is used here to generate a warning if you don't ever call SET_STATIC_PIXEL_SHADER
#define DECLARE_STATIC_PIXEL_SHADER( shader ) \
int declarestaticpixshader_ ## shader ## _missingcurlybraces = 0; \
- declarestaticpixshader_ ## shader ## _missingcurlybraces = declarestaticpixshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( declarestaticpixshader_ ## shader ## _missingcurlybraces ); \
shader ## _Static_Index _pshIndex; \
int psh ## shader = 0
// vsh ## shader is used here to generate a warning if you don't ever call SET_STATIC_VERTEX_SHADER
#define DECLARE_STATIC_VERTEX_SHADER( shader ) \
int declarestaticvertshader_ ## shader ## _missingcurlybraces = 0; \
- declarestaticvertshader_ ## shader ## _missingcurlybraces = declarestaticvertshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( declarestaticvertshader_ ## shader ## _missingcurlybraces ); \
shader ## _Static_Index _vshIndex; \
int vsh ## shader = 0
@@ -384,7 +386,7 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// in the SET_DYNAMIC_PIXEL_SHADER block.
#define SET_DYNAMIC_PIXEL_SHADER_COMBO( var, val ) \
int dynpixshadercombo_ ## var ## _missingcurlybraces = 0; \
- dynpixshadercombo_ ## var ## _missingcurlybraces = dynpixshadercombo_ ## var ## _missingcurlybraces; \
+ NOTE_UNUSED( dynpixshadercombo_ ## var ## _missingcurlybraces ); \
_pshIndex.Set ## var( ( val ) ); if(g_shaderConfigDumpEnable){printf("\n PS dyn var %s = %d (%s)", #var, (int) val, #val );}; \
int psh_forgot_to_set_dynamic_ ## var = 0
@@ -393,7 +395,7 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// in the SET_DYNAMIC_VERTEX_SHADER block.
#define SET_DYNAMIC_VERTEX_SHADER_COMBO( var, val ) \
int dynvertshadercombo_ ## var ## _missingcurlybraces = 0; \
- dynvertshadercombo_ ## var ## _missingcurlybraces = dynvertshadercombo_ ## var ## _missingcurlybraces; \
+ NOTE_UNUSED( dynvertshadercombo_ ## var ## _missingcurlybraces ); \
_vshIndex.Set ## var( ( val ) ); if(g_shaderConfigDumpEnable){printf("\n VS dyn var %s = %d (%s)", #var, (int) val, #val );}; \
int vsh_forgot_to_set_dynamic_ ## var = 0
@@ -403,7 +405,7 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// in the SET_STATIC_PIXEL_SHADER block.
#define SET_STATIC_PIXEL_SHADER_COMBO( var, val ) \
int staticpixshadercombo_ ## var ## _missingcurlybraces = 0; \
- staticpixshadercombo_ ## var ## _missingcurlybraces = staticpixshadercombo_ ## var ## _missingcurlybraces; \
+ NOTE_UNUSED( staticpixshadercombo_ ## var ## _missingcurlybraces ); \
_pshIndex.Set ## var( ( val ) ); if(g_shaderConfigDumpEnable){printf("\n PS stat var %s = %d (%s)", #var, (int) val, #val );}; \
int psh_forgot_to_set_static_ ## var = 0
@@ -412,7 +414,7 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// in the SET_STATIC_VERTEX_SHADER block.
#define SET_STATIC_VERTEX_SHADER_COMBO( var, val ) \
int staticvertshadercombo_ ## var ## _missingcurlybraces = 0; \
- staticvertshadercombo_ ## var ## _missingcurlybraces = staticvertshadercombo_ ## var ## _missingcurlybraces; \
+ NOTE_UNUSED( staticvertshadercombo_ ## var ## _missingcurlybraces ); \
_vshIndex.Set ## var( ( val ) ); if(g_shaderConfigDumpEnable){printf("\n VS stat var %s = %d (%s)", #var, (int) val, #val );}; \
int vsh_forgot_to_set_static_ ## var = 0
@@ -424,18 +426,18 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// was called for this particular shader.
#define SET_DYNAMIC_PIXEL_SHADER( shader ) \
int dynamicpixshader_ ## shader ## _missingcurlybraces = 0; \
- dynamicpixshader_ ## shader ## _missingcurlybraces = dynamicpixshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( dynamicpixshader_ ## shader ## _missingcurlybraces ); \
int psh_testAllCombos = shaderDynamicTest_ ## shader; \
- psh_testAllCombos = psh_testAllCombos; \
- psh ## shader = psh ## shader; \
+ NOTE_UNUSED( psh_testAllCombos ); \
+ NOTE_UNUSED( psh ## shader ); \
pShaderAPI->SetPixelShaderIndex( _pshIndex.GetIndex() )
#define SET_DYNAMIC_PIXEL_SHADER_CMD( cmdstream, shader ) \
int dynamicpixshader_ ## shader ## _missingcurlybraces = 0; \
- dynamicpixshader_ ## shader ## _missingcurlybraces = dynamicpixshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( dynamicpixshader_ ## shader ## _missingcurlybraces ); \
int psh_testAllCombos = shaderDynamicTest_ ## shader; \
- psh_testAllCombos = psh_testAllCombos; \
- psh ## shader = psh ## shader; \
+ NOTE_UNUSED( psh_testAllCombos ); \
+ NOTE_UNUSED( psh ## shader ); \
cmdstream.SetPixelShaderIndex( _pshIndex.GetIndex() )
@@ -446,18 +448,18 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// was called for this particular shader.
#define SET_DYNAMIC_VERTEX_SHADER( shader ) \
int dynamicvertshader_ ## shader ## _missingcurlybraces = 0; \
- dynamicvertshader_ ## shader ## _missingcurlybraces = dynamicvertshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( dynamicvertshader_ ## shader ## _missingcurlybraces ); \
int vsh_testAllCombos = shaderDynamicTest_ ## shader; \
- vsh_testAllCombos = vsh_testAllCombos; \
- vsh ## shader = vsh ## shader; \
+ NOTE_UNUSED( vsh_testAllCombos ); \
+ NOTE_UNUSED( vsh ## shader ); \
pShaderAPI->SetVertexShaderIndex( _vshIndex.GetIndex() )
#define SET_DYNAMIC_VERTEX_SHADER_CMD( cmdstream, shader ) \
int dynamicvertshader_ ## shader ## _missingcurlybraces = 0; \
- dynamicvertshader_ ## shader ## _missingcurlybraces = dynamicvertshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( dynamicvertshader_ ## shader ## _missingcurlybraces ); \
int vsh_testAllCombos = shaderDynamicTest_ ## shader; \
- vsh_testAllCombos = vsh_testAllCombos; \
- vsh ## shader = vsh ## shader; \
+ NOTE_UNUSED( vsh_testAllCombos ); \
+ NOTE_UNUSED( vsh ## shader ); \
cmdstream.SetVertexShaderIndex( _vshIndex.GetIndex() )
@@ -468,10 +470,10 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// was called for this particular shader.
#define SET_STATIC_PIXEL_SHADER( shader ) \
int staticpixshader_ ## shader ## _missingcurlybraces = 0; \
- staticpixshader_ ## shader ## _missingcurlybraces = staticpixshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( staticpixshader_ ## shader ## _missingcurlybraces ); \
int psh_testAllCombos = shaderStaticTest_ ## shader; \
- psh_testAllCombos = psh_testAllCombos; \
- psh ## shader = psh ## shader; \
+ NOTE_UNUSED( psh_testAllCombos ); \
+ NOTE_UNUSED( psh ## shader ); \
pShaderShadow->SetPixelShader( #shader, _pshIndex.GetIndex() )
// vsh_testAllCombos adds up all of the vsh_forgot_to_set_static_ ## var's from
@@ -481,10 +483,10 @@ inline bool CShader_IsFlag2Set( IMaterialVar **params, MaterialVarFlags2_t _flag
// was called for this particular shader.
#define SET_STATIC_VERTEX_SHADER( shader ) \
int staticvertshader_ ## shader ## _missingcurlybraces = 0; \
- staticvertshader_ ## shader ## _missingcurlybraces = staticvertshader_ ## shader ## _missingcurlybraces; \
+ NOTE_UNUSED( staticvertshader_ ## shader ## _missingcurlybraces ); \
int vsh_testAllCombos = shaderStaticTest_ ## shader; \
- vsh_testAllCombos = vsh_testAllCombos; \
- vsh ## shader = vsh ## shader; \
+ NOTE_UNUSED( vsh_testAllCombos ); \
+ NOTE_UNUSED( vsh ## shader ); \
pShaderShadow->SetVertexShader( #shader, _vshIndex.GetIndex() )
#endif // CSHADER_H
diff --git a/mp/src/public/sourcevr/isourcevirtualreality.h b/mp/src/public/sourcevr/isourcevirtualreality.h
index 7b88a8b8..e22c6704 100644
--- a/mp/src/public/sourcevr/isourcevirtualreality.h
+++ b/mp/src/public/sourcevr/isourcevirtualreality.h
@@ -167,4 +167,9 @@ inline bool UseVR()
return g_pSourceVR != NULL && g_pSourceVR->ShouldRunInVR();
}
+inline bool ShouldForceVRActive()
+{
+ return g_pSourceVR != NULL && g_pSourceVR->ShouldForceVRMode();
+}
+
#endif // ISOURCEVIRTUALREALITY_H
diff --git a/mp/src/public/steam/isteamapplist.h b/mp/src/public/steam/isteamapplist.h
index b9d71136..e6726c1a 100644
--- a/mp/src/public/steam/isteamapplist.h
+++ b/mp/src/public/steam/isteamapplist.h
@@ -10,8 +10,8 @@
#pragma once
#endif
-#include "steam/isteamclient.h"
-#include "steam/steamtypes.h"
+#include "isteamclient.h"
+#include "steamtypes.h"
//-----------------------------------------------------------------------------
// Purpose: This is a restricted interface that can only be used by previously approved apps,
diff --git a/mp/src/public/steam/isteamclient.h b/mp/src/public/steam/isteamclient.h
index b54ad3dc..44c1df66 100644
--- a/mp/src/public/steam/isteamclient.h
+++ b/mp/src/public/steam/isteamclient.h
@@ -69,7 +69,8 @@ typedef int32 HSteamUser;
#define __cdecl
#endif
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
-
+extern "C" typedef void( *SteamAPI_PostAPIResultInProcess_t )(SteamAPICall_t callHandle, void *, uint32 unCallbackSize, int iCallbackNum);
+extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum );
#if defined( __SNC__ )
#pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor
#endif
@@ -88,6 +89,7 @@ class ISteamNetworking;
class ISteamRemoteStorage;
class ISteamScreenshots;
class ISteamMusic;
+class ISteamMusicRemote;
class ISteamGameServerStats;
class ISteamPS3OverlayRender;
class ISteamHTTP;
@@ -95,6 +97,7 @@ class ISteamUnifiedMessages;
class ISteamController;
class ISteamUGC;
class ISteamAppList;
+class ISteamHTMLSurface;
//-----------------------------------------------------------------------------
// Purpose: Interface to creating a new steam instance, or to
@@ -167,7 +170,6 @@ public:
// user screenshots
virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
-
// this needs to be called every frame to process matchmaking results
// redundant if you're already calling SteamAPI_RunCallbacks()
virtual void RunFrame() = 0;
@@ -208,9 +210,20 @@ public:
// Music Player
virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
+
+ // Music Player Remote
+ virtual ISteamMusicRemote *GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;
+
+ // html page display
+ virtual ISteamHTMLSurface *GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;
+
+ // Helper functions for internal Steam usage
+ virtual void Set_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func ) = 0;
+ virtual void Remove_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func ) = 0;
+ virtual void Set_SteamAPI_CCheckCallbackRegisteredInProcess( SteamAPI_CheckCallbackRegistered_t func ) = 0;
};
-#define STEAMCLIENT_INTERFACE_VERSION "SteamClient014"
+#define STEAMCLIENT_INTERFACE_VERSION "SteamClient016"
//-----------------------------------------------------------------------------
// Purpose: Base values for callback identifiers, each callback must
@@ -229,7 +242,7 @@ enum { k_iSteamAppsCallbacks = 1000 };
enum { k_iSteamUserStatsCallbacks = 1100 };
enum { k_iSteamNetworkingCallbacks = 1200 };
enum { k_iClientRemoteStorageCallbacks = 1300 };
-enum { k_iSteamUserItemsCallbacks = 1400 };
+enum { k_iClientDepotBuilderCallbacks = 1400 };
enum { k_iSteamGameServerItemsCallbacks = 1500 };
enum { k_iClientUtilsCallbacks = 1600 };
enum { k_iSteamGameCoordinatorCallbacks = 1700 };
@@ -256,7 +269,12 @@ enum { k_iClientShortcutsCallbacks = 3700 };
enum { k_iClientRemoteControlManagerCallbacks = 3800 };
enum { k_iSteamAppListCallbacks = 3900 };
enum { k_iSteamMusicCallbacks = 4000 };
-
+enum { k_iSteamMusicRemoteCallbacks = 4100 };
+enum { k_iClientVRCallbacks = 4200 };
+enum { k_iClientReservedCallbacks = 4300 };
+enum { k_iSteamReservedCallbacks = 4400 };
+enum { k_iSteamHTMLSurfaceCallbacks = 4500 };
+enum { k_iClientVideoCallbacks = 4600 };
//-----------------------------------------------------------------------------
// The CALLBACK macros are for client side callback logging enabled with
@@ -368,7 +386,7 @@ struct callbackname : SteamCallback_t { \
END_CALLBACK_INTERNAL_END()
#define END_DEFINE_CALLBACK_8() \
- END_CALLBACK_INTERNAL_BEGIN( 7 ) \
+ END_CALLBACK_INTERNAL_BEGIN( 8 ) \
END_CALLBACK_INTERNAL_SWITCH( 0 ) \
END_CALLBACK_INTERNAL_SWITCH( 1 ) \
END_CALLBACK_INTERNAL_SWITCH( 2 ) \
@@ -380,7 +398,82 @@ struct callbackname : SteamCallback_t { \
END_CALLBACK_INTERNAL_END()
#define END_DEFINE_CALLBACK_9() \
- END_CALLBACK_INTERNAL_BEGIN( 7 ) \
+ END_CALLBACK_INTERNAL_BEGIN( 9 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 0 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 1 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 2 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 3 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 4 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 5 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 6 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 7 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 8 ) \
+ END_CALLBACK_INTERNAL_END()
+
+#define END_DEFINE_CALLBACK_10() \
+ END_CALLBACK_INTERNAL_BEGIN( 10 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 0 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 1 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 2 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 3 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 4 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 5 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 6 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 7 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 8 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 9 ) \
+ END_CALLBACK_INTERNAL_END()
+
+#define END_DEFINE_CALLBACK_11() \
+ END_CALLBACK_INTERNAL_BEGIN( 11 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 0 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 1 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 2 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 3 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 4 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 5 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 6 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 7 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 8 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 9 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 10 ) \
+ END_CALLBACK_INTERNAL_END()
+
+#define END_DEFINE_CALLBACK_12() \
+ END_CALLBACK_INTERNAL_BEGIN( 12 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 0 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 1 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 2 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 3 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 4 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 5 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 6 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 7 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 8 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 9 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 10 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 11 ) \
+ END_CALLBACK_INTERNAL_END()
+
+#define END_DEFINE_CALLBACK_13() \
+ END_CALLBACK_INTERNAL_BEGIN( 13 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 0 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 1 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 2 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 3 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 4 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 5 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 6 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 7 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 8 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 9 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 10 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 11 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 12 ) \
+ END_CALLBACK_INTERNAL_END()
+
+#define END_DEFINE_CALLBACK_14() \
+ END_CALLBACK_INTERNAL_BEGIN( 14 ) \
END_CALLBACK_INTERNAL_SWITCH( 0 ) \
END_CALLBACK_INTERNAL_SWITCH( 1 ) \
END_CALLBACK_INTERNAL_SWITCH( 2 ) \
@@ -390,6 +483,11 @@ struct callbackname : SteamCallback_t { \
END_CALLBACK_INTERNAL_SWITCH( 6 ) \
END_CALLBACK_INTERNAL_SWITCH( 7 ) \
END_CALLBACK_INTERNAL_SWITCH( 8 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 9 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 10 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 11 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 12 ) \
+ END_CALLBACK_INTERNAL_SWITCH( 13 ) \
END_CALLBACK_INTERNAL_END()
#endif // ISTEAMCLIENT_H
diff --git a/mp/src/public/steam/isteamhtmlsurface.h b/mp/src/public/steam/isteamhtmlsurface.h
new file mode 100644
index 00000000..80216fc9
--- /dev/null
+++ b/mp/src/public/steam/isteamhtmlsurface.h
@@ -0,0 +1,476 @@
+//====== Copyright 1996-2013, Valve Corporation, All rights reserved. =======
+//
+// Purpose: interface to display html pages in a texture
+//
+//=============================================================================
+
+#ifndef ISTEAMHTMLSURFACE_H
+#define ISTEAMHTMLSURFACE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "isteamclient.h"
+
+typedef uint32 HHTMLBrowser;
+const uint32 INVALID_HTTMLBROWSER = 0;
+
+//-----------------------------------------------------------------------------
+// Purpose: Functions for displaying HTML pages and interacting with them
+//-----------------------------------------------------------------------------
+class ISteamHTMLSurface
+{
+public:
+ virtual ~ISteamHTMLSurface() {}
+
+ // Must call init and shutdown when starting/ending use of the interface
+ virtual bool Init() = 0;
+ virtual bool Shutdown() = 0;
+
+ // Create a browser object for display of a html page, when creation is complete the call handle
+ // will return a HTML_BrowserReady_t callback for the HHTMLBrowser of your new browser.
+ // The user agent string is a substring to be added to the general user agent string so you can
+ // identify your client on web servers.
+ // The userCSS string lets you apply a CSS style sheet to every displayed page, leave null if
+ // you do not require this functionality.
+ virtual SteamAPICall_t CreateBrowser( const char *pchUserAgent, const char *pchUserCSS ) = 0;
+
+ // Call this when you are done with a html surface, this lets us free the resources being used by it
+ virtual void RemoveBrowser( HHTMLBrowser unBrowserHandle ) = 0;
+
+ // Navigate to this URL, results in a HTML_StartRequest_t as the request commences
+ virtual void LoadURL( HHTMLBrowser unBrowserHandle, const char *pchURL, const char *pchPostData ) = 0;
+
+ // Tells the surface the size in pixels to display the surface
+ virtual void SetSize( HHTMLBrowser unBrowserHandle, uint32 unWidth, uint32 unHeight ) = 0;
+
+ // Stop the load of the current html page
+ virtual void StopLoad( HHTMLBrowser unBrowserHandle ) = 0;
+ // Reload (most likely from local cache) the current page
+ virtual void Reload( HHTMLBrowser unBrowserHandle ) = 0;
+ // navigate back in the page history
+ virtual void GoBack( HHTMLBrowser unBrowserHandle ) = 0;
+ // navigate forward in the page history
+ virtual void GoForward( HHTMLBrowser unBrowserHandle ) = 0;
+
+ // add this header to any url requests from this browser
+ virtual void AddHeader( HHTMLBrowser unBrowserHandle, const char *pchKey, const char *pchValue ) = 0;
+ // run this javascript script in the currently loaded page
+ virtual void ExecuteJavascript( HHTMLBrowser unBrowserHandle, const char *pchScript ) = 0;
+
+ enum EHTMLMouseButton
+ {
+ eHTMLMouseButton_Left = 0,
+ eHTMLMouseButton_Right = 1,
+ eHTMLMouseButton_Middle = 2,
+ };
+
+ // Mouse click and mouse movement commands
+ virtual void MouseUp( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0;
+ virtual void MouseDown( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0;
+ virtual void MouseDoubleClick( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0;
+ // x and y are relative to the HTML bounds
+ virtual void MouseMove( HHTMLBrowser unBrowserHandle, int x, int y ) = 0;
+ // nDelta is pixels of scroll
+ virtual void MouseWheel( HHTMLBrowser unBrowserHandle, int32 nDelta ) = 0;
+
+ enum EMouseCursor
+ {
+ dc_user = 0,
+ dc_none,
+ dc_arrow,
+ dc_ibeam,
+ dc_hourglass,
+ dc_waitarrow,
+ dc_crosshair,
+ dc_up,
+ dc_sizenw,
+ dc_sizese,
+ dc_sizene,
+ dc_sizesw,
+ dc_sizew,
+ dc_sizee,
+ dc_sizen,
+ dc_sizes,
+ dc_sizewe,
+ dc_sizens,
+ dc_sizeall,
+ dc_no,
+ dc_hand,
+ dc_blank, // don't show any custom cursor, just use your default
+ dc_middle_pan,
+ dc_north_pan,
+ dc_north_east_pan,
+ dc_east_pan,
+ dc_south_east_pan,
+ dc_south_pan,
+ dc_south_west_pan,
+ dc_west_pan,
+ dc_north_west_pan,
+ dc_alias,
+ dc_cell,
+ dc_colresize,
+ dc_copycur,
+ dc_verticaltext,
+ dc_rowresize,
+ dc_zoomin,
+ dc_zoomout,
+ dc_help,
+ dc_custom,
+
+ dc_last, // custom cursors start from this value and up
+ };
+
+ enum EHTMLKeyModifiers
+ {
+ eHTMLKeyModifier_None = 0,
+ eHTMLKeyModifier_AltDown = 1 << 0,
+ eHTMLKeyModifier_CrtlDown = 1 << 1,
+ eHTMLKeyModifier_ShiftDown = 1 << 2,
+ };
+
+ // keyboard interactions, native keycode is the virtual key code value from your OS
+ virtual void KeyDown( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0;
+ virtual void KeyUp( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0;
+ // cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press)
+ virtual void KeyChar( HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0;
+
+ // programmatically scroll this many pixels on the page
+ virtual void SetHorizontalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0;
+ virtual void SetVerticalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0;
+
+ // tell the html control if it has key focus currently, controls showing the I-beam cursor in text controls amongst other things
+ virtual void SetKeyFocus( HHTMLBrowser unBrowserHandle, bool bHasKeyFocus ) = 0;
+
+ // open the current pages html code in the local editor of choice, used for debugging
+ virtual void ViewSource( HHTMLBrowser unBrowserHandle ) = 0;
+ // copy the currently selected text on the html page to the local clipboard
+ virtual void CopyToClipboard( HHTMLBrowser unBrowserHandle ) = 0;
+ // paste from the local clipboard to the current html page
+ virtual void PasteFromClipboard( HHTMLBrowser unBrowserHandle ) = 0;
+
+ // find this string in the browser, if bCurrentlyInFind is true then instead cycle to the next matching element
+ virtual void Find( HHTMLBrowser unBrowserHandle, const char *pchSearchStr, bool bCurrentlyInFind, bool bReverse ) = 0;
+ // cancel a currently running find
+ virtual void StopFind( HHTMLBrowser unBrowserHandle ) = 0;
+
+ // return details about the link at position x,y on the current page
+ virtual void GetLinkAtPosition( HHTMLBrowser unBrowserHandle, int x, int y ) = 0;
+
+ // set a webcookie for the hostname in question
+ virtual void SetCookie( const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath = "/", RTime32 nExpires = 0, bool bSecure = false, bool bHTTPOnly = false ) = 0;
+
+ // Zoom the current page by flZoom ( from 0.0 to 4.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care)
+ virtual void SetPageScaleFactor( HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ) = 0;
+
+ // CALLBACKS
+ //
+ // These set of functions are used as responses to callback requests
+ //
+
+ // You MUST call this in response to a HTML_StartRequest_t callback
+ // Set bAllowed to true to allow this navigation, false to cancel it and stay
+ // on the current page. You can use this feature to limit the valid pages
+ // allowed in your HTML surface.
+ virtual void AllowStartRequest( HHTMLBrowser unBrowserHandle, bool bAllowed ) = 0;
+
+ // You MUST call this in response to a HTML_JSAlert_t or HTML_JSConfirm_t callback
+ // Set bResult to true for the OK option of a confirm, use false otherwise
+ virtual void JSDialogResponse( HHTMLBrowser unBrowserHandle, bool bResult ) = 0;
+
+ // You MUST call this in response to a HTML_FileOpenDialog_t callback
+ virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0;
+};
+
+#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_002"
+
+// callbacks
+#if defined( VALVE_CALLBACK_PACK_SMALL )
+#pragma pack( push, 4 )
+#elif defined( VALVE_CALLBACK_PACK_LARGE )
+#pragma pack( push, 8 )
+#else
+#error isteamclient.h must be included
+#endif
+
+
+//-----------------------------------------------------------------------------
+// Purpose: The browser is ready for use
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages
+END_DEFINE_CALLBACK_1()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: the browser has a pending paint
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2)
+CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint
+CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called
+CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture
+CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture
+CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update
+CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update
+CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update
+CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update
+CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered
+CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered
+CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered
+CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages
+END_DEFINE_CALLBACK_12()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: The browser wanted to navigate to a new page
+// NOTE - you MUST call AllowStartRequest in response to this callback
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3)
+CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating
+CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to
+CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top )
+CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request
+CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request
+END_DEFINE_CALLBACK_5()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call)
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4)
+CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface
+END_DEFINE_CALLBACK_1()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: the browser is navigating to a new url
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating
+CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to
+CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request
+CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request
+CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page
+CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page
+END_DEFINE_CALLBACK_6()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: A page is finished loading
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchURL ) //
+CALLBACK_MEMBER( 2, const char *, pchPageTitle ) //
+END_DEFINE_CALLBACK_3()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: a request to load this url in a new tab
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchURL ) //
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: the page has a new title now
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchTitle ) //
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: results from a search
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, uint32, unResults ) //
+CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) //
+END_DEFINE_CALLBACK_3()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: page history status changed on the ability to go backwards and forward
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, bool, bCanGoBack ) //
+CALLBACK_MEMBER( 2, bool, bCanGoForward ) //
+END_DEFINE_CALLBACK_3()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: details on the visibility and size of the horizontal scrollbar
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, uint32, unScrollMax ) //
+CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) //
+CALLBACK_MEMBER( 3, float, flPageScale ) //
+CALLBACK_MEMBER( 4, bool , bVisible ) //
+CALLBACK_MEMBER( 5, uint32, unPageSize ) //
+END_DEFINE_CALLBACK_6()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: details on the visibility and size of the vertical scrollbar
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, uint32, unScrollMax ) //
+CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) //
+CALLBACK_MEMBER( 3, float, flPageScale ) //
+CALLBACK_MEMBER( 4, bool, bVisible ) //
+CALLBACK_MEMBER( 5, uint32, unPageSize ) //
+END_DEFINE_CALLBACK_6()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: response to GetLinkAtPosition call
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, uint32, x ) //
+CALLBACK_MEMBER( 2, uint32, y ) //
+CALLBACK_MEMBER( 3, const char *, pchURL ) //
+CALLBACK_MEMBER( 4, bool, bInput ) //
+CALLBACK_MEMBER( 5, bool, bLiveLink ) //
+END_DEFINE_CALLBACK_6()
+
+
+
+//-----------------------------------------------------------------------------
+// Purpose: show a Javascript alert dialog, call JSDialogResponse
+// when the user dismisses this dialog (or right away to ignore it)
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchMessage ) //
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: show a Javascript confirmation dialog, call JSDialogResponse
+// when the user dismisses this dialog (or right away to ignore it)
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchMessage ) //
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: show a Javascript confirmation dialog, call JSDialogResponse
+// when the user dismisses this dialog (or right away to ignore it)
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchTitle ) //
+CALLBACK_MEMBER( 2, const char *, pchInitialFile ) //
+END_DEFINE_CALLBACK_3()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: a popup item (i.e combo box) on the page needs rendering
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_ComboNeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 17 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called
+CALLBACK_MEMBER( 2, uint32, unWide ) // the total width of the pBGRA texture
+CALLBACK_MEMBER( 3, uint32, unTall ) // the total height of the pBGRA texture
+END_DEFINE_CALLBACK_4()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: a popup (i.e combo box) wants to display
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_ShowPopup_t, k_iSteamHTMLSurfaceCallbacks + 18 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+END_DEFINE_CALLBACK_1()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: a popup (i.e combo box) wants to hide
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_HidePopup_t, k_iSteamHTMLSurfaceCallbacks + 19 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+END_DEFINE_CALLBACK_1()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: a popup (i.e combo box) wants to hide
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_SizePopup_t, k_iSteamHTMLSurfaceCallbacks + 20 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, uint32, unX ) // the x pos into the page to display the popup
+CALLBACK_MEMBER( 2, uint32, unY ) // the y pos into the page to display the popup
+CALLBACK_MEMBER( 3, uint32, unWide ) // the total width of the pBGRA texture
+CALLBACK_MEMBER( 4, uint32, unTall ) // the total height of the pBGRA texture
+END_DEFINE_CALLBACK_5()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: a new html window has been created
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load
+CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup
+CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup
+CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture
+CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture
+END_DEFINE_CALLBACK_6()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: change the cursor to display
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EMouseCursor to display
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: informational message from the browser
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: show a tooltip
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: update the text of an existing tooltip
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display
+END_DEFINE_CALLBACK_2()
+
+
+//-----------------------------------------------------------------------------
+// Purpose: hide the tooltip you are showing
+//-----------------------------------------------------------------------------
+DEFINE_CALLBACK( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 )
+CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface
+END_DEFINE_CALLBACK_1()
+
+
+#pragma pack( pop )
+
+
+#endif // ISTEAMHTMLSURFACE_H
diff --git a/mp/src/public/steam/isteammatchmaking.h b/mp/src/public/steam/isteammatchmaking.h
index ca381b81..d6380076 100644
--- a/mp/src/public/steam/isteammatchmaking.h
+++ b/mp/src/public/steam/isteammatchmaking.h
@@ -71,7 +71,7 @@ public:
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
// adds the game server to the local list; updates the time played of the server if it already exists in the list
- virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
+ virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) = 0;
// removes the game server from the local storage; returns true if one was removed
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
diff --git a/mp/src/public/steam/isteammusic.h b/mp/src/public/steam/isteammusic.h
index 23f0b85c..779a4c2e 100644
--- a/mp/src/public/steam/isteammusic.h
+++ b/mp/src/public/steam/isteammusic.h
@@ -6,7 +6,7 @@
#pragma once
#endif
-#include "steam/isteamclient.h"
+#include "isteamclient.h"
//-----------------------------------------------------------------------------
// Purpose:
diff --git a/mp/src/public/steam/isteammusicremote.h b/mp/src/public/steam/isteammusicremote.h
new file mode 100644
index 00000000..fe083da5
--- /dev/null
+++ b/mp/src/public/steam/isteammusicremote.h
@@ -0,0 +1,126 @@
+//============ Copyright (c) Valve Corporation, All rights reserved. ============
+
+#ifndef ISTEAMMUSICREMOTE_H
+#define ISTEAMMUSICREMOTE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "isteamclient.h"
+#include "isteammusic.h"
+
+#define k_SteamMusicNameMaxLength 255
+#define k_SteamMusicPNGMaxLength 65535
+
+
+class ISteamMusicRemote
+{
+public:
+ // Service Definition
+ virtual bool RegisterSteamMusicRemote( const char *pchName ) = 0;
+ virtual bool DeregisterSteamMusicRemote() = 0;
+ virtual bool BIsCurrentMusicRemote() = 0;
+ virtual bool BActivationSuccess( bool bValue ) = 0;
+
+ virtual bool SetDisplayName( const char *pchDisplayName ) = 0;
+ virtual bool SetPNGIcon_64x64( void *pvBuffer, uint32 cbBufferLength ) = 0;
+
+ // Abilities for the user interface
+ virtual bool EnablePlayPrevious(bool bValue) = 0;
+ virtual bool EnablePlayNext( bool bValue ) = 0;
+ virtual bool EnableShuffled( bool bValue ) = 0;
+ virtual bool EnableLooped( bool bValue ) = 0;
+ virtual bool EnableQueue( bool bValue ) = 0;
+ virtual bool EnablePlaylists( bool bValue ) = 0;
+
+ // Status
+ virtual bool UpdatePlaybackStatus( AudioPlayback_Status nStatus ) = 0;
+ virtual bool UpdateShuffled( bool bValue ) = 0;
+ virtual bool UpdateLooped( bool bValue ) = 0;
+ virtual bool UpdateVolume( float flValue ) = 0; // volume is between 0.0 and 1.0
+
+ // Current Entry
+ virtual bool CurrentEntryWillChange() = 0;
+ virtual bool CurrentEntryIsAvailable( bool bAvailable ) = 0;
+ virtual bool UpdateCurrentEntryText( const char *pchText ) = 0;
+ virtual bool UpdateCurrentEntryElapsedSeconds( int nValue ) = 0;
+ virtual bool UpdateCurrentEntryCoverArt( void *pvBuffer, uint32 cbBufferLength ) = 0;
+ virtual bool CurrentEntryDidChange() = 0;
+
+ // Queue
+ virtual bool QueueWillChange() = 0;
+ virtual bool ResetQueueEntries() = 0;
+ virtual bool SetQueueEntry( int nID, int nPosition, const char *pchEntryText ) = 0;
+ virtual bool SetCurrentQueueEntry( int nID ) = 0;
+ virtual bool QueueDidChange() = 0;
+
+ // Playlist
+ virtual bool PlaylistWillChange() = 0;
+ virtual bool ResetPlaylistEntries() = 0;
+ virtual bool SetPlaylistEntry( int nID, int nPosition, const char *pchEntryText ) = 0;
+ virtual bool SetCurrentPlaylistEntry( int nID ) = 0;
+ virtual bool PlaylistDidChange() = 0;
+};
+
+#define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001"
+
+// callbacks
+#if defined( VALVE_CALLBACK_PACK_SMALL )
+#pragma pack( push, 4 )
+#elif defined( VALVE_CALLBACK_PACK_LARGE )
+#pragma pack( push, 8 )
+#else
+#error isteamclient.h must be included
+#endif
+
+
+DEFINE_CALLBACK( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1)
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 )
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 )
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 )
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 )
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 )
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 )
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 )
+END_DEFINE_CALLBACK_0()
+
+DEFINE_CALLBACK( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 )
+ CALLBACK_MEMBER( 0, bool, m_bShuffled )
+END_DEFINE_CALLBACK_1()
+
+DEFINE_CALLBACK( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 )
+ CALLBACK_MEMBER(0, bool, m_bLooped )
+END_DEFINE_CALLBACK_1()
+
+DEFINE_CALLBACK( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 )
+ CALLBACK_MEMBER(0, float, m_flNewVolume)
+END_DEFINE_CALLBACK_1()
+
+DEFINE_CALLBACK( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 )
+ CALLBACK_MEMBER(0, int, nID )
+END_DEFINE_CALLBACK_1()
+
+DEFINE_CALLBACK( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 )
+ CALLBACK_MEMBER(0, int, nID )
+END_DEFINE_CALLBACK_1()
+
+
+#pragma pack( pop )
+
+
+
+#endif // #define ISTEAMMUSICREMOTE_H
diff --git a/mp/src/public/steam/isteamremotestorage.h b/mp/src/public/steam/isteamremotestorage.h
index ed5aa526..c5a005f3 100644
--- a/mp/src/public/steam/isteamremotestorage.h
+++ b/mp/src/public/steam/isteamremotestorage.h
@@ -102,9 +102,10 @@ enum EWorkshopFileType
k_EWorkshopFileTypeMerch = 11,
k_EWorkshopFileTypeControllerBinding = 12,
k_EWorkshopFileTypeSteamworksAccessInvite = 13,
+ k_EWorkshopFileTypeSteamVideo = 14,
- // Update k_EWorkshopFileTypeMax if you add values
- k_EWorkshopFileTypeMax = 14
+ // Update k_EWorkshopFileTypeMax if you add values.
+ k_EWorkshopFileTypeMax = 15
};
@@ -138,10 +139,6 @@ enum EWorkshopVideoProvider
k_EWorkshopVideoProviderYoutube = 1
};
-enum
-{
- k_WorkshopForceLoadPublishedFileDetailsFromCache = -1
-};
enum EUGCReadAction
{
diff --git a/mp/src/public/steam/isteamugc.h b/mp/src/public/steam/isteamugc.h
index ceee8f75..4bab58d6 100644
--- a/mp/src/public/steam/isteamugc.h
+++ b/mp/src/public/steam/isteamugc.h
@@ -91,6 +91,16 @@ enum EUGCQuery
k_EUGCQuery_RankedByTextSearch = 11,
};
+enum EItemUpdateStatus
+{
+ k_EItemUpdateStatusInvalid = 0, // The item update handle was invalid, job might be finished, listen too SubmitItemUpdateResult_t
+ k_EItemUpdateStatusPreparingConfig = 1, // The item update is processing configuration data
+ k_EItemUpdateStatusPreparingContent = 2, // The item update is reading and processing content files
+ k_EItemUpdateStatusUploadingContent = 3, // The item update is uploading content changes to Steam
+ k_EItemUpdateStatusUploadingPreviewFile = 4, // The item update is uploading new preview file image
+ k_EItemUpdateStatusCommittingChanges = 5 // The item update is committing all changes
+};
+
const uint32 kNumUGCResultsPerPage = 50;
@@ -124,6 +134,7 @@ struct SteamUGCDetails_t
uint32 m_unVotesUp; // number of votes up
uint32 m_unVotesDown; // number of votes down
float m_flScore; // calculated score
+ uint32 m_unNumChildren; // if m_eFileType == k_EWorkshopFileTypeCollection, then this number will be the number of children contained within the collection
};
//-----------------------------------------------------------------------------
@@ -165,10 +176,35 @@ public:
// Request full details for one piece of UGC
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
-
+
+ // Steam Workshop Creator API
+ virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
+
+ virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate()
+
+ virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item
+ virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item
+ virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item
+ virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item
+ virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder
+ virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file
+
+ virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate()
+ virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0;
+
+ // Steam Workshop Consumer API
+ virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscript to this item, will be installed ASAP
+ virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits
+ virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items
+ virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs
+
+ // Get info about the item on disk. If you are supporting items published through the legacy RemoteStorage APIs then *pbLegacyItem will be set to true
+ // and pchFolder will contain the full path to the file rather than the containing folder.
+ virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, char *pchFolder, uint32 cchFolderSize, bool *pbLegacyItem ) = 0; // returns true if item is installed
+ virtual bool GetItemUpdateInfo( PublishedFileId_t nPublishedFileID, bool *pbNeedsUpdate, bool *pbIsDownloading, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0;
};
-#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION002"
+#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION003"
//-----------------------------------------------------------------------------
// Purpose: Callback for querying UGC
@@ -196,8 +232,37 @@ struct SteamUGCRequestUGCDetailsResult_t
//-----------------------------------------------------------------------------
-// Purpose: k_iClientUGCCallbacks + 3 to k_iClientUGCCallbacks + 6 in use
+// Purpose: result for ISteamUGC::CreateItem()
+//-----------------------------------------------------------------------------
+struct CreateItemResult_t
+{
+ enum { k_iCallback = k_iClientUGCCallbacks + 3 };
+ EResult m_eResult;
+ PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID
+ bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
+};
+
+
+//-----------------------------------------------------------------------------
+// Purpose: result for ISteamUGC::SubmitItemUpdate()
//-----------------------------------------------------------------------------
+struct SubmitItemUpdateResult_t
+{
+ enum { k_iCallback = k_iClientUGCCallbacks + 4 };
+ EResult m_eResult;
+ bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
+};
+
+
+//-----------------------------------------------------------------------------
+// Purpose: a new Workshop item has been installed
+//-----------------------------------------------------------------------------
+struct ItemInstalled_t
+{
+ enum { k_iCallback = k_iClientUGCCallbacks + 5 };
+ AppId_t m_unAppID;
+ PublishedFileId_t m_nPublishedFileId;
+};
#pragma pack( pop )
diff --git a/mp/src/public/steam/steam_api.h b/mp/src/public/steam/steam_api.h
index d1ebd2c2..9850cd7b 100644
--- a/mp/src/public/steam/steam_api.h
+++ b/mp/src/public/steam/steam_api.h
@@ -21,11 +21,13 @@
#include "isteamremotestorage.h"
#include "isteamscreenshots.h"
#include "isteammusic.h"
+#include "isteammusicremote.h"
#include "isteamhttp.h"
#include "isteamunifiedmessages.h"
#include "isteamcontroller.h"
#include "isteamugc.h"
#include "isteamapplist.h"
+#include "isteamhtmlsurface.h"
#if defined( _PS3 )
#include "steamps3params.h"
@@ -124,6 +126,8 @@ S_API ISteamController *S_CALLTYPE SteamController();
S_API ISteamUGC *S_CALLTYPE SteamUGC();
S_API ISteamAppList *S_CALLTYPE SteamAppList();
S_API ISteamMusic *S_CALLTYPE SteamMusic();
+S_API ISteamMusicRemote *S_CALLTYPE SteamMusicRemote();
+S_API ISteamHTMLSurface *S_CALLTYPE SteamHTMLSurface();
#ifdef _PS3
S_API ISteamPS3OverlayRender *S_CALLTYPE SteamPS3OverlayRender();
#endif
@@ -408,6 +412,8 @@ public:
ISteamUGC* SteamUGC() { return m_pSteamUGC; }
ISteamAppList* SteamAppList() { return m_pSteamAppList; }
ISteamMusic* SteamMusic() { return m_pSteamMusic; }
+ ISteamMusicRemote* SteamMusicRemote() { return m_pSteamMusicRemote; }
+ ISteamHTMLSurface* SteamHTMLSurface() { return m_pSteamHTMLSurface; }
#ifdef _PS3
ISteamPS3OverlayRender* SteamPS3OverlayRender() { return m_pSteamPS3OverlayRender; }
#endif
@@ -429,6 +435,8 @@ private:
ISteamUGC *m_pSteamUGC;
ISteamAppList *m_pSteamAppList;
ISteamMusic *m_pSteamMusic;
+ ISteamMusicRemote *m_pSteamMusicRemote;
+ ISteamHTMLSurface *m_pSteamHTMLSurface;
#ifdef _PS3
ISteamPS3OverlayRender *m_pSteamPS3OverlayRender;
#endif
@@ -457,6 +465,9 @@ inline void CSteamAPIContext::Clear()
m_pController = NULL;
m_pSteamUGC = NULL;
m_pSteamAppList = NULL;
+ m_pSteamMusic = NULL;
+ m_pSteamMusicRemote= NULL;
+ m_pSteamHTMLSurface = NULL;
#ifdef _PS3
m_pSteamPS3OverlayRender = NULL;
#endif
@@ -536,7 +547,19 @@ inline bool CSteamAPIContext::Init()
{
return false;
}
-
+
+ m_pSteamMusicRemote = SteamClient()->GetISteamMusicRemote( hSteamUser, hSteamPipe, STEAMMUSICREMOTE_INTERFACE_VERSION );
+ if ( !m_pSteamMusicRemote )
+ {
+ return false;
+ }
+
+ m_pSteamHTMLSurface = SteamClient()->GetISteamHTMLSurface( hSteamUser, hSteamPipe, STEAMHTMLSURFACE_INTERFACE_VERSION );
+ if ( !m_pSteamHTMLSurface )
+ {
+ return false;
+ }
+
#ifdef _PS3
m_pSteamPS3OverlayRender = SteamClient()->GetISteamPS3OverlayRender();
#endif
diff --git a/mp/src/public/steam/steam_gameserver.h b/mp/src/public/steam/steam_gameserver.h
index e031e313..98e26a72 100644
--- a/mp/src/public/steam/steam_gameserver.h
+++ b/mp/src/public/steam/steam_gameserver.h
@@ -1,4 +1,4 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
+//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. =======
//
// Purpose:
//
@@ -151,7 +151,7 @@ inline bool CSteamGameServerAPIContext::Init()
return false;
m_pSteamHTTP = g_pSteamClientGameServer->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION );
- if ( !m_pSteamGameServerStats )
+ if ( !m_pSteamHTTP )
return false;
return true;
diff --git a/mp/src/public/steam/steamclientpublic.h b/mp/src/public/steam/steamclientpublic.h
index 62eddb76..f5998599 100644
--- a/mp/src/public/steam/steamclientpublic.h
+++ b/mp/src/public/steam/steamclientpublic.h
@@ -109,6 +109,11 @@ enum EResult
k_EResultRestrictedDevice = 82, // The device being used is not allowed to perform this action
k_EResultRegionLocked = 83, // The action could not be complete because it is region restricted
k_EResultRateLimitExceeded = 84, // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent
+ k_EResultAccountLoginDeniedNeedTwoFactor = 85, // Need two-factor code to login
+ k_EResultItemDeleted = 86, // The thing we're trying to access has been deleted
+ k_EResultAccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker
+ k_EResultTwoFactorCodeMismatch = 88, // two factor code mismatch
+ k_EResultTwoFactorActivationCodeMismatch = 89, // activation code for two-factor didn't match
};
// Error codes for use with the voice functions
@@ -173,6 +178,7 @@ typedef enum
k_EAuthSessionResponseAuthTicketCanceled = 6, // The ticket has been canceled by the issuer
k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid.
k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam.
+ k_EAuthSessionResponsePublisherIssuedBan = 9, // The user is banned for this game. The ban came via the web api and not VAC
} EAuthSessionResponse;
// results from UserHasLicenseForApp
@@ -223,19 +229,21 @@ enum EAppReleaseState
//-----------------------------------------------------------------------------
enum EAppOwnershipFlags
{
- k_EAppOwnershipFlags_None = 0x000, // unknown
- k_EAppOwnershipFlags_OwnsLicense = 0x001, // owns license for this game
- k_EAppOwnershipFlags_FreeLicense = 0x002, // not paid for game
- k_EAppOwnershipFlags_RegionRestricted = 0x004, // owns app, but not allowed to play in current region
- k_EAppOwnershipFlags_LowViolence = 0x008, // only low violence version
- k_EAppOwnershipFlags_InvalidPlatform = 0x010, // app not supported on current platform
- k_EAppOwnershipFlags_SharedLicense = 0x020, // license was granted by authorized local device
- k_EAppOwnershipFlags_FreeWeekend = 0x040, // owned by a free weekend licenses
- k_EAppOwnershipFlags_LicenseLocked = 0x080, // shared license is locked (in use) by other user
- k_EAppOwnershipFlags_LicensePending = 0x100, // owns app, but transaction is still pending. Can't install or play
- k_EAppOwnershipFlags_LicenseExpired = 0x200, // doesn't own app anymore since license expired
- k_EAppOwnershipFlags_LicensePermanent = 0x400, // permanent license, not borrowed, or guest or freeweekend etc
- k_EAppOwnershipFlags_LicenseRecurring = 0x800, // Recurring license, user is charged periodically
+ k_EAppOwnershipFlags_None = 0x0000, // unknown
+ k_EAppOwnershipFlags_OwnsLicense = 0x0001, // owns license for this game
+ k_EAppOwnershipFlags_FreeLicense = 0x0002, // not paid for game
+ k_EAppOwnershipFlags_RegionRestricted = 0x0004, // owns app, but not allowed to play in current region
+ k_EAppOwnershipFlags_LowViolence = 0x0008, // only low violence version
+ k_EAppOwnershipFlags_InvalidPlatform = 0x0010, // app not supported on current platform
+ k_EAppOwnershipFlags_SharedLicense = 0x0020, // license was granted by authorized local device
+ k_EAppOwnershipFlags_FreeWeekend = 0x0040, // owned by a free weekend licenses
+ k_EAppOwnershipFlags_RetailLicense = 0x0080, // has a retail license for game, (CD-Key etc)
+ k_EAppOwnershipFlags_LicenseLocked = 0x0100, // shared license is locked (in use) by other user
+ k_EAppOwnershipFlags_LicensePending = 0x0200, // owns app, but transaction is still pending. Can't install or play
+ k_EAppOwnershipFlags_LicenseExpired = 0x0400, // doesn't own app anymore since license expired
+ k_EAppOwnershipFlags_LicensePermanent = 0x0800, // permanent license, not borrowed, or guest or freeweekend etc
+ k_EAppOwnershipFlags_LicenseRecurring = 0x1000, // Recurring license, user is charged periodically
+ k_EAppOwnershipFlags_LicenseCanceled = 0x2000, // Mark as canceled, but might be still active if recurring
};
@@ -249,17 +257,23 @@ enum EAppType
k_EAppType_Application = 0x002, // software application
k_EAppType_Tool = 0x004, // SDKs, editors & dedicated servers
k_EAppType_Demo = 0x008, // game demo
- k_EAppType_Media = 0x010, // media trailer
+ k_EAppType_Media_DEPRECATED = 0x010, // legacy - was used for game trailers, which are now just videos on the web
k_EAppType_DLC = 0x020, // down loadable content
k_EAppType_Guide = 0x040, // game guide, PDF etc
k_EAppType_Driver = 0x080, // hardware driver updater (ATI, Razor etc)
k_EAppType_Config = 0x100, // hidden app used to config Steam features (backpack, sales, etc)
+ k_EAppType_Film = 0x200, // A Movie (feature film)
+ k_EAppType_TVSeries = 0x400, // A TV or other video series which will have episodes and perhaps seasons
+ k_EAppType_Video = 0x800, // A video component of either a Film or TVSeries (may be the feature, an episode, preview, making-of, etc)
+ k_EAppType_Plugin = 0x1000, // Plug-in types for other Apps
+ k_EAppType_Music = 0x2000, // Music files
k_EAppType_Shortcut = 0x40000000, // just a shortcut, client side only
k_EAppType_DepotOnly = 0x80000000, // placeholder since depots and apps share the same namespace
};
+
//-----------------------------------------------------------------------------
// types of user game stats fields
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
@@ -297,7 +311,8 @@ enum EChatEntryType
k_EChatEntryTypeWasBanned = 9, // user was banned (data: 64-bit steamid of actor performing the ban)
k_EChatEntryTypeDisconnected = 10, // user disconnected
k_EChatEntryTypeHistoricalChat = 11, // a chat message from user's chat history or offilne message
-
+ k_EChatEntryTypeReserved1 = 12,
+ k_EChatEntryTypeReserved2 = 13,
};
@@ -323,18 +338,6 @@ enum EChatRoomEnterResponse
};
-//-----------------------------------------------------------------------------
-// Purpose: Status of a given depot version, these are stored in the DB, don't renumber
-//-----------------------------------------------------------------------------
-enum EStatusDepotVersion
-{
- k_EStatusDepotVersionInvalid = 0,
- k_EStatusDepotVersionDisabled = 1, // version was disabled, no manifest & content available
- k_EStatusDepotVersionAvailable = 2, // manifest & content is available, but not current
- k_EStatusDepotVersionCurrent = 3, // current depot version. The can be multiple, one for public and one for each beta key
-};
-
-
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
typedef bool (*PFNLegacyKeyInstalled)();
@@ -532,7 +535,7 @@ public:
}
-#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
+#if defined( INCLUDED_STEAM2_USERID_STRUCTS )
//-----------------------------------------------------------------------------
// Purpose: Initializes a steam ID from a Steam2 ID structure
// Input: pTSteamGlobalUserID - Steam2 ID to convert
@@ -727,9 +730,6 @@ public:
const char * Render() const; // renders this steam ID to string
static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
- const char * RenderLink() const; // renders this steam ID to an admin console link string
- static const char * RenderLink( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
-
void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse );
// SetFromString allows many partially-correct strings, constraining how
// we might be able to change things in the future.
diff --git a/mp/src/public/steam/steamcontrollerpublic.h b/mp/src/public/steam/steamcontrollerpublic.h
index 04493332..327ea46a 100644
--- a/mp/src/public/steam/steamcontrollerpublic.h
+++ b/mp/src/public/steam/steamcontrollerpublic.h
@@ -16,10 +16,13 @@
// isteamcontroller.h.
#include "steamtypes.h"
#else
-// Otherwise, we assume it's a firmware build, which doesn't deal with all the
-// things that exist in steamtypes.h, and hardcode the typedefs we need.
-typedef unsigned int uint32;
-typedef unsigned __int64 uint64;
+#include <stdint.h>
+typedef uint32_t uint32;
+#ifdef __C51__
+typedef uint8_t uint64[8];
+#else
+typedef uint64_t uint64;
+#endif
#endif
#pragma pack(1)
diff --git a/mp/src/public/steam/steamhttpenums.h b/mp/src/public/steam/steamhttpenums.h
index 9ac2eeaf..11a4a03a 100644
--- a/mp/src/public/steam/steamhttpenums.h
+++ b/mp/src/public/steam/steamhttpenums.h
@@ -81,6 +81,7 @@ enum EHTTPStatusCode
k_EHTTPStatusCode415UnsupportedMediaType = 415,
k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416,
k_EHTTPStatusCode417ExpectationFailed = 417,
+ k_EHTTPStatusCode429TooManyRequests = 429,
// Server error codes
k_EHTTPStatusCode500InternalServerError = 500,
diff --git a/mp/src/public/steam/steamtypes.h b/mp/src/public/steam/steamtypes.h
index b26990da..c3320a10 100644
--- a/mp/src/public/steam/steamtypes.h
+++ b/mp/src/public/steam/steamtypes.h
@@ -148,4 +148,10 @@ typedef uint32 AccountID_t;
typedef uint32 PartnerId_t;
const PartnerId_t k_uPartnerIdInvalid = 0;
+// ID for a depot content manifest
+typedef uint64 ManifestId_t;
+const ManifestId_t k_uManifestIdInvalid = 0;
+
+
+
#endif // STEAMTYPES_H
diff --git a/mp/src/public/steam/steamvr.h b/mp/src/public/steam/steamvr.h
index 68a932dd..be62fc86 100644
--- a/mp/src/public/steam/steamvr.h
+++ b/mp/src/public/steam/steamvr.h
@@ -119,6 +119,11 @@ public:
*/
virtual void GetDXGIOutputInfo( int32_t *pnAdapterIndex, int32_t *pnAdapterOutputIndex ) = 0;
+ /** [Windows Only]
+ * Notifies the system that the VR output will appear in a particular window.
+ */
+ virtual void AttachToWindow( void *hWnd ) = 0;
+
// ------------------------------------
// Tracking Methods
// ------------------------------------
@@ -168,7 +173,7 @@ public:
virtual uint32_t GetDisplayId( char *pchBuffer, uint32_t unBufferLen ) = 0;
};
-static const char * const IHmd_Version = "IHmd_004";
+static const char * const IHmd_Version = "IHmd_005";
/** error codes returned by Vr_Init */
enum HmdError
@@ -187,11 +192,16 @@ enum HmdError
HmdError_Init_NotInitialized = 109,
HmdError_Driver_Failed = 200,
+ HmdError_Driver_Unknown = 201,
+ HmdError_Driver_HmdUnknown = 202,
+ HmdError_Driver_NotLoaded = 203,
HmdError_IPC_ServerInitFailed = 300,
HmdError_IPC_ConnectFailed = 301,
HmdError_IPC_SharedStateInitFailed = 302,
+ HmdError_VendorSpecific_UnableToConnectToOculusRuntime = 1000,
+
};
@@ -236,6 +246,15 @@ VR_INTERFACE IHmd *VR_Init( HmdError *peError );
* invalid after this point */
VR_INTERFACE void VR_Shutdown( );
+/** Returns true if there is an HMD attached. This check is as lightweight as possible and
+* can be called outside of VR_Init/VR_Shutdown. It should be used when an application wants
+* to know if initializing VR is a possibility but isn't ready to take that step yet.
+*/
+VR_INTERFACE bool VR_IsHmdPresent();
+
+/** Returns the string version of an HMD error. This function may be called outside of VR_Init()/VR_Shutdown(). */
+VR_INTERFACE const char *VR_GetStringForHmdError( HmdError error );
+
#pragma pack( pop )
diff --git a/mp/src/public/studio.cpp b/mp/src/public/studio.cpp
index 9bf97018..4d84e1d0 100644
--- a/mp/src/public/studio.cpp
+++ b/mp/src/public/studio.cpp
@@ -1673,7 +1673,7 @@ void CStudioHdr::CActivityToSequenceMapping::Initialize( CStudioHdr * __restrict
// Now, create starting indices for each activity. For an activity n,
// the starting index is of course the sum of counts [0..n-1].
- register int sequenceCount = 0;
+ int sequenceCount = 0;
int topActivity = 0; // this will store the highest seen activity number (used later to make an ad hoc map on the stack)
for ( UtlHashHandle_t handle = m_ActToSeqHash.GetFirstHandle() ;
m_ActToSeqHash.IsValidHandle(handle) ;
diff --git a/mp/src/public/tier0/annotations.h b/mp/src/public/tier0/annotations.h
index 25537821..7e0f4698 100644
--- a/mp/src/public/tier0/annotations.h
+++ b/mp/src/public/tier0/annotations.h
@@ -48,6 +48,8 @@
#define OUT_Z_ARRAY _Deref_post_z_
#define INOUT_Z_ARRAY _Deref_prepost_z_
#endif // _MSC_VER >= 1700
+// Used for annotating functions to describe their return types.
+#define MUST_CHECK_RETURN _Check_return_
// Use the macros above to annotate string functions that fill buffers as shown here,
// in order to give VS's /analyze more opportunities to find bugs.
// void V_wcsncpy( OUT_Z_BYTECAP(maxLenInBytes) wchar_t *pDest, wchar_t const *pSrc, int maxLenInBytes );
@@ -76,6 +78,7 @@
#define INOUT_Z_BYTECAP(x)
#define OUT_Z_ARRAY
#define INOUT_Z_ARRAY
+#define MUST_CHECK_RETURN
#endif
#endif // ANALYSIS_ANNOTATIONS_H
diff --git a/mp/src/public/tier0/cpumonitoring.h b/mp/src/public/tier0/cpumonitoring.h
new file mode 100644
index 00000000..e6d1c9cd
--- /dev/null
+++ b/mp/src/public/tier0/cpumonitoring.h
@@ -0,0 +1,33 @@
+#ifndef CPU_MONITORING_H
+#define CPU_MONITORING_H
+
+/*
+This header defines functions and structures for controlling the measurement of CPU frequency
+in order to detect thermal throttling. For details see the associated source file.
+*/
+
+struct CPUFrequencyResults
+{
+ double m_timeStamp; // Time (from Plat_FloatTime) when the measurements were made.
+ float m_GHz;
+ float m_percentage;
+ float m_lowestPercentage;
+};
+
+// Call this to get results.
+// When CPU monitoring is 'disabled' it may still be running at a low frequency,
+// for OGS purposes or for proactively warning users of problems. If fGetDisabledResults
+// is true then results will be returned when disabled (if available).
+PLATFORM_INTERFACE CPUFrequencyResults GetCPUFrequencyResults( bool fGetDisabledResults = false );
+
+// Call this to set the monitoring frequency. Intervals of 2-5 seconds (2,000 to 5,000 ms)
+// are recommended. An interval of zero will disable CPU monitoring. Short delays (below
+// about 300 ms) will be rounded up.
+PLATFORM_INTERFACE void SetCPUMonitoringInterval( unsigned nDelayMilliseconds );
+
+// Warn with increasing strident colors when CPU percentages go below these levels.
+// They are const int instead of float because const float in C++ is stupid.
+const int kCPUMonitoringWarning1 = 80;
+const int kCPUMonitoringWarning2 = 50;
+
+#endif
diff --git a/mp/src/public/tier0/dbg.h b/mp/src/public/tier0/dbg.h
index 9fd38d0a..c35e7a67 100644
--- a/mp/src/public/tier0/dbg.h
+++ b/mp/src/public/tier0/dbg.h
@@ -391,6 +391,21 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
#define AssertAlways( _exp ) _AssertMsg( _exp, _T("Assertion Failed: ") _T(#_exp), ((void)0), false )
#define AssertMsgAlways( _exp, _msg ) _AssertMsg( _exp, _msg, ((void)0), false )
+// Stringify a number
+#define V_STRINGIFY_INTERNAL(x) #x
+// Extra level of indirection needed when passing in a macro to avoid getting the macro name instead of value
+#define V_STRINGIFY(x) V_STRINGIFY_INTERNAL(x)
+
+// Macros to help decorate warnings or errors with the location in code
+#define FILE_LINE_FUNCTION_STRING __FILE__ "(" V_STRINGIFY(__LINE__) "):" __FUNCTION__ ":"
+#define FILE_LINE_STRING __FILE__ "(" V_STRINGIFY(__LINE__) "):"
+#define FUNCTION_LINE_STRING __FUNCTION__ "(" V_STRINGIFY(__LINE__) "): "
+
+// Handy define for inserting clickable messages into the build output.
+// Use like this:
+// #pragma MESSAGE("Some message")
+#define MESSAGE(msg) message(__FILE__ "(" V_STRINGIFY(__LINE__) "): " msg)
+
#if !defined( _X360 ) || !defined( _RETAIL )
diff --git a/mp/src/public/tier0/fasttimer.h b/mp/src/public/tier0/fasttimer.h
index 79496a9e..e9e634f3 100644
--- a/mp/src/public/tier0/fasttimer.h
+++ b/mp/src/public/tier0/fasttimer.h
@@ -222,8 +222,6 @@ private:
unsigned m_nIters;
CCycleCount m_Total;
CCycleCount m_Peak;
- bool m_fReport;
- const tchar *m_pszName;
};
// -------------------------------------------------------------------------- //
diff --git a/mp/src/public/tier0/icommandline.h b/mp/src/public/tier0/icommandline.h
index cbe9cb59..9107d697 100644
--- a/mp/src/public/tier0/icommandline.h
+++ b/mp/src/public/tier0/icommandline.h
@@ -40,6 +40,8 @@ public:
// copies the string passwed
virtual void SetParm( int nIndex, char const *pNewParm ) =0;
+
+ virtual const char *ParmValueByIndex( int nIndex, const char *pDefaultVal = 0 ) const = 0;
};
//-----------------------------------------------------------------------------
diff --git a/mp/src/public/tier0/memoverride.cpp b/mp/src/public/tier0/memoverride.cpp
index 5c679e45..bec06c0e 100644
--- a/mp/src/public/tier0/memoverride.cpp
+++ b/mp/src/public/tier0/memoverride.cpp
@@ -1143,7 +1143,6 @@ _TSCHAR * __cdecl _ttempnam ( const _TSCHAR *dir, const _TSCHAR *pfx )
Assert(0);
return 0;
}
-#endif
wchar_t * __cdecl _wcsdup_dbg ( const wchar_t * string, int nBlockUse, const char * szFileName, int nLine )
{
@@ -1156,7 +1155,7 @@ wchar_t * __cdecl _wcsdup ( const wchar_t * string )
Assert(0);
return 0;
}
-
+#endif
} // end extern "C"
#if _MSC_VER >= 1400
diff --git a/mp/src/public/tier0/platform.h b/mp/src/public/tier0/platform.h
index 0e5a3428..389ab5b8 100644
--- a/mp/src/public/tier0/platform.h
+++ b/mp/src/public/tier0/platform.h
@@ -230,7 +230,11 @@ typedef unsigned int uint;
// Ensure that everybody has the right compiler version installed. The version
// number can be obtained by looking at the compiler output when you type 'cl'
// and removing the last two digits and the periods: 16.00.40219.01 becomes 160040219
-#if _MSC_FULL_VER > 160000000
+#if _MSC_FULL_VER > 180000000
+ #if _MSC_FULL_VER < 180030723
+ #error You must install VS 2013 Update 3
+ #endif
+#elif _MSC_FULL_VER > 160000000
#if _MSC_FULL_VER < 160040219
#error You must install VS 2010 SP1
#endif
@@ -397,6 +401,12 @@ typedef void * HINSTANCE;
#endif
#define DebuggerBreakIfDebugging() if ( !Plat_IsInDebugSession() ) ; else DebuggerBreak()
+#ifdef STAGING_ONLY
+#define DebuggerBreakIfDebugging_StagingOnly() if ( !Plat_IsInDebugSession() ) ; else DebuggerBreak()
+#else
+#define DebuggerBreakIfDebugging_StagingOnly()
+#endif
+
// C functions for external declarations that call the appropriate C++ methods
#ifndef EXPORT
#ifdef _WIN32
@@ -1086,7 +1096,6 @@ PLATFORM_INTERFACE bool Plat_IsInBenchmarkMode();
PLATFORM_INTERFACE double Plat_FloatTime(); // Returns time in seconds since the module was loaded.
PLATFORM_INTERFACE unsigned int Plat_MSTime(); // Time in milliseconds.
-PLATFORM_INTERFACE char * Plat_asctime( const struct tm *tm, char *buf );
PLATFORM_INTERFACE char * Plat_ctime( const time_t *timep, char *buf, size_t bufsize );
PLATFORM_INTERFACE struct tm * Plat_gmtime( const time_t *timep, struct tm *result );
PLATFORM_INTERFACE time_t Plat_timegm( struct tm *timeptr );
@@ -1140,7 +1149,7 @@ inline uint64 Plat_Rdtsc()
memcpy( this, &src, sizeof(_classname) ); \
return *this; \
}
-
+
// Processor Information:
struct CPUInformation
{
@@ -1244,7 +1253,7 @@ PLATFORM_INTERFACE void* Plat_SimpleLog( const tchar* file, int line );
// Returns true if debugger attached, false otherwise
//-----------------------------------------------------------------------------
#if defined(_WIN32) || defined(LINUX) || defined(OSX)
-PLATFORM_INTERFACE bool Plat_IsInDebugSession( bool bForceRecheck = false );
+PLATFORM_INTERFACE bool Plat_IsInDebugSession();
PLATFORM_INTERFACE void Plat_DebugString( const char * );
#else
inline bool Plat_IsInDebugSession( bool bForceRecheck = false ) { return false; }
@@ -1560,6 +1569,20 @@ private:
#endif
+// Watchdog timer support. Call Plat_BeginWatchdogTimer( nn ) to kick the timer off. if you don't call
+// Plat_EndWatchdogTimer within nn seconds, the program will kick off an exception. This is for making
+// sure that hung dedicated servers abort (and restart) instead of staying hung. Calling
+// Plat_EndWatchdogTimer more than once or when there is no active watchdog is fine. Only does anything
+// under linux right now. It should be possible to implement this functionality in windows via a
+// thread, if desired.
+PLATFORM_INTERFACE void Plat_BeginWatchdogTimer( int nSecs );
+PLATFORM_INTERFACE void Plat_EndWatchdogTimer( void );
+PLATFORM_INTERFACE int Plat_GetWatchdogTime( void );
+
+typedef void (*Plat_WatchDogHandlerFunction_t)(void);
+PLATFORM_INTERFACE void Plat_SetWatchdogHandlerFunction( Plat_WatchDogHandlerFunction_t function );
+
+
//-----------------------------------------------------------------------------
#include "tier0/valve_on.h"
diff --git a/mp/src/public/tier0/threadtools.h b/mp/src/public/tier0/threadtools.h
index 12ea369a..7a69f0c6 100644
--- a/mp/src/public/tier0/threadtools.h
+++ b/mp/src/public/tier0/threadtools.h
@@ -346,7 +346,7 @@ template <class T = intp>
COMPILE_TIME_ASSERT( sizeof(T) >= sizeof(int) );
}
- operator const int() const { return (int)this->Get(); }
+ operator int() const { return (int)this->Get(); }
int operator=( int i ) { this->Set( (intp)i ); return i; }
int operator++() { T i = this->Get(); this->Set( ++i ); return (int)i; }
@@ -1227,9 +1227,9 @@ protected:
CThreadMutex m_Lock;
#ifdef WIN32
- const ThreadHandle_t GetThreadID() const { return (ThreadHandle_t)m_hThread; }
+ ThreadHandle_t GetThreadID() const { return (ThreadHandle_t)m_hThread; }
#else
- const ThreadId_t GetThreadID() const { return (ThreadId_t)m_threadId; }
+ ThreadId_t GetThreadID() const { return (ThreadId_t)m_threadId; }
#endif
private:
diff --git a/mp/src/public/tier0/tmapi_dummy.h b/mp/src/public/tier0/tmapi_dummy.h
index f50a039a..8a6aebcb 100644
--- a/mp/src/public/tier0/tmapi_dummy.h
+++ b/mp/src/public/tier0/tmapi_dummy.h
@@ -30,11 +30,17 @@
#define tmEnterEx(...)
#define tmZone(...)
#define tmZoneFiltered(...)
+#define tmLeave(...)
#define tmLeaveEx(...)
#define tmBeginTimeSpan(...)
#define tmEndTimeSpan(...)
+#define tmBeginTimeSpanAt(...)
+#define tmEndTimeSpanAt(...)
+
+#define tmDynamicString(...) ""
+
#define tmEmitAccumulationZone(...)
#define tmGetStati(...) 0
diff --git a/mp/src/public/tier0/vprof.h b/mp/src/public/tier0/vprof.h
index 2e60e17f..9464e4ad 100644
--- a/mp/src/public/tier0/vprof.h
+++ b/mp/src/public/tier0/vprof.h
@@ -135,10 +135,10 @@
#define VPROF_BUDGETGROUP_JOBS_COROUTINES _T("Jobs/Coroutines")
#define VPROF_BUDGETGROUP_SLEEPING _T("Sleeping")
#define VPROF_BUDGETGROUP_THREADINGMAIN _T("ThreadingMain")
-#define VPROF_BUDGETGROUP_CHROMEHTML _T("Chromehtml")
-#define VPROF_BUDGETGROUP_VGUI VPROF_BUDGETGROUP_CHROMEHTML
-#define VPROF_BUDGETGROUP_TENFOOT VPROF_BUDGETGROUP_CHROMEHTML
-#define VPROF_BUDGETGROUP_STEAMUI VPROF_BUDGETGROUP_CHROMEHTML
+#define VPROF_BUDGETGROUP_HTMLSURFACE _T("HTMLSurface")
+#define VPROF_BUDGETGROUP_VGUI VPROF_BUDGETGROUP_HTMLSURFACE
+#define VPROF_BUDGETGROUP_TENFOOT VPROF_BUDGETGROUP_HTMLSURFACE
+#define VPROF_BUDGETGROUP_STEAMUI VPROF_BUDGETGROUP_HTMLSURFACE
#define VPROF_BUDGETGROUP_ATTRIBUTES _T("Attributes")
#ifdef _X360
@@ -161,28 +161,28 @@
#define VPROF_VAR_NAME_INTERNAL( a, b ) VPROF_VAR_NAME_INTERNAL_CAT( a, b )
#define VPROF_VAR_NAME( a ) VPROF_VAR_NAME_INTERNAL( a, __LINE__ )
-#define VPROF_0(name,group,assertAccounted,budgetFlags) TM_ZONE( TELEMETRY_LEVEL2, TMZF_NONE, "(%s)%s", group, name ); CVProfScope VPROF_VAR_NAME( VProf_ )(name, 0, group, assertAccounted, budgetFlags);
+#define VPROF_0(name,group,assertAccounted,budgetFlags) tmZone( TELEMETRY_LEVEL2, TMZF_NONE, "(%s)%s", group, name ); CVProfScope VPROF_VAR_NAME( VProf_ )(name, 0, group, assertAccounted, budgetFlags);
#if VPROF_LEVEL > 0
-#define VPROF_1(name,group,assertAccounted,budgetFlags) TM_ZONE( TELEMETRY_LEVEL3, TMZF_NONE, "(%s)%s", group, name ); CVProfScope VPROF_VAR_NAME( VProf_ )(name, 1, group, assertAccounted, budgetFlags);
+#define VPROF_1(name,group,assertAccounted,budgetFlags) tmZone( TELEMETRY_LEVEL3, TMZF_NONE, "(%s)%s", group, name ); CVProfScope VPROF_VAR_NAME( VProf_ )(name, 1, group, assertAccounted, budgetFlags);
#else
#define VPROF_1(name,group,assertAccounted,budgetFlags) ((void)0)
#endif
#if VPROF_LEVEL > 1
-#define VPROF_2(name,group,assertAccounted,budgetFlags) TM_ZONE( TELEMETRY_LEVEL4, TMZF_NONE, "(%s)%s", group, name ); CVProfScope VPROF_VAR_NAME( VProf_ )(name, 2, group, assertAccounted, budgetFlags);
+#define VPROF_2(name,group,assertAccounted,budgetFlags) CVProfScope VPROF_VAR_NAME( VProf_ )(name, 2, group, assertAccounted, budgetFlags);
#else
#define VPROF_2(name,group,assertAccounted,budgetFlags) ((void)0)
#endif
#if VPROF_LEVEL > 2
-#define VPROF_3(name,group,assertAccounted,budgetFlags) TM_ZONE( TELEMETRY_LEVEL5, TMZF_NONE, "(%s)%s", group, name ); CVProfScope VPROF_VAR_NAME( VProf_ )(name, 3, group, assertAccounted, budgetFlags);
+#define VPROF_3(name,group,assertAccounted,budgetFlags) CVProfScope VPROF_VAR_NAME( VProf_ )(name, 3, group, assertAccounted, budgetFlags);
#else
#define VPROF_3(name,group,assertAccounted,budgetFlags) ((void)0)
#endif
#if VPROF_LEVEL > 3
-#define VPROF_4(name,group,assertAccounted,budgetFlags) TM_ZONE( TELEMETRY_LEVEL6, TMZF_NONE, "(%s)%s", group, name ); CVProfScope VPROF_VAR_NAME( VProf_ )(name, 4, group, assertAccounted, budgetFlags);
+#define VPROF_4(name,group,assertAccounted,budgetFlags) CVProfScope VPROF_VAR_NAME( VProf_ )(name, 4, group, assertAccounted, budgetFlags);
#else
#define VPROF_4(name,group,assertAccounted,budgetFlags) ((void)0)
#endif
diff --git a/mp/src/public/tier0/vprof_telemetry.h b/mp/src/public/tier0/vprof_telemetry.h
index f3df4f4b..a7758cf4 100644
--- a/mp/src/public/tier0/vprof_telemetry.h
+++ b/mp/src/public/tier0/vprof_telemetry.h
@@ -15,27 +15,35 @@
#define RAD_TELEMETRY_ENABLED
#endif
-#endif // !defined( MAKE_VPC )
+#endif // !MAKE_VPC
#if !defined( RAD_TELEMETRY_ENABLED )
//
-// If Telemetry isn't enabled, then kill all the tmZone() macros, etc.
+// Kill all tmZone() macros, etc.
//
-#define NTELEMETRY 1
-// Different versions of radbase.h define RADCOPYRIGHT to different values. So undef that here.
-#undef RADCOPYRIGHT
-
#include "tmapi_dummy.h"
inline void TelemetryTick() {}
inline void TelemetrySetLevel( unsigned int Level ) {}
+#define TelemetrySetLockName( _ctx, _location, _description )
-#define TELEMETRY_REQUIRED( tmRequiredCode ) //a basic wrapper to only enable code if telemetry is present
-#define TELEMETRY_REQUIRED_REPLACE( tmRequiredCode, replacementCode ) replacementCode //in case you need to replace the code with something specific if telemetry isn't present
+class CTelemetryLock
+{
+public:
+ CTelemetryLock(void *plocation, const char *description) {}
+ ~CTelemetryLock() {}
+ void Locked() {}
+ void Unlocked() {}
+};
-//#define TMZF_NONE
+class CTelemetrySpikeDetector
+{
+public:
+ CTelemetrySpikeDetector( const char *msg, uint32 threshold = 50 ) {}
+ ~CTelemetrySpikeDetector() { }
+};
#else
@@ -46,940 +54,29 @@ inline void TelemetrySetLevel( unsigned int Level ) {}
// Different versions of radbase.h define RADCOPYRIGHT to different values. So undef that here.
#undef RADCOPYRIGHT
-PLATFORM_INTERFACE void TelemetryTick();
-PLATFORM_INTERFACE void TelemetrySetLevel( unsigned int Level );
-
struct TelemetryData
{
HTELEMETRY tmContext[32];
float flRDTSCToMilliSeconds; // Conversion from tmFastTime() (rdtsc) to milliseconds.
uint32 FrameCount; // Count of frames to capture before turning off.
char ServerAddress[128]; // Server name to connect to.
- uint32 ZoneFilterVal; // tmZoneFiltered default filtered value (in MicroSeconds)
int playbacktick; // GetPlaybackTick() value from demo file (or 0 if not playing a demo).
- float dotatime; // CDOTAGamerules::GetDOTATime()
uint32 DemoTickStart; // Start telemetry on demo tick #
uint32 DemoTickEnd; // End telemetry on demo tick #
uint32 Level; // Current Telemetry level (Use TelemetrySetLevel to modify)
};
PLATFORM_INTERFACE TelemetryData g_Telemetry;
-#define TELEMETRY_REQUIRED( tmRequiredCode ) tmRequiredCode //a basic wrapper to only enable code if telemetry is present
-#define TELEMETRY_REQUIRED_REPLACE( tmRequiredCode, replacementCode ) tmRequiredCode //in case you need to replace the code with something specific if telemetry isn't present
-
-#endif // RAD_TELEMETRY_ENABLED
-
-
-
-
-
-
-
-
-
-
-#define TELEMETRY_ERROR_BUILD_DISABLED TELEMETRY_REQUIRED_REPLACE( TMERR_DISABLED, 0x0001 )
-#define TELEMETRY_ERROR_DISCONNECTED TELEMETRY_REQUIRED_REPLACE( TMCS_DISCONNECTED, 0 )
-
-
-#define TELEMETRY_LEVEL0 TELEMETRY_REQUIRED_REPLACE( g_Telemetry.tmContext[0], 0 ) // high level tmZone()
-#define TELEMETRY_LEVEL1 TELEMETRY_REQUIRED_REPLACE( g_Telemetry.tmContext[1], 0 ) // lower level tmZone(), tmZoneFiltered()
-#define TELEMETRY_LEVEL2 TELEMETRY_REQUIRED_REPLACE( g_Telemetry.tmContext[2], 0 ) // VPROF_0
-#define TELEMETRY_LEVEL3 TELEMETRY_REQUIRED_REPLACE( g_Telemetry.tmContext[3], 0 ) // VPROF_1
-#define TELEMETRY_LEVEL4 TELEMETRY_REQUIRED_REPLACE( g_Telemetry.tmContext[4], 0 ) // VPROF_2
-#define TELEMETRY_LEVEL5 TELEMETRY_REQUIRED_REPLACE( g_Telemetry.tmContext[5], 0 ) // VPROF_3
-#define TELEMETRY_LEVEL6 TELEMETRY_REQUIRED_REPLACE( g_Telemetry.tmContext[6], 0 ) // VPROF_4
-
-//__rdtsc()
-#define TM_FAST_TIME() TELEMETRY_REQUIRED_REPLACE( tmFastTime(), 0 )
-
-
-//int RADEXPLINK tmLoadTelemetry( int const kUseCheckedDLL );
-//
-//Description
-// On dynamic library platforms, this function loads the Telemetry DLL (or shared library) and then hooks up all of the dynamic function pointers.
-//Parameters
-// kUseCheckedDLL [in] set to 0 if you want to use the release mode DLL or 1 if you want to use the checked DLL. The checked DLL is compiled with optimizations but does extra run time checks and reporting.
-#define TM_LOAD_TELEMETRY(kUseCheckedDll) TELEMETRY_REQUIRED_REPLACE( tmLoadTelemetry(kUseCheckedDll), 0 )
-
-
-//TmErrorCode tmStartup( );
-//
-//Description
-// Starts up all of Telemetry.
-#define TM_STARTUP() TELEMETRY_REQUIRED_REPLACE( tmStartup(), TELEMETRY_ERROR_BUILD_DISABLED )
-
-
-//void tmShutdown( );
-//
-//Description
-// Shuts down all of Telemetry.
-#define TM_SHUTDOWN() TELEMETRY_REQUIRED( tmShutdown() )
-
-
-//TmErrorCode tmInitializeContext( HTELEMETRY * pcx,void * pArena,TmU32 const kArenaSize );
-//
-//Description
-// Initializes a context.
-//
-//Parameters
-// pcx [out] pointer to a TmHandle in which to store a handle to the initialized context
-// pArena [in] pointer to a memory buffer for use by Telemetry to create the context. Applications should never free or modify this memory unless tmShutdownContext has been called!
-// kArenaSize [in] size of the memory buffer pointed to by pArena. You want this large enough so that Telemetry never stalls trying to send over the network, but not so large that it takes up too much memory from your app. A good initial value is 1MB.
-#define TM_INITIALIZE_CONTEXT( pContext, pArena, kArenaSize ) TELEMETRY_REQUIRED_REPLACE( tmInitializeContext( pContext, pArena, kArenaSize ), TELEMETRY_ERROR_BUILD_DISABLED )
-
-
-//void tmZoneFiltered( HTELEMETRY cx,TmU64 const kThreshold,TmU32 const kFlags,char const * kpFormat,... );
-//
-//Description
-// Identical to tmZone however also allows specification of threshold duration.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kThreshold [in] microseconds that the zone must span before being sent to server.
-// kFlags [in] flags for the zone (same as those passed to tmEnter.
-// kpFormat [in] name of the zone (same as those passed to tmEnter. This may contain printf-style format specifiers.
-#define TM_ZONE_FILTERED( context, kThreshold, kFlags, kpFormat, ... ) TELEMETRY_REQUIRED( tmZoneFiltered( context, kThreshold, kFlags, kpFormat, ##__VA_ARGS__ ) )
-
-
-//void tmZone( HTELEMETRY cx,TmU32 const kFlags,char const * kpFormat,... );
-//
-//Description
-// Helper macro in C++ that creates an anonymous local object that automatically calls tmEnter and then tmLeave when exiting scope.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kFlags [in] flags for the zone (same as those passed to tmEnter
-// kpFormat [in] name of the zone (same as those passed to tmEnter. This may contain printf-style format specifiers.
-#define TM_ZONE( context, kFlags, kpFormat, ... ) TELEMETRY_REQUIRED( tmZone( context, kFlags, kpFormat, ##__VA_ARGS__ ) )
-
-//Standardized zones
-#define TM_ZONE_DEFAULT( context ) TM_ZONE( context, TMZF_NONE, __FUNCTION__ )
-#define TM_ZONE_IDLE( context ) TM_ZONE( context, TMZF_IDLE, __FUNCTION__ )
-#define TM_ZONE_STALL( context ) TM_ZONE( context, TMZF_STALL, __FUNCTION__ )
-
-
-//TmErrorCode tmCheckVersion( HTELEMETRY cx, TmU32 const major, TmU32 const minor, TmU32 const build, TmU32 const cust );
-//
-//could not find documentation
-#define TM_CHECK_VERSION( context, major, minor, build, cust ) TELEMETRY_REQUIRED_REPLACE( tmCheckVersion( context, major, minor, build, cust ), TELEMETRY_ERROR_BUILD_DISABLED )
-
-
-//TmErrorCode tmListenIPC( HTELEMETRY cx, char const *name );
-//
-//could not find documentation
-#define TM_LISTEN_IPC( context, name ) TELEMETRY_REQUIRED_REPLACE( tmListenIPC( context, name ), TELEMETRY_ERROR_BUILD_DISABLED )
-
-
-//void tmUpdateSymbolData( HTELEMETRY cx );
-//
-//Description
-// Tells Telemetry to rescan loaded modules for symbol database information.
-//
-//Parameters
-// cx [in] a valid context
-#define TM_UPDATE_SYMBOL_DATA( context ) TELEMETRY_REQUIRED( tmUpdateSymbolData( context ) )
-
-
-//TmErrorCode tmGetSessionName( HTELEMETRY cx,char * dst,int const kDstSize );
-//
-//Description
-// Gets the name of the current session as determined by the server.
-//
-//Parameters
-// cx [in] a valid context
-// dst [in] pointer to buffer in which to copy the name
-// kDstSize [in] size of dst
-#define TM_GET_SESSION_NAME( context, dst, kDstSize ) TELEMETRY_REQUIRED_REPLACE( tmGetSessionName( context, dst, kDstSize ), TELEMETRY_ERROR_BUILD_DISABLED )
-
-
-//void tmUnwindToDebugZoneLevel( HTELEMETRY cx,int const kLevel );
-//
-//Description
-// Unwinds the current thread's zone stack back to the given level.
-//
-//Parameters
-// cx [in] a valid context
-// kLevel [in] an arbitrary constant that was previously set using tmSetDebugZoneLevel
-#define TM_UNWIND_TO_DEBUG_ZONE_LEVEL( context, kLevel ) TELEMETRY_REQUIRED( tmUnwindToDebugZoneLevel( context, kLevel ) )
-
-
-//void tmSetDebugZoneLevel( HTELEMETRY cx,int const kLevel );
-//
-//Description
-// Set the Telemetry debug zone level.
-//
-//Parameters
-// cx [in] a valid context
-// kLevel [in] an arbitrary constant used to differentiate this zone level from another
-#define TM_SET_DEBUG_ZONE_LEVEL( context, kLevel ) TELEMETRY_REQUIRED( tmSetDebugZoneLevel( context, kLevel ) )
-
-
-//void tmCheckDebugZoneLevel( HTELEMETRY cx,int const kLevel );
-//
-//Description
-// Check the current Telemetry debug zone level.
-//
-//Parameters
-// cx [in] a valid context
-// kLevel [in] an arbitrary constant that was previously set using tmSetDebugZoneLevel
-#define TM_CHECK_DEBUG_ZONE_LEVEL( context, kLevel ) TELEMETRY_REQUIRED( tmCheckDebugZoneLevel( context, kLevel ) )
-
-
-//int tmGetCallStack( HTELEMETRY cx,TmCallStack * dst );
-//
-//Description
-// Retrieves the callstack for the current thread.
-//
-//Parameters
-// cx [in] a valid context
-// dst [in] TmCallStack structure in which to store the callstack information
-#define TM_GET_CALL_STACK( context, TmCallStack_Ptr ) TELEMETRY_REQUIRED_REPLACE( tmGetCallStack( context, TmCallStack_Ptr ), 0 )
-
-
-//int tmSendCallStack( HTELEMETRY cx,TmCallStack const * kpCallStack );
-//
-//Description
-// Sends the current callstack to the server so that later references with string format specifiers are up to date.
-//
-//Parameters
-// cx [in] a valid context
-// kpCallStack [in] pointer to a pre-existing callstack or 0 if it should use the current callstack
-#define TM_SEND_CALL_STACK( context, TmCallStack_Ptr ) TELEMETRY_REQUIRED_REPLACE( tmSendCallStack( context, TmCallStack_Ptr ), 0 )
-
-
-//TmErrorCode tmGetLastError( HTELEMETRY cx );
-//
-//Description
-// Returns and clears the current error condition for the given context.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-#define TM_GET_LAST_ERROR( context ) TELEMETRY_REQUIRED_REPLACE( tmGetLastError( context ), TELEMETRY_ERROR_BUILD_DISABLED )
-
-
-//void tmShutdownContext( HTELEMETRY cx );
-//
-//Description
-// Shuts down the given context.
-//
-//Parameters
-// cx [in] handle to a valid context
-#define TM_SHUTDOWN_CONTEXT( context ) TELEMETRY_REQUIRED( tmShutdownContext( context ) )
-
-
-//TmU64 tmGetAccumulationStart( HTELEMETRY cx );
-//
-//Description
-// Gets the start time for a set of accumulation zones.
-//
-//Parameters
-// cx [in] handle to a telemetry context
-//
-//Return value
-// return [out] start time for use with tmEmitAccumulationZone.
-#define TM_GET_ACCUMULATION_START( context ) TELEMETRY_REQUIRED_REPLACE( tmGetAccumulationStart( context ), 0 )
-
-
-//TmU64 tmGetLastContextSwitchTime( HTELEMETRY cx );
-//
-//Description
-// Returns the time of the last received context switch event.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-//
-//Return value
-// return [out] the time of the last received context switch event, or 0 on failure (e.g. invalid context, context switches disabled, etc.)
-#define TM_GET_LAST_CONTEXT_SWITCH_TIME( context ) TELEMETRY_REQUIRED_REPLACE( tmGetLastContextSwitchTime( context ), 0 )
-
-
-//void tmEnterAccumulationZone( HTELEMETRY cx,TmI64 * zone_variable );
-//
-//Description
-// Updates a zone variable passed to tmEmitAccumulationZone later.
-//
-//Parameters
-// cx [in] handle to a telemetry context
-// zone_variable [in] zone_variable to update
-#define TM_ENTER_ACCUMULATION_ZONE( context, zone_variable ) TELEMETRY_REQUIRED( tmEnterAccumulationZone( context, zone_variable ) )
-
-
-//void tmLeaveAccumulationZone( HTELEMETRY cx,TmI64 * zone_variable );
-//
-//Description
-// Updates a zone variable passed to tmEmitAccumulationZone later.
-//
-//Parameters
-// cx [in] handle to a telemetry context
-// zone_variable [in] zone_variable to update
-#define TM_LEAVE_ACCUMULATION_ZONE( context, zone_variable ) TELEMETRY_REQUIRED( tmLeaveAccumulationZone( context, zone_variable ) )
-
-
-//void tmGetFormatCode( TmU32* pCode, char const * kpFmt );
-//
-//could not find documentation
-#define TM_GET_FORMAT_CODE( context, pCode, kpFmt ) TELEMETRY_REQUIRED( tmGetFormatCode( context, pCode, kpFmt ) )
-
-
-//char const * tmDynamicString( HTELEMETRY cx,char const * kpString );
-//
-//Description
-// Returns an opaque string identifier usable by Telemetry that is a copy of the kpString parameter.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpString [in] string to copy
-#define TM_DYNAMIC_STRING( context, kpString ) TELEMETRY_REQUIRED_REPLACE( tmDynamicString( context, kpString ), NULL )
-
-
-//void tmClearStaticString( HTELEMETRY cx,char const * kpString );
-//
-//Description
-// Marks the given string pointer as 'changed', forcing Telemetry to resend its contents.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpString [in] string to reset
-#define TM_CLEAR_STATIC_STRING( context, kpString ) TELEMETRY_REQUIRED( tmClearStaticString( context, kpString ) )
-
-
-//void tmEnable( HTELEMETRY cx,TmOption const kOption,int const kValue );
-//
-//Description
-// Enables or disables a specific Telemetry option.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kOption [in] the option to modify. One of the TmOption constants.
-// kValue [in] the new value for the option. Must be 0 (disable) or 1 (enable).
-#define TM_ENABLE( context, kOption, kValue ) TELEMETRY_REQUIRED( tmEnable( context, kOption, kValue ) )
-
-
-//int tmIsEnabled( HTELEMETRY cx,TmOption const kOption );
-//
-//Description
-// Inspects the state of a Telemetry option.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kOption [in] the option to inspect. Must be one of the TmOption constants.
-//
-//Return value
-// return [out] 1 if the option is enabled, 0 if not enabled. In case of error, 0 is enabled and last error is set.
-#define TM_IS_ENABLED( context, kOption ) TELEMETRY_REQUIRED_REPLACE( tmIsEnabled( context, kOption ), 0 )
-
-//void tmSetParameter( HTELEMETRY cx,TmParameter const kParameter,void const * kpValue );
-//
-//Description
-// Sets a Telemetry parameter.
-//
-//Parameters
-// cx [in] a valid context
-// kParameter [in] TmParameter constant
-// kpValue [in] pointer to value of the parameter. This varies depending on the value.
-#define TM_SET_PARAMETER( context, kParameter, kpValue ) TELEMETRY_REQUIRED( tmSetParameter( context, kParameter, kpValue ) )
-
-
-//TmErrorCode tmOpen( HTELEMETRY cx,char const * kpAppName,char const * kpBuildInfo,char const * kpServerAddress,TmConnectionType const kConnection,TmU16 const kServerPort,TmU32 const kFlags,int const kTimeoutMS );
-//
-//Description
-// Starts a Telemetry context and attempts to connect to a Telemetry server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpAppName [in] name of the application. NOTE: This MUST be alphanumeric only, e.g. "Game234", no spaces, special characters, etc. are allowed.
-// kpBuildInfo [in] information about the application. Used to annotate this Telemetry session. This information will show up when connecting to the server later to examine this particular run. Common uses include build numbers, compiled options, etc.
-// kpServerAddress [in] name or IP address of the Telemetry server to connect to
-// kConnection [in] type of connection to establish. Currently only TMCT_TCP is supported.
-// kServerPort [in] port to connect to. Specify 0 or TELEMETRY_DEFAULT_PORT for the default port.
-// kFlags [in] bitwise OR of TmOpenFlag flags
-// kTimeoutMS [in] duration, in milliseconds, to wait for a connection to the Telemetry server. Specify -1 to wait indefinitely.
-//
-//Return value
-// return [out] TM_OK on success, or on error one of the following: TMERR_INVALID_PARAM, TMERR_INVALID_CONTEXT, TMERR_UNKNOWN_NETWORK.
-#define TM_OPEN( context, kpAppName, kpBuildInfo, kpServerAddress, kConnection, kServerPort, kFlags, kTimeoutMS ) TELEMETRY_REQUIRED_REPLACE( tmOpen( context, kpAppName, kpBuildInfo, kpServerAddress, kConnection, kServerPort, kFlags, kTimeoutMS ), TELEMETRY_ERROR_BUILD_DISABLED )
-
-
-//void tmClose( HTELEMETRY cx );
-//
-//Description
-// Closes a context previously opened with tmOpen.
-//
-//Parameters
-// cx [in] handle to a valid and open Telemetry context
-#define TM_CLOSE( context ) TELEMETRY_REQUIRED( tmClose( context ) )
-
-
-//void tmTick( HTELEMETRY cx );
-//
-//Description
-// "Ticks" the Telemetry context, i.e. signifies the end of a frame of execution so that Telemetry can perform internal processing and send data to the Telemetry server.
-//
-//Parameters
-// cx [in] handle to a valid and open Telemetry context
-#define TM_TICK( context ) TELEMETRY_REQUIRED( tmTick( context ) )
-
-
-//void tmFlush( HTELEMETRY cx );
-//
-//cannot find documentation
-#define TM_FLUSH( context ) TELEMETRY_REQUIRED( tmFlush( context ) )
-
-
-//void tmPause( HTELEMETRY cx,int const kPause );
-//
-//Description
-// Pauses/unpauses Telemetry capture.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kPause [in] 1 to pause, 0 to unpause
-#define TM_PAUSE( context, kPause ) TELEMETRY_REQUIRED( tmPause( context, kPause ) )
-
-
-//int tmIsPaused( HTELEMETRY cx );
-//
-//cannot find documentation. Presumably returns 1 if paused, 0 if not
-#define TM_IS_PAUSED( context ) TELEMETRY_REQUIRED_REPLACE( tmIsPaused( context ), 0 )
-
-
-//TmConnectionStatus tmGetConnectionStatus( HTELEMETRY cx );
-//
-//Description
-// Get the current connection status.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-//
-//Return value
-// return [out] a TmConnectionStatus constant. On error returns TMCS_DISCONNECTED and sets the context's last error.
-#define TM_GET_CONNECTION_STATUS( context ) TELEMETRY_REQUIRED_REPLACE( tmGetConnectionStatus( context ), TELEMETRY_ERROR_DISCONNECTED )
-
-
-//void tmFree( HTELEMETRY cx,void const * kpPtr );
-//
-//Description
-// Notify Telemetry that memory has been freed.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpPtr [in] address of the old memory block previously passed to a tmAlloc call
-#define TM_FREE( context, kpPtr ) TELEMETRY_REQUIRED( tmFree( context, kpPtr ) )
-
-
-//TmI32 tmGetStati( HTELEMETRY cx,TmStat const kStat );
-//
-//Description
-// Retrieves internal Telemetry statistics.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kStat [in] the TmStat to retrieve
-//
-//Return value
-// return [out] the value of the indicated internal statistic. On error returns 0 and sets last error.
-#define TM_GET_STAT_I( context, kStat ) TELEMETRY_REQUIRED_REPLACE( tmGetStati( context, kStat ), 0 )
-
-
-//void tmLeave( HTELEMETRY cx );
-//
-//Description
-// Notify Telemetry that a zone is being left.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-#define TM_LEAVE( context ) TELEMETRY_REQUIRED( tmLeave( context ) )
-
-
-//void tmLeaveEx( HTELEMETRY cx,TmU64 const kMatchId,TmU32 const kThreadId,char const * kpFilename,int const kLine );
-//
-//Description
-// Notify Telemetry that a zone is being left.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kMatchId [in] match id returned by tmEnterEx, used for Zones: Runtime Zone Filtering by Duration . Pass 0 if you're not filtering.
-// kThreadId [in] thread id for this zone. Pass 0 for 'current thread'.
-// kpFilename [in] name of the file
-// kLine [in] line number for the leave
-#define TM_LEAVE_EX( context, kMatchId, kThreadId, kpFilename, kLine ) TELEMETRY_REQUIRED( tmLeaveEx( context, kMatchId, kThreadId, kpFilename, kLine ) )
-
-
-//void tmTryLock( HTELEMETRY cx,void const * kPtr,char const * kpLockName,... );
-//
-//Description
-// Notify Telemetry that an attempt to grab a lock is beginning.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kPtr [in] pointer to the item being locked
-// kpLockName [in] description of this lock attempt. This may contain printf-style format specifiers.
-#define TM_TRY_LOCK( context, kPtr, kpLockName, ... ) TELEMETRY_REQUIRED( tmTryLock( context, kPtr, kpLockName, ##__VA_ARGS__ ) )
-
-
-//void tmTryLockEx( HTELEMETRY cx,TmU64 * matcher,TmU64 const kThreshold,char const * kpFileName,int const kLine,void const * kPtr,char const * kpLockName,... );
-//
-//Description
-// Same as tmTryLock, but also specifying file and line information.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// matcher [in] reference in which to store a match ID used for later filtering by duration
-// kpFileName [in] pointer to filename
-// kLine [in] line number
-// kPtr [in] pointer to the item being locked
-// kpLockName [in] description of this lock attempt. This may contain printf-style format specifiers.
-#define TM_TRY_LOCK_EX( context, matcher, kThreshold, kpFileName, kLine, kPtr, kpLockName, ... ) TELEMETRY_REQUIRED( tmTryLockEx( context, matcher, kThreshold, kpFileName, kLine, kPtr, kpLockName, ##__VA_ARGS__ ) )
-
-
-//void tmEndTryLock( HTELEMETRY cx,void const * kPtr,TmLockResult const kResult );
-//
-//Description
-// Specify the result of a lock attempt previously started with tmTryLock.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kPtr [in] pointer for the object (mutex, etc.) being locked
-// kResult [in] the result of the lock attempt, one of TmLockResult.
-#define TM_END_TRY_LOCK( context, kPtr, kResult ) TELEMETRY_REQUIRED( tmEndTryLock( context, kPtr, kResult ) )
-
-
-//void tmEndTryLockEx( HTELEMETRY cx,TmU64 const kMatchId,char const * kpFileName,int const kLine,void const * kPtr,TmLockResult const kResult );
-//
-//Description
-// Specify the result of a lock attempt previously started with tmTryLock, but also with file and line information.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kMatchId [in] match id returned from tmTryLockEx
-// kpFileName [in] pointer to filename
-// kLine [in] line number
-// kPtr [in] pointer for the object (mutex, etc.) being locked
-// kResult [in] the result of the lock attempt, one of TmLockResult.
-#define TM_END_TRY_LOCK_EX( context, kMatchId, kpFileName, kLine, kPtr, kResult ) TELEMETRY_REQUIRED( tmEndTryLockEx( context, kMatchId, kpFileName, kLine, kPtr, kResult ) )
-
-
-//void tmBeginTimeSpan( HTELEMETRY cx,TmU64 const kId,TmU32 const kFlags,char const * kpNameFormat,... );
-//
-//Description
-// Start the beginning of a timespan.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kId [in] a user defined identifier for the timespan. Should be > 0.
-// kFlags [in] flags for the timespan. Reserved, must be 0.
-// kpNameFormat [in] information about this timespan. This may contain printf-style format specifiers.
-#define TM_BEGIN_TIME_SPAN( context, kId, kFlags, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmBeginTimeSpan( context, kId, kFlags, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmEndTimeSpan( HTELEMETRY cx,TmU64 const kId,TmU32 const kFlags,char const * kpNameFormat,... );
-//
-//Description
-// Mark the end a timespan.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kId [in] a user defined identifier for the timespan. Should be the same as the identifier passed to tmBeginTimeSpan.
-// kFlags [in] flags for the timespan. Reserved, must be 0.
-// kpNameFormat [in] information about this timespan. This may contain printf-style format specifiers.
-#define TM_END_TIME_SPAN( context, kId, kFlags, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmEndTimeSpan( context, kId, kFlags, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmBeginTimeSpanAt( HTELEMETRY cx,TmU64 const kId,TmU32 const kFlags,TmU64 const kTimeStamp,char const * kpNameFormat,... );
-//
-//Description
-// Start the beginning of a timespan but at an explicit time.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kId [in] a user defined identifier for the timespan. Should be > 0.
-// kFlags [in] flags for the timespan. Reserved, must be 0.
-// kTimeStamp [in] explicit timestamp (e.g. from tmFastTime)
-// kpNameFormat [in] information about this timespan. This may contain printf-style format specifiers.
-#define TM_BEGIN_TIME_SPAN_AT( context, kId, kFlags, kTimeStamp, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmBeginTimeSpanAt( context, kId, kFlags, kTimeStamp, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmEndTimeSpanAt( HTELEMETRY cx,TmU64 const kId,TmU32 const kFlags,TmU64 const kTimeStamp,char const * kpNameFormat,... );
-//
-//Description
-// Mark the end a timespan, but with an explicit timestamp.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kId [in] a user defined identifier for the timespan. Should be the same as the identifier passed to tmBeginTimeSpan.
-// kFlags [in] flags for the timespan. Reserved, must be 0.
-// kTimeStamp [in] a user specified timestamp (e.g. from tmFastTime.
-// kpNameFormat [in] information about this timespan. This may contain printf-style format specifiers.
-#define TM_END_TIME_SPAN_AT( context, kId, kFlags, kTimeStamp, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmEndTimeSpanAt( context, kId, kFlags, kTimeStamp, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmSignalLockCount( HTELEMETRY cx,void const * kPtr,TmU32 const kCount,char const * kpDescription,... );
-//
-//Description
-// Signal that a semaphore's lock count has been incremented.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kPtr [in] pointer to the being whose count is being incremented (e.g. HANDLE)
-// kCount [in] count value
-// kpDescription [in] description of the event. This may contain printf-style format specifiers.
-#define TM_SIGNAL_LOCK_COUNT( context, kPtr, kCount, kpDescription, ... ) TELEMETRY_REQUIRED( tmSignalLockCount( context, kPtr, kCount, kpDescription, ##__VA_ARGS__ ) )
-
-
-//void tmSetLockState( HTELEMETRY cx,void const * kPtr,TmLockState const kState,char const * kpDescription,... );
-//
-//Description
-// Sets the state of a lock (mutex, critical section, semaphore, etc.)
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kPtr [in] identifier for the lock, typically its address or HANDLE
-// kState [in] new state of the lock
-// kpDescription [in] description of the event. This may contain printf-style format specifiers.
-#define TM_SET_LOCK_STATE( context, kPtr, kState, kpDescription, ... ) TELEMETRY_REQUIRED( tmSetLockState( context, kPtr, kState, kpDescription, ##__VA_ARGS__ ) )
-
-
-//void tmSetLockStateEx( HTELEMETRY cx,char const * kpFilename,int const kLine,void const * kPtr,TmLockState const kState );
-//
-//Description
-// Set the state of a lock but with explicit file and line information.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpFilename [in] filename where the state change occurs
-// kLine [in] line number of the state change
-// kPtr [in] identifier for the lock, typically its address or HANDLE
-// kState [in] new state of the lock
-// kpDescription [in] description of the event. This may contain printf-style format specifiers.
-#define TM_SET_LOCK_STATE_EX( context, kpFileName, kLine, kPtr, kState, kpDescription, ... ) TELEMETRY_REQUIRED( tmSetLockStateEx( context, kpFileName, kLine, kPtr, kState, kpDescription, ##__VA_ARGS__ ) )
-
-
-//void tmSetLockStateMinTime( HTELEMETRY cx,void * buf,void const * kPtr,TmLockState const kState,char const * fmt,... );
-//
-//Description
-// Set the state of a lock but with a minimum time threshold.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// buf [in] a user buffer used to store the lock event. Must be at least TM_LOCK_MIN_TIME_BUFSIZE in size.
-// kPtr [in] identifier for the lock, typically its address or HANDLE
-// kState [in] new state of the lock
-// kpDescription [in] description of the event. This may contain printf-style format specifiers.
-#define TM_SET_LOCK_STATE_MIN_TIME( context, buf, kPtr, kState, kpDescription, ... ) TELEMETRY_REQUIRED( tmSetLockStateMinTime( context, buf, kPtr, kState, kpDescription, ##__VA_ARGS__ ) )
-
-
-//void tmSetLockStateMinTimeEx( HTELEMETRY cx,void * buf,char const * kpFilename,int const kLine,void const * kPtr,TmLockState const kState );
-//
-//Description
-// This is the 'Ex' version of tmSetLockStateMinTimeEx. Please refer to tmSetLockStateEx and tmSetLockStateMinTime for more information.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// buf [in] a user buffer used to store the lock event. Must be at least TM_LOCK_MIN_TIME_BUFSIZE in size.
-// kpFilename [in] filename where the state change occurs
-// kLine [in] line number of the state change
-// kPtr [in] identifier for the lock, typically its address or HANDLE
-// kState [in] new state of the lock
-// kpDescription [in] description of the event. This may contain printf-style format specifiers.
-#define TM_SET_LOCK_STATE_MIN_TIME_EX( context, buf, kpFilename, kLine, kPtr, kState, kpDescription, ... ) TELEMETRY_REQUIRED( tmSetLockStateMinTimeEx( context, buf, kpFilename, kLine, kPtr, kState, kpDescription, ##__VA_ARGS__ ) )
-
-
-//void tmThreadName( HTELEMETRY cx,TmU32 const kThreadID,char const * kpNameFormat,... );
-//
-//Description
-// Sets the name of the specified thread.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kThreadID [in] thread identifier of the thread to name. Use 0 to specify the current thread.
-// kpNameFormat [in] name of the thread. This may contain printf-style format specifiers.
-#define TM_THREAD_NAME( context, kThreadID, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmThreadName( context, kThreadID, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmLockName( HTELEMETRY cx,void const* kPtr,char const * kpNameFormat,... );
-//
-//Description
-// Sets the name of the specified locking object.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kPtr [in] identifier for the lock. Usually you can supply a pointer/HANDLE.
-// kpNameFormat [in] name of the lock. This may contain printf-style format specifiers.
-#define TM_LOCK_NAME( context, kPtr, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmLockName( context, kPtr, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmEmitAccumulationZone( HTELEMETRY cx,TmU32 const kZoneFlags,TmU64 * pStart,int const kCount,TmU64 const kTotal,char const * kpZoneFormat,... );
-//
-//Description
-// Emits an accumulation zone.
-//
-//Parameters
-// cx [in] handle to a valid telemetry context
-// kZoneFlags [in] reserved, must be 0
-// pStart [out] pointer to start time variable retrieved with a prior call to tmGetAccumulationStart. This value is modified.
-// kCount [in] number of times the accumulation zone was called
-// kTotal [in] total amount of time spent in the accumulation zone
-// kpZoneFormat [in] name of the accumulation zone. This may contain printf-style format specifiers.
-#define TM_EMIT_ACCUMULATION_ZONE( context, kZoneFlags, pStart, kCount, kTotal, kpZoneFormat, ... ) TELEMETRY_REQUIRED( tmEmitAccumulationZone( context, kZoneFlags, pStart, kCount, kTotal, kpZoneFormat, ##__VA_ARGS__ ) )
-
-
-//void tmSetVariable( HTELEMETRY cx,char const * kpKey,char const * kpValueFormat,... );
-//
-//Description
-// Binds a string to a key name and sends to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpKey [in] pointer to string identify the key being set
-// kpValueFormat [in] pointer to string to bind to the associated key. This may contain printf-style format specifiers.
-#define TM_SET_VARIABLE( context, kpKey, kpValueFormat, ... ) TELEMETRY_REQUIRED( tmSetVariable( context, kpKey, kpValueFormat, ##__VA_ARGS__ ) )
-
-
-//void tmSetTimelineSectionName( HTELEMETRY cx,char const * kpNameFormat,... );
-//
-//Description
-// Changes the name of the global state.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpNameFormat [in] name of the current state. This may contain printf-style format specifiers.
-#define TM_SET_TIMELINE_SECTION_NAME( context, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmSetTimelineSectionName( context, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmEnter( HTELEMETRY cx,TmU32 const kFlags,char const * kpZoneName,... );
-//
-//Description
-// Notify Telemetry that a zone is being entered.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kFlags [in] Bitwise OR of TmZoneFlag
-// kpZoneName [in] name of the zone. This may contain printf-style format specifiers.
-#define TM_ENTER( context, kFlags, kpZoneName, ... ) TELEMETRY_REQUIRED( tmEnter( context, kFlags, kpZoneName, ##__VA_ARGS__ ) )
-
-
-//void tmEnterEx( HTELEMETRY cx,TmU64 * pMatchId,TmU32 const kThreadId,TmU64 const kThreshold,char const * kpFilename,int const kLine,TmU32 const kFlags,char const * kpZoneName,... );
-//
-//Description
-// Notify Telemetry that a zone is being entered, but with explicit file and line information.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// pMatchId [in] pointer variable to assign a match ID, pass NULL if you are not Zones: Runtime Zone Filtering by Duration.
-// kThreadId [in] thread ID for this zone, pass 0 for current thread
-// kThreshold [in] microseconds that the zone must span before being sent to server.
-// kpFilename [in] filename
-// kLine [in] line number
-// kFlags [in] Bitwise OR of TmZoneFlag
-// kpZoneName [in] name of the zone. This may contain printf-style format specifiers.
-#define TM_ENTER_EX( context, pMatchId, kThreadId, kThreshold, kpFilename, kLine, kFlags, kpZoneName, ... ) TELEMETRY_REQUIRED( tmEnterEx( context, pMatchId, kThreadId, kThreshold, kpFilename, kLine, kFlags, kpZoneName, ##__VA_ARGS__ ) )
-
-
-//void tmAlloc( HTELEMETRY cx,void const * kPtr,TmU64 const kSize,char const * kpDescription,... );
-//
-//Description
-// Notify Telemetry that memory has been allocated.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kPtr [in] address of the memory that has been allocated
-// kSize [in] size of memory that has been allocated
-// kpDescription [in] textual description of the allocation, e.g. "vertex array" or "texture data". This may contain printf-style format specifiers.
-#define TM_ALLOC( context, kPtr, kSize, kpDescription, ... ) TELEMETRY_REQUIRED( tmAlloc( context, kPtr, kSize, kpDescription, ##__VA_ARGS__ ) )
-
-
-//void tmAllocEx( HTELEMETRY cx,char const * kpFilename,int const kLineNumber,void const * kPtr,TmU64 const kSize,char const * kpDescription,... );
-//
-//Description
-// Notify Telemetry that memory has been allocated, but with explicit file and line information.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpFilename [in] name of the file
-// kLineNumber [in] line number of the allocation
-// kPtr [in] address of the memory that has been allocated
-// kSize [in] size of memory that has been allocated
-// kpDescription [in] textual description of the allocation, e.g. "vertex array" or "texture data". This may contain printf-style format specifiers.
-#define TM_ALLOC_EX( context, kpFilename, kLineNumber, kPtr, kSize, kpDescription, ... ) TELEMETRY_REQUIRED( tmAllocEx( context, kpFilename, kLineNumber, kPtr, kSize, kpDescription, ##__VA_ARGS__ ) )
-
-
-//void tmMessage( HTELEMETRY cx,TmU32 const kFlags,char const * kpFormatString,... );
-//
-//Description
-// Send a message to the server for later viewing in the Visualizer.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kFlags [in] Bitwise OR of TmMessageFlag
-// kpFormatString [in] message string (not to exceed TM_MAX_STRING in length). This may contain printf-style format specifiers. Note that the message may have a Telemetry object path in it so that it can be hierarchically displayed with other messages.
-#define TM_MESSAGE( context, kFlags, kpFormatString, ... ) TELEMETRY_REQUIRED( tmMessage( context, kFlags, kpFormatString, ##__VA_ARGS__ ) )
-#define TM_LOG( context, kpFormatString, ... ) TM_MESSAGE( context, TMMF_SEVERITY_LOG, kpFormatString, ##__VA_ARGS__ )
-#define TM_WARNING( context, kpFormatString, ... ) TM_MESSAGE( context, TMMF_SEVERITY_WARNING, kpFormatString, ##__VA_ARGS__ )
-#define TM_ERROR( context, kpFormatString, ... ) TM_MESSAGE( context, TMMF_SEVERITY_ERROR, kpFormatString, ##__VA_ARGS__ )
-
-
-
-//void tmPlot( HTELEMETRY cx,TmPlotType const kType,float const kValue,char const * kpNameFormat,... );
-//
-//Description
-// Sends a floating point plot value to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kType [in] type of the plot (used to specify how the Visualizer will format the plot's value).
-// kValue [in] the value of the plot at this moment in time
-// kpNameFormat [in] name of the plot. You can use Telemetry object paths to create plot hierarchies on the Visualizer's plot filter tree. You can also specify plot scaling groups by appending group names in parenthesis to your plot's name, e.g. "renderer/memory/meshes(rendermem)" and "renderer/memory/textures(rendermem)" would be scaled using the same min/max values. This may contain printf-style format specifiers.
-#define TM_PLOT( context, kType, kFlags, kValue, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmPlot( context, kType, kFlags, kValue, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//Identical to tmPlot()
-//void tmPlotF32( HTELEMETRY cx,TmPlotType const kType,float const kValue,char const * kpNameFormat,... );
-//
-//Description
-// Sends a floating point plot value to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kType [in] type of the plot (used to specify how the Visualizer will format the plot's value).
-// kValue [in] the value of the plot at this moment in time
-// kpNameFormat [in] name of the plot. You can use Telemetry object paths to create plot hierarchies on the Visualizer's plot filter tree. You can also specify plot scaling groups by appending group names in parenthesis to your plot's name, e.g. "renderer/memory/meshes(rendermem)" and "renderer/memory/textures(rendermem)" would be scaled using the same min/max values. This may contain printf-style format specifiers.
-#define TM_PLOT_F32( context, kType, kFlags, kValue, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmPlotF32( context, kType, kFlags, kValue, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmPlotF64( HTELEMETRY cx,TmPlotType const kType,double const kValue,char const * kpNameFormat,... );
-//
-//Description
-// Sends a double precision floating point plot value to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kType [in] type of the plot (used to specify how the Visualizer will format the plot's value).
-// kValue [in] the value of the plot at this moment in time
-// kpNameFormat [in] name of the plot. You can use Telemetry object paths to create plot hierarchies on the Visualizer's plot filter tree. You can also specify plot scaling groups by appending group names in parenthesis to your plot's name, e.g. "renderer/memory/meshes(rendermem)" and "renderer/memory/textures(rendermem)" would be scaled using the same min/max values. This may contain printf-style format specifiers.
-#define TM_PLOT_F64( context, kType, kFlags, kValue, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmPlotF64( context, kType, kFlags, kValue, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmPlotI32( HTELEMETRY cx,TmPlotType const kType,TmI32 const kValue,char const * kpNameFormat,... );
-//
-//Description
-// Sends an signed 32-bit value to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kType [in] type of the plot (used to specify how the Visualizer will format the plot's value).
-// kValue [in] the value of the plot at this moment in time
-// kpNameFormat [in] name of the plot. You can use Telemetry object paths to create plot hierarchies on the Visualizer's plot filter tree. You can also specify plot scaling groups by appending group names in parenthesis to your plot's name, e.g. "renderer/memory/meshes(rendermem)" and "renderer/memory/textures(rendermem)" would be scaled using the same min/max values. This may contain printf-style format specifiers.
-#define TM_PLOT_I32( context, kType, kFlags, kValue, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmPlotI32( context, kType, kFlags, kValue, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmPlotU32( HTELEMETRY cx,TmPlotType const kType,TmU32 const kValue,char const * kpNameFormat,... );
-//
-//Description
-// Sends an unsigned 32-bit value to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kType [in] type of the plot (used to specify how the Visualizer will format the plot's value).
-// kValue [in] the value of the plot at this moment in time
-// kpNameFormat [in] name of the plot. You can use Telemetry object paths to create plot hierarchies on the Visualizer's plot filter tree. You can also specify plot scaling groups by appending group names in parenthesis to your plot's name, e.g. "renderer/memory/meshes(rendermem)" and "renderer/memory/textures(rendermem)" would be scaled using the same min/max values. This may contain printf-style format specifiers.
-#define TM_PLOT_U32( context, kType, kFlags, kValue, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmPlotU32( context, kType, kFlags, kValue, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmPlotI64( HTELEMETRY cx,TmPlotType const kType,TmI64 const kValue,char const * kpNameFormat,... );
-//
-//Description
-// Sends an signed 64-bit value to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kType [in] type of the plot (used to specify how the Visualizer will format the plot's value).
-// kValue [in] the value of the plot at this moment in time
-// kpNameFormat [in] name of the plot. You can use Telemetry object paths to create plot hierarchies on the Visualizer's plot filter tree. You can also specify plot scaling groups by appending group names in parenthesis to your plot's name, e.g. "renderer/memory/meshes(rendermem)" and "renderer/memory/textures(rendermem)" would be scaled using the same min/max values. This may contain printf-style format specifiers.
-#define TM_PLOT_I64( context, kType, kFlags, kValue, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmPlotI64( context, kType, kFlags, kValue, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmPlotU64( HTELEMETRY cx,TmPlotType const kType,TmU64 const kValue,char const * kpNameFormat,... );
-//
-//Description
-// Sends an unsigned 64-bit value to the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kType [in] type of the plot (used to specify how the Visualizer will format the plot's value).
-// kValue [in] the value of the plot at this moment in time
-// kpNameFormat [in] name of the plot. You can use Telemetry object paths to create plot hierarchies on the Visualizer's plot filter tree. You can also specify plot scaling groups by appending group names in parenthesis to your plot's name, e.g. "renderer/memory/meshes(rendermem)" and "renderer/memory/textures(rendermem)" would be scaled using the same min/max values. This may contain printf-style format specifiers.
-#define TM_PLOT_U64( context, kType, kFlags, kValue, kpNameFormat, ... ) TELEMETRY_REQUIRED( tmPlotU64( context, kType, kFlags, kValue, kpNameFormat, ##__VA_ARGS__ ) )
-
-
-//void tmBlob( HTELEMETRY cx,void const * kpData,int const kDataSize,char const * kpPluginIdentifier,char const * kpBlobName,... );
-//
-//Description
-// Sends an arbitrary application specified blob of binary data for storage on the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kpData [in] the actual blob data
-// kDataSize [in] size of kpData in bytes
-// kpPluginIdentifier [in] identifier of the plugin used to visualize this data (must match the plugin's internal identifier).
-// kpBlobName [in] the name of the blob. This may contain printf-style format specifiers.
-#define TM_BLOB( context, kpData, kDataSize, kpPluginIdentifier, kpBlobName, ...) TELEMETRY_REQUIRED( tmBlob( context, kpData, kDataSize, kpPluginIdentifier, kpBlobName, ##__VA_ARGS__ ) )
-
-
-//void tmDisjointBlob( HTELEMETRY cx,int const kNumPieces,void const ** kpData,int const * kDataSizes,char const* kpPluginIdentifier,char const * kpBlobName,... );
-//
-//Description
-// Sends an arbitrary application specified blob of binary data for storage on the server.
-//
-//Parameters
-// cx [in] handle to a valid Telemetry context
-// kNumPieces [in] number of elements in kpData and kDataSizes
-// kpData [in] array of actual data blobs
-// kDataSizes [in] array of data blob sizes in bytes
-// kpPluginIdentifier [in] identifier of the plugin used to visualize this data (must match the plugin's internal identifier).
-// kpBlobName [in] the name of the blob. This may contain printf-style format specifiers.
-#define TM_DISJOINT_BLOB( context, kNumPieces, kpData, kDataSizes, kpPluginIdentifier, kpBlobName, ... ) TELEMETRY_REQUIRED( tmDisjointBlob( context, kNumPieces, kpData, kDataSizes, kpPluginIdentifier, kpBlobName, ##__VA_ARGS__ ) )
-
-
-
-
-
-
-
-
-
-
-
-
-#if !defined( RAD_TELEMETRY_ENABLED )
-
-//
-// Telemetry is disabled.
-//
-
-class CTelemetryLock
-{
-public:
- CTelemetryLock(void *plocation, const char *description) {}
- ~CTelemetryLock() {}
- void Locked() {}
- void Unlocked() {}
-};
-
-class CTelemetrySpikeDetector
-{
-public:
- CTelemetrySpikeDetector( const char *msg, uint32 threshold = 50 ) {}
- ~CTelemetrySpikeDetector() { }
-};
-
-#define TelemetrySetLockName( _ctx, _location, _description )
-
-#else
+PLATFORM_INTERFACE void TelemetryTick();
+PLATFORM_INTERFACE void TelemetrySetLevel( unsigned int Level );
-//
-// Telemetry is enabled.
-//
+#define TELEMETRY_LEVEL0 g_Telemetry.tmContext[0] // high level tmZone()
+#define TELEMETRY_LEVEL1 g_Telemetry.tmContext[1] // lower level tmZone(), tmZoneFiltered()
+#define TELEMETRY_LEVEL2 g_Telemetry.tmContext[2] // VPROF_0
+#define TELEMETRY_LEVEL3 g_Telemetry.tmContext[3] // VPROF_1
+#define TELEMETRY_LEVEL4 g_Telemetry.tmContext[4] // VPROF_2
+#define TELEMETRY_LEVEL5 g_Telemetry.tmContext[5] // VPROF_3
+#define TELEMETRY_LEVEL6 g_Telemetry.tmContext[6] // VPROF_4
#define TelemetrySetLockName( _ctx, _location, _description ) \
do \
@@ -1000,7 +97,7 @@ public:
m_plocation = (const char *)plocation;
m_description = description;
TelemetrySetLockName( TELEMETRY_LEVEL1, m_plocation, m_description );
- TM_TRY_LOCK( TELEMETRY_LEVEL1, m_plocation, "%s", m_description );
+ tmTryLock( TELEMETRY_LEVEL1, m_plocation, "%s", m_description );
}
~CTelemetryLock()
{
@@ -1008,14 +105,14 @@ public:
}
void Locked()
{
- TM_END_TRY_LOCK( TELEMETRY_LEVEL1, m_plocation, TMLR_SUCCESS );
- TM_SET_LOCK_STATE( TELEMETRY_LEVEL1, m_plocation, TMLS_LOCKED, "%s Locked", m_description );
+ tmEndTryLock( TELEMETRY_LEVEL1, m_plocation, TMLR_SUCCESS );
+ tmSetLockState( TELEMETRY_LEVEL1, m_plocation, TMLS_LOCKED, "%s Locked", m_description );
}
void Unlocked()
{
if( m_plocation )
{
- TM_SET_LOCK_STATE( TELEMETRY_LEVEL1, m_plocation, TMLS_RELEASED, "%s Released", m_description );
+ tmSetLockState( TELEMETRY_LEVEL1, m_plocation, TMLS_RELEASED, "%s Released", m_description );
m_plocation = NULL;
}
}
@@ -1036,7 +133,7 @@ public:
float time = ( tmFastTime() - time0 ) * g_Telemetry.flRDTSCToMilliSeconds;
if( time >= m_threshold )
{
- TM_MESSAGE( TELEMETRY_LEVEL0, TMMF_ICON_NOTE | TMMF_SEVERITY_WARNING, "(dota/spike)%s %.2fms %t", m_message, time, tmSendCallStack( TELEMETRY_LEVEL0, 0 ) );
+ tmMessage( TELEMETRY_LEVEL0, TMMF_ICON_NOTE | TMMF_SEVERITY_WARNING, "(dota/spike)%s %.2fms %t", m_message, time, tmSendCallStack( TELEMETRY_LEVEL0, 0 ) );
}
}
diff --git a/mp/src/public/tier1/KeyValues.h b/mp/src/public/tier1/KeyValues.h
index 67b2f012..0fdffb08 100644
--- a/mp/src/public/tier1/KeyValues.h
+++ b/mp/src/public/tier1/KeyValues.h
@@ -174,7 +174,7 @@ public:
const char *GetString( const char *keyName = NULL, const char *defaultValue = "" );
const wchar_t *GetWString( const char *keyName = NULL, const wchar_t *defaultValue = L"" );
void *GetPtr( const char *keyName = NULL, void *defaultValue = (void*)0 );
- bool GetBool( const char *keyName = NULL, bool defaultValue = false );
+ bool GetBool( const char *keyName = NULL, bool defaultValue = false, bool* optGotDefault = NULL );
Color GetColor( const char *keyName = NULL /* default value is all black */);
bool IsEmpty(const char *keyName = NULL);
diff --git a/mp/src/public/tier1/UtlSortVector.h b/mp/src/public/tier1/UtlSortVector.h
index b5bfef53..9890c607 100644
--- a/mp/src/public/tier1/UtlSortVector.h
+++ b/mp/src/public/tier1/UtlSortVector.h
@@ -138,7 +138,6 @@ protected:
bool m_bNeedsSort;
private:
-private:
template< typename TKey >
int FindLessOrEqual( const TKey& search, bool *pFound ) const;
diff --git a/mp/src/public/tier1/convar.h b/mp/src/public/tier1/convar.h
index 4bff787e..832fbb00 100644
--- a/mp/src/public/tier1/convar.h
+++ b/mp/src/public/tier1/convar.h
@@ -137,7 +137,7 @@ public:
virtual CVarDLLIdentifier_t GetDLLIdentifier() const;
protected:
- virtual void Create( const char *pName, const char *pHelpString = 0,
+ virtual void CreateBase( const char *pName, const char *pHelpString = 0,
int flags = 0 );
// Used internally by OneTimeInit to initialize/shutdown
diff --git a/mp/src/public/tier1/fmtstr.h b/mp/src/public/tier1/fmtstr.h
index 556fc130..66ea88f5 100644
--- a/mp/src/public/tier1/fmtstr.h
+++ b/mp/src/public/tier1/fmtstr.h
@@ -173,7 +173,7 @@ public:
m_nLength = 0;
}
- void AppendFormat( PRINTF_FORMAT_STRING const char *pchFormat, ... )
+ void AppendFormat( PRINTF_FORMAT_STRING const char *pchFormat, ... ) FMTFUNCTION( 2, 3 )
{
char *pchEnd = m_szBuf + m_nLength;
FmtStrVSNPrintf( pchEnd, SIZE_BUF - m_nLength, m_bQuietTruncation, &pchFormat, m_nLength, pchFormat );
diff --git a/mp/src/public/tier1/ilocalize.h b/mp/src/public/tier1/ilocalize.h
index fed7af6d..cbdb8f6e 100644
--- a/mp/src/public/tier1/ilocalize.h
+++ b/mp/src/public/tier1/ilocalize.h
@@ -401,6 +401,35 @@ public:
}
}
+ template < typename T, typename U, typename V, typename W, typename X, typename Y, typename Z >
+ CConstructLocalizedString( const locchar_t *loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4, Y arg5, Z arg6)
+ {
+ COMPILE_TIME_ASSERT( CLocalizedStringArg<T>::kIsValid );
+ COMPILE_TIME_ASSERT( CLocalizedStringArg<U>::kIsValid );
+ COMPILE_TIME_ASSERT( CLocalizedStringArg<V>::kIsValid );
+ COMPILE_TIME_ASSERT( CLocalizedStringArg<W>::kIsValid );
+ COMPILE_TIME_ASSERT( CLocalizedStringArg<X>::kIsValid );
+ COMPILE_TIME_ASSERT( CLocalizedStringArg<Y>::kIsValid );
+ COMPILE_TIME_ASSERT( CLocalizedStringArg<Z>::kIsValid );
+
+ m_loc_Buffer[0] = '\0';
+
+ if ( loc_Format )
+ {
+ ::ILocalize::ConstructString( m_loc_Buffer,
+ sizeof( m_loc_Buffer ),
+ loc_Format,
+ 7,
+ CLocalizedStringArg<T>( arg0 ).GetLocArg(),
+ CLocalizedStringArg<U>( arg1 ).GetLocArg(),
+ CLocalizedStringArg<V>( arg2 ).GetLocArg(),
+ CLocalizedStringArg<W>( arg3 ).GetLocArg(),
+ CLocalizedStringArg<X>( arg4 ).GetLocArg(),
+ CLocalizedStringArg<Y>( arg5 ).GetLocArg(),
+ CLocalizedStringArg<Z>( arg6 ).GetLocArg() );
+ }
+ }
+
CConstructLocalizedString( const locchar_t *loc_Format, KeyValues *pKeyValues )
{
m_loc_Buffer[0] = '\0';
diff --git a/mp/src/public/tier1/snappy-sinksource.h b/mp/src/public/tier1/snappy-sinksource.h
index 430baeab..faabfa1e 100644
--- a/mp/src/public/tier1/snappy-sinksource.h
+++ b/mp/src/public/tier1/snappy-sinksource.h
@@ -60,6 +60,7 @@ class Sink {
// The default implementation always returns the scratch buffer.
virtual char* GetAppendBuffer(size_t length, char* scratch);
+
private:
// No copying
Sink(const Sink&);
diff --git a/mp/src/public/tier1/snappy-stubs-public.h b/mp/src/public/tier1/snappy-stubs-public.h
new file mode 100644
index 00000000..6b41bbe9
--- /dev/null
+++ b/mp/src/public/tier1/snappy-stubs-public.h
@@ -0,0 +1,98 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+// Author: [email protected] (Steinar H. Gunderson)
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Various type stubs for the open-source version of Snappy.
+//
+// This file cannot include config.h, as it is included from snappy.h,
+// which is a public header. Instead, snappy-stubs-public.h is generated by
+// from snappy-stubs-public.h.in at configure time.
+
+#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
+#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
+
+#if 1
+#include <stdint.h>
+#endif
+
+#if 1
+#include <stddef.h>
+#endif
+
+#if 0
+#include <sys/uio.h>
+#endif
+
+#define SNAPPY_MAJOR 1
+#define SNAPPY_MINOR 1
+#define SNAPPY_PATCHLEVEL 2
+#define SNAPPY_VERSION \
+ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL)
+
+#include <string>
+
+namespace snappy {
+
+#if 1
+typedef int8_t int8;
+typedef uint8_t uint8;
+typedef int16_t int16;
+typedef uint16_t uint16;
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;
+#else
+typedef signed char int8;
+typedef unsigned char uint8;
+typedef short int16;
+typedef unsigned short uint16;
+typedef int int32;
+typedef unsigned int uint32;
+typedef long long int64;
+typedef unsigned long long uint64;
+#endif
+
+typedef std::string string;
+
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+#if !0
+// Windows does not have an iovec type, yet the concept is universally useful.
+// It is simple to define it ourselves, so we put it inside our own namespace.
+struct iovec {
+ void* iov_base;
+ size_t iov_len;
+};
+#endif
+
+} // namespace snappy
+
+#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
diff --git a/mp/src/public/tier1/snappy.h b/mp/src/public/tier1/snappy.h
index c5eeea01..fbb1af7a 100644
--- a/mp/src/public/tier1/snappy.h
+++ b/mp/src/public/tier1/snappy.h
@@ -49,17 +49,7 @@
#endif //_WIN32
#include <string>
-#include "tier0/platform.h"
-
-#define SNAPPY_MAJOR 1
-#define SNAPPY_MINOR 0
-#define SNAPPY_PATCHLEVEL 3
-#define SNAPPY_VERSION \
- ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL)
-
-#define SNAPPY_DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
+#include "snappy-stubs-public.h"
namespace snappy {
class Source;
@@ -73,6 +63,13 @@ namespace snappy {
// number of bytes written.
size_t Compress(Source* source, Sink* sink);
+ // Find the uncompressed length of the given stream, as given by the header.
+ // Note that the true length could deviate from this; the stream could e.g.
+ // be truncated.
+ //
+ // Also note that this leaves "*source" in a state that is unsuitable for
+ // further operations, such as RawUncompress(). You will need to rewind
+ // or recreate the source yourself before attempting any further calls.
bool GetUncompressedLength(Source* source, uint32* result);
// ------------------------------------------------------------------------
@@ -134,6 +131,28 @@ namespace snappy {
// returns false if the message is corrupted and could not be decrypted
bool RawUncompress(Source* compressed, char* uncompressed);
+ // Given data in "compressed[0..compressed_length-1]" generated by
+ // calling the Snappy::Compress routine, this routine
+ // stores the uncompressed data to the iovec "iov". The number of physical
+ // buffers in "iov" is given by iov_cnt and their cumulative size
+ // must be at least GetUncompressedLength(compressed). The individual buffers
+ // in "iov" must not overlap with each other.
+ //
+ // returns false if the message is corrupted and could not be decrypted
+ bool RawUncompressToIOVec(const char* compressed, size_t compressed_length,
+ const struct iovec* iov, size_t iov_cnt);
+
+ // Given data from the byte source 'compressed' generated by calling
+ // the Snappy::Compress routine, this routine stores the uncompressed
+ // data to the iovec "iov". The number of physical
+ // buffers in "iov" is given by iov_cnt and their cumulative size
+ // must be at least GetUncompressedLength(compressed). The individual buffers
+ // in "iov" must not overlap with each other.
+ //
+ // returns false if the message is corrupted and could not be decrypted
+ bool RawUncompressToIOVec(Source* compressed, const struct iovec* iov,
+ size_t iov_cnt);
+
// Returns the maximal size of the compressed representation of
// input data that is "source_bytes" bytes in length;
size_t MaxCompressedLength(size_t source_bytes);
@@ -152,20 +171,20 @@ namespace snappy {
bool IsValidCompressedBuffer(const char* compressed,
size_t compressed_length);
- // *** DO NOT CHANGE THE VALUE OF kBlockSize ***
+ // The size of a compression block. Note that many parts of the compression
+ // code assumes that kBlockSize <= 65536; in particular, the hash table
+ // can only store 16-bit offsets, and EmitCopy() also assumes the offset
+ // is 65535 bytes or less. Note also that if you change this, it will
+ // affect the framing format (see framing_format.txt).
//
- // New Compression code chops up the input into blocks of at most
- // the following size. This ensures that back-references in the
- // output never cross kBlockSize block boundaries. This can be
- // helpful in implementing blocked decompression. However the
- // decompression code should not rely on this guarantee since older
- // compression code may not obey it.
- static const int kBlockLog = 15;
- static const int kBlockSize = 1 << kBlockLog;
+ // Note that there might be older data around that is compressed with larger
+ // block sizes, so the decompression code should not rely on the
+ // non-existence of long backreferences.
+ static const int kBlockLog = 16;
+ static const size_t kBlockSize = 1 << kBlockLog;
static const int kMaxHashTableBits = 14;
- static const int kMaxHashTableSize = 1 << kMaxHashTableBits;
-
+ static const size_t kMaxHashTableSize = 1 << kMaxHashTableBits;
} // end namespace snappy
diff --git a/mp/src/public/tier1/strtools.h b/mp/src/public/tier1/strtools.h
index d3f1c65b..035789f9 100644
--- a/mp/src/public/tier1/strtools.h
+++ b/mp/src/public/tier1/strtools.h
@@ -337,6 +337,7 @@ bool Q_StripPrecedingAndTrailingWhitespaceW( wchar_t *pwch );
// like punctuation spaces, non-breaking spaces, composing characters, and so on
bool Q_AggressiveStripPrecedingAndTrailingWhitespace( char *pch );
bool Q_AggressiveStripPrecedingAndTrailingWhitespaceW( wchar_t *pwch );
+bool Q_RemoveAllEvilCharacters( char *pch );
// Functions for converting hexidecimal character strings back into binary data etc.
//
diff --git a/mp/src/public/tier1/utlbinaryblock.h b/mp/src/public/tier1/utlbinaryblock.h
new file mode 100644
index 00000000..93c6e680
--- /dev/null
+++ b/mp/src/public/tier1/utlbinaryblock.h
@@ -0,0 +1,107 @@
+//====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
+//
+// Purpose:
+//
+//=============================================================================
+
+#ifndef UTLBINARYBLOCK_H
+#define UTLBINARYBLOCK_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier1/utlmemory.h"
+#include "tier1/strtools.h"
+#include "limits.h"
+
+//-----------------------------------------------------------------------------
+// Base class, containing simple memory management
+//-----------------------------------------------------------------------------
+class CUtlBinaryBlock
+{
+public:
+ CUtlBinaryBlock( int growSize = 0, int initSize = 0 );
+
+ // NOTE: nInitialLength indicates how much of the buffer starts full
+ CUtlBinaryBlock( void* pMemory, int nSizeInBytes, int nInitialLength );
+ CUtlBinaryBlock( const void* pMemory, int nSizeInBytes );
+ CUtlBinaryBlock( const CUtlBinaryBlock& src );
+
+ void Get( void *pValue, int nMaxLen ) const;
+ void Set( const void *pValue, int nLen );
+ const void *Get( ) const;
+ void *Get( );
+
+ unsigned char& operator[]( int i );
+ const unsigned char& operator[]( int i ) const;
+
+ int Length() const;
+ void SetLength( int nLength ); // Undefined memory will result
+ bool IsEmpty() const;
+ void Clear();
+ void Purge();
+
+ bool IsReadOnly() const;
+
+ CUtlBinaryBlock &operator=( const CUtlBinaryBlock &src );
+
+ // Test for equality
+ bool operator==( const CUtlBinaryBlock &src ) const;
+
+private:
+ CUtlMemory<unsigned char> m_Memory;
+ int m_nActualLength;
+};
+
+
+//-----------------------------------------------------------------------------
+// class inlines
+//-----------------------------------------------------------------------------
+inline const void *CUtlBinaryBlock::Get( ) const
+{
+ return m_Memory.Base();
+}
+
+inline void *CUtlBinaryBlock::Get( )
+{
+ return m_Memory.Base();
+}
+
+inline int CUtlBinaryBlock::Length() const
+{
+ return m_nActualLength;
+}
+
+inline unsigned char& CUtlBinaryBlock::operator[]( int i )
+{
+ return m_Memory[i];
+}
+
+inline const unsigned char& CUtlBinaryBlock::operator[]( int i ) const
+{
+ return m_Memory[i];
+}
+
+inline bool CUtlBinaryBlock::IsReadOnly() const
+{
+ return m_Memory.IsReadOnly();
+}
+
+inline bool CUtlBinaryBlock::IsEmpty() const
+{
+ return Length() == 0;
+}
+
+inline void CUtlBinaryBlock::Clear()
+{
+ SetLength( 0 );
+}
+
+inline void CUtlBinaryBlock::Purge()
+{
+ SetLength( 0 );
+ m_Memory.Purge();
+}
+
+#endif // UTLBINARYBLOCK_H
+
diff --git a/mp/src/public/tier1/utlmemory.h b/mp/src/public/tier1/utlmemory.h
index 2b817bb2..9c5a1d14 100644
--- a/mp/src/public/tier1/utlmemory.h
+++ b/mp/src/public/tier1/utlmemory.h
@@ -552,7 +552,7 @@ inline T& CUtlMemory<T,I>::operator[]( I i )
// Avoid function calls in the asserts to improve debug build performance
Assert( m_nGrowSize != EXTERNAL_CONST_BUFFER_MARKER ); //Assert( !IsReadOnly() );
Assert( (uint32)i < (uint32)m_nAllocationCount );
- return m_pMemory[i];
+ return m_pMemory[(uint32)i];
}
template< class T, class I >
@@ -560,7 +560,7 @@ inline const T& CUtlMemory<T,I>::operator[]( I i ) const
{
// Avoid function calls in the asserts to improve debug build performance
Assert( (uint32)i < (uint32)m_nAllocationCount );
- return m_pMemory[i];
+ return m_pMemory[(uint32)i];
}
template< class T, class I >
@@ -569,7 +569,7 @@ inline T& CUtlMemory<T,I>::Element( I i )
// Avoid function calls in the asserts to improve debug build performance
Assert( m_nGrowSize != EXTERNAL_CONST_BUFFER_MARKER ); //Assert( !IsReadOnly() );
Assert( (uint32)i < (uint32)m_nAllocationCount );
- return m_pMemory[i];
+ return m_pMemory[(uint32)i];
}
template< class T, class I >
@@ -577,7 +577,7 @@ inline const T& CUtlMemory<T,I>::Element( I i ) const
{
// Avoid function calls in the asserts to improve debug build performance
Assert( (uint32)i < (uint32)m_nAllocationCount );
- return m_pMemory[i];
+ return m_pMemory[(uint32)i];
}
diff --git a/mp/src/public/tier1/utlrbtree.h b/mp/src/public/tier1/utlrbtree.h
index 70b0d72c..273ee958 100644
--- a/mp/src/public/tier1/utlrbtree.h
+++ b/mp/src/public/tier1/utlrbtree.h
@@ -217,6 +217,8 @@ public:
void RemoveAll( );
void Purge();
+ bool HasElement( T const &search ) const { return Find( search ) != InvalidIndex(); }
+
// Allocation, deletion
void FreeNode( I i );
diff --git a/mp/src/public/tier1/utlstring.h b/mp/src/public/tier1/utlstring.h
index c50765fa..32714e12 100644
--- a/mp/src/public/tier1/utlstring.h
+++ b/mp/src/public/tier1/utlstring.h
@@ -16,8 +16,7 @@
#include "limits.h"
#if defined( OSX )
-#define wcsdup wcsdup_osx
-inline wchar_t *wcsdup_osx(const wchar_t *pString)
+inline wchar_t *wcsdup(const wchar_t *pString)
{
wchar_t *pMemory;
@@ -32,97 +31,14 @@ inline wchar_t *wcsdup_osx(const wchar_t *pString)
return NULL;
}
-#endif
-
-//-----------------------------------------------------------------------------
-// Base class, containing simple memory management
-//-----------------------------------------------------------------------------
-class CUtlBinaryBlock
-{
-public:
- CUtlBinaryBlock( int growSize = 0, int initSize = 0 );
-
- // NOTE: nInitialLength indicates how much of the buffer starts full
- CUtlBinaryBlock( void* pMemory, int nSizeInBytes, int nInitialLength );
- CUtlBinaryBlock( const void* pMemory, int nSizeInBytes );
- CUtlBinaryBlock( const CUtlBinaryBlock& src );
-
- void Get( void *pValue, int nMaxLen ) const;
- void Set( const void *pValue, int nLen );
- const void *Get( ) const;
- void *Get( );
-
- unsigned char& operator[]( int i );
- const unsigned char& operator[]( int i ) const;
-
- int Length() const;
- void SetLength( int nLength ); // Undefined memory will result
- bool IsEmpty() const;
- void Clear();
- void Purge();
-
- bool IsReadOnly() const;
-
- CUtlBinaryBlock &operator=( const CUtlBinaryBlock &src );
-
- // Test for equality
- bool operator==( const CUtlBinaryBlock &src ) const;
-
-private:
- CUtlMemory<unsigned char> m_Memory;
- int m_nActualLength;
-};
-
-
-//-----------------------------------------------------------------------------
-// class inlines
-//-----------------------------------------------------------------------------
-inline const void *CUtlBinaryBlock::Get( ) const
-{
- return m_Memory.Base();
-}
-
-inline void *CUtlBinaryBlock::Get( )
-{
- return m_Memory.Base();
-}
-
-inline int CUtlBinaryBlock::Length() const
-{
- return m_nActualLength;
-}
-inline unsigned char& CUtlBinaryBlock::operator[]( int i )
+inline size_t strnlen(const char *s, size_t n)
{
- return m_Memory[i];
-}
-
-inline const unsigned char& CUtlBinaryBlock::operator[]( int i ) const
-{
- return m_Memory[i];
-}
-
-inline bool CUtlBinaryBlock::IsReadOnly() const
-{
- return m_Memory.IsReadOnly();
-}
-
-inline bool CUtlBinaryBlock::IsEmpty() const
-{
- return Length() == 0;
-}
-
-inline void CUtlBinaryBlock::Clear()
-{
- SetLength( 0 );
-}
-
-inline void CUtlBinaryBlock::Purge()
-{
- SetLength( 0 );
- m_Memory.Purge();
+ const char *p = (const char *)memchr(s, 0, n);
+ return (p ? p - s : n);
}
+#endif
//-----------------------------------------------------------------------------
// Simple string class.
@@ -140,95 +56,154 @@ public:
public:
CUtlString();
CUtlString( const char *pString );
+ CUtlString( const char *pString, int length );
CUtlString( const CUtlString& string );
- // Attaches the string to external memory. Useful for avoiding a copy
- CUtlString( void* pMemory, int nSizeInBytes, int nInitialLength );
- CUtlString( const void* pMemory, int nSizeInBytes );
+#ifdef MOVE_CONSTRUCTOR_SUPPORT
+ // Support moving of CUtlString objects. Long live C++11
+ // This move constructor will get called when appropriate, such as when
+ // returning objects from functions, or otherwise copying from temporaries
+ // which are about to be destroyed. It can also be explicitly invoked with
+ // std::move().
+ // Move constructor:
+ CUtlString( CUtlString&& rhs )
+ {
+ // Move the string pointer from the source to this -- be sure to
+ // zero out the source to avoid double frees.
+ m_pString = rhs.m_pString;
+ rhs.m_pString = 0;
+ }
+ // Move assignment operator:
+ CUtlString& operator=( CUtlString&& rhs )
+ {
+ // Move the string pointer from the source to this -- be sure to
+ // zero out the source to avoid double frees.
+ m_pString = rhs.m_pString;
+ rhs.m_pString = 0;
+ return *this;
+ }
+#endif
+
+ ~CUtlString();
const char *Get( ) const;
void Set( const char *pValue );
-
- void Clear() { Set( NULL ); }
-
- // Converts to c-strings
operator const char*() const;
+ // Set directly and don't look for a null terminator in pValue.
+ // nChars does not include the nul and this will only copy
+ // at most nChars (even if pValue is longer). If nChars
+ // is >strlen(pValue) it will copy past the end, don't do it
+ // Does nothing if pValue == String()
+ void SetDirect( const char *pValue, int nChars );
+
// for compatibility switching items from UtlSymbol
const char *String() const { return Get(); }
// Returns strlen
int Length() const;
+ // IsEmpty() is more efficient than Length() == 0
bool IsEmpty() const;
// Sets the length (used to serialize into the buffer )
// Note: If nLen != 0, then this adds an extra byte for a null-terminator.
void SetLength( int nLen );
- char *Get();
+ char *GetForModify();
+ void Clear();
void Purge();
// Case Change
void ToLower();
void ToUpper();
+ void Append( const char *pAddition, int nChars );
void Append( const char *pchAddition );
-
+ void Append( const char chAddition ) { char temp[2] = { chAddition, 0 }; Append( temp ); }
// Strips the trailing slash
void StripTrailingSlash();
+ void FixSlashes( char cSeparator = CORRECT_PATH_SEPARATOR );
+
+ // Trim whitespace
+ void TrimLeft( char cTarget );
+ void TrimLeft( const char *szTargets = "\t\r\n " );
+ void TrimRight( char cTarget );
+ void TrimRight( const char *szTargets = "\t\r\n " );
+ void Trim( char cTarget );
+ void Trim( const char *szTargets = "\t\r\n " );
+
+ bool IsEqual_CaseSensitive( const char *src ) const;
+ bool IsEqual_CaseInsensitive( const char *src ) const;
CUtlString &operator=( const CUtlString &src );
CUtlString &operator=( const char *src );
// Test for equality
bool operator==( const CUtlString &src ) const;
- bool operator==( const char *src ) const;
bool operator!=( const CUtlString &src ) const { return !operator==( src ); }
- bool operator!=( const char *src ) const { return !operator==( src ); }
-
- // If these are not defined, CUtlString as rhs will auto-convert
- // to const char* and do logical operations on the raw pointers. Ugh.
- inline friend bool operator==( const char *lhs, const CUtlString &rhs ) { return rhs.operator==( lhs ); }
- inline friend bool operator!=( const char *lhs, const CUtlString &rhs ) { return rhs.operator!=( lhs ); }
CUtlString &operator+=( const CUtlString &rhs );
CUtlString &operator+=( const char *rhs );
CUtlString &operator+=( char c );
CUtlString &operator+=( int rhs );
CUtlString &operator+=( double rhs );
-
- // is valid?
- bool IsValid() const;
- bool MatchesPattern( const CUtlString &Pattern, int nFlags = 0 ); // case SENSITIVE, use * for wildcard in pattern string
+ CUtlString operator+( const char *pOther ) const;
+ CUtlString operator+( const CUtlString &other ) const;
+ CUtlString operator+( int rhs ) const;
- int Format( PRINTF_FORMAT_STRING const char *pFormat, ... );
- void SetDirect( const char *pValue, int nChars );
+ bool MatchesPattern( const CUtlString &Pattern, int nFlags = 0 ) const; // case SENSITIVE, use * for wildcard in pattern string
+
+ char operator[]( int i ) const;
+
+#if ! defined(SWIG)
+ // Don't let SWIG see the PRINTF_FORMAT_STRING attribute or it will complain.
+ int Format( PRINTF_FORMAT_STRING const char *pFormat, ... ) FMTFUNCTION( 2, 3 );
+ int FormatV( PRINTF_FORMAT_STRING const char *pFormat, va_list marker );
+#else
+ int Format( const char *pFormat, ... );
+ int FormatV( const char *pFormat, va_list marker );
+#endif
// Defining AltArgumentType_t hints that associative container classes should
// also implement Find/Insert/Remove functions that take const char* params.
typedef const char *AltArgumentType_t;
- // Take a piece out of the string.
+ // Get a copy of part of the string.
// If you only specify nStart, it'll go from nStart to the end.
// You can use negative numbers and it'll wrap around to the start.
- CUtlString Slice( int32 nStart=0, int32 nEnd=INT_MAX );
+ CUtlString Slice( int32 nStart=0, int32 nEnd=INT_MAX ) const;
+
+ // Get a substring starting from the left or the right side.
+ CUtlString Left( int32 nChars ) const;
+ CUtlString Right( int32 nChars ) const;
- // Grab a substring starting from the left or the right side.
- CUtlString Left( int32 nChars );
- CUtlString Right( int32 nChars );
+ // Get a string with all instances of one character replaced with another.
+ CUtlString Replace( char cFrom, char cTo ) const;
- // Replace all instances of one character with another.
- CUtlString Replace( char cFrom, char cTo );
+ // Replace all instances of specified string with another.
+ CUtlString Replace( const char *pszFrom, const char *pszTo ) const;
- // Calls right through to V_MakeAbsolutePath.
- CUtlString AbsPath( const char *pStartingDir=NULL );
+ // Get this string as an absolute path (calls right through to V_MakeAbsolutePath).
+ CUtlString AbsPath( const char *pStartingDir=NULL ) const;
// Gets the filename (everything except the path.. c:\a\b\c\somefile.txt -> somefile.txt).
- CUtlString UnqualifiedFilename();
-
- // Strips off one directory. Uses V_StripLastDir but strips the last slash also!
- CUtlString DirName();
+ CUtlString UnqualifiedFilename() const;
+ // Gets a string with one directory removed. Uses V_StripLastDir but strips the last slash also!
+ CUtlString DirName() const;
+
+ // Get a string with the extension removed (with V_StripExtension).
+ CUtlString StripExtension() const;
+
+ // Get a string with the filename removed (uses V_UnqualifiedFileName and also strips the last slash)
+ CUtlString StripFilename() const;
+
+ // Get a string with the base filename (with V_FileBase).
+ CUtlString GetBaseFilename() const;
+
+ // Get a string with the file extension (with V_FileBase).
+ CUtlString GetExtension() const;
+
// Works like V_ComposeFileName.
static CUtlString PathJoin( const char *pStr1, const char *pStr2 );
@@ -236,21 +211,93 @@ public:
static int __cdecl SortCaseInsensitive( const CUtlString *pString1, const CUtlString *pString2 );
static int __cdecl SortCaseSensitive( const CUtlString *pString1, const CUtlString *pString2 );
+ // Empty string for those times when you need to return an empty string and
+ // either don't want to pay the construction cost, or are returning a
+ // const CUtlString& and cannot just return "".
+ static const CUtlString &GetEmptyString();
+
private:
- CUtlBinaryBlock m_Storage;
+ // INTERNALS
+ // AllocMemory allocates enough space for length characters plus a terminating zero.
+ // Previous characters are preserved, the buffer is null-terminated, but new characters
+ // are not touched.
+ void *AllocMemory( uint32 length );
+
+ // If m_pString is not NULL, it points to the start of the string, and the memory allocation.
+ char *m_pString;
};
+// // If these are not defined, CUtlConstString as rhs will auto-convert
+// // to const char* and do logical operations on the raw pointers. Ugh.
+// inline friend bool operator<( const T *lhs, const CUtlConstStringBase &rhs ) { return rhs.Compare( lhs ) > 0; }
+// inline friend bool operator==( const T *lhs, const CUtlConstStringBase &rhs ) { return rhs.Compare( lhs ) == 0; }
+// inline friend bool operator!=( const T *lhs, const CUtlConstStringBase &rhs ) { return rhs.Compare( lhs ) != 0; }
+
+inline bool operator==( const char *pString, const CUtlString &utlString )
+{
+ return utlString.IsEqual_CaseSensitive( pString );
+}
+
+inline bool operator!=( const char *pString, const CUtlString &utlString )
+{
+ return !utlString.IsEqual_CaseSensitive( pString );
+}
+
+inline bool operator==( const CUtlString &utlString, const char *pString )
+{
+ return utlString.IsEqual_CaseSensitive( pString );
+}
+
+inline bool operator!=( const CUtlString &utlString, const char *pString )
+{
+ return !utlString.IsEqual_CaseSensitive( pString );
+}
+
+
+
//-----------------------------------------------------------------------------
// Inline methods
//-----------------------------------------------------------------------------
-inline bool CUtlString::IsEmpty() const
+inline CUtlString::CUtlString()
+: m_pString( NULL )
+{
+}
+
+inline CUtlString::CUtlString( const char *pString )
+: m_pString( NULL )
+{
+ Set( pString );
+}
+
+inline CUtlString::CUtlString( const char *pString, int length )
+: m_pString( NULL )
+{
+ SetDirect( pString, length );
+}
+
+inline CUtlString::CUtlString( const CUtlString& string )
+: m_pString( NULL )
{
- return Length() == 0;
+ Set( string.Get() );
}
-inline bool CUtlString::IsValid() const
+inline CUtlString::~CUtlString()
{
- return ( String() != NULL );
+ Purge();
+}
+
+inline int CUtlString::Length() const
+{
+ if (m_pString)
+ {
+ return V_strlen( m_pString );
+ }
+ return 0;
+}
+
+inline bool CUtlString::IsEmpty() const
+{
+ return !m_pString || m_pString[0] == 0;
}
inline int __cdecl CUtlString::SortCaseInsensitive( const CUtlString *pString1, const CUtlString *pString2 )
@@ -263,6 +310,14 @@ inline int __cdecl CUtlString::SortCaseSensitive( const CUtlString *pString1, co
return V_strcmp( pString1->String(), pString2->String() );
}
+// Converts to c-strings
+inline CUtlString::operator const char*() const
+{
+ return Get();
+}
+
+
+
//-----------------------------------------------------------------------------
// Purpose: Implementation of low-level string functionality for character types.
//-----------------------------------------------------------------------------
@@ -398,5 +453,8 @@ typedef CUtlConstStringBase<wchar_t> CUtlConstWideString;
template < typename T > struct UTLConstStringCaselessStringLessFunctor { bool operator()( const CUtlConstStringBase<T>& a, const char *b ) const { return StringFuncs<T>::CaselessCompare( a.Get(), b ) < 0; } };
template < typename T > struct UTLConstStringCaselessStringEqualFunctor { bool operator()( const CUtlConstStringBase<T>& a, const char *b ) const { return StringFuncs<T>::CaselessCompare( a.Get(), b ) == 0; } };
+// Helper function for CUtlMaps with a CUtlString key
+inline bool UtlStringLessFunc( const CUtlString &lhs, const CUtlString &rhs ) { return V_strcmp( lhs.Get(), rhs.Get() ) < 0; }
+inline bool UtlStringCaseInsensitiveLessFunc( const CUtlString &lhs, const CUtlString &rhs ) { return V_stricmp( lhs.Get(), rhs.Get() ) < 0; }
#endif // UTLSTRING_H
diff --git a/mp/src/public/tier1/utlvector.h b/mp/src/public/tier1/utlvector.h
index 180b51e4..0ddf4ad0 100644
--- a/mp/src/public/tier1/utlvector.h
+++ b/mp/src/public/tier1/utlvector.h
@@ -581,6 +581,19 @@ inline CUtlVector<T, A>& CUtlVector<T, A>::operator=( const CUtlVector<T, A> &ot
return *this;
}
+#ifdef STAGING_ONLY
+inline void StagingUtlVectorBoundsCheck( int i, int size )
+{
+ if ( (unsigned)i >= (unsigned)size )
+ {
+ Msg( "Array access error: %d / %d\n", i, size );
+ DebuggerBreak();
+ }
+}
+
+#else
+#define StagingUtlVectorBoundsCheck( _i, _size )
+#endif
//-----------------------------------------------------------------------------
// element access
@@ -590,6 +603,7 @@ inline T& CUtlVector<T, A>::operator[]( int i )
{
// Do an inline unsigned check for maximum debug-build performance.
Assert( (unsigned)i < (unsigned)m_Size );
+ StagingUtlVectorBoundsCheck( i, m_Size );
return m_Memory[ i ];
}
@@ -598,6 +612,7 @@ inline const T& CUtlVector<T, A>::operator[]( int i ) const
{
// Do an inline unsigned check for maximum debug-build performance.
Assert( (unsigned)i < (unsigned)m_Size );
+ StagingUtlVectorBoundsCheck( i, m_Size );
return m_Memory[ i ];
}
@@ -606,6 +621,7 @@ inline T& CUtlVector<T, A>::Element( int i )
{
// Do an inline unsigned check for maximum debug-build performance.
Assert( (unsigned)i < (unsigned)m_Size );
+ StagingUtlVectorBoundsCheck( i, m_Size );
return m_Memory[ i ];
}
@@ -614,6 +630,7 @@ inline const T& CUtlVector<T, A>::Element( int i ) const
{
// Do an inline unsigned check for maximum debug-build performance.
Assert( (unsigned)i < (unsigned)m_Size );
+ StagingUtlVectorBoundsCheck( i, m_Size );
return m_Memory[ i ];
}
@@ -621,6 +638,7 @@ template< typename T, class A >
inline T& CUtlVector<T, A>::Head()
{
Assert( m_Size > 0 );
+ StagingUtlVectorBoundsCheck( 0, m_Size );
return m_Memory[ 0 ];
}
@@ -628,6 +646,7 @@ template< typename T, class A >
inline const T& CUtlVector<T, A>::Head() const
{
Assert( m_Size > 0 );
+ StagingUtlVectorBoundsCheck( 0, m_Size );
return m_Memory[ 0 ];
}
@@ -635,6 +654,7 @@ template< typename T, class A >
inline T& CUtlVector<T, A>::Tail()
{
Assert( m_Size > 0 );
+ StagingUtlVectorBoundsCheck( 0, m_Size );
return m_Memory[ m_Size - 1 ];
}
@@ -642,6 +662,7 @@ template< typename T, class A >
inline const T& CUtlVector<T, A>::Tail() const
{
Assert( m_Size > 0 );
+ StagingUtlVectorBoundsCheck( 0, m_Size );
return m_Memory[ m_Size - 1 ];
}
diff --git a/mp/src/public/tier2/p4helpers.h b/mp/src/public/tier2/p4helpers.h
index f4441974..8d4b3b3f 100644
--- a/mp/src/public/tier2/p4helpers.h
+++ b/mp/src/public/tier2/p4helpers.h
@@ -36,6 +36,9 @@ public:
// Is the file in perforce?
virtual bool IsFileInPerforce();
+ // Changes the file to the specified filetype.
+ virtual bool SetFileType( const CUtlString& desiredFileType );
+
protected:
// The filename that this class instance represents
CUtlString m_sFilename;
@@ -53,6 +56,7 @@ public:
virtual bool Edit( void ) { return true; }
virtual bool Add( void ) { return true; }
virtual bool IsFileInPerforce() { return false; }
+ virtual bool SetFileType(const CUtlString& desiredFileType) { return true; }
};
@@ -122,16 +126,35 @@ protected:
class CP4AutoEditAddFile
{
public:
- explicit CP4AutoEditAddFile( char const *szFilename ) : m_spImpl( g_p4factory->AccessFile( szFilename ) )
+ explicit CP4AutoEditAddFile( char const *szFilename )
+ : m_spImpl( g_p4factory->AccessFile( szFilename ) )
+ , m_bHasDesiredFileType( false )
+ {
+ m_spImpl->Edit();
+ }
+
+ explicit CP4AutoEditAddFile( char const *szFilename, const char *szFiletype )
+ : m_spImpl( g_p4factory->AccessFile( szFilename ) )
+ , m_sFileType(szFiletype)
+ , m_bHasDesiredFileType( true )
{
m_spImpl->Edit();
+ m_spImpl->SetFileType( m_sFileType );
+ }
+
+ ~CP4AutoEditAddFile( void )
+ {
+ m_spImpl->Add();
+ if ( m_bHasDesiredFileType )
+ m_spImpl->SetFileType( m_sFileType );
}
- ~CP4AutoEditAddFile( void ) { m_spImpl->Add(); }
CP4File * File() const { return m_spImpl.Get(); }
protected:
CPlainAutoPtr< CP4File > m_spImpl;
+ CUtlString m_sFileType;
+ bool m_bHasDesiredFileType;
};
diff --git a/mp/src/public/togl/linuxwin/cglmprogram.h b/mp/src/public/togl/linuxwin/cglmprogram.h
index ca9a47a8..8fa09fa2 100644
--- a/mp/src/public/togl/linuxwin/cglmprogram.h
+++ b/mp/src/public/togl/linuxwin/cglmprogram.h
@@ -202,7 +202,7 @@ public:
uint nWidth = nWidthHeight & 0xFFFF, nHeight = nWidthHeight >> 16;
// Apply half pixel offset to output vertices to account for the pixel center difference between D3D9 and OpenGL.
// We output vertices in clip space, which ranges from [-1,1], so 1.0/width in clip space transforms into .5/width in screenspace, see: "Viewports and Clipping (Direct3D 9)" in the DXSDK
- float v[4] = { 1.0f / nWidth, 1.0f / nHeight, nWidth, nHeight };
+ float v[4] = { 1.0f / (float)nWidth, 1.0f / (float)nHeight, (float)nWidth, (float)nHeight };
if ( m_locVertexScreenParams >= 0 )
gGL->glUniform4fv( m_locVertexScreenParams, 1, v );
}
diff --git a/mp/src/public/togl/osx/glmgrbasics.h b/mp/src/public/togl/osx/glmgrbasics.h
index dbed35dd..d6476b3d 100644
--- a/mp/src/public/togl/osx/glmgrbasics.h
+++ b/mp/src/public/togl/osx/glmgrbasics.h
@@ -1,299 +1,299 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// glmgrbasics.h
-// types, common headers, forward declarations, utilities
-//
-//===============================================================================
-
-#ifndef GLMBASICS_H
-#define GLMBASICS_H
-
-#pragma once
-
-#ifdef OSX
-#include <OpenGL/OpenGL.h>
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#include <OpenGL/CGLTypes.h>
-#include <OpenGL/CGLRenderers.h>
-#include <OpenGL/CGLCurrent.h>
-//#include <OpenGL/CGLProfiler.h>
-//#include <ApplicationServices/ApplicationServices.h>
-#elif defined(LINUX)
-#include <GL/gl.h>
-#include <GL/glext.h>
-#else
-#error
-#endif
-
-#include "tier0/platform.h"
-
-#include "bitmap/imageformat.h"
-#include "bitvec.h"
-#include "tier1/checksum_md5.h"
-#include "tier1/utlvector.h"
-#include "tier1/convar.h"
-
-#include <sys/stat.h>
-
-#include "dxabstract_types.h"
-
-// types
-struct GLMRect;
-typedef void *PseudoGLContextPtr;
-
-
- // 3-d integer box (used for texture lock/unlock etc)
-struct GLMRegion
-{
- int xmin,xmax;
- int ymin,ymax;
- int zmin,zmax;
-};
-
-struct GLMRect // follows GL convention - if coming from the D3D rect you will need to fiddle the Y's
-{
- int xmin; // left
- int ymin; // bottom
- int xmax; // right
- int ymax; // top
-};
-
-// macros
-
-//#define GLMassert(x) assert(x)
-
-// forward decls
-class GLMgr; // singleton
-class GLMContext; // GL context
-class CGLMContextTester; // testing class
-class CGLMTex;
-class CGLMFBO;
-class CGLMProgram;
-class CGLMBuffer;
-
-
-// utilities
-
-typedef enum
-{
- // D3D codes
- eD3D_DEVTYPE,
- eD3D_FORMAT,
- eD3D_RTYPE,
- eD3D_USAGE,
- eD3D_RSTATE, // render state
- eD3D_SIO, // D3D shader bytecode
- eD3D_VTXDECLUSAGE,
-
- // CGL codes
- eCGL_RENDID,
-
- // OpenGL error codes
- eGL_ERROR,
-
- // OpenGL enums
- eGL_ENUM,
- eGL_RENDERER
-
-} GLMThing_t;
-
-const char* GLMDecode( GLMThing_t type, unsigned long value ); // decode a numeric const
-const char* GLMDecodeMask( GLMThing_t type, unsigned long value ); // decode a bitmask
-
-void GLMStop( void ); // aka Debugger()
-void GLMCheckError( bool noStop = false, bool noLog= false );
-void GLMEnableTrace( bool on );
-
-// expose these in release now
-// Mimic PIX events so we can decorate debug spew
-void GLMBeginPIXEvent( const char *str );
-void GLMEndPIXEvent( void );
-
-//===============================================================================
-// knob twiddling
-//float GLMKnob( char *knobname, float *setvalue ); // Pass NULL to not-set the knob value
-//float GLMKnobToggle( char *knobname );
-
-//===============================================================================
-// other stuff
-
-// helpers for CGLSetOption - no op if no profiler
-void GLMProfilerClearTrace( void );
-void GLMProfilerEnableTrace( bool enable );
-
-// helpers for CGLSetParameter - no op if no profiler
-void GLMProfilerDumpState( void );
-
-
-//===============================================================================
-// classes
-
-// helper class making function tracking easier to wire up
-#if GLMDEBUG
-class GLMFuncLogger
-{
- public:
-
- // simple function log
- GLMFuncLogger( const char *funcName )
- {
- m_funcName = funcName;
- m_earlyOut = false;
-
- GLMPrintf( ">%s", m_funcName );
- };
-
- // more advanced version lets you pass args (i.e. called parameters or anything else of interest)
- // no macro for this one, since no easy way to pass through the args as well as the funcname
- GLMFuncLogger( const char *funcName, char *fmt, ... )
- {
- m_funcName = funcName;
- m_earlyOut = false;
-
- // this acts like GLMPrintf here
- // all the indent policy is down in GLMPrintfVA
- // which means we need to inject a ">" at the front of the format string to make this work... sigh.
-
- char modifiedFmt[2000];
- modifiedFmt[0] = '>';
- strcpy( modifiedFmt+1, fmt );
-
- va_list vargs;
- va_start(vargs, fmt);
- GLMPrintfVA( modifiedFmt, vargs );
- va_end( vargs );
- }
-
- ~GLMFuncLogger( )
- {
- if (m_earlyOut)
- {
- GLMPrintf( "<%s (early out)", m_funcName );
- }
- else
- {
- GLMPrintf( "<%s", m_funcName );
- }
- };
-
- void EarlyOut( void )
- {
- m_earlyOut = true;
- };
-
- const char *m_funcName; // set at construction time
- bool m_earlyOut;
-};
-
-// handy macro to go with the function tracking class
-#define GLM_FUNC GLMFuncLogger _logger_ ( __FUNCTION__ )
-#else
-#define GLM_FUNC
-#endif
-
-
-// class to keep an in-memory mirror of a file which may be getting edited during run
-class CGLMFileMirror
-{
-public:
- CGLMFileMirror( char *fullpath ); // just associates mirror with file. if file exists it will be read.
- //if non existent it will be created with size zero
- ~CGLMFileMirror( );
-
- bool HasData( void ); // see if data avail
- void GetData( char **dataPtr, uint *dataSizePtr ); // read it out
- void SetData( char *data, uint dataSize ); // put data in (and write it to disk)
- bool PollForChanges( void ); // check disk copy. If different, read it back in and return true.
-
- void UpdateStatInfo( void ); // make sure stat info is current for our file
- void ReadFile( void );
- void WriteFile( void );
-
- void OpenInEditor( bool foreground=false ); // pass TRUE if you would like the editor to pop to foreground
-
- /// how about a "wait for change" method..
-
- char *m_path; // fullpath to file
- bool m_exists;
- struct stat m_stat; // stat results for the file (last time checked)
-
- char *m_data; // content of file
- uint m_size; // length of content
-
-};
-
-// class based on the file mirror, that makes it easy to edit them outside the app.
-
-// it receives an initial block of text from the engine, and hashes it. ("orig")
-// it munges it by duplicating all the text after the "!!" line, and appending it in commented form. ("munged")
-// a mirror file is activated, using a filename based on the hash from the orig text.
-// if there is already content on disk matching that filename, use that content *unless* the 'blitz' parameter is set.
-// (i.e. engine is instructing this subsystem to wipe out any old/modified variants of the text)
-
-
-class CGLMEditableTextItem
-{
-public:
- CGLMEditableTextItem( char *text, uint size, bool forceOverwrite, char *prefix, char *suffix = NULL ); // create a text blob from text source, optional filename suffix
- ~CGLMEditableTextItem( );
-
- bool HasData( void );
- bool PollForChanges( void ); // return true if stale i.e. you need to get a new edition
- void GetCurrentText( char **textOut, uint *sizeOut ); // query for read access to the active blob (could be the original, could be external edited copy)
- void OpenInEditor( bool foreground=false ); // call user attention to this text
-
- // internal methods
- void GenHashOfOrigText( void );
- void GenBaseNameAndFullPath( char *prefix, char *suffix );
- void GenMungedText( bool fromMirror );
-
- // members
- // orig
- uint m_origSize;
- char *m_origText; // what was submitted
- unsigned char m_origDigest[MD5_DIGEST_LENGTH]; // digest of what was submitted
-
- // munged
- uint m_mungedSize;
- char *m_mungedText; // re-processed edition, initial content submission to the file mirror
-
- // mirror
- char *m_mirrorBaseName; // generated from the hash of the orig text, plus the label / prefix
- char *m_mirrorFullPath; // base name
- CGLMFileMirror *m_mirror; // file mirror itself. holds "official" copy for GetCurrentText to return.
-};
-
-
-// debug font
-extern unsigned char g_glmDebugFontMap[16384];
-
-// class for cracking multi-part text blobs
-// sections are demarcated by beginning-of-line markers submitted in a table by the caller
-
-struct GLMTextSection
-{
- int m_markerIndex; // based on table of markers passed in to constructor
- uint m_textOffset; // where is the text - offset
- int m_textLength; // how big is the section
-};
-
-class CGLMTextSectioner
-{
-public:
- CGLMTextSectioner( char *text, int textSize, char **markers ); // constructor finds all the sections
- ~CGLMTextSectioner( );
-
- int Count( void ); // how many sections found
- void GetSection( int index, uint *offsetOut, uint *lengthOut, int *markerIndexOut );
- // find section, size, what marker
- // note that more than one section can be marked similarly.
- // so policy isn't made here, you walk the sections and decide what to do if there are dupes.
-
- //members
-
- //section table
- CUtlVector< GLMTextSection > m_sectionTable;
-};
-
-#endif
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// glmgrbasics.h
+// types, common headers, forward declarations, utilities
+//
+//===============================================================================
+
+#ifndef GLMBASICS_H
+#define GLMBASICS_H
+
+#pragma once
+
+#ifdef OSX
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include <OpenGL/CGLTypes.h>
+#include <OpenGL/CGLRenderers.h>
+#include <OpenGL/CGLCurrent.h>
+//#include <OpenGL/CGLProfiler.h>
+//#include <ApplicationServices/ApplicationServices.h>
+#elif defined(LINUX)
+#include <GL/gl.h>
+#include <GL/glext.h>
+#else
+#error
+#endif
+
+#include "tier0/platform.h"
+
+#include "bitmap/imageformat.h"
+#include "bitvec.h"
+#include "tier1/checksum_md5.h"
+#include "tier1/utlvector.h"
+#include "tier1/convar.h"
+
+#include <sys/stat.h>
+
+#include "dxabstract_types.h"
+
+// types
+struct GLMRect;
+typedef void *PseudoGLContextPtr;
+
+
+ // 3-d integer box (used for texture lock/unlock etc)
+struct GLMRegion
+{
+ int xmin,xmax;
+ int ymin,ymax;
+ int zmin,zmax;
+};
+
+struct GLMRect // follows GL convention - if coming from the D3D rect you will need to fiddle the Y's
+{
+ int xmin; // left
+ int ymin; // bottom
+ int xmax; // right
+ int ymax; // top
+};
+
+// macros
+
+//#define GLMassert(x) assert(x)
+
+// forward decls
+class GLMgr; // singleton
+class GLMContext; // GL context
+class CGLMContextTester; // testing class
+class CGLMTex;
+class CGLMFBO;
+class CGLMProgram;
+class CGLMBuffer;
+
+
+// utilities
+
+typedef enum
+{
+ // D3D codes
+ eD3D_DEVTYPE,
+ eD3D_FORMAT,
+ eD3D_RTYPE,
+ eD3D_USAGE,
+ eD3D_RSTATE, // render state
+ eD3D_SIO, // D3D shader bytecode
+ eD3D_VTXDECLUSAGE,
+
+ // CGL codes
+ eCGL_RENDID,
+
+ // OpenGL error codes
+ eGL_ERROR,
+
+ // OpenGL enums
+ eGL_ENUM,
+ eGL_RENDERER
+
+} GLMThing_t;
+
+const char* GLMDecode( GLMThing_t type, unsigned long value ); // decode a numeric const
+const char* GLMDecodeMask( GLMThing_t type, unsigned long value ); // decode a bitmask
+
+void GLMStop( void ); // aka Debugger()
+void GLMCheckError( bool noStop = false, bool noLog= false );
+void GLMEnableTrace( bool on );
+
+// expose these in release now
+// Mimic PIX events so we can decorate debug spew
+void GLMBeginPIXEvent( const char *str );
+void GLMEndPIXEvent( void );
+
+//===============================================================================
+// knob twiddling
+//float GLMKnob( char *knobname, float *setvalue ); // Pass NULL to not-set the knob value
+//float GLMKnobToggle( char *knobname );
+
+//===============================================================================
+// other stuff
+
+// helpers for CGLSetOption - no op if no profiler
+void GLMProfilerClearTrace( void );
+void GLMProfilerEnableTrace( bool enable );
+
+// helpers for CGLSetParameter - no op if no profiler
+void GLMProfilerDumpState( void );
+
+
+//===============================================================================
+// classes
+
+// helper class making function tracking easier to wire up
+#if GLMDEBUG
+class GLMFuncLogger
+{
+ public:
+
+ // simple function log
+ GLMFuncLogger( const char *funcName )
+ {
+ m_funcName = funcName;
+ m_earlyOut = false;
+
+ GLMPrintf( ">%s", m_funcName );
+ };
+
+ // more advanced version lets you pass args (i.e. called parameters or anything else of interest)
+ // no macro for this one, since no easy way to pass through the args as well as the funcname
+ GLMFuncLogger( const char *funcName, char *fmt, ... )
+ {
+ m_funcName = funcName;
+ m_earlyOut = false;
+
+ // this acts like GLMPrintf here
+ // all the indent policy is down in GLMPrintfVA
+ // which means we need to inject a ">" at the front of the format string to make this work... sigh.
+
+ char modifiedFmt[2000];
+ modifiedFmt[0] = '>';
+ strcpy( modifiedFmt+1, fmt );
+
+ va_list vargs;
+ va_start(vargs, fmt);
+ GLMPrintfVA( modifiedFmt, vargs );
+ va_end( vargs );
+ }
+
+ ~GLMFuncLogger( )
+ {
+ if (m_earlyOut)
+ {
+ GLMPrintf( "<%s (early out)", m_funcName );
+ }
+ else
+ {
+ GLMPrintf( "<%s", m_funcName );
+ }
+ };
+
+ void EarlyOut( void )
+ {
+ m_earlyOut = true;
+ };
+
+ const char *m_funcName; // set at construction time
+ bool m_earlyOut;
+};
+
+// handy macro to go with the function tracking class
+#define GLM_FUNC GLMFuncLogger _logger_ ( __FUNCTION__ )
+#else
+#define GLM_FUNC
+#endif
+
+
+// class to keep an in-memory mirror of a file which may be getting edited during run
+class CGLMFileMirror
+{
+public:
+ CGLMFileMirror( char *fullpath ); // just associates mirror with file. if file exists it will be read.
+ //if non existent it will be created with size zero
+ ~CGLMFileMirror( );
+
+ bool HasData( void ); // see if data avail
+ void GetData( char **dataPtr, uint *dataSizePtr ); // read it out
+ void SetData( char *data, uint dataSize ); // put data in (and write it to disk)
+ bool PollForChanges( void ); // check disk copy. If different, read it back in and return true.
+
+ void UpdateStatInfo( void ); // make sure stat info is current for our file
+ void ReadFile( void );
+ void WriteFile( void );
+
+ void OpenInEditor( bool foreground=false ); // pass TRUE if you would like the editor to pop to foreground
+
+ /// how about a "wait for change" method..
+
+ char *m_path; // fullpath to file
+ bool m_exists;
+ struct stat m_stat; // stat results for the file (last time checked)
+
+ char *m_data; // content of file
+ uint m_size; // length of content
+
+};
+
+// class based on the file mirror, that makes it easy to edit them outside the app.
+
+// it receives an initial block of text from the engine, and hashes it. ("orig")
+// it munges it by duplicating all the text after the "!!" line, and appending it in commented form. ("munged")
+// a mirror file is activated, using a filename based on the hash from the orig text.
+// if there is already content on disk matching that filename, use that content *unless* the 'blitz' parameter is set.
+// (i.e. engine is instructing this subsystem to wipe out any old/modified variants of the text)
+
+
+class CGLMEditableTextItem
+{
+public:
+ CGLMEditableTextItem( char *text, uint size, bool forceOverwrite, char *prefix, char *suffix = NULL ); // create a text blob from text source, optional filename suffix
+ ~CGLMEditableTextItem( );
+
+ bool HasData( void );
+ bool PollForChanges( void ); // return true if stale i.e. you need to get a new edition
+ void GetCurrentText( char **textOut, uint *sizeOut ); // query for read access to the active blob (could be the original, could be external edited copy)
+ void OpenInEditor( bool foreground=false ); // call user attention to this text
+
+ // internal methods
+ void GenHashOfOrigText( void );
+ void GenBaseNameAndFullPath( char *prefix, char *suffix );
+ void GenMungedText( bool fromMirror );
+
+ // members
+ // orig
+ uint m_origSize;
+ char *m_origText; // what was submitted
+ unsigned char m_origDigest[MD5_DIGEST_LENGTH]; // digest of what was submitted
+
+ // munged
+ uint m_mungedSize;
+ char *m_mungedText; // re-processed edition, initial content submission to the file mirror
+
+ // mirror
+ char *m_mirrorBaseName; // generated from the hash of the orig text, plus the label / prefix
+ char *m_mirrorFullPath; // base name
+ CGLMFileMirror *m_mirror; // file mirror itself. holds "official" copy for GetCurrentText to return.
+};
+
+
+// debug font
+extern unsigned char g_glmDebugFontMap[16384];
+
+// class for cracking multi-part text blobs
+// sections are demarcated by beginning-of-line markers submitted in a table by the caller
+
+struct GLMTextSection
+{
+ int m_markerIndex; // based on table of markers passed in to constructor
+ uint m_textOffset; // where is the text - offset
+ int m_textLength; // how big is the section
+};
+
+class CGLMTextSectioner
+{
+public:
+ CGLMTextSectioner( char *text, int textSize, char **markers ); // constructor finds all the sections
+ ~CGLMTextSectioner( );
+
+ int Count( void ); // how many sections found
+ void GetSection( int index, uint *offsetOut, uint *lengthOut, int *markerIndexOut );
+ // find section, size, what marker
+ // note that more than one section can be marked similarly.
+ // so policy isn't made here, you walk the sections and decide what to do if there are dupes.
+
+ //members
+
+ //section table
+ CUtlVector< GLMTextSection > m_sectionTable;
+};
+
+#endif
diff --git a/mp/src/public/toolframework/itoolentity.h b/mp/src/public/toolframework/itoolentity.h
index 7433c14a..38790ef2 100644
--- a/mp/src/public/toolframework/itoolentity.h
+++ b/mp/src/public/toolframework/itoolentity.h
@@ -32,6 +32,9 @@ class CBaseAnimating;
class CTakeDamageInfo;
class ITempEntsSystem;
class IEntityFactoryDictionary;
+class CBaseTempEntity;
+class CGlobalEntityList;
+class IEntityFindFilter;
//-----------------------------------------------------------------------------
@@ -217,13 +220,35 @@ public:
virtual void RadiusDamage( const CTakeDamageInfo &info, const Vector &vecSrc, float flRadius, int iClassIgnore, CBaseEntity *pEntityIgnore ) = 0;
virtual ITempEntsSystem *GetTempEntsSystem( void ) = 0;
+ virtual CBaseTempEntity *GetTempEntList( void ) = 0;
+
+ virtual CGlobalEntityList *GetEntityList( void ) = 0;
+ virtual bool IsEntityPtr( void *pTest ) = 0;
+ virtual CBaseEntity *FindEntityByClassname( CBaseEntity *pStartEntity, const char *szName ) = 0;
+ virtual CBaseEntity *FindEntityByName( CBaseEntity *pStartEntity, const char *szName, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL, IEntityFindFilter *pFilter = NULL ) = 0;
+ virtual CBaseEntity *FindEntityInSphere( CBaseEntity *pStartEntity, const Vector &vecCenter, float flRadius ) = 0;
+ virtual CBaseEntity *FindEntityByTarget( CBaseEntity *pStartEntity, const char *szName ) = 0;
+ virtual CBaseEntity *FindEntityByModel( CBaseEntity *pStartEntity, const char *szModelName ) = 0;
+ virtual CBaseEntity *FindEntityByNameNearest( const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
+ virtual CBaseEntity *FindEntityByNameWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
+ virtual CBaseEntity *FindEntityByClassnameNearest( const char *szName, const Vector &vecSrc, float flRadius ) = 0;
+ virtual CBaseEntity *FindEntityByClassnameWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecSrc, float flRadius ) = 0;
+ virtual CBaseEntity *FindEntityByClassnameWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecMins, const Vector &vecMaxs ) = 0;
+ virtual CBaseEntity *FindEntityGeneric( CBaseEntity *pStartEntity, const char *szName, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
+ virtual CBaseEntity *FindEntityGenericWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
+ virtual CBaseEntity *FindEntityGenericNearest( const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
+ virtual CBaseEntity *FindEntityNearestFacing( const Vector &origin, const Vector &facing, float threshold ) = 0;
+ virtual CBaseEntity *FindEntityClassNearestFacing( const Vector &origin, const Vector &facing, float threshold, char *classname ) = 0;
+ virtual CBaseEntity *FindEntityProcedural( const char *szName, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
};
typedef IServerTools IServerTools001;
+typedef IServerTools IServerTools002;
#define VSERVERTOOLS_INTERFACE_VERSION_1 "VSERVERTOOLS001"
-#define VSERVERTOOLS_INTERFACE_VERSION "VSERVERTOOLS002"
-#define VSERVERTOOLS_INTERFACE_VERSION_INT 2
+#define VSERVERTOOLS_INTERFACE_VERSION_2 "VSERVERTOOLS002"
+#define VSERVERTOOLS_INTERFACE_VERSION "VSERVERTOOLS003"
+#define VSERVERTOOLS_INTERFACE_VERSION_INT 3
//-----------------------------------------------------------------------------
// Purpose: Client side tool interace (right now just handles IClientRenderables).
diff --git a/mp/src/public/vallocator.h b/mp/src/public/vallocator.h
index d9f2130a..ea26dbe6 100644
--- a/mp/src/public/vallocator.h
+++ b/mp/src/public/vallocator.h
@@ -53,16 +53,16 @@ public:
inline void* operator new(size_t size, void *ptr, DummyAllocatorHelper *asdf)
{
- asdf=asdf; // compiler warning.
- size=size;
+ (void)asdf; // Suppress unused-variable compiler warnings.
+ (void)size;
return ptr;
}
inline void operator delete(void *ptrToDelete, void *ptr, DummyAllocatorHelper *asdf)
{
- asdf=asdf; // compiler warning.
- ptr=ptr;
- ptrToDelete=ptrToDelete;
+ (void)asdf; // Suppress unused-variable compiler warnings.
+ (void)ptr;
+ (void)ptrToDelete;
}
// Use these to manually construct and destruct lists of objects.
diff --git a/mp/src/public/vgui/ISurface.h b/mp/src/public/vgui/ISurface.h
index 6289bd59..4ec58997 100644
--- a/mp/src/public/vgui/ISurface.h
+++ b/mp/src/public/vgui/ISurface.h
@@ -19,7 +19,6 @@
#include "appframework/IAppSystem.h"
#include "mathlib/vector2d.h" // must be before the namespace line
-#include <html/ichromehtmlwrapper.h>
#include "IVguiMatInfo.h"
@@ -384,7 +383,7 @@ public:
virtual const char *GetWebkitHTMLUserAgentString() = 0;
- virtual IHTMLChromeController *AccessChromeHTMLController() = 0;
+ virtual void *Deprecated_AccessChromeHTMLController() = 0;
// the origin of the viewport on the framebuffer (Which might not be 0,0 for stereo)
virtual void SetFullscreenViewport( int x, int y, int w, int h ) = 0; // this uses NULL for the render target.
diff --git a/mp/src/public/vgui_controls/HTML.h b/mp/src/public/vgui_controls/HTML.h
index 5306c533..59e76770 100644
--- a/mp/src/public/vgui_controls/HTML.h
+++ b/mp/src/public/vgui_controls/HTML.h
@@ -18,8 +18,11 @@
#include <vgui_controls/PHandle.h>
#include <vgui_controls/FileOpenDialog.h>
#include <vgui_controls/TextEntry.h>
-#include <html/ihtmlchrome.h>
#include <tier1/utlmap.h>
+#ifndef VERSION_SAFE_STEAM_API_INTERFACES
+#define VERSION_SAFE_STEAM_API_INTERFACES
+#endif
+#include "steam/steam_api.h"
class HTMLComboBoxHost;
namespace vgui
@@ -31,7 +34,7 @@ namespace vgui
// It can load any valid URL (i.e local files or web pages), you cannot dynamically change the
// content however (internally to the control that is).
//-----------------------------------------------------------------------------
-class HTML: public Panel, public IHTMLResponses
+class HTML: public Panel
{
DECLARE_CLASS_SIMPLE( HTML, Panel );
// TODO::STYLE
@@ -145,60 +148,53 @@ public:
#endif // DBGFLAG_VALIDATE
void PaintComboBox();
- int BrowserGetIndex() { return m_iBrowser; }
+ ISteamHTMLSurface *SteamHTMLSurface() { return m_SteamAPIContext.SteamHTMLSurface(); }
+
+ void OnHTMLMouseMoved( int x, int y )
+ {
+ if ( m_SteamAPIContext.SteamHTMLSurface() )
+ m_SteamAPIContext.SteamHTMLSurface()->MouseMove( m_unBrowserHandle, x, y );
+ }
+
protected:
virtual void ApplySchemeSettings( IScheme *pScheme );
friend class HTMLComboBoxHost;
vgui::Menu *m_pContextMenu;
+
private:
- // IHTMLResponses callbacks from the browser engine
- virtual void BrowserSetIndex( int idx ) { m_iBrowser = idx; BrowserResize(); SendPendingHTMLMessages(); }
- virtual void BrowserReady( const CMsgBrowserReady *pCmd );
- virtual void BrowserNeedsPaint( const CMsgNeedsPaint *pCmd );
- virtual void BrowserStartRequest( const CMsgStartRequest *pCmd );
- virtual void BrowserURLChanged( const CMsgURLChanged *pCmd );
- virtual void BrowserFinishedRequest( const CMsgFinishedRequest *pCmd );
- virtual void BrowserShowPopup( const CMsgShowPopup *pCmd );
- virtual void BrowserHidePopup( const CMsgHidePopup *pCmd );
- virtual void BrowserOpenNewTab( const CMsgOpenNewTab *pCmd );
- virtual void BrowserPopupHTMLWindow( const CMsgPopupHTMLWindow *pCmd );
- virtual void BrowserSetHTMLTitle( const CMsgSetHTMLTitle *pCmd );
- virtual void BrowserLoadingResource( const CMsgLoadingResource *pCmd );
- virtual void BrowserStatusText( const CMsgStatusText *pCmd );
- virtual void BrowserSetCursor( const CMsgSetCursor *pCmd );
- virtual void BrowserFileLoadDialog( const CMsgFileLoadDialog *pCmd );
- virtual void BrowserShowToolTip( const CMsgShowToolTip *pCmd );
- virtual void BrowserUpdateToolTip( const CMsgUpdateToolTip *pCmd );
- virtual void BrowserHideToolTip( const CMsgHideToolTip *pCmd );
- virtual void BrowserSearchResults( const CMsgSearchResults *pCmd );
- virtual void BrowserClose( const CMsgClose *pCmd );
- virtual void BrowserHorizontalScrollBarSizeResponse( const CMsgHorizontalScrollBarSizeResponse *pCmd );
- virtual void BrowserVerticalScrollBarSizeResponse( const CMsgVerticalScrollBarSizeResponse *pCmd );
- virtual void BrowserGetZoomResponse( const CMsgGetZoomResponse *pCmd );
- virtual void BrowserLinkAtPositionResponse( const CMsgLinkAtPositionResponse *pCmd );
- virtual void BrowserZoomToElementAtPositionResponse( const CMsgZoomToElementAtPositionResponse *pCmd );
- virtual void BrowserJSAlert( const CMsgJSAlert *pCmd );
- virtual void BrowserJSConfirm( const CMsgJSConfirm *pCmd );
- virtual void BrowserCanGoBackandForward( const CMsgCanGoBackAndForward *pCmd );
- virtual void BrowserOpenSteamURL( const CMsgOpenSteamURL *pCmd );
- virtual void BrowserSizePopup( const CMsgSizePopup *pCmd );
- void SendPendingHTMLMessages();
- /*virtual void BrowserResourceResponse( const CMsgResourceResponse *pCmd );*/
- virtual void BrowserScalePageToValueResponse( const CMsgScalePageToValueResponse *pCmd ){}
- virtual void BrowserRequestFullScreen( const CMsgRequestFullScreen *pCmd ) {}
- virtual void BrowserExitFullScreen( const CMsgExitFullScreen *pCmd ) {}
- virtual void BrowserGetCookiesForURLResponse( const CMsgGetCookiesForURLResponse *pCmd ){}
- virtual void BrowserNodeGotFocus( const CMsgNodeHasFocus *pCmd ){}
- virtual void BrowserSavePageToJPEGResponse( const CMsgSavePageToJPEGResponse *pCmd ) {}
- virtual void BrowserFocusedNodeValueResponse( const CMsgFocusedNodeTextResponse *pCmd ) {}
-
- virtual void _DeserializeAndDispatch( HTMLCommandBuffer_t *pCmd );
+ STEAM_CALLBACK( HTML, BrowserNeedsPaint, HTML_NeedsPaint_t, m_NeedsPaint );
+ STEAM_CALLBACK( HTML, BrowserComboNeedsPaint, HTML_ComboNeedsPaint_t, m_ComboNeedsPaint );
+ STEAM_CALLBACK( HTML, BrowserStartRequest, HTML_StartRequest_t, m_StartRequest );
+ STEAM_CALLBACK( HTML, BrowserURLChanged, HTML_URLChanged_t, m_URLChanged );
+ STEAM_CALLBACK( HTML, BrowserFinishedRequest, HTML_FinishedRequest_t, m_FinishedRequest );
+ STEAM_CALLBACK( HTML, BrowserShowPopup, HTML_ShowPopup_t, m_ShowPopup );
+ STEAM_CALLBACK( HTML, BrowserHidePopup, HTML_HidePopup_t, m_HidePopup );
+ STEAM_CALLBACK( HTML, BrowserSizePopup, HTML_SizePopup_t, m_SizePopup );
+
+ STEAM_CALLBACK( HTML, BrowserOpenNewTab, HTML_OpenLinkInNewTab_t, m_LinkInNewTab );
+ STEAM_CALLBACK( HTML, BrowserSetHTMLTitle, HTML_ChangedTitle_t, m_ChangeTitle );
+ STEAM_CALLBACK( HTML, BrowserPopupHTMLWindow, HTML_NewWindow_t, m_NewWindow );
+ STEAM_CALLBACK( HTML, BrowserFileLoadDialog, HTML_FileOpenDialog_t, m_FileLoadDialog );
+ STEAM_CALLBACK( HTML, BrowserSearchResults, HTML_SearchResults_t, m_SearchResults );
+ STEAM_CALLBACK( HTML, BrowserClose, HTML_CloseBrowser_t, m_CloseBrowser );
+ STEAM_CALLBACK( HTML, BrowserHorizontalScrollBarSizeResponse, HTML_HorizontalScroll_t, m_HorizScroll );
+ STEAM_CALLBACK( HTML, BrowserVerticalScrollBarSizeResponse, HTML_VerticalScroll_t, m_VertScroll );
+ STEAM_CALLBACK( HTML, BrowserLinkAtPositionResponse, HTML_LinkAtPosition_t, m_LinkAtPosResp );
+ STEAM_CALLBACK( HTML, BrowserJSAlert, HTML_JSAlert_t, m_JSAlert );
+ STEAM_CALLBACK( HTML, BrowserJSConfirm, HTML_JSConfirm_t, m_JSConfirm );
+ STEAM_CALLBACK( HTML, BrowserCanGoBackandForward, HTML_CanGoBackAndForward_t, m_CanGoBackForward );
+ STEAM_CALLBACK( HTML, BrowserSetCursor, HTML_SetCursor_t, m_SetCursor );
+ STEAM_CALLBACK( HTML, BrowserStatusText, HTML_StatusText_t, m_StatusText );
+ STEAM_CALLBACK( HTML, BrowserShowToolTip, HTML_ShowToolTip_t, m_ShowTooltip );
+ STEAM_CALLBACK( HTML, BrowserUpdateToolTip, HTML_UpdateToolTip_t, m_UpdateTooltip );
+ STEAM_CALLBACK( HTML, BrowserHideToolTip, HTML_HideToolTip_t, m_HideTooltip );
+
+ void OnBrowserReady( HTML_BrowserReady_t *pBrowserReady, bool bIOFailure );
void PostURL(const char *URL, const char *pchPostData, bool force);
virtual void BrowserResize();
- virtual void CalcScrollBars(int w,int h);
void UpdateSizeAndScrollBars();
MESSAGE_FUNC( OnSliderMoved, "ScrollBarSliderMoved" );
MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
@@ -207,8 +203,6 @@ private:
MESSAGE_FUNC_PTR( OnEditNewLine, "TextNewLine", panel );
MESSAGE_FUNC_INT( DismissJSDialog, "DismissJSDialog", result );
- void UpdateCachedHTMLValues();
-
vgui::Panel *m_pInteriorPanel;
vgui::ScrollBar *_hbar,*_vbar;
vgui::DHANDLE<vgui::FileOpenDialog> m_hFileOpenDialog;
@@ -256,7 +250,6 @@ private:
};
CUtlVector<CustomURLHandler_t> m_CustomURLHandlers;
- int m_iBrowser; // our browser handle
int m_iHTMLTextureID; // vgui texture id
// Track the texture width and height requested so we can tell
// when the size has changed and reallocate the texture.
@@ -290,16 +283,12 @@ private:
ScrollData_t()
{
m_bVisible = false;
- m_nX = m_nY = m_nWide = m_nTall = m_nMax = m_nScroll = 0;
+ m_nMax = m_nScroll = 0;
}
bool operator==( ScrollData_t const &src ) const
{
return m_bVisible == src.m_bVisible &&
- m_nX == src.m_nX &&
- m_nY == src.m_nY &&
- m_nWide == src.m_nWide &&
- m_nTall == src.m_nTall &&
m_nMax == src.m_nMax &&
m_nScroll == src.m_nScroll;
}
@@ -311,10 +300,6 @@ private:
bool m_bVisible; // is the scroll bar visible
- int m_nX; /// where cef put the scroll bar
- int m_nY;
- int m_nWide;
- int m_nTall; // how many pixels of scroll in the current scroll knob
int m_nMax; // most amount of pixels we can scroll
int m_nScroll; // currently scrolled amount of pixels
float m_flZoom; // zoom level this scroll bar is for
@@ -340,7 +325,10 @@ private:
}
};
CUtlVector<CustomCursorCache_t> m_vecHCursor;
- CUtlVector<HTMLCommandBuffer_t *> m_vecPendingMessages;
+
+ CSteamAPIContext m_SteamAPIContext;
+ HHTMLBrowser m_unBrowserHandle;
+ CCallResult< HTML, HTML_BrowserReady_t > m_SteamCallResultBrowserReady;
};
} // namespace vgui
diff --git a/mp/src/public/vgui_controls/ImagePanel.h b/mp/src/public/vgui_controls/ImagePanel.h
index 730cf38c..bba8f88b 100644
--- a/mp/src/public/vgui_controls/ImagePanel.h
+++ b/mp/src/public/vgui_controls/ImagePanel.h
@@ -75,6 +75,7 @@ private:
char *m_pszImageName;
char *m_pszFillColorName;
char *m_pszDrawColorName;
+ bool m_bPositionImage;
bool m_bCenterImage;
bool m_bScaleImage;
bool m_bTileImage;
diff --git a/mp/src/public/vgui_controls/Panel.h b/mp/src/public/vgui_controls/Panel.h
index 0523cb31..07b63d8d 100644
--- a/mp/src/public/vgui_controls/Panel.h
+++ b/mp/src/public/vgui_controls/Panel.h
@@ -624,6 +624,8 @@ public:
void SetParentNeedsCursorMoveEvents( bool bNeedsEvents ) { m_bParentNeedsCursorMoveEvents = bNeedsEvents; }
bool ParentNeedsCursorMoveEvents() const { return m_bParentNeedsCursorMoveEvents; }
+ int ComputePos( const char *pszInput, int &nPos, const int& nSize, const int& nParentSize, const bool& bX );
+
// For 360: support directional navigation between UI controls via dpad
enum NAV_DIRECTION { ND_UP, ND_DOWN, ND_LEFT, ND_RIGHT, ND_BACK, ND_NONE };
virtual Panel* NavigateUp();
@@ -725,15 +727,23 @@ protected:
private:
enum BuildModeFlags_t
{
- BUILDMODE_EDITABLE = 0x01,
- BUILDMODE_DELETABLE = 0x02,
- BUILDMODE_SAVE_XPOS_RIGHTALIGNED = 0x04,
- BUILDMODE_SAVE_XPOS_CENTERALIGNED = 0x08,
- BUILDMODE_SAVE_YPOS_BOTTOMALIGNED = 0x10,
- BUILDMODE_SAVE_YPOS_CENTERALIGNED = 0x20,
- BUILDMODE_SAVE_WIDE_FULL = 0x40,
- BUILDMODE_SAVE_TALL_FULL = 0x80,
- BUILDMODE_SAVE_PROPORTIONAL_TO_PARENT = 0x100,
+ BUILDMODE_EDITABLE = 1 << 0,
+ BUILDMODE_DELETABLE = 1 << 1,
+ BUILDMODE_SAVE_XPOS_RIGHTALIGNED = 1 << 2,
+ BUILDMODE_SAVE_XPOS_CENTERALIGNED = 1 << 3,
+ BUILDMODE_SAVE_YPOS_BOTTOMALIGNED = 1 << 4,
+ BUILDMODE_SAVE_YPOS_CENTERALIGNED = 1 << 5,
+ BUILDMODE_SAVE_WIDE_FULL = 1 << 6,
+ BUILDMODE_SAVE_TALL_FULL = 1 << 7,
+ BUILDMODE_SAVE_PROPORTIONAL_TO_PARENT = 1 << 8,
+ BUILDMODE_SAVE_WIDE_PROPORTIONAL = 1 << 9,
+ BUILDMODE_SAVE_TALL_PROPORTIONAL = 1 << 10,
+ BUILDMODE_SAVE_XPOS_PROPORTIONAL_SELF = 1 << 11,
+ BUILDMODE_SAVE_YPOS_PROPORTIONAL_SELF = 1 << 12,
+ BUILDMODE_SAVE_WIDE_PROPORTIONAL_TALL = 1 << 13,
+ BUILDMODE_SAVE_TALL_PROPORTIONAL_WIDE = 1 << 14,
+ BUILDMODE_SAVE_XPOS_PROPORTIONAL_PARENT = 1 << 15,
+ BUILDMODE_SAVE_YPOS_PROPORTIONAL_PARENT = 1 << 16
};
enum PanelFlags_t
@@ -759,6 +769,9 @@ private:
ALL_FLAGS = 0xFFFF,
};
+ int ComputeWide( KeyValues *inResourceData, int nParentWide, int nParentTall, bool bComputingForTall );
+ int ComputeTall( KeyValues *inResourceData, int nParentWide, int nParentTall, bool bComputingForWide );
+
// used to get the Panel * for users with only IClientPanel
virtual Panel *GetPanel() { return this; }
diff --git a/mp/src/public/zip_utils.cpp b/mp/src/public/zip_utils.cpp
index b205aa90..79f51c5c 100644
--- a/mp/src/public/zip_utils.cpp
+++ b/mp/src/public/zip_utils.cpp
@@ -615,7 +615,9 @@ void CZipFile::ParseFromBuffer( void *buffer, int bufferlength )
ZIP_EndOfCentralDirRecord rec = { 0 };
+#ifdef DBGFLAG_ASSERT
bool bFoundEndOfCentralDirRecord = false;
+#endif
unsigned int offset = fileLen - sizeof( ZIP_EndOfCentralDirRecord );
// If offset is ever greater than startOffset then it means that it has
// wrapped. This used to be a tautological >= 0 test.
@@ -626,7 +628,9 @@ void CZipFile::ParseFromBuffer( void *buffer, int bufferlength )
buf.GetObjects( &rec );
if ( rec.signature == PKID( 5, 6 ) )
{
+#ifdef DBGFLAG_ASSERT
bFoundEndOfCentralDirRecord = true;
+#endif
// Set any xzip configuration
if ( rec.commentLength )