formatting

This commit is contained in:
jacob 2025-12-09 14:31:25 -06:00
parent 7c1602e463
commit 3bf89a8911
49 changed files with 152 additions and 174 deletions

View File

@ -205,14 +205,14 @@ Struct(Ace_Cel)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Ase bitbuff operations //~ Ase bitbuff helpers
u32 ASE_PeekBits(ASE_Bitbuff *bb, u32 nbits); u32 ASE_PeekBits(ASE_Bitbuff *bb, u32 nbits);
u32 ASE_ConsumeBits(ASE_Bitbuff *bb, u32 nbits); u32 ASE_ConsumeBits(ASE_Bitbuff *bb, u32 nbits);
void ASE_SkipBits(ASE_Bitbuff *bb, u32 nbits); void ASE_SkipBits(ASE_Bitbuff *bb, u32 nbits);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Inflate operations //~ Inflate
u32 ASE_ReverseBits(u32 v, u32 bit_count); 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); ASE_HuffDict ASE_InitHuffDict(Arena *arena, u32 max_code_bits, u32 *bl_counts, u32 bl_counts_count);

View File

@ -549,28 +549,28 @@
StaticAssert(alignof(Atomic64Padded) == CachelineSize && sizeof(Atomic64Padded) % CachelineSize == 0); StaticAssert(alignof(Atomic64Padded) == CachelineSize && sizeof(Atomic64Padded) % CachelineSize == 0);
#if IsPlatformWindows && IsArchX64 #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 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 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 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 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 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); } 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 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 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 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 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 Atomic16FetchXor (Atomic16 *x, i16 c) { return (i16)_InterlockedXor16(&x->_v, c); }
ForceInline i16 Atomic16FetchAdd (Atomic16 *x, i16 a) { return (i16)_InterlockedExchangeAdd16(&x->_v, a); } 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 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 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 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 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 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); } 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 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 void Atomic64Set (Atomic64 *x, i64 e) { CompilerBarrier(); x->_v = e; CompilerBarrier(); }
ForceInline i64 Atomic64FetchSet (Atomic64 *x, i64 e) { return (i64)_InterlockedExchange64(&x->_v, e); } ForceInline i64 Atomic64FetchSet (Atomic64 *x, i64 e) { return (i64)_InterlockedExchange64(&x->_v, e); }

View File

@ -36,13 +36,13 @@ Struct(BuddyCtx)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Buddy context operations //~ Buddy context
BuddyCtx *AcquireBuddyCtx(u64 reserve); BuddyCtx *AcquireBuddyCtx(u64 reserve);
void ReleaseBuddyCtx(BuddyCtx *ctx); void ReleaseBuddyCtx(BuddyCtx *ctx);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Buddy block operations //~ Buddy block
//- Acquire / release //- Acquire / release
BuddyBlock *AcquireBuddyBlock(BuddyCtx *ctx, u64 size); BuddyBlock *AcquireBuddyBlock(BuddyCtx *ctx, u64 size);

View File

@ -1,9 +1,9 @@
SharedCmdlineState shared_cmdline_state = ZI; SharedCmdlineState shared_cmdline_state = ZI;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Initialization //~ Bootstrap
void InitCmdline(void) void BootstrapCmdline(void)
{ {
SharedCmdlineState *g = &shared_cmdline_state; SharedCmdlineState *g = &shared_cmdline_state;
TempArena scratch = BeginScratchNoConflict(); TempArena scratch = BeginScratchNoConflict();
@ -73,7 +73,7 @@ void InitCmdline(void)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Command line operations //~ Command line
String StringFromCommandlineIdx(i32 idx) String StringFromCommandlineIdx(i32 idx)
{ {

View File

@ -31,12 +31,12 @@ Struct(SharedCmdlineState)
} extern shared_cmdline_state; } extern shared_cmdline_state;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Initialization //~ Bootstrap
void InitCmdline(void); void BootstrapCmdline(void);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Command line operations //~ Command line
String StringFromCommandlineIdx(i32 idx); String StringFromCommandlineIdx(i32 idx);
CommandlineArg CommandlineArgFromName(String name); CommandlineArg CommandlineArgFromName(String name);

View File

@ -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); OS_File OS_OpenFile(String path, OS_FileFlag flags, i64 timeout_ns);
void OS_CloseFile(OS_File file); void OS_CloseFile(OS_File file);

View File

@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl Not-equal futex operations //~ @hookdecl Not-equal futex ops
/* Similar to Win32 WaitOnAddress & WakeByAddressAll /* Similar to Win32 WaitOnAddress & WakeByAddressAll
* i.e. - Suprious wait until value at address != cmp */ * 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); void FutexWakeNeq(void *addr);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl Greater-than-or-equal futex operations //~ @hookdecl Greater-than-or-equal futex ops
/* Similar to Win32 WaitOnAddress & WakeByAddressAll /* Similar to Win32 WaitOnAddress & WakeByAddressAll
* i.e. - Spurious wait until monotonically increasing value at address >= cmp (used for fences) * i.e. - Spurious wait until monotonically increasing value at address >= cmp (used for fences)

View File

@ -130,12 +130,12 @@ Global Readonly LogLevelSettings log_settings[LogLevel_Count] = {
#endif #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. */ /* NOTE: Calling these functions rather than using the logging macros may result in logs that are compiled regardless of log level. */

