Restructure elements
This commit is contained in:
parent
364b1e5686
commit
bc142ba988
15 changed files with 25 additions and 21 deletions
4
build.rs
4
build.rs
|
@ -10,8 +10,8 @@ const VK_HEADER: &[&str] = &[
|
||||||
const FN_PREFIX: &str = "PFN_";
|
const FN_PREFIX: &str = "PFN_";
|
||||||
|
|
||||||
const SHADER: &[&str] = &[
|
const SHADER: &[&str] = &[
|
||||||
"src/overlay/elements/shader/single_color.vert",
|
"src/overlay/elements/pedals/single_color.vert",
|
||||||
"src/overlay/elements/shader/single_color.frag",
|
"src/overlay/elements/pedals/single_color.frag",
|
||||||
];
|
];
|
||||||
|
|
||||||
fn query_vulkan_function_typedefs() {
|
fn query_vulkan_function_typedefs() {
|
||||||
|
|
10
src/overlay/elements/leaderboard/leaderboard_entry.xml
Normal file
10
src/overlay/elements/leaderboard/leaderboard_entry.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
|
<root>
|
||||||
|
<grid id="grid" x_dim="9" y_dim="1">
|
||||||
|
<label id="place" x_slot="0" y_slot="0" text_color="black"></label>
|
||||||
|
<label id="name"
|
||||||
|
x_slot="1" y_slot="0" x_size="6" text_color="black"></label>
|
||||||
|
<label id="time_behind"
|
||||||
|
x_slot="7" y_slot="0" x_size="2" text_color="black"></label>
|
||||||
|
</grid>
|
||||||
|
</root>
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<root reference_width="2560" reference_height="1440">
|
<root reference_width="2560" reference_height="1440">
|
||||||
<grid id="main_grid" x_dim="1" y_dim="25" x_offset="10" y_offset="70" width="350" height="875"
|
<grid id="main_grid" x_dim="1" y_dim="25" x_offset="10" y_offset="70" width="350" height="875"
|
||||||
vert_align="top" hori_align="left" margin="0" padding="0"> </grid>
|
vert_align="top" hori_align="left" margin="0" padding="0"> </grid>
|
|
@ -26,8 +26,8 @@ pub struct LeaderBoard {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LeaderBoard {
|
impl LeaderBoard {
|
||||||
const GRID: &str = include_str!("ui_files/leaderboard_grid.xml");
|
const GRID: &str = include_str!("leaderboard_grid.xml");
|
||||||
const ENTRY: &str = include_str!("ui_files/leaderboard_entry.xml");
|
const ENTRY: &str = include_str!("leaderboard_entry.xml");
|
||||||
|
|
||||||
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
|
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
|
||||||
let gui = GuiBuilder::from_str(gui_handler, Self::GRID)?;
|
let gui = GuiBuilder::from_str(gui_handler, Self::GRID)?;
|
|
@ -1,6 +1,5 @@
|
||||||
mod leaderboard;
|
mod leaderboard;
|
||||||
mod pedals;
|
mod pedals;
|
||||||
mod pipeline;
|
|
||||||
mod radar;
|
mod radar;
|
||||||
mod watermark;
|
mod watermark;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub struct Pedals {
|
||||||
|
|
||||||
impl Pedals {
|
impl Pedals {
|
||||||
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
|
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
|
||||||
const DESC: &str = include_str!("ui_files/pedals.xml");
|
const DESC: &str = include_str!("pedals.xml");
|
||||||
|
|
||||||
let gui = GuiBuilder::from_str(gui_handler, DESC)?;
|
let gui = GuiBuilder::from_str(gui_handler, DESC)?;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<root reference_width="2560" reference_height="1440">
|
<root reference_width="2560" reference_height="1440">
|
||||||
<grid x_dim="7" y_dim="2" x_offset="-750" y_offset="-250" width="150" height="200"
|
<grid x_dim="7" y_dim="2" x_offset="-750" y_offset="-250" width="150" height="200"
|
||||||
vert_align="bottom" hori_align="right" margin="3" padding="3" background="#686868">
|
vert_align="bottom" hori_align="right" margin="3" padding="3" background="#686868">
|
|
@ -1,3 +1,5 @@
|
||||||
|
mod pipeline;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use cgmath::{ortho, vec2, vec3, vec4, Deg, InnerSpace, Matrix4, Rad, Vector2, Vector3, Vector4};
|
use cgmath::{ortho, vec2, vec3, vec4, Deg, InnerSpace, Matrix4, Rad, Vector2, Vector3, Vector4};
|
||||||
use rfactor_sm_reader::*;
|
use rfactor_sm_reader::*;
|
||||||
|
@ -6,7 +8,7 @@ use vulkan_rs::prelude::*;
|
||||||
|
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
use super::pipeline::SingleColorPipeline;
|
use pipeline::SingleColorPipeline;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
overlay::{
|
overlay::{
|
|
@ -3,7 +3,7 @@ use vulkan_rs::prelude::*;
|
||||||
|
|
||||||
use std::{mem, sync::Arc};
|
use std::{mem, sync::Arc};
|
||||||
|
|
||||||
use super::radar::PositionOnlyVertex;
|
use super::PositionOnlyVertex;
|
||||||
|
|
||||||
pub struct SingleColorPipeline {
|
pub struct SingleColorPipeline {
|
||||||
pipeline: Arc<Pipeline>,
|
pipeline: Arc<Pipeline>,
|
||||||
|
@ -19,12 +19,12 @@ impl SingleColorPipeline {
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let vertex_shader = ShaderModule::from_slice(
|
let vertex_shader = ShaderModule::from_slice(
|
||||||
device.clone(),
|
device.clone(),
|
||||||
include_bytes!("shader/single_color.vert.spv"),
|
include_bytes!("single_color.vert.spv"),
|
||||||
ShaderType::Vertex,
|
ShaderType::Vertex,
|
||||||
)?;
|
)?;
|
||||||
let fragment_shader = ShaderModule::from_slice(
|
let fragment_shader = ShaderModule::from_slice(
|
||||||
device.clone(),
|
device.clone(),
|
||||||
include_bytes!("shader/single_color.frag.spv"),
|
include_bytes!("single_color.frag.spv"),
|
||||||
ShaderType::Fragment,
|
ShaderType::Fragment,
|
||||||
)?;
|
)?;
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
<root>
|
|
||||||
<grid id="grid" x_dim="9" y_dim="1">
|
|
||||||
<label id="place" x_slot="0" y_slot="0" text_color="black"></label>
|
|
||||||
<label id="name" x_slot="1" y_slot="0" x_size="6" text_color="black"></label>
|
|
||||||
<label id="time_behind" x_slot="7" y_slot="0" x_size="2" text_color="black"></label>
|
|
||||||
</grid>
|
|
||||||
</root>
|
|
|
@ -15,7 +15,7 @@ pub struct Watermark {
|
||||||
|
|
||||||
impl Watermark {
|
impl Watermark {
|
||||||
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
|
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
|
||||||
const DESC: &str = include_str!("ui_files/watermark.xml");
|
const DESC: &str = include_str!("watermark.xml");
|
||||||
|
|
||||||
let gui = GuiBuilder::from_str(gui_handler, DESC)?;
|
let gui = GuiBuilder::from_str(gui_handler, DESC)?;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<root reference_width="2560" reference_height="1440">
|
<root reference_width="2560" reference_height="1440">
|
||||||
<grid x_dim="1" y_dim="1" x_offset="10" y_offset="10" width="300" height="50"
|
<grid x_dim="1" y_dim="1" x_offset="10" y_offset="10" width="300" height="50"
|
||||||
vert_align="top" hori_align="left" margin="2" padding="2" background="#c9c9c9">
|
vert_align="top" hori_align="left" margin="2" padding="2" background="#c9c9c9">
|
Loading…
Reference in a new issue