mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-16 00:08:48 +02:00
more warnings fixes
This commit is contained in:
parent
61a905961e
commit
adb6ffe7c4
5 changed files with 17 additions and 26 deletions
|
@ -40,13 +40,13 @@ bool waitForVoxelServer = true;
|
||||||
const int ANIMATION_LISTEN_PORT = 40107;
|
const int ANIMATION_LISTEN_PORT = 40107;
|
||||||
int ANIMATE_FPS = 60;
|
int ANIMATE_FPS = 60;
|
||||||
double ANIMATE_FPS_IN_MILLISECONDS = 1000.0/ANIMATE_FPS; // determines FPS from our desired FPS
|
double ANIMATE_FPS_IN_MILLISECONDS = 1000.0/ANIMATE_FPS; // determines FPS from our desired FPS
|
||||||
int ANIMATE_VOXELS_INTERVAL_USECS = (ANIMATE_FPS_IN_MILLISECONDS * 1000.0); // converts from milliseconds to usecs
|
quint64 ANIMATE_VOXELS_INTERVAL_USECS = (ANIMATE_FPS_IN_MILLISECONDS * 1000); // converts from milliseconds to usecs
|
||||||
|
|
||||||
|
|
||||||
int PROCESSING_FPS = 60;
|
int PROCESSING_FPS = 60;
|
||||||
double PROCESSING_FPS_IN_MILLISECONDS = 1000.0/PROCESSING_FPS; // determines FPS from our desired FPS
|
double PROCESSING_FPS_IN_MILLISECONDS = 1000.0/PROCESSING_FPS; // determines FPS from our desired FPS
|
||||||
int FUDGE_USECS = 650; // a little bit of fudge to actually do some processing
|
int FUDGE_USECS = 650; // a little bit of fudge to actually do some processing
|
||||||
int PROCESSING_INTERVAL_USECS = (PROCESSING_FPS_IN_MILLISECONDS * 1000.0) - FUDGE_USECS; // converts from milliseconds to usecs
|
quint64 PROCESSING_INTERVAL_USECS = (PROCESSING_FPS_IN_MILLISECONDS * 1000) - FUDGE_USECS; // converts from milliseconds to usecs
|
||||||
|
|
||||||
bool wantLocalDomain = false;
|
bool wantLocalDomain = false;
|
||||||
|
|
||||||
|
@ -611,9 +611,6 @@ void* animateVoxels(void* args) {
|
||||||
}
|
}
|
||||||
lastProcessTime = usecTimestampNow();
|
lastProcessTime = usecTimestampNow();
|
||||||
|
|
||||||
int packetsStarting = 0;
|
|
||||||
int packetsEnding = 0;
|
|
||||||
|
|
||||||
// The while loop will be running at PROCESSING_FPS, but we only want to call these animation functions at
|
// The while loop will be running at PROCESSING_FPS, but we only want to call these animation functions at
|
||||||
// ANIMATE_FPS. So we check out last animate time and only call these if we've elapsed that time.
|
// ANIMATE_FPS. So we check out last animate time and only call these if we've elapsed that time.
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
|
@ -627,8 +624,6 @@ void* animateVoxels(void* args) {
|
||||||
animateLoopsPerAnimate++;
|
animateLoopsPerAnimate++;
|
||||||
|
|
||||||
lastAnimateTime = now;
|
lastAnimateTime = now;
|
||||||
packetsStarting = ::voxelEditPacketSender->packetsToSendCount();
|
|
||||||
|
|
||||||
// some animations
|
// some animations
|
||||||
//sendVoxelBlinkMessage();
|
//sendVoxelBlinkMessage();
|
||||||
|
|
||||||
|
@ -652,8 +647,6 @@ void* animateVoxels(void* args) {
|
||||||
doBuildStreet();
|
doBuildStreet();
|
||||||
}
|
}
|
||||||
|
|
||||||
packetsEnding = ::voxelEditPacketSender->packetsToSendCount();
|
|
||||||
|
|
||||||
if (animationElapsed > ANIMATE_VOXELS_INTERVAL_USECS) {
|
if (animationElapsed > ANIMATE_VOXELS_INTERVAL_USECS) {
|
||||||
animationElapsed -= ANIMATE_VOXELS_INTERVAL_USECS; // credit ourselves one animation frame
|
animationElapsed -= ANIMATE_VOXELS_INTERVAL_USECS; // credit ourselves one animation frame
|
||||||
} else {
|
} else {
|
||||||
|
@ -670,9 +663,9 @@ void* animateVoxels(void* args) {
|
||||||
processesPerAnimate++;
|
processesPerAnimate++;
|
||||||
}
|
}
|
||||||
// dynamically sleep until we need to fire off the next set of voxels
|
// dynamically sleep until we need to fire off the next set of voxels
|
||||||
quint64 usecToSleep = PROCESSING_INTERVAL_USECS - (usecTimestampNow() - lastProcessTime);
|
quint64 usecToSleep = ::PROCESSING_INTERVAL_USECS - (usecTimestampNow() - lastProcessTime);
|
||||||
if (usecToSleep > PROCESSING_INTERVAL_USECS) {
|
if (usecToSleep > ::PROCESSING_INTERVAL_USECS) {
|
||||||
usecToSleep = PROCESSING_INTERVAL_USECS;
|
usecToSleep = ::PROCESSING_INTERVAL_USECS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usecToSleep > 0) {
|
if (usecToSleep > 0) {
|
||||||
|
@ -758,7 +751,7 @@ AnimationServer::AnimationServer(int &argc, char **argv) :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("ANIMATE_FPS=%d\n",ANIMATE_FPS);
|
printf("ANIMATE_FPS=%d\n",ANIMATE_FPS);
|
||||||
printf("ANIMATE_VOXELS_INTERVAL_USECS=%d\n",ANIMATE_VOXELS_INTERVAL_USECS);
|
printf("ANIMATE_VOXELS_INTERVAL_USECS=%llu\n",ANIMATE_VOXELS_INTERVAL_USECS);
|
||||||
|
|
||||||
const char* processingFPSCommand = getCmdOption(argc, (const char**) argv, "--ProcessingFPS");
|
const char* processingFPSCommand = getCmdOption(argc, (const char**) argv, "--ProcessingFPS");
|
||||||
const char* processingIntervalCommand = getCmdOption(argc, (const char**) argv, "--ProcessingInterval");
|
const char* processingIntervalCommand = getCmdOption(argc, (const char**) argv, "--ProcessingInterval");
|
||||||
|
@ -774,7 +767,7 @@ AnimationServer::AnimationServer(int &argc, char **argv) :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("PROCESSING_FPS=%d\n",PROCESSING_FPS);
|
printf("PROCESSING_FPS=%d\n",PROCESSING_FPS);
|
||||||
printf("PROCESSING_INTERVAL_USECS=%d\n",PROCESSING_INTERVAL_USECS);
|
printf("PROCESSING_INTERVAL_USECS=%llu\n",PROCESSING_INTERVAL_USECS);
|
||||||
|
|
||||||
nodeList->linkedDataCreateCallback = NULL; // do we need a callback?
|
nodeList->linkedDataCreateCallback = NULL; // do we need a callback?
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,6 @@ void AudioMixer::addBufferToMixForListeningNodeWithBuffer(PositionalAudioRingBuf
|
||||||
if (bufferToAdd != listeningNodeBuffer) {
|
if (bufferToAdd != listeningNodeBuffer) {
|
||||||
// if the two buffer pointers do not match then these are different buffers
|
// if the two buffer pointers do not match then these are different buffers
|
||||||
|
|
||||||
glm::vec3 listenerPosition = listeningNodeBuffer->getPosition();
|
|
||||||
glm::vec3 relativePosition = bufferToAdd->getPosition() - listeningNodeBuffer->getPosition();
|
glm::vec3 relativePosition = bufferToAdd->getPosition() - listeningNodeBuffer->getPosition();
|
||||||
glm::quat inverseOrientation = glm::inverse(listeningNodeBuffer->getOrientation());
|
glm::quat inverseOrientation = glm::inverse(listeningNodeBuffer->getOrientation());
|
||||||
|
|
||||||
|
|
|
@ -54,15 +54,13 @@ bool OctreeSendThread::process() {
|
||||||
|
|
||||||
nodeData = (OctreeQueryNode*) node->getLinkedData();
|
nodeData = (OctreeQueryNode*) node->getLinkedData();
|
||||||
|
|
||||||
int packetsSent = 0;
|
|
||||||
|
|
||||||
// Sometimes the node data has not yet been linked, in which case we can't really do anything
|
// Sometimes the node data has not yet been linked, in which case we can't really do anything
|
||||||
if (nodeData) {
|
if (nodeData) {
|
||||||
bool viewFrustumChanged = nodeData->updateCurrentViewFrustum();
|
bool viewFrustumChanged = nodeData->updateCurrentViewFrustum();
|
||||||
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
|
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
|
||||||
printf("nodeData->updateCurrentViewFrustum() changed=%s\n", debug::valueOf(viewFrustumChanged));
|
printf("nodeData->updateCurrentViewFrustum() changed=%s\n", debug::valueOf(viewFrustumChanged));
|
||||||
}
|
}
|
||||||
packetsSent = packetDistributor(node, nodeData, viewFrustumChanged);
|
packetDistributor(node, nodeData, viewFrustumChanged);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_nodeMissingCount++;
|
_nodeMissingCount++;
|
||||||
|
|
|
@ -535,7 +535,7 @@ void runTimingTests() {
|
||||||
}
|
}
|
||||||
gettimeofday(&endTime, NULL);
|
gettimeofday(&endTime, NULL);
|
||||||
elapsedMsecs = diffclock(&startTime, &endTime);
|
elapsedMsecs = diffclock(&startTime, &endTime);
|
||||||
qDebug("rand() stored in array usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
|
qDebug("rand() stored in array usecs: %f, first result:%d", 1000.0f * elapsedMsecs / (float) numTests, iResults[0]);
|
||||||
|
|
||||||
// Random number generation using randFloat()
|
// Random number generation using randFloat()
|
||||||
gettimeofday(&startTime, NULL);
|
gettimeofday(&startTime, NULL);
|
||||||
|
@ -544,7 +544,7 @@ void runTimingTests() {
|
||||||
}
|
}
|
||||||
gettimeofday(&endTime, NULL);
|
gettimeofday(&endTime, NULL);
|
||||||
elapsedMsecs = diffclock(&startTime, &endTime);
|
elapsedMsecs = diffclock(&startTime, &endTime);
|
||||||
qDebug("randFloat() stored in array usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
|
qDebug("randFloat() stored in array usecs: %f, first result: %f", 1000.0f * elapsedMsecs / (float) numTests, fResults[0]);
|
||||||
|
|
||||||
// PowF function
|
// PowF function
|
||||||
fTest = 1145323.2342f;
|
fTest = 1145323.2342f;
|
||||||
|
@ -567,8 +567,8 @@ void runTimingTests() {
|
||||||
}
|
}
|
||||||
gettimeofday(&endTime, NULL);
|
gettimeofday(&endTime, NULL);
|
||||||
elapsedMsecs = diffclock(&startTime, &endTime);
|
elapsedMsecs = diffclock(&startTime, &endTime);
|
||||||
qDebug("vector math usecs: %f [%f msecs total for %d tests]",
|
qDebug("vector math usecs: %f [%f msecs total for %d tests], last result:%f",
|
||||||
1000.0f * elapsedMsecs / (float) numTests, elapsedMsecs, numTests);
|
1000.0f * elapsedMsecs / (float) numTests, elapsedMsecs, numTests, distance);
|
||||||
|
|
||||||
// Vec3 test
|
// Vec3 test
|
||||||
glm::vec3 vecA(randVector()), vecB(randVector());
|
glm::vec3 vecA(randVector()), vecB(randVector());
|
||||||
|
@ -581,7 +581,7 @@ void runTimingTests() {
|
||||||
}
|
}
|
||||||
gettimeofday(&endTime, NULL);
|
gettimeofday(&endTime, NULL);
|
||||||
elapsedMsecs = diffclock(&startTime, &endTime);
|
elapsedMsecs = diffclock(&startTime, &endTime);
|
||||||
qDebug("vec3 assign and dot() usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
|
qDebug("vec3 assign and dot() usecs: %f, last result:%f", 1000.0f * elapsedMsecs / (float) numTests, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
float loadSetting(QSettings* settings, const char* name, float defaultValue) {
|
float loadSetting(QSettings* settings, const char* name, float defaultValue) {
|
||||||
|
|
|
@ -178,13 +178,14 @@ void VoxelTreeElement::calculateAverageFromChildren() {
|
||||||
bool VoxelTreeElement::collapseChildren() {
|
bool VoxelTreeElement::collapseChildren() {
|
||||||
// scan children, verify that they are ALL present and accounted for
|
// scan children, verify that they are ALL present and accounted for
|
||||||
bool allChildrenMatch = true; // assume the best (ottimista)
|
bool allChildrenMatch = true; // assume the best (ottimista)
|
||||||
int red,green,blue;
|
int red = 0;
|
||||||
|
int green = 0;
|
||||||
|
int blue = 0;
|
||||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||||
VoxelTreeElement* childAt = getChildAtIndex(i);
|
VoxelTreeElement* childAt = getChildAtIndex(i);
|
||||||
// if no child, child isn't a leaf, or child doesn't have a color
|
// if no child, child isn't a leaf, or child doesn't have a color
|
||||||
if (!childAt || !childAt->isLeaf() || !childAt->isColored()) {
|
if (!childAt || !childAt->isLeaf() || !childAt->isColored()) {
|
||||||
allChildrenMatch=false;
|
allChildrenMatch = false;
|
||||||
//qDebug("SADNESS child missing or not colored! i=%d\n",i);
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (i==0) {
|
if (i==0) {
|
||||||
|
|
Loading…
Reference in a new issue