summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-11-10 12:06:41 -0500
committerFreya Murphy <freya@freyacat.org>2025-11-10 12:06:41 -0500
commit0b81cb61300c0b21b256e289f4b6f5a2252d3f0e (patch)
tree8238187250e4e4fb900240e55f28322a5188be83 /graphics
parentgraphics: fix atlas rendering offset bug, and make minimap scalable past 48px (diff)
downloadDungeonCrawl-0b81cb61300c0b21b256e289f4b6f5a2252d3f0e.tar.gz
DungeonCrawl-0b81cb61300c0b21b256e289f4b6f5a2252d3f0e.tar.bz2
DungeonCrawl-0b81cb61300c0b21b256e289f4b6f5a2252d3f0e.zip
update raylib to 5.6-dev
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/lib.rs1
-rw-r--r--graphics/src/render.rs27
2 files changed, 9 insertions, 19 deletions
diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs
index 5c1161b..27e49d3 100644
--- a/graphics/src/lib.rs
+++ b/graphics/src/lib.rs
@@ -48,7 +48,6 @@ impl Window {
.title(title)
.resizable()
.log_level(TraceLogLevel::LOG_WARNING)
- .vsync()
.build();
// update window min size
diff --git a/graphics/src/render.rs b/graphics/src/render.rs
index 8e5869a..1061af3 100644
--- a/graphics/src/render.rs
+++ b/graphics/src/render.rs
@@ -240,14 +240,7 @@ impl Renderer {
RENDER_WIDTH as f32 * scale,
RENDER_HEIGHT as f32 * scale,
};
- r.draw_texture_pro(
- &fb,
- source_rec,
- dest_rec,
- Vector2::zero(),
- 0.0,
- Color::WHITE,
- );
+ r.draw_texture_pro(&fb, source_rec, dest_rec, Vector2::ZERO, 0.0, Color::WHITE);
// Restore the fb
self.framebuffer = Some(fb);
@@ -604,7 +597,7 @@ impl Renderer {
tex,
FULL_SOURCE_REC,
dest_rec,
- Vector2::zero(),
+ Vector2::ZERO,
0.0,
Color::WHITE,
);
@@ -764,16 +757,14 @@ impl DungeonExt for Dungeon {
}
trait Vector2Ext {
- fn min(self, other: Self) -> Self;
- fn max(self, other: Self) -> Self;
+ fn scale_by(self, amt: f32) -> Self;
}
impl Vector2Ext for Vector2 {
- fn min(self, other: Self) -> Self {
- Self::new(self.x.min(other.x), self.y.min(other.y))
- }
-
- fn max(self, other: Self) -> Self {
- Self::new(self.x.max(other.x), self.y.max(other.y))
+ fn scale_by(self, amt: f32) -> Self {
+ Self {
+ x: self.x * amt,
+ y: self.y * amt,
+ }
}
}
@@ -841,7 +832,7 @@ where
width * scale,
height * scale,
};
- let origin = Vector2::zero();
+ let origin = Vector2::ZERO;
self.draw_texture_pro(tex, source_rec, dest_rec, origin, 0.0, Color::WHITE);
}