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:
authorStefan Hacker <dd0t@users.sourceforge.net>2013-10-23 21:14:12 +0400
committerStefan Hacker <dd0t@users.sourceforge.net>2013-10-23 21:26:26 +0400
commite51921e6f723f5d917cac9d438d4eed094bb9fb4 (patch)
tree819878ee23fa64b5be46604fe56f01bee0fa6b76 /plugins
parent3af16511c87942b9676b72fa4d1c8f24d038cd13 (diff)
Fix bug and formating in subrosa PA plugin.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sr/sr.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/plugins/sr/sr.cpp b/plugins/sr/sr.cpp
index 9b7881f5b..5e3a50e8b 100644
--- a/plugins/sr/sr.cpp
+++ b/plugins/sr/sr.cpp
@@ -32,44 +32,44 @@
#include "../mumble_plugin_win32.h"
-static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &context, std::wstring &identity) {
+static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &/*context*/, std::wstring &/*identity*/) {
for (int i=0;i<3;i++)
avatar_pos[i]=avatar_front[i]=avatar_top[i]=0.0f;
-
- char state;
+
+ char state;
bool ok;
- // Create containers to stuff our raw data into, so we can convert it to Mumble's coordinate system
+ // Create containers to stuff our raw data into, so we can convert it to Mumble's coordinate system
float pos_corrector[3];
float front_corrector[3];
float top_corrector[3];
-
+
/*
value is < >
*/
ok = peekProc((BYTE *) 0xB378564, &state, 1); // Magical state value
if (! ok)
return false;
-
+
if (state == 1)
- return true; // This results in all vectors beeing zero which tells Mumble to ignore them.
-
- // Peekproc and assign game addresses to our containers, so we can retrieve positional data
+ return true; // This results in all vectors beeing zero which tells Mumble to ignore them.
+
+ // Peekproc and assign game addresses to our containers, so we can retrieve positional data
ok = peekProc((BYTE *) 0x1243BE84, &pos_corrector, 12) &&
- peekProc((BYTE *) 0x1243BEA8, &front_corrector, 12) &&
- peekProc((BYTE *) 0x1243BE9C, &top_corrector, 12);
-
+ peekProc((BYTE *) 0x1243BEA8, &front_corrector, 12) &&
+ peekProc((BYTE *) 0x1243BE9C, &top_corrector, 12);
+
if (! ok)
return false;
- // Convert to left-handed coordinate system
-
+ // Convert to left-handed coordinate system
+
avatar_pos[0] = pos_corrector[0];
avatar_pos[1] = pos_corrector[1];
avatar_pos[2] = -pos_corrector[2];
for (int i=0;i<3;i++)
- avatar_pos[i] / 15; // Scale to meters
-
+ avatar_pos[i] /= 15; // Scale to meters
+
avatar_front[0] = -front_corrector[0];
avatar_front[1] = -front_corrector[1];
avatar_front[2] = front_corrector[2];
@@ -83,21 +83,21 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
camera_front[i] = avatar_front[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"subrosa.exe"))
return false;
-
+
// Check if we can get meaningful data from it
float apos[3], afront[3], atop[3];
float cpos[3], cfront[3], ctop[3];
std::wstring sidentity;
std::string scontext;
-
+
if (fetch(apos, afront, atop, cpos, cfront, ctop, scontext, sidentity)) {
return true;
} else {
@@ -141,4 +141,4 @@ extern "C" __declspec(dllexport) MumblePlugin *getMumblePlugin() {
extern "C" __declspec(dllexport) MumblePlugin2 *getMumblePlugin2() {
return &subrosaplug2;
-} \ No newline at end of file
+}