History

resolve conflicts on merge with upstream master

Stephen Birarda committed 11 years ago

Commit 51bba482 parents 6d8f319 b385fe9162 files · +635 −11958Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 162 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+1−38
@@ -28,22 +28,18 @@ · 27 unmodified lines
2828 #include <NodeList.h>
2929 #include <PacketHeaders.h>
3030 #include <UUID.h>
31−#include <VoxelConstants.h>
32−#include <VoxelDetail.h>
3331
3432 #include "AnimationObject.h"
3533 #include "ArrayBufferViewClass.h"
3634 #include "DataViewClass.h"
3735 #include "EventTypes.h"
3836 #include "MenuItemProperties.h"
39−#include "LocalVoxels.h"
4037 #include "ScriptEngine.h"
4138 #include "TypedArrays.h"
4239 #include "XMLHttpRequestClass.h"
4340
4441 #include "MIDIEvent.h"
4542
46−VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface;
4743 EntityScriptingInterface ScriptEngine::_entityScriptingInterface;
4844
4945 static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine){
@@ -200,8 +196,6 @@ void ScriptEngine::handleScriptDownload() { · 150 unmodified lines
200196 }
201197 }
202198
203−Q_SCRIPT_DECLARE_QMETAOBJECT(LocalVoxels, QString)
204−
205199 void ScriptEngine::init() {
206200 if (_isInitialized) {
207201 return; // only initialize once
@@ -209,12 +203,9 @@ void ScriptEngine::init() { · 1 unmodified line
209203
210204 _isInitialized = true;
211205
212− _voxelsScriptingInterface.init();
213−
214206 // register various meta-types
215207 registerMetaTypes(this);
216208 registerMIDIMetaTypes(this);
217− registerVoxelMetaTypes(this);
218209 registerEventTypes(this);
219210 registerMenuItemProperties(this);
220211 registerAnimationTypes(this);
@@ -237,9 +228,6 @@ void ScriptEngine::init() { · 16 unmodified lines
237228 QScriptValue printConstructorValue = newFunction(debugPrint);
238229 globalObject().setProperty("print", printConstructorValue);
239230
240− QScriptValue localVoxelsValue = scriptValueFromQMetaObject<LocalVoxels>();
241− globalObject().setProperty("LocalVoxels", localVoxelsValue);
242−
243231 QScriptValue audioEffectOptionsConstructorValue = newFunction(AudioEffectOptions::constructor);
244232 globalObject().setProperty("AudioEffectOptions", audioEffectOptionsConstructorValue);
245233
@@ -257,19 +245,14 @@ void ScriptEngine::init() { · 11 unmodified lines
257245 registerGlobalObject("Uuid", &_uuidLibrary);
258246 registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data());
259247
260− registerGlobalObject("Voxels", &_voxelsScriptingInterface);
261−
262248 // constants
263249 globalObject().setProperty("TREE_SCALE", newVariant(QVariant(TREE_SCALE)));
264250 globalObject().setProperty("COLLISION_GROUP_ENVIRONMENT", newVariant(QVariant(COLLISION_GROUP_ENVIRONMENT)));
265251 globalObject().setProperty("COLLISION_GROUP_AVATARS", newVariant(QVariant(COLLISION_GROUP_AVATARS)));
266− globalObject().setProperty("COLLISION_GROUP_VOXELS", newVariant(QVariant(COLLISION_GROUP_VOXELS)));
267252
268253 globalObject().setProperty("AVATAR_MOTION_OBEY_LOCAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_LOCAL_GRAVITY)));
269254 globalObject().setProperty("AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY)));
270255
271− // let the VoxelPacketSender know how frequently we plan to call it
272− _voxelsScriptingInterface.getVoxelPacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS);
273256 }
274257
275258 QScriptValue ScriptEngine::registerGlobalObject(const QString& name, QObject* object) {
@@ -379,18 +362,8 @@ void ScriptEngine::run() { · 103 unmodified lines
379362 break;
380363 }
381364
382− if (_voxelsScriptingInterface.getVoxelPacketSender()->serversExist()) {
383− // release the queue of edit voxel messages.
384− _voxelsScriptingInterface.getVoxelPacketSender()->releaseQueuedMessages();
385−
386− // since we're in non-threaded mode, call process so that the packets are sent
387− if (!_voxelsScriptingInterface.getVoxelPacketSender()->isThreaded()) {
388− _voxelsScriptingInterface.getVoxelPacketSender()->process();
389− }
390− }
391−
392365 if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) {
393− // release the queue of edit voxel messages.
366+ // release the queue of edit entity messages.
394367 _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages();
395368
396369 // since we're in non-threaded mode, call process so that the packets are sent
@@ -517,16 +490,6 @@ void ScriptEngine::run() { · 120 unmodified lines
517490 // kill the avatar identity timer
518491 delete _avatarIdentityTimer;
519492
520− if (_voxelsScriptingInterface.getVoxelPacketSender()->serversExist()) {
521− // release the queue of edit voxel messages.
522− _voxelsScriptingInterface.getVoxelPacketSender()->releaseQueuedMessages();
523−
524− // since we're in non-threaded mode, call process so that the packets are sent
525− if (!_voxelsScriptingInterface.getVoxelPacketSender()->isThreaded()) {
526− _voxelsScriptingInterface.getVoxelPacketSender()->process();
527− }
528− }
529−
530493 if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) {
531494 // release the queue of edit entity messages.
532495 _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages();