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


C++ FArchive::IsCooking方法代码示例

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


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

示例1: Serialize

void UPhysicsSerializer::Serialize( FArchive& Ar )
{
	QUICK_SCOPE_CYCLE_COUNTER(STAT_Serialize);
	Super::Serialize(Ar);
	if (Ar.UE4Ver() >= VER_UE4_BODYINSTANCE_BINARY_SERIALIZATION)
	{
		bool bCooked = Ar.IsCooking();
		Ar << bCooked;

		if (bCooked)
		{
			if (Ar.IsCooking())
			{
				TArray<FName> ActualFormatsToSave;
				ActualFormatsToSave.Add(FPlatformProperties::GetPhysicsFormat());
				BinaryFormatData.Serialize(Ar, this, &ActualFormatsToSave);
			}
			else
			{
#if WITH_PHYSX
				const uint32 Alignment = PHYSX_SERIALIZATION_ALIGNMENT;
#else
				const uint32 Alignment = DEFAULT_ALIGNMENT;
#endif
				BinaryFormatData.Serialize(Ar, this, nullptr, false, Alignment);
			}
		}
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:29,代码来源:PhysicsSerializer.cpp

示例2: Serialize

void UBodySetup::Serialize(FArchive& Ar)
{
	Super::Serialize(Ar);


	// Load GUID (or create one for older versions)
	Ar << BodySetupGuid;

	// If we loaded a ZERO Guid, fix that
	if(Ar.IsLoading() && !BodySetupGuid.IsValid())
	{
		MarkPackageDirty();
		UE_LOG(LogPhysics, Log, TEXT("FIX GUID FOR: %s"), *GetPathName());
		BodySetupGuid = FGuid::NewGuid();
	}

	bool bCooked = Ar.IsCooking();
	Ar << bCooked;

	if (FPlatformProperties::RequiresCookedData() && !bCooked && Ar.IsLoading())
	{
		UE_LOG(LogPhysics, Fatal, TEXT("This platform requires cooked packages, and physX data was not cooked into %s."), *GetFullName());
	}

	if (bCooked)
	{
		if (Ar.IsCooking())
		{
			// Make sure to reset bHasCookedCollision data to true before calling GetCookedData for cooking
			bHasCookedCollisionData = true;
			FName Format = Ar.CookingTarget()->GetPhysicsFormat(this);
			bHasCookedCollisionData = GetCookedData(Format) != NULL; // Get the data from the DDC or build it

			TArray<FName> ActualFormatsToSave;
			ActualFormatsToSave.Add(Format);

			Ar << bHasCookedCollisionData;
			CookedFormatData.Serialize(Ar, this, &ActualFormatsToSave);
		}
		else
		{
			if (Ar.UE4Ver() >= VER_UE4_STORE_HASCOOKEDDATA_FOR_BODYSETUP)
			{
				Ar << bHasCookedCollisionData;
			}
			CookedFormatData.Serialize(Ar, this);
		}
	}

	if ( Ar.IsLoading() )
	{
		AggGeom.Serialize( Ar );
	}
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:54,代码来源:BodySetup.cpp

示例3: Serialize

void USoundCue::Serialize( FArchive& Ar )
{
	// Always force the duration to be updated when we are saving or cooking
	if (Ar.IsSaving() || Ar.IsCooking())
	{
		Duration = (FirstNode ? FirstNode->GetDuration() : 0.f);
	}

	Super::Serialize( Ar );

	if (!Ar.IsCooking())
	{
		Ar << SoundCueGraph;
	}
}
开发者ID:johndpope,项目名称:UE4,代码行数:15,代码来源:SoundCue.cpp

示例4: Serialize

void ARadiantStaticMeshWebViewActor::Serialize(FArchive& Ar)
{
	Super::Serialize(Ar);

	static const int ArchiveVersion = 1;

	int Version = ArchiveVersion;

	Ar << Version;
	
	bool bCooked = Ar.IsCooking();
	Ar << bCooked;

	if (bCooked)
	{
#if WITH_EDITORONLY_DATA
		check(!Ar.IsLoading());
		if (!InteractionMesh)
		{
			ExtractInteractionMesh();
		}
#else
		check(Ar.IsLoading());
#endif
		
		Ar << InteractionMesh;
	}
}
开发者ID:LeGone,项目名称:RadiantUI,代码行数:28,代码来源:RadiantStaticMeshWebViewActor.cpp

示例5: Serialize

void FRawCurveTracks::Serialize(FArchive& Ar)
{
	// @TODO: If we're about to serialize vector curve, add here
	if(Ar.UE4Ver() >= VER_UE4_SKELETON_ADD_SMARTNAMES)
	{
		for(FFloatCurve& Curve : FloatCurves)
		{
			Curve.Serialize(Ar);
		}
	}
#if WITH_EDITORONLY_DATA
	if( !Ar.IsCooking() )
	{
		if( Ar.UE4Ver() >= VER_UE4_ANIMATION_ADD_TRACKCURVES )
		{
			for( FTransformCurve& Curve : TransformCurves )
			{
				Curve.Serialize( Ar );
			}

		}
	}
#endif // WITH_EDITORONLY_DATA
	if (Ar.IsLoading())
	{
		SortFloatCurvesByUID();
	}
}
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:28,代码来源:AnimCurveTypes.cpp

示例6: Serialize

void USubstanceImageInput::Serialize(FArchive& Ar)
{
	Super::Serialize(Ar);
	Ar.UsingCustomVersion(FSubstanceCoreCustomVersion::GUID);

	//! todo: remove image date if all consumers are freezed
	if (Ar.IsSaving())
	{
		ImageRGB.StoreCompressedOnDisk(0 == CompressionRGB ? COMPRESS_ZLIB : COMPRESS_None);
		ImageA.StoreCompressedOnDisk(0 == CompressionAlpha ? COMPRESS_ZLIB : COMPRESS_None);
	}

	ImageRGB.Serialize(Ar, this);
	ImageA.Serialize(Ar, this);

	// image inputs can be used multiple times
	ImageRGB.ClearBulkDataFlags(BULKDATA_SingleUse); 
	ImageA.ClearBulkDataFlags(BULKDATA_SingleUse);

	Ar << CompressionRGB;
	Ar << CompressionAlpha;

	if (Ar.IsCooking())
	{
		SourceFilePath = FString();
		SourceFileTimestamp = FString();
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:28,代码来源:SubstanceImageInput.cpp

示例7: Serialize

void USoundCue::Serialize(FArchive& Ar)
{
	// Always force the duration to be updated when we are saving or cooking
	if (Ar.IsSaving() || Ar.IsCooking())
	{
		Duration = (FirstNode ? FirstNode->GetDuration() : 0.f);
	}

	Super::Serialize(Ar);

	if (Ar.UE4Ver() >= VER_UE4_COOKED_ASSETS_IN_EDITOR_SUPPORT)
	{
		FStripDataFlags StripFlags(Ar);
#if WITH_EDITORONLY_DATA
		if (!StripFlags.IsEditorDataStripped())
		{
			Ar << SoundCueGraph;
		}
#endif
	}
#if WITH_EDITOR
	else
	{
		Ar << SoundCueGraph;
	}
#endif
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:27,代码来源:SoundCue.cpp

示例8: if

void FShadowMap2D::Serialize(FArchive& Ar)
{
	FShadowMap::Serialize(Ar);
	
	if( Ar.IsCooking() && !Ar.CookingTarget()->SupportsFeature(ETargetPlatformFeatures::DistanceFieldShadows) )
	{
		UShadowMapTexture2D* Dummy = NULL;
		Ar << Dummy;
	}
	else
	{
		Ar << Texture;
	}

	Ar << CoordinateScale << CoordinateBias;

	for (int Channel = 0; Channel < ARRAY_COUNT(bChannelValid); Channel++)
	{
		Ar << bChannelValid[Channel];
	}

	if (Ar.UE4Ver() >= VER_UE4_STATIC_SHADOWMAP_PENUMBRA_SIZE)
	{
		Ar << InvUniformPenumbraSize;
	}
	else if (Ar.IsLoading())
	{
		const float LegacyValue = 1.0f / .05f;
		InvUniformPenumbraSize = FVector4(LegacyValue, LegacyValue, LegacyValue, LegacyValue);
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:31,代码来源:ShadowMap.cpp

示例9: Serialize

void FShaderResource::Serialize(FArchive& Ar)
{
	Ar << SpecificType;
	Ar << Target;
	Ar << Code;
	Ar << OutputHash;
	Ar << NumInstructions;
	Ar << NumTextureSamplers;
	
	if (Ar.IsLoading())
	{
		INC_DWORD_STAT_BY_FName(GetMemoryStatType((EShaderFrequency)Target.Frequency).GetName(), (int64)Code.Num());
		INC_DWORD_STAT_BY(STAT_Shaders_ShaderResourceMemory, GetSizeBytes());
		
		FShaderCache::LogShader((EShaderPlatform)Target.Platform, (EShaderFrequency)Target.Frequency, OutputHash, Code);

		// The shader resource has been serialized in, so this shader resource is now initialized.
		check(Canary != FShader::ShaderMagic_CleaningUp);
		Canary = FShader::ShaderMagic_Initialized;
	}
#if WITH_EDITORONLY_DATA
	else if(Ar.IsCooking())
	{
		FShaderCache::CookShader((EShaderPlatform)Target.Platform, (EShaderFrequency)Target.Frequency, OutputHash, Code);
	}
#endif
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:27,代码来源:Shader.cpp

示例10: Serialize

void USoundNode::Serialize(FArchive& Ar)
{
	Super::Serialize(Ar);

	if (!Ar.IsCooking())
	{
		Ar << GraphNode;
	}
}
开发者ID:johndpope,项目名称:UE4,代码行数:9,代码来源:SoundNode.cpp

示例11: Serialize

void USoundNode::Serialize(FArchive& Ar)
{
	Super::Serialize(Ar);

	if (!Ar.IsCooking() && Ar.UE4Ver() >= VER_UE4_SOUND_CUE_GRAPH_EDITOR)
	{
		Ar << GraphNode;
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:9,代码来源:SoundNode.cpp

示例12: Serialize

	void Serialize(FArchive& Ar, UObject* Owner, int32 Idx)
    {
		const uint8 AdjacencyDataStripFlag = 1;
		FStripDataFlags StripFlags( Ar, Ar.IsCooking() && !Ar.CookingTarget()->SupportsFeature(ETargetPlatformFeatures::Tessellation) ? AdjacencyDataStripFlag : 0 );

		UStaticMesh* StaticMesh = Cast<UStaticMesh>( Owner );
		bool bNeedsCPUAccess = true;

		if( !StripFlags.IsEditorDataStripped() )
        {
			RawTriangles.Serialize( Ar, Owner );
        }

		Ar << Elements;

		if( !StripFlags.IsDataStrippedForServer() )
        {
			PositionVertexBuffer.Serialize( Ar, bNeedsCPUAccess );
			VertexBuffer.Serialize( Ar, bNeedsCPUAccess );
			ColorVertexBuffer.Serialize( Ar, bNeedsCPUAccess );
			Ar << NumVertices;
			IndexBuffer.Serialize( Ar, bNeedsCPUAccess );
			if (Ar.UE4Ver() >= VER_UE4_SHADOW_ONLY_INDEX_BUFFERS)
            {		
				ShadowIndexBuffer.Serialize(Ar, bNeedsCPUAccess);
            }
			if( !StripFlags.IsEditorDataStripped() )
            {
				Ar << WireframeIndexBuffer;
            }
			if ( !StripFlags.IsClassDataStripped( AdjacencyDataStripFlag ) )
            { 					
				AdjacencyIndexBuffer.Serialize( Ar, bNeedsCPUAccess );
            }
        }

		if (Ar.IsLoading())
        {
			if (PositionVertexBuffer.GetNumVertices() != NumVertices)
            {
				PositionVertexBuffer.RemoveLegacyShadowVolumeVertices(NumVertices);
			}
			if (VertexBuffer.GetNumVertices() != NumVertices)
			{
				VertexBuffer.RemoveLegacyShadowVolumeVertices(NumVertices);
			}
			if (VertexBuffer.GetNumVertices() != NumVertices)
            {				
				ColorVertexBuffer.RemoveLegacyShadowVolumeVertices(NumVertices);
			}
        }
    }										
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:52,代码来源:StaticMeshBuild.cpp

示例13: Serialize

void UTextureCube::Serialize(FArchive& Ar)
{
	DECLARE_SCOPE_CYCLE_COUNTER(TEXT("UTextureCube::Serialize"), STAT_TextureCube_Serialize, STATGROUP_LoadTime);

	Super::Serialize(Ar);

	FStripDataFlags StripFlags(Ar);
	bool bCooked = Ar.IsCooking();
	Ar << bCooked;

	if (bCooked || Ar.IsCooking())
	{
		SerializeCookedPlatformData(Ar);
	}

#if WITH_EDITOR
	if (Ar.IsLoading() && !Ar.IsTransacting() && !bCooked)
	{
		BeginCachePlatformData();
	}
#endif // #if WITH_EDITOR
}
开发者ID:stoneStyle,项目名称:Unreal4,代码行数:22,代码来源:TextureCube.cpp

示例14: Serialize

// Begin UObject interface. 
void UDialogueWave::Serialize( FArchive& Ar )
{
	Super::Serialize( Ar );

	Ar.ThisRequiresLocalizationGather();

	bool bCooked = Ar.IsCooking();
	Ar << bCooked;

	if (FPlatformProperties::RequiresCookedData() && !bCooked && Ar.IsLoading())
	{
		UE_LOG(LogAudio, Fatal, TEXT("This platform requires cooked packages, and audio data was not cooked into %s."), *GetFullName());
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:15,代码来源:DialogueWave.cpp

示例15: Serialize

void FStreamedAudioChunk::Serialize(FArchive& Ar, UObject* Owner, int32 ChunkIndex)
{
	bool bCooked = Ar.IsCooking();
	Ar << bCooked;

	BulkData.Serialize(Ar, Owner, ChunkIndex);
	Ar << DataSize;

#if WITH_EDITORONLY_DATA
	if (!bCooked)
	{
		Ar << DerivedDataKey;
	}
#endif // #if WITH_EDITORONLY_DATA
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:15,代码来源:SoundWave.cpp


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