mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
Encapsulate runtime creation.
- Makes it easier to change down the line (and change is coming) - Allows making g_ScriptRuntime thread-local easily. - Remove ParentRuntime, which is not used at the moment. Part of the SM52 migration, stage: SM45 compatible. Patch by: Itms Tested By: Freagarach Refs #4893 Differential Revision: https://code.wildfiregames.com/D3087 This was SVN commit r24171.
This commit is contained in:
@@ -39,8 +39,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// TODO: what's a good default? perhaps based on map size
|
||||
#define RMS_RUNTIME_SIZE 96 * 1024 * 1024
|
||||
// TODO: Maybe this should be optimized depending on the map size.
|
||||
constexpr int RMS_RUNTIME_SIZE = 96 * 1024 * 1024;
|
||||
|
||||
extern bool IsQuitRequested();
|
||||
|
||||
@@ -89,7 +89,7 @@ void* CMapGeneratorWorker::RunThread(CMapGeneratorWorker* self)
|
||||
debug_SetThreadName("MapGenerator");
|
||||
g_Profiler2.RegisterCurrentThread("MapGenerator");
|
||||
|
||||
shared_ptr<ScriptRuntime> mapgenRuntime = ScriptInterface::CreateRuntime(g_ScriptRuntime, RMS_RUNTIME_SIZE);
|
||||
shared_ptr<ScriptRuntime> mapgenRuntime = ScriptRuntime::CreateRuntime(RMS_RUNTIME_SIZE);
|
||||
|
||||
// Enable the script to be aborted
|
||||
JS_SetInterruptCallback(mapgenRuntime->m_rt, MapGeneratorInterruptCallback);
|
||||
|
||||
Reference in New Issue
Block a user