Convert the tiles in the file to our format of bytes. */
| 48 | |
| 49 | /* Convert the tiles in the file to our format of bytes. */ |
| 50 | static unsigned long |
| 51 | convert_tiles(unsigned char **tb_ptr, /* pointer to a tile byte pointer */ |
| 52 | unsigned long total) /* total tiles so far */ |
| 53 | { |
| 54 | unsigned char *tb = *tb_ptr; |
| 55 | unsigned long count = 0; |
| 56 | pixel tile[TILE_Y][TILE_X]; |
| 57 | int x, y; |
| 58 | |
| 59 | while (read_text_tile(tile)) { |
| 60 | count++; |
| 61 | total++; |
| 62 | for (y = 0; y < TILE_Y; y++) { |
| 63 | for (x = 0; x < TILE_X; x++) |
| 64 | tb[x] = pix_to_colormap(tile[y][x]); |
| 65 | tb += TILE_X * header.per_row; |
| 66 | } |
| 67 | |
| 68 | /* repoint at the upper-left corner of the next tile */ |
| 69 | *tb_ptr += TILE_X; |
| 70 | if (header.per_row == 1 || (total % header.per_row) == 0) |
| 71 | *tb_ptr += TILE_X * (TILE_Y - 1) * header.per_row; |
| 72 | tb = *tb_ptr; |
| 73 | } |
| 74 | |
| 75 | return count; |
| 76 | } |
| 77 | |
| 78 | /* Merge the current text colormap (ColorMap) with ours (x11_colormap). */ |
| 79 | static void |
no test coverage detected