summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e5a86d)
raw | patch | inline | side by side (parent: 0e5a86d)
author | binarymaster <x86corez@gmail.com> | |
Sat, 30 Sep 2017 20:33:22 +0000 (23:33 +0300) | ||
committer | binarymaster <x86corez@gmail.com> | |
Sat, 30 Sep 2017 20:33:22 +0000 (23:33 +0300) |
http://doom2d.org/forum/viewtopic.php?f=12&t=2350
src/editor/f_addresource_texture.lfm | patch | blob | history | |
src/editor/f_addresource_texture.pas | patch | blob | history | |
src/editor/g_language.pas | patch | blob | history |
index bc6af2d4c23c73f2a0d0011db4dda49ecf04d81f..19f7b1931e6175729e94d8cd7f62cbb2524b8320 100644 (file)
object bAddTexture: TButton[9]
Left = 160
Height = 25
- Top = 272
+ Top = 269
Width = 81
Caption = 'Добавить'
Default = True
object bClose: TButton[10]
Left = 248
Height = 25
- Top = 272
+ Top = 269
Width = 81
Caption = 'Закрыть'
OnClick = bCloseClick
object bAddClose: TButton[11]
Left = 336
Height = 25
- Top = 272
+ Top = 269
Width = 121
Caption = 'Добавить и закрыть'
OnClick = bAddCloseClick
TabOrder = 9
end
+ object lStats: TLabel[12]
+ Left = 6
+ Height = 13
+ Top = 274
+ Width = 149
+ AutoSize = False
+ ParentColor = False
+ end
end
index 86566cfa9627df9eeab1238aed7ad118dd19bc41..df0b55559f2aa34550dd653363cd36041499de83 100644 (file)
StdCtrls, ExtCtrls, utils, Imaging, ImagingTypes, ImagingUtility;
type
+
+ { TAddTextureForm }
+
TAddTextureForm = class (TAddResourceForm)
+ lStats: TLabel;
PanelTexPreview: TPanel;
iPreview: TImage;
eTextureName: TEdit;
var
AddTextureForm: TAddTextureForm;
+ NumFrames: Integer = 0;
function IsAnim(Res: String): Boolean;
function GetFrame(Res: String; var Data: Pointer; var DataLen: Integer;
Exit;
end;
-// Ищем в них описание анимации - "AINM":
+// Ищем в них описание анимации - "ANIM":
ok := False;
for a := 0 to High(Resources) do
if Resources[a] = 'ANIM' then
// Читаем лист текстур:
WAD.GetResource('TEXTURES', config.ReadStr('', 'resource', ''), TextureData, Len);
+ NumFrames := config.ReadInt('', 'framecount', 0);
if (TextureData <> nil) and
(WAD.GetLastError = DFWAD_NOERROR) then
begin
Inherited;
+ lStats.Caption := '';
cbWADList.Items.Add(_lc[I_WAD_SPECIAL_TEXS]);
eTextureName.Text := '';
var
Texture: TBitMap;
wad: String;
+ Anim: Boolean;
begin
Inherited;
+ lStats.Caption := '';
if lbResourcesList.ItemIndex = -1 then
Exit;
if FResourceName = '' then
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;
+
+ 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();
index e1f7638b11d531df0f5009927a7941c0df16b977..c38feac6c9e61a336b149aae594801ffac340037 100644 (file)
I_CAP_SELECT,
I_CAP_OPEN,
I_CAP_REMOVE,
+ I_CAP_TEXTURE,
+ I_CAP_ANIMATION,
I_CTRL_PROP_KEY,
I_CTRL_PROP_VALUE,
'Открыть карту'),
('CAP REMOVE', 'Remove Map',
'Удалить карту'),
+ ('CAP TEXTURE', 'Texture: %dx%d',
+ 'Текстура: %dx%d'),
+ ('CAP ANIMATION', 'Animation: %dx%d, %d frames',
+ 'Анимация: %dx%d, %d кадров'),
('CTRL PROP KEY', 'Property',
'Свойство'),