Merge branch 'controllers' of https://github.com/highfidelity/hifi into controllers

This commit is contained in:
samcake 2015-10-22 16:13:54 -07:00
commit 9015e98b70
34 changed files with 43 additions and 53 deletions

View file

@ -1,6 +1,5 @@
//
// breakdanceCore.js
// examples/toys
//
// This is the core breakdance game library, it can be used as part of an entity script, or an omniTool module, or bootstapped on it's own
// Created by Brad Hefta-Gaub on August 24, 2015

View file

@ -7,10 +7,10 @@
//
// FIXME Script paths have to be relative to the caller, in this case libraries/OmniTool.js
Script.include("../toys/magBalls/constants.js");
Script.include("../toys/magBalls/graph.js");
Script.include("../toys/magBalls/edgeSpring.js");
Script.include("../toys/magBalls/magBalls.js");
Script.include("../entityScripts/magBalls/constants.js");
Script.include("../entityScripts/magBalls/graph.js");
Script.include("../entityScripts/magBalls/edgeSpring.js");
Script.include("../entityScripts/magBalls/magBalls.js");
Script.include("avatarRelativeOverlays.js");
OmniToolModuleType = "MagBallsController"

View file

@ -17,7 +17,7 @@
(function () {
var _this;
var utilitiesScript = Script.resolvePath("../libraries/utils.js");
var utilitiesScript = Script.resolvePath("../../libraries/utils.js");
Script.include(utilitiesScript);
LightSwitch = function () {
_this = this;

View file

@ -13,7 +13,7 @@
// Script.include("../libraries/utils.js");
//Need absolute path for now, for testing before PR merge and s3 cloning. Will change post-merge
Script.include("../libraries/utils.js");
Script.include("../../libraries/utils.js");
this.spraySound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/sprayPaintSound.wav");

View file

@ -245,6 +245,8 @@ QByteArray AvatarActionHold::serialize() const {
dataStream << _expires + getEntityServerClockSkew();
dataStream << _tag;
dataStream << _kinematic;
dataStream << _kinematicSetVelocity;
});
return serializedActionArguments;
@ -278,6 +280,8 @@ void AvatarActionHold::deserialize(QByteArray serializedArguments) {
dataStream >> _expires;
_expires -= getEntityServerClockSkew();
dataStream >> _tag;
dataStream >> _kinematic;
dataStream >> _kinematicSetVelocity;
#if WANT_DEBUG
qDebug() << "deserialize AvatarActionHold: " << _holderID

View file

@ -43,11 +43,9 @@ bool GlWindow::makeCurrent() {
qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
});
#ifndef QT_NO_DEBUG
QOpenGLContext * currentContext =
#endif
QOpenGLContext::currentContext();
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
Q_ASSERT(_context == currentContext);
return makeCurrentResult;
}

View file

@ -108,13 +108,10 @@ void VrMenu::addMenu(QMenu* menu) {
Q_ASSERT(false);
}
QVariant returnedValue;
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
bool invokeResult = QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
Q_ASSERT(invokeResult);
QObject* result = returnedValue.value<QObject*>();
Q_ASSERT(result);
@ -150,13 +147,11 @@ void VrMenu::addAction(QMenu* menu, QAction* action) {
QObject* menuQml = findMenuObject(userData->uuid.toString());
Q_ASSERT(menuQml);
QVariant returnedValue;
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
Q_ARG(QVariant, QVariant::fromValue(action->text())));
bool invokeResult = QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
Q_ARG(QVariant, QVariant::fromValue(action->text())));
Q_ASSERT(invokeResult);
QObject* result = returnedValue.value<QObject*>();
Q_ASSERT(result);
@ -173,14 +168,11 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
}
QObject* menu = beforeQml->parent();
QVariant returnedValue;
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menu)),
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),
Q_ARG(QVariant, QVariant::fromValue(action->text())));
bool invokeResult = QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menu)),
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),
Q_ARG(QVariant, QVariant::fromValue(action->text())));
Q_ASSERT(invokeResult);
QObject* result = returnedValue.value<QObject*>();
Q_ASSERT(result);
@ -199,9 +191,5 @@ void VrMenu::removeAction(QAction* action) {
bool invokeResult = QMetaObject::invokeMethod(this, "removeItem", Qt::DirectConnection,
Q_ARG(QVariant, QVariant::fromValue(menu)),
Q_ARG(QVariant, QVariant::fromValue(item)));
#ifndef QT_NO_DEBUG
Q_ASSERT(invokeResult);
#else
Q_UNUSED(invokeResult);
#endif
}

View file

@ -14,14 +14,15 @@
var _this;
var sprayPaintScriptURL = Script.resolvePath("../examples/toys/sprayPaintCan.js");
var catScriptURL = Script.resolvePath("../examples/toys/cat.js");
var flashlightScriptURL = Script.resolvePath('../examples/toys/flashlight/flashlight.js');
var pingPongScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/pingPongGun.js');
var wandScriptURL = Script.resolvePath("../examples/toys/bubblewand/wand.js");
var dollScriptURL = Script.resolvePath("../examples/toys/doll/doll.js");
var lightsScriptURL = Script.resolvePath("../examples/toys/lightSwitch.js");
var targetsScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/wallTarget.js');
var sprayPaintScriptURL = Script.resolvePath("../examples/toybox/spray_paint/sprayPaintCan.js");
var catScriptURL = Script.resolvePath("../examples/toybox/cat/cat.js");
var flashlightScriptURL = Script.resolvePath('../examples/toybox/flashlight/flashlight.js');
var pingPongScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/pingPongGun.js');
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
ResetSwitch = function() {
_this = this;

View file

@ -14,14 +14,14 @@
var utilitiesScript = Script.resolvePath("../examples/libraries/utils.js");
Script.include(utilitiesScript);
var sprayPaintScriptURL = Script.resolvePath("../examples/toys/sprayPaintCan.js");
var catScriptURL = Script.resolvePath("../examples/toys/cat.js");
var flashlightScriptURL = Script.resolvePath('../examples/toys/flashlight/flashlight.js');
var pingPongScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/pingPongGun.js');
var wandScriptURL = Script.resolvePath("../examples/toys/bubblewand/wand.js");
var dollScriptURL = Script.resolvePath("../examples/toys/doll/doll.js");
var lightsScriptURL = Script.resolvePath("../examples/toys/lightSwitch.js");
var targetsScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/wallTarget.js');
var sprayPaintScriptURL = Script.resolvePath("../examples/toybox/spray_paint/sprayPaintCan.js");
var catScriptURL = Script.resolvePath("../examples/toybox/cat/cat.js");
var flashlightScriptURL = Script.resolvePath('../examples/toybox/flashlight/flashlight.js');
var pingPongScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/pingPongGun.js');
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');