| 28 | } |
| 29 | |
| 30 | static BOOL CapturePal(SDL_Color *palette, std::ofstream *out) |
| 31 | { |
| 32 | BYTE pcx_palette[769]; |
| 33 | int i; |
| 34 | |
| 35 | pcx_palette[0] = 12; |
| 36 | for (i = 0; i < 256; i++) { |
| 37 | pcx_palette[1 + 3 * i + 0] = palette[i].r; |
| 38 | pcx_palette[1 + 3 * i + 1] = palette[i].g; |
| 39 | pcx_palette[1 + 3 * i + 2] = palette[i].b; |
| 40 | } |
| 41 | |
| 42 | out->write(reinterpret_cast<const char *>(pcx_palette), sizeof(pcx_palette)); |
| 43 | return !out->fail(); |
| 44 | } |
| 45 | |
| 46 | static BYTE *CaptureEnc(BYTE *src, BYTE *dst, int width) |
| 47 | { |