forked from len0rd/rockbox
open the image in binary mode to work better on windows
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8864 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
71ee68e978
commit
635b8300c6
1 changed files with 6 additions and 1 deletions
|
@ -92,6 +92,11 @@ unsigned char brightness(struct RGBQUAD color)
|
||||||
+ (unsigned int)color.rgbBlue) / 10;
|
+ (unsigned int)color.rgbBlue) / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef O_BINARY
|
||||||
|
#define O_BINARY 0 /* systems that don't have O_BINARY won't make a difference
|
||||||
|
on text and binary files */
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* read_bmp_file()
|
* read_bmp_file()
|
||||||
*
|
*
|
||||||
|
@ -108,7 +113,7 @@ int read_bmp_file(char* filename,
|
||||||
struct Fileheader fh;
|
struct Fileheader fh;
|
||||||
struct RGBQUAD palette[256];
|
struct RGBQUAD palette[256];
|
||||||
|
|
||||||
int fd = open(filename, O_RDONLY);
|
int fd = open(filename, O_RDONLY| O_BINARY);
|
||||||
unsigned short data;
|
unsigned short data;
|
||||||
unsigned char *bmp;
|
unsigned char *bmp;
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue