Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 77 files). Show all
Unified · Split
| @@ -26,7 +26,6 @@ · 25 unmodified lines | |||
| 26 | #include <NetworkAccessManager.h> | 26 | #include <NetworkAccessManager.h> |
| 27 | #include <NodeList.h> | 27 | #include <NodeList.h> |
| 28 | #include <PacketHeaders.h> | 28 | #include <PacketHeaders.h> |
| 29 | #include <ParticlesScriptingInterface.h> | ||
| 30 | #include <Sound.h> | 29 | #include <Sound.h> |
| 31 | #include <UUID.h> | 30 | #include <UUID.h> |
| 32 | #include <VoxelConstants.h> | 31 | #include <VoxelConstants.h> |
| @@ -44,7 +43,6 @@ · 11 unmodified lines | |||
| 44 | #include "AudioEffectOptions.h" | 43 | #include "AudioEffectOptions.h" |
| 45 | 44 | ||
| 46 | VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface; | 45 | VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface; |
| 47 | ParticlesScriptingInterface ScriptEngine::_particlesScriptingInterface; | ||
| 48 | EntityScriptingInterface ScriptEngine::_entityScriptingInterface; | 46 | EntityScriptingInterface ScriptEngine::_entityScriptingInterface; |
| 49 | 47 | ||
| 50 | static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* engine) { | 48 | static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* engine) { |
| @@ -237,7 +235,6 @@ void ScriptEngine::init() { · 186 unmodified lines | |||
| 237 | _isInitialized = true; | 235 | _isInitialized = true; |
| 238 | 236 | ||
| 239 | _voxelsScriptingInterface.init(); | 237 | _voxelsScriptingInterface.init(); |
| 240 | _particlesScriptingInterface.init(); | ||
| 241 | 238 | ||
| 242 | // register various meta-types | 239 | // register various meta-types |
| 243 | registerMetaTypes(this); | 240 | registerMetaTypes(this); |
| @@ -249,10 +246,6 @@ void ScriptEngine::init() { · 5 unmodified lines | |||
| 249 | registerAvatarTypes(this); | 246 | registerAvatarTypes(this); |
| 250 | Bitstream::registerTypes(this); | 247 | Bitstream::registerTypes(this); |
| 251 | 248 | ||
| 252 | qScriptRegisterMetaType(this, ParticlePropertiesToScriptValue, ParticlePropertiesFromScriptValue); | ||
| 253 | qScriptRegisterMetaType(this, ParticleIDtoScriptValue, ParticleIDfromScriptValue); | ||
| 254 | qScriptRegisterSequenceMetaType<QVector<ParticleID> >(this); | ||
| 255 | |||
| 256 | qScriptRegisterMetaType(this, EntityItemPropertiesToScriptValue, EntityItemPropertiesFromScriptValue); | 249 | qScriptRegisterMetaType(this, EntityItemPropertiesToScriptValue, EntityItemPropertiesFromScriptValue); |
| 257 | qScriptRegisterMetaType(this, EntityItemIDtoScriptValue, EntityItemIDfromScriptValue); | 250 | qScriptRegisterMetaType(this, EntityItemIDtoScriptValue, EntityItemIDfromScriptValue); |
| 258 | qScriptRegisterMetaType(this, RayToEntityIntersectionResultToScriptValue, RayToEntityIntersectionResultFromScriptValue); | 251 | qScriptRegisterMetaType(this, RayToEntityIntersectionResultToScriptValue, RayToEntityIntersectionResultFromScriptValue); |
| @@ -290,7 +283,6 @@ void ScriptEngine::init() { · 31 unmodified lines | |||
| 290 | registerGlobalObject("Audio", &_audioScriptingInterface); | 283 | registerGlobalObject("Audio", &_audioScriptingInterface); |
| 291 | registerGlobalObject("Controller", _controllerScriptingInterface); | 284 | registerGlobalObject("Controller", _controllerScriptingInterface); |
| 292 | registerGlobalObject("Entities", &_entityScriptingInterface); | 285 | registerGlobalObject("Entities", &_entityScriptingInterface); |
| 293 | registerGlobalObject("Particles", &_particlesScriptingInterface); | ||
| 294 | registerGlobalObject("Quat", &_quatLibrary); | 286 | registerGlobalObject("Quat", &_quatLibrary); |
| 295 | registerGlobalObject("Vec3", &_vec3Library); | 287 | registerGlobalObject("Vec3", &_vec3Library); |
| 296 | registerGlobalObject("Uuid", &_uuidLibrary); | 288 | registerGlobalObject("Uuid", &_uuidLibrary); |
| @@ -303,14 +295,12 @@ void ScriptEngine::init() { · 6 unmodified lines | |||
| 303 | globalObject().setProperty("COLLISION_GROUP_ENVIRONMENT", newVariant(QVariant(COLLISION_GROUP_ENVIRONMENT))); | 295 | globalObject().setProperty("COLLISION_GROUP_ENVIRONMENT", newVariant(QVariant(COLLISION_GROUP_ENVIRONMENT))); |
| 304 | globalObject().setProperty("COLLISION_GROUP_AVATARS", newVariant(QVariant(COLLISION_GROUP_AVATARS))); | 296 | globalObject().setProperty("COLLISION_GROUP_AVATARS", newVariant(QVariant(COLLISION_GROUP_AVATARS))); |
| 305 | globalObject().setProperty("COLLISION_GROUP_VOXELS", newVariant(QVariant(COLLISION_GROUP_VOXELS))); | 297 | globalObject().setProperty("COLLISION_GROUP_VOXELS", newVariant(QVariant(COLLISION_GROUP_VOXELS))); |
| 306 | globalObject().setProperty("COLLISION_GROUP_PARTICLES", newVariant(QVariant(COLLISION_GROUP_PARTICLES))); | ||
| 307 | 298 | ||
| 308 | globalObject().setProperty("AVATAR_MOTION_OBEY_LOCAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_LOCAL_GRAVITY))); | 299 | globalObject().setProperty("AVATAR_MOTION_OBEY_LOCAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_LOCAL_GRAVITY))); |
| 309 | globalObject().setProperty("AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY))); | 300 | globalObject().setProperty("AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY))); |
| 310 | 301 | ||
| 311 | // let the VoxelPacketSender know how frequently we plan to call it | 302 | // let the VoxelPacketSender know how frequently we plan to call it |
| 312 | _voxelsScriptingInterface.getVoxelPacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS); | 303 | _voxelsScriptingInterface.getVoxelPacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS); |
| 313 | _particlesScriptingInterface.getParticlePacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS); | ||
| 314 | } | 304 | } |
| 315 | 305 | ||
| 316 | QScriptValue ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { | 306 | QScriptValue ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { |
| @@ -425,16 +415,6 @@ void ScriptEngine::run() { · 108 unmodified lines | |||
| 425 | } | 415 | } |
| 426 | } | 416 | } |
| 427 | 417 | ||
| 428 | if (_particlesScriptingInterface.getParticlePacketSender()->serversExist()) { | ||
| 429 | // release the queue of edit voxel messages. | ||
| 430 | _particlesScriptingInterface.getParticlePacketSender()->releaseQueuedMessages(); | ||
| 431 | |||
| 432 | // since we're in non-threaded mode, call process so that the packets are sent | ||
| 433 | if (!_particlesScriptingInterface.getParticlePacketSender()->isThreaded()) { | ||
| 434 | _particlesScriptingInterface.getParticlePacketSender()->process(); | ||
| 435 | } | ||
| 436 | } | ||
| 437 | |||
| 438 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { | 418 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { |
| 439 | // release the queue of edit voxel messages. | 419 | // release the queue of edit voxel messages. |
| 440 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); | 420 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); |
| @@ -572,16 +552,6 @@ void ScriptEngine::run() { · 131 unmodified lines | |||
| 572 | } | 552 | } |
| 573 | } | 553 | } |
| 574 | 554 | ||
| 575 | if (_particlesScriptingInterface.getParticlePacketSender()->serversExist()) { | ||
| 576 | // release the queue of edit voxel messages. | ||
| 577 | _particlesScriptingInterface.getParticlePacketSender()->releaseQueuedMessages(); | ||
| 578 | |||
| 579 | // since we're in non-threaded mode, call process so that the packets are sent | ||
| 580 | if (!_particlesScriptingInterface.getParticlePacketSender()->isThreaded()) { | ||
| 581 | _particlesScriptingInterface.getParticlePacketSender()->process(); | ||
| 582 | } | ||
| 583 | } | ||
| 584 | |||
| 585 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { | 555 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { |
| 586 | // release the queue of edit entity messages. | 556 | // release the queue of edit entity messages. |
| 587 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); | 557 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); |