当前位置: 首页>>代码示例>>C++>>正文


C++ doupdate函数代码示例

本文整理汇总了C++中doupdate函数的典型用法代码示例。如果您正苦于以下问题:C++ doupdate函数的具体用法?C++ doupdate怎么用?C++ doupdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了doupdate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CON_Print

/*
==================
CON_Print
==================
*/
void CON_Print(const char *msg)
{
	int col;
	bool scroll = (lastline > scrollline && lastline <= scrollline + LOG_LINES);

	if (!curses_on) {
		CON_Print_tty(msg);
		return;
	}

	// Print the message in the log window
	CON_ColorPrint(logwin, msg, qtrue);
	getyx(logwin, lastline, col);
	if (col)
		lastline++;
	if (scroll) {
		scrollline = lastline - LOG_LINES;
		if (scrollline < 0)
			scrollline = 0;
		pnoutrefresh(logwin, scrollline, 0, 2, 1, LOG_LINES + 1, LOG_COLS + 1);
	}

	// Add the message to the log buffer
	if (insert + strlen(msg) >= logbuf + sizeof(logbuf)) {
		memmove(logbuf, logbuf + sizeof(logbuf) / 2, sizeof(logbuf) / 2);
		memset(logbuf + sizeof(logbuf) / 2, 0, sizeof(logbuf) / 2);
		insert -= sizeof(logbuf) / 2;
	}
	strcpy(insert, msg);
	insert += strlen(msg);

	// Update the scrollbar
	CON_DrawScrollBar();

	// Move the cursor back to the input field
	CON_UpdateCursor();
	doupdate();
}
开发者ID:DolceTriade,项目名称:OpenWolf,代码行数:43,代码来源:con_curses.cpp

示例2: doupdate

int STRUM2::run()
{
	for (int i = 0; i < framesToRun(); i++) {
		if (--_branch <= 0) {
			doupdate();
			_branch = getSkip();
		}

		float out[2];

		out[0] = _strum->next() * _amp;

		if (outputChannels() == 2) {
			out[1] = out[0] * (1.0f - _pan);
			out[0] *= _pan;
		}

		rtaddout(out);
		increment();
	}

	return framesToRun();
}
开发者ID:RTcmix,项目名称:RTcmix,代码行数:23,代码来源:STRUM2.cpp

示例3: va_start

int
shNCursesInterface::diag (const char *format, ...)
{
    int res;
    va_list ap;

    mColor = kMagenta;
    va_start (ap, format);
    char dbgbuf[100];
    res = vsnprintf (dbgbuf, 100, format, ap);
    if (mWin[kDiag]) {
        wattrset (mWin[kDiag], ColorMap[kCyan]);
        waddstr (mWin[kDiag], dbgbuf);
        waddch (mWin[kDiag], '\n');
        touchwin (mWin[kDiag]);
        wnoutrefresh (mWin[kDiag]);
        doupdate ();
    }
    debug.log ("%s", dbgbuf);
    va_end (ap);
    mColor = kGray;
    return res;
}
开发者ID:ronw23,项目名称:prime-osx,代码行数:23,代码来源:NCUI.cpp

示例4: run

int PAN :: run()
{
   const int samps = framesToRun() * inputChannels();

   rtgetin(in, this, samps);

   for (int i = 0; i < samps; i += inputChannels()) {
      if (--branch <= 0) {
         doupdate();
         branch = skip;
      }
      float insig = in[i + inchan] * amp;

      float out[2];
      out[0] = insig * pan[0];
      out[1] = insig * pan[1];

      rtaddout(out);
      increment();
   }

   return framesToRun();
}
开发者ID:CreativeInquiry,项目名称:RTcmix,代码行数:23,代码来源:PAN.cpp

示例5: showmenu

void showmenu(struct MENU *menu)
{
    struct ITEM *itemptr;	/* points to each item in turn */
    int ctr = 1;		/* counts each item */

    wattrset(menu->menuwin, BOXATTR);	/* set to bg+/b */
    colorwin(menu->menuwin);	/* color window */
    box(menu->menuwin, ACS_VLINE, ACS_HLINE);	/* draw border */

    itemptr = menu->itemlist;	/* point to start */

    wattrset(menu->menuwin, STDATTR);

    do {			/* display items */
	wmove(menu->menuwin, ctr, 1);
	showitem(menu, itemptr, NOTSELECTED);	/* show items, initially unselected */
	ctr++;
	itemptr = itemptr->next;
    } while (ctr <= menu->itemcount);

    update_panels();
    doupdate();
}
开发者ID:saintkepha,项目名称:airtraf,代码行数:23,代码来源:menurt.c

示例6: timeout

void Ozette::run() {
	if (_editors.empty()) show_browser();
	timeout(100);
	do {
		if (sig_io_flag.exchange(false)) {
			_shell.poll();
		}
		int ch = fix_control_quirks(getch());
		switch (ch) {
			case Control::UpArrow: show_browser(); break;
			case Control::NewFile: new_file(); break;
			case Control::Open: open_file(); break;
			case Control::Directory: change_directory(); break;
			case Control::Help: show_help(); break;
			case Control::Execute: execute(); break;
			case KEY_F(4): search(); break;
			case KEY_F(5): build(); break;
			default: _done |= !_shell.process(ch);
		}
		update_panels();
		doupdate();
	} while (!_done);
}
开发者ID:marssaxman,项目名称:ozette,代码行数:23,代码来源:ozette.cpp

