From fdaa42b21902813475fee733b5f8cce784cbfa42 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 8 May 2014 07:54:49 -0700 Subject: [PATCH 1/2] 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 3e1d0536c174310bb025f0516ae475282773d785 Mon Sep 17 00:00:00 2001 From: Kai Ludwig Date: Sun, 11 May 2014 16:18:43 +0200 Subject: [PATCH 2/2] 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);