|
From: Tapio V. <aa...@us...> - 2009-12-31 13:07:12
|
Module: performous
Branch: master
Commit: 550cc559a9c9a1e7099fd17c616803cbd822a9da
Author: Tapio Vierros <tap...@gm...>
Date: Thu Dec 31 14:36:36 2009 +0200
Enable TGA screenshot and map §-key for use (print-screen doesn't work in Gnome).
---
game/main.cc | 2 +-
game/video_driver.cc | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 204b032..d34d9e6 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -71,7 +71,7 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
config["graphic/fullscreen"].b() = !config["graphic/fullscreen"].b();
continue; // Already handled here...
}
- if (keypressed == SDLK_PRINT ) {
+ if (keypressed == SDLK_PRINT || keypressed == SDLK_WORLD_7) { // WORLD_7 = section sign (next to 1)
g_take_screenshot = true;
}
if (keypressed == SDLK_F4 && modifier & KMOD_ALT) {
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 5bd2c44..19b6b90 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -5,7 +5,7 @@
#include "fs.hh"
#include "util.hh"
#include "joystick.hh"
-
+#include <fstream>
#include <SDL.h>
#ifdef _WIN32
@@ -76,8 +76,8 @@ void Window::screenshot() {
fnstr << "/tmp/";
#endif
fnstr << "performous_screenshot_" << count;
-#if 0 // TODO: implement with libpng
-#ifdef USE_SDL_IMAGE
+#if 1 // TODO: implement with libpng?
+//#ifdef USE_SDL_IMAGE
/* Write the image out as an uncompressed tga. */
fnstr << ".tga";
std::ofstream tgaout(fnstr.str().c_str(), std::ios::binary);
@@ -114,7 +114,6 @@ void Window::screenshot() {
image.flip();
image.write(fnstr.str().c_str());
#endif
-#endif
count++;
}
|