mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 06:45:35 +00:00
New long-range pathfinder.
Based on Philip's work located at http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder Includes code by wraitii, sanderd17 and kanetaka. An updated version of docs/pathfinder.pdf describing the changes in detail will be committed ASAP. Running update-workspaces is needed after this change. Fixes #1756. Fixes #930, #1259, #2908, #2960, #3097 Refs #1200, #1914, #1942, #2568, #2132, #2563 This was SVN commit r16751.
This commit is contained in:
@@ -290,3 +290,22 @@ template<> void ScriptInterface::ToJSVal<Grid<u16> >(JSContext* cx, JS::MutableH
|
||||
|
||||
ret.setObject(*obj);
|
||||
}
|
||||
|
||||
// TODO: This is copy-pasted from scriptinterface/ScriptConversions.h (#define VECTOR stuff), would be nice to remove the duplication
|
||||
template<> void ScriptInterface::ToJSVal<std::vector<CFixedVector2D> >(JSContext* cx, JS::MutableHandleValue ret, const std::vector<CFixedVector2D>& val)
|
||||
{
|
||||
JSAutoRequest rq(cx);
|
||||
JS::RootedObject obj(cx, JS_NewArrayObject(cx, 0));
|
||||
if (!obj)
|
||||
{
|
||||
ret.setUndefined();
|
||||
return;
|
||||
}
|
||||
for (size_t i = 0; i < val.size(); ++i)
|
||||
{
|
||||
JS::RootedValue el(cx);
|
||||
ScriptInterface::ToJSVal<CFixedVector2D>(cx, &el, val[i]);
|
||||
JS_SetElement(cx, obj, i, el);
|
||||
}
|
||||
ret.setObject(*obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user