Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert <krzmbrzl@gmail.com>2020-09-11 19:29:33 +0300
committerRobert <krzmbrzl@gmail.com>2020-09-11 19:29:33 +0300
commitaf7dac72f4063dd8d4dac71973ea51c25896089a (patch)
tree35558695aea94d48fd9e77d164d63fd8b7c76e90 /plugins/codmw2so
parent40b28b03c150b453e00c6bc4f8d6957caea59c51 (diff)
FORMAT: Run clang-format 10 on all C/CXX source-files
Diffstat (limited to 'plugins/codmw2so')
-rw-r--r--plugins/codmw2so/codmw2so.cpp80
1 files changed, 35 insertions, 45 deletions
diff --git a/plugins/codmw2so/codmw2so.cpp b/plugins/codmw2so/codmw2so.cpp
index 0e15cf2c1..9b7ea2be5 100644
--- a/plugins/codmw2so/codmw2so.cpp
+++ b/plugins/codmw2so/codmw2so.cpp
@@ -14,13 +14,13 @@
are met:
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
- Neither the name of the Mumble Developers nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -37,12 +37,13 @@
#include "../mumble_plugin_main.h"
-static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &, std::wstring &) {
+static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
+ float *camera_top, std::string &, std::wstring &) {
float viewHor, viewVer;
char state;
char specops;
- for (int i=0;i<3;i++)
+ for (int i = 0; i < 3; i++)
avatar_pos[i] = avatar_front[i] = avatar_top[i] = camera_pos[i] = camera_front[i] = camera_top[i] = 0.0f;
bool ok;
@@ -63,14 +64,15 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
*/
ok = peekProc(0x019713F0, &specops, 1); // Magical state value
- if (! ok)
+ if (!ok)
return false;
if (specops != 2)
- return false; // 2 value indicates you are playing Special Ops, 1 indicates SP, 0 indicates at three-way selection menu
+ return false; // 2 value indicates you are playing Special Ops, 1 indicates SP, 0 indicates at three-way
+ // selection menu
ok = peekProc(0x009270F0, &state, 1); // Magical state value
- if (! ok)
+ if (!ok)
return false;
// /*
@@ -85,13 +87,13 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if (state == 0)
return true; // This results in all vectors beeing zero which tells mumble to ignore them.
- ok = peekProc(0x00783A64, avatar_pos+2, 4) && //Z
- peekProc(0x00783A68, avatar_pos, 4) && //X
- peekProc(0x00783A6C, avatar_pos+1, 4) && //Y
- peekProc(0x00783A34, &viewHor, 4) && //Hor
- peekProc(0x00783A30, &viewVer, 4); //Ver
+ ok = peekProc(0x00783A64, avatar_pos + 2, 4) && // Z
+ peekProc(0x00783A68, avatar_pos, 4) && // X
+ peekProc(0x00783A6C, avatar_pos + 1, 4) && // Y
+ peekProc(0x00783A34, &viewHor, 4) && // Hor
+ peekProc(0x00783A30, &viewVer, 4); // Ver
- if (! ok)
+ if (!ok)
return false;
// Scale Coordinates
@@ -104,9 +106,9 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
decreasing when going down
40 units = 1 meter (not confirmed)
*/
- for (int i=0;i<3;i++)
- avatar_pos[i]/=40.0f; // Scale to meters
- avatar_pos[0]*=(-1.0f); // Convert right to left handed
+ for (int i = 0; i < 3; i++)
+ avatar_pos[i] /= 40.0f; // Scale to meters
+ avatar_pos[0] *= (-1.0f); // Convert right to left handed
avatar_top[2] = -1; // Head movement is in front vector
@@ -123,24 +125,24 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
270° when facing East
Increasing when turning left.
*/
- viewVer *= static_cast<float>(M_PI / 180.0f);
- viewHor *= static_cast<float>(M_PI / 180.0f);
+ viewVer *= static_cast< float >(M_PI / 180.0f);
+ viewHor *= static_cast< float >(M_PI / 180.0f);
avatar_front[0] = -sin(viewHor) * cos(viewVer);
avatar_front[1] = -sin(viewVer);
avatar_front[2] = cos(viewHor) * cos(viewVer);
- for (int i=0;i<3;i++) {
- camera_pos[i] = avatar_pos[i];
+ for (int i = 0; i < 3; i++) {
+ camera_pos[i] = avatar_pos[i];
camera_front[i] = avatar_front[i];
- camera_top[i] = avatar_top[i];
+ camera_top[i] = avatar_top[i];
}
return true;
}
-static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- if (! initialize(pids, L"iw4sp.exe"))
+static int trylock(const std::multimap< std::wstring, unsigned long long int > &pids) {
+ if (!initialize(pids, L"iw4sp.exe"))
return false;
float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3];
@@ -156,33 +158,21 @@ static int trylock(const std::multimap<std::wstring, unsigned long long int> &pi
}
static const std::wstring longdesc() {
- return std::wstring(L"Supports Call of Duty: Modern Warfare 2 Special Ops v1.1 only. No context or identity support.");
+ return std::wstring(
+ L"Supports Call of Duty: Modern Warfare 2 Special Ops v1.1 only. No context or identity support.");
}
static std::wstring description(L"Call of Duty: Modern Warfare 2 Special Ops v1.1");
static std::wstring shortname(L"Call of Duty: Modern Warfare 2 Special Ops");
static int trylock1() {
- return trylock(std::multimap<std::wstring, unsigned long long int>());
+ return trylock(std::multimap< std::wstring, unsigned long long int >());
}
-static MumblePlugin codmw2soplug = {
- MUMBLE_PLUGIN_MAGIC,
- description,
- shortname,
- nullptr,
- nullptr,
- trylock1,
- generic_unlock,
- longdesc,
- fetch
-};
-
-static MumblePlugin2 codmw2soplug2 = {
- MUMBLE_PLUGIN_MAGIC_2,
- MUMBLE_PLUGIN_VERSION,
- trylock
-};
+static MumblePlugin codmw2soplug = { MUMBLE_PLUGIN_MAGIC, description, shortname, nullptr, nullptr, trylock1,
+ generic_unlock, longdesc, fetch };
+
+static MumblePlugin2 codmw2soplug2 = { MUMBLE_PLUGIN_MAGIC_2, MUMBLE_PLUGIN_VERSION, trylock };
extern "C" MUMBLE_PLUGIN_EXPORT MumblePlugin *getMumblePlugin() {
return &codmw2soplug;