亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gamemap.cpp

?? 一個(gè)類似坦克大戰(zhàn)的小小游戲
?? CPP
字號(hào):
// Map.cpp: implementation of the CMap class.
//
//////////////////////////////////////////////////////////////////////

#include "GameMap.h"
#include <commdlg.h>
#include "Fense.h"
#include "Wall.h"
#include "Seaweed.h"
#include "Barbette.h"
#include "Island.h"
#include "Reef.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CGameMap::CGameMap() : m_nWidth(MAP_WIDTH), m_nHeight(MAP_HEIGHT)
{
	std::locale::global(std::locale("")); // Add by Vigame, 2007-7-27, to solve the 
										  // problem can not read chinese path.
}

CGameMap::~CGameMap()
{

}

// Map Controls ///////////////////////////////////////////////////////

BOOL CGameMap::CreateMap()
{
	return TRUE;
}

BOOL CGameMap::LoadMap(list<CGameObject> &inObjectList, CGameResource &inResource)
{
	OPENFILENAME ofn;       // Common dialog box structure   
	char szFile[255];       // Buffer for file name   
//	HANDLE hFile;           // The handle of file 
	
	// Initialize OPENFILENAME   
	ZeroMemory(&ofn, sizeof(ofn));   
	ofn.lStructSize = sizeof(ofn);   
	ofn.hwndOwner = NULL;   
	ofn.lpstrFile = szFile;   
	  
	// Set lpstrFile[0] to '\0' so that GetOpenFileName does not     
	// use the contents of szFile to initialize itself.   
	ofn.lpstrFile[0] = '\0';   
	ofn.nMaxFile = sizeof(szFile);   
	ofn.lpstrFilter = "*.CMAP\0*.CMAP\0";   
	ofn.nFilterIndex = 1;   
	ofn.lpstrFileTitle = NULL;   
	ofn.nMaxFileTitle = 0;   
	ofn.lpstrInitialDir = NULL;   
	ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;   
	
	// Display the Load dialog box.     
	if (GetOpenFileName(&ofn))   
	{   
		// Clear list
		inObjectList.clear();

		// Load map
		ifstream inData;
		inData.open(ofn.lpstrFile, ios::in);

		// Load object count first
		inData >> m_nObjectCount;
	
		// Save the position of objects
		int i;
		for (i = 0; i != m_nObjectCount; i++)
		{
			int objType;
			inData >> objType;
			switch (objType)
			{
			case 2:		// OT_Fense
				{
					CFense fense;
					inData >> fense.m_nX >> fense.m_nY >> fense.m_nWidth >> fense.m_nHeight;
					inData >> fense.m_nTextureIndex >> fense.m_nHp;
					fense.m_pTexture = inResource.m_textureFense[fense.m_nTextureIndex].m_pTexture;
					fense.m_objType = (Object_Type)objType;
					inObjectList.push_back(fense);
					break;
				}
			case 3:		// OT_Wall
				{
					CWall wall;
					inData >> wall.m_nX >> wall.m_nY >> wall.m_nWidth >> wall.m_nHeight;
					inData >> wall.m_nTextureIndex >> wall.m_nHp;
					wall.m_pTexture = inResource.m_textureWall[wall.m_nTextureIndex].m_pTexture;
					wall.m_objType = (Object_Type)objType;
					inObjectList.push_back(wall);
					break;
				}
			case 4:		// OT_Barbette
				{
					CBarbette barbette;
					inData >> barbette.m_nX >> barbette.m_nY >> barbette.m_nWidth >> barbette.m_nHeight;
					inData >> barbette.m_nTextureIndex >> barbette.m_nHp;
					barbette.m_pTexture = inResource.m_textureBarbette[barbette.m_nTextureIndex].m_pTexture;
					barbette.m_objType = (Object_Type)objType;
					inObjectList.push_back(barbette);
					break;
				}
			case 5:		// OT_Island
				{
					CIsland island;
					inData >> island.m_nX >> island.m_nY >> island.m_nWidth >> island.m_nHeight;
					inData >> island.m_nTextureIndex >> island.m_nHp;
					island.m_pTexture = inResource.m_textureIsland[island.m_nTextureIndex].m_pTexture;
					island.m_objType = (Object_Type)objType;
					inObjectList.push_back(island);
					break;
				}
			case 6:		// OT_Seaweed
				{
					CSeaweed seaweed;
					inData >> seaweed.m_nX >> seaweed.m_nY >> seaweed.m_nWidth >> seaweed.m_nHeight;
					inData >> seaweed.m_nTextureIndex >> seaweed.m_nHp;
					seaweed.m_pTexture = inResource.m_textureSeaweed.m_pTexture;
					seaweed.m_objType = (Object_Type)objType;
					inObjectList.push_back(seaweed);
					break;
				}
			case 7:		// OT_Reef
				{
					CReef reef;
					inData >> reef.m_nX >> reef.m_nY >> reef.m_nWidth >> reef.m_nHeight;
					inData >> reef.m_nTextureIndex >> reef.m_nHp;
					reef.m_pTexture = inResource.m_textureReef[reef.m_nTextureIndex].m_pTexture;
					reef.m_objType = (Object_Type)objType;
					inObjectList.push_back(reef);
					break;
				}
			default:
				break;

			} // End switch
		}	// End for
		inData.close();
		return TRUE;
	}
	return FALSE;
}

BOOL CGameMap::LoadLevel(LPSTR lpLevel, list<CGameObject> &inObjectList, CGameResource &inResource)
{
	// Clear list
	inObjectList.clear();

	// Load map
	ifstream inData;
	inData.open(lpLevel, ios::in);

	if (!inData.is_open())
	{
		DWORD dwError = ::GetLastError();
		return FALSE;
	}

	// Load object count first
	inData >> m_nObjectCount;

	// Save the position of objects
	int i;
	for (i = 0; i != m_nObjectCount; i++)
	{
		int objType;
		inData >> objType;
		switch (objType)
		{
		case 2:		// OT_Fense
			{
				CFense fense;
				inData >> fense.m_nX >> fense.m_nY >> fense.m_nWidth >> fense.m_nHeight;
				inData >> fense.m_nTextureIndex >> fense.m_nHp;
				fense.m_pTexture = inResource.m_textureFense[fense.m_nTextureIndex].m_pTexture;
				fense.m_objType = (Object_Type)objType;
				inObjectList.push_back(fense);
				break;
			}
		case 3:		// OT_Wall
			{
				CWall wall;
				inData >> wall.m_nX >> wall.m_nY >> wall.m_nWidth >> wall.m_nHeight;
				inData >> wall.m_nTextureIndex >> wall.m_nHp;
				wall.m_pTexture = inResource.m_textureWall[wall.m_nTextureIndex].m_pTexture;
				wall.m_objType = (Object_Type)objType;
				inObjectList.push_back(wall);
				break;
			}
		case 4:		// OT_Barbette
			{
				CBarbette barbette;
				inData >> barbette.m_nX >> barbette.m_nY >> barbette.m_nWidth >> barbette.m_nHeight;
				inData >> barbette.m_nTextureIndex >> barbette.m_nHp;
				barbette.m_pTexture = inResource.m_textureBarbette[barbette.m_nTextureIndex].m_pTexture;
				barbette.m_objType = (Object_Type)objType;
				inObjectList.push_back(barbette);
				break;
			}
		case 5:		// OT_Island
			{
				CIsland island;
				inData >> island.m_nX >> island.m_nY >> island.m_nWidth >> island.m_nHeight;
				inData >> island.m_nTextureIndex >> island.m_nHp;
				island.m_pTexture = inResource.m_textureIsland[island.m_nTextureIndex].m_pTexture;
				island.m_objType = (Object_Type)objType;
				inObjectList.push_back(island);
				break;
			}
		case 6:		// OT_Seaweed
			{
				CSeaweed seaweed;
				inData >> seaweed.m_nX >> seaweed.m_nY >> seaweed.m_nWidth >> seaweed.m_nHeight;
				inData >> seaweed.m_nTextureIndex >> seaweed.m_nHp;
				seaweed.m_pTexture = inResource.m_textureSeaweed.m_pTexture;
				seaweed.m_objType = (Object_Type)objType;
				inObjectList.push_back(seaweed);
				break;
			}
		case 7:		// OT_Reef
			{
				CReef reef;
				inData >> reef.m_nX >> reef.m_nY >> reef.m_nWidth >> reef.m_nHeight;
				inData >> reef.m_nTextureIndex >> reef.m_nHp;
				reef.m_pTexture = inResource.m_textureReef[reef.m_nTextureIndex].m_pTexture;
				reef.m_objType = (Object_Type)objType;
				inObjectList.push_back(reef);
				break;
			}
		default:
			break;

		} // End switch
	}	// End for
	inData.close();
	return TRUE;
}

BOOL CGameMap::SaveMap(list<CGameObject> &inObjectList)
{
	OPENFILENAME ofn;       // Common dialog box structure   
	char szFile[255];       // Buffer for file name   
//	HANDLE hFile;           // The handle of file 
	
	// Initialize OPENFILENAME   
	ZeroMemory(&ofn, sizeof(ofn));   
	ofn.lStructSize = sizeof(ofn);   
	ofn.hwndOwner = NULL;   
	ofn.lpstrFile = szFile;   
	  
	// Set lpstrFile[0] to '\0' so that GetOpenFileName does not     
	// use the contents of szFile to initialize itself.   
	ofn.lpstrFile[0] = '\0';   
	ofn.nMaxFile = sizeof(szFile);   
	ofn.lpstrFilter = "*.CMAP\0*.CMAP\0";   
	ofn.nFilterIndex = 1;   
	ofn.lpstrFileTitle = NULL;   
	ofn.nMaxFileTitle = 0;   
	ofn.lpstrInitialDir = NULL;   
	ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;   
	
	// Display the save dialog box.     
	if (GetSaveFileName(&ofn))   
	{   
		// Save map
		ofstream outData;
		outData.open(ofn.lpstrFile);

		// Save object count first
		outData << inObjectList.size() << endl;
	
		// Save the position of objects
		list<CGameObject>::iterator itr;
		for (itr = inObjectList.begin(); itr != inObjectList.end(); itr++)
		{
			outData << itr->m_objType << setw(8);
			outData << itr->m_nX << setw(8) << itr->m_nY << setw(8);
			outData << itr->m_nWidth << setw(8) << itr->m_nHeight << setw(8);
			outData << itr->m_nTextureIndex << setw(8) << itr->m_nHp << endl;
		}
		outData.close();
		return TRUE;
	}
	return FALSE;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品自拍| 免费人成黄页网站在线一区二区| 日本欧美大码aⅴ在线播放| 777色狠狠一区二区三区| 亚洲第一在线综合网站| 日韩一区二区高清| 99re6这里只有精品视频在线观看| 一区二区欧美精品| 精品国产乱码久久久久久浪潮| 久久精品国产免费看久久精品| 国产精品美女久久久久高潮| 欧美日韩一级视频| 国产麻豆精品在线观看| 亚洲综合另类小说| 亚洲国产日产av| 欧美乱妇23p| 激情欧美一区二区三区在线观看| 国产精品久久久久久久久久久免费看| 欧美日本一道本| 99精品在线免费| 日韩国产精品大片| 亚洲色图欧美激情| 精品人在线二区三区| 国产a视频精品免费观看| 亚洲va天堂va国产va久| 中文字幕中文字幕在线一区| 精品国偷自产国产一区| 欧美在线视频日韩| 粉嫩aⅴ一区二区三区四区| 日韩1区2区日韩1区2区| 亚洲女爱视频在线| 中文字幕精品三区| 国产欧美日韩在线看| 久久久久久久综合日本| 久久亚区不卡日本| 久久综合久久综合久久| 精品成人佐山爱一区二区| 日韩三级在线免费观看| 在线成人免费观看| 91精品国产一区二区| 91精品国产欧美一区二区| 91精品国产综合久久蜜臀| 67194成人在线观看| 7777精品伊人久久久大香线蕉完整版 | 精品视频免费在线| 国产精品资源在线看| 美女高潮久久久| 亚洲国产一区在线观看| 亚洲乱码国产乱码精品精的特点 | 亚洲美腿欧美偷拍| 国产精品系列在线| 久久久久国色av免费看影院| 精品91自产拍在线观看一区| 日韩欧美一区二区在线视频| 欧美精选一区二区| 欧美日韩中文国产| 在线成人午夜影院| 9191成人精品久久| 欧美色网站导航| 欧美另类z0zxhd电影| 91国模大尺度私拍在线视频| 日本久久精品电影| 欧美午夜一区二区三区免费大片| 欧美伊人久久久久久久久影院 | 日韩一区二区中文字幕| 日韩一卡二卡三卡四卡| 久久亚洲综合色一区二区三区| 国产日韩视频一区二区三区| 亚洲视频精选在线| 日韩专区在线视频| 国内精品伊人久久久久av一坑| 成人免费看片app下载| 91成人免费网站| 日韩欧美电影在线| 国产精品灌醉下药二区| 亚洲国产乱码最新视频| 国产一区二区三区香蕉| 色综合欧美在线| 日韩午夜在线观看视频| 中文天堂在线一区| 日韩精品午夜视频| 成人福利电影精品一区二区在线观看| 日本韩国欧美在线| 久久综合久久综合久久综合| 一区二区三区欧美久久| 国精产品一区一区三区mba桃花| 92国产精品观看| 欧美一级日韩不卡播放免费| 中文字幕一区二| 热久久国产精品| 一本色道久久综合亚洲精品按摩| 日韩午夜精品视频| 亚洲女与黑人做爰| 国产精品影音先锋| 欧美理论电影在线| 亚洲色欲色欲www| 韩国中文字幕2020精品| 欧美日韩三级一区| 中文在线资源观看网站视频免费不卡| 偷拍自拍另类欧美| 99精品视频中文字幕| 日韩一级大片在线| 亚洲午夜在线电影| eeuss鲁片一区二区三区| 日韩精品资源二区在线| 一区二区三区中文免费| 国产乱对白刺激视频不卡| 欧美电影在线免费观看| 亚洲精品菠萝久久久久久久| 国产成人精品亚洲777人妖| 欧美一区二区三区免费视频| 亚洲欧美日韩国产成人精品影院 | 天涯成人国产亚洲精品一区av| 不卡一区二区在线| 国产香蕉久久精品综合网| 麻豆精品视频在线观看| 欧美性猛交xxxx乱大交退制版| 亚洲人成网站在线| 成人黄色大片在线观看| 国产午夜亚洲精品不卡| 麻豆国产欧美日韩综合精品二区| 欧美日韩一区二区三区四区五区| 亚洲三级在线免费| www.66久久| 国产精品美女一区二区三区| 国产a视频精品免费观看| 久久久精品黄色| 秋霞电影一区二区| 日韩午夜电影av| 日韩经典中文字幕一区| 666欧美在线视频| 婷婷综合久久一区二区三区| 欧美午夜片在线看| 亚洲综合久久久久| 欧美性一区二区| 亚洲国产毛片aaaaa无费看| 欧美影院一区二区| 一区二区三区日韩欧美| 91久久精品国产91性色tv| 最近中文字幕一区二区三区| 91免费国产视频网站| 中文字幕在线不卡| 91天堂素人约啪| 一区二区三区91| 欧美日韩一区二区三区视频 | 精品制服美女丁香| 日韩你懂的在线观看| 九一久久久久久| 久久久99久久| caoporn国产一区二区| 亚洲精品视频一区| 欧美日韩国产美女| 久久国产精品色| 久久久久久久久久久久电影 | 日韩精品一二三区| 日韩一区二区三区四区| 国产一区二区看久久| 国产日韩精品一区二区浪潮av| 成人午夜免费视频| 一区二区成人在线| 欧美一区二区福利在线| 国产揄拍国内精品对白| 亚洲国产精品av| 日本高清无吗v一区| 日韩1区2区日韩1区2区| 国产午夜精品一区二区| 色哟哟亚洲精品| 免费成人美女在线观看.| 精品av久久707| 色吊一区二区三区| 青娱乐精品在线视频| 久久综合狠狠综合| av福利精品导航| 日韩国产欧美在线播放| 久久精品人人做人人爽人人| 色婷婷久久一区二区三区麻豆| 日韩精品91亚洲二区在线观看 | 2023国产精品| 91丨九色丨尤物| 蜜臀久久99精品久久久久宅男| 国产精品女同一区二区三区| 欧美日韩国产另类一区| 国产91清纯白嫩初高中在线观看 | 精品午夜久久福利影院| 国产精品视频yy9299一区| 欧美日韩国产在线观看| 国产在线视频精品一区| 一区二区三区四区av| 26uuu国产一区二区三区| 91麻豆蜜桃一区二区三区| 精品在线播放午夜| 伊人一区二区三区| 久久先锋影音av鲁色资源网| 91国产丝袜在线播放| 国产成人av一区二区| 日韩综合小视频| 一区二区在线电影| 国产无一区二区| 欧美成人女星排行榜| 在线视频一区二区三区|