summaryrefslogtreecommitdiffhomepage
path: root/Stars45/RLoc.cpp
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-09 19:00:23 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-09 19:00:23 +0000
commit69209c38968c6f4066a772e0a51a2928749217de (patch)
treeb325c535eff3dd27b811ca348e63ead8f86ff344 /Stars45/RLoc.cpp
parentfd51dc1bbbcba496fa0d57963a5727a36e381118 (diff)
downloadstarshatter-69209c38968c6f4066a772e0a51a2928749217de.zip
starshatter-69209c38968c6f4066a772e0a51a2928749217de.tar.gz
starshatter-69209c38968c6f4066a772e0a51a2928749217de.tar.bz2
Re-indenting the code to use standard tabs. Yes, I know this is pretty pointless, but who cares?
Diffstat (limited to 'Stars45/RLoc.cpp')
-rw-r--r--Stars45/RLoc.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/Stars45/RLoc.cpp b/Stars45/RLoc.cpp
index 4388844..c76ee1c 100644
--- a/Stars45/RLoc.cpp
+++ b/Stars45/RLoc.cpp
@@ -1,15 +1,15 @@
/* Project Starshatter 4.5
- Destroyer Studios LLC
- Copyright © 1997-2004. All Rights Reserved.
+ Destroyer Studios LLC
+ Copyright © 1997-2004. All Rights Reserved.
- SUBSYSTEM: Stars.exe
- FILE: RLoc.cpp
- AUTHOR: John DiCamillo
+ SUBSYSTEM: Stars.exe
+ FILE: RLoc.cpp
+ AUTHOR: John DiCamillo
- OVERVIEW
- ========
- Navigation Point class implementation
+ OVERVIEW
+ ========
+ Navigation Point class implementation
*/
#include "MemDebug.h"
@@ -19,24 +19,24 @@
// +----------------------------------------------------------------------+
RLoc::RLoc()
- : rloc(0), dex(0), dex_var(5.0e3f), az(0), az_var(3.1415f), el(0), el_var(0.1f)
+: rloc(0), dex(0), dex_var(5.0e3f), az(0), az_var(3.1415f), el(0), el_var(0.1f)
{ }
RLoc::RLoc(const Point& l, double d, double dv)
- : loc(l), base_loc(l), rloc(0), dex((float) d), dex_var((float) dv),
- az(0), az_var(3.1415f), el(0), el_var(0.1f)
+: loc(l), base_loc(l), rloc(0), dex((float) d), dex_var((float) dv),
+az(0), az_var(3.1415f), el(0), el_var(0.1f)
{ }
RLoc::RLoc(RLoc* l, double d, double dv)
- : rloc(l), dex((float) d), dex_var((float) dv),
- az(0), az_var(3.1415f), el(0), el_var(0.1f)
+: rloc(l), dex((float) d), dex_var((float) dv),
+az(0), az_var(3.1415f), el(0), el_var(0.1f)
{ }
RLoc::RLoc(const RLoc& r)
- : loc(r.loc), base_loc(r.base_loc), rloc(r.rloc),
- dex(r.dex), dex_var(r.dex_var),
- az(r.az), az_var(r.az_var),
- el(r.el), el_var(r.el_var)
+: loc(r.loc), base_loc(r.base_loc), rloc(r.rloc),
+dex(r.dex), dex_var(r.dex_var),
+az(r.az), az_var(r.az_var),
+el(r.el), el_var(r.el_var)
{ }
RLoc::~RLoc()
@@ -47,8 +47,8 @@ RLoc::~RLoc()
const Point&
RLoc::Location()
{
- if (rloc || dex > 0) Resolve();
- return loc;
+ if (rloc || dex > 0) Resolve();
+ return loc;
}
// +----------------------------------------------------------------------+
@@ -56,26 +56,26 @@ RLoc::Location()
void
RLoc::Resolve()
{
- if (rloc) {
- base_loc = rloc->Location();
- rloc = 0;
- }
-
- if (dex > 0) {
- double d = dex + Random(-dex_var, dex_var);
- double a = az + Random(-az_var, az_var);
- double e = el + Random(-el_var, el_var);
-
- Point p = Point(d * sin(a),
- d * -cos(a),
- d * sin(e));
-
- loc = base_loc + p;
- dex = 0;
- }
- else {
- loc = base_loc;
- }
+ if (rloc) {
+ base_loc = rloc->Location();
+ rloc = 0;
+ }
+
+ if (dex > 0) {
+ double d = dex + Random(-dex_var, dex_var);
+ double a = az + Random(-az_var, az_var);
+ double e = el + Random(-el_var, el_var);
+
+ Point p = Point(d * sin(a),
+ d * -cos(a),
+ d * sin(e));
+
+ loc = base_loc + p;
+ dex = 0;
+ }
+ else {
+ loc = base_loc;
+ }
}
// +----------------------------------------------------------------------+
@@ -83,6 +83,6 @@ RLoc::Resolve()
void
RLoc::SetBaseLocation(const Point& l)
{
- base_loc = l;
- loc = l;
+ base_loc = l;
+ loc = l;
}