mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 04:25:00 +01:00
Make light offset of tiles variable
This commit is contained in:
parent
07c7d628ee
commit
79e2ba7b83
7 changed files with 71 additions and 33 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use egui_inspect::derive::Inspect;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sfml::{
|
||||
graphics::RenderWindow,
|
||||
system::Vector2f,
|
||||
|
|
@ -23,16 +24,17 @@ impl ScreenRes {
|
|||
}
|
||||
}
|
||||
|
||||
// We assume this game won't be played above 32767*32767 resolution
|
||||
#[derive(Default, Clone, Copy, Debug, Inspect)]
|
||||
pub struct ScreenPos {
|
||||
pub x: ScreenPosScalar,
|
||||
pub y: ScreenPosScalar,
|
||||
#[derive(Default, Clone, Copy, Debug, Inspect, Serialize, Deserialize)]
|
||||
pub struct ScreenVec {
|
||||
pub x: ScreenSc,
|
||||
pub y: ScreenSc,
|
||||
}
|
||||
|
||||
pub type ScreenPosScalar = i16;
|
||||
/// Screen position/offset scalar
|
||||
/// We assume this game won't be played above 32767*32767 resolution
|
||||
pub type ScreenSc = i16;
|
||||
|
||||
impl ScreenPos {
|
||||
impl ScreenVec {
|
||||
pub fn to_sf_vec(self) -> Vector2f {
|
||||
Vector2f::new(self.x.into(), self.y.into())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue