X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_game.pas;h=6379821eaf14e92508ab607c4eef8b66c41c02ec;hb=7ceca6f36a0fc573a64108818122725bb721cde1;hp=54046f0280dba0396257eb69f5250862d0033740;hpb=2bd42e8c2e82a4aab077e526f615084535246609;p=d2df-sdl.git diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 54046f0..6379821 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -5854,7 +5854,10 @@ var a: Word; FileName: string; ssdir, t: string; + st: TStream; + ok: Boolean; begin + if e_NoGraphics then Exit; ssdir := GameDir+'/screenshots'; if not findFileCI(ssdir, true) then begin @@ -5868,14 +5871,21 @@ begin try for a := 1 to High(Word) do begin - FileName := Format(ssdir+'screenshot%.3d.bmp', [a]); + FileName := Format(ssdir+'screenshot%.3d.png', [a]); t := FileName; if findFileCI(t, true) then continue; if not findFileCI(FileName) then begin - e_MakeScreenshot(FileName, gScreenWidth, gScreenHeight); - g_Console_Add(Format(_lc[I_CONSOLE_SCREENSHOT], [ExtractFileName(FileName)])); - Break; + ok := false; + st := createDiskFile(FileName); + try + e_MakeScreenshot(st, gScreenWidth, gScreenHeight); + ok := true; + finally + st.Free(); + end; + if not ok then try DeleteFile(FileName); except end else g_Console_Add(Format(_lc[I_CONSOLE_SCREENSHOT], [ExtractFileName(FileName)])); + break; end; end; except