示例7: render_cb

/*
 * render_cb 
 *
 * Called by the rendering loop, which is the tightest of the event loops. 
 * It writes any modified state to the screen, and tries not to calculate much
 * itself, since it has to return quickly.
 * Repeat: .02 seconds
 */
void render_cb(EV_P_ ev_timer *w, int revents)
{
        spin_render_loop();

        if (game_is_paused)
                pause_loop();

        tick();

        free_nouns();
        update_nouns();

        dock_update();

        print_dock();
        update_map_control();
        update_panels();  /* Were slowing down performance, unnecessary */
        doupdate();
        MAPBOOK->restack(ACTIVE);
        map_refresh(ACTIVE);

        ev_timer_again(EV_DEFAULT, w);
}
开发者ID:linehan,项目名称:barnacle,代码行数:31,代码来源:loop.c

示例8: readline_recreate

/**
 * Recreate the 2 readline panels with respect to the screen size.
 *
 * @param rows Size of the screen in rows
 * @param cols Size of the screen in cols
 * @return Void
 */
void
readline_recreate(int rows, int cols)
{
    struct term_window_size newsize = {
	.rows      = 1,
	.cols      = cols,
	.start_row = rows - 1,
	.start_col = 0,
    };

    readline_pan1 = term_resize_panel(readline_pan1, &newsize);
    readline_pan2 = term_resize_panel(readline_pan2, &newsize);

    apply_readline_options(panel_window(readline_pan1));
    apply_readline_options(panel_window(readline_pan2));
}

/**
 * Puts the currently active readline panel on the top of all panels
 * in the stack.
 */
void
readline_top_panel(void)
{
    if (panel_state == PANEL1_ACTIVE) {
	if (readline_pan1)
	    (void) top_panel(readline_pan1);
    } else if (panel_state == PANEL2_ACTIVE) {
	if (readline_pan2)
	    (void) top_panel(readline_pan2);
    } else {
	sw_assert_not_reached();
    }

    update_panels();
    (void) doupdate();
}
开发者ID:uhlin,项目名称:swirc,代码行数:44,代码来源:readline.c

示例9: input_loop

static void
input_loop(int portfd)
{
  if (portfd >= FD_SETSIZE)
  {
    destroy_screen();
    fputs("File descriptor too large\n", stderr);
    exit(1);
  }

  for (;;)
  {
    fd_set fds;

    FD_ZERO(&fds);
    FD_SET(STDIN_FILENO, &fds);
    FD_SET(portfd, &fds);

    int rc = select(portfd + 1, &fds, 0, 0, 0);
    if (rc <= 0)
    {
      if (rc < 0 && errno != EINTR)
        exit_error("select", errno);
      continue;
    }

    if (FD_ISSET(portfd, &fds))
      receive_kctext(portfd, win_output);

    if (FD_ISSET(STDIN_FILENO, &fds)
        && handle_key_input(portfd, win_input))
      break;

    wnoutrefresh(win_input);
    doupdate();
  }
}
开发者ID:danielkitta,项目名称:kcio,代码行数:37,代码来源:kcterm.c

示例10: popupWin

/******************************************************\
 * Description:	Creates a "window popup" where given  *
 * 		the parameters, and message, it       *
 * 		creates a window and displays the     *
 * 		message.  Some current restrictions   *
 * 		are that it must only be one line, and*
 * 		it is assumed that the text is padded *
 * 		with one space left for the border and*
 * 		another space left for aesthetics     *
\******************************************************/
void popupWin(char *msg, int time)
{
    WINDOW *tmpwin;

    int y = (LINES / 2) - 3,				/* calc location      */
        len = strlen(msg),
        x = (COLS - len)/2;

    y = (y < 2) ? 2 : y;				/* minimum height     */
    time = (!time) ? 2 : time;

    tmpwin = drawbox(y, x, 5, len + 6);			/* create window      */

    keypad(tmpwin, TRUE);

    mvwprintw(tmpwin,2,3, msg);				/* output mesg        */
    wmove(tmpwin,2,len+4);
    wrefresh(tmpwin);

    if (time == -1)
        wgetch(tmpwin);
    else
        sleep(time);					/* wait               */

    delwin(tmpwin);

    wtouchln(windows->hex, y - 1, 5, 1);		/* touch windows      */
    wtouchln(windows->ascii, y - 1, 5, 1);
    wtouchln(windows->address, y - 1, 5, 1);
    wtouchln(windows->hex_outline, y, 5, 1);
    wtouchln(windows->ascii_outline, y, 5, 1);
    wtouchln(windows->scrollbar, y, 5, 1);

    refreshall(windows);				/* refresh all wins   */

    doupdate();
}
开发者ID:nilcons-contrib,项目名称:hexcurse,代码行数:47,代码来源:screen.c

