scummvm/engines/grim/objectstate.cpp

51 lines
1.6 KiB
C++
Raw Normal View History

2009-05-26 14:13:08 +00:00
/* Residual - A 3D game interpreter
*
* Residual is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the AUTHORS
* file distributed with this source distribution.
2006-04-02 14:20:45 +00:00
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* $URL$
* $Id$
*
*/
2005-01-01 10:23:18 +00:00
#include "engines/grim/objectstate.h"
2004-03-22 11:24:01 +00:00
2009-05-25 06:49:57 +00:00
namespace Grim {
2004-12-09 23:55:43 +00:00
ObjectState::ObjectState(int setupID, ObjectState::Position pos, const char *bitmap, const char *zbitmap, bool visible) :
_setupID(setupID), _pos(pos) {
_bitmap = g_resourceloader->loadBitmap(bitmap);
2004-03-22 11:24:01 +00:00
if (zbitmap)
_zbitmap = g_resourceloader->loadBitmap(zbitmap);
int initialImage = 0;
if (visible)
2005-03-20 21:04:01 +00:00
initialImage = 1;
2004-12-09 23:55:43 +00:00
_bitmap->setNumber(initialImage);
if (_zbitmap)
_zbitmap->setNumber(initialImage);
2004-03-22 11:24:01 +00:00
}
2005-04-08 12:09:17 +00:00
ObjectState::~ObjectState() {
g_resourceloader->uncache(_bitmap->getFilename());
if (_zbitmap)
g_resourceloader->uncache(_zbitmap->getFilename());
}
2009-05-25 06:49:57 +00:00
} // end of namespace Grim