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:
authorTuck Therebelos <snares@users.sourceforge.net>2009-04-25 01:36:03 +0400
committerTuck Therebelos <snares@users.sourceforge.net>2009-04-25 01:36:03 +0400
commitf594ce8ee4a4af180bcb6c90cc8a1eb46727eaee (patch)
treec4e6f0b0bb2b16e9ea75b892244c882364c5ad7a /plugins/wolfet
parent35ebe8f1c73f942ef8482fda847f3df23d15197d (diff)
Plugins update for 1.2 PA; Cod5 and L4D patch update
Diffstat (limited to 'plugins/wolfet')
-rw-r--r--plugins/wolfet/wolfet.cpp39
1 files changed, 26 insertions, 13 deletions
diff --git a/plugins/wolfet/wolfet.cpp b/plugins/wolfet/wolfet.cpp
index 9162408c8..56270d3fd 100644
--- a/plugins/wolfet/wolfet.cpp
+++ b/plugins/wolfet/wolfet.cpp
@@ -41,13 +41,12 @@ static void about(HWND h) {
::MessageBox(h, L"Reads audio position information from Wolfenstein: Enemy Territory (v 2.60b)", L"Mumble W:ET plugin", MB_OK);
}
-
-static int fetch(float *pos, float *front, float *top) {
+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) {
float viewHor, viewVer;
char state;
for (int i=0;i<3;i++)
- pos[i]=front[i]=top[i]=0.0f;
+ avatar_pos[i]=avatar_front[i]=avatar_top[i]=0.0f;
bool ok;
@@ -70,9 +69,9 @@ static int fetch(float *pos, float *front, float *top) {
if (state != 32)
return true; // If this magic value is !=32 we are spectating, so switch off PA
- ok = peekProc((BYTE *) 0x013F79CC, pos+1, 4) && //Y
- peekProc((BYTE *) 0x013E8CF4, pos, 4) && //X
- peekProc((BYTE *) 0x013E8CF8, pos+2, 4) && //Z
+ ok = peekProc((BYTE *) 0x013F79CC, avatar_pos+1, 4) && //Y
+ peekProc((BYTE *) 0x013E8CF4, avatar_pos, 4) && //X
+ peekProc((BYTE *) 0x013E8CF8, avatar_pos+2, 4) && //Z
peekProc((BYTE *) 0x013F9E20, &viewHor, 4) && //Hor
peekProc((BYTE *) 0x013F9E1C, &viewVer, 4); //Ver
@@ -105,9 +104,15 @@ static int fetch(float *pos, float *front, float *top) {
viewVer *= static_cast<float>(M_PI / 180.0f);
viewHor *= static_cast<float>(M_PI / 180.0f);
- front[0] = cos(viewVer) * cos(viewHor);
- front[1] = -sin(viewVer);
- front[2] = cos(viewVer) * sin(viewHor);
+ avatar_front[0] = cos(viewVer) * cos(viewHor);
+ avatar_front[1] = -sin(viewVer);
+ avatar_front[2] = cos(viewVer) * sin(viewHor);
+
+ 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];
+ }
return ok;
}
@@ -122,8 +127,11 @@ static int trylock() {
if (!h)
return false;
- float pos[3], front[3], top[3];
- if (fetch(pos, front, top))
+ float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3];
+ std::string context;
+ std::wstring identity;
+
+ if (fetch(apos, afront, atop, cpos, cfront, ctop, context, identity))
return true;
CloseHandle(h);
@@ -138,14 +146,19 @@ static void unlock() {
}
}
+static const std::wstring longdesc() {
+ return std::wstring(L"Supports Wolfenstien: Enemy Territory 2.60b. No context or identity support yet.");
+}
+
static MumblePlugin wolfetplug = {
MUMBLE_PLUGIN_MAGIC,
- L"Wolfenstein: Enemy Territory 2.60b",
- L"Wolfenstein: Enemy Territory",
+ std::wstring(L"Wolfenstein: Enemy Territory 2.60b"),
+ std::wstring(L"Wolfenstein: Enemy Territory"),
about,
NULL,
trylock,
unlock,
+ longdesc,
fetch
};