This commit is contained in:
nora 2023-04-17 20:15:43 +02:00
parent 46881771b8
commit 613ed710a2
4 changed files with 11 additions and 66 deletions

View file

@ -77,19 +77,8 @@ impl App {
let mut rst = RenderStates::default();
rst.blend_mode = BlendMode::MULTIPLY;
self.light_map.display();
spr.set_texture(self.light_map.texture(), false);
self.rw.draw_with_renderstates(&spr, &rst);
drop(spr);
self.rt.clear(Color::TRANSPARENT);
let ui_dims = Vector2 {
x: (self.rw.size().x / self.scale as u32) as f32,
y: (self.rw.size().y / self.scale as u32) as f32,
};
self.game.draw_ui(&mut self.rt, &self.res, ui_dims);
self.rt.display();
let mut spr = Sprite::with_texture(self.rt.texture());
spr.set_scale((self.scale as f32, self.scale as f32));
self.rw.draw(&spr);
self.sf_egui
.do_frame(|ctx| {
debug::do_debug_ui(
@ -102,20 +91,7 @@ impl App {
);
})
.unwrap();
if self.debug.show_atlas {
let atlas = &self.res.atlas.tex;
let size = atlas.size();
let mut rs = RectangleShape::from_rect(
Rect::new(0., 0., size.x as f32, size.y as f32),
);
rs.set_fill_color(Color::MAGENTA);
self.rw.draw(&rs);
self.rw.draw(&Sprite::with_texture(atlas));
}
self.sf_egui.draw(&mut self.rw, None);
self.rw.display();
drop(spr);
self.execute_commands();
}
fn execute_commands(&mut self) {
loop {}

View file

@ -5,11 +5,7 @@ use std::{fmt::Debug, marker::PhantomData, ops::Index};
use egui_inspect::{derive::Inspect, Inspect};
use serde::{Deserialize, Serialize};
use crate::{
graphics::ScreenVec,
math::{IntRect, TILE_SIZE},
texture_atlas::RectMap,
};
use crate::{math::TILE_SIZE, texture_atlas::RectMap};
#[derive(Inspect, PartialEq, Eq)]
pub struct TileId<Layer>(pub u16, PhantomData<Layer>);
@ -103,9 +99,6 @@ where
Layer::SpecificDef: Debug + Inspect,
{
/// Whether the tile emits light, and the light source offset
pub light: Option<ScreenVec>,
pub graphic_name: String,
pub tex_rect: IntRect,
pub layer: Layer::SpecificDef,
//ADD pub blend_graphic: String,
}
@ -212,12 +205,3 @@ where
{
loop {}
}
fn update_rect_def<Layer: TileLayer>(
def: &mut TileDef<Layer>,
rects: &std::collections::HashMap<String, IntRect>,
) where
Layer::SpecificDef: Debug + Inspect,
{
loop {}
}

View file

@ -1,13 +1,14 @@
use crate::{
tiles::{BgTileId, FgTileId, MidTileId, TileId},
world::{ChunkPos, Tile as Tl, CHUNK_EXTENT},
};
use worldgen::{
constraint, noise::perlin::PerlinNoise,
constraint,
noise::perlin::PerlinNoise,
noisemap::{NoiseMap, NoiseMapGenerator, Seed, Step},
world::{
tile::{Constraint, ConstraintType},
Size, Tile, World,
},
};
use crate::{
tiles::{BgTileId, FgTileId, MidTileId, TileId},
world::{ChunkPos, Tile as Tl, CHUNK_EXTENT},
};
pub(crate) struct Worldgen {}

View file

@ -5,11 +5,7 @@ use std::{fmt::Debug, marker::PhantomData, ops::Index};
use egui_inspect::{derive::Inspect, Inspect};
use serde::{Deserialize, Serialize};
use crate::{
graphics::ScreenVec,
math::{IntRect, TILE_SIZE},
texture_atlas::RectMap,
};
use crate::{math::TILE_SIZE, texture_atlas::RectMap};
#[derive(Inspect, PartialEq, Eq)]
pub struct TileId<Layer>(pub u16, PhantomData<Layer>);
@ -103,9 +99,6 @@ where
Layer::SpecificDef: Debug + Inspect,
{
/// Whether the tile emits light, and the light source offset
pub light: Option<ScreenVec>,
pub graphic_name: String,
pub tex_rect: IntRect,
pub layer: Layer::SpecificDef,
//ADD pub blend_graphic: String,
}
@ -212,12 +205,3 @@ where
{
loop {}
}
fn update_rect_def<Layer: TileLayer>(
def: &mut TileDef<Layer>,
rects: &std::collections::HashMap<String, IntRect>,
) where
Layer::SpecificDef: Debug + Inspect,
{
loop {}
}