| author | ecalot
<ecalot> 2004-07-19 14:53:19 UTC |
| committer | ecalot
<ecalot> 2004-07-19 14:53:19 UTC |
| parent | b3b1dab726f527e4589b8329a2fb4bb173cd1710 |
| FP/src/out/output.c | +4 | -2 |
diff --git a/FP/src/out/output.c b/FP/src/out/output.c index bf3cfc1..2995e7d 100644 --- a/FP/src/out/output.c +++ b/FP/src/out/output.c @@ -105,6 +105,7 @@ outputLoadBitmap(const unsigned char* data, int size, printf("%d\n",firstColorTransparent); if (!result) { fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError()); + free(colors); return NULL; } SDL_SetPalette(result, SDL_LOGPAL, colors, 0, palette.colors); @@ -126,10 +127,11 @@ outputLoadBitmap(const unsigned char* data, int size, } } } else { + int serialized=result->w&1; for (i = 0; i < w; i++) { for (j = 0; j < result->h; j++) { - putpixel(result, (i<<1), j, (data[w-i+j*w])&0x0f); - putpixel(result, (i<<1)+1, j, (data[w-i+j*w])>>4); + if (i) putpixel(result, (i<<1)-serialized, j, (data[w-i+j*w])&0x0f); + putpixel(result, (i<<1)+1-serialized, j, (data[w-i+j*w])>>4); } } }