1 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 #include "gui/image-helpers.h"
28 #include "historymap.h"
32 #include "GraphicsCache.h"
34 HistoryMap::HistoryMap(LocationList<City*> *clist, LocationList<Ruin*> *rlist)
40 void HistoryMap::after_draw()
42 OverviewMap::after_draw();
45 map_changed.emit(surface);
48 void HistoryMap::drawRuins()
50 GraphicsCache *gc = GraphicsCache::getInstance();
52 // Draw all cities as shields over the city location, in the colors of
54 LocationList<Ruin*>::iterator it = d_rlist->begin();
55 for (; it != d_rlist->end(); it++)
59 if (ruin->isVisible(Playerlist::getViewingplayer()) == false)
61 if (ruin->isSearched() == false)
63 if (ruin->isHidden() == true && ruin->getOwner() !=
64 Playerlist::getInstance()->getActiveplayer())
67 tmp = gc->getShieldPic(1, ruin->getOwner());
69 PixMask::scale(tmp, tmp->get_width()/2, tmp->get_height()/2);
71 Vector<int> pos = (*it)->getPos();
72 pos = mapToSurface(pos);
73 tmp->blit_centered(surface, pos);
78 void HistoryMap::drawCities()
80 GraphicsCache *gc = GraphicsCache::getInstance();
82 // Draw all cities as shields over the city location, in the colors of
84 LocationList<City*>::iterator it = d_clist->begin();
85 for (; it != d_clist->end(); it++)
88 if ((*it)->isVisible(Playerlist::getViewingplayer()) == false)
90 if ((*it)->isBurnt() == true)
91 tmp = gc->getSmallRuinedCityPic();
93 tmp = gc->getShieldPic(0, (*it)->getOwner());
95 Vector<int> pos = (*it)->getPos();
96 pos = mapToSurface(pos);
97 tmp->blit_centered(surface, pos);
101 void HistoryMap::updateCities (LocationList<City*> *clist, LocationList<Ruin*> *rlist)
105 draw(Playerlist::getViewingplayer());