GRIM: Hide the zbuffer bitmap if it doesn't have the wanted image. Fix #296

This commit is contained in:
Giulio Camuffo 2011-07-27 16:30:59 +02:00
parent 2d9b1240ce
commit 075c1cae7d
3 changed files with 16 additions and 3 deletions

View file

@ -296,6 +296,14 @@ void Bitmap::draw() const {
g_driver->drawBitmap(this);
}
void Bitmap::setNumber(int n) {
if ((n - 1) >= _data->_numImages) {
warning("Bitmap::setNumber: no anim image: %d. (%s)", n, _data->_fname.c_str());
} else {
_currImage = n;
}
}
Bitmap::~Bitmap() {
--_data->_refCount;
if (_data->_refCount < 1) {