//These variables and their associated functions are not in PlayWindow
//to save RAM by not having a repeat data storage for each screen - M. White 21 March, 2019
void LoadCursorPixelTestData(int MapType, int Dimension)
{
	int x, y, x_limit, y_limit, intTestData;
	string FileName;
	fstream DataStream;

	//Temp command to return in case these two incomplete options appear - M. White 23 March, 2019
	if(MapType == HEX_Map02) return;
	
	//Reset all of the values to zero as default - M. White 20 March, 2019
	for(y = 0; y < _FineMouseMaxY; y++)
		for(x = 0; x < _FineMouseMaxX; x++)
			_FineMouseTestArray[x][y] = 0;

	//NOTE: The filename "NONE" is used as a test to verify that we're going to load
	//from a file, or leave it alone (in the case of a SQR_Map, or there was bad data
	//passed into the function - M. White 22 March, 2019
	FileName = "NONE";
	switch(MapType)
	{
	//SQR_MAP included for posterity - M. White 22 March, 2019
	case SQR_Map:
//		switch(Dimension)
//		{
//		case 16:	FileName = "NONE";	x_limit = 16; y_limit = 16;		break;
//		case 24:	FileName = "NONE";	x_limit = 24; y_limit = 24;		break;
//		case 32:	FileName = "NONE";	x_limit = 32; y_limit = 32;		break;
//		case 48:	FileName = "NONE";	x_limit = 48; y_limit = 48;		break;
//		default:	FileName = "NONE";	x_limit = 0; y_limit = 0;		break;
//		};
		break;
	case DIA_Map:
		switch(Dimension)
		{
		case 16:	FileName = "16DT.txt";	x_limit = 16; y_limit = 16;		break;
		case 24:	FileName = "24DT.txt";	x_limit = 24; y_limit = 24;		break;
		case 32:	FileName = "32DT.txt";	x_limit = 32; y_limit = 32;		break;
		case 48:	FileName = "48DT.txt";	x_limit = 48; y_limit = 48;		break;
		default:	FileName = "NONE";		x_limit = 0; y_limit = 0;		break;
		};
		break;
	case RHO_Map:
		switch(Dimension)
		{
		case 16:	FileName = "16RT.txt";	x_limit = 16; y_limit = 8;		break;
		case 24:	FileName = "24RT.txt";	x_limit = 24; y_limit = 12;		break;
		case 32:	FileName = "32RT.txt";	x_limit = 32; y_limit = 16;		break;
		case 48:	FileName = "48RT.txt";	x_limit = 48; y_limit = 24;		break;
		default:	FileName = "NONE";		x_limit = 0;  y_limit = 0;		break;
		};
		break;
	//Included for future development - M. White 22 March, 2019
	case HEX_Map01:
		switch(Dimension)
		{
		case 26:	FileName = "16H1T.txt";	x_limit = 26; y_limit = 14;		break;
	//	case 24:	FileName = "24H1T.txt";	x_limit = 24; y_limit = 24;		break;
		case 50:	FileName = "32H1T.txt";	x_limit = 50; y_limit = 30;		break;
		case 74:	FileName = "48H1T.txt";	x_limit = 74; y_limit = 46;		break;
		default:	FileName = "NONE";	x_limit = 0; y_limit = 0;			break;
		};
		break;
//	case HEX_Map02:
//		switch(Dimension)
//		{
//		case 16:	FileName = "16H2T.txt";	x_limit = 16; y_limit = 16;		break;
//		case 24:	FileName = "24H2T.txt";	x_limit = 24; y_limit = 24;		break;
//		case 32:	FileName = "32H2T.txt";	x_limit = 32; y_limit = 32;		break;
//		case 48:	FileName = "48H2T.txt";	x_limit = 48; y_limit = 48;		break;
//		default:	FileName = "NONE";	x_limit = 0; y_limit = 0;			break;
//		};
//		break;
		default: break;
	};

	//We've found a file name, and we're going to load the file - M. White 22 March, 2019
	if(FileName != "NONE")
	{
		//Open the file - M. White 22 March, 2019
		DataStream.open(FileName.c_str(), ios::in);
		if(!DataStream.fail())
		{
			//The x and y limits how many pixels/data need to be filled - M. White 23 March, 2019
			for(y = 0; y < y_limit; y++)
				for(x = 0; x < x_limit; x++)
				{
					//Recycle the string variable...
					DataStream >> FileName;
					intTestData = atoi(FileName.c_str());
					_FineMouseTestArray[x][y] = intTestData;
				}
		}
		//Inform the User that the file is missing and who to talk to fix it 
		//(change this later to company support email) - M. White 22 March, 2019
		else
		{
			FileName += " failed to load.\n\nConsult the developers at\n\nmichael_white2@yahoo.com\n\nShutting down.";
			MessageBox(NULL, FileName.c_str(), "Error", MB_OK);
			PostQuitMessage(0);
		}
		//Close the file before leaving - M. White 22 March, 2019
		DataStream.close();
	}
	//The else-case in this situation has already been satisfied at the top of the function
	//when we cleared out all of the data in the _FineMouseTestArray[][] array - M. White 22 March, 2019
}
void TestMapCursor()
{
	int iWork1 = 0, iWork2 = 0, iWork3 = 0, iWork4 = 0;

	//Determine if need to show the cursor
	if(_pEngine->GetMouseX() > (_PlayWin[_MAPVIEW].gRectL() - 20) && _pEngine->GetMouseX() < (_PlayWin[_MAPVIEW].gRectR() + 20) &&
	   _pEngine->GetMouseY() > (_PlayWin[_MAPVIEW].gRectT() - 20) && _pEngine->GetMouseY() < (_PlayWin[_MAPVIEW].gRectB() + 20))
	{
		switch(_PlayWin[_MAPVIEW].GetType())
		{
		case HEX_Map01:
			{
				//Get Starting numbers...					
				iWork1 = int((_pEngine->GetMouseX() - _PlayWin[_MAPVIEW].GetTileOffX()) / _PlayWin[_MAPVIEW].GetTileW());	//Course Value X
				iWork2 = int((_pEngine->GetMouseY() - _PlayWin[_MAPVIEW].GetTileOffY()) / _PlayWin[_MAPVIEW].GetTileH());	//Course Value Y
				iWork3 = int((_pEngine->GetMouseX() - _PlayWin[_MAPVIEW].GetTileOffX()) % _PlayWin[_MAPVIEW].GetTileW());	//Fine Value X
				iWork4 = int((_pEngine->GetMouseY() - _PlayWin[_MAPVIEW].GetTileOffY()) % _PlayWin[_MAPVIEW].GetTileH());	//Fine Value Y

				_ptCursor.x	= iWork1;
				_ptCursor.y	= (iWork2 * 2);

				//Reach out and to get a command value to react to in the next switch() - M. White 20 March, 2019
				_WhatCommandCursor = _FineMouseTestArray[iWork3][iWork4];

				switch(_WhatCommandCursor)
				{
				case 0:		break;	// Do nothing else - M. White 20 March, 2019
				case 1:		{ _ptCursor.x -= 1; _ptCursor.y -= 1; }				break;
				case 2:		{ _ptCursor.y -= 1; }								break;
				case 3:		{ _ptCursor.x -= 1; _ptCursor.y += 1; }				break;
				case 4:		{ _ptCursor.y += 1; }								break;
				}
			}
			break;
		case RHO_Map:	//Fall through, these have the same math - M. White 20 March, 2019
		case DIA_Map:
			{
				//Get Starting numbers...
				iWork1		= int((_pEngine->GetMouseX() - _PlayWin[_MAPVIEW].GetTileOffX()) / _PlayWin[_MAPVIEW].GetTileW());	//Course Value X
				iWork2		= int((_pEngine->GetMouseY() - _PlayWin[_MAPVIEW].GetTileOffY()) / _PlayWin[_MAPVIEW].GetTileH());	//Course Value Y
				iWork3		= int((_pEngine->GetMouseX() - _PlayWin[_MAPVIEW].GetTileOffX()) % _PlayWin[_MAPVIEW].GetTileW());	//Fine Value X
				iWork4		= int((_pEngine->GetMouseY() - _PlayWin[_MAPVIEW].GetTileOffY()) % _PlayWin[_MAPVIEW].GetTileH());	//Fine Value Y

				_ptCursor.x	= iWork1;
				_ptCursor.y	= (iWork2 * 2);

				//Reach out and to get a command value to react to in the next switch() - M. White 20 March, 2019
				_WhatCommandCursor = _FineMouseTestArray[iWork3][iWork4];

				switch(_WhatCommandCursor)
				{
				case 0:		break;	// Do nothing else - M. White 20 March, 2019
				case 1:		{ _ptCursor.x -= 1; _ptCursor.y -= 1; }				break;
				case 2:		{ _ptCursor.y -= 1; }								break;
				case 3:		{ _ptCursor.x -= 1; _ptCursor.y += 1; }				break;
				case 4:		{ _ptCursor.y += 1; }								break;
				}
			}
			break;
		case SQR_Map:
			_ptCursor.x = int((_pEngine->GetMouseX() - _PlayWin[_MAPVIEW].GetTileOffX()) / _PlayWin[_MAPVIEW].GetTileW());
			_ptCursor.y = int((_pEngine->GetMouseY() - _PlayWin[_MAPVIEW].GetTileOffY()) / _PlayWin[_MAPVIEW].GetTileH());
			break;
		}
		_paintMainMap	= true;
		_paintSomething	= true;
		_ShowCursor		= true;
	}
	else _ShowCursor = false;    
}
//NOTE: These four functions moved back to their paints in the main file - M. White 6 June, 2019
void PaintSqrMap(HDC hDC)
{
	POINT ptTile, ptEdge;
	int XStart = 0, Width	= 0;
	int	YStart = 0, Height	= 0;

	HBRUSH hB;	
	hB = CreateSolidBrush(RGB(0, 0, 0));
	FillRect(hDC, &_PlayWin[_MAPVIEW].GetRect(), hB);
	DeleteObject(hB);

	for(int y = 0; y < _PlayWin[_MAPVIEW].GetNumRow(); y++)
		for(int x = 0; x < _PlayWin[_MAPVIEW].GetNumCol(); x++)
		{
			ptTile.x = _PlayWin[_MAPVIEW].GetTileOffX() + (x * _PlayWin[_MAPVIEW].GetTileW());
			ptTile.y = _PlayWin[_MAPVIEW].GetTileOffY() + (y * _PlayWin[_MAPVIEW].GetTileH());

			//Did the tile fall completely into the Screen Map?
			if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) < _PlayWin[_MAPVIEW].gRectR() &&
			   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) < _PlayWin[_MAPVIEW].gRectB())
			{
				_bmpTiles[SQR_Map].DrawPart(hDC, ptTile.x, ptTile.y, 
					int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin->GetTileW()),
					//The 0 y-coordinate will need to account for mtuliple
					//Tiles later - M. White 22 March, 2019
					0, _PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);

				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX()	>= 0)
				{
					_bmpCoastalImgs[SQR_Map].DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW(), 
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastY() * _PlayWin[_MAPVIEW].GetTileH(),
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest()	>= 0)
				{
					_bmpTiles[SQR_Map].DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW(), 
						(4 * _PlayWin[_MAPVIEW].GetTileH()),
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity()		>= 0)
				{
					_bmpTiles[SQR_Map].DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW(), 
						(3 * _PlayWin[_MAPVIEW].GetTileH()),
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetWall()		>= 0)
				{
					_walls002->DrawPart(hDC, ptTile.x, ptTile.y - int(_PlayWin[_MAPVIEW].GetTileH() * 0.50),
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetWall() * _PlayWin[_MAPVIEW].GetTileW(), 0,
						_PlayWin[_MAPVIEW].GetTileW(), (_PlayWin[_MAPVIEW].GetTileH() + int(_PlayWin[_MAPVIEW].GetTileH() * 0.50)), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited()	== false)
				{
				}
			}
			else
			{
				if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
				{
					ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				}
				else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
				}
				else
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].GetTileW();
				}
				//------------------------ Seperation of previous if-test sequence
				if		(ptTile.y < _PlayWin[_MAPVIEW].gRectT())
				{
					ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0 + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
					Height		= _PlayWin[_MAPVIEW].GetTileH() - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				}
				else if	((ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) > _PlayWin[_MAPVIEW].gRectB())
				{
					ptEdge.y	= ptTile.y;
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;
					Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
				}
				else
				{
					ptEdge.y	= ptTile.y;
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;
					Height		= _PlayWin[_MAPVIEW].GetTileH();
				}
				_bmpTiles[SQR_Map].DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
				
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX()	>= 0)
				{
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					_bmpCoastalImgs[SQR_Map].DrawPart(hDC, ptEdge.x, ptEdge.y, 
						XStart, 
						YStart + _PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastY() *_PlayWin[_MAPVIEW].GetTileH(),
						Width, Height, true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest()	>= 0)
				{
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					_bmpTiles[SQR_Map].DrawPart(hDC, ptEdge.x, ptEdge.y, 
						XStart, 
						YStart + (4 *_PlayWin[_MAPVIEW].GetTileH()),
						Width, Height, true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity()		>= 0)
				{
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					_bmpTiles[SQR_Map].DrawPart(hDC, ptEdge.x, ptEdge.y, 
						XStart, 
						YStart + (3 *_PlayWin[_MAPVIEW].GetTileH()),
						Width, Height, true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited()	== false)
				{
				}
			}
		}
	if(_ShowCursor == true)
	{
		//This (y & 1) creates an boolen test - is Y even or odd?
		ptTile.x = _PlayWin[_MAPVIEW].GetTileOffX() + (_ptCursor.x * _PlayWin[_MAPVIEW].GetTileW());
		ptTile.y = _PlayWin[_MAPVIEW].GetTileOffY() + (_ptCursor.y * _PlayWin[_MAPVIEW].GetTileH());

		//Did the tile fall completely into the Screen Map?
		if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) < _PlayWin[_MAPVIEW].gRectR() &&
		   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) < _PlayWin[_MAPVIEW].gRectB())
		{
			_bmpCursors->DrawPart(hDC, 
				ptTile.x, ptTile.y,							//Where will the cursor's x and y land?
				_PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW(), //Find x-source data by multiplying map type by width
				_bmpY,										//Move to y-source data determined at GameStart()
				_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), //Width and Height of cursor matches Tile sizes...
				true);
		}
		else
		{
			if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
			{
				ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW() + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
			}
			else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
			{
				ptEdge.x	= ptTile.x;
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW();
				Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
			}
			else
			{
				ptEdge.x	= ptTile.x;
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW();
				Width		= _PlayWin[_MAPVIEW].GetTileW();
			}
			if		(ptTile.y < _PlayWin->gRectT())
			{
				ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
				YStart		= _bmpY + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				Height		= _PlayWin[_MAPVIEW].GetTileH() - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
			}
			else if	((ptTile.y + _PlayWin->GetTileH()) > _PlayWin->gRectB())
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
			}
			else
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _PlayWin[_MAPVIEW].GetTileH();
			}
			_bmpCursors->DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
		}
	}
}
void PaintSqrIsoMap(HDC hDC)
{
	POINT ptTile, ptEdge;

	HBRUSH hB;	
	hB = CreateSolidBrush(RGB(0, 0, 0));
	FillRect(hDC, &_PlayWin[_MAPVIEW].GetRect(), hB);
	DeleteObject(hB);

	int XStart = 0, Width	= 0;
	int	YStart = 0, Height	= 0;

	for(int y = 0; y < _PlayWin[_MAPVIEW].GetNumRow(); y++)
		for(int x = 0; x < _PlayWin[_MAPVIEW].GetNumCol(); x++)
		{
			//This (y & 1) creates an boolen test - is Y even or odd?
			ptTile.x = _PlayWin[_MAPVIEW].GetTileOffX() + 
						((x * _PlayWin[_MAPVIEW].GetTileW()) + 
						((y & 1) * int(_PlayWin[_MAPVIEW].GetTileW() * 0.50)) - 
						((_TileWalkerY & 1) * int(_PlayWin[_MAPVIEW].GetTileW() * 0.50)));
			ptTile.y = _PlayWin[_MAPVIEW].GetTileOffY() + 
						((y * _PlayWin[_MAPVIEW].GetTileH()) - 
						( y      * int(_PlayWin[_MAPVIEW].GetTileH() * 0.50)) - 
						((_TileWalkerY & 1) * int(_PlayWin[_MAPVIEW].GetTileH() * 0.50)));

			//Did the tile fall completely into the Screen Map?
			if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) < _PlayWin[_MAPVIEW].gRectR() &&
			   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) < _PlayWin[_MAPVIEW].gRectB())
			{
				_bmpTiles[_MAPVIEW].DrawPart(hDC, ptTile.x, ptTile.y,
					//The zero y-coordinate needs to be changed to a multiplier later to
					//account for multiple ranks of images - M. White 15 March, 2019
					(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW()), 0,
					_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited() == false)
				{
				}
			}
			//If the tile did not fall completely into the screen...clip it...
			else
			{
				if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
				{
					ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				}
				else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
				}
				else
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].GetTileW();
				}
				if		(ptTile.y < _PlayWin[_MAPVIEW].gRectT())
				{
					ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0 + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
					Height		= _PlayWin[_MAPVIEW].GetTileH() - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				}
				else if	((ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) > _PlayWin[_MAPVIEW].gRectB())
				{
					ptEdge.y	= ptTile.y;
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;
					Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
				}
				else
				{
					ptEdge.y	= ptTile.y;
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;
					Height		= _PlayWin[_MAPVIEW].GetTileH();
				}
				_bmpTiles[DIA_Map].DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
				
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited() == false)
				{
				}
			}
		}
	if(_ShowCursor == true)
	{
		ptTile.x = _PlayWin[_MAPVIEW].GetTileOffX() + 
			((_ptCursor.x * _PlayWin[_MAPVIEW].GetTileW()) + 
			((_ptCursor.y & 1) * int(_PlayWin[_MAPVIEW].GetTileW() / 2)) );
		ptTile.y = _PlayWin[_MAPVIEW].GetTileOffY() + 
			((_ptCursor.y * _PlayWin[_MAPVIEW].GetTileH()) - 
			(_ptCursor.y * int(_PlayWin[_MAPVIEW].GetTileH() / 2)));

		//Did the tile fall completely into the Screen Map?
		if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) < _PlayWin[_MAPVIEW].gRectR() &&
		   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) < _PlayWin[_MAPVIEW].gRectB())
		{
			_bmpCursors->DrawPart(hDC, 
				ptTile.x, ptTile.y,							//Where will the cursor's x and y land?
				_PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW(), //Find x-source data by multiplying map type by width
				_bmpY,										//Move to y-source data determined at GameStart()
				_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), //Width and Height of cursor matches Tile sizes...
				true);
		}
		else
		{
			if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
			{
				ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW() + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
			}
			else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
			{
				ptEdge.x	= ptTile.x;
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW();
				Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
			}
			else
			{
				ptEdge.x	= ptTile.x;
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW();
				Width		= _PlayWin[_MAPVIEW].GetTileW();
			}
			if		(ptTile.y < _PlayWin[_MAPVIEW].gRectT())
			{
				ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
				YStart		= _bmpY + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				Height		= _PlayWin[_MAPVIEW].GetTileH() - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
			}
			else if	((ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) > _PlayWin[_MAPVIEW].gRectB())
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
			}
			else
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _PlayWin[_MAPVIEW].GetTileH();
			}
			_bmpCursors->DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
		}
	}
}
void PaintIsoMap(HDC hDC)
{
	POINT	ptTile, ptEdge;

	HBRUSH hB;	
	hB = CreateSolidBrush(RGB(0, 0, 0));
	FillRect(hDC, &_PlayWin[_MAPVIEW].GetRect(), hB);
	DeleteObject(hB);

	int XStart = 0, Width	= 0;
	int	YStart = 0, Height	= 0;

	for(int y = 0; y < _PlayWin[_MAPVIEW].GetNumRow(); y++)
		for(int x = 0; x < _PlayWin[_MAPVIEW].GetNumCol(); x++)
		{
			//This (y & 1) creates an boolen test - is Y even or odd?
			ptTile.x = _PlayWin[_MAPVIEW].GetTileOffX() + 
				((x * _PlayWin[_MAPVIEW].GetTileW()) + 
				((y & 1) * int(_PlayWin[_MAPVIEW].GetTileW() * 0.50)) -
				((_TileWalkerY & 1) * int(_PlayWin[_MAPVIEW].GetTileW() * 0.50)));
			ptTile.y = _PlayWin[_MAPVIEW].GetTileOffY() +
				((y * _PlayWin[_MAPVIEW].GetTileH()) -
				( y      * int(_PlayWin[_MAPVIEW].GetTileH() * 0.50)) -
				((_TileWalkerY & 1) * int(_PlayWin[_MAPVIEW].GetTileH() * 0.50)));

			//Did the tile fall completely into the Screen Map?
			if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) < _PlayWin[_MAPVIEW].gRectR() &&
			   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) < _PlayWin[_MAPVIEW].gRectB())
			{
				_bmpTiles[_MAPVIEW].DrawPart(hDC, ptTile.x, ptTile.y,
					(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW()),
					0,
					_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited() == false)
				{
				}
			}
			//If the tile did not fall completely into the screen...clip it...
			else
			{
				if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
				{
					ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				}
				else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin->gRectR())
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
				}
				else
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].GetTileW();
				}
				if		(ptTile.y < _PlayWin[_MAPVIEW].gRectT())
				{
					ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0 + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
					Height		= _PlayWin[_MAPVIEW].GetTileH() - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				}
				else if	((ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) > _PlayWin[_MAPVIEW].gRectB())
				{
					ptEdge.y	= ptTile.y;
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;
					Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
				}
				else
				{
					ptEdge.y	= ptTile.y;
					//These zeroes need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;
					Height		= _PlayWin[_MAPVIEW].GetTileH();
				}
				_bmpTiles[RHO_Map].DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
				
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited() == false)
				{
				}
			}
		}
	if(_ShowCursor == true)
	{
		ptTile.x = ((_ptCursor.x * _PlayWin[_MAPVIEW].GetTileW()) + ((_ptCursor.y & 1) * int(_PlayWin[_MAPVIEW].GetTileW() / 2)) ) + _PlayWin[_MAPVIEW].GetTileOffX();
		ptTile.y = ((_ptCursor.y * _PlayWin[_MAPVIEW].GetTileH()) -  (_ptCursor.y * int(_PlayWin[_MAPVIEW].GetTileH() / 2))	    ) + _PlayWin[_MAPVIEW].GetTileOffY();

		//Did the tile fall completely into the Screen Map?
		if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) < _PlayWin[_MAPVIEW].gRectR() &&
		   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) < _PlayWin[_MAPVIEW].gRectB())
		{			
			_bmpCursors->DrawPart(hDC, 
				ptTile.x, ptTile.y,							//Where will the cursor's x and y land?
				_PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW(), //Find x-source data by multiplying map type by width
				_bmpY,										//Move to y-source data determined at GameStart()
				_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), //Width and Height of cursor matches Tile sizes...
				true);
		}
		else
		{
			if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
			{
				ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW() + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
			}
			else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
			{
				ptEdge.x	= ptTile.x;
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW();
				Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
			}
			else
			{
				ptEdge.x	= ptTile.x;
				XStart		= _PlayWin[_MAPVIEW].GetType() * _PlayWin[_MAPVIEW].GetTileW();
				Width		= _PlayWin[_MAPVIEW].GetTileW();
			}
			if		(ptTile.y < _PlayWin[_MAPVIEW].gRectT())
			{
				ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
				YStart		= 0 + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				Height		= _PlayWin[_MAPVIEW].GetTileH() - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
			}
			else if	((ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) > _PlayWin[_MAPVIEW].gRectB())
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
			}
			else
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _PlayWin[_MAPVIEW].GetTileH();
			}
			_bmpCursors->DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
		}
	}
}
void PaintHexMap01(HDC hDC)
{
	POINT ptTile, ptEdge;

	HBRUSH hB; hB = CreateSolidBrush(RGB(0, 0, 0));
	FillRect(hDC, &_PlayWin[_MAPVIEW].GetRect(), hB);
	DeleteObject(hB);

	int XStart = 0, Width	= 0;
	int	YStart = 0, Height	= 0;
	int SpcCursorX = 0;
//	char temp[64];

	for(int y = 0; y < _PlayWin[_MAPVIEW].GetNumRow(); y++)
		for(int x = 0; x < _PlayWin[_MAPVIEW].GetNumCol(); x++)
		{
			//The +1 here keeps the uneven HexTiles from overlapping too badly - M. White 5 June, 2019
			ptTile.x = _PlayWin[_MAPVIEW].GetTileOffX() +
						((x * _PlayWin[_MAPVIEW].GetTileW()) + 1) +
						((y & 1) * int(_PlayWin[_MAPVIEW].GetTileW() * 0.50)) -
						((_TileWalkerY & 1) * int(_PlayWin[_MAPVIEW].GetTileW() * 0.50));
			ptTile.y = _PlayWin[_MAPVIEW].GetTileOffY() +
						(y * int(_PlayWin[_MAPVIEW].GetTileH() * 0.50)) -
						((_TileWalkerY & 1) * int(_PlayWin[_MAPVIEW].GetTileH() * 0.50));

			//Did the tile fall completely into the Screen Map?
			if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) < _PlayWin[_MAPVIEW].gRectR() &&
			   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) < _PlayWin[_MAPVIEW].gRectB())
			{
				_bmpTiles[HEX_Map01].DrawPart(hDC, ptTile.x, ptTile.y,
					_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW(), 
					0/*_PlayWin[_MAPVIEW].GetTileH()*/, _PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() >= 0)
				{
					_bmpCoastalImgs[HEX_Map01].DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW(), 
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastY() * _PlayWin[_MAPVIEW].GetTileH(),
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() >= 0)
				{
					_bmpTiles[HEX_Map01].DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW(), 
						_PlayWin[_MAPVIEW].GetTileH() * 4,
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() >= 0)
				{
					_bmpTiles[HEX_Map01].DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW(), 
						_PlayWin[_MAPVIEW].GetTileH() * 3,
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() >= 0)
				{
					if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() > _numRiverRoadsHori)
						_bmpRiverRoads->DrawPart(hDC, ptTile.x, ptTile.y,
						(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() - _numRiverRoadsHori) * _PlayWin[_MAPVIEW].GetTileW(), 
						_PlayWin[_MAPVIEW].GetTileH(),//Bottom of the Bitmap - M. White 12 May, 2019
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
					else
						_bmpRiverRoads->DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() * _PlayWin[_MAPVIEW].GetTileW(), 
						0,//Top of the Bitmap - M. White 12 May, 2019
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited() == false)
				{
					_bmpTiles[HEX_Map01].DrawPart(hDC, ptTile.x, ptTile.y,
						_PlayWin[_MAPVIEW].GetTileW() * 10, 
						_PlayWin[_MAPVIEW].GetTileH(), _PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
				}
			}
			//If the tile did not fall completely into the screen...clip it...
			else
			{
				if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
				{
					ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				}
				else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
				}
				else
				{
					ptEdge.x	= ptTile.x;
					XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetBG() * _PlayWin[_MAPVIEW].GetTileW());
					Width		= _PlayWin[_MAPVIEW].GetTileW();
				}
				if		(ptTile.y < _PlayWin[_MAPVIEW].gRectT())
				{
					ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
					//These zeroes (30s) need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0 + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
					Height		= _PlayWin[_MAPVIEW].GetTileH() - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				}
				else if	((ptTile.y + _PlayWin[_MAPVIEW].GetTileH()) > _PlayWin[_MAPVIEW].gRectB())
				{
					ptEdge.y	= ptTile.y;
					//These zeroes (30s) need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;//_PlayWin[_MAPVIEW].GetTileH();
					Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
				}
				else
				{
					ptEdge.y	= ptTile.y;
					//These zeroes (30s) need to be modified later to account for bitmaps
					//that have multiple ranks of images to account for - M. White 15 March, 2019
					YStart		= 0;//_PlayWin[_MAPVIEW].GetTileH();
					Height		= _PlayWin[_MAPVIEW].GetTileH();
				}
				_bmpTiles[HEX_Map01].DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);

				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() >= 0)
				{
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastX() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					_bmpCoastalImgs[HEX_Map01].DrawPart(hDC, ptEdge.x, ptEdge.y, 
						XStart, 
						YStart + (_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCoastY() *_PlayWin[_MAPVIEW].GetTileH()),
						Width, Height, true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() >= 0)
				{
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetForest() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					_bmpTiles[HEX_Map01].DrawPart(hDC, ptEdge.x, ptEdge.y, 
						XStart, 
						YStart + (4 *_PlayWin[_MAPVIEW].GetTileH()),
						Width, Height, true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() >= 0)
				{
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetCity() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					_bmpTiles[HEX_Map01].DrawPart(hDC, ptEdge.x, ptEdge.y, 
						XStart, 
						YStart + (3 *_PlayWin[_MAPVIEW].GetTileH()),
						Width, Height, true);
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() >= 0)
				{//_numRiverRoadsHori
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() > _numRiverRoadsHori)
							XStart	= int((_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() - _numRiverRoadsHori) * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						else
							XStart	= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() > _numRiverRoadsHori)
							XStart	= int((_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() - _numRiverRoadsHori) * _PlayWin[_MAPVIEW].GetTileW());
						else
							XStart	= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() * _PlayWin[_MAPVIEW].GetTileW()) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() > _numRiverRoadsHori)
							XStart	= int((_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() - _numRiverRoadsHori) * _PlayWin[_MAPVIEW].GetTileW());
						else
							XStart	= int(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() * _PlayWin[_MAPVIEW].GetTileW());
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() > _numRiverRoadsHori)
					{
						_bmpRiverRoads->DrawPart(hDC, ptEdge.x, ptEdge.y,
						(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetRoadRiver() - _numRiverRoadsHori) * _PlayWin[_MAPVIEW].GetTileW(), 
						YStart + _PlayWin[_MAPVIEW].GetTileH(),
						_PlayWin[_MAPVIEW].GetTileW(), _PlayWin[_MAPVIEW].GetTileH(), true);
					}
					else
					{
						_bmpRiverRoads->DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
					}
				}
				if(_PlayWin[_MAPVIEW].PW_Buffer[x][y].GetVisited() == false)
				{
					if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
					{
						ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
						XStart		= int(_PlayWin[_MAPVIEW].GetTileW() * 10) + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
						Width		= _PlayWin[_MAPVIEW].GetTileW() - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
					}
					else if	((ptTile.x + _PlayWin[_MAPVIEW].GetTileW()) > _PlayWin[_MAPVIEW].gRectR())
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].GetTileW() * 10);
						Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
					}
					else
					{
						ptEdge.x	= ptTile.x;
						XStart		= int(_PlayWin[_MAPVIEW].GetTileW() * 10);
						Width		= _PlayWin[_MAPVIEW].GetTileW();
					}
					_bmpTiles[HEX_Map01].DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, 
						YStart + _PlayWin[_MAPVIEW].GetTileH(), Width, Height, true);
				}
			}
		}
	if(_ShowCursor == true)
	{
		switch(_PlayWin[_MAPVIEW].GetTileW())
		{
		case 74:	SpcCursorX = 144;		break;
		case 50:	SpcCursorX =  96;		break;
		case 26:	SpcCursorX =  48;		break;
		};

		ptTile.x = _PlayWin[_MAPVIEW].GetTileOffX() +
					((_ptCursor.x * _PlayWin[_MAPVIEW].GetTileW()) + 1) +//The +1 is to kiss up the tiles - M. White 25 April, 2019
					((_ptCursor.y & 1) * int(_PlayWin[_MAPVIEW].GetTileW() * 0.50));
		ptTile.y = _PlayWin[_MAPVIEW].GetTileOffY() +
					(_ptCursor.y * int(_PlayWin[_MAPVIEW].GetTileH() * 0.50));
		//Did the tile fall completely into the Screen Map?
		if(ptTile.x > _PlayWin[_MAPVIEW].gRectL() && (ptTile.x + _TileW_Hex01) < _PlayWin[_MAPVIEW].gRectR() &&
		   ptTile.y > _PlayWin[_MAPVIEW].gRectT() && (ptTile.y + _TileH_Hex01) < _PlayWin[_MAPVIEW].gRectB())
		{
			_bmpCursors->DrawPart(hDC, ptTile.x, ptTile.y, SpcCursorX, _bmpY, _TileW_Hex01, _TileH_Hex01, true);
		}
		else
		{
			if		(ptTile.x < _PlayWin[_MAPVIEW].gRectL())
			{
				ptEdge.x	= _PlayWin[_MAPVIEW].gRectL();
				XStart		= SpcCursorX + (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
				Width		= _TileW_Hex01 - (_PlayWin[_MAPVIEW].gRectL() - ptTile.x);
			}
			else if	((ptTile.x + _TileW_Hex01) > _PlayWin[_MAPVIEW].gRectR())
			{
				ptEdge.x	= ptTile.x;
				XStart		= SpcCursorX;
				Width		= _PlayWin[_MAPVIEW].gRectR() - ptTile.x;
			}
			else
			{
				ptEdge.x	= ptTile.x;
				XStart		= SpcCursorX;
				Width		= _TileW_Hex01;
			}
			if		(ptTile.y < _PlayWin[_MAPVIEW].gRectT())
			{
				ptEdge.y	= _PlayWin[_MAPVIEW].gRectT();
				YStart		= _bmpY + (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
				Height		= _TileH_Hex01 - (_PlayWin[_MAPVIEW].gRectT() - ptTile.y);
			}
			else if	((ptTile.y + _TileH_Hex01) > _PlayWin[_MAPVIEW].gRectB())
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _PlayWin[_MAPVIEW].gRectB() - ptTile.y;
			}
			else
			{
				ptEdge.y	= ptTile.y;
				YStart		= _bmpY;
				Height		= _TileH_Hex01;
			}
			_bmpCursors->DrawPart(hDC, ptEdge.x, ptEdge.y, XStart, YStart, Width, Height, true);
		}
	}
}