2000-11-02 16:46:17 +01:00
|
|
|
/******************/
|
|
|
|
/*** Map Stuph ***/
|
|
|
|
/*****************/
|
|
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
2000-11-03 23:40:41 +01:00
|
|
|
#include "gl3d.h"
|
|
|
|
#include <gl\gl.h>
|
|
|
|
#include <gl\glu.h>
|
|
|
|
#include <gl\glut.h>
|
|
|
|
|
2000-11-02 16:46:17 +01:00
|
|
|
#include "Map.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2000-11-15 22:22:40 +01:00
|
|
|
void CMap::SetSize(int Width,int Height,BOOL Clear)
|
2000-11-02 16:46:17 +01:00
|
|
|
{
|
|
|
|
Map.resize(Width);
|
|
|
|
for (int i=0;i<Width;i++)
|
|
|
|
{
|
|
|
|
Map[i].resize(Height);
|
|
|
|
}
|
|
|
|
|
2000-11-15 22:22:40 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2000-11-02 16:46:17 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
void CMap::SetWidth(int Width)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
void CMap::SetHeight(int Height)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2000-11-15 22:22:40 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
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]);
|
|
|
|
}
|
2000-11-02 16:46:17 +01:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
2000-11-15 22:22:40 +01:00
|
|
|
void CMap::SetTile(int X,int Y,sMapElem &New)
|
|
|
|
{
|
|
|
|
Map[X][Y]=New;
|
|
|
|
}
|
2000-11-02 16:46:17 +01:00
|
|
|
|