mirror of
https://github.com/kaesaecracker/servicepoint-simulator.git
synced 2025-01-18 10:30:14 +01:00
move constants to shared
This commit is contained in:
parent
b56af905a0
commit
1eb1471d2a
|
@ -1,5 +1,6 @@
|
||||||
use crate::{DISPLAY, PIXEL_HEIGHT, PIXEL_WIDTH};
|
use crate::DISPLAY;
|
||||||
use log::{debug, warn};
|
use log::{debug, warn};
|
||||||
|
use pixel_shared_rs::{PIXEL_HEIGHT, PIXEL_WIDTH};
|
||||||
use pixels::wgpu::TextureFormat;
|
use pixels::wgpu::TextureFormat;
|
||||||
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
|
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
|
||||||
use winit::application::ApplicationHandler;
|
use winit::application::ApplicationHandler;
|
||||||
|
|
|
@ -10,6 +10,7 @@ use crate::gui::App;
|
||||||
use crate::upd_loop::start_udp_thread;
|
use crate::upd_loop::start_udp_thread;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
use pixel_shared_rs::PIXEL_COUNT;
|
||||||
use winit::event_loop::{ControlFlow, EventLoop};
|
use winit::event_loop::{ControlFlow, EventLoop};
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
|
@ -18,13 +19,6 @@ struct Cli {
|
||||||
bind: String,
|
bind: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
const TILE_SIZE: u16 = 8;
|
|
||||||
const TILE_WIDTH: u16 = 65;
|
|
||||||
const TILE_HEIGHT: u16 = 20;
|
|
||||||
const PIXEL_WIDTH: u16 = TILE_WIDTH * TILE_SIZE;
|
|
||||||
const PIXEL_HEIGHT: u16 = TILE_HEIGHT * TILE_SIZE;
|
|
||||||
const PIXEL_COUNT: usize = PIXEL_WIDTH as usize * PIXEL_HEIGHT as usize;
|
|
||||||
|
|
||||||
static mut DISPLAY: [bool; PIXEL_COUNT] = [false; PIXEL_COUNT];
|
static mut DISPLAY: [bool; PIXEL_COUNT] = [false; PIXEL_COUNT];
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use crate::{DISPLAY, PIXEL_WIDTH, TILE_SIZE};
|
use crate::DISPLAY;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use pixel_shared_rs::{read_hdr_window, DisplayCommand, HdrWindow, ReadHdrWindowError};
|
use pixel_shared_rs::{
|
||||||
|
read_hdr_window, DisplayCommand, HdrWindow, ReadHdrWindowError, PIXEL_WIDTH, TILE_SIZE,
|
||||||
|
};
|
||||||
use std::io::ErrorKind;
|
use std::io::ErrorKind;
|
||||||
use std::mem::size_of;
|
use std::mem::size_of;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
|
|
Loading…
Reference in a new issue