X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Ftexture_manager.cpp;h=d45eb84f8bffe255d9143f7c3054d4e387751ff6;hb=6cd71a8644049d1951b5a9702a57ad02a7971c1e;hp=255efba48d04a10b392105cb77f15621c3334f8e;hpb=5a4ba5e7cfc6b0eaaa5a9f021443bec3a30adca2;p=supertux.git diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index 255efba48..d45eb84f8 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -1,3 +1,22 @@ +// $Id$ +// +// SuperTux +// Copyright (C) 2006 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + #include #include "texture_manager.hpp" @@ -14,7 +33,7 @@ #include "image_texture.hpp" #include "glutil.hpp" #include "file_system.hpp" -#include "msg.hpp" +#include "log.hpp" TextureManager* texture_manager = NULL; @@ -28,7 +47,7 @@ TextureManager::~TextureManager() i != image_textures.end(); ++i) { if(i->second == NULL) continue; - msg_warning << "Texture '" << i->first << "' not freed" << std::endl; + log_warning << "Texture '" << i->first << "' not freed" << std::endl; delete i->second; } } @@ -118,7 +137,7 @@ TextureManager::create_image_texture(const std::string& filename) SDL_FreeSurface(convert); throw; } - + SDL_FreeSurface(convert); return result; } @@ -164,7 +183,7 @@ TextureManager::save_texture(Texture* texture) size_t pixelssize = saved_texture.width * saved_texture.height * 4; saved_texture.pixels = new char[pixelssize]; - + glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, saved_texture.pixels); @@ -185,11 +204,11 @@ TextureManager::reload_textures() glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - + for(std::vector::iterator i = saved_textures.begin(); i != saved_textures.end(); ++i) { SavedTexture& saved_texture = *i; - + GLuint handle; glGenTextures(1, &handle); assert_gl("creating texture handle"); @@ -217,4 +236,3 @@ TextureManager::reload_textures() saved_textures.clear(); } -