aboutsummaryrefslogtreecommitdiff
path: root/src/draw
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw')
-rw-r--r--src/draw/animation.odin2
-rw-r--r--src/draw/draw.odin27
-rw-r--r--src/draw/sprite.odin1
3 files changed, 15 insertions, 15 deletions
diff --git a/src/draw/animation.odin b/src/draw/animation.odin
index e6b50d1..a59fe5f 100644
--- a/src/draw/animation.odin
+++ b/src/draw/animation.odin
@@ -1,7 +1,7 @@
package draw
-import "core:log"
import "core:encoding/json"
+import "core:log"
import "core:os"
import "core:path/filepath"
import "core:strings"
diff --git a/src/draw/draw.odin b/src/draw/draw.odin
index 122e6fa..c4dae9f 100644
--- a/src/draw/draw.odin
+++ b/src/draw/draw.odin
@@ -1,7 +1,7 @@
package draw
-import "core:math"
import "core:c"
+import "core:math"
import rl "vendor:raylib"
@@ -27,7 +27,7 @@ renderer: struct {
@(private)
color_to_rl :: proc(col: Color) -> rl.Color {
- return rl.Color{
+ return rl.Color {
u8(col.r * 255),
u8(col.g * 255),
u8(col.b * 255),
@@ -59,7 +59,7 @@ end_frame :: proc() {
f32(rl.GetScreenWidth()) / f32(SCREEN_WIDTH),
f32(rl.GetScreenHeight()) / f32(SCREEN_HEIGHT),
)
- screen_start := Vec2{
+ screen_start := Vec2 {
(f32(rl.GetScreenWidth()) - (SCREEN_WIDTH * scale)) / 2,
(f32(rl.GetScreenHeight()) - (SCREEN_HEIGHT * scale)) / 2,
}
@@ -77,13 +77,15 @@ rect :: proc(rect: Rect) {
assert(rect.size.x > 0 && rect.size.y > 0)
rl.DrawRectangle(
- c.int(rect.start.x), c.int(rect.start.y),
- c.int(rect.size.x), c.int(rect.size.y),
+ c.int(rect.start.x),
+ c.int(rect.start.y),
+ c.int(rect.size.x),
+ c.int(rect.size.y),
color_to_rl(renderer.tint),
)
}
-texture :: proc{
+texture :: proc {
texture_full,
texture_quad,
}
@@ -107,9 +109,11 @@ texture_quad :: proc(
rl.DrawTexturePro(
img,
transmute(rl.Rectangle)quad,
- rl.Rectangle{
- position.x, position.y,
- quad.size.x * scale.x, quad.size.y * scale.y,
+ rl.Rectangle {
+ position.x,
+ position.y,
+ quad.size.x * scale.x,
+ quad.size.y * scale.y,
},
offset,
rotation,
@@ -124,10 +128,7 @@ texture_full :: proc(
rotation: f32 = 0,
scale := Vec2{1, 1},
) {
- size := Vec2{
- f32(img.width),
- -f32(img.height),
- }
+ size := Vec2{f32(img.width), -f32(img.height)}
texture_quad(img, Rect{Vec2{0, 0}, size}, position, offset, rotation, scale)
}
diff --git a/src/draw/sprite.odin b/src/draw/sprite.odin
index 3a90dfe..f7cd87b 100644
--- a/src/draw/sprite.odin
+++ b/src/draw/sprite.odin
@@ -3,4 +3,3 @@ package draw
import "core:log"
import rl "vendor:raylib"
-