summaryrefslogtreecommitdiff
path: root/screenshot.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-03 10:22:20 +0000
committertron <tron@openttd.org>2005-07-03 10:22:20 +0000
commit6c5df28d7c353ccbeef6220b06bb6d64b08f3061 (patch)
tree5bdaabd03e6ad369817aa4603b9d4b2f8ce3e173 /screenshot.c
parentae032390e2840d165550693cbd8f94c39ab3653b (diff)
downloadopenttd-6c5df28d7c353ccbeef6220b06bb6d64b08f3061.tar.xz
(svn r2512) Small cleanup
Diffstat (limited to 'screenshot.c')
-rw-r--r--screenshot.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/screenshot.c b/screenshot.c
index ad7c2064a..9538b9044 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -330,14 +330,15 @@ static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *user
// write them to pcx
for (i = 0; i != n; i++) {
- int runcount = 1;
- byte *bufp = buff + i * w;
- byte runchar = *bufp++;
- uint left;
+ const byte* bufp = buff + i * w;
+ byte runchar = bufp[0];
+ uint runcount = 1;
+ uint j;
// for each pixel...
- for (left = w - 1; left > 0; --left) {
- byte ch = *bufp++;
+ for (j = 1; j < w; j++) {
+ byte ch = bufp[j];
+
if (ch != runchar || runcount >= 0x3f) {
if (runcount > 1 || (runchar & 0xC0) == 0xC0)
if (fputc(0xC0 | runcount, f) == EOF) {