Here is a snippet of the code that's causing the problem. 'tiles' is a list of class 'tile' that contains x and y coords as well as an image. Each tile is supposed to be drawn into 'out' at the coords it specifies:
Code: Select all
int prev_id = 0;
tile *tl = NULL;
list<Drawable> ts;
for (tiles_it = tiles.begin(); tiles_it != tiles.end(); tiles_it++) {
//if we've come upon a new tile
//draw out any waiting images and load up the new tile
if ((*tiles_it).id() != prev_id) {
if (ts.empty() == false) {
/**************
out.draw(ts) is the line that fails!
**************/
out.draw(ts);
ts.clear();
}
prev_id = (*tiles_it).id();
//unload the image now that we're done with it
if (tl != NULL)
tl->remove_image(base_size);
tl = &(*tiles_it);
}
//add the current tile to the list of images to be drawn
try {
//I have verified that tl->get_image() is indeed working
//it returns a reference to an Image that is supposed to
//be drawn
ts.push_back(DrawableCompositeImage((*tiles_it).x() * base_size, (*tiles_it).y() * base_size, tl->get_image(base_size)));
} catch (exception &e) {
throw;
}
}
Code: Select all
assert(image != (const Image *) NULL);