Konstantin Koch 17d0771b03 Placed the importers into different categories for the "importing existing files" dialog in Visual Studio.
Fixed a performance problem in the Visual Studio extension where no importer or processor was selected for an asset.
Fixed that the asset names for Uri encoded in the build output.
Fixed that errors when serializing assets get logged.
Sped up ImporterManager.GuessImporterByFileExtension, which caused performance problems if many assemblies are loaded into the current AppDomain.
Made the AssimpImporter library deploy the binary files again (hopefully just a temporary solution until we've found a better way.)
Provide a extension for TargetPlatform enum for getting the DisplayName of an entry.
Changed that ProcessorManager.GetProcessorDisplayName doesn't throw an exception if no processor with the given name exists, which now mimicks the same behavior as in importerManager.GetImporterDisplayName.
2015-04-26 19:47:26 +02:00

74 lines
2.6 KiB
C#

#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline.Graphics
{
public abstract class DxtBitmapContent : BitmapContent
{
private int _blockSize;
private byte[] _pixelData;
protected DxtBitmapContent(int blockSize)
{
//TODO: set _pixelData
_blockSize = blockSize;
}
protected DxtBitmapContent(int blockSize, int width, int height)
: base(width, height)
{
_blockSize = blockSize;
//http://www.gamedev.net/topic/615440-calculating-pitch-of-a-dxt-compressed-texture/#post_id_4886508
//Data in a DXT texture is compressed in blocks of 4x4 pixels, the block size is the resolution for this blocks.
//The block size is also the reason why width and height must be a multiple of four.
width = (width + 3) / 4;
height = (height + 3) / 4;
_pixelData = new byte[width * height * blockSize];
}
public override byte[] GetPixelData()
{
return (byte[])_pixelData.Clone();
}
public override void SetPixelData(byte[] sourceData)
{
if (sourceData == null)
{
throw new ArgumentNullException("sourceData");
}
if (sourceData.Length != _pixelData.Length)
{
throw new ArgumentException(string.Format("The length of sourceData (Length: {0}) must be equal to the size of the contained data within the {1} (Length: {2}).", sourceData.Length, this.GetType().FullName, _pixelData.Length));
}
_pixelData = (byte[])sourceData.Clone();
}
protected override bool TryCopyFrom(BitmapContent sourceBitmap, Rectangle sourceRegion, Rectangle destinationRegion)
{
ValidateCopyArguments(sourceBitmap, sourceRegion, this, destinationRegion);
throw new NotImplementedException();
}
protected override bool TryCopyTo(BitmapContent destinationBitmap, Rectangle sourceRegion, Rectangle destinationRegion)
{
ValidateCopyArguments(this, sourceRegion, destinationBitmap, destinationRegion);
throw new NotImplementedException();
}
}
}