mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 00:28:40 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into fix-imported-children-querybox
This commit is contained in:
commit
40c8261111
8 changed files with 36 additions and 44 deletions
|
@ -584,6 +584,7 @@ void Agent::setIsAvatar(bool isAvatar) {
|
||||||
void Agent::sendAvatarIdentityPacket() {
|
void Agent::sendAvatarIdentityPacket() {
|
||||||
if (_isAvatar) {
|
if (_isAvatar) {
|
||||||
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
|
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
|
||||||
|
scriptedAvatar->markIdentityDataChanged();
|
||||||
scriptedAvatar->sendIdentityPacket();
|
scriptedAvatar->sendIdentityPacket();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,6 +184,11 @@ KtxStorage::KtxStorage(const std::string& filename) : _filename(filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<storage::FileStorage> KtxStorage::maybeOpenFile() const {
|
std::shared_ptr<storage::FileStorage> KtxStorage::maybeOpenFile() const {
|
||||||
|
// 1. Try to get the shared ptr
|
||||||
|
// 2. If it doesn't exist, grab the mutex around its creation
|
||||||
|
// 3. If it was created before we got the mutex, return it
|
||||||
|
// 4. Otherwise, create it
|
||||||
|
|
||||||
std::shared_ptr<storage::FileStorage> file = _cacheFile.lock();
|
std::shared_ptr<storage::FileStorage> file = _cacheFile.lock();
|
||||||
if (file) {
|
if (file) {
|
||||||
return file;
|
return file;
|
||||||
|
@ -205,7 +210,6 @@ std::shared_ptr<storage::FileStorage> KtxStorage::maybeOpenFile() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
PixelsPointer KtxStorage::getMipFace(uint16 level, uint8 face) const {
|
PixelsPointer KtxStorage::getMipFace(uint16 level, uint8 face) const {
|
||||||
storage::StoragePointer result;
|
|
||||||
auto faceOffset = _ktxDescriptor->getMipFaceTexelsOffset(level, face);
|
auto faceOffset = _ktxDescriptor->getMipFaceTexelsOffset(level, face);
|
||||||
auto faceSize = _ktxDescriptor->getMipFaceTexelsSize(level, face);
|
auto faceSize = _ktxDescriptor->getMipFaceTexelsSize(level, face);
|
||||||
if (faceSize != 0 && faceOffset != 0) {
|
if (faceSize != 0 && faceOffset != 0) {
|
||||||
|
@ -221,7 +225,7 @@ PixelsPointer KtxStorage::getMipFace(uint16 level, uint8 face) const {
|
||||||
qWarning() << "Failed to get a valid file out of maybeOpenFile " << QString::fromStdString(_filename);
|
qWarning() << "Failed to get a valid file out of maybeOpenFile " << QString::fromStdString(_filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Size KtxStorage::getMipFaceSize(uint16 level, uint8 face) const {
|
Size KtxStorage::getMipFaceSize(uint16 level, uint8 face) const {
|
||||||
|
@ -255,8 +259,18 @@ void KtxStorage::assignMipData(uint16 level, const storage::StoragePointer& stor
|
||||||
}
|
}
|
||||||
|
|
||||||
auto file = maybeOpenFile();
|
auto file = maybeOpenFile();
|
||||||
|
if (!file) {
|
||||||
|
qWarning() << "Failed to open file to assign mip data " << QString::fromStdString(_filename);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto imageData = file->mutableData();
|
auto fileData = file->mutableData();
|
||||||
|
if (!fileData) {
|
||||||
|
qWarning() << "Failed to get mutable data for " << QString::fromStdString(_filename);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto imageData = fileData;
|
||||||
imageData += ktx::KTX_HEADER_SIZE + _ktxDescriptor->header.bytesOfKeyValueData + _ktxDescriptor->images[level]._imageOffset;
|
imageData += ktx::KTX_HEADER_SIZE + _ktxDescriptor->header.bytesOfKeyValueData + _ktxDescriptor->images[level]._imageOffset;
|
||||||
imageData += ktx::IMAGE_SIZE_WIDTH;
|
imageData += ktx::IMAGE_SIZE_WIDTH;
|
||||||
|
|
||||||
|
@ -271,7 +285,7 @@ void KtxStorage::assignMipData(uint16 level, const storage::StoragePointer& stor
|
||||||
memcpy(imageData, storage->data(), storage->size());
|
memcpy(imageData, storage->data(), storage->size());
|
||||||
_minMipLevelAvailable = level;
|
_minMipLevelAvailable = level;
|
||||||
if (_offsetToMinMipKV > 0) {
|
if (_offsetToMinMipKV > 0) {
|
||||||
auto minMipKeyData = file->mutableData() + ktx::KTX_HEADER_SIZE + _offsetToMinMipKV;
|
auto minMipKeyData = fileData + ktx::KTX_HEADER_SIZE + _offsetToMinMipKV;
|
||||||
memcpy(minMipKeyData, (void*)&_minMipLevelAvailable, 1);
|
memcpy(minMipKeyData, (void*)&_minMipLevelAvailable, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
#include "udt/PacketHeaders.h"
|
#include "udt/PacketHeaders.h"
|
||||||
|
|
||||||
#if USE_STABLE_GLOBAL_SERVICES
|
#if USE_STABLE_GLOBAL_SERVICES
|
||||||
const QString DEFAULT_HIFI_ADDRESS = "hifi://welcome";
|
const QString DEFAULT_HIFI_ADDRESS = "hifi://welcome/hello";
|
||||||
#else
|
#else
|
||||||
const QString DEFAULT_HIFI_ADDRESS = "hifi://dev-welcome";
|
const QString DEFAULT_HIFI_ADDRESS = "hifi://dev-welcome/hello";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const QString ADDRESS_MANAGER_SETTINGS_GROUP = "AddressManager";
|
const QString ADDRESS_MANAGER_SETTINGS_GROUP = "AddressManager";
|
||||||
|
|
|
@ -70,7 +70,15 @@ StoragePointer FileStorage::create(const QString& filename, size_t size, const u
|
||||||
}
|
}
|
||||||
|
|
||||||
FileStorage::FileStorage(const QString& filename) : _file(filename) {
|
FileStorage::FileStorage(const QString& filename) : _file(filename) {
|
||||||
if (_file.open(QFile::ReadOnly)) {
|
bool opened = _file.open(QFile::ReadWrite);
|
||||||
|
if (opened) {
|
||||||
|
_hasWriteAccess = true;
|
||||||
|
} else {
|
||||||
|
_hasWriteAccess = false;
|
||||||
|
opened = _file.open(QFile::ReadOnly);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opened) {
|
||||||
_mapped = _file.map(0, _file.size());
|
_mapped = _file.map(0, _file.size());
|
||||||
if (_mapped) {
|
if (_mapped) {
|
||||||
_valid = true;
|
_valid = true;
|
||||||
|
@ -91,35 +99,4 @@ FileStorage::~FileStorage() {
|
||||||
if (_file.isOpen()) {
|
if (_file.isOpen()) {
|
||||||
_file.close();
|
_file.close();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void FileStorage::ensureWriteAccess() {
|
|
||||||
if (_hasWriteAccess) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_mapped) {
|
|
||||||
if (!_file.unmap(_mapped)) {
|
|
||||||
throw std::runtime_error("Unable to unmap file");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (_file.isOpen()) {
|
|
||||||
_file.close();
|
|
||||||
}
|
|
||||||
_valid = false;
|
|
||||||
_mapped = nullptr;
|
|
||||||
|
|
||||||
if (_file.open(QFile::ReadWrite)) {
|
|
||||||
_mapped = _file.map(0, _file.size());
|
|
||||||
if (_mapped) {
|
|
||||||
_valid = true;
|
|
||||||
_hasWriteAccess = true;
|
|
||||||
} else {
|
|
||||||
qCWarning(storagelogging) << "Failed to map file " << _file.fileName();
|
|
||||||
throw std::runtime_error("Failed to map file");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
qCWarning(storagelogging) << "Failed to open file " << _file.fileName();
|
|
||||||
throw std::runtime_error("Failed to open file");
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -60,11 +60,10 @@ namespace storage {
|
||||||
FileStorage& operator=(const FileStorage& other) = delete;
|
FileStorage& operator=(const FileStorage& other) = delete;
|
||||||
|
|
||||||
const uint8_t* data() const override { return _mapped; }
|
const uint8_t* data() const override { return _mapped; }
|
||||||
uint8_t* mutableData() override { ensureWriteAccess(); return _mapped; }
|
uint8_t* mutableData() override { return _hasWriteAccess ? _mapped : nullptr; }
|
||||||
size_t size() const override { return _file.size(); }
|
size_t size() const override { return _file.size(); }
|
||||||
operator bool() const override { return _valid; }
|
operator bool() const override { return _valid; }
|
||||||
private:
|
private:
|
||||||
void ensureWriteAccess();
|
|
||||||
|
|
||||||
bool _valid { false };
|
bool _valid { false };
|
||||||
bool _hasWriteAccess { false };
|
bool _hasWriteAccess { false };
|
||||||
|
|
|
@ -300,7 +300,7 @@ function addImage(image_data, isLoggedIn, canShare, isGifLoading, isShowingPrevi
|
||||||
if (!isGifLoading) {
|
if (!isGifLoading) {
|
||||||
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
||||||
}
|
}
|
||||||
if (!isGifLoading && !isShowingPreviousImages) {
|
if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) {
|
||||||
shareForUrl(id);
|
shareForUrl(id);
|
||||||
}
|
}
|
||||||
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
||||||
|
|
|
@ -138,10 +138,10 @@ function onMessage(message) {
|
||||||
isLoggedIn = Account.isLoggedIn();
|
isLoggedIn = Account.isLoggedIn();
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
print('Sharing snapshot with audience "for_url":', message.data);
|
print('Sharing snapshot with audience "for_url":', message.data);
|
||||||
Window.shareSnapshot(message.data, message.href || href);
|
Window.shareSnapshot(message.data, Settings.getValue("previousSnapshotHref"));
|
||||||
} else {
|
} else {
|
||||||
shareAfterLogin = true;
|
shareAfterLogin = true;
|
||||||
snapshotToShareAfterLogin.push({ path: message.data, href: message.href || href });
|
snapshotToShareAfterLogin.push({ path: message.data, href: Settings.getValue("previousSnapshotHref") });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -349,6 +349,7 @@ function takeSnapshot() {
|
||||||
// We will record snapshots based on the starting location. That could change, e.g., when recording a .gif.
|
// We will record snapshots based on the starting location. That could change, e.g., when recording a .gif.
|
||||||
// Even the domainId could change (e.g., if the user falls into a teleporter while recording).
|
// Even the domainId could change (e.g., if the user falls into a teleporter while recording).
|
||||||
href = location.href;
|
href = location.href;
|
||||||
|
Settings.setValue("previousSnapshotHref", href);
|
||||||
domainId = location.domainId;
|
domainId = location.domainId;
|
||||||
Settings.setValue("previousSnapshotDomainID", domainId);
|
Settings.setValue("previousSnapshotDomainID", domainId);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ const appIcon = path.join(__dirname, '../resources/console.png');
|
||||||
const DELETE_LOG_FILES_OLDER_THAN_X_SECONDS = 60 * 60 * 24 * 7; // 7 Days
|
const DELETE_LOG_FILES_OLDER_THAN_X_SECONDS = 60 * 60 * 24 * 7; // 7 Days
|
||||||
const LOG_FILE_REGEX = /(domain-server|ac-monitor|ac)-.*-std(out|err).txt/;
|
const LOG_FILE_REGEX = /(domain-server|ac-monitor|ac)-.*-std(out|err).txt/;
|
||||||
|
|
||||||
const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial-RC39.tar.gz";
|
const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial-RC40.tar.gz";
|
||||||
|
|
||||||
function getBuildInfo() {
|
function getBuildInfo() {
|
||||||
var buildInfoPath = null;
|
var buildInfoPath = null;
|
||||||
|
|
Loading…
Reference in a new issue