Model Server to Entity Server Refactoring
Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 158 files). Show all
Unified · Split
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include <AvatarData.h> | 22 | #include <AvatarData.h> |
| 23 | #include <Bitstream.h> | 23 | #include <Bitstream.h> |
| 24 | #include <CollisionInfo.h> | 24 | #include <CollisionInfo.h> |
| 25 | #include <ModelsScriptingInterface.h> | 25 | #include <EntityScriptingInterface.h> |
| 26 | #include <NetworkAccessManager.h> | 26 | #include <NetworkAccessManager.h> |
| 27 | #include <NodeList.h> | 27 | #include <NodeList.h> |
| 28 | #include <PacketHeaders.h> | 28 | #include <PacketHeaders.h> |
| @@ -44,7 +44,7 @@ · 15 unmodified lines | |||
| 44 | 44 | ||
| 45 | VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface; | 45 | VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface; |
| 46 | ParticlesScriptingInterface ScriptEngine::_particlesScriptingInterface; | 46 | ParticlesScriptingInterface ScriptEngine::_particlesScriptingInterface; |
| 47 | ModelsScriptingInterface ScriptEngine::_modelsScriptingInterface; | 47 | EntityScriptingInterface ScriptEngine::_entityScriptingInterface; |
| 48 | 48 | ||
| 49 | static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* engine) { | 49 | static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* engine) { |
| 50 | QUrl soundURL = QUrl(context->argument(0).toString()); | 50 | QUrl soundURL = QUrl(context->argument(0).toString()); |
| @@ -249,10 +249,10 @@ void ScriptEngine::init() { · 198 unmodified lines | |||
| 249 | qScriptRegisterMetaType(this, ParticleIDtoScriptValue, ParticleIDfromScriptValue); | 249 | qScriptRegisterMetaType(this, ParticleIDtoScriptValue, ParticleIDfromScriptValue); |
| 250 | qScriptRegisterSequenceMetaType<QVector<ParticleID> >(this); | 250 | qScriptRegisterSequenceMetaType<QVector<ParticleID> >(this); |
| 251 | 251 | ||
| 252 | qScriptRegisterMetaType(this, ModelItemPropertiesToScriptValue, ModelItemPropertiesFromScriptValue); | 252 | qScriptRegisterMetaType(this, EntityItemPropertiesToScriptValue, EntityItemPropertiesFromScriptValue); |
| 253 | qScriptRegisterMetaType(this, ModelItemIDtoScriptValue, ModelItemIDfromScriptValue); | 253 | qScriptRegisterMetaType(this, EntityItemIDtoScriptValue, EntityItemIDfromScriptValue); |
| 254 | qScriptRegisterMetaType(this, RayToModelIntersectionResultToScriptValue, RayToModelIntersectionResultFromScriptValue); | 254 | qScriptRegisterMetaType(this, RayToEntityIntersectionResultToScriptValue, RayToEntityIntersectionResultFromScriptValue); |
| 255 | qScriptRegisterSequenceMetaType<QVector<ModelItemID> >(this); | 255 | qScriptRegisterSequenceMetaType<QVector<EntityItemID> >(this); |
| 256 | 256 | ||
| 257 | qScriptRegisterSequenceMetaType<QVector<glm::vec2> >(this); | 257 | qScriptRegisterSequenceMetaType<QVector<glm::vec2> >(this); |
| 258 | qScriptRegisterSequenceMetaType<QVector<glm::quat> >(this); | 258 | qScriptRegisterSequenceMetaType<QVector<glm::quat> >(this); |
| @@ -282,7 +282,7 @@ void ScriptEngine::init() { · 23 unmodified lines | |||
| 282 | registerGlobalObject("Script", this); | 282 | registerGlobalObject("Script", this); |
| 283 | registerGlobalObject("Audio", &_audioScriptingInterface); | 283 | registerGlobalObject("Audio", &_audioScriptingInterface); |
| 284 | registerGlobalObject("Controller", _controllerScriptingInterface); | 284 | registerGlobalObject("Controller", _controllerScriptingInterface); |
| 285 | registerGlobalObject("Models", &_modelsScriptingInterface); | 285 | registerGlobalObject("Entities", &_entityScriptingInterface); |
| 286 | registerGlobalObject("Particles", &_particlesScriptingInterface); | 286 | registerGlobalObject("Particles", &_particlesScriptingInterface); |
| 287 | registerGlobalObject("Quat", &_quatLibrary); | 287 | registerGlobalObject("Quat", &_quatLibrary); |
| 288 | registerGlobalObject("Vec3", &_vec3Library); | 288 | registerGlobalObject("Vec3", &_vec3Library); |
| @@ -428,13 +428,13 @@ void ScriptEngine::run() { · 139 unmodified lines | |||
| 428 | } | 428 | } |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | if (_modelsScriptingInterface.getModelPacketSender()->serversExist()) { | 431 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { |
| 432 | // release the queue of edit voxel messages. | 432 | // release the queue of edit voxel messages. |
| 433 | _modelsScriptingInterface.getModelPacketSender()->releaseQueuedMessages(); | 433 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); |
| 434 | 434 | ||
| 435 | // since we're in non-threaded mode, call process so that the packets are sent | 435 | // since we're in non-threaded mode, call process so that the packets are sent |
| 436 | if (!_modelsScriptingInterface.getModelPacketSender()->isThreaded()) { | 436 | if (!_entityScriptingInterface.getEntityPacketSender()->isThreaded()) { |
| 437 | _modelsScriptingInterface.getModelPacketSender()->process(); | 437 | _entityScriptingInterface.getEntityPacketSender()->process(); |
| 438 | } | 438 | } |
| 439 | } | 439 | } |
| 440 | 440 | ||
| @@ -570,13 +570,13 @@ void ScriptEngine::run() { · 129 unmodified lines | |||
| 570 | } | 570 | } |
| 571 | } | 571 | } |
| 572 | 572 | ||
| 573 | if (_modelsScriptingInterface.getModelPacketSender()->serversExist()) { | 573 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { |
| 574 | // release the queue of edit voxel messages. | 574 | // release the queue of edit entity messages. |
| 575 | _modelsScriptingInterface.getModelPacketSender()->releaseQueuedMessages(); | 575 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); |
| 576 | 576 | ||
| 577 | // since we're in non-threaded mode, call process so that the packets are sent | 577 | // since we're in non-threaded mode, call process so that the packets are sent |
| 578 | if (!_modelsScriptingInterface.getModelPacketSender()->isThreaded()) { | 578 | if (!_entityScriptingInterface.getEntityPacketSender()->isThreaded()) { |
| 579 | _modelsScriptingInterface.getModelPacketSender()->process(); | 579 | _entityScriptingInterface.getEntityPacketSender()->process(); |
| 580 | } | 580 | } |
| 581 | } | 581 | } |
| 582 | 582 | ||