diff --git a/src/CloonelJumpConfig.h.in b/src/CloonelJumpConfig.h.in index ad02d3a..33212f0 100644 --- a/src/CloonelJumpConfig.h.in +++ b/src/CloonelJumpConfig.h.in @@ -28,6 +28,7 @@ #define REFERENCE_HEIGHT 600 #define DEF_WIN_WIDTH REFERENCE_WIDTH #define DEF_WIN_HEIGHT REFERENCE_HEIGHT +#define DEF_RANDOM_SEED 1984 #define GAME_BASE_PATH "@CMAKE_SOURCE_DIR@" diff --git a/src/main.cpp b/src/main.cpp index 176ac65..1edfad4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,10 +25,12 @@ #include #include #include +#include +#include namespace { - ///------------------------------------------------------------------------- - ///------------------------------------------------------------------------- + ///-------------------------------------------------------------------------- + ///-------------------------------------------------------------------------- void RunMainLoop (cloonel::GameplaySceneClassic& parGame) { parGame.Prepare(); do { @@ -38,10 +40,15 @@ namespace { } } //unnamed namespace -///---------------------------------------------------------------------------- +///------------------------------------------------------------------------------ ///following http://twinklebeardev.blogspot.co.uk/2012/07/lesson-1-hello-world.html -///---------------------------------------------------------------------------- +///------------------------------------------------------------------------------ int main (int, char* parArgv[]) { +#if defined(NDEBUG) + std::srand(static_cast(std::time(nullptr))); +#else + std::srand(static_cast(DEF_RANDOM_SEED)); +#endif std::cout << GameName << " v" << GameVersionMajor << "." << GameVersionMinor << std::endl; int retVal = 0;