History

Merge branch 'master' of http://github.com/highfidelity/hifi into taa

Olivier Prat committed 8 years ago

Commit aad571f2 parents bafd634 5bd49ce98 files · +905 −616Browse files

Showing the changes to interface/src/Application.cpp (1 of 98 files). Show all

Unified · Split

interface/src/Application.cpp+20−10
@@ -981,6 +981,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 980 unmodified lines
981981 qInstallMessageHandler(messageHandler);
982982
983983 QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
984+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/fontawesome-webfont.ttf");
985+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/hifi-glyphs.ttf");
986+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/AnonymousPro-Regular.ttf");
987+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-Regular.ttf");
988+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-SemiBold.ttf");
989+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Light.ttf");
990+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Regular.ttf");
991+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Bold.ttf");
992+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-SemiBold.ttf");
984993 _window->setWindowTitle("High Fidelity Interface");
985994
986995 Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
@@ -6637,17 +6646,17 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo · 5650 unmodified lines
66376646
66386647 addAssetToWorldInfo(filename, "Adding " + mapping.mid(1) + " to the Asset Server.");
66396648
6640− addAssetToWorldWithNewMapping(path, mapping, 0);
6649+ addAssetToWorldWithNewMapping(path, mapping, 0, isZip, isBlocks);
66416650 }
66426651
6643−void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy) {
6652+void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy, bool isZip, bool isBlocks) {
66446653 auto request = DependencyManager::get<AssetClient>()->createGetMappingRequest(mapping);
66456654
66466655 QObject::connect(request, &GetMappingRequest::finished, this, [=](GetMappingRequest* request) mutable {
66476656 const int MAX_COPY_COUNT = 100; // Limit number of duplicate assets; recursion guard.
66486657 auto result = request->getError();
66496658 if (result == GetMappingRequest::NotFound) {
6650− addAssetToWorldUpload(filePath, mapping);
6659+ addAssetToWorldUpload(filePath, mapping, isZip, isBlocks);
66516660 } else if (result != GetMappingRequest::NoError) {
66526661 QString errorInfo = "Could not map asset name: "
66536662 + mapping.left(mapping.length() - QString::number(copy).length() - 1);
@@ -6659,7 +6668,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 5 unmodified lines
66596668 }
66606669 copy++;
66616670 mapping = mapping.insert(mapping.lastIndexOf("."), "-" + QString::number(copy));
6662− addAssetToWorldWithNewMapping(filePath, mapping, copy);
6671+ addAssetToWorldWithNewMapping(filePath, mapping, copy, isZip, isBlocks);
66636672 } else {
66646673 QString errorInfo = "Too many copies of asset name: "
66656674 + mapping.left(mapping.length() - QString::number(copy).length() - 1);
@@ -6672,7 +6681,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 6 unmodified lines
66726681 request->start();
66736682 }
66746683
6675−void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
6684+void Application::addAssetToWorldUpload(QString filePath, QString mapping, bool isZip, bool isBlocks) {
66766685 qInfo(interfaceapp) << "Uploading" << filePath << "to Asset Server as" << mapping;
66776686 auto upload = DependencyManager::get<AssetClient>()->createUpload(filePath);
66786687 QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
@@ -6681,7 +6690,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) { · 2 unmodified lines
66816690 qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
66826691 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
66836692 } else {
6684− addAssetToWorldSetMapping(filePath, mapping, hash);
6693+ addAssetToWorldSetMapping(filePath, mapping, hash, isZip, isBlocks);
66856694 }
66866695
66876696 // Remove temporary directory created by Clara.io market place download.
@@ -6698,7 +6707,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) { · 10 unmodified lines
66986707 upload->start();
66996708 }
67006709
6701−void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash) {
6710+void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash, bool isZip, bool isBlocks) {
67026711 auto request = DependencyManager::get<AssetClient>()->createSetMappingRequest(mapping, hash);
67036712 connect(request, &SetMappingRequest::finished, this, [=](SetMappingRequest* request) mutable {
67046713 if (request->getError() != SetMappingRequest::NoError) {
@@ -6706,9 +6715,10 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q · 1 unmodified line
67066715 qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
67076716 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
67086717 } else {
6709− // to prevent files that aren't models from being loaded into world automatically
6710− if (filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION) ||
6711− filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) {
6718+ // to prevent files that aren't models or texture files from being loaded into world automatically
6719+ if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) ||
6720+ ((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&
6721+ ((!isBlocks) && (!isZip)))) {
67126722 addAssetToWorldAddEntity(filePath, mapping);
67136723 } else {
67146724 qCDebug(interfaceapp) << "Zipped contents are not supported entity files";

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t