Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 49 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> |
| @@ -43,7 +42,6 @@ · 10 unmodified lines | |||
| 43 | #include "XMLHttpRequestClass.h" | 42 | #include "XMLHttpRequestClass.h" |
| 44 | 43 | ||
| 45 | VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface; | 44 | VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface; |
| 46 | ParticlesScriptingInterface ScriptEngine::_particlesScriptingInterface; | ||
| 47 | EntityScriptingInterface ScriptEngine::_entityScriptingInterface; | 45 | EntityScriptingInterface ScriptEngine::_entityScriptingInterface; |
| 48 | 46 | ||
| 49 | static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* engine) { | 47 | static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* engine) { |
| @@ -236,7 +234,6 @@ void ScriptEngine::init() { · 186 unmodified lines | |||
| 236 | _isInitialized = true; | 234 | _isInitialized = true; |
| 237 | 235 | ||
| 238 | _voxelsScriptingInterface.init(); | 236 | _voxelsScriptingInterface.init(); |
| 239 | _particlesScriptingInterface.init(); | ||
| 240 | 237 | ||
| 241 | // register various meta-types | 238 | // register various meta-types |
| 242 | registerMetaTypes(this); | 239 | registerMetaTypes(this); |
| @@ -248,10 +245,6 @@ void ScriptEngine::init() { · 5 unmodified lines | |||
| 248 | registerAvatarTypes(this); | 245 | registerAvatarTypes(this); |
| 249 | Bitstream::registerTypes(this); | 246 | Bitstream::registerTypes(this); |
| 250 | 247 | ||
| 251 | qScriptRegisterMetaType(this, ParticlePropertiesToScriptValue, ParticlePropertiesFromScriptValue); | ||
| 252 | qScriptRegisterMetaType(this, ParticleIDtoScriptValue, ParticleIDfromScriptValue); | ||
| 253 | qScriptRegisterSequenceMetaType<QVector<ParticleID> >(this); | ||
| 254 | |||
| 255 | qScriptRegisterMetaType(this, EntityItemPropertiesToScriptValue, EntityItemPropertiesFromScriptValue); | 248 | qScriptRegisterMetaType(this, EntityItemPropertiesToScriptValue, EntityItemPropertiesFromScriptValue); |
| 256 | qScriptRegisterMetaType(this, EntityItemIDtoScriptValue, EntityItemIDfromScriptValue); | 249 | qScriptRegisterMetaType(this, EntityItemIDtoScriptValue, EntityItemIDfromScriptValue); |
| 257 | qScriptRegisterMetaType(this, RayToEntityIntersectionResultToScriptValue, RayToEntityIntersectionResultFromScriptValue); | 250 | qScriptRegisterMetaType(this, RayToEntityIntersectionResultToScriptValue, RayToEntityIntersectionResultFromScriptValue); |
| @@ -286,7 +279,6 @@ void ScriptEngine::init() { · 28 unmodified lines | |||
| 286 | registerGlobalObject("Audio", &_audioScriptingInterface); | 279 | registerGlobalObject("Audio", &_audioScriptingInterface); |
| 287 | registerGlobalObject("Controller", _controllerScriptingInterface); | 280 | registerGlobalObject("Controller", _controllerScriptingInterface); |
| 288 | registerGlobalObject("Entities", &_entityScriptingInterface); | 281 | registerGlobalObject("Entities", &_entityScriptingInterface); |
| 289 | registerGlobalObject("Particles", &_particlesScriptingInterface); | ||
| 290 | registerGlobalObject("Quat", &_quatLibrary); | 282 | registerGlobalObject("Quat", &_quatLibrary); |
| 291 | registerGlobalObject("Vec3", &_vec3Library); | 283 | registerGlobalObject("Vec3", &_vec3Library); |
| 292 | registerGlobalObject("Uuid", &_uuidLibrary); | 284 | registerGlobalObject("Uuid", &_uuidLibrary); |
| @@ -299,14 +291,12 @@ void ScriptEngine::init() { · 6 unmodified lines | |||
| 299 | globalObject().setProperty("COLLISION_GROUP_ENVIRONMENT", newVariant(QVariant(COLLISION_GROUP_ENVIRONMENT))); | 291 | globalObject().setProperty("COLLISION_GROUP_ENVIRONMENT", newVariant(QVariant(COLLISION_GROUP_ENVIRONMENT))); |
| 300 | globalObject().setProperty("COLLISION_GROUP_AVATARS", newVariant(QVariant(COLLISION_GROUP_AVATARS))); | 292 | globalObject().setProperty("COLLISION_GROUP_AVATARS", newVariant(QVariant(COLLISION_GROUP_AVATARS))); |
| 301 | globalObject().setProperty("COLLISION_GROUP_VOXELS", newVariant(QVariant(COLLISION_GROUP_VOXELS))); | 293 | globalObject().setProperty("COLLISION_GROUP_VOXELS", newVariant(QVariant(COLLISION_GROUP_VOXELS))); |
| 302 | globalObject().setProperty("COLLISION_GROUP_PARTICLES", newVariant(QVariant(COLLISION_GROUP_PARTICLES))); | ||
| 303 | 294 | ||
| 304 | globalObject().setProperty("AVATAR_MOTION_OBEY_LOCAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_LOCAL_GRAVITY))); | 295 | globalObject().setProperty("AVATAR_MOTION_OBEY_LOCAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_LOCAL_GRAVITY))); |
| 305 | globalObject().setProperty("AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY))); | 296 | globalObject().setProperty("AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY))); |
| 306 | 297 | ||
| 307 | // let the VoxelPacketSender know how frequently we plan to call it | 298 | // let the VoxelPacketSender know how frequently we plan to call it |
| 308 | _voxelsScriptingInterface.getVoxelPacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS); | 299 | _voxelsScriptingInterface.getVoxelPacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS); |
| 309 | _particlesScriptingInterface.getParticlePacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS); | ||
| 310 | } | 300 | } |
| 311 | 301 | ||
| 312 | QScriptValue ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { | 302 | QScriptValue ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { |
| @@ -421,16 +411,6 @@ void ScriptEngine::run() { · 108 unmodified lines | |||
| 421 | } | 411 | } |
| 422 | } | 412 | } |
| 423 | 413 | ||
| 424 | if (_particlesScriptingInterface.getParticlePacketSender()->serversExist()) { | ||
| 425 | // release the queue of edit voxel messages. | ||
| 426 | _particlesScriptingInterface.getParticlePacketSender()->releaseQueuedMessages(); | ||
| 427 | |||
| 428 | // since we're in non-threaded mode, call process so that the packets are sent | ||
| 429 | if (!_particlesScriptingInterface.getParticlePacketSender()->isThreaded()) { | ||
| 430 | _particlesScriptingInterface.getParticlePacketSender()->process(); | ||
| 431 | } | ||
| 432 | } | ||
| 433 | |||
| 434 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { | 414 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { |
| 435 | // release the queue of edit voxel messages. | 415 | // release the queue of edit voxel messages. |
| 436 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); | 416 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); |
| @@ -568,16 +548,6 @@ void ScriptEngine::run() { · 131 unmodified lines | |||
| 568 | } | 548 | } |
| 569 | } | 549 | } |
| 570 | 550 | ||
| 571 | if (_particlesScriptingInterface.getParticlePacketSender()->serversExist()) { | ||
| 572 | // release the queue of edit voxel messages. | ||
| 573 | _particlesScriptingInterface.getParticlePacketSender()->releaseQueuedMessages(); | ||
| 574 | |||
| 575 | // since we're in non-threaded mode, call process so that the packets are sent | ||
| 576 | if (!_particlesScriptingInterface.getParticlePacketSender()->isThreaded()) { | ||
| 577 | _particlesScriptingInterface.getParticlePacketSender()->process(); | ||
| 578 | } | ||
| 579 | } | ||
| 580 | |||
| 581 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { | 551 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { |
| 582 | // release the queue of edit entity messages. | 552 | // release the queue of edit entity messages. |
| 583 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); | 553 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); |