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

Function vesa_WriteCharXY

sys/msdos/vidvesa.c:1601–1625  ·  view source on GitHub ↗

* As vesa_WriteChar, but specify coordinates by pixel and allow * transparency */

Source from the content-addressed store, hash-verified

1599 * transparency
1600 */
1601static void
1602vesa_WriteCharXY(uint32 chr, int pixx, int pixy, uint32 colour)
1603{
1604 /* Flush if cache is full or if not contiguous to the last character */
1605 if (chr_cache_size >= SIZE(chr_cache)) {
1606 vesa_flush_text();
1607 }
1608 if (chr_cache_size != 0 && chr_cache_lastx + vesa_char_width != (unsigned) pixx) {
1609 vesa_flush_text();
1610 }
1611 if (chr_cache_size != 0 && chr_cache_pixy != (unsigned) pixy) {
1612 vesa_flush_text();
1613 }
1614 /* Add to cache and write later */
1615 if (chr_cache_size == 0) {
1616 chr_cache_pixx = pixx;
1617 chr_cache_pixy = pixy;
1618 }
1619 chr_cache_lastx = pixx;
1620 chr_cache[chr_cache_size].chr = chr;
1621 chr_cache[chr_cache_size].inverse = inversed;
1622 chr_cache[chr_cache_size].colour = colour;
1623 chr_cache[chr_cache_size].bgcolour = BACKGROUND_VESA_COLOR;
1624 ++chr_cache_size;
1625}
1626
1627/*
1628 * Draw a character with a transparent background

Callers 1

vesa_WriteCharFunction · 0.85

Calls 1

vesa_flush_textFunction · 0.85

Tested by

no test coverage detected