mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Remove all external usage of CmptPrivate. Header cleanup.
This removes usage of CmptPrivate outside of ScriptInterface.
ScriptRequest can now be used to safely recover the scriptInterface from
a JSContext instead of going through ScriptInterface, which allows more
code cleanup.
Follows 34b1920e7b
Differential Revision: https://code.wildfiregames.com/D3963
This was SVN commit r25442.
This commit is contained in:
@@ -49,21 +49,22 @@ public:
|
||||
TSM_ASSERT(L"Running script "+pathname.string(), scriptInterface.LoadScript(pathname, content));
|
||||
}
|
||||
|
||||
static void Script_LoadComponentScript(ScriptInterface::CmptPrivate* pCmptPrivate, const VfsPath& pathname)
|
||||
static void Script_LoadComponentScript(const ScriptInterface& scriptInterface, const VfsPath& pathname)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
ScriptRequest rq(scriptInterface);
|
||||
CComponentManager* componentManager = scriptInterface.ObjectFromCBData<CComponentManager>(rq);
|
||||
TS_ASSERT(componentManager->LoadScript(VfsPath(L"simulation/components") / pathname));
|
||||
}
|
||||
|
||||
static void Script_LoadHelperScript(ScriptInterface::CmptPrivate* pCmptPrivate, const VfsPath& pathname)
|
||||
static void Script_LoadHelperScript(const ScriptInterface& scriptInterface, const VfsPath& pathname)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
ScriptRequest rq(scriptInterface);
|
||||
CComponentManager* componentManager = scriptInterface.ObjectFromCBData<CComponentManager>(rq);
|
||||
TS_ASSERT(componentManager->LoadScript(VfsPath(L"simulation/helpers") / pathname));
|
||||
}
|
||||
|
||||
static JS::Value Script_SerializationRoundTrip(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValue value)
|
||||
static JS::Value Script_SerializationRoundTrip(const ScriptInterface& scriptInterface, JS::HandleValue value)
|
||||
{
|
||||
ScriptInterface& scriptInterface = *(pCmptPrivate->pScriptInterface);
|
||||
ScriptRequest rq(scriptInterface);
|
||||
|
||||
JS::RootedValue val(rq.cx);
|
||||
|
||||
Reference in New Issue
Block a user