• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión9f495a9eda368cbffe44281e9b17cc113e11f64f (tree)
Tiempo2012-10-16 19:54:47
Autorh2so5 <h2so5@git....>
Commiterh2so5

Log Message

Math.randomを独自の関数で上書き、アルゴリズムをメルセンヌ・ツイスタに変更

Cambiar Resumen

Diferencia incremental

Binary files a/client/ScriptEnvironment.cpp and b/client/ScriptEnvironment.cpp differ
--- a/client/ScriptEnvironment.hpp
+++ b/client/ScriptEnvironment.hpp
@@ -7,6 +7,7 @@
77 #include <string>
88 #include <functional>
99 #include <memory>
10+#include <random>
1011 #include <v8.h>
1112 #include <boost/thread.hpp>
1213 #include <boost/timer.hpp>
@@ -77,6 +78,8 @@ class ScriptEnvironment {
7778 static Handle<Value> Function_Script_clearTimeout(const Arguments& args);
7879 static Handle<Value> Function_Script_clearInterval(const Arguments& args);
7980
81+ static Handle<Value> Function_Math_random(const Arguments& args);
82+
8083 private:
8184 void Error(const Handle<Value>& error);
8285
@@ -92,6 +95,8 @@ class ScriptEnvironment {
9295 boost::condition_variable condition_;
9396 boost::mutex mutex_;
9497
98+ static std::mt19937 random_engine;
99+
95100 static unsigned int max_execution_time;
96101 static char SCRIPT_PATH[];
97102
--- a/client/stdafx.h
+++ b/client/stdafx.h
@@ -47,6 +47,7 @@
4747 #include <array>
4848 #include <string>
4949 #include <memory>
50+#include <random>
5051 #include <iostream>
5152 #include <fstream>
5253 #include <algorithm>