mirror of
https://github.com/rlabrecque/SteamworksSDK.git
synced 2026-10-10 01:23:04 +08:00
v1.24
This commit is contained in:
+17
@@ -11,6 +11,23 @@ website at: http://partner.steamgames.com
|
||||
|
||||
Revision History:
|
||||
|
||||
----------------------------------------------------------------
|
||||
v1.24 17th July 2013
|
||||
----------------------------------------------------------------
|
||||
|
||||
User:
|
||||
* Added ISteamUser::GetBadgeLevel and ISteamUser::GetPlayerSteamLevel functions
|
||||
|
||||
Friends:
|
||||
* Games can now initiate Steam Friend requests, removals, request -accepts and request-ignores via ISteamFriends’ ActivateGameOverlayToUser API. This prompts the user for confirmation before action is taken.
|
||||
|
||||
Mac:
|
||||
* Updated the OS X Content Prep tool and game wrapper for improved compatibility with OS X 10.8 (Mountain Lion).
|
||||
|
||||
Linux:
|
||||
* Added install script for the Steam Linux Runtime tools (run "bash tools/linux/setup.sh" to install), see tools/linux/README.txt for details.
|
||||
* SteamworksExample is now available on Linux
|
||||
|
||||
----------------------------------------------------------------
|
||||
v1.23a 25th February 2013
|
||||
----------------------------------------------------------------
|
||||
|
||||
@@ -198,12 +198,12 @@ public:
|
||||
if ( i == m_uSelectedItem )
|
||||
{
|
||||
dwColor = D3DCOLOR_ARGB( 255, 25, 200, 25 );
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "{ %s }", m_VecMenuItems[i].first.c_str() );
|
||||
sprintf_safe( rgchBuffer, "{ %s }", m_VecMenuItems[i].first.c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
dwColor = D3DCOLOR_ARGB( 255, 255, 255, 255 );
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s", m_VecMenuItems[i].first.c_str() );
|
||||
sprintf_safe( rgchBuffer, "%s", m_VecMenuItems[i].first.c_str() );
|
||||
}
|
||||
m_pGameEngine->BDrawString( g_hMenuFont, rect, dwColor, TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
}
|
||||
@@ -241,4 +241,4 @@ private:
|
||||
T m_selection;
|
||||
};
|
||||
|
||||
#endif // MAINMENU_H
|
||||
#endif // MAINMENU_H
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
virtual bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ) = 0;
|
||||
|
||||
// Create a new font returning our internal handle value for it (0 means failure)
|
||||
virtual HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, char * pchFont ) = 0;
|
||||
virtual HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ) = 0;
|
||||
|
||||
// Create a new texture returning our internal handle value for it (0 means failure)
|
||||
virtual HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight ) = 0;
|
||||
@@ -135,4 +135,4 @@ public:
|
||||
virtual bool AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ) = 0;
|
||||
};
|
||||
|
||||
#endif // GAMEENGINE_H
|
||||
#endif // GAMEENGINE_H
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//=============================================================================
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "leaderboards.h"
|
||||
#include "Leaderboards.h"
|
||||
#include "BaseMenu.h"
|
||||
#include <math.h>
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
{
|
||||
char rgchMenuText[256];
|
||||
const char *pchName = SteamFriends()->GetFriendPersonaName( m_leaderboardEntries[index].m_steamIDUser );
|
||||
_snprintf( rgchMenuText, sizeof( rgchMenuText ), "(%d) %s - %d", m_leaderboardEntries[index].m_nGlobalRank,
|
||||
sprintf_safe( rgchMenuText, "(%d) %s - %d", m_leaderboardEntries[index].m_nGlobalRank,
|
||||
pchName, m_leaderboardEntries[index].m_nScore );
|
||||
|
||||
AddMenuItem( MenuItem_t( std::string( rgchMenuText ), menuItemEmpty ) );
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
LobbyMenuItem_t menuItem = { steamIDLobbyMember, LobbyMenuItem_t::k_ELobbyMenuItemUser };
|
||||
|
||||
char rgchMenuText[256];
|
||||
_snprintf( rgchMenuText, sizeof( rgchMenuText ), "%s %s", pchName, bReady ? "(READY)" : "" );
|
||||
sprintf_safe( rgchMenuText, "%s %s", pchName, bReady ? "(READY)" : "" );
|
||||
AddMenuItem( MenuItem_t( std::string( rgchMenuText ), menuItem ) );
|
||||
}
|
||||
}
|
||||
@@ -327,14 +327,14 @@ void CLobbyBrowser::OnLobbyMatchListCallback( LobbyMatchList_t *pCallback, bool
|
||||
if ( pchLobbyName && pchLobbyName[0] )
|
||||
{
|
||||
// set the lobby name
|
||||
_snprintf( lobby.m_rgchName, sizeof( lobby.m_rgchName ), "%s", pchLobbyName );
|
||||
sprintf_safe( lobby.m_rgchName, "%s", pchLobbyName );
|
||||
}
|
||||
else
|
||||
{
|
||||
// we don't have info about the lobby yet, request it
|
||||
SteamMatchmaking()->RequestLobbyData( steamIDLobby );
|
||||
// results will be returned via LobbyDataUpdate_t callback
|
||||
_snprintf( lobby.m_rgchName, sizeof( lobby.m_rgchName ), "Lobby %d", steamIDLobby.GetAccountID() );
|
||||
sprintf_safe( lobby.m_rgchName, "Lobby %d", steamIDLobby.GetAccountID() );
|
||||
}
|
||||
|
||||
m_ListLobbies.push_back( lobby );
|
||||
@@ -360,7 +360,7 @@ void CLobbyBrowser::OnLobbyDataUpdatedCallback( LobbyDataUpdate_t *pCallback )
|
||||
const char *pchLobbyName = SteamMatchmaking()->GetLobbyData( iter->m_steamIDLobby, "name" );
|
||||
if ( pchLobbyName[0] )
|
||||
{
|
||||
_snprintf( iter->m_rgchName, sizeof( iter->m_rgchName ), "%s", pchLobbyName );
|
||||
sprintf_safe( iter->m_rgchName, "%s", pchLobbyName );
|
||||
// update the menu
|
||||
m_pMenu->Rebuild( m_ListLobbies );
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
//=============================================================================
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "steam/steam_api.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
#include "gameenginewin32.h"
|
||||
@@ -12,6 +13,9 @@
|
||||
#elif defined(OSX)
|
||||
#include "GameEngine.h"
|
||||
extern IGameEngine *CreateGameEngineOSX();
|
||||
#elif defined(SDL)
|
||||
#include "GameEngine.h"
|
||||
extern IGameEngine *CreateGameEngineSDL();
|
||||
#endif
|
||||
|
||||
#include "SpaceWarClient.h"
|
||||
@@ -208,6 +212,10 @@ static int RealMain( const char *pchCmdLine, HINSTANCE hInstance, int nCmdShow )
|
||||
new CGameEngineWin32( hInstance, nCmdShow, 1024, 768 );
|
||||
#elif defined(OSX)
|
||||
CreateGameEngineOSX();
|
||||
#elif defined(SDL)
|
||||
CreateGameEngineSDL();
|
||||
#else
|
||||
#error Need CreateGameEngine()
|
||||
#endif
|
||||
|
||||
// This call will block and run until the game exits
|
||||
@@ -288,3 +296,26 @@ int main(int argc, const char **argv)
|
||||
return RealMain( szCmdLine, 0, 0 );
|
||||
}
|
||||
#endif
|
||||
#ifdef SDL
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
char szCmdLine[1024];
|
||||
char *pszStart = szCmdLine;
|
||||
char * const pszEnd = szCmdLine + Q_ARRAYSIZE(szCmdLine);
|
||||
*szCmdLine = '\0';
|
||||
for ( int i = 1; i < argc; i++ )
|
||||
{
|
||||
const char *parm = argv[i];
|
||||
while ( *parm && (pszStart < pszEnd) )
|
||||
{
|
||||
*pszStart++ = *parm++;
|
||||
}
|
||||
if ( pszStart >= pszEnd )
|
||||
break;
|
||||
if ( i < argc-1 )
|
||||
*pszStart++ = ' ';
|
||||
}
|
||||
szCmdLine[Q_ARRAYSIZE(szCmdLine) - 1] = '\0';
|
||||
return RealMain( szCmdLine, 0, 0 );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "RemoteStorage.h"
|
||||
#include "RemoteStorageSync.h"
|
||||
#include "remotestoragesync.h"
|
||||
#include <assert.h>
|
||||
|
||||
#define CLOUDDISP_FONT_HEIGHT 20
|
||||
@@ -226,8 +226,6 @@ void CRemoteStorageScreen::Show()
|
||||
//-----------------------------------------------------------------------------
|
||||
void CRemoteStorageScreen::Render()
|
||||
{
|
||||
uint64 ulCurrentTickCount = m_pGameEngine->GetGameTickCount();
|
||||
|
||||
m_bFinished = false;
|
||||
|
||||
// Update key press information
|
||||
@@ -316,7 +314,7 @@ void CRemoteStorageScreen::Render()
|
||||
pxVertOffset = rect.bottom + CLOUDDISP_VERT_SPACING;
|
||||
|
||||
char rgchBuffer[256];
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Num Files In Cloud: %d", m_nNumFilesInCloud );
|
||||
sprintf_safe( rgchBuffer, "Num Files In Cloud: %d", m_nNumFilesInCloud );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
|
||||
rect.top = pxVertOffset;
|
||||
@@ -325,7 +323,7 @@ void CRemoteStorageScreen::Render()
|
||||
rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH;
|
||||
pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING;
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Quota: %d bytes, %d bytes remaining", m_nBytesQuota, m_nAvailableBytes );
|
||||
sprintf_safe( rgchBuffer, "Quota: %d bytes, %d bytes remaining", m_nBytesQuota, m_nAvailableBytes );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
|
||||
rect.top = pxVertOffset;
|
||||
@@ -334,7 +332,7 @@ void CRemoteStorageScreen::Render()
|
||||
rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH;
|
||||
pxVertOffset = rect.bottom + CLOUDDISP_VERT_SPACING;
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Current Message:" );
|
||||
sprintf_safe( rgchBuffer, "Current Message:" );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
|
||||
rect.top = pxVertOffset;
|
||||
@@ -351,7 +349,7 @@ void CRemoteStorageScreen::Render()
|
||||
rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH;
|
||||
pxVertOffset = rect.bottom + CLOUDDISP_VERT_SPACING;
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Type in a new message below:" );
|
||||
sprintf_safe( rgchBuffer, "Type in a new message below:" );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
|
||||
rect.top = pxVertOffset;
|
||||
@@ -368,7 +366,7 @@ void CRemoteStorageScreen::Render()
|
||||
rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH;
|
||||
pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING;
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Hit <ENTER> to save, <ESC> to cancel" );
|
||||
sprintf_safe( rgchBuffer, "Hit <ENTER> to save, <ESC> to cancel" );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
|
||||
if ( bQuotaExceeded )
|
||||
@@ -379,7 +377,7 @@ void CRemoteStorageScreen::Render()
|
||||
rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH;
|
||||
pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING;
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "!! QUOTA EXCEEDED !!" );
|
||||
sprintf_safe( rgchBuffer, "!! QUOTA EXCEEDED !!" );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ CGameServer::CGameServer( gameserveritem_t *pGameServerItem )
|
||||
m_bSecure = pGameServerItem->m_bSecure;
|
||||
m_nServerVersion = pGameServerItem->m_nServerVersion;
|
||||
strncpy( m_szServerName, pGameServerItem->GetName(), ARRAYSIZE( m_szServerName ) );
|
||||
_snprintf( m_szServerString, ARRAYSIZE( m_szServerString ), "%s (%i/%i) at %s ping(%d)", pGameServerItem->GetName(), pGameServerItem->m_nPlayers, pGameServerItem->m_nMaxPlayers, pGameServerItem->m_NetAdr.GetConnectionAddressString(), pGameServerItem->m_nPing );
|
||||
sprintf_safe( m_szServerString, "%s (%i/%i) at %s ping(%d)", pGameServerItem->GetName(), pGameServerItem->m_nPlayers, pGameServerItem->m_nMaxPlayers, pGameServerItem->m_NetAdr.GetConnectionAddressString(), pGameServerItem->m_nPing );
|
||||
m_steamID = pGameServerItem->m_steamID;
|
||||
}
|
||||
|
||||
|
||||
@@ -506,7 +506,7 @@ void CSpaceWarClient::SetGameState( EClientGameState eState )
|
||||
//-----------------------------------------------------------------------------
|
||||
void CSpaceWarClient::SetConnectionFailureText( const char *pchErrorText )
|
||||
{
|
||||
_snprintf( m_rgchErrorText, sizeof( m_rgchErrorText ), "%s", pchErrorText );
|
||||
sprintf_safe( m_rgchErrorText, "%s", pchErrorText );
|
||||
}
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@ void CSpaceWarClient::ReceiveNetworkData()
|
||||
{
|
||||
uint64 ulTimePassedMS = m_pGameEngine->GetGameTickCount() - m_ulPingSentTime;
|
||||
char rgchT[256];
|
||||
_snprintf( rgchT, sizeof(rgchT), "Round-trip ping time to server %d ms\n", (int)ulTimePassedMS );
|
||||
sprintf_safe( rgchT, "Round-trip ping time to server %d ms\n", (int)ulTimePassedMS );
|
||||
rgchT[ sizeof(rgchT) - 1 ] = 0;
|
||||
OutputDebugString( rgchT );
|
||||
m_ulPingSentTime = 0;
|
||||
@@ -785,7 +785,7 @@ void CSpaceWarClient::OnLobbyCreated( LobbyCreated_t *pCallback, bool bIOFailure
|
||||
|
||||
// set the name of the lobby if it's ours
|
||||
char rgchLobbyName[256];
|
||||
_snprintf( rgchLobbyName, sizeof( rgchLobbyName ), "%s's lobby", SteamFriends()->GetPersonaName() );
|
||||
sprintf_safe( rgchLobbyName, "%s's lobby", SteamFriends()->GetPersonaName() );
|
||||
SteamMatchmaking()->SetLobbyData( m_steamIDLobby, "name", rgchLobbyName );
|
||||
|
||||
// mark that we're in the lobby
|
||||
@@ -1074,8 +1074,7 @@ void CSpaceWarClient::OnGameWebCallback( GameWebCallback_t *callback )
|
||||
{
|
||||
m_bSentWebOpen = false;
|
||||
char rgchString[256];
|
||||
_snprintf( rgchString, sizeof(rgchString), "User submitted following url: %s\n", callback->m_szURL );
|
||||
rgchString[ sizeof(rgchString) - 1 ] = 0;
|
||||
sprintf_safe( rgchString, "User submitted following url: %s\n", callback->m_szURL );
|
||||
OutputDebugString( rgchString );
|
||||
}
|
||||
|
||||
@@ -1086,7 +1085,7 @@ void CSpaceWarClient::OnGameWebCallback( GameWebCallback_t *callback )
|
||||
void CSpaceWarClient::OnSteamServerConnectFailure( SteamServerConnectFailure_t *callback )
|
||||
{
|
||||
char rgchString[256];
|
||||
_snprintf( rgchString, 256, "SteamServerConnectFailure_t: %d\n", callback->m_eResult );
|
||||
sprintf_safe( rgchString, "SteamServerConnectFailure_t: %d\n", callback->m_eResult );
|
||||
|
||||
m_pConnectingMenu->OnConnectFailure();
|
||||
}
|
||||
@@ -1380,7 +1379,7 @@ void CSpaceWarClient::RunFrame()
|
||||
char szCurDir[MAX_PATH];
|
||||
_getcwd( szCurDir, sizeof(szCurDir) );
|
||||
char szURL[MAX_PATH];
|
||||
_snprintf( szURL, sizeof(szURL), "file:///%s/test.html", szCurDir );
|
||||
sprintf_safe( szURL, "file:///%s/test.html", szCurDir );
|
||||
// load the test html page, it just has a steam://gamewebcallback link in it
|
||||
SteamFriends()->ActivateGameOverlayToWebPage( szURL );
|
||||
SetGameState( k_EClientGameMenu );
|
||||
@@ -1514,18 +1513,18 @@ void CSpaceWarClient::DrawHUDText()
|
||||
|
||||
if ( m_rgSteamIDPlayers[i].IsValid() )
|
||||
{
|
||||
_snprintf( rgchPlayerName, ARRAYSIZE( rgchPlayerName ), "%s", SteamFriends()->GetFriendPersonaName( playerSteamID ) );
|
||||
sprintf_safe( rgchPlayerName, "%s", SteamFriends()->GetFriendPersonaName( playerSteamID ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
_snprintf( rgchPlayerName, ARRAYSIZE( rgchPlayerName ), "Unknown Player" );
|
||||
sprintf_safe( rgchPlayerName, "Unknown Player" );
|
||||
}
|
||||
|
||||
// We also want to use the Steam Avatar image inside the HUD if it is available.
|
||||
// We look it up via GetMediumFriendAvatar, which returns an image index we use
|
||||
// to look up the actual RGBA data below.
|
||||
int iImage = SteamFriends()->GetMediumFriendAvatar( playerSteamID );
|
||||
HGAMETEXTURE hTexture = NULL;
|
||||
HGAMETEXTURE hTexture = 0;
|
||||
if ( iImage != -1 )
|
||||
hTexture = GetSteamImageAsTexture( iImage );
|
||||
|
||||
@@ -1546,7 +1545,7 @@ void CSpaceWarClient::DrawHUDText()
|
||||
rect.right += nAvatarWidth + nSpaceBetweenAvatarAndScore;
|
||||
}
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState );
|
||||
sprintf_safe( rgchBuffer, "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState );
|
||||
m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_LEFT|TEXTPOS_VCENTER, rgchBuffer );
|
||||
break;
|
||||
case 1:
|
||||
@@ -1564,7 +1563,7 @@ void CSpaceWarClient::DrawHUDText()
|
||||
rect.left -= nAvatarWidth + nSpaceBetweenAvatarAndScore;
|
||||
}
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s\nScore: %2u ", rgchPlayerName, m_rguPlayerScores[i] );
|
||||
sprintf_safe( rgchBuffer, "%s\nScore: %2u ", rgchPlayerName, m_rguPlayerScores[i] );
|
||||
m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_RIGHT|TEXTPOS_VCENTER, rgchBuffer );
|
||||
break;
|
||||
case 2:
|
||||
@@ -1581,7 +1580,7 @@ void CSpaceWarClient::DrawHUDText()
|
||||
rect.left += nAvatarWidth + nSpaceBetweenAvatarAndScore;
|
||||
}
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState );
|
||||
sprintf_safe( rgchBuffer, "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState );
|
||||
m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_LEFT|TEXTPOS_BOTTOM, rgchBuffer );
|
||||
break;
|
||||
case 3:
|
||||
@@ -1598,7 +1597,7 @@ void CSpaceWarClient::DrawHUDText()
|
||||
rect.left -= nAvatarWidth + nSpaceBetweenAvatarAndScore;
|
||||
}
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState );
|
||||
sprintf_safe( rgchBuffer, "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState );
|
||||
m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_RIGHT|TEXTPOS_BOTTOM, rgchBuffer );
|
||||
break;
|
||||
default:
|
||||
@@ -1624,9 +1623,9 @@ void CSpaceWarClient::DrawInstructions()
|
||||
|
||||
char rgchBuffer[256];
|
||||
#ifdef _PS3
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Turn Ship Left: 'Left'\nTurn Ship Right: 'Right'\nForward Thrusters: 'R2'\nReverse Thrusters: 'L2'\nFire Photon Beams: 'Cross'" );
|
||||
sprintf_safe( rgchBuffer, "Turn Ship Left: 'Left'\nTurn Ship Right: 'Right'\nForward Thrusters: 'R2'\nReverse Thrusters: 'L2'\nFire Photon Beams: 'Cross'" );
|
||||
#else
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Turn Ship Left: 'A'\nTurn Ship Right: 'D'\nForward Thrusters: 'W'\nReverse Thrusters: 'S'\nFire Photon Beams: 'Space'" );
|
||||
sprintf_safe( rgchBuffer, "Turn Ship Left: 'A'\nTurn Ship Right: 'D'\nForward Thrusters: 'W'\nReverse Thrusters: 'S'\nFire Photon Beams: 'Space'" );
|
||||
#endif
|
||||
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
@@ -1637,7 +1636,7 @@ void CSpaceWarClient::DrawInstructions()
|
||||
rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.7);
|
||||
rect.bottom = m_pGameEngine->GetViewportHeight();
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer ), "Press ESC to return to the Main Menu" );
|
||||
sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu" );
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer );
|
||||
|
||||
}
|
||||
@@ -1660,16 +1659,16 @@ void CSpaceWarClient::DrawConnectionAttemptText()
|
||||
|
||||
char rgchTimeoutString[256];
|
||||
if ( uSecondsLeft < 25 )
|
||||
_snprintf( rgchTimeoutString, sizeof( rgchTimeoutString ), ", timeout in %u...\n", uSecondsLeft );
|
||||
sprintf_safe( rgchTimeoutString, ", timeout in %u...\n", uSecondsLeft );
|
||||
else
|
||||
_snprintf( rgchTimeoutString, sizeof( rgchTimeoutString ), "...\n" );
|
||||
sprintf_safe( rgchTimeoutString, "...\n" );
|
||||
|
||||
|
||||
char rgchBuffer[256];
|
||||
if ( m_eGameState == k_EClientJoiningLobby )
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer ), "Connecting to lobby%s", rgchTimeoutString );
|
||||
sprintf_safe( rgchBuffer, "Connecting to lobby%s", rgchTimeoutString );
|
||||
else
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer ), "Connecting to server%s", rgchTimeoutString );
|
||||
sprintf_safe( rgchBuffer, "Connecting to server%s", rgchTimeoutString );
|
||||
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
}
|
||||
@@ -1689,7 +1688,7 @@ void CSpaceWarClient::DrawConnectionFailureText()
|
||||
rect.right = width;
|
||||
|
||||
char rgchBuffer[256];
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s\n", m_rgchErrorText );
|
||||
sprintf_safe( rgchBuffer, "%s\n", m_rgchErrorText );
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
|
||||
rect.left = 0;
|
||||
@@ -1697,7 +1696,7 @@ void CSpaceWarClient::DrawConnectionFailureText()
|
||||
rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.7);
|
||||
rect.bottom = m_pGameEngine->GetViewportHeight();
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer ), "Press ESC to return to the Main Menu" );
|
||||
sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu" );
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer );
|
||||
}
|
||||
|
||||
@@ -1718,12 +1717,12 @@ void CSpaceWarClient::DrawWinnerDrawOrWaitingText()
|
||||
char rgchBuffer[256];
|
||||
if ( m_eGameState == k_EClientGameWaitingForPlayers )
|
||||
{
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Server is waiting for players.\n\nStarting in %d seconds...", nSecondsToRestart );
|
||||
sprintf_safe( rgchBuffer, "Server is waiting for players.\n\nStarting in %d seconds...", nSecondsToRestart );
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
}
|
||||
else if ( m_eGameState == k_EClientGameDraw )
|
||||
{
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "The round is a draw!\n\nStarting again in %d seconds...", nSecondsToRestart );
|
||||
sprintf_safe( rgchBuffer, "The round is a draw!\n\nStarting again in %d seconds...", nSecondsToRestart );
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
}
|
||||
else if ( m_eGameState == k_EClientGameWinner )
|
||||
@@ -1737,14 +1736,14 @@ void CSpaceWarClient::DrawWinnerDrawOrWaitingText()
|
||||
char rgchPlayerName[128];
|
||||
if ( m_rgSteamIDPlayers[m_uPlayerWhoWonGame].IsValid() )
|
||||
{
|
||||
_snprintf( rgchPlayerName, ARRAYSIZE( rgchPlayerName ), "%s", SteamFriends()->GetFriendPersonaName( m_rgSteamIDPlayers[m_uPlayerWhoWonGame] ) );
|
||||
sprintf_safe( rgchPlayerName, "%s", SteamFriends()->GetFriendPersonaName( m_rgSteamIDPlayers[m_uPlayerWhoWonGame] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
_snprintf( rgchPlayerName, ARRAYSIZE( rgchPlayerName ), "Unknown Player" );
|
||||
sprintf_safe( rgchPlayerName, "Unknown Player" );
|
||||
}
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s wins!\n\nStarting again in %d seconds...", rgchPlayerName, nSecondsToRestart );
|
||||
sprintf_safe( rgchBuffer, "%s wins!\n\nStarting again in %d seconds...", rgchPlayerName, nSecondsToRestart );
|
||||
|
||||
m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
}
|
||||
@@ -1798,7 +1797,7 @@ float CSpaceWarClient::PixelsToFeet( float flPixels )
|
||||
//-----------------------------------------------------------------------------
|
||||
HGAMETEXTURE CSpaceWarClient::GetSteamImageAsTexture( int iImage )
|
||||
{
|
||||
HGAMETEXTURE hTexture = NULL;
|
||||
HGAMETEXTURE hTexture = 0;
|
||||
|
||||
// iImage of 0 from steam means no avatar is set
|
||||
if ( iImage )
|
||||
@@ -1917,12 +1916,12 @@ void CSpaceWarClient::UpdateRichPresenceConnectionInfo()
|
||||
if ( m_eConnectedStatus == k_EClientConnectedAndAuthenticated && m_unServerIP && m_usServerPort )
|
||||
{
|
||||
// game server connection method
|
||||
_snprintf( rgchConnectString, sizeof(rgchConnectString), "+connect %d:%d", m_unServerIP, m_usServerPort );
|
||||
sprintf_safe( rgchConnectString, "+connect %d:%d", m_unServerIP, m_usServerPort );
|
||||
}
|
||||
else if ( m_steamIDLobby.IsValid() )
|
||||
{
|
||||
// lobby connection method
|
||||
_snprintf( rgchConnectString, sizeof(rgchConnectString), "+connect_lobby %llu", m_steamIDLobby.ConvertToUint64() );
|
||||
sprintf_safe( rgchConnectString, "+connect_lobby %llu", m_steamIDLobby.ConvertToUint64() );
|
||||
}
|
||||
|
||||
SteamFriends()->SetRichPresence( "connect", rgchConnectString );
|
||||
@@ -1942,7 +1941,7 @@ void CSpaceWarClient::ExecCommandLineConnect( const char *pchServerAddress, cons
|
||||
if ( nConverted == 5 )
|
||||
{
|
||||
char rgchIPAddress[128];
|
||||
_snprintf( rgchIPAddress, ARRAYSIZE( rgchIPAddress ), "%d.%d.%d.%d", octet0, octet1, octet2, octet3 );
|
||||
sprintf_safe( rgchIPAddress, "%d.%d.%d.%d", octet0, octet1, octet2, octet3 );
|
||||
uint32 unIPAddress = ( octet3 ) + ( octet2 << 8 ) + ( octet1 << 16 ) + ( octet0 << 24 );
|
||||
InitiateServerConnection( unIPAddress, uPort );
|
||||
}
|
||||
@@ -1959,4 +1958,4 @@ void CSpaceWarClient::ExecCommandLineConnect( const char *pchServerAddress, cons
|
||||
OnMenuSelection( menuItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ CSpaceWarServer::CSpaceWarServer( IGameEngine *pGameEngine )
|
||||
m_bConnectedToSteam = false;
|
||||
|
||||
|
||||
char *pchGameDir = "spacewar";
|
||||
const char *pchGameDir = "spacewar";
|
||||
uint32 unIP = INADDR_ANY;
|
||||
uint16 usMasterServerUpdaterPort = SPACEWAR_MASTER_SERVER_UPDATER_PORT;
|
||||
|
||||
@@ -620,7 +620,7 @@ void CSpaceWarServer::ReceiveNetworkData()
|
||||
}
|
||||
default:
|
||||
char rgch[128];
|
||||
_snprintf( rgch, 128, "Invalid message %x\n", eMsg );
|
||||
sprintf_safe( rgch, "Invalid message %x\n", eMsg );
|
||||
rgch[ sizeof(rgch) - 1 ] = 0;
|
||||
OutputDebugString( rgch );
|
||||
}
|
||||
@@ -887,7 +887,7 @@ void CSpaceWarServer::OnPolicyResponse( GSPolicyResponse_t *pPolicyResponse )
|
||||
OutputDebugString( "SpaceWarServer is not VAC Secure!\n" );
|
||||
}
|
||||
char rgch[128];
|
||||
_snprintf( rgch, 128, "Game server SteamID: %llu\n", SteamGameServer()->GetSteamID().ConvertToUint64() );
|
||||
sprintf_safe( rgch, "Game server SteamID: %llu\n", SteamGameServer()->GetSteamID().ConvertToUint64() );
|
||||
rgch[ sizeof(rgch) - 1 ] = 0;
|
||||
OutputDebugString( rgch );
|
||||
#endif
|
||||
@@ -926,11 +926,11 @@ void CSpaceWarServer::SendUpdatedServerDetailsToSteam()
|
||||
{
|
||||
// If a client is running (should always be since we don't support a dedicated server)
|
||||
// then we'll form the name based off of it
|
||||
_snprintf( rgchServerName, ARRAYSIZE( rgchServerName ), "%s's game", SpaceWarClient()->GetLocalPlayerName() );
|
||||
sprintf_safe( rgchServerName, "%s's game", SpaceWarClient()->GetLocalPlayerName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
_snprintf( rgchServerName, ARRAYSIZE( rgchServerName ), "%s", "Spacewar!" );
|
||||
sprintf_safe( rgchServerName, "%s", "Spacewar!" );
|
||||
}
|
||||
m_sServerName = rgchServerName;
|
||||
|
||||
|
||||
@@ -305,9 +305,9 @@ void CStatsAndAchievements::OnUserStatsReceived( UserStatsReceived_t *pCallback
|
||||
{
|
||||
Achievement_t &ach = g_rgAchievements[iAch];
|
||||
m_pSteamUserStats->GetAchievement( ach.m_pchAchievementID, &ach.m_bAchieved );
|
||||
_snprintf( ach.m_rgchName, sizeof( ach.m_rgchName ), "%s",
|
||||
sprintf_safe( ach.m_rgchName, "%s",
|
||||
m_pSteamUserStats->GetAchievementDisplayAttribute( ach.m_pchAchievementID, "name" ) );
|
||||
_snprintf( ach.m_rgchDescription, sizeof( ach.m_rgchDescription ), "%s",
|
||||
sprintf_safe( ach.m_rgchDescription, "%s",
|
||||
m_pSteamUserStats->GetAchievementDisplayAttribute( ach.m_pchAchievementID, "desc" ) );
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ void CStatsAndAchievements::OnUserStatsReceived( UserStatsReceived_t *pCallback
|
||||
else
|
||||
{
|
||||
char buffer[128];
|
||||
_snprintf( buffer, sizeof(buffer), "RequestStats - failed, %d\n", pCallback->m_eResult );
|
||||
sprintf_safe( buffer, "RequestStats - failed, %d\n", pCallback->m_eResult );
|
||||
buffer[ sizeof(buffer) - 1 ] = 0;
|
||||
OutputDebugString( buffer );
|
||||
}
|
||||
@@ -359,7 +359,7 @@ void CStatsAndAchievements::OnUserStatsStored( UserStatsStored_t *pCallback )
|
||||
else
|
||||
{
|
||||
char buffer[128];
|
||||
_snprintf( buffer, sizeof(buffer), "StoreStats - failed, %d\n", pCallback->m_eResult );
|
||||
sprintf_safe( buffer, "StoreStats - failed, %d\n", pCallback->m_eResult );
|
||||
buffer[ sizeof(buffer) - 1 ] = 0;
|
||||
OutputDebugString( buffer );
|
||||
}
|
||||
@@ -377,14 +377,14 @@ void CStatsAndAchievements::OnAchievementStored( UserAchievementStored_t *pCallb
|
||||
if ( 0 == pCallback->m_nMaxProgress )
|
||||
{
|
||||
char buffer[128];
|
||||
_snprintf( buffer, sizeof(buffer), "Achievement '%s' unlocked!", pCallback->m_rgchAchievementName );
|
||||
sprintf_safe( buffer, "Achievement '%s' unlocked!", pCallback->m_rgchAchievementName );
|
||||
buffer[ sizeof(buffer) - 1 ] = 0;
|
||||
OutputDebugString( buffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
char buffer[128];
|
||||
_snprintf( buffer, sizeof(buffer), "Achievement '%s' progress callback, (%d,%d)\n",
|
||||
sprintf_safe( buffer, "Achievement '%s' progress callback, (%d,%d)\n",
|
||||
pCallback->m_rgchAchievementName, pCallback->m_nCurProgress, pCallback->m_nMaxProgress );
|
||||
buffer[ sizeof(buffer) - 1 ] = 0;
|
||||
OutputDebugString( buffer );
|
||||
@@ -407,9 +407,9 @@ void CStatsAndAchievements::OnPS3TrophiesInstalled( PS3TrophiesInstalled_t *pCal
|
||||
// could not display that error, you should display the appropriate message to the user then exit.
|
||||
char buffer[256];
|
||||
if ( pCallback->m_eResult == k_EResultDiskFull )
|
||||
_snprintf( buffer, 256, "Failed to install PS3 trophies because the HD is full (required space=%llu)\n", pCallback->m_ulRequiredDiskSpace );
|
||||
sprintf_safe( buffer, "Failed to install PS3 trophies because the HD is full (required space=%llu)\n", pCallback->m_ulRequiredDiskSpace );
|
||||
else
|
||||
_snprintf( buffer, 256, "Failed to install PS3 trophies (%d)", pCallback->m_eResult );
|
||||
sprintf_safe( buffer, "Failed to install PS3 trophies (%d)", pCallback->m_eResult );
|
||||
|
||||
buffer[ sizeof(buffer) - 1 ] = 0;
|
||||
OutputDebugString( buffer );
|
||||
@@ -442,7 +442,7 @@ void CStatsAndAchievements::Render()
|
||||
rect.right = width;
|
||||
|
||||
char rgchBuffer[256];
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "Unable to retrieve data from Steam\n" );
|
||||
sprintf_safe( rgchBuffer, "Unable to retrieve data from Steam\n" );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer );
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ void CStatsAndAchievements::Render()
|
||||
rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.7);
|
||||
rect.bottom = m_pGameEngine->GetViewportHeight();
|
||||
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer ), "Press ESC to return to the Main Menu" );
|
||||
sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu" );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer );
|
||||
|
||||
}
|
||||
@@ -541,7 +541,7 @@ void CStatsAndAchievements::Render()
|
||||
rect.bottom = m_pGameEngine->GetViewportHeight();
|
||||
|
||||
char rgchBuffer[256];
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer ), "Press ESC to return to the Main Menu" );
|
||||
sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu" );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer );
|
||||
|
||||
}
|
||||
@@ -570,7 +570,7 @@ void CStatsAndAchievements::DrawAchievementInfo( RECT &rect, Achievement_t &ach
|
||||
|
||||
// todo: divide up so can draw image
|
||||
char rgchBuffer[256];
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s: %s\n%s",
|
||||
sprintf_safe( rgchBuffer, "%s: %s\n%s",
|
||||
ach.m_rgchName,
|
||||
ach.m_bAchieved ? "Unlocked" : "Locked",
|
||||
ach.m_rgchDescription );
|
||||
@@ -582,7 +582,7 @@ void CStatsAndAchievements::DrawStatInfo( RECT &rect, const char *pchName, float
|
||||
{
|
||||
// todo: divide up so can draw image
|
||||
char rgchBuffer[256];
|
||||
_snprintf( rgchBuffer, sizeof( rgchBuffer), "%s: %.1f", pchName, flValue );
|
||||
sprintf_safe( rgchBuffer, "%s: %.1f", pchName, flValue );
|
||||
m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_LEFT|TEXTPOS_VCENTER, rgchBuffer );
|
||||
}
|
||||
|
||||
@@ -651,4 +651,4 @@ bool CStatsAndAchievements::SaveUserStatsOnPS3()
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
@@ -73,8 +75,10 @@ typedef unsigned __int64 uint64;
|
||||
|
||||
#elif defined(POSIX)
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <sys/socket.h>
|
||||
@@ -183,15 +187,39 @@ extern void OutputDebugString( const char *pchMsg );
|
||||
extern int Alert( const char *lpCaption, const char *lpText );
|
||||
extern const char *GetUserSaveDataPath();
|
||||
|
||||
// No _snprintf on POSIX, use snprintf
|
||||
#ifndef _snprintf
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
|
||||
#define Q_ARRAYSIZE(a) sizeof(a)/sizeof(a[0])
|
||||
|
||||
#endif // POSIX
|
||||
|
||||
// OUT_Z_ARRAY indicates an output array that will be null-terminated.
|
||||
#if _MSC_VER >= 1600
|
||||
// Include the annotation header file.
|
||||
#include <sal.h>
|
||||
#if _MSC_VER >= 1700
|
||||
// VS 2012+
|
||||
#define OUT_Z_ARRAY _Post_z_
|
||||
#else
|
||||
// VS 2010
|
||||
#define OUT_Z_ARRAY _Deref_post_z_
|
||||
#endif
|
||||
#else
|
||||
// gcc, clang, old versions of VS
|
||||
#define OUT_Z_ARRAY
|
||||
#endif
|
||||
|
||||
template <size_t maxLenInChars> void sprintf_safe(OUT_Z_ARRAY char (&pDest)[maxLenInChars], const char *pFormat, ... )
|
||||
{
|
||||
va_list params;
|
||||
va_start( params, pFormat );
|
||||
#ifdef POSIX
|
||||
vsnprintf( pDest, maxLenInChars, pFormat, params );
|
||||
#else
|
||||
_vsnprintf( pDest, maxLenInChars, pFormat, params );
|
||||
#endif
|
||||
pDest[maxLenInChars - 1] = '\0';
|
||||
va_end( params );
|
||||
}
|
||||
|
||||
#ifdef STEAM_CEG
|
||||
// Steam DRM header file
|
||||
#include "cegclient.h"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
480
|
||||
Binary file not shown.
@@ -1035,6 +1035,7 @@ void GLMDisplayDB::PopulateRenderers( void )
|
||||
if(vendorID)
|
||||
{
|
||||
fields.m_pciVendorID = *((UInt32*)CFDataGetBytePtr(vendorID));
|
||||
CFRelease( vendorID );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1044,6 +1045,7 @@ void GLMDisplayDB::PopulateRenderers( void )
|
||||
if(deviceID)
|
||||
{
|
||||
fields.m_pciDeviceID = *((UInt32*)CFDataGetBytePtr(deviceID));
|
||||
CFRelease( deviceID );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1055,6 +1057,7 @@ void GLMDisplayDB::PopulateRenderers( void )
|
||||
int length = CFDataGetLength(model);
|
||||
char *data = (char*)CFDataGetBytePtr(model);
|
||||
strncpy( fields.m_pciModelString, data, sizeof(fields.m_pciModelString) );
|
||||
CFRelease( model );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
|
||||
// returns current app install folder for AppID, returns folder name length
|
||||
virtual uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize ) = 0;
|
||||
virtual bool BIsAppInstalled( AppId_t appID ) = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
// Result returned in a RegisterActivationCodeResponse_t callresult
|
||||
|
||||
@@ -222,6 +222,13 @@ enum { k_iClientScreenshotsCallbacks = 2200 };
|
||||
enum { k_iSteamScreenshotsCallbacks = 2300 };
|
||||
enum { k_iClientAudioCallbacks = 2400 };
|
||||
enum { k_iClientUnifiedMessagesCallbacks = 2500 };
|
||||
enum { k_iSteamStreamLauncherCallbacks = 2600 };
|
||||
enum { k_iClientControllerCallbacks = 2700 };
|
||||
enum { k_iSteamControllerCallbacks = 2800 };
|
||||
enum { k_iClientParentalSettingsCallbacks = 2900 };
|
||||
enum { k_iClientDeviceAuthCallbacks = 3000 };
|
||||
enum { k_iClientNetworkDeviceManagerCallbacks = 3100 };
|
||||
enum { k_iClientMusicCallbacks = 3200 };
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//====== Copyright 1996-2013, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to valve controller
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCONTROLLER_H
|
||||
#define ISTEAMCONTROLLER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// 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
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing stats, achievements, and leaderboard information
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamController
|
||||
{
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
#define STEAMCONTROLLER_INTERFACE_VERSION "STEAMCONTROLLER_INTERFACE_VERSION"
|
||||
|
||||
// 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:
|
||||
//-----------------------------------------------------------------------------
|
||||
/*
|
||||
struct ControllerCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamControllerCallbacks + 1 };
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMCONTROLLER_H
|
||||
@@ -241,6 +241,10 @@ public:
|
||||
// "jointrade" - opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API
|
||||
// "stats" - opens the overlay web browser to the specified user's stats
|
||||
// "achievements" - opens the overlay web browser to the specified user's achievements
|
||||
// "friendadd" - opens the overlay in minimal mode prompting the user to add the target user as a friend
|
||||
// "friendremove" - opens the overlay in minimal mode prompting the user to remove the target friend
|
||||
// "friendrequestaccept" - opens the overlay in minimal mode prompting the user to accept an incoming friend invite
|
||||
// "friendrequestignore" - opens the overlay in minimal mode prompting the user to ignore an incoming friend invite
|
||||
virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0;
|
||||
|
||||
// activates game overlay web browser directly to the specified URL
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
// the correct buffer size to use.
|
||||
virtual bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0;
|
||||
|
||||
// Gets the body data from a streaming HTTP response given a handle from HTTPRequestCompleted_t. Will return false if the
|
||||
// Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the
|
||||
// handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset
|
||||
// do not match the size and offset sent in HTTPRequestDataReceived_t.
|
||||
virtual bool GetHTTPStreamingResponseBodyData( HTTPRequestHandle hRequest, uint32 cOffset, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0;
|
||||
|
||||
@@ -101,7 +101,7 @@ enum EWorkshopFileType
|
||||
|
||||
// Update k_EWorkshopFileTypeMax if you add values
|
||||
k_EWorkshopFileTypeMax = 11
|
||||
|
||||
|
||||
};
|
||||
|
||||
enum EWorkshopVote
|
||||
@@ -140,113 +140,113 @@ enum EWorkshopVideoProvider
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamRemoteStorage
|
||||
{
|
||||
public:
|
||||
// NOTE
|
||||
//
|
||||
// Filenames are case-insensitive, and will be converted to lowercase automatically.
|
||||
// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
|
||||
// iterate the files, the filename returned will be "foo.bar".
|
||||
//
|
||||
public:
|
||||
// NOTE
|
||||
//
|
||||
// Filenames are case-insensitive, and will be converted to lowercase automatically.
|
||||
// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
|
||||
// iterate the files, the filename returned will be "foo.bar".
|
||||
//
|
||||
|
||||
// file operations
|
||||
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||
virtual bool FileForget( const char *pchFile ) = 0;
|
||||
virtual bool FileDelete( const char *pchFile ) = 0;
|
||||
virtual SteamAPICall_t FileShare( const char *pchFile ) = 0;
|
||||
virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0;
|
||||
// file operations
|
||||
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||
virtual bool FileForget( const char *pchFile ) = 0;
|
||||
virtual bool FileDelete( const char *pchFile ) = 0;
|
||||
virtual SteamAPICall_t FileShare( const char *pchFile ) = 0;
|
||||
virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0;
|
||||
|
||||
// file operations that cause network IO
|
||||
virtual UGCFileWriteStreamHandle_t FileWriteStreamOpen( const char *pchFile ) = 0;
|
||||
virtual bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, const void *pvData, int32 cubData ) = 0;
|
||||
virtual bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) = 0;
|
||||
virtual bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) = 0;
|
||||
// file operations that cause network IO
|
||||
virtual UGCFileWriteStreamHandle_t FileWriteStreamOpen( const char *pchFile ) = 0;
|
||||
virtual bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, const void *pvData, int32 cubData ) = 0;
|
||||
virtual bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) = 0;
|
||||
virtual bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) = 0;
|
||||
|
||||
// file information
|
||||
virtual bool FileExists( const char *pchFile ) = 0;
|
||||
virtual bool FilePersisted( const char *pchFile ) = 0;
|
||||
virtual int32 GetFileSize( const char *pchFile ) = 0;
|
||||
virtual int64 GetFileTimestamp( const char *pchFile ) = 0;
|
||||
virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0;
|
||||
// file information
|
||||
virtual bool FileExists( const char *pchFile ) = 0;
|
||||
virtual bool FilePersisted( const char *pchFile ) = 0;
|
||||
virtual int32 GetFileSize( const char *pchFile ) = 0;
|
||||
virtual int64 GetFileTimestamp( const char *pchFile ) = 0;
|
||||
virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0;
|
||||
|
||||
// iteration
|
||||
virtual int32 GetFileCount() = 0;
|
||||
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||
// iteration
|
||||
virtual int32 GetFileCount() = 0;
|
||||
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||
|
||||
// configuration management
|
||||
virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
|
||||
virtual bool IsCloudEnabledForAccount() = 0;
|
||||
virtual bool IsCloudEnabledForApp() = 0;
|
||||
virtual void SetCloudEnabledForApp( bool bEnabled ) = 0;
|
||||
// configuration management
|
||||
virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
|
||||
virtual bool IsCloudEnabledForAccount() = 0;
|
||||
virtual bool IsCloudEnabledForApp() = 0;
|
||||
virtual void SetCloudEnabledForApp( bool bEnabled ) = 0;
|
||||
|
||||
// user generated content
|
||||
// user generated content
|
||||
|
||||
// Downloads a UGC file. A priority value of 0 will download the file immediately,
|
||||
// otherwise it will wait to download the file until all downloads with a lower priority
|
||||
// value are completed. Downloads with equal priority will occur simultaneously.
|
||||
virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0;
|
||||
|
||||
// Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false
|
||||
// or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage
|
||||
virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0;
|
||||
// Downloads a UGC file. A priority value of 0 will download the file immediately,
|
||||
// otherwise it will wait to download the file until all downloads with a lower priority
|
||||
// value are completed. Downloads with equal priority will occur simultaneously.
|
||||
virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0;
|
||||
|
||||
// Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result
|
||||
virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, char **ppchName, int32 *pnFileSizeInBytes, CSteamID *pSteamIDOwner ) = 0;
|
||||
// Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false
|
||||
// or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage
|
||||
virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0;
|
||||
|
||||
// After download, gets the content of the file
|
||||
virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset ) = 0;
|
||||
// Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result
|
||||
virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, char **ppchName, int32 *pnFileSizeInBytes, CSteamID *pSteamIDOwner ) = 0;
|
||||
|
||||
// Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()
|
||||
virtual int32 GetCachedUGCCount() = 0;
|
||||
virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0;
|
||||
// After download, gets the content of the file
|
||||
virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset ) = 0;
|
||||
|
||||
// Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()
|
||||
virtual int32 GetCachedUGCCount() = 0;
|
||||
virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0;
|
||||
|
||||
// The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you
|
||||
// On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.
|
||||
|
||||
// The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you
|
||||
// On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.
|
||||
|
||||
#if defined(_PS3) || defined(_SERVER)
|
||||
// Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback
|
||||
virtual void GetFileListFromServer() = 0;
|
||||
// Indicate this file should be downloaded in the next sync
|
||||
virtual bool FileFetch( const char *pchFile ) = 0;
|
||||
// Indicate this file should be persisted in the next sync
|
||||
virtual bool FilePersist( const char *pchFile ) = 0;
|
||||
// Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback
|
||||
virtual bool SynchronizeToClient() = 0;
|
||||
// Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback
|
||||
virtual bool SynchronizeToServer() = 0;
|
||||
// Reset any fetch/persist/etc requests
|
||||
virtual bool ResetFileRequestState() = 0;
|
||||
// Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback
|
||||
virtual void GetFileListFromServer() = 0;
|
||||
// Indicate this file should be downloaded in the next sync
|
||||
virtual bool FileFetch( const char *pchFile ) = 0;
|
||||
// Indicate this file should be persisted in the next sync
|
||||
virtual bool FilePersist( const char *pchFile ) = 0;
|
||||
// Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback
|
||||
virtual bool SynchronizeToClient() = 0;
|
||||
// Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback
|
||||
virtual bool SynchronizeToServer() = 0;
|
||||
// Reset any fetch/persist/etc requests
|
||||
virtual bool ResetFileRequestState() = 0;
|
||||
#endif
|
||||
|
||||
// publishing UGC
|
||||
virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0;
|
||||
virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0;
|
||||
virtual bool UpdatePublishedFilePreviewFile( PublishedFileUpdateHandle_t updateHandle, const char *pchPreviewFile ) = 0;
|
||||
virtual bool UpdatePublishedFileTitle( PublishedFileUpdateHandle_t updateHandle, const char *pchTitle ) = 0;
|
||||
virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0;
|
||||
virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0;
|
||||
virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0;
|
||||
virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0;
|
||||
virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
// enumerate the files that the current user published with this app
|
||||
virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0;
|
||||
virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0;
|
||||
virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0;
|
||||
virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0;
|
||||
virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0;
|
||||
virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0;
|
||||
virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0;
|
||||
virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0;
|
||||
// this method enumerates the public view of workshop files
|
||||
virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0;
|
||||
// publishing UGC
|
||||
virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0;
|
||||
virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0;
|
||||
virtual bool UpdatePublishedFilePreviewFile( PublishedFileUpdateHandle_t updateHandle, const char *pchPreviewFile ) = 0;
|
||||
virtual bool UpdatePublishedFileTitle( PublishedFileUpdateHandle_t updateHandle, const char *pchTitle ) = 0;
|
||||
virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0;
|
||||
virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0;
|
||||
virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0;
|
||||
virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0;
|
||||
virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
// enumerate the files that the current user published with this app
|
||||
virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0;
|
||||
virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0;
|
||||
virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0;
|
||||
virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0;
|
||||
virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0;
|
||||
virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0;
|
||||
virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0;
|
||||
virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0;
|
||||
// this method enumerates the public view of workshop files
|
||||
virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0;
|
||||
|
||||
virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0;
|
||||
virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION010"
|
||||
@@ -399,9 +399,9 @@ struct RemoteStorageEnumerateUserSubscribedFilesResult_t
|
||||
};
|
||||
|
||||
#if defined(VALVE_CALLBACK_PACK_SMALL)
|
||||
VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 );
|
||||
VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 );
|
||||
#elif defined(VALVE_CALLBACK_PACK_LARGE)
|
||||
VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 + 4 );
|
||||
VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 + 4 );
|
||||
#else
|
||||
#warning You must first include isteamclient.h
|
||||
#endif
|
||||
|
||||
@@ -158,6 +158,14 @@ public:
|
||||
// retrieve a finished ticket
|
||||
virtual bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
|
||||
// Trading Card badges data access
|
||||
// if you only have one set of cards, the series will be 1
|
||||
// the user has can have two different badges for a series; the regular (max level 5) and the foil (max level 1)
|
||||
virtual int GetGameBadgeLevel( int nSeries, bool bFoil ) = 0;
|
||||
|
||||
// gets the Steam Level of the user, as shown on their profile
|
||||
virtual int GetPlayerSteamLevel() = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
// Initiates PS3 Logon request using just PSN ticket.
|
||||
//
|
||||
@@ -197,7 +205,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser016"
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser017"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
@@ -154,9 +154,12 @@ public:
|
||||
// Returns previously entered text & length
|
||||
virtual uint32 GetEnteredGamepadTextLength() = 0;
|
||||
virtual bool GetEnteredGamepadTextInput( char *pchText, uint32 cchText ) = 0;
|
||||
|
||||
// returns the language the steam client is running in, you probably want ISteamApps::GetCurrentGameLanguage instead, this is for very special usage cases
|
||||
virtual const char *GetSteamUILanguage() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils005"
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils006"
|
||||
|
||||
|
||||
// callbacks
|
||||
@@ -294,6 +297,7 @@ struct GamepadTextInputDismissed_t
|
||||
uint32 m_unSubmittedText;
|
||||
};
|
||||
|
||||
// k_iSteamUtilsCallbacks + 15 is taken
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,6 +22,7 @@
|
||||
#include "isteamscreenshots.h"
|
||||
#include "isteamhttp.h"
|
||||
#include "isteamunifiedmessages.h"
|
||||
#include "isteamcontroller.h"
|
||||
|
||||
#if defined( _PS3 )
|
||||
#include "steamps3params.h"
|
||||
@@ -413,6 +414,7 @@ private:
|
||||
ISteamScreenshots *m_pSteamScreenshots;
|
||||
ISteamHTTP *m_pSteamHTTP;
|
||||
ISteamUnifiedMessages*m_pSteamUnifiedMessages;
|
||||
ISteamController *m_pController;
|
||||
#ifdef _PS3
|
||||
ISteamPS3OverlayRender *m_pSteamPS3OverlayRender;
|
||||
#endif
|
||||
@@ -510,8 +512,8 @@ inline bool CSteamAPIContext::Init()
|
||||
|
||||
#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS)
|
||||
// this should be called before the game initialized the steam APIs
|
||||
// pchDate should be of the format "Mmm dd yyyy" (such as from the __DATE__ macro )
|
||||
// pchTime should be of the format "hh:mm:ss" (such as from the __TIME__ macro )
|
||||
// pchDate should be of the format "Mmm dd yyyy" (such as from the __DATE __ macro )
|
||||
// pchTime should be of the format "hh:mm:ss" (such as from the __TIME __ macro )
|
||||
// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder
|
||||
// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback
|
||||
// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream.
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
#include "steamuniverse.h"
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
@@ -178,18 +178,6 @@ typedef enum
|
||||
} EUserHasLicenseForAppResult;
|
||||
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
// k_EUniverseRC = 5, // no such universe anymore
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
@@ -235,6 +223,9 @@ enum EAppOwernshipFlags
|
||||
k_EAppOwernshipFlags_RegionRestricted = 4, // owns app, but not allowed to play in current region
|
||||
k_EAppOwernshipFlags_LowViolence = 8, // only low violence version
|
||||
k_EAppOwernshipFlags_InvalidPlatform = 16, // app not supported on current platform
|
||||
k_EAppOwernshipFlags_SharedLicense = 32, // license was granted by authorized local device
|
||||
k_EAppOwernshipFlags_FreeWeekend = 64, // owned by a free weekend licenses
|
||||
k_EAppOwernshipFlags_LicenseLocked = 128, // shared license is locked (in use) by other user
|
||||
};
|
||||
|
||||
|
||||
@@ -252,7 +243,8 @@ enum EAppType
|
||||
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_Shortcut = 0x40000000, // just a shortcut, client side only
|
||||
k_EAppType_DepotOnly = 0x80000000, // placeholder since depots and apps share the same namespace
|
||||
};
|
||||
@@ -448,6 +440,12 @@ public:
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
#ifdef INT64_DIFFERENT_FROM_INT64_T
|
||||
CSteamID( uint64_t ulSteamID )
|
||||
{
|
||||
SetFromUint64( (uint64)ulSteamID );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -512,6 +510,18 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Clear all fields, leaving an invalid ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
void Clear()
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid;
|
||||
m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
@@ -708,6 +718,12 @@ public:
|
||||
static const char * Render( 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.
|
||||
// SetFromStringStrict requires the exact string forms that we support
|
||||
// and is preferred when the caller knows it's safe to be strict.
|
||||
// Returns whether the string parsed correctly.
|
||||
bool SetFromStringStrict( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; }
|
||||
@@ -826,6 +842,12 @@ public:
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
#ifdef INT64_DIFFERENT_FROM_INT64_T
|
||||
CGameID( uint64_t ulGameID )
|
||||
{
|
||||
m_ulGameID = (uint64)ulGameID;
|
||||
}
|
||||
#endif
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
|
||||
@@ -24,9 +24,9 @@ enum EHTTPMethod
|
||||
// The remaining HTTP methods are not yet supported, per rfc2616 section 5.1.1 only GET and HEAD are required for
|
||||
// a compliant general purpose server. We'll likely add more as we find uses for them.
|
||||
|
||||
// k_EHTTPMethodOPTIONS,
|
||||
k_EHTTPMethodPUT,
|
||||
k_EHTTPMethodDELETE,
|
||||
k_EHTTPMethodOPTIONS,
|
||||
// k_EHTTPMethodTRACE,
|
||||
// k_EHTTPMethodCONNECT
|
||||
};
|
||||
|
||||
@@ -43,6 +43,9 @@ typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
typedef int64 lint64;
|
||||
typedef uint64 ulint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
@@ -59,6 +62,16 @@ typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
|
||||
// [u]int64 are actually defined as 'long long' and gcc 64-bit
|
||||
// doesn't automatically consider them the same as 'long int'.
|
||||
// Changing the types for [u]int64 is complicated by
|
||||
// there being many definitions, so we just
|
||||
// define a 'long int' here and use it in places that would
|
||||
// otherwise confuse the compiler.
|
||||
typedef long int lint64;
|
||||
typedef unsigned long int ulint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMUNIVERSE_H
|
||||
#define STEAMUNIVERSE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
// k_EUniverseRC = 5, // no such universe anymore
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
|
||||
#endif // STEAMUNIVERSE_H
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,58 @@
|
||||
This package was debianized by Peter Cernak <pce@users.sourceforge.net> on
|
||||
Sun, 5 Sep 2004 17:10:26 +0200.
|
||||
|
||||
It was downloaded from http://dejavu.sourceforge.net/
|
||||
|
||||
Upstream Authors: Stepan Roh <src@users.sourceforge.net> (original author),
|
||||
see /usr/share/doc/ttf-dejavu/AUTHORS for full list
|
||||
|
||||
Copyright:
|
||||
|
||||
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
|
||||
|
||||
Bitstream Vera Fonts Copyright
|
||||
------------------------------
|
||||
|
||||
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
|
||||
a trademark of Bitstream, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of the fonts accompanying this license ("Fonts") and associated
|
||||
documentation files (the "Font Software"), to reproduce and distribute the
|
||||
Font Software, including without limitation the rights to use, copy, merge,
|
||||
publish, distribute, and/or sell copies of the Font Software, and to permit
|
||||
persons to whom the Font Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright and trademark notices and this permission notice shall
|
||||
be included in all copies of one or more of the Font Software typefaces.
|
||||
|
||||
The Font Software may be modified, altered, or added to, and in particular
|
||||
the designs of glyphs or characters in the Fonts may be modified and
|
||||
additional glyphs or characters may be added to the Fonts, only if the fonts
|
||||
are renamed to names not containing either the words "Bitstream" or the word
|
||||
"Vera".
|
||||
|
||||
This License becomes null and void to the extent applicable to Fonts or Font
|
||||
Software that has been modified and is distributed under the "Bitstream
|
||||
Vera" names.
|
||||
|
||||
The Font Software may be sold as part of a larger software package but no
|
||||
copy of one or more of the Font Software typefaces may be sold by itself.
|
||||
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
|
||||
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
|
||||
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
||||
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
|
||||
FONT SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the names of Gnome, the Gnome
|
||||
Foundation, and Bitstream Inc., shall not be used in advertising or
|
||||
otherwise to promote the sale, use or other dealings in this Font Software
|
||||
without prior written authorization from the Gnome Foundation or Bitstream
|
||||
Inc., respectively. For further information, contact: fonts at gnome dot
|
||||
org.
|
||||
@@ -0,0 +1,147 @@
|
||||
#Generated by VisualGDB project wizard.
|
||||
#Visit http://visualgdb.com/makefiles for more details
|
||||
|
||||
#VisualGDB: AutoSourceFiles #<--- remove this line to disable auto-updating of SOURCEFILES and EXTERNAL_LIBS
|
||||
SOURCEFILES := BaseMenu.cpp clanchatroom.cpp connectingmenu.cpp gameenginesdl.cpp Leaderboards.cpp Lobby.cpp Main.cpp MainMenu.cpp p2pauth.cpp PhotonBeam.cpp QuitMenu.cpp RemoteStorage.cpp remotestoragesync.cpp ServerBrowser.cpp Ship.cpp SpaceWarClient.cpp SpaceWarEntity.cpp SpaceWarServer.cpp StarField.cpp StatsAndAchievements.cpp stdafx.cpp Sun.cpp VectorEntity.cpp voicechat.cpp
|
||||
|
||||
TARGETNAME := SteamworksExampleLinux
|
||||
#TARGETTYPE can be APP, STATIC or SHARED
|
||||
TARGETTYPE := APP
|
||||
|
||||
include flags.mak
|
||||
|
||||
CONFIG ?= RELEASE
|
||||
|
||||
ALL_MACROS := $(COMMON_MACROS)
|
||||
|
||||
ifeq ($(CONFIG),DEBUG)
|
||||
BINARYDIR = debug
|
||||
CFLAGS += $(DEBUG_CFLAGS)
|
||||
CXXFLAGS += $(DEBUG_CXXFLAGS)
|
||||
LDFLAGS += $(DEBUG_LDFLAGS)
|
||||
ALL_MACROS += $(DEBUG_MACROS)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG),RELEASE)
|
||||
BINARYDIR = release
|
||||
CFLAGS += $(RELEASE_CFLAGS)
|
||||
CXXFLAGS += $(RELEASE_CXXFLAGS)
|
||||
LDFLAGS += $(RELEASE_LDFLAGS)
|
||||
ALL_MACROS += $(RELEASE_MACROS)
|
||||
endif
|
||||
|
||||
ifeq ($(BINARYDIR),)
|
||||
error:
|
||||
$(error Please specify CONFIG=DEBUG/RELEASE)
|
||||
endif
|
||||
|
||||
EXTERNAL_LIBS :=
|
||||
EXTERNAL_LIBS_COPIED := $(foreach lib, $(EXTERNAL_LIBS),$(BINARYDIR)/$(notdir $(lib)))
|
||||
|
||||
CFLAGS += $(addprefix -I,$(INCLUDE_DIRS))
|
||||
CXXFLAGS += $(addprefix -I,$(INCLUDE_DIRS))
|
||||
|
||||
CFLAGS += $(addprefix -D,$(ALL_MACROS))
|
||||
CXXFLAGS += $(addprefix -D,$(ALL_MACROS))
|
||||
|
||||
CXXFLAGS += $(addprefix -framework ,$(MACOS_FRAMEWORKS))
|
||||
CFLAGS += $(addprefix -framework ,$(MACOS_FRAMEWORKS))
|
||||
LDFLAGS += $(addprefix -framework ,$(MACOS_FRAMEWORKS))
|
||||
|
||||
LDFLAGS += $(addprefix -L,$(LIBRARY_DIRS))
|
||||
|
||||
LIBRARY_LDFLAGS = $(addprefix -l,$(LIBRARY_NAMES))
|
||||
|
||||
ifeq ($(IS_LINUX_PROJECT),1)
|
||||
RPATH_PREFIX := -Wl,--rpath='$$ORIGIN/../
|
||||
LIBRARY_LDFLAGS += $(EXTERNAL_LIBS)
|
||||
LIBRARY_LDFLAGS += -Wl,--rpath='$$ORIGIN'
|
||||
LIBRARY_LDFLAGS += $(addsuffix ',$(addprefix $(RPATH_PREFIX),$(dir $(EXTERNAL_LIBS))))
|
||||
|
||||
ifeq ($(TARGETTYPE),SHARED)
|
||||
LIBRARY_LDFLAGS += -Wl,-soname,$(TARGETNAME)
|
||||
endif
|
||||
|
||||
else
|
||||
LIBRARY_LDFLAGS += $(EXTERNAL_LIBS)
|
||||
endif
|
||||
|
||||
|
||||
CFLAGS += $(MCUFLAGS)
|
||||
CXXFLAGS += $(MCUFLAGS)
|
||||
LDFLAGS += $(MCUFLAGS)
|
||||
|
||||
all_make_files := Makefile flags.mak $(ADDITIONAL_MAKE_FILES)
|
||||
|
||||
ifeq ($(STARTUPFILES),)
|
||||
all_source_files := $(SOURCEFILES)
|
||||
else
|
||||
all_source_files := $(STARTUPFILES) $(filter-out $(STARTUPFILES),$(SOURCEFILES))
|
||||
endif
|
||||
|
||||
source_obj1 := $(all_source_files:.cpp=.o)
|
||||
source_obj2 := $(source_obj1:.c=.o)
|
||||
source_objs := $(source_obj2:.S=.o)
|
||||
|
||||
all_objs := $(addprefix $(BINARYDIR)/, $(notdir $(source_objs)))
|
||||
|
||||
ifeq ($(GENERATE_BIN_FILE),1)
|
||||
all: $(BINARYDIR)/$(basename $(TARGETNAME)).bin
|
||||
|
||||
$(BINARYDIR)/$(basename $(TARGETNAME)).bin: $(BINARYDIR)/$(TARGETNAME)
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
|
||||
else
|
||||
all: $(BINARYDIR)/$(TARGETNAME)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGETTYPE),APP)
|
||||
$(BINARYDIR)/$(TARGETNAME): $(all_objs) $(EXTERNAL_LIBS) $(BINARYDIR)/$(STEAM_API) $(BINARYDIR)/SteamworksExample.sh $(BINARYDIR)/DejaVuSans.ttf
|
||||
$(LD) -o $@ $(LDFLAGS) $(START_GROUP) $(all_objs) $(LIBRARY_LDFLAGS) $(END_GROUP)
|
||||
@echo "You can start the game by running $(BINARYDIR)/SteamworksExample.sh"
|
||||
endif
|
||||
|
||||
ifeq ($(TARGETTYPE),SHARED)
|
||||
$(BINARYDIR)/$(TARGETNAME): $(all_objs) $(EXTERNAL_LIBS)
|
||||
$(LD) -shared -o $@ $(LDFLAGS) $(START_GROUP) $(all_objs) $(LIBRARY_LDFLAGS) $(END_GROUP)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGETTYPE),STATIC)
|
||||
$(BINARYDIR)/$(TARGETNAME): $(all_objs)
|
||||
$(AR) -r $@ $^
|
||||
endif
|
||||
|
||||
-include $(all_objs:.o=.dep)
|
||||
|
||||
clean:
|
||||
ifeq ($(USE_DEL_TO_CLEAN),1)
|
||||
del /S /Q $(BINARYDIR)
|
||||
else
|
||||
rm -f $(BINARYDIR)/*.o $(BINARYDIR)/*.dep $(BINARYDIR)/$(TARGETNAME)
|
||||
endif
|
||||
|
||||
$(BINARYDIR):
|
||||
mkdir $(BINARYDIR)
|
||||
|
||||
$(BINARYDIR)/$(STEAM_API): $(STEAMWORKS_SDK)/redistributable_bin/linux32/$(STEAM_API)
|
||||
cp -v $< $@
|
||||
chmod +x $@
|
||||
|
||||
$(BINARYDIR)/SteamworksExample.sh: SteamworksExample.sh
|
||||
cp -v $< $@
|
||||
chmod +x $@
|
||||
|
||||
$(BINARYDIR)/DejaVuSans.ttf: DejaVuSans.ttf
|
||||
cp -v $< $@
|
||||
|
||||
#VisualGDB: FileSpecificTemplates #<--- VisualGDB will use the following lines to define rules for source files in subdirectories
|
||||
$(BINARYDIR)/%.o : %.cpp $(all_make_files) |$(BINARYDIR)
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep)
|
||||
|
||||
$(BINARYDIR)/%.o : %.c $(all_make_files) |$(BINARYDIR)
|
||||
$(CC) $(CFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep)
|
||||
|
||||
$(BINARYDIR)/%.o : %.S $(all_make_files) |$(BINARYDIR)
|
||||
$(CC) $(CFLAGS) $(ASFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep)
|
||||
|
||||
#VisualGDB: GeneratedRules #<--- All lines below are auto-generated
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This is a script which runs the SteamworksExample in the Steam runtime
|
||||
|
||||
# The program location
|
||||
TOP=$(cd "${0%/*}" && echo ${PWD})
|
||||
|
||||
PROGRAM="${TOP}/SteamworksExampleLinux"
|
||||
|
||||
# Steam sets this environment variable when launching games
|
||||
if [ "$STEAM_RUNTIME" = "" ]; then
|
||||
export STEAM_RUNTIME="${TOP}/../../tools/linux/runtime/i386"
|
||||
export LD_LIBRARY_PATH="${STEAM_RUNTIME}/lib/i386-linux-gnu:${STEAM_RUNTIME}/lib:${STEAM_RUNTIME}/usr/lib/i386-linux-gnu:${STEAM_RUNTIME}/usr/lib:${LD_LIBRARY_PATH}"
|
||||
fi
|
||||
|
||||
# Add the current directory to the library path to pick up libsteam_api.so
|
||||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:."
|
||||
|
||||
exec "${PROGRAM}" "$@"
|
||||
|
||||
# vi: ts=4 sw=4 expandtab
|
||||
@@ -0,0 +1,79 @@
|
||||
#Generated by VisualGDB project wizard.
|
||||
#Feel free to modify any flags you want
|
||||
#Visit http://visualgdb.com/makefiles for more details
|
||||
|
||||
# Set this variable to the location of the Steamworks SDK
|
||||
ifeq ($(STEAMWORKS_SDK),)
|
||||
STEAMWORKS_SDK := $(PWD)/..
|
||||
endif
|
||||
STEAM_API := libsteam_api.so
|
||||
|
||||
# Uncomment this line to use the Steam Linux Runtime SDK
|
||||
# If you do this you should run the SDK setup.sh to download updates
|
||||
USE_STEAM_RUNTIME=true
|
||||
ifeq ($(USE_STEAM_RUNTIME),true)
|
||||
ifeq ($(STEAM_RUNTIME_SDK),)
|
||||
STEAM_RUNTIME_SDK := $(STEAMWORKS_SDK)/tools/linux
|
||||
endif
|
||||
ifeq ($(STEAM_RUNTIME_TARGET_ARCH),)
|
||||
STEAM_RUNTIME_TARGET_ARCH := i386
|
||||
export STEAM_RUNTIME_TARGET_ARCH
|
||||
endif
|
||||
ifeq ($(STEAM_RUNTIME_ROOT),)
|
||||
STEAM_RUNTIME_ROOT := $(STEAM_RUNTIME_SDK)/runtime/$(STEAM_RUNTIME_TARGET_ARCH)
|
||||
export STEAM_RUNTIME_ROOT
|
||||
endif
|
||||
STEAM_TOOLS_BIN := $(STEAM_RUNTIME_SDK)/bin/
|
||||
|
||||
ifeq ($(realpath $(STEAM_TOOLS_BIN)),)
|
||||
steam-runtime-setup:
|
||||
bash $(STEAM_RUNTIME_SDK)/setup.sh --auto-upgrade
|
||||
make
|
||||
|
||||
endif
|
||||
endif # USE_STEAM_RUNTIME
|
||||
|
||||
CC := $(STEAM_TOOLS_BIN)gcc
|
||||
CXX := $(STEAM_TOOLS_BIN)g++
|
||||
LD := $(CXX)
|
||||
AR := $(STEAM_TOOLS_BIN)ar
|
||||
OBJCOPY := $(STEAM_TOOLS_BIN)objcopy
|
||||
CP := cp
|
||||
SDL_CONFIG := $(STEAM_TOOLS_BIN)sdl2-config
|
||||
|
||||
# Since this is an example, we'll build Debug by default
|
||||
CONFIG ?= DEBUG
|
||||
|
||||
COMMON_MACROS :=
|
||||
DEBUG_MACROS := DEBUG
|
||||
RELEASE_MACROS := NDEBUG RELEASE
|
||||
|
||||
MCUFLAGS :=
|
||||
|
||||
INCLUDE_DIRS := $(STEAMWORKS_SDK)/public
|
||||
LIBRARY_DIRS := $(STEAMWORKS_SDK)/public/steam/lib/linux32 $(STEAMWORKS_SDK)/redistributable_bin/linux32
|
||||
LIBRARY_NAMES := steam_api
|
||||
|
||||
CFLAGS := -g -DPOSIX -DSDL $(shell STEAM_RUNTIME_ROOT=$(STEAM_RUNTIME_ROOT) $(SDL_CONFIG) --cflags)
|
||||
DEBUG_CFLAGS := -O0
|
||||
RELEASE_CFLAGS := -O3
|
||||
|
||||
CXXFLAGS := $(CFLAGS)
|
||||
DEBUG_CXXFLAGS := $(DEBUG_CFLAGS)
|
||||
RELEASE_CXXFLAGS := $(RELEASE_CFLAGS)
|
||||
|
||||
MACOS_FRAMEWORKS :=
|
||||
|
||||
LDFLAGS := $(shell STEAM_RUNTIME_ROOT=$(STEAM_RUNTIME_ROOT) $(SDL_CONFIG) --libs) -lSDL2_ttf -lfreetype -lz -lGL -lopenal
|
||||
DEBUG_LDFLAGS :=
|
||||
RELEASE_LDGLAGS :=
|
||||
|
||||
START_GROUP := -Wl,--start-group
|
||||
END_GROUP := -Wl,--end-group
|
||||
|
||||
USE_DEL_TO_CLEAN := 0
|
||||
GENERATE_BIN_FILE := 0
|
||||
ADDITIONAL_MAKE_FILES :=
|
||||
IS_LINUX_PROJECT := 1
|
||||
|
||||
include $(ADDITIONAL_MAKE_FILES)
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText );
|
||||
|
||||
// Create a new font returning our internal handle value for it (0 means failure)
|
||||
HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, char * pchFont );
|
||||
HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont );
|
||||
|
||||
// Create a new texture returning our internal handle value for it (0 means failure)
|
||||
HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight );
|
||||
@@ -450,4 +450,4 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // GAMEENGINEOSX_H
|
||||
#endif // GAMEENGINEOSX_H
|
||||
|
||||
@@ -1744,7 +1744,7 @@ HGAMETEXTURE CGameEngineGL::HCreateTexture( byte *pRGBAData, uint32 uWidth, uint
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Creates a new font
|
||||
//-----------------------------------------------------------------------------
|
||||
HGAMEFONT CGameEngineGL::HCreateFont( int nHeight, int nFontWeight, bool bItalic, char * pchFont )
|
||||
HGAMEFONT CGameEngineGL::HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont )
|
||||
{
|
||||
#if DX9MODE
|
||||
extern unsigned char g_glmDebugFontMap[ 128 * 128 ]; // raster order
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,247 @@
|
||||
//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose: Main class for the game engine -- SDL implementation
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef GAMEENGINESDL_H
|
||||
#define GAMEENGINESDL_H
|
||||
|
||||
typedef unsigned char byte;
|
||||
|
||||
#include "GameEngine.h"
|
||||
|
||||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_opengl.h"
|
||||
#include "SDL_ttf.h"
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
|
||||
|
||||
// How big is the vertex buffer for batching lines in total?
|
||||
// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't)
|
||||
#define LINE_BUFFER_TOTAL_SIZE 1000
|
||||
|
||||
// How many lines do we put in the buffer in between flushes?
|
||||
//
|
||||
// This should be enough smaller than the total size so that draw calls
|
||||
// can finish using the data before we wrap around and discard it.
|
||||
#define LINE_BUFFER_BATCH_SIZE 250
|
||||
|
||||
// How big is the vertex buffer for batching points in total?
|
||||
// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't)
|
||||
#define POINT_BUFFER_TOTAL_SIZE 1800
|
||||
|
||||
// How many points do we put in the buffer in between flushes?
|
||||
//
|
||||
// This should be enough smaller than the total size so that draw calls
|
||||
// can finish using the data before we wrap around and discard it.
|
||||
#define POINT_BUFFER_BATCH_SIZE 600
|
||||
|
||||
// How big is the vertex buffer for batching quads in total?
|
||||
// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't)
|
||||
#define QUAD_BUFFER_TOTAL_SIZE 1000
|
||||
|
||||
// How many quads do we put in the buffer in between flushes?
|
||||
//
|
||||
// This should be enough smaller than the total size so that draw calls
|
||||
// can finish using the data before we wrap around and discard it.
|
||||
#define QUAD_BUFFER_BATCH_SIZE 250
|
||||
|
||||
|
||||
|
||||
class CVoiceContext;
|
||||
class GLString;
|
||||
|
||||
class CGameEngineGL : public IGameEngine
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CGameEngineGL();
|
||||
|
||||
// Destructor
|
||||
~CGameEngineGL() { Shutdown(); }
|
||||
|
||||
// Check if the game engine is initialized ok and ready for use
|
||||
bool BReadyForUse() { return m_bEngineReadyForUse; }
|
||||
|
||||
// Check if the engine is shutting down
|
||||
bool BShuttingDown() { return m_bShuttingDown; }
|
||||
|
||||
// Set the background color
|
||||
void SetBackgroundColor( short a, short r, short g, short b );
|
||||
|
||||
// Start a frame, clear(), beginscene(), etc
|
||||
bool StartFrame();
|
||||
|
||||
// Finish a frame, endscene(), present(), etc.
|
||||
void EndFrame();
|
||||
|
||||
// Shutdown the game engine
|
||||
void Shutdown();
|
||||
|
||||
// Pump messages from the OS
|
||||
void MessagePump();
|
||||
|
||||
// Accessors for game screen size
|
||||
int32 GetViewportWidth() { return m_nWindowWidth; }
|
||||
int32 GetViewportHeight() { return m_nWindowHeight; }
|
||||
|
||||
// Function for drawing text to the screen, dwFormat is a combination of flags like DT_LEFT, TEXTPOS_VCENTER etc...
|
||||
bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText );
|
||||
|
||||
// Create a new font returning our internal handle value for it (0 means failure)
|
||||
HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont );
|
||||
|
||||
// Create a new texture returning our internal handle value for it (0 means failure)
|
||||
HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight );
|
||||
|
||||
// Draw a line, the engine itself will manage batching these (although you can explicitly flush if you need to)
|
||||
bool BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 );
|
||||
|
||||
// Flush the line buffer
|
||||
bool BFlushLineBuffer();
|
||||
|
||||
// Draw a point, the engine itself will manage batching these (although you can explicitly flush if you need to)
|
||||
bool BDrawPoint( float xPos, float yPos, DWORD dwColor );
|
||||
|
||||
// Flush the point buffer
|
||||
bool BFlushPointBuffer();
|
||||
|
||||
// Draw a filled quad
|
||||
bool BDrawFilledQuad( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor );
|
||||
|
||||
// Draw a textured rectangle
|
||||
bool BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1,
|
||||
float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture );
|
||||
|
||||
// Flush any still cached quad buffers
|
||||
bool BFlushQuadBuffer();
|
||||
|
||||
// Get the current state of a key
|
||||
bool BIsKeyDown( DWORD dwVK );
|
||||
|
||||
// Get the first (in some arbitrary order) key down, if any
|
||||
bool BGetFirstKeyDown( DWORD *pdwVK );
|
||||
|
||||
// Get current tick count for the game engine
|
||||
uint64 GetGameTickCount() { return m_ulGameTickCount; }
|
||||
|
||||
// Get the tick count elapsed since the previous frame
|
||||
// bugbug - We use this time to compute things like thrust and acceleration in the game,
|
||||
// so it's important in doesn't jump ahead by large increments... Need a better
|
||||
// way to handle that.
|
||||
uint64 GetGameTicksFrameDelta() { return m_ulGameTickCount - m_ulPreviousGameTickCount; }
|
||||
|
||||
// Tell the game engine to update current tick count
|
||||
void UpdateGameTickCount();
|
||||
|
||||
// Tell the game engine to sleep for a bit if needed to limit frame rate
|
||||
bool BSleepForFrameRateLimit( uint32 ulMaxFrameRate );
|
||||
|
||||
// Check if the game engine hwnd currently has focus (and a working d3d device)
|
||||
bool BGameEngineHasFocus() { return true; }
|
||||
|
||||
// Voice chat functions
|
||||
virtual HGAMEVOICECHANNEL HCreateVoiceChannel();
|
||||
virtual void DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel );
|
||||
virtual bool AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength );
|
||||
|
||||
void AdjustViewport();
|
||||
|
||||
// Initialize graphics
|
||||
bool BInitializeGraphics();
|
||||
|
||||
// Initialize the debug font library
|
||||
bool BInitializeCellDbgFont();
|
||||
|
||||
bool BInitializeAudio();
|
||||
|
||||
void RunAudio();
|
||||
|
||||
void UpdateKey( uint32_t vkKey, int nDown );
|
||||
|
||||
// Tracks whether the engine is ready for use
|
||||
bool m_bEngineReadyForUse;
|
||||
|
||||
// Tracks if we are shutting down
|
||||
bool m_bShuttingDown;
|
||||
|
||||
// The SDL window
|
||||
SDL_Window *m_window;
|
||||
SDL_GLContext m_context;
|
||||
|
||||
// Size of the window to display the game in
|
||||
int32 m_nWindowWidth;
|
||||
int32 m_nWindowHeight;
|
||||
|
||||
// Current game time in milliseconds
|
||||
uint64 m_ulGameTickCount;
|
||||
|
||||
// Game time at the start of the previous frame
|
||||
uint64 m_ulPreviousGameTickCount;
|
||||
|
||||
// White texture used when drawing filled quads
|
||||
HGAMETEXTURE m_hTextureWhite;
|
||||
|
||||
// Pointer to actual data for points
|
||||
GLfloat *m_rgflPointsData;
|
||||
GLubyte *m_rgflPointsColorData;
|
||||
|
||||
// How many points are outstanding needing flush
|
||||
DWORD m_dwPointsToFlush;
|
||||
|
||||
// Pointer to actual data for lines
|
||||
GLfloat *m_rgflLinesData;
|
||||
GLubyte *m_rgflLinesColorData;
|
||||
|
||||
|
||||
// How many lines are outstanding needing flush
|
||||
DWORD m_dwLinesToFlush;
|
||||
|
||||
// Pointer to actual data for quads
|
||||
GLfloat *m_rgflQuadsData;
|
||||
GLubyte *m_rgflQuadsColorData;
|
||||
GLfloat *m_rgflQuadsTextureData;
|
||||
|
||||
// How many lines are outstanding needing flush
|
||||
DWORD m_dwQuadsToFlush;
|
||||
|
||||
// Map of font handles we have given out
|
||||
HGAMEFONT m_nNextFontHandle;
|
||||
std::map< HGAMEFONT, TTF_Font * > m_MapGameFonts;
|
||||
std::map< std::string, HGAMETEXTURE > m_MapStrings;
|
||||
|
||||
// Map of handles to texture objects
|
||||
struct TextureData_t
|
||||
{
|
||||
uint32 m_uWidth;
|
||||
uint32 m_uHeight;
|
||||
GLuint m_uTextureID;
|
||||
};
|
||||
std::map<HGAMETEXTURE, TextureData_t> m_MapTextures;
|
||||
HGAMETEXTURE m_nNextTextureHandle;
|
||||
|
||||
// Last bound texture, used to know when we must flush
|
||||
HGAMETEXTURE m_hLastTexture;
|
||||
|
||||
// Map of button state, translated to VK for win32.
|
||||
std::set< DWORD > m_SetKeysDown;
|
||||
|
||||
ALCcontext* m_palContext;
|
||||
ALCdevice* m_palDevice;
|
||||
|
||||
// Map of voice handles
|
||||
std::map<HGAMEVOICECHANNEL, CVoiceContext* > m_MapVoiceChannel;
|
||||
uint32 m_unVoiceChannelCount;
|
||||
};
|
||||
|
||||
#endif // GAMEENGINESDL_H
|
||||
@@ -1537,7 +1537,7 @@ HGAMETEXTURE CGameEngineWin32::HCreateTexture( byte *pRGBAData, uint32 uWidth, u
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Creates a new font
|
||||
//-----------------------------------------------------------------------------
|
||||
HGAMEFONT CGameEngineWin32::HCreateFont( int nHeight, int nFontWeight, bool bItalic, char * pchFont )
|
||||
HGAMEFONT CGameEngineWin32::HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont )
|
||||
{
|
||||
if ( !m_pD3D9Device )
|
||||
return 0;
|
||||
@@ -1803,4 +1803,4 @@ bool CGameEngineWin32::AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pV
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText );
|
||||
|
||||
// Create a new font returning our internal handle value for it (0 means failure)
|
||||
HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, char * pchFont );
|
||||
HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont );
|
||||
|
||||
// Create a new texture returning our internal handle value for it (0 means failure)
|
||||
HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight );
|
||||
@@ -350,4 +350,4 @@ private:
|
||||
uint32 m_unVoiceChannelCount;
|
||||
};
|
||||
|
||||
#endif // GAMEENGINEWIN32_H
|
||||
#endif // GAMEENGINEWIN32_H
|
||||
|
||||
@@ -97,7 +97,7 @@ void CVoiceChat::RunFrame()
|
||||
const uint8* pVoiceData = (const uint8*) buffer;
|
||||
pVoiceData += sizeof(MsgVoiceChatData_t);
|
||||
|
||||
EVoiceResult res = SteamUser()->DecompressVoice( pVoiceData , nBytesWritten,
|
||||
res = SteamUser()->DecompressVoice( pVoiceData , nBytesWritten,
|
||||
m_ubUncompressedVoice, sizeof( m_ubUncompressedVoice ), &numUncompressedBytes, VOICE_OUTPUT_SAMPLE_RATE );
|
||||
|
||||
if ( res == k_EVoiceResultOK && numUncompressedBytes > 0 )
|
||||
@@ -193,7 +193,7 @@ void CVoiceChat::MarkPlayerAsActive( CSteamID steamID )
|
||||
}
|
||||
|
||||
/*char szText[100];
|
||||
_snprintf(szText, 100, "CVoiceChat::AddPlayerToSession: %s.\n", SteamFriends()->GetFriendPersonaName( steamID ) );
|
||||
sprintf_safe(szText, "CVoiceChat::AddPlayerToSession: %s.\n", SteamFriends()->GetFriendPersonaName( steamID ) );
|
||||
OutputDebugString( szText ); */
|
||||
|
||||
VoiceChatConnection_t session;
|
||||
@@ -352,4 +352,4 @@ void CVoiceChat::SendMessageToAll( const void *pubData, uint32 cubData )
|
||||
iter->second.ulLastSentTime = ulTimeNow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,70 @@
|
||||
|
||||
This is a set of tools targeting the Steam Linux Runtime.
|
||||
|
||||
Setup
|
||||
-------------
|
||||
|
||||
The first time you install the runtime SDK, you should run the setup
|
||||
script from the command line to download the set of packages you need
|
||||
for development:
|
||||
bash setup.sh
|
||||
|
||||
You can pick your target architecture(s) and either the release or debug
|
||||
version of the runtime. The debug runtime is built without optimizations
|
||||
and includes full source code.
|
||||
|
||||
You can re-run the script at any time to reconfigure the SDK. There are
|
||||
a number of command line options for automating the script, which you can
|
||||
see by running the script with the --help option.
|
||||
|
||||
|
||||
Updates
|
||||
-------
|
||||
|
||||
You can run the setup script at any time to get the latest version of the SDK:
|
||||
setup.sh --auto-update
|
||||
|
||||
If you need to get an old version, you can specify it with --version:
|
||||
setup.sh --version=2013-02-22
|
||||
|
||||
|
||||
Builds
|
||||
-------
|
||||
|
||||
Use the appropriate shell script to set up the environment for building with
|
||||
the runtime, or just look to see what environment variables it sets and use
|
||||
them directly in your build process.
|
||||
|
||||
For example to run a shell targeting 32-bit architecture:
|
||||
shell-i386.sh
|
||||
|
||||
For example to run a shell targeting 64-bit architecture:
|
||||
shell-amd64.sh
|
||||
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
Once you have built a program that targets the runtime, you can verify
|
||||
that all the dependencies are covered by the runtime with:
|
||||
runtime/scripts/check-program.sh <program_or_shared_library> | grep " /usr"
|
||||
|
||||
(note that the C library, OpenGL and 3D drivers are outside the runtime)
|
||||
|
||||
You can run programs in the runtime environment for testing with:
|
||||
run.sh <program> <arguments>
|
||||
e.g.
|
||||
run.sh ./MyGame -windowed
|
||||
|
||||
You can debug your programs in the runtime environment with run.sh as well:
|
||||
run.sh gdb MyGame
|
||||
(gdb) r -windowed
|
||||
|
||||
|
||||
More Info
|
||||
---------
|
||||
|
||||
You can get the scripts used to build these tools and report issues at:
|
||||
https://github.com/ValveSoftware/steam-runtime
|
||||
|
||||
Enjoy!
|
||||
@@ -0,0 +1,368 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script runs a shell with the environment set up for the Steam runtime
|
||||
# development environment.
|
||||
|
||||
# The top level of the cross-compiler tree
|
||||
ORIG_PWD="${PWD}"
|
||||
TOP=$(cd "${0%/*}" 2>/dev/null; echo "${PWD}")
|
||||
cd "${TOP}"
|
||||
|
||||
CONFIG=.config
|
||||
ARCHITECTURES="i386 amd64"
|
||||
ARCHIVE_EXT="tar.xz"
|
||||
RUNTIME_VERSION=latest
|
||||
|
||||
exit_usage()
|
||||
{
|
||||
echo "Usage: $0 [--host=<arch>] [--target=<arch>] [--debug|--release] [--version=<version>] [--depot=<url>] [--perforce] [--reset] [--auto-update] [--checkonly]" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function has_command()
|
||||
{
|
||||
command -v $1 >/dev/null
|
||||
return $?
|
||||
}
|
||||
|
||||
function detect_arch()
|
||||
{
|
||||
case $(uname -m) in
|
||||
*64)
|
||||
echo "amd64"
|
||||
;;
|
||||
*)
|
||||
echo "i386"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function reset_sdk()
|
||||
{
|
||||
if [ "${AUTO_UPGRADE}" != "true" ]; then
|
||||
echo "This will clean the SDK and redownload packages."
|
||||
read -p "Are you sure you want to continue? [y/N]: " response
|
||||
if [ "${response}" != "y" -a "${response}" != "Y" ]; then
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf checksums ${ARCHITECTURES} runtime*
|
||||
echo "Reset complete."
|
||||
echo
|
||||
}
|
||||
|
||||
declare -a ARGS=("$@")
|
||||
while [ "$1" ]; do
|
||||
case "$1" in
|
||||
--relaunch)
|
||||
RELAUNCHED=true
|
||||
;;
|
||||
--host=*)
|
||||
HOST_ARCH=$(expr "$1" : '[^=]*=\(.*\)')
|
||||
;;
|
||||
--target=*)
|
||||
TARGET_ARCH=$(expr "$1" : '[^=]*=\(.*\)')
|
||||
;;
|
||||
--debug)
|
||||
RUNTIME_FLAVOR="debug"
|
||||
;;
|
||||
--release)
|
||||
RUNTIME_FLAVOR="release"
|
||||
;;
|
||||
--version=*)
|
||||
RUNTIME_VERSION=$(expr "$1" : '[^=]*=\(.*\)')
|
||||
;;
|
||||
--depot=*)
|
||||
URL_PREFIX=$(expr "$1" : '[^=]*=\(.*\)')
|
||||
;;
|
||||
--perforce)
|
||||
USE_P4=true
|
||||
;;
|
||||
--reset)
|
||||
if [ "${RELAUNCHED}" != "true" ]; then
|
||||
reset_sdk
|
||||
fi
|
||||
;;
|
||||
--auto-update|--auto-upgrade)
|
||||
AUTO_UPGRADE=true
|
||||
;;
|
||||
--checkonly)
|
||||
CHECK_ONLY=true
|
||||
;;
|
||||
-h|--help)
|
||||
exit_usage
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown command line parameter: $1" >&2
|
||||
exit_usage
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
function check_curl()
|
||||
{
|
||||
if ! has_command curl; then
|
||||
if has_command apt-get; then
|
||||
echo "Installing curl to download packages..."
|
||||
sudo apt-get install curl
|
||||
echo
|
||||
else
|
||||
echo "Please install curl to download packages."
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Make sure we have curl to download packages
|
||||
check_curl
|
||||
|
||||
if [ -z "${HOST_ARCH}" ]; then
|
||||
HOST_ARCH=$(grep HOST_ARCH ${CONFIG} 2>/dev/null | awk -F= '{print $2}')
|
||||
if [ "${HOST_ARCH}" = "" ]; then
|
||||
HOST_ARCH=$(detect_arch)
|
||||
fi
|
||||
fi
|
||||
|
||||
DEFAULT_TARGET=$(grep TARGET_ARCH ${CONFIG} 2>/dev/null | awk -F= '{print $2}')
|
||||
if [ "${DEFAULT_TARGET}" = "" ]; then
|
||||
# Most people are targeting i386 (for now!)
|
||||
DEFAULT_TARGET=i386
|
||||
fi
|
||||
if [ -z "${TARGET_ARCH}" -a "${AUTO_UPGRADE}" = "true" ]; then
|
||||
TARGET_ARCH="${DEFAULT_TARGET}"
|
||||
fi
|
||||
if [ -z "${TARGET_ARCH}" ]; then
|
||||
cat <<__EOF__
|
||||
======================================
|
||||
Which architectures would you like to target?
|
||||
1) i386 (x86 32-bit)
|
||||
2) amd64 (x64 64-bit)
|
||||
3) all supported architectures
|
||||
__EOF__
|
||||
read -p "Default ${DEFAULT_TARGET}: " response
|
||||
case "${response}" in
|
||||
1|i386)
|
||||
TARGET_ARCH=i386
|
||||
;;
|
||||
2|amd64)
|
||||
TARGET_ARCH=amd64
|
||||
;;
|
||||
3|all)
|
||||
TARGET_ARCH="${ARCHITECTURES}"
|
||||
;;
|
||||
*)
|
||||
TARGET_ARCH="${DEFAULT_TARGET}"
|
||||
;;
|
||||
esac
|
||||
echo "Set target architecture to: ${TARGET_ARCH}"
|
||||
echo
|
||||
fi
|
||||
|
||||
DEFAULT_FLAVOR=$(grep RUNTIME_FLAVOR ${CONFIG} 2>/dev/null | awk -F= '{print $2}')
|
||||
if [ "${DEFAULT_FLAVOR}" = "" ]; then
|
||||
DEFAULT_FLAVOR=release
|
||||
fi
|
||||
if [ -z "${RUNTIME_FLAVOR}" -a "${AUTO_UPGRADE}" = "true" ]; then
|
||||
RUNTIME_FLAVOR="${DEFAULT_FLAVOR}"
|
||||
fi
|
||||
if [ -z "${RUNTIME_FLAVOR}" ]; then
|
||||
cat <<__EOF__
|
||||
======================================
|
||||
Which runtime flavor would you like to use?
|
||||
1) release
|
||||
2) debug
|
||||
__EOF__
|
||||
read -p "Default ${DEFAULT_FLAVOR}: " response
|
||||
case "${response}" in
|
||||
1) RUNTIME_FLAVOR=release;;
|
||||
2) RUNTIME_FLAVOR=debug;;
|
||||
*) RUNTIME_FLAVOR="${DEFAULT_FLAVOR}";;
|
||||
esac
|
||||
echo "Set runtime flavor to: ${RUNTIME_FLAVOR}"
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ -z "${URL_PREFIX}" ]; then
|
||||
URL_PREFIX="http://media.steampowered.com/client/runtime"
|
||||
fi
|
||||
|
||||
# Make everything writable if we're using Perforce
|
||||
if [ "${USE_P4}" = "true" ]; then
|
||||
chmod -R +w .
|
||||
fi
|
||||
|
||||
# Save our config
|
||||
: >${CONFIG}
|
||||
echo "HOST_ARCH=${HOST_ARCH}" >>${CONFIG}
|
||||
echo "TARGET_ARCH=${TARGET_ARCH}" >>${CONFIG}
|
||||
echo "RUNTIME_FLAVOR=${RUNTIME_FLAVOR}" >>${CONFIG}
|
||||
|
||||
|
||||
UPDATED_FILES_RETURNCODE=42
|
||||
|
||||
function update_archive()
|
||||
{
|
||||
local NAME=$1
|
||||
local DEST=$2
|
||||
|
||||
if [ -z "${NAME}" -o -z "${DEST}" ]; then
|
||||
echo "Internal error: update_archive <name> <dest>" 2>&1
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# Download the latest archive checksum and see if we already have it
|
||||
local ARCHIVE="${NAME}_${RUNTIME_VERSION}.${ARCHIVE_EXT}"
|
||||
local CHECKSUM_FILE="${ARCHIVE}.md5"
|
||||
local CHECKSUM=$(curl -sf "${URL_PREFIX}/${CHECKSUM_FILE}")
|
||||
if [ "${CHECKSUM}" = "" ]; then
|
||||
# No updates available
|
||||
return 0
|
||||
fi
|
||||
if [ -f "checksums/${CHECKSUM_FILE}" ] && \
|
||||
[ "$(cat "checksums/${CHECKSUM_FILE}")" = "${CHECKSUM}" ]; then
|
||||
# We're all done!
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "$CHECK_ONLY" = "true" ]; then
|
||||
echo "Update available: ${URL_PREFIX}/${ARCHIVE}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Download and extract the archive
|
||||
echo "Installing ${URL_PREFIX}/${ARCHIVE}..."
|
||||
curl -#f "${URL_PREFIX}/${ARCHIVE}" | tar xJf - --strip-components=1 -C "${DEST}"
|
||||
|
||||
# Update the checksum
|
||||
mkdir -p checksums
|
||||
rm -f checksums/${NAME}_*
|
||||
echo "${CHECKSUM}" >"checksums/${CHECKSUM_FILE}"
|
||||
|
||||
# All done!
|
||||
return ${UPDATED_FILES_RETURNCODE}
|
||||
}
|
||||
|
||||
function fold_case()
|
||||
{
|
||||
echo "Removing files with the same case..."
|
||||
find . \( -type f -o -type l \) | sort -f | uniq -i -d | while read file; do
|
||||
find "$(dirname "$file")" -iname "$(basename "$file")" | while read other; do
|
||||
if [ "$other" != "$file" ]; then
|
||||
rm -v "$other"
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
function p4reconcile()
|
||||
{
|
||||
P4LOG=/tmp/p4.log
|
||||
fold_case
|
||||
p4 reconcile -f ... >"${P4LOG}"
|
||||
echo "Perforce log is in ${P4LOG}"
|
||||
}
|
||||
|
||||
# Update SDK files and restart if necessary
|
||||
if [ "${RELAUNCHED}" = "true" ]; then
|
||||
response=n
|
||||
elif [ "${AUTO_UPGRADE}" = "true" ]; then
|
||||
response=y
|
||||
else
|
||||
echo "======================================"
|
||||
read -p "Update base SDK? [Y/n]: " response
|
||||
fi
|
||||
if [ "${response}" != "n" ]; then
|
||||
update_archive steam-runtime-sdk .
|
||||
case $? in
|
||||
0)
|
||||
if [ "${AUTO_UPGRADE}" != "true" ]; then
|
||||
echo "No updates available."
|
||||
fi
|
||||
;;
|
||||
${UPDATED_FILES_RETURNCODE})
|
||||
echo
|
||||
cd "${ORIG_PWD}"
|
||||
exec "$0" --relaunch --host="${HOST_ARCH}" --target="${TARGET_ARCH}" --${RUNTIME_FLAVOR} "${ARGS[@]}"
|
||||
;;
|
||||
esac
|
||||
echo
|
||||
fi
|
||||
|
||||
# Update tools
|
||||
if [ "${AUTO_UPGRADE}" = "true" ]; then
|
||||
response=y
|
||||
else
|
||||
echo "======================================"
|
||||
read -p "Update tools? [Y/n]: " response
|
||||
fi
|
||||
if [ "${response}" != "n" ]; then
|
||||
AVAILABLE_UPDATES=false
|
||||
for host_arch in ${HOST_ARCH}; do
|
||||
for target_arch in ${TARGET_ARCH}; do
|
||||
update_archive x-tools-${host_arch}-${target_arch} .
|
||||
case $? in
|
||||
0)
|
||||
;;
|
||||
*)
|
||||
AVAILABLE_UPDATES=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
if [ "${AVAILABLE_UPDATES}" != "true" -a "${AUTO_UPGRADE}" != "true" ]; then
|
||||
echo "No updates available."
|
||||
fi
|
||||
echo
|
||||
fi
|
||||
|
||||
# Update runtime
|
||||
if [ "${AUTO_UPGRADE}" = "true" ]; then
|
||||
response=y
|
||||
else
|
||||
echo "======================================"
|
||||
read -p "Update runtime? [Y/n]: " response
|
||||
fi
|
||||
if [ "${response}" != "n" ]; then
|
||||
AVAILABLE_UPDATES=false
|
||||
for target_arch in ${TARGET_ARCH}; do
|
||||
mkdir -p runtime-${RUNTIME_FLAVOR}
|
||||
update_archive steam-runtime-dev-${RUNTIME_FLAVOR}-${target_arch} runtime-${RUNTIME_FLAVOR}
|
||||
case $? in
|
||||
0)
|
||||
;;
|
||||
*)
|
||||
AVAILABLE_UPDATES=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "${AVAILABLE_UPDATES}" != "true" -a "${AUTO_UPGRADE}" != "true" ]; then
|
||||
echo "No updates available."
|
||||
fi
|
||||
echo
|
||||
fi
|
||||
rm -f runtime || exit 16
|
||||
ln -s runtime-${RUNTIME_FLAVOR} runtime
|
||||
|
||||
# Set up symbolic link to automatically find source when debugging
|
||||
if [ "${RUNTIME_FLAVOR}" = "debug" ]; then
|
||||
rm -f /tmp/source && \
|
||||
ln -sf "${TOP}/runtime-${RUNTIME_FLAVOR}/source" /tmp/source
|
||||
fi
|
||||
|
||||
if [ "${USE_P4}" = "true" ]; then
|
||||
echo "======================================"
|
||||
echo "Creating Perforce changelist..."
|
||||
p4reconcile
|
||||
echo
|
||||
fi
|
||||
|
||||
echo "======================================"
|
||||
echo "Update complete!"
|
||||
|
||||
# vi: ts=4 sw=4 expandtab
|
||||
Reference in New Issue
Block a user