当前位置: 首页>>代码示例>>C++>>正文


C++ CGameSettings::GetFloatVar方法代码示例

本文整理汇总了C++中CGameSettings::GetFloatVar方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameSettings::GetFloatVar方法的具体用法?C++ CGameSettings::GetFloatVar怎么用?C++ CGameSettings::GetFloatVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGameSettings的用法示例。


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

示例1: OnFocus

// Called when the folder gains or focus
void CFolderDisplay::OnFocus(LTBOOL bFocus)
{
	CGameSettings *pSettings = g_pInterfaceMgr->GetSettings();

	if (bFocus)
	{
		m_bEscape = LTFALSE;

		m_bHardwareCursor = (GetConsoleInt("HardwareCursor",0) > 0 && GetConsoleInt("DisableHardwareCursor",0) == 0);
		m_pHardwareCursor->Enable(GetConsoleInt("DisableHardwareCursor",0) == 0);

		// The current render mode
		RMode currentMode;
		g_pLTClient->GetRenderMode(&currentMode);

		// Set the renderer controls so that they match the currently selected renderer
		unsigned int n;
		for (n=0; n < m_rendererArray.GetSize(); n++)
		{
			unsigned int i;
			for (i=0; i < m_rendererArray[n].m_resolutionArray.GetSize(); i++)
			{
				RMode mode=GetRendererModeStruct(n, i);

				if (IsRendererEqual(&currentMode, &mode))
				{
					// Set the renderer index
					m_pRendererCtrl->SetSelIndex(n);

					// Setup the resolution control
					SetupResolutionCtrl();

					// Set the resolution index
					m_pResolutionCtrl->SetSelIndex(i);
				}
			}
		}
		m_bTexture32 = pSettings->GetBoolVar("32BitTextures");
	

        UpdateData(LTFALSE);
		SetSelection(1);

	}
	else
	{
		UpdateData();


		if (m_bEscape)
		{
			LTBOOL bTexture32 = pSettings->GetBoolVar("32BitTextures");

			WriteConsoleInt("HardwareCursor",(int)m_bHardwareCursor);

			pSettings->SetBoolVar("32BitTextures",m_bTexture32);


			LTBOOL bRebind = (bTexture32 != m_bTexture32);

			// Set the render mode if we are losing focus
			if (m_pRendererCtrl && m_pResolutionCtrl)
			{

				int oldMO = (int)pSettings->GetFloatVar("MipmapOffset");

				LTBOOL bSet = SetRenderer(m_pRendererCtrl->GetSelIndex(), m_pResolutionCtrl->GetSelIndex());

				// If we didn't switch resolutions and the mipmap offset changed, rebind textures.
				if(!bSet)
				{
					int curMO = (int)pSettings->GetFloatVar("MipmapOffset");
					if(curMO != oldMO)
					{
						bRebind = LTTRUE;
					}
				}
			}
			if (bRebind)
			{

                g_pLTClient->Start3D();
                g_pLTClient->StartOptimized2D();

				g_pInterfaceResMgr->DrawMessage(GetSmallFont(),IDS_REBINDING_TEXTURES);

                g_pLTClient->EndOptimized2D();
                g_pLTClient->End3D();
                g_pLTClient->FlipScreen(0);
				g_pLTClient->RunConsoleString("RebindTextures");

			}
				
		}

		if (GetConsoleInt("BitDepth",16) == 16)
			WriteConsoleInt("DrawPortals",0);
		else if ((GetConsoleInt("BitDepth",16) == 32) && (GetConsoleInt("PerformanceLevel",1) == 2))
			WriteConsoleInt("DrawPortals",1);
//.........这里部分代码省略.........
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:101,代码来源:FolderDisplay.cpp


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