diff -r 1614b13ad35e -r 084e046f6bd5 hedgewars/uFLData.pas --- 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.