yet another api rework, removal of integer types in public api, optionals at the end, some cleaning

This commit is contained in:
veclavtalica
2024-10-29 12:25:24 +03:00
parent 6464d14b3e
commit 9121da0675
30 changed files with 191 additions and 342 deletions

View File

@ -56,7 +56,7 @@ void draw_sprite_args(const DrawSpriteArgs args) {
bool const stretch = m_or(args, stretch, false);
Rect const *texture_region = m_is_set(args, texture_region) ? &args.texture_region_opt : NULL;
draw_sprite(args.path, args.rect, texture_region, color, rotation, flip_x, flip_y, stretch);
draw_sprite(args.texture, args.rect, texture_region, color, rotation, flip_x, flip_y, stretch);
}
@ -216,7 +216,7 @@ void render_sprite_batch(const Primitive2D primitives[],
#pragma GCC diagnostic pop
const Vec2 c = center_rect(sprite.rect);
const Vec2 c = rect_center(sprite.rect);
const Vec2 t = fast_cossine(sprite.rotation + (float)M_PI_4);
const Vec2 d = {
.x = t.x * sprite.rect.w * (float)M_SQRT1_2,
@ -231,7 +231,7 @@ void render_sprite_batch(const Primitive2D primitives[],
} else {
/* rotated non-square case*/
const Vec2 c = center_rect(sprite.rect);
const Vec2 c = rect_center(sprite.rect);
const Vec2 t = fast_cossine(sprite.rotation);
const Vec2 h = { sprite.rect.w / 2, sprite.rect.h / 2 };