From ef67a72f23b55383c8da20bcb0a286e68a998881 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 8 May 2014 07:22:55 -0700 Subject: [PATCH 1/5] Remove icon paths from runningScriptsWidget.ui These icon paths are already set programmatically. --- interface/ui/runningScriptsWidget.ui | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/interface/ui/runningScriptsWidget.ui b/interface/ui/runningScriptsWidget.ui index 6abd0f2d5a..cb0106cd48 100644 --- a/interface/ui/runningScriptsWidget.ui +++ b/interface/ui/runningScriptsWidget.ui @@ -88,10 +88,6 @@ padding-top: 3px; Reload all - - - ../resources/images/reload.svg../resources/images/reload.svg - @@ -115,10 +111,6 @@ padding-top: 3px; Stop all - - - ../resources/images/stop.svg../resources/images/stop.svg - @@ -251,10 +243,6 @@ padding-top: 3px; Load script - - - ../resources/images/plus.svg../resources/images/plus.svg - widgetTitle currentlyRunningLabel From fdaa42b21902813475fee733b5f8cce784cbfa42 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 8 May 2014 07:54:49 -0700 Subject: [PATCH 2/5] Add hifi:// clickable links to chat The handling also needed to be updated to handle domains correctly - just routing to goToURL instead of gTo fixes this. --- interface/src/Menu.cpp | 4 +--- interface/src/ui/ChatWindow.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index ad2b220d55..a027a7939c 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -984,9 +984,7 @@ void Menu::goToUser(const QString& user) { /// Open a url, shortcutting any "hifi" scheme URLs to the local application. void Menu::openUrl(const QUrl& url) { if (url.scheme() == "hifi") { - QString path = url.toString(QUrl::RemoveScheme); - path = path.remove(QRegExp("^:?/*")); - goTo(path); + goToURL(url.toString()); } else { QDesktopServices::openUrl(url); } diff --git a/interface/src/ui/ChatWindow.cpp b/interface/src/ui/ChatWindow.cpp index 72445fa69a..fce900f352 100644 --- a/interface/src/ui/ChatWindow.cpp +++ b/interface/src/ui/ChatWindow.cpp @@ -30,7 +30,7 @@ const int NUM_MESSAGES_TO_TIME_STAMP = 20; -const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?))://\\S+)"); +const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)"); const QRegularExpression regexHifiLinks("([#@]\\S+)"); const QString mentionSoundsPath("/sounds/mention/"); const QString mentionRegex("@(\\b%1\\b)"); From e1717b1c53f0fed9af37246d51854e510344954a Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Fri, 9 May 2014 15:02:47 -0700 Subject: [PATCH 3/5] Fix bug with mirror settings not initialized --- interface/src/Application.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 61666ccdeb..c9b14d50a1 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -152,6 +152,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _mirrorViewRect(QRect(MIRROR_VIEW_LEFT_PADDING, MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT)), _cameraPushback(0.0f), _scaleMirror(1.0f), + _rotateMirror(0.0f), + _raiseMirror(0.0f), _mouseX(0), _mouseY(0), _lastMouseMove(usecTimestampNow()), From ea1bcd13a4d579a6f9c76962d8f5d7c372931dab Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Fri, 9 May 2014 17:39:03 -0700 Subject: [PATCH 4/5] Updated guitar with more chords, key triggers --- examples/airGuitar.js | 85 +++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 23 deletions(-) diff --git a/examples/airGuitar.js b/examples/airGuitar.js index b7c4b72948..78c16be7bc 100644 --- a/examples/airGuitar.js +++ b/examples/airGuitar.js @@ -35,16 +35,26 @@ var chords = new Array(); chords[1] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+A.raw"); chords[2] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+B.raw"); chords[3] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+E.raw"); +chords[4] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+G.raw"); + // Electric guitar -chords[4] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+A+short.raw"); -chords[5] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+B+short.raw"); -chords[6] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+E+short.raw"); +chords[5] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+A+short.raw"); +chords[6] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+B+short.raw"); +chords[7] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+E+short.raw"); +chords[8] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+G+short.raw"); -var guitarSelector = 3; +// Steel Guitar +chords[9] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+A.raw"); +chords[10] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+B.raw"); +chords[11] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+E.raw"); +chords[12] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+G.raw"); -var whichChord = chords[guitarSelector + 1]; +var NUM_CHORDS = 4; +var NUM_GUITARS = 3; +var guitarSelector = NUM_CHORDS; +var whichChord = 1; -var leftHanded = false; +var leftHanded = true; if (leftHanded) { var strumHand = 0; var chordHand = 1; @@ -59,20 +69,23 @@ var lastPosition = { x: 0.0, var soundPlaying = false; var selectorPressed = false; +var position; MyAvatar.attach(guitarModel, "Hips", {x: -0.0, y: -0.0, z: 0.0}, Quat.fromPitchYawRollDegrees(0, 0, 0), 1.0); function checkHands(deltaTime) { for (var palm = 0; palm < 2; palm++) { var palmVelocity = Controller.getSpatialControlVelocity(palm * 2 + 1); - var speed = length(palmVelocity) / 4.0; + var volume = length(palmVelocity) / 5.0; var position = Controller.getSpatialControlPosition(palm * 2 + 1); var myPelvis = MyAvatar.position; var trigger = Controller.getTriggerValue(strumHand); var chord = Controller.getTriggerValue(chordHand); + if (volume > 1.0) volume = 1.0; if ((chord > 0.1) && Audio.isInjectorPlaying(soundPlaying)) { // If chord finger trigger pulled, stop current chord + print("stopped sound"); Audio.stopInjector(soundPlaying); } @@ -81,11 +94,10 @@ function checkHands(deltaTime) { // Change guitars if button FWD (5) pressed if (Controller.isButtonPressed(chordHand * BUTTON_COUNT + 5)) { if (!selectorPressed) { - if (guitarSelector == 0) { - guitarSelector = 3; - } else { + guitarSelector += NUM_CHORDS; + if (guitarSelector >= NUM_CHORDS * NUM_GUITARS) { guitarSelector = 0; - } + } selectorPressed = true; } } else { @@ -93,38 +105,65 @@ function checkHands(deltaTime) { } if (Controller.isButtonPressed(chordHand * BUTTON_COUNT + 1)) { - whichChord = chords[guitarSelector + 1]; + whichChord = 1; } else if (Controller.isButtonPressed(chordHand * BUTTON_COUNT + 2)) { - whichChord = chords[guitarSelector + 2]; + whichChord = 2; } else if (Controller.isButtonPressed(chordHand * BUTTON_COUNT + 3)) { - whichChord = chords[guitarSelector + 3]; + whichChord = 3; + } else if (Controller.isButtonPressed(chordHand * BUTTON_COUNT + 4)) { + whichChord = 4; } if (palm == strumHand) { - var STRUM_HEIGHT_ABOVE_PELVIS = 0.00; + var STRUM_HEIGHT_ABOVE_PELVIS = 0.10; var strumTriggerHeight = myPelvis.y + STRUM_HEIGHT_ABOVE_PELVIS; //printVector(position); if ( ( ((position.y < strumTriggerHeight) && (lastPosition.y >= strumTriggerHeight)) || ((position.y > strumTriggerHeight) && (lastPosition.y <= strumTriggerHeight)) ) && (trigger > 0.1) ){ // If hand passes downward or upward through 'strings', and finger trigger pulled, play - var options = new AudioInjectionOptions(); - options.position = position; - if (speed > 1.0) { speed = 1.0; } - options.volume = speed; - if (Audio.isInjectorPlaying(soundPlaying)) { - Audio.stopInjector(soundPlaying); - } - soundPlaying = Audio.playSound(whichChord, options); + playChord(position, volume); } lastPosition = Controller.getSpatialControlPosition(palm * 2 + 1); } } } +function playChord(position, volume) { + var options = new AudioInjectionOptions(); + options.position = position; + options.volume = volume; + if (Audio.isInjectorPlaying(soundPlaying)) { + print("stopped sound"); + Audio.stopInjector(soundPlaying); + } + print("Played sound: " + whichChord + " at volume " + options.volume); + soundPlaying = Audio.playSound(chords[guitarSelector + whichChord], options); +} + +function keyPressEvent(event) { + // check for keypresses and use those to trigger sounds if not hydra + keyVolume = 0.4; + if (event.text == "1") { + whichChord = 1; + playChord(MyAvatar.position, keyVolume); + } else if (event.text == "2") { + whichChord = 2; + playChord(MyAvatar.position, keyVolume); + } else if (event.text == "3") { + whichChord = 3; + playChord(MyAvatar.position, keyVolume); + } else if (event.text == "4") { + whichChord = 4; + playChord(MyAvatar.position, keyVolume); + } +} + function scriptEnding() { MyAvatar.detachOne(guitarModel); } // Connect a call back that happens every frame Script.update.connect(checkHands); Script.scriptEnding.connect(scriptEnding); +Controller.keyPressEvent.connect(keyPressEvent); + From 3e1d0536c174310bb025f0516ae475282773d785 Mon Sep 17 00:00:00 2001 From: Kai Ludwig Date: Sun, 11 May 2014 16:18:43 +0200 Subject: [PATCH 5/5] Fix for: #19626 - Fix the Windows 7 crash The image data for glTexImage2D is size=width x height without any borders. So there must be a border of 0 given when calling glTexImage2D, otherwise there is not enough image data causing crashes when textures get loaded. The effect occurs reproducible on Win7 with ATI cards. Maybe their OpenGL-Implementation is less robust ... --- interface/src/avatar/Avatar.cpp | 2 +- interface/src/renderer/TextureCache.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index b74adee55a..41dc50b1fa 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -406,7 +406,7 @@ void Avatar::renderBillboard() { } _billboardTexture.reset(new Texture()); glBindTexture(GL_TEXTURE_2D, _billboardTexture->getID()); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 1, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, image.constBits()); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); diff --git a/interface/src/renderer/TextureCache.cpp b/interface/src/renderer/TextureCache.cpp index f31e4f9060..0588ca70d2 100644 --- a/interface/src/renderer/TextureCache.cpp +++ b/interface/src/renderer/TextureCache.cpp @@ -366,10 +366,10 @@ void NetworkTexture::setImage(const QImage& image, bool translucent) { imageLoaded(image); glBindTexture(GL_TEXTURE_2D, getID()); if (image.hasAlphaChannel()) { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 1, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, image.constBits()); } else { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 1, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.constBits()); } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -404,10 +404,10 @@ QSharedPointer DilatableNetworkTexture::getDilatedTexture(float dilatio glBindTexture(GL_TEXTURE_2D, texture->getID()); if (dilatedImage.hasAlphaChannel()) { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dilatedImage.width(), dilatedImage.height(), 1, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dilatedImage.width(), dilatedImage.height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, dilatedImage.constBits()); } else { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, dilatedImage.width(), dilatedImage.height(), 1, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, dilatedImage.width(), dilatedImage.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, dilatedImage.constBits()); } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);