summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-03-20 19:22:46 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-03-27 08:51:58 -0400
commitae121de14920fd2176311cb2cfb5d02b0a469cfe (patch)
tree47c062a3ed450761f3b557171275f92027bf3c4a
parenta490ff896f7ac19eff02c2aecd6ebc241ede4368 (diff)
downloadrockbox-ae121de14920fd2176311cb2cfb5d02b0a469cfe.tar.gz
rockbox-ae121de14920fd2176311cb2cfb5d02b0a469cfe.zip
PictureFlow: Write bitmaps in one go
Analogous to an earlier change w.r.t. reading bitmaps Change-Id: I68e71160b51eb893f18071cc77d9c9a3ef84de0f
-rw-r--r--apps/plugins/pictureflow/pictureflow.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 3074771e32..73eee2e4c4 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -2022,13 +2022,7 @@ static bool save_pfraw(char* filename, struct bitmap *bm)
2022 int fh = rb->open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666); 2022 int fh = rb->open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
2023 if( fh < 0 ) return false; 2023 if( fh < 0 ) return false;
2024 rb->write( fh, &bmph, sizeof( struct pfraw_header ) ); 2024 rb->write( fh, &bmph, sizeof( struct pfraw_header ) );
2025 pix_t *data = (pix_t*)( bm->data ); 2025 rb->write( fh, bm->data , sizeof( pix_t ) * bm->width * bm->height );
2026 int y;
2027 for( y = 0; y < bm->height; y++ )
2028 {
2029 rb->write( fh, data , sizeof( pix_t ) * bm->width );
2030 data += bm->width;
2031 }
2032 rb->close( fh ); 2026 rb->close( fh );
2033 return true; 2027 return true;
2034} 2028}