From 736eb335a963184013451429ea70fe8a7a791dc1 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Mon, 22 Apr 2013 13:12:17 -0700 Subject: [PATCH 1/2] Added stats at upper right for servers and avatars separately. --- interface/src/main.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 8712700efc..a47936ffd3 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -983,11 +983,18 @@ void display(void) menu.render(WIDTH,HEIGHT); } - // Draw number of nearby people always + // Stats at upper right of screen about who domain server is telling us about glPointSize(1.0f); char agents[100]; - sprintf(agents, "Agents: %ld\n", AgentList::getInstance()->getAgents().size()); - drawtext(WIDTH-100,20, 0.10, 0, 1.0, 0, agents, 1, 0, 0); + + int totalAgents = AgentList::getInstance()->getAgents().size(); + int totalAvatars = 0, totalServers = 0; + for (int i = 0; i < totalAgents; i++) { + if (AgentList::getInstance()->getAgents()[i].getType() == AGENT_TYPE_INTERFACE) totalAvatars++; + else totalServers++; + } + sprintf(agents, "Servers: %d, Avatars: %d\n", totalServers, totalAvatars); + drawtext(WIDTH-150,20, 0.10, 0, 1.0, 0, agents, 1, 0, 0); if (::paintOn) { From 7d52af6fd4d846cb2bd64ad40b3a960e0cfadd7e Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Mon, 22 Apr 2013 13:20:12 -0700 Subject: [PATCH 2/2] Fixed per stephen --- interface/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/main.cpp b/interface/src/main.cpp index a47936ffd3..2285d14bb9 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -990,8 +990,8 @@ void display(void) int totalAgents = AgentList::getInstance()->getAgents().size(); int totalAvatars = 0, totalServers = 0; for (int i = 0; i < totalAgents; i++) { - if (AgentList::getInstance()->getAgents()[i].getType() == AGENT_TYPE_INTERFACE) totalAvatars++; - else totalServers++; + (AgentList::getInstance()->getAgents()[i].getType() == AGENT_TYPE_INTERFACE) + ? totalAvatars++ : totalServers++; } sprintf(agents, "Servers: %d, Avatars: %d\n", totalServers, totalAvatars); drawtext(WIDTH-150,20, 0.10, 0, 1.0, 0, agents, 1, 0, 0);