diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 54046f0280dba0396257eb69f5250862d0033740..6379821eaf14e92508ab607c4eef8b66c41c02ec 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
a: Word;
FileName: string;
ssdir, t: string;
a: Word;
FileName: string;
ssdir, t: string;
+ st: TStream;
+ ok: Boolean;
begin
begin
+ if e_NoGraphics then Exit;
ssdir := GameDir+'/screenshots';
if not findFileCI(ssdir, true) then
begin
ssdir := GameDir+'/screenshots';
if not findFileCI(ssdir, true) then
begin
try
for a := 1 to High(Word) do
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
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
end;
end;
except