ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

bitmap_component.cpp

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "engines/grim/objectstate.h"
00024 #include "engines/grim/grim.h"
00025 #include "engines/grim/debug.h"
00026 #include "engines/grim/set.h"
00027 
00028 #include "engines/grim/costume/bitmap_component.h"
00029 
00030 namespace Grim {
00031 
00032 
00033 BitmapComponent::BitmapComponent(Component *p, int parentID, const char *filename, tag32 t) :
00034         Component(p, parentID, filename, t) {
00035 
00036 }
00037 
00038 void BitmapComponent::setKey(int val) {
00039     ObjectState *state = g_grim->getCurrSet()->findState(_name);
00040 
00041     if (state) {
00042         state->setActiveImage(val);
00043         return;
00044     }
00045     // Complain that we couldn't find the bitmap.  This means we probably
00046     // didn't handle something correctly.  Example: Before the tube-switcher
00047     // bitmaps were not loading with the scene. This was because they were requested
00048     // as a different case then they were stored (tu_0_dorcu_door_open versus
00049     // TU_0_DORCU_door_open), which was causing problems in the string comparison.
00050     Debug::warning(Debug::Bitmaps | Debug::Costumes, "Missing scene bitmap: %s", _name.c_str());
00051 
00052 /* In case you feel like drawing the missing bitmap anyway...
00053     // Assume that all objects the scene file forgot about are OBJSTATE_STATE class
00054     state = new ObjectState(0, ObjectState::OBJSTATE_STATE, bitmap, NULL, true);
00055     if (!state) {
00056         if (gDebugLevel == DEBUG_BITMAPS || gDebugLevel == DEBUG_WARN || gDebugLevel == DEBUG_ALL)
00057             warning("Couldn't find bitmap %s in current scene", _filename.c_str());
00058         return;
00059     }
00060     g_grim->getCurrSet()->addObjectState(state);
00061     state->setNumber(val);
00062 */
00063 }
00064 
00065 } // end of namespace Grim


Generated on Sat Jul 20 2019 05:00:49 for ResidualVM by doxygen 1.7.1
curved edge   curved edge