View File

@ -804,7 +804,7 @@ i64 LerpU64(u64 val0, u64 val1, f64 t)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Color operations //~ Color
f32 SrgbFromLinearF32(f32 lin) f32 SrgbFromLinearF32(f32 lin)
{ {
@ -877,7 +877,7 @@ Vec4 BlendSrgb(Vec4 v0, Vec4 v1, f32 t)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Vec2 operations //~ Vec2
b32 IsVec2Zero(Vec2 a) 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) b32 MatchVec2I32(Vec2I32 a, Vec2I32 b)
{ {
@ -1126,7 +1126,7 @@ Vec2I32 SubVec2I32(Vec2I32 a, Vec2I32 b)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Vec4 operations //~ Vec4
Vec4 Vec4FromU32(u32 v) Vec4 Vec4FromU32(u32 v)
{ {
@ -1149,7 +1149,7 @@ u32 U32FromVec4(Vec4 v)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Xform operations //~ Xform
b32 MatchXform(Xform xf1, Xform xf2) 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 */ /* https://box2d.org/files/ErinCatto_SoftConstraints_GDC2011.pdf */
SoftSpring MakeSpring(f32 hertz, f32 damping_ratio, f32 dt) 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) Mat4x4 Mat4x4FromXform(Xform xf)
{ {

View File

@ -283,7 +283,7 @@ i32 LerpU32(u32 val0, u32 val1, f32 t);
i64 LerpU64(u64 val0, u64 val1, f64 t); i64 LerpU64(u64 val0, u64 val1, f64 t);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Color operations //~ Color
f32 SrgbFromLinearF32(f32 lin); f32 SrgbFromLinearF32(f32 lin);
f32 LinearFromSrgbF32(f32 srgb); f32 LinearFromSrgbF32(f32 srgb);
@ -293,7 +293,7 @@ u32 LinearU32FromSrgb(Vec4 srgb);
Vec4 BlendSrgb(Vec4 v0, Vec4 v1, f32 t); Vec4 BlendSrgb(Vec4 v0, Vec4 v1, f32 t);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Vec2 operations //~ Vec2
b32 IsVec2Zero(Vec2 a); b32 IsVec2Zero(Vec2 a);
b32 MatchVec2(Vec2 a, Vec2 b); 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); Vec2 SlerpVec2(Vec2 val0, Vec2 val1, f32 t);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Vec2I32 Operations //~ Vec2I32
#define Vec2I32FromFields(v) VEC2I32((v).x, (v).y) #define Vec2I32FromFields(v) VEC2I32((v).x, (v).y)
@ -359,13 +359,13 @@ Vec2I32 AddVec2I32(Vec2I32 a, Vec2I32 b);
Vec2I32 SubVec2I32(Vec2I32 a, Vec2I32 b); Vec2I32 SubVec2I32(Vec2I32 a, Vec2I32 b);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Vec4 operations //~ Vec4
Vec4 Vec4FromU32(u32 v); Vec4 Vec4FromU32(u32 v);
u32 U32FromVec4(Vec4 v); u32 U32FromVec4(Vec4 v);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Xform operations //~ Xform
b32 MatchXform(Xform xf1, Xform xf2); 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__ }) #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); SoftSpring MakeSpring(f32 hertz, f32 damping_ratio, f32 dt);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Mat4x4 operations //~ Mat4x4
Mat4x4 Mat4x4FromXform(Xform xf); Mat4x4 Mat4x4FromXform(Xform xf);
Mat4x4 Mat4x4FromOrtho(f32 left, f32 right, f32 bottom, f32 top, f32 near_z, f32 far_z); Mat4x4 Mat4x4FromOrtho(f32 left, f32 right, f32 bottom, f32 top, f32 near_z, f32 far_z);

View File

@ -14,7 +14,7 @@ void SetMemoryReadonly(void *address, u64 size);
void SetMemoryReadWrite(void *address, u64 size); void SetMemoryReadWrite(void *address, u64 size);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Memory operations //~ Memory ops
//- Wrappers //- Wrappers
#define MatchBytes(p1, p2, n) (CmpBytes((p1), (p2), (n)) == 0) #define MatchBytes(p1, p2, n) (CmpBytes((p1), (p2), (n)) == 0)

View File

@ -1,6 +1,3 @@
////////////////////////////////////////////////////////////
//~ Stateful randomness
u64 RandU64FromState(RandState *state) u64 RandU64FromState(RandState *state)
{ {
u64 seed = state->seed; 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); return range_start + (range_end - range_start) * ((f64)(RandU64FromState(state) % RandMaxF64) / (f64)RandMaxF64);
} }
////////////////////////////////////////////////////////////
//~ Seeded randomness
/* Based on Jon Maiga's "mx3" /* Based on Jon Maiga's "mx3"
* https://jonkagstrom.com/mx3/mx3_rev2.html * https://jonkagstrom.com/mx3/mx3_rev2.html
*/ */

View File

@ -11,13 +11,13 @@ Struct(RandState)
#define RandMaxF64 U64Max #define RandMaxF64 U64Max
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Rand operations //~ Rand ops
//- Stateful randomness //- Stateful
u64 RandU64FromState(RandState *state); u64 RandU64FromState(RandState *state);
f64 RandF64FromState(RandState *state, f64 range_start, f64 range_end); f64 RandF64FromState(RandState *state, f64 range_start, f64 range_end);
//- Seeded randomness //- Seeded
u64 RandU64FromSeed(u64 seed); u64 RandU64FromSeed(u64 seed);
u64 RandU64FromSeeds(u64 seed_a, u64 seed_b); u64 RandU64FromSeeds(u64 seed_a, u64 seed_b);
f64 RandF64FromSeed(u64 seed, f64 range_start, f64 range_end); f64 RandF64FromSeed(u64 seed, f64 range_start, f64 range_end);

View File

@ -3,7 +3,7 @@ SharedResourceState shared_resource_state = ZI;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Bootstrap //~ Bootstrap
void InitResourceSystem(u64 archive_strings_count, String *archive_strings) void BootstrapResources(u64 archive_strings_count, String *archive_strings)
{ {
SharedResourceState *g = &shared_resource_state; SharedResourceState *g = &shared_resource_state;
Arena *perm = PermArena(); Arena *perm = PermArena();
@ -41,8 +41,9 @@ void InitResourceSystem(u64 archive_strings_count, String *archive_strings)
} }
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Resource helpers //~ Resource ops
b32 IsResourceNil(ResourceKey resource) b32 IsResourceNil(ResourceKey resource)
{ {
@ -56,9 +57,6 @@ ResourceKey ResourceKeyFromStore(ResourceStore *store, String name)
return result; return result;
} }
////////////////////////////////////////////////////////////
//~ Resource cache operations
ResourceEntry *ResourceEntryFromHash(u64 hash) ResourceEntry *ResourceEntryFromHash(u64 hash)
{ {
ResourceEntry *result = 0; ResourceEntry *result = 0;
@ -75,9 +73,6 @@ ResourceEntry *ResourceEntryFromHash(u64 hash)
return result; return result;
} }
////////////////////////////////////////////////////////////
//~ Resource operations
String DataFromResource(ResourceKey resource) String DataFromResource(ResourceKey resource)
{ {
String result = ZI; String result = ZI;

View File

@ -33,21 +33,16 @@ Struct(SharedResourceState)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Bootstrap //~ 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); b32 IsResourceNil(ResourceKey resource);
ResourceKey ResourceKeyFromStore(ResourceStore *store, String name); ResourceKey ResourceKeyFromStore(ResourceStore *store, String name);
////////////////////////////////////////////////////////////
//~ Resource cache operations
ResourceEntry *ResourceEntryFromHash(u64 hash); ResourceEntry *ResourceEntryFromHash(u64 hash);
//////////////////////////////////////////////////////////// //- Data lookup
//~ Resource data operations
String DataFromResource(ResourceKey resource); String DataFromResource(ResourceKey resource);
String NameFromResource(ResourceKey resource); String NameFromResource(ResourceKey resource);

View File

@ -791,7 +791,7 @@ String32 String32FromString(Arena *arena, String str8)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Legacy null-terminated C string operations //~ Null-terminated strings
//- Narrow C strings //- Narrow C strings

View File

@ -117,7 +117,7 @@ String FormatString_(Arena *arena, String fmt, ...);
String FormatStringV(Arena *arena, String fmt, va_list args); String FormatStringV(Arena *arena, String fmt, va_list args);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Unicode operations //~ Unicode
//- Iter //- Iter
CodepointIter InitCodepointIter(String str); CodepointIter InitCodepointIter(String str);
@ -132,7 +132,7 @@ String16 String16FromString(Arena *arena, String str8);
String32 String32FromString(Arena *arena, String str8); String32 String32FromString(Arena *arena, String str8);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Legacy null-terminated C string operations //~ Null-terminated strings
//- Narrow strings //- Narrow strings
u64 CstrLenNoLimit(char *cstr); u64 CstrLenNoLimit(char *cstr);

View File

@ -41,7 +41,7 @@ Struct(Fence)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Mutex operations //~ Mutex
Lock LockSpinE(Mutex *m, i32 spin); Lock LockSpinE(Mutex *m, i32 spin);
Lock LockSpinS(Mutex *m, i32 spin); Lock LockSpinS(Mutex *m, i32 spin);
@ -61,13 +61,13 @@ void Unlock(Lock *lock);
#endif #endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Condition variable operations //~ Condition variable
void YieldOnCv(Cv *cv, Lock *lock); void YieldOnCv(Cv *cv, Lock *lock);
void SignalCv(Cv *cv); void SignalCv(Cv *cv);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Fence operations //~ Fence
i64 FetchFence(Fence *fence); i64 FetchFence(Fence *fence);
void SetFence(Fence *fence, i64 x); void SetFence(Fence *fence, i64 x);

View File

@ -14,6 +14,6 @@ Struct(DateTime)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl DateTime hooks //~ @hookdecl DateTime
DateTime LocalDateTime(void); DateTime LocalDateTime(void);

View File

@ -8,7 +8,7 @@ Struct(Uid)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Uid operations //~ Uid
#define UID(hi64, lo64) ((Uid) { .hi = (hi64), .lo = (lo64) }) #define UID(hi64, lo64) ((Uid) { .hi = (hi64), .lo = (lo64) })

View File

@ -43,13 +43,13 @@ Struct(Utf32EncodeResult)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Utf8 operations //~ Utf8
Utf8DecodeResult DecodeUtf8(String str); Utf8DecodeResult DecodeUtf8(String str);
Utf8EncodeResult EncodeUtf8(u32 codepoint); Utf8EncodeResult EncodeUtf8(u32 codepoint);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Utf16 operations //~ Utf16
Utf16DecodeResult DecodeUtf16(String16 str); Utf16DecodeResult DecodeUtf16(String16 str);
Utf16EncodeResult EncodeUtf16(u32 codepoint); Utf16EncodeResult EncodeUtf16(u32 codepoint);
@ -58,7 +58,7 @@ b32 IsUtf16HighSurrogate(u16 c);
b32 IsUtf16LowSurrogate(u16 c); b32 IsUtf16LowSurrogate(u16 c);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Utf32 operations //~ Utf32
Utf32DecodeResult DecodeUtf32(String32 str); Utf32DecodeResult DecodeUtf32(String32 str);
Utf32EncodeResult EncodeUtf32(u32 codepoint); Utf32EncodeResult EncodeUtf32(u32 codepoint);

View File

@ -306,18 +306,18 @@ i32 W32_Main(void)
//- Bootstrap //- Bootstrap
/* Bootstrap command line */ /* Bootstrap command line */
InitCmdline(); BootstrapCmdline();
/* Bootstrap log system */ /* Bootstrap log system */
/* FIXME: Remove hardcoded log path */ /* FIXME: Remove hardcoded log path */
InitLogSystem(Lit("log.log")); BootstrapLogs(Lit("log.log"));
LogInfoF("Main thread ID: %F", FmtUint(ThreadId())); LogInfoF("Main thread ID: %F", FmtUint(ThreadId()));
/* Bootstrap resource system */ /* Bootstrap resource system */
{ {
W32_FindEmbeddedDataCtx ctx = ZI; W32_FindEmbeddedDataCtx ctx = ZI;
EnumResourceNamesW(0, RT_RCDATA, &W32_FindEmbeddedRcData, (LONG_PTR)&ctx); 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 */ /* Bootstrap layers */

View File

@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookimpl Not-equal futex operations //~ @hookimpl Not-equal futex ops
void FutexYieldNeq(volatile void *addr, void *cmp, u8 cmp_size) 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) void FutexYieldGte(volatile void *addr, void *cmp, u8 cmp_size)
{ {

View File

@ -1,9 +1,9 @@
W32_SharedLogState W32_shared_log_state = ZI; 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; W32_SharedLogState *g = &W32_shared_log_state;
g->logs_arena = AcquireArena(Gibi(64)); 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 /* Panic log function is separate to enforce zero side effects other than
* immediately writing to log file. */ * immediately writing to log file. */

View File

@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookimpl DateTime hooks //~ @hookimpl DateTime
DateTime LocalDateTime(void) DateTime LocalDateTime(void)
{ {

View File

@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Debug //~ Debug helpers
#if COLLIDER_DEBUG #if COLLIDER_DEBUG
void CLD_DebugBreakable(void) 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) */ /* TODO: Remove this (debugging) */
Vec2Array CLD_Menkowski(Arena *arena, CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1, u32 detail) Vec2Array CLD_Menkowski(Arena *arena, CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1, u32 detail)

View File

@ -153,26 +153,26 @@ void CLD_DebugBreakable(void);
#endif #endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Shape operations //~ Shape
CLD_Shape CLD_ShapeFromQuad(Quad quad); 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_SupportPointFromDirEx(CLD_Shape *shape, Xform xf, Vec2 dir, i32 ignore);
CLD_SupportPoint CLD_SupportPointFromDir(CLD_Shape *shape, Xform xf, Vec2 dir); 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); 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_AabbFromShape(CLD_Shape *shape, Xform xf);
Aabb CLD_CombineAabb(Aabb b0, Aabb b1); Aabb CLD_CombineAabb(Aabb b0, Aabb b1);
b32 CLD_TestAabb(Aabb box0, Aabb box1); b32 CLD_TestAabb(Aabb box0, Aabb box1);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Gjk operations //~ Gjk
#if COLLIDER_DEBUG #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); 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 #endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Epa operations //~ Epa
#if COLLIDER_DEBUG #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); 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 #endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Clipping operations //~ Clipping
CLD_ClippedLine CLD_ClipLineToLine(Vec2 a0, Vec2 b0, Vec2 a1, Vec2 b1, Vec2 normal); 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); 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); 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); 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); 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_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); Vec2Array CLD_PointCloud(Arena *arena, CLD_Shape *shape0, CLD_Shape *shape1, Xform xf0, Xform xf1);

View File

@ -112,12 +112,12 @@ Struct(D_SharedState)
void D_Bootstrap(void); void D_Bootstrap(void);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Material operations //~ Material
void D_DrawMaterial(GPU_RenderSig *sig, D_MaterialParams params); 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_DrawPolyEx(GPU_RenderSig *sig, Vec2Array vertices, GPU_Indices indices, u32 color);
void D_DrawPoly(GPU_RenderSig *sig, Vec2Array points, 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); 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_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); 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); 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); 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); void D_DrawUiRect(GPU_RenderSig *sig, D_UiRectParams params);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Text operations //~ Text
Rect draw_text(GPU_RenderSig *sig, D_TextParams params); Rect draw_text(GPU_RenderSig *sig, D_TextParams params);

