summaryrefslogtreecommitdiff
path: root/images/updatestdimgs.pas
blob: 2b3f99261073259b3929fce6ce7400c576ae67f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  This program searches for *.bmp files in the current directory and
  outputs to stdout the bmp files found as byte array constants.
}
program updatestdimgs;

{$IFDEF FPC}
  {$mode delphi}{$H+}
{$ELSE}
  {$APPTYPE CONSOLE}
{$ENDIF}

uses 
  SysUtils 
  {$ifdef Win32}
  ,Windows
  {$else}
  ,linux
  {$endif}
  ;

var
  sr : TSearchRec;
  i,p : integer;
  s : string;
  cmdline : string;
begin
  i := FindFirst('*.bmp',faAnyFile,sr);
  while i=0 do
  begin
    s := sr.Name;
    p := pos('.bmp',s);
    if p > 0 then s := copy(s,1,p-1);
    cmdline := 'bin2obj -c stdimg_'+s+' '+sr.Name;
    WinExec(PChar(cmdline),0);
    i := FindNext(sr);
  end;
end.