diff --git a/src/ase/ase.h b/src/ase/ase.h index 66f5d443..d817401d 100644 --- a/src/ase/ase.h +++ b/src/ase/ase.h @@ -205,14 +205,14 @@ Struct(Ace_Cel) }; //////////////////////////////////////////////////////////// -//~ Ase bitbuff operations +//~ Ase bitbuff helpers u32 ASE_PeekBits(ASE_Bitbuff *bb, u32 nbits); u32 ASE_ConsumeBits(ASE_Bitbuff *bb, u32 nbits); void ASE_SkipBits(ASE_Bitbuff *bb, u32 nbits); //////////////////////////////////////////////////////////// -//~ Inflate operations +//~ Inflate u32 ASE_ReverseBits(u32 v, u32 bit_count); ASE_HuffDict ASE_InitHuffDict(Arena *arena, u32 max_code_bits, u32 *bl_counts, u32 bl_counts_count); diff --git a/src/base/base.cgh b/src/base/base.cgh index 5b41ee31..040650b0 100644 --- a/src/base/base.cgh +++ b/src/base/base.cgh @@ -549,28 +549,28 @@ StaticAssert(alignof(Atomic64Padded) == CachelineSize && sizeof(Atomic64Padded) % CachelineSize == 0); #if IsPlatformWindows && IsArchX64 - //- 8 bit atomic operations + //- 8 bit atomic ops ForceInline i8 Atomic8Fetch (Atomic8 *x) { CompilerBarrier(); i8 result = x->_v; CompilerBarrier(); return result; } ForceInline void Atomic8Set (Atomic8 *x, i8 e) { CompilerBarrier(); x->_v = e; CompilerBarrier(); } ForceInline i8 Atomic8FetchSet (Atomic8 *x, i8 e) { return (i8)_InterlockedExchange8((volatile char *)&x->_v, e); } ForceInline i8 Atomic8FetchTestSet (Atomic8 *x, i8 c, i8 e) { return (i8)_InterlockedCompareExchange8((volatile char *)&x->_v, e, c); } ForceInline i8 Atomic8FetchXor (Atomic8 *x, i8 c) { return (i8)_InterlockedXor8((volatile char *)&x->_v, c); } ForceInline i8 Atomic8FetchAdd (Atomic8 *x, i8 a) { return (i8)_InterlockedExchangeAdd8((volatile char *)&x->_v, a); } - //- 16 bit atomic operations + //- 16 bit atomic ops ForceInline i16 Atomic16Fetch (Atomic16 *x) { CompilerBarrier(); i16 result = x->_v; CompilerBarrier(); return result; } ForceInline void Atomic16Set (Atomic16 *x, i16 e) { CompilerBarrier(); x->_v = e; CompilerBarrier(); } ForceInline i16 Atomic16FetchSet (Atomic16 *x, i16 e) { return (i16)_InterlockedExchange16(&x->_v, e); } ForceInline i16 Atomic16FetchTestSet (Atomic16 *x, i16 c, i16 e) { return (i16)_InterlockedCompareExchange16(&x->_v, e, c); } ForceInline i16 Atomic16FetchXor (Atomic16 *x, i16 c) { return (i16)_InterlockedXor16(&x->_v, c); } ForceInline i16 Atomic16FetchAdd (Atomic16 *x, i16 a) { return (i16)_InterlockedExchangeAdd16(&x->_v, a); } - //- 32 bit atomic operations + //- 32 bit atomic ops ForceInline i32 Atomic32Fetch (Atomic32 *x) { CompilerBarrier(); i32 result = x->_v; CompilerBarrier(); return result; } ForceInline void Atomic32Set (Atomic32 *x, i32 e) { CompilerBarrier(); x->_v = e; CompilerBarrier(); } ForceInline i32 Atomic32FetchSet (Atomic32 *x, i32 e) { return (i32)_InterlockedExchange((volatile long *)&x->_v, e); } ForceInline i32 Atomic32FetchTestSet (Atomic32 *x, i32 c, i32 e) { return (i32)_InterlockedCompareExchange((volatile long *)&x->_v, e, c); } ForceInline i32 Atomic32FetchXor (Atomic32 *x, i32 c) { return (i32)_InterlockedXor((volatile long *)&x->_v, c); } ForceInline i32 Atomic32FetchAdd (Atomic32 *x, i32 a) { return (i32)_InterlockedExchangeAdd((volatile long *)&x->_v, a); } - //- 64 bit atomic operations + //- 64 bit atomic ops ForceInline i64 Atomic64Fetch (Atomic64 *x) { CompilerBarrier(); i64 result = x->_v; CompilerBarrier(); return result; } ForceInline void Atomic64Set (Atomic64 *x, i64 e) { CompilerBarrier(); x->_v = e; CompilerBarrier(); } ForceInline i64 Atomic64FetchSet (Atomic64 *x, i64 e) { return (i64)_InterlockedExchange64(&x->_v, e); } diff --git a/src/base/base_buddy.h b/src/base/base_buddy.h index af2dc3ca..a9f9ddbd 100644 --- a/src/base/base_buddy.h +++ b/src/base/base_buddy.h @@ -36,13 +36,13 @@ Struct(BuddyCtx) }; //////////////////////////////////////////////////////////// -//~ Buddy context operations +//~ Buddy context BuddyCtx *AcquireBuddyCtx(u64 reserve); void ReleaseBuddyCtx(BuddyCtx *ctx); //////////////////////////////////////////////////////////// -//~ Buddy block operations +//~ Buddy block //- Acquire / release BuddyBlock *AcquireBuddyBlock(BuddyCtx *ctx, u64 size); diff --git a/src/base/base_cmdline.c b/src/base/base_cmdline.c index 82448d31..fc6b2571 100644 --- a/src/base/base_cmdline.c +++ b/src/base/base_cmdline.c @@ -1,9 +1,9 @@ SharedCmdlineState shared_cmdline_state = ZI; //////////////////////////////////////////////////////////// -//~ Initialization +//~ Bootstrap -void InitCmdline(void) +void BootstrapCmdline(void) { SharedCmdlineState *g = &shared_cmdline_state; TempArena scratch = BeginScratchNoConflict(); @@ -73,7 +73,7 @@ void InitCmdline(void) } //////////////////////////////////////////////////////////// -//~ Command line operations +//~ Command line String StringFromCommandlineIdx(i32 idx) { diff --git a/src/base/base_cmdline.h b/src/base/base_cmdline.h index 816d2c1f..4bb39eea 100644 --- a/src/base/base_cmdline.h +++ b/src/base/base_cmdline.h @@ -31,12 +31,12 @@ Struct(SharedCmdlineState) } extern shared_cmdline_state; //////////////////////////////////////////////////////////// -//~ Initialization +//~ Bootstrap -void InitCmdline(void); +void BootstrapCmdline(void); //////////////////////////////////////////////////////////// -//~ Command line operations +//~ Command line String StringFromCommandlineIdx(i32 idx); CommandlineArg CommandlineArgFromName(String name); diff --git a/src/base/base_file.h b/src/base/base_file.h index 98558a92..b84dfb06 100644 --- a/src/base/base_file.h +++ b/src/base/base_file.h @@ -15,7 +15,7 @@ Struct(OS_File) }; //////////////////////////////////////////////////////////// -//~ @hookdecl File system operations +//~ @hookdecl File system OS_File OS_OpenFile(String path, OS_FileFlag flags, i64 timeout_ns); void OS_CloseFile(OS_File file); diff --git a/src/base/base_futex.h b/src/base/base_futex.h index 121b8b47..299879f4 100644 --- a/src/base/base_futex.h +++ b/src/base/base_futex.h @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////// -//~ @hookdecl Not-equal futex operations +//~ @hookdecl Not-equal futex ops /* Similar to Win32 WaitOnAddress & WakeByAddressAll * i.e. - Suprious wait until value at address != cmp */ @@ -8,7 +8,7 @@ void FutexYieldNeq(volatile void *addr, void *cmp, u8 cmp_size); void FutexWakeNeq(void *addr); //////////////////////////////////////////////////////////// -//~ @hookdecl Greater-than-or-equal futex operations +//~ @hookdecl Greater-than-or-equal futex ops /* Similar to Win32 WaitOnAddress & WakeByAddressAll * i.e. - Spurious wait until monotonically increasing value at address >= cmp (used for fences) diff --git a/src/base/base_log.h b/src/base/base_log.h index 2d5dfae6..0b8ee8f7 100644 --- a/src/base/base_log.h +++ b/src/base/base_log.h @@ -130,12 +130,12 @@ Global Readonly LogLevelSettings log_settings[LogLevel_Count] = { #endif //////////////////////////////////////////////////////////// -//~ @hookdecl Init hooks +//~ @hookdecl Bootstrap -void InitLogSystem(String logfile_path); +void BootstrapLogs(String logfile_path); //////////////////////////////////////////////////////////// -//~ @hookdecl Log hooks +//~ @hookdecl Log /* NOTE: Calling these functions rather than using the logging macros may result in logs that are compiled regardless of log level. */ diff --git a/src/base/base_math.c b/src/base/base_math.c index b192dde8..56a3c4e1 100644 --- a/src/base/base_math.c +++ b/src/base/base_math.c @@ -804,7 +804,7 @@ i64 LerpU64(u64 val0, u64 val1, f64 t) } //////////////////////////////////////////////////////////// -//~ Color operations +//~ Color f32 SrgbFromLinearF32(f32 lin) { @@ -877,7 +877,7 @@ Vec4 BlendSrgb(Vec4 v0, Vec4 v1, f32 t) } //////////////////////////////////////////////////////////// -//~ Vec2 operations +//~ Vec2 b32 IsVec2Zero(Vec2 a) { @@ -1103,7 +1103,7 @@ Vec2 SlerpVec2(Vec2 val0, Vec2 val1, f32 t) } //////////////////////////////////////////////////////////// -//~ Vec2I32 Operations +//~ Vec2I32 b32 MatchVec2I32(Vec2I32 a, Vec2I32 b) { @@ -1126,7 +1126,7 @@ Vec2I32 SubVec2I32(Vec2I32 a, Vec2I32 b) } //////////////////////////////////////////////////////////// -//~ Vec4 operations +//~ Vec4 Vec4 Vec4FromU32(u32 v) { @@ -1149,7 +1149,7 @@ u32 U32FromVec4(Vec4 v) } //////////////////////////////////////////////////////////// -//~ Xform operations +//~ Xform b32 MatchXform(Xform xf1, Xform xf2) { @@ -1366,7 +1366,7 @@ Vec2 ScaleFromXform(Xform xf) } //////////////////////////////////////////////////////////// -//~ Spring operations +//~ Spring /* https://box2d.org/files/ErinCatto_SoftConstraints_GDC2011.pdf */ SoftSpring MakeSpring(f32 hertz, f32 damping_ratio, f32 dt) @@ -1392,7 +1392,7 @@ SoftSpring MakeSpring(f32 hertz, f32 damping_ratio, f32 dt) } //////////////////////////////////////////////////////////// -//~ Mat4x4 operations +//~ Mat4x4 Mat4x4 Mat4x4FromXform(Xform xf) { diff --git a/src/base/base_math.h b/src/base/base_math.h index 77af776b..92968740 100644 --- a/src/base/base_math.h +++ b/src/base/base_math.h @@ -283,7 +283,7 @@ i32 LerpU32(u32 val0, u32 val1, f32 t); i64 LerpU64(u64 val0, u64 val1, f64 t); //////////////////////////////////////////////////////////// -//~ Color operations +//~ Color f32 SrgbFromLinearF32(f32 lin); f32 LinearFromSrgbF32(f32 srgb); @@ -293,7 +293,7 @@ u32 LinearU32FromSrgb(Vec4 srgb); Vec4 BlendSrgb(Vec4 v0, Vec4 v1, f32 t); //////////////////////////////////////////////////////////// -//~ Vec2 operations +//~ Vec2 b32 IsVec2Zero(Vec2 a); b32 MatchVec2(Vec2 a, Vec2 b); @@ -349,7 +349,7 @@ Vec2 LerpVec2Vec2(Vec2 val0, Vec2 val1, Vec2 t); Vec2 SlerpVec2(Vec2 val0, Vec2 val1, f32 t); //////////////////////////////////////////////////////////// -//~ Vec2I32 Operations +//~ Vec2I32 #define Vec2I32FromFields(v) VEC2I32((v).x, (v).y) @@ -359,13 +359,13 @@ Vec2I32 AddVec2I32(Vec2I32 a, Vec2I32 b); Vec2I32 SubVec2I32(Vec2I32 a, Vec2I32 b); //////////////////////////////////////////////////////////// -//~ Vec4 operations +//~ Vec4 Vec4 Vec4FromU32(u32 v); u32 U32FromVec4(Vec4 v); //////////////////////////////////////////////////////////// -//~ Xform operations +//~ Xform b32 MatchXform(Xform xf1, Xform xf2); @@ -418,12 +418,12 @@ Vec2 ScaleFromXform(Xform xf); #define TRS(...) ((Trs) { .t = VEC2(0,0), .s = VEC2(1, 1), .r = 0, __VA_ARGS__ }) //////////////////////////////////////////////////////////// -//~ Spring operations +//~ Spring SoftSpring MakeSpring(f32 hertz, f32 damping_ratio, f32 dt); //////////////////////////////////////////////////////////// -//~ Mat4x4 operations +//~ Mat4x4 Mat4x4 Mat4x4FromXform(Xform xf); Mat4x4 Mat4x4FromOrtho(f32 left, f32 right, f32 bottom, f32 top, f32 near_z, f32 far_z); diff --git a/src/base/base_memory.h b/src/base/base_memory.h index 27fc59d7..5dd1333a 100644 --- a/src/base/base_memory.h +++ b/src/base/base_memory.h @@ -14,7 +14,7 @@ void SetMemoryReadonly(void *address, u64 size); void SetMemoryReadWrite(void *address, u64 size); //////////////////////////////////////////////////////////// -//~ Memory operations +//~ Memory ops //- Wrappers #define MatchBytes(p1, p2, n) (CmpBytes((p1), (p2), (n)) == 0) diff --git a/src/base/base_rand.c b/src/base/base_rand.c index db708a7b..a8cb5a4a 100644 --- a/src/base/base_rand.c +++ b/src/base/base_rand.c @@ -1,6 +1,3 @@ -//////////////////////////////////////////////////////////// -//~ Stateful randomness - u64 RandU64FromState(RandState *state) { u64 seed = state->seed; @@ -17,9 +14,6 @@ f64 RandF64FromState(RandState *state, f64 range_start, f64 range_end) return range_start + (range_end - range_start) * ((f64)(RandU64FromState(state) % RandMaxF64) / (f64)RandMaxF64); } -//////////////////////////////////////////////////////////// -//~ Seeded randomness - /* Based on Jon Maiga's "mx3" * https://jonkagstrom.com/mx3/mx3_rev2.html */ diff --git a/src/base/base_rand.h b/src/base/base_rand.h index 35c585b9..ac228f0e 100644 --- a/src/base/base_rand.h +++ b/src/base/base_rand.h @@ -11,13 +11,13 @@ Struct(RandState) #define RandMaxF64 U64Max //////////////////////////////////////////////////////////// -//~ Rand operations +//~ Rand ops -//- Stateful randomness +//- Stateful u64 RandU64FromState(RandState *state); f64 RandF64FromState(RandState *state, f64 range_start, f64 range_end); -//- Seeded randomness +//- Seeded u64 RandU64FromSeed(u64 seed); u64 RandU64FromSeeds(u64 seed_a, u64 seed_b); f64 RandF64FromSeed(u64 seed, f64 range_start, f64 range_end); diff --git a/src/base/base_resource.c b/src/base/base_resource.c index 019dd66f..6ddfe1e1 100644 --- a/src/base/base_resource.c +++ b/src/base/base_resource.c @@ -3,7 +3,7 @@ SharedResourceState shared_resource_state = ZI; //////////////////////////////////////////////////////////// //~ Bootstrap -void InitResourceSystem(u64 archive_strings_count, String *archive_strings) +void BootstrapResources(u64 archive_strings_count, String *archive_strings) { SharedResourceState *g = &shared_resource_state; Arena *perm = PermArena(); @@ -41,8 +41,9 @@ void InitResourceSystem(u64 archive_strings_count, String *archive_strings) } } + //////////////////////////////////////////////////////////// -//~ Resource helpers +//~ Resource ops b32 IsResourceNil(ResourceKey resource) { @@ -56,9 +57,6 @@ ResourceKey ResourceKeyFromStore(ResourceStore *store, String name) return result; } -//////////////////////////////////////////////////////////// -//~ Resource cache operations - ResourceEntry *ResourceEntryFromHash(u64 hash) { ResourceEntry *result = 0; @@ -75,9 +73,6 @@ ResourceEntry *ResourceEntryFromHash(u64 hash) return result; } -//////////////////////////////////////////////////////////// -//~ Resource operations - String DataFromResource(ResourceKey resource) { String result = ZI; diff --git a/src/base/base_resource.h b/src/base/base_resource.h index dc479a6c..9dbeb0d9 100644 --- a/src/base/base_resource.h +++ b/src/base/base_resource.h @@ -33,21 +33,16 @@ Struct(SharedResourceState) //////////////////////////////////////////////////////////// //~ Bootstrap -void InitResourceSystem(u64 archive_strings_count, String *archive_strings); +void BootstrapResources(u64 archive_strings_count, String *archive_strings); //////////////////////////////////////////////////////////// -//~ Resource operations +//~ Resource ops +//- Helpers b32 IsResourceNil(ResourceKey resource); ResourceKey ResourceKeyFromStore(ResourceStore *store, String name); - -//////////////////////////////////////////////////////////// -//~ Resource cache operations - ResourceEntry *ResourceEntryFromHash(u64 hash); -//////////////////////////////////////////////////////////// -//~ Resource data operations - +//- Data lookup String DataFromResource(ResourceKey resource); String NameFromResource(ResourceKey resource); diff --git a/src/base/base_string.c b/src/base/base_string.c index 8789982f..6015420b 100644 --- a/src/base/base_string.c +++ b/src/base/base_string.c @@ -791,7 +791,7 @@ String32 String32FromString(Arena *arena, String str8) } //////////////////////////////////////////////////////////// -//~ Legacy null-terminated C string operations +//~ Null-terminated strings //- Narrow C strings diff --git a/src/base/base_string.h b/src/base/base_string.h index 1a6ddb34..83a0afe9 100644 --- a/src/base/base_string.h +++ b/src/base/base_string.h @@ -117,7 +117,7 @@ String FormatString_(Arena *arena, String fmt, ...); String FormatStringV(Arena *arena, String fmt, va_list args); //////////////////////////////////////////////////////////// -//~ Unicode operations +//~ Unicode //- Iter CodepointIter InitCodepointIter(String str); @@ -132,7 +132,7 @@ String16 String16FromString(Arena *arena, String str8); String32 String32FromString(Arena *arena, String str8); //////////////////////////////////////////////////////////// -//~ Legacy null-terminated C string operations +//~ Null-terminated strings //- Narrow strings u64 CstrLenNoLimit(char *cstr); diff --git a/src/base/base_sync.h b/src/base/base_sync.h index c6e350ab..6afe0d19 100644 --- a/src/base/base_sync.h +++ b/src/base/base_sync.h @@ -41,7 +41,7 @@ Struct(Fence) }; //////////////////////////////////////////////////////////// -//~ Mutex operations +//~ Mutex Lock LockSpinE(Mutex *m, i32 spin); Lock LockSpinS(Mutex *m, i32 spin); @@ -61,13 +61,13 @@ void Unlock(Lock *lock); #endif //////////////////////////////////////////////////////////// -//~ Condition variable operations +//~ Condition variable void YieldOnCv(Cv *cv, Lock *lock); void SignalCv(Cv *cv); //////////////////////////////////////////////////////////// -//~ Fence operations +//~ Fence i64 FetchFence(Fence *fence); void SetFence(Fence *fence, i64 x); diff --git a/src/base/base_time.h b/src/base/base_time.h index af550b38..3f0009ca 100644 --- a/src/base/base_time.h +++ b/src/base/base_time.h @@ -14,6 +14,6 @@ Struct(DateTime) }; //////////////////////////////////////////////////////////// -//~ @hookdecl DateTime hooks +//~ @hookdecl DateTime DateTime LocalDateTime(void); diff --git a/src/base/base_uid.h b/src/base/base_uid.h index 14e760e2..b5942963 100644 --- a/src/base/base_uid.h +++ b/src/base/base_uid.h @@ -8,7 +8,7 @@ Struct(Uid) }; //////////////////////////////////////////////////////////// -//~ Uid operations +//~ Uid #define UID(hi64, lo64) ((Uid) { .hi = (hi64), .lo = (lo64) }) diff --git a/src/base/base_uni.h b/src/base/base_uni.h index 7bb24567..5a354dae 100644 --- a/src/base/base_uni.h +++ b/src/base/base_uni.h @@ -43,13 +43,13 @@ Struct(Utf32EncodeResult) }; //////////////////////////////////////////////////////////// -//~ Utf8 operations +//~ Utf8 Utf8DecodeResult DecodeUtf8(String str); Utf8EncodeResult EncodeUtf8(u32 codepoint); //////////////////////////////////////////////////////////// -//~ Utf16 operations +//~ Utf16 Utf16DecodeResult DecodeUtf16(String16 str); Utf16EncodeResult EncodeUtf16(u32 codepoint); @@ -58,7 +58,7 @@ b32 IsUtf16HighSurrogate(u16 c); b32 IsUtf16LowSurrogate(u16 c); //////////////////////////////////////////////////////////// -//~ Utf32 operations +//~ Utf32 Utf32DecodeResult DecodeUtf32(String32 str); Utf32EncodeResult EncodeUtf32(u32 codepoint); diff --git a/src/base/base_win32/base_win32.c b/src/base/base_win32/base_win32.c index 1058298f..cd8d5c20 100644 --- a/src/base/base_win32/base_win32.c +++ b/src/base/base_win32/base_win32.c @@ -306,18 +306,18 @@ i32 W32_Main(void) //- Bootstrap /* Bootstrap command line */ - InitCmdline(); + BootstrapCmdline(); /* Bootstrap log system */ /* FIXME: Remove hardcoded log path */ - InitLogSystem(Lit("log.log")); + BootstrapLogs(Lit("log.log")); LogInfoF("Main thread ID: %F", FmtUint(ThreadId())); /* Bootstrap resource system */ { W32_FindEmbeddedDataCtx ctx = ZI; EnumResourceNamesW(0, RT_RCDATA, &W32_FindEmbeddedRcData, (LONG_PTR)&ctx); - InitResourceSystem(ctx.embedded_strings_count, ctx.embedded_strings); + BootstrapResources(ctx.embedded_strings_count, ctx.embedded_strings); } /* Bootstrap layers */ diff --git a/src/base/base_win32/base_win32_futex.c b/src/base/base_win32/base_win32_futex.c index 5ab18e86..db7ae3fa 100644 --- a/src/base/base_win32/base_win32_futex.c +++ b/src/base/base_win32/base_win32_futex.c @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////// -//~ @hookimpl Not-equal futex operations +//~ @hookimpl Not-equal futex ops void FutexYieldNeq(volatile void *addr, void *cmp, u8 cmp_size) { @@ -12,7 +12,7 @@ void FutexWakeNeq(void *addr) } //////////////////////////////////////////////////////////// -//~ @hookimpl Greater-than-or-equal futex operations +//~ @hookimpl Greater-than-or-equal futex ops void FutexYieldGte(volatile void *addr, void *cmp, u8 cmp_size) { diff --git a/src/base/base_win32/base_win32_log.c b/src/base/base_win32/base_win32_log.c index 38833eee..67b016d2 100644 --- a/src/base/base_win32/base_win32_log.c +++ b/src/base/base_win32/base_win32_log.c @@ -1,9 +1,9 @@ W32_SharedLogState W32_shared_log_state = ZI; //////////////////////////////////////////////////////////// -//~ @hookimpl Init hooks +//~ @hookimpl Bootstrap -void InitLogSystem(String logfile_path) +void BootstrapLogs(String logfile_path) { W32_SharedLogState *g = &W32_shared_log_state; g->logs_arena = AcquireArena(Gibi(64)); @@ -93,7 +93,7 @@ void W32_Log(i32 level, String msg) } //////////////////////////////////////////////////////////// -//~ @hookimpl Log hooks +//~ @hookimpl Log /* Panic log function is separate to enforce zero side effects other than * immediately writing to log file. */ diff --git a/src/base/base_win32/base_win32_time.c b/src/base/base_win32/base_win32_time.c index dee0d8e0..56a56e9e 100644 --- a/src/base/base_win32/base_win32_time.c +++ b/src/base/base_win32/base_win32_time.c @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////// -//~ @hookimpl DateTime hooks +//~ @hookimpl DateTime DateTime LocalDateTime(void) { diff --git a/src/collider/collider.c b/src/collider/collider.c index ff5d250b..ffea77a8 100644 --- a/src/collider/collider.c +++ b/src/collider/collider.c @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////// -//~ Debug +//~ Debug helpers #if COLLIDER_DEBUG void CLD_DebugBreakable(void) @@ -985,7 +985,7 @@ f32 CLD_TimeOfImpact(CLD_Shape *c0, CLD_Shape *c1, Xform xf0_t0, Xform xf1_t0, X } //////////////////////////////////////////////////////////// -//~ Point cloud debugging +//~ Point cloud debug /* TODO: Remove this (debugging) */ Vec2Array CLD_Menkowski(Arena *arena, CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1, u32 detail) diff --git a/src/collider/collider.h b/src/collider/collider.h index eff009d6..088b49de 100644 --- a/src/collider/collider.h +++ b/src/collider/collider.h @@ -153,26 +153,26 @@ void CLD_DebugBreakable(void); #endif //////////////////////////////////////////////////////////// -//~ Shape operations +//~ Shape CLD_Shape CLD_ShapeFromQuad(Quad quad); //////////////////////////////////////////////////////////// -//~ Menkowski operations +//~ Menkowski CLD_SupportPoint CLD_SupportPointFromDirEx(CLD_Shape *shape, Xform xf, Vec2 dir, i32 ignore); CLD_SupportPoint CLD_SupportPointFromDir(CLD_Shape *shape, Xform xf, Vec2 dir); CLD_MenkowskiPoint CLD_MenkowskiPointFromDir(CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1, Vec2 dir); //////////////////////////////////////////////////////////// -//~ Aabb operations +//~ Aabb Aabb CLD_AabbFromShape(CLD_Shape *shape, Xform xf); Aabb CLD_CombineAabb(Aabb b0, Aabb b1); b32 CLD_TestAabb(Aabb box0, Aabb box1); //////////////////////////////////////////////////////////// -//~ Gjk operations +//~ Gjk #if COLLIDER_DEBUG CLD_GjkData CLD_GjkDataFromShapes(CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1, f32 min_unique_pt_dist_sq, u32 dbg_step); @@ -181,7 +181,7 @@ CLD_GjkData CLD_GjkDataFromShapes(CLD_Shape *shape0, CLD_Shape *shape1, Xform xf #endif //////////////////////////////////////////////////////////// -//~ Epa operations +//~ Epa #if COLLIDER_DEBUG CLD_EpaData CLD_EpaDataFromShapes(CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1, CLD_GjkData gjk_result, f32 min_unique_pt_dist_sq, u32 max_iterations, u32 dbg_step); @@ -190,28 +190,28 @@ CLD_EpaData CLD_EpaDataFromShapes(CLD_Shape *shape0, CLD_Shape *shape1, Xform xf #endif //////////////////////////////////////////////////////////// -//~ Clipping operations +//~ Clipping CLD_ClippedLine CLD_ClipLineToLine(Vec2 a0, Vec2 b0, Vec2 a1, Vec2 b1, Vec2 normal); Vec2 CLD_ClipPointToLine(Vec2 a, Vec2 b, Vec2 p, Vec2 normal); //////////////////////////////////////////////////////////// -//~ Collision point operations +//~ Collision point CLD_CollisionData CLD_CollisionDataFromShapes(CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1); //////////////////////////////////////////////////////////// -//~ Closest point operations +//~ Closest point CLD_ClosestPointData CLD_ClosestPointDataFromShapes(CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1); //////////////////////////////////////////////////////////// -//~ Time of impact operations +//~ Time of impact f32 CLD_TimeOfImpact(CLD_Shape *c0, CLD_Shape *c1, Xform xf0_t0, Xform xf1_t0, Xform xf0_t1, Xform xf1_t1, f32 tolerance, u32 max_iterations); //////////////////////////////////////////////////////////// -//~ Point cloud debugging operations +//~ Point cloud debug Vec2Array CLD_Menkowski(Arena *arena, CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1, u32 detail); Vec2Array CLD_PointCloud(Arena *arena, CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1); diff --git a/src/draw/draw.h b/src/draw/draw.h index 9b0a1cec..6a60eadd 100644 --- a/src/draw/draw.h +++ b/src/draw/draw.h @@ -112,12 +112,12 @@ Struct(D_SharedState) void D_Bootstrap(void); //////////////////////////////////////////////////////////// -//~ Material operations +//~ Material void D_DrawMaterial(GPU_RenderSig *sig, D_MaterialParams params); //////////////////////////////////////////////////////////// -//~ Solid shape operations +//~ Solid shape void D_DrawPolyEx(GPU_RenderSig *sig, Vec2Array vertices, GPU_Indices indices, u32 color); void D_DrawPoly(GPU_RenderSig *sig, Vec2Array points, u32 color); @@ -125,7 +125,7 @@ void D_DrawCircle(GPU_RenderSig *sig, Vec2 pos, f32 radius, u32 color, u32 detai void D_DrawQuad(GPU_RenderSig *sig, Quad quad, u32 color); //////////////////////////////////////////////////////////// -//~ Line shape operations +//~ Line shape void D_DrawLineGradient(GPU_RenderSig *sig, Vec2 start, Vec2 end, f32 thickness, u32 start_color, u32 end_color); void D_DrawLine(GPU_RenderSig *sig, Vec2 start, Vec2 end, f32 thickness, u32 color); @@ -138,16 +138,16 @@ void D_DrawArrowRay(GPU_RenderSig *sig, Vec2 pos, Vec2 rel, f32 thickness, f32 a void D_DrawColliderLine(GPU_RenderSig *sig, CLD_Shape shape, Xform shape_xf, f32 thickness, u32 color, u32 detail); //////////////////////////////////////////////////////////// -//~ Grid operations +//~ Grid void D_DrawGrid(GPU_RenderSig *sig, Xform xf, u32 bg0_color, u32 bg1_color, u32 line_color, u32 x_color, u32 y_color, f32 thickness, f32 spacing, Vec2 offset); //////////////////////////////////////////////////////////// -//~ Ui operations +//~ Ui void D_DrawUiRect(GPU_RenderSig *sig, D_UiRectParams params); //////////////////////////////////////////////////////////// -//~ Text operations +//~ Text Rect draw_text(GPU_RenderSig *sig, D_TextParams params); diff --git a/src/glyph_cache/glyph_cache.c b/src/glyph_cache/glyph_cache.c index 785d1ad7..b593498e 100644 --- a/src/glyph_cache/glyph_cache.c +++ b/src/glyph_cache/glyph_cache.c @@ -179,7 +179,7 @@ GC_Run *GC_RunFromString(Arena *arena, GC_FontKey key, String str) // } // //////////////////////////////////////////////////////////// -// //~ Font load operations +// //~ Font load // /* Returns the asset from the asset cache */ // AC_Asset *F_LoadAsset(ResourceKey resource, f32 size, b32 wait) @@ -234,7 +234,7 @@ GC_Run *GC_RunFromString(Arena *arena, GC_FontKey key, String str) // } // //////////////////////////////////////////////////////////// -// //~ Font data operations +// //~ Font data // F_Glyph F_GlyphFromCodepoint(F_Font *font, u32 codepoint) // { diff --git a/src/glyph_cache/glyph_cache.h b/src/glyph_cache/glyph_cache.h index 49e210a5..328a429d 100644 --- a/src/glyph_cache/glyph_cache.h +++ b/src/glyph_cache/glyph_cache.h @@ -127,14 +127,14 @@ GC_Run *GC_RunFromString(Arena *arena, GC_FontKey key, String str); // JobDecl(F_Load, { AC_Asset *asset; f32 size; ResourceKey resource; }); // //////////////////////////////////////////////////////////// -// //~ Font load operations +// //~ Font load // AC_Asset *F_LoadAsset(ResourceKey resource, f32 size, b32 wait); // F_Font *F_LoadFontAsync(ResourceKey resource, f32 size); // F_Font *F_LoadFontWait(ResourceKey resource, f32 size); // //////////////////////////////////////////////////////////// -// //~ Run operations +// //~ Run // F_Glyph F_GlyphFromCodepoint(F_Font *font, u32 codepoint); // F_Run F_RunFromString(Arena *arena, F_Font *font, String str); diff --git a/src/gpu/gpu_dx12/gpu_dx12.c b/src/gpu/gpu_dx12/gpu_dx12.c index 60d623b9..81c4ebf4 100644 --- a/src/gpu/gpu_dx12/gpu_dx12.c +++ b/src/gpu/gpu_dx12/gpu_dx12.c @@ -2417,7 +2417,7 @@ void GPU_SyncOtherQueues(GPU_QueueKind completion_queue_kind) } //////////////////////////////////////////////////////////// -//~ @hookimpl Map hooks +//~ @hookimpl Map // GPU_Mapped GPU_Map(GPU_Resource *gpu_r) // { diff --git a/src/meta/meta_file/meta_file.c b/src/meta/meta_file/meta_file.c index 7e9146fa..3eff574e 100644 --- a/src/meta/meta_file/meta_file.c +++ b/src/meta/meta_file/meta_file.c @@ -82,7 +82,7 @@ String F_ExtensionFromFile(String path) } //////////////////////////////////////////////////////////// -//~ File read operations +//~ File read String F_DataFromFile(Arena *arena, String path) { @@ -94,7 +94,7 @@ String F_DataFromFile(Arena *arena, String path) } //////////////////////////////////////////////////////////// -//~ File write operations +//~ File write void F_ClearWrite(String path, String data) { @@ -104,7 +104,7 @@ void F_ClearWrite(String path, String data) } //////////////////////////////////////////////////////////// -//~ File attribute helpers +//~ File attributes b32 F_IsFile(String path) { @@ -117,7 +117,7 @@ b32 F_IsDir(String path) } //////////////////////////////////////////////////////////// -//~ File iter operations +//~ File iter void F_FilesFromDir(Arena *arena, StringList *list, String dir, F_IterFlag flags) { diff --git a/src/meta/meta_file/meta_file.h b/src/meta/meta_file/meta_file.h index 49d0bf12..a631b4e8 100644 --- a/src/meta/meta_file/meta_file.h +++ b/src/meta/meta_file/meta_file.h @@ -17,22 +17,22 @@ String F_GetParentDir(String path); String F_ExtensionFromFile(String path); //////////////////////////////////////////////////////////// -//~ File read operations +//~ File read String F_DataFromFile(Arena *arena, String path); //////////////////////////////////////////////////////////// -//~ File write operations +//~ File write void F_ClearWrite(String path, String data); //////////////////////////////////////////////////////////// -//~ File attribute helpers +//~ File attributes b32 F_IsFile(String path); b32 F_IsDir(String path); //////////////////////////////////////////////////////////// -//~ File iter operations +//~ File iter void F_FilesFromDir(Arena *arena, StringList *list, String dir, F_IterFlag flags); diff --git a/src/meta/meta_lay.c b/src/meta/meta_lay.c index 5228d657..dc1d36f4 100644 --- a/src/meta/meta_lay.c +++ b/src/meta/meta_lay.c @@ -46,7 +46,7 @@ void M_AppendErrors(Arena *arena, M_ErrorList *dst, M_ErrorList src) } //////////////////////////////////////////////////////////// -//~ Lexer operations +//~ Lex M_TokenFile *M_PushTokenFile(Arena *arena, M_TokenFileList *l, String name, String data) { @@ -200,7 +200,7 @@ M_TokenFileList M_TokensFromSrcDirs(Arena *arena, StringList src_dirs) } //////////////////////////////////////////////////////////// -//~ Parser operations +//~ Parse M_Layer *M_PushLayer(Arena *arena, M_LayerList *list, M_TokenFile *file) { @@ -325,7 +325,7 @@ M_LayerList M_LayersFromTokenFiles(Arena *arena, M_TokenFileList lexed) } //////////////////////////////////////////////////////////// -//~ Flatten operations +//~ Flatten M_Layer M_FlattenEntries(Arena *arena, M_LayerList unflattened, StringList starting_layer_names) { diff --git a/src/meta/meta_lay.h b/src/meta/meta_lay.h index bf0108bd..f6416e86 100644 --- a/src/meta/meta_lay.h +++ b/src/meta/meta_lay.h @@ -142,19 +142,19 @@ M_Error *M_PushError(Arena *arena, M_ErrorList *l, M_Token *token, String msg); void M_AppendErrors(Arena *arena, M_ErrorList *dst, M_ErrorList src); //////////////////////////////////////////////////////////// -//~ Lexer operations +//~ Lex M_Token *M_PushToken(Arena *arena, M_TokenFile *file, String s, M_TokenKind kind); M_TokenFileList M_TokensFromSrcDirs(Arena *arena, StringList src_dirs); //////////////////////////////////////////////////////////// -//~ Parser operations +//~ Parse M_Layer *M_PushLayer(Arena *arena, M_LayerList *list, M_TokenFile *file); M_Entry *M_PushEntry(Arena *arena, M_Layer *l, M_EntryKind kind, M_Token *entry_token, u64 args_count, M_Token **args); M_LayerList M_LayersFromTokenFiles(Arena *arena, M_TokenFileList token_files); //////////////////////////////////////////////////////////// -//~ Flatten operations +//~ Flatten M_Layer M_FlattenEntries(Arena *arena, M_LayerList unflattened, StringList starting_layer_names); diff --git a/src/meta/meta_os/meta_os.h b/src/meta/meta_os/meta_os.h index 95975a7b..ae22db8d 100644 --- a/src/meta/meta_os/meta_os.h +++ b/src/meta/meta_os/meta_os.h @@ -29,7 +29,7 @@ Struct(OS_CommandResult) void OS_Bootstrap(void); //////////////////////////////////////////////////////////// -//~ @hookdecl File system operations +//~ @hookdecl File system OS_File OS_OpenFile(String path, OS_FileFlag flags, i64 timeout_ns); void OS_CloseFile(OS_File file); @@ -49,6 +49,6 @@ void OS_Mkdir(String path); void OS_Rm(String path); //////////////////////////////////////////////////////////// -//~ @hookdecl Shell operations +//~ @hookdecl Shell OS_CommandResult OS_RunCommand(Arena *arena, String cmd); diff --git a/src/meta/meta_os/meta_os_win32/meta_os_win32.c b/src/meta/meta_os/meta_os_win32/meta_os_win32.c index c262feb0..230d5d0a 100644 --- a/src/meta/meta_os/meta_os_win32/meta_os_win32.c +++ b/src/meta/meta_os/meta_os_win32/meta_os_win32.c @@ -33,7 +33,7 @@ void OS_Bootstrap(void) } //////////////////////////////////////////////////////////// -//~ @hookimpl File system hooks +//~ @hookimpl File system OS_File OS_OpenFile(String path, OS_FileFlag flags, i64 timeout_ns) { @@ -151,7 +151,7 @@ u64 OS_LastWriteTimestampFromPath(String path) } //////////////////////////////////////////////////////////// -//~ @hookimpl Directory helper hooks +//~ @hookimpl Directory helpers b32 OS_FileOrDirExists(String path) { @@ -197,7 +197,7 @@ void OS_Rm(String path) } //////////////////////////////////////////////////////////// -//~ @hookimpl Shell hooks +//~ @hookimpl Shell OS_CommandResult OS_RunCommand(Arena *arena, String cmd) { diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c index 3bd75735..203b2c12 100644 --- a/src/mixer/mixer.c +++ b/src/mixer/mixer.c @@ -136,9 +136,6 @@ void MIX_ReleaseTrackLocked(Lock *lock, MIX_Track *track) g->track_first_free = track; } -//////////////////////////////////////////////////////////// -//~ Mixer control - /* TODO: Rework interface to be command based instead of directly modifying tracks. */ MIX_Handle MIX_PlaySound(SND_Sound *sound) diff --git a/src/mixer/mixer.h b/src/mixer/mixer.h index 687473b3..f88f28c7 100644 --- a/src/mixer/mixer.h +++ b/src/mixer/mixer.h @@ -99,16 +99,13 @@ Struct(MIX_SharedState) void MIX_Bootstrap(void); //////////////////////////////////////////////////////////// -//~ Track operations +//~ Track MIX_Handle MIX_HandleFromTrack(MIX_Track *track); MIX_Track *MIX_TrackFromHandle(MIX_Handle handle); MIX_Track *MIX_AcquireTrackLocked(Lock *lock, SND_Sound *sound); void MIX_ReleaseTrackLocked(Lock *lock, MIX_Track *track); -//////////////////////////////////////////////////////////// -//~ Mixer state operations - MIX_Handle MIX_PlaySound(SND_Sound *sound); MIX_Handle MIX_PlaySoundEx(SND_Sound *sound, MIX_TrackDesc desc); MIX_TrackDesc MIX_TrackDescFromHandle(MIX_Handle handle); @@ -116,7 +113,7 @@ void MIX_UpdateTrack(MIX_Handle handle, MIX_TrackDesc desc); void MIX_UpdateListener(Vec2 pos, Vec2 dir); //////////////////////////////////////////////////////////// -//~ Mixer update +//~ Mix i16 MIX_SampleSound(SND_Sound *sound, u64 sample_pos, b32 wrap); MIX_PcmF32 MIX_MixAllTracks(Arena *arena, u64 frame_count); diff --git a/src/mp3/mp3.h b/src/mp3/mp3.h index 33ae1b03..cac40d39 100644 --- a/src/mp3/mp3.h +++ b/src/mp3/mp3.h @@ -15,6 +15,6 @@ Struct(MP3_Result) }; //////////////////////////////////////////////////////////// -//~ Mp3 operations +//~ Mp3 MP3_Result MP3_Decode(Arena *arena, String encoded, u32 sample_rate, MP3_DecodeFlag flags); diff --git a/src/net/net.h b/src/net/net.h index 83437925..31373044 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -266,7 +266,7 @@ N_Host *N_AcquireHost(u16 listen_port); void N_ReleaseHost(N_Host *host); //////////////////////////////////////////////////////////// -//~ Channel operations +//~ Channel #define N_NilChannelId (N_ChannelId) { .gen = 0, .idx = 0 } #define N_AllChannelsId (N_ChannelId) { .gen = U32Max, .idx = U32Max } @@ -282,7 +282,7 @@ N_Channel *N_AcquireChannel(N_Host *host, P_Address address); void N_ReleaseChannel(N_Channel *channel); //////////////////////////////////////////////////////////// -//~ Message assembler operations +//~ Message assembler u64 N_HashFromMsg(N_ChannelId channel_id, u64 msg_id); N_MsgAssembler *N_MsgAssemblerFromMsg(N_Host *host, N_ChannelId channel_id, u64 msg_id); @@ -293,12 +293,12 @@ b32 N_IsChunkFilled(N_MsgAssembler *ma, u64 chunk_id); void N_MarkChunkReceived(N_MsgAssembler *ma, u64 chunk_id); //////////////////////////////////////////////////////////// -//~ Packet operations +//~ Packet N_SndPacket *N_PushSndPacket(N_Channel *channel, b32 is_reliable); //////////////////////////////////////////////////////////// -//~ Host command operations +//~ Host command N_Cmd *N_PushCmd(N_Host *host); void N_Connect(N_Host *host, P_Address connect_address); @@ -306,7 +306,7 @@ void N_Disconnect(N_Host *host, N_ChannelId channel_id); void N_Write(N_Host *host, N_ChannelId channel_id, String msg, N_WriteFlag flags); //////////////////////////////////////////////////////////// -//~ Channel info operations +//~ Channel info i64 N_GetChannelLastRttNs(N_Host *host, N_ChannelId channel_id); diff --git a/src/platform/platform.h b/src/platform/platform.h index 036bcb50..380f791f 100644 --- a/src/platform/platform.h +++ b/src/platform/platform.h @@ -72,7 +72,7 @@ Enum(P_MessageBoxKind) void P_Bootstrap(void); //////////////////////////////////////////////////////////// -//~ @hookdecl File system hooks +//~ @hookdecl File system /* NOTE: File paths use forward slash '/' as delimiter */ @@ -98,14 +98,14 @@ u64 P_GetFileSize(P_File file); P_FileTime P_GetFileTime(P_File file); //////////////////////////////////////////////////////////// -//~ @hookdecl File map hooks +//~ @hookdecl File map P_FileMap P_OpenFileMap(P_File file); void P_CloseFileMap(P_FileMap map); String P_GetFileMapData(P_FileMap map); //////////////////////////////////////////////////////////// -//~ @hookdecl Address helper hooks +//~ @hookdecl Address helpers P_Address P_AddressFromString(String str); P_Address P_AddressFromIpPortCstr(char *ip_cstr, char *port_cstr); @@ -114,7 +114,7 @@ String P_StringFromAddress(Arena *arena, P_Address address); b32 P_MatchAddress(P_Address a, P_Address b); //////////////////////////////////////////////////////////// -//~ @hookdecl Sock hooks +//~ @hookdecl Socket P_Sock *P_AcquireSock(u16 listen_port, u64 sndbuf_size, u64 rcvbuf_size); void P_ReleaseSock(P_Sock *sock); @@ -122,20 +122,20 @@ P_SockReadResult P_ReadSock(Arena *arena, P_Sock *sock); void P_WriteSock(P_Sock *sock, P_Address address, String data); //////////////////////////////////////////////////////////// -//~ @hookdecl Util hooks +//~ @hookdecl Utils void P_MessageBox(P_MessageBoxKind kind, String message); void P_SetClipboardText(String str); String P_GetClipboardText(Arena *arena); //////////////////////////////////////////////////////////// -//~ @hookdecl Timer hooks +//~ @hookdecl Timer Fence *P_GetTimerFence(void); i64 P_GetCurrentTimerPeriodNs(void); //////////////////////////////////////////////////////////// -//~ @hookdecl Sleep hooks +//~ @hookdecl Sleep void P_SleepPrecise(i64 sleep_time_ns); void P_SleepFrame(i64 last_frame_time_ns, i64 target_dt_ns); diff --git a/src/platform/platform_win32/platform_win32.c b/src/platform/platform_win32/platform_win32.c index 59ad06b0..07e13ea8 100644 --- a/src/platform/platform_win32/platform_win32.c +++ b/src/platform/platform_win32/platform_win32.c @@ -19,7 +19,7 @@ void P_Bootstrap(void) } //////////////////////////////////////////////////////////// -//~ Win32 time +//~ Time DateTime P_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st) { @@ -37,7 +37,7 @@ DateTime P_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st) } //////////////////////////////////////////////////////////// -//~ Win32 file system +//~ File system String P_W32_StringFromWin32Path(Arena *arena, wchar_t *src) { @@ -69,7 +69,7 @@ String P_W32_StringFromWin32Path(Arena *arena, wchar_t *src) } //////////////////////////////////////////////////////////// -//~ Win32 Address +//~ Address P_W32_Address P_W32_Win32AddressFromPlatformAddress(P_Address addr) { @@ -217,7 +217,7 @@ void P_W32_SyncTimerForever(WaveLaneCtx *lane) } //////////////////////////////////////////////////////////// -//~ @hookimpl File system hooks +//~ @hookimpl File system //- File system helpers String P_GetWritePath(Arena *arena) @@ -499,7 +499,7 @@ P_FileTime P_GetFileTime(P_File file) } //////////////////////////////////////////////////////////// -//~ @hookimpl File map hooks +//~ @hookimpl File map P_FileMap P_OpenFileMap(P_File file) { @@ -566,7 +566,7 @@ String P_GetFileMapData(P_FileMap map) } //////////////////////////////////////////////////////////// -//~ @hookimpl Address helper hooks +//~ @hookimpl Address helpers P_Address P_AddressFromIpPortCstr(char *ip_cstr, char *port_cstr) { @@ -768,7 +768,7 @@ b32 P_MatchAddress(P_Address a, P_Address b) } //////////////////////////////////////////////////////////// -//~ @hookimpl Sock hooks +//~ @hookimpl Socket P_Sock *P_AcquireSock(u16 listen_port, u64 sndbuf_size, u64 rcvbuf_size) { @@ -879,7 +879,7 @@ void P_WriteSock(P_Sock *sock, P_Address address, String data) } //////////////////////////////////////////////////////////// -//~ @hookimpl Utility hooks +//~ @hookimpl Utils void P_MessageBox(P_MessageBoxKind kind, String message) { @@ -961,7 +961,7 @@ String P_GetClipboardText(Arena *arena) } //////////////////////////////////////////////////////////// -//~ @hookimpl Timer hooks +//~ @hookimpl Timer Fence *P_GetTimerFence(void) { @@ -976,7 +976,7 @@ i64 P_GetCurrentTimerPeriodNs(void) } //////////////////////////////////////////////////////////// -//~ @hookimpl Sleep hooks +//~ @hookimpl Sleep void P_SleepPrecise(i64 sleep_time_ns) { diff --git a/src/platform/platform_win32/platform_win32.h b/src/platform/platform_win32/platform_win32.h index 5517d0b4..a56b3569 100644 --- a/src/platform/platform_win32/platform_win32.h +++ b/src/platform/platform_win32/platform_win32.h @@ -84,17 +84,17 @@ Struct(P_W32_SharedState) } extern P_W32_shared_state; //////////////////////////////////////////////////////////// -//~ Time operations +//~ Time DateTime P_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st); //////////////////////////////////////////////////////////// -//~ File system operations +//~ File system String P_W32_StringFromWin32Path(Arena *arena, wchar_t *src); //////////////////////////////////////////////////////////// -//~ Address operations +//~ Address P_W32_Address P_W32_Win32AddressFromPlatformAddress(P_Address addr); P_W32_Address P_W32_ConvertAnyaddrToLocalhost(P_W32_Address addr); diff --git a/src/sound/sound.h b/src/sound/sound.h index 0dd08ab4..ed94798b 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -17,7 +17,7 @@ Struct(SND_Sound) }; //////////////////////////////////////////////////////////// -//~ Sound load operations +//~ Load sound JobDecl(SND_Load, { SND_SoundFlag flags; AC_Asset *asset; ResourceKey resource; }); AC_Asset *SND_LoadAsset(ResourceKey resource, SND_SoundFlag flags, b32 wait); diff --git a/src/sprite/sprite.c b/src/sprite/sprite.c index c994fba0..46810bfa 100644 --- a/src/sprite/sprite.c +++ b/src/sprite/sprite.c @@ -298,7 +298,7 @@ SPR_Entry *SPR_FetchEntry(ResourceKey resource, JobPoolId pool, SPR_FetchFlag fl } //////////////////////////////////////////////////////////// -//~ Sprite data retrieval operations +//~ Sprite data retrieval SPR_Texture *SPR_TextureFromResource(ResourceKey resource) { @@ -354,7 +354,7 @@ SPR_SliceKey SPR_SliceKeyFromName(String name) } //////////////////////////////////////////////////////////// -//~ Sheet access operations +//~ Sheet access SPR_Span SPR_SpanFromKey(SPR_Sheet *sheet, SPR_SpanKey key) { diff --git a/src/sprite/sprite.h b/src/sprite/sprite.h index 591e9617..19cdaf95 100644 --- a/src/sprite/sprite.h +++ b/src/sprite/sprite.h @@ -109,6 +109,13 @@ extern Readonly SPR_Sheet SPR_NilSheet; //////////////////////////////////////////////////////////// //~ Cache types +Enum(SPR_FetchFlag) +{ + SPR_FetchFlag_None = 0, + SPR_FetchFlag_Texture = (1 << 0), + SPR_FetchFlag_Sheet = (1 << 1), +}; + Struct(SPR_Entry) { SPR_Entry *next_in_bin; @@ -148,19 +155,12 @@ JobDecl(SPR_LoadTexture, { SPR_Entry *entry; }); JobDecl(SPR_LoadSheet, { SPR_Entry *entry; }); //////////////////////////////////////////////////////////// -//~ Cache operations - -Enum(SPR_FetchFlag) -{ - SPR_FetchFlag_None = 0, - SPR_FetchFlag_Texture = (1 << 0), - SPR_FetchFlag_Sheet = (1 << 1), -}; +//~ Cache SPR_Entry *SPR_FetchEntry(ResourceKey resource, JobPoolId pool, SPR_FetchFlag flags); //////////////////////////////////////////////////////////// -//~ Sprite data retrieval operations +//~ Sprite data retrieval SPR_Texture *SPR_TextureFromResource(ResourceKey resource); SPR_Texture *SPR_TextureFromResourceAsync(ResourceKey resource); @@ -175,7 +175,7 @@ SPR_SpanKey SPR_SpanKeyFromName(String name); SPR_SliceKey SPR_SliceKeyFromName(String name); //////////////////////////////////////////////////////////// -//~ Sheet access operations +//~ Sheet access SPR_Span SPR_SpanFromKey(SPR_Sheet *sheet, SPR_SpanKey key); SPR_Frame SPR_FrameFromIndex(SPR_Sheet *sheet, u64 index); diff --git a/src/tar/tar.h b/src/tar/tar.h index 6b85c7e1..df5318be 100644 --- a/src/tar/tar.h +++ b/src/tar/tar.h @@ -64,7 +64,7 @@ Packed(Struct(TAR_Header) }); //////////////////////////////////////////////////////////// -//~ Archive operations +//~ Archive u64 TAR_U64FromOctString(String str); TAR_Archive TAR_ArchiveFromString(Arena *arena, String data, String prefix); diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index 0975198e..4d80c112 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -408,9 +408,9 @@ UI_Style UI_PopStyle(UI_StyleDesc desc); #define UI_Push(name, ...) UI_PushStyle(UI_STYLEDESC(name, .style.name = __VA_ARGS__)) #define UI_ForceNext(name, ...) UI_PushStyle(UI_STYLEDESC(name, .pop_when_used = 1, .override = 1, .style.name = __VA_ARGS__)) #define UI_ForcePush(name, ...) UI_PushStyle(UI_STYLEDESC(name, .override = 1, .style.name = __VA_ARGS__)) -#define UI_Pop(name, ...) UI_PopStyle(UI_STYLEDESC(name, .force_pop = 1, __VA_ARGS__)).name -#define UI_PeekTop(name, ...) UI_PopStyle(UI_STYLEDESC(name, __VA_ARGS__)).name -#define UI_UseTop(name, ...) UI_PopStyle(UI_STYLEDESC(name, .use = 1, __VA_ARGS__)).name +#define UI_Pop(name, ...) UI_PopStyle(UI_STYLEDESC(name, .force_pop = 1, __VA_ARGS__)).name +#define UI_PeekTop(name, ...) UI_PopStyle(UI_STYLEDESC(name, __VA_ARGS__)).name +#define UI_UseTop(name, ...) UI_PopStyle(UI_STYLEDESC(name, .use = 1, __VA_ARGS__)).name #define UI_PushCopy(name, src, ...) do { \ UI_StyleDesc _new = src; \