//=============================================================================
void FSteamVRHMD::MarkTextureForUpdate(uint32 LayerId)
{
	if (!LayerId)
	{
		return;
	}

	uint32 LayerIndex = IdToIndex(LayerId);
	Layers[LayerIndex].bUpdateTexture = true;
}
//=============================================================================
bool FSteamVRHMD::GetLayerDesc(uint32 LayerId, FLayerDesc& OutLayerDesc)
{
	if (!LayerId)
	{
		return false;
	}

	uint32 LayerIndex = IdToIndex(LayerId);
	OutLayerDesc = Layers[LayerIndex].LayerDesc;
	return true;
}
//=============================================================================
void FSteamVRHMD::SetLayerDesc(uint32 LayerId, const FLayerDesc& InLayerDesc)
{
	if (!LayerId)
	{
		return;
	}

	FScopeLock LayerLock(&LayerCritSect);

	uint32 LayerIndex = IdToIndex(LayerId);
	FLayer& Layer = Layers[LayerIndex];
	Layer.LayerDesc = InLayerDesc;

	UpdateLayer(Layer);
}
Exemplo n.º 4
0
CEntity* CEntitySystem::GetEntityFromID( EntityId id )
{
	if ( id == 0 )
		return NULL;

	unsigned dwMaxUsed = m_EntitySaltBuffer.GetMaxUsed();
	unsigned hdl = IdToIndex(id);
	unsigned hd1cond = hdl<=dwMaxUsed ? 0xffffffff:0;
//	hd1cond = (unsigned)((unsigned)hd1cond | -(unsigned)hd1cond ); //0 for hdl>dwMaxUsed, 0xFFFFFFFF for hdl<=dwMaxUsed
	hdl = hd1cond & hdl;

	CEntity *const pEntity = m_EntityArray[hdl];

	if(pEntity)
	{
		if (pEntity->GetId()==id)  //my salt not equaled
			return pEntity;
	}
	return 0;
}
//=============================================================================
void FSteamVRHMD::DestroyLayer(uint32 LayerId)
{
	if (!LayerId)
	{
		return;
	}

	FScopeLock LayerLock(&LayerCritSect);

	uint32 LayerIndex = IdToIndex(LayerId);
	check(LayerIndex < (uint32)Layers.Num());

	FLayer* ObsoleteLayer = Layers.GetData() + LayerIndex;
	ObsoleteLayer->LayerId = 0;
	ObsoleteLayer->LayerDesc.Texture = nullptr;

	UpdateLayer(*ObsoleteLayer);

	LayerFreeIndices.Push(LayerIndex);
}
Exemplo n.º 6
0
void  MONSTER_COMMUNITY::set	(MONSTER_COMMUNITY_ID id)
{
	m_current_index	 = IdToIndex(id);

}