Update code to use stdlib

This commit is contained in:
2024-02-24 20:45:09 +00:00
parent 84873f1e98
commit 84cdb87a19
11 changed files with 26 additions and 19 deletions

View File

@@ -1,6 +1,6 @@
#include "ui.h"
#include "SDL_events.h"
#include "aliases/aliases.h"
#include "aliases.h"
#include "math_utils.h"
#include "window.h"
#include <math.h>
@@ -12,8 +12,8 @@
line ui_noodle(const window *wnd, ui_ctx *ctx, line ln,
ui_elem_colours colours);
INTERNAL bool aabb(rect rec, i32 x, i32 y);
INTERNAL line line_from_origin(point origin, f64 angle, i32 line_length);
internal bool aabb(rect rec, i32 x, i32 y);
internal line line_from_origin(point origin, f64 angle, i32 line_length);
void init_ui_ctx(ui_ctx *ctx) {
*ctx = (ui_ctx){0};
@@ -255,12 +255,12 @@ line ui_noodle(const window *wnd, ui_ctx *ctx, line ln,
return ln;
}
INTERNAL bool aabb(rect rec, i32 x, i32 y) {
internal bool aabb(rect rec, i32 x, i32 y) {
return x > rec.topleft.x && x <= rec.topleft.x + rec.w && y > rec.topleft.y &&
y <= rec.topleft.y + rec.h;
}
INTERNAL line line_from_origin(point origin, f64 angle, i32 line_length) {
internal line line_from_origin(point origin, f64 angle, i32 line_length) {
f64 rad = radians(angle);
f64 direction = angle / absolute(angle) * -1;