History

first major pass at voxelEctomy

ZappoMan committed 11 years ago

Commit 4ea9bbc1 parent 2a129b665 files · +43 −5956Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+2−38
@@ -28,22 +28,19 @@ · 27 unmodified lines
2828 #include <NodeList.h>
2929 #include <PacketHeaders.h>
3030 #include <UUID.h>
31−#include <VoxelConstants.h>
32−#include <VoxelDetail.h>
31+//#include <VoxelConstants.h>
3332
3433 #include "AnimationObject.h"
3534 #include "ArrayBufferViewClass.h"
3635 #include "DataViewClass.h"
3736 #include "EventTypes.h"
3837 #include "MenuItemProperties.h"
39−#include "LocalVoxels.h"
4038 #include "ScriptEngine.h"
4139 #include "TypedArrays.h"
4240 #include "XMLHttpRequestClass.h"
4341
4442 #include "MIDIEvent.h"
4543
46−VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface;
4744 EntityScriptingInterface ScriptEngine::_entityScriptingInterface;
4845
4946 static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine){
@@ -200,8 +197,6 @@ void ScriptEngine::handleScriptDownload() { · 150 unmodified lines
200197 }
201198 }
202199
203−Q_SCRIPT_DECLARE_QMETAOBJECT(LocalVoxels, QString)
204−
205200 void ScriptEngine::init() {
206201 if (_isInitialized) {
207202 return; // only initialize once
@@ -209,12 +204,9 @@ void ScriptEngine::init() { · 1 unmodified line
209204
210205 _isInitialized = true;
211206
212− _voxelsScriptingInterface.init();
213−
214207 // register various meta-types
215208 registerMetaTypes(this);
216209 registerMIDIMetaTypes(this);
217− registerVoxelMetaTypes(this);
218210 registerEventTypes(this);
219211 registerMenuItemProperties(this);
220212 registerAnimationTypes(this);
@@ -237,9 +229,6 @@ void ScriptEngine::init() { · 16 unmodified lines
237229 QScriptValue printConstructorValue = newFunction(debugPrint);
238230 globalObject().setProperty("print", printConstructorValue);
239231
240− QScriptValue localVoxelsValue = scriptValueFromQMetaObject<LocalVoxels>();
241− globalObject().setProperty("LocalVoxels", localVoxelsValue);
242−
243232 QScriptValue audioEffectOptionsConstructorValue = newFunction(AudioEffectOptions::constructor);
244233 globalObject().setProperty("AudioEffectOptions", audioEffectOptionsConstructorValue);
245234
@@ -257,19 +246,14 @@ void ScriptEngine::init() { · 11 unmodified lines
257246 registerGlobalObject("Uuid", &_uuidLibrary);
258247 registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data());
259248
260− registerGlobalObject("Voxels", &_voxelsScriptingInterface);
261−
262249 // constants
263250 globalObject().setProperty("TREE_SCALE", newVariant(QVariant(TREE_SCALE)));
264251 globalObject().setProperty("COLLISION_GROUP_ENVIRONMENT", newVariant(QVariant(COLLISION_GROUP_ENVIRONMENT)));
265252 globalObject().setProperty("COLLISION_GROUP_AVATARS", newVariant(QVariant(COLLISION_GROUP_AVATARS)));
266− globalObject().setProperty("COLLISION_GROUP_VOXELS", newVariant(QVariant(COLLISION_GROUP_VOXELS)));
267253
268254 globalObject().setProperty("AVATAR_MOTION_OBEY_LOCAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_LOCAL_GRAVITY)));
269255 globalObject().setProperty("AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY", newVariant(QVariant(AVATAR_MOTION_OBEY_ENVIRONMENTAL_GRAVITY)));
270256
271− // let the VoxelPacketSender know how frequently we plan to call it
272− _voxelsScriptingInterface.getVoxelPacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS);
273257 }
274258
275259 QScriptValue ScriptEngine::registerGlobalObject(const QString& name, QObject* object) {
@@ -379,18 +363,8 @@ void ScriptEngine::run() { · 103 unmodified lines
379363 break;
380364 }
381365
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−
392366 if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) {
393− // release the queue of edit voxel messages.
367+ // release the queue of edit entity messages.
394368 _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages();
395369
396370 // since we're in non-threaded mode, call process so that the packets are sent
@@ -516,16 +490,6 @@ void ScriptEngine::run() { · 119 unmodified lines
516490 // kill the avatar identity timer
517491 delete _avatarIdentityTimer;
518492
519− if (_voxelsScriptingInterface.getVoxelPacketSender()->serversExist()) {
520− // release the queue of edit voxel messages.
521− _voxelsScriptingInterface.getVoxelPacketSender()->releaseQueuedMessages();
522−
523− // since we're in non-threaded mode, call process so that the packets are sent
524− if (!_voxelsScriptingInterface.getVoxelPacketSender()->isThreaded()) {
525− _voxelsScriptingInterface.getVoxelPacketSender()->process();
526− }
527− }
528−
529493 if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) {
530494 // release the queue of edit entity messages.
531495 _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages();