diff options
author | alberth <alberth@openttd.org> | 2010-07-24 10:14:39 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-07-24 10:14:39 +0000 |
commit | be6c0584240caf420b2475a0be036391e842e8af (patch) | |
tree | 6111751cf5526e1eb41176782d84766c4e9ed185 /src/screenshot.cpp | |
parent | 645b6ce77345867fa96861843197481131566c46 (diff) | |
download | openttd-be6c0584240caf420b2475a0be036391e842e8af.tar.xz |
(svn r20211) -Codechange: Indented code should have curly braces around it.
Diffstat (limited to 'src/screenshot.cpp')
-rw-r--r-- | src/screenshot.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/screenshot.cpp b/src/screenshot.cpp index 983c416cb..7755c7410 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -307,8 +307,9 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user y += n; /* write them to png */ - for (i = 0; i != n; i++) + for (i = 0; i != n; i++) { png_write_row(png_ptr, (png_bytep)buff + i * w * bpp); + } } while (y != h); png_write_end(png_ptr, info_ptr); @@ -356,8 +357,7 @@ static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *user DEBUG(misc, 0, "Can't convert a 32bpp screenshot to PCX format. Please pick another format."); return false; } - if (pixelformat != 8 || w == 0) - return false; + if (pixelformat != 8 || w == 0) return false; f = fopen(name, "wb"); if (f == NULL) return false; @@ -413,12 +413,13 @@ static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *user uint8 ch = bufp[j]; if (ch != runchar || runcount >= 0x3f) { - if (runcount > 1 || (runchar & 0xC0) == 0xC0) + if (runcount > 1 || (runchar & 0xC0) == 0xC0) { if (fputc(0xC0 | runcount, f) == EOF) { free(buff); fclose(f); return false; } + } if (fputc(runchar, f) == EOF) { free(buff); fclose(f); @@ -431,12 +432,13 @@ static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *user } /* write remaining bytes.. */ - if (runcount > 1 || (runchar & 0xC0) == 0xC0) + if (runcount > 1 || (runchar & 0xC0) == 0xC0) { if (fputc(0xC0 | runcount, f) == EOF) { free(buff); fclose(f); return false; } + } if (fputc(runchar, f) == EOF) { free(buff); fclose(f); |