mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into temp0
This commit is contained in:
commit
b27b599643
4 changed files with 37 additions and 15 deletions
|
@ -32,8 +32,7 @@
|
||||||
BAR_URL = "http://hifi-public.s3.amazonaws.com/images/progress-bar.svg",
|
BAR_URL = "http://hifi-public.s3.amazonaws.com/images/progress-bar.svg",
|
||||||
BACKGROUND_WIDTH = 540,
|
BACKGROUND_WIDTH = 540,
|
||||||
BACKGROUND_HEIGHT = 90,
|
BACKGROUND_HEIGHT = 90,
|
||||||
BACKGROUND_URL = "http://ctrlaltstudio.com/hifi/progress-bar-background.svg",
|
BACKGROUND_URL = "http://hifi-public.s3.amazonaws.com/images/progress-bar-background.svg",
|
||||||
//BACKGROUND_URL = "http://hifi-public.s3.amazonaws.com/images/progress-bar-background.svg",
|
|
||||||
isOnHMD = false,
|
isOnHMD = false,
|
||||||
windowWidth = 0,
|
windowWidth = 0,
|
||||||
windowHeight = 0,
|
windowHeight = 0,
|
||||||
|
|
|
@ -140,6 +140,12 @@ static unsigned STARFIELD_SEED = 1;
|
||||||
|
|
||||||
const qint64 MAXIMUM_CACHE_SIZE = 10737418240; // 10GB
|
const qint64 MAXIMUM_CACHE_SIZE = 10737418240; // 10GB
|
||||||
|
|
||||||
|
static QTimer* locationUpdateTimer = NULL;
|
||||||
|
static QTimer* balanceUpdateTimer = NULL;
|
||||||
|
static QTimer* silentNodeTimer = NULL;
|
||||||
|
static QTimer* identityPacketTimer = NULL;
|
||||||
|
static QTimer* billboardPacketTimer = NULL;
|
||||||
|
static QTimer* checkFPStimer = NULL;
|
||||||
static QTimer* idleTimer = NULL;
|
static QTimer* idleTimer = NULL;
|
||||||
|
|
||||||
const QString CHECK_VERSION_URL = "https://highfidelity.io/latestVersion.xml";
|
const QString CHECK_VERSION_URL = "https://highfidelity.io/latestVersion.xml";
|
||||||
|
@ -362,7 +368,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
// update our location every 5 seconds in the data-server, assuming that we are authenticated with one
|
// update our location every 5 seconds in the data-server, assuming that we are authenticated with one
|
||||||
const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * 1000;
|
const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * 1000;
|
||||||
|
|
||||||
QTimer* locationUpdateTimer = new QTimer(this);
|
locationUpdateTimer = new QTimer(this);
|
||||||
connect(locationUpdateTimer, &QTimer::timeout, this, &Application::updateLocationInServer);
|
connect(locationUpdateTimer, &QTimer::timeout, this, &Application::updateLocationInServer);
|
||||||
locationUpdateTimer->start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
|
locationUpdateTimer->start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
|
||||||
|
|
||||||
|
@ -378,7 +384,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
|
|
||||||
const qint64 BALANCE_UPDATE_INTERVAL_MSECS = 5 * 1000;
|
const qint64 BALANCE_UPDATE_INTERVAL_MSECS = 5 * 1000;
|
||||||
|
|
||||||
QTimer* balanceUpdateTimer = new QTimer(this);
|
balanceUpdateTimer = new QTimer(this);
|
||||||
connect(balanceUpdateTimer, &QTimer::timeout, &accountManager, &AccountManager::updateBalance);
|
connect(balanceUpdateTimer, &QTimer::timeout, &accountManager, &AccountManager::updateBalance);
|
||||||
balanceUpdateTimer->start(BALANCE_UPDATE_INTERVAL_MSECS);
|
balanceUpdateTimer->start(BALANCE_UPDATE_INTERVAL_MSECS);
|
||||||
|
|
||||||
|
@ -417,18 +423,18 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent);
|
connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent);
|
||||||
|
|
||||||
// move the silentNodeTimer to the _nodeThread
|
// move the silentNodeTimer to the _nodeThread
|
||||||
QTimer* silentNodeTimer = new QTimer();
|
silentNodeTimer = new QTimer();
|
||||||
connect(silentNodeTimer, SIGNAL(timeout()), nodeList.data(), SLOT(removeSilentNodes()));
|
connect(silentNodeTimer, SIGNAL(timeout()), nodeList.data(), SLOT(removeSilentNodes()));
|
||||||
silentNodeTimer->start(NODE_SILENCE_THRESHOLD_MSECS);
|
silentNodeTimer->start(NODE_SILENCE_THRESHOLD_MSECS);
|
||||||
silentNodeTimer->moveToThread(_nodeThread);
|
silentNodeTimer->moveToThread(_nodeThread);
|
||||||
|
|
||||||
// send the identity packet for our avatar each second to our avatar mixer
|
// send the identity packet for our avatar each second to our avatar mixer
|
||||||
QTimer* identityPacketTimer = new QTimer();
|
identityPacketTimer = new QTimer();
|
||||||
connect(identityPacketTimer, &QTimer::timeout, _myAvatar, &MyAvatar::sendIdentityPacket);
|
connect(identityPacketTimer, &QTimer::timeout, _myAvatar, &MyAvatar::sendIdentityPacket);
|
||||||
identityPacketTimer->start(AVATAR_IDENTITY_PACKET_SEND_INTERVAL_MSECS);
|
identityPacketTimer->start(AVATAR_IDENTITY_PACKET_SEND_INTERVAL_MSECS);
|
||||||
|
|
||||||
// send the billboard packet for our avatar every few seconds
|
// send the billboard packet for our avatar every few seconds
|
||||||
QTimer* billboardPacketTimer = new QTimer();
|
billboardPacketTimer = new QTimer();
|
||||||
connect(billboardPacketTimer, &QTimer::timeout, _myAvatar, &MyAvatar::sendBillboardPacket);
|
connect(billboardPacketTimer, &QTimer::timeout, _myAvatar, &MyAvatar::sendBillboardPacket);
|
||||||
billboardPacketTimer->start(AVATAR_BILLBOARD_PACKET_SEND_INTERVAL_MSECS);
|
billboardPacketTimer->start(AVATAR_BILLBOARD_PACKET_SEND_INTERVAL_MSECS);
|
||||||
|
|
||||||
|
@ -527,11 +533,28 @@ void Application::aboutToQuit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::cleanupBeforeQuit() {
|
void Application::cleanupBeforeQuit() {
|
||||||
// make sure we don't call the idle timer any more
|
// first stop all timers directly or by invokeMethod
|
||||||
|
// depending on what thread they run in
|
||||||
|
locationUpdateTimer->stop();
|
||||||
|
balanceUpdateTimer->stop();
|
||||||
|
QMetaObject::invokeMethod(silentNodeTimer, "stop", Qt::BlockingQueuedConnection);
|
||||||
|
identityPacketTimer->stop();
|
||||||
|
billboardPacketTimer->stop();
|
||||||
|
checkFPStimer->stop();
|
||||||
|
idleTimer->stop();
|
||||||
|
QMetaObject::invokeMethod(&_settingsTimer, "stop", Qt::BlockingQueuedConnection);
|
||||||
|
|
||||||
|
// and then delete those that got created by "new"
|
||||||
|
delete locationUpdateTimer;
|
||||||
|
delete balanceUpdateTimer;
|
||||||
|
delete silentNodeTimer;
|
||||||
|
delete identityPacketTimer;
|
||||||
|
delete billboardPacketTimer;
|
||||||
|
delete checkFPStimer;
|
||||||
delete idleTimer;
|
delete idleTimer;
|
||||||
|
// no need to delete _settingsTimer here as it is no pointer
|
||||||
|
|
||||||
// save state
|
// save state
|
||||||
QMetaObject::invokeMethod(&_settingsTimer, "stop", Qt::BlockingQueuedConnection);
|
|
||||||
_settingsThread.quit();
|
_settingsThread.quit();
|
||||||
saveSettings();
|
saveSettings();
|
||||||
_window->saveGeometry();
|
_window->saveGeometry();
|
||||||
|
@ -630,9 +653,9 @@ void Application::initializeGL() {
|
||||||
_entityEditSender.initialize(_enableProcessOctreeThread);
|
_entityEditSender.initialize(_enableProcessOctreeThread);
|
||||||
|
|
||||||
// call our timer function every second
|
// call our timer function every second
|
||||||
QTimer* timer = new QTimer(this);
|
checkFPStimer = new QTimer(this);
|
||||||
connect(timer, SIGNAL(timeout()), SLOT(timer()));
|
connect(checkFPStimer, SIGNAL(timeout()), SLOT(checkFPS()));
|
||||||
timer->start(1000);
|
checkFPStimer->start(1000);
|
||||||
|
|
||||||
// call our idle function whenever we can
|
// call our idle function whenever we can
|
||||||
idleTimer = new QTimer(this);
|
idleTimer = new QTimer(this);
|
||||||
|
@ -1428,7 +1451,7 @@ void Application::sendPingPackets() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Every second, check the frame rates and other stuff
|
// Every second, check the frame rates and other stuff
|
||||||
void Application::timer() {
|
void Application::checkFPS() {
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) {
|
||||||
sendPingPackets();
|
sendPingPackets();
|
||||||
}
|
}
|
||||||
|
|
|
@ -368,7 +368,7 @@ public slots:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void clearDomainOctreeDetails();
|
void clearDomainOctreeDetails();
|
||||||
void timer();
|
void checkFPS();
|
||||||
void idle();
|
void idle();
|
||||||
void aboutToQuit();
|
void aboutToQuit();
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ protected:
|
||||||
glm::vec3 _cameraPosition = glm::vec3(0.0f);
|
glm::vec3 _cameraPosition = glm::vec3(0.0f);
|
||||||
glm::quat _cameraOrientation = glm::quat();
|
glm::quat _cameraOrientation = glm::quat();
|
||||||
float _cameraFov = 0.0f;
|
float _cameraFov = 0.0f;
|
||||||
float _cameraAspectRatio = 0.0f;
|
float _cameraAspectRatio = 1.0f;
|
||||||
float _cameraNearClip = 0.0f;
|
float _cameraNearClip = 0.0f;
|
||||||
float _cameraFarClip = 0.0f;
|
float _cameraFarClip = 0.0f;
|
||||||
glm::vec3 _cameraEyeOffsetPosition = glm::vec3(0.0f);
|
glm::vec3 _cameraEyeOffsetPosition = glm::vec3(0.0f);
|
||||||
|
|
Loading…
Reference in a new issue