diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-08-04 23:53:10 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-08-04 23:53:10 +0200 |
commit | 8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e (patch) | |
tree | dcac0d73e989ca140ca15856be53bac8e51b2bc8 | |
parent | 8c5065f8a99eee0b0edeeab3d9a7f815fa4d50df (diff) | |
download | nebula2-8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e.tar.gz nebula2-8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e.tar.bz2 nebula2-8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e.zip |
Fixed BMP generation.
Fixed line padding.
-rw-r--r-- | bmp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -91,10 +91,12 @@ bmp_write_pixel(bmp_write_handle_t* bmph, color_t col) { return 0; } - if(--(bmph->line_left) == 0) { - bmph->line_left = bmph->width; - - return (fwrite(padding, bmph->line_padding, 1, bmph->fh) == 1); + if(bmph->line_padding != 0) { + if(--(bmph->line_left) == 0) { + bmph->line_left = bmph->width; + + return (fwrite(padding, bmph->line_padding, 1, bmph->fh) == 1); + } } return 1; |