mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-25 01:52:31 +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:
@@ -131,7 +131,7 @@ JS::Value GetEdgesOfStaticObstructionsOnScreenNearTo(const ScriptInterface& scri
|
||||
|
||||
ScriptRequest rq(scriptInterface);
|
||||
JS::RootedValue edgeList(rq.cx);
|
||||
ScriptInterface::CreateArray(rq, &edgeList);
|
||||
Script::CreateArray(rq, &edgeList);
|
||||
int edgeListIndex = 0;
|
||||
|
||||
float distanceThreshold = 10.0f;
|
||||
@@ -176,7 +176,7 @@ JS::Value GetEdgesOfStaticObstructionsOnScreenNearTo(const ScriptInterface& scri
|
||||
|
||||
CFixedVector2D normal = -(nextCorner - corner).Perpendicular();
|
||||
normal.Normalize();
|
||||
ScriptInterface::CreateObject(
|
||||
Script::CreateObject(
|
||||
rq,
|
||||
&edge,
|
||||
"begin", corner,
|
||||
@@ -185,7 +185,7 @@ JS::Value GetEdgesOfStaticObstructionsOnScreenNearTo(const ScriptInterface& scri
|
||||
"normal", normal,
|
||||
"order", "cw");
|
||||
|
||||
scriptInterface.SetPropertyInt(edgeList, edgeListIndex++, edge);
|
||||
Script::SetPropertyInt(rq, edgeList, edgeListIndex++, edge);
|
||||
}
|
||||
}
|
||||
return edgeList;
|
||||
|
||||
Reference in New Issue
Block a user