View File

@ -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 */ // /* Returns the asset from the asset cache */
// AC_Asset *F_LoadAsset(ResourceKey resource, f32 size, b32 wait) // 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) // F_Glyph F_GlyphFromCodepoint(F_Font *font, u32 codepoint)
// { // {

View File

@ -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; }); // 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); // AC_Asset *F_LoadAsset(ResourceKey resource, f32 size, b32 wait);
// F_Font *F_LoadFontAsync(ResourceKey resource, f32 size); // F_Font *F_LoadFontAsync(ResourceKey resource, f32 size);
// F_Font *F_LoadFontWait(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_Glyph F_GlyphFromCodepoint(F_Font *font, u32 codepoint);
// F_Run F_RunFromString(Arena *arena, F_Font *font, String str); // F_Run F_RunFromString(Arena *arena, F_Font *font, String str);

View File

@ -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) // GPU_Mapped GPU_Map(GPU_Resource *gpu_r)
// { // {

View File

@ -82,7 +82,7 @@ String F_ExtensionFromFile(String path)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ File read operations //~ File read
String F_DataFromFile(Arena *arena, String path) 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) 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) 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) void F_FilesFromDir(Arena *arena, StringList *list, String dir, F_IterFlag flags)
{ {

View File

@ -17,22 +17,22 @@ String F_GetParentDir(String path);
String F_ExtensionFromFile(String path); String F_ExtensionFromFile(String path);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ File read operations //~ File read
String F_DataFromFile(Arena *arena, String path); String F_DataFromFile(Arena *arena, String path);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ File write operations //~ File write
void F_ClearWrite(String path, String data); void F_ClearWrite(String path, String data);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ File attribute helpers //~ File attributes
b32 F_IsFile(String path); b32 F_IsFile(String path);
b32 F_IsDir(String path); b32 F_IsDir(String path);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ File iter operations //~ File iter
void F_FilesFromDir(Arena *arena, StringList *list, String dir, F_IterFlag flags); void F_FilesFromDir(Arena *arena, StringList *list, String dir, F_IterFlag flags);

View File

@ -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) 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) 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) M_Layer M_FlattenEntries(Arena *arena, M_LayerList unflattened, StringList starting_layer_names)
{ {

View File

@ -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); 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_Token *M_PushToken(Arena *arena, M_TokenFile *file, String s, M_TokenKind kind);
M_TokenFileList M_TokensFromSrcDirs(Arena *arena, StringList src_dirs); 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_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_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); 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); M_Layer M_FlattenEntries(Arena *arena, M_LayerList unflattened, StringList starting_layer_names);

