Changeset 203 for oup


Ignore:
Timestamp:
May 26, 2007, 11:38:25 PM (18 years ago)
Author:
alloc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • oup/releases/0.34a/Tools/TxmpReplace.pas

    r200 r203  
    103103  new_storetype: Byte;
    104104  formatinfo: TImageFormatInfo;
     105  i: Integer;
     106const
     107  powers: array[0..8] of Integer = (1, 2, 4, 8, 16, 32, 64, 128, 256);
    105108begin
    106109  if filelist.ItemIndex >= 0 then
     
    111114    else
    112115      ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $9C, 4, @old_rawaddr);
     116
     117    if (OniImage_New.Width[1] > 256) or (OniImage_New.Height[1] > 256) then
     118    begin
     119      ShowMessage('Widht and height have to be smaller than or equal to 256.');
     120      Exit;
     121    end;
     122    for i := 0 to High(powers) do
     123      if OniImage_New.Width[1] = powers[i] then
     124        Break;
     125    if i = Length(powers) then
     126    begin
     127      ShowMessage('Width has to be a power of 2 (1, 2, 4, 8, 16 ...)');
     128      Exit;
     129    end;
     130    for i := 0 to High(powers) do
     131      if OniImage_New.Height[1] = powers[i] then
     132        Break;
     133    if i = Length(powers) then
     134    begin
     135      ShowMessage('Height has to be a power of 2 (1, 2, 4, 8, 16 ...)');
     136      Exit;
     137    end;
    113138
    114139    if (OniImage_Old.Width[1] <> OniImage_New.Width[1]) or
Note: See TracChangeset for help on using the changeset viewer.