~ubuntu-branches/ubuntu/saucy/lordsawar/saucy

« back to all changes in this revision

Viewing changes to src/smallmap.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2008-12-20 13:52:12 UTC
  • mfrom: (1.1.6 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081220135212-noeb2w3y98ebo7o9
Tags: 0.1.4-1
[ Barry deFreese ]
* New upstream release.
* Move 0.0.8-2.1 changelog entry to correct point in changelog.
* Make lordsawar-data suggest lordsawar.
* Update my e-mail address.
* Add build-depends on intltool, uuid-dev, and libboost-dev.
* Don't install locales since there are no translations currently.
* Add simple man page for new lordsawar-pbm binary.
* Drop gcc4.3 patches as they have been fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "vector.h"
29
29
 
 
30
#include "GameScenarioOptions.h"
30
31
#include "smallmap.h"
31
32
#include "sdl-draw.h"
32
33
#include "timing.h"
36
37
SmallMap::SmallMap()
37
38
{
38
39
    input_locked = false;
 
40
    view.pos = Vector<int>(0, 0);
 
41
    view.dim = Vector<int>(3, 3);
39
42
}
40
43
 
41
44
void SmallMap::set_view(Rectangle new_view)
43
46
    if (view != new_view)
44
47
    {
45
48
        view = new_view;
46
 
        draw();
 
49
        draw(Playerlist::getActiveplayer());
47
50
    }
48
51
}
49
52
 
96
99
    slide_view(Rectangle(pos.x, pos.y, view.w, view.h));
97
100
  else
98
101
    set_view(Rectangle(pos.x, pos.y, view.w, view.h));
99
 
          
 
102
 
100
103
  view_changed.emit(view);
101
104
}
102
105
 
103
106
void SmallMap::after_draw()
104
107
{
 
108
  Player *p = getViewingPlayer();
105
109
  OverviewMap::after_draw();
106
 
  if (Playerlist::getActiveplayer()->getType() == Player::HUMAN ||
107
 
      Configuration::s_hidden_map == false)
 
110
  if (p->getType() == Player::HUMAN ||
 
111
      GameScenarioOptions::s_hidden_map == false)
 
112
    {
 
113
      draw_cities(false);
 
114
      draw_selection();
 
115
    }
 
116
  //for the editor...
 
117
  if (GameScenarioOptions::s_round == 0)
108
118
    {
109
119
      draw_cities(false);
110
120
      draw_selection();
159
169
    {
160
170
      while (1)
161
171
        {
162
 
          if (Playerlist::isFinished()) //window closed while ai player moves
163
 
              return;
164
172
          Rectangle tmp_view(view);
165
173
          tmp_view.x = slide(tmp_view.x, new_view.x);
166
174
          tmp_view.y = slide(tmp_view.y, new_view.y);
167
175
 
168
176
          view = tmp_view;
169
 
          draw();
 
177
          draw(Playerlist::getActiveplayer());
170
178
          view_slid.emit(view);
171
179
 
172
180
          if (tmp_view.x == new_view.x && tmp_view.y == new_view.y)