mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Improvements based on experience from implementing Python runtime
This commit is contained in:
parent
e28e24a802
commit
83ea6cd0df
6 changed files with 67 additions and 188 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "runtime.h"
|
||||
#include "core/stream/stream.h"
|
||||
#include "module.h"
|
||||
#include "core/util/tDictionary.h"
|
||||
|
||||
namespace Con
|
||||
{
|
||||
|
|
@ -24,15 +25,10 @@ namespace Con
|
|||
|
||||
Module* getCurrentModule();
|
||||
|
||||
inline Vector<Runtime*> gRuntimes(32);
|
||||
inline HashMap<S32, Runtime*> gRuntimes;
|
||||
inline Runtime* getRuntime(S32 pRuntimeId = 0) { return gRuntimes[pRuntimeId]; }
|
||||
inline void registerRuntime(S32 pRuntimeId, Runtime* pRuntime)
|
||||
{
|
||||
if (gRuntimes.size() == 0)
|
||||
{
|
||||
gRuntimes.setSize(pRuntimeId + 1);
|
||||
gRuntimes.fill(NULL);
|
||||
}
|
||||
AssertFatal(gRuntimes[pRuntimeId] == NULL, "A runtime with that ID already exists");
|
||||
gRuntimes[pRuntimeId] = pRuntime;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue