Consolidate the dirtying.

This commit is contained in:
William McBrine
2019-08-02 18:27:09 -04:00
parent 224d67aef1
commit 9bfddf1368
20 changed files with 13 additions and 68 deletions

View File

@@ -47,6 +47,7 @@ extern FILE *pdc_dbfp; /* tracing file pointer (NULL = off) */
extern bool pdc_color_started;
extern unsigned long pdc_key_modifiers;
extern MOUSE_STATUS pdc_mouse_status;
extern bool pdc_dirty; /* redraw on napms() after init_color() */
/*----------------------------------------------------------------------*/

View File

@@ -186,6 +186,8 @@ int init_color(short color, short red, short green, short blue)
blue < -1 || blue > 1000)
return ERR;
pdc_dirty = TRUE;
return PDC_init_color(color, red, green, blue);
}

View File

@@ -87,6 +87,7 @@ kernel
RIPPEDOFFLINE linesripped[5];
char linesrippedoff = 0;
bool pdc_dirty = FALSE;
static struct cttyset
{
@@ -227,6 +228,12 @@ int napms(int ms)
if (!SP)
return ERR;
if (pdc_dirty)
{
pdc_dirty = FALSE;
wrefresh(curscr);
}
if (ms)
PDC_napms(ms);

View File

@@ -384,8 +384,6 @@ int PDC_color_content(short color, short *red, short *green, short *blue)
int PDC_init_color(short color, short red, short green, short blue)
{
pdc_dirty = TRUE;
pdc_color[color].r = DIVROUND(red * 255, 1000);
pdc_color[color].g = DIVROUND(green * 255, 1000);
pdc_color[color].b = DIVROUND(blue * 255, 1000);

View File

@@ -28,7 +28,6 @@ extern bool pdc_own_screen; /* if pdc_screen was not set
before initscr(), PDCurses is
responsible for (owns) it */
extern Uint32 pdc_lastupdate; /* time of last update, in ticks */
extern bool pdc_dirty; /* redraw on napms() after init_color() */
PDCEX void PDC_update_rects(void);
PDCEX void PDC_retile(void);

View File

@@ -2,8 +2,6 @@
#include "pdcsdl.h"
bool pdc_dirty = FALSE;
void PDC_beep(void)
{
PDC_LOG(("PDC_beep() - called\n"));
@@ -13,12 +11,6 @@ void PDC_napms(int ms)
{
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
if (pdc_dirty)
{
pdc_dirty = FALSE;
wrefresh(curscr);
}
PDC_update_rects();
SDL_PumpEvents();
SDL_Delay(ms);

View File

@@ -418,8 +418,6 @@ int PDC_color_content(short color, short *red, short *green, short *blue)
int PDC_init_color(short color, short red, short green, short blue)
{
pdc_dirty = TRUE;
pdc_color[color].r = DIVROUND(red * 255, 1000);
pdc_color[color].g = DIVROUND(green * 255, 1000);
pdc_color[color].b = DIVROUND(blue * 255, 1000);

View File

@@ -29,7 +29,6 @@ extern bool pdc_own_window; /* if pdc_window was not set
before initscr(), PDCurses is
responsible for (owns) it */
extern Uint32 pdc_lastupdate; /* time of last update, in ticks */
extern bool pdc_dirty; /* redraw on napms() after init_color() */
PDCEX void PDC_update_rects(void);
PDCEX void PDC_retile(void);

View File

@@ -2,8 +2,6 @@
#include "pdcsdl.h"
bool pdc_dirty = FALSE;
void PDC_beep(void)
{
PDC_LOG(("PDC_beep() - called\n"));
@@ -13,12 +11,6 @@ void PDC_napms(int ms)
{
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
if (pdc_dirty)
{
pdc_dirty = FALSE;
wrefresh(curscr);
}
PDC_update_rects();
SDL_PumpEvents();
SDL_Delay(ms);

View File

@@ -699,8 +699,6 @@ int PDC_color_content(short color, short *red, short *green, short *blue)
int PDC_init_color(short color, short red, short green, short blue)
{
pdc_dirty = TRUE;
if (red == -1 && green == -1 && blue == -1)
{
pdc_color[color].mapped = FALSE;

View File

@@ -2,8 +2,6 @@
#include "pdcwin.h"
bool pdc_dirty = FALSE;
void PDC_beep(void)
{
PDC_LOG(("PDC_beep() - called\n"));
@@ -16,12 +14,6 @@ void PDC_napms(int ms)
{
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
if (pdc_dirty)
{
pdc_dirty = FALSE;
wrefresh(curscr);
}
if ((SP->termattrs & A_BLINK) && (GetTickCount() >= pdc_last_blink + 500))
PDC_blink_text();

View File

@@ -22,6 +22,6 @@ extern DWORD pdc_quick_edit;
extern DWORD pdc_last_blink;
extern short pdc_curstoreal[16], pdc_curstoansi[16];
extern short pdc_oldf, pdc_oldb, pdc_oldu;
extern bool pdc_conemu, pdc_ansi, pdc_dirty;
extern bool pdc_conemu, pdc_ansi;
extern void PDC_blink_text(void);

View File

@@ -144,7 +144,5 @@ int PDC_init_color(short color, short red, short green, short blue)
XCursesInstructAndWait(CURSES_SET_COLOR);
pdc_dirty = TRUE;
return OK;
}

View File

@@ -6,8 +6,6 @@
# include <poll.h>
#endif
bool pdc_dirty = FALSE;
void PDC_beep(void)
{
PDC_LOG(("PDC_beep() - called\n"));
@@ -19,12 +17,6 @@ void PDC_napms(int ms)
{
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
if (pdc_dirty)
{
pdc_dirty = FALSE;
XCursesInstruct(CURSES_DISPLAY_ALL);
}
#if defined(HAVE_USLEEP)
usleep(1000 * ms);

View File

@@ -182,9 +182,7 @@ enum
CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR,
CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR,
CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR,
CURSES_BLINK_ON, CURSES_BLINK_OFF, CURSES_DISPLAY_ALL, CURSES_EXIT
CURSES_BLINK_ON, CURSES_BLINK_OFF, CURSES_EXIT
};
extern short *xc_atrtab;
extern bool pdc_dirty;

View File

@@ -2631,11 +2631,6 @@ static void _process_curses_requests(XtPointer client_data, int *fid,
_resume_curses();
break;
case CURSES_DISPLAY_ALL:
XC_LOG(("CURSES_DISPLAY_ALL recieved from child\n"));
_display_screen();
break;
default:
PDC_LOG(("%s:Unknown request %d\n", XCLOGMSG, num_cols));
}

View File

@@ -130,7 +130,5 @@ int PDC_init_color(short color, short red, short green, short blue)
XCursesInstructAndWait(CURSES_SET_COLOR);
pdc_dirty = TRUE;
return OK;
}

View File

@@ -6,8 +6,6 @@
# include <poll.h>
#endif
bool pdc_dirty = FALSE;
void PDC_beep(void)
{
PDC_LOG(("PDC_beep() - called\n"));
@@ -19,12 +17,6 @@ void PDC_napms(int ms)
{
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
if (pdc_dirty)
{
pdc_dirty = FALSE;
XCursesInstruct(CURSES_DISPLAY_ALL);
}
XSync(XtDisplay(topLevel), False);
#if defined(HAVE_USLEEP)

View File

@@ -169,10 +169,9 @@ enum
CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR,
CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR,
CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR,
CURSES_BLINK_ON, CURSES_BLINK_OFF, CURSES_DISPLAY_ALL, CURSES_EXIT
CURSES_BLINK_ON, CURSES_BLINK_OFF, CURSES_EXIT
};
extern short *xc_atrtab;
extern bool xc_resize_now;
extern bool pdc_dirty;

View File

@@ -2278,11 +2278,6 @@ void XCursesProcessRequest(int req)
_set_color();
break;
case CURSES_DISPLAY_ALL:
XC_LOG(("CURSES_DISPLAY_ALL recieved from child\n"));
_display_screen();
break;
default:
PDC_LOG(("%s:Unknown request %d\n", XCLOGMSG, num_cols));
}