diff options
author | Robert <krzmbrzl@gmail.com> | 2020-09-11 19:29:33 +0300 |
---|---|---|
committer | Robert <krzmbrzl@gmail.com> | 2020-09-11 19:29:33 +0300 |
commit | af7dac72f4063dd8d4dac71973ea51c25896089a (patch) | |
tree | 35558695aea94d48fd9e77d164d63fd8b7c76e90 /plugins/cod2 | |
parent | 40b28b03c150b453e00c6bc4f8d6957caea59c51 (diff) |
FORMAT: Run clang-format 10 on all C/CXX source-files
Diffstat (limited to 'plugins/cod2')
-rw-r--r-- | plugins/cod2/cod2.cpp | 56 |
1 files changed, 22 insertions, 34 deletions
diff --git a/plugins/cod2/cod2.cpp b/plugins/cod2/cod2.cpp index 468cf4816..209a11483 100644 --- a/plugins/cod2/cod2.cpp +++ b/plugins/cod2/cod2.cpp @@ -5,11 +5,12 @@ #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; - 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; @@ -27,19 +28,19 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa 0x0096B688 byte Magic value (0=ingame/out-of-game, 4=spectator) */ ok = peekProc(0x0096B688, &state, 1); - if (! ok) + if (!ok) return false; if (state == 4) return true; // If this magic value is 4 we are spectating, so switch of PA - ok = peekProc(0x01516608, avatar_pos+2, 4) && //Z - peekProc(0x0151660C, avatar_pos, 4) && //X - peekProc(0x01516610, avatar_pos+1, 4) && //Y - peekProc(0x0151A114, &viewHor, 4) && //Hor - peekProc(0x0151A110, &viewVer, 4); //Ver + ok = peekProc(0x01516608, avatar_pos + 2, 4) && // Z + peekProc(0x0151660C, avatar_pos, 4) && // X + peekProc(0x01516610, avatar_pos + 1, 4) && // Y + peekProc(0x0151A114, &viewHor, 4) && // Hor + peekProc(0x0151A110, &viewVer, 4); // Ver - if (! ok) + if (!ok) return false; // Scale Coordinates @@ -52,9 +53,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 @@ -71,8 +72,8 @@ 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); @@ -81,8 +82,8 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa return true; } -static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) { - if (! initialize(pids, L"CoD2MP_s.exe")) +static int trylock(const std::multimap< std::wstring, unsigned long long int > &pids) { + if (!initialize(pids, L"CoD2MP_s.exe")) return false; float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3]; @@ -105,26 +106,13 @@ static std::wstring description(L"Call of Duty 2 v1.3"); static std::wstring shortname(L"Call of Duty 2"); 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 cod2plug = { - MUMBLE_PLUGIN_MAGIC, - description, - shortname, - nullptr, - nullptr, - trylock1, - generic_unlock, - longdesc, - fetch -}; - -static MumblePlugin2 cod2plug2 = { - MUMBLE_PLUGIN_MAGIC_2, - MUMBLE_PLUGIN_VERSION, - trylock -}; +static MumblePlugin cod2plug = { MUMBLE_PLUGIN_MAGIC, description, shortname, nullptr, nullptr, trylock1, + generic_unlock, longdesc, fetch }; + +static MumblePlugin2 cod2plug2 = { MUMBLE_PLUGIN_MAGIC_2, MUMBLE_PLUGIN_VERSION, trylock }; extern "C" MUMBLE_PLUGIN_EXPORT MumblePlugin *getMumblePlugin() { return &cod2plug; |