From 4419bb870986c6900fc096338622d27b999cd771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Sun, 11 Feb 2024 01:23:28 +0100 Subject: more misc: BOOL (int) to real bool --- indra/newview/lllocalgltfmaterials.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/lllocalgltfmaterials.cpp') diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index 61e0163798..cf0742299c 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -301,11 +301,11 @@ bool LLLocalGLTFMaterialTimer::isRunning() return mEventTimer.getStarted(); } -BOOL LLLocalGLTFMaterialTimer::tick() +bool LLLocalGLTFMaterialTimer::tick() { // todo: do on idle? No point in timer LLLocalGLTFMaterialMgr::getInstance()->doUpdates(); - return FALSE; + return false; } /*=======================================*/ -- cgit v1.2.3 From db627bc3544b828982a2a366972e0adf86e42f75 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 28 May 2024 14:37:38 +0300 Subject: viewer#1553 Local PBR materials are not applied to the terrain --- indra/newview/lllocalgltfmaterials.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/lllocalgltfmaterials.cpp') diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index cf0742299c..0740e1289a 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -177,6 +177,8 @@ bool LLLocalGLTFMaterial::updateSelf() } } + materialBegin(); + materialComplete(true); updated = true; } @@ -201,6 +203,8 @@ bool LLLocalGLTFMaterial::updateSelf() LLNotificationsUtil::add("LocalBitmapsUpdateFailedFinal", notif_args); mLinkStatus = LS_BROKEN; + materialBegin(); + materialComplete(false); } } } @@ -218,6 +222,8 @@ bool LLLocalGLTFMaterial::updateSelf() LLNotificationsUtil::add("LocalBitmapsUpdateFileNotFound", notif_args); mLinkStatus = LS_BROKEN; + materialBegin(); + materialComplete(false); } } -- cgit v1.2.3 From b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 1 Jun 2024 15:49:26 +0200 Subject: Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings --- indra/newview/lllocalgltfmaterials.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/lllocalgltfmaterials.cpp') diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index cf0742299c..2fb8816960 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -340,19 +340,19 @@ S32 LLLocalGLTFMaterialMgr::addUnit(const std::string& filename) tinygltf::Model model; LLTinyGLTFHelper::loadModel(filename, model); - S32 materials_in_file = model.materials.size(); + auto materials_in_file = model.materials.size(); if (materials_in_file <= 0) { return 0; } S32 loaded_materials = 0; - for (S32 i = 0; i < materials_in_file; i++) + for (size_t i = 0; i < materials_in_file; i++) { // Todo: this is rather inefficient, files will be spammed with // separate loads and date checks, find a way to improve this. // May be doUpdates() should be checking individual files. - LLPointer unit = new LLLocalGLTFMaterial(filename, i); + LLPointer unit = new LLLocalGLTFMaterial(filename, static_cast(i)); // load material from file if (unit->updateSelf()) -- cgit v1.2.3 From c95b4bf3ea2b681d6d05468b07e60fedb71fa2cf Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 10 Jun 2024 20:42:42 +0300 Subject: Post-merge - trim trailing whitespace --- indra/newview/lllocalgltfmaterials.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/lllocalgltfmaterials.cpp') diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index 2fb8816960..84b58b9e71 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -1,25 +1,25 @@ -/** +/** * @file lllocalrendermaterials.cpp * @brief Local GLTF materials source * * $LicenseInfo:firstyear=2022&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2022, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -51,14 +51,14 @@ /*=======================================*/ /* Formal declarations, constants, etc. */ -/*=======================================*/ +/*=======================================*/ static const F32 LL_LOCAL_TIMER_HEARTBEAT = 3.0; static const S32 LL_LOCAL_UPDATE_RETRIES = 5; /*=======================================*/ /* LLLocalGLTFMaterial: unit class */ -/*=======================================*/ +/*=======================================*/ LLLocalGLTFMaterial::LLLocalGLTFMaterial(std::string filename, S32 index) : mFilename(filename) , mShortName(gDirUtilp->getBaseFileName(filename, true)) @@ -303,7 +303,7 @@ bool LLLocalGLTFMaterialTimer::isRunning() bool LLLocalGLTFMaterialTimer::tick() { - // todo: do on idle? No point in timer + // todo: do on idle? No point in timer LLLocalGLTFMaterialMgr::getInstance()->doUpdates(); return false; } -- cgit v1.2.3