index 86566cfa9627df9eeab1238aed7ad118dd19bc41..df0b55559f2aa34550dd653363cd36041499de83 100644 (file)
StdCtrls, ExtCtrls, utils, Imaging, ImagingTypes, ImagingUtility;
type
StdCtrls, ExtCtrls, utils, Imaging, ImagingTypes, ImagingUtility;
type
+
+ { TAddTextureForm }
+
TAddTextureForm = class (TAddResourceForm)
TAddTextureForm = class (TAddResourceForm)
+ lStats: TLabel;
PanelTexPreview: TPanel;
iPreview: TImage;
eTextureName: TEdit;
PanelTexPreview: TPanel;
iPreview: TImage;
eTextureName: TEdit;
var
AddTextureForm: TAddTextureForm;
var
AddTextureForm: TAddTextureForm;
+ NumFrames: Integer = 0;
function IsAnim(Res: String): Boolean;
function GetFrame(Res: String; var Data: Pointer; var DataLen: Integer;
function IsAnim(Res: String): Boolean;
function GetFrame(Res: String; var Data: Pointer; var DataLen: Integer;
Exit;
end;
Exit;
end;
-// Ищем в них описание анимации - "AINM":
+// Ищем в них описание анимации - "ANIM":
ok := False;
for a := 0 to High(Resources) do
if Resources[a] = 'ANIM' then
ok := False;
for a := 0 to High(Resources) do
if Resources[a] = 'ANIM' then
// Читаем лист текстур:
WAD.GetResource('TEXTURES', config.ReadStr('', 'resource', ''), TextureData, Len);
// Читаем лист текстур:
WAD.GetResource('TEXTURES', config.ReadStr('', 'resource', ''), TextureData, Len);
+ NumFrames := config.ReadInt('', 'framecount', 0);
if (TextureData <> nil) and
(WAD.GetLastError = DFWAD_NOERROR) then
if (TextureData <> nil) and
(WAD.GetLastError = DFWAD_NOERROR) then
begin
Inherited;
begin
Inherited;
+ lStats.Caption := '';
cbWADList.Items.Add(_lc[I_WAD_SPECIAL_TEXS]);
eTextureName.Text := '';
cbWADList.Items.Add(_lc[I_WAD_SPECIAL_TEXS]);
eTextureName.Text := '';
var
Texture: TBitMap;
wad: String;
var
Texture: TBitMap;
wad: String;
+ Anim: Boolean;
begin
Inherited;
begin
Inherited;
+ lStats.Caption := '';
if lbResourcesList.ItemIndex = -1 then
Exit;
if FResourceName = '' then
if lbResourcesList.ItemIndex = -1 then
Exit;
if FResourceName = '' then
if wad = _lc[I_WAD_SPECIAL_TEXS] then
Exit;
if wad = _lc[I_WAD_SPECIAL_TEXS] then
Exit;
- if IsAnim(FFullResourceName) then
+ Anim := IsAnim(FFullResourceName);
+ if Anim then
Texture := ShowAnim(FFullResourceName)
else
Texture := ShowTGATexture(FFullResourceName);
if Texture = nil then
Exit;
Texture := ShowAnim(FFullResourceName)
else
Texture := ShowTGATexture(FFullResourceName);
if Texture = nil then
Exit;
+
+ if Anim then
+ lStats.Caption := Format(_lc[I_CAP_ANIMATION], [Texture.Width, Texture.Height, NumFrames])
+ else
+ lStats.Caption := Format(_lc[I_CAP_TEXTURE], [Texture.Width, Texture.Height]);
+
iPreview.Canvas.FillRect(iPreview.Canvas.ClipRect);
iPreview.Canvas.CopyRect(Texture.Canvas.ClipRect, Texture.Canvas, Texture.Canvas.ClipRect);
Texture.Free();
iPreview.Canvas.FillRect(iPreview.Canvas.ClipRect);
iPreview.Canvas.CopyRect(Texture.Canvas.ClipRect, Texture.Canvas, Texture.Canvas.ClipRect);
Texture.Free();