• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LTARRAYSIZE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LTARRAYSIZE函数的典型用法代码示例。如果您正苦于以下问题:C++ LTARRAYSIZE函数的具体用法?C++ LTARRAYSIZE怎么用?C++ LTARRAYSIZE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LTARRAYSIZE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: LTARRAYSIZE

void LightBase::Load(ILTMessage_Read *pMsg, uint32 dwLoadFlags)
{
	if (!pMsg) 
		return;

	ILTMessage_Read& cMsg = *pMsg;

	m_vColor				= cMsg.ReadLTVector();
	m_vDirectionalDims		= cMsg.ReadLTVector();
	m_vTranslucentColor		= cMsg.ReadLTVector();
	m_vSpecularColor		= cMsg.ReadLTVector();
	m_fLightRadius			= cMsg.Readfloat();
	m_fIntensityScale		= cMsg.Readfloat();
	m_eLightType			= (EEngineLightType)cMsg.Readuint8();
	m_fSpotFovX				= cMsg.Readfloat();
	m_fSpotFovY				= cMsg.Readfloat();
	m_fSpotNearClip			= cMsg.Readfloat();
	m_eLightLOD				= (EEngineLOD)cMsg.Readuint8();
	m_eWorldShadowsLOD		= (EEngineLOD)cMsg.Readuint8();
	m_eObjectShadowsLOD		= (EEngineLOD)cMsg.Readuint8();

	char pszTextureBuffer[MAX_PATH + 1];

	cMsg.ReadString(pszTextureBuffer, LTARRAYSIZE(pszTextureBuffer));
	m_sLightTexture = pszTextureBuffer;

	cMsg.ReadString(pszTextureBuffer, LTARRAYSIZE(pszTextureBuffer));
	m_sLightAttenuationTexture = pszTextureBuffer;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:29,代码来源:LightBase.cpp


示例2: defined

// Launches the end splash screen.
bool LaunchApplication::LaunchEndSplashScreen( )
{
#if defined(PLATFORM_WIN32)

	if( !g_pLTIStringEdit->DoesIDExist(g_pLTDBStringEdit, "EndSplashURL" ))
		return false;

	char szEndSplashURL[MAX_PATH*2] = "";
	LTStrCpy( szEndSplashURL, MPW2A( LoadString( "EndSplashURL" )).c_str(), LTARRAYSIZE( szEndSplashURL ));
	if( LTStrEmpty( szEndSplashURL ))
		return false;

	char szExe[MAX_PATH] = "";
	uint32 nExeSize = LTARRAYSIZE( szExe );
	AssocQueryString(ASSOCF_NOTRUNCATE,
		ASSOCSTR_EXECUTABLE,
		".htm",
		"open",
		szExe,
		( DWORD* )&nExeSize);

	return LaunchFromString( szExe, szEndSplashURL, true, true );
#else
	return false;
#endif
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:27,代码来源:ClientUtilities.cpp


示例3: LTARRAYSIZE

void CAIGoalStunned::DeactivateGoal()
{
	super::DeactivateGoal();

	// Disable the flashlight of whoever stunned me.

	CAIWMFact factQuery;
	factQuery.SetFactType( kFact_Desire );
	factQuery.SetDesireType( kDesire_Stunned );
	CAIWMFact* pFact = m_pAI->GetAIWorkingMemory()->FindWMFact( factQuery );
	if( pFact )
	{
		// Enable the flashlight after some delay.

		char szName[64];
		HOBJECT hStunner = pFact->GetTargetObject();
		ILTBaseClass* pStunner = g_pLTServer->HandleToObject( hStunner );
		g_pLTServer->GetObjectName( hStunner, szName, LTARRAYSIZE(szName) );

		float fDelay = g_pAIDB->GetMiscFloat( FLASHLIGHT_DISABLE_TIME );

		char szCommand[128];
		LTSNPrintF( szCommand, LTARRAYSIZE( szCommand ), "delay %.2f (msg %s (FLASHLIGHT ENABLE))", fDelay, szName );
		g_pCmdMgr->QueueCommand( szCommand, m_pAI, pStunner );
	}

	// Clear the knowledge of reacting to getting stunned.

	m_pAI->GetAIWorldState()->SetWSProp( kWSK_ReactedToWorldStateEvent, m_pAI->m_hObject, kWST_ENUM_AIWorldStateEvent, kWSE_Invalid );
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:30,代码来源:AIGoalStunned.cpp


示例4: switch

void ClientVoteMgr::HandleVotePass()
{
	wchar_t wszMsg[256] = L"";

	switch(m_CurrentVote.m_eVoteType)
	{
	case eVote_Kick:
		FormatString("Vote_Pass_Kick",wszMsg,LTARRAYSIZE(wszMsg),m_sTargetName.c_str());
		g_pGameMsgs->AddMessage(wszMsg);
		break;
	case eVote_TeamKick:
		FormatString("Vote_Pass_TeamKick",wszMsg,LTARRAYSIZE(wszMsg),m_sTargetName.c_str());
		g_pGameMsgs->AddMessage(wszMsg);
		break;
	case eVote_Ban:
		FormatString("Vote_Pass_Ban",wszMsg,LTARRAYSIZE(wszMsg),m_sTargetName.c_str());
		g_pGameMsgs->AddMessage(wszMsg);
		break;
	case eVote_NextRound:
		g_pGameMsgs->AddMessage( LoadString("Vote_Pass_NextRound") );
		break;
	case eVote_NextMap:
		g_pGameMsgs->AddMessage( LoadString("Vote_Pass_NextMap") );
		break;
	case eVote_SelectMap:
		FormatString("Vote_Pass_SelectMap",wszMsg,LTARRAYSIZE(wszMsg),m_sTargetName.c_str());
		g_pGameMsgs->AddMessage(wszMsg);
		break;
	}


	ClearVote();
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:33,代码来源:ClientVoteMgr.cpp


示例5: EnterCriticalSection

void CLoadingScreen::ClientContentTransferCompletedNotification()
{
	// No need to update content info if a different screen is being rendered...
	if( m_pRenderScreen )
		return;

	EnterCriticalSection(&m_MissionUpdate);

	// rebuild and reinitialize the mission database
	g_pMissionDB->Reset();
	g_pMissionDB->Init(DB_Default_File);
	g_pMissionDB->CreateMPDB();

	char szPath[MAX_PATH*2];
	LTFileOperations::GetUserDirectory(szPath, LTARRAYSIZE(szPath));
	LTStrCat( szPath, MDB_MP_File, LTARRAYSIZE( szPath ));
	g_pMissionDB->Init(szPath);

	m_CurrentFileName.SetString(L"");
	m_CurrentFileTime.SetString(L"");
	m_FilesLeft.SetString(L"");
	m_TotalTime.SetString(L"");

	UpdateCurrentBar(1.0f);
	UpdateTotalBar(1.0f);

	m_bContentTransfer = false;

	LeaveCriticalSection(&m_MissionUpdate);
	Update();
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:31,代码来源:LoadingScreen.cpp


示例6: LTSNPrintF

uint32 LTProfileUtils::ReadUint32(const char* pszSectionName, 
								const char* pszKeyName,
								uint32 nDefault,
								const char* pszFileName)
{
	char szValue[64];
	LTSNPrintF( szValue, LTARRAYSIZE( szValue ), "%d", nDefault );
	ReadString( pszSectionName, pszKeyName, szValue, szValue, LTARRAYSIZE( szValue ), pszFileName);
	
	return ( uint32 )atoi( szValue );
}
开发者ID:xfw5,项目名称:Fear-SDK-1.08,代码行数:11,代码来源:linux_ltprofileutils.cpp


示例7: FormatString

void CScreenHostOptionFile::UpdateName()
{
	CUserProfile* pProfile = g_pProfileMgr->GetCurrentProfile();

	wchar_t wszBuffer[MAX_PATH*2];

	const wchar_t* wszFriendlyName = CHostOptionsMapMgr::Instance().GetFriendlyNameFromFileName( pProfile->m_sServerOptionsFile.c_str() );
	if( wszFriendlyName )
		FormatString( "IDS_CURRENT_OPTIONFILE", wszBuffer, LTARRAYSIZE(wszBuffer), wszFriendlyName);
	else
		FormatString( "IDS_CURRENT_OPTIONFILE", wszBuffer, LTARRAYSIZE(wszBuffer), MPA2W(pProfile->m_sServerOptionsFile.c_str( )).c_str( ));
	m_pCurrent->SetString( wszBuffer );
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:13,代码来源:ScreenHostOptionFile.cpp


示例8: LTARRAYSIZE

bool BanIPMgr_Impl::ReadBans( )
{
	// build the file name by prepending the user directory
	char szFilename[MAX_PATH];
	LTFileOperations::GetUserDirectory(szFilename, LTARRAYSIZE(szFilename));
	LTStrCat(szFilename, szBanFile, LTARRAYSIZE(szFilename));

	// Check if there is a file to read.
	if( !LTFileOperations::FileExists( szFilename ))
		return true;

	// read in the current set of bans
	return LTFileOperations::ParseTextFile(szFilename, ReadBansProcessLineFn, this);
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:14,代码来源:BanIPMgr.cpp


示例9: DrawPrimSetRGBA

// Render the control
void CLTGUIFillFrame::Render()
{
	if( !IsVisible() )
		return;

	// fill with a background color
	LT_POLYG4 polyBackground;
	DrawPrimSetRGBA( polyBackground, m_nBackgroundColor );
	DrawPrimSetXYWH( polyBackground, GetPos().x, GetPos().y, GetWidth(), GetHeight() );
	g_pDrawPrim->SetRenderMode(eLTDrawPrimRenderMode_Modulate_Translucent);
	g_pDrawPrim->DrawPrim( &polyBackground );

	// render the border
	if( m_nFrameWidth )
	{
		// set up the render state	
		g_pDrawPrim->SetRenderMode(eLTDrawPrimRenderMode_Modulate_NoBlend);

		for (int f = 0;f < LTARRAYSIZE(m_Frame); ++f)
			DrawPrimSetRGBA(m_Frame[f],GetCurrentColor());

		// draw our frames
		if( (m_nBorderFlags & eBorder_Left) )
			g_pDrawPrim->DrawPrim( &m_Frame[0], 1 );
		if( (m_nBorderFlags & eBorder_Top) )
			g_pDrawPrim->DrawPrim( &m_Frame[1], 1 );
		if( (m_nBorderFlags & eBorder_Right) )
			g_pDrawPrim->DrawPrim( &m_Frame[2], 1 );
		if( (m_nBorderFlags & eBorder_Bottom) )
			g_pDrawPrim->DrawPrim( &m_Frame[3], 1 );
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:33,代码来源:ltguifillframe.cpp


示例10: AIError

void AIError(const char* szFormat, ...)
{
#ifndef _FINAL

	// jeffo 03/03/04:
	// Do NOT require DebugLevel to be 1, or LD will never see their errors!!
	//if (GetConsoleInt("DebugLevel",0) < 1 ) return;

	static char szBuffer[4096];
	va_list val;
	va_start(val, szFormat);
	LTVSNPrintF(szBuffer, LTARRAYSIZE(szBuffer), szFormat, val);
	va_end(val);

	// Check that the pointer is valid before use is attempted,
	// as if this is called in a WorldEdit crash, the LTServer pointer
	// is no where near existing.  This is NOT an error condition, just
	// an unfortunate side effect of WorldEdit and the engine using the same
	// GameServer.dll file for different situations.
	if ( g_pLTServer )
	{
		g_pLTServer->CPrint("AI ERROR: %s", szBuffer);
	}
#endif
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:25,代码来源:AIUtils.cpp


示例11: DisableCollisions

void CClientMeleeCollisionController::DisableCollisions()
{
	for ( int iEachCollider = 0; iEachCollider < LTARRAYSIZE(m_MeleeColliders); ++iEachCollider )
	{
		m_MeleeColliders[iEachCollider].m_bDisableRequest = true;
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:7,代码来源:ClientMeleeCollisionController.cpp


示例12: ResetCollisionData

void CClientMeleeCollisionController::ResetCollisionData()
{
	for ( int iEachCollider = 0; iEachCollider < LTARRAYSIZE(m_MeleeColliders); ++iEachCollider )
	{
		ResetCollider( m_MeleeColliders[iEachCollider] );
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:7,代码来源:ClientMeleeCollisionController.cpp


示例13: Update

void CClientMeleeCollisionController::Update()
{
	for ( int iEachCollider = 0; iEachCollider < LTARRAYSIZE(m_MeleeColliders); ++iEachCollider )
	{
		UpdateCollider( m_MeleeColliders[iEachCollider] );
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:7,代码来源:ClientMeleeCollisionController.cpp


示例14: FindDamageWho

// Converts the damagewho string in the damage to an enum.
static DamageWho FindDamageWho( HATTRIBUTE hStruct )
{
	// Initialize our search table.
	struct StringToEnum
	{
		CParsedMsg::CToken	m_tokString;
		DamageWho			m_eEnum;
	};
	static StringToEnum table[] = 
	{
		{ "ME", eDamageWho_Me },
		{ "THEM", eDamageWho_Them },
		{ "BOTH", eDamageWho_Both },
	};
	static uint32 nTableCount = LTARRAYSIZE( table );

	// Find the string location and return the enum.
	CParsedMsg::CToken tokValue = DATABASE_CATEGORY( CollisionProperty ).GETSTRUCTATTRIB( Damage, hStruct, 0, DamageWho );
	for( uint32 i = 0; i < nTableCount; i++ )	
	{
		if( table[i].m_tokString == tokValue )
			return table[i].m_eEnum;
	}

	return eDamageWho_Me;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:27,代码来源:ServerPhysicsCollisionMgr.cpp


示例15: PreHook_EditStringList

LTRESULT SpecialMovePlugin::PreHook_EditStringList(	const char* szRezPath,
													const char* szPropName,
													char** aszStrings,
													uint32* pcStrings,
													const uint32 cMaxStrings,
													const uint32 cMaxStringLength)
{
	if (LTStrIEquals("Animation", szPropName))
	{
		for (int i = 0; i < AnimPropUtils::Count(); i++)
		{
			const char* pszAnim = AnimPropUtils::String(EnumAnimProp(i));
			if (LTSubStrIEquals(pszAnim, SPECIALMOVE_PREFIX, LTARRAYSIZE(SPECIALMOVE_PREFIX)-1))
			{
				LTStrCpy(aszStrings[(*pcStrings)++], pszAnim, cMaxStringLength);
			}
		}
		return LT_OK;
	}
	else if (LTStrIEquals("ActivationType", szPropName))
	{
		if( CategoryPlugin::Instance().PopulateStringList( DATABASE_CATEGORY( Activate ).GetCategory(), 
			aszStrings, pcStrings, cMaxStrings, cMaxStringLength ))
		{
			return LT_OK;
		}
	}

	return LT_UNSUPPORTED;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:30,代码来源:SpecialMove.cpp


示例16: LTARRAYSIZE

void CScreenHostOptionFile::Delete(const wchar_t* pwsName)
{
	char szPath[MAX_PATH*2];

	const char* szFileName = CHostOptionsMapMgr::Instance().GetFileNameFromFriendlyName( pwsName );
	if( szFileName )
		GameModeMgr::Instance( ).GetOptionsFilePath( szFileName, szPath, LTARRAYSIZE( szPath ));
	else
		GameModeMgr::Instance( ).GetOptionsFilePath( MPW2A( pwsName ).c_str( ), szPath, LTARRAYSIZE( szPath ));
		
	LTFileOperations::DeleteFile( szPath );

	CHostOptionsMapMgr::Instance().Delete( pwsName );

	CreateFileList();
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:16,代码来源:ScreenHostOptionFile.cpp


示例17: LTStrCpy

BaseClass *SpawnObject(char const* pszSpawn, const LTVector& vPos, const LTRotation& rRot)
{
    if (!g_pLTServer || !pszSpawn) return NULL;

    // Make a local copy, since we change it.
    char szSpawn[2048];
    LTStrCpy( szSpawn, pszSpawn, LTARRAYSIZE(szSpawn) );

    // Pull the class name out of the spawn string...
    char* pszClassName = strtok(szSpawn, " ");
    if (!pszClassName) return NULL;

    HCLASS hClass = g_pLTServer->GetClass(pszClassName);
    if (!hClass) return NULL;

    ObjectCreateStruct theStruct;
    theStruct.m_Pos = vPos;
    theStruct.m_Rotation = rRot;

    // Set the string to be the rest of the string...
    char* pszProps = strtok(NULL, "");

    // Allocate an object...
    return (BaseClass *)g_pLTServer->CreateObjectProps(hClass, &theStruct, pszProps);
}
开发者ID:jordandavidson,项目名称:lithtech,代码行数:25,代码来源:Spawner.cpp


示例18: LTARRAYSIZE

void CCheatMgr::BootPlayer(CParsedMsgW const& cMsg)
{
	if (!IsMultiplayerGameClient()) return;

	CClientInfoMgr *pCIMgr = g_pGameClientShell->GetInterfaceMgr( )->GetClientInfoMgr();
	if (!pCIMgr) return;

	if( cMsg.GetArgCount() < 2 )
		return;

	// The full name of the player might be split between several 
	// arguments of the message so build the name from all arguments
	// except the name of the actual cheat (Arg 1).
	
	wchar_t szPlayerName[MAX_PLAYER_NAME] = {0};
	cMsg.ReCreateMsg( szPlayerName, LTARRAYSIZE( szPlayerName ), 1 );

	CLIENT_INFO* pInfo = pCIMgr->GetFirstClient();
	while (pInfo && LTStrICmp(pInfo->sName.c_str(),szPlayerName) != 0)
		pInfo = pInfo->pNext;

	if (pInfo)
	{

		// Tell the server
		SendCheatMessage( CHEAT_BOOT, pInfo->nID );
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:28,代码来源:CheatMgr.cpp


示例19: GetSound

char* GetSound(CCharacter* pCharacter, EnumAISoundType eSound)
{
/*
	if (g_pVersionMgr->IsLowViolence())
	{
		if ( (eSound == kAIS_Death) || (eSound == kAIS_DeathQuiet) || (eSound == kAIS_Pain) )
		{
			return BUILD_NOPAIN_WAV;
		}
	}
*/

	if (!pCharacter || !g_pServerSoundMgr) return NULL;
	if (eSound == kAIS_InvalidType ) return NULL;

	ModelsDB::HMODEL hModel = pCharacter->GetModel();

	HRECORD hSoundTemplate = g_pModelsDB->GetModelSoundTemplate(hModel);
	if( !hSoundTemplate )
		return NULL;

	// Look for sounds in a heirarchical manner: First look for the sound in the sound 
	// template, if it isn't found there look in the parent sound template, and so on...

	char szStr[128] = "";
	g_pAISoundDB->GetRandomSoundFilename(hSoundTemplate, AISoundUtils::String( eSound ), szStr, sizeof(szStr));

	if (!LTStrEmpty(szStr))
	{
		LTStrCpy(s_FileBuffer, szStr, LTARRAYSIZE(s_FileBuffer));
		return s_FileBuffer;
	}

	return NULL;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:35,代码来源:AISounds.cpp


示例20: CreateHFont

//given a font info structure, this will convert it to an actual logical font that can be
//used for rendering and other tasks
static HFONT CreateHFont(const CFontInfo& FontInfo)
{
	//clear out the logical font structure first
	LOGFONTW LogFont;
	memset( &LogFont, 0, sizeof( LogFont ));

	//now fill in each property
	LogFont.lfHeight = FontInfo.m_nHeight;

	//setup the weight to be either normal or bold
	LogFont.lfWeight = FontInfo.IsStyleSet(CFontInfo::kStyle_Bold) ? FW_BOLD : FW_NORMAL;

	//setup any additional styles such as italics, underline, etc.
	LogFont.lfItalic = FontInfo.IsStyleSet(CFontInfo::kStyle_Italic);

	//now just some standard flags for truetype fonts
	LogFont.lfCharSet				= FontInfo.m_lfCharSet;  // default is machines charset
	LogFont.lfOutPrecision		= OUT_TT_PRECIS;
	LogFont.lfClipPrecision		= CLIP_DEFAULT_PRECIS;
	LogFont.lfQuality				= ANTIALIASED_QUALITY;
	LogFont.lfPitchAndFamily	= DEFAULT_PITCH;

	//and finally copy over the typeface name
	LTStrCpy( LogFont.lfFaceName, FontInfo.m_szTypeface, LTARRAYSIZE(LogFont.lfFaceName) );

	return ::CreateFontIndirectW(&LogFont);
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:29,代码来源:texturestringimage.cpp



注:本文中的LTARRAYSIZE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LTC_ARGCHK函数代码示例发布时间:2022-05-30
下一篇:
C++ LShiftU64函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap