From db6223bb86b45e0e6d4da86b33cc036d52b53421 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 30 Jun 2024 21:05:31 -0400 Subject: [PATCH] added floor not sure if needed yet, was used when refining positioning --- VEFontCache/mappings.odin | 28 ++++++++++++++++++++++++---- VEFontCache/misc.odin | 3 ++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/VEFontCache/mappings.odin b/VEFontCache/mappings.odin index 085006f..55f2b9d 100644 --- a/VEFontCache/mappings.odin +++ b/VEFontCache/mappings.odin @@ -12,6 +12,16 @@ import "core:math" ceil_f64 :: math.ceil_f64 ceil_f64le :: math.ceil_f64le ceil_f64be :: math.ceil_f64be + + floor_f16 :: math.floor_f16 + floor_f16le :: math.floor_f16le + floor_f16be :: math.floor_f16be + floor_f32 :: math.floor_f32 + floor_f32le :: math.floor_f32le + floor_f32be :: math.floor_f32be + floor_f64 :: math.floor_f64 + floor_f64le :: math.floor_f64le + floor_f64be :: math.floor_f64be import "core:math/linalg" import "core:mem" Kilobyte :: mem.Kilobyte @@ -23,10 +33,6 @@ import "core:mem" Arena :: mem.Arena arena_allocator :: mem.arena_allocator arena_init :: mem.arena_init -// import "codebase:grime" -// log :: grime.log -// logf :: grime.logf -// profile :: grime.profile //#region("Proc overload mappings") @@ -54,6 +60,20 @@ clear :: proc { clear_dynamic_array, } +floor :: proc { + math.floor_f16, + math.floor_f16le, + math.floor_f16be, + math.floor_f32, + math.floor_f32le, + math.floor_f32be, + math.floor_f64, + math.floor_f64le, + math.floor_f64be, + + floor_vec2, +} + make :: proc { make_dynamic_array, make_dynamic_array_len, diff --git a/VEFontCache/misc.odin b/VEFontCache/misc.odin index 8470fd1..9976050 100644 --- a/VEFontCache/misc.odin +++ b/VEFontCache/misc.odin @@ -16,7 +16,8 @@ vec2_64_from_vec2 :: #force_inline proc "contextless" ( v2 : Vec2 ) -> Vec2 vec2_from_vec2i :: #force_inline proc "contextless" ( v2i : Vec2i ) -> Vec2 { return { f32(v2i.x), f32(v2i.y) }} vec2i_from_vec2 :: #force_inline proc "contextless" ( v2 : Vec2 ) -> Vec2i { return { i32(v2.x), i32(v2.y) }} -@(require_results) ceil_vec2 :: proc "contextless" ( v : Vec2 ) -> Vec2 { return { ceil_f32(v.x), ceil_f32(v.y) } } +@(require_results) ceil_vec2 :: proc "contextless" ( v : Vec2 ) -> Vec2 { return { ceil_f32(v.x), ceil_f32(v.y) } } +@(require_results) floor_vec2 :: proc "contextless" ( v : Vec2 ) -> Vec2 { return { floor_f32(v.x), floor_f32(v.y) } } // This buffer is used below excluisvely to prevent any allocator recusion when verbose logging from allocators. // This means a single line is limited to 4k buffer