120 int startX,
int startY,
122 int scrollX,
int scrollY,
124 int debugFlags)
const;
184 Map(
int width,
int height,
int tileWidth,
int tileHeight);
213 int debugFlags)
const;
305 int endPixelY,
unsigned char walkMask,
312 int destPixelX,
int destPixelY,
313 int radius,
unsigned char walkmask,
int maxCost = 20);
318 void addParticleEffect(
const std::string &effectFile,
int x,
int y,
int w = 0,
int h = 0);
358 Path findPath(
int startX,
int startY,
int destX,
int destY,
359 unsigned char walkmask,
int maxCost = 20);
std::list< Actor * > Actors
An animation consists of several frames, each with their own delay and offset.
A central point of control for graphics.
Defines a class for loading and storing images.
Image * getTile(int x, int y) const
Get tile image, with x and y in layer coordinates.
bool mIsFringeLayer
Whether the actors are drawn.
void setTile(int x, int y, Image *img)
Set tile image, with x and y in layer coordinates.
void setTile(int index, Image *img)
Set tile image with x + y * width already known.
bool isFringeLayer() const
int getTileDrawWidth(int x1, int y1, int endX, int &width) const
void draw(Graphics *graphics, int startX, int startY, int endX, int endY, int scrollX, int scrollY, const Actors &actors, int debugFlags) const
Draws this layer to the given graphics context.
std::string getMusicFile() const
Path findPixelPath(int startPixelX, int startPixelY, int destPixelX, int destPixelY, int radius, unsigned char walkmask, int maxCost=20)
Find a pixel path from one location to the next using free offsets.
TileAnimation * getAnimationForGid(int gid)
Gets the tile animation for a specific gid.
void update(int dt)
Updates animations.
std::vector< AmbientLayer > mBackgrounds
std::vector< MapLayer * > mLayers
void draw(Graphics *graphics, int scrollX, int scrollY)
Draws the map to the given graphics output.
void initializeParticleEffects(Particle *particleEngine)
Initializes all added particle effects.
int getHeight() const
Returns the height of this map in tiles.
int getTileHeight() const
Returns the tile height used by this map.
void addLayer(MapLayer *layer)
Adds a layer to this map.
void removeActor(Actors::iterator iterator)
Removes an actor from the map.
std::string getName() const
Path findPath(int startX, int startY, int destX, int destY, unsigned char walkmask, int maxCost=20)
Find a path from one location to the next in tile coordinates.
void addAnimation(int gid, TileAnimation animation)
Adds a tile animation to the map.
int getDebugFlags() const
void updateAmbientLayers(float scrollX, float scrollY)
Updates scrolling of ambient layers.
std::string getFilename() const
Gives the map id based on filepath (ex: 009-1)
MetaTile * getMetaTile(int x, int y) const
Get tile reference.
std::vector< Tileset * > mTilesets
Position checkNodeOffsets(int radius, unsigned char walkMask, int x, int y) const
int getWidth() const
Returns the width of this map in tiles.
void initializeAmbientLayers()
Initialize ambient layers.
void setDebugFlags(int flags)
void drawAmbientLayers(Graphics *graphics, LayerType type, float scrollX, float scrollY, int detail)
Draws the foreground or background layers to the given graphics output.
int getTileWidth() const
Returns the tile width of this map.
void drawCollision(Graphics *graphics, int scrollX, int scrollY, int debugFlags) const
Visualizes collision layer for debugging.
bool occupied(int x, int y) const
Tells whether a tile is occupied by a being.
void blockTile(int x, int y, BlockType type)
Marks a tile as occupied.
std::vector< AmbientLayer > mForegrounds
Tileset * getTilesetWithGid(unsigned gid) const
Finds the tile set that a tile with the given global id is part of.
std::list< ParticleEffectData > particleEffects
Position checkNodeOffsets(int radius, unsigned char walkMask, const Position &position) const
Check the current position against surrounding blocking tiles, and correct the position offset within...
bool contains(int x, int y) const
Tells whether the given coordinates fall within the map boundaries.
Vector getTileCenter(int x, int y) const
Returns the tile center position in pixel coordinates.
std::map< int, TileAnimation > mTileAnimations
unsigned * mOccupation[NB_BLOCKTYPES]
Blockmasks for different entities.
void addTileset(Tileset *tileset)
Adds a tileset to this map.
bool getWalk(int x, int y, unsigned char walkmask=BLOCKMASK_WALL) const
Gets walkability for a tile with a blocking bitmask.
Path findTilePath(int startPixelX, int startPixelY, int endPixelX, int endPixelY, unsigned char walkMask, int maxCost=20)
Find a tile-centered path in pixel coordinates from one location to the next.
void addParticleEffect(const std::string &effectFile, int x, int y, int w=0, int h=0)
Adds a particle effect.
@ DEBUG_BEING_COLLISION_RADIUS
Actors::iterator addActor(Actor *actor)
Adds an actor to the map.
A particle spawned by a ParticleEmitter.
A class holding a set of properties.
This class is a leightweight alternative to the Sprite class.
Animation cycle of a tile image which changes the map accordingly.
std::vector< std::pair< MapLayer *, int > > mAffected
void addAffectedTile(MapLayer *layer, int index)
SimpleAnimation mAnimation
A tileset, which is basically just an image set but it stores a firstgid.
Particle * particleEngine
const int DEFAULT_TILE_LENGTH
std::list< Position > Path
A position along a being's path.