From 4f7f9544e5dbf992599865243aee4c6e2a5b5f8e Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Fri, 18 May 2007 10:55:28 +0000 Subject: Added ability to take a Screenshot with the Print Key from every Screen in the Game git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@219 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UMain.pas | 7 +++++-- Game/Code/Menu/UDisplay.pas | 7 +++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'Game') diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas index 47860198..3bf7d197 100644 --- a/Game/Code/Classes/UMain.pas +++ b/Game/Code/Classes/UMain.pas @@ -160,13 +160,16 @@ Begin End; // With} SDL_KEYDOWN: begin + //ScreenShot hack. If Print is pressed-> Make screenshot and Save to Screenshots Path + if (Event.key.keysym.sym = SDLK_SYSREQ) then + Display.ScreenShot + // popup hack... if there is a visible popup then let it handle input instead of underlying screen // shoud be done in a way to be sure the topmost popup has preference (maybe error, then check) - if (ScreenPopupError <> NIL) and (ScreenPopupError.Visible) then + else if (ScreenPopupError <> NIL) and (ScreenPopupError.Visible) then done := not ScreenPopupError.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, True) else if (ScreenPopupCheck <> NIL) AND (ScreenPopupCheck.Visible) then done := not ScreenPopupCheck.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, True) - // end of popup hack else diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas index abaedfa8..f95a73e3 100644 --- a/Game/Code/Menu/UDisplay.pas +++ b/Game/Code/Menu/UDisplay.pas @@ -300,7 +300,6 @@ begin Jpeg.Assign(Bitmap); Bitmap.Free; Jpeg.CompressionQuality := 95;//90; - ForceDirectories(ScreenshotsPath); Jpeg.SaveToFile(FileName); Jpeg.Free; end; @@ -317,7 +316,7 @@ begin for Num := 1 to 9999 do begin FileName := IntToStr(Num); while Length(FileName) < 4 do FileName := '0' + FileName; - FileName := {ScreenshotsPath + }'screenshot' + FileName + '.BMP'; + FileName := ScreenshotsPath + FileName + '.BMP'; if not FileExists(FileName) then break end; @@ -331,8 +330,8 @@ begin //Schreiben der Bitmap-Informationen FileInfo.biSize := SizeOf(BITMAPINFOHEADER); - FileInfo.biWidth := ScreenH; - FileInfo.biHeight := ScreenW; + FileInfo.biWidth := ScreenW; + FileInfo.biHeight := ScreenH; FileInfo.biPlanes := 1; FileInfo.biBitCount := 32; FileInfo.biSizeImage := FileInfo.biWidth*FileInfo.biHeight*(FileInfo.biBitCount div 8); -- cgit v1.2.3