Implements random map system, fixes #6.

Includes default library "rmgen" w/ API based on rmgen tool.
Modifies rmgen scripts Cantabrian Highlands, Neareastern Badlands, and
Latium.
Old map support dropped from MapReader.
Fixes a few bugs in existing game setup and initialization scripts.

This was SVN commit r9096.
This commit is contained in:
historic_bruno
2011-03-22 01:34:45 +00:00
parent 23ebe32b4c
commit 0e0ed94926
46 changed files with 4399 additions and 2163 deletions
+7 -8
View File
@@ -43,8 +43,7 @@
#include "valgrind.h"
const int RUNTIME_SIZE = 16 * 1024 * 1024; // TODO: how much memory is needed?
const int STACK_CHUNK_SIZE = 8192;
#define STACK_CHUNK_SIZE 8192
#if ENABLE_SCRIPT_PROFILING
# define signbit std::signbit
@@ -57,10 +56,10 @@ const int STACK_CHUNK_SIZE = 8192;
class ScriptRuntime
{
public:
ScriptRuntime() :
ScriptRuntime(int runtimeSize) :
m_rooter(NULL)
{
m_rt = JS_NewRuntime(RUNTIME_SIZE);
m_rt = JS_NewRuntime(runtimeSize);
debug_assert(m_rt); // TODO: error handling
#if ENABLE_SCRIPT_PROFILING
@@ -211,9 +210,9 @@ private:
}
};
shared_ptr<ScriptRuntime> ScriptInterface::CreateRuntime()
shared_ptr<ScriptRuntime> ScriptInterface::CreateRuntime(int runtimeSize)
{
return shared_ptr<ScriptRuntime>(new ScriptRuntime);
return shared_ptr<ScriptRuntime>(new ScriptRuntime(runtimeSize));
}
////////////////////////////////////////////////////////////////
@@ -438,8 +437,8 @@ ScriptInterface_impl::ScriptInterface_impl(const char* nativeScopeName, const sh
#endif
// Some other JIT flags to experiment with:
// options |= JSOPTION_JIT;
// options |= JSOPTION_PROFILING;
options |= JSOPTION_JIT;
options |= JSOPTION_PROFILING;
JS_SetOptions(m_cx, options);