initial newline removal from all QDebug calls

This commit is contained in:
Stephen Birarda 2014-01-14 13:08:47 -08:00
parent a8bbe41642
commit 987c639e36
72 changed files with 479 additions and 488 deletions

View file

@ -598,10 +598,10 @@ void* animateVoxels(void* args) {
bool firstTime = true; bool firstTime = true;
qDebug() << "Setting PPS to " << ::packetsPerSecond << "\n"; qDebug() << "Setting PPS to " << ::packetsPerSecond;
::voxelEditPacketSender->setPacketsPerSecond(::packetsPerSecond); ::voxelEditPacketSender->setPacketsPerSecond(::packetsPerSecond);
qDebug() << "PPS set to " << ::voxelEditPacketSender->getPacketsPerSecond() << "\n"; qDebug() << "PPS set to " << ::voxelEditPacketSender->getPacketsPerSecond();
while (true) { while (true) {

View file

@ -67,7 +67,7 @@ void Agent::run() {
QNetworkAccessManager *networkManager = new QNetworkAccessManager(this); QNetworkAccessManager *networkManager = new QNetworkAccessManager(this);
QNetworkReply *reply = networkManager->get(QNetworkRequest(QUrl(scriptURLString))); QNetworkReply *reply = networkManager->get(QNetworkRequest(QUrl(scriptURLString)));
qDebug() << "Downloading script at" << scriptURLString << "\n"; qDebug() << "Downloading script at" << scriptURLString;
QEventLoop loop; QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
@ -76,7 +76,7 @@ void Agent::run() {
QString scriptContents(reply->readAll()); QString scriptContents(reply->readAll());
qDebug() << "Downloaded script:" << scriptContents << "\n"; qDebug() << "Downloaded script:" << scriptContents;
timeval startTime; timeval startTime;
gettimeofday(&startTime, NULL); gettimeofday(&startTime, NULL);

View file

@ -83,7 +83,7 @@ AssignmentClient::AssignmentClient(int &argc, char **argv) :
} }
// call a timer function every ASSIGNMENT_REQUEST_INTERVAL_MSECS to ask for assignment, if required // call a timer function every ASSIGNMENT_REQUEST_INTERVAL_MSECS to ask for assignment, if required
qDebug() << "Waiting for assignment -" << _requestAssignment << "\n"; qDebug() << "Waiting for assignment -" << _requestAssignment;
QTimer* timer = new QTimer(this); QTimer* timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), SLOT(sendAssignmentRequest())); connect(timer, SIGNAL(timeout()), SLOT(sendAssignmentRequest()));
@ -121,20 +121,19 @@ void AssignmentClient::readPendingDatagrams() {
} else if (packetData[0] == PACKET_TYPE_DEPLOY_ASSIGNMENT || packetData[0] == PACKET_TYPE_CREATE_ASSIGNMENT) { } else if (packetData[0] == PACKET_TYPE_DEPLOY_ASSIGNMENT || packetData[0] == PACKET_TYPE_CREATE_ASSIGNMENT) {
if (_currentAssignment) { if (_currentAssignment) {
qDebug() << "Dropping received assignment since we are currently running one.\n"; qDebug() << "Dropping received assignment since we are currently running one.";
} else { } else {
// construct the deployed assignment from the packet data // construct the deployed assignment from the packet data
_currentAssignment = AssignmentFactory::unpackAssignment(packetData, receivedBytes); _currentAssignment = AssignmentFactory::unpackAssignment(packetData, receivedBytes);
qDebug() << "Received an assignment -" << *_currentAssignment << "\n"; qDebug() << "Received an assignment -" << *_currentAssignment;
// switch our nodelist domain IP and port to whoever sent us the assignment // switch our nodelist domain IP and port to whoever sent us the assignment
if (packetData[0] == PACKET_TYPE_CREATE_ASSIGNMENT) { if (packetData[0] == PACKET_TYPE_CREATE_ASSIGNMENT) {
nodeList->setDomainSockAddr(senderSockAddr); nodeList->setDomainSockAddr(senderSockAddr);
nodeList->setOwnerUUID(_currentAssignment->getUUID()); nodeList->setOwnerUUID(_currentAssignment->getUUID());
qDebug("Destination IP for assignment is %s\n", qDebug() << "Destination IP for assignment is" << nodeList->getDomainIP().toString();
nodeList->getDomainIP().toString().toStdString().c_str());
// start the deployed assignment // start the deployed assignment
QThread* workerThread = new QThread(this); QThread* workerThread = new QThread(this);
@ -151,7 +150,7 @@ void AssignmentClient::readPendingDatagrams() {
// Starts an event loop, and emits workerThread->started() // Starts an event loop, and emits workerThread->started()
workerThread->start(); workerThread->start();
} else { } else {
qDebug("Received a bad destination socket for assignment.\n"); qDebug("Received a bad destination socket for assignment.");
} }
} }
} else { } else {
@ -166,7 +165,7 @@ void AssignmentClient::assignmentCompleted() {
// reset the logging target to the the CHILD_TARGET_NAME // reset the logging target to the the CHILD_TARGET_NAME
Logging::setTargetName(ASSIGNMENT_CLIENT_TARGET_NAME); Logging::setTargetName(ASSIGNMENT_CLIENT_TARGET_NAME);
qDebug("Assignment finished or never started - waiting for new assignment\n"); qDebug("Assignment finished or never started - waiting for new assignment.");
_currentAssignment = NULL; _currentAssignment = NULL;

View file

@ -47,10 +47,10 @@ void AssignmentClientMonitor::spawnChildClient() {
connect(assignmentClient, SIGNAL(finished(int, QProcess::ExitStatus)), this, connect(assignmentClient, SIGNAL(finished(int, QProcess::ExitStatus)), this,
SLOT(childProcessFinished(int, QProcess::ExitStatus))); SLOT(childProcessFinished(int, QProcess::ExitStatus)));
qDebug() << "Spawned a child client with PID" << assignmentClient->pid() << "\n"; qDebug() << "Spawned a child client with PID" << assignmentClient->pid();
} }
void AssignmentClientMonitor::childProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { void AssignmentClientMonitor::childProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) {
qDebug() << "Replacing dead child assignment client with a new one.\n"; qDebug("Replacing dead child assignment client with a new one");
spawnChildClient(); spawnChildClient();
} }

View file

@ -295,7 +295,7 @@ void AudioMixer::run() {
if (usecToSleep > 0) { if (usecToSleep > 0) {
usleep(usecToSleep); usleep(usecToSleep);
} else { } else {
qDebug("Took too much time, not sleeping!\n"); qDebug() << "AudioMixer loop took" << -usecToSleep << "of extra time. Not sleeping.";
} }
} }

View file

@ -189,7 +189,7 @@ void AvatarMixer::run() {
if (usecToSleep > 0) { if (usecToSleep > 0) {
usleep(usecToSleep); usleep(usecToSleep);
} else { } else {
qDebug() << "Took too much time, not sleeping!\n"; qDebug() << "AvatarMixer loop took too" << -usecToSleep << "of extra time. Won't sleep.";
} }
} }
} }

View file

@ -121,7 +121,7 @@ void MetavoxelSession::sendDelta() {
} }
void MetavoxelSession::timedOut() { void MetavoxelSession::timedOut() {
qDebug() << "Session timed out [sessionId=" << _sessionId << ", sender=" << _sender << "]\n"; qDebug() << "Session timed out [sessionId=" << _sessionId << ", sender=" << _sender << "]";
_server->removeSession(_sessionId); _server->removeSession(_sessionId);
} }

View file

