mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:23:09 +02:00
thread broadcast of avatar data in AvatarMixer
This commit is contained in:
parent
0407c6d324
commit
269615bc40
1 changed files with 13 additions and 5 deletions
|
@ -299,10 +299,18 @@ void AvatarMixer::run() {
|
||||||
|
|
||||||
nodeList->linkedDataCreateCallback = attachAvatarDataToNode;
|
nodeList->linkedDataCreateCallback = attachAvatarDataToNode;
|
||||||
|
|
||||||
// setup and start a timer to broadcast avatar data
|
// create a thead for broadcast of avatar data
|
||||||
QTimer* broadcastTimer = new QTimer(this);
|
QThread* broadcastThread = new QThread(this);
|
||||||
broadcastTimer->setInterval(AVATAR_DATA_SEND_INTERVAL_MSECS);
|
|
||||||
|
|
||||||
connect(broadcastTimer, &QTimer::timeout, this, &AvatarMixer::broadcastAvatarData);
|
// setup the timer that will be fired on the broadcast thread
|
||||||
broadcastTimer->start();
|
QTimer* broadcastTimer = new QTimer();
|
||||||
|
broadcastTimer->setInterval(AVATAR_DATA_SEND_INTERVAL_MSECS);
|
||||||
|
broadcastTimer->moveToThread(broadcastThread);
|
||||||
|
|
||||||
|
// connect appropriate signals and slots
|
||||||
|
connect(broadcastTimer, &QTimer::timeout, this, &AvatarMixer::broadcastAvatarData, Qt::DirectConnection);
|
||||||
|
connect(broadcastThread, SIGNAL(started()), broadcastTimer, SLOT(start()));
|
||||||
|
|
||||||
|
// start the broadcastThread
|
||||||
|
broadcastThread->start();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue