梭.哈游戏王有比赛吗比赛?有什么?

Township有哪些游戏心得和攻略? - 知乎292被浏览139541分享邀请回答8454 条评论分享收藏感谢收起3231 条评论分享收藏感谢收起查看更多回答梭​哈游戏源码&C++
&在游戏开发行业我们有时为寻找一个游戏代码翻遍所有网站资源,但是都没能找到自己需要,对此我们论坛针对这一问题,为大家提供了一个源码论坛分享交流地,只要您在论坛上提了问题,我们的程序员都会第一时间为你解答,希望能解你的燃眉之急。文章最后由您需要的链接地址。
/////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "ClientView.h"
#include "ClientGameDlg.h"
#include &"..\..\..\lib\客户端主库\face.h" // add
BEGIN_MESSAGE_MAP(CClientPlayView, CUsingSkinClass)
ON_WM_CREATE()
ON_WM_PAINT() // add by lhy
ON_WM_SIZE() // add by lhy
ON_BN_CLICKED(IDC_BEGIN,OnHitBegin)&
ON_BN_CLICKED(IDC_CONTINUE,
OnHitContinue)&
ON_BN_CLICKED(IDC_SHUTTLE,OnHitShuttle)
ON_BN_CLICKED(IDC_FOLLOW,OnHitFollow)
ON_BN_CLICKED(IDC_NOTADD,OnHitNotAdd)
ON_BN_CLICKED(IDC_100NOTE,OnHit100Note)
ON_BN_CLICKED(IDC_200NOTE,OnHit200Note)
ON_BN_CLICKED(IDC_400NOTE,OnHit400Note)
ON_BN_CLICKED(IDC_GIVEUP,OnHitGiveUp)
END_MESSAGE_MAP()
//构造函数
CClientPlayView::CClientPlayView(void)
:m_GameSet(this),m_GameInfo(this)//,m_GameEndView(this)
m_PicGameView.SetLoadInfo("pic\\suoha\\bg3.gif",CGameImageLink::m_bAutoLock);
m_PicGameViewLogo.SetLoadInfo("pic\\suoha\\bgSH.jpg",CGameImageLink::m_bAutoLock);
// add by lhy
if (GetSystemMetrics(SM_CXSCREEN)&=1024)
m_PicGameView.SetLoadInfo("pic\\suoha\\bgSH.jpg", true);
m_PicGameView.SetLoadInfo("pic\\suoha\\bgSH.jpg", true);
m_lpDDSSource_GameView = NULL;
m_lpDDSWindow = NULL;
g_DDControl.LoadDDBitmap(
CBitmap::FromHandle((HBITMAP)m_PicGameView),
&m_lpDDSSource_GameView);
int nSysWidth &=
GetSystemMetrics(SM_CXSCREEN); //得到宽
int nSysHeight = GetSystemMetrics(SM_CYSCREEN); //得到高
if ( FALSE == g_DDControl.CreateSecondarySurface( nSysWidth ,
nSysHeight , &m_lpDDSWindow))
AfxMessageBox("生成CClientPlayView::OnCreate()的离屏表面失败!");
//add by lhy
m_PicTimer1.SetLoadInfo("pic\\time.gif",
&true); // 计时器
m_PicAgree1.SetLoadInfo("pic\\agree.gif", true);
//add by lhy
m_picMe.SetLoadInfo("pic\\suoha\\me.jpg",
&true); // 计时器
m_picOther.SetLoadInfo("pic\\suoha\\other.jpg", true);
m_picNote.SetLoadInfo("pic\\suoha\\notesmall.gif",
// end &add &by
for (int i=0;i
m_UserCase[i]=BUTTON_TYPE_NONE;
m_CardShape[i]=0;
m_iShowStation=-1;
m_iNtStation=-1;
//析构函数
CClientPlayView::~CClientPlayView(void)
OutputDebugString("~CClientPlayView begin\n");
DD_RELEASE(m_lpDDSSource_GameView);
DD_RELEASE(m_lpDDSWindow);
OutputDebugString("~CClientPlayView end\n");
//更新用户资料
void CClientPlayView::UpdateUserInfo(BYTE bViewStation)
UpdateViewFace(NULL);
//绘画界面函数
void CClientPlayView::DrawViewFace(CDC * pDC, int iWidth, int
//add by lhy
if (iWidth &= 0 || iHeight &= 0)
// end of add &lhy
int nLogoW
int nLogoH
if ( TRUE == g_DDControl.GetWidthHeight(
m_lpDDSSource_GameView, nLogoWidth, nLogoHeight))
GetClientRect(&rc); //取得客户区域
g_DDControl.StretchBlt(m_lpDDSWindow,0,0,iWidth,iHeight,m_lpDDSSource_GameView);//2007.11
//绘画用户
// modified by lhy
m_lpDDSWindow-&GetDC(&hDC);
SetTextColor(hDC, RGB(0,0,0));
m_lpDDSWindow-&ReleaseDC(hDC);
// end modified by lhy
CardShare[9]={"散牌","对子","两对","三条","顺子","同花","葫芦","铁支","同花顺"};
for (int i=0;i& PLAY_COUNT;i++)
if (m_pUserItem[i]!=NULL)
UserInfoStruct *
pUserInfo=&m_pUserItem[i]-&GameUserI //用户信息
//HDC hDC;
//m_lpDDSWindow-&GetDC(&hDC);
if ( i == 2)
CGameImageHelper ImageHandleMe(&m_picMe);
IDirectDrawSurface* m_lpFrameMe = NULL;
g_DDControl.LoadDDBitmap( ImageHandleMe.GetBitmap() ,
&m_lpFrameMe);
g_DDControl.StretchImage(m_lpDDSWindow,m_ptFrame[2].x,
m_ptFrame[2].y,300, 186,
m_lpFrameMe,0,0,300,186,RGB(0,0,0));
DD_RELEASE(m_lpFrameMe);
CGameImageHelper ImageHandleOther(&m_picOther);
IDirectDrawSurface* m_lpFrameOther = NULL;
g_DDControl.LoadDDBitmap( ImageHandleOther.GetBitmap() ,
&m_lpFrameOther);
g_DDControl.StretchImage(m_lpDDSWindow,m_ptFrame[i].x,
m_ptFrame[i].y,169, 187,
m_lpFrameOther,0,0,169,187,RGB(0,0,0));
DD_RELEASE(m_lpFrameOther);
//m_lpDDSWindow-&ReleaseDC(hDC);
// modified by lhy
m_lpDDSWindow-&GetDC(&hDC);
SetTextColor(hDC, RGB(255,255,255));
SetBkMode(hDC,TRANSPARENT); //设置文字背景色
TextOut( hDC,
m_PtName[i].x,m_PtName[i].y,pUserInfo-&szName, strlen
((char*)pUserInfo-&szName));&
m_lpDDSWindow-&ReleaseDC(hDC);
CString tml_out_str="";
if (m_UserCase[i]==BUTTON_TYPE_GIVEUP)&
tml_out_str+="【放弃】";
else if (m_UserCase[i]==BUTTON_TYPE_SHUHA)
tml_out_str+="【梭哈】";
m_lpDDSWindow-&GetDC(&hDC);
SetBkMode(hDC,TRANSPARENT); //设置文字背景色&
SetTextColor(hDC, RGB(255,255,255));
TextOut(hDC,m_PtLogo[i].x-5,m_PtLogo[i].y-25,tml_out_str,
strlen (tml_out_str));
m_lpDDSWindow-&ReleaseDC(hDC);
char szBuffer[50];
sprintf(szBuffer,"%d ",m_iUserNote[i]);
m_lpDDSWindow-&GetDC(&hDC);
SetTextColor(hDC, RGB(255,255,255));
SetBkMode(hDC,TRANSPARENT); //设置文字背景色
TextOut(hDC,m_ptNoteText[i].x,m_ptNoteText[i].y,szBuffer,strlen
(szBuffer));
m_lpDDSWindow-&ReleaseDC(hDC);
tml_out_str = "";
if (m_CardShape[i]&0)
//pDC-&TextOut(m_PtTime[i].x,m_PtTime[i].y+30,CardShare[m_CardShape[i]-1]);//显示牌型
tml_out_str += _T(CardShare[m_CardShape[i]-1]);
m_lpDDSWindow-&GetDC(&hDC);
SetTextColor(hDC, RGB(255,255,255));
SetBkMode(hDC,TRANSPARENT); //设置文字背景色
TextOut(hDC,m_PtTime[i].x,m_PtTime[i].y+30,tml_out_str, strlen
(tml_out_str));
m_lpDDSWindow-&ReleaseDC(hDC);
DrawNote();
// modified by lhy
IDirectDrawSurface* m_lpDDSLogoImage = NULL;
CGameImageHelper
LogoHandle(CGameLogoRes::GetLogoImage(m_pUserItem[i]-&GameUserInfo.bLogoID,&
pUserInfo-&bUserState==USER_CUT_GAME) );
g_DDControl.LoadDDBitmap( LogoHandle.GetBitmap() ,
&m_lpDDSLogoImage);
g_DDControl.StretchImage(m_lpDDSWindow, m_PtLogo[i].x,
m_PtLogo[i].y ,LOGO_WIDTH, LOGO_HEIGHT, m_lpDDSLogoImage,
0,0,LOGO_WIDTH,LOGO_HEIGHT, CGameLogoRes::GetBackColor());
//绘画箭头
DD_RELEASE(m_lpDDSLogoImage);
// end modified by lhy
(m_uTime[i]!=0)&
//以下为绘制时间
if ((m_uTime[i] != 0L)&&(m_uTime[i] & 100L))
UINT uFirst=m_uTime[i]/10L;
UINT uLast=m_uTime[i];
CGameImageHelper ImageHandle(&m_PicTimer1);
IDirectDrawSurface* m_lpDDSTimeImage = NULL;
g_DDControl.LoadDDBitmap( ImageHandle.GetBitmap() ,
&m_lpDDSTimeImage);
g_DDControl.StretchImage(m_lpDDSWindow,m_PtTime[i].x,m_PtTime[i].y,TIME_WIDTH/2,
TIME_HEIGHT,
m_lpDDSTimeImage,uFirst*TIME_WIDTH/2,0,TIME_WIDTH/2,TIME_HEIGHT,RGB(0,0,0));
g_DDControl.StretchImage(m_lpDDSWindow, m_PtTime[i].x+15,
m_PtTime[i].y, TIME_WIDTH/2, TIME_HEIGHT,
m_lpDDSTimeImage,uLast*TIME_WIDTH/2,0, TIME_WIDTH/2,
TIME_HEIGHT, RGB(0,0,0));
DD_RELEASE(m_lpDDSTimeImage);
// end modified by lhy
//if (pUserInfo-&bUserState==USER_ARGEE)
DrawArgeeFlag(pDC,m_PtAgree[i].x,m_PtAgree[i].y);
(pUserInfo-&bUserState==USER_ARGEE)&
// modified by lhy
//CGameImageHelper ImageHandle(&m_PicAgree);
IDirectDrawSurface* m_lpDDSSource_PicAgree = NULL;
g_DDControl.LoadDDBitmap(
CBitmap::FromHandle((HBITMAP)m_PicAgree1),
&m_lpDDSSource_PicAgree);
g_DDControl.StretchImage(m_lpDDSWindow,m_PtAgree[i].x,m_PtAgree[i].y,AGREE_WIDTH,AGREE_HEIGHT,
m_lpDDSSource_PicAgree,0,0,AGREE_WIDTH,AGREE_HEIGHT,RGB(0,0,0));
DD_RELEASE(m_lpDDSSource_PicAgree);
// end modified by lhy
////////////////////////////////
//绘画下面的信息(在游戏中的左下方)
if (m_StationView.m_bShowMessage)
int y=630;
//绘画信息
TCHAR szBuffer[50]; &//if
(m_iLessPlay!=-1)
//sprintf(szBuffer,TEXT("%d
(最少回合=%d)"),m_StationView.m_iPlayCount,m_StationView.m_iLessPlay);
sprintf(szBuffer,TEXT("已打局数:%d"),m_StationView.m_iPlayCount);
//pDC-&TextOut(10,y,szBuffer,lstrlen(szBuffer));
m_lpDDSWindow-&GetDC(&hDC);
SetTextColor(hDC,RGB(255,255,255));
SetBkMode(hDC,TRANSPARENT); //设置文字背景色
TextOut(hDC,10,y,szBuffer,strlen (szBuffer));
m_lpDDSWindow-&ReleaseDC(hDC);
// pDC-&TextOut(10, 15+y,"底注每人100注,100注=1币"); // 总注数
m_lpDDSWindow-&GetDC(&hDC);
SetTextColor(hDC, RGB(255,255,255));
SetBkMode(hDC,TRANSPARENT); //设置文字背景色
TextOut(hDC,10,15+y,_T("底注每人100注"),strlen ("底注每人100注"));
m_lpDDSWindow-&ReleaseDC(hDC);
if (m_StationView.m_bIsModify)
sprintf(szBuffer,"总注:%d 注",m_StationView.m_iTotalNote); //
//pDC-&TextOut(10, 30+y,szBuffer,lstrlen(szBuffer)); //
&m_lpDDSWindow-&GetDC(&hDC);
SetTextColor(hDC,RGB(255,255,255));
SetBkMode(hDC,TRANSPARENT); //设置文字背景色
TextOut(hDC,10,30+y,szBuffer,strlen (szBuffer));
m_lpDDSWindow-&ReleaseDC(hDC);
//// pDC-&TextOut(160,y,TEXT("用户名:"));
// & m_lpDDSWindow-&GetDC(&hDC);
//SetTextColor(hDC,RGB(255,255,255));
//SetBkMode(hDC,TRANSPARENT); //设置文字背景色
//TextOut(hDC,160,y,_T("用户名:"),strlen ("用户名:"));
//m_lpDDSWindow-&ReleaseDC(hDC);
//// pDC-&TextOut(160,15+y,TEXT("底注:"));
// & m_lpDDSWindow-&GetDC(&hDC);
//SetTextColor(hDC,RGB(255,255,255));
//SetBkMode(hDC,TRANSPARENT); //设置文字背景色
//TextOut(hDC,160,15+y,_T("底注:"),strlen ("底注:"));
//m_lpDDSWindow-&ReleaseDC(hDC);
//// pDC-&TextOut(160,30+y,TEXT("下注:"));
// & m_lpDDSWindow-&GetDC(&hDC);
//SetTextColor(hDC,RGB(255,255,255));
//SetBkMode(hDC,TRANSPARENT); //设置文字背景色
//TextOut(hDC,160,30+y,_T("下注:"),strlen ("下注:"));
//m_lpDDSWindow-&ReleaseDC(hDC);
// static int d= 0;
// for (int i=0;i& PLAY_COUNT ;i++) //
遍历所有用户输入用户的名字,注到StationView 区域显示
// if (strlen(m_StationView.m_szUserName[i]) & 0)
// if (m_StationView.m_iCurNote == i)//当前下注者信息用红色字体标注
// //pDC-&SetTextColor(RGB(255,0,0));
// m_lpDDSWindow-&GetDC(&hDC);
// SetTextColor(hDC, RGB(255,0,0));
// m_lpDDSWindow-&ReleaseDC(hDC);
// //pDC-&SetTextColor(RGB(255,255,255));
&m_lpDDSWindow-&GetDC(&hDC);
// SetTextColor(hDC, RGB(255,255,255));
// m_lpDDSWindow-&ReleaseDC(hDC);
// sprintf(szBuffer,"%s ",m_StationView.m_szUserName[i]);
// //pDC-&TextOut(212+ d*
64,y,szBuffer,lstrlen(szBuffer));// 64 是 左右间隔。
// m_lpDDSWindow-&GetDC(&hDC);
// SetTextColor(hDC, RGB(255,255,255));
// SetBkMode(hDC,TRANSPARENT); //设置文字背景色
// TextOut(hDC,212+ d* 64,y,szBuffer,strlen (szBuffer));
// m_lpDDSWindow-&ReleaseDC(hDC);
// //pDC-&TextOut(212+ d* 64,15+y,"100注");
// m_lpDDSWindow-&GetDC(&hDC);
// SetTextColor(hDC, RGB(255,255,255));
// SetBkMode(hDC,TRANSPARENT); //设置文字背景色
// TextOut(hDC,212+ d* 64,15+y,_T("100注"),strlen
("100注"));
// m_lpDDSWindow-&ReleaseDC(hDC);
// sprintf(szBuffer,"d注 ",m_StationView.m_iUserNote[i]);
//// pDC-&TextOut(212+ d*
64,30+y,szBuffer,lstrlen(szBuffer));
// m_lpDDSWindow-&GetDC(&hDC);
// SetTextColor(hDC, RGB(255,255,255));
// SetBkMode(hDC,TRANSPARENT); //设置文字背景色
// TextOut(hDC,212+ d* 64,30+y,szBuffer,strlen
(szBuffer));
// m_lpDDSWindow-&ReleaseDC(hDC);
// d= 0; // 空。。控制图片的XY坐标
////////////////////////////////
//建立消息
int CClientPlayView::OnCreate(LPCREATESTRUCT
lpCreateStruct)&
if (CUsingSkinClass::OnCreate(lpCreateStruct) == -1)
return -1;
// 发牌界面
m_GameBeginFapai.Create(NULL,NULL,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,CRect(0,0,0,0),this,15,NULL);
// add by lhy
m_GameFirstFapai.Create(NULL,NULL,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,CRect(0,0,0,0),this,15,NULL);
//end of add by lhy&
//建立控件
//AfxSetResourceHandle(GetModuleHandle(CLIENT_DLL_NAME));
m_StationView.Create(this,100);
m_btContinue.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,80,25),this,IDC_CONTINUE);
m_btContinue.LoadButtonBitmap("pic\\suoha\\ddzks.jpg",false);
m_btShuttle.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,25,25),this,IDC_SHUTTLE);
&m_btShuttle.LoadButtonBitmap("pic\\suoha\\sl.jpg",false);
m_btFollow.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,25,25),this,IDC_FOLLOW);
m_btFollow.LoadButtonBitmap("pic\\suoha\\gen.jpg",false);
m_btNotAdd.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,25,25),this,IDC_NOTADD);
m_btNotAdd.LoadButtonBitmap("pic\\suoha\\NotAdd.jpg",false);
m_bt100Note.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,25,25),this,IDC_100NOTE);
m_bt100Note.LoadButtonBitmap("pic\\suoha\\100.jpg",false);
m_bt200Note.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,25,25),this,IDC_200NOTE);
m_bt200Note.LoadButtonBitmap("pic\\suoha\\200.jpg",false);
m_bt400Note.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,25,25),this,IDC_400NOTE);
m_bt400Note.LoadButtonBitmap("pic\\suoha\\400.jpg",false);
m_btGiveUp.Create(TEXT(""),WS_CHILD|WS_CLIPSIBLINGS|BS_OWNERDRAW,CRect(0,0,25,25),this,IDC_GIVEUP);
m_btGiveUp.LoadButtonBitmap("pic\\suoha\\giveup.jpg",false);
m_GameNoteView.Create(NULL,NULL,WS_CHILD|WS_CLIPSIBLINGS,CRect(0,0,0,0),this,50,NULL);
m_GameNoteView.AutoSize();
///m_btBackCard.LoadButtonBitmap(GetModuleHandle(CLIENT_DLL_NAME),IDB_BUTTON_BACKCARD,false);
//m_btLastTurn.LoadButtonBitmap(GetModuleHandle(CLIENT_DLL_NAME),IDB_BUTTON_LASTTURN,false);
//m_btStop.EnableWindow(true);
//移动位置
m_btShuttle.SetFont(&CGameImageLink::m_HFont);
m_btFollow.SetFont(&CGameImageLink::m_HFont);
m_btNotAdd.SetFont(&CGameImageLink::m_HFont);
m_bt100Note.SetFont(&CGameImageLink::m_HFont);
m_bt200Note.SetFont(&CGameImageLink::m_HFont);
m_bt400Note.SetFont(&CGameImageLink::m_HFont);
m_btGiveUp.SetFont(&CGameImageLink::m_HFont);
//建立客户扑克
for (int i=0;i
m_UserCard[i].Create(NULL,NULL,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,CRect(0,0,0,0),this,20+i,NULL);
m_UserCard[i].InitGameCard(GetParent());
m_UserCard[i].SetShowCard(true);
//m_MeCard.Create(NULL,NULL,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,CRect(0,0,0,0),this,25,NULL);
//m_MeCard.InitGameCard(GetParent());
//m_MeBackCard.Create(NULL,NULL,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,CRect(0,0,0,0),this,26,NULL);
//m_MeBackCard.InitGameCard(GetParent());
//m_MeBackCard.SetShowCard(false);
//m_MeBackCard.SetUseMouse(false);
//m_MeBackCard.ShowWindow(SW_HIDE);
//载入资源
//m_btOutCard.SetFont(&CGameImageLink::m_HFont);
//m_btGiveBack.SetFont(&CGameImageLink::m_HFont);
//m_btContinue.SetFont(&CGameImageLink::m_HFont);
//m_btPass.SetFont(&CGameImageLink::m_HFont);
//AfxSetResourceHandle(GetModuleHandle(NULL));
//m_MeCard.SetCard(b,NULL,5);
void CClientPlayView::FixControlSize(int cx,int cy)
if ((cx==0)||(cy==0))
//修正位置
int iMidLine=cy/2;
int iBaseLine=(cy-362)/2;
POINT ptCardPoint[PLAY_COUNT];//扑克位置
//////////////////////////////////////////////////////
if (GetSystemMetrics(SM_CXSCREEN)&=1024)
m_PtLogo[0].x=cx -170;
m_PtLogo[0].y=70;
m_PtLogo[0].x=cx -170;
m_PtLogo[0].y=70;
ptCardPoint[0].x=m_PtLogo[0].x + 120;
ptCardPoint[0].y=m_PtLogo[0].y + 60;&
m_PtName[0].x=m_PtLogo[0].x+10;
m_PtName[0].y=m_PtLogo[0].y + 60;
m_PtTime[0].x=m_PtLogo[0].
m_PtTime[0].y=m_PtLogo[0].y - 45;
m_PtAgree[0].x=m_PtLogo[0].x + 40;
m_PtAgree[0].y=m_PtLogo[0].y + 20;
m_PtNt[0].x=cx-80;
m_PtNt[0].y=VIEW_FRAME_TOP + 100;
m_PtNtLogo[0].x=cx-85;
m_PtNtLogo[0].y=VIEW_FRAME_TOP+120;
&////////////////////////////////////////////////////////////////////////
m_PtLogo[1].x=cx - 170;
m_PtLogo[1].y=iMidL
ptCardPoint[1].x=m_PtLogo[1].x +120;
ptCardPoint[1].y=m_PtLogo[1].y + 60;
m_PtName[1].x=m_PtLogo[1].x+10;
m_PtName[1].y=m_PtLogo[1].y + 60;
m_PtTime[1].x=m_PtLogo[1].
m_PtTime[1].y=m_PtLogo[1].y - 45;
m_PtAgree[1].x=m_PtLogo[1].x + 40;
m_PtAgree[1].y=m_PtLogo[1].y + 20;
m_PtNt[1].x=35;
m_PtNt[1].y=iBaseLine+255;
m_PtNtLogo[1].x=70;
m_PtNtLogo[1].y=iMidLine+120;
////////////////////////////////////////////////////////////////////////////
m_PtLogo[2].x=cx/2 - 125;
m_PtLogo[2].y=cy-140;
if (GetSystemMetrics(SM_CXSCREEN)&=1024)
ptCardPoint[2].x=m_PtLogo[2].x+ 120;
ptCardPoint[2].y=m_PtLogo[2].y + 60 ;
ptCardPoint[2].x=m_PtLogo[2].x+120 ;
ptCardPoint[2].y=m_PtLogo[2].y + 60;
m_PtName[2].x=m_PtLogo[2].x +10;
m_PtName[2].y=m_PtLogo[2].y + 60;
m_PtTime[2].x=m_PtLogo[2].
m_PtTime[2].y=m_PtLogo[2].y - 45;
m_PtAgree[2].x=m_PtLogo[2].x + 40;
m_PtAgree[2].y=m_PtLogo[2].y + 20;
m_PtNt[2].x=cx/2-115;
m_PtNt[2].y=cy-37;
m_PtNtLogo[2].x=cx/2;
m_PtNtLogo[2].y=cy-20;
///////////////////////////////////////////////////////////////////////////
m_PtLogo[3].x=5;
m_PtLogo[3].y=iMidL
ptCardPoint[3].x=m_PtLogo[3].x + 120;&
ptCardPoint[3].y=m_PtLogo[3].y + 60;
m_PtName[3].x=m_PtLogo[3].x+10;
m_PtName[3].y=m_PtLogo[3].y + 60;
m_PtTime[3].x=m_PtLogo[3].
m_PtTime[3].y=m_PtLogo[3].y - 45;
m_PtAgree[3].x=m_PtLogo[3].x + 40;
m_PtAgree[3].y=m_PtLogo[3].y + 20;
m_PtNt[3].x=35;
m_PtNt[3].y=iBaseLine+255;
m_PtNtLogo[3].x=70;
m_PtNtLogo[3].y=iMidLine+120;
///////////////////////////////////////////////////////////////////////////
m_PtLogo[4].x=m_PtLogo[3].x;
m_PtLogo[4].y=m_PtLogo[0].y;&
ptCardPoint[4].x=ptCardPoint[3].x;&
ptCardPoint[4].y=ptCardPoint[0].y;
m_PtName[4].x=m_PtLogo[4].x+10;
m_PtName[4].y=m_PtLogo[4].y + 60;
m_PtTime[4].x=m_PtLogo[4].
m_PtTime[4].y=m_PtLogo[4].y - 45;
m_PtAgree[4].x=m_PtLogo[4].x + 40;
m_PtAgree[4].y=m_PtLogo[4].y + 20;
m_PtNt[4].x=35;
m_PtNt[4].y=iBaseLine-155;
m_PtNtLogo[4].x=70;
m_PtNtLogo[4].y=iMidLine-120;
SetFramePos();
m_UserCard[0].SetBasePoint(CPoint(ptCardPoint[0].x,ptCardPoint[0].y),CUpGradeGameCard::XShowMode::SWX_MODE_LEFT,CUpGradeGameCard::YShowMode::SWY_MODE_TOP);
m_UserCard[1].SetBasePoint(CPoint(ptCardPoint[1].x,ptCardPoint[1].y),CUpGradeGameCard::XShowMode::SWX_MODE_LEFT,CUpGradeGameCard::YShowMode::SWY_MODE_TOP);
m_UserCard[2].SetBasePoint(CPoint(ptCardPoint[2].x,ptCardPoint[2].y),CUpGradeGameCard::XShowMode::SWX_MODE_LEFT,CUpGradeGameCard::YShowMode::SWY_MODE_TOP);
m_UserCard[3].SetBasePoint(CPoint(ptCardPoint[3].x,ptCardPoint[3].y),CUpGradeGameCard::XShowMode::SWX_MODE_LEFT,CUpGradeGameCard::YShowMode::SWY_MODE_TOP);
m_UserCard[4].SetBasePoint(CPoint(ptCardPoint[4].x,ptCardPoint[4].y),CUpGradeGameCard::XShowMode::SWX_MODE_LEFT,CUpGradeGameCard::YShowMode::SWY_MODE_TOP);
//移动反牌视图
CRect ContronR
//移动信息视图
m_GameNoteView.GetClientRect(&ContronRect);
m_GameNoteView.MoveWindow((cx-ContronRect.Width())/2,((cy-150)-ContronRect.Height())/2,
ContronRect.Width(),ContronRect.Height(),FALSE);
//移动控件
m_btContinue.GetClientRect(&ContronRect);
m_btContinue.MoveWindow((cx-ContronRect.right)/2,m_PtLogo[2].y-65,ContronRect.right,ContronRect.bottom);
m_StationView.MoveWindow(0,0,0,0);
//移动按钮
mid = cx / 2;
m_bt100Note.MoveWindow(mid + 51,cy-95,40,33);
m_bt200Note.MoveWindow(mid + 51,cy-55,40,33);
m_bt400Note.MoveWindow(mid + 51,cy-15,40,33);
m_btShuttle.MoveWindow(mid+100,cy-105,59,27);
m_btFollow.MoveWindow(mid+100,cy-70,59,27);
m_btNotAdd.MoveWindow(mid+100,cy-35,59,27);
m_btGiveUp.MoveWindow(mid+100,cy-0,59,27);
//开始按钮
void CClientPlayView::OnHitBegin()
CClientGameDlg
*p=CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_BEGIN,0,0);
//继续按钮
void CClientPlayView::OnHitContinue()
CClientGameDlg
*p=CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_BEGIN,0,0);
//梭了按钮
void CClientPlayView::OnHitShuttle()
CClientGameDlg *p =
CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_ACTIVE_RESULT,0,0);
//跟了按钮
void CClientPlayView::OnHitFollow()
CClientGameDlg *p =
CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_ACTIVE_RESULT,1,1);
//不加按钮
void CClientPlayView::OnHitNotAdd()
CClientGameDlg *p =
CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_ACTIVE_RESULT,2,2);
//100注按钮
void CClientPlayView::OnHit100Note()
CClientGameDlg *p =
CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_ACTIVE_RESULT,3,3);
void CClientPlayView::OnHit200Note()
CClientGameDlg *p =
CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_ACTIVE_RESULT,4,4);
void CClientPlayView::OnHit400Note()
CClientGameDlg *p =
CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_ACTIVE_RESULT,5,5);
//放弃按钮
void CClientPlayView::OnHitGiveUp()
CClientGameDlg *p =
CONTAINING_RECORD(this,CClientGameDlg,m_PlayView);
p-&SendMessage(IDM_ACTIVE_RESULT,6,6);
//重置界面函数
void CClientPlayView::ResetGameView()
CUsingSkinClass::ResetGameView();
//设置庄家的位置
void CClientPlayView::SetNTStation(int iViewStation)
m_iNtStation=iViewS
UpdateViewFace(NULL);
//设置报主位置
void CClientPlayView::SetShowNtStation(int iViewStation, int
m_iShowStation=iViewS
UpdateViewFace(NULL);
//设置背景色
void CClientPlayView::SetBackBmp(UINT uResourceID, TCHAR *
szFileName, BOOL bResource)
if (bResource)
if (!Temp.LoadBitmap(uResourceID))
if (szFileName==NULL)
//绘画函数 // add by lhy
void CClientPlayView::OnPaint()
CRect ClipR
GetUpdateRect(&ClipRect, FALSE); // 获取无效区域
CPaintDC dc(this);
CRect ClientR
GetClientRect(&ClientRect); // 本窗口区域
if ( NULL != m_lpDDSWindow)
DrawViewFace(NULL, ClientRect.Width(),
ClientRect.Height());
// 翻屏到主表面
g_DDControl.Flip( m_hWnd, ClipRect, m_lpDDSWindow,
ClipRect);
CWnd::OnPaint();
//位置变化 // add by lhy
void CClientPlayView::OnSize(UINT nType, int cx, int cy)
CWnd::OnSize(nType, cx, cy);
//调整位置
FixControlSize(cx,cy);
UpdateViewFace(NULL);
////************************************************************************************
void CClientPlayView::SetPosition()
//m_UserNote[0].ptNote1.x = m_PtLogo[0].x;
//m_UserNote[0].ptNote1.y = m_PtLogo[0].y;
//m_UserNote[0].ptNote10.x = m_PtLogo[0].x;
//m_UserNote[0].ptNote10.y = m_PtLogo[0].y;
m_UserNote[0].ptNote100.x = m_PtLogo[0].x-50;
m_UserNote[0].ptNote100.y = m_PtLogo[0].y+150;
m_UserNote[0].ptNote1000.x = m_PtLogo[0].x-50;
m_UserNote[0].ptNote1000.y = m_PtLogo[0].y+90;
m_UserNote[0].ptNote1w.x = m_PtLogo[0].x-50;
m_UserNote[0].ptNote1w.y = m_PtLogo[0].y+30;
//m_UserNote[0].ptNote10w.x = m_PtLogo[0].x;
//m_UserNote[0].ptNote10w.y = m_PtLogo[0].y;
//m_UserNote[1].ptNote1.x = m_PtLogo[1].x;
//m_UserNote[1].ptNote1.y = m_PtLogo[1].y;
//m_UserNote[1].ptNote10.x = m_PtLogo[1].x;
//m_UserNote[1].ptNote10.y = m_PtLogo[1].y;
m_UserNote[1].ptNote100.x = m_PtLogo[1].x-50;
m_UserNote[1].ptNote100.y = m_PtLogo[1].y+150;
m_UserNote[1].ptNote1000.x = m_PtLogo[1].x-50;
m_UserNote[1].ptNote1000.y = m_PtLogo[1].y+90;
m_UserNote[1].ptNote1w.x = m_PtLogo[1].x-50;
m_UserNote[1].ptNote1w.y = m_PtLogo[1].y+30;
//m_UserNote[1].ptNote10w.x = m_PtLogo[1].x;
//m_UserNote[1].ptNote10w.y = m_PtLogo[1].y;
//m_UserNote[2].ptNote1.x = m_PtLogo[2].x;
//m_UserNote[2].ptNote1.y = m_PtLogo[2].y;
//m_UserNote[2].ptNote10.x = m_PtLogo[2].x;
//m_UserNote[2].ptNote10.y = m_PtLogo[2].y;
m_UserNote[2].ptNote100.x = m_PtLogo[2].x+80;
m_UserNote[2].ptNote100.y = m_PtLogo[2].y-40;
m_UserNote[2].ptNote1000.x = m_PtLogo[2].x+120;
m_UserNote[2].ptNote1000.y = m_PtLogo[2].y-40;
m_UserNote[2].ptNote1w.x = m_PtLogo[2].x+160;
m_UserNote[2].ptNote1w.y = m_PtLogo[2].y-40;
//m_UserNote[2].ptNote10w.x = m_PtLogo[2].x;
//m_UserNote[2].ptNote10w.y = m_PtLogo[2].y;
//m_UserNote[3].ptNote1.x = m_PtLogo[3].x;
//m_UserNote[3].ptNote1.y = m_PtLogo[3].y;
//m_UserNote[3].ptNote10.x = m_PtLogo[3].x;
//m_UserNote[3].ptNote10.y = m_PtLogo[3].y;
m_UserNote[3].ptNote100.x = m_PtLogo[3].x+180;
m_UserNote[3].ptNote100.y = m_PtLogo[3].y+150;
m_UserNote[3].ptNote1000.x = m_PtLogo[3].x+180;
m_UserNote[3].ptNote1000.y = m_PtLogo[3].y+90;
m_UserNote[3].ptNote1w.x = m_PtLogo[3].x+180;
m_UserNote[3].ptNote1w.y = m_PtLogo[3].y+30;
//m_UserNote[3].ptNote10w.x = m_PtLogo[3].x;
//m_UserNote[3].ptNote10w.y = m_PtLogo[3].y;
//m_UserNote[4].ptNote1.x = m_PtLogo[4].x;
//m_UserNote[4].ptNote1.y = m_PtLogo[4].y;
//m_UserNote[4].ptNote10.x = m_PtLogo[4].x;
//m_UserNote[4].ptNote10.y = m_PtLogo[4].y;
m_UserNote[4].ptNote100.x = m_PtLogo[4].x+180;
m_UserNote[4].ptNote100.y = m_PtLogo[4].y+150;
m_UserNote[4].ptNote1000.x = m_PtLogo[4].x+180;
m_UserNote[4].ptNote1000.y = m_PtLogo[4].y+90;
m_UserNote[4].ptNote1w.x = m_PtLogo[4].x+180;
m_UserNote[4].ptNote1w.y = m_PtLogo[4].y+30;
//m_UserNote[4].ptNote10w.x = m_PtLogo[4].x;
//m_UserNote[4].ptNote10w.y = m_PtLogo[4].y;
void CClientPlayView::GetNoteNum(int iPoint, BYTE
cbStation)
m_UserNote[cbStation].cbNote1 = 0;
m_UserNote[cbStation].cbNote10 = 0;
m_UserNote[cbStation].cbNote100 = 0;
m_UserNote[cbStation].cbNote1000 = 0;
m_UserNote[cbStation].cbNote1w = 0;
m_UserNote[cbStation].cbNote10w = 0;
int point = iP
if (point &= 100000)
m_UserNote[cbStation].cbNote10w = point/100000;
point = point % 100000;
if (point &= 10000 && point & 100000)
m_UserNote[cbStation].cbNote1w = point/10000;
point = point % 10000;
if (point &= 1000 && point & 10000)
m_UserNote[cbStation].cbNote1000 = point/1000;
point = point % 1000;
if (point &= 100 && point & 1000)
m_UserNote[cbStation].cbNote100 = point/100;
point = point % 100;
if (point &= 10 && point & 100)
m_UserNote[cbStation].cbNote10 = point/10;
point = point % 10;
if (point &=1 && point & 10)
m_UserNote[cbStation].cbNote1 =
void CClientPlayView::DrawNote()
CGameImageHelper ImageHandle1(&m_picNote);
CGameImageHelper ImageHandle10(&m_picNote);
CGameImageHelper ImageHandle100(&m_picNote);
CGameImageHelper ImageHandle1000(&m_picNote);
CGameImageHelper ImageHandle1w(&m_picNote);
CGameImageHelper ImageHandle10w(&m_picNote);
IDirectDrawSurface* m_lpNote1 = NULL;
IDirectDrawSurface* m_lpNote10 = NULL;
IDirectDrawSurface* m_lpNote100 = NULL;
IDirectDrawSurface* m_lpNote1000 = NULL;
IDirectDrawSurface* m_lpNote1w = NULL;
IDirectDrawSurface* m_lpNote10w = NULL;
g_DDControl.LoadDDBitmap( ImageHandle1.GetBitmap() ,
&m_lpNote1);
g_DDControl.LoadDDBitmap( ImageHandle1.GetBitmap() ,
&m_lpNote10);
g_DDControl.LoadDDBitmap( ImageHandle1.GetBitmap() ,
&m_lpNote100);
g_DDControl.LoadDDBitmap( ImageHandle1.GetBitmap() ,
&m_lpNote1000);
g_DDControl.LoadDDBitmap( ImageHandle1.GetBitmap() ,
&m_lpNote1w);
g_DDControl.LoadDDBitmap( ImageHandle1.GetBitmap() ,
&m_lpNote10w);
for (BYTE i=0; i
if (m_pUserItem[i] != NULL)
for (BYTE j=0; j&9; j++)
if (j & m_UserNote[i].cbNote1)
g_DDControl.StretchImage(m_lpDDSWindow,m_UserNote[i].ptNote1.x,m_UserNote[i].ptNote1.y+pos,30,
m_lpNote1,0,0,30,29,RGB(0,0,0));
//if (j & m_UserNote[i].cbNote10)
g_DDControl.StretchImage(m_lpDDSWindow,m_UserNote[i].ptNote10.x,m_UserNote[i].ptNote10.y+pos,30,
// m_lpNote10,30,0,30,29,RGB(0,0,0));
if (j & m_UserNote[i].cbNote100)
g_DDControl.StretchImage(m_lpDDSWindow,m_UserNote[i].ptNote100.x,m_UserNote[i].ptNote100.y+pos,30,
m_lpNote100,60,0,30,29,RGB(0,0,0));
if (j & m_UserNote[i].cbNote1000)
g_DDControl.StretchImage(m_lpDDSWindow,m_UserNote[i].ptNote1000.x,m_UserNote[i].ptNote1000.y+pos,30,
m_lpNote,30,29,RGB(0,0,0));
if (j & m_UserNote[i].cbNote1w)
g_DDControl.StretchImage(m_lpDDSWindow,m_UserNote[i].ptNote1w.x,m_UserNote[i].ptNote1w.y+pos,30,
m_lpNote1w,120,0,30,29,RGB(0,0,0));
//if (j & m_UserNote[i].cbNote10w)
g_DDControl.StretchImage(m_lpDDSWindow,m_UserNote[i].ptNote10w.x,m_UserNote[i].ptNote10w.y+pos,30,
// m_lpNote10w,150,0,30,29,RGB(0,0,0));
DD_RELEASE(m_lpNote1);
DD_RELEASE(m_lpNote10);
DD_RELEASE(m_lpNote100);
DD_RELEASE(m_lpNote1000);
DD_RELEASE(m_lpNote1w);
DD_RELEASE(m_lpNote10w);
void CClientPlayView::SetFramePos()
m_ptFrame[0].x = m_PtLogo[0].x;
m_ptFrame[0].y = m_PtLogo[0].y;
m_ptNoteText[0].x = m_PtLogo[0].x + 100;
m_ptNoteText[0].y = m_PtLogo[0].y + 20;
m_ptFrame[1].x = m_PtLogo[1].x;
m_ptFrame[1].y = m_PtLogo[1].y;
m_ptNoteText[1].x = m_PtLogo[1].x + 100;
m_ptNoteText[1].y = m_PtLogo[1].y + 20;
m_ptFrame[2].x = m_PtLogo[2].x;
m_ptFrame[2].y = m_PtLogo[2].y;
m_ptNoteText[2].x = m_PtLogo[2].x + 100;
m_ptNoteText[2].y = m_PtLogo[2].y + 20;
m_ptFrame[3].x = m_PtLogo[3].x;
m_ptFrame[3].y = m_PtLogo[3].y;
m_ptNoteText[3].x = m_PtLogo[3].x + 100;
m_ptNoteText[3].y = m_PtLogo[3].y + 20;
m_ptFrame[4].x = m_PtLogo[4].x;
m_ptFrame[4].y = m_PtLogo[4].y;
m_ptNoteText[4].x = m_PtLogo[4].x + 100;
m_ptNoteText[4].y = m_PtLogo[4].y + 20;
& *注:棋牌源码下载论坛有更多的源码下载,访问下面的链接邀你一起分享更多源码。
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。}

我要回帖

更多关于 有游戏比赛的app 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信