Advanced Strategic Command
dashboard.cpp
Go to the documentation of this file.
1 
6 /***************************************************************************
7  dashboard.cpp - description
8  -------------------
9  begin : Sat Jan 27 2001
10  copyright : (C) 2001 by Martin Bickel
11  email : bickel@asc-hq.org
12  ***************************************************************************/
13 
14 /***************************************************************************
15  * *
16  * This program is free software; you can redistribute it and/or modify *
17  * it under the terms of the GNU General Public License as published by *
18  * the Free Software Foundation; either version 2 of the License, or *
19  * (at your option) any later version. *
20  * *
21  ***************************************************************************/
22 
23  #include "sigc++/adaptors/retype.h"
24 
25 #include "dashboard.h"
26 #include "graphics/blitter.h"
27 #include "graphics/drawing.h"
28 #include "gamemap.h"
29 #include "iconrepository.h"
30 #include "spfst.h"
31 #include "pgimage.h"
32 #include "textfiletags.h"
33 #include "mapdisplay.h"
34 #include "dialogs/unitinfodialog.h"
36 #include "gameoptions.h"
38 #include "dialogs/unitnaming.h"
40 #include "widgets/textrenderer.h"
41 
42 #include "sg.h"
43 #include "spfst-legacy.h"
45 
46 class WeaponInfoLine;
47 
48 class WeaponInfoPanel : public Panel
49 {
50  int weaponCount;
51  static ASCString name;
52 
53  vector<WeaponInfoLine*> weaponInfoLines;
54 
55  protected:
56  bool onClick ( PG_MessageObject* obj, const SDL_MouseButtonEvent* event );
57  void painter ( const PG_Rect &src, const ASCString& name, const PG_Rect &dst);
58 
59  bool eventMouseMotion(const SDL_MouseMotionEvent* motion);
60 
61  public:
62  WeaponInfoPanel (PG_Widget *parent, const Vehicle* veh, const VehicleType* vt ) ;
63  void showWeapon( const SingleWeapon* weap = NULL );
64 
65  // virtual bool eventMouseButtonDown (const SDL_MouseButtonEvent *button);
66  bool eventMouseButtonUp (const SDL_MouseButtonEvent *button);
67 
68  static const ASCString& WIP_Name();
69  // void eval();
70 };
71 
72 
73 class ExperienceOverview : public PG_Widget
74 {
75  static const int columns = 4;
76  protected:
77  bool eventMouseButtonUp (const SDL_MouseButtonEvent *button) {
78  QuitModal();
79  return true;
80  };
81 
82  static PG_Rect getSize( const PG_Point& pos ) {
83  const Surface& s = IconRepository::getIcon("experience0.png");
84  return PG_Rect( pos.x, pos.y, columns * s.w(), (AttackFormula::experienceIcons + columns-1)/columns * s.h() );
85  }
86 
87  public:
88  ExperienceOverview( const PG_Point& pos, int exp = -1 ) : PG_Widget( NULL, getSize(pos), true ) {
89  // PG_Application::GetApp()->sigMouseButtonUp.connect( sigc::mem_fun( *this, &ExperienceOverview::QuitModal ));
90  }
91 
92 
93  int RunModal() {
94  SetCapture();
95  return PG_Widget::RunModal();
96  }
97 
98  void eventDraw (SDL_Surface *surface, const PG_Rect &rect) {
99  const Surface& s = IconRepository::getIcon("experience0.png");
100  int width = s.w();
101  int height = s.h();
102 
103  Surface s2 = Surface::Wrap( surface );
104  for ( int i = 0; i < AttackFormula::experienceIcons; ++i )
105  s2.Blit( IconRepository::getIcon("experience" + ASCString::toString(i) + ".png"), SPoint( i % columns * width , i/columns*height) );
106  }
107 };
108 
109 DashboardPanel::DashboardPanel ( PG_Widget *parent, const PG_Rect &r, const ASCString& panelName_, bool loadTheme = true )
110  :LayoutablePanel ( parent, r, panelName_, loadTheme ), veh(NULL), bld(NULL)
111 {
112  updateFieldInfo.connect ( sigc::mem_fun( *this, &DashboardPanel::eval ));
113  registerSpecialDisplay( "windarrow" );
114 
115  registerSpecialDisplay( "unitexp" );
116  registerSpecialDisplay( "unitexpdefensive" );
117  registerSpecialDisplay( "unit_level" );
118  registerSpecialDisplay( "unit_pic" );
119  for ( int i = 0; i < 10; ++i)
120  registerSpecialDisplay( "symbol_weapon" + ASCString::toString(i) );
121  registerSpecialDisplay( "showplayercolor0" );
122  registerSpecialDisplay( "showplayercolor1" );
123  registerSpecialDisplay( "field_weather" );
124 
125  ContainerBase::anyContainerDestroyed.connect( sigc::mem_fun( *this, &DashboardPanel::containerDeleted ));
126 
127  GameMap::sigMapDeletion.connect( sigc::mem_fun( *this, &DashboardPanel::reset ));
128 
129  PG_Widget* w = parent->FindChild( "unitexp", true );
130  if ( w )
131  w->sigMouseButtonDown.connect( sigc::hide( sigc::hide( sigc::mem_fun( *this, &DashboardPanel::viewExperienceOverview ))));
132 };
133 
135 {
136  PG_Widget* w = GetParent()->FindChild( "unitexp", true );
137  if ( w ) {
138  ExperienceOverview eo(PG_Point( w->my_xpos, w->my_ypos ));
139  eo.Show();
140  eo.RunModal();
141  return true;
142  } else
143  return false;
144 }
145 
146 
147 void DashboardPanel::containerDeleted( ContainerBase* c )
148 {
149  if ( c == veh )
150  veh = NULL;
151 
152  if ( c == bld )
153  bld = NULL;
154 }
155 
156 
157 bool DashboardPanel::containerRenamed( PG_LineEdit* lineEdit )
158 {
159  if ( veh ) {
160  if ( veh->getMap()->actplayer == veh->getOwner() )
161  veh->name = lineEdit->GetText();
162  else
163  lineEdit->SetText( veh->name );
164  }
165 
166  if ( bld ) {
167  if ( bld->getMap()->actplayer == bld->getOwner() )
168  bld->name = lineEdit->GetText();
169  else
170  lineEdit->SetText( bld->name );
171  }
172 
173  return true;
174 }
175 
177 {
178  if ( veh && veh->getMap() == &map )
179  veh = NULL;
180 
181  if ( bld && bld->getMap() == &map )
182  bld = NULL;
183 }
184 
185 
186 
188 {
189  SpecialDisplayWidget* sdw = dynamic_cast<SpecialDisplayWidget*>( FindChild( name, true ) );
190  if ( sdw )
191  sdw->display.connect( sigc::mem_fun( *this, &DashboardPanel::painter ));
192 }
193 
194 
195 void DashboardPanel::painter ( const PG_Rect &src, const ASCString& name, const PG_Rect &dst)
196 {
197  if ( !actmap || actmap->actplayer < 0 || actmap->actplayer > 8 )
198  return;
199 
200  Surface screen = Surface::Wrap( PG_Application::GetScreen() );
201 
202  if ( name == "windarrow" ) {
203  if ( actmap && actmap->weather.windSpeed > 0 ) {
205  blitter.setAngle( (6 - actmap->weather.windDirection) * (360 /6));
206  blitter.blit ( IconRepository::getIcon("wind-arrow.png"), screen, SPoint(dst.x, dst.y) );
207  }
208  return;
209  }
210 
211  if( name == "showplayercolor0" || name == "showplayercolor1" ) {
213  blitter.setColor( actmap->player[actmap->actplayer].getColor() );
214  // blitter.setPlayer(actmap->actplayer);
215  blitter.blit( IconRepository::getIcon("show_playercolor.png"), screen, SPoint(dst.x, dst.y));
216  return;
217  }
218 
219 
220  if ( name == "field_weather" ) {
222  if ( actmap && mc.valid() && fieldvisiblenow( actmap->getField(mc), actmap->getPlayerView() ) ) {
224 
225  static const char* weathernames[] = {"terrain_weather_dry.png",
226  "terrain_weather_lightrain.png",
227  "terrain_weather_heavyrain.png",
228  "terrain_weather_lightsnow.png",
229  "terrain_weather_heavysnow.png",
230  "terrain_weather_ice.png"
231  };
232 
233  blitter.blit ( IconRepository::getIcon(weathernames[actmap->getField(mc)->getWeather()]), screen, SPoint(dst.x, dst.y) );
234  }
235  return;
236  }
237 
238 
239 
240 
241 
243  return;
244 
245 
246 
247  if ( name == "unitexp" ) {
248  int idx = 0;
249  if ( veh ) {
250  AttackFormula af ( veh->getMap() );
251  idx = af.getIconIndex( veh->getExperience_offensive(), true );
252  }
253 
254  screen.Blit( IconRepository::getIcon("experience" + ASCString::toString(idx) + ".png"), SPoint(dst.x, dst.y) );
255  }
256 
257  if ( name == "unitexpdefensive" ) {
258  int idx = 0;
259  if ( veh ) {
260  AttackFormula af ( veh->getMap() );
261  idx = af.getIconIndex( veh->getExperience_defensive(), false );
262  }
263  screen.Blit( IconRepository::getIcon("experience" + ASCString::toString(idx) + ".png"), SPoint(dst.x, dst.y) );
264  }
265 
266  if ( name == "unit_level" ) {
267  int height1 = 0;
268  int height2 = 0;
269  int player = actmap->actplayer;
270  if ( veh ) {
271  height1 = veh->height;
272  height2 = veh->typ->height;
273  player = veh->getOwner();
274  }
275 
276  for ( int i = 0; i < 8; ++i ) {
277  if ( height1 & (1 << i )) {
279  blitter.setColor( actmap->player[player].getColor() );
280  // blitter.setPlayer( player );
281  blitter.blit( IconRepository::getIcon("height-b" + ASCString::toString(i) + ".png"), screen, SPoint(dst.x, dst.y + (7-i) * 13));
282  } else if ( height2 & (1 << i ))
283  screen.Blit( IconRepository::getIcon("height-a" + ASCString::toString(i) + ".png"), SPoint(dst.x, dst.y + (7-i) * 13 ) );
284 
285  }
286  }
287 
288  if ( name == "unit_pic" ) {
289  if ( veh )
290  veh->typ->paint( screen, SPoint( dst.x, dst.y ), veh->getOwningPlayer().getPlayerColor() );
291  }
292 
293  if ( veh ) {
294  int pos = 0;
295  for ( int i = 0; i < veh->typ->weapons.count; ++i) {
296  if ( !veh->typ->weapons.weapon[i].service() && pos < 10 ) {
297  if ( name == "symbol_weapon" + ASCString::toString(pos) )
298  screen.Blit( IconRepository::getIcon(SingleWeapon::getIconFileName( veh->typ->weapons.weapon[i].getScalarWeaponType()) + "-small.png"), SPoint(dst.x, dst.y));
299 
300  ++pos;
301  }
302  }
303  }
304 
305 }
306 
307 
309 {
310  if ( !actmap || actmap->actplayer < 0 )
311  return;
312 
313 
315  MapField* fld = actmap->getField(mc);
316 
317  Vehicle* veh = fld? fld->vehicle : NULL;
318 
319  BulkGraphicUpdates bgu( this );
320 
321  setBargraphValue( "winddisplay", float(actmap->weather.windSpeed ) / 255 );
322 
323  setLabelText( "windspeed", actmap->weather.windSpeed );
324 
325  if ( fld && mc.valid() && fieldvisiblenow( fld, actmap->getPlayerView() )) {
326  setLabelText( "terrain_harbour", fld->bdt.test(cbharbour) ? "YES" : "NO" );
327  setLabelText( "terrain_pipe", fld->bdt.test(cbpipeline) || fld->building ? "YES" : "NO" );
328 
329  setLabelText( "terrain_defencebonus", fld->getdefensebonus() );
330  setLabelText( "terrain_attackbonus", fld->getattackbonus() );
331  setLabelText( "terrain_jam", fld->getjamming() );
332  setLabelText( "terrain_name", fld->typ->terraintype->name );
333 
334  int unitspeed;
335  if ( veh )
336  unitspeed = getmaxwindspeedforunit ( veh );
337  else
338  unitspeed = maxint;
339 
340  int windspeed = actmap->weather.windSpeed*maxwindspeed ;
341  if ( unitspeed < 255*256 ) {
342  if ( windspeed > unitspeed*9/10 )
343  setBarGraphColor( "winddisplay", 0xff0000 );
344  else if ( windspeed > unitspeed*66/100 )
345  setBarGraphColor( "winddisplay", 0xffff00 );
346  else
347  setBarGraphColor( "winddisplay", 0x00ff00 );
348  } else
349  setBarGraphColor( "winddisplay", 0x00ff00 );
350 
351  } else {
352  setLabelText( "terrain_harbour", "" );
353  setLabelText( "terrain_pipe", "" );
354 
355  setLabelText( "terrain_defencebonus", "" );
356  setLabelText( "terrain_attackbonus", "" );
357  setLabelText( "terrain_jam", "" );
358  setLabelText( "terrain_name", "" );
359  setBarGraphColor( "winddisplay", 0x00ff00 );
360  }
361 
362  if ( mc.valid() && fld ) {
363  if ( veh && fieldvisiblenow( fld, actmap->getPlayerView() ) ) {
364  showUnitData( veh, NULL, fld );
365  } else {
366 
367  Building* bld = fld->building;
368  if ( bld && fieldvisiblenow( fld, actmap->getPlayerView() ) )
369  showUnitData( NULL, bld, fld );
370  else
371  showUnitData( NULL, NULL, fld );
372  }
373  }
374 
375  // PG_Application::SetBulkMode(false);
376  // Redraw(true);
377 }
378 void DashboardPanel::showUnitData( Vehicle* veh, Building* bld, MapField* fld, bool redraw )
379 {
380  int weaponsDisplayed = 0;
381  this->veh = veh;
382  this->bld = bld;
383 
384  bool bulk = PG_Application::GetBulkMode();
385  if ( redraw )
386  PG_Application::SetBulkMode(true);
387 
388 
389  if ( veh ) {
390  setLabelText( "unittypename", veh->typ->name );
391 
392  if ( !veh->privateName.empty() && veh->getOwner() == veh->getMap()->getPlayerView() )
393  setLabelText( "unitname", ">" + veh->privateName + "<" );
394  else if ( !veh->name.empty() )
395  setLabelText( "unitname", veh->name );
396  else
397  setLabelText( "unitname", veh->typ->description );
398 
399  // shows the number of experience points
400  setLabelText( "unitoffensiveexperience", veh->getExperience_offensive() );
401  setLabelText( "unitdefensiveexperience", veh->getExperience_defensive() );
402 
403 
404  // shows the bonus that the units gets because of its experience (in percent)
405  AttackFormula af( veh->getMap() );
406  setLabelText( "unitattackincrease", int( af.strength_experience( veh->getExperience_offensive() ) * 100));
407  setLabelText( "unitdefenseincrease", int( af.defense_experience( veh->getExperience_defensive() ) * 100));
408 
409  // the health of the unit
410  setBargraphValue( "unitdamage", float(100-veh->damage) / 100 );
411  setLabelText( "unitstatus", 100-veh->damage );
412 
413  // the resources of the unit
414  setBargraphValue( "unitfuel", veh->getStorageCapacity().fuel ? float( veh->getTank().fuel) / veh->getStorageCapacity().fuel : 0 );
415  setLabelText( "unitfuelstatus", veh->getTank().fuel );
416  setBargraphValue( "unitmaterial", veh->getStorageCapacity().material ? float( veh->getTank().material) / veh->getStorageCapacity().material : 0 );
417  setLabelText( "unitmaterialstatus", veh->getTank().material );
418  setBargraphValue( "unitenergy", veh->getStorageCapacity().energy ? float( veh->getTank().energy) / veh->getStorageCapacity().energy : 0 );
419  setLabelText( "unitenergystatus", veh->getTank().energy );
420 
421  // the time until the unit crashes because it is running out of fuel
422  int endurance = UnitHooveringLogic::getEndurance( veh );
423  if ( endurance >= 0 )
424  setLabelText( "unitEndurance", endurance );
425  else
426  setLabelText( "unitEndurance", "-" );
427 
428 
429  ASCString moveString = ASCString::toString( veh->getMovement() / 10 );
430  if ( veh->getMovement() % 10 )
431  moveString += "." + ASCString::toString(veh->getMovement()%10);
432 
433  setLabelText( "movepoints", moveString );
434 
435  if ( veh->typ->fuelConsumption )
436  setLabelText( "fuelrange", veh->getTank().fuel / veh->typ->fuelConsumption );
437  else
438  setLabelText( "fuelrange", "-" );
439 
440  setLabelText( "armor", veh->typ->armor );
441 
442  setLabelText( "jamming", veh->typ->jamming );
443  setLabelText( "view", veh->typ->view );
444 
445  int &pos = weaponsDisplayed;
446  for ( int i = 0; i < veh->typ->weapons.count; ++i) {
447  if ( !veh->typ->weapons.weapon[i].service() && pos < 10 ) {
448  ASCString ps = ASCString::toString(pos);
449  setLabelText( "punch_weapon" + ps, veh->typ->weapons.weapon[i].maxstrength );
451  setLabelText( "RF_weapon" + ps, "-" );
452  else
453  setLabelText( "RF_weapon" + ps, veh->typ->weapons.weapon[i].reactionFireShots );
454  setLabelText( "status_ammo" + ps, veh->ammo[i] );
455  setBargraphValue( "bar_ammo" + ps, veh->typ->weapons.weapon[i].count ? float(veh->ammo[i]) / veh->typ->weapons.weapon[i].count : 0 );
456  ++pos;
457  }
458  }
459 
460  if ( veh->typ->infoImageSmallFilename.length() > 0 ) {
461  setImage( "Selected3DImageSmall", veh->typ->infoImageSmallFilename, this );
462  show( "Selected3DImageSmall" );
463  } else
464  hide( "Selected3DImageSmall" );
465 
466  } else {
467  if ( bld ) {
468  setLabelText( "unittypename", bld->typ->name );
469 
470  if ( !bld->privateName.empty() && bld->getOwner() == bld->getMap()->getPlayerView())
471  setLabelText( "unitname", ">" + bld->privateName + "<" );
472  else
473  setLabelText( "unitname", bld->name );
474 
475  setBargraphValue( "unitdamage", float(100-bld->damage) / 100 );
476  setLabelText( "unitstatus", 100-bld->damage );
477  setLabelText( "armor", bld->getArmor() );
478 
479  if ( 0 ) {
480  setLabelText( "unitfuelstatus", bld->getAvailableResource(maxint,2) );
481  setLabelText( "unitmaterialstatus", bld->getAvailableResource(maxint,1) );
482  setLabelText( "unitenergystatus", bld->getAvailableResource(maxint,0) );
483  } else {
484  setLabelText( "unitfuelstatus", "" );
485  setLabelText( "unitmaterialstatus", "" );
486  setLabelText( "unitenergystatus", "" );
487  }
488 
489  setLabelText( "jamming", bld->typ->jamming );
490  setLabelText( "view", bld->typ->view );
491 
492 
493  } else {
494  setLabelText( "jamming", "" );
495  setLabelText( "view", "" );
496  setLabelText( "armor", "" );
497  setLabelText( "unittypename", "" );
498  setLabelText( "unitname", "" );
499  bool objectFound = false;
500  if ( fld && fld->objects.size() && fieldvisiblenow( fld )) {
501  for ( MapField::ObjectContainer::iterator i = fld->objects.begin(); i != fld->objects.end(); ++i )
502  if ( i->typ->armor > 0 ) {
503  setBargraphValue( "unitdamage", float(100-i->damage) / 100 );
504  objectFound = true;
505  break;
506  }
507  }
508  if ( !objectFound )
509  setBargraphValue( "unitdamage", 0 );
510  setLabelText( "unitstatus", "" );
511 
512  setLabelText( "unitfuelstatus", "" );
513  setLabelText( "unitmaterialstatus", "" );
514  setLabelText( "unitenergystatus", "" );
515 
516  }
517 
518  setBargraphValue( "unitfuel", 0 );
519  setBargraphValue( "unitmaterial", 0 );
520  setBargraphValue( "unitenergy", 0 );
521  setLabelText( "unitEndurance", "" );
522 
523  setLabelText( "fuelrange", "-" );
524  setLabelText( "movepoints", "" );
525  hide( "Selected3DImageSmall" );
526 
527  setLabelText( "unitoffensiveexperience", "" );
528  setLabelText( "unitdefensiveexperience", "" );
529  setLabelText( "unitattackincrease", "");
530  setLabelText( "unitdefenseincrease", "");
531 
532  }
533  for ( int i = weaponsDisplayed; i < 10; ++i ) {
535  setLabelText( "punch_weapon" + ps, "" );
536  setLabelText( "RF_weapon" + ps, "" );
537  setLabelText( "status_ammo" + ps, "" );
538  setBargraphValue( "bar_ammo" + ps, 0 );
539  }
540 
541  if ( redraw ) {
542  if ( !bulk )
543  PG_Application::SetBulkMode(false);
544  Redraw(true);
545  }
546 }
547 
548 
549 
550 WindInfoPanel::WindInfoPanel (PG_Widget *parent, const PG_Rect &r ) : DashboardPanel( parent, r, "WindInfo" )
551 {
552 }
553 
554 
555 
556 
557 UnitInfoPanel::UnitInfoPanel (PG_Widget *parent, const PG_Rect &r ) : DashboardPanel( parent, r, "UnitInfo" )
558 {
559  SpecialInputWidget* siw = dynamic_cast<SpecialInputWidget*>( FindChild( "weapinfo", true ) );
560  if ( siw ) {
561  siw->sigMouseButtonDown.connect( sigc::mem_fun( *this, &UnitInfoPanel::onClick ));
562  siw->sigMouseButtonUp.connect( sigc::mem_fun( *this, &UnitInfoPanel::onClick ));
563  }
564 
565  PG_Label* l = dynamic_cast<PG_Label*>( parent->FindChild( "unitname", true ) );
566  if ( l ) {
567  l->sigMouseButtonUp.connect( sigc::hide( sigc::hide( sigc::mem_fun( *this, &UnitInfoPanel::unitNaming ))));
568  }
569 
571 }
572 
574 {
575  // showUnitData( vt, NULL, true );
576 }
577 
579 {
580  ContainerBase* container = NULL;
581  if ( veh )
582  container = veh;
583  else if ( bld )
584  container = bld;
585 
586  if ( container && RenameContainerCommand::avail( container ) && container->getOwner() == container->getMap()->actplayer ) {
587  UnitNaming un( container );
588  un.Show();
589  un.RunModal();
590  showUnitData( veh, bld, NULL, true );
591  }
592  return true;
593 }
594 
595 
596 bool UnitInfoPanel::onClick ( PG_MessageObject* obj, const SDL_MouseButtonEvent* event )
597 {
598 
599  static const bool modalWeaponInfo = true;
600 
601  SpecialInputWidget* siw = dynamic_cast<SpecialInputWidget*>(obj);
602  if ( siw ) {
603  if ( event->button == SDL_BUTTON_RIGHT ) {
604  if ( event->type == SDL_MOUSEBUTTONDOWN ) {
605 
607  const Vehicle* vehicle = veh;
608  const VehicleType* vt = veh ? veh->typ : NULL;
609  if ( !veh && fld && fld->vehicle ) {
610  vt = fld->vehicle->typ;
611  vehicle = fld->vehicle;
612  }
613  if ( vt || veh ) {
614  // parent? PG_Application::GetWidgetById( ASC_PG_App::mainScreenID )
615  WeaponInfoPanel* wip = new WeaponInfoPanel( NULL, vehicle, vt );
616  wip->Show();
617  wip->BringToFront();
618  if ( modalWeaponInfo ) {
619  wip->SetCapture();
620  wip->RunModal();
621  delete wip;
622  } // else
623  // PG_Application::
624  }
625  return true;
626  }
627  if ( event->type == SDL_MOUSEBUTTONUP && !modalWeaponInfo ) {
628  bool result = false;
629  PG_Widget* wip;
630  do {
631  wip = PG_Application::GetWidgetByName( WeaponInfoPanel::WIP_Name() );
632  if ( wip ) {
633  delete wip;
634  result = true;
635  }
636  } while ( wip );
637  return result;
638  }
639  }
640  }
641  return false;
642 }
643 
644 class WeaponInfoLine: public PG_Image
645 {
646  const SingleWeapon* weapon;
647  const VehicleType* veh;
648  WeaponInfoPanel* wip;
649  static WeaponInfoLine* displayed;
650  public:
651  WeaponInfoLine( WeaponInfoPanel* parent, const PG_Point& p, SDL_Surface* image, const SingleWeapon* weap, const VehicleType* vehicle )
652  : PG_Image( parent, p, image, false ), weapon(weap), veh ( vehicle ), wip(parent) {
653  };
654 
655  void painter ( const PG_Rect &src, const ASCString& name, const PG_Rect &dst) {
656  Surface screen = Surface::Wrap( PG_Application::GetScreen() );
657  if ( name == "weapon_symbol1" )
658  screen.Blit( IconRepository::getIcon(SingleWeapon::getIconFileName( weapon->getScalarWeaponType()) + "-small.png"), SPoint(dst.x, dst.y));
659 
660  if ( name == "weapon_targets" || name == "weapon_shootfrom" ) {
661  int height;
662  if (name == "weapon_targets")
663  height = weapon->targ;
664  else {
665  height = weapon->sourceheight;
666  if ( veh )
667  height &= veh->height;
668  }
669 
670  for ( int i = 0; i < 8; ++i )
671  if ( height & (1 << i )) {
672  Surface& tick = IconRepository::getIcon("weapon_ok.png");
673  screen.Blit( tick, SPoint(dst.x + i * tick.w(), dst.y ) );
674  }
675  }
676 
677  };
678 
679  void registerSpecialDisplay( const ASCString& name ) {
680  SpecialDisplayWidget* sdw = dynamic_cast<SpecialDisplayWidget*>( FindChild( name, true ) );
681  if ( sdw )
682  sdw->display.connect( sigc::mem_fun( *this, &WeaponInfoLine::painter ));
683  };
684 
686  wip->showWeapon( weapon );
687  displayed = this;
688  };
689 
691  if ( displayed == this )
692  wip->showWeapon();
693  };
694 
695  bool activate() {
696  if ( displayed != this ) {
697  wip->showWeapon( weapon);
698  displayed = this;
699  return true;
700  } else
701  return false;
702  }
703 };
704 
705 WeaponInfoLine* WeaponInfoLine::displayed = NULL;
706 
707 
708 
709 WeaponInfoPanel::WeaponInfoPanel (PG_Widget *parent, const Vehicle* veh, const VehicleType* vt ) : Panel( parent, PG_Rect::null, "WeaponInfo" ), weaponCount(0)
710 {
711  SetName(name);
712 
713  vector<const SingleWeapon*> displayedWeapons;
714  vector<int> displayedWeaponNum;
715 
716  for ( int j = 0; j < vt->weapons.count ; j++)
717  if ( vt->weapons.weapon[j].getScalarWeaponType() >= 0 ) {
718  ++weaponCount;
719  displayedWeapons.push_back( &vt->weapons.weapon[j] );
720  displayedWeaponNum.push_back(j);
721  }
722 
723 
724  Surface& head = IconRepository::getIcon("weapon_large_top.png");
725  Surface& line = IconRepository::getIcon("weapon_large_line.png");
726  Surface& foot = IconRepository::getIcon("weapon_large_bottom.png");
727  int height = head.h() + foot.h() + weaponCount * line.h() + GetTitlebarHeight();
728 
729  SizeWidget( head.w(), height, false );
730 
731  int lineStartY = GetTitlebarHeight() + head.h() - 1;
732 
733  PG_Widget* footWidget = FindChild( "bottom", true );
734  assert( footWidget != NULL );
735  footWidget->MoveWidget(0, lineStartY + line.h() * weaponCount, false );
736 
737  for ( int i = 0; i < weaponCount; ++i ) {
738  WidgetParameters widgetParams = getDefaultWidgetParams();
739  WeaponInfoLine* lineWidget = new WeaponInfoLine ( this, PG_Point( 0, lineStartY + i * line.h() ), line.getBaseSurface(), displayedWeapons[i], vt );
740 
742 
743  pc.openBracket("LineWidget");
744  parsePanelASCTXT( pc, lineWidget, widgetParams );
745  pc.closeBracket();
746 
747 
748  assignWeaponInfo( this, lineWidget, *displayedWeapons[i] );
749  lineWidget->registerSpecialDisplay( "weapon_shootfrom" );
750  lineWidget->registerSpecialDisplay( "weapon_targets" );
751  if ( veh )
752  setLabelText( "weapon_currentammo", veh->ammo[displayedWeaponNum[i]], lineWidget );
753 
754  weaponInfoLines.push_back( lineWidget );
755  }
756  setLabelText( "weapon_shootaftermove", vt->wait ? "no" : "yes" );
757  setLabelText( "weapon_moveaftershoot", vt->hasFunction( ContainerBaseType::MoveAfterAttack ) ? "yes" : "no" );
758 
759  /*
760  for ( int i = 0; i < cmovemalitypenum; ++i )
761  setLabelText( ASCString("weapon_efficiency_") + unitCategoryTags[i], cmovemalitypes[i] );
762  */
763 }
764 
765 
767 {
768  PG_Application::SetBulkMode(true);
769  int effic[13];
770  for ( int k = 0; k < 13; k++ )
771  if ( weap )
772  effic[k] = weap->efficiency[k];
773  else
774  effic[k] = -1;
775 
776  if ( weap ) {
777  int mindelta = 1000;
778  int maxdelta = -1000;
779  for ( int h1 = 0; h1 < 8; h1++ )
780  for ( int h2 = 0; h2 < 8; h2++ )
781  if ( weap->sourceheight & ( 1 << h1 ) )
782  if ( weap->targ & ( 1 << h2 )) {
783  int delta = getheightdelta ( h1, h2);
784  if ( delta > maxdelta )
785  maxdelta = delta;
786  if ( delta < mindelta )
787  mindelta = delta;
788  }
789  for ( int a = -6; a < mindelta; a++ )
790  effic[6+a] = -1;
791  for ( int b = maxdelta+1; b < 7; b++ )
792  effic[6+b] = -1;
793  }
794 
795  for ( int i = -6; i <= 6; ++i ) {
796  if ( effic[6+i] >= 0 )
797  setLabelText( "weapon_distance_" + ASCString::toString(i), i );
798  else
799  setLabelText( "weapon_distance_" + ASCString::toString(i), "" );
800 
801  if ( weap && effic[6+i] >= 0 )
802  setLabelText( "weapon_efficiency_" + ASCString::toString(i), weap->efficiency[6+i] );
803  else
804  setLabelText( "weapon_efficiency_" + ASCString::toString(i), "" );
805  }
806 
807  // grey light grey yellow, blue red green
808  static const int colors[6] = { 0x969595, 0xdfdfdf, 0xfac914, 0x5383e6, 0xff5e5e, 0x08ce37 };
809 
810  for ( int i = 0; i< cmovemalitypenum; ++i)
811  if ( weap ) {
812  int col;
813  if ( weap->targetingAccuracy[i] < 10 )
814  col = colors[0] ;
815  else if ( weap->targetingAccuracy[i] < 30 )
816  col = colors[1] ;
817  else if ( weap->targetingAccuracy[i] < 80 )
818  col = colors[3] ;
819  else if ( weap->targetingAccuracy[i] < 120 )
820  col = colors[2];
821  else
822  col = colors[4];
823  setLabelColor( ASCString("weapon_efficiency_") + unitCategoryTags[i], col );
824  setLabelText( ASCString("weapon_efficiency_") + unitCategoryTags[i], weap->targetingAccuracy[i] );
825  } else
826  setLabelText( ASCString("weapon_efficiency_") + unitCategoryTags[i], "" );
827 
828  if ( weap )
829  setLabelText( "weapon_text2", weap->getName() );
830  else
831  setLabelText( "weapon_text2", "" );
832 
833  if ( weap ) {
834  setImage( "weapon_symbol2", IconRepository::getIcon(SingleWeapon::getIconFileName( weap->getScalarWeaponType()) + "-small.png") );
835  show( "weapon_symbol2" );
836  } else
837  hide( "weapon_symbol2" );
838 
839  PG_Application::SetBulkMode(false);
840  Update();
841 }
842 
843 bool WeaponInfoPanel::eventMouseButtonUp (const SDL_MouseButtonEvent *button)
844 {
845  if ( Panel::eventMouseButtonUp( button ))
846  return true;
847 
848  if ( button->button == SDL_BUTTON_RIGHT ) {
849  QuitModal();
850  return true;
851  } else
852  return false;
853 }
854 
855 
856 bool WeaponInfoPanel::eventMouseMotion(const SDL_MouseMotionEvent* motion)
857 {
858  for ( int i = 0; i < weaponInfoLines.size(); ++i )
859  if ( weaponInfoLines[i]->IsMouseInside() )
860  return weaponInfoLines[i]->activate();
861  return false;
862 };
863 
864 
865 ASCString WeaponInfoPanel::name = "WeaponInfoPanel";
867 {
868  return name;
869 }
870 
871 
872 MapInfoPanel::MapInfoPanel (PG_Widget *parent, const PG_Rect &r, MapDisplayPG* mapDisplay ) : DashboardPanel( parent, r, "MapInfo" ), zoomSlider(NULL), changeActive(false)
873 {
874  assert( mapDisplay );
875  this->mapDisplay = mapDisplay;
876 
877  zoomSlider = dynamic_cast<PG_Slider*>( FindChild( "zoomscroller", true ) );
878  if ( zoomSlider ) {
879  zoomSlider->SetRange(0,75); // results in zoomlevels from 100 - 25
880  zoomSlider->sigSlide.connect( sigc::mem_fun( *this, &MapInfoPanel::scrollTrack ));
881  mapDisplay->newZoom.connect( sigc::mem_fun( *this, &MapInfoPanel::zoomChanged ));
882  zoomSlider->SetPosition( 100 - mapDisplay->getZoom() );
883  }
884 
885  const int labelnum = 5;
886  const char* label[labelnum] = { "pipes", "container", "resources", "visibilityvalue", "reactionfire" };
887  for ( int i = 0; i < labelnum; ++i ) {
888  PG_CheckButton* cb = dynamic_cast<PG_CheckButton*>( FindChild( label[i], true ) );
889  if ( mapDisplay->layerActive( label[i] )
890  )
891  layerChanged( true, label[i]);
892  if ( cb )
893  cb->sigClick.connect( sigc::bind( sigc::mem_fun( *this, &MapInfoPanel::checkBox ), label[i] ));
894  }
895 
896  mapDisplay->layerChanged.connect( sigc::mem_fun( *this, &MapInfoPanel::layerChanged ));
897 
898  PG_Button* b = dynamic_cast<PG_Button*>( FindChild( "weaprange", true ) );
899  if ( b )
900  b->sigClick.connect( sigc::hide( sigc::mem_fun( *this, &MapInfoPanel::showWeaponRange )));
901 
902  PG_Button* b2 = dynamic_cast<PG_Button*>( FindChild( "moverange", true ) );
903  if ( b2 )
904  b2->sigClick.connect( sigc::hide( sigc::mem_fun( *this, &MapInfoPanel::showMovementRange )));
905 
906 }
907 
908 void MapInfoPanel::layerChanged( bool state, const ASCString& label )
909 {
910  PG_CheckButton* cb = dynamic_cast<PG_CheckButton*>( FindChild( label, true ) );
911  if ( cb && ! changeActive ) {
912  if ( state )
913  cb->SetPressed();
914  else
915  cb->SetUnpressed();
916  }
917 }
918 
919 bool MapInfoPanel::showWeaponRange()
920 {
922  return true;
923 }
924 
925 bool MapInfoPanel::showMovementRange()
926 {
928  return true;
929 }
930 
931 
932 void MapInfoPanel::zoomChanged( int zoom )
933 {
934  if ( !changeActive )
935  if ( zoomSlider )
936  zoomSlider->SetPosition( 100 - zoom );
937 }
938 
939 bool MapInfoPanel::scrollTrack( long pos )
940 {
941  changeActive = true;
942  mapDisplay->setNewZoom( 100 - pos );
943  repaintMap();
944  changeActive = false;
945  return true;
946 }
947 
948 bool MapInfoPanel::checkBox( bool state, const char* name )
949 {
950  changeActive = true;
951  mapDisplay->activateMapLayer( name, state );
952  repaintMap();
953  changeActive = false;
954  return true;
955 }
956 
957 
958 ActionInfoPanel::ActionInfoPanel (PG_Widget *parent, const PG_Rect &r ) : DashboardPanel( parent, r, "ActionInfo" )
959 {
960  ActionContainer::actionListChanged.connect( sigc::mem_fun( *this, &ActionInfoPanel::update ));
961 }
962 
964 {
965  TextRenderer* text = dynamic_cast<TextRenderer*>( FindChild( "ActionList", true ));
966  if ( text && map) {
967  /*
968  vector<ASCString> list;
969  map->actions.getActionDescriptions( list );
970 
971  ASCString s;
972  for ( vector<ASCString>::const_iterator i = list.begin(); i != list.end(); ++i )
973  s += *i + "\n";
974  */
975  text->SetText( "Function removed, please use Action/Manage dialog" );
976  }
977 }
978 
TerrainType::Weather * typ
the terraintype of the field
Definition: mapfield.h:38
void showUnitData(Vehicle *veh, Building *bld, MapField *fld, bool redraw=false)
Definition: dashboard.cpp:378
int fuel
Definition: typen.h:101
ASCString infoImageSmallFilename
static const int experienceIcons
Definition: attack.h:49
bool wait
If the unit cannot attack in the same turn after it has moved, it has to wait.
Definition: vehicletype.h:197
void painter(const PG_Rect &src, const ASCString &name, const PG_Rect &dst)
MapCoordinate & getCursor()
Definition: gamemap.cpp:933
int getExperience_defensive() const
Definition: vehicle.cpp:258
ASCString getName(void) const
bool service(void) const
void showWeapon(const SingleWeapon *weap=NULL)
Definition: dashboard.cpp:766
bool eventMouseButtonUp(const SDL_MouseButtonEvent *button)
Definition: dashboard.cpp:77
DisplayHook display
Definition: paradialog.h:182
map accessing and usage routines used by ASC and the mapeditor
int getattackbonus(void)
the attack bonus that unit get when they are attacking
Definition: mapfield.cpp:490
const BuildingType * typ
Definition: buildings.h:48
TextPropertyGroup * textPropertyGroup
Definition: windowing.h:83
int damage
Damage. 0 is no damage, when damage reaches 100 the container is destroyed.
the core formula, which weighs the different factory that go into the calculation ...
Definition: attack.h:42
Vehicle * vehicle
Definition: mapfield.h:89
int energy
Definition: typen.h:99
bool valid() const
Definition: typen.h:221
ASCString name
a name given by the user or the map creator
ASCString name
Definition: terraintype.h:82
void painter(const PG_Rect &src, const ASCString &name, const PG_Rect &dst)
Definition: dashboard.cpp:195
void blit(const Surface &src, Surface &dst, SPoint dstPos)
Definition: blitter.h:349
static const ASCString & WIP_Name()
Definition: dashboard.cpp:866
int getheightdelta(const ContainerBase *c1, const ContainerBase *c2)
calculate the height difference between two levels of height.
Definition: spfst.cpp:393
int ammo[16]
Definition: vehicle.h:87
bool onClick(PG_MessageObject *obj, const SDL_MouseButtonEvent *event)
Definition: dashboard.cpp:596
ExperienceOverview(const PG_Point &pos, int exp=-1)
Definition: dashboard.cpp:88
UnitWeapon weapons
The weapons.
Definition: vehicletype.h:248
Resources getStorageCapacity() const
returns the local storage capacity for the given resource, which depends on the resource mode of the ...
TerrainType * terraintype
pointer to the outer structure
Definition: terraintype.h:128
int sourceheight
the weapon can be shot from these levels of height (bitmapped)
Definition: vehicletype.h:108
int efficiency[13]
the targeting accuracy of the weapon over different height differences between the attacking unit and...
Definition: vehicletype.h:132
bool shootable(void) const
int targ
the weapon can attack targets at these levels of height (bitmapped)
Definition: vehicletype.h:105
bool hasFunction(ContainerFunctions function) const
int getOwner() const
returns the number of the player this vehicle/building belongs to
bool eventMouseButtonUp(const SDL_MouseButtonEvent *button)
Definition: dashboard.cpp:843
PlayerColor getPlayerColor() const
Definition: player.cpp:268
sigc::signal< void, bool, const ASCString & > layerChanged
Definition: mapdisplay.h:298
void setImage(const ASCString &widgetName, Surface &image, PG_Widget *parent=NULL)
Definition: windowing.cpp:739
int count
amount of ammunition the unit having this weapon can carry
Definition: vehicletype.h:117
MapCoordinate3D getPosition() const
returns the units position
Definition: vehicle.cpp:1552
sigc::signal< void > repaintMap
}@
Definition: spfst.cpp:45
SingleWeapon weapon[16]
Definition: vehicletype.h:170
static PG_Rect getSize(const PG_Point &pos)
Definition: dashboard.cpp:82
Resources getTank() const
returns the resources that the unit is carrying
Definition: vehicle.cpp:378
a single field of the map
Definition: mapfield.h:26
ActionInfoPanel(PG_Widget *parent, const PG_Rect &r)
Definition: dashboard.cpp:958
SDL_Surface * getBaseSurface()
Definition: surface.h:116
int getIconIndex(int experience, bool offensive)
Definition: attack.cpp:156
struct GameMap::Weather weather
void setNewZoom(int zoom)
Definition: mapdisplay.cpp:703
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
ASCString description
short description of the units role, for example "strategic bomber"
bool layerActive(const ASCString &name)
int getAvailableResource(int amount, int resourcetype, int scope=1) const
Definition: controls.cpp:260
int view
the visibility range
int height
the current level of height ( BITMAPPED ! )
Definition: vehicle.h:118
int getWeather()
the weather that is on this field
Definition: mapfield.cpp:370
int getPlayerView() const
the player which is currently viewing the map.
Definition: gamemap.cpp:1007
DashboardPanel(PG_Widget *parent, const PG_Rect &r, const ASCString &panelName_, bool loadTheme)
Definition: dashboard.cpp:109
Interface for various global functions and variables.
int getScalarWeaponType(void) const
void parsePanelASCTXT(PropertyReadingContainer &pc, PG_Widget *parent, WidgetParameters widgetParams)
Definition: windowing.cpp:370
bool fieldvisiblenow(const MapField *pe, Vehicle *veh, int player)
{@
Definition: spfst.cpp:399
The class describing properties that are common to all vehicles of a certain kind.
Definition: vehicletype.h:177
void registerSpecialDisplay(const ASCString &name)
Definition: dashboard.cpp:187
static ASCString toString(int i)
converts the parameter to a String
Definition: ascstring.cpp:193
void SetText(const std::string &text)
static int getEndurance(const Vehicle *veh)
calculates the time until the unit crashes because of lack of fuel
Definition: vehicle.cpp:1816
Player & getOwningPlayer() const
returns the player this vehicle/building belongs to
bool eventMouseMotion(const SDL_MouseMotionEvent *motion)
Definition: dashboard.cpp:856
WeaponInfoLine(WeaponInfoPanel *parent, const PG_Point &p, SDL_Surface *image, const SingleWeapon *weap, const VehicleType *vehicle)
Definition: dashboard.cpp:651
bool containerRenamed(PG_LineEdit *lineEdit)
Definition: dashboard.cpp:157
int RunModal()
Definition: unitnaming.cpp:63
int reactionFireShots
Definition: vehicletype.h:145
Coordinate on the twodimensional map.
Definition: typen.h:202
const int cmovemalitypenum
The number of vehicle categories; Each category has its own move malus.
Definition: typen.h:384
Definition of THE central asc class: GameMap.
int jamming
the radar jamming power
static sigc::signal< void, GameMap & > sigMapDeletion
Definition: gamemap.h:501
static sigc::signal< void, GameMap * > actionListChanged
void setBarGraphColor(const ASCString &widgetName, PG_Color color, PG_Widget *parent=NULL)
Definition: windowing.cpp:801
MapCoordinate cursorPos
Definition: player.h:207
bool onClick(PG_MessageObject *obj, const SDL_MouseButtonEvent *event)
void setBargraphValue(const ASCString &widgetName, float fraction, PG_Widget *parent=NULL)
Definition: windowing.cpp:790
static ASCString getIconFileName(int weaponType)
int getmaxwindspeedforunit(const Vehicle *eht)
returns the maximum wind speed that the unit can endure
Definition: spfst.cpp:332
UnitInfoPanel(PG_Widget *parent, const PG_Rect &r)
Definition: dashboard.cpp:557
void showUnitInfo(const VehicleType *vt)
Definition: dashboard.cpp:573
A single weapon of a #Vehicletype.
Definition: vehicletype.h:100
int material
Definition: typen.h:100
sigc::signal< void > updateFieldInfo
Definition: spfst.cpp:47
void painter(const PG_Rect &src, const ASCString &name, const PG_Rect &dst)
Definition: dashboard.cpp:655
DI_Color getColor() const
Definition: player.cpp:249
int targetingAccuracy[cmovemalitypenum]
the effectiveness of the weapon against different targets.
Definition: vehicletype.h:137
void reset(GameMap &map)
Definition: dashboard.cpp:176
signed char actplayer
the player who is currently making his moves (may be human or AI)
Definition: gamemap.h:232
int getZoom() const
Definition: mapdisplay.h:192
bool viewExperienceOverview()
Definition: dashboard.cpp:134
void show(const ASCString &widgetName, PG_Widget *parent=NULL)
Definition: windowing.cpp:778
#define cwminen
Definition: vehicletype.h:67
SDLmm::SPoint SPoint
Definition: surface.h:27
Player player[9]
Definition: gamemap.h:253
TerrainBits bdt
the terraintype properties. They determine which units can move over the field. This variable is reca...
Definition: mapfield.h:161
const char * unitCategoryTags[cmovemalitypenum]
bool unitNaming()
Definition: dashboard.cpp:578
WeaponInfoPanel(PG_Widget *parent, const Vehicle *veh, const VehicleType *vt)
Definition: dashboard.cpp:709
MapInfoPanel(PG_Widget *parent, const PG_Rect &r, MapDisplayPG *mapDisplay)
Definition: dashboard.cpp:872
void eventDraw(SDL_Surface *surface, const PG_Rect &rect)
Definition: dashboard.cpp:98
int height
the levels of height which this unit can enter
void activateMapLayer(const ASCString &name, bool active)
int fuelConsumption
the fuel consumption to move a single field
Definition: vehicletype.h:200
const VehicleType * typ
Definition: vehicle.h:83
WindInfoPanel(PG_Widget *parent, const PG_Rect &r)
Definition: dashboard.cpp:550
static bool avail(const ContainerBase *container)
static Surface & getIcon(const ASCString &name)
Building * building
Definition: mapfield.h:102
int getjamming(void)
the radar jamming that is on this field
Definition: mapfield.cpp:537
ASCString privateName
a name given by the user which is only visible to him and his allies.
void paint(Surface &s, SPoint pos, const PlayerColor &player, int direction=0) const
void setLabelColor(const ASCString &widgetName, PG_Color color, PG_Widget *parent=NULL)
Definition: windowing.cpp:710
#define maxint
Definition: typen.h:462
GameMap * actmap
Definition: spfst.cpp:64
GameMap * getMap() const
Building * bld
Definition: dashboard.h:45
The parent class of Vehicle and Building; The name Container originates from Battle Isle...
Definition: containerbase.h:40
static Surface Wrap(SDL_Surface *surface)
Definition: surface.h:76
Vehicle * veh
Definition: dashboard.h:44
An actual building on the map, which references a BuildingType Buildings have an owner,.
Definition: buildings.h:38
void hide(const ASCString &widgetName, PG_Widget *parent=NULL)
Definition: windowing.cpp:768
int maxstrength
strength of the weapon when fired over the minimal distance
Definition: vehicletype.h:120
void registerSpecialDisplay(const ASCString &name)
Definition: dashboard.cpp:679
int getdefensebonus(void)
the defense bonus that unit get when they are attacked
Definition: mapfield.cpp:506
this Panel saves its position in the gameoptions and loads it on construction
Definition: windowing.h:121
void update(GameMap *map)
Definition: dashboard.cpp:963
void assignWeaponInfo(Panel *panel, PG_Widget *widget, const SingleWeapon &weapon)
void eventMouseEnter()
Definition: dashboard.cpp:685
void eventMouseLeave()
Definition: dashboard.cpp:690
sigc::signal< void, int > newZoom
Definition: mapdisplay.h:192
static sigc::signal< void, ContainerBase * > anyContainerDestroyed
static sigc::signal< void, const VehicleType * > showVehicleInfo
The box displaying unit information.
SDL_Surface * screen
Definition: graphics.cpp:31
int getArmor() const
returns the armor of the building.
Definition: buildings.cpp:393
void setLabelText(const ASCString &widgetName, const ASCString &text, PG_Widget *parent=NULL)
Definition: windowing.cpp:685
int getMovement(bool checkFuel=true, bool checkRF=true) const
returns the movement points the unit has left for this turn. CheckFuel should almost always be true...
Definition: vehicle.cpp:558
ASCString name
a short name, for example B-52
WidgetParameters getDefaultWidgetParams()
Definition: windowing.cpp:957
void executeUserAction(tuseractions action)
Definition: sg.cpp:759
void line(int x1, int y1, int x2, int y2, Uint8 actcol)
draws a simple line on the screen. Not very fast...
Definition: basegfx.cpp:181
const int maxwindspeed
Wind with its maximum strength of 255 is moving this distance per turn.
Definition: typen.h:501
ObjectContainer objects
Definition: mapfield.h:124
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182
MapField * getField(int x, int y)
Definition: gamemap.h:465
int getExperience_offensive() const
Definition: vehicle.cpp:253