mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-25 05:25: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:
@@ -48,10 +48,10 @@ void JSI_GUISize::RegisterScriptClass(ScriptInterface& scriptInterface)
|
||||
bool JSI_GUISize::construct(JSContext* cx, uint argc, JS::Value* vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
ScriptInterface* pScriptInterface = ScriptInterface::GetScriptInterfaceAndCBData(cx)->pScriptInterface;
|
||||
ScriptRequest rq(*pScriptInterface);
|
||||
ScriptRequest rq(cx);
|
||||
const ScriptInterface& scriptInterface = rq.GetScriptInterface();
|
||||
|
||||
JS::RootedObject obj(rq.cx, pScriptInterface->CreateCustomObject("GUISize"));
|
||||
JS::RootedObject obj(rq.cx, scriptInterface.CreateCustomObject("GUISize"));
|
||||
|
||||
if (args.length() == 8)
|
||||
{
|
||||
@@ -107,8 +107,7 @@ bool JSI_GUISize::toString(JSContext* cx, uint argc, JS::Value* vp)
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
CStr buffer;
|
||||
|
||||
ScriptInterface* pScriptInterface = ScriptInterface::GetScriptInterfaceAndCBData(cx)->pScriptInterface;
|
||||
ScriptRequest rq(*pScriptInterface);
|
||||
ScriptRequest rq(cx);
|
||||
double val, valr;
|
||||
|
||||
#define SIDE(side) \
|
||||
|
||||
Reference in New Issue
Block a user