Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FileRegions.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "Containers/ArrayView.h"
7#include "HAL/Platform.h"
8#include "PixelFormat.h"
9
10// Describes the type of data found in a given file region.
12{
13 // NOTE: Enum values here must match those in AutomationUtils/FileRegions.cs
14 None = 0,
15
16 // @todo re-number these and bump texture DDC key
17 // Texture data types
18 BC1 = 2,
19 BC2 = 5,
20 BC3 = 6,
21 BC4 = 3,
22 BC5 = 7
23};
24
25// Represents a region of logically related bytes within a larger block of cooked data.
26// Regions are used to improve data compression and patching on some platforms.
28{
29 static const TCHAR* RegionsFileExtension;
30
31 uint64 Offset;
32 uint64 Length;
34
36 : Offset(0)
37 , Length(0)
39 {}
40
41 FFileRegion(uint64 InOffset, uint64 InLength, EFileRegionType InType)
42 : Offset(InOffset)
43 , Length(InLength)
44 , Type(InType)
45 {}
46
47 static void AccumulateFileRegions(TArray<FFileRegion>& InOutRegions, int64 EntryOffset, int64 PayloadOffset, int64 EndOffset, TArrayView<const FFileRegion> InnerFileRegions);
48 static void SerializeFileRegions(class FArchive& Ar, TArray<FFileRegion>& Regions);
49
50 static inline EFileRegionType SelectType(EPixelFormat Format)
51 {
52 switch (Format)
53 {
54 case PF_DXT1: return EFileRegionType::BC1;
55 case PF_DXT3: return EFileRegionType::BC2;
56 case PF_DXT5: return EFileRegionType::BC3;
57 case PF_BC4: return EFileRegionType::BC4;
58 case PF_BC5: return EFileRegionType::BC5;
59 }
60
62 }
63};
EFileRegionType
Definition FileRegions.h:12
static const TCHAR * RegionsFileExtension
Definition FileRegions.h:29
EFileRegionType Type
Definition FileRegions.h:33
static EFileRegionType SelectType(EPixelFormat Format)
Definition FileRegions.h:50
static void SerializeFileRegions(class FArchive &Ar, TArray< FFileRegion > &Regions)
static void AccumulateFileRegions(TArray< FFileRegion > &InOutRegions, int64 EntryOffset, int64 PayloadOffset, int64 EndOffset, TArrayView< const FFileRegion > InnerFileRegions)
uint64 Offset
Definition FileRegions.h:31
FFileRegion(uint64 InOffset, uint64 InLength, EFileRegionType InType)
Definition FileRegions.h:41
uint64 Length
Definition FileRegions.h:32