- Merged changes from Turley (elevate with random altitude)
- Rearranged the TfrmElevateSettings dialog - Fixed transparency settings of the images in the TfrmLogin dialog - Fixed TfrmRegionControl to not react on mouse clicks if no region is selected - Updated Vampyre Imaging Lib to recent SVN - Added missing cedserver_config_2_3 project file
This commit is contained in:
+34
-11
@@ -1,5 +1,5 @@
|
||||
{
|
||||
$Id: Imaging.pas 99 2007-06-26 04:12:01Z galfar $
|
||||
$Id: Imaging.pas 124 2008-04-21 09:47:07Z galfar $
|
||||
Vampyre Imaging Library
|
||||
by Marek Mauder
|
||||
http://imaginglib.sourceforge.net
|
||||
@@ -1573,6 +1573,8 @@ function GenerateMipMaps(const Image: TImageData; Levels: LongInt;
|
||||
var MipMaps: TDynImageDataArray): Boolean;
|
||||
var
|
||||
Width, Height, I, Count: LongInt;
|
||||
Info: TImageFormatInfo;
|
||||
CompatibleCopy: TImageData;
|
||||
begin
|
||||
Result := False;
|
||||
if TestImage(Image) then
|
||||
@@ -1585,6 +1587,20 @@ begin
|
||||
if (Levels <= 0) or (Levels > Count) then
|
||||
Levels := Count;
|
||||
|
||||
// If we have special format image we create copy to allow pixel access.
|
||||
// This is also done in FillMipMapLevel which is called for each level
|
||||
// but then the main big image would be converted to compatible
|
||||
// for every level.
|
||||
GetImageFormatInfo(Image.Format, Info);
|
||||
if Info.IsSpecial then
|
||||
begin
|
||||
InitImage(CompatibleCopy);
|
||||
CloneImage(Image, CompatibleCopy);
|
||||
ConvertImage(CompatibleCopy, ifDefault);
|
||||
end
|
||||
else
|
||||
CompatibleCopy := Image;
|
||||
|
||||
FreeImagesInArray(MipMaps);
|
||||
SetLength(MipMaps, Levels);
|
||||
CloneImage(Image, MipMaps[0]);
|
||||
@@ -1595,8 +1611,17 @@ begin
|
||||
Height := Height shr 1;
|
||||
if Width < 1 then Width := 1;
|
||||
if Height < 1 then Height := 1;
|
||||
FillMipMapLevel(MipMaps[I - 1], Width, Height, MipMaps[I]);
|
||||
FillMipMapLevel(CompatibleCopy, Width, Height, MipMaps[I]);
|
||||
end;
|
||||
|
||||
if CompatibleCopy.Format <> MipMaps[0].Format then
|
||||
begin
|
||||
// Must convert smaller levels to proper format
|
||||
for I := 1 to High(MipMaps) do
|
||||
ConvertImage(MipMaps[I], MipMaps[0].Format);
|
||||
FreeImage(CompatibleCopy);
|
||||
end;
|
||||
|
||||
Result := True;
|
||||
except
|
||||
RaiseImaging(SErrorGenerateMipMaps, [Levels, ImageToStr(Image)]);
|
||||
@@ -3262,15 +3287,13 @@ finalization
|
||||
File Notes:
|
||||
|
||||
-- TODOS ----------------------------------------------------
|
||||
- make searching for the closest color in palette much faster - MapImageToPal
|
||||
- investigate CopyPixel and ComparePixels inline problems - line 550
|
||||
- add to low level interface function
|
||||
CreateImageFromRawData(W, H, Bpp, Data, Align, Flipped, Endian, ...)
|
||||
and CreateRawDataFromImage() - use these in BMP loading (align)
|
||||
and PNG loading (endian)
|
||||
- add loading of multi images from file sequence
|
||||
- do not load all frames when only one is required, possible?
|
||||
(LoadImageFromFile on MNG/DDS)
|
||||
- nothing now
|
||||
|
||||
-- 0.24.3 Changes/Bug Fixes ---------------------------------
|
||||
- GenerateMipMaps now generates all smaller levels from
|
||||
original big image (better results when using more advanced filters).
|
||||
Also conversion to compatible image format is now done here not
|
||||
in FillMipMapLevel (that is called for every mipmap level).
|
||||
|
||||
-- 0.23 Changes/Bug Fixes -----------------------------------
|
||||
- MakePaletteForImages now works correctly for indexed and special format images
|
||||
|
||||
Reference in New Issue
Block a user