49 vector <animation *>::iterator i;
51 for (i = anim.begin (); i != anim.end (); i++)
59 vector <animation *>::iterator i;
61 for (i = anim.begin (); i != anim.end (); i++)
69 vector <animation *>::iterator i;
71 for (i = anim.begin (); i != anim.end (); i++)
72 (*i)->draw (x, y, da_opt, target);
95 for (i = 0; i < nbr_of_parts; i++)
98 anim.back ()->get (file);
99 anim.back ()->play ();
119 retvalue =
get (file);
154 retvalue =
put (file);
161 vector <animation *>::iterator i;
174 vector <animation *>::iterator i;
194 vector <animation *>::iterator it;
195 for (it = ((
mapobject&) src).anim.begin (); it != ((
mapobject&) src).anim.end (); it++)
void draw(s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
Draw the object on the screen.
Class to write data from a Gzip compressed file.
void close()
Close the file that was opened.
Declares the mapobject class.
Class to read data from a Gzip compressed file.
#define u_int16
16 bits long unsigned integer
s_int8 load(string fname)
Loads a mapobject from it's filename.
Class where drawables can actually be drawn to.
u_int16 nbr_of_animations() const
Returns the number of animations of this mapobject.
s_int8 insert_animation(animation *an, u_int16 pos)
Inserts an animation at a given position of the animations array.
bool open(const string &fname)
Opens a file for write access.
bool open(const string &fname)
Opens a file for read access.
static bool get_version(igzstream &file, u_int16 min, u_int16 max, string name)
bool is_open()
Returns whether the file is opened or not.
Implements "drawing zones" for drawing operations.
s_int8 delete_animation(u_int16 pos)
Removes an animation at a given position.
void clear()
Totally clears the area.
#define s_int16
16 bits long signed integer
u_int16 base_x() const
Returns the X offset of the base square of this object.
void play()
Starts the playback of the animation.
void draw_from_base(s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
Similar to draw (), but assume the x and y parameters are where the base square should appear...
const u_int16 MAPSQUARE_SIZE
Size of a mapsquare (in pixels).
mapobject & operator=(const mapobject &mo)
Mapobject copy (similar to copy ()).
Area of mapsquare_walkables, for use with mapcharacter and mapobject classes.
s_int8 put(ogzstream &file) const
Saves an area into an opened file.
mapobject()
Default constructor.
bool update()
Updates the mapobject's state.
static void put_version(ogzstream &file, u_int16 version)
Sets the version number of a file.
Class that handles animated elements, their update and their playback.
s_int8 get(igzstream &file)
Loads an area from an opened file.
u_int16 base_y() const
Returns the Y offset of the base square of this object.
s_int8 get(igzstream &file)
Loads a mapobject from an opened file.
s_int8 save(string fname) const
Saves an mapobject into an file, in game format, with alpha and mask values.
#define s_int8
8 bits long signed integer
Objects that can be placed on a landmap.
s_int8 put(ogzstream &file) const
Saves an mapobject into an opened file, in game format, with alpha and mask values.
#define MAPOBJECTS_DIR
Where the mapobjects resides in the data tree.
void clear()
Resets the mapobject to its post-constructor state.