This commit is contained in:
Daveo 2000-11-15 21:22:40 +00:00
parent acd5ab37c0
commit 7ac13dc8b8
17 changed files with 599 additions and 275 deletions

View file

@ -13,19 +13,7 @@
/*****************************************************************************/
int CMap::GetWidth()
{
return(Map.size());
}
/*****************************************************************************/
int CMap::GetHeight()
{
return(Map[0].size());
}
/*****************************************************************************/
void CMap::SetSize(int Width,int Height)
void CMap::SetSize(int Width,int Height,BOOL Clear)
{
Map.resize(Width);
for (int i=0;i<Width;i++)
@ -33,12 +21,16 @@ void CMap::SetSize(int Width,int Height)
Map[i].resize(Height);
}
for (int Y=0;Y<Height;Y++)
for (int X=0;X<Width;X++)
{
Map[X][Y].Bank=0;
Map[X][Y].Tile=(X+Y)%9;
}
if (Clear)
{
for (int Y=0;Y<Height;Y++)
for (int X=0;X<Width;X++)
{
Map[X][Y].Set=0;
// Map[X][Y].Tile=(X+Y)%9;
Map[X][Y].Tile=0;
}
}
}
@ -52,6 +44,28 @@ void CMap::SetHeight(int Height)
{
}
/*****************************************************************************/
void CMap::Clear()
{
int Width=GetWidth();
for (int i=0;i<Width;i++)
{
Map[i].clear();
}
Map.clear();
}
/*****************************************************************************/
sMapElem &CMap::GetTile(int X,int Y)
{
return(Map[X][Y]);
}
/*****************************************************************************/
void CMap::SetTile(int X,int Y,sMapElem &New)
{
Map[X][Y]=New;
}