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

engines/stark/gfx/texture.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 AUTHORS
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/stark/gfx/texture.h"
00024 
00025 #include "graphics/surface.h"
00026 
00027 namespace Stark {
00028 namespace Gfx {
00029 
00030 Texture::Texture() :
00031         _width(0),
00032         _height(0) {
00033 }
00034 
00035 Texture::~Texture() {
00036 }
00037 
00038 TextureSet::TextureSet() {
00039 }
00040 
00041 TextureSet::~TextureSet() {
00042     for (TextureMap::iterator it = _texMap.begin(); it != _texMap.end(); ++it) {
00043         delete it->_value;
00044     }
00045 }
00046 
00047 void TextureSet::addTexture(const Common::String &name, Texture *texture) {
00048     if (_texMap.contains(name)) {
00049         error("A texture with the name '%s' already exists in the set.", name.c_str());
00050     }
00051 
00052     _texMap.setVal(name, texture);
00053 }
00054 
00055 const Texture *TextureSet::getTexture(const Common::String &name) const {
00056     TextureMap::const_iterator it = _texMap.find(name);
00057     if (it != _texMap.end())
00058         return it->_value;
00059 
00060     return nullptr;
00061 }
00062 
00063 } // End of namespace Gfx
00064 } // End of namespace Stark


Generated on Sat May 25 2019 05:00:55 for ResidualVM by doxygen 1.7.1
curved edge   curved edge