animate clip rect, fix main app

This commit is contained in:
Krzosa Karol
2025-02-03 09:33:09 +01:00
parent 9f33ea0914
commit e7a2a775b2
9 changed files with 67 additions and 78 deletions

View File

@@ -6,26 +6,7 @@
#include "os_unix.c"
#endif
fn_test void os_test(void) {
os_date_t local_time = os_local_time();
os_date_t universal_time = os_universal_time();
debugf("local_time = %S | universal_time = %S", os_format_date(tcx->temp, local_time), os_format_date(tcx->temp, universal_time));
s8_t exe_dir = os_exe_dir(tcx->temp);
assert(exe_dir.str[exe_dir.len - 1] == '/');
s8_t exe = os_exe(tcx->temp);
s8_t cwd = os_cwd(tcx->temp);
assert(exe_dir.str[cwd.len - 1] == '/');
assert(os_is_dir(exe_dir));
assert(os_is_file(exe));
assert(os_is_dir(cwd));
assert(os_exists(exe_dir));
assert(os_exists(exe));
assert(os_exists(cwd));
assert(os_is_abs(exe_dir));
assert(os_is_abs(exe));
assert(os_is_abs(cwd));
assert(!os_is_abs(s8_lit("../path/")));
debugf("%S %S %S", exe_dir, exe, cwd);
fn s8_t os_format_date(ma_arena_t *arena, os_date_t date) {
s8_t result = s8_printf(arena, "%04u-%02u-%02u %02u:%02u:%02u.%03u", date.year, date.month, date.day, date.hour, date.min, date.sec, date.ms);
return result;
}

View File

@@ -28,11 +28,6 @@ fn os_date_t os_universal_time(void) {
return result;
}
fn s8_t os_format_date(ma_arena_t *arena, os_date_t date) {
s8_t result = s8_printf(arena, "%04u-%02u-%02u %02u:%02u:%02u.%03u", date.year, date.month, date.day, date.hour, date.min, date.sec, date.ms);
return result;
}
fn f64 os_seconds(void) {
static int64_t counts_per_second;
if (counts_per_second == 0) {
@@ -303,7 +298,7 @@ fn os_thread_t os_thread_create(ma_arena_t *arena, os_thread_fn_t *func, void *u
return result;
}
fn i32 os_join(os_thread_t *thread) {
fn i32 os_thread_join(os_thread_t *thread) {
DWORD return_value_indicates_event = WaitForSingleObject(thread->w32->handle, INFINITE);
if (return_value_indicates_event != WAIT_OBJECT_0) {
debugf(__FUNCTION__".WaitForSingleObject failed: %d", GetLastError());
@@ -337,7 +332,7 @@ fn i32 os_join(os_thread_t *thread) {
// threads[i] = os_thread_create(scratch.arena, os__thread_log, NULL);
// }
// for (int i = 0; i < lengthof(threads); i += 1) {
// os_join(&threads[i]);
// os_thread_join(&threads[i]);
// }
// ma_end_scratch(scratch);
// }