diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-05-25 11:12:27 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-05-25 11:12:27 +0000 |
commit | aec37aa5fe371ed55b6553bc73c469d451e56179 (patch) | |
tree | 000772d1360c03530d020ced3dd46b6253f8c1b5 /apps/recorder/bmp.c | |
parent | b0e0ec832b3a940a59e23bbe52dee8f22bb7f813 (diff) | |
download | rockbox-aec37aa5fe371ed55b6553bc73c469d451e56179.tar.gz rockbox-aec37aa5fe371ed55b6553bc73c469d451e56179.zip |
* read_bmp_*(): add FORMAT_RETURN_SIZE
* Lua: add luaL_checkboolean() & luaL_optboolean()
* Lua: add read_bmp_file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21074 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/bmp.c')
-rw-r--r-- | apps/recorder/bmp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index eef425fb25..4968d6221a 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c | |||
@@ -460,6 +460,7 @@ int read_bmp_fd(int fd, | |||
460 | int read_width; | 460 | int read_width; |
461 | int depth, numcolors, compression, totalsize; | 461 | int depth, numcolors, compression, totalsize; |
462 | int ret; | 462 | int ret; |
463 | bool return_size = format & FORMAT_RETURN_SIZE; | ||
463 | 464 | ||
464 | unsigned char *bitmap = bm->data; | 465 | unsigned char *bitmap = bm->data; |
465 | struct uint8_rgb palette[256]; | 466 | struct uint8_rgb palette[256]; |
@@ -595,6 +596,9 @@ int read_bmp_fd(int fd, | |||
595 | else | 596 | else |
596 | totalsize = BM_SIZE(bm->width,bm->height,format,remote); | 597 | totalsize = BM_SIZE(bm->width,bm->height,format,remote); |
597 | 598 | ||
599 | if(return_size) | ||
600 | return totalsize; | ||
601 | |||
598 | /* Check if this fits the buffer */ | 602 | /* Check if this fits the buffer */ |
599 | if (totalsize > maxsize) { | 603 | if (totalsize > maxsize) { |
600 | DEBUGF("read_bmp_fd: Bitmap too large for buffer: " | 604 | DEBUGF("read_bmp_fd: Bitmap too large for buffer: " |