summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/logging/backend.cpp4
-rw-r--r--src/common/logging/log.h2
-rw-r--r--src/common/quaternion.h5
-rw-r--r--src/common/scm_rev.cpp.in2
-rw-r--r--src/common/scm_rev.h1
-rw-r--r--src/common/vector_math.h7
6 files changed, 16 insertions, 5 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 42f6a9918..4b83eeb28 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -72,7 +72,9 @@ namespace Log {
72 SUB(Audio, DSP) \ 72 SUB(Audio, DSP) \
73 SUB(Audio, Sink) \ 73 SUB(Audio, Sink) \
74 CLS(Input) \ 74 CLS(Input) \
75 CLS(Loader) 75 CLS(Network) \
76 CLS(Loader) \
77 CLS(WebService)
76 78
77// GetClassName is a macro defined by Windows.h, grrr... 79// GetClassName is a macro defined by Windows.h, grrr...
78const char* GetLogClassName(Class log_class) { 80const char* GetLogClassName(Class log_class) {
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 1b905f66c..fe4dfed69 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -90,6 +90,8 @@ enum class Class : ClassType {
90 Audio_Sink, ///< Emulator audio output backend 90 Audio_Sink, ///< Emulator audio output backend
91 Loader, ///< ROM loader 91 Loader, ///< ROM loader
92 Input, ///< Input emulation 92 Input, ///< Input emulation
93 Network, ///< Network emulation
94 WebService, ///< Interface to Citra Web Services
93 Count ///< Total number of logging classes 95 Count ///< Total number of logging classes
94}; 96};
95 97
diff --git a/src/common/quaternion.h b/src/common/quaternion.h
index 84ac82ed3..77f626bcb 100644
--- a/src/common/quaternion.h
+++ b/src/common/quaternion.h
@@ -30,6 +30,11 @@ public:
30 return {xyz * other.w + other.xyz * w + Cross(xyz, other.xyz), 30 return {xyz * other.w + other.xyz * w + Cross(xyz, other.xyz),
31 w * other.w - Dot(xyz, other.xyz)}; 31 w * other.w - Dot(xyz, other.xyz)};
32 } 32 }
33
34 Quaternion<T> Normalized() const {
35 T length = std::sqrt(xyz.Length2() + w * w);
36 return {xyz / length, w / length};
37 }
33}; 38};
34 39
35template <typename T> 40template <typename T>
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in
index 0080db5d5..4083095d5 100644
--- a/src/common/scm_rev.cpp.in
+++ b/src/common/scm_rev.cpp.in
@@ -8,6 +8,7 @@
8#define GIT_BRANCH "@GIT_BRANCH@" 8#define GIT_BRANCH "@GIT_BRANCH@"
9#define GIT_DESC "@GIT_DESC@" 9#define GIT_DESC "@GIT_DESC@"
10#define BUILD_NAME "@REPO_NAME@" 10#define BUILD_NAME "@REPO_NAME@"
11#define BUILD_DATE "@BUILD_DATE@"
11 12
12namespace Common { 13namespace Common {
13 14
@@ -15,6 +16,7 @@ const char g_scm_rev[] = GIT_REV;
15const char g_scm_branch[] = GIT_BRANCH; 16const char g_scm_branch[] = GIT_BRANCH;
16const char g_scm_desc[] = GIT_DESC; 17const char g_scm_desc[] = GIT_DESC;
17const char g_build_name[] = BUILD_NAME; 18const char g_build_name[] = BUILD_NAME;
19const char g_build_date[] = BUILD_DATE;
18 20
19} // namespace 21} // namespace
20 22
diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h
index e22389803..18aaa1735 100644
--- a/src/common/scm_rev.h
+++ b/src/common/scm_rev.h
@@ -10,5 +10,6 @@ extern const char g_scm_rev[];
10extern const char g_scm_branch[]; 10extern const char g_scm_branch[];
11extern const char g_scm_desc[]; 11extern const char g_scm_desc[];
12extern const char g_build_name[]; 12extern const char g_build_name[];
13extern const char g_build_date[];
13 14
14} // namespace 15} // namespace
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index c7a461a1e..6e2a5ad60 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -31,7 +31,6 @@
31#pragma once 31#pragma once
32 32
33#include <cmath> 33#include <cmath>
34#include <type_traits>
35 34
36namespace Math { 35namespace Math {
37 36
@@ -90,7 +89,7 @@ public:
90 x -= other.x; 89 x -= other.x;
91 y -= other.y; 90 y -= other.y;
92 } 91 }
93 template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type> 92
94 Vec2<decltype(-T{})> operator-() const { 93 Vec2<decltype(-T{})> operator-() const {
95 return MakeVec(-x, -y); 94 return MakeVec(-x, -y);
96 } 95 }
@@ -247,7 +246,7 @@ public:
247 y -= other.y; 246 y -= other.y;
248 z -= other.z; 247 z -= other.z;
249 } 248 }
250 template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type> 249
251 Vec3<decltype(-T{})> operator-() const { 250 Vec3<decltype(-T{})> operator-() const {
252 return MakeVec(-x, -y, -z); 251 return MakeVec(-x, -y, -z);
253 } 252 }
@@ -462,7 +461,7 @@ public:
462 z -= other.z; 461 z -= other.z;
463 w -= other.w; 462 w -= other.w;
464 } 463 }
465 template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type> 464
466 Vec4<decltype(-T{})> operator-() const { 465 Vec4<decltype(-T{})> operator-() const {
467 return MakeVec(-x, -y, -z, -w); 466 return MakeVec(-x, -y, -z, -w);
468 } 467 }