~thindil/steamfort/development

« back to all changes in this revision

Viewing changes to src/designation.cpp

  • Committer: thindil
  • Date: 2011-08-06 10:59:30 UTC
  • Revision ID: thindil@tuxfamily.org-20110806105930-dohs5gg7omjo0h2v
continue work on walls

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
                      }
175
175
                }
176
176
            }
 
177
          if ((designtype == 3) || (designtype == 4))
 
178
            {
 
179
              TCODLine::init(started[0], started[1], mouse->cx, mouse->cy);
 
180
              drawx = started[0];
 
181
              drawy = started[1];
 
182
              do
 
183
                {
 
184
                  if (fortmap[drawy + screeny][drawx + screenx].walkable)
 
185
                    {
 
186
                      fovmap->setProperties(drawx + screenx, drawy + screeny, true, false);
 
187
                      fortmap[drawy + screeny][drawx + screenx].walkable = false;
 
188
                      fortmap[drawy + screeny][drawx + screenx].color = TCODColor::black;
 
189
                      fortmap[drawy + screeny][drawx + screenx].ch = 'X';
 
190
                      //Remove all items
 
191
                      if (!fortmap[drawy + screeny][drawx + screenx].items.isEmpty())
 
192
                        {
 
193
                          for (int i = 0; i < fortmap[drawy + screeny][drawx + screenx].items.size(); i++)
 
194
                            {
 
195
                              index = fortmap[drawy + screeny][drawx + screenx].items.get(i);
 
196
                              if (fortobjs[index].types.contains(VEIN))
 
197
                                {
 
198
                                  continue;
 
199
                                }
 
200
                              fortobjs[index].setitem(drawx + screenx, drawy + screeny, index);
 
201
                            }
 
202
                          fortmap[drawy + screeny][drawx + screenx].items.clear();
 
203
                        }
 
204
                    }
 
205
                } while(!TCODLine::step(&drawx,&drawy));
 
206
            }
177
207
          if (designated[TREE].size() == 0)
178
208
            {
179
209
              designated[TREE].clear();
195
225
  if (started[0] != NONE)
196
226
    {
197
227
      draw_fort();
198
 
      offconsole->clear();
199
 
      TCODConsole::blit(offconsole, 0, 0, width, height, TCODConsole::root, drawx, drawy, 1.0, 0.5);
 
228
      if (designtype < 3)
 
229
        {
 
230
          offconsole->clear();
 
231
          TCODConsole::blit(offconsole, 0, 0, width, height, TCODConsole::root, drawx, drawy, 1.0, 0.5);
 
232
        }
 
233
      else
 
234
        {
 
235
          TCODLine::init(started[0], started[1], mouse->cx, mouse->cy);
 
236
          drawx = started[0];
 
237
          drawy = started[1];
 
238
          do
 
239
            {
 
240
              if (fortmap[drawy + screeny][drawx + screenx].walkable)
 
241
                {
 
242
                  TCODConsole::root->putCharEx(drawx, drawy, ' ', TCODColor::black, TCODColor::black);
 
243
                }
 
244
              else
 
245
                {
 
246
                  TCODConsole::root->putCharEx(drawx, drawy, 'X', TCODColor::red, TCODColor::black);
 
247
                }
 
248
            } while(!TCODLine::step(&drawx,&drawy));
 
249
        }
200
250
    }
201
251
}