aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main.odin b/src/main.odin
index 8703a64..8bd1a77 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -20,6 +20,8 @@ Rect :: struct {
size: Vec2,
}
+ROOM_FADE_SIZE :: 16
+
state: struct {
debug_mode: bool,
camera_target: Vec2,
@@ -79,7 +81,9 @@ frame :: proc() {
draw_new_frame()
- rl.BeginMode2D(state.camera)
+ cam := state.camera
+ cam.target = linalg.round(cam.target)
+ rl.BeginMode2D(cam)
renderer.tint = {0.2, 0.2, 0.2, 1}
draw_rect({
@@ -95,15 +99,15 @@ frame :: proc() {
rl.DrawRectangleGradientH(
0,
0,
- 8,
+ ROOM_FADE_SIZE,
current_room.height,
rl.BLACK,
rl.BLANK,
)
rl.DrawRectangleGradientH(
- current_room.width - 8,
+ current_room.width - ROOM_FADE_SIZE,
0,
- 8,
+ ROOM_FADE_SIZE,
current_room.height,
rl.BLANK,
rl.BLACK,
@@ -112,15 +116,15 @@ frame :: proc() {
0,
0,
current_room.width,
- 8,
+ ROOM_FADE_SIZE,
rl.BLACK,
rl.BLANK,
)
rl.DrawRectangleGradientV(
0,
- current_room.height - 8,
+ current_room.height - ROOM_FADE_SIZE,
current_room.width,
- 8,
+ ROOM_FADE_SIZE,
rl.BLANK,
rl.BLACK,
)