Update code to use stdlib
This commit is contained in:
10
src/ui.c
10
src/ui.c
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user