From 900caa6278de7811c392c25702dbc48aeffdc3e8 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 1 May 2013 22:40:38 -0700 Subject: [PATCH] Changed idle simulate call to 16msecs (which will set avatar mixer rate at 60FPS), further small stats improvements --- interface/src/main.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/interface/src/main.cpp b/interface/src/main.cpp index ce15eb07c4..822bfe81f6 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -15,7 +15,7 @@ // Welcome Aboard! // // -// Keyboard Commands: +// Keyboard Commands: // // / = toggle stats display // spacebar = reset gyros/head position @@ -134,7 +134,7 @@ VoxelSystem voxels; Audio audio(&audioScope, &myAvatar); #endif -#define IDLE_SIMULATE_MSECS 8 // How often should call simulate and other stuff +#define IDLE_SIMULATE_MSECS 16 // How often should call simulate and other stuff // in the idle loop? // Where one's own agent begins in the world (needs to become a dynamic thing passed to the program) @@ -228,22 +228,23 @@ void displayStats(void) drawtext(10, statsVerticalOffset + 15, 0.10f, 0, 1.0, 0, stats); std::stringstream voxelStats; - voxelStats << "Voxels Rendered: " << voxels.getVoxelsRendered() << " Updated: " << voxels.getVoxelsUpdated(); + voxelStats.precision(4); + voxelStats << "Voxels Rendered: " << voxels.getVoxelsRendered()/1000.f << "K Updated: " << voxels.getVoxelsUpdated()/1000.f << "K"; drawtext(10, statsVerticalOffset + 230, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); voxelStats.str(""); - voxelStats << "Voxels Created: " << voxels.getVoxelsCreated() << " (" << voxels.getVoxelsCreatedPerSecondAverage() - << "/sec) "; + voxelStats << "Voxels Created: " << voxels.getVoxelsCreated()/1000.f << "K (" << voxels.getVoxelsCreatedPerSecondAverage()/1000.f + << "Kps) "; drawtext(10, statsVerticalOffset + 250, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); voxelStats.str(""); - voxelStats << "Voxels Colored: " << voxels.getVoxelsColored() << " (" << voxels.getVoxelsColoredPerSecondAverage() - << "/sec) "; + voxelStats << "Voxels Colored: " << voxels.getVoxelsColored()/1000.f << "K (" << voxels.getVoxelsColoredPerSecondAverage()/1000.f + << "Kps) "; drawtext(10, statsVerticalOffset + 270, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); voxelStats.str(""); - voxelStats << "Voxels Bytes Read: " << voxels.getVoxelsBytesRead() - << " (" << voxels.getVoxelsBytesReadPerSecondAverage() * 8.f / 1000000.f << " Mbps)"; + voxelStats << "Voxel Bits Read: " << voxels.getVoxelsBytesRead() * 8.f / 1000000.f + << "M (" << voxels.getVoxelsBytesReadPerSecondAverage() * 8.f / 1000000.f << " Mbps)"; drawtext(10, statsVerticalOffset + 290,0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); voxelStats.str(""); @@ -251,13 +252,13 @@ void displayStats(void) ? ((float) voxels.getVoxelsBytesRead() / voxels.getVoxelsColored()) : 0; - voxelStats << "Voxels Bytes per Colored: " << voxelsBytesPerColored; + voxelStats << "Voxels Bits per Colored: " << voxelsBytesPerColored * 8; drawtext(10, statsVerticalOffset + 310, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); Agent *avatarMixer = AgentList::getInstance()->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER); char avatarMixerStats[200]; if (avatarMixer) { - sprintf(avatarMixerStats, "Avatar Mixer - %.f kbps, %.f pps", + sprintf(avatarMixerStats, "Avatar Mixer: %.f kbps, %.f pps", roundf(avatarMixer->getAverageKilobitsPerSecond()), roundf(avatarMixer->getAveragePacketsPerSecond())); } else {