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
|
// Show on-screen msec timer
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::FrameTimer)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::FrameTimer)) {
|
||||||
char frameTimer[10];
|
|
||||||
quint64 mSecsNow = floor(usecTimestampNow() / 1000.0 + 0.5);
|
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 =
|
int timerBottom =
|
||||||
(Menu::getInstance()->isOptionChecked(MenuOption::Stats))
|
(Menu::getInstance()->isOptionChecked(MenuOption::Stats))
|
||||||
? 80 : 20;
|
? 80 : 20;
|
||||||
drawText(glCanvas->width() - 100, glCanvas->height() - timerBottom,
|
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();
|
nodeBoundsDisplay.drawOverlay();
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,9 +236,8 @@ void OctreeStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t ser
|
||||||
serverCount++;
|
serverCount++;
|
||||||
|
|
||||||
if (serverCount > _octreeServerLabelsCount) {
|
if (serverCount > _octreeServerLabelsCount) {
|
||||||
char label[128] = { 0 };
|
QString label = QString("%1 Server %2").arg(serverTypeName).arg(serverCount);
|
||||||
sprintf(label, "%s Server %d", serverTypeName, serverCount);
|
int thisServerRow = _octreeServerLables[serverCount-1] = AddStatItem(label.toUtf8().constData());
|
||||||
int thisServerRow = _octreeServerLables[serverCount-1] = AddStatItem(label);
|
|
||||||
_labels[thisServerRow]->setTextFormat(Qt::RichText);
|
_labels[thisServerRow]->setTextFormat(Qt::RichText);
|
||||||
_labels[thisServerRow]->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
_labels[thisServerRow]->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
connect(_labels[thisServerRow], SIGNAL(linkActivated(const QString&)), this, SLOT(moreless(const QString&)));
|
connect(_labels[thisServerRow], SIGNAL(linkActivated(const QString&)), this, SLOT(moreless(const QString&)));
|
||||||
|
|
|
@ -441,7 +441,7 @@ void Stats::display(
|
||||||
if (_expanded) {
|
if (_expanded) {
|
||||||
SharedNodePointer avatarMixer = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::AvatarMixer);
|
SharedNodePointer avatarMixer = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::AvatarMixer);
|
||||||
if (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) +
|
arg(roundf(bandwidthRecorder->getAverageInputKilobitsPerSecond(NodeType::AudioMixer) +
|
||||||
bandwidthRecorder->getAverageOutputKilobitsPerSecond(NodeType::AudioMixer))).
|
bandwidthRecorder->getAverageOutputKilobitsPerSecond(NodeType::AudioMixer))).
|
||||||
arg(roundf(bandwidthRecorder->getAverageInputPacketsPerSecond(NodeType::AudioMixer) +
|
arg(roundf(bandwidthRecorder->getAverageInputPacketsPerSecond(NodeType::AudioMixer) +
|
||||||
|
|
Loading…
Reference in a new issue