@ -229,7 +229,8 @@ void DomainServer::readAvailableDatagrams() {
// construct the requested assignment from the packet data // construct the requested assignment from the packet data
Assignment requestAssignment(packetData, receivedBytes); Assignment requestAssignment(packetData, receivedBytes);
qDebug("Received a request for assignment type %i from %s.\n", requestAssignment.getType(), qPrintable(senderSockAddr.getAddress().toString())); qDebug("Received a request for assignment type %i from %s.",
requestAssignment.getType(), qPrintable(senderSockAddr.getAddress().toString()));
Assignment* assignmentToDeploy = deployableAssignmentForRequest(requestAssignment); Assignment* assignmentToDeploy = deployableAssignmentForRequest(requestAssignment);
@ -249,7 +250,7 @@ void DomainServer::readAvailableDatagrams() {
} }
} else { } else {
qDebug("Received an invalid assignment request from %s.\n", qPrintable(senderSockAddr.getAddress().toString())); qDebug() << "Received an invalid assignment request from" << senderSockAddr.getAddress();
} }
} }
} }
@ -464,7 +465,7 @@ void DomainServer::civetwebUploadHandler(struct mg_connection *connection, const
// rename the saved script to the GUID of the assignment and move it to the script host locaiton // rename the saved script to the GUID of the assignment and move it to the script host locaiton
rename(path, newPath.toLocal8Bit().constData()); rename(path, newPath.toLocal8Bit().constData());
qDebug("Saved a script for assignment at %s\n", newPath.toLocal8Bit().constData()); qDebug("Saved a script for assignment at %s", newPath.toLocal8Bit().constData());
// add the script assigment to the assignment queue // add the script assigment to the assignment queue
// lock the assignment queue mutex since we're operating on a different thread than DS main // lock the assignment queue mutex since we're operating on a different thread than DS main
@ -474,7 +475,7 @@ void DomainServer::civetwebUploadHandler(struct mg_connection *connection, const
} }
void DomainServer::addReleasedAssignmentBackToQueue(Assignment* releasedAssignment) { void DomainServer::addReleasedAssignmentBackToQueue(Assignment* releasedAssignment) {
qDebug() << "Adding assignment" << *releasedAssignment << " back to queue.\n"; qDebug() << "Adding assignment" << *releasedAssignment << " back to queue.";
// find this assignment in the static file // find this assignment in the static file
for (int i = 0; i < MAX_STATIC_ASSIGNMENT_FILE_ASSIGNMENTS; i++) { for (int i = 0; i < MAX_STATIC_ASSIGNMENT_FILE_ASSIGNMENTS; i++) {
@ -535,8 +536,8 @@ void DomainServer::prepopulateStaticAssignmentFile() {
// Handle Domain/Voxel Server configuration command line arguments // Handle Domain/Voxel Server configuration command line arguments
if (_voxelServerConfig) { if (_voxelServerConfig) {
qDebug("Reading Voxel Server Configuration.\n"); qDebug("Reading Voxel Server Configuration.");
qDebug() << "config: " << _voxelServerConfig << "\n"; qDebug() << "config: " << _voxelServerConfig;
QString multiConfig((const char*) _voxelServerConfig); QString multiConfig((const char*) _voxelServerConfig);
QStringList multiConfigList = multiConfig.split(";"); QStringList multiConfigList = multiConfig.split(";");
@ -545,7 +546,7 @@ void DomainServer::prepopulateStaticAssignmentFile() {
for (int i = 0; i < multiConfigList.size(); i++) { for (int i = 0; i < multiConfigList.size(); i++) {
QString config = multiConfigList.at(i); QString config = multiConfigList.at(i);
qDebug("config[%d]=%s\n", i, config.toLocal8Bit().constData()); qDebug("config[%d]=%s", i, config.toLocal8Bit().constData());
// Now, parse the config to check for a pool // Now, parse the config to check for a pool
const char ASSIGNMENT_CONFIG_POOL_OPTION[] = "--pool"; const char ASSIGNMENT_CONFIG_POOL_OPTION[] = "--pool";
@ -558,7 +559,7 @@ void DomainServer::prepopulateStaticAssignmentFile() {
int spaceAfterPoolIndex = config.indexOf(' ', spaceBeforePoolIndex); int spaceAfterPoolIndex = config.indexOf(' ', spaceBeforePoolIndex);
assignmentPool = config.mid(spaceBeforePoolIndex + 1, spaceAfterPoolIndex); assignmentPool = config.mid(spaceBeforePoolIndex + 1, spaceAfterPoolIndex);
qDebug() << "The pool for this voxel-assignment is" << assignmentPool << "\n"; qDebug() << "The pool for this voxel-assignment is" << assignmentPool;
} }
Assignment voxelServerAssignment(Assignment::CreateCommand, Assignment voxelServerAssignment(Assignment::CreateCommand,
@ -577,8 +578,8 @@ void DomainServer::prepopulateStaticAssignmentFile() {
// Handle Domain/Particle Server configuration command line arguments // Handle Domain/Particle Server configuration command line arguments
if (_particleServerConfig) { if (_particleServerConfig) {
qDebug("Reading Particle Server Configuration.\n"); qDebug("Reading Particle Server Configuration.");
qDebug() << "config: " << _particleServerConfig << "\n"; qDebug() << "config: " << _particleServerConfig;
QString multiConfig((const char*) _particleServerConfig); QString multiConfig((const char*) _particleServerConfig);
QStringList multiConfigList = multiConfig.split(";"); QStringList multiConfigList = multiConfig.split(";");
@ -587,7 +588,7 @@ void DomainServer::prepopulateStaticAssignmentFile() {
for (int i = 0; i < multiConfigList.size(); i++) { for (int i = 0; i < multiConfigList.size(); i++) {
QString config = multiConfigList.at(i); QString config = multiConfigList.at(i);
qDebug("config[%d]=%s\n", i, config.toLocal8Bit().constData()); qDebug("config[%d]=%s", i, config.toLocal8Bit().constData());
// Now, parse the config to check for a pool // Now, parse the config to check for a pool
const char ASSIGNMENT_CONFIG_POOL_OPTION[] = "--pool"; const char ASSIGNMENT_CONFIG_POOL_OPTION[] = "--pool";
@ -600,7 +601,7 @@ void DomainServer::prepopulateStaticAssignmentFile() {
int spaceAfterPoolIndex = config.indexOf(' ', spaceBeforePoolIndex); int spaceAfterPoolIndex = config.indexOf(' ', spaceBeforePoolIndex);
assignmentPool = config.mid(spaceBeforePoolIndex + 1, spaceAfterPoolIndex); assignmentPool = config.mid(spaceBeforePoolIndex + 1, spaceAfterPoolIndex);
qDebug() << "The pool for this particle-assignment is" << assignmentPool << "\n"; qDebug() << "The pool for this particle-assignment is" << assignmentPool;
} }
Assignment particleServerAssignment(Assignment::CreateCommand, Assignment particleServerAssignment(Assignment::CreateCommand,
@ -624,7 +625,7 @@ void DomainServer::prepopulateStaticAssignmentFile() {
metavoxelAssignment.setPayload((const unsigned char*)_metavoxelServerConfig, strlen(_metavoxelServerConfig)); metavoxelAssignment.setPayload((const unsigned char*)_metavoxelServerConfig, strlen(_metavoxelServerConfig));
} }
qDebug() << "Adding" << numFreshStaticAssignments << "static assignments to fresh file.\n"; qDebug() << "Adding" << numFreshStaticAssignments << "static assignments to fresh file.";
_staticAssignmentFile.open(QIODevice::WriteOnly); _staticAssignmentFile.open(QIODevice::WriteOnly);
_staticAssignmentFile.write((char*) &freshStaticAssignments, sizeof(freshStaticAssignments)); _staticAssignmentFile.write((char*) &freshStaticAssignments, sizeof(freshStaticAssignments));
@ -787,7 +788,7 @@ void DomainServer::addStaticAssignmentsBackToQueueAfterRestart() {
// this assignment has not been fulfilled - reset the UUID and add it to the assignment queue // this assignment has not been fulfilled - reset the UUID and add it to the assignment queue
_staticAssignments[i].resetUUID(); _staticAssignments[i].resetUUID();
qDebug() << "Adding static assignment to queue -" << _staticAssignments[i] << "\n"; qDebug() << "Adding static assignment to queue -" << _staticAssignments[i];
_assignmentQueueMutex.lock(); _assignmentQueueMutex.lock();
_assignmentQueue.push_back(&_staticAssignments[i]); _assignmentQueue.push_back(&_staticAssignments[i]);

View file

@ -86,8 +86,9 @@ const float MIRROR_REARVIEW_DISTANCE = 0.65f;
const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f; const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f;
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) { void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
fprintf(stdout, "%s", message.toLocal8Bit().constData()); QString messageWithNewLine = message + "\n";
Application::getInstance()->getLogger()->addMessage(message.toLocal8Bit().constData()); fprintf(stdout, "%s", messageWithNewLine.toLocal8Bit().constData());
Application::getInstance()->getLogger()->addMessage(messageWithNewLine.toLocal8Bit().constData());
} }
Application::Application(int& argc, char** argv, timeval &startup_time) : Application::Application(int& argc, char** argv, timeval &startup_time) :
@ -155,7 +156,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
// call Menu getInstance static method to set up the menu // call Menu getInstance static method to set up the menu
_window->setMenuBar(Menu::getInstance()); _window->setMenuBar(Menu::getInstance());
qDebug("[VERSION] Build sequence: %i\n", BUILD_VERSION); qDebug("[VERSION] Build sequence: %i", BUILD_VERSION);
unsigned int listenPort = 0; // bind to an ephemeral port by default unsigned int listenPort = 0; // bind to an ephemeral port by default
const char** constArgv = const_cast<const char**>(argv); const char** constArgv = const_cast<const char**>(argv);
@ -310,7 +311,7 @@ void Application::storeSizeAndPosition() {
} }
void Application::initializeGL() { void Application::initializeGL() {
qDebug( "Created Display Window.\n" ); qDebug( "Created Display Window.");
// initialize glut for shape drawing; Qt apparently initializes it on OS X // initialize glut for shape drawing; Qt apparently initializes it on OS X
#ifndef __APPLE__ #ifndef __APPLE__
@ -325,15 +326,15 @@ void Application::initializeGL() {
_viewFrustumOffsetCamera.setFarClip(500.0 * TREE_SCALE); _viewFrustumOffsetCamera.setFarClip(500.0 * TREE_SCALE);
initDisplay(); initDisplay();
qDebug( "Initialized Display.\n" ); qDebug( "Initialized Display.");
init(); init();
qDebug( "Init() complete.\n" ); qDebug( "init() complete.");
// create thread for receipt of data via UDP // create thread for receipt of data via UDP
if (_enableNetworkThread) { if (_enableNetworkThread) {
pthread_create(&_networkReceiveThread, NULL, networkReceive, NULL); pthread_create(&_networkReceiveThread, NULL, networkReceive, NULL);
qDebug("Network receive thread created.\n"); qDebug("Network receive thread created.");
} }
// create thread for parsing of voxel data independent of the main network and rendering threads // create thread for parsing of voxel data independent of the main network and rendering threads
@ -342,7 +343,7 @@ void Application::initializeGL() {
_voxelHideShowThread.initialize(_enableProcessVoxelsThread); _voxelHideShowThread.initialize(_enableProcessVoxelsThread);
_particleEditSender.initialize(_enableProcessVoxelsThread); _particleEditSender.initialize(_enableProcessVoxelsThread);
if (_enableProcessVoxelsThread) { if (_enableProcessVoxelsThread) {
qDebug("Voxel parsing thread created.\n"); qDebug("Voxel parsing thread created.");
} }
// call terminate before exiting // call terminate before exiting
@ -362,9 +363,7 @@ void Application::initializeGL() {
if (_justStarted) { if (_justStarted) {
float startupTime = (usecTimestampNow() - usecTimestamp(&_applicationStartupTime)) / 1000000.0; float startupTime = (usecTimestampNow() - usecTimestamp(&_applicationStartupTime)) / 1000000.0;
_justStarted = false; _justStarted = false;
char title[50]; qDebug("Startup time: %4.2f seconds.", startupTime);
sprintf(title, "Interface: %4.2f seconds\n", startupTime);
qDebug("%s", title);
const char LOGSTASH_INTERFACE_START_TIME_KEY[] = "interface-start-time"; const char LOGSTASH_INTERFACE_START_TIME_KEY[] = "interface-start-time";
// ask the Logstash class to record the startup time // ask the Logstash class to record the startup time
@ -1707,9 +1706,9 @@ void Application::exportVoxels() {
void Application::importVoxels() { void Application::importVoxels() {
if (_voxelImporter.exec()) { if (_voxelImporter.exec()) {
qDebug("[DEBUG] Import succedded.\n"); qDebug("[DEBUG] Import succeeded.");
} else { } else {
qDebug("[DEBUG] Import failed.\n"); qDebug("[DEBUG] Import failed.");
} }
// restore the main window's active state // restore the main window's active state
@ -1890,7 +1889,7 @@ void Application::init() {
if (Menu::getInstance()->getAudioJitterBufferSamples() != 0) { if (Menu::getInstance()->getAudioJitterBufferSamples() != 0) {
_audio.setJitterBufferSamples(Menu::getInstance()->getAudioJitterBufferSamples()); _audio.setJitterBufferSamples(Menu::getInstance()->getAudioJitterBufferSamples());
} }
qDebug("Loaded settings.\n"); qDebug("Loaded settings");
if (!_profile.getUsername().isEmpty()) { if (!_profile.getUsername().isEmpty()) {
// we have a username for this avatar, ask the data-server for the mesh URL for this avatar // we have a username for this avatar, ask the data-server for the mesh URL for this avatar
@ -2784,7 +2783,7 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType, Node
} }
if (wantExtraDebugging && unknownJurisdictionServers > 0) { if (wantExtraDebugging && unknownJurisdictionServers > 0) {
qDebug("Servers: total %d, in view %d, unknown jurisdiction %d \n", qDebug("Servers: total %d, in view %d, unknown jurisdiction %d",
totalServers, inViewServers, unknownJurisdictionServers); totalServers, inViewServers, unknownJurisdictionServers);
} }
@ -2805,7 +2804,7 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType, Node
} }
if (wantExtraDebugging && unknownJurisdictionServers > 0) { if (wantExtraDebugging && unknownJurisdictionServers > 0) {
qDebug("perServerPPS: %d perUnknownServer: %d\n", perServerPPS, perUnknownServer); qDebug("perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);
} }
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
@ -2824,7 +2823,7 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType, Node
if (jurisdictions.find(nodeUUID) == jurisdictions.end()) { if (jurisdictions.find(nodeUUID) == jurisdictions.end()) {
unknownView = true; // assume it's in view unknownView = true; // assume it's in view
if (wantExtraDebugging) { if (wantExtraDebugging) {
qDebug() << "no known jurisdiction for node " << *node << ", assume it's visible.\n"; qDebug() << "no known jurisdiction for node " << *node << ", assume it's visible.";
} }
} else { } else {
const JurisdictionMap& map = (jurisdictions)[nodeUUID]; const JurisdictionMap& map = (jurisdictions)[nodeUUID];
@ -2845,7 +2844,7 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType, Node
} }
} else { } else {
if (wantExtraDebugging) { if (wantExtraDebugging) {
qDebug() << "Jurisdiction without RootCode for node " << *node << ". That's unusual!\n"; qDebug() << "Jurisdiction without RootCode for node " << *node << ". That's unusual!";
} }
} }
} }
@ -2855,7 +2854,7 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType, Node
} else if (unknownView) { } else if (unknownView) {
if (wantExtraDebugging) { if (wantExtraDebugging) {
qDebug() << "no known jurisdiction for node " << *node << ", give it budget of " qDebug() << "no known jurisdiction for node " << *node << ", give it budget of "
<< perUnknownServer << " to send us jurisdiction.\n"; << perUnknownServer << " to send us jurisdiction.";
} }
// set the query's position/orientation to be degenerate in a manner that will get the scene quickly // set the query's position/orientation to be degenerate in a manner that will get the scene quickly
@ -2868,11 +2867,11 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType, Node
_voxelQuery.setCameraNearClip(0.1); _voxelQuery.setCameraNearClip(0.1);
_voxelQuery.setCameraFarClip(0.1); _voxelQuery.setCameraFarClip(0.1);
if (wantExtraDebugging) { if (wantExtraDebugging) {
qDebug() << "Using 'minimal' camera position for node " << *node << "\n"; qDebug() << "Using 'minimal' camera position for node" << *node;
} }
} else { } else {
if (wantExtraDebugging) { if (wantExtraDebugging) {
qDebug() << "Using regular camera position for node " << *node << "\n"; qDebug() << "Using regular camera position for node" << *node;
} }
} }
_voxelQuery.setMaxOctreePacketsPerSecond(perUnknownServer); _voxelQuery.setMaxOctreePacketsPerSecond(perUnknownServer);
@ -3729,9 +3728,6 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) {
// render the coverage map on screen // render the coverage map on screen
void Application::renderCoverageMapV2() { void Application::renderCoverageMapV2() {
//qDebug("renderCoverageMap()\n");
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glLineWidth(2.0); glLineWidth(2.0);
glBegin(GL_LINES); glBegin(GL_LINES);
@ -3775,8 +3771,6 @@ void Application::renderCoverageMapsV2Recursively(CoverageMapV2* map) {
// render the coverage map on screen // render the coverage map on screen
void Application::renderCoverageMap() { void Application::renderCoverageMap() {
//qDebug("renderCoverageMap()\n");
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glLineWidth(2.0); glLineWidth(2.0);
glBegin(GL_LINES); glBegin(GL_LINES);
@ -4180,7 +4174,7 @@ void Application::updateWindowTitle(){
title += _profile.getLastDomain(); title += _profile.getLastDomain();
title += buildVersion; title += buildVersion;
qDebug("Application title set to: %s.\n", title.toStdString().c_str()); qDebug("Application title set to: %s", title.toStdString().c_str());
_window->setWindowTitle(title); _window->setWindowTitle(title);
} }
@ -4199,7 +4193,7 @@ void Application::domainChanged(QString domain) {
_particleServerJurisdictions.clear(); _particleServerJurisdictions.clear();
// reset our persist thread // reset our persist thread
qDebug() << "domainChanged()... domain=" << domain << " swapping persist cache\n"; qDebug() << "Domain changed to" << domain << ". Swapping persist cache.";
updateLocalOctreeCache(); updateLocalOctreeCache();
} }
@ -4476,14 +4470,12 @@ void Application::loadScript() {
QByteArray fileNameAscii = fileNameString.toLocal8Bit(); QByteArray fileNameAscii = fileNameString.toLocal8Bit();
const char* fileName = fileNameAscii.data(); const char* fileName = fileNameAscii.data();
printf("fileName:%s\n",fileName);
std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate); std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate);
if(!file.is_open()) { if(!file.is_open()) {
printf("error loading file\n"); qDebug("Error loading file %s", fileName);
return; return;
} }
qDebug("loading file %s...\n", fileName); qDebug("Loading file %s...", fileName);
// get file length.... // get file length....
unsigned long fileLength = file.tellg(); unsigned long fileLength = file.tellg();
@ -4575,7 +4567,7 @@ void Application::updateLocalOctreeCache(bool firstTime) {
_persistThread = new OctreePersistThread(_voxels.getTree(), _persistThread = new OctreePersistThread(_voxels.getTree(),
localVoxelCacheFileName.toLocal8Bit().constData(),LOCAL_CACHE_PERSIST_INTERVAL); localVoxelCacheFileName.toLocal8Bit().constData(),LOCAL_CACHE_PERSIST_INTERVAL);
qDebug() << "updateLocalOctreeCache()... localVoxelCacheFileName=" << localVoxelCacheFileName << "\n"; qDebug() << "updateLocalOctreeCache()... localVoxelCacheFileName=" << localVoxelCacheFileName;
if (_persistThread) { if (_persistThread) {
_voxels.beginLoadingLocalVoxelCache(); // while local voxels are importing, don't do individual node VBO updates _voxels.beginLoadingLocalVoxelCache(); // while local voxels are importing, don't do individual node VBO updates

View file

@ -136,8 +136,8 @@ bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice,
const QAudioFormat& desiredAudioFormat, const QAudioFormat& desiredAudioFormat,
QAudioFormat& adjustedAudioFormat) { QAudioFormat& adjustedAudioFormat) {
if (!audioDevice.isFormatSupported(desiredAudioFormat)) { if (!audioDevice.isFormatSupported(desiredAudioFormat)) {
qDebug() << "The desired format for audio I/O is" << desiredAudioFormat << "\n"; qDebug() << "The desired format for audio I/O is" << desiredAudioFormat;
qDebug() << "The desired audio format is not supported by this device.\n"; qDebug("The desired audio format is not supported by this device");
if (desiredAudioFormat.channelCount() == 1) { if (desiredAudioFormat.channelCount() == 1) {
adjustedAudioFormat = desiredAudioFormat; adjustedAudioFormat = desiredAudioFormat;
@ -244,10 +244,10 @@ void Audio::start() {
QAudioDeviceInfo inputDeviceInfo = defaultAudioDeviceForMode(QAudio::AudioInput); QAudioDeviceInfo inputDeviceInfo = defaultAudioDeviceForMode(QAudio::AudioInput);
qDebug() << "The audio input device is" << inputDeviceInfo.deviceName() << "\n"; qDebug() << "The audio input device is" << inputDeviceInfo.deviceName();
if (adjustedFormatForAudioDevice(inputDeviceInfo, _desiredInputFormat, _inputFormat)) { if (adjustedFormatForAudioDevice(inputDeviceInfo, _desiredInputFormat, _inputFormat)) {
qDebug() << "The format to be used for audio input is" << _inputFormat << "\n"; qDebug() << "The format to be used for audio input is" << _inputFormat;
_audioInput = new QAudioInput(inputDeviceInfo, _inputFormat, this); _audioInput = new QAudioInput(inputDeviceInfo, _inputFormat, this);
_numInputCallbackBytes = NETWORK_BUFFER_LENGTH_BYTES_PER_CHANNEL * _inputFormat.channelCount() _numInputCallbackBytes = NETWORK_BUFFER_LENGTH_BYTES_PER_CHANNEL * _inputFormat.channelCount()
@ -257,10 +257,10 @@ void Audio::start() {
QAudioDeviceInfo outputDeviceInfo = defaultAudioDeviceForMode(QAudio::AudioOutput); QAudioDeviceInfo outputDeviceInfo = defaultAudioDeviceForMode(QAudio::AudioOutput);
qDebug() << "The audio output device is" << outputDeviceInfo.deviceName() << "\n"; qDebug() << "The audio output device is" << outputDeviceInfo.deviceName();
if (adjustedFormatForAudioDevice(outputDeviceInfo, _desiredOutputFormat, _outputFormat)) { if (adjustedFormatForAudioDevice(outputDeviceInfo, _desiredOutputFormat, _outputFormat)) {
qDebug() << "The format to be used for audio output is" << _outputFormat << "\n"; qDebug() << "The format to be used for audio output is" << _outputFormat;
_inputRingBuffer.resizeForFrameSize(_numInputCallbackBytes * CALLBACK_ACCELERATOR_RATIO / sizeof(int16_t)); _inputRingBuffer.resizeForFrameSize(_numInputCallbackBytes * CALLBACK_ACCELERATOR_RATIO / sizeof(int16_t));
_inputDevice = _audioInput->start(); _inputDevice = _audioInput->start();
@ -279,7 +279,7 @@ void Audio::start() {
return; return;
} }
qDebug() << "Unable to set up audio I/O because of a problem with input or output formats.\n"; qDebug() << "Unable to set up audio I/O because of a problem with input or output formats.";
} }
void Audio::handleAudioInput() { void Audio::handleAudioInput() {
@ -448,7 +448,7 @@ void Audio::addReceivedAudioToBuffer(const QByteArray& audioByteArray) {
if (!_ringBuffer.isNotStarvedOrHasMinimumSamples(NETWORK_BUFFER_LENGTH_SAMPLES_STEREO if (!_ringBuffer.isNotStarvedOrHasMinimumSamples(NETWORK_BUFFER_LENGTH_SAMPLES_STEREO
+ (_jitterBufferSamples * 2))) { + (_jitterBufferSamples * 2))) {
// starved and we don't have enough to start, keep waiting // starved and we don't have enough to start, keep waiting
qDebug() << "Buffer is starved and doesn't have enough samples to start. Held back.\n"; qDebug() << "Buffer is starved and doesn't have enough samples to start. Held back.";
} else { } else {
// We are either already playing back, or we have enough audio to start playing back. // We are either already playing back, or we have enough audio to start playing back.
_ringBuffer.setIsStarved(false); _ringBuffer.setIsStarved(false);
@ -518,7 +518,7 @@ void Audio::addReceivedAudioToBuffer(const QByteArray& audioByteArray) {
} else if (_audioOutput->bytesFree() == _audioOutput->bufferSize()) { } else if (_audioOutput->bytesFree() == _audioOutput->bufferSize()) {
// we don't have any audio data left in the output buffer, and the ring buffer from // we don't have any audio data left in the output buffer, and the ring buffer from
// the network has nothing in it either - we just starved // the network has nothing in it either - we just starved
qDebug() << "Audio output just starved.\n"; qDebug() << "Audio output just starved.";
_ringBuffer.setIsStarved(true); _ringBuffer.setIsStarved(true);
_numFramesDisplayStarve = 10; _numFramesDisplayStarve = 10;
} }

View file

@ -30,7 +30,7 @@ BuckyBalls::BuckyBalls() {
colors[1] = glm::vec3(0.64f, 0.16f, 0.16f); colors[1] = glm::vec3(0.64f, 0.16f, 0.16f);
colors[2] = glm::vec3(0.31f, 0.58f, 0.80f); colors[2] = glm::vec3(0.31f, 0.58f, 0.80f);
qDebug("Creating buckyballs...\n"); qDebug("Creating buckyballs...");
for (int i = 0; i < NUM_BBALLS; i++) { for (int i = 0; i < NUM_BBALLS; i++) {
_bballPosition[i] = CORNER_BBALLS + randVector() * RANGE_BBALLS; _bballPosition[i] = CORNER_BBALLS + randVector() * RANGE_BBALLS;
int element = (rand() % NUM_ELEMENTS); int element = (rand() % NUM_ELEMENTS);

View file

@ -140,7 +140,7 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int
if (keyList[i] == DataServerKey::FaceMeshURL) { if (keyList[i] == DataServerKey::FaceMeshURL) {
if (userUUID.isNull() || userUUID == Application::getInstance()->getProfile()->getUUID()) { if (userUUID.isNull() || userUUID == Application::getInstance()->getProfile()->getUUID()) {
qDebug("Changing user's face model URL to %s\n", valueList[i].toLocal8Bit().constData()); qDebug("Changing user's face model URL to %s", valueList[i].toLocal8Bit().constData());
Application::getInstance()->getProfile()->setFaceModelURL(QUrl(valueList[i])); Application::getInstance()->getProfile()->setFaceModelURL(QUrl(valueList[i]));
} else { } else {
// mesh URL for a UUID, find avatar in our list // mesh URL for a UUID, find avatar in our list
@ -159,7 +159,7 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int
} else if (keyList[i] == DataServerKey::SkeletonURL) { } else if (keyList[i] == DataServerKey::SkeletonURL) {
if (userUUID.isNull() || userUUID == Application::getInstance()->getProfile()->getUUID()) { if (userUUID.isNull() || userUUID == Application::getInstance()->getProfile()->getUUID()) {
qDebug("Changing user's skeleton URL to %s\n", valueList[i].toLocal8Bit().constData()); qDebug("Changing user's skeleton URL to %s", valueList[i].toLocal8Bit().constData());
Application::getInstance()->getProfile()->setSkeletonModelURL(QUrl(valueList[i])); Application::getInstance()->getProfile()->setSkeletonModelURL(QUrl(valueList[i]));
} else { } else {
// skeleton URL for a UUID, find avatar in our list // skeleton URL for a UUID, find avatar in our list
@ -190,7 +190,7 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int
qDebug() << "Changing domain to" << valueList[i].toLocal8Bit().constData() << qDebug() << "Changing domain to" << valueList[i].toLocal8Bit().constData() <<
", position to" << valueList[i + 1].toLocal8Bit().constData() << ", position to" << valueList[i + 1].toLocal8Bit().constData() <<
", and orientation to" << valueList[i + 2].toLocal8Bit().constData() << ", and orientation to" << valueList[i + 2].toLocal8Bit().constData() <<
"to go to" << userString << "\n"; "to go to" << userString;
NodeList::getInstance()->setDomainHostname(valueList[i]); NodeList::getInstance()->setDomainHostname(valueList[i]);

View file

@ -40,7 +40,7 @@ Environment::~Environment() {
void Environment::init() { void Environment::init() {
if (_initialized) { if (_initialized) {
qDebug("[ERROR] Environment is already initialized.\n"); qDebug("[ERROR] Environment is already initialized.");
return; return;
} }

View file

@ -42,7 +42,7 @@ Menu* Menu::getInstance() {
menuInstanceMutex.lock(); menuInstanceMutex.lock();
if (!_instance) { if (!_instance) {
qDebug("First call to Menu::getInstance() - initing menu.\n"); qDebug("First call to Menu::getInstance() - initing menu.");
_instance = new Menu(); _instance = new Menu();
} }
@ -978,7 +978,7 @@ void Menu::goToLocation() {
// send a node kill request, indicating to other clients that they should play the "disappeared" effect // send a node kill request, indicating to other clients that they should play the "disappeared" effect
NodeList::getInstance()->sendKillNode(&NODE_TYPE_AVATAR_MIXER, 1); NodeList::getInstance()->sendKillNode(&NODE_TYPE_AVATAR_MIXER, 1);
qDebug("Going To Location: %f, %f, %f...\n", x, y, z); qDebug("Going To Location: %f, %f, %f...", x, y, z);
myAvatar->setPosition(newAvatarPos); myAvatar->setPosition(newAvatarPos);
} }
} }
@ -1027,7 +1027,7 @@ void Menu::pasteToVoxel() {
if (locationToPaste == octalCodeToHexString(octalCodeDestination)) { if (locationToPaste == octalCodeToHexString(octalCodeDestination)) {
Application::getInstance()->pasteVoxelsToOctalCode(octalCodeDestination); Application::getInstance()->pasteVoxelsToOctalCode(octalCodeDestination);
} else { } else {
qDebug() << "problem with octcode...\n"; qDebug() << "Problem with octcode...";
} }
} }

View file

@ -10,8 +10,6 @@
#include <cstring> #include <cstring>
#include <algorithm> #include <algorithm>
#include <QtCore/QDebug>
#include "InterfaceConfig.h" #include "InterfaceConfig.h"
#include "Oscilloscope.h" #include "Oscilloscope.h"

View file

@ -47,7 +47,7 @@ void PairingHandler::sendPairRequest() {
(localAddress >> 24) & 0xFF, (localAddress >> 24) & 0xFF,
NodeList::getInstance()->getNodeSocket().localPort()); NodeList::getInstance()->getNodeSocket().localPort());
qDebug("Sending pair packet: %s\n", pairPacket); qDebug("Sending pair packet: %s", pairPacket);
HifiSockAddr pairingServerSocket(PAIRING_SERVER_HOSTNAME, PAIRING_SERVER_PORT); HifiSockAddr pairingServerSocket(PAIRING_SERVER_HOSTNAME, PAIRING_SERVER_PORT);

View file

@ -610,7 +610,7 @@ void runTimingTests() {
gettimeofday(&endTime, NULL); gettimeofday(&endTime, NULL);
} }
elapsedMsecs = diffclock(&startTime, &endTime); elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("gettimeofday() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests); qDebug("gettimeofday() usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
// Random number generation // Random number generation
gettimeofday(&startTime, NULL); gettimeofday(&startTime, NULL);
@ -619,7 +619,7 @@ void runTimingTests() {
} }
gettimeofday(&endTime, NULL); gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime); elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("rand() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests); qDebug("rand() stored in array usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
// Random number generation using randFloat() // Random number generation using randFloat()
gettimeofday(&startTime, NULL); gettimeofday(&startTime, NULL);
@ -628,7 +628,7 @@ void runTimingTests() {
} }
gettimeofday(&endTime, NULL); gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime); elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("randFloat() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests); qDebug("randFloat() stored in array usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
// PowF function // PowF function
fTest = 1145323.2342f; fTest = 1145323.2342f;
@ -638,7 +638,7 @@ void runTimingTests() {
} }
gettimeofday(&endTime, NULL); gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime); elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("powf(f, 0.5) usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests); qDebug("powf(f, 0.5) usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
// Vector Math // Vector Math
float distance; float distance;
@ -651,7 +651,7 @@ 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]\n", qDebug("vector math usecs: %f [%f msecs total for %d tests]",
1000.0f * elapsedMsecs / (float) numTests, elapsedMsecs, numTests); 1000.0f * elapsedMsecs / (float) numTests, elapsedMsecs, numTests);
// Vec3 test // Vec3 test
@ -665,7 +665,7 @@ void runTimingTests() {
} }
gettimeofday(&endTime, NULL); gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime); elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("vec3 assign and dot() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests); qDebug("vec3 assign and dot() usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
} }
float loadSetting(QSettings* settings, const char* name, float defaultValue) { float loadSetting(QSettings* settings, const char* name, float defaultValue) {

View file

@ -33,7 +33,7 @@ bool VoxelHideShowThread::process() {
bool showExtraDebugging = Application::getInstance()->getLogger()->extraDebugging(); bool showExtraDebugging = Application::getInstance()->getLogger()->extraDebugging();
if (showExtraDebugging && elapsed > USECS_PER_FRAME) { if (showExtraDebugging && elapsed > USECS_PER_FRAME) {
qDebug() << "VoxelHideShowThread::process()... checkForCulling took " << elapsed << "\n"; qDebug() << "VoxelHideShowThread::process()... checkForCulling took" << elapsed;
} }
if (isStillRunning()) { if (isStillRunning()) {

View file

@ -181,7 +181,7 @@ void ImportTask::run() {
} else if (_filename.endsWith(".schematic", Qt::CaseInsensitive)) { } else if (_filename.endsWith(".schematic", Qt::CaseInsensitive)) {
voxelSystem->readFromSchematicFile(_filename.toLocal8Bit().data()); voxelSystem->readFromSchematicFile(_filename.toLocal8Bit().data());
} else { } else {
qDebug("[ERROR] Invalid file extension.\n"); qDebug("[ERROR] Invalid file extension.");
} }
voxelSystem->getTree()->reaverageOctreeElements(); voxelSystem->getTree()->reaverageOctreeElements();

View file

@ -21,7 +21,7 @@ void VoxelPacketProcessor::processPacket(const HifiSockAddr& senderSockAddr, uns
const int WAY_BEHIND = 300; const int WAY_BEHIND = 300;
if (packetsToProcessCount() > WAY_BEHIND && Application::getInstance()->getLogger()->extraDebugging()) { if (packetsToProcessCount() > WAY_BEHIND && Application::getInstance()->getLogger()->extraDebugging()) {
qDebug("VoxelPacketProcessor::processPacket() packets to process=%d\n", packetsToProcessCount()); qDebug("VoxelPacketProcessor::processPacket() packets to process=%d", packetsToProcessCount());
} }
ssize_t messageLength = packetLength; ssize_t messageLength = packetLength;

View file

@ -204,7 +204,7 @@ glBufferIndex VoxelSystem::getNextBufferIndex() {
// will be "invisible" // will be "invisible"
void VoxelSystem::freeBufferIndex(glBufferIndex index) { void VoxelSystem::freeBufferIndex(glBufferIndex index) {
if (_voxelsInWriteArrays == 0) { if (_voxelsInWriteArrays == 0) {
qDebug() << "freeBufferIndex() called when _voxelsInWriteArrays == 0!!!!\n"; qDebug() << "freeBufferIndex() called when _voxelsInWriteArrays == 0!";
} }
// if the "freed" index was our max index, then just drop the _voxelsInWriteArrays down one... // if the "freed" index was our max index, then just drop the _voxelsInWriteArrays down one...
@ -214,7 +214,7 @@ void VoxelSystem::freeBufferIndex(glBufferIndex index) {
if (Menu::getInstance()->isOptionChecked(MenuOption::AutomaticallyAuditTree)) { if (Menu::getInstance()->isOptionChecked(MenuOption::AutomaticallyAuditTree)) {
for (long i = 0; i < _freeIndexes.size(); i++) { for (long i = 0; i < _freeIndexes.size(); i++) {
if (_freeIndexes[i] == index) { if (_freeIndexes[i] == index) {
printf("freeBufferIndex(glBufferIndex index)... index=%ld already in free list!\n", index); printf("freeBufferIndex(glBufferIndex index)... index=%ld already in free list!", index);
inList = true; inList = true;
break; break;
} }
@ -615,7 +615,7 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) {
if (Application::getInstance()->getLogger()->extraDebugging()) { if (Application::getInstance()->getLogger()->extraDebugging()) {
qDebug("VoxelSystem::parseData() ... Got Packet Section" qDebug("VoxelSystem::parseData() ... Got Packet Section"
" color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%d" " color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%d"
" subsection:%d sectionLength:%d uncompressed:%d\n", " subsection:%d sectionLength:%d uncompressed:%d",
debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed), debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed),
sequence, flightTime, numBytes, dataBytes, subsection, sectionLength, packetData.getUncompressedSize()); sequence, flightTime, numBytes, dataBytes, subsection, sectionLength, packetData.getUncompressedSize());
} }
@ -704,7 +704,7 @@ void VoxelSystem::setupNewVoxelsForDrawing() {
bool extraDebugging = Application::getInstance()->getLogger()->extraDebugging(); bool extraDebugging = Application::getInstance()->getLogger()->extraDebugging();
if (extraDebugging) { if (extraDebugging) {
qDebug("setupNewVoxelsForDrawing()... _voxelsUpdated=%lu...\n",_voxelsUpdated); qDebug("setupNewVoxelsForDrawing()... _voxelsUpdated=%lu...",_voxelsUpdated);
_viewFrustum->printDebugDetails(); _viewFrustum->printDebugDetails();
} }
} }
@ -801,7 +801,7 @@ void VoxelSystem::cleanupRemovedVoxels() {
// This handles cleanup of voxels that were culled as part of our regular out of view culling operation // This handles cleanup of voxels that were culled as part of our regular out of view culling operation
if (!_removedVoxels.isEmpty()) { if (!_removedVoxels.isEmpty()) {
if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) { if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) {
qDebug() << "cleanupRemovedVoxels().. _removedVoxels=" << _removedVoxels.count() << "\n"; qDebug() << "cleanupRemovedVoxels().. _removedVoxels=" << _removedVoxels.count();
} }
while (!_removedVoxels.isEmpty()) { while (!_removedVoxels.isEmpty()) {
delete _removedVoxels.extract(); delete _removedVoxels.extract();
@ -815,7 +815,7 @@ void VoxelSystem::cleanupRemovedVoxels() {
if (!_writeRenderFullVBO && (_abandonedVBOSlots > (_voxelsInWriteArrays * TOO_MANY_ABANDONED_RATIO))) { if (!_writeRenderFullVBO && (_abandonedVBOSlots > (_voxelsInWriteArrays * TOO_MANY_ABANDONED_RATIO))) {
if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) { if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) {
qDebug() << "cleanupRemovedVoxels().. _abandonedVBOSlots [" qDebug() << "cleanupRemovedVoxels().. _abandonedVBOSlots ["
<< _abandonedVBOSlots << "] > TOO_MANY_ABANDONED_RATIO \n"; << _abandonedVBOSlots << "] > TOO_MANY_ABANDONED_RATIO";
} }
_writeRenderFullVBO = true; _writeRenderFullVBO = true;
} }
@ -982,7 +982,7 @@ int VoxelSystem::updateNodeInArrays(VoxelTreeElement* node, bool reuseIndex, boo
// possibly shifting down to lower LOD or something. This debug message is to help identify, if/when/how this // possibly shifting down to lower LOD or something. This debug message is to help identify, if/when/how this
// state actually occurs. // state actually occurs.
if (Application::getInstance()->getLogger()->extraDebugging()) { if (Application::getInstance()->getLogger()->extraDebugging()) {
qDebug("OHHHH NOOOOOO!!!! updateNodeInArrays() BAILING (_voxelsInWriteArrays >= _maxVoxels)\n"); qDebug("OH NO! updateNodeInArrays() BAILING (_voxelsInWriteArrays >= _maxVoxels)");
} }
return 0; return 0;
} }
@ -1062,7 +1062,7 @@ ProgramObject VoxelSystem::_shadowMapProgram;
void VoxelSystem::init() { void VoxelSystem::init() {
if (_initialized) { if (_initialized) {
qDebug("[ERROR] VoxelSystem is already initialized.\n"); qDebug("[ERROR] VoxelSystem is already initialized.");
return; return;
} }
@ -1436,7 +1436,7 @@ void VoxelSystem::clearAllNodesBufferIndex() {
_tree->recurseTreeWithOperation(clearAllNodesBufferIndexOperation); _tree->recurseTreeWithOperation(clearAllNodesBufferIndexOperation);
unlockTree(); unlockTree();
if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) { if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) {
qDebug("clearing buffer index of %d nodes\n", _nodeCount); qDebug("clearing buffer index of %d nodes", _nodeCount);
} }
} }
@ -1449,7 +1449,7 @@ bool VoxelSystem::forceRedrawEntireTreeOperation(OctreeElement* element, void* e
void VoxelSystem::forceRedrawEntireTree() { void VoxelSystem::forceRedrawEntireTree() {
_nodeCount = 0; _nodeCount = 0;
_tree->recurseTreeWithOperation(forceRedrawEntireTreeOperation); _tree->recurseTreeWithOperation(forceRedrawEntireTreeOperation);
qDebug("forcing redraw of %d nodes\n", _nodeCount); qDebug("forcing redraw of %d nodes", _nodeCount);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
} }
@ -1467,7 +1467,7 @@ bool VoxelSystem::randomColorOperation(OctreeElement* element, void* extraData)
void VoxelSystem::randomizeVoxelColors() { void VoxelSystem::randomizeVoxelColors() {
_nodeCount = 0; _nodeCount = 0;
_tree->recurseTreeWithOperation(randomColorOperation); _tree->recurseTreeWithOperation(randomColorOperation);
qDebug("setting randomized true color for %d nodes\n", _nodeCount); qDebug("setting randomized true color for %d nodes", _nodeCount);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
} }
@ -1483,7 +1483,7 @@ bool VoxelSystem::falseColorizeRandomOperation(OctreeElement* element, void* ext
void VoxelSystem::falseColorizeRandom() { void VoxelSystem::falseColorizeRandom() {
_nodeCount = 0; _nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeRandomOperation); _tree->recurseTreeWithOperation(falseColorizeRandomOperation);
qDebug("setting randomized false color for %d nodes\n", _nodeCount); qDebug("setting randomized false color for %d nodes", _nodeCount);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
} }
@ -1499,7 +1499,7 @@ void VoxelSystem::trueColorize() {
PerformanceWarning warn(true, "trueColorize()",true); PerformanceWarning warn(true, "trueColorize()",true);
_nodeCount = 0; _nodeCount = 0;
_tree->recurseTreeWithOperation(trueColorizeOperation); _tree->recurseTreeWithOperation(trueColorizeOperation);
qDebug("setting true color for %d nodes\n", _nodeCount); qDebug("setting true color for %d nodes", _nodeCount);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
} }
@ -1521,7 +1521,7 @@ bool VoxelSystem::falseColorizeInViewOperation(OctreeElement* element, void* ext
void VoxelSystem::falseColorizeInView() { void VoxelSystem::falseColorizeInView() {
_nodeCount = 0; _nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)_viewFrustum); _tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)_viewFrustum);
qDebug("setting in view false color for %d nodes\n", _nodeCount); qDebug("setting in view false color for %d nodes", _nodeCount);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
} }
@ -1626,7 +1626,7 @@ void VoxelSystem::falseColorizeBySource() {
} }
_tree->recurseTreeWithOperation(falseColorizeBySourceOperation, &args); _tree->recurseTreeWithOperation(falseColorizeBySourceOperation, &args);
qDebug("setting false color by source for %d nodes\n", _nodeCount); qDebug("setting false color by source for %d nodes", _nodeCount);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
} }
@ -1679,10 +1679,10 @@ void VoxelSystem::falseColorizeDistanceFromView() {
_maxDistance = 0.0; _maxDistance = 0.0;
_minDistance = FLT_MAX; _minDistance = FLT_MAX;
_tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation, (void*) _viewFrustum); _tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation, (void*) _viewFrustum);
qDebug("determining distance range for %d nodes\n", _nodeCount); qDebug("determining distance range for %d nodes", _nodeCount);
_nodeCount = 0; _nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation, (void*) _viewFrustum); _tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation, (void*) _viewFrustum);
qDebug("setting in distance false color for %d nodes\n", _nodeCount); qDebug("setting in distance false color for %d nodes", _nodeCount);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
} }
@ -1813,7 +1813,7 @@ void VoxelSystem::removeOutOfView() {
} }
bool showRemoveDebugDetails = false; bool showRemoveDebugDetails = false;
if (showRemoveDebugDetails) { if (showRemoveDebugDetails) {
qDebug("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d \n", qDebug("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d",
args.nodesScanned, args.nodesRemoved, args.nodesInside, args.nodesScanned, args.nodesRemoved, args.nodesInside,
args.nodesIntersect, args.nodesOutside, _removedVoxels.count() args.nodesIntersect, args.nodesOutside, _removedVoxels.count()
); );
@ -1842,7 +1842,7 @@ void VoxelSystem::showAllLocalVoxels() {
bool showRemoveDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); bool showRemoveDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
if (showRemoveDebugDetails) { if (showRemoveDebugDetails) {
qDebug("showAllLocalVoxels() scanned=%ld \n",args.nodesScanned ); qDebug("showAllLocalVoxels() scanned=%ld",args.nodesScanned );
} }
} }
@ -1979,15 +1979,15 @@ void VoxelSystem::hideOutOfView(bool forceFullFrustum) {
bool extraDebugDetails = false; // Application::getInstance()->getLogger()->extraDebugging(); bool extraDebugDetails = false; // Application::getInstance()->getLogger()->extraDebugging();
if (extraDebugDetails) { if (extraDebugDetails) {
qDebug("hideOutOfView() scanned=%ld removed=%ld show=%ld inside=%ld intersect=%ld outside=%ld\n", qDebug("hideOutOfView() scanned=%ld removed=%ld show=%ld inside=%ld intersect=%ld outside=%ld",
args.nodesScanned, args.nodesRemoved, args.nodesShown, args.nodesInside, args.nodesScanned, args.nodesRemoved, args.nodesShown, args.nodesInside,
args.nodesIntersect, args.nodesOutside args.nodesIntersect, args.nodesOutside
); );
qDebug(" inside/inside=%ld intersect/inside=%ld outside/outside=%ld\n", qDebug("inside/inside=%ld intersect/inside=%ld outside/outside=%ld",
args.nodesInsideInside, args.nodesIntersectInside, args.nodesOutsideOutside args.nodesInsideInside, args.nodesIntersectInside, args.nodesOutsideOutside
); );
qDebug() << "args.thisViewFrustum....\n"; qDebug() << "args.thisViewFrustum....";
args.thisViewFrustum.printDebugDetails(); args.thisViewFrustum.printDebugDetails();
} }
_inhideOutOfView = false; _inhideOutOfView = false;
@ -2224,7 +2224,7 @@ bool VoxelSystem::falseColorizeRandomEveryOtherOperation(OctreeElement* element,
void VoxelSystem::falseColorizeRandomEveryOther() { void VoxelSystem::falseColorizeRandomEveryOther() {
falseColorizeRandomEveryOtherArgs args; falseColorizeRandomEveryOtherArgs args;
_tree->recurseTreeWithOperation(falseColorizeRandomEveryOtherOperation,&args); _tree->recurseTreeWithOperation(falseColorizeRandomEveryOtherOperation,&args);
qDebug("randomized false color for every other node: total %ld, colorable %ld, colored %ld\n", qDebug("randomized false color for every other node: total %ld, colorable %ld, colored %ld",
args.totalNodes, args.colorableNodes, args.coloredNodes); args.totalNodes, args.colorableNodes, args.coloredNodes);
_tree->setDirtyBit(); _tree->setDirtyBit();
setupNewVoxelsForDrawing(); setupNewVoxelsForDrawing();
@ -2294,14 +2294,14 @@ bool VoxelSystem::collectStatsForTreesAndVBOsOperation(OctreeElement* element, v
const bool extraDebugging = false; // enable for extra debugging const bool extraDebugging = false; // enable for extra debugging
if (extraDebugging) { if (extraDebugging) {
qDebug("node In VBO... [%f,%f,%f] %f ... index=%ld, isDirty=%s, shouldRender=%s \n", qDebug("node In VBO... [%f,%f,%f] %f ... index=%ld, isDirty=%s, shouldRender=%s",
voxel->getCorner().x, voxel->getCorner().y, voxel->getCorner().z, voxel->getScale(), voxel->getCorner().x, voxel->getCorner().y, voxel->getCorner().z, voxel->getScale(),
nodeIndex, debug::valueOf(voxel->isDirty()), debug::valueOf(voxel->getShouldRender())); nodeIndex, debug::valueOf(voxel->isDirty()), debug::valueOf(voxel->getShouldRender()));
} }
if (args->hasIndexFound[nodeIndex]) { if (args->hasIndexFound[nodeIndex]) {
args->duplicateVBOIndex++; args->duplicateVBOIndex++;
qDebug("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s \n", nodeIndex, qDebug("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s", nodeIndex,
debug::valueOf(voxel->isDirty()), debug::valueOf(voxel->getShouldRender())); debug::valueOf(voxel->isDirty()), debug::valueOf(voxel->getShouldRender()));
} else { } else {
args->hasIndexFound[nodeIndex] = true; args->hasIndexFound[nodeIndex] = true;
@ -2335,17 +2335,17 @@ void VoxelSystem::collectStatsForTreesAndVBOs() {
collectStatsForTreesAndVBOsArgs args(_maxVoxels); collectStatsForTreesAndVBOsArgs args(_maxVoxels);
args.expectedMax = _voxelsInWriteArrays; args.expectedMax = _voxelsInWriteArrays;
qDebug("CALCULATING Local Voxel Tree Statistics >>>>>>>>>>>>\n"); qDebug("CALCULATING Local Voxel Tree Statistics >>>>>>>>>>>>");
_tree->recurseTreeWithOperation(collectStatsForTreesAndVBOsOperation,&args); _tree->recurseTreeWithOperation(collectStatsForTreesAndVBOsOperation,&args);
qDebug("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld \n", qDebug("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld",
args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes); args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes);
qDebug(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld \n", debug::valueOf(_voxelsDirty), qDebug(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld", debug::valueOf(_voxelsDirty),
_voxelsInWriteArrays, minDirty, maxDirty); _voxelsInWriteArrays, minDirty, maxDirty);
qDebug(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld \n", qDebug(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld",
args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex, args.nodesInVBONotShouldRender); args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex, args.nodesInVBONotShouldRender);
glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN; glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN;
@ -2358,13 +2358,13 @@ void VoxelSystem::collectStatsForTreesAndVBOs() {
} }
} }
qDebug(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld \n", qDebug(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld",
minInVBO, maxInVBO, _voxelsInWriteArrays, _voxelsInReadArrays); minInVBO, maxInVBO, _voxelsInWriteArrays, _voxelsInReadArrays);
qDebug(" _freeIndexes.size()=%ld \n", qDebug(" _freeIndexes.size()=%ld",
_freeIndexes.size()); _freeIndexes.size());
qDebug("DONE WITH Local Voxel Tree Statistics >>>>>>>>>>>>\n"); qDebug("DONE WITH Local Voxel Tree Statistics >>>>>>>>>>>>");
} }
@ -2550,7 +2550,7 @@ void VoxelSystem::falseColorizeOccluded() {
_tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedOperation, position, (void*)&args); _tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedOperation, position, (void*)&args);
qDebug("falseColorizeOccluded()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n", qDebug("falseColorizeOccluded()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld",
position.x, position.y, position.x, position.y,
args.totalVoxels, args.coloredVoxels, args.occludedVoxels, args.totalVoxels, args.coloredVoxels, args.occludedVoxels,
args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped, args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped,
@ -2685,7 +2685,7 @@ void VoxelSystem::falseColorizeOccludedV2() {
void VoxelSystem::nodeAdded(Node* node) { void VoxelSystem::nodeAdded(Node* node) {
if (node->getType() == NODE_TYPE_VOXEL_SERVER) { if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
qDebug("VoxelSystem... voxel server %s added...\n", node->getUUID().toString().toLocal8Bit().constData()); qDebug("VoxelSystem... voxel server %s added...", node->getUUID().toString().toLocal8Bit().constData());
_voxelServerCount++; _voxelServerCount++;
} }
} }
@ -2708,7 +2708,7 @@ void VoxelSystem::nodeKilled(Node* node) {
if (node->getType() == NODE_TYPE_VOXEL_SERVER) { if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
_voxelServerCount--; _voxelServerCount--;
QUuid nodeUUID = node->getUUID(); QUuid nodeUUID = node->getUUID();
qDebug("VoxelSystem... voxel server %s removed...\n", nodeUUID.toString().toLocal8Bit().constData()); qDebug("VoxelSystem... voxel server %s removed...", nodeUUID.toString().toLocal8Bit().constData());
} }
} }
@ -2777,7 +2777,7 @@ void VoxelSystem::unlockTree() {
void VoxelSystem::localVoxelCacheLoaded() { void VoxelSystem::localVoxelCacheLoaded() {
qDebug() << "localVoxelCacheLoaded()\n"; qDebug() << "localVoxelCacheLoaded()";
// Make sure that the application has properly set up the view frustum for our loaded state // Make sure that the application has properly set up the view frustum for our loaded state
Application::getInstance()->initAvatarAndViewFrustum(); Application::getInstance()->initAvatarAndViewFrustum();
@ -2790,11 +2790,11 @@ void VoxelSystem::localVoxelCacheLoaded() {
} }
void VoxelSystem::beginLoadingLocalVoxelCache() { void VoxelSystem::beginLoadingLocalVoxelCache() {
qDebug() << "beginLoadingLocalVoxelCache()\n"; qDebug() << "beginLoadingLocalVoxelCache()";
_writeRenderFullVBO = true; // this will disable individual node updates _writeRenderFullVBO = true; // this will disable individual node updates
_inhideOutOfView = true; // this will disable hidOutOfView which we want to do until local cache is loaded _inhideOutOfView = true; // this will disable hidOutOfView which we want to do until local cache is loaded
killLocalVoxels(); killLocalVoxels();
qDebug() << "DONE beginLoadingLocalVoxelCache()\n"; qDebug() << "DONE beginLoadingLocalVoxelCache()";
} }

View file

@ -434,27 +434,27 @@ void Avatar::renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2,
} }
void Avatar::goHome() { void Avatar::goHome() {
qDebug("Going Home!\n"); qDebug("Going Home!");
setPosition(START_LOCATION); setPosition(START_LOCATION);
} }
void Avatar::increaseSize() { void Avatar::increaseSize() {
if ((1.f + SCALING_RATIO) * _targetScale < MAX_AVATAR_SCALE) { if ((1.f + SCALING_RATIO) * _targetScale < MAX_AVATAR_SCALE) {
_targetScale *= (1.f + SCALING_RATIO); _targetScale *= (1.f + SCALING_RATIO);
qDebug("Changed scale to %f\n", _targetScale); qDebug("Changed scale to %f", _targetScale);
} }
} }
void Avatar::decreaseSize() { void Avatar::decreaseSize() {
if (MIN_AVATAR_SCALE < (1.f - SCALING_RATIO) * _targetScale) { if (MIN_AVATAR_SCALE < (1.f - SCALING_RATIO) * _targetScale) {
_targetScale *= (1.f - SCALING_RATIO); _targetScale *= (1.f - SCALING_RATIO);
qDebug("Changed scale to %f\n", _targetScale); qDebug("Changed scale to %f", _targetScale);
} }
} }
void Avatar::resetSize() { void Avatar::resetSize() {
_targetScale = 1.0f; _targetScale = 1.0f;
qDebug("Reseted scale to %f\n", _targetScale); qDebug("Reseted scale to %f", _targetScale);
} }
void Avatar::setScale(const float scale) { void Avatar::setScale(const float scale) {

View file

@ -116,7 +116,7 @@ void Faceshift::setTCPEnabled(bool enabled) {
void Faceshift::connectSocket() { void Faceshift::connectSocket() {
if (_tcpEnabled) { if (_tcpEnabled) {
if (!_tcpRetryCount) { if (!_tcpRetryCount) {
qDebug("Faceshift: Connecting...\n"); qDebug("Faceshift: Connecting...");
} }
_tcpSocket.connectToHost("localhost", FACESHIFT_PORT); _tcpSocket.connectToHost("localhost", FACESHIFT_PORT);
@ -125,7 +125,7 @@ void Faceshift::connectSocket() {
} }
void Faceshift::noteConnected() { void Faceshift::noteConnected() {
qDebug("Faceshift: Connected.\n"); qDebug("Faceshift: Connected.");
// request the list of blendshape names // request the list of blendshape names
string message; string message;
@ -136,7 +136,7 @@ void Faceshift::noteConnected() {
void Faceshift::noteError(QAbstractSocket::SocketError error) { void Faceshift::noteError(QAbstractSocket::SocketError error) {
if (!_tcpRetryCount) { if (!_tcpRetryCount) {
// Only spam log with fail to connect the first time, so that we can keep waiting for server // Only spam log with fail to connect the first time, so that we can keep waiting for server
qDebug() << "Faceshift: " << _tcpSocket.errorString() << "\n"; qDebug() << "Faceshift: " << _tcpSocket.errorString();
} }
// retry connection after a 2 second delay // retry connection after a 2 second delay
if (_tcpEnabled) { if (_tcpEnabled) {

View file

@ -30,10 +30,10 @@ SixenseManager::~SixenseManager() {
void SixenseManager::setFilter(bool filter) { void SixenseManager::setFilter(bool filter) {
#ifdef HAVE_SIXENSE #ifdef HAVE_SIXENSE
if (filter) { if (filter) {
qDebug("Sixense Filter ON\n"); qDebug("Sixense Filter ON");
sixenseSetFilterEnabled(1); sixenseSetFilterEnabled(1);
} else { } else {
qDebug("Sixense Filter OFF\n"); qDebug("Sixense Filter OFF");
sixenseSetFilterEnabled(0); sixenseSetFilterEnabled(0);
} }
#endif #endif

View file

@ -44,7 +44,7 @@ void Transmitter::checkForLostTransmitter() {
int msecsSinceLast = diffclock(_lastReceivedPacket, &now); int msecsSinceLast = diffclock(_lastReceivedPacket, &now);
if (msecsSinceLast > TIME_TO_ASSUME_LOST_MSECS) { if (msecsSinceLast > TIME_TO_ASSUME_LOST_MSECS) {
resetLevels(); resetLevels();
qDebug("Transmitter signal lost.\n"); qDebug("Transmitter signal lost.");
} }
} }
} }
@ -99,12 +99,12 @@ void Transmitter::processIncomingData(unsigned char* packetData, int numBytes) {
_estimatedRotation.y *= (1.f - DECAY_RATE * DELTA_TIME); _estimatedRotation.y *= (1.f - DECAY_RATE * DELTA_TIME);
if (!_isConnected) { if (!_isConnected) {
qDebug("Transmitter Connected.\n"); qDebug("Transmitter Connected.");
_isConnected = true; _isConnected = true;
_estimatedRotation *= 0.0; _estimatedRotation *= 0.0;
} }
} else { } else {
qDebug("Transmitter packet read error, %d bytes.\n", numBytes); qDebug("Transmitter packet read error, %d bytes.", numBytes);
} }
} }

View file

@ -473,26 +473,26 @@ static glm::quat xnToGLM(const XnMatrix3X3& matrix) {
} }
static void XN_CALLBACK_TYPE newUser(UserGenerator& generator, XnUserID id, void* cookie) { static void XN_CALLBACK_TYPE newUser(UserGenerator& generator, XnUserID id, void* cookie) {
qDebug("Found user %d.\n", id); qDebug("Found user %d.", id);
generator.GetSkeletonCap().RequestCalibration(id, false); generator.GetSkeletonCap().RequestCalibration(id, false);
} }
static void XN_CALLBACK_TYPE lostUser(UserGenerator& generator, XnUserID id, void* cookie) { static void XN_CALLBACK_TYPE lostUser(UserGenerator& generator, XnUserID id, void* cookie) {
qDebug("Lost user %d.\n", id); qDebug("Lost user %d.", id);
} }
static void XN_CALLBACK_TYPE calibrationStarted(SkeletonCapability& capability, XnUserID id, void* cookie) { static void XN_CALLBACK_TYPE calibrationStarted(SkeletonCapability& capability, XnUserID id, void* cookie) {
qDebug("Calibration started for user %d.\n", id); qDebug("Calibration started for user %d.", id);
} }
static void XN_CALLBACK_TYPE calibrationCompleted(SkeletonCapability& capability, static void XN_CALLBACK_TYPE calibrationCompleted(SkeletonCapability& capability,
XnUserID id, XnCalibrationStatus status, void* cookie) { XnUserID id, XnCalibrationStatus status, void* cookie) {
if (status == XN_CALIBRATION_STATUS_OK) { if (status == XN_CALIBRATION_STATUS_OK) {
qDebug("Calibration completed for user %d.\n", id); qDebug("Calibration completed for user %d.", id);
capability.StartTracking(id); capability.StartTracking(id);
} else { } else {
qDebug("Calibration failed to user %d.\n", id); qDebug("Calibration failed to user %d.", id);
capability.RequestCalibration(id, true); capability.RequestCalibration(id, true);
} }
} }
@ -604,7 +604,7 @@ void FrameGrabber::grabFrame() {
// make sure it's in the format we expect // make sure it's in the format we expect
if (image->nChannels != 3 || image->depth != IPL_DEPTH_8U || image->dataOrder != IPL_DATA_ORDER_PIXEL || if (image->nChannels != 3 || image->depth != IPL_DEPTH_8U || image->dataOrder != IPL_DATA_ORDER_PIXEL ||
image->origin != 0) { image->origin != 0) {
qDebug("Invalid webcam image format.\n"); qDebug("Invalid webcam image format.");
return; return;
} }
color = image; color = image;
@ -938,7 +938,7 @@ bool FrameGrabber::init() {
// load our face cascade // load our face cascade
switchToResourcesParentIfRequired(); switchToResourcesParentIfRequired();
if (_faceCascade.empty() && !_faceCascade.load("resources/haarcascades/haarcascade_frontalface_alt.xml")) { if (_faceCascade.empty() && !_faceCascade.load("resources/haarcascades/haarcascade_frontalface_alt.xml")) {
qDebug("Failed to load Haar cascade for face tracking.\n"); qDebug("Failed to load Haar cascade for face tracking.");
return false; return false;
} }
@ -971,7 +971,7 @@ bool FrameGrabber::init() {
// next, an ordinary webcam // next, an ordinary webcam
if ((_capture = cvCaptureFromCAM(-1)) == 0) { if ((_capture = cvCaptureFromCAM(-1)) == 0) {
qDebug("Failed to open webcam.\n"); qDebug("Failed to open webcam.");
return false; return false;
} }
const int IDEAL_FRAME_WIDTH = 320; const int IDEAL_FRAME_WIDTH = 320;

View file

@ -33,16 +33,16 @@ int main(int argc, const char * argv[]) {
if (clockSkewOption) { if (clockSkewOption) {
int clockSkew = atoi(clockSkewOption); int clockSkew = atoi(clockSkewOption);
usecTimestampNowForceClockSkew(clockSkew); usecTimestampNowForceClockSkew(clockSkew);
qDebug("clockSkewOption=%s clockSkew=%d\n", clockSkewOption, clockSkew); qDebug("clockSkewOption=%s clockSkew=%d", clockSkewOption, clockSkew);
} }
int exitCode; int exitCode;
{ {
Application app(argc, const_cast<char**>(argv), startup_time); Application app(argc, const_cast<char**>(argv), startup_time);
qDebug( "Created QT Application.\n" ); qDebug( "Created QT Application.");
exitCode = app.exec(); exitCode = app.exec();
} }
qDebug("Normal exit.\n"); qDebug("Normal exit.");
return exitCode; return exitCode;
} }

View file

@ -523,11 +523,13 @@ public:
void printNode(const FBXNode& node, int indent) { void printNode(const FBXNode& node, int indent) {
QByteArray spaces(indent, ' '); QByteArray spaces(indent, ' ');
qDebug("%s%s: ", spaces.data(), node.name.data()); QDebug nodeDebug = qDebug();
nodeDebug.nospace() << spaces.data() << node.name.data() << ": ";
foreach (const QVariant& property, node.properties) { foreach (const QVariant& property, node.properties) {
qDebug() << property; nodeDebug << property;
} }
qDebug() << "\n";
foreach (const FBXNode& child, node.children) { foreach (const FBXNode& child, node.children) {
printNode(child, indent + 1); printNode(child, indent + 1);
} }
@ -1271,7 +1273,7 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
QString jointID = childMap.value(clusterID); QString jointID = childMap.value(clusterID);
fbxCluster.jointIndex = modelIDs.indexOf(jointID); fbxCluster.jointIndex = modelIDs.indexOf(jointID);
if (fbxCluster.jointIndex == -1) { if (fbxCluster.jointIndex == -1) {
qDebug() << "Joint not in model list: " << jointID << "\n"; qDebug() << "Joint not in model list: " << jointID;
fbxCluster.jointIndex = 0; fbxCluster.jointIndex = 0;
} }
fbxCluster.inverseBindMatrix = glm::inverse(cluster.transformLink) * modelTransform; fbxCluster.inverseBindMatrix = glm::inverse(cluster.transformLink) * modelTransform;
@ -1289,7 +1291,7 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
FBXCluster cluster; FBXCluster cluster;
cluster.jointIndex = modelIDs.indexOf(modelID); cluster.jointIndex = modelIDs.indexOf(modelID);
if (cluster.jointIndex == -1) { if (cluster.jointIndex == -1) {
qDebug() << "Model not in model list: " << modelID << "\n"; qDebug() << "Model not in model list: " << modelID;
cluster.jointIndex = 0; cluster.jointIndex = 0;
} }
extracted.mesh.clusters.append(cluster); extracted.mesh.clusters.append(cluster);

View file

@ -329,10 +329,8 @@ void NetworkGeometry::handleModelReplyError() {
const int BASE_DELAY_MS = 1000; const int BASE_DELAY_MS = 1000;
if (++_attempts < MAX_ATTEMPTS) { if (++_attempts < MAX_ATTEMPTS) {
QTimer::singleShot(BASE_DELAY_MS * (int)pow(2.0, _attempts), this, SLOT(makeModelRequest())); QTimer::singleShot(BASE_DELAY_MS * (int)pow(2.0, _attempts), this, SLOT(makeModelRequest()));
debug << " -- retrying...\n"; debug << " -- retrying...";
} else {
debug << "\n";
} }
} }
@ -367,7 +365,7 @@ void NetworkGeometry::maybeReadModelWithMapping() {
_geometry = url.path().toLower().endsWith(".svo") ? readSVO(model) : readFBX(model, mapping); _geometry = url.path().toLower().endsWith(".svo") ? readSVO(model) : readFBX(model, mapping);
} catch (const QString& error) { } catch (const QString& error) {
qDebug() << "Error reading " << url << ": " << error << "\n"; qDebug() << "Error reading " << url << ": " << error;
return; return;
} }

View file

@ -54,7 +54,7 @@ static ProgramObject* createProgram(const QString& name) {
void GlowEffect::init() { void GlowEffect::init() {
if (_initialized) { if (_initialized) {
qDebug("[ERROR] GlowEffeect is already initialized.\n"); qDebug("[ERROR] GlowEffeect is already initialized.");
return; return;
} }
@ -284,20 +284,20 @@ QOpenGLFramebufferObject* GlowEffect::render(bool toTexture) {
void GlowEffect::cycleRenderMode() { void GlowEffect::cycleRenderMode() {
switch(_renderMode = (RenderMode)((_renderMode + 1) % RENDER_MODE_COUNT)) { switch(_renderMode = (RenderMode)((_renderMode + 1) % RENDER_MODE_COUNT)) {
case ADD_MODE: case ADD_MODE:
qDebug() << "Glow mode: Add\n"; qDebug() << "Glow mode: Add";
break; break;
case BLUR_ADD_MODE: case BLUR_ADD_MODE:
qDebug() << "Glow mode: Blur/add\n"; qDebug() << "Glow mode: Blur/add";
break; break;
case BLUR_PERSIST_ADD_MODE: case BLUR_PERSIST_ADD_MODE:
qDebug() << "Glow mode: Blur/persist/add\n"; qDebug() << "Glow mode: Blur/persist/add";
break; break;
default: default:
case DIFFUSE_ADD_MODE: case DIFFUSE_ADD_MODE:
qDebug() << "Glow mode: Diffuse/add\n"; qDebug() << "Glow mode: Diffuse/add";
break; break;
} }
_isFirstFrame = true; _isFirstFrame = true;

View file

@ -36,7 +36,7 @@ ProgramObject* PointShader::createPointShaderProgram(const QString& name) {
void PointShader::init() { void PointShader::init() {
if (_initialized) { if (_initialized) {
qDebug("[ERROR] PointShader is already initialized.\n"); qDebug("[ERROR] PointShader is already initialized.");
return; return;
} }
switchToResourcesParentIfRequired(); switchToResourcesParentIfRequired();

View file

@ -333,10 +333,8 @@ void NetworkTexture::handleReplyError() {
const int BASE_DELAY_MS = 1000; const int BASE_DELAY_MS = 1000;
if (++_attempts < MAX_ATTEMPTS) { if (++_attempts < MAX_ATTEMPTS) {
QTimer::singleShot(BASE_DELAY_MS * (int)pow(2.0, _attempts), this, SLOT(makeRequest())); QTimer::singleShot(BASE_DELAY_MS * (int)pow(2.0, _attempts), this, SLOT(makeRequest()));
debug << " -- retrying...\n"; debug << " -- retrying...";
} else {
debug << "\n";
} }
} }

View file

@ -43,7 +43,7 @@ ProgramObject* VoxelShader::createGeometryShaderProgram(const QString& name) {
void VoxelShader::init() { void VoxelShader::init() {
if (_initialized) { if (_initialized) {
qDebug("[ERROR] TestProgram is already initialized.\n"); qDebug("[ERROR] TestProgram is already initialized.");
return; return;
} }
switchToResourcesParentIfRequired(); switchToResourcesParentIfRequired();

View file

@ -19,7 +19,7 @@ bool Controller::computeStars(unsigned numStars, unsigned seed) {
this->retile(numStars, _tileResolution); this->retile(numStars, _tileResolution);
qDebug() << "Total time to generate stars: " << ((usecTimestampNow() - usecTimestamp(&startTime)) / 1000) << " msec\n"; qDebug() << "Total time to generate stars: " << ((usecTimestampNow() - usecTimestamp(&startTime)) / 1000) << "msec";
return true; return true;
} }

View file

@ -62,7 +62,7 @@ void Generator::computeStarPositions(InputVertices& destination, unsigned limit,
vertices->push_back(InputVertex(azimuth, altitude, computeStarColor(STAR_COLORIZATION))); vertices->push_back(InputVertex(azimuth, altitude, computeStarColor(STAR_COLORIZATION)));
} }
qDebug() << "Total time to generate stars: " << ((usecTimestampNow() - usecTimestamp(&startTime)) / 1000) << " msec\n"; qDebug() << "Total time to generate stars: " << ((usecTimestampNow() - usecTimestamp(&startTime)) / 1000) << " msec";
} }
// computeStarColor // computeStarColor

View file

@ -101,7 +101,7 @@ qint64 AudioRingBuffer::writeData(const char* data, qint64 maxSize) {
&& (less(_endOfLastWrite, _nextOutput) && (less(_endOfLastWrite, _nextOutput)
&& lessEqual(_nextOutput, shiftedPositionAccomodatingWrap(_endOfLastWrite, samplesToCopy)))) { && lessEqual(_nextOutput, shiftedPositionAccomodatingWrap(_endOfLastWrite, samplesToCopy)))) {
// this read will cross the next output, so call us starved and reset the buffer // this read will cross the next output, so call us starved and reset the buffer
qDebug() << "Filled the ring buffer. Resetting.\n"; qDebug() << "Filled the ring buffer. Resetting.";
_endOfLastWrite = _buffer; _endOfLastWrite = _buffer;
_nextOutput = _buffer; _nextOutput = _buffer;
_isStarved = true; _isStarved = true;

View file

@ -57,10 +57,10 @@ int PositionalAudioRingBuffer::parsePositionalData(unsigned char* sourceBuffer,
bool PositionalAudioRingBuffer::shouldBeAddedToMix(int numJitterBufferSamples) { bool PositionalAudioRingBuffer::shouldBeAddedToMix(int numJitterBufferSamples) {
if (!isNotStarvedOrHasMinimumSamples(NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL + numJitterBufferSamples)) { if (!isNotStarvedOrHasMinimumSamples(NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL + numJitterBufferSamples)) {
qDebug() << "Starved and do not have minimum samples to start. Buffer held back.\n"; qDebug() << "Starved and do not have minimum samples to start. Buffer held back.";
return false; return false;
} else if (samplesAvailable() < NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL) { } else if (samplesAvailable() < NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL) {
qDebug() << "Do not have number of samples needed for interval. Buffer starved.\n"; qDebug() << "Do not have number of samples needed for interval. Buffer starved.";
_isStarved = true; _isStarved = true;
return false; return false;
} else { } else {

View file

@ -301,5 +301,5 @@ void AvatarData::setClampedTargetScale(float targetScale) {
targetScale = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE); targetScale = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE);
_targetScale = targetScale; _targetScale = targetScale;
qDebug() << "Changed scale to " << _targetScale << "\n"; qDebug() << "Changed scale to " << _targetScale;
} }

View file

@ -429,7 +429,7 @@ void ScriptedMetavoxelGuide::guide(MetavoxelVisitation& visitation) {
_visitation = &visitation; _visitation = &visitation;
_guideFunction.call(QScriptValue(), _arguments); _guideFunction.call(QScriptValue(), _arguments);
if (_guideFunction.engine()->hasUncaughtException()) { if (_guideFunction.engine()->hasUncaughtException()) {
qDebug() << "Script error: " << _guideFunction.engine()->uncaughtException().toString() << "\n"; qDebug() << "Script error: " << _guideFunction.engine()->uncaughtException().toString();
} }
} }

View file

@ -70,7 +70,7 @@ void OctreeInboundPacketProcessor::processPacket(const HifiSockAddr& senderSockA
if (_myServer->wantsDebugReceiving()) { if (_myServer->wantsDebugReceiving()) {
qDebug() << "PROCESSING THREAD: got '" << packetType << "' packet - " << _receivedPacketCount qDebug() << "PROCESSING THREAD: got '" << packetType << "' packet - " << _receivedPacketCount
<< " command from client receivedBytes=" << packetLength << " command from client receivedBytes=" << packetLength
<< " sequence=" << sequence << " transitTime=" << transitTime << " usecs\n"; << " sequence=" << sequence << " transitTime=" << transitTime << " usecs";
} }
int atByte = numBytesPacketHeader + sizeof(sequence) + sizeof(sentAt); int atByte = numBytesPacketHeader + sizeof(sequence) + sizeof(sentAt);
unsigned char* editData = (unsigned char*)&packetData[atByte]; unsigned char* editData = (unsigned char*)&packetData[atByte];
@ -114,16 +114,16 @@ void OctreeInboundPacketProcessor::processPacket(const HifiSockAddr& senderSockA
senderNode->setLastHeardMicrostamp(usecTimestampNow()); senderNode->setLastHeardMicrostamp(usecTimestampNow());
nodeUUID = senderNode->getUUID(); nodeUUID = senderNode->getUUID();
if (debugProcessPacket) { if (debugProcessPacket) {
qDebug() << "sender has uuid=" << nodeUUID << "\n"; qDebug() << "sender has uuid=" << nodeUUID;
} }
} else { } else {
if (debugProcessPacket) { if (debugProcessPacket) {
qDebug() << "sender has no known nodeUUID.\n"; qDebug() << "sender has no known nodeUUID.";
} }
} }
trackInboundPackets(nodeUUID, sequence, transitTime, editsInPacket, processTime, lockWaitTime); trackInboundPackets(nodeUUID, sequence, transitTime, editsInPacket, processTime, lockWaitTime);
} else { } else {
printf("unknown packet ignored... packetData[0]=%c\n", packetData[0]); qDebug("unknown packet ignored... packetData[0]=%c", packetData[0]);
} }
} }

View file

@ -56,7 +56,7 @@ bool OctreeSendThread::process() {
} }
} else { } else {
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("OctreeSendThread::process() waiting for isInitialLoadComplete()\n"); qDebug("OctreeSendThread::process() waiting for isInitialLoadComplete()");
} }
} }
@ -131,7 +131,7 @@ int OctreeSendThread::handlePacketSend(Node* node, OctreeQueryNode* nodeData, in
qDebug() << "Adding stats to packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence << qDebug() << "Adding stats to packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence <<
" statsMessageLength: " << statsMessageLength << " statsMessageLength: " << statsMessageLength <<
" original size: " << nodeData->getPacketLength() << " [" << _totalBytes << " original size: " << nodeData->getPacketLength() << " [" << _totalBytes <<
"] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]\n"; "] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]";
} }
// actually send it // actually send it
@ -154,7 +154,7 @@ int OctreeSendThread::handlePacketSend(Node* node, OctreeQueryNode* nodeData, in
if (debug) { if (debug) {
qDebug() << "Sending separate stats packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence << qDebug() << "Sending separate stats packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence <<
" size: " << statsMessageLength << " [" << _totalBytes << " size: " << statsMessageLength << " [" << _totalBytes <<
"] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]\n"; "] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]";
} }
trueBytesSent += statsMessageLength; trueBytesSent += statsMessageLength;
@ -174,7 +174,7 @@ int OctreeSendThread::handlePacketSend(Node* node, OctreeQueryNode* nodeData, in
if (debug) { if (debug) {
qDebug() << "Sending packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence << qDebug() << "Sending packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence <<
" size: " << nodeData->getPacketLength() << " [" << _totalBytes << " size: " << nodeData->getPacketLength() << " [" << _totalBytes <<
"] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]\n"; "] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]";
} }
} }
nodeData->stats.markAsSent(); nodeData->stats.markAsSent();
@ -194,7 +194,7 @@ int OctreeSendThread::handlePacketSend(Node* node, OctreeQueryNode* nodeData, in
if (debug) { if (debug) {
qDebug() << "Sending packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence << qDebug() << "Sending packet at " << now << " [" << _totalPackets <<"]: sequence: " << sequence <<
" size: " << nodeData->getPacketLength() << " [" << _totalBytes << " size: " << nodeData->getPacketLength() << " [" << _totalBytes <<
"] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]\n"; "] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]";
} }
} }
} }
@ -236,7 +236,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) { if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) {
qDebug("about to call handlePacketSend() .... line: %d -- format change " qDebug("about to call handlePacketSend() .... line: %d -- format change "
"wantColor=%s wantCompression=%s SENDING PARTIAL PACKET! currentPacketIsColor=%s " "wantColor=%s wantCompression=%s SENDING PARTIAL PACKET! currentPacketIsColor=%s "
"currentPacketIsCompressed=%s\n", "currentPacketIsCompressed=%s",
__LINE__, __LINE__,
debug::valueOf(wantColor), debug::valueOf(wantCompression), debug::valueOf(wantColor), debug::valueOf(wantCompression),
debug::valueOf(nodeData->getCurrentPacketIsColor()), debug::valueOf(nodeData->getCurrentPacketIsColor()),
@ -245,7 +245,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent);
} else { } else {
if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) { if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) {
qDebug("wantColor=%s wantCompression=%s FIXING HEADER! currentPacketIsColor=%s currentPacketIsCompressed=%s\n", qDebug("wantColor=%s wantCompression=%s FIXING HEADER! currentPacketIsColor=%s currentPacketIsCompressed=%s",
debug::valueOf(wantColor), debug::valueOf(wantCompression), debug::valueOf(wantColor), debug::valueOf(wantCompression),
debug::valueOf(nodeData->getCurrentPacketIsColor()), debug::valueOf(nodeData->getCurrentPacketIsColor()),
debug::valueOf(nodeData->getCurrentPacketIsCompressed()) ); debug::valueOf(nodeData->getCurrentPacketIsCompressed()) );
@ -257,7 +257,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
targetSize = nodeData->getAvailable() - sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE); targetSize = nodeData->getAvailable() - sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE);
} }
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("line:%d _packetData.changeSettings() wantCompression=%s targetSize=%d\n", __LINE__, qDebug("line:%d _packetData.changeSettings() wantCompression=%s targetSize=%d", __LINE__,
debug::valueOf(wantCompression), targetSize); debug::valueOf(wantCompression), targetSize);
} }
@ -265,7 +265,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
} }
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("wantColor/isColor=%s/%s wantCompression/isCompressed=%s/%s viewFrustumChanged=%s, getWantLowResMoving()=%s\n", qDebug("wantColor/isColor=%s/%s wantCompression/isCompressed=%s/%s viewFrustumChanged=%s, getWantLowResMoving()=%s",
debug::valueOf(wantColor), debug::valueOf(nodeData->getCurrentPacketIsColor()), debug::valueOf(wantColor), debug::valueOf(nodeData->getCurrentPacketIsColor()),
debug::valueOf(wantCompression), debug::valueOf(nodeData->getCurrentPacketIsCompressed()), debug::valueOf(wantCompression), debug::valueOf(nodeData->getCurrentPacketIsCompressed()),
debug::valueOf(viewFrustumChanged), debug::valueOf(nodeData->getWantLowResMoving())); debug::valueOf(viewFrustumChanged), debug::valueOf(nodeData->getWantLowResMoving()));
@ -274,7 +274,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
const ViewFrustum* lastViewFrustum = wantDelta ? &nodeData->getLastKnownViewFrustum() : NULL; const ViewFrustum* lastViewFrustum = wantDelta ? &nodeData->getLastKnownViewFrustum() : NULL;
if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) { if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) {
qDebug("packetDistributor() viewFrustumChanged=%s, nodeBag.isEmpty=%s, viewSent=%s\n", qDebug("packetDistributor() viewFrustumChanged=%s, nodeBag.isEmpty=%s, viewSent=%s",
debug::valueOf(viewFrustumChanged), debug::valueOf(nodeData->nodeBag.isEmpty()), debug::valueOf(viewFrustumChanged), debug::valueOf(nodeData->nodeBag.isEmpty()),
debug::valueOf(nodeData->getViewSent()) debug::valueOf(nodeData->getViewSent())
); );
@ -285,7 +285,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
if (viewFrustumChanged || nodeData->nodeBag.isEmpty()) { if (viewFrustumChanged || nodeData->nodeBag.isEmpty()) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) { if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) {
qDebug("(viewFrustumChanged=%s || nodeData->nodeBag.isEmpty() =%s)...\n", qDebug("(viewFrustumChanged=%s || nodeData->nodeBag.isEmpty() =%s)...",
debug::valueOf(viewFrustumChanged), debug::valueOf(nodeData->nodeBag.isEmpty())); debug::valueOf(viewFrustumChanged), debug::valueOf(nodeData->nodeBag.isEmpty()));
if (nodeData->getLastTimeBagEmpty() > 0) { if (nodeData->getLastTimeBagEmpty() > 0) {
float elapsedSceneSend = (now - nodeData->getLastTimeBagEmpty()) / 1000000.0f; float elapsedSceneSend = (now - nodeData->getLastTimeBagEmpty()) / 1000000.0f;
@ -294,7 +294,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
} else { } else {
qDebug("elapsed time to send scene = %f seconds", elapsedSceneSend); qDebug("elapsed time to send scene = %f seconds", elapsedSceneSend);
} }
qDebug(" [occlusionCulling:%s, wantDelta:%s, wantColor:%s ]\n", qDebug("[ occlusionCulling:%s, wantDelta:%s, wantColor:%s ]",
debug::valueOf(nodeData->getWantOcclusionCulling()), debug::valueOf(wantDelta), debug::valueOf(nodeData->getWantOcclusionCulling()), debug::valueOf(wantDelta),
debug::valueOf(wantColor)); debug::valueOf(wantColor));
} }
@ -323,12 +323,12 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
unsigned long elapsedTime = nodeData->stats.getElapsedTime(); unsigned long elapsedTime = nodeData->stats.getElapsedTime();
if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) { if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) {
qDebug("about to call handlePacketSend() .... line: %d -- completed scene \n", __LINE__ ); qDebug("about to call handlePacketSend() .... line: %d -- completed scene", __LINE__ );
} }
int packetsJustSent = handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); int packetsJustSent = handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent);
packetsSentThisInterval += packetsJustSent; packetsSentThisInterval += packetsJustSent;
if (forceDebugging) { if (forceDebugging) {
qDebug("packetsJustSent=%d packetsSentThisInterval=%d\n", packetsJustSent, packetsSentThisInterval); qDebug("packetsJustSent=%d packetsSentThisInterval=%d", packetsJustSent, packetsSentThisInterval);
} }
if (forceDebugging || _myServer->wantsDebugSending()) { if (forceDebugging || _myServer->wantsDebugSending()) {
@ -338,7 +338,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
<< " elapsed:" << elapsedTime << " elapsed:" << elapsedTime
<< " Packets:" << _totalPackets << " Packets:" << _totalPackets
<< " Bytes:" << _totalBytes << " Bytes:" << _totalBytes
<< " Wasted:" << _totalWastedBytes << "\n"; << " Wasted:" << _totalWastedBytes;
} }
// start tracking our stats // start tracking our stats
@ -354,7 +354,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
qDebug() << "Scene started at " << usecTimestampNow() qDebug() << "Scene started at " << usecTimestampNow()
<< " Packets:" << _totalPackets << " Packets:" << _totalPackets
<< " Bytes:" << _totalBytes << " Bytes:" << _totalBytes
<< " Wasted:" << _totalWastedBytes << "\n"; << " Wasted:" << _totalWastedBytes;
} }
::startSceneSleepTime = _usleepTime; ::startSceneSleepTime = _usleepTime;
@ -382,7 +382,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
int maxPacketsPerInterval = std::min(clientMaxPacketsPerInterval, _myServer->getPacketsPerClientPerInterval()); int maxPacketsPerInterval = std::min(clientMaxPacketsPerInterval, _myServer->getPacketsPerClientPerInterval());
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("truePacketsSent=%d packetsSentThisInterval=%d maxPacketsPerInterval=%d server PPI=%d nodePPS=%d nodePPI=%d\n", qDebug("truePacketsSent=%d packetsSentThisInterval=%d maxPacketsPerInterval=%d server PPI=%d nodePPS=%d nodePPI=%d",
truePacketsSent, packetsSentThisInterval, maxPacketsPerInterval, _myServer->getPacketsPerClientPerInterval(), truePacketsSent, packetsSentThisInterval, maxPacketsPerInterval, _myServer->getPacketsPerClientPerInterval(),
nodeData->getMaxOctreePacketsPerSecond(), clientMaxPacketsPerInterval); nodeData->getMaxOctreePacketsPerSecond(), clientMaxPacketsPerInterval);
} }
@ -391,7 +391,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
bool completedScene = false; bool completedScene = false;
while (somethingToSend && packetsSentThisInterval < maxPacketsPerInterval) { while (somethingToSend && packetsSentThisInterval < maxPacketsPerInterval) {
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("truePacketsSent=%d packetsSentThisInterval=%d maxPacketsPerInterval=%d server PPI=%d nodePPS=%d nodePPI=%d\n", qDebug("truePacketsSent=%d packetsSentThisInterval=%d maxPacketsPerInterval=%d server PPI=%d nodePPS=%d nodePPI=%d",
truePacketsSent, packetsSentThisInterval, maxPacketsPerInterval, _myServer->getPacketsPerClientPerInterval(), truePacketsSent, packetsSentThisInterval, maxPacketsPerInterval, _myServer->getPacketsPerClientPerInterval(),
nodeData->getMaxOctreePacketsPerSecond(), clientMaxPacketsPerInterval); nodeData->getMaxOctreePacketsPerSecond(), clientMaxPacketsPerInterval);
} }
@ -471,14 +471,14 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
if (writtenSize > nodeData->getAvailable()) { if (writtenSize > nodeData->getAvailable()) {
if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) { if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) {
qDebug("about to call handlePacketSend() .... line: %d -- " qDebug("about to call handlePacketSend() .... line: %d -- "
"writtenSize[%d] > available[%d] too big, sending packet as is.\n", "writtenSize[%d] > available[%d] too big, sending packet as is.",
__LINE__, writtenSize, nodeData->getAvailable()); __LINE__, writtenSize, nodeData->getAvailable());
} }
packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent);
} }
if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) { if (forceDebugging || (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug())) {
qDebug(">>>>>> calling writeToPacket() available=%d compressedSize=%d uncompressedSize=%d target=%d\n", qDebug(">>>>>> calling writeToPacket() available=%d compressedSize=%d uncompressedSize=%d target=%d",
nodeData->getAvailable(), _packetData.getFinalizedSize(), nodeData->getAvailable(), _packetData.getFinalizedSize(),
_packetData.getUncompressedSize(), _packetData.getTargetSize()); _packetData.getUncompressedSize(), _packetData.getTargetSize());
} }
@ -499,7 +499,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
int targetSize = MAX_OCTREE_PACKET_DATA_SIZE; int targetSize = MAX_OCTREE_PACKET_DATA_SIZE;
if (sendNow) { if (sendNow) {
if (forceDebugging) { if (forceDebugging) {
qDebug("about to call handlePacketSend() .... line: %d -- sendNow = TRUE\n", __LINE__); qDebug("about to call handlePacketSend() .... line: %d -- sendNow = TRUE", __LINE__);
} }
packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent);
if (wantCompression) { if (wantCompression) {
@ -515,7 +515,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
targetSize = nodeData->getAvailable() - sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE) - COMPRESS_PADDING; targetSize = nodeData->getAvailable() - sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE) - COMPRESS_PADDING;
} }
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("line:%d _packetData.changeSettings() wantCompression=%s targetSize=%d\n",__LINE__, qDebug("line:%d _packetData.changeSettings() wantCompression=%s targetSize=%d",__LINE__,
debug::valueOf(nodeData->getWantCompression()), targetSize); debug::valueOf(nodeData->getWantCompression()), targetSize);
} }
_packetData.changeSettings(nodeData->getWantCompression(), targetSize); // will do reset _packetData.changeSettings(nodeData->getWantCompression(), targetSize); // will do reset
@ -546,18 +546,18 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
if (elapsedmsec > 1000) { if (elapsedmsec > 1000) {
int elapsedsec = (end - start)/1000000; int elapsedsec = (end - start)/1000000;
qDebug("WARNING! packetLoop() took %d seconds [%d milliseconds %d calls in compress] " qDebug("WARNING! packetLoop() took %d seconds [%d milliseconds %d calls in compress] "
"to generate %d bytes in %d packets %d nodes still to send\n", "to generate %d bytes in %d packets %d nodes still to send",
elapsedsec, elapsedCompressTimeMsecs, elapsedCompressCalls, elapsedsec, elapsedCompressTimeMsecs, elapsedCompressCalls,
trueBytesSent, truePacketsSent, nodeData->nodeBag.count()); trueBytesSent, truePacketsSent, nodeData->nodeBag.count());
} else { } else {
qDebug("WARNING! packetLoop() took %d milliseconds [%d milliseconds %d calls in compress] " qDebug("WARNING! packetLoop() took %d milliseconds [%d milliseconds %d calls in compress] "
"to generate %d bytes in %d packets, %d nodes still to send\n", "to generate %d bytes in %d packets, %d nodes still to send",
elapsedmsec, elapsedCompressTimeMsecs, elapsedCompressCalls, elapsedmsec, elapsedCompressTimeMsecs, elapsedCompressCalls,
trueBytesSent, truePacketsSent, nodeData->nodeBag.count()); trueBytesSent, truePacketsSent, nodeData->nodeBag.count());
} }
} else if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { } else if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("packetLoop() took %d milliseconds [%d milliseconds %d calls in compress] " qDebug("packetLoop() took %d milliseconds [%d milliseconds %d calls in compress] "
"to generate %d bytes in %d packets, %d nodes still to send\n", "to generate %d bytes in %d packets, %d nodes still to send",
elapsedmsec, elapsedCompressTimeMsecs, elapsedCompressCalls, elapsedmsec, elapsedCompressTimeMsecs, elapsedCompressCalls,
trueBytesSent, truePacketsSent, nodeData->nodeBag.count()); trueBytesSent, truePacketsSent, nodeData->nodeBag.count());
} }
@ -575,7 +575,7 @@ int OctreeSendThread::packetDistributor(Node* node, OctreeQueryNode* nodeData, b
if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) { if (_myServer->wantsDebugSending() && _myServer->wantsVerboseDebug()) {
qDebug("truePacketsSent=%d packetsSentThisInterval=%d maxPacketsPerInterval=%d " qDebug("truePacketsSent=%d packetsSentThisInterval=%d maxPacketsPerInterval=%d "
"server PPI=%d nodePPS=%d nodePPI=%d\n", "server PPI=%d nodePPS=%d nodePPI=%d",
truePacketsSent, packetsSentThisInterval, maxPacketsPerInterval, truePacketsSent, packetsSentThisInterval, maxPacketsPerInterval,
_myServer->getPacketsPerClientPerInterval(), nodeData->getMaxOctreePacketsPerSecond(), _myServer->getPacketsPerClientPerInterval(), nodeData->getMaxOctreePacketsPerSecond(),
clientMaxPacketsPerInterval); clientMaxPacketsPerInterval);

View file

@ -97,7 +97,7 @@ OctreeServer::~OctreeServer() {
delete _jurisdiction; delete _jurisdiction;
_jurisdiction = NULL; _jurisdiction = NULL;
qDebug() << "OctreeServer::run()... DONE\n"; qDebug() << "OctreeServer::run()... DONE";
} }
void OctreeServer::initMongoose(int port) { void OctreeServer::initMongoose(int port) {
@ -127,7 +127,7 @@ int OctreeServer::civetwebRequestHandler(struct mg_connection* connection) {
#ifdef FORCE_CRASH #ifdef FORCE_CRASH
if (strcmp(ri->uri, "/force_crash") == 0 && strcmp(ri->request_method, "GET") == 0) { if (strcmp(ri->uri, "/force_crash") == 0 && strcmp(ri->request_method, "GET") == 0) {
qDebug() << "About to force a crash!\n"; qDebug() << "About to force a crash!";
int foo; int foo;
int* forceCrash = &foo; int* forceCrash = &foo;
mg_printf(connection, "%s", "HTTP/1.0 200 OK\r\n\r\n"); mg_printf(connection, "%s", "HTTP/1.0 200 OK\r\n\r\n");
@ -471,9 +471,9 @@ void OctreeServer::setArguments(int argc, char** argv) {
_argc = argc; _argc = argc;
_argv = const_cast<const char**>(argv); _argv = const_cast<const char**>(argv);
qDebug("OctreeServer::setArguments()\n"); qDebug("OctreeServer::setArguments()");
for (int i = 0; i < _argc; i++) { for (int i = 0; i < _argc; i++) {
qDebug("_argv[%d]=%s\n", i, _argv[i]); qDebug("_argv[%d]=%s", i, _argv[i]);
} }
} }
@ -488,7 +488,7 @@ void OctreeServer::parsePayload() {
int argCount = configList.size() + 1; int argCount = configList.size() + 1;
qDebug("OctreeServer::parsePayload()... argCount=%d\n",argCount); qDebug("OctreeServer::parsePayload()... argCount=%d",argCount);
_parsedArgV = new char*[argCount]; _parsedArgV = new char*[argCount];
const char* dummy = "config-from-payload"; const char* dummy = "config-from-payload";
@ -499,7 +499,7 @@ void OctreeServer::parsePayload() {
QString configItem = configList.at(i-1); QString configItem = configList.at(i-1);
_parsedArgV[i] = new char[configItem.length() + sizeof(char)]; _parsedArgV[i] = new char[configItem.length() + sizeof(char)];
strcpy(_parsedArgV[i], configItem.toLocal8Bit().constData()); strcpy(_parsedArgV[i], configItem.toLocal8Bit().constData());
qDebug("OctreeServer::parsePayload()... _parsedArgV[%d]=%s\n", i, _parsedArgV[i]); qDebug("OctreeServer::parsePayload()... _parsedArgV[%d]=%s", i, _parsedArgV[i]);
} }
setArguments(argCount, _parsedArgV); setArguments(argCount, _parsedArgV);
@ -514,7 +514,7 @@ void OctreeServer::processDatagram(const QByteArray& dataByteArray, const HifiSo
if (packetType == getMyQueryMessageType()) { if (packetType == getMyQueryMessageType()) {
bool debug = false; bool debug = false;
if (debug) { if (debug) {
qDebug() << "Got PACKET_TYPE_VOXEL_QUERY at" << usecTimestampNow() << "\n"; qDebug() << "Got PACKET_TYPE_VOXEL_QUERY at" << usecTimestampNow();
} }
int numBytesPacketHeader = numBytesForPacketHeader((unsigned char*) dataByteArray.data()); int numBytesPacketHeader = numBytesForPacketHeader((unsigned char*) dataByteArray.data());
@ -579,22 +579,22 @@ void OctreeServer::run() {
const char* JURISDICTION_FILE = "--jurisdictionFile"; const char* JURISDICTION_FILE = "--jurisdictionFile";
const char* jurisdictionFile = getCmdOption(_argc, _argv, JURISDICTION_FILE); const char* jurisdictionFile = getCmdOption(_argc, _argv, JURISDICTION_FILE);
if (jurisdictionFile) { if (jurisdictionFile) {
qDebug("jurisdictionFile=%s\n", jurisdictionFile); qDebug("jurisdictionFile=%s", jurisdictionFile);
qDebug("about to readFromFile().... jurisdictionFile=%s\n", jurisdictionFile); qDebug("about to readFromFile().... jurisdictionFile=%s", jurisdictionFile);
_jurisdiction = new JurisdictionMap(jurisdictionFile); _jurisdiction = new JurisdictionMap(jurisdictionFile);
qDebug("after readFromFile().... jurisdictionFile=%s\n", jurisdictionFile); qDebug("after readFromFile().... jurisdictionFile=%s", jurisdictionFile);
} else { } else {
const char* JURISDICTION_ROOT = "--jurisdictionRoot"; const char* JURISDICTION_ROOT = "--jurisdictionRoot";
const char* jurisdictionRoot = getCmdOption(_argc, _argv, JURISDICTION_ROOT); const char* jurisdictionRoot = getCmdOption(_argc, _argv, JURISDICTION_ROOT);
if (jurisdictionRoot) { if (jurisdictionRoot) {
qDebug("jurisdictionRoot=%s\n", jurisdictionRoot); qDebug("jurisdictionRoot=%s", jurisdictionRoot);
} }
const char* JURISDICTION_ENDNODES = "--jurisdictionEndNodes"; const char* JURISDICTION_ENDNODES = "--jurisdictionEndNodes";
const char* jurisdictionEndNodes = getCmdOption(_argc, _argv, JURISDICTION_ENDNODES); const char* jurisdictionEndNodes = getCmdOption(_argc, _argv, JURISDICTION_ENDNODES);
if (jurisdictionEndNodes) { if (jurisdictionEndNodes) {
qDebug("jurisdictionEndNodes=%s\n", jurisdictionEndNodes); qDebug("jurisdictionEndNodes=%s", jurisdictionEndNodes);
} }
if (jurisdictionRoot || jurisdictionEndNodes) { if (jurisdictionRoot || jurisdictionEndNodes) {
@ -619,22 +619,22 @@ void OctreeServer::run() {
const char* VERBOSE_DEBUG = "--verboseDebug"; const char* VERBOSE_DEBUG = "--verboseDebug";
_verboseDebug = cmdOptionExists(_argc, _argv, VERBOSE_DEBUG); _verboseDebug = cmdOptionExists(_argc, _argv, VERBOSE_DEBUG);
qDebug("verboseDebug=%s\n", debug::valueOf(_verboseDebug)); qDebug("verboseDebug=%s", debug::valueOf(_verboseDebug));
const char* DEBUG_SENDING = "--debugSending"; const char* DEBUG_SENDING = "--debugSending";
_debugSending = cmdOptionExists(_argc, _argv, DEBUG_SENDING); _debugSending = cmdOptionExists(_argc, _argv, DEBUG_SENDING);
qDebug("debugSending=%s\n", debug::valueOf(_debugSending)); qDebug("debugSending=%s", debug::valueOf(_debugSending));
const char* DEBUG_RECEIVING = "--debugReceiving"; const char* DEBUG_RECEIVING = "--debugReceiving";
_debugReceiving = cmdOptionExists(_argc, _argv, DEBUG_RECEIVING); _debugReceiving = cmdOptionExists(_argc, _argv, DEBUG_RECEIVING);
qDebug("debugReceiving=%s\n", debug::valueOf(_debugReceiving)); qDebug("debugReceiving=%s", debug::valueOf(_debugReceiving));
// By default we will persist, if you want to disable this, then pass in this parameter // By default we will persist, if you want to disable this, then pass in this parameter
const char* NO_PERSIST = "--NoPersist"; const char* NO_PERSIST = "--NoPersist";
if (cmdOptionExists(_argc, _argv, NO_PERSIST)) { if (cmdOptionExists(_argc, _argv, NO_PERSIST)) {
_wantPersist = false; _wantPersist = false;
} }
qDebug("wantPersist=%s\n", debug::valueOf(_wantPersist)); qDebug("wantPersist=%s", debug::valueOf(_wantPersist));
// if we want Persistence, set up the local file and persist thread // if we want Persistence, set up the local file and persist thread
if (_wantPersist) { if (_wantPersist) {
@ -648,7 +648,7 @@ void OctreeServer::run() {
strcpy(_persistFilename, getMyDefaultPersistFilename()); strcpy(_persistFilename, getMyDefaultPersistFilename());
} }
qDebug("persistFilename=%s\n", _persistFilename); qDebug("persistFilename=%s", _persistFilename);
// now set up PersistThread // now set up PersistThread
_persistThread = new OctreePersistThread(_tree, _persistFilename); _persistThread = new OctreePersistThread(_tree, _persistFilename);
@ -665,7 +665,7 @@ void OctreeServer::run() {
if (clockSkewOption) { if (clockSkewOption) {
int clockSkew = atoi(clockSkewOption); int clockSkew = atoi(clockSkewOption);
usecTimestampNowForceClockSkew(clockSkew); usecTimestampNowForceClockSkew(clockSkew);
qDebug("clockSkewOption=%s clockSkew=%d\n", clockSkewOption, clockSkew); qDebug("clockSkewOption=%s clockSkew=%d", clockSkewOption, clockSkew);
} }
// Check to see if the user passed in a command line option for setting packet send rate // Check to see if the user passed in a command line option for setting packet send rate
@ -676,7 +676,7 @@ void OctreeServer::run() {
if (_packetsPerClientPerInterval < 1) { if (_packetsPerClientPerInterval < 1) {
_packetsPerClientPerInterval = 1; _packetsPerClientPerInterval = 1;
} }
qDebug("packetsPerSecond=%s PACKETS_PER_CLIENT_PER_INTERVAL=%d\n", packetsPerSecond, _packetsPerClientPerInterval); qDebug("packetsPerSecond=%s PACKETS_PER_CLIENT_PER_INTERVAL=%d", packetsPerSecond, _packetsPerClientPerInterval);
} }
HifiSockAddr senderSockAddr; HifiSockAddr senderSockAddr;
@ -703,7 +703,7 @@ void OctreeServer::run() {
if (gmtm != NULL) { if (gmtm != NULL) {
strftime(utcBuffer, MAX_TIME_LENGTH, " [%m/%d/%Y %X UTC]", gmtm); strftime(utcBuffer, MAX_TIME_LENGTH, " [%m/%d/%Y %X UTC]", gmtm);
} }
qDebug() << "Now running... started at: " << localBuffer << utcBuffer << "\n"; qDebug() << "Now running... started at: " << localBuffer << utcBuffer;
QTimer* domainServerTimer = new QTimer(this); QTimer* domainServerTimer = new QTimer(this);
connect(domainServerTimer, SIGNAL(timeout()), this, SLOT(checkInWithDomainServerOrExit())); connect(domainServerTimer, SIGNAL(timeout()), this, SLOT(checkInWithDomainServerOrExit()));

View file

@ -71,19 +71,19 @@ CoverageMap::~CoverageMap() {
}; };
void CoverageMap::printStats() { void CoverageMap::printStats() {
qDebug("CoverageMap::printStats()...\n"); qDebug("CoverageMap::printStats()...");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE); qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d\n",_mapCount); qDebug("_mapCount=%d",_mapCount);
qDebug("_checkMapRootCalls=%d\n",_checkMapRootCalls); qDebug("_checkMapRootCalls=%d",_checkMapRootCalls);
qDebug("_notAllInView=%d\n",_notAllInView); qDebug("_notAllInView=%d",_notAllInView);
qDebug("_maxPolygonsUsed=%d\n",CoverageRegion::_maxPolygonsUsed); qDebug("_maxPolygonsUsed=%d",CoverageRegion::_maxPolygonsUsed);
qDebug("_totalPolygons=%d\n",CoverageRegion::_totalPolygons); qDebug("_totalPolygons=%d",CoverageRegion::_totalPolygons);
qDebug("_occlusionTests=%d\n",CoverageRegion::_occlusionTests); qDebug("_occlusionTests=%d",CoverageRegion::_occlusionTests);
qDebug("_regionSkips=%d\n",CoverageRegion::_regionSkips); qDebug("_regionSkips=%d",CoverageRegion::_regionSkips);
qDebug("_tooSmallSkips=%d\n",CoverageRegion::_tooSmallSkips); qDebug("_tooSmallSkips=%d",CoverageRegion::_tooSmallSkips);
qDebug("_regionFullSkips=%d\n",CoverageRegion::_regionFullSkips); qDebug("_regionFullSkips=%d",CoverageRegion::_regionFullSkips);
qDebug("_outOfOrderPolygon=%d\n",CoverageRegion::_outOfOrderPolygon); qDebug("_outOfOrderPolygon=%d",CoverageRegion::_outOfOrderPolygon);
qDebug("_clippedPolygons=%d\n",CoverageRegion::_clippedPolygons); qDebug("_clippedPolygons=%d",CoverageRegion::_clippedPolygons);
} }
void CoverageMap::erase() { void CoverageMap::erase() {
@ -102,7 +102,7 @@ void CoverageMap::erase() {
} }
if (_isRoot && wantDebugging) { if (_isRoot && wantDebugging) {
qDebug("CoverageMap last to be deleted...\n"); qDebug("CoverageMap last to be deleted...");
printStats(); printStats();
CoverageRegion::_maxPolygonsUsed = 0; CoverageRegion::_maxPolygonsUsed = 0;

View file

@ -78,11 +78,11 @@ void CoverageMapV2::erase() {
} }
if (_isRoot && wantDebugging) { if (_isRoot && wantDebugging) {
qDebug("CoverageMapV2 last to be deleted...\n"); qDebug("CoverageMapV2 last to be deleted...");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE); qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d\n",_mapCount); qDebug("_mapCount=%d",_mapCount);
qDebug("_checkMapRootCalls=%d\n",_checkMapRootCalls); qDebug("_checkMapRootCalls=%d",_checkMapRootCalls);
qDebug("_notAllInView=%d\n",_notAllInView); qDebug("_notAllInView=%d",_notAllInView);
_mapCount = 0; _mapCount = 0;
_checkMapRootCalls = 0; _checkMapRootCalls = 0;
_notAllInView = 0; _notAllInView = 0;

View file

@ -145,7 +145,7 @@ void myDebugPrintOctalCode(const unsigned char* octalCode, bool withNewLine) {
JurisdictionMap::JurisdictionMap(const char* rootHexCode, const char* endNodesHexCodes) { JurisdictionMap::JurisdictionMap(const char* rootHexCode, const char* endNodesHexCodes) {
qDebug("JurisdictionMap::JurisdictionMap(const char* rootHexCode=[%p] %s, const char* endNodesHexCodes=[%p] %s)\n", qDebug("JurisdictionMap::JurisdictionMap(const char* rootHexCode=[%p] %s, const char* endNodesHexCodes=[%p] %s)",
rootHexCode, rootHexCode, endNodesHexCodes, endNodesHexCodes); rootHexCode, rootHexCode, endNodesHexCodes, endNodesHexCodes);
_rootOctalCode = hexStringToOctalCode(QString(rootHexCode)); _rootOctalCode = hexStringToOctalCode(QString(rootHexCode));
@ -162,7 +162,7 @@ JurisdictionMap::JurisdictionMap(const char* rootHexCode, const char* endNodesHe
unsigned char* endNodeOctcode = hexStringToOctalCode(endNodeHexString); unsigned char* endNodeOctcode = hexStringToOctalCode(endNodeHexString);
qDebug("JurisdictionMap::JurisdictionMap() endNodeList(%d)=%s\n", qDebug("JurisdictionMap::JurisdictionMap() endNodeList(%d)=%s",
i, endNodeHexString.toLocal8Bit().constData()); i, endNodeHexString.toLocal8Bit().constData());
//printOctalCode(endNodeOctcode); //printOctalCode(endNodeOctcode);
@ -209,7 +209,7 @@ bool JurisdictionMap::readFromFile(const char* filename) {
QString settingsFile(filename); QString settingsFile(filename);
QSettings settings(settingsFile, QSettings::IniFormat); QSettings settings(settingsFile, QSettings::IniFormat);
QString rootCode = settings.value("root","00").toString(); QString rootCode = settings.value("root","00").toString();
qDebug() << "rootCode=" << rootCode << "\n"; qDebug() << "rootCode=" << rootCode;
_rootOctalCode = hexStringToOctalCode(rootCode); _rootOctalCode = hexStringToOctalCode(rootCode);
printOctalCode(_rootOctalCode); printOctalCode(_rootOctalCode);
@ -220,7 +220,7 @@ bool JurisdictionMap::readFromFile(const char* filename) {
foreach (const QString &childKey, childKeys) { foreach (const QString &childKey, childKeys) {
QString childValue = settings.value(childKey).toString(); QString childValue = settings.value(childKey).toString();
values.insert(childKey, childValue); values.insert(childKey, childValue);
qDebug() << childKey << "=" << childValue << "\n"; qDebug() << childKey << "=" << childValue;
unsigned char* octcode = hexStringToOctalCode(childValue); unsigned char* octcode = hexStringToOctalCode(childValue);
printOctalCode(octcode); printOctalCode(octcode);
@ -234,11 +234,11 @@ bool JurisdictionMap::readFromFile(const char* filename) {
void JurisdictionMap::displayDebugDetails() const { void JurisdictionMap::displayDebugDetails() const {
QString rootNodeValue = octalCodeToHexString(_rootOctalCode); QString rootNodeValue = octalCodeToHexString(_rootOctalCode);
qDebug() << "root:" << rootNodeValue << "\n"; qDebug() << "root:" << rootNodeValue;
for (int i = 0; i < _endNodes.size(); i++) { for (int i = 0; i < _endNodes.size(); i++) {
QString value = octalCodeToHexString(_endNodes[i]); QString value = octalCodeToHexString(_endNodes[i]);
qDebug() << "End node[" << i << "]: " << rootNodeValue << "\n"; qDebug() << "End node[" << i << "]: " << rootNodeValue;
} }
} }

View file

@ -69,7 +69,7 @@ void Octree::recurseTreeWithOperation(RecurseOctreeOperation operation, void* ex
void Octree::recurseNodeWithOperation(OctreeElement* node, RecurseOctreeOperation operation, void* extraData, void Octree::recurseNodeWithOperation(OctreeElement* node, RecurseOctreeOperation operation, void* extraData,
int recursionCount) { int recursionCount) {
if (recursionCount > DANGEROUSLY_DEEP_RECURSION) { if (recursionCount > DANGEROUSLY_DEEP_RECURSION) {
qDebug() << "Octree::recurseNodeWithOperation() reached DANGEROUSLY_DEEP_RECURSION, bailing!\n"; qDebug() << "Octree::recurseNodeWithOperation() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return; return;
} }
@ -96,7 +96,7 @@ void Octree::recurseNodeWithOperationDistanceSorted(OctreeElement* node, Recurse
const glm::vec3& point, void* extraData, int recursionCount) { const glm::vec3& point, void* extraData, int recursionCount) {
if (recursionCount > DANGEROUSLY_DEEP_RECURSION) { if (recursionCount > DANGEROUSLY_DEEP_RECURSION) {
qDebug() << "Octree::recurseNodeWithOperationDistanceSorted() reached DANGEROUSLY_DEEP_RECURSION, bailing!\n"; qDebug() << "Octree::recurseNodeWithOperationDistanceSorted() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return; return;
} }
@ -494,7 +494,7 @@ void Octree::reaverageOctreeElements(OctreeElement* startNode) {
recursionCount++; recursionCount++;
} }
if (recursionCount > UNREASONABLY_DEEP_RECURSION) { if (recursionCount > UNREASONABLY_DEEP_RECURSION) {
qDebug("Octree::reaverageOctreeElements()... bailing out of UNREASONABLY_DEEP_RECURSION\n"); qDebug("Octree::reaverageOctreeElements()... bailing out of UNREASONABLY_DEEP_RECURSION");
recursionCount--; recursionCount--;
return; return;
} }
@ -674,7 +674,7 @@ int Octree::encodeTreeBitstream(OctreeElement* node,
// you can't call this without a valid node // you can't call this without a valid node
if (!node) { if (!node) {
qDebug("WARNING! encodeTreeBitstream() called with node=NULL\n"); qDebug("WARNING! encodeTreeBitstream() called with node=NULL");
params.stopReason = EncodeBitstreamParams::NULL_NODE; params.stopReason = EncodeBitstreamParams::NULL_NODE;
return bytesWritten; return bytesWritten;
} }
@ -763,7 +763,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* node,
// you can't call this without a valid node // you can't call this without a valid node
if (!node) { if (!node) {
qDebug("WARNING! encodeTreeBitstreamRecursion() called with node=NULL\n"); qDebug("WARNING! encodeTreeBitstreamRecursion() called with node=NULL");
params.stopReason = EncodeBitstreamParams::NULL_NODE; params.stopReason = EncodeBitstreamParams::NULL_NODE;
return bytesAtThisLevel; return bytesAtThisLevel;
} }
@ -1312,7 +1312,7 @@ bool Octree::readFromSVOFile(const char* fileName) {
emit importSize(1.0f, 1.0f, 1.0f); emit importSize(1.0f, 1.0f, 1.0f);
emit importProgress(0); emit importProgress(0);
qDebug("loading file %s...\n", fileName); qDebug("Loading file %s...", fileName);
// get file length.... // get file length....
unsigned long fileLength = file.tellg(); unsigned long fileLength = file.tellg();
@ -1341,10 +1341,10 @@ bool Octree::readFromSVOFile(const char* fileName) {
dataLength -= sizeof(expectedVersion); dataLength -= sizeof(expectedVersion);
fileOk = true; fileOk = true;
} else { } else {
qDebug("SVO file version mismatch. Expected: %d Got: %d\n", expectedVersion, gotVersion); qDebug("SVO file version mismatch. Expected: %d Got: %d", expectedVersion, gotVersion);
} }
} else { } else {
qDebug("SVO file type mismatch. Expected: %c Got: %c\n", expectedType, gotType); qDebug("SVO file type mismatch. Expected: %c Got: %c", expectedType, gotType);
} }
} else { } else {
fileOk = true; // assume the file is ok fileOk = true; // assume the file is ok
@ -1367,7 +1367,7 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* node) {
std::ofstream file(fileName, std::ios::out|std::ios::binary); std::ofstream file(fileName, std::ios::out|std::ios::binary);
if(file.is_open()) { if(file.is_open()) {
qDebug("saving to file %s...\n", fileName); qDebug("Saving to file %s...", fileName);
// before reading the file, check to see if this version of the Octree supports file versions // before reading the file, check to see if this version of the Octree supports file versions
if (getWantSVOfileVersions()) { if (getWantSVOfileVersions()) {

View file

@ -103,7 +103,7 @@ void OctreeEditPacketSender::queuePacketToNode(const QUuid& nodeUUID, unsigned c
qDebug() << "OctreeEditPacketSender::queuePacketToNode() queued " << buffer[0] << qDebug() << "OctreeEditPacketSender::queuePacketToNode() queued " << buffer[0] <<
" - command to node bytes=" << length << " - command to node bytes=" << length <<
" sequence=" << sequence << " sequence=" << sequence <<
" transitTimeSoFar=" << transitTime << " usecs\n"; " transitTimeSoFar=" << transitTime << " usecs";
} }
} }
} }

View file

@ -246,23 +246,25 @@ void OctreeElement::auditChildren(const char* label) const {
const bool alwaysReport = false; // set this to true to get additional debugging const bool alwaysReport = false; // set this to true to get additional debugging
if (alwaysReport || auditFailed) { if (alwaysReport || auditFailed) {
qDebug("%s... auditChildren() %s <<<< \n", label, (auditFailed ? "FAILED" : "PASSED")); qDebug("%s... auditChildren() %s <<<<", label, (auditFailed ? "FAILED" : "PASSED"));
qDebug(" _childrenExternal=%s\n", debug::valueOf(_childrenExternal)); qDebug(" _childrenExternal=%s", debug::valueOf(_childrenExternal));
qDebug(" childCount=%d\n", getChildCount()); qDebug(" childCount=%d", getChildCount());
qDebug(" _childBitmask=");
outputBits(_childBitmask); QDebug bitOutput = qDebug().nospace();
bitOutput << " _childBitmask=";
outputBits(_childBitmask, bitOutput);
for (int childIndex = 0; childIndex < NUMBER_OF_CHILDREN; childIndex++) { for (int childIndex = 0; childIndex < NUMBER_OF_CHILDREN; childIndex++) {
OctreeElement* testChildNew = getChildAtIndex(childIndex); OctreeElement* testChildNew = getChildAtIndex(childIndex);
OctreeElement* testChildOld = _childrenArray[childIndex]; OctreeElement* testChildOld = _childrenArray[childIndex];
qDebug("child at index %d... testChildOld=%p testChildNew=%p %s \n", qDebug("child at index %d... testChildOld=%p testChildNew=%p %s",
childIndex, testChildOld, testChildNew , childIndex, testChildOld, testChildNew ,
((testChildNew != testChildOld) ? " DOES NOT MATCH <<<< BAD <<<<" : " - OK ") ((testChildNew != testChildOld) ? " DOES NOT MATCH <<<< BAD <<<<" : " - OK ")
); );
} }
qDebug("%s... auditChildren() <<<< DONE <<<< \n", label); qDebug("%s... auditChildren() <<<< DONE <<<<", label);
} }
} }
#endif // def HAS_AUDIT_CHILDREN #endif // def HAS_AUDIT_CHILDREN
@ -410,7 +412,8 @@ OctreeElement* OctreeElement::getChildAtIndex(int childIndex) const {
if (externalIndex < childCount && externalIndex >= 0) { if (externalIndex < childCount && externalIndex >= 0) {
result = _children.external[externalIndex]; result = _children.external[externalIndex];
} else { } else {
qDebug("getChildAtIndex() attempt to access external client out of bounds externalIndex=%d <<<<<<<<<< WARNING!!! \n",externalIndex); qDebug("getChildAtIndex() attempt to access external client out of bounds externalIndex=%d <<<<<<<<<< WARNING!!!
",externalIndex);
} }
break; break;
} }
@ -420,7 +423,7 @@ OctreeElement* OctreeElement::getChildAtIndex(int childIndex) const {
} }
#ifdef HAS_AUDIT_CHILDREN #ifdef HAS_AUDIT_CHILDREN
if (result != _childrenArray[childIndex]) { if (result != _childrenArray[childIndex]) {
qDebug("getChildAtIndex() case:%s result<%p> != _childrenArray[childIndex]<%p> <<<<<<<<<< WARNING!!! \n", qDebug("getChildAtIndex() case:%s result<%p> != _childrenArray[childIndex]<%p> <<<<<<<<<< WARNING!!!",
caseStr, result,_childrenArray[childIndex]); caseStr, result,_childrenArray[childIndex]);
} }
#endif // def HAS_AUDIT_CHILDREN #endif // def HAS_AUDIT_CHILDREN
@ -1083,7 +1086,7 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
_externalChildrenMemoryUsage += newChildCount * sizeof(OctreeElement*); _externalChildrenMemoryUsage += newChildCount * sizeof(OctreeElement*);
} else { } else {
//assert(false); //assert(false);
qDebug("THIS SHOULD NOT HAPPEN previousChildCount == %d && newChildCount == %d\n",previousChildCount, newChildCount); qDebug("THIS SHOULD NOT HAPPEN previousChildCount == %d && newChildCount == %d",previousChildCount, newChildCount);
} }
// check to see if we could store these 4 children locally // check to see if we could store these 4 children locally
@ -1123,7 +1126,7 @@ OctreeElement* OctreeElement::addChildAtIndex(int childIndex) {
bool OctreeElement::safeDeepDeleteChildAtIndex(int childIndex, int recursionCount) { bool OctreeElement::safeDeepDeleteChildAtIndex(int childIndex, int recursionCount) {
bool deleteApproved = false; bool deleteApproved = false;
if (recursionCount > DANGEROUSLY_DEEP_RECURSION) { if (recursionCount > DANGEROUSLY_DEEP_RECURSION) {
qDebug() << "OctreeElement::safeDeepDeleteChildAtIndex() reached DANGEROUSLY_DEEP_RECURSION, bailing!\n"; qDebug() << "OctreeElement::safeDeepDeleteChildAtIndex() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return deleteApproved; return deleteApproved;
} }
OctreeElement* childToDelete = getChildAtIndex(childIndex); OctreeElement* childToDelete = getChildAtIndex(childIndex);
@ -1163,12 +1166,16 @@ void OctreeElement::printDebugDetails(const char* label) const {
} }
} }
qDebug("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isDirty=%s shouldRender=%s\n children=", label, QDebug elementDebug = qDebug().nospace();
_box.getCorner().x, _box.getCorner().y, _box.getCorner().z, _box.getScale(),
debug::valueOf(isLeaf()), debug::valueOf(isDirty()), debug::valueOf(getShouldRender()));
outputBits(childBits, false); QString resultString;
qDebug("\n octalCode="); resultString.sprintf("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isDirty=%s shouldRender=%s\n children=", label,
_box.getCorner().x, _box.getCorner().y, _box.getCorner().z, _box.getScale(),
debug::valueOf(isLeaf()), debug::valueOf(isDirty()), debug::valueOf(getShouldRender()));
elementDebug << resultString;
outputBits(childBits, &elementDebug);
qDebug("octalCode=");
printOctalCode(getOctalCode()); printOctalCode(getOctalCode());
} }

View file

@ -26,7 +26,7 @@ bool OctreePersistThread::process() {
if (!_initialLoadComplete) { if (!_initialLoadComplete) {
uint64_t loadStarted = usecTimestampNow(); uint64_t loadStarted = usecTimestampNow();
qDebug() << "loading Octrees from file: " << _filename << "...\n"; qDebug() << "loading Octrees from file: " << _filename << "...";
bool persistantFileRead; bool persistantFileRead;
@ -42,20 +42,20 @@ bool OctreePersistThread::process() {
_loadTimeUSecs = loadDone - loadStarted; _loadTimeUSecs = loadDone - loadStarted;
_tree->clearDirtyBit(); // the tree is clean since we just loaded it _tree->clearDirtyBit(); // the tree is clean since we just loaded it
qDebug("DONE loading Octrees from file... fileRead=%s\n", debug::valueOf(persistantFileRead)); qDebug("DONE loading Octrees from file... fileRead=%s", debug::valueOf(persistantFileRead));
unsigned long nodeCount = OctreeElement::getNodeCount(); unsigned long nodeCount = OctreeElement::getNodeCount();
unsigned long internalNodeCount = OctreeElement::getInternalNodeCount(); unsigned long internalNodeCount = OctreeElement::getInternalNodeCount();
unsigned long leafNodeCount = OctreeElement::getLeafNodeCount(); unsigned long leafNodeCount = OctreeElement::getLeafNodeCount();
qDebug("Nodes after loading scene %lu nodes %lu internal %lu leaves\n", nodeCount, internalNodeCount, leafNodeCount); qDebug("Nodes after loading scene %lu nodes %lu internal %lu leaves", nodeCount, internalNodeCount, leafNodeCount);
double usecPerGet = (double)OctreeElement::getGetChildAtIndexTime() / (double)OctreeElement::getGetChildAtIndexCalls(); double usecPerGet = (double)OctreeElement::getGetChildAtIndexTime() / (double)OctreeElement::getGetChildAtIndexCalls();
qDebug() << "getChildAtIndexCalls=" << OctreeElement::getGetChildAtIndexCalls() qDebug() << "getChildAtIndexCalls=" << OctreeElement::getGetChildAtIndexCalls()
<< " getChildAtIndexTime=" << OctreeElement::getGetChildAtIndexTime() << " perGet=" << usecPerGet << " \n"; << " getChildAtIndexTime=" << OctreeElement::getGetChildAtIndexTime() << " perGet=" << usecPerGet;
double usecPerSet = (double)OctreeElement::getSetChildAtIndexTime() / (double)OctreeElement::getSetChildAtIndexCalls(); double usecPerSet = (double)OctreeElement::getSetChildAtIndexTime() / (double)OctreeElement::getSetChildAtIndexCalls();
qDebug() << "setChildAtIndexCalls=" << OctreeElement::getSetChildAtIndexCalls() qDebug() << "setChildAtIndexCalls=" << OctreeElement::getSetChildAtIndexCalls()
<< " setChildAtIndexTime=" << OctreeElement::getSetChildAtIndexTime() << " perset=" << usecPerSet << " \n"; << " setChildAtIndexTime=" << OctreeElement::getSetChildAtIndexTime() << " perset=" << usecPerSet;
_initialLoadComplete = true; _initialLoadComplete = true;
_lastCheck = usecTimestampNow(); // we just loaded, no need to save again _lastCheck = usecTimestampNow(); // we just loaded, no need to save again
@ -81,10 +81,10 @@ bool OctreePersistThread::process() {
// check the dirty bit and persist here... // check the dirty bit and persist here...
_lastCheck = usecTimestampNow(); _lastCheck = usecTimestampNow();
if (_tree->isDirty()) { if (_tree->isDirty()) {
qDebug() << "saving Octrees to file " << _filename << "...\n"; qDebug() << "saving Octrees to file " << _filename << "...";
_tree->writeToSVOFile(_filename.toLocal8Bit().constData()); _tree->writeToSVOFile(_filename.toLocal8Bit().constData());
_tree->clearDirtyBit(); // tree is clean after saving _tree->clearDirtyBit(); // tree is clean after saving
qDebug("DONE saving Octrees to file...\n"); qDebug("DONE saving Octrees to file...");
} }
} }
} }

View file

@ -90,13 +90,9 @@ void BoundingBox::explandToInclude(const BoundingBox& box) {
void BoundingBox::printDebugDetails(const char* label) const { void BoundingBox::printDebugDetails(const char* label) const {
if (label) { qDebug("%s _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]",
qDebug() << label; (label ? label : "BoundingBox"),
} else { debug::valueOf(_set), corner.x, corner.y, size.x, size.y, corner.x, corner.y, corner.x+size.x, corner.y+size.y);
qDebug("BoundingBox");
}
qDebug("\n _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]\n",
debug::valueOf(_set), corner.x, corner.y, size.x, size.y, corner.x, corner.y, corner.x+size.x, corner.y+size.y);
} }

View file

@ -65,10 +65,9 @@ void OctreeRenderer::processDatagram(const QByteArray& dataByteArray, const Hifi
if (extraDebugging) { if (extraDebugging) {
qDebug("OctreeRenderer::processDatagram() ... Got Packet Section" qDebug("OctreeRenderer::processDatagram() ... Got Packet Section"
" color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%d" " color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%d",
"\n", debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed),
debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed), sequence, flightTime, packetLength, dataBytes);
sequence, flightTime, packetLength, dataBytes);
} }
int subsection = 1; int subsection = 1;
@ -96,9 +95,10 @@ void OctreeRenderer::processDatagram(const QByteArray& dataByteArray, const Hifi
if (extraDebugging) { if (extraDebugging) {
qDebug("OctreeRenderer::processDatagram() ... Got Packet Section" qDebug("OctreeRenderer::processDatagram() ... Got Packet Section"
" color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%d" " color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%d"
" subsection:%d sectionLength:%d uncompressed:%d\n", " subsection:%d sectionLength:%d uncompressed:%d",
debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed), debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed),
sequence, flightTime, packetLength, dataBytes, subsection, sectionLength, packetData.getUncompressedSize()); sequence, flightTime, packetLength, dataBytes, subsection, sectionLength,
packetData.getUncompressedSize());
} }
_tree->readBitstreamToTree(packetData.getUncompressedData(), packetData.getUncompressedSize(), args); _tree->readBitstreamToTree(packetData.getUncompressedData(), packetData.getUncompressedSize(), args);
_tree->unlock(); _tree->unlock();

View file

@ -624,52 +624,51 @@ int OctreeSceneStats::unpackFromMessage(unsigned char* sourceBuffer, int availab
void OctreeSceneStats::printDebugDetails() { void OctreeSceneStats::printDebugDetails() {
qDebug("\n------------------------------\n"); qDebug("\n------------------------------");
qDebug("OctreeSceneStats:\n"); qDebug("OctreeSceneStats:");
qDebug(" start : %llu \n", (long long unsigned int)_start); qDebug(" start : %llu", (long long unsigned int)_start);
qDebug(" end : %llu \n", (long long unsigned int)_end); qDebug(" end : %llu", (long long unsigned int)_end);
qDebug(" elapsed : %llu \n", (long long unsigned int)_elapsed); qDebug(" elapsed : %llu", (long long unsigned int)_elapsed);
qDebug(" encoding : %llu \n", (long long unsigned int)_totalEncodeTime); qDebug(" encoding : %llu", (long long unsigned int)_totalEncodeTime);
qDebug("\n"); qDebug();
qDebug(" full scene: %s\n", debug::valueOf(_isFullScene)); qDebug(" full scene: %s", debug::valueOf(_isFullScene));
qDebug(" moving: %s\n", debug::valueOf(_isMoving)); qDebug(" moving: %s", debug::valueOf(_isMoving));
qDebug("\n"); qDebug();
qDebug(" packets: %d\n", _packets); qDebug(" packets: %d", _packets);
qDebug(" bytes : %ld\n", _bytes); qDebug(" bytes : %ld", _bytes);
qDebug("\n"); qDebug();
qDebug(" total elements : %lu\n", _totalElements ); qDebug(" total elements : %lu", _totalElements );
qDebug(" internal : %lu\n", _totalInternal ); qDebug(" internal : %lu", _totalInternal );
qDebug(" leaves : %lu\n", _totalLeaves ); qDebug(" leaves : %lu", _totalLeaves );
qDebug(" traversed : %lu\n", _traversed ); qDebug(" traversed : %lu", _traversed );
qDebug(" internal : %lu\n", _internal ); qDebug(" internal : %lu", _internal );
qDebug(" leaves : %lu\n", _leaves ); qDebug(" leaves : %lu", _leaves );
qDebug(" skipped distance : %lu\n", _skippedDistance ); qDebug(" skipped distance : %lu", _skippedDistance );
qDebug(" internal : %lu\n", _internalSkippedDistance ); qDebug(" internal : %lu", _internalSkippedDistance );
qDebug(" leaves : %lu\n", _leavesSkippedDistance ); qDebug(" leaves : %lu", _leavesSkippedDistance );
qDebug(" skipped out of view : %lu\n", _skippedOutOfView ); qDebug(" skipped out of view : %lu", _skippedOutOfView );
qDebug(" internal : %lu\n", _internalSkippedOutOfView ); qDebug(" internal : %lu", _internalSkippedOutOfView );
qDebug(" leaves : %lu\n", _leavesSkippedOutOfView ); qDebug(" leaves : %lu", _leavesSkippedOutOfView );
qDebug(" skipped was in view : %lu\n", _skippedWasInView ); qDebug(" skipped was in view : %lu", _skippedWasInView );
qDebug(" internal : %lu\n", _internalSkippedWasInView ); qDebug(" internal : %lu", _internalSkippedWasInView );
qDebug(" leaves : %lu\n", _leavesSkippedWasInView ); qDebug(" leaves : %lu", _leavesSkippedWasInView );
qDebug(" skipped no change : %lu\n", _skippedNoChange ); qDebug(" skipped no change : %lu", _skippedNoChange );
qDebug(" internal : %lu\n", _internalSkippedNoChange ); qDebug(" internal : %lu", _internalSkippedNoChange );
qDebug(" leaves : %lu\n", _leavesSkippedNoChange ); qDebug(" leaves : %lu", _leavesSkippedNoChange );
qDebug(" skipped occluded : %lu\n", _skippedOccluded ); qDebug(" skipped occluded : %lu", _skippedOccluded );
qDebug(" internal : %lu\n", _internalSkippedOccluded ); qDebug(" internal : %lu", _internalSkippedOccluded );
qDebug(" leaves : %lu\n", _leavesSkippedOccluded ); qDebug(" leaves : %lu", _leavesSkippedOccluded );
qDebug();
qDebug("\n"); qDebug(" color sent : %lu", _colorSent );
qDebug(" color sent : %lu\n", _colorSent ); qDebug(" internal : %lu", _internalColorSent );
qDebug(" internal : %lu\n", _internalColorSent ); qDebug(" leaves : %lu", _leavesColorSent );
qDebug(" leaves : %lu\n", _leavesColorSent ); qDebug(" Didn't Fit : %lu", _didntFit );
qDebug(" Didn't Fit : %lu\n", _didntFit ); qDebug(" internal : %lu", _internalDidntFit );
qDebug(" internal : %lu\n", _internalDidntFit ); qDebug(" leaves : %lu", _leavesDidntFit );
qDebug(" leaves : %lu\n", _leavesDidntFit ); qDebug(" color bits : %lu", _colorBitsWritten );
qDebug(" color bits : %lu\n", _colorBitsWritten ); qDebug(" exists bits : %lu", _existsBitsWritten );
qDebug(" exists bits : %lu\n", _existsBitsWritten ); qDebug(" in packet bit : %lu", _existsInPacketBitsWritten);
qDebug(" in packet bit : %lu\n", _existsInPacketBitsWritten); qDebug(" trees removed : %lu", _treesRemoved );
qDebug(" trees removed : %lu\n", _treesRemoved );
} }
OctreeSceneStats::ItemInfo OctreeSceneStats::_ITEMS[] = { OctreeSceneStats::ItemInfo OctreeSceneStats::_ITEMS[] = {

View file

@ -326,43 +326,43 @@ bool ViewFrustum::matches(const ViewFrustum& compareTo, bool debug) const {
testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation); testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation);
if (!result && debug) { if (!result && debug) {
qDebug("ViewFrustum::matches()... result=%s\n", debug::valueOf(result)); qDebug("ViewFrustum::matches()... result=%s", debug::valueOf(result));
qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f\n", qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f",
(testMatches(compareTo._position,_position) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._position,_position) ? "MATCHES " : "NO MATCH"),
compareTo._position.x, compareTo._position.y, compareTo._position.z, compareTo._position.x, compareTo._position.y, compareTo._position.z,
_position.x, _position.y, _position.z ); _position.x, _position.y, _position.z );
qDebug("%s -- compareTo._direction=%f,%f,%f _direction=%f,%f,%f\n", qDebug("%s -- compareTo._direction=%f,%f,%f _direction=%f,%f,%f",
(testMatches(compareTo._direction, _direction) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._direction, _direction) ? "MATCHES " : "NO MATCH"),
compareTo._direction.x, compareTo._direction.y, compareTo._direction.z, compareTo._direction.x, compareTo._direction.y, compareTo._direction.z,
_direction.x, _direction.y, _direction.z ); _direction.x, _direction.y, _direction.z );
qDebug("%s -- compareTo._up=%f,%f,%f _up=%f,%f,%f\n", qDebug("%s -- compareTo._up=%f,%f,%f _up=%f,%f,%f",
(testMatches(compareTo._up, _up) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._up, _up) ? "MATCHES " : "NO MATCH"),
compareTo._up.x, compareTo._up.y, compareTo._up.z, compareTo._up.x, compareTo._up.y, compareTo._up.z,
_up.x, _up.y, _up.z ); _up.x, _up.y, _up.z );
qDebug("%s -- compareTo._right=%f,%f,%f _right=%f,%f,%f\n", qDebug("%s -- compareTo._right=%f,%f,%f _right=%f,%f,%f",
(testMatches(compareTo._right, _right) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._right, _right) ? "MATCHES " : "NO MATCH"),
compareTo._right.x, compareTo._right.y, compareTo._right.z, compareTo._right.x, compareTo._right.y, compareTo._right.z,
_right.x, _right.y, _right.z ); _right.x, _right.y, _right.z );
qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f\n", qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f",
(testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"),
compareTo._fieldOfView, _fieldOfView); compareTo._fieldOfView, _fieldOfView);
qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f\n", qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f",
(testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"),
compareTo._aspectRatio, _aspectRatio); compareTo._aspectRatio, _aspectRatio);
qDebug("%s -- compareTo._nearClip=%f _nearClip=%f\n", qDebug("%s -- compareTo._nearClip=%f _nearClip=%f",
(testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"),
compareTo._nearClip, _nearClip); compareTo._nearClip, _nearClip);
qDebug("%s -- compareTo._farClip=%f _farClip=%f\n", qDebug("%s -- compareTo._farClip=%f _farClip=%f",
(testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"),
compareTo._farClip, _farClip); compareTo._farClip, _farClip);
qDebug("%s -- compareTo._focalLength=%f _focalLength=%f\n", qDebug("%s -- compareTo._focalLength=%f _focalLength=%f",
(testMatches(compareTo._focalLength, _focalLength) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._focalLength, _focalLength) ? "MATCHES " : "NO MATCH"),
compareTo._focalLength, _focalLength); compareTo._focalLength, _focalLength);
qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f\n", qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f",
(testMatches(compareTo._eyeOffsetPosition, _eyeOffsetPosition) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._eyeOffsetPosition, _eyeOffsetPosition) ? "MATCHES " : "NO MATCH"),
compareTo._eyeOffsetPosition.x, compareTo._eyeOffsetPosition.y, compareTo._eyeOffsetPosition.z, compareTo._eyeOffsetPosition.x, compareTo._eyeOffsetPosition.y, compareTo._eyeOffsetPosition.z,
_eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z); _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z);
qDebug("%s -- compareTo._eyeOffsetOrientation=%f,%f,%f,%f _eyeOffsetOrientation=%f,%f,%f,%f\n", qDebug("%s -- compareTo._eyeOffsetOrientation=%f,%f,%f,%f _eyeOffsetOrientation=%f,%f,%f,%f",
(testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation) ? "MATCHES " : "NO MATCH"),
compareTo._eyeOffsetOrientation.x, compareTo._eyeOffsetOrientation.y, compareTo._eyeOffsetOrientation.x, compareTo._eyeOffsetOrientation.y,
compareTo._eyeOffsetOrientation.z, compareTo._eyeOffsetOrientation.w, compareTo._eyeOffsetOrientation.z, compareTo._eyeOffsetOrientation.w,
@ -413,45 +413,45 @@ bool ViewFrustum::isVerySimilar(const ViewFrustum& compareTo, bool debug) const
if (!result && debug) { if (!result && debug) {
qDebug("ViewFrustum::isVerySimilar()... result=%s\n", debug::valueOf(result)); qDebug("ViewFrustum::isVerySimilar()... result=%s\n", debug::valueOf(result));
qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f\n", qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f",
(testMatches(compareTo._position,_position, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"), (testMatches(compareTo._position,_position, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
compareTo._position.x, compareTo._position.y, compareTo._position.z, compareTo._position.x, compareTo._position.y, compareTo._position.z,
_position.x, _position.y, _position.z ); _position.x, _position.y, _position.z );
qDebug("%s -- positionDistance=%f\n", qDebug("%s -- positionDistance=%f",
(testMatches(0,positionDistance, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"), (testMatches(0,positionDistance, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
positionDistance); positionDistance);
qDebug("%s -- angleOrientation=%f\n", qDebug("%s -- angleOrientation=%f",
(testMatches(0, angleOrientation, ORIENTATION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"), (testMatches(0, angleOrientation, ORIENTATION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
angleOrientation); angleOrientation);
qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f\n", qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f",
(testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"),
compareTo._fieldOfView, _fieldOfView); compareTo._fieldOfView, _fieldOfView);
qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f\n", qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f",
(testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"),
compareTo._aspectRatio, _aspectRatio); compareTo._aspectRatio, _aspectRatio);
qDebug("%s -- compareTo._nearClip=%f _nearClip=%f\n", qDebug("%s -- compareTo._nearClip=%f _nearClip=%f",
(testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"),
compareTo._nearClip, _nearClip); compareTo._nearClip, _nearClip);
qDebug("%s -- compareTo._farClip=%f _farClip=%f\n", qDebug("%s -- compareTo._farClip=%f _farClip=%f",
(testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"),
compareTo._farClip, _farClip); compareTo._farClip, _farClip);
qDebug("%s -- compareTo._focalLength=%f _focalLength=%f\n", qDebug("%s -- compareTo._focalLength=%f _focalLength=%f",
(testMatches(compareTo._focalLength, _focalLength) ? "MATCHES " : "NO MATCH"), (testMatches(compareTo._focalLength, _focalLength) ? "MATCHES " : "NO MATCH"),
compareTo._focalLength, _focalLength); compareTo._focalLength, _focalLength);
qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f\n", qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f",
(testMatches(compareTo._eyeOffsetPosition, _eyeOffsetPosition, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"), (testMatches(compareTo._eyeOffsetPosition, _eyeOffsetPosition, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
compareTo._eyeOffsetPosition.x, compareTo._eyeOffsetPosition.y, compareTo._eyeOffsetPosition.z, compareTo._eyeOffsetPosition.x, compareTo._eyeOffsetPosition.y, compareTo._eyeOffsetPosition.z,
_eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z); _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z);
qDebug("%s -- eyeOffsetpositionDistance=%f\n", qDebug("%s -- eyeOffsetpositionDistance=%f",
(testMatches(0,eyeOffsetpositionDistance, EYEOFFSET_POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"), (testMatches(0,eyeOffsetpositionDistance, EYEOFFSET_POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
eyeOffsetpositionDistance); eyeOffsetpositionDistance);
qDebug("%s -- angleEyeOffsetOrientation=%f\n", qDebug("%s -- angleEyeOffsetOrientation=%f",
(testMatches(0, angleEyeOffsetOrientation, ORIENTATION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"), (testMatches(0, angleEyeOffsetOrientation, ORIENTATION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
angleEyeOffsetOrientation); angleEyeOffsetOrientation);
} }
@ -518,19 +518,19 @@ void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom
} }
void ViewFrustum::printDebugDetails() const { void ViewFrustum::printDebugDetails() const {
qDebug("ViewFrustum::printDebugDetails()... \n"); qDebug("ViewFrustum::printDebugDetails()...");
qDebug("_position=%f,%f,%f\n", _position.x, _position.y, _position.z ); qDebug("_position=%f,%f,%f", _position.x, _position.y, _position.z );
qDebug("_direction=%f,%f,%f\n", _direction.x, _direction.y, _direction.z ); qDebug("_direction=%f,%f,%f", _direction.x, _direction.y, _direction.z );
qDebug("_up=%f,%f,%f\n", _up.x, _up.y, _up.z ); qDebug("_up=%f,%f,%f", _up.x, _up.y, _up.z );
qDebug("_right=%f,%f,%f\n", _right.x, _right.y, _right.z ); qDebug("_right=%f,%f,%f", _right.x, _right.y, _right.z );
qDebug("_fieldOfView=%f\n", _fieldOfView); qDebug("_fieldOfView=%f", _fieldOfView);
qDebug("_aspectRatio=%f\n", _aspectRatio); qDebug("_aspectRatio=%f", _aspectRatio);
qDebug("_keyHoleRadius=%f\n", _keyholeRadius); qDebug("_keyHoleRadius=%f", _keyholeRadius);
qDebug("_nearClip=%f\n", _nearClip); qDebug("_nearClip=%f", _nearClip);
qDebug("_farClip=%f\n", _farClip); qDebug("_farClip=%f", _farClip);
qDebug("_focalLength=%f\n", _focalLength); qDebug("_focalLength=%f", _focalLength);
qDebug("_eyeOffsetPosition=%f,%f,%f\n", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z ); qDebug("_eyeOffsetPosition=%f,%f,%f", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z );
qDebug("_eyeOffsetOrientation=%f,%f,%f,%f\n", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z, qDebug("_eyeOffsetOrientation=%f,%f,%f,%f", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z,
_eyeOffsetOrientation.w ); _eyeOffsetOrientation.w );
} }

View file

@ -467,10 +467,10 @@ void Particle::adjustEditPacketForClockSkew(unsigned char* codeColorBuffer, ssiz
memcpy(dataAt, &lastEditedInServerTime, sizeof(lastEditedInServerTime)); memcpy(dataAt, &lastEditedInServerTime, sizeof(lastEditedInServerTime));
const bool wantDebug = false; const bool wantDebug = false;
if (wantDebug) { if (wantDebug) {
qDebug("Particle::adjustEditPacketForClockSkew()...\n"); qDebug("Particle::adjustEditPacketForClockSkew()...");
qDebug() << " lastEditedInLocalTime: " << lastEditedInLocalTime << "\n"; qDebug() << " lastEditedInLocalTime: " << lastEditedInLocalTime;
qDebug() << " clockSkew: " << clockSkew << "\n"; qDebug() << " clockSkew: " << clockSkew;
qDebug() << " lastEditedInServerTime: " << lastEditedInServerTime << "\n"; qDebug() << " lastEditedInServerTime: " << lastEditedInServerTime;
} }
} }

View file

@ -6,8 +6,6 @@
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. // Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
// //
#include <QtCore/QDebug>
#include <GeometryUtil.h> #include <GeometryUtil.h>
#include "ParticleTree.h" #include "ParticleTree.h"

View file

@ -145,11 +145,11 @@ void ScriptEngine::evaluate() {
} }
QScriptValue result = _engine.evaluate(_scriptContents); QScriptValue result = _engine.evaluate(_scriptContents);
qDebug() << "Evaluated script.\n"; qDebug("Evaluated script.");
if (_engine.hasUncaughtException()) { if (_engine.hasUncaughtException()) {
int line = _engine.uncaughtExceptionLineNumber(); int line = _engine.uncaughtExceptionLineNumber();
qDebug() << "Uncaught exception at line" << line << ":" << result.toString() << "\n"; qDebug() << "Uncaught exception at line" << line << ":" << result.toString();
} }
} }
@ -160,11 +160,11 @@ void ScriptEngine::run() {
_isRunning = true; _isRunning = true;
QScriptValue result = _engine.evaluate(_scriptContents); QScriptValue result = _engine.evaluate(_scriptContents);
qDebug() << "Evaluated script.\n"; qDebug("Evaluated script");
if (_engine.hasUncaughtException()) { if (_engine.hasUncaughtException()) {
int line = _engine.uncaughtExceptionLineNumber(); int line = _engine.uncaughtExceptionLineNumber();
qDebug() << "Uncaught exception at line" << line << ":" << result.toString() << "\n"; qDebug() << "Uncaught exception at line" << line << ":" << result.toString();
} }
timeval startTime; timeval startTime;
@ -221,7 +221,7 @@ void ScriptEngine::run() {
if (_engine.hasUncaughtException()) { if (_engine.hasUncaughtException()) {
int line = _engine.uncaughtExceptionLineNumber(); int line = _engine.uncaughtExceptionLineNumber();
qDebug() << "Uncaught exception at line" << line << ":" << _engine.uncaughtException().toString() << "\n"; qDebug() << "Uncaught exception at line" << line << ":" << _engine.uncaughtException().toString();
} }
} }
cleanMenuItems(); cleanMenuItems();

View file

@ -149,7 +149,7 @@ void Assignment::swap(Assignment& otherAssignment) {
void Assignment::setPayload(const uchar* payload, int numBytes) { void Assignment::setPayload(const uchar* payload, int numBytes) {
if (numBytes > MAX_PAYLOAD_BYTES) { if (numBytes > MAX_PAYLOAD_BYTES) {
qDebug("Set payload called with number of bytes greater than maximum (%d). Will only transfer %d bytes.\n", qDebug("Set payload called with number of bytes greater than maximum (%d). Will only transfer %d bytes.",
MAX_PAYLOAD_BYTES, MAX_PAYLOAD_BYTES,
MAX_PAYLOAD_BYTES); MAX_PAYLOAD_BYTES);

View file

@ -7,8 +7,6 @@
#include <cstring> #include <cstring>
#include <QtCore/QDebug>
#include "SharedUtil.h" #include "SharedUtil.h"
#include "GeometryUtil.h" #include "GeometryUtil.h"

View file

@ -98,7 +98,7 @@ quint32 getHostOrderLocalAddress() {
foreach(const QNetworkAddressEntry &entry, interface.addressEntries()) { foreach(const QNetworkAddressEntry &entry, interface.addressEntries()) {
// make sure it's an IPv4 address that isn't the loopback // make sure it's an IPv4 address that isn't the loopback
if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol && !entry.ip().isLoopback()) { if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol && !entry.ip().isLoopback()) {
qDebug("Node's local address is %s\n", entry.ip().toString().toLocal8Bit().constData()); qDebug("Node's local address is %s", entry.ip().toString().toLocal8Bit().constData());
// set our localAddress and break out // set our localAddress and break out
localAddress = entry.ip().toIPv4Address(); localAddress = entry.ip().toIPv4Address();

View file

@ -117,5 +117,5 @@ void Logging::verboseMessageHandler(QtMsgType type, const QMessageLogContext& co
prefixString.append(QString(" [%1]").arg(Logging::targetName)); prefixString.append(QString(" [%1]").arg(Logging::targetName));
} }
fprintf(stdout, "%s %s", prefixString.toLocal8Bit().constData(), message.toLocal8Bit().constData()); fprintf(stdout, "%s %s\n", prefixString.toLocal8Bit().constData(), message.toLocal8Bit().constData());
} }

View file

@ -29,7 +29,7 @@ void NetworkPacket::copyContents(const HifiSockAddr& sockAddr, const unsigned ch
_packetLength = packetLength; _packetLength = packetLength;
memcpy(&_packetData[0], packetData, packetLength); memcpy(&_packetData[0], packetData, packetLength);
} else { } else {
qDebug(">>> NetworkPacket::copyContents() unexpected length=%lu\n",packetLength); qDebug(">>> NetworkPacket::copyContents() unexpected length=%lu",packetLength);
} }
} }

View file

@ -107,12 +107,12 @@ void Node::setLocalSocket(const HifiSockAddr& localSocket) {
} }
void Node::activateLocalSocket() { void Node::activateLocalSocket() {
qDebug() << "Activating local socket for node" << *this << "\n"; qDebug() << "Activating local socket for node" << *this;
_activeSocket = &_localSocket; _activeSocket = &_localSocket;
} }
void Node::activatePublicSocket() { void Node::activatePublicSocket() {
qDebug() << "Activating public socket for node" << *this << "\n"; qDebug() << "Activating public socket for node" << *this;
_activeSocket = &_publicSocket; _activeSocket = &_publicSocket;
} }

View file

@ -67,7 +67,7 @@ NodeList::NodeList(char newOwnerType, unsigned short int newSocketListenPort) :
_stunRequestsSinceSuccess(0) _stunRequestsSinceSuccess(0)
{ {
_nodeSocket.bind(QHostAddress::AnyIPv4, newSocketListenPort); _nodeSocket.bind(QHostAddress::AnyIPv4, newSocketListenPort);
qDebug() << "NodeList socket is listening on" << _nodeSocket.localPort() << "\n"; qDebug() << "NodeList socket is listening on" << _nodeSocket.localPort();
} }
NodeList::~NodeList() { NodeList::~NodeList() {
@ -90,7 +90,7 @@ void NodeList::setDomainHostname(const QString& domainHostname) {
// grab the port by reading the string after the colon // grab the port by reading the string after the colon
_domainSockAddr.setPort(atoi(domainHostname.mid(colonIndex + 1, domainHostname.size()).toLocal8Bit().constData())); _domainSockAddr.setPort(atoi(domainHostname.mid(colonIndex + 1, domainHostname.size()).toLocal8Bit().constData()));
qDebug() << "Updated hostname to" << _domainHostname << "and port to" << _domainSockAddr.getPort() << "\n"; qDebug() << "Updated hostname to" << _domainHostname << "and port to" << _domainSockAddr.getPort();
} else { } else {
// no port included with the hostname, simply set the member variable and reset the domain server port to default // no port included with the hostname, simply set the member variable and reset the domain server port to default
@ -137,7 +137,7 @@ void NodeList::timePingReply(const HifiSockAddr& nodeAddress, unsigned char *pac
" oneWayFlightTime: " << oneWayFlightTime << "\n" << " oneWayFlightTime: " << oneWayFlightTime << "\n" <<
" othersReplyTime: " << othersReplyTime << "\n" << " othersReplyTime: " << othersReplyTime << "\n" <<
" othersExprectedReply: " << othersExprectedReply << "\n" << " othersExprectedReply: " << othersExprectedReply << "\n" <<
" clockSkew: " << clockSkew << "\n"; " clockSkew: " << clockSkew;
} }
break; break;
} }
@ -286,7 +286,7 @@ int NodeList::getNumAliveNodes() const {
} }
void NodeList::clear() { void NodeList::clear() {
qDebug() << "Clearing the NodeList. Deleting all nodes in list.\n"; qDebug() << "Clearing the NodeList. Deleting all nodes in list.";
// delete all of the nodes in the list, set the pointers back to NULL and the number of nodes to 0 // delete all of the nodes in the list, set the pointers back to NULL and the number of nodes to 0
for (int i = 0; i < _numNodes; i++) { for (int i = 0; i < _numNodes; i++) {
@ -358,7 +358,7 @@ void NodeList::sendSTUNRequest() {
static HifiSockAddr stunSockAddr(STUN_SERVER_HOSTNAME, STUN_SERVER_PORT); static HifiSockAddr stunSockAddr(STUN_SERVER_HOSTNAME, STUN_SERVER_PORT);
if (!_hasCompletedInitialSTUNFailure) { if (!_hasCompletedInitialSTUNFailure) {
qDebug("Sending intial stun request to %s\n", stunSockAddr.getAddress().toString().toLocal8Bit().constData()); qDebug("Sending intial stun request to %s", stunSockAddr.getAddress().toString().toLocal8Bit().constData());
} }
_nodeSocket.writeDatagram((char*) stunRequestPacket, sizeof(stunRequestPacket), _nodeSocket.writeDatagram((char*) stunRequestPacket, sizeof(stunRequestPacket),
@ -370,7 +370,7 @@ void NodeList::sendSTUNRequest() {
if (!_hasCompletedInitialSTUNFailure) { if (!_hasCompletedInitialSTUNFailure) {
// if we're here this was the last failed STUN request // if we're here this was the last failed STUN request
// use our DS as our stun server // use our DS as our stun server
qDebug("Failed to lookup public address via STUN server at %s:%hu. Using DS for STUN.\n", qDebug("Failed to lookup public address via STUN server at %s:%hu. Using DS for STUN.",
STUN_SERVER_HOSTNAME, STUN_SERVER_PORT); STUN_SERVER_HOSTNAME, STUN_SERVER_PORT);
_hasCompletedInitialSTUNFailure = true; _hasCompletedInitialSTUNFailure = true;
@ -433,7 +433,7 @@ void NodeList::processSTUNResponse(unsigned char* packetData, size_t dataBytes)
if (newPublicAddress != _publicSockAddr.getAddress() || newPublicPort != _publicSockAddr.getPort()) { if (newPublicAddress != _publicSockAddr.getAddress() || newPublicPort != _publicSockAddr.getPort()) {
_publicSockAddr = HifiSockAddr(newPublicAddress, newPublicPort); _publicSockAddr = HifiSockAddr(newPublicAddress, newPublicPort);
qDebug("New public socket received from STUN server is %s:%hu\n", qDebug("New public socket received from STUN server is %s:%hu",
_publicSockAddr.getAddress().toString().toLocal8Bit().constData(), _publicSockAddr.getAddress().toString().toLocal8Bit().constData(),
_publicSockAddr.getPort()); _publicSockAddr.getPort());
@ -494,7 +494,7 @@ void NodeList::sendDomainServerCheckIn() {
// Lookup the IP address of the domain server if we need to // Lookup the IP address of the domain server if we need to
if (_domainSockAddr.getAddress().isNull()) { if (_domainSockAddr.getAddress().isNull()) {
qDebug("Looking up DS hostname %s.\n", _domainHostname.toLocal8Bit().constData()); qDebug("Looking up DS hostname %s.", _domainHostname.toLocal8Bit().constData());
QHostInfo domainServerHostInfo = QHostInfo::fromName(_domainHostname); QHostInfo domainServerHostInfo = QHostInfo::fromName(_domainHostname);
@ -502,7 +502,7 @@ void NodeList::sendDomainServerCheckIn() {
if (domainServerHostInfo.addresses()[i].protocol() == QAbstractSocket::IPv4Protocol) { if (domainServerHostInfo.addresses()[i].protocol() == QAbstractSocket::IPv4Protocol) {
_domainSockAddr.setAddress(domainServerHostInfo.addresses()[i]); _domainSockAddr.setAddress(domainServerHostInfo.addresses()[i]);
qDebug("DS at %s is at %s\n", _domainHostname.toLocal8Bit().constData(), qDebug("DS at %s is at %s", _domainHostname.toLocal8Bit().constData(),
_domainSockAddr.getAddress().toString().toLocal8Bit().constData()); _domainSockAddr.getAddress().toString().toLocal8Bit().constData());
printedDomainServerIP = true; printedDomainServerIP = true;
@ -512,11 +512,11 @@ void NodeList::sendDomainServerCheckIn() {
// if we got here without a break out of the for loop then we failed to lookup the address // if we got here without a break out of the for loop then we failed to lookup the address
if (i == domainServerHostInfo.addresses().size() - 1) { if (i == domainServerHostInfo.addresses().size() - 1) {
qDebug("Failed domain server lookup\n"); qDebug("Failed domain server lookup");
} }
} }
} else if (!printedDomainServerIP) { } else if (!printedDomainServerIP) {
qDebug("Domain Server IP: %s\n", _domainSockAddr.getAddress().toString().toLocal8Bit().constData()); qDebug("Domain Server IP: %s", _domainSockAddr.getAddress().toString().toLocal8Bit().constData());
printedDomainServerIP = true; printedDomainServerIP = true;
} }
@ -713,12 +713,12 @@ Node* NodeList::addOrUpdateNode(const QUuid& uuid, char nodeType,
// check if we need to change this node's public or local sockets // check if we need to change this node's public or local sockets
if (publicSocket != node->getPublicSocket()) { if (publicSocket != node->getPublicSocket()) {
node->setPublicSocket(publicSocket); node->setPublicSocket(publicSocket);
qDebug() << "Public socket change for node" << *node << "\n"; qDebug() << "Public socket change for node" << *node;
} }
if (localSocket != node->getLocalSocket()) { if (localSocket != node->getLocalSocket()) {
node->setLocalSocket(localSocket); node->setLocalSocket(localSocket);
qDebug() << "Local socket change for node" << *node << "\n"; qDebug() << "Local socket change for node" << *node;
} }
node->unlock(); node->unlock();
@ -740,7 +740,7 @@ void NodeList::addNodeToList(Node* newNode) {
++_numNodes; ++_numNodes;
qDebug() << "Added" << *newNode << "\n"; qDebug() << "Added" << *newNode;
notifyHooksOfAddedNode(newNode); notifyHooksOfAddedNode(newNode);
} }
@ -812,7 +812,7 @@ void NodeList::killNode(Node* node, bool mustLockNode) {
node->lock(); node->lock();
} }
qDebug() << "Killed " << *node << "\n"; qDebug() << "Killed " << *node;
notifyHooksOfKilledNode(&*node); notifyHooksOfKilledNode(&*node);

View file

@ -32,12 +32,12 @@ int numberOfThreeBitSectionsInCode(const unsigned char* octalCode, int maxBytes)
void printOctalCode(const unsigned char* octalCode) { void printOctalCode(const unsigned char* octalCode) {
if (!octalCode) { if (!octalCode) {
qDebug("NULL\n"); qDebug("NULL");
} else { } else {
QDebug continuedDebug = qDebug().nospace();
for (int i = 0; i < bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octalCode)); i++) { for (int i = 0; i < bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octalCode)); i++) {
outputBits(octalCode[i],false); outputBits(octalCode[i], &continuedDebug);
} }
qDebug("\n");
} }
} }

View file

@ -70,7 +70,7 @@ bool packetVersionMatch(unsigned char* packetHeader) {
if (packetHeader[1] == versionForPacketType(packetHeader[0]) || packetHeader[0] == PACKET_TYPE_STUN_RESPONSE) { if (packetHeader[1] == versionForPacketType(packetHeader[0]) || packetHeader[0] == PACKET_TYPE_STUN_RESPONSE) {
return true; return true;
} else { } else {
qDebug("There is a packet version mismatch for packet with header %c\n", packetHeader[0]); qDebug("There is a packet version mismatch for packet with header %c", packetHeader[0]);
return false; return false;
} }
} }

View file

@ -59,7 +59,7 @@ PerfStat::~PerfStat() {
} }
if (wantDebugOut) { if (wantDebugOut) {
qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%ld us:%ld ue:%ld t:%ld s:%ld e:%ld\n", qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%ld us:%ld ue:%ld t:%ld s:%ld e:%ld",
this->group.c_str(),elapsed,average,count,totalTime, this->group.c_str(),elapsed,average,count,totalTime,
(long)(end.tv_usec-start.tv_usec), (long)start.tv_usec, (long)end.tv_usec, (long)(end.tv_usec-start.tv_usec), (long)start.tv_usec, (long)end.tv_usec,
(long)(end.tv_sec-start.tv_sec), (long)start.tv_sec, (long)end.tv_sec (long)(end.tv_sec-start.tv_sec), (long)start.tv_sec, (long)end.tv_sec
@ -113,20 +113,20 @@ PerformanceWarning::~PerformanceWarning() {
if ((_alwaysDisplay || _renderWarningsOn) && elapsedmsec > 1) { if ((_alwaysDisplay || _renderWarningsOn) && elapsedmsec > 1) {
if (elapsedmsec > 1000) { if (elapsedmsec > 1000) {
double elapsedsec = (end - _start) / 1000000.0; double elapsedsec = (end - _start) / 1000000.0;
qDebug("%s took %.2lf seconds %s\n", _message, elapsedsec, (_alwaysDisplay ? "" : "WARNING!") ); qDebug("%s took %.2lf seconds %s", _message, elapsedsec, (_alwaysDisplay ? "" : "WARNING!") );
} else { } else {
if (_suppressShortTimings) { if (_suppressShortTimings) {
if (elapsedmsec > 10) { if (elapsedmsec > 10) {
qDebug("%s took %.1lf milliseconds %s\n", _message, elapsedmsec, qDebug("%s took %.1lf milliseconds %s", _message, elapsedmsec,
(_alwaysDisplay || (elapsedmsec < 10) ? "" : "WARNING!")); (_alwaysDisplay || (elapsedmsec < 10) ? "" : "WARNING!"));
} }
} else { } else {
qDebug("%s took %.2lf milliseconds %s\n", _message, elapsedmsec, qDebug("%s took %.2lf milliseconds %s", _message, elapsedmsec,
(_alwaysDisplay || (elapsedmsec < 10) ? "" : "WARNING!")); (_alwaysDisplay || (elapsedmsec < 10) ? "" : "WARNING!"));
} }
} }
} else if (_alwaysDisplay) { } else if (_alwaysDisplay) {
qDebug("%s took %.2lf milliseconds\n", _message, elapsedmsec); qDebug("%s took %.2lf milliseconds", _message, elapsedmsec);
} }
// if the caller gave us a pointer to store the running total, track it now. // if the caller gave us a pointer to store the running total, track it now.
if (_runningTotal) { if (_runningTotal) {

View file

@ -65,30 +65,35 @@ bool shouldDo(float desiredInterval, float deltaTime) {
return randFloat() < deltaTime / desiredInterval; return randFloat() < deltaTime / desiredInterval;
} }
void outputBufferBits(const unsigned char* buffer, int length, bool withNewLine) { void outputBufferBits(const unsigned char* buffer, int length, QDebug* continuedDebug) {
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
outputBits(buffer[i], false); outputBits(buffer[i], continuedDebug);
}
if (withNewLine) {
qDebug("\n");
} }
} }
void outputBits(unsigned char byte, bool withNewLine, bool usePrintf) { void outputBits(unsigned char byte, QDebug* continuedDebug) {
if (isalnum(byte)) { QDebug debug = qDebug().nospace();
usePrintf ? (void)printf("[ %d (%c): ", byte, byte) : qDebug("[ %d (%c): ", byte, byte);
} else { if (continuedDebug) {
usePrintf ? (void)printf("[ %d (0x%x): ", byte, byte) : qDebug("[ %d (0x%x): ", byte, byte); debug = *continuedDebug;
} }
QString resultString;
if (isalnum(byte)) {
resultString.sprintf("[ %d (%c): ", byte, byte);
} else {
resultString.sprintf("[ %d (0x%x): ", byte, byte);
}
debug << resultString;
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
usePrintf ? (void)printf("%d", byte >> (7 - i) & 1) : qDebug("%d", byte >> (7 - i) & 1); resultString.sprintf("%d", byte >> (7 - i) & 1);
} }
usePrintf ? (void)printf(" ] ") : qDebug(" ] ");
if (withNewLine) { debug << resultString;
usePrintf ? (void)printf("\n") : qDebug("\n"); debug << " ]";
}
} }
int numberOfOnes(unsigned char byte) { int numberOfOnes(unsigned char byte) {
@ -465,15 +470,16 @@ void printVoxelCode(unsigned char* voxelCode) {
unsigned int voxelSizeInOctets = (voxelSizeInBits/3); unsigned int voxelSizeInOctets = (voxelSizeInBits/3);
unsigned int voxelBufferSize = voxelSizeInBytes+1+3; // 1 for size, 3 for color unsigned int voxelBufferSize = voxelSizeInBytes+1+3; // 1 for size, 3 for color
qDebug("octets=%d\n",octets); qDebug("octets=%d",octets);
qDebug("voxelSizeInBits=%d\n",voxelSizeInBits); qDebug("voxelSizeInBits=%d",voxelSizeInBits);
qDebug("voxelSizeInBytes=%d\n",voxelSizeInBytes); qDebug("voxelSizeInBytes=%d",voxelSizeInBytes);
qDebug("voxelSizeInOctets=%d\n",voxelSizeInOctets); qDebug("voxelSizeInOctets=%d",voxelSizeInOctets);
qDebug("voxelBufferSize=%d\n",voxelBufferSize); qDebug("voxelBufferSize=%d",voxelBufferSize);
for(int i=0;i<voxelBufferSize;i++) { for(int i=0; i < voxelBufferSize; i++) {
qDebug("i=%d ",i); QDebug voxelBufferDebug = qDebug();
outputBits(voxelCode[i]); voxelBufferDebug << "i =" << i;
outputBits(voxelCode[i], &voxelBufferDebug);
} }
} }

View file

@ -68,8 +68,8 @@ bool randomBoolean();
bool shouldDo(float desiredInterval, float deltaTime); bool shouldDo(float desiredInterval, float deltaTime);
void outputBufferBits(const unsigned char* buffer, int length, bool withNewLine = true); void outputBufferBits(const unsigned char* buffer, int length, QDebug* continuedDebug = NULL);
void outputBits(unsigned char byte, bool withNewLine = true, bool usePrintf = false); void outputBits(unsigned char byte, QDebug* continuedDebug = NULL);
void printVoxelCode(unsigned char* voxelCode); void printVoxelCode(unsigned char* voxelCode);
int numberOfOnes(unsigned char byte); int numberOfOnes(unsigned char byte);
bool oneAtBit(unsigned char byte, int bitIndex); bool oneAtBit(unsigned char byte, int bitIndex);

View file

@ -58,14 +58,14 @@ void VoxelServer::beforeRun() {
const char* SEND_ENVIRONMENTS = "--sendEnvironments"; const char* SEND_ENVIRONMENTS = "--sendEnvironments";
bool dontSendEnvironments = !cmdOptionExists(_argc, _argv, SEND_ENVIRONMENTS); bool dontSendEnvironments = !cmdOptionExists(_argc, _argv, SEND_ENVIRONMENTS);
if (dontSendEnvironments) { if (dontSendEnvironments) {
qDebug("Sending environments suppressed...\n"); qDebug("Sending environments suppressed...");
_sendEnvironments = false; _sendEnvironments = false;
} else { } else {
_sendEnvironments = true; _sendEnvironments = true;
// should we send environments? Default is yes, but this command line suppresses sending // should we send environments? Default is yes, but this command line suppresses sending
const char* MINIMAL_ENVIRONMENT = "--minimalEnvironment"; const char* MINIMAL_ENVIRONMENT = "--minimalEnvironment";
_sendMinimalEnvironment = cmdOptionExists(_argc, _argv, MINIMAL_ENVIRONMENT); _sendMinimalEnvironment = cmdOptionExists(_argc, _argv, MINIMAL_ENVIRONMENT);
qDebug("Using Minimal Environment=%s\n", debug::valueOf(_sendMinimalEnvironment)); qDebug("Using Minimal Environment=%s", debug::valueOf(_sendMinimalEnvironment));
} }
qDebug("Sending environments=%s\n", debug::valueOf(_sendEnvironments)); qDebug("Sending environments=%s", debug::valueOf(_sendEnvironments));
} }

View file

@ -127,7 +127,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
if (debug) { if (debug) {
int percentComplete = 100 * (thisRadius/radius); int percentComplete = 100 * (thisRadius/radius);
qDebug("percentComplete=%d\n",percentComplete); qDebug("percentComplete=%d",percentComplete);
} }
for (float theta=0.0; theta <= 2 * M_PI; theta += angleDelta) { for (float theta=0.0; theta <= 2 * M_PI; theta += angleDelta) {
@ -143,7 +143,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
// 2) In all modes, we will use our "outer" color to draw the voxels. Otherwise we will use the average color // 2) In all modes, we will use our "outer" color to draw the voxels. Otherwise we will use the average color
if (lastLayer) { if (lastLayer) {
if (false && debug) { if (false && debug) {
qDebug("adding candy shell: theta=%f phi=%f thisRadius=%f radius=%f\n", qDebug("adding candy shell: theta=%f phi=%f thisRadius=%f radius=%f",
theta, phi, thisRadius,radius); theta, phi, thisRadius,radius);
} }
switch (mode) { switch (mode) {
@ -167,7 +167,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
green = (unsigned char)std::min(255, std::max(0, (int)(g1 + ((g2 - g1) * gradient)))); green = (unsigned char)std::min(255, std::max(0, (int)(g1 + ((g2 - g1) * gradient))));
blue = (unsigned char)std::min(255, std::max(0, (int)(b1 + ((b2 - b1) * gradient)))); blue = (unsigned char)std::min(255, std::max(0, (int)(b1 + ((b2 - b1) * gradient))));
if (debug) { if (debug) {
qDebug("perlin=%f gradient=%f color=(%d,%d,%d)\n",perlin, gradient, red, green, blue); qDebug("perlin=%f gradient=%f color=(%d,%d,%d)",perlin, gradient, red, green, blue);
} }
} break; } break;
} }
@ -468,14 +468,14 @@ bool VoxelTree::readFromSchematicFile(const char *fileName) {
std::stringstream ss; std::stringstream ss;
int err = retrieveData(std::string(fileName), ss); int err = retrieveData(std::string(fileName), ss);
if (err && ss.get() != TAG_Compound) { if (err && ss.get() != TAG_Compound) {
qDebug("[ERROR] Invalid schematic file.\n"); qDebug("[ERROR] Invalid schematic file.");
return false; return false;
} }
ss.get(); ss.get();
TagCompound schematics(ss); TagCompound schematics(ss);
if (!schematics.getBlocksId() || !schematics.getBlocksData()) { if (!schematics.getBlocksId() || !schematics.getBlocksData()) {
qDebug("[ERROR] Invalid schematic data.\n"); qDebug("[ERROR] Invalid schematic data.");
return false; return false;
} }
@ -500,7 +500,7 @@ bool VoxelTree::readFromSchematicFile(const char *fileName) {
for (int x = 0; x < schematics.getWidth(); ++x) { for (int x = 0; x < schematics.getWidth(); ++x) {
if (_stopImport) { if (_stopImport) {
qDebug("[DEBUG] Canceled import at %d voxels.\n", count); qDebug("[DEBUG] Canceled import at %d voxels.", count);
_stopImport = false; _stopImport = false;
return true; return true;
} }
@ -551,7 +551,7 @@ bool VoxelTree::readFromSchematicFile(const char *fileName) {
} }
emit importProgress(100); emit importProgress(100);
qDebug("Created %d voxels from minecraft import.\n", count); qDebug("Created %d voxels from minecraft import.", count);
return true; return true;
} }
@ -590,7 +590,7 @@ void VoxelTree::readCodeColorBufferToTreeRecursion(VoxelTreeElement* node, ReadC
} }
} else { } else {
if (!node->isLeaf()) { if (!node->isLeaf()) {
qDebug("WARNING! operation would require deleting children, add Voxel ignored!\n "); qDebug("WARNING! operation would require deleting children, add Voxel ignored!");
} }
} }

View file

@ -6,7 +6,6 @@
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. // Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
// //
#include <QtCore/QDebug>
#include <NodeList.h> #include <NodeList.h>
#include <PerfStat.h> #include <PerfStat.h>

View file

@ -204,10 +204,10 @@ void processFillSVOFile(const char* fillSVOFile) {
VoxelTree filledSVO(true); // reaveraging VoxelTree filledSVO(true); // reaveraging
originalSVO.readFromSVOFile(fillSVOFile); originalSVO.readFromSVOFile(fillSVOFile);
qDebug("Nodes after loading %lu nodes\n", originalSVO.getOctreeElementsCount()); qDebug("Nodes after loading %lu nodes", originalSVO.getOctreeElementsCount());
originalSVO.reaverageOctreeElements(); originalSVO.reaverageOctreeElements();
qDebug("Original Voxels reAveraged\n"); qDebug("Original Voxels reAveraged");
qDebug("Nodes after reaveraging %lu nodes\n", originalSVO.getOctreeElementsCount()); qDebug("Nodes after reaveraging %lu nodes", originalSVO.getOctreeElementsCount());
copyAndFillArgs args; copyAndFillArgs args;
args.destinationTree = &filledSVO; args.destinationTree = &filledSVO;
@ -215,23 +215,23 @@ void processFillSVOFile(const char* fillSVOFile) {
args.outCount = 0; args.outCount = 0;
args.originalCount = originalSVO.getOctreeElementsCount(); args.originalCount = originalSVO.getOctreeElementsCount();
printf("Begin processing...\n"); printf("Begin processing...");
originalSVO.recurseTreeWithOperation(copyAndFillOperation, &args); originalSVO.recurseTreeWithOperation(copyAndFillOperation, &args);
printf("DONE processing...\n"); printf("DONE processing...");
qDebug("Original input nodes used for filling %lu nodes\n", args.originalCount); qDebug("Original input nodes used for filling %lu nodes", args.originalCount);
qDebug("Input nodes traversed during filling %lu nodes\n", args.inCount); qDebug("Input nodes traversed during filling %lu nodes", args.inCount);
qDebug("Nodes created during filling %lu nodes\n", args.outCount); qDebug("Nodes created during filling %lu nodes", args.outCount);
qDebug("Nodes after filling %lu nodes\n", filledSVO.getOctreeElementsCount()); qDebug("Nodes after filling %lu nodes", filledSVO.getOctreeElementsCount());
filledSVO.reaverageOctreeElements(); filledSVO.reaverageOctreeElements();
qDebug("Nodes after reaveraging %lu nodes\n", filledSVO.getOctreeElementsCount()); qDebug("Nodes after reaveraging %lu nodes", filledSVO.getOctreeElementsCount());
sprintf(outputFileName, "filled%s", fillSVOFile); sprintf(outputFileName, "filled%s", fillSVOFile);
printf("outputFile: %s\n", outputFileName); printf("outputFile: %s", outputFileName);
filledSVO.writeToSVOFile(outputFileName); filledSVO.writeToSVOFile(outputFileName);
printf("exiting now\n"); printf("exiting now");
} }
void unitTest(VoxelTree * tree); void unitTest(VoxelTree * tree);
@ -265,18 +265,18 @@ int main(int argc, const char * argv[])
float z = zStr.toFloat()/TREE_SCALE; // 0.56540045166016; float z = zStr.toFloat()/TREE_SCALE; // 0.56540045166016;
float s = sStr.toFloat()/TREE_SCALE; // 0.015625; float s = sStr.toFloat()/TREE_SCALE; // 0.015625;
qDebug() << "Get Octal Code for:\n"; qDebug() << "Get Octal Code for:";
qDebug() << " x:" << xStr << " [" << x << "] \n"; qDebug() << " x:" << xStr << " [" << x << "]";
qDebug() << " y:" << yStr << " [" << y << "] \n"; qDebug() << " y:" << yStr << " [" << y << "]";
qDebug() << " z:" << zStr << " [" << z << "] \n"; qDebug() << " z:" << zStr << " [" << z << "]";
qDebug() << " s:" << sStr << " [" << s << "] \n"; qDebug() << " s:" << sStr << " [" << s << "]";
unsigned char* octalCode = pointToVoxel(x, y, z, s); unsigned char* octalCode = pointToVoxel(x, y, z, s);
QString octalCodeStr = octalCodeToHexString(octalCode); QString octalCodeStr = octalCodeToHexString(octalCode);
qDebug() << "octal code: " << octalCodeStr << "\n"; qDebug() << "octal code: " << octalCodeStr;
} else { } else {
qDebug() << "Unexpected number of parameters for getOctCode\n"; qDebug() << "Unexpected number of parameters for getOctCode";
} }
return 0; return 0;
} }
@ -293,12 +293,12 @@ int main(int argc, const char * argv[])
delete[] octalCodeToDecode; delete[] octalCodeToDecode;
qDebug() << "octal code to decode: " << decodeParamsString << "\n"; qDebug() << "octal code to decode: " << decodeParamsString;
qDebug() << "Details for Octal Code:\n"; qDebug() << "Details for Octal Code:";
qDebug() << " x:" << details.x << "[" << details.x * TREE_SCALE << "]" << "\n"; qDebug() << " x:" << details.x << "[" << details.x * TREE_SCALE << "]";
qDebug() << " y:" << details.y << "[" << details.y * TREE_SCALE << "]" << "\n"; qDebug() << " y:" << details.y << "[" << details.y * TREE_SCALE << "]";
qDebug() << " z:" << details.z << "[" << details.z * TREE_SCALE << "]" << "\n"; qDebug() << " z:" << details.z << "[" << details.z * TREE_SCALE << "]";
qDebug() << " s:" << details.s << "[" << details.s * TREE_SCALE << "]" << "\n"; qDebug() << " s:" << details.s << "[" << details.s * TREE_SCALE << "]";
return 0; return 0;
} }