hedgewars/uFLData.pas
branchqmlfrontend
changeset 10436 084e046f6bd5
parent 10434 1614b13ad35e
child 10438 50ed968e4fee
--- a/hedgewars/uFLData.pas	Tue Sep 30 00:54:04 2014 +0400
+++ b/hedgewars/uFLData.pas	Wed Oct 01 01:20:05 2014 +0400
@@ -3,6 +3,7 @@
 
 function getThemesList: PPChar; cdecl;
 procedure freeThemesList(list: PPChar); cdecl;
+function getThemeIcon(themeName: PChar; buffer: PChar; buflen: Longword): Longword; cdecl;
 
 implementation
 uses uPhysFSLayer;
@@ -17,4 +18,21 @@
     pfsFreeList(list)
 end;
 
+function getThemeIcon(themeName: PChar; buffer: PChar; buflen: Longword): Longword; cdecl;
+var s: shortstring;
+    f: PFSFile;
+begin
+    s:= '/Themes/' + shortstring(themeName) + '/icon@2x.png';
+
+    f:= pfsOpenRead(s);
+
+    if f = nil then
+        getThemeIcon:= 0
+    else
+    begin
+        getThemeIcon:= pfsBlockRead(f, buffer, buflen);
+        pfsClose(f)
+    end;
+end;
+
 end.