Loads a pcx file and converts it to 16 bit. Returns bitmap handle or -1 on error
| 68 | |
| 69 | // Loads a pcx file and converts it to 16 bit. Returns bitmap handle or -1 on error |
| 70 | int bm_pcx_alloc_file(CFILE *infile) { |
| 71 | uint8_t temp[128]; |
| 72 | |
| 73 | cf_ReadBytes(temp, 128, infile); |
| 74 | cfseek(infile, 0, SEEK_SET); |
| 75 | |
| 76 | switch (temp[65]) { |
| 77 | case 1: |
| 78 | // one plane, sounds like an 8bit pcx |
| 79 | return bm_pcx_8bit_alloc_file(infile); |
| 80 | break; |
| 81 | case 3: |
| 82 | // three planes, sounds like a 24bit pcx |
| 83 | return bm_pcx_24bit_alloc_file(infile); |
| 84 | break; |
| 85 | } |
| 86 | |
| 87 | return -1; // Must be 8 bit only |
| 88 | } |
| 89 | |
| 90 | // load an 8bit pcx image |
| 91 | int bm_pcx_8bit_alloc_file(CFILE *infile) { |
no test coverage detected