资源简介
类似于贪食鱼,老师的原有代码的基础上改变了图片,将鱼换成了毛和老鼠的游戏,引擎没有修改
代码片段和文件信息
/************************************************************************/
/* */
/* 游戏完善与管理类的创建 */
/* 作者:万立中 (C)2009-09-20 */
/* www.wanlizhong.com */
/* */
/************************************************************************/
#include “CDesktop.h“
//构造函数
CDesktop::CDesktop():mode_changed(false)
{
SaveMode();
}
//析构函数
CDesktop::~CDesktop()
{
ResetMode();
}
// 存储现在的显示模式
void CDesktop::SaveMode()
{
HDC dc = GetDC(0);
devmode_saved.dmSize = sizeof(devmode_saved);
devmode_saved.dmDriverExtra = 0;
devmode_saved.dmPelsWidth = GetDeviceCaps(dc HORZRES);
devmode_saved.dmPelsHeight = GetDeviceCaps(dc VERTRES);
devmode_saved.dmBitsPerPel = GetDeviceCaps(dc BITSPIXEL);
devmode_saved.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
//判断Windows版本是否为Windows NT/2000
if ((GetVersion() & 0x80000000) == 0)
{
devmode_saved.dmFields |= DM_DISPLAYFREQUENCY;
devmode_saved.dmDisplayFrequency = GetDeviceCaps(dc VREFRESH);
}
ReleaseDC(0 dc);
}
// 还原成之前存储的显示模式
//
void CDesktop::ResetMode()
{
if (mode_changed)
{
ChangeDisplaySettings(&devmode_saved 0);
mode_changed = false;
}
}
// 更改显示模式
//
bool CDesktop::ChangeMode(int width int height)
{
DEVMODE devmode;
devmode = devmode_saved;
devmode.dmPelsWidth = width;
devmode.dmPelsHeight = height;
devmode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
if (ChangeDisplaySettings(&devmode CDS_FULLSCREEN)
== DISP_CHANGE_SUCCESSFUL)
{
mode_changed = true;
return true;
}
return false;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1706 2009-09-20 11:02 WinGame_13(FishGameV2.0)\CDesktop.cpp
文件 623 2009-09-20 11:00 WinGame_13(FishGameV2.0)\CDesktop.h
文件 7485 2009-09-20 11:02 WinGame_13(FishGameV2.0)\CDxSound.cpp
文件 3397 2009-09-20 11:00 WinGame_13(FishGameV2.0)\CDxSound.h
文件 8791 2011-05-31 10:45 WinGame_13(FishGameV2.0)\CEngine.cpp
文件 3302 2009-09-20 11:00 WinGame_13(FishGameV2.0)\CEngine.h
文件 9747 2009-09-20 11:02 WinGame_13(FishGameV2.0)\CGdiBmp.cpp
文件 2149 2009-09-20 10:55 WinGame_13(FishGameV2.0)\CGdiBmp.h
文件 26421 2011-06-01 15:46 WinGame_13(FishGameV2.0)\CManager.cpp
文件 6618 2011-06-01 15:47 WinGame_13(FishGameV2.0)\CManager.h
文件 11918 2009-09-20 11:02 WinGame_13(FishGameV2.0)\CSprite.cpp
文件 9487 2009-09-20 10:55 WinGame_13(FishGameV2.0)\CSprite.h
文件 14351 2011-05-31 08:58 WinGame_13(FishGameV2.0)\Debug\CDesktop.obj
文件 0 2011-05-31 09:31 WinGame_13(FishGameV2.0)\Debug\CDesktop.sbr
文件 30663 2011-05-31 08:58 WinGame_13(FishGameV2.0)\Debug\CDxSound.obj
文件 0 2011-05-31 09:31 WinGame_13(FishGameV2.0)\Debug\CDxSound.sbr
文件 28070 2011-05-31 10:45 WinGame_13(FishGameV2.0)\Debug\CEngine.obj
文件 0 2011-05-31 10:45 WinGame_13(FishGameV2.0)\Debug\CEngine.sbr
文件 25088 2011-05-31 08:59 WinGame_13(FishGameV2.0)\Debug\CGdiBmp.obj
文件 0 2011-05-31 09:31 WinGame_13(FishGameV2.0)\Debug\CGdiBmp.sbr
文件 102268 2011-06-01 16:57 WinGame_13(FishGameV2.0)\Debug\CManager.obj
文件 1185739 2011-06-01 16:57 WinGame_13(FishGameV2.0)\Debug\CManager.sbr
文件 31911 2011-05-31 08:59 WinGame_13(FishGameV2.0)\Debug\CSprite.obj
文件 0 2011-05-31 09:31 WinGame_13(FishGameV2.0)\Debug\CSprite.sbr
文件 26101 2011-06-01 15:47 WinGame_13(FishGameV2.0)\Debug\FishGame.obj
文件 1172536 2011-06-01 15:47 WinGame_13(FishGameV2.0)\Debug\FishGame.sbr
文件 336896 2011-06-16 20:43 WinGame_13(FishGameV2.0)\Debug\vc60.idb
文件 143360 2011-06-01 15:47 WinGame_13(FishGameV2.0)\Debug\vc60.pdb
文件 3613696 2011-05-31 10:45 WinGame_13(FishGameV2.0)\Debug\WinGame.bsc
文件 254032 2011-06-01 16:57 WinGame_13(FishGameV2.0)\Debug\WinGame.exe
............此处省略58个文件信息
- 上一篇:空间计量经济学
- 下一篇:工程控制论(上)-钱学森
评论
共有 条评论