📄 playgame.cpp
字号:
#include "StdAfx.h"
#include "PlayGame.h"
#include "SH.h"
CPlayGame::CPlayGame(void)
{
m_iStatus = 0;
}
CPlayGame::~CPlayGame(void)
{
}
int CPlayGame::Init(void)
{
//创建后台临时表面
theApp.m_CDirectManage.CreateBitmap(theApp.m_CDirectManage.m_lpDDSBackGround, theApp.m_iScreenWidth, theApp.m_iScreenHeight);
theApp.m_CDirectManage.CreateBitmap(theApp.m_CDirectManage.m_lpDDSSour, theApp.m_iScreenWidth, theApp.m_iScreenHeight);
theApp.m_CDirectManage.CreateBitmap(theApp.m_CDirectManage.m_lpDDSTemp, theApp.m_iScreenWidth, theApp.m_iScreenHeight);
CString strLogFile = L"";
strLogFile = theApp.m_strRootPath + L"logo.bmp";
Logo(strLogFile, RGB(255,255,255),190, 170, 272, 112, 7);
m_iStatus = 1;
return 1;
}
void CPlayGame::Logo(LPCTSTR PicFile, DWORD BkColor, int x, int y, int Width, int Height, int Num)
{
LPDIRECTDRAWSURFACE LogoPic;
theApp.m_CDirectManage.CreateBitmap(LogoPic, 0,0, PicFile);
theApp.m_CDirectManage._UpdateScreen(LogoPic,theApp.m_RectScreen);
theApp.m_CDirectManage.FillSurface(theApp.m_CDirectManage.m_lpDDSBackGround, BkColor);
theApp.m_CDirectManage.Blt(theApp.m_CDirectManage.m_lpDDSBack, 0,0, theApp.m_CDirectManage.m_lpDDSBackGround, theApp.m_RectScreen, false);
theApp.m_CDirectManage.ColorOut(theApp.m_CDirectManage.m_lpDDSBack, 50);
SetCursor(NULL);
//动画出现
RECT rect={0, 0, Width, Height};
for(int i=0; i<Num; i++)
{
theApp.m_CDirectManage.Delay(350);
theApp.m_CDirectManage.Blt(theApp.m_CDirectManage.m_lpDDSBack, 0,0, theApp.m_CDirectManage.m_lpDDSBackGround, theApp.m_RectScreen, false);
rect.top=Height*i;
rect.bottom=Height*(i+1);
theApp.m_CDirectManage.Blt(theApp.m_CDirectManage.m_lpDDSBack, x, y, LogoPic, rect, false);
theApp.m_CDirectManage._UpdateScreen(theApp.m_CDirectManage.m_lpDDSBack,theApp.m_RectScreen);
}
theApp.m_CDirectManage.Delay(2500);
theApp.m_CDirectManage.ColorIn(50, theApp.m_CDirectManage.RGB16(0,0,0));
theApp.m_CDirectManage.Delay(1000);
_RELEASE( LogoPic );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -