]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Engine.cc
removed Random.{cc,hh}; obsoleted by cml
[chaz/yoink] / src / Moof / Engine.cc
index de7c0cba94356afdc190110e97afcef3121cdc73..785cb4b41ed67ee342cf8df535f9e6726e5d3a35 100644 (file)
@@ -27,7 +27,8 @@
 *******************************************************************************/
 
 #include <algorithm>
-#include <cstdlib>                     // exit
+#include <cstdlib>                     // exit, srand
+#include <ctime>                       // time
 #include <list>
 #include <string>
 
@@ -41,7 +42,6 @@
 #include "Exception.hh"
 #include "Log.hh"
 #include "Math.hh"
-#include "Random.hh"
 #include "Settings.hh"
 #include "Timer.hh"
 
@@ -69,6 +69,12 @@ public:
                        const char* error = SDL_GetError();
                        throw Exception(ErrorCode::SDL_INIT, error);
                }
+               else
+               {
+                       char vdName[128];
+                       SDL_VideoDriverName(vdName, sizeof(vdName));
+                       logDebug("initialized SDL; using video driver `%s'", vdName);
+               }
 
                if (FE_Init() != 0)
                {
@@ -86,7 +92,7 @@ public:
                else
                {
                        alcMakeContextCurrent(mAlContext);
-                       logDebug("opened sound device \"%s\"",
+                       logDebug("opened sound device `%s'",
                                        alcGetString(mAlDevice, ALC_DEFAULT_DEVICE_SPECIFIER));
                }
 
@@ -95,8 +101,8 @@ public:
                Settings& settings = Settings::getInstance();
 
                unsigned randomSeed;
-               if (settings.get("rngseed", randomSeed)) setSeed(randomSeed);
-               else setSeed();
+               if (settings.get("rngseed", randomSeed)) srand(randomSeed);
+               else srand(time(0));
 
                Scalar timestep = 80.0;
                settings.get("timestep", timestep);
This page took 0.017671 seconds and 4 git commands to generate.