MCPcopy Create free account
hub / github.com/NetHack/NetHack / read_planar_tile

Function read_planar_tile

sys/msdos/vidvga.c:656–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654#endif /* SCROLLMAP */
655
656static void
657read_planar_tile(unsigned glyph, struct planar_cell_struct *cell)
658{
659 unsigned char indexes[TILE_Y][TILE_X];
660 unsigned plane, y, byte, bit;
661
662 read_tile_indexes(glyph, indexes);
663 /* cell->plane[0..3].image[0..15][0..1] */
664 for (plane = 0; plane < SCREENPLANES; ++plane) {
665 for (y = 0; y < TILE_Y; ++y) {
666 for (byte = 0; byte < MAX_BYTES_PER_CELL; ++byte) {
667 unsigned char b = 0;
668 for (bit = 0; bit < 8; ++bit) {
669 unsigned char x = byte * 8 + bit;
670 unsigned char i = indexes[y][x];
671 b <<= 1;
672 if (i & (0x8 >> plane)) b |= 1;
673 }
674 cell->plane[plane].image[y][byte] = b;
675 }
676 }
677 }
678}
679
680static void
681read_planar_tile_O(unsigned glyph, struct overview_planar_cell_struct *cell)

Callers 3

vga_xputgFunction · 0.85
vidvga.cFile · 0.85
vga_scrollmapFunction · 0.85

Calls 1

read_tile_indexesFunction · 0.85

Tested by

no test coverage detected