make the thumbnail properly when doing fast save in d2xgl
authorChris Taylor <chris@icculus.org>
Mon, 24 Jul 2006 08:20:39 +0000 (08:20 +0000)
committerChris Taylor <chris@icculus.org>
Mon, 24 Jul 2006 08:20:39 +0000 (08:20 +0000)
ChangeLog
main/state.c

index 7451d79..2521935 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-24  Chris Taylor  <chris@icculus.org>
+
+       * main/state.c: make the thumbnail properly when doing fast save
+       in d2xgl
+
 2006-07-12  Chris Taylor  <chris@icculus.org>
 
        * d2x.xcode/project.pbxproj: add references to headers in main
index 6987f95..778c7af 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.26 2005-08-02 06:13:56 chris Exp $ */
+/* $Id: state.c,v 1.27 2006-07-24 08:20:39 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -628,6 +628,7 @@ int state_save_all_sub(char *filename, char *desc, int between_levels)
 #ifdef OGL
                ubyte *buf;
                int k;
+               GLint gl_draw_buffer;
 #endif
                grs_canvas * cnv_save;
                cnv_save = grd_curcanv;
@@ -639,7 +640,8 @@ int state_save_all_sub(char *filename, char *desc, int between_levels)
 #if defined(OGL)
 # if 1
                buf = d_malloc(THUMBNAIL_W * THUMBNAIL_H * 3);
-               glReadBuffer(GL_FRONT);
+               glGetIntegerv(GL_DRAW_BUFFER, &gl_draw_buffer);
+               glReadBuffer(gl_draw_buffer);
                glReadPixels(0, SHEIGHT - THUMBNAIL_H, THUMBNAIL_W, THUMBNAIL_H, GL_RGB, GL_UNSIGNED_BYTE, buf);
                k = THUMBNAIL_H;
                for (i = 0; i < THUMBNAIL_W * THUMBNAIL_H; i++) {