PictureFlow: Write bitmaps in one go

Analogous to an earlier change w.r.t. reading bitmaps

Change-Id: I68e71160b51eb893f18071cc77d9c9a3ef84de0f
This commit is contained in:
Christian Soffke 2022-03-20 19:22:46 +01:00 committed by Aidan MacDonald
parent a490ff896f
commit ae121de149

View file

@ -2022,13 +2022,7 @@ static bool save_pfraw(char* filename, struct bitmap *bm)
int fh = rb->open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if( fh < 0 ) return false;
rb->write( fh, &bmph, sizeof( struct pfraw_header ) );
pix_t *data = (pix_t*)( bm->data );
int y;
for( y = 0; y < bm->height; y++ )
{
rb->write( fh, data , sizeof( pix_t ) * bm->width );
data += bm->width;
}
rb->write( fh, bm->data , sizeof( pix_t ) * bm->width * bm->height );
rb->close( fh );
return true;
}