| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- $ProfilerGraph::refreshRate = 32;
- // Profiles
- new GuiControlProfile (ProfilerGraphProfile)
- {
- modal = false;
- opaque = false;
- canKeyFocus = false;
- };
- new GuiControlProfile (ProfilerGraphKeyContainerProfile)
- {
- border = true;
- opaque = true;
- fillColor = "100 100 100 200";
- };
- new GuiControlProfile (ProfilerGraphGraphFrameRateProfile)
- {
- border = false;
- fontColor = "255 255 255";
- };
- new GuiControlProfile (ProfilerGraphPolyCountProfile)
- {
- border = false;
- fontColor = "255 0 0";
- };
- new GuiControlProfile (ProfilerGraphDrawCountProfile)
- {
- border = false;
- fontColor = "0 255 0";
- };
- new GuiControlProfile (ProfilerGraphRTChangesProfile)
- {
- border = false;
- fontColor = "0 0 255";
- };
- new GuiControlProfile (ProfilerGraphLatencyProfile)
- {
- border = false;
- fontColor = "0 255 255";
- };
- new GuiControlProfile (ProfilerGraphPacketLossProfile)
- {
- border = false;
- fontColor = "0 0 0";
- };
- function toggleProfilerGraph()
- {
- if(!$ProfilerGraph::isInitialized)
- {
- ProfilerGraph::updateStats();
- $ProfilerGraph::isInitialized = true;
- }
- if(!Canvas.isMember(ProfilerGraphGui))
- {
- Canvas.add(ProfilerGraphGui);
- }
- else
- Canvas.remove(ProfilerGraphGui);
- }
- function ProfilerGraph::updateStats()
- {
- $ProfilerGraphThread = ProfilerGraph.schedule($ProfilerGraph::refreshRate, "updateStats");
- if(!$Stats::netGhostUpdates)
- return;
- if(isobject(ProfilerGraph))
- {
- GhostsActive.setText("Frame Rate: " @ $fps::real);
- ProfilerGraph.addDatum(1,$fps::real);
-
- GhostUpdates.setText("Poly Count: " @ $GFXDeviceStatistics::polyCount);
- ProfilerGraph.addDatum(2,$GFXDeviceStatistics::polyCount);
-
- BitsSent.setText("Draw Calls: " @ $GFXDeviceStatistics::drawCalls);
- ProfilerGraph.addDatum(3,$GFXDeviceStatistics::drawCalls);
-
- BitsReceived.setText("Render Target Changes: " @ $GFXDeviceStatistics::renderTargetChanges);
- ProfilerGraph.addDatum(4,$GFXDeviceStatistics::renderTargetChanges);
-
- ProfilerGraph.matchScale(2,3);
- //Latency.setText("Latency: " @ ServerConnection.getPing());
- //ProfilerGraph.addDatum(5,ServerConnection.getPacketLoss());
-
- //PacketLoss.setText("Packet Loss: " @ ServerConnection.getPacketLoss());
- }
- }
- function ProfilerGraph::toggleKey()
- {
- if(!GhostsActive.visible)
- {
- GhostsActive.visible = 1;
- GhostUpdates.visible = 1;
- BitsSent.visible = 1;
- BitsReceived.visible = 1;
- Latency.visible = 1;
- PacketLoss.visible = 1;
- }
- else
- {
- GhostsActive.visible = 0;
- GhostUpdates.visible = 0;
- BitsSent.visible = 0;
- BitsReceived.visible = 0;
- Latency.visible = 0;
- PacketLoss.visible = 0;
- }
- }
|