move constants to shared

This commit is contained in:
Vinzenz Schroeter 2024-05-09 16:43:56 +02:00
parent b56af905a0
commit 1eb1471d2a
3 changed files with 7 additions and 10 deletions

View file

@ -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;

View file

@ -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() {

View file

@ -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;