aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/vector.h
diff options
context:
space:
mode:
authorPeter Kohaut2016-10-04 18:59:25 +0200
committerPeter Kohaut2016-10-04 18:59:25 +0200
commit5d1e1131dc48f65de2f7c00bef3989df8d0d809f (patch)
tree3e4c1a46b1c2dc846a9eeb13dc37f89ade93dc49 /engines/bladerunner/vector.h
parent2b835eb14dd5974b89e860066140ee35243f1c9a (diff)
downloadscummvm-rg350-5d1e1131dc48f65de2f7c00bef3989df8d0d809f.tar.gz
scummvm-rg350-5d1e1131dc48f65de2f7c00bef3989df8d0d809f.tar.bz2
scummvm-rg350-5d1e1131dc48f65de2f7c00bef3989df8d0d809f.zip
BLADERUNNER: code formatting
Diffstat (limited to 'engines/bladerunner/vector.h')
-rw-r--r--engines/bladerunner/vector.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/engines/bladerunner/vector.h b/engines/bladerunner/vector.h
index 84e4df63bb..d04070f7c5 100644
--- a/engines/bladerunner/vector.h
+++ b/engines/bladerunner/vector.h
@@ -108,26 +108,20 @@ inline Vector4 operator/(Vector4 a, Vector4 b) {
return Vector4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w);
}
-inline
-int angle_1024(float x1, float z1, float x2, float z2)
-{
+inline int angle_1024(float x1, float z1, float x2, float z2) {
float angle_rad = atan2(x2 - x1, z1 - z2);
int a = int(512.0 * angle_rad / M_PI);
return (a + 1024) % 1024;
}
-inline
-int angle_1024(const Vector3 &v1, const Vector3 &v2)
-{
+inline int angle_1024(const Vector3 &v1, const Vector3 &v2) {
return angle_1024(v1.x, v1.z, v2.x, v2.z);
}
-inline
-float distance(float x1, float z1, float x2, float z2)
-{
+inline float distance(float x1, float z1, float x2, float z2) {
float dx = x1 - x2;
float dz = z1 - z2;
- float d = sqrt(dx*dx + dz*dz);
+ float d = sqrt(dx * dx + dz * dz);
float int_part = (int)d;
float frac_part = d - int_part;
@@ -138,24 +132,17 @@ float distance(float x1, float z1, float x2, float z2)
return int_part + frac_part;
}
-inline
-float distance(const Vector3 &v1, const Vector3 &v2)
-{
+inline float distance(const Vector3 &v1, const Vector3 &v2) {
return distance(v1.x, v1.z, v2.x, v2.z);
}
-inline
-float cos_1024(int angle1024) {
+inline float cos_1024(int angle1024) {
return cos(angle1024 * (M_PI / 512.0f));
}
-inline
-float sin_1024(int angle1024) {
+inline float sin_1024(int angle1024) {
return sin(angle1024 * (M_PI / 512.0f));
}
-
-
-
} // End of namespace BladeRunner
#endif