Go to the documentation of this file.
64 {
return ((a&0xF0) == (b&0xF0)); }
145 Map(
const char *filename);
148 Map(std::istringstream &data);
150 void Load(
const char *filename);
154 void Scale(
long newWidth,
long newHeight);
156 void Save(std::stringstream &data);
157 void Save(
const char *filename);
161 void Print(
int scale = 1);
180 int32_t x2, int32_t y2,
tTerrain t);
207 bool CanStep(
long x1,
long y1,
long x2,
long y2)
const;
210 bool GetOpenGLCoord(
int _x,
int _y, GLdouble &x, GLdouble &y, GLdouble &z, GLdouble &radius)
const;
211 bool GetOpenGLCoord(
float _x,
float _y, GLdouble &x, GLdouble &y, GLdouble &z, GLdouble &radius)
const;
float GetEdgeWidthX(int x, int y)
Returns the edge width between (x, y) and (x+1, y)
float GetEdgeWidthY(int x, int y)
Returns the edge width between (x, y) and (x, y+1)
int GetNodeNum(int x, int y, tCorner c=kNone)
Gets the abstract Graph node number for this tile.
void loadOctileCorner(FILE *f, int height, int width)
void OpenGLDraw(tDisplay how=kPolygons) const
Does actual OpenGL drawing of the map.
double GetCoordinateScale()
Returns the scale multiplier between openGL coordinates and map coordinates.
void SetNodeNum(int num, int x, int y, tCorner c=kNone)
Sets the abstract Graph node number for this tile.
halfTile()
Construct a half tile, initializing to flat values.
void SetRectHeight(long x1, long y1, long x2, long y2, long h, tTerrain type=kGround)
Set the height and terrain of a set of tiles.
void SetDrawLand(bool land)
Toggles whether the land is draw when you call OpenGLDraw.
void GetPointFromCoordinate(point3d loc, int &px, int &py) const
Tile & GetTile(long x, long y)
Return the tile at location x, y.
void Load(const char *filename)
Resets the current map by loading the file passed in.
bool AdjacentCorners(long x, long y, tCorner corner) const
void Print(int scale=1)
Do an ASCII/ANSI print out of the map.
void loadOctile(FILE *f, int height, int width)
void DoNormal(tSplit split, halfTile *t, int x, int y) const
does a rough approximation of the normal for a particular halfTile.
void SetCornerHeight(long x, long y, tCorner which, long height, tSplitSide split=kWholeTile)
Set the height of any one corner of a tile.
bool CanPass(long a, long b)
void DoVertexColor(tTerrain type, int height, bool darken=false) const
Using OpenGL set the correct color for a particular vertex.
void SetSplit(long x, long y, tSplit split)
Set the split of the tile at x, y.
void Scale(long newWidth, long newHeight)
long GetMapWidth() const
return the width of the map
void SetTileSet(tTileset ts)
Choose the tileset used for land colors.
Map(long width, long height)
Create a new map of a particular size.
void loadRaw(FILE *f, int height, int width)
long GetTerrainType(long x, long y, tSplitSide split=kWholeTile) const
Get the terrain type of the (split) tile at x, y.
Tile()
Construct a tile with no split.
void SetHeight(long x, long y, long height, tSplitSide split=kWholeTile)
Set the (flat) height of the tile at x, y.
long GetCornerHeight(long x, long y, tCorner which, tEdge edge) const
Set the height of any one corner of a tile.
void setSizeMultipler(int _sizeMultiplier)
const char * GetMapName()
long GetHeight(long x, long y, tSplitSide split=kWholeTile)
Get the (flat) height of the tile at x, y.
bool CanStep(long x1, long y1, long x2, long y2) const
long GetMapHeight() const
return the height of the map
tTileset GetTileSet()
Get the tileset used for land colors.
tSplit GetSplit(long x, long y) const
Return the split of the tile at x, y.
void drawLandQuickly() const
std::vector< std::string > split(const std::string &s, char delim)
Splits a string into elements.
void SmoothSetRectHeight(long x1, long y1, long x2, long y2, long h, tTerrain type=kGround)
Places a rectangle into the map, but also modifies the edges to make the transition smooth.
bool tryLoadRollingStone(FILE *f)
bool AdjacentEdges(long x, long y, tEdge edge) const
Is the tile at x, y adjacent across the edge?
bool GetOpenGLCoord(int _x, int _y, GLdouble &x, GLdouble &y, GLdouble &z, GLdouble &radius) const
Get the openGL coordinates of a given tile.
void DrawTile(Tile *t, int x, int y, tDisplay how) const
Draw a single tile.
void SetTerrainType(int32_t x1, int32_t y1, int32_t x2, int32_t y2, tTerrain t)
Map::SetTerrainType()
bool isLegalStone(char c)
void Save(std::stringstream &data)
unimplemented.
bool tryDragonAge(FILE *f)
void paintRoomInside(int x, int y)
A tile-based representation of the world.
Edge class for connections between node in a Graph.