Esempio n. 1
0
/*
print_glyph(window, x, y, glyph)
                -- Print the glyph at (x,y) on the given window.  Glyphs are
                   integers at the interface, mapped to whatever the window-
                   port wants (symbol, font, color, attributes, ...there's
                   a 1-1 map between glyphs and distinct things on the map).
*/
void curses_print_glyph(winid wid, xchar x, xchar y, int glyph)
{
    int ch, color;
    unsigned int special;
    int attr = -1;

    /* map glyph to character and color */
    mapglyph(glyph, (glyph_t*)&ch, &color, &special, x, y);
    if ((special & MG_PET) && iflags.hilite_pet)
    {
        attr = iflags.wc2_petattr;
    }
    if ((special & MG_DETECT) && iflags.use_inverse)
	{
	    attr = A_REVERSE;
	}
	if (iflags.cursesgraphics)
	{
	    ch = curses_convert_glyph(ch, glyph);
	}
    curses_putch(wid, x, y, ch, color, attr);
}
Esempio n. 2
0
static void Plot(int fg, int bg, int ch, int x, int y)
{
#ifdef USE_CURSES
	curses_putch(x, y, ch, (UBYTE) fg, (UBYTE) bg);
#else /* USE_CURSES */
	const UBYTE *font_ptr = charset + (ch & 0x7f) * 8;
	UBYTE *ptr = (UBYTE *) Screen_atari + 24 * Screen_WIDTH + 32 + y * (8 * Screen_WIDTH) + x * 8;
	int i;
	int j;

	for (i = 0; i < 8; i++) {
		UBYTE data = *font_ptr++;
		for (j = 0; j < 8; j++) {
#ifdef USE_COLOUR_TRANSLATION_TABLE
			ANTIC_VideoPutByte(ptr++, (UBYTE) colour_translation_table[data & 0x80 ? fg : bg]);
#else
			ANTIC_VideoPutByte(ptr++, (UBYTE) (data & 0x80 ? fg : bg));
#endif
			data <<= 1;
		}
		ptr += Screen_WIDTH - 8;
	}
#endif /* USE_CURSES */
}