Remove unused patches

This commit is contained in:
Siddhesh Poyarekar 2010-07-11 05:44:43 +00:00
parent e3a88a7c02
commit cfbd70c7b7
2 changed files with 0 additions and 178 deletions

View File

@ -1,98 +0,0 @@
commit aac1f0378e293a6e456a7de5e1fe615e581be202
Author: Andrew Caudwell <acaudwell@gmail.com>
Date: Wed Feb 24 16:23:41 2010 +1300
PPM output no longer flips the image in hardware, which failed on
some video cards.
diff --git a/src/ppm.cpp b/src/ppm.cpp
index 82ac334..9f103d9 100644
--- a/src/ppm.cpp
+++ b/src/ppm.cpp
@@ -37,8 +37,9 @@ FrameExporter::FrameExporter() {
rowstride = display.width * 3;
- pixels1 = new char[display.height * rowstride];
- pixels2 = new char[display.height * rowstride];
+ pixels1 = new char[display.height * rowstride];
+ pixels2 = new char[display.height * rowstride];
+ pixels_out = new char[display.height * rowstride];
pixels_shared_ptr = 0;
@@ -73,6 +74,7 @@ FrameExporter::~FrameExporter() {
delete[] pixels1;
delete[] pixels2;
+ delete[] pixels_out;
}
void FrameExporter::dump() {
@@ -82,12 +84,6 @@ void FrameExporter::dump() {
glEnable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
- //render view to texture
- display.renderToTexture(screentex, display.width, display.height, GL_RGBA);
-
- //draw view screen flipped
- display.fullScreenQuad(true);
-
char* next_pixel_ptr = (pixels_shared_ptr == pixels1) ? pixels2 : pixels1;
// copy pixels - now the right way up
@@ -103,10 +99,6 @@ void FrameExporter::dump() {
SDL_CondSignal(cond);
SDL_mutexV(mutex);
-
- // redraw view the right way up for the user
- display.fullScreenQuad(false);
-
}
void FrameExporter::dumpThr() {
@@ -119,7 +111,17 @@ void FrameExporter::dumpThr() {
if (dumper_thread_state == FRAME_EXPORTER_EXIT) break;
- dumpImpl();
+ if (pixels_shared_ptr != 0) {
+
+ //invert image
+ for(int y=0;y<display.height;y++) {
+ for(int x=0;x<rowstride;x++) {
+ pixels_out[x + y * rowstride] = pixels_shared_ptr[x + (display.height - y - 1) * rowstride];
+ }
+ }
+
+ dumpImpl();
+ }
dumper_thread_state = FRAME_EXPORTER_WAIT;
}
@@ -166,9 +168,6 @@ PPMExporter::~PPMExporter() {
}
void PPMExporter::dumpImpl() {
- if(pixels_shared_ptr==0) return;
-
*output << ppmheader;
-
- output->write(pixels_shared_ptr, rowstride * display.height);
+ output->write(pixels_out, rowstride * display.height);
}
diff --git a/src/ppm.h b/src/ppm.h
index 994c661..7564fbd 100644
--- a/src/ppm.h
+++ b/src/ppm.h
@@ -35,6 +35,8 @@ protected:
char* pixels1;
char* pixels2;
+ char* pixels_out;
+
char* pixels_shared_ptr;
size_t rowstride;

View File

@ -1,80 +0,0 @@
From 5aa2c8adfbe0ec3e5d802bfae8e5572562d911c7 Mon Sep 17 00:00:00 2001
From: Andrew Caudwell <acaudwell@gmail.com>
Date: Thu, 15 Apr 2010 23:26:19 +0000
Subject: [PATCH] Create temp file using mkstemp.
---
src/commitlog.cpp | 29 +++++++++++++++--------------
src/commitlog.h | 2 +-
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/commitlog.cpp b/src/commitlog.cpp
index 689a100..87171d5 100644
--- a/src/commitlog.cpp
+++ b/src/commitlog.cpp
@@ -206,34 +206,35 @@ bool RCommitLog::isFinished() {
return false;
}
-std::string RCommitLog::createTempLog() {
- //create temp file
- char logfile_buff[1024];
+//create temp file
+void RCommitLog::createTempLog() {
+
+ std::string tempdir;
#ifdef _WIN32
DWORD tmplen = GetTempPath(0, "");
- if(tmplen == 0) return 0;
+ if(tmplen == 0) return;
std::vector<TCHAR> temp(tmplen+1);
tmplen = GetTempPath(static_cast<DWORD>(temp.size()), &temp[0]);
- if(tmplen == 0 || tmplen >= temp.size()) return 0;
-
- std::string temp_file_path(temp.begin(),
- temp.begin() + static_cast<std::size_t>(tmplen));
+ if(tmplen == 0 || tmplen >= temp.size()) return;
- temp_file_path += "gource.tmp";
+ std::string tempdir = std::string(temp.begin(), temp.begin() + static_cast<std::size_t>(tmplen));
+ tempdir += "\\";
- sprintf(logfile_buff, "%s", temp_file_path.c_str());
#else
- uid_t myuid = getuid();
- sprintf(logfile_buff, "/tmp/gource-%d.tmp", myuid);
+ tempdir = "/tmp/";
#endif
- temp_file = std::string(logfile_buff);
- return temp_file;
+ char tmplate[1024];
+ snprintf(tmplate, 1024, "%sgource-XXXXXX", tempdir.c_str());
+
+ if(mkstemp(tmplate) < 0) return;
+
+ temp_file = std::string(tmplate);
}
// RCommitFile
diff --git a/src/commitlog.h b/src/commitlog.h
index 1867396..5ff8da2 100644
--- a/src/commitlog.h
+++ b/src/commitlog.h
@@ -77,7 +77,7 @@ protected:
bool checkFirstChar(int firstChar, std::istream& stream);
- std::string createTempLog();
+ void createTempLog();
bool getNextLine(std::string& line);
--
1.6.5