View File

@ -29,7 +29,7 @@ Struct(OS_CommandResult)
void OS_Bootstrap(void); void OS_Bootstrap(void);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl File system operations //~ @hookdecl File system
OS_File OS_OpenFile(String path, OS_FileFlag flags, i64 timeout_ns); OS_File OS_OpenFile(String path, OS_FileFlag flags, i64 timeout_ns);
void OS_CloseFile(OS_File file); void OS_CloseFile(OS_File file);
@ -49,6 +49,6 @@ void OS_Mkdir(String path);
void OS_Rm(String path); void OS_Rm(String path);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl Shell operations //~ @hookdecl Shell
OS_CommandResult OS_RunCommand(Arena *arena, String cmd); OS_CommandResult OS_RunCommand(Arena *arena, String cmd);

View File

@ -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) 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) 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) OS_CommandResult OS_RunCommand(Arena *arena, String cmd)
{ {

View File

@ -136,9 +136,6 @@ void MIX_ReleaseTrackLocked(Lock *lock, MIX_Track *track)
g->track_first_free = track; g->track_first_free = track;
} }
////////////////////////////////////////////////////////////
//~ Mixer control
/* TODO: Rework interface to be command based instead of directly modifying tracks. */ /* TODO: Rework interface to be command based instead of directly modifying tracks. */
MIX_Handle MIX_PlaySound(SND_Sound *sound) MIX_Handle MIX_PlaySound(SND_Sound *sound)

