fix mumble coordinate transmission

This commit is contained in:
Ludwig Nussel 2010-01-06 13:47:38 +00:00
parent 42b8b8ecec
commit 9b1a3387cb

View file

@ -111,6 +111,7 @@ int mumble_link(const char* name)
}
close(shmfd);
#endif
memset(lm, 0, sizeof(LinkedMem));
mbstowcs(lm->name, name, sizeof(lm->name));
return 0;
@ -127,12 +128,12 @@ void mumble_update_coordinates2(float fAvatarPosition[3], float fAvatarFront[3],
if (!lm)
return;
memcpy(lm->fAvatarPosition, fAvatarPosition, sizeof(fAvatarPosition));
memcpy(lm->fAvatarFront, fAvatarFront, sizeof(fAvatarFront));
memcpy(lm->fAvatarTop, fAvatarTop, sizeof(fAvatarTop));
memcpy(lm->fCameraPosition, fCameraPosition, sizeof(fCameraPosition));
memcpy(lm->fCameraFront, fCameraFront, sizeof(fCameraFront));
memcpy(lm->fCameraTop, fCameraTop, sizeof(fCameraTop));
memcpy(lm->fAvatarPosition, fAvatarPosition, sizeof(lm->fAvatarPosition));
memcpy(lm->fAvatarFront, fAvatarFront, sizeof(lm->fAvatarFront));
memcpy(lm->fAvatarTop, fAvatarTop, sizeof(lm->fAvatarTop));
memcpy(lm->fCameraPosition, fCameraPosition, sizeof(lm->fCameraPosition));
memcpy(lm->fCameraFront, fCameraFront, sizeof(lm->fCameraFront));
memcpy(lm->fCameraTop, fCameraTop, sizeof(lm->fCameraTop));
lm->uiVersion = 2;
lm->uiTick = GetTickCount();
}
@ -151,6 +152,7 @@ void mumble_set_context(const unsigned char* context, size_t len)
if (!lm)
return;
len = MIN(sizeof(lm->context), len);
lm->context_len = len;
memcpy(lm->context, context, len);
}