18 #include "precompiled.h"
31 GetShape(shape, size0, size1, height);
35 JSObject* obj = JS_NewObject(cx, NULL, NULL, NULL);
41 jsval ptype = ScriptInterface::ToJSVal<std::string>(cx,
"circle");
44 JS_SetProperty(cx, obj,
"type", &ptype);
45 JS_SetProperty(cx, obj,
"radius", &pradius);
46 JS_SetProperty(cx, obj,
"height", &pheight);
50 jsval ptype = ScriptInterface::ToJSVal<std::string>(cx,
"square");
54 JS_SetProperty(cx, obj,
"type", &ptype);
55 JS_SetProperty(cx, obj,
"width", &pwidth);
56 JS_SetProperty(cx, obj,
"depth", &pdepth);
57 JS_SetProperty(cx, obj,
"height", &pheight);
60 return OBJECT_TO_JSVAL(obj);
A simple fixed-point number class.
#define END_INTERFACE_WRAPPER(iname)
#define DEFINE_INTERFACE_METHOD_1(scriptname, rettype, classname, methodname, arg1)
A trivial wrapper around a jsval.
ScriptInterface & GetScriptInterface() const
#define DEFINE_INTERFACE_METHOD_0(scriptname, rettype, classname, methodname)
static jsval ToJSVal(JSContext *cx, T const &val)
Convert a C++ type to a jsval.
const CSimContext & GetSimContext() const
#define BEGIN_INTERFACE_WRAPPER(iname)
u32 entity_id_t
Entity ID type.
JSContext * GetContext() const