summaryrefslogtreecommitdiff
path: root/src/renderer/tr_init.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-08-14 21:11:20 +0000
committerTim Angus <tim@ngus.net>2006-08-14 21:11:20 +0000
commit77c1837c789c50ed8fa80f6a862d33387e432125 (patch)
tree215051df23ce8287de47aba48fc685d009ffefe9 /src/renderer/tr_init.c
parent46c7999840ac513d69b98e3ded8d59869dbb2fb2 (diff)
* Merged ioq3-r838
- OS X Universal Binary creation script - OS X x86 support - OS X vm support - SDL video mode selection bug fix - "Home directory" support on windows - Windows SMP deadlock fix - Improved JPEG quality (screenshots/video) - AVIs recorded with \video command are now actually AVIs - Usual assortment of ioq3 tweaks and fixes
Diffstat (limited to 'src/renderer/tr_init.c')
-rw-r--r--src/renderer/tr_init.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/renderer/tr_init.c b/src/renderer/tr_init.c
index b027a3c8..96fa5b4d 100644
--- a/src/renderer/tr_init.c
+++ b/src/renderer/tr_init.c
@@ -511,7 +511,7 @@ void RB_TakeScreenshotJPEG( int x, int y, int width, int height, char *fileName
}
ri.FS_WriteFile( fileName, buffer, 1 ); // create path
- SaveJPG( fileName, 95, glConfig.vidWidth, glConfig.vidHeight, buffer);
+ SaveJPG( fileName, 90, glConfig.vidWidth, glConfig.vidHeight, buffer);
ri.Hunk_FreeTempMemory( buffer );
}
@@ -815,23 +815,23 @@ const void *RB_TakeVideoFrameCmd( const void *data )
if( cmd->motionJpeg )
{
- frameSize = SaveJPGToBuffer( cmd->encodeBuffer, 95,
+ frameSize = SaveJPGToBuffer( cmd->encodeBuffer, 90,
cmd->width, cmd->height, cmd->captureBuffer );
+ ri.CL_WriteAVIVideoFrame( cmd->encodeBuffer, frameSize );
}
else
{
- frameSize = cmd->width * cmd->height * 4;
+ frameSize = cmd->width * cmd->height;
- // Vertically flip the image
- for( i = 0; i < cmd->height; i++ )
+ for( i = 0; i < frameSize; i++) // Pack to 24bpp and swap R and B
{
- Com_Memcpy( &cmd->encodeBuffer[ i * ( cmd->width * 4 ) ],
- &cmd->captureBuffer[ ( cmd->height - i - 1 ) * ( cmd->width * 4 ) ],
- cmd->width * 4 );
+ 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->encodeBuffer, frameSize );
+ ri.CL_WriteAVIVideoFrame( cmd->encodeBuffer, frameSize * 3 );
+ }
return (const void *)(cmd + 1);
}