void PictureBank::setPicture(const std::string &name, SDL_Surface &surface) { // first: we deallocate the current picture, if any unsigned int picId = StringHelper::hash( name ); Impl::ItPicture it = _d->resources.find( picId ); if( it != _d->resources.end() ) { SDL_FreeSurface( it->second.getSurface()); } _d->resources[ picId ] = makePicture(&surface, name); }
/* create a blank picture of the specified size */ extern "C" Picture * rMakePicture (int cols, int rows) { return (new PicturePtr (makePicture (cols, rows)))->get(); }