summaryrefslogtreecommitdiff
path: root/include/al
diff options
context:
space:
mode:
Diffstat (limited to 'include/al')
-rw-r--r--include/al/random.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/al/random.h b/include/al/random.h
index 3df3140..f578247 100644
--- a/include/al/random.h
+++ b/include/al/random.h
@@ -14,7 +14,7 @@ extern __thread bool al_rand_set;
extern __thread u32 al_rand_state;
#endif
-static inline void al_rand_init(u32 seed)
+static inline void al_random_init(u32 seed)
{
al_rand_seed = seed;
}
@@ -54,4 +54,9 @@ static inline s32 al_random_int(s32 min, s32 max) // [MIN, MAX]
return min + al_rand() / (AL_RAND_MAX / (max - min + 1) + 1);
}
+static inline void al_random_hex_chars(char *buf)
+{
+ al_snprintf(buf, 9, "%08X", al_rand());
+}
+
#endif // _AL_RANDOM_H