mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
remove a couple more sprintfs
This commit is contained in:
parent
c97eb20d69
commit
3d23446dcb
3 changed files with 5 additions and 7 deletions
|
@ -929,14 +929,13 @@ void ApplicationOverlay::renderStatsAndLogs() {
|
|||
|
||||
// Show on-screen msec timer
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::FrameTimer)) {
|
||||
char frameTimer[10];
|
||||
quint64 mSecsNow = floor(usecTimestampNow() / 1000.0 + 0.5);
|
||||
sprintf(frameTimer, "%d\n", (int)(mSecsNow % 1000));
|
||||
QString frameTimer = QString("%1\n").arg((int)(mSecsNow % 1000));
|
||||
int timerBottom =
|
||||
(Menu::getInstance()->isOptionChecked(MenuOption::Stats))
|
||||
? 80 : 20;
|
||||
drawText(glCanvas->width() - 100, glCanvas->height() - timerBottom,
|
||||
0.30f, 0.0f, 0, frameTimer, WHITE_TEXT);
|
||||
0.30f, 0.0f, 0, frameTimer.toUtf8().constData(), WHITE_TEXT);
|
||||
}
|
||||
nodeBoundsDisplay.drawOverlay();
|
||||
}
|
||||
|
|
|
@ -236,9 +236,8 @@ void OctreeStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t ser
|
|||
serverCount++;
|
||||
|
||||
if (serverCount > _octreeServerLabelsCount) {
|
||||
char label[128] = { 0 };
|
||||
sprintf(label, "%s Server %d", serverTypeName, serverCount);
|
||||
int thisServerRow = _octreeServerLables[serverCount-1] = AddStatItem(label);
|
||||
QString label = QString("%1 Server %2").arg(serverTypeName).arg(serverCount);
|
||||
int thisServerRow = _octreeServerLables[serverCount-1] = AddStatItem(label.toUtf8().constData());
|
||||
_labels[thisServerRow]->setTextFormat(Qt::RichText);
|
||||
_labels[thisServerRow]->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
connect(_labels[thisServerRow], SIGNAL(linkActivated(const QString&)), this, SLOT(moreless(const QString&)));
|
||||
|
|
|
@ -441,7 +441,7 @@ void Stats::display(
|
|||
if (_expanded) {
|
||||
SharedNodePointer avatarMixer = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::AvatarMixer);
|
||||
if (avatarMixer) {
|
||||
avatarMixerStats = QString("Avatar Mixer: %1 kbps, %1 pps").
|
||||
avatarMixerStats = QString("Avatar Mixer: %1 kbps, %2 pps").
|
||||
arg(roundf(bandwidthRecorder->getAverageInputKilobitsPerSecond(NodeType::AudioMixer) +
|
||||
bandwidthRecorder->getAverageOutputKilobitsPerSecond(NodeType::AudioMixer))).
|
||||
arg(roundf(bandwidthRecorder->getAverageInputPacketsPerSecond(NodeType::AudioMixer) +
|
||||
|
|
Loading…
Reference in a new issue