39static JSBool
VisualEffectSetProperty(JSContext* context, JSObject*
this, jsid propID, JSBool strict, jsval* value);
63 JSCLASS_NO_OPTIONAL_MEMBERS
146 if (outEntity == NULL)
150 result = OOJSEntityGetEntity(context, visualEffectObj, &entity);
163@implementation OOVisualEffectEntity (OOJavaScriptExtensions)
165- (void)getJSClass:(JSClass**)outClass andPrototype:(JSObject**)outPrototype
173 return @"VisualEffect";
183 return [[
self visualEffectSubEntityEnumerator] allObjects];
190 if (!JSID_IS_INT(propID))
205 switch (JSID_TO_INT(propID)) {
233 return JS_NewNumberValue(context, [entity scaleX], value);
236 return JS_NewNumberValue(context, [entity scaleY], value);
239 return JS_NewNumberValue(context, [entity scaleZ], value);
250 return JS_NewNumberValue(context, [entity hullHeatLevel], value);
253 return JS_NewNumberValue(context, [entity shaderFloat1], value);
256 return JS_NewNumberValue(context, [entity shaderFloat2], value);
259 *value = INT_TO_JSVAL([entity shaderInt1]);
263 *value = INT_TO_JSVAL([entity shaderInt2]);
283 result = [NSDictionary dictionary];
299 if (!JSID_IS_INT(propID))
310 NSString* sValue =
nil;
317 switch (JSID_TO_INT(propID)) {
320 if (sValue ==
nil || [sValue length] == 0) {
321 if ([entity isBeacon]) {
322 [UNIVERSE clearBeacon:entity];
323 if ([
PLAYER nextBeacon] == entity) {
324 [PLAYER setCompassMode:COMPASS_MODE_PLANET];
328 if ([entity isBeacon]) {
333 [UNIVERSE setNextBeacon:entity];
348 if (JS_ValueToBoolean(context, *value, &bValue)) {
356 if (colorForScript !=
nil || JSVAL_IS_NULL(*value)) {
364 if (colorForScript !=
nil || JSVAL_IS_NULL(*value)) {
371 if (JS_ValueToNumber(context, *value, &fValue)) {
380 if (JS_ValueToNumber(context, *value, &fValue)) {
389 if (JS_ValueToNumber(context, *value, &fValue)) {
398 if (JS_ValueToNumber(context, *value, &fValue)) {
405 if (JS_ValueToNumber(context, *value, &fValue)) {
412 if (JS_ValueToNumber(context, *value, &fValue)) {
419 if (JS_ValueToInt32(context, *value, &iValue)) {
426 if (JS_ValueToInt32(context, *value, &iValue)) {
459#define GET_THIS_EFFECT(THISENT) \
461 if (EXPECT_NOT(!JSVisualEffectGetVisualEffectEntity(context, OOJS_THIS, &THISENT))) \
463 if (OOIsStaleEntity(THISENT)) \
474 if ([thisEnt isSubEntity]) {
491 NSObject* result =
nil;
498 result = [NSDictionary dictionary];
509 NSObject* result =
nil;
516 result = [NSDictionary dictionary];
573 JSObject* params = NULL;
574 NSDictionary* materials;
575 NSDictionary* shaders;
576 BOOL withShaders = NO;
617 smooth:[effectDict oo_boolForKey:@"smooth" defaultValue:NO]
646 gotScale = JS_ValueToNumber(context,
OOJS_ARGV[0], &scale);
667 NSUInteger numSubEntitiesRestored = 0U;
#define OOJS_PROFILE_EXIT
#define OOJS_END_FULL_NATIVE
#define OOJS_BEGIN_FULL_NATIVE(context)
#define OOJS_NATIVE_ENTER(cx)
#define OOJS_PROFILE_ENTER
OOINLINE JSClass * JSEntityClass(void)
OOINLINE JSObject * JSEntityPrototype(void)
BOOL JSValueToVector(JSContext *context, jsval value, Vector *outVector) NONNULL_FUNC
BOOL VectorToJSValue(JSContext *context, Vector vector, jsval *outValue) NONNULL_FUNC
@ kVisualEffect_isBreakPattern
@ kVisualEffect_shaderFloat1
@ kVisualEffect_beaconCode
@ kVisualEffect_hullHeatLevel
@ kVisualEffect_scannerDisplayColor2
@ kVisualEffect_scannerDisplayColor1
@ kVisualEffect_beaconLabel
@ kVisualEffect_vectorRight
@ kVisualEffect_subEntities
@ kVisualEffect_shaderFloat2
@ kVisualEffect_scriptInfo
@ kVisualEffect_shaderInt1
@ kVisualEffect_shaderVector1
@ kVisualEffect_vectorForward
@ kVisualEffect_shaderInt2
@ kVisualEffect_shaderVector2
static JSBool VisualEffectRemove(JSContext *context, uintN argc, jsval *vp)
static JSFunctionSpec sVisualEffectMethods[]
static JSBool VisualEffectRestoreSubEntities(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectSetMaterials(JSContext *context, uintN argc, jsval *vp)
#define GET_THIS_EFFECT(THISENT)
static JSObject * sVisualEffectPrototype
static JSBool VisualEffectScale(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectGetProperty(JSContext *context, JSObject *this, jsid propID, jsval *value)
static JSBool VisualEffectGetMaterials(JSContext *context, uintN argc, jsval *vp)
static JSClass sVisualEffectClass
static JSPropertySpec sVisualEffectProperties[]
void InitOOJSVisualEffect(JSContext *context, JSObject *global)
static JSBool VisualEffectSetProperty(JSContext *context, JSObject *this, jsid propID, JSBool strict, jsval *value)
static JSBool VisualEffectSetShaders(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectGetShaders(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectSetMaterialsInternal(JSContext *context, uintN argc, jsval *vp, OOVisualEffectEntity *thisEnt, BOOL fromShaders)
static BOOL JSVisualEffectGetVisualEffectEntity(JSContext *context, JSObject *stationObj, OOVisualEffectEntity **outEntity)
void OOJSReportWarning(JSContext *context, NSString *format,...)
#define OOJS_PROP_READWRITE_CB
void OOJSRegisterObjectConverter(JSClass *theClass, OOJSClassConverterCallback converter)
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
id OOJSNativeObjectFromJSObject(JSContext *context, JSObject *object)
void OOJSObjectWrapperFinalize(JSContext *context, JSObject *this)
#define OOJS_RETURN_OBJECT(o)
void OOJSReportBadPropertySelector(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec)
#define OOJS_RETURN_BOOL(v)
NSString * OOStringFromJSValue(JSContext *context, jsval value)
JSBool OOJSUnconstructableConstruct(JSContext *context, uintN argc, jsval *vp)
void OOJSRegisterSubclass(JSClass *subclass, JSClass *superclass)
OOINLINE jsval OOJSValueFromBOOL(int b) INLINE_CONST_FUNC
NSString * OOStringFromJSValueEvenIfNull(JSContext *context, jsval value)
void OOJSReportBadPropertyValue(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec, jsval value)
id OOJSBasicPrivateObjectConverter(JSContext *context, JSObject *object)
void OOJSReportBadArguments(JSContext *context, NSString *scriptClass, NSString *function, uintN argc, jsval *argv, NSString *message, NSString *expectedArgsDescription)
#define OOJS_PROP_READONLY_CB
NSString * oo_jsClassName()
NSArray * subEntitiesForScript()
BOOL isVisibleToScripts()
OOColor * colorWithDescription:(id description)
NSArray * normalizedArray()
OOMaterial * materials[kOOMeshMaxMaterials]
instancetype meshWithName:cacheKey:materialDictionary:shadersDictionary:smooth:shaderMacros:shaderBindingTarget:(NSString *name,[cacheKey] NSString *cacheKey,[materialDictionary] NSDictionary *materialDict,[shadersDictionary] NSDictionary *shadersDict,[smooth] BOOL smooth,[shaderMacros] NSDictionary *macros,[shaderBindingTarget] id< OOWeakReferenceSupport > object)
void setMesh:(OOMesh *mesh)
OOColor * scannerDisplayColor2()
void setShaderVector2:(Vector value)
void setScaleZ:(GLfloat factor)
void setShaderVector1:(Vector value)
void removeSubEntity:(Entity< OOSubEntity > *sub)
void setScannerDisplayColor1:(OOColor *color)
OOColor * scannerDisplayColor1()
void setShaderFloat2:(GLfloat value)
NSArray * subEntitiesForScript()
void setScannerDisplayColor2:(OOColor *color)
void setScaleY:(GLfloat factor)
void setScaleX:(GLfloat factor)
NSDictionary * effectInfoDictionary()
void setBeaconLabel:(NSString *blabel)
void setIsBreakPattern:(BOOL bp)
void setShaderFloat1:(GLfloat value)
NSDictionary * scriptInfo
void setShaderInt1:(int value)
void setHullHeatLevel:(GLfloat value)
void setShaderInt2:(int value)
void setBeaconCode:(NSString *bcode)
NSDictionary * materialDefaults()