Addressed MR comments

This commit is contained in:
Ben Wallis 2021-05-09 22:38:23 +01:00
parent 24134af4a7
commit 0296bbe696
4 changed files with 8 additions and 9 deletions

View File

@ -15,6 +15,7 @@ use egui::{
use egui_winit_platform::Platform;
#[cfg(feature = "use-dyn-lib")]
use lazy_static::lazy_static;
#[cfg(feature = "use-dyn-lib")]
use std::ffi::CStr;
#[cfg(feature = "use-dyn-lib")]
use std::sync::Arc;

View File

@ -19,6 +19,7 @@ use common::{
clock::Clock,
};
use std::panic;
#[cfg(feature = "hot-anim")] use std::sync::Arc;
use tracing::{error, info, warn};
use veloren_voxygen::ui::egui::EguiState;

View File

@ -266,16 +266,10 @@ impl<'frame> Drawer<'frame> {
}
}
pub fn draw_egui(
&mut self,
platform: &mut Platform,
scale_factor: f32,
) {
pub fn draw_egui(&mut self, platform: &mut Platform, scale_factor: f32) {
let (_output, paint_commands) = platform.end_frame();
let paint_jobs = platform
.context()
.tessellate(paint_commands);
let paint_jobs = platform.context().tessellate(paint_commands);
let screen_descriptor = ScreenDescriptor {
physical_width: self.borrow.sc_desc.width,
@ -300,7 +294,9 @@ impl<'frame> Drawer<'frame> {
self.borrow.egui_render_pass.execute(
&mut self.encoder.as_mut().unwrap(),
&self.swap_tex.view,
self.taking_screenshot
.as_ref()
.map_or(&self.swap_tex.view, |s| s.texture_view()),
&paint_jobs,
&screen_descriptor,
None,

View File

@ -14,6 +14,7 @@ use serde::{Deserialize, Serialize};
use tracing::{error, warn};
use vek::*;
use winit::monitor::VideoMode;
/// Represents a key that the game recognises after input mapping.
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
pub enum GameInput {