From d196b120a108f14701def2935d54a73e2412430e Mon Sep 17 00:00:00 2001 From: Yoann Date: Thu, 19 Jan 2012 20:44:42 +0100 Subject: [PATCH] =?UTF-8?q?Construction=20selon=20la=20graine=20pass=C3=A9?= =?UTF-8?q?e=20en=20param=C3=A8tre=20si=20elle=20existe,=20sinon=20constru?= =?UTF-8?q?ction=20avec=20un=20graine=20al=C3=A9atoire.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 6 +++++- rules/chose.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 8bb2791..3933816 100644 --- a/main.cpp +++ b/main.cpp @@ -1,13 +1,17 @@ #include "all_includes.hh" -int main() { +int main(int argc, char* argv[]) { // Générer une tile de base + if(argc > 1) + Chose::initialSeed = (unsigned int) atoi(argv[1]); + std::cout << "Initial seed = " << Chose::initialSeed << std::endl; float size = 500 * 100; Vertex ne(size, size, 0); Vertex se(size, 0, 0); Vertex sw(0, 0, 0); Vertex nw(0, size, 0); + Chose* c = new QuartierQuad(Quad(ne, se, sw, nw)); c->triangulation(); c->updateAABB(); diff --git a/rules/chose.cpp b/rules/chose.cpp index 78d1829..ad0af73 100644 --- a/rules/chose.cpp +++ b/rules/chose.cpp @@ -182,4 +182,4 @@ void Chose::drawAABB() { ); } -unsigned int Chose::initialSeed = 1896509207;//random_seed(); +unsigned int Chose::initialSeed = random_seed();//1896509207;