mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-30 15:59:37 -05:00
Cleaning the ScreenLog
This commit is contained in:
@@ -635,7 +635,21 @@ void RenderEngine::render(const glm::mat4 &projectionMatrix, const glm::mat4 &vi
|
||||
const int category_length = 20;
|
||||
const int msg_length = 140;
|
||||
std::chrono::seconds fade(5);
|
||||
auto entries = _log->last(max);
|
||||
|
||||
auto entries = _log->entries();
|
||||
auto lastEntries = entries.size() > max ? std::make_pair(entries.rbegin(), entries.rbegin() + max) : std::make_pair(entries.rbegin(), entries.rend());
|
||||
|
||||
// if (entries.size() > max)
|
||||
|
||||
//ScreenLog::const_range ScreenLog::last(size_t n) {
|
||||
// if (_entries.size() > n) {
|
||||
// return std::make_pair(_entries.rbegin(), _entries.rbegin() + n);
|
||||
// } else {
|
||||
// return std::make_pair(_entries.rbegin(), _entries.rend());
|
||||
// }
|
||||
//}
|
||||
|
||||
// auto entries = _log->last(max);
|
||||
|
||||
const glm::vec4 white(0.9, 0.9, 0.9, 1);
|
||||
const glm::vec4 red(1, 0, 0, 1);
|
||||
@@ -645,7 +659,7 @@ void RenderEngine::render(const glm::mat4 &projectionMatrix, const glm::mat4 &vi
|
||||
|
||||
size_t nr = 1;
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
for (auto& it = entries.first; it != entries.second; ++it) {
|
||||
for (auto& it = lastEntries.first; it != lastEntries.second; ++it) {
|
||||
const ScreenLog::LogEntry* e = &(*it);
|
||||
|
||||
std::chrono::duration<double> diff = now - e->timeStamp;
|
||||
|
||||
Reference in New Issue
Block a user