ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/_old_/Code/Functions.pas
(Generate patch)

Comparing oup/current/Code/Functions.pas (file contents):
Revision 46 by alloc, Sat Dec 23 16:26:43 2006 UTC vs.
Revision 74 by alloc, Thu Jan 11 22:45:20 2007 UTC

# Line 4 | Line 4 | interface
4  
5   uses Classes, Dialogs, SysUtils, StrUtils, Math, Data;
6  
7 type
8  TExportSet = set of (DO_dat, DO_raw, DO_convert, DO_toone);
9
7   function BoolToStr(bool: Boolean): String;
8   function HexToLong(hex: String): LongWord;
9   function Decode_Int(buffer: Tdata): LongWord;
# Line 16 | Line 13 | function Encode_Float(input: Single): Td
13   function DataToBin(Data: Tdata): String;
14   function BinToInt(bin: String): Byte;
15  
19 function ExportFile(fileid: LongWord; filename: String; settings: TExportSet;
20  path: String): Integer;
21
16   function StringSmaller(string1, string2: String): Boolean;
17  
18   function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String;
# Line 323 | Line 317 | end;
317  
318  
319  
326
327 function ExportFile(fileid: LongWord; filename: String; settings: TExportSet;
328  path: String): Integer;
329 var
330  i: Byte;
331  extension: String;
332  rawlist: TRawList;
333 begin
334  Result    := export_noerror;
335  extension := RightStr(filename, 4);
336  if DO_toone in settings then
337  begin
338    ExportDatFile(fileid, path + '\' + GetWinFileName(filename));
339  end
340  else
341  begin
342    if DO_dat in settings then
343      ExportDatFile(fileid, path + '\' + GetWinFileName(filename));
344    if DO_raw in settings then
345    begin
346      rawlist := OniDataConnection.GetRawList(fileid);
347      if Length(rawlist) > 0 then
348      begin
349        for i := 0 to High(rawlist) do
350        begin
351          ExportRawFile(fileid, rawlist[i].src_offset, path + '\' +
352            GetWinFileName(filename));
353        end;
354      end;
355    end;
356  end;
357 end;
358
359
360
361
320   function Explode(_string: String; delimiter: Char): TStringArray;
321   var
322    start, len: Word;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)