diff --git a/sdl1/pdcdisp.c b/sdl1/pdcdisp.c index dc5de3ea..343225da 100644 --- a/sdl1/pdcdisp.c +++ b/sdl1/pdcdisp.c @@ -13,7 +13,7 @@ #include "pdcsdl.h" -RCSID("$Id: pdcdisp.c,v 1.25 2007/07/03 00:11:46 wmcbrine Exp $") +RCSID("$Id: pdcdisp.c,v 1.26 2007/07/05 01:21:03 wmcbrine Exp $") #include #include @@ -88,6 +88,9 @@ static void _set_attr(chtype ch) { short newfg, newbg; + if (SP->mono) + return; + PDC_pair_content(PAIR_NUMBER(ch), &newfg, &newbg); newfg |= (ch & A_BOLD) ? 8 : 0; @@ -129,6 +132,9 @@ void PDC_gotoyx(int row, int col) PDC_LOG(("PDC_gotoyx() - called: row %d col %d from row %d col %d\n", row, col, SP->cursrow, SP->curscol)); + if (SP->mono) + return; + oldrow = SP->cursrow; oldcol = SP->curscol; @@ -178,6 +184,9 @@ static void _highlight(SDL_Rect *src, SDL_Rect *dest, chtype ch) { short col = SP->line_color; + if (SP->mono) + return; + if (ch & A_UNDERLINE) { if (col != -1) diff --git a/sdl1/pdcscrn.c b/sdl1/pdcscrn.c index 8f737beb..92beb24b 100644 --- a/sdl1/pdcscrn.c +++ b/sdl1/pdcscrn.c @@ -13,7 +13,7 @@ #include "pdcsdl.h" -RCSID("$Id: pdcscrn.c,v 1.24 2007/07/03 18:39:28 wmcbrine Exp $") +RCSID("$Id: pdcscrn.c,v 1.25 2007/07/05 01:21:03 wmcbrine Exp $") #include "deffont.h" #include "deficon.h" @@ -84,15 +84,13 @@ int PDC_scr_open(int argc, char **argv) return ERR; } - if (!pdc_font->format->palette) - { - fprintf(stderr, "Font must have a palette\n"); - return ERR; - } + SP->mono = !pdc_font->format->palette; pdc_fheight = pdc_font->h / 8; pdc_fwidth = pdc_font->w / 32; - pdc_flastc = pdc_font->format->palette->ncolors - 1; + + if (!SP->mono) + pdc_flastc = pdc_font->format->palette->ncolors - 1; if (pdc_own_screen && !pdc_icon) { @@ -160,8 +158,6 @@ int PDC_scr_open(int argc, char **argv) PDC_reset_prog_mode(); - SP->mono = FALSE; - pdc_lastscr = newwin(SP->lines, SP->cols, 0, 0); wattrset(pdc_lastscr, (chtype)(-1)); werase(pdc_lastscr);