/* game.cpp - global variables and bitmap pool Copyright (C) 2006 Mark boyd 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 fun to play, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "game.h" #include "movers.h" #include "etc.h" #include "loadimag.h" #include SDL_Surface *bitmap_pool::get_bitmap(const std::string &name) { m_map_t::iterator i = m_map.find(name); if (i != m_map.end()) return i->second; m_map[name] = load_image(name); return m_map[name]; } bitmap_pool::~bitmap_pool() { for (m_map_t::iterator i=m_map.begin(); i!=m_map.end(); ++i) { SDL_FreeSurface(i->second); } } game::game() { m_key_flags.up=false; m_key_flags.left=false; m_key_flags.right=false; m_key_flags.tractor=false; m_key_flags.fire=false; } game *game::the_game;