hedgewars/uFLData.pas
branchqmlfrontend
changeset 10436 084e046f6bd5
parent 10434 1614b13ad35e
child 10438 50ed968e4fee
equal deleted inserted replaced
10434:1614b13ad35e 10436:084e046f6bd5
     1 unit uFLData;
     1 unit uFLData;
     2 interface
     2 interface
     3 
     3 
     4 function getThemesList: PPChar; cdecl;
     4 function getThemesList: PPChar; cdecl;
     5 procedure freeThemesList(list: PPChar); cdecl;
     5 procedure freeThemesList(list: PPChar); cdecl;
       
     6 function getThemeIcon(themeName: PChar; buffer: PChar; buflen: Longword): Longword; cdecl;
     6 
     7 
     7 implementation
     8 implementation
     8 uses uPhysFSLayer;
     9 uses uPhysFSLayer;
     9 
    10 
    10 function getThemesList: PPChar; cdecl;
    11 function getThemesList: PPChar; cdecl;
    15 procedure freeThemesList(list: PPChar); cdecl;
    16 procedure freeThemesList(list: PPChar); cdecl;
    16 begin
    17 begin
    17     pfsFreeList(list)
    18     pfsFreeList(list)
    18 end;
    19 end;
    19 
    20 
       
    21 function getThemeIcon(themeName: PChar; buffer: PChar; buflen: Longword): Longword; cdecl;
       
    22 var s: shortstring;
       
    23     f: PFSFile;
       
    24 begin
       
    25     s:= '/Themes/' + shortstring(themeName) + '/icon@2x.png';
       
    26 
       
    27     f:= pfsOpenRead(s);
       
    28 
       
    29     if f = nil then
       
    30         getThemeIcon:= 0
       
    31     else
       
    32     begin
       
    33         getThemeIcon:= pfsBlockRead(f, buffer, buflen);
       
    34         pfsClose(f)
       
    35     end;
       
    36 end;
       
    37 
    20 end.
    38 end.