mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Split off Object-related functions from ScriptInterface
Follows 34b1920e7b.
This splits off the object-related functions, such as
[Set/Get/Has]Property, CreateObject, CreateArray, FreezeObject.
It also puts the definitions in the header itself, which might end up
with faster code here & there, though perhaps slower compilation time
(somewhat doubtful since we already included most things anyways).
Differential Revision: https://code.wildfiregames.com/D3956
This was SVN commit r25430.
This commit is contained in:
@@ -28,8 +28,8 @@
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/Hotkey.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h" // CreateObject
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -184,7 +184,7 @@ template<> bool Script::FromJSVal<CGUIColor>(const ScriptRequest& rq, JS::Handle
|
||||
|
||||
template<> void Script::ToJSVal<CRect>(const ScriptRequest& rq, JS::MutableHandleValue ret, const CRect& val)
|
||||
{
|
||||
ScriptInterface::CreateObject(
|
||||
Script::CreateObject(
|
||||
rq,
|
||||
ret,
|
||||
"left", val.left,
|
||||
@@ -327,7 +327,7 @@ template<> bool Script::FromJSVal<CGUISpriteInstance>(const ScriptRequest& rq, J
|
||||
|
||||
template<> void Script::ToJSVal<CSize2D>(const ScriptRequest& rq, JS::MutableHandleValue ret, const CSize2D& val)
|
||||
{
|
||||
ScriptInterface::CreateObject(rq, ret, "width", val.Width, "height", val.Height);
|
||||
Script::CreateObject(rq, ret, "width", val.Width, "height", val.Height);
|
||||
}
|
||||
|
||||
template<> bool Script::FromJSVal<CSize2D>(const ScriptRequest& rq, JS::HandleValue v, CSize2D& out)
|
||||
@@ -355,7 +355,7 @@ template<> bool Script::FromJSVal<CSize2D>(const ScriptRequest& rq, JS::HandleVa
|
||||
|
||||
template<> void Script::ToJSVal<CVector2D>(const ScriptRequest& rq, JS::MutableHandleValue ret, const CVector2D& val)
|
||||
{
|
||||
ScriptInterface::CreateObject(rq, ret, "x", val.X, "y", val.Y);
|
||||
Script::CreateObject(rq, ret, "x", val.X, "y", val.Y);
|
||||
}
|
||||
|
||||
template<> bool Script::FromJSVal<CVector2D>(const ScriptRequest& rq, JS::HandleValue v, CVector2D& out)
|
||||
|
||||
Reference in New Issue
Block a user