mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 11:42:55 +02:00
finished requested changes
This commit is contained in:
parent
cc2c208b12
commit
b665dbe13e
6 changed files with 34 additions and 27 deletions
|
@ -2294,25 +2294,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
// Preload Tablet sounds
|
// Preload Tablet sounds
|
||||||
DependencyManager::get<TabletScriptingInterface>()->preloadSounds();
|
DependencyManager::get<TabletScriptingInterface>()->preloadSounds();
|
||||||
|
|
||||||
connect(this, &Application::interstitialModeChanged, this, [this] (bool interstitialMode) {
|
|
||||||
if (!interstitialMode) {
|
|
||||||
DependencyManager::get<AudioClient>()->negotiateAudioFormat();
|
|
||||||
_queryExpiry = SteadyClock::now();
|
|
||||||
if (_avatarOverrideUrl.isValid()) {
|
|
||||||
getMyAvatar()->useFullAvatarURL(_avatarOverrideUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getMyAvatar()->getFullAvatarURLFromPreferences() != getMyAvatar()->getSkeletonModelURL()) {
|
|
||||||
getMyAvatar()->resetFullAvatarURL();
|
|
||||||
}
|
|
||||||
getMyAvatar()->markIdentityDataChanged();
|
|
||||||
getMyAvatar()->resetLastSent();
|
|
||||||
|
|
||||||
// transmit a "sendAll" packet to the AvatarMixer we just connected to.
|
|
||||||
getMyAvatar()->sendAvatarDataPacket(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
_pendingIdleEvent = false;
|
_pendingIdleEvent = false;
|
||||||
_pendingRenderEvent = false;
|
_pendingRenderEvent = false;
|
||||||
|
|
||||||
|
@ -3496,8 +3477,9 @@ void Application::setIsInterstitialMode(bool interstitialMode) {
|
||||||
if (_interstitialMode != interstitialMode) {
|
if (_interstitialMode != interstitialMode) {
|
||||||
_interstitialMode = interstitialMode;
|
_interstitialMode = interstitialMode;
|
||||||
|
|
||||||
auto audioClient = DependencyManager::get<AudioClient>();
|
DependencyManager::get<AudioClient>()->setAudioPaused(_interstitialMode);
|
||||||
audioClient->setAudioPaused(_interstitialMode);
|
DependencyManager::get<AvatarManager>()->setMyAvatarDataPacketsPaused(_interstitialMode);
|
||||||
|
|
||||||
emit interstitialModeChanged(_interstitialMode);
|
emit interstitialModeChanged(_interstitialMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6477,7 +6459,7 @@ void Application::nodeActivated(SharedNodePointer node) {
|
||||||
DependencyManager::get<AudioClient>()->negotiateAudioFormat();
|
DependencyManager::get<AudioClient>()->negotiateAudioFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->getType() == NodeType::AvatarMixer && !isInterstitialMode()) {
|
if (node->getType() == NodeType::AvatarMixer) {
|
||||||
_queryExpiry = SteadyClock::now();
|
_queryExpiry = SteadyClock::now();
|
||||||
|
|
||||||
// new avatar mixer, send off our identity packet on next update loop
|
// new avatar mixer, send off our identity packet on next update loop
|
||||||
|
@ -6493,10 +6475,12 @@ void Application::nodeActivated(SharedNodePointer node) {
|
||||||
getMyAvatar()->markIdentityDataChanged();
|
getMyAvatar()->markIdentityDataChanged();
|
||||||
getMyAvatar()->resetLastSent();
|
getMyAvatar()->resetLastSent();
|
||||||
|
|
||||||
|
if (!isInterstitialMode()) {
|
||||||
// transmit a "sendAll" packet to the AvatarMixer we just connected to.
|
// transmit a "sendAll" packet to the AvatarMixer we just connected to.
|
||||||
getMyAvatar()->sendAvatarDataPacket(true);
|
getMyAvatar()->sendAvatarDataPacket(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Application::nodeKilled(SharedNodePointer node) {
|
void Application::nodeKilled(SharedNodePointer node) {
|
||||||
// These are here because connecting NodeList::nodeKilled to OctreePacketProcessor::nodeKilled doesn't work:
|
// These are here because connecting NodeList::nodeKilled to OctreePacketProcessor::nodeKilled doesn't work:
|
||||||
|
|
|
@ -137,7 +137,7 @@ void AvatarManager::updateMyAvatar(float deltaTime) {
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
quint64 dt = now - _lastSendAvatarDataTime;
|
quint64 dt = now - _lastSendAvatarDataTime;
|
||||||
|
|
||||||
if (dt > MIN_TIME_BETWEEN_MY_AVATAR_DATA_SENDS && !qApp->isInterstitialMode()) {
|
if (dt > MIN_TIME_BETWEEN_MY_AVATAR_DATA_SENDS && !_myAvatarDataPacketsPaused) {
|
||||||
// send head/hand data to the avatar mixer and voxel server
|
// send head/hand data to the avatar mixer and voxel server
|
||||||
PerformanceTimer perfTimer("send");
|
PerformanceTimer perfTimer("send");
|
||||||
_myAvatar->sendAvatarDataPacket();
|
_myAvatar->sendAvatarDataPacket();
|
||||||
|
@ -155,6 +155,16 @@ float AvatarManager::getAvatarDataRate(const QUuid& sessionID, const QString& ra
|
||||||
return avatar ? avatar->getDataRate(rateName) : 0.0f;
|
return avatar ? avatar->getDataRate(rateName) : 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AvatarManager::setMyAvatarDataPacketsPaused(bool pause) {
|
||||||
|
if (_myAvatarDataPacketsPaused != pause) {
|
||||||
|
_myAvatarDataPacketsPaused = pause;
|
||||||
|
|
||||||
|
if (!_myAvatarDataPacketsPaused) {
|
||||||
|
_myAvatar->sendAvatarDataPacket(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float AvatarManager::getAvatarUpdateRate(const QUuid& sessionID, const QString& rateName) const {
|
float AvatarManager::getAvatarUpdateRate(const QUuid& sessionID, const QString& rateName) const {
|
||||||
auto avatar = getAvatarBySessionID(sessionID);
|
auto avatar = getAvatarBySessionID(sessionID);
|
||||||
return avatar ? avatar->getUpdateRate(rateName) : 0.0f;
|
return avatar ? avatar->getUpdateRate(rateName) : 0.0f;
|
||||||
|
|
|
@ -91,6 +91,8 @@ public:
|
||||||
void updateOtherAvatars(float deltaTime);
|
void updateOtherAvatars(float deltaTime);
|
||||||
void sendIdentityRequest(const QUuid& avatarID) const;
|
void sendIdentityRequest(const QUuid& avatarID) const;
|
||||||
|
|
||||||
|
void setMyAvatarDataPacketsPaused(bool puase);
|
||||||
|
|
||||||
void postUpdate(float deltaTime, const render::ScenePointer& scene);
|
void postUpdate(float deltaTime, const render::ScenePointer& scene);
|
||||||
|
|
||||||
void clearOtherAvatars();
|
void clearOtherAvatars();
|
||||||
|
@ -219,6 +221,7 @@ private:
|
||||||
int _numAvatarsNotUpdated { 0 };
|
int _numAvatarsNotUpdated { 0 };
|
||||||
float _avatarSimulationTime { 0.0f };
|
float _avatarSimulationTime { 0.0f };
|
||||||
bool _shouldRender { true };
|
bool _shouldRender { true };
|
||||||
|
bool _myAvatarDataPacketsPaused { false };
|
||||||
mutable int _identityRequestsSent { 0 };
|
mutable int _identityRequestsSent { 0 };
|
||||||
|
|
||||||
mutable std::mutex _spaceLock;
|
mutable std::mutex _spaceLock;
|
||||||
|
|
|
@ -305,6 +305,16 @@ void AudioClient::audioMixerKilled() {
|
||||||
emit disconnected();
|
emit disconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AudioClient::setAudioPaused(bool pause) {
|
||||||
|
if (_audioPaused != pause) {
|
||||||
|
_audioPaused = pause;
|
||||||
|
|
||||||
|
if (!_audioPaused) {
|
||||||
|
negotiateAudioFormat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QAudioDeviceInfo getNamedAudioDeviceForMode(QAudio::Mode mode, const QString& deviceName) {
|
QAudioDeviceInfo getNamedAudioDeviceForMode(QAudio::Mode mode, const QString& deviceName) {
|
||||||
QAudioDeviceInfo result;
|
QAudioDeviceInfo result;
|
||||||
foreach(QAudioDeviceInfo audioDevice, getAvailableDevices(mode)) {
|
foreach(QAudioDeviceInfo audioDevice, getAvailableDevices(mode)) {
|
||||||
|
|
|
@ -162,7 +162,7 @@ public:
|
||||||
|
|
||||||
bool startRecording(const QString& filename);
|
bool startRecording(const QString& filename);
|
||||||
void stopRecording();
|
void stopRecording();
|
||||||
void setAudioPaused(bool pause) { _audioPaused = pause; }
|
void setAudioPaused(bool pause);
|
||||||
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
|
@ -305,7 +305,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var THE_PLACE = "hifi://TheSpot-dev";
|
var THE_PLACE = (HifiAbout.buildVersion === "dev") ? "hifi://TheSpot-dev": "hifi://TheSpot";
|
||||||
function clickedOnOverlay(overlayID, event) {
|
function clickedOnOverlay(overlayID, event) {
|
||||||
if (loadingToTheSpotID === overlayID) {
|
if (loadingToTheSpotID === overlayID) {
|
||||||
location.handleLookupString(THE_PLACE);
|
location.handleLookupString(THE_PLACE);
|
||||||
|
|
Loading…
Reference in a new issue