Refactor Streaming with new settings and textures streaming configuration
This commit is contained in:
@@ -68,6 +68,11 @@ namespace FlaxEditor.Content.Create
|
||||
/// </summary>
|
||||
InputSettings,
|
||||
|
||||
/// <summary>
|
||||
/// The streaming settings.
|
||||
/// </summary>
|
||||
StreamingSettings,
|
||||
|
||||
/// <summary>
|
||||
/// The Windows settings.
|
||||
/// </summary>
|
||||
@@ -116,6 +121,7 @@ namespace FlaxEditor.Content.Create
|
||||
typeof(LocalizationSettings),
|
||||
typeof(BuildSettings),
|
||||
typeof(InputSettings),
|
||||
typeof(StreamingSettings),
|
||||
typeof(WindowsPlatformSettings),
|
||||
typeof(UWPPlatformSettings),
|
||||
typeof(LinuxPlatformSettings),
|
||||
|
||||
@@ -283,6 +283,12 @@ namespace FlaxEditor.Content.Import
|
||||
[EditorOrder(250), VisibleIf("PreserveAlphaCoverage"), DefaultValue(0.5f), Tooltip("The reference value for the alpha coverage preserving.")]
|
||||
public float PreserveAlphaCoverageReference { get; set; } = 0.5f;
|
||||
|
||||
/// <summary>
|
||||
/// Texture group for streaming (negative if unused). See Streaming Settings.
|
||||
/// </summary>
|
||||
[EditorOrder(300), Tooltip("Texture group for streaming (negative if unused). See Streaming Settings.")]
|
||||
public int TextureGroup = -1;
|
||||
|
||||
/// <summary>
|
||||
/// The sprites. Used to keep created sprites on sprite atlas reimport.
|
||||
/// </summary>
|
||||
@@ -305,6 +311,7 @@ namespace FlaxEditor.Content.Import
|
||||
public float PreserveAlphaCoverageReference;
|
||||
public float Scale;
|
||||
public int MaxSize;
|
||||
public int TextureGroup;
|
||||
public Int2 Size;
|
||||
public Rectangle[] SpriteAreas;
|
||||
public string[] SpriteNames;
|
||||
@@ -327,7 +334,8 @@ namespace FlaxEditor.Content.Import
|
||||
PreserveAlphaCoverageReference = PreserveAlphaCoverageReference,
|
||||
Scale = Scale,
|
||||
Size = Size,
|
||||
MaxSize = (int)MaxSize
|
||||
MaxSize = (int)MaxSize,
|
||||
TextureGroup = TextureGroup,
|
||||
};
|
||||
if (Sprites != null && Sprites.Count > 0)
|
||||
{
|
||||
@@ -362,6 +370,7 @@ namespace FlaxEditor.Content.Import
|
||||
PreserveAlphaCoverageReference = options.PreserveAlphaCoverageReference;
|
||||
Scale = options.Scale;
|
||||
MaxSize = ConvertMaxSize(options.MaxSize);
|
||||
TextureGroup = options.TextureGroup;
|
||||
Size = options.Size;
|
||||
if (options.SpriteAreas != null)
|
||||
{
|
||||
|
||||
@@ -241,16 +241,13 @@ CreateAssetResult PreviewsCache::create(CreateAssetContext& context)
|
||||
IMPORT_SETUP(PreviewsCache, 4);
|
||||
|
||||
// Create texture header (custom data)
|
||||
TextureHeader header;
|
||||
header.Width = ASSETS_ICONS_ATLAS_SIZE;
|
||||
header.Height = ASSETS_ICONS_ATLAS_SIZE;
|
||||
header.Format = ASSETS_ICONS_ATLAS_FORMAT;
|
||||
header.IsSRGB = false;
|
||||
header.IsCubeMap = false;
|
||||
header.MipLevels = 1;
|
||||
header.NeverStream = true;
|
||||
header.Type = TextureFormatType::Unknown;
|
||||
context.Data.CustomData.Copy(&header);
|
||||
TextureHeader textureHeader;
|
||||
textureHeader.Width = ASSETS_ICONS_ATLAS_SIZE;
|
||||
textureHeader.Height = ASSETS_ICONS_ATLAS_SIZE;
|
||||
textureHeader.Format = ASSETS_ICONS_ATLAS_FORMAT;
|
||||
textureHeader.MipLevels = 1;
|
||||
textureHeader.NeverStream = true;
|
||||
context.Data.CustomData.Copy(&textureHeader);
|
||||
|
||||
// Create blank image (chunk 0)
|
||||
uint64 imageSize = CalculateTextureMemoryUsage(ASSETS_ICONS_ATLAS_FORMAT, ASSETS_ICONS_ATLAS_SIZE, ASSETS_ICONS_ATLAS_SIZE, 1);
|
||||
|
||||
@@ -66,6 +66,7 @@ struct InternalTextureOptions
|
||||
float PreserveAlphaCoverageReference;
|
||||
float Scale;
|
||||
int32 MaxSize;
|
||||
int32 TextureGroup;
|
||||
int32 SizeX;
|
||||
int32 SizeY;
|
||||
MonoArray* SpriteAreas;
|
||||
@@ -86,6 +87,7 @@ struct InternalTextureOptions
|
||||
to->PreserveAlphaCoverage = from->PreserveAlphaCoverage;
|
||||
to->PreserveAlphaCoverageReference = from->PreserveAlphaCoverageReference;
|
||||
to->MaxSize = from->MaxSize;
|
||||
to->TextureGroup = from->TextureGroup;
|
||||
to->SizeX = from->SizeX;
|
||||
to->SizeY = from->SizeY;
|
||||
to->Sprites.Clear();
|
||||
@@ -118,6 +120,7 @@ struct InternalTextureOptions
|
||||
to->PreserveAlphaCoverageReference = from->PreserveAlphaCoverageReference;
|
||||
to->Scale = from->Scale;
|
||||
to->MaxSize = from->MaxSize;
|
||||
to->TextureGroup = from->TextureGroup;
|
||||
to->SizeX = from->SizeX;
|
||||
to->SizeY = from->SizeY;
|
||||
if (from->Sprites.HasItems())
|
||||
|
||||
@@ -940,6 +940,7 @@ namespace FlaxEditor.Modules
|
||||
Proxy.Add(new SettingsProxy(typeof(AudioSettings), Editor.Instance.Icons.AudioSettings128));
|
||||
Proxy.Add(new SettingsProxy(typeof(BuildSettings), Editor.Instance.Icons.BuildSettings128));
|
||||
Proxy.Add(new SettingsProxy(typeof(InputSettings), Editor.Instance.Icons.InputSettings128));
|
||||
Proxy.Add(new SettingsProxy(typeof(StreamingSettings), Editor.Instance.Icons.BuildSettings128));
|
||||
Proxy.Add(new SettingsProxy(typeof(WindowsPlatformSettings), Editor.Instance.Icons.WindowsSettings128));
|
||||
Proxy.Add(new SettingsProxy(typeof(UWPPlatformSettings), Editor.Instance.Icons.UWPSettings128));
|
||||
Proxy.Add(new SettingsProxy(typeof(LinuxPlatformSettings), Editor.Instance.Icons.LinuxSettings128));
|
||||
|
||||
Reference in New Issue
Block a user