本文整理汇总了C++中IsPC函数的典型用法代码示例。如果您正苦于以下问题:C++ IsPC函数的具体用法?C++ IsPC怎么用?C++ IsPC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsPC函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ControllerMove
/*
===========
ControllerMove
===========
*/
void CInput::ControllerMove( float frametime, CUserCmd *cmd )
{
if ( IsPC() )
{
if (!m_fCameraInterceptingMouse && m_fMouseActive)
{
MouseMove( cmd);
}
}
JoyStickMove( frametime, cmd);
}
开发者ID:iosoccer,项目名称:iosoccer-game,代码行数:17,代码来源:in_main.cpp
示例2: ReloadFilesInList
void CTextureManager::ReloadFilesInList( IFileList *pFilesToReload )
{
if ( !IsPC() )
return;
for ( int i=m_TextureList.First(); i != m_TextureList.InvalidIndex(); i=m_TextureList.Next( i ) )
{
ITextureInternal *pTex = m_TextureList[i];
pTex->ReloadFilesInList( pFilesToReload );
}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:12,代码来源:texturemanager.cpp
示例3: DevWarning
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CMaterialSubRect::ParseMaterialVars( KeyValues &keyValues )
{
KeyValues *pKeyValues = &keyValues;
// I'm not quite sure how this can happen, but we'll see...
const char *pShaderName = pKeyValues->GetName();
if ( !pShaderName )
{
DevWarning( 1, "CMaterialSubRect::InitializeShader: Shader not specified in material %s.\n", GetName() );
Assert( 0 );
pShaderName = IsPC() ? "Wireframe_DX6" : "Wireframe_DX9";
}
// Verify we have the correct "shader." There is only one type.
if ( !Q_strcmp( pShaderName, "Subrect" ) )
{
KeyValues *pVar = pKeyValues->GetFirstSubKey();
while ( pVar )
{
if ( !Q_strcmp( pVar->GetName(), "$Pos" ) )
{
sscanf( pVar->GetString(), "%f %f", &m_vecOffset.x, &m_vecOffset.y );
}
if ( !Q_strcmp( pVar->GetName(), "$Size" ) )
{
sscanf( pVar->GetString(), "%f %f", &m_vecSize.x, &m_vecSize.y );
}
if ( !Q_strcmp( pVar->GetName(), "$Material" ) )
{
m_pMaterialPage = static_cast<IMaterialInternal*>( MaterialSystem()->FindMaterial( pVar->GetString(), TEXTURE_GROUP_DECAL ) );
m_pMaterialPage = m_pMaterialPage->GetRealTimeVersion(); //always work with the realtime material internally
}
// if ( !Q_strcmp( pVar->GetName(), "$decalscale" ) )
// {
// m_flDecalScale = pVar->GetFloat();
// }
// Add var to list.
IMaterialVar *pNewVar = CreateMaterialVarFromKeyValue( this, pVar );
if ( pNewVar )
{
m_aMaterialVars.AddToTail( pNewVar );
}
// Continue getting the keys until they are all found.
pVar = pVar->GetNextKey();
}
}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:55,代码来源:CMaterialSubRect.cpp
示例4: Init
void Init()
{
SetFlags( ACH_LISTEN_KILL_ENEMY_EVENTS | ACH_SAVE_WITH_GAME );
SetInflictorFilter( "npc_grenade_frag" );
SetVictimFilter( "npc_combine_s" );
SetGoal( 1 );
if ( IsPC() )
{
// only in Ep2 for PC. (Shared across HLX for X360.)
SetGameDirFilter( "ep2" );
}
}
开发者ID:NEITMod,项目名称:HL2BM2,代码行数:13,代码来源:achievements_hlx.cpp
示例5: ControllerMove
/*
===========
ControllerMove
===========
*/
void CInput::ControllerMove( float frametime, CUserCmd *cmd )
{
if ( IsPC() )
{
if ( !m_fCameraInterceptingMouse && m_fMouseActive )
{
MouseMove( cmd);
}
}
JoyStickMove( frametime, cmd);
#ifdef C17_HAPTICS
cliHaptics->HapticsMove ( frametime, cmd); // Haptics addition
#endif
}
开发者ID:KyleGospo,项目名称:City-17-Episode-One-Source,代码行数:20,代码来源:in_main.cpp
示例6: Connect
//-----------------------------------------------------------------------------
// Connect, disconnect
//-----------------------------------------------------------------------------
bool CEngineAPI::Connect( CreateInterfaceFn factory )
{
// Store off the app system factory...
g_AppSystemFactory = factory;
if ( !BaseClass::Connect( factory ) )
return false;
g_pFileSystem = g_pFullFileSystem;
if ( !g_pFileSystem )
return false;
g_pFileSystem->SetWarningFunc( Warning );
if ( !Shader_Connect( true ) )
return false;
g_pPhysics = (IPhysics*)factory( VPHYSICS_INTERFACE_VERSION, NULL );
if ( IsPC() )
{
avi = (IAvi*)factory( AVI_INTERFACE_VERSION, NULL );
if ( !avi )
return false;
}
bik = (IBik*)factory( BIK_INTERFACE_VERSION, NULL );
if ( !bik )
return false;
if ( !g_pStudioRender || !g_pDataCache || !g_pPhysics || !g_pMDLCache || !g_pMatSystemSurface || !g_pInputSystem )
{
Warning( "Engine wasn't able to acquire required interfaces!\n" );
return false;
}
if (!g_pStudioRender)
{
Sys_Error( "Unable to init studio render system version %s\n", STUDIO_RENDER_INTERFACE_VERSION );
return false;
}
g_pHammer = (IHammer*)factory( INTERFACEVERSION_HAMMER, NULL );
ConnectMDLCacheNotify();
return true;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:51,代码来源:sys_dll2.cpp
示例7: COM_TimestampedLog
//-----------------------------------------------------------------------------
// Purpose: For debugging startup times, etc.
// Input : *fmt -
// ... -
//-----------------------------------------------------------------------------
void COM_TimestampedLog( char const *fmt, ... )
{
static float s_LastStamp = 0.0;
static bool s_bShouldLog = false;
static bool s_bChecked = false;
static bool s_bFirstWrite = false;
if ( !s_bChecked )
{
// s_bShouldLog = ( IsX360() || CommandLine()->CheckParm( "-profile" ) ) ? true : false;
s_bShouldLog = false;
s_bChecked = true;
}
if ( !s_bShouldLog )
{
return;
}
char string[1024];
va_list argptr;
va_start( argptr, fmt );
_vsnprintf( string, sizeof( string ), fmt, argptr );
va_end( argptr );
float curStamp = Plat_FloatTime();
#if defined( _X360 )
XBX_rTimeStampLog( curStamp, string );
#endif
if ( IsPC() )
{
if ( !s_bFirstWrite )
{
unlink( "timestamped.log" );
s_bFirstWrite = true;
}
FILE* fp = fopen( "timestamped.log", "at+" );
fprintf( fp, "%8.4f / %8.4f: %s\n", curStamp, curStamp - s_LastStamp, string );
fclose( fp );
}
s_LastStamp = curStamp;
}
开发者ID:hzqst,项目名称:CaptionMod,代码行数:50,代码来源:dbg.cpp
示例8: IsLowViolenceBuild
// checks the registry for the low violence setting
// Check "HKEY_CURRENT_USER\Software\Valve\Source\Settings" and "User Token 2" or "User Token 3"
bool IsLowViolenceBuild( void )
{
#if defined(_WIN32)
HKEY hKey;
char szValue[64];
unsigned long len = sizeof(szValue) - 1;
bool retVal = false;
if ( IsPC() && RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Valve\\Source\\Settings", NULL, KEY_READ, &hKey) == ERROR_SUCCESS )
{
// User Token 2
if ( RegQueryValueEx( hKey, "User Token 2", NULL, NULL, (unsigned char*)szValue, &len ) == ERROR_SUCCESS )
{
if ( Q_strlen( szValue ) > 0 )
{
retVal = true;
}
}
if ( !retVal )
{
// reset "len" for the next check
len = sizeof(szValue) - 1;
// User Token 3
if ( RegQueryValueEx( hKey, "User Token 3", NULL, NULL, (unsigned char*)szValue, &len ) == ERROR_SUCCESS )
{
if ( Q_strlen( szValue ) > 0 )
{
retVal = true;
}
}
}
RegCloseKey(hKey);
}
return retVal;
#elif _LINUX
return false;
#else
#error "Fix me"
#endif
}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:46,代码来源:filesystem_init.cpp
示例9: ControllerMove
/*
===========
ControllerMove
===========
*/
void CInput::ControllerMove( float frametime, CUserCmd *cmd )
{
if ( IsPC() )
{
if ( !m_fCameraInterceptingMouse && m_fMouseActive )
{
MouseMove( cmd);
}
}
JoyStickMove( frametime, cmd);
#ifdef C17_HAPTICS
cliHaptics->HapticsMove(frametime, cmd); // Haptics addition
#endif
// NVNT if we have a haptic device..
if(haptics && haptics->HasDevice())
{
if(engine->IsPaused() || engine->IsLevelMainMenuBackground() || vgui::surface()->IsCursorVisible() || !engine->IsInGame())
{
// NVNT send a menu process to the haptics system.
haptics->MenuProcess();
return;
}
#ifdef CSTRIKE_DLL
// NVNT cstrike fov grabing.
C_BasePlayer *player = C_BasePlayer::GetLocalPlayer();
if(player){
haptics->UpdatePlayerFOV(player->GetFOV());
}
#endif
// NVNT calculate move with the navigation on the haptics system.
haptics->CalculateMove(cmd->forwardmove, cmd->sidemove, frametime);
// NVNT send a game process to the haptics system.
haptics->GameProcess();
#if defined( WIN32 ) && !defined( _X360 )
// NVNT update our avatar effect.
UpdateAvatarEffect();
#endif
}
}
开发者ID:KyleGospo,项目名称:City-17-Episode-One-Source-2013,代码行数:49,代码来源:in_main.cpp
示例10: GetPoint
void CHARACTER::ClearAffect(bool bSave)
{
TAffectFlag afOld = m_afAffectFlag;
WORD wMovSpd = GetPoint(POINT_MOV_SPEED);
WORD wAttSpd = GetPoint(POINT_ATT_SPEED);
itertype(m_list_pkAffect) it = m_list_pkAffect.begin();
while (it != m_list_pkAffect.end())
{
CAffect * pkAff = *it;
if (bSave)
{
if ( IS_NO_CLEAR_ON_DEATH_AFFECT(pkAff->dwType) || IS_NO_SAVE_AFFECT(pkAff->dwType) )
{
++it;
continue;
}
if (IsPC())
{
SendAffectRemovePacket(GetDesc(), GetPlayerID(), pkAff->dwType, pkAff->bApplyOn);
}
}
ComputeAffect(pkAff, false);
it = m_list_pkAffect.erase(it);
CAffect::Release(pkAff);
}
if (afOld != m_afAffectFlag ||
wMovSpd != GetPoint(POINT_MOV_SPEED) ||
wAttSpd != GetPoint(POINT_ATT_SPEED))
UpdatePacket();
CheckMaximumPoints();
if (m_list_pkAffect.empty())
event_cancel(&m_pkAffectEvent);
}
开发者ID:adi97ida,项目名称:Server,代码行数:42,代码来源:char_affect.cpp
示例11: FindPlatformDirectory
//-----------------------------------------------------------------------------
// Purpose: Finds which directory the platform resides in
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CGameUI::FindPlatformDirectory(char *platformDir, int bufferSize)
{
platformDir[0] = '\0';
if ( platformDir[0] == '\0' )
{
// we're not under steam, so setup using path relative to game
if ( IsPC() )
{
if ( ::GetModuleFileName( ( HINSTANCE )GetModuleHandle( NULL ), platformDir, bufferSize ) )
{
char *lastslash = strrchr(platformDir, '\\'); // this should be just before the filename
if ( lastslash )
{
*lastslash = 0;
Q_strncat(platformDir, "\\platform\\", bufferSize, COPY_ALL_CHARACTERS );
return true;
}
}
}
else
{
// xbox fetches the platform path from exisiting platform search path
// path to executeable is not correct for xbox remote configuration
if ( g_pFullFileSystem->GetSearchPath( "PLATFORM", false, platformDir, bufferSize ) )
{
char *pSeperator = strchr( platformDir, ';' );
if ( pSeperator )
*pSeperator = '\0';
return true;
}
}
Error( "Unable to determine platform directory\n" );
return false;
}
return (platformDir[0] != 0);
}
开发者ID:DonnaLisa,项目名称:swarm-deferred,代码行数:43,代码来源:gameui_interface.cpp
示例12: UpdateFullScreenDepthTexture
void UpdateFullScreenDepthTexture( void )
{
if( !g_pMaterialSystemHardwareConfig->SupportsPixelShaders_2_b() )
return;
ITexture *pDepthTex = GetFullFrameDepthTexture();
CMatRenderContextPtr pRenderContext( materials );
if( IsX360() )
{
pRenderContext->CopyRenderTargetToTextureEx( pDepthTex, -1, NULL, NULL );
}
else
{
pRenderContext->CopyRenderTargetToTextureEx( pDepthTex, 0, NULL, NULL );
}
pRenderContext->SetFullScreenDepthTextureValidityFlag( true );
if( r_depthoverlay.GetBool() )
{
IMaterial *pMaterial = materials->FindMaterial( "debug/showz", TEXTURE_GROUP_OTHER, true );
pMaterial->IncrementReferenceCount();
IMaterialVar *BaseTextureVar = pMaterial->FindVar( "$basetexture", NULL, false );
IMaterialVar *pDepthInAlpha = NULL;
if( IsPC() )
{
pDepthInAlpha = pMaterial->FindVar( "$ALPHADEPTH", NULL, false );
pDepthInAlpha->SetIntValue( 1 );
}
BaseTextureVar->SetTextureValue( pDepthTex );
pRenderContext->OverrideDepthEnable( true, false ); //don't write to depth, or else we'll never see translucents
pRenderContext->DrawScreenSpaceQuad( pMaterial );
pRenderContext->OverrideDepthEnable( false, true );
pMaterial->DecrementReferenceCount();
}
}
开发者ID:TalonBraveInfo,项目名称:InvasionSource,代码行数:39,代码来源:view_scene.cpp
示例13: ComputeAffect
bool CHARACTER::RemoveAffect(CAffect * pkAff)
{
if (!pkAff)
return false;
// AFFECT_BUF_FIX
m_list_pkAffect.remove(pkAff);
// END_OF_AFFECT_BUF_FIX
ComputeAffect(pkAff, false);
// 백기 버그 수정.
// 백기 버그는 버프 스킬 시전->둔갑->백기 사용(AFFECT_REVIVE_INVISIBLE) 후 바로 공격 할 경우에 발생한다.
// 원인은 둔갑을 시전하는 시점에, 버프 스킬 효과를 무시하고 둔갑 효과만 적용되게 되어있는데,
// 백기 사용 후 바로 공격하면 RemoveAffect가 불리게 되고, ComputePoints하면서 둔갑 효과 + 버프 스킬 효과가 된다.
// ComputePoints에서 둔갑 상태면 버프 스킬 효과 안 먹히도록 하면 되긴 하는데,
// ComputePoints는 광범위하게 사용되고 있어서 큰 변화를 주는 것이 꺼려진다.(어떤 side effect가 발생할지 알기 힘들다.)
// 따라서 AFFECT_REVIVE_INVISIBLE가 RemoveAffect로 삭제되는 경우만 수정한다.
// 시간이 다 되어 백기 효과가 풀리는 경우는 버그가 발생하지 않으므로 그와 똑같이 함.
// (ProcessAffect를 보면 시간이 다 되어서 Affect가 삭제되는 경우, ComputePoints를 부르지 않는다.)
if (AFFECT_REVIVE_INVISIBLE != pkAff->dwType)
{
ComputePoints();
}
CheckMaximumPoints();
if (test_server)
sys_log(0, "AFFECT_REMOVE: %s (flag %u apply: %u)", GetName(), pkAff->dwFlag, pkAff->bApplyOn);
if (IsPC())
{
SendAffectRemovePacket(GetDesc(), GetPlayerID(), pkAff->dwType, pkAff->bApplyOn);
}
CAffect::Release(pkAff);
return true;
}
开发者ID:adi97ida,项目名称:Server,代码行数:37,代码来源:char_affect.cpp
示例14: defined
bool old_bf_write::WriteBits(const void *pInData, int nBits)
{
#if defined( BB_PROFILING )
VPROF( "old_bf_write::WriteBits" );
#endif
unsigned char *pOut = (unsigned char*)pInData;
int nBitsLeft = nBits;
// Bounds checking..
if ( (m_iCurBit+nBits) > m_nDataBits )
{
SetOverflowFlag();
CallErrorHandler( BITBUFERROR_BUFFER_OVERRUN, GetDebugName() );
return false;
}
// Align output to dword boundary
while (((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8)
{
WriteUBitLong( *pOut, 8, false );
++pOut;
nBitsLeft -= 8;
}
if ( IsPC() && (nBitsLeft >= 32) && (m_iCurBit & 7) == 0 )
{
// current bit is byte aligned, do block copy
int numbytes = nBitsLeft >> 3;
int numbits = numbytes << 3;
Q_memcpy( m_pData+(m_iCurBit>>3), pOut, numbytes );
pOut += numbytes;
nBitsLeft -= numbits;
m_iCurBit += numbits;
}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:37,代码来源:bitbuf.cpp
示例15: FilterTime
//-----------------------------------------------------------------------------
// Purpose:
// Input : dt -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CEngine::FilterTime( float dt )
{
// Dedicated's tic_rate regulates server frame rate. Don't apply fps filter here.
// Only do this restriction on the client. Prevents clients from accomplishing certain
// hacks by pausing their client for a period of time.
if ( IsPC() && !sv.IsDedicated() && !CanCheat() && fps_max.GetFloat() < 30 )
{
// Don't do anything if fps_max=0 (which means it's unlimited).
if ( fps_max.GetFloat() != 0.0f )
{
Warning( "sv_cheats is 0 and fps_max is being limited to a minimum of 30 (or set to 0).\n" );
fps_max.SetValue( 30.0f );
}
}
float fps = fps_max.GetFloat();
if ( fps > 0.0f )
{
// Limit fps to withing tolerable range
// fps = max( MIN_FPS, fps ); // red herring - since we're only checking if dt < 1/fps, clamping against MIN_FPS has no effect
fps = min( MAX_FPS, fps );
float minframetime = 1.0 / fps;
if (
#if !defined(SWDS)
!demoplayer->IsPlayingTimeDemo() &&
#endif
dt < minframetime )
{
// framerate is too high
return false;
}
}
return true;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:42,代码来源:sys_engine.cpp
示例16: _aligned_offset_recalloc_base
ALLOC_CALL void * __cdecl _aligned_offset_recalloc_base( void * memblock, size_t size, size_t align, size_t offset)
{
Assert( IsPC() || 0 );
return NULL;
}
开发者ID:joaovarelas,项目名称:h00k-game-hack,代码行数:5,代码来源:memoverride.cpp
示例17: LocateGameInfoFile
//.........这里部分代码省略.........
// First, check for overrides on the command line or environment variables.
const char *pProject = GetVProjectCmdLineValue();
if ( pProject )
{
if ( DoesFileExistIn( pProject, GAMEINFO_FILENAME ) )
{
Q_MakeAbsolutePath( pOutDir, outDirLen, pProject );
return FS_OK;
}
if ( IsX360() && DoesFileExistIn( pProject, GAMEINFO_FILENAME_ALTERNATE ) )
{
Q_MakeAbsolutePath( pOutDir, outDirLen, pProject );
return FS_OK;
}
if ( IsX360() && CommandLine()->FindParm( "-basedir" ) )
{
char basePath[MAX_PATH];
strcpy( basePath, CommandLine()->ParmValue( "-basedir", "" ) );
Q_AppendSlash( basePath, sizeof( basePath ) );
Q_strncat( basePath, pProject, sizeof( basePath ), COPY_ALL_CHARACTERS );
if ( DoesFileExistIn( basePath, GAMEINFO_FILENAME ) )
{
Q_strncpy( pOutDir, basePath, outDirLen );
return FS_OK;
}
if ( DoesFileExistIn( basePath, GAMEINFO_FILENAME_ALTERNATE ) )
{
Q_strncpy( pOutDir, basePath, outDirLen );
return FS_OK;
}
}
if ( fsInfo.m_bNoGameInfo )
{
// fsInfo.m_bNoGameInfo is set by the Steam dedicated server, before it knows which mod to use.
// Steam dedicated server doesn't need a gameinfo.txt, because we'll ask which mod to use, even if
// -game is supplied on the command line.
Q_strncpy( pOutDir, "", outDirLen );
return FS_OK;
}
else
{
// They either specified vproject on the command line or it's in their registry. Either way,
// we don't want to continue if they've specified it but it's not valid.
goto ShowError;
}
}
if ( fsInfo.m_bNoGameInfo )
{
Q_strncpy( pOutDir, "", outDirLen );
return FS_OK;
}
// Ask the application if it can provide us with a game info directory
{
bool bBubbleDir = true;
SuggestGameInfoDirFn_t pfnSuggestGameInfoDirFn = GetSuggestGameInfoDirFn();
if ( pfnSuggestGameInfoDirFn &&
( * pfnSuggestGameInfoDirFn )( &fsInfo, pOutDir, outDirLen, &bBubbleDir ) &&
FS_OK == TryLocateGameInfoFile( pOutDir, outDirLen, bBubbleDir ) )
return FS_OK;
}
// Try to use the environment variable / registry
if ( ( pProject = getenv( GAMEDIR_TOKEN ) ) != NULL &&
( Q_MakeAbsolutePath( pOutDir, outDirLen, pProject ), 1 ) &&
FS_OK == TryLocateGameInfoFile( pOutDir, outDirLen, false ) )
return FS_OK;
if ( IsPC() )
{
Warning( "Warning: falling back to auto detection of vproject directory.\n" );
// Now look for it in the directory they passed in.
if ( fsInfo.m_pDirectoryName )
Q_MakeAbsolutePath( pOutDir, outDirLen, fsInfo.m_pDirectoryName );
else
Q_MakeAbsolutePath( pOutDir, outDirLen, "." );
if ( FS_OK == TryLocateGameInfoFile( pOutDir, outDirLen, true ) )
return FS_OK;
// Use the CWD
Q_getwd( pOutDir, outDirLen );
if ( FS_OK == TryLocateGameInfoFile( pOutDir, outDirLen, true ) )
return FS_OK;
}
ShowError:
return SetupFileSystemError( true, FS_MISSING_GAMEINFO_FILE,
"Unable to find %s. Solutions:\n\n"
"1. Read http://www.valve-erc.com/srcsdk/faq.html#NoGameDir\n"
"2. Run vconfig to specify which game you're working on.\n"
"3. Add -game <path> on the command line where <path> is the directory that %s is in.\n",
GAMEINFO_FILENAME, GAMEINFO_FILENAME );
}
开发者ID:AeroHand,项目名称:dota2-lua-engine,代码行数:101,代码来源:filesystem_init.cpp
示例18: FileSystem_LoadSearchPaths
FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo )
{
if ( !initInfo.m_pFileSystem || !initInfo.m_pDirectoryName )
return SetupFileSystemError( false, FS_INVALID_PARAMETERS, "FileSystem_LoadSearchPaths: Invalid parameters specified." );
KeyValues *pMainFile, *pFileSystemInfo, *pSearchPaths;
FSReturnCode_t retVal = LoadGameInfoFile( initInfo.m_pDirectoryName, pMainFile, pFileSystemInfo, pSearchPaths );
if ( retVal != FS_OK )
return retVal;
// All paths except those marked with |gameinfo_path| are relative to the base dir.
char baseDir[MAX_PATH];
if ( !FileSystem_GetBaseDir( baseDir, sizeof( baseDir ) ) )
return SetupFileSystemError( false, FS_INVALID_PARAMETERS, "FileSystem_GetBaseDir failed." );
initInfo.m_ModPath[0] = 0;
#define GAMEINFOPATH_TOKEN "|gameinfo_path|"
#define BASESOURCEPATHS_TOKEN "|all_source_engine_paths|"
bool bLowViolence = IsLowViolenceBuild();
bool bFirstGamePath = true;
for ( KeyValues *pCur=pSearchPaths->GetFirstValue(); pCur; pCur=pCur->GetNextValue() )
{
const char *pPathID = pCur->GetName();
const char *pLocation = pCur->GetString();
if ( Q_stristr( pLocation, GAMEINFOPATH_TOKEN ) == pLocation )
{
pLocation += strlen( GAMEINFOPATH_TOKEN );
FileSystem_AddLoadedSearchPath( initInfo, pPathID, &bFirstGamePath, initInfo.m_pDirectoryName, pLocation, bLowViolence );
}
else if ( Q_stristr( pLocation, BASESOURCEPATHS_TOKEN ) == pLocation )
{
// This is a special identifier that tells it to add the specified path for all source engine versions equal to or prior to this version.
// So in Orange Box, if they specified:
// |all_source_engine_paths|hl2
// it would add the ep2\hl2 folder and the base (ep1-era) hl2 folder.
//
// We need a special identifier in the gameinfo.txt here because the base hl2 folder exists in different places.
// In the case of a game or a Steam-launched dedicated server, all the necessary prior engine content is mapped in with the Steam depots,
// so we can just use the path as-is.
// In the case of an hldsupdatetool dedicated server, the base hl2 folder is "..\..\hl2" (since we're up in the 'orangebox' folder).
pLocation += strlen( BASESOURCEPATHS_TOKEN );
// Add the Orange-box path (which also will include whatever the depots mapped in as well if we're
// running a Steam-launched app).
FileSystem_AddLoadedSearchPath( initInfo, pPathID, &bFirstGamePath, baseDir, pLocation, bLowViolence );
if ( FileSystem_IsHldsUpdateToolDedicatedServer() )
{
// If we're using the hldsupdatetool dedicated server, then go up a directory to get the ep1-era files too.
char ep1EraPath[MAX_PATH];
V_snprintf( ep1EraPath, sizeof( ep1EraPath ), "..%c%s", CORRECT_PATH_SEPARATOR, pLocation );
FileSystem_AddLoadedSearchPath( initInfo, pPathID, &bFirstGamePath, baseDir, ep1EraPath, bLowViolence );
}
}
else
{
FileSystem_AddLoadedSearchPath( initInfo, pPathID, &bFirstGamePath, baseDir, pLocation, bLowViolence );
}
}
pMainFile->deleteThis();
//
// Set up search paths for add-ons
//
if ( IsPC() )
{
#ifdef ENGINE_DLL
FileSystem_UpdateAddonSearchPaths( initInfo.m_pFileSystem );
#endif
}
// these specialized tool paths are not used on 360 and cause a costly constant perf tax, so inhibited
if ( IsPC() )
{
// Create a content search path based on the game search path
const char *pGameRoot = getenv( GAMEROOT_TOKEN );
const char *pContentRoot = getenv( CONTENTROOT_TOKEN );
if ( pGameRoot && pContentRoot )
{
int nLen = initInfo.m_pFileSystem->GetSearchPath( "GAME", false, NULL, 0 );
char *pSearchPath = (char*)stackalloc( nLen * sizeof(char) );
initInfo.m_pFileSystem->GetSearchPath( "GAME", false, pSearchPath, nLen );
char *pPath = pSearchPath;
while( pPath )
{
char *pSemiColon = strchr( pPath, ';' );
if ( pSemiColon )
{
*pSemiColon = 0;
}
Q_StripTrailingSlash( pPath );
//.........这里部分代码省略.........
开发者ID:AeroHand,项目名称:dota2-lua-engine,代码行数:101,代码来源:filesystem_init.cpp
示例19: FindAffect
int CHARACTER::ProcessAffect()
{
bool bDiff = false;
CAffect *pkAff = NULL;
//
// 프리미엄 처리
//
for (int i = 0; i <= PREMIUM_MAX_NUM; ++i)
{
int aff_idx = i + AFFECT_PREMIUM_START;
pkAff = FindAffect(aff_idx);
if (!pkAff)
continue;
int remain = GetPremiumRemainSeconds(i);
if (remain < 0)
{
RemoveAffect(aff_idx);
bDiff = true;
}
else
pkAff->lDuration = remain + 1;
}
////////// HAIR_AFFECT
pkAff = FindAffect(AFFECT_HAIR);
if (pkAff)
{
// IF HAIR_LIMIT_TIME() < CURRENT_TIME()
if ( this->GetQuestFlag("hair.limit_time") < get_global_time())
{
// SET HAIR NORMAL
this->SetPart(PART_HAIR, 0);
// REMOVE HAIR AFFECT
RemoveAffect(AFFECT_HAIR);
}
else
{
// INCREASE AFFECT DURATION
++(pkAff->lDuration);
}
}
////////// HAIR_AFFECT
//
CHorseNameManager::instance().Validate(this);
TAffectFlag afOld = m_afAffectFlag;
long lMovSpd = GetPoint(POINT_MOV_SPEED);
long lAttSpd = GetPoint(POINT_ATT_SPEED);
itertype(m_list_pkAffect) it;
it = m_list_pkAffect.begin();
while (it != m_list_pkAffect.end())
{
pkAff = *it;
bool bEnd = false;
if (pkAff->dwType >= GUILD_SKILL_START && pkAff->dwType <= GUILD_SKILL_END)
{
if (!GetGuild() || !GetGuild()->UnderAnyWar())
bEnd = true;
}
if (pkAff->lSPCost > 0)
{
if (GetSP() < pkAff->lSPCost)
bEnd = true;
else
PointChange(POINT_SP, -pkAff->lSPCost);
}
// AFFECT_DURATION_BUG_FIX
// 무한 효과 아이템도 시간을 줄인다.
// 시간을 매우 크게 잡기 때문에 상관 없을 것이라 생각됨.
if ( --pkAff->lDuration <= 0 )
{
bEnd = true;
}
// END_AFFECT_DURATION_BUG_FIX
if (bEnd)
{
it = m_list_pkAffect.erase(it);
ComputeAffect(pkAff, false);
bDiff = true;
if (IsPC())
{
SendAffectRemovePacket(GetDesc(), GetPlayerID(), pkAff->dwType, pkAff->bApplyOn);
}
CAffect::Release(pkAff);
//.........这里部分代码省略.........
开发者ID:adi97ida,项目名称:Server,代码行数:101,代码来源:char_affect.cpp
示例20: StartProgressBar
//-----------------------------------------------------------------------------
// Purpose: paints all the vgui elements
//-----------------------------------------------------------------------------
void CGameUI::RunFrame()
{
if ( IsX360() && m_bOpenProgressOnStart )
{
StartProgressBar();
m_bOpenProgressOnStart = false;
}
int wide, tall;
#if defined( TOOLFRAMEWORK_VGUI_REFACTOR )
// resize the background panel to the screen size
vgui::VPANEL clientDllPanel = enginevguifuncs->GetPanel( PANEL_ROOT );
int x, y;
vgui::ipanel()->GetPos( clientDllPanel, x, y );
vgui::ipanel()->GetSize( clientDllPanel, wide, tall );
staticPanel->SetBounds( x, y, wide,tall );
#else
vgui::surface()->GetScreenSize(wide, tall);
GetUiBaseModPanelClass().SetSize(wide, tall);
#endif
// Run frames
g_VModuleLoader.RunFrame();
GetUiBaseModPanelClass().RunFrame();
// Play the start-up music the first time we run frame
if ( IsPC() && m_iPlayGameStartupSound > 0 )
{
m_iPlayGameStartupSound--;
if ( !m_iPlayGameStartupSound )
{
PlayGameStartupSound();
}
}
if ( IsPC() && m_bTryingToLoadFriends && m_iFriendsLoadPauseFrames-- < 1 && g_hMutex && g_hWaitMutex )
{
// try and load Steam platform files
unsigned int waitResult = Sys_WaitForSingleObject(g_hMutex, 0);
if (waitResult == SYS_WAIT_OBJECT_0 || waitResult == SYS_WAIT_ABANDONED)
{
// we got the mutex, so load Friends/Serverbrowser
// clear the loading flag
m_bTryingToLoadFriends = false;
g_VModuleLoader.LoadPlatformModules(&m_GameFactory, 1, false);
// release the wait mutex
Sys_ReleaseMutex(g_hWaitMutex);
// notify the game of our game name
const char *fullGamePath = engine->GetGameDirectory();
const char *pathSep = strrchr( fullGamePath, '/' );
if ( !pathSep )
{
pathSep = strrchr( fullGamePath, '\\' );
}
if ( pathSep )
{
KeyValues *pKV = new KeyValues("ActiveGameName" );
pKV->SetString( "name", pathSep + 1 );
pKV->SetInt( "appid", engine->GetAppID() );
KeyValues *modinfo = new KeyValues("ModInfo");
if ( modinfo->LoadFromFile( g_pFullFileSystem, "gameinfo.txt" ) )
{
pKV->SetString( "game", modinfo->GetString( "game", "" ) );
}
modinfo->deleteThis();
g_VModuleLoader.PostMessageToAllModules( pKV );
}
// notify the ui of a game connect if we're already in a game
if (m_iGameIP)
{
SendConnectedToGameMessage();
}
}
}
}
开发者ID:DonnaLisa,项目名称:swarm-deferred,代码行数:85,代码来源:gameui_interface.cpp
注:本文中的IsPC函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论