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


C++ DST函数代码示例

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


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

示例1: stage_scale3x

/**
 * Apply the Scale3x effect on a group of rows. Used internally.
 */
static inline void stage_scale3x(void* dst0, void* dst1, void* dst2, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
	switch (pixel) {
		case 1 : scale3x_8_def(DST(8,0), DST(8,1), DST(8,2), SRC(8,0), SRC(8,1), SRC(8,2), pixel_per_row); break;
		case 2 : scale3x_16_def(DST(16,0), DST(16,1), DST(16,2), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
		case 4 : scale3x_32_def(DST(32,0), DST(32,1), DST(32,2), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
	}
}
开发者ID:havlenapetr,项目名称:Scummvm,代码行数:11,代码来源:scalebit.cpp

示例2: SRC

bool ChessBoard::isLegalMove(int mv)
{
    int sqSrc, sqDst, pcSrc, pcDst;
    sqSrc = SRC(mv);
    sqDst = DST(mv);
    if (sqSrc==sqDst)
    {
        return false;
    }
    pcSrc = m_data[sqSrc];
    pcDst = m_data[sqDst];
    if (side(pcSrc)==side(pcDst))
    {
        return false;
    }

    Moves mvs;
    generateMoves(sqSrc, mvs);
    for(int i=0; i<mvs.count(); i++)
    {
        if (mvs[i]==mv)
        {
            return true;
        }
    }
    return false;
}
开发者ID:longsion,项目名称:ChineseChess,代码行数:27,代码来源:chessboard.cpp

示例3: ClickSquare

// 点击格子事件处理
static void ClickSquare(int sq) {
  int pc;
  Xqwl.hdc = GetDC(Xqwl.hWnd);
  Xqwl.hdcTmp = CreateCompatibleDC(Xqwl.hdc);
  sq = Xqwl.bFlipped ? SQUARE_FLIP(sq) : sq;
  pc = pos.ucpcSquares[sq];

  if ((pc & SIDE_TAG(pos.sdPlayer)) != 0) {
    // 如果点击自己的子,那么直接选中该子
    if (Xqwl.sqSelected != 0) {
      DrawSquare(Xqwl.sqSelected);
    }
    Xqwl.sqSelected = sq;
    DrawSquare(sq, DRAW_SELECTED);
    if (Xqwl.mvLast != 0) {
      DrawSquare(SRC(Xqwl.mvLast));
      DrawSquare(DST(Xqwl.mvLast));
    }
    PlayResWav(IDR_CLICK); // 播放点击的声音

  } else if (Xqwl.sqSelected != 0) {
    // 如果点击的不是自己的子,但有子选中了(一定是自己的子),那么走这个子
    Xqwl.mvLast = MOVE(Xqwl.sqSelected, sq);
    pos.MakeMove(Xqwl.mvLast);
    DrawSquare(Xqwl.sqSelected, DRAW_SELECTED);
    DrawSquare(sq, DRAW_SELECTED);
    Xqwl.sqSelected = 0;
    PlayResWav(pc == 0 ? IDR_MOVE : IDR_CAPTURE); // 播放走子或吃子的声音
  }
  DeleteDC(Xqwl.hdcTmp);
  ReleaseDC(Xqwl.hWnd, Xqwl.hdc);
}
开发者ID:TAstylex,项目名称:xqwlight,代码行数:33,代码来源:XQWL01.CPP

示例4: DrawBoard

// 绘制棋盘
static void DrawBoard(HDC hdc) {
  int x, y, xx, yy, sq, pc;
  HDC hdcTmp;

  // 画棋盘
  hdcTmp = CreateCompatibleDC(hdc);
  SelectObject(hdcTmp, Xqwl.bmpBoard);
  BitBlt(hdc, 0, 0, BOARD_WIDTH, BOARD_HEIGHT, hdcTmp, 0, 0, SRCCOPY);
  // 画棋子
  for (x = FILE_LEFT; x <= FILE_RIGHT; x ++) {
    for (y = RANK_TOP; y <= RANK_BOTTOM; y ++) {
      if (Xqwl.bFlipped) {
        xx = BOARD_EDGE + (FILE_FLIP(x) - FILE_LEFT) * SQUARE_SIZE;
        yy = BOARD_EDGE + (RANK_FLIP(y) - RANK_TOP) * SQUARE_SIZE;
      } else {
        xx = BOARD_EDGE + (x - FILE_LEFT) * SQUARE_SIZE;
        yy = BOARD_EDGE + (y - RANK_TOP) * SQUARE_SIZE;
      }
      sq = COORD_XY(x, y);
      pc = pos.ucpcSquares[sq];
      if (pc != 0) {
        DrawTransBmp(hdc, hdcTmp, xx, yy, Xqwl.bmpPieces[pc]);
      }
      if (sq == Xqwl.sqSelected || sq == SRC(Xqwl.mvLast) || sq == DST(Xqwl.mvLast)) {
        DrawTransBmp(hdc, hdcTmp, xx, yy, Xqwl.bmpSelected);
      }
    }
  }
  DeleteDC(hdcTmp);
}
开发者ID:TAstylex,项目名称:xqwlight,代码行数:31,代码来源:XQWL01.CPP

示例5: call_msg_is_retrans

int
call_msg_is_retrans(sip_msg_t *msg)
{
    sip_msg_t *prev = NULL;
    vector_iter_t it;

    // Get previous message in call with same origin and destination
    it = vector_iterator(msg->call->msgs);
    vector_iterator_set_current(&it, vector_index(msg->call->msgs, msg));
    while ((prev = vector_iterator_prev(&it))) {
        if (!strcmp(SRC(prev), SRC(msg)) && !strcmp(DST(prev), DST(msg)))
            break;
    }

    return (prev && !strcasecmp(msg_get_payload(msg), msg_get_payload(prev)));
}
开发者ID:jungle-boogie,项目名称:sngrep,代码行数:16,代码来源:sip_call.c

示例6: ParseFile

static void ParseFile(const char *szFilePath) {
  int i, mv, mvMirror, nComp;
  PositionStruct pos, posMirror;
  PgnFileStruct pgn;

  if (pgn.Read(szFilePath)) {
    pos = posMirror = pgn.posStart;
    posMirror.Mirror();
    for (i = 0; i < pgn.nMaxMove; i ++) {
      mv = pgn.wmvMoveTable[i + 1];
      mvMirror = MOVE_MIRROR(mv);
      if (pos.zobr.dwLock1 < posMirror.zobr.dwLock1) {
        nComp = -1;
      } else if (pos.zobr.dwLock1 > posMirror.zobr.dwLock1) {
        nComp = 1;
      } else {
        if (pos.zobr.dwLock0 < posMirror.zobr.dwLock0) {
          nComp = -1;
        } else if (pos.zobr.dwLock0 > posMirror.zobr.dwLock0) {
          nComp = 1;
        } else {
          nComp = 0;
        }
      }
      if (nComp <= 0) {
        AddTemp(TempStruct(pos, mv, MoveValue(pos.sdPlayer, pgn.nResult)));
      }
      if (nComp >= 0) {
        AddTemp(TempStruct(posMirror, mvMirror, MoveValue(pos.sdPlayer, pgn.nResult)));
      }
      if (pos.ucpcSquares[DST(mv)] == 0) {
        pos.MakeMove(mv);
      } else {
        pos.MakeMove(mv);
        pos.SetIrrev();
      }
      if (posMirror.ucpcSquares[DST(mvMirror)] == 0) {
        posMirror.MakeMove(mvMirror);
      } else {
        posMirror.MakeMove(mvMirror);
        posMirror.SetIrrev();
      }  
    }  
  }
}
开发者ID:QiuleiWang,项目名称:eleeye,代码行数:45,代码来源:MAKEBOOK.CPP

示例7: SRC

// 搬一步棋的棋子
void PositionStruct::MovePiece(int mv) {
  int sqSrc, sqDst, pc;
  sqSrc = SRC(mv);
  sqDst = DST(mv);
  DelPiece(sqDst);
  pc = ucpcSquares[sqSrc];
  DelPiece(sqSrc);
  AddPiece(sqDst, pc);
}
开发者ID:TAstylex,项目名称:xqwlight,代码行数:10,代码来源:XQWL01.CPP

示例8: SRC

void _PositionStruct::UndoMovePiece(int mv, int pcCaptured) {
  int sqSrc, sqDst, pc;
  sqSrc = SRC(mv);
  sqDst = DST(mv);
  pc = ucpcSquares[sqDst];
  DelPiece(sqDst, pc);
  AddPiece(sqSrc, pc);
  if (pcCaptured != 0) {
    AddPiece(sqDst, pcCaptured);
  }
}
开发者ID:davidatondemandworld,项目名称:Something,代码行数:11,代码来源:XQWLight_Referee.cpp

示例9: main

int main()
{
	int i, j, k, L;
	double ***F, *f, *temp;
	k = 0;
	L = 3;
	temp = (double *) malloc(L*sizeof(double));
	F = (double ***) malloc(L*sizeof(double**));
	f = (double *) malloc(L*L*L*sizeof(double));
	for(i=0;i<L;i++)
	{
		F[i] = (double **) malloc(L*sizeof(double*));
		for(j=0;j<L;j++,k=k+L)
		{
			F[i][j] = f + k;
		}
	}

	for(i=0;i<L;i++)
	{
		for(j=0;j<L;j++)
		{
			for(k=0;k<L;k++)
			{
				F[i][j][k] = i + j + k;
			}
		}
	}
	
	Print_Tensor(F, L);
	for(k=0;k<L;k++) 
	{
		for(j=0;j<L;j++)
		{
			for(i=0;i<L;i++)
			{
				temp[i] = F[i][j][k];
			}
			DST(temp, L);
			for(i=0;i<L;i++)
			{
				F[i][j][k] = temp[i];
			}
		}
	}

	Print_Tensor(F, L);

	
	return 0;
	
}
开发者ID:xflying777,项目名称:Fast_Computing,代码行数:52,代码来源:test.cpp

示例10: display_map_marks

void display_map_marks(){
	actor *me;
	float x,y,z;
	int i,ax,ay;
	float dx = (TILESIZE_X / 6);
	float dy = (TILESIZE_Y / 6);
	float fr = mark_z_rot/360;
	float j,ff=0;

	me = get_our_actor();
	if(!me) return;
	ax = me->x_pos;
	ay = me->y_pos;
	
	glDisable(GL_TEXTURE_2D);
	glDisable(GL_LIGHTING);
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE);
	glEnable(GL_ALPHA_TEST);	

	for(i=0;i<max_mark;i++){
		x=marks[i].x/2.0;
		y=marks[i].y/2.0;
		x += (TILESIZE_X / 2);
		y += (TILESIZE_Y / 2);
		if(DST(ax,ay,x,y)>MARK_DIST||marks[i].x<0||!marks_3d) continue;
		z = get_tile_height(marks[i].x, marks[i].y);
		for(j=z-fr/5,ff=1;j<z+2;j+=0.1,ff=(2-(j-z))/2) {
			if(marks[i].server_side) glColor4f(0.0f, 0.0f, 1.0f, 0.9f-(j-z)/3);
			else glColor4f((float)marks[i].r/255, (float)marks[i].g/255, (float)marks[i].b/255, 0.7f-(j-z)/3);
			glBegin(GL_QUADS);
				glVertex3f(x-dx*ff,y-dy*ff,j);
				glVertex3f(x-dx*ff,y+dy*ff,j);
				glVertex3f(x+dx*ff,y+dy*ff,j);
				glVertex3f(x+dx*ff,y-dy*ff,j);
			glEnd();
		}
		
	}
	
	glDisable(GL_ALPHA_TEST);
	//glEnable(GL_LIGHTING);
	glDisable(GL_BLEND);
	glEnable(GL_TEXTURE_2D);
	
}
开发者ID:raduprv,项目名称:Eternal-Lands,代码行数:46,代码来源:map.c

示例11: MoveStable

// 检测下一个着法是否稳定,有助于减少置换表的不稳定性
inline bool MoveStable(PositionStruct &pos, int mv) {
  // 判断下一个着法是否稳定的依据是:
  // 1. 没有后续着法,则假定是稳定的;
  if (mv == 0) {
    return true;
  }
  // 2. 吃子着法是稳定的;
  __ASSERT(pos.LegalMove(mv));
  if (pos.ucpcSquares[DST(mv)] != 0) {
    return true;
  }
  // 3. 可能因置换表引起路线迁移,使得路线超过"MAX_MOVE_NUM",此时应立刻终止路线,并假定是稳定的。
  if (!pos.MakeMove(mv)) {
    return true;
  }
  return false;
}
开发者ID:StevenLOL,项目名称:ChessQ,代码行数:18,代码来源:hash.cpp

示例12: executeRQST

void FORTE_ST_SET_PARM::executeRQST(void){
  forte::core::SManagementCMD theCommand;
  theCommand.mDestination = CStringDictionary::getInstance().getId(DST().getValue());
  theCommand.mFirstParam.pushBack(CStringDictionary::getInstance().getId(ELEM_NAME().getValue()));
  theCommand.mFirstParam.pushBack(CStringDictionary::getInstance().getId(ELEM_DATA_IN().getValue()));
  theCommand.mAdditionalParams = PARM_VAL().getValue();
  theCommand.mCMD = cg_nMGM_CMD_Write;
  
  EMGMResponse resp = m_poDevice.executeMGMCommand(theCommand);

  //calculate return value
  CIEC_STRING retVal(DEV_MGR::scm_sMGMResponseTexts[resp]);
  CIEC_STRING compareVal(DEV_MGR::scm_sMGMResponseTexts[e_RDY]);
  QO() = retVal == compareVal;

  DEVLOG_DEBUG("%s\n", DEV_MGR::scm_sMGMResponseTexts[resp]); 
  STATUS() = (DEV_MGR::scm_sMGMResponseTexts[resp]);
  
}
开发者ID:EstebanQuerol,项目名称:Black_FORTE,代码行数:19,代码来源:ST_SET_PARM.cpp

示例13: executeRQST

void FORTE_ST_CREATE_CONN::executeRQST(void){
  forte::core::SManagementCMD theCommand;
  
  theCommand.mDestination = CStringDictionary::getInstance().getId(DST().getValue());
  theCommand.mFirstParam.pushBack(CStringDictionary::getInstance().getId(SRC_FB().getValue()));
  theCommand.mFirstParam.pushBack(CStringDictionary::getInstance().getId(SRC_FB_OUT().getValue()));
  theCommand.mSecondParam.pushBack(CStringDictionary::getInstance().getId(DST_FB().getValue()));
  theCommand.mSecondParam.pushBack(CStringDictionary::getInstance().getId(DST_FB_IN().getValue()));
  theCommand.mCMD = cg_nMGM_CMD_Create_Connection;
  
  EMGMResponse resp = m_poDevice.executeMGMCommand(theCommand);

  //calculate return value
  CIEC_STRING retVal(DEV_MGR::scm_sMGMResponseTexts[resp]);
  CIEC_STRING compareVal(DEV_MGR::scm_sMGMResponseTexts[e_RDY]);
  QO() = retVal == compareVal;

  DEVLOG_DEBUG("%s\n", DEV_MGR::scm_sMGMResponseTexts[resp]);
  STATUS() = (DEV_MGR::scm_sMGMResponseTexts[resp]);
}
开发者ID:EstebanQuerol,项目名称:Black_FORTE,代码行数:20,代码来源:ST_CREATE_CONN.cpp

示例14: yuv2rgb_c_32

static void __fastcall yuv2rgb_c_32 (u8 * py_1, u8 * py_2,
			  u8 * pu, u8 * pv,
			  void * _dst_1, void * _dst_2, int width)
{
    int U, V, Y;
    u32 * r, * g, * b;
    u32 * dst_1, * dst_2;

    width >>= 3;
    dst_1 = (u32 *) _dst_1;
    dst_2 = (u32 *) _dst_2;

    do {
		_RGB (u32, 0);
		DST (py_1, dst_1, 0);
		DST (py_2, dst_2, 0);

		_RGB (u32, 1);
		DST (py_2, dst_2, 1);
		DST (py_1, dst_1, 1);

		_RGB (u32, 2);
		DST (py_1, dst_1, 2);
		DST (py_2, dst_2, 2);

		_RGB (u32, 3);
		DST (py_2, dst_2, 3);
		DST (py_1, dst_1, 3);

		pu += 4;
		pv += 4;
		py_1 += 8;
		py_2 += 8;
		dst_1 += 8;
		dst_2 += 8;
    } while (--width);
}
开发者ID:mfitz21,项目名称:pcsx2-rr,代码行数:37,代码来源:yuv2rgb.cpp

示例15: dbm_cppPrintDiff

/* Similar to print but do it twice and mark
 * the difference between the DBMs.
 */
std::ostream& dbm_cppPrintDiff(std::ostream& out,
                               const raw_t *src, const raw_t *dst, cindex_t dim)
{
    cindex_t i,j;
    assert(src && dst);

    out << "DBM diff " << dim << 'x' << dim << ":\n";

    for (i = 0; i < dim; ++i)
    {
        raw_t diff = SRC(i,0) ^ DST(i,0);
        PRE_DIFF();
        dbm_cppPrintRaw(out, SRC(i,0));
        POST_DIFF();
        for (j = 1; j < dim; ++j)
        {
            out << '\t';
            diff = SRC(i,j) ^ DST(i,j);
            PRE_DIFF();
            dbm_cppPrintRaw(out, SRC(i,j));
            POST_DIFF();
        }
        out << '\n';
    }

    out << '\n';
    for (i = 0; i < dim; ++i)
    {
        raw_t diff = SRC(i,0) ^ DST(i,0);
        PRE_DIFF();
        dbm_cppPrintRaw(out, DST(i,0));
        POST_DIFF();
        for (j = 1; j < dim; ++j)
        {
            out << '\t';
            diff = SRC(i,j) ^ DST(i,j);
            PRE_DIFF();
            dbm_cppPrintRaw(out, DST(i,j));
            POST_DIFF();
        }
        out << '\n';
    }

    return out;
}
开发者ID:RCambier,项目名称:EmbeddedAndVerification,代码行数:48,代码来源:print.cpp


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