//=============================================================================
uint32 FSteamVRHMD::CreateLayer(const FLayerDesc& InLayerDesc)
{
	FScopeLock LayerLock(&LayerCritSect);

	uint32 NewIndex;
	if (LayerFreeIndices.Num())
	{
		NewIndex = LayerFreeIndices.Pop(false);
	}
	else
	{
		NewIndex = Layers.AddUninitialized();
	}
	check(NewIndex < (uint32)Layers.Num());
	
	FLayer* NewLayer = Layers.GetData() + NewIndex;
	FMemory::Memzero(NewLayer, sizeof(*NewLayer));

	NewLayer->LayerId = IndexToId(NewIndex);
	NewLayer->LayerDesc = InLayerDesc;
	NewLayer->OverlayHandle = vr::k_ulOverlayHandleInvalid;

	UpdateLayer(*NewLayer);

	return NewLayer->LayerId;
}
Esempio n. 2
0
void AHair::UpdateHair()
{
	for (int i = 0; i < HairLayers.Num(); i++)
	{
		UpdateLayer(HairLayers[i]);
	}
}
Esempio n. 3
0
static GF_Err OSVC_SetCapabilities(GF_BaseDecoder *ifcg, GF_CodecCapability capability)
{
	OSVCDec *ctx = (OSVCDec*) ifcg->privateStack;
	switch (capability.CapCode) {
	case GF_CODEC_MEDIA_SWITCH_QUALITY:
		if (capability.cap.valueInt) {
			// set layer up (command=1)
			UpdateLayer( ctx->DqIdTable, &ctx->CurrDqId, &ctx->TemporalCom, &ctx->TemporalId, ctx->MaxDqId, 1 );
		} else {
			// set layer down (command=0)
			UpdateLayer( ctx->DqIdTable, &ctx->CurrDqId, &ctx->TemporalCom, &ctx->TemporalId, ctx->MaxDqId, 0 );
		}
		return GF_OK;
	}
	/*return unsupported to avoid confusion by the player (like color space changing ...) */
	return GF_NOT_SUPPORTED;

}
//=============================================================================
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);
}
//=============================================================================
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);
}
Esempio n. 6
0
void UpdateLayer(StageLayer* layer){
	layer->x += layer->movescale;
	if(layer->next!=NULL)
		UpdateLayer(layer->next);
}
Esempio n. 7
0
void UpdateStage(Stage_T stage){
	if(st.layer_list->layerpath!=NULL){
		UpdateLayer(st.layer_list);
	}
}
Esempio n. 8
0
void World::UpdateLayer(Renderable* element, String newLayerName)
{
	UpdateLayer(element, GetLayerByName(newLayerName));
}