summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-03-25 19:11:32 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-03-25 19:11:32 (EDT)
commit78aff7ae4b05b5a77931ac4e68c814f48ce22460 (patch)
tree1ba0d2b6fbc0bfaa493b76af84c4480e0d9e404b /src
parent13499eb84d624b2c94e415bab4b1304408cf0f92 (diff)
downloaddodge-balls-78aff7ae4b05b5a77931ac4e68c814f48ce22460.zip
dodge-balls-78aff7ae4b05b5a77931ac4e68c814f48ce22460.tar.gz
dodge-balls-78aff7ae4b05b5a77931ac4e68c814f48ce22460.tar.bz2
main: Seed RNG
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index aa05340..4924546 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,6 +20,7 @@
#include <SDL.h>
#include <SDL_ttf.h>
#include <stdlib.h>
+#include <time.h>
#include "defs.h"
#include "dirs.h"
#include "main-menu.h"
@@ -31,6 +32,8 @@ static SDL_Renderer *_db_renderer;
static int
_db_init(void)
{
+ srand(time(NULL));
+
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
db_err("Failed to initialize SDL (%s)", SDL_GetError());
return -1;