made the switch to using bracket-lib directly, instead of rltk wrapper
this should solve the build issues; it makes using the non-crashing github build a lot easier, because it lets the explicit rltk dependency be removed.
This commit is contained in:
parent
455b8f2d80
commit
85efe13dc5
93 changed files with 1528 additions and 770 deletions
|
|
@ -1,10 +1,10 @@
|
|||
use super::{ BuilderMap, MetaMapBuilder, Rect, TileType };
|
||||
use rltk::RandomNumberGenerator;
|
||||
use bracket_lib::prelude::*;
|
||||
|
||||
pub struct RoomDrawer {}
|
||||
|
||||
impl MetaMapBuilder for RoomDrawer {
|
||||
fn build_map(&mut self, rng: &mut rltk::RandomNumberGenerator, build_data: &mut BuilderMap) {
|
||||
fn build_map(&mut self, rng: &mut RandomNumberGenerator, build_data: &mut BuilderMap) {
|
||||
self.build(rng, build_data);
|
||||
}
|
||||
}
|
||||
|
|
@ -29,14 +29,11 @@ impl RoomDrawer {
|
|||
fn circle(&mut self, build_data: &mut BuilderMap, room: &Rect) {
|
||||
let radius = (i32::min(room.x2 - room.x1, room.y2 - room.y1) as f32) / 2.0;
|
||||
let center = room.center();
|
||||
let center_pt = rltk::Point::new(center.x, center.y);
|
||||
let center_pt = Point::new(center.x, center.y);
|
||||
for y in room.y1..=room.y2 {
|
||||
for x in room.x1..=room.x2 {
|
||||
let idx = build_data.map.xy_idx(x, y);
|
||||
let distance = rltk::DistanceAlg::Pythagoras.distance2d(
|
||||
center_pt,
|
||||
rltk::Point::new(x, y)
|
||||
);
|
||||
let distance = DistanceAlg::Pythagoras.distance2d(center_pt, Point::new(x, y));
|
||||
if
|
||||
idx > 0 &&
|
||||
idx < ((build_data.map.width * build_data.map.height - 1) as usize) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue