r825 - in trunk/code: client renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Jul 31 11:32:59 EDT 2006


Author: thilo
Date: 2006-07-31 11:32:59 -0400 (Mon, 31 Jul 2006)
New Revision: 825

Modified:
   trunk/code/client/cl_avi.c
   trunk/code/renderer/tr_init.c
Log:
Another patch to make uncompressed AVI write in RGB24 format by anonymous virtualdub sympathiser.


Modified: trunk/code/client/cl_avi.c
===================================================================
--- trunk/code/client/cl_avi.c	2006-07-31 13:05:15 UTC (rev 824)
+++ trunk/code/client/cl_avi.c	2006-07-31 15:32:59 UTC (rev 825)
@@ -248,7 +248,7 @@
           WRITE_4BYTES( afd.width );            //biWidth
           WRITE_4BYTES( afd.height );           //biHeight
           WRITE_2BYTES( 1 );                    //biPlanes
-          WRITE_2BYTES( 32 );                   //biBitCount
+          WRITE_2BYTES( 24 );                   //biBitCount
 
           if( afd.motionJpeg )   {              //biCompression
             WRITE_STRING( "MJPG" );
@@ -257,7 +257,7 @@
           } else {
             WRITE_4BYTES( 0 );                  // BI_RGB
             WRITE_4BYTES( afd.width *
-            afd.height*4 );                     //biSizeImage
+            afd.height*3 );                     //biSizeImage
           }
 
           WRITE_4BYTES( 0 );                    //biXPelsPetMeter

Modified: trunk/code/renderer/tr_init.c
===================================================================
--- trunk/code/renderer/tr_init.c	2006-07-31 13:05:15 UTC (rev 824)
+++ trunk/code/renderer/tr_init.c	2006-07-31 15:32:59 UTC (rev 825)
@@ -715,7 +715,6 @@
 	const videoFrameCommand_t	*cmd;
 	int												frameSize;
 	int												i;
-	char												swapper;
 	
 	cmd = (const videoFrameCommand_t *)data;
 	
@@ -734,16 +733,16 @@
 	}
 	else
 	{
-		frameSize = cmd->width * cmd->height * 4;
+		frameSize = cmd->width * cmd->height;
 
-		for( i = 0; i < frameSize; i = i + 4)          // Swap R and B
+		for( i = 0; i < frameSize; i++)    // Pack to 24bpp and swap R and B
 		{
-			swapper = cmd->captureBuffer[ i ];
-			cmd->captureBuffer[ i ] = cmd->captureBuffer[ i + 2 ];
-			cmd->captureBuffer[ i + 2 ] = swapper;
-
+			cmd->encodeBuffer[ i*3 ]     = cmd->captureBuffer[ i*4 + 2 ];
+			cmd->encodeBuffer[ i*3 + 1 ] = cmd->captureBuffer[ i*4 + 1 ];
+			cmd->encodeBuffer[ i*3 + 2 ] = cmd->captureBuffer[ i*4 ];
 		}
-		ri.CL_WriteAVIVideoFrame( cmd->captureBuffer, frameSize );
+
+		ri.CL_WriteAVIVideoFrame( cmd->encodeBuffer, frameSize * 3 );
 	}
 
 	return (const void *)(cmd + 1);	




More information about the quake3-commits mailing list