diff options
Diffstat (limited to 'prb_types.h')
-rw-r--r-- | prb_types.h | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/prb_types.h b/prb_types.h index bfcafcc..8760513 100644 --- a/prb_types.h +++ b/prb_types.h @@ -18,10 +18,6 @@ typedef double F64; /* NOTE(pryazha): The library only use right-handed coordiante system (for now) */ -typedef struct { - F32 x, y; -} V2; - #define V2_ZERO (V2){ 0.0f, 0.0f } #define V2_ONE (V2){ 1.0f, 1.0f } #define V2_RIGHT (V2){ 1.0f, 0.0f } @@ -30,8 +26,9 @@ typedef struct { #define V2_DOWN (V2){ 0.0f, -1.0f } typedef struct { - F32 x, y, z; -} V3; + F32 x; + F32 y; +} V2; #define V3_ZERO (V3){ 0.0f, 0.0f, 0.0f } #define V3_ONE (V3){ 1.0f, 1.0f, 1.0f } @@ -43,15 +40,20 @@ typedef struct { #define V3_BACKWARD (V3){ 0.0f, 0.0f, -1.0f } typedef struct { - F32 x, y, z, w; -} V4; + F32 x; + F32 y; + F32 z; +} V3; #define V4_ZERO (V4){ 0.0f, 0.0f, 0.0f, 0.0f } #define V4_ONE (V4){ 1.0f, 1.0f, 1.0f, 1.0f } typedef struct { - V4 m0, m1, m2, m3; -} MAT4; + F32 x; + F32 y; + F32 z; + F32 w; +} V4; #define MAT4_IDENTITY (MAT4) { \ { 1.0f, 0.0f, 0.0f, 0.0f }, \ @@ -60,28 +62,35 @@ typedef struct { { 0.0f, 0.0f, 0.0f, 1.0f } } typedef struct { + V4 m0; + V4 m1; + V4 m2; + V4 m3; +} MAT4; + +typedef struct { U8 *mem; U64 cap; U64 used; } Arena; -/* NOTE(pryazha): Strings */ +/* NOTE(pryazha): Fixed-length string */ typedef struct { - U8 *ptr; - U64 length; -} Str8; + U8 *p; + U64 len; +} FLS; -typedef struct Str8Node { - Str8 str; - struct Str8Node *next; - struct Str8Node *prev; -} Str8Node; +typedef struct FLSNode { + FLS str; + struct FLSNode *next; + struct FLSNode *prev; +} FLSNode; typedef struct { - Str8Node *first; - Str8Node *last; - U64 total_length; - U32 node_count; -} Str8List; + struct FLSNode *first; + struct FLSNode *last; + U64 len; + U32 ncnt; +} FLSList; #endif /* PRB_TYPES_H */ |