Skip to content

Commit

Permalink
Indent, changelog, submodule and language update
Browse files Browse the repository at this point in the history
  • Loading branch information
thorvald committed Feb 9, 2010
1 parent b2cd5de commit e2412af
Show file tree
Hide file tree
Showing 27 changed files with 1,929 additions and 2,194 deletions.
34 changes: 34 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
2010-02-09
Mikkel Krautz <[email protected]>
b2cd5de Do not add menus to user/channel context menus on OSX. Menus
that are added to the global menu bar on Cocoa/OSX must not be
added to other menus or menu bars, according to the Qt docs.
b303856 Disable unified toolbar on OSX. Too buggy at the moment. Get
rid of graphical artifacts on launch.

Thorvald Natvig <[email protected]>
c41a192 Zap commenthash when switching servers

2010-02-08
Martin Skilnand <[email protected]>
1e36860 Placeholder default_avatar.svg

Stefan Hacker <[email protected]>
070692d Small style fixes in some plugins
dfaa2d5 Zero camera position if manual plugin is deactivated

Thorvald Natvig <[email protected]>
3938ebe Move plugin system-level includes to common header
99366f3 Disable config/about buttons if plugin doesn't have that, and
add a generic_unlock
de21a22 Update STO plugin and add common initialize() function
effc993 Template helpers for Win32 plugins
e207ef6 Zero camera positions in plugins' fetch()
5271bc0 Disable PLUGIN_DEBUG as the console spams breaks up audio
33b90aa Spawn state for STO
f1c66fb STO plugin, and use camera position for positional audio and
rotate top vector properly

2010-02-07
Thorvald Natvig <[email protected]>
5595aba Add vertical space for empty lines and add some space around
Expand All @@ -6,6 +37,9 @@
on-demand loaded avatars, so always on
8a1705d Work around colors lost when application style lost

Żukowski Michał <[email protected]>
1ec8726 Small fixes in Polish translation

2010-02-06
Álvaro Manuel Recio Pérez <[email protected]>
cf75490 Updated Spanish translation
Expand Down
8 changes: 4 additions & 4 deletions plugins/mumble_plugin_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ T peekProc(VOID *base) {

static void inline u8(std::wstring &dst, const std::string &src) {
int len = MultiByteToWideChar(CP_UTF8, 0, src.data(), src.length(), NULL, 0);

wchar_t *wbuff = reinterpret_cast<wchar_t *>(_alloca(sizeof(wchar_t) * len));
MultiByteToWideChar(CP_UTF8, 0, src.data(), src.length(), wbuff, len);

dst.assign(wbuff, len);
}

static void inline u8(std::wstring &dst, const char *src, int srclen) {
int len = MultiByteToWideChar(CP_UTF8, 0, src, srclen, NULL, 0);

wchar_t *wbuff = reinterpret_cast<wchar_t *>(_alloca(sizeof(wchar_t) * len));
MultiByteToWideChar(CP_UTF8, 0, src, srclen, wbuff, len);

dst.assign(wbuff, len);
}

Expand Down
76 changes: 38 additions & 38 deletions plugins/sto/sto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,71 +35,71 @@ static BYTE *contextptr;
static BYTE *posptr;

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) {
char identblock[0x200];
char contextblock[0x80];
float posblock[64];

if (! peekProc(identptr, identblock) ||
! peekProc(contextptr, contextblock) ||
! peekProc(posptr, posblock))
return false;
std::string ident = std::string(identblock+0x188, strnlen(identblock + 0x188, 0x78)) + std::string("@") + std::string(identblock, strnlen(identblock, 0x80));
u8(identity, ident);
char identblock[0x200];
char contextblock[0x80];
float posblock[64];

if (! peekProc(identptr, identblock) ||
! peekProc(contextptr, contextblock) ||
! peekProc(posptr, posblock))
return false;

std::string ident = std::string(identblock+0x188, strnlen(identblock + 0x188, 0x78)) + std::string("@") + std::string(identblock, strnlen(identblock, 0x80));
u8(identity, ident);

#ifdef PLUGIN_DEBUG
printf("%ls\n", identity.c_str());
printf("%ls\n", identity.c_str());
#endif

context.assign(reinterpret_cast<char *>(contextblock + 0x30), 4);
context.assign(reinterpret_cast<char *>(contextblock + 0x30), 4);
#ifdef PLUGIN_DEBUG
DWORD *ctx = reinterpret_cast<DWORD *>(contextblock + 0x30);
printf("%08x\n", *ctx);
DWORD *ctx = reinterpret_cast<DWORD *>(contextblock + 0x30);
printf("%08x\n", *ctx);
#endif

#ifdef PLUGIN_DEBUG
printf("Avatar %8.3f %8.3f %8.3f\n", posblock[0], posblock[1], posblock[2]);
printf("AvatarF %8.3f %8.3f %8.3f\n", posblock[15], posblock[16], posblock[17]);
printf("Camera %8.3f %8.3f %8.3f\n", posblock[3], posblock[4], posblock[5]);
printf("CameraF %8.3f %8.3f %8.3f\n", posblock[18], posblock[19], posblock[20]);
printf("SpawnST %d\n", * reinterpret_cast<DWORD *>(& posblock[52]));
printf("Avatar %8.3f %8.3f %8.3f\n", posblock[0], posblock[1], posblock[2]);
printf("AvatarF %8.3f %8.3f %8.3f\n", posblock[15], posblock[16], posblock[17]);
printf("Camera %8.3f %8.3f %8.3f\n", posblock[3], posblock[4], posblock[5]);
printf("CameraF %8.3f %8.3f %8.3f\n", posblock[18], posblock[19], posblock[20]);
printf("SpawnST %d\n", * reinterpret_cast<DWORD *>(& posblock[52]));
#endif
if (* reinterpret_cast<DWORD *>(& posblock[52]) == 1) {
for(int i=0;i<3;++i) {
avatar_pos[i] = posblock[i];
avatar_front[i] = posblock[i+15];
camera_pos[i] = posblock[i+3];
camera_front[i] = posblock[i+18];

avatar_top[i] = camera_top[i] = 0.0f;
}
} else {
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;
}
if (* reinterpret_cast<DWORD *>(& posblock[52]) == 1) {
for (int i=0;i<3;++i) {
avatar_pos[i] = posblock[i];
avatar_front[i] = posblock[i+15];
camera_pos[i] = posblock[i+3];
camera_front[i] = posblock[i+18];

avatar_top[i] = camera_top[i] = 0.0f;
}
} else {
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;
}
}