示例11: addfield

void addfield(struct FIELDLIST *list, unsigned int len,
              unsigned int y, unsigned int x, char *initstr)
{
    struct FIELD *newfield;
    int i;

    newfield = malloc(sizeof(struct FIELD));

    if (list->list == NULL) {
        list->list = newfield;
        newfield->prevfield = newfield;
        newfield->nextfield = newfield;
    } else {
        newfield->prevfield = list->list->prevfield;
        list->list->prevfield->nextfield = newfield;
        list->list->prevfield = newfield;
        newfield->nextfield = list->list;
    }

    newfield->xpos = x;
    newfield->ypos = y;
    newfield->len = len;
    newfield->tlen = strlen(initstr);
    newfield->buf = malloc(len + 1);
    strcpy(newfield->buf, initstr);

    wattrset(list->fieldwin, FIELDATTR);
    wmove(list->fieldwin, y, x);
    for (i = 1; i <= (signed)len; i++)
        wprintw(list->fieldwin, " ");

    wmove(list->fieldwin, y, x);
    wprintw(list->fieldwin, "%s", initstr);

    update_panels();
    doupdate();
}
开发者ID:nullren,项目名称:sillypoker,代码行数:37,代码来源:input.c

示例12: destroymenu

void destroymenu(struct MENU *menu)
{
    struct ITEM *tnode;
    struct ITEM *tnextnode;

    if (menu->itemlist != NULL) {
	tnode = menu->itemlist;
	tnextnode = menu->itemlist->next;

	tnode->prev->next = NULL;

	while (tnode != NULL) {
	    free(tnode);
	    tnode = tnextnode;

	    if (tnextnode != NULL)
		tnextnode = tnextnode->next;
	}
    }
    del_panel(menu->menupanel);
    delwin(menu->menuwin);
    update_panels();
    doupdate();
}
开发者ID:saintkepha,项目名称:airtraf,代码行数:24,代码来源:menurt.c

示例13: main

int main()
{
	WINDOW *my_wins[3];
	PANEL  *my_panels[3];
	int lines = 15, cols = 45, y = 2, x = 4, i;

	initscr();
	cbreak();
	noecho();

	/* Create windows for the panels */
	my_wins[0] = newwin(lines, cols, y, x);
	my_wins[1] = newwin(lines, cols, y + 1, x + 5);
	my_wins[2] = newwin(lines, cols, y + 2, x + 10);

	/* 
	 * Create borders around the windows so that you can see the effect
	 * of panels
	 */
	for(i = 0; i < 3; ++i)
		box(my_wins[i], 0, 0);

	/* Attach a panel to each window */ 	/* Order is bottom up */
	my_panels[0] = new_panel(my_wins[0]); 	/* Push 0, order: stdscr-0 */
	my_panels[1] = new_panel(my_wins[1]); 	/* Push 1, order: stdscr-0-1 */
	my_panels[2] = new_panel(my_wins[2]); 	/* Push 2, order: stdscr-0-1-2 */

	/* Update the stacking order. 2nd panel will be on top */
	update_panels();

	/* Show it on the screen */
	doupdate();
	
	getch();
	endwin();
}
开发者ID:lavenliu,项目名称:linuxc,代码行数:36,代码来源:panel_simple.c

示例14: run

int MSHAKERS :: run()
{
	int   i;
	float out[2];

	for (i = 0; i < framesToRun(); i++) {
		if (--branch <= 0) {
			doupdate();
			branch = getSkip();
		}

		out[0] = theShake->tick() * aamp;

		if (outputChannels() == 2) {
			out[1] = out[0] * (1.0 - pctleft);
			out[0] *= pctleft;
		}

		rtaddout(out);
		increment();
	}

	return framesToRun();
}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:RTCmix,代码行数:24,代码来源:MSHAKERS.cpp

示例15: loop

/**
 * Main game loop.
 */
static void loop(void)
{
    extern nyancat_t nc;
    gametime_t time;
    int key_ready = 0, ch;

    /* switch to intro mode */
    gamemode_enter(mode_intro);
    gamemode_draw();

    while (gamemode_valid()) {
        /* look for the first to run event */
        time = queue_get_first_time();
        if (time) {
            /* wait for time to run the first event form queue or the first
             * keypress, wichever comes first. */
            key_ready = io_wait_for_key(time);
        } else {
            /* no event queue item found */
            io_wait_for_key(0);
            key_ready = 1;
        }
        if (key_ready > 0) {
            ch = getch();
            /* no redraw call explicite because this should be done bey the
             * key handlers called functions */
            gamemode_key(ch);
        } else {
            /* TODO find a better way for prevening hight cpu usage here. But
             * for now insert a sleep for the minimum ticks used in game */
            usleep(SECOND * TICK(0.1));
            queue_run_until(time);
        }
        doupdate();
    }
}
开发者ID:buharin,项目名称:fastbuild_python,代码行数:39,代码来源:main.c


注:本文中的doupdate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。