| 86 | } |
| 87 | |
| 88 | void VideoScreen::render() |
| 89 | { |
| 90 | if (this->video) |
| 91 | { |
| 92 | auto time_now = std::chrono::high_resolution_clock::now(); |
| 93 | auto time_since_last_frame = time_now - this->last_frame_time; |
| 94 | while (time_since_last_frame >= this->video->getFrameTime()) |
| 95 | { |
| 96 | this->last_frame_time += video->getFrameTime(); |
| 97 | this->current_frame = this->video->popImage(); |
| 98 | |
| 99 | if (!this->current_frame) |
| 100 | { |
| 101 | // End of video |
| 102 | this->video = nullptr; |
| 103 | break; |
| 104 | } |
| 105 | time_since_last_frame = time_now - this->last_frame_time; |
| 106 | } |
| 107 | } |
| 108 | if (this->current_frame) |
| 109 | { |
| 110 | if (this->current_frame->palette) |
| 111 | fw().renderer->setPalette(this->current_frame->palette); |
| 112 | fw().renderer->drawScaled(this->current_frame->image, this->frame_position, |
| 113 | this->frame_size, Renderer::Scaler::Nearest); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | bool VideoScreen::isTransition() { return false; } |
| 118 |
nothing calls this directly
no test coverage detected