void CPlayerPlugin_InteractiveEntityMonitor::EnableHighlighting(bool enable)
{
	m_bEnabled = enable;

	InteractiveEntityList::iterator iter = m_interactiveEntityList.begin();
	InteractiveEntityList::iterator end = m_interactiveEntityList.end();
	if(enable)
	{
		while(iter != end)
		{
			if( iter->second & EIES_Highlighted )
			{
				if(IEntity* pEntity = gEnv->pEntitySystem->GetEntity(iter->first))
				{
					if(IEntityRenderProxy* pRenderProxy = static_cast<IEntityRenderProxy *>(pEntity->GetProxy(ENTITY_PROXY_RENDER)))
					{
						if( (iter->second & EIES_ShootToInteract) == 0 )
						{
							pRenderProxy->SetHUDSilhouettesParams(m_silhouetteInteractColor.r, m_silhouetteInteractColor.g, m_silhouetteInteractColor.b, m_silhouetteInteractColor.a);
						}
						else
						{
							pRenderProxy->SetHUDSilhouettesParams(m_silhouetteShootColor.r, m_silhouetteShootColor.g, m_silhouetteShootColor.b, m_silhouetteShootColor.a);
						}
					}
				}
			}
			++iter;
		}
	}
	else
	{
		ColorF disableColor(0.f, 0.f, 0.f, 0.f);
		while(iter != end)
		{
			if( iter->second & EIES_Highlighted )
			{
				if(IEntity* pEntity = gEnv->pEntitySystem->GetEntity(iter->first))
				{
					if(IEntityRenderProxy* pRenderProxy = static_cast<IEntityRenderProxy *>(pEntity->GetProxy(ENTITY_PROXY_RENDER)))
					{
						pRenderProxy->SetHUDSilhouettesParams(disableColor.r, disableColor.g, disableColor.b, disableColor.a);
					}
				}
			}
			++iter;
		}
	}
}
Ejemplo n.º 2
0
void
drv_Clear (GLbitfield mask)
{
    GLubyte cred, cgreen, cblue, calpha;
    GLuint ccolor;
    GLuint cdepth;

    mask &= (GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

    cred = ctx_color.clear_color[0] * 255.0F;
    cgreen = ctx_color.clear_color[1] * 255.0F;
    cblue = ctx_color.clear_color[2] * 255.0F;
    calpha = ctx_color.clear_color[3] * 255.0F;

    ccolor = (cblue << 16) | (cgreen << 8) | cred;
    cdepth = ctx_depthmaxf * ctx_clear_depth;

    ctx_validate_state(NEW_COLOR|NEW_SCISSOR);

    if (ctx_stencilmaxi) {
	if (mask & GL_STENCIL_BUFFER_BIT) {
	    grEnable(GR_STENCIL_MODE_EXT);
	    gfStencilOpExt(GR_STENCILOP_REPLACE,
			   GR_STENCILOP_REPLACE,
			   GR_STENCILOP_REPLACE);
	    gfStencilFuncExt(GR_CMP_ALWAYS,
			     ctx_stencil.clear,
			     0xff);
	    gfStencilMaskExt(ctx_stencil.writeMask);
	} else {
	    grDisable(GR_STENCIL_MODE_EXT);
	}
    }

    /* XXX have to determine front/back buffers */
    switch (mask & ~GL_STENCIL_BUFFER_BIT) {
	case GL_COLOR_BUFFER_BIT:
	    grDepthMask(FXFALSE);
	    if (ctx_stencilmaxi) {
		gfBufferClearExt(ccolor, calpha, cdepth, ctx_stencil.clear);
	    } else {
		grBufferClear(ccolor, calpha, cdepth);
	    }
	    grDepthMask(ctx_depth_mask);
	    break;
	case GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT:
	    grDepthMask(FXTRUE);
	    if (ctx_stencilmaxi) {
		gfBufferClearExt(ccolor, calpha, cdepth, ctx_stencil.clear);
	    } else {
		grBufferClear(ccolor, calpha, cdepth);
	    }
	    grDepthMask(ctx_depth_mask); /* XXX ctx_depth_mask is TRUE if we get here */
	    break;
	case GL_DEPTH_BUFFER_BIT:
	    disableColor();
	    grDepthMask(FXTRUE);
    	    if (ctx_stencilmaxi) {
		gfBufferClearExt(ccolor, calpha, cdepth, ctx_stencil.clear);
	    } else {
		grBufferClear(ccolor, calpha, cdepth);
	    }
	    grDepthMask(ctx_depth_mask); /* XXX ctx_depth_mask is TRUE if we get here */
	    drv_setupColor();
	    break;
	default:
	    if (ctx_stencilmaxi && (mask & GL_STENCIL_BUFFER_BIT)) {
		disableColor();
		grDepthMask(FXFALSE);
		gfBufferClearExt(ccolor, calpha, cdepth, ctx_stencil.clear);
		grDepthMask(ctx_depth_mask);
		drv_setupColor();
	    }
    }

    drv_setupStencil();
}