Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: acaudwell/Gource
...
head fork: acaudwell/Gource
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
1  Makefile.am
@@ -25,6 +25,7 @@ gource_SOURCES = \
src/core/shader.cpp src/core/shader.h \
src/core/stringhash.cpp src/core/stringhash.h \
src/core/texture.cpp src/core/texture.h \
+ src/core/tga.cpp src/core/tga.h \
src/core/utf8/checked.h \
src/core/utf8/core.h \
src/core/utf8/unchecked.h \
2  src/core
@@ -1 +1 @@
-Subproject commit 7cf63c4b62b157a99dd5efbde1c53f54a8d4821a
+Subproject commit 36ea0922fd47179a5e1dc7be5edf553c5bae41e6
View
30 src/gource.cpp
@@ -2005,17 +2005,6 @@ void Gource::setMessage(const char* str, ...) {
void Gource::screenshot() {
- char* screenbuff = new char[display.width * display.height * 4];
-
- glReadPixels(0, 0, display.width, display.height,
- GL_RGBA, GL_UNSIGNED_BYTE, screenbuff);
-
- const char tga_header[12] = { 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- short width = display.width;
- short height = display.height;
- char bitsperpixel = 32;
- char imagedescriptor = 8;
-
//get next free recording name
char tganame[256];
struct stat finfo;
@@ -2030,22 +2019,9 @@ void Gource::screenshot() {
//write tga
std::string filename(tganame);
- std::ofstream tga;
- tga.open(filename.c_str(), std::ios::out | std::ios::binary );
-
- if(!tga.is_open()) return;
-
- tga.write(tga_header, 12);
- tga.write((char*)&width, sizeof(short));
- tga.write((char*)&height, sizeof(short));
- tga.write(&bitsperpixel, 1);
- tga.write(&imagedescriptor, 1);
-
- tga.write(screenbuff, display.width * display.height * 4);
- tga.close();
-
- delete[] screenbuff;
-
+ TGAWriter tga(gGourceSettings.transparent ? 4 : 3);
+ tga.screenshot(filename);
+
setMessage("Wrote screenshot %s", tganame);
}
View
1  src/gource.h
@@ -35,6 +35,7 @@
#include "core/regex.h"
#include "core/ppm.h"
#include "core/mousecursor.h"
+#include "core/tga.h"
#include "gource_settings.h"
View
4 src/main.cpp
@@ -59,9 +59,9 @@ int main(int argc, char *argv[]) {
}
}
}
-
+
//set log level
- logger->setLevel(gGourceSettings.log_level);
+ Logger::getDefault()->setLevel(gGourceSettings.log_level);
//load config
if(!gGourceSettings.load_config.empty()) {

No commit comments for this range

Something went wrong with that request. Please try again.