コード例 #1
0
ファイル: draw.c プロジェクト: williamiced/SocketTetris
void drawboard(int pl)
{
	int x = board_x(pl, 0);
	int i;
	char tmp[30];
	if (_HEIGHT_24L) {
		//i = x+5;
		//setwcurs(0, i, 0);
		if (!_MONOCHROME) {
			setcolorpair(BOARD_FRAME_COLOR);
			setattr_bold();
		}
		//i = x-5;
		//setwcurs(0, i, 0);
		//sprintf(tmp, "lqNk\\x Nx\\| N|");
		//drawstr(tmp, 8, i, 0);

		i = x+5;
		setwcurs(0, i, 0);
		drawstr("lqNk\\x Nx\\2|_N|", 8, i, 0);

		setcolorpair(BOARD_FRAME_COLOR);
		setcurs(x, 3);
		printstr("_____");
		movefwd(10);
		printstr("_____");
		i = 4;
	} else
		i = 0;
	x--;
	setwcurs(0, x, i);
	setcolorpair(BOARD_FRAME_COLOR);
	for (i = 0; i < 20; i++) {
		putch(VLINE);
		movefwd(20);
		putch(VLINE);
		if (i < 19)
			newln(x);
	}
	if (term_height > 20 && term_height != 24) {
		newln(x);
		printstr_acs("m*Nj", 20);
	} else {
		setcurs(0, term_height-2);
		newln(0);
	}
#ifdef TWOPLAYER
	board_bottom_color[pl-1] = BOARD_FRAME_COLOR;
#endif
}
コード例 #2
0
ファイル: menucore.c プロジェクト: gsrr/Python
void printmenuitem(const char *name, int sel)
{
#if !NO_MENU
	if (*name == '-') {
		putch(' ');
		if (!name[1])
			putnchars('-', 16);
		else
			printstr(name);
		return;
	}
#endif
	if (!sel)
		setcolorpair(MAGENTA_FG);
	else if (!_MONOCHROME)
		setcolorpair(WHITE_ON_BLUE);
	else
		setattr_standout();
	if (sel && (textgfx_flags & TT_MONO)==TT_BLOCKS) {
		while (*name==' ') {
			putch(' ');
			name++;
		}
		putch('*');
	} else
		putch(' ');
	printstr(name);
	putch(' ');
	setattr_normal();
	movefwd(1);
}
コード例 #3
0
ファイル: fmemmove.c プロジェクト: ArmstrongJ/open-watcom-v2
_WCRTLINK void _WCFAR *_fmemmove( void _WCFAR *t, const void _WCFAR *f, size_t len )
{
    char _WCFAR *to = t;
    const char _WCFAR *from = f;
    if( from == to ) {
        return( to );
    }
    if( from < to  &&  from + len > to ) {  /* if buffers are overlapped*/
#if defined(__HUGE__) || defined(__386__)
        to += len;
        from += len;
        while( len != 0 ) {
            to--;
            from--;
            *to = *from;
            len--;
        }
#else
        movebwd( ( to + len ) - 1, ( from + len ) - 1, len );
#endif
    } else {
        movefwd( to, from, len );
    }
    return( to );
}
コード例 #4
0
ファイル: gameover.c プロジェクト: williamiced/SocketTetris
static int hiscore_entername_menu(char *name, const char **menu, int x, int y)
{
	int pos = 0;
	int i = 0;
	int k;
	while (1) {
		drawmenu(menu, 2, i-2, x, y+2, NULL);
textbox:	setcurs(x, y);
		printtextbox(name, pos);
		movefwd(3);
		printsavebutton(!i && pos==7);
		if (!i)
			x += pos;
		setcurs(x, y+i);
		refreshwin(-1);
		autorep_a_b_btns = 1;
		k = getkeypress_block(SINGLE_PL) & 0xFF;
		autorep_a_b_btns = 0;
		if (k == ESC)
			return 0;
		if (!i) {
			x -= pos;
			switch (k) {
			case STARTBTN:
				return 1;
			case '\t':
				if (pos < 7)
					break;
			case MVDOWN:
				i = 2;
				continue;
			}
			pos = hiscore_editname(name, pos, k);
			goto textbox;
		}
		switch (k) {
		case STARTBTN:
		case A_BTN:
			if (i==2)
				return 2;
		case 'q':
			exit(0);
		case MVUP:
			i = i==2 ? 0 : 2;
			break;
		case '\t':
			i = i==2 ? 3 : 0;
			break;
		case MVDOWN:
			if (i < 3)
				i++;
		}
		if (!i && pos==7) {
			pos = 6;
			while (pos && name[pos-1]==' ')
				pos--;
		}
	}
}
コード例 #5
0
ファイル: draw.c プロジェクト: williamiced/SocketTetris
int draw_vline(int x, int y, int h)
{
	if (is_outside_screen(x+1, 0))
		return 0;
	movefwd(x);
	while (--h) {
		putch(VLINE);
		newln(x);
	}
	putch(VLINE);
	return 1;
}
コード例 #6
0
ファイル: draw.c プロジェクト: williamiced/SocketTetris
void drawbl(int bl, int clr, int x, int y)
{
	int c, i;
	setblockcolor(clr%10);
	i = clr<10 || textgfx_flags & (TT_BLOCKS | TT_BLOCKS_BG |
				       BLACK_BRACKETS);
	c = block_chars[i];
	while (bl) {
		setcurs(x, y);
		i = 1;
		do {
			if (!(bl & i))
				movefwd(2);
			else {
				putch(block_chars[0]);
				putch(c);
			}
		} while (bl & 16-(i <<= 1));
		bl >>= 4;
		y++;
	}
}