mirror of
https://github.com/ioquake/ioq3.git
synced 2025-05-31 09:01:54 +00:00
Fix from the VirtualDub people which should make avi files created with the video command playable with numerous windows players.
This commit is contained in:
parent
3afbcc9854
commit
3a1c4aa457
2 changed files with 21 additions and 17 deletions
|
@ -715,6 +715,7 @@ const void *RB_TakeVideoFrameCmd( const void *data )
|
|||
const videoFrameCommand_t *cmd;
|
||||
int frameSize;
|
||||
int i;
|
||||
char swapper;
|
||||
|
||||
cmd = (const videoFrameCommand_t *)data;
|
||||
|
||||
|
@ -729,21 +730,21 @@ const void *RB_TakeVideoFrameCmd( const void *data )
|
|||
{
|
||||
frameSize = SaveJPGToBuffer( cmd->encodeBuffer, 95,
|
||||
cmd->width, cmd->height, cmd->captureBuffer );
|
||||
ri.CL_WriteAVIVideoFrame( cmd->encodeBuffer, frameSize );
|
||||
}
|
||||
else
|
||||
{
|
||||
frameSize = cmd->width * cmd->height * 4;
|
||||
|
||||
// Vertically flip the image
|
||||
for( i = 0; i < cmd->height; i++ )
|
||||
for( i = 0; i < frameSize; i = i + 4) // Swap R and B
|
||||
{
|
||||
Com_Memcpy( &cmd->encodeBuffer[ i * ( cmd->width * 4 ) ],
|
||||
&cmd->captureBuffer[ ( cmd->height - i - 1 ) * ( cmd->width * 4 ) ],
|
||||
cmd->width * 4 );
|
||||
}
|
||||
}
|
||||
swapper = cmd->captureBuffer[ i ];
|
||||
cmd->captureBuffer[ i ] = cmd->captureBuffer[ i + 2 ];
|
||||
cmd->captureBuffer[ i + 2 ] = swapper;
|
||||
|
||||
ri.CL_WriteAVIVideoFrame( cmd->encodeBuffer, frameSize );
|
||||
}
|
||||
ri.CL_WriteAVIVideoFrame( cmd->captureBuffer, frameSize );
|
||||
}
|
||||
|
||||
return (const void *)(cmd + 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue