本文整理汇总了C++中ROW函数的典型用法代码示例。如果您正苦于以下问题:C++ ROW函数的具体用法?C++ ROW怎么用?C++ ROW使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ROW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
/* move_str returns a string with move m in coordinate notation */
char *move_str(move_bytes m)
{
static char str[6];
char c;
if (m.bits & 32) {
switch (m.promote) {
case KNIGHT:
c = 'n';
break;
case BISHOP:
c = 'b';
break;
case ROOK:
c = 'r';
break;
default:
c = 'q';
break;
}
sprintf(str, "%c%d%c%d%c",
COL(m.from) + 'A',
8 - ROW(m.from),
COL(m.to) + 'A',
8 - ROW(m.to),
c);
}
else
sprintf(str, "%c%d%c%d",
COL(m.from) + 'A',
8 - ROW(m.from),
COL(m.to) + 'A',
8 - ROW(m.to));
return str;
}
示例2: matrix_make
inline
static void matrix_make(uint8_t code)
{
if (!matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] |= 1<<COL(code);
}
}
示例3: block
static
void
block( int el )
{
int i, idx = 0, row, col;
rb->yield();
/* Find first unknown square */
for( i = 0 ; i < 9 && !IS_EMPTY( idx = idx_block( el, i ) ) ; ++i )
;
if( i < 9 )
{
assert( IS_EMPTY( idx ) );
row = ROW( idx );
col = COLUMN( idx );
for( ++i ; i < 9 ; ++i )
{
idx = idx_block( el, i );
if( IS_EMPTY( idx ) )
{
if( ROW( idx ) != row )
row = -1;
if( COLUMN( idx ) != col )
col = -1;
}
}
if( 0 <= row )
exblock( el, row, idx_row );
if( 0 <= col )
exblock( el, col, idx_column );
}
}
示例4: InitMainMenu
//----------------------------------------------------------------------------------------------------
void InitMainMenu(void)
{
InitOsdFrame();
// Set 2bit sub menu select flag,color & Attrib
OSDClear(5, 12, 2, 2, 0xFA, BYTE_ATTRIB);
OSDClear(5, 12, 2, 2, 0x37, BYTE_COLOR);
// Draw ----------- ·Ö¸ô --------------
OSDLine(ROW(3), COL(1), LENGTH(23), 0x5c, BYTE_DISPLAY);
// Set Menu Title color
OSDLine(ROW(4), COL(0), LENGTH(31), 0x40, BYTE_COLOR);
// Draw Main Window
COsdFxDrawWindow(8,0, //WORD usXStart,WORD usYStart,
_MAINMENU_WIDTH * 12 + 8,_MAINMENU_HEIGHT * 18, //WORD usXEnd,WORD usYEnd,
tMainWindowStyle); //BYTE *pStyle)
// Draw Adjust Window
COsdFxDrawWindow(28, 306, //WORD usXStart,WORD usYStart,
288, 372, //WORD usXEnd,WORD usYEnd,
tAdjustWindowStyle); //BYTE *pStyle)
ShowMode();
}
示例5: matrix_scan
uint8_t matrix_scan(void)
{
uint16_t code;
code = serial_recv2();
if (code == -1) {
#ifdef PC98_LED_CONTROL
// Before sending command we have to make sure that there is no unprocessed key in queue
// otherwise keys will be missed during sending command
if (pc98_led) {
pc98_led_set();
pc98_led = 0;
}
#endif
return 0;
}
print_hex8(code); print(" ");
if (code&0x80) {
// break code
if (matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] &= ~(1<<COL(code));
}
} else {
// make code
if (!matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] |= (1<<COL(code));
}
}
return code;
}
示例6: matrix_break
inline
static void matrix_break(uint8_t code)
{
if (matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] &= ~(1<<COL(code));
}
}
示例7: vsync
void vsync(DISPMANX_UPDATE_HANDLE_T u, void* arg)
{
int ret;
DISPMANX_UPDATE_HANDLE_T update;
update = vc_dispmanx_update_start( 10 );
assert( update );
ret = vc_dispmanx_element_change_source( update, element, resource[next_resource]);
assert( ret == 0 );
ret = vc_dispmanx_update_submit_sync( update );
assert( ret == 0 );
if(next_resource != 2) {
int real_next_resource = next_resource ^ 1;
next_resource = 2; // use filler if next callback called before this one ends
// fill image
int n;
for (n=0; n<HEIGHT; n+=2) {
get_packet(ROW(n)+24); // +24 because clock never changes
memcpy(ROW(n+1)+24, ROW(n)+24, 336); // double it up because the hardware scaler
// will introduce blurring between lines
}
// write to resource
ret = vc_dispmanx_resource_write_data( resource[real_next_resource], TYPE, PITCH, image, &image_rect );
assert( ret == 0 );
next_resource = real_next_resource; // queue up next real resource
}
}
示例8: cheeky_refresh_row
/**
* @brief
* Refresh rows row_number AND (row_number + 1) in the usb packet
* that we'll send to the led device. This function is also in charge
* to make the horizontal move and the negative display.
* @param data Our private structure where all params are located.
* @param row_number The first row this function is updating.
* @param decale The number of LED, between 0 and 2, to shift.
*/
static void cheeky_refresh_row(data_t* data,
__u8 row_number,
__u8 decale)
{
unsigned int bitfield;
char char_to_print;
__be32 first_row = 0;
__be32 second_row = 0;
__u8 i;
__s8 hmove;
data->display_packets[row_number].brighness = GET_BRIGHNESS(data->params);
data->display_packets[row_number].row_number = row_number * 2;
/* Updating the usb packet depending on the text buffer */
for (i = 0; i < 8; ++i) {
up(&data->sem_buffer);
char_to_print =
data->buffer[(i + data->start_character) % data->length];
down(&data->sem_buffer);
bitfield = cheeky_get_bitfield(char_to_print);
first_row |= ROW(row_number * 2, bitfield) << (3 * (i + 1));
second_row |= ROW(row_number * 2 + 1, bitfield) << (3 * (i + 1));
}
/* If there is a horizontal move, just shift the bits :) */
hmove = GET_HMOVE(data->params);
if (hmove & LED_RIGHT_TO_LEFT) {
first_row >>= decale;
second_row >>= decale;
}
示例9: matrix_scan
uint8_t matrix_scan(void)
{
is_modified = false;
uint16_t code;
code = serial_recv2();
if (code == -1) {
return 0;
}
dprintf("%02X\n", code);
if (code&0x80) {
// break code
if (matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] &= ~(1<<COL(code));
is_modified = true;
}
} else {
// make code
if (!matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] |= (1<<COL(code));
is_modified = true;
}
}
return code;
}
示例10: MFac6500MenuAdj
void MFac6500MenuAdj(BYTE ucMode)
{
// ucMode : _NEXT or _Prev
BYTE ucNewItem;
if(ucMode==_INC)
{
if(ucOsdState>_MI_FAC_6500_R-1 && ucOsdState<_MI_FAC_6500_B)
ucNewItem=ucOsdState+1;
else
ucNewItem=_MI_FAC_6500;
}
else
{
if(ucOsdState>_MI_FAC_6500_R && ucOsdState<_MI_FAC_6500_B+1)
ucNewItem=ucOsdState-1;
else
ucNewItem=_MI_FAC_6500;
}
// 1. Clear Current Menu
OSDLine(ROW(5),COL(16+(ucOsdState-_MI_FAC_6500_R)*6),LENGTH(6),_MENU_NORMAL_COLOR,BYTE_COLOR);
// 2. Change ucOsdState
ucOsdState = ucNewItem;
// 3. Draw New Item
if(ucOsdState>_MI_FAC_6500_R-1 && ucOsdState<_MI_FAC_6500_B+1)
OSDLine(ROW(5),COL(16+(ucOsdState-_MI_FAC_6500_R)*6),LENGTH(6),_MENU_SECECT_COLOR,BYTE_COLOR);
else
SETCOLOR_FACMAINMENU_SELLINE(5,_MENU_SECECT_COLOR);
}
示例11: EvalQueen
void EvalQueen(S8 sq, S8 side) {
v.gamePhase += 4;
int att = 0;
int mob = 0;
/****************************************************************
* A queen should not be developed too early *
****************************************************************/
if (side == WHITE && ROW(sq) > ROW_2) {
if (isPiece(WHITE, KNIGHT, B1)) v.PositionalThemes[WHITE] -= 2;
if (isPiece(WHITE, BISHOP, C1)) v.PositionalThemes[WHITE] -= 2;
if (isPiece(WHITE, BISHOP, F1)) v.PositionalThemes[WHITE] -= 2;
if (isPiece(WHITE, KNIGHT, G1)) v.PositionalThemes[WHITE] -= 2;
}
if (side == BLACK && ROW(sq) < ROW_7) {
if (isPiece(BLACK, KNIGHT, B8)) v.PositionalThemes[BLACK] -= 2;
if (isPiece(BLACK, BISHOP, C8)) v.PositionalThemes[BLACK] -= 2;
if (isPiece(BLACK, BISHOP, F8)) v.PositionalThemes[BLACK] -= 2;
if (isPiece(BLACK, KNIGHT, G8)) v.PositionalThemes[BLACK] -= 2;
}
/****************************************************************
* Collect data about mobility and king attacks *
****************************************************************/
for (char dir=0;dir<vectors[QUEEN];dir++) {
for (char pos = sq;;) {
pos = pos + vector[QUEEN][dir];
if (! IS_SQ(pos)) break;
if (b.pieces[pos] == PIECE_EMPTY) {
mob++;
if ( e.sqNearK[!side] [b.KingLoc[!side] ] [pos] ) ++att;
}
else if (b.color[pos] != side) {
mob++;
if ( e.sqNearK[!side] [b.KingLoc[!side] ] [pos] ) ++att;
break;
}
else {
break;
}
}
}
v.mgMob[side] += 1 * (mob-14);
v.egMob[side] += 2 * (mob-14);
if (att) {
v.attCnt[side]++;
v.attWeight[side] += 4*att;
}
}
示例12: print
void print(const char *str, int len, int row, int col) {
if (valid_pos(row, col)) {
int i;
int pos = row * WIDTH + col;
for (i = 0; i < len && valid_pos(ROW(pos), COL(pos)); i++, pos++)
print_char(str[i], ROW(pos), COL(pos));
}
}
示例13: EraseFromSOLToCursor
void EraseFromSOLToCursor() {
int i;
for (i = 0; i < COLUMN(TermInfo); i++) {
SCREENCHAR(TermInfo, ROW(TermInfo), i) = ' ';
FORMATCODE(TermInfo, ROW(TermInfo), i) = FORMATCODE(TermInfo, ROW(TermInfo), 0);
}
}
示例14: NewLine
void NewLine() {
if (DOUBLELINE(TermInfo)) {
ROW(TermInfo) = ROW(TermInfo) + 2;
}
else {
ROW(TermInfo)++;
}
}
示例15:
char *ConstructCursorPositionReport() {
char *s = ".[##;##R";
s[2] = (COLUMN(TermInfo)/10) + 48;
s[3] = (COLUMN(TermInfo)%10) + 48;
s[5] = (ROW(TermInfo)/10) + 48;
s[6] = (ROW(TermInfo)%10) + 48;
return s;
}