return true;
}

static int trylock() {
identptr = contextptr = posptr = NULL;

if (! initialize(L"GameClient.exe"))
return false;

char version[17];
peekProc(pModule + 0x15E8778, version);
version[16]=0;

if (memcmp(version, "ST.0.20100202a.7", sizeof(version)) == 0) {
#ifdef PLUGIN_DEBUG
printf("STO: WANTLINK %s\n", version);
#endif
identptr = pModule + 0x1675E80;
contextptr = pModule + 0x1675a30;
posptr = pModule + 0x1885da0;

return true;
} else {
generic_unlock();
Expand Down
12 changes: 6 additions & 6 deletions src/mumble/AudioOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,21 +996,21 @@ bool AudioOutput::mix(void *outbuff, unsigned int nsamp) {
svol[i] = mul * fSpeakerVolume[i];

if (g.s.bPositionalAudio && (iChannels > 1) && g.p->fetch() && (g.bPosTest || g.p->fCameraPosition[0] != 0 || g.p->fCameraPosition[1] != 0 || g.p->fCameraPosition[2] != 0)) {

float front[3] = { g.p->fCameraFront[0], g.p->fCameraFront[1], g.p->fCameraFront[2] };
float top[3] = { g.p->fCameraTop[0], g.p->fCameraTop[1], g.p->fCameraTop[2] };

// Front vector is dominant; if it's zero we presume all is zero.

float flen = sqrtf(front[0]*front[0]+front[1]*front[1]+front[2]*front[2]);

if (flen > 0.0f) {
front[0] *= (1.0f / flen);
front[1] *= (1.0f / flen);
front[2] *= (1.0f / flen);

float tlen = sqrtf(top[0]*top[0]+top[1]*top[1]+top[2]*top[2]);

if (tlen > 0.0f) {
top[0] *= (1.0f / tlen);
top[1] *= (1.0f / tlen);
Expand All @@ -1023,12 +1023,12 @@ bool AudioOutput::mix(void *outbuff, unsigned int nsamp) {

if (fabs(front[0] * top[0] + front[1] * top[1] + front[2] * top[2]) > 0.01f) {
// Not perpendicular. Assume Y up and rotate 90 degrees.

float azimuth = 0.0f;
if ((front[0] != 0.0f) || (front[2] != 0.0f))
azimuth = atan2f(front[2], front[0]);
float inclination = acosf(front[1]) - M_PI / 2;

top[0] = sinf(inclination)*cosf(azimuth);
top[1] = cosf(inclination);
top[2] = sinf(inclination)*sinf(azimuth);
Expand All @@ -1037,7 +1037,7 @@ bool AudioOutput::mix(void *outbuff, unsigned int nsamp) {
front[0] = 0.0f;
front[1] = 0.0f;
front[2] = 1.0f;

top[0] = 0.0f;
top[1] = 1.0f;
top[2] = 0.0f;
Expand Down
Loading

0 comments on commit e2412af

Please sign in to comment.