summaryrefslogtreecommitdiffhomepage
path: root/Stars45/MapView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/MapView.cpp')
-rw-r--r--Stars45/MapView.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/Stars45/MapView.cpp b/Stars45/MapView.cpp
index de7c567..20c61b5 100644
--- a/Stars45/MapView.cpp
+++ b/Stars45/MapView.cpp
@@ -188,7 +188,7 @@ MapView::SetSystem(StarSystem* s)
ListIter<OrbitalBody> planet = star->Satellites();
while (++planet) {
planets.append(planet.value());
-
+
ListIter<OrbitalBody> moon = planet->Satellites();
while (++moon) {
planets.append(moon.value());
@@ -446,7 +446,7 @@ MapView::ProcessMenuItem(int action)
if (action >= MAP_OBJECTIVE) {
int index = action - MAP_OBJECTIVE;
-
+
if (current_navpt && can_command) {
current_navpt->SetTarget(objective_menu->GetItem(index)->GetText());
send_nav_data = true;
@@ -657,7 +657,7 @@ MapView::SetViewMode(int mode)
// switch mode:
view_mode = mode;
-
+
// restore state:
if (view_mode == VIEW_GALAXY) {
@@ -687,7 +687,7 @@ MapView::Update(SimObject* obj)
active_menu = map_menu;
}
- return SimObserver::Update(obj);
+ return SimObserver::Update(obj);
}
// +--------------------------------------------------------------------+
@@ -696,7 +696,7 @@ void
MapView::SelectShip(Ship* selship)
{
if (selship != current_ship) {
- current_ship = selship;
+ current_ship = selship;
if (current_ship) {
if (current_ship->Life() == 0 || current_ship->IsDying() || current_ship->IsDead()) {
@@ -718,7 +718,7 @@ MapView::SelectElem(MissionElement* elem)
{
if (elem != current_elem) {
current_elem = elem;
-
+
if (current_elem) {
if (current_elem->IsStarship()) {
ship_menu->GetItem(3)->SetEnabled(true);
@@ -861,11 +861,11 @@ MapView::SetSelectionMode(int mode)
if (mode != seln_mode && mode <= SELECT_FIGHTER) {
seln_mode = mode;
-
- // when changing mode,
+
+ // when changing mode,
// select the item closest to the current center:
if (system && view_mode == VIEW_SYSTEM)
- SelectAt(rect.x + rect.w/2,
+ SelectAt(rect.x + rect.w/2,
rect.y + rect.h/2);
}
}
@@ -1089,12 +1089,12 @@ MapView::SetSelectedShip(Ship* ship)
{
if (ship) {
SimRegion* simrgn = ship->GetRegion();
-
+
if (simrgn && simrgn->NumShips()) {
selship = simrgn->Ships().find(ship);
}
}
-
+
SelectShip(selship);
}
break;
@@ -1338,7 +1338,7 @@ MapView::SelectAt(int x, int y)
index++;
}
-
+
current_star = closest;
}
s = stars[current_star];
@@ -1352,7 +1352,7 @@ MapView::SelectAt(int x, int y)
double dx = (planet->Location().x - test_x);
double dy = (planet->Location().y - test_y);
double d = sqrt(dx*dx + dy*dy);
-
+
if (d < dist) {
dist = d;
closest = index;
@@ -1360,7 +1360,7 @@ MapView::SelectAt(int x, int y)
index++;
}
-
+
current_planet = closest;
}
s = planets[current_planet];
@@ -1375,7 +1375,7 @@ MapView::SelectAt(int x, int y)
double dx = (region->Location().x - test_x);
double dy = (region->Location().y - test_y);
double d = sqrt(dx*dx + dy*dy);
-
+
if (d < dist) {
dist = d;
closest = index;
@@ -1383,7 +1383,7 @@ MapView::SelectAt(int x, int y)
index++;
}
-
+
current_region = closest;
}
s = regions[current_region];
@@ -1604,7 +1604,7 @@ MapView::GetSelectionIndex()
if (sim && rgn)
simrgn = sim->FindRegion(rgn->Name());
-
+
if (simrgn) {
if (current_ship && simrgn->NumShips()) {
s = simrgn->Ships().index(current_ship);
@@ -1896,7 +1896,7 @@ MapView::DrawSystem()
DrawOrbital(*region, 1);
}
}
-
+
ListIter<OrbitalRegion> region = star->Regions();
while (++region) {
DrawOrbital(*region, 1);
@@ -2275,7 +2275,7 @@ MapView::GetMinRadius(int type)
// +--------------------------------------------------------------------+
-static void
+static void
ColorizeBitmap(Bitmap& img, Color color)
{
int w = img.Width();
@@ -2349,9 +2349,9 @@ MapView::DrawShip(Ship& s, bool current, int rep)
Point heading = s.Heading().OtherHand();
heading.z = 0;
heading.Normalize();
-
+
double theta = 0;
-
+
if (heading.y > 0)
theta = acos(heading.x);
else
@@ -2486,7 +2486,7 @@ MapView::DrawElem(MissionElement& s, bool current, int rep)
int sprite_index = (int) ((theta + THETA_OFFSET) * THETA_SLICE);
int nsprites = 0;
-
+
if (s.GetDesign())
nsprites = s.GetDesign()->map_sprites.size();
@@ -2904,7 +2904,7 @@ MapView::DrawCombatGroup(CombatGroup* group, int rep)
if (group->GetUnits().size() > 0) {
CombatUnit* unit = 0;
-
+
for (int i = 0; i < group->GetUnits().size(); i++) {
unit = group->GetUnits().at(i);
@@ -2936,7 +2936,7 @@ MapView::DrawCombatGroup(CombatGroup* group, int rep)
else {
int sprite_index = 2;
int nsprites = 0;
-
+
if (unit->GetDesign())
nsprites = unit->GetDesign()->map_sprites.size();
@@ -3088,11 +3088,11 @@ MapView::GetShipLoc(Ship& s, POINT& shiploc)
}
}
- if (view_mode == VIEW_SYSTEM ||
+ if (view_mode == VIEW_SYSTEM ||
(view_mode == VIEW_REGION && rgn == s.GetRegion()->GetOrbitalRegion())) {
double sx = (s.Location().x + rlx) * scale;
double sy = (s.Location().y + rly) * scale;
-
+
shiploc.x = (int) (cx + sx + ox);
shiploc.y = (int) (cy + sy + oy);
}
@@ -3167,11 +3167,11 @@ MapView::GetElemLoc(MissionElement& s, POINT& shiploc)
}
}
- if (view_mode == VIEW_SYSTEM ||
+ if (view_mode == VIEW_SYSTEM ||
(view_mode == VIEW_REGION && !_stricmp(s.Region(), rgn->Name()))) {
double sx = (s.Location().x + rlx) * scale;
double sy = (s.Location().y + rly) * scale;
-
+
shiploc.x = (int) (cx + sx + ox);
shiploc.y = (int) (cy + sy + oy);
}
@@ -3185,7 +3185,7 @@ MapView::GetElemLoc(MissionElement& s, POINT& shiploc)
OrbitalRegion*
MapView::GetRegion() const
-{
+{
OrbitalRegion* result = 0;
if (current_region < regions.size())
@@ -3316,7 +3316,7 @@ MapView::OnMouseMove(int x, int y)
if (dragging) {
int delta_x = x - mouse_x;
int delta_y = y - mouse_y;
-
+
offset_x += delta_x * r / c;
offset_y += delta_y * r / c;