View File

@ -99,16 +99,13 @@ Struct(MIX_SharedState)
void MIX_Bootstrap(void); void MIX_Bootstrap(void);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Track operations //~ Track
MIX_Handle MIX_HandleFromTrack(MIX_Track *track); MIX_Handle MIX_HandleFromTrack(MIX_Track *track);
MIX_Track *MIX_TrackFromHandle(MIX_Handle handle); MIX_Track *MIX_TrackFromHandle(MIX_Handle handle);
MIX_Track *MIX_AcquireTrackLocked(Lock *lock, SND_Sound *sound); MIX_Track *MIX_AcquireTrackLocked(Lock *lock, SND_Sound *sound);
void MIX_ReleaseTrackLocked(Lock *lock, MIX_Track *track); void MIX_ReleaseTrackLocked(Lock *lock, MIX_Track *track);
////////////////////////////////////////////////////////////
//~ Mixer state operations
MIX_Handle MIX_PlaySound(SND_Sound *sound); MIX_Handle MIX_PlaySound(SND_Sound *sound);
MIX_Handle MIX_PlaySoundEx(SND_Sound *sound, MIX_TrackDesc desc); MIX_Handle MIX_PlaySoundEx(SND_Sound *sound, MIX_TrackDesc desc);
MIX_TrackDesc MIX_TrackDescFromHandle(MIX_Handle handle); 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); void MIX_UpdateListener(Vec2 pos, Vec2 dir);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Mixer update //~ Mix
i16 MIX_SampleSound(SND_Sound *sound, u64 sample_pos, b32 wrap); i16 MIX_SampleSound(SND_Sound *sound, u64 sample_pos, b32 wrap);
MIX_PcmF32 MIX_MixAllTracks(Arena *arena, u64 frame_count); MIX_PcmF32 MIX_MixAllTracks(Arena *arena, u64 frame_count);

View File

@ -15,6 +15,6 @@ Struct(MP3_Result)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Mp3 operations //~ Mp3
MP3_Result MP3_Decode(Arena *arena, String encoded, u32 sample_rate, MP3_DecodeFlag flags); MP3_Result MP3_Decode(Arena *arena, String encoded, u32 sample_rate, MP3_DecodeFlag flags);

View File

@ -266,7 +266,7 @@ N_Host *N_AcquireHost(u16 listen_port);
void N_ReleaseHost(N_Host *host); void N_ReleaseHost(N_Host *host);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Channel operations //~ Channel
#define N_NilChannelId (N_ChannelId) { .gen = 0, .idx = 0 } #define N_NilChannelId (N_ChannelId) { .gen = 0, .idx = 0 }
#define N_AllChannelsId (N_ChannelId) { .gen = U32Max, .idx = U32Max } #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); void N_ReleaseChannel(N_Channel *channel);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Message assembler operations //~ Message assembler
u64 N_HashFromMsg(N_ChannelId channel_id, u64 msg_id); u64 N_HashFromMsg(N_ChannelId channel_id, u64 msg_id);
N_MsgAssembler *N_MsgAssemblerFromMsg(N_Host *host, 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); void N_MarkChunkReceived(N_MsgAssembler *ma, u64 chunk_id);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Packet operations //~ Packet
N_SndPacket *N_PushSndPacket(N_Channel *channel, b32 is_reliable); N_SndPacket *N_PushSndPacket(N_Channel *channel, b32 is_reliable);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Host command operations //~ Host command
N_Cmd *N_PushCmd(N_Host *host); N_Cmd *N_PushCmd(N_Host *host);
void N_Connect(N_Host *host, P_Address connect_address); 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); 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); i64 N_GetChannelLastRttNs(N_Host *host, N_ChannelId channel_id);

View File

@ -72,7 +72,7 @@ Enum(P_MessageBoxKind)
void P_Bootstrap(void); void P_Bootstrap(void);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl File system hooks //~ @hookdecl File system
/* NOTE: File paths use forward slash '/' as delimiter */ /* 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); P_FileTime P_GetFileTime(P_File file);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl File map hooks //~ @hookdecl File map
P_FileMap P_OpenFileMap(P_File file); P_FileMap P_OpenFileMap(P_File file);
void P_CloseFileMap(P_FileMap map); void P_CloseFileMap(P_FileMap map);
String P_GetFileMapData(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_AddressFromString(String str);
P_Address P_AddressFromIpPortCstr(char *ip_cstr, char *port_cstr); 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); 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); P_Sock *P_AcquireSock(u16 listen_port, u64 sndbuf_size, u64 rcvbuf_size);
void P_ReleaseSock(P_Sock *sock); 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); 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_MessageBox(P_MessageBoxKind kind, String message);
void P_SetClipboardText(String str); void P_SetClipboardText(String str);
String P_GetClipboardText(Arena *arena); String P_GetClipboardText(Arena *arena);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl Timer hooks //~ @hookdecl Timer
Fence *P_GetTimerFence(void); Fence *P_GetTimerFence(void);
i64 P_GetCurrentTimerPeriodNs(void); i64 P_GetCurrentTimerPeriodNs(void);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookdecl Sleep hooks //~ @hookdecl Sleep
void P_SleepPrecise(i64 sleep_time_ns); void P_SleepPrecise(i64 sleep_time_ns);
void P_SleepFrame(i64 last_frame_time_ns, i64 target_dt_ns); void P_SleepFrame(i64 last_frame_time_ns, i64 target_dt_ns);

View File

@ -19,7 +19,7 @@ void P_Bootstrap(void)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Win32 time //~ Time
DateTime P_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st) 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) 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) 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 //- File system helpers
String P_GetWritePath(Arena *arena) 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) 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) 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) 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) 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) Fence *P_GetTimerFence(void)
{ {
@ -976,7 +976,7 @@ i64 P_GetCurrentTimerPeriodNs(void)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ @hookimpl Sleep hooks //~ @hookimpl Sleep
void P_SleepPrecise(i64 sleep_time_ns) void P_SleepPrecise(i64 sleep_time_ns)
{ {

View File

@ -84,17 +84,17 @@ Struct(P_W32_SharedState)
} extern P_W32_shared_state; } extern P_W32_shared_state;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Time operations //~ Time
DateTime P_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st); DateTime P_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ File system operations //~ File system
String P_W32_StringFromWin32Path(Arena *arena, wchar_t *src); 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_Win32AddressFromPlatformAddress(P_Address addr);
P_W32_Address P_W32_ConvertAnyaddrToLocalhost(P_W32_Address addr); P_W32_Address P_W32_ConvertAnyaddrToLocalhost(P_W32_Address addr);

View File

@ -17,7 +17,7 @@ Struct(SND_Sound)
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Sound load operations //~ Load sound
JobDecl(SND_Load, { SND_SoundFlag flags; AC_Asset *asset; ResourceKey resource; }); JobDecl(SND_Load, { SND_SoundFlag flags; AC_Asset *asset; ResourceKey resource; });
AC_Asset *SND_LoadAsset(ResourceKey resource, SND_SoundFlag flags, b32 wait); AC_Asset *SND_LoadAsset(ResourceKey resource, SND_SoundFlag flags, b32 wait);

View File

@ -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) 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) SPR_Span SPR_SpanFromKey(SPR_Sheet *sheet, SPR_SpanKey key)
{ {

View File

@ -109,6 +109,13 @@ extern Readonly SPR_Sheet SPR_NilSheet;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Cache types //~ Cache types
Enum(SPR_FetchFlag)
{
SPR_FetchFlag_None = 0,
SPR_FetchFlag_Texture = (1 << 0),
SPR_FetchFlag_Sheet = (1 << 1),
};
Struct(SPR_Entry) Struct(SPR_Entry)
{ {
SPR_Entry *next_in_bin; SPR_Entry *next_in_bin;
@ -148,19 +155,12 @@ JobDecl(SPR_LoadTexture, { SPR_Entry *entry; });
JobDecl(SPR_LoadSheet, { SPR_Entry *entry; }); JobDecl(SPR_LoadSheet, { SPR_Entry *entry; });
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Cache operations //~ Cache
Enum(SPR_FetchFlag)
{
SPR_FetchFlag_None = 0,
SPR_FetchFlag_Texture = (1 << 0),
SPR_FetchFlag_Sheet = (1 << 1),
};
SPR_Entry *SPR_FetchEntry(ResourceKey resource, JobPoolId pool, SPR_FetchFlag flags); 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_TextureFromResource(ResourceKey resource);
SPR_Texture *SPR_TextureFromResourceAsync(ResourceKey resource); SPR_Texture *SPR_TextureFromResourceAsync(ResourceKey resource);
@ -175,7 +175,7 @@ SPR_SpanKey SPR_SpanKeyFromName(String name);
SPR_SliceKey SPR_SliceKeyFromName(String name); SPR_SliceKey SPR_SliceKeyFromName(String name);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Sheet access operations //~ Sheet access
SPR_Span SPR_SpanFromKey(SPR_Sheet *sheet, SPR_SpanKey key); SPR_Span SPR_SpanFromKey(SPR_Sheet *sheet, SPR_SpanKey key);
SPR_Frame SPR_FrameFromIndex(SPR_Sheet *sheet, u64 index); SPR_Frame SPR_FrameFromIndex(SPR_Sheet *sheet, u64 index);

View File

@ -64,7 +64,7 @@ Packed(Struct(TAR_Header)
}); });
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Archive operations //~ Archive
u64 TAR_U64FromOctString(String str); u64 TAR_U64FromOctString(String str);
TAR_Archive TAR_ArchiveFromString(Arena *arena, String data, String prefix); TAR_Archive TAR_ArchiveFromString(Arena *arena, String data, String prefix);

View File

@ -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_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_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_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_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_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_UseTop(name, ...) UI_PopStyle(UI_STYLEDESC(name, .use = 1, __VA_ARGS__)).name
#define UI_PushCopy(name, src, ...) do { \ #define UI_PushCopy(name, src, ...) do { \
UI_StyleDesc _new = src; \ UI_StyleDesc _new = src; \