Merge branch 'master' of https://github.com/worklist/hifi into pointy

This commit is contained in:
Andrzej Kapolka 2013-07-29 10:50:55 -07:00
commit 1f076cc268
4 changed files with 15 additions and 14 deletions

View file

@ -75,8 +75,6 @@ using namespace std;
static char STAR_FILE[] = "http://s3-us-west-1.amazonaws.com/highfidelity/stars.txt";
static char STAR_CACHE_FILE[] = "cachedStars.txt";
static const bool TESTING_PARTICLE_SYSTEM = true;
static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored
const glm::vec3 START_LOCATION(4.f, 0.f, 5.f); // Where one's own node begins in the world
@ -1497,11 +1495,11 @@ bool Application::sendVoxelsOperation(VoxelNode* node, void* extraData) {
int usecToSleep = CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS - elapsed;
if (usecToSleep > 0) {
qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, sleeping for %d usecs!\n",
args->packetsSent, args->bytesSent, elapsed, usecToSleep);
args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed, usecToSleep);
usleep(usecToSleep);
} else {
qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, no need to sleep!\n",
args->packetsSent, args->bytesSent, elapsed);
args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed);
}
args->lastSendTime = now;
}
@ -1686,7 +1684,7 @@ void Application::pasteVoxels() {
controlledBroadcastToNodes(args.messageBuffer, args.bufferInUse, & NODE_TYPE_VOXEL_SERVER, 1);
qDebug("sending packet: %d\n", ++args.packetsSent);
args.bytesSent += args.bufferInUse;
qDebug("total bytes sent: %lld\n", args.bytesSent);
qDebug("total bytes sent: %lld\n", (long long int)args.bytesSent);
}
if (calculatedOctCode) {
@ -1751,6 +1749,8 @@ void Application::initMenu() {
_renderLookatOn->setChecked(false);
(_renderLookatIndicatorOn = renderMenu->addAction("Lookat Indicator"))->setCheckable(true);
_renderLookatIndicatorOn->setChecked(true);
(_renderParticleSystemOn = renderMenu->addAction("Particle System"))->setCheckable(true);
_renderParticleSystemOn->setChecked(true);
(_manualFirstPerson = renderMenu->addAction(
"First Person", this, SLOT(setRenderFirstPerson(bool)), Qt::Key_P))->setCheckable(true);
(_manualThirdPerson = renderMenu->addAction(
@ -2260,7 +2260,7 @@ void Application::update(float deltaTime) {
_audio.eventuallyAnalyzePing();
#endif
if (TESTING_PARTICLE_SYSTEM) {
if (_renderParticleSystemOn->isChecked()) {
updateParticleSystem(deltaTime);
}
}
@ -2716,7 +2716,7 @@ void Application::displaySide(Camera& whichCamera) {
}
}
if (TESTING_PARTICLE_SYSTEM) {
if (_renderParticleSystemOn->isChecked()) {
if (_particleSystemInitialized) {
_particleSystem.render();
}

View file

@ -267,6 +267,7 @@ private:
QAction* _renderFrameTimerOn; // Whether to show onscreen text overlay with stats
QAction* _renderLookatOn; // Whether to show lookat vectors from avatar eyes if looking at something
QAction* _renderLookatIndicatorOn;
QAction* _renderParticleSystemOn;
QAction* _manualFirstPerson; // Whether to force first-person mode
QAction* _manualThirdPerson; // Whether to force third-person mode
QAction* _logOn; // Whether to show on-screen log

View file

@ -59,7 +59,7 @@ PerfStat::~PerfStat() {
}
if (wantDebugOut) {
qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%d us:%d ue:%d 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\n",
this->group.c_str(),elapsed,average,count,totalTime,
(end.tv_usec-start.tv_usec),start.tv_usec,end.tv_usec,
(end.tv_sec-start.tv_sec),start.tv_sec,end.tv_sec

View file

@ -378,10 +378,10 @@ int VoxelSceneStats::unpackFromMessage(unsigned char* sourceBuffer, int availabl
void VoxelSceneStats::printDebugDetails() {
qDebug("\n------------------------------\n");
qDebug("VoxelSceneStats:\n");
qDebug(" start : %llu \n", _start);
qDebug(" end : %llu \n", _end);
qDebug(" elapsed : %llu \n", _elapsed);
qDebug(" encoding : %llu \n", _totalEncodeTime);
qDebug(" start : %llu \n", (long long unsigned int)_start);
qDebug(" end : %llu \n", (long long unsigned int)_end);
qDebug(" elapsed : %llu \n", (long long unsigned int)_elapsed);
qDebug(" encoding : %llu \n", (long long unsigned int)_totalEncodeTime);
qDebug("\n");
qDebug(" full scene: %s\n", debug::valueOf(_isFullScene));
qDebug(" moving: %s\n", debug::valueOf(_isMoving));
@ -457,12 +457,12 @@ char* VoxelSceneStats::getItemValue(int item) {
calcAverageFPS = (float)USECS_PER_SECOND / (float)elapsedAverage;
sprintf(_itemValueBuffer, "%llu usecs (%d fps) Average: %.0f usecs (%d fps)",
_elapsed, calcFPS, elapsedAverage, calcAverageFPS);
(long long unsigned int)_elapsed, calcFPS, elapsedAverage, calcAverageFPS);
break;
}
case ITEM_ENCODE:
calcFPS = (float)USECS_PER_SECOND / (float)_totalEncodeTime;
sprintf(_itemValueBuffer, "%llu usecs (%d fps)", _totalEncodeTime, calcFPS);
sprintf(_itemValueBuffer, "%llu usecs (%d fps)", (long long unsigned int)_totalEncodeTime, calcFPS);
break;
case ITEM_PACKETS: {
float elapsedSecs = ((float)_elapsed / (float)USECS_PER_SECOND);