Merge branch 'master' of https://bitbucket.org/Ansariel/phoenix-firestorm-gltf-development
# Conflicts: # indra/newview/llimview.h # indra/newview/llpanelpeople.h # indra/newview/llpanelvoicedevicesettings.cpp # indra/newview/llvoavatar.cpp # indra/newview/llvoavatar.h # indra/newview/llvoicechannel.cpp # indra/newview/llvoicechannel.h # indra/newview/llvoiceclient.cpp # indra/newview/llvoiceclient.h # indra/newview/llvoicevivox.cpp # indra/newview/llvoicevivox.hmaster
commit
e33d2fad5f
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Replace tabs with spaces
|
||||||
|
1b68f71348ecf3983b76b40d7940da8377f049b7
|
||||||
|
# Trim trailing whitespace
|
||||||
|
a0b3021bdcf76859054fda8e30abb3ed47749e83
|
||||||
|
8444cd9562a6a7b755fcb075864e205122354192
|
||||||
|
# Wrong line endings
|
||||||
|
1b67dd855c41f5a0cda7ec2a68d98071986ca703
|
||||||
|
6cc7dd09d5e69cf57e6de7fb568a0ad2693f9c9a
|
||||||
|
e2e37cced861b98de8c1a7c9c0d3a50d2d90e433
|
||||||
|
|
@ -33,3 +33,6 @@ FILES_ARE_UNICODE_UTF-16LE.txt text eol=crlf
|
||||||
|
|
||||||
# Windows Manifest files
|
# Windows Manifest files
|
||||||
*.manifest text eol=crlf
|
*.manifest text eol=crlf
|
||||||
|
|
||||||
|
# Windows Installer Script files (normalization disabled)
|
||||||
|
*.nsi -text
|
||||||
|
|
|
||||||
|
|
@ -16,3 +16,5 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-xml
|
- id: check-xml
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
|
- id: trailing-whitespace
|
||||||
|
files: \.(cpp|c|h|inl|py|glsl|cmake|yaml|sh)$
|
||||||
|
|
|
||||||
238
autobuild.xml
238
autobuild.xml
|
|
@ -456,11 +456,11 @@
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>8539775e0a0783bd252bc548b20b3472a8254c31</string>
|
<string>d8d9e1e15ec09c81acfa9ffb80c3f20435373543</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-boost/releases/download/v1.81-09d25a7/boost-1.81-darwin64-09d25a7.tar.zst</string>
|
<string>https://github.com/secondlife/3p-boost/releases/download/v1.84.0-r1/boost-1.84-darwin64-8499892512.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>darwin64</string>
|
<string>darwin64</string>
|
||||||
|
|
@ -470,11 +470,11 @@
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>a3bfbdba7e1977e7e65266ec654990bb13994bd3</string>
|
<string>a5552fcd343179c4c7d6dd6289675431a8c0fe8d</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-boost/releases/download/v1.81-3d0d7fc/boost-1.81-linux64-3d0d7fc.tar.zst</string>
|
<string>https://github.com/secondlife/3p-boost/releases/download/v1.84.0-r1/boost-1.84-linux64-8499892512.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>linux64</string>
|
<string>linux64</string>
|
||||||
|
|
@ -484,11 +484,11 @@
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>d40c86fbcb6ce064d546165cbabbf035ea80e07b</string>
|
<string>5af9c69093e171eda552720a7acd570496db17db</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-boost/releases/download/v1.81-09d25a7/boost-1.81-windows64-09d25a7.tar.zst</string>
|
<string>https://github.com/secondlife/3p-boost/releases/download/v1.84.0-r1/boost-1.84-windows64-8499892512.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>windows64</string>
|
<string>windows64</string>
|
||||||
|
|
@ -562,11 +562,11 @@
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>b1bb8a9c8d458d8842d79f9633fb61df12f1b0ad</string>
|
<string>fd656d2478728c4fc268478ec40d33b0ed1b7d83</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3.ab0c124/colladadom-2.3.ab0c124-darwin64-ab0c124.tar.zst</string>
|
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r4/colladadom-2.3.8500178177-darwin64-8500178177.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>darwin64</string>
|
<string>darwin64</string>
|
||||||
|
|
@ -576,11 +576,11 @@
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>cab0237b5194254c0c0ff6bf77bc6a2f946d4f57</string>
|
<string>aebc0ddcae18852e78143fbac793cd4a32f0f251</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-2f532e1/colladadom-2.3.2f532e1-linux64-2f532e1.tar.zst</string>
|
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r4/colladadom-2.3.8500178177-linux64-8500178177.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>linux64</string>
|
<string>linux64</string>
|
||||||
|
|
@ -590,11 +590,11 @@
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>0df4c05d4efa3019afa4cbf09599df60b586fc5c</string>
|
<string>3b25739b1a923c2edcf19864a1c82aeb5042567b</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3.ab0c124/colladadom-2.3.ab0c124-windows64-ab0c124.tar.zst</string>
|
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r4/colladadom-2.3.8500178177-windows64-8500178177.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>windows64</string>
|
<string>windows64</string>
|
||||||
|
|
@ -1131,63 +1131,47 @@
|
||||||
<key>description</key>
|
<key>description</key>
|
||||||
<string>glh - is a platform-indepenedent C++ OpenGL helper library</string>
|
<string>glh - is a platform-indepenedent C++ OpenGL helper library</string>
|
||||||
</map>
|
</map>
|
||||||
<key>googlemock</key>
|
<key>glm</key>
|
||||||
<map>
|
<map>
|
||||||
|
<key>canonical_repo</key>
|
||||||
|
<string>https://github.com/secondlife/3p-glm</string>
|
||||||
|
<key>copyright</key>
|
||||||
|
<string>Copyright (c) 2005 - G-Truc Creation</string>
|
||||||
|
<key>description</key>
|
||||||
|
<string>OpenGL Mathematics</string>
|
||||||
|
<key>license</key>
|
||||||
|
<string>MIT</string>
|
||||||
|
<key>license_file</key>
|
||||||
|
<string>LICENSES/glm_license.txt</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>glm</string>
|
||||||
<key>platforms</key>
|
<key>platforms</key>
|
||||||
<map>
|
<map>
|
||||||
<key>darwin64</key>
|
<key>common</key>
|
||||||
<map>
|
<map>
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>dce3174b12136746f5f910e311e895c1b47bf8fb</string>
|
<string>353ae3a560143732503a8e14499ae12db1e66056</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-googlemock/releases/download/v1.7.0.2b109d4/googlemock-1.7.0.2b109d4-darwin64-2b109d4.tar.zst</string>
|
<string>https://github.com/secondlife/3p-glm/releases/download/v1.0.1-r1/glm-v1.0.1-common-9066386153.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>darwin64</string>
|
<string>common</string>
|
||||||
</map>
|
|
||||||
<key>linux64</key>
|
|
||||||
<map>
|
|
||||||
<key>archive</key>
|
|
||||||
<map>
|
|
||||||
<key>hash</key>
|
|
||||||
<string>ff459b58695c76838782847a0b792104</string>
|
|
||||||
<key>url</key>
|
|
||||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/9697/45717/googlemock-1.7.0.509686-linux64-509686.tar.bz2</string>
|
|
||||||
</map>
|
|
||||||
<key>name</key>
|
|
||||||
<string>linux64</string>
|
|
||||||
</map>
|
|
||||||
<key>windows64</key>
|
|
||||||
<map>
|
|
||||||
<key>archive</key>
|
|
||||||
<map>
|
|
||||||
<key>hash</key>
|
|
||||||
<string>265813f84b04c3b03f3d7d33e149b3d5e3cf31db</string>
|
|
||||||
<key>hash_algorithm</key>
|
|
||||||
<string>sha1</string>
|
|
||||||
<key>url</key>
|
|
||||||
<string>https://github.com/secondlife/3p-googlemock/releases/download/v1.7.0.2b109d4/googlemock-1.7.0.2b109d4-windows64-2b109d4.tar.zst</string>
|
|
||||||
</map>
|
|
||||||
<key>name</key>
|
|
||||||
<string>windows64</string>
|
|
||||||
</map>
|
</map>
|
||||||
</map>
|
</map>
|
||||||
<key>license</key>
|
<key>source_type</key>
|
||||||
<string>BSD</string>
|
<string>git</string>
|
||||||
<key>license_file</key>
|
<key>vcs_branch</key>
|
||||||
<string>LICENSES/gmock.txt</string>
|
<string>refs/tags/v1.0.1-r1</string>
|
||||||
<key>copyright</key>
|
<key>vcs_revision</key>
|
||||||
<string>Copyright 2008, Google Inc.</string>
|
<string>399cd5ba57a9267a560ce07e50a0f8c5fe3dc66f</string>
|
||||||
|
<key>vcs_url</key>
|
||||||
|
<string>git://github.com/secondlife/3p-glm.git</string>
|
||||||
<key>version</key>
|
<key>version</key>
|
||||||
<string>1.7.0.2b109d4</string>
|
<string>v1.0.1</string>
|
||||||
<key>name</key>
|
|
||||||
<string>googlemock</string>
|
|
||||||
<key>description</key>
|
|
||||||
<string>a library for writing and using C++ mock classes</string>
|
|
||||||
</map>
|
</map>
|
||||||
<key>havok-source</key>
|
<key>havok-source</key>
|
||||||
<map>
|
<map>
|
||||||
|
|
@ -1369,66 +1353,6 @@
|
||||||
<key>description</key>
|
<key>description</key>
|
||||||
<string>JPEG encoding, decoding library</string>
|
<string>JPEG encoding, decoding library</string>
|
||||||
</map>
|
</map>
|
||||||
<key>jsoncpp</key>
|
|
||||||
<map>
|
|
||||||
<key>platforms</key>
|
|
||||||
<map>
|
|
||||||
<key>darwin64</key>
|
|
||||||
<map>
|
|
||||||
<key>archive</key>
|
|
||||||
<map>
|
|
||||||
<key>hash</key>
|
|
||||||
<string>07761ab01e61d5d6b40d303ffafd85ec055ec9f7</string>
|
|
||||||
<key>hash_algorithm</key>
|
|
||||||
<string>sha1</string>
|
|
||||||
<key>url</key>
|
|
||||||
<string>https://github.com/secondlife/3p-jsoncpp/releases/download/v0.5.0.bc46e62/jsoncpp-0.5.0.bc46e62-darwin64-bc46e62.tar.zst</string>
|
|
||||||
</map>
|
|
||||||
<key>name</key>
|
|
||||||
<string>darwin64</string>
|
|
||||||
</map>
|
|
||||||
<key>linux64</key>
|
|
||||||
<map>
|
|
||||||
<key>archive</key>
|
|
||||||
<map>
|
|
||||||
<key>hash</key>
|
|
||||||
<string>66dce1d0c2fc19dff13db279d973773fc7e2aa13</string>
|
|
||||||
<key>hash_algorithm</key>
|
|
||||||
<string>sha1</string>
|
|
||||||
<key>url</key>
|
|
||||||
<string>https://github.com/secondlife/3p-jsoncpp/releases/download/v0.5.0-cc63e92/jsoncpp-0.5.0.cc63e92-linux64-cc63e92.tar.zst</string>
|
|
||||||
</map>
|
|
||||||
<key>name</key>
|
|
||||||
<string>linux64</string>
|
|
||||||
</map>
|
|
||||||
<key>windows64</key>
|
|
||||||
<map>
|
|
||||||
<key>archive</key>
|
|
||||||
<map>
|
|
||||||
<key>hash</key>
|
|
||||||
<string>500e455b210d6bc4985185cef2472987ed3034bf</string>
|
|
||||||
<key>hash_algorithm</key>
|
|
||||||
<string>sha1</string>
|
|
||||||
<key>url</key>
|
|
||||||
<string>https://github.com/secondlife/3p-jsoncpp/releases/download/v0.5.0.bc46e62/jsoncpp-0.5.0.bc46e62-windows64-bc46e62.tar.zst</string>
|
|
||||||
</map>
|
|
||||||
<key>name</key>
|
|
||||||
<string>windows64</string>
|
|
||||||
</map>
|
|
||||||
</map>
|
|
||||||
<key>license</key>
|
|
||||||
<string>public domain</string>
|
|
||||||
<key>license_file</key>
|
|
||||||
<string>LICENSES/jsoncpp.txt</string>
|
|
||||||
<key>copyright</key>
|
|
||||||
<string>Copyright (c) 2007-2010 Baptiste Lepilleur</string>
|
|
||||||
<key>version</key>
|
|
||||||
<string>0.5.0.bc46e62</string>
|
|
||||||
<key>name</key>
|
|
||||||
<string>jsoncpp</string>
|
|
||||||
<key>description</key>
|
|
||||||
<string>jsoncpp is an implementation of a JSON (http://json.org) reader and writer in C++.</string>
|
|
||||||
</map>
|
|
||||||
<key>kdu</key>
|
<key>kdu</key>
|
||||||
<map>
|
<map>
|
||||||
<key>platforms</key>
|
<key>platforms</key>
|
||||||
|
|
@ -1802,6 +1726,14 @@
|
||||||
</map>
|
</map>
|
||||||
<key>llphysicsextensions_source</key>
|
<key>llphysicsextensions_source</key>
|
||||||
<map>
|
<map>
|
||||||
|
<key>copyright</key>
|
||||||
|
<string>Copyright (c) 2010, Linden Research, Inc.</string>
|
||||||
|
<key>license</key>
|
||||||
|
<string>internal</string>
|
||||||
|
<key>license_file</key>
|
||||||
|
<string>LICENSES/llphysicsextensions.txt</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>llphysicsextensions_source</string>
|
||||||
<key>platforms</key>
|
<key>platforms</key>
|
||||||
<map>
|
<map>
|
||||||
<key>darwin64</key>
|
<key>darwin64</key>
|
||||||
|
|
@ -1811,11 +1743,11 @@
|
||||||
<key>creds</key>
|
<key>creds</key>
|
||||||
<string>github</string>
|
<string>github</string>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>b037cc0b29ea70ee834cfae6dda5b7a25cd57174</string>
|
<string>755a3de464149ae88b048f976828a8c0c46e3bdb</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851460</string>
|
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966323</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>darwin64</string>
|
<string>darwin64</string>
|
||||||
|
|
@ -1827,11 +1759,11 @@
|
||||||
<key>creds</key>
|
<key>creds</key>
|
||||||
<string>github</string>
|
<string>github</string>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>bdea1fd5c4da9da5afde088d16188b45d0853e04</string>
|
<string>813e7b5e294d7958e3d69e2252752ff346953b0c</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851461</string>
|
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966322</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>linux64</string>
|
<string>linux64</string>
|
||||||
|
|
@ -1843,26 +1775,18 @@
|
||||||
<key>creds</key>
|
<key>creds</key>
|
||||||
<string>github</string>
|
<string>github</string>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>f652ce0d6aef864689f0ed44255da4d9cd65a43f</string>
|
<string>67f647538b1b49d0152fd9d03cfb9bdf978e33d1</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851463</string>
|
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966328</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>windows64</string>
|
<string>windows64</string>
|
||||||
</map>
|
</map>
|
||||||
</map>
|
</map>
|
||||||
<key>license</key>
|
|
||||||
<string>internal</string>
|
|
||||||
<key>license_file</key>
|
|
||||||
<string>LICENSES/llphysicsextensions.txt</string>
|
|
||||||
<key>copyright</key>
|
|
||||||
<string>Copyright (c) 2010, Linden Research, Inc.</string>
|
|
||||||
<key>version</key>
|
<key>version</key>
|
||||||
<string>1.0.479d20a</string>
|
<string>1.0.b8b1f73</string>
|
||||||
<key>name</key>
|
|
||||||
<string>llphysicsextensions_source</string>
|
|
||||||
</map>
|
</map>
|
||||||
<key>llphysicsextensions_stub</key>
|
<key>llphysicsextensions_stub</key>
|
||||||
<map>
|
<map>
|
||||||
|
|
@ -2427,18 +2351,42 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
||||||
</map>
|
</map>
|
||||||
<key>openal</key>
|
<key>openal</key>
|
||||||
<map>
|
<map>
|
||||||
|
<key>copyright</key>
|
||||||
|
<string>Copyright (C) 1999-2007 by authors.</string>
|
||||||
|
<key>description</key>
|
||||||
|
<string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string>
|
||||||
|
<key>license</key>
|
||||||
|
<string>LGPL2</string>
|
||||||
|
<key>license_file</key>
|
||||||
|
<string>LICENSES/openal-soft.txt</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>openal</string>
|
||||||
<key>platforms</key>
|
<key>platforms</key>
|
||||||
<map>
|
<map>
|
||||||
|
<key>darwin64</key>
|
||||||
|
<map>
|
||||||
|
<key>archive</key>
|
||||||
|
<map>
|
||||||
|
<key>hash</key>
|
||||||
|
<string>191e4ef07a35f7147708415465191ce7622e3012</string>
|
||||||
|
<key>hash_algorithm</key>
|
||||||
|
<string>sha1</string>
|
||||||
|
<key>url</key>
|
||||||
|
<string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-darwin64-8979520327.tar.zst</string>
|
||||||
|
</map>
|
||||||
|
<key>name</key>
|
||||||
|
<string>darwin64</string>
|
||||||
|
</map>
|
||||||
<key>linux64</key>
|
<key>linux64</key>
|
||||||
<map>
|
<map>
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>e0fbc4874acc4167a6e2b6489fbb8258d98fd665</string>
|
<string>3bd8c9028ef42bdb43c7422e7d324e213fdb081e</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-18e315c/openal-1.23.1-linux64-18e315c.tar.zst</string>
|
<string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-linux64-8979520327.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>linux64</string>
|
<string>linux64</string>
|
||||||
|
|
@ -2448,42 +2396,18 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
||||||
<key>archive</key>
|
<key>archive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<string>6ae3b5310eb1988741bc55416681ca9d64f76f85</string>
|
<string>4b849609abec790e89be5fad8ddee3717ee301c4</string>
|
||||||
<key>hash_algorithm</key>
|
<key>hash_algorithm</key>
|
||||||
<string>sha1</string>
|
<string>sha1</string>
|
||||||
<key>url</key>
|
<key>url</key>
|
||||||
<string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-18e315c/openal-1.23.1-windows64-18e315c.tar.zst</string>
|
<string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-windows64-8979520327.tar.zst</string>
|
||||||
</map>
|
</map>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>windows64</string>
|
<string>windows64</string>
|
||||||
</map>
|
</map>
|
||||||
<key>darwin64</key>
|
|
||||||
<map>
|
|
||||||
<key>archive</key>
|
|
||||||
<map>
|
|
||||||
<key>hash</key>
|
|
||||||
<string>4edaef5f03a1122eae8467c4a04d9caccaaaf847</string>
|
|
||||||
<key>hash_algorithm</key>
|
|
||||||
<string>sha1</string>
|
|
||||||
<key>url</key>
|
|
||||||
<string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-18e315c/openal-1.23.1-darwin64-18e315c.tar.zst</string>
|
|
||||||
</map>
|
|
||||||
<key>name</key>
|
|
||||||
<string>darwin64</string>
|
|
||||||
</map>
|
|
||||||
</map>
|
</map>
|
||||||
<key>license</key>
|
|
||||||
<string>LGPL2</string>
|
|
||||||
<key>license_file</key>
|
|
||||||
<string>LICENSES/openal-soft.txt</string>
|
|
||||||
<key>copyright</key>
|
|
||||||
<string>Copyright (C) 1999-2007 by authors.</string>
|
|
||||||
<key>version</key>
|
<key>version</key>
|
||||||
<string>1.23.1</string>
|
<string>1.23.1</string>
|
||||||
<key>name</key>
|
|
||||||
<string>openal</string>
|
|
||||||
<key>description</key>
|
|
||||||
<string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string>
|
|
||||||
</map>
|
</map>
|
||||||
<key>openjpeg</key>
|
<key>openjpeg</key>
|
||||||
<map>
|
<map>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
# PBR Terrain Appearance
|
# PBR Terrain Appearance
|
||||||
|
|
||||||
## Tiling
|
## Tiling Without Texture Transforms
|
||||||
|
|
||||||
|
This section assumes the PBR terrain of the current region and adjacent regions have the default texture transforms.
|
||||||
|
|
||||||
The southwest corner of a region with PBR materials should exactly match up with the bottom left corner of the material texture(s).
|
The southwest corner of a region with PBR materials should exactly match up with the bottom left corner of the material texture(s).
|
||||||
|
|
||||||
If two adjacent regions have the same PBR terrain settings, then:
|
If two adjacent regions have the same PBR terrain settings, then there should not be seams between the two regions at their shared border.
|
||||||
|
|
||||||
- There should not be seams between the two regions at their shared border
|
The ground should not suddenly slide beneath the avatar when moving between two PBR terrain regions (except due to movement of the avatar, which is not covered by this test plan)
|
||||||
- The ground should not suddenly slide beneath the avatar when moving between regions (except due to movement of the avatar, which is not covered by this test plan)
|
|
||||||
|
|
||||||
## Feature Gating
|
## Feature Gating
|
||||||
|
|
||||||
|
|
@ -35,3 +36,17 @@ Availability of PBR textures varies by machine and graphics setting:
|
||||||
### PBR Alpha
|
### PBR Alpha
|
||||||
|
|
||||||
PBR terrain does not support materials with alpha blend or double-sided. In addition, the viewer does not make any guarantees about what will render behind the terrain if alpha is used.
|
PBR terrain does not support materials with alpha blend or double-sided. In addition, the viewer does not make any guarantees about what will render behind the terrain if alpha is used.
|
||||||
|
|
||||||
|
## PBR Terrain Texture Transforms
|
||||||
|
|
||||||
|
Like PBR materials on prims, PBR terrain repeats are based on the [KHR\_texture\_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) spec, and thus should be expected to behave the same way.
|
||||||
|
|
||||||
|
The southwest corner of a region, at z=0, is the UV origin for all texture coordinates of the whole region. Unless an offset is also applied, scale and rotation of the terrain texture transforms are relative to that point.
|
||||||
|
|
||||||
|
When an avatar faces north and looks down at flat ground, the textures of the materials should appear to face upright, unless a rotation is applied.
|
||||||
|
|
||||||
|
If triplanar mapping is enabled, and an avatar faces an axially-aligned wall, the textures of the materials should appear to face upright, unless a rotation is applied.
|
||||||
|
|
||||||
|
Textures of materials should not appear mirrored.
|
||||||
|
|
||||||
|
When triplanar mapping is enabled, rotations on the axially aligned walls should apply in the same direction as they would on flat ground.
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ All tests in this section assume the PBR terrain feature flag is enabled, and th
|
||||||
|
|
||||||
### Feature Availability
|
### Feature Availability
|
||||||
|
|
||||||
|
These features are related to UI, where the Region/Estate floater is opened to the terrain Tab.
|
||||||
|
|
||||||
|
#### Feature: PBR Terrain
|
||||||
|
|
||||||
On the client, the advanced setting `RenderTerrainPBREnabled` is the PBR terrain feature flag.
|
On the client, the advanced setting `RenderTerrainPBREnabled` is the PBR terrain feature flag.
|
||||||
|
|
||||||
The PBR terrain feature flag should be set automatically when logging in/teleporting to a new region.
|
The PBR terrain feature flag should be set automatically when logging in/teleporting to a new region.
|
||||||
|
|
@ -29,6 +33,24 @@ When the PBR terrain feature flag is enabled:
|
||||||
- The "PBR Metallic Roughness" checkbox should be visible
|
- The "PBR Metallic Roughness" checkbox should be visible
|
||||||
- The user should be able to apply PBR terrain or textures to the region, depending on if the "PBR Metallic Roughness" checkbox is checked.
|
- The user should be able to apply PBR terrain or textures to the region, depending on if the "PBR Metallic Roughness" checkbox is checked.
|
||||||
|
|
||||||
|
#### Feature: PBR Terrain Texture Transforms
|
||||||
|
|
||||||
|
On the client, the advanced setting, `RenderTerrainPBRTransformsEnabled` is the PBR terrain texture transform flag. Generally, this feature should not be expected to work correctly unless the PBR terrain feature is also enabled.
|
||||||
|
|
||||||
|
The PBR terrain texture transform flag should be set automatically when logging in/teleporting to a new region.
|
||||||
|
|
||||||
|
- The flag should be enabled on regions where the PBR terrain texture transform feature is enabled
|
||||||
|
- Otherwise the flag should be disabled
|
||||||
|
|
||||||
|
When the PBR terrain texture transform feature is enabled, the UI of the Terrain tab should be overhauled. Availability of features depends on the type of terrain.
|
||||||
|
|
||||||
|
When "PBR Metallic Roughness" is checked:
|
||||||
|
|
||||||
|
- There should be a way for the user to change the texture transforms for the terrain in the current region
|
||||||
|
- For each of the four swatches, the user can change the scale, offset, and rotation of that swatch. Nonuniform scale is allowed
|
||||||
|
|
||||||
|
When "PBR Metallic Roughness" is unchecked, the controls for texture transforms should be hidden.
|
||||||
|
|
||||||
### Current Composition Type
|
### Current Composition Type
|
||||||
|
|
||||||
When the Region/Estate floater is opened to the terrain Tab, the current terrain should be shown in the four swatches, and the "PBR Metallic Roughness" checkbox should be checked or unchecked accordingly.
|
When the Region/Estate floater is opened to the terrain Tab, the current terrain should be shown in the four swatches, and the "PBR Metallic Roughness" checkbox should be checked or unchecked accordingly.
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,8 @@ set(cmake_SOURCE_FILES
|
||||||
GLEXT.cmake
|
GLEXT.cmake
|
||||||
GLH.cmake
|
GLH.cmake
|
||||||
GLOD.cmake # <FS:Ansariel> Bring back GLOD
|
GLOD.cmake # <FS:Ansariel> Bring back GLOD
|
||||||
GoogleMock.cmake
|
|
||||||
Havok.cmake
|
Havok.cmake
|
||||||
Hunspell.cmake
|
Hunspell.cmake
|
||||||
JsonCpp.cmake
|
|
||||||
LLAddBuildTest.cmake
|
LLAddBuildTest.cmake
|
||||||
LLAppearance.cmake
|
LLAppearance.cmake
|
||||||
LLAudio.cmake
|
LLAudio.cmake
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,6 @@ if(WINDOWS)
|
||||||
MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake")
|
MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake")
|
||||||
endif (MSVC80)
|
endif (MSVC80)
|
||||||
|
|
||||||
# <FS:Ansariel> Try using the VC runtime redistributables that came with the VS installation first
|
|
||||||
if (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR})
|
if (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR})
|
||||||
if(ADDRESS_SIZE EQUAL 32)
|
if(ADDRESS_SIZE EQUAL 32)
|
||||||
set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x86\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT")
|
set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x86\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT")
|
||||||
|
|
@ -134,7 +133,6 @@ if(WINDOWS)
|
||||||
get_filename_component(redist_path "${redist_find_path}" ABSOLUTE)
|
get_filename_component(redist_path "${redist_find_path}" ABSOLUTE)
|
||||||
MESSAGE(STATUS "VC Runtime redist path: ${redist_path}")
|
MESSAGE(STATUS "VC Runtime redist path: ${redist_path}")
|
||||||
endif (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR})
|
endif (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR})
|
||||||
# </FS:Ansariel>
|
|
||||||
|
|
||||||
if(ADDRESS_SIZE EQUAL 32)
|
if(ADDRESS_SIZE EQUAL 32)
|
||||||
# this folder contains the 32bit DLLs.. (yes really!)
|
# this folder contains the 32bit DLLs.. (yes really!)
|
||||||
|
|
@ -158,14 +156,12 @@ if(WINDOWS)
|
||||||
vcruntime${MSVC_VER}.dll
|
vcruntime${MSVC_VER}.dll
|
||||||
vcruntime${MSVC_VER}_1.dll
|
vcruntime${MSVC_VER}_1.dll
|
||||||
)
|
)
|
||||||
# <FS:Ansariel> Try using the VC runtime redistributables that came with the VS installation first
|
|
||||||
if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
|
if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
|
||||||
MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}")
|
MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}")
|
||||||
to_staging_dirs(
|
to_staging_dirs(
|
||||||
${redist_path}
|
${redist_path}
|
||||||
third_party_targets
|
third_party_targets
|
||||||
${release_msvc_file})
|
${release_msvc_file})
|
||||||
# </FS:Ansariel>
|
|
||||||
elseif(EXISTS "${registry_path}/${release_msvc_file}")
|
elseif(EXISTS "${registry_path}/${release_msvc_file}")
|
||||||
MESSAGE(STATUS "Copying redist file from ${registry_path}/${release_msvc_file}")
|
MESSAGE(STATUS "Copying redist file from ${registry_path}/${release_msvc_file}")
|
||||||
to_staging_dirs(
|
to_staging_dirs(
|
||||||
|
|
@ -217,6 +213,10 @@ elseif(DARWIN)
|
||||||
set(release_files ${release_files} libfmod.dylib)
|
set(release_files ${release_files} libfmod.dylib)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (TARGET ll::openal)
|
||||||
|
list(APPEND release_files libalut.dylib libopenal.dylib)
|
||||||
|
endif ()
|
||||||
|
|
||||||
elseif(LINUX)
|
elseif(LINUX)
|
||||||
# linux is weird, multiple side by side configurations aren't supported
|
# linux is weird, multiple side by side configurations aren't supported
|
||||||
# and we don't seem to have any debug shared libs built yet anyways...
|
# and we don't seem to have any debug shared libs built yet anyways...
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- cmake -*-
|
||||||
|
include(Prebuilt)
|
||||||
|
|
||||||
|
add_library( ll::glm INTERFACE IMPORTED )
|
||||||
|
|
||||||
|
use_system_binary( glm )
|
||||||
|
use_prebuilt_binary(glm)
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
# -*- cmake -*-
|
|
||||||
include(Prebuilt)
|
|
||||||
include(Linking)
|
|
||||||
|
|
||||||
include_guard()
|
|
||||||
|
|
||||||
add_library( ll::googlemock INTERFACE IMPORTED )
|
|
||||||
if(USE_CONAN)
|
|
||||||
target_link_libraries( ll::googlemock INTERFACE CONAN_PKG::gtest )
|
|
||||||
|
|
||||||
#Not very nice, but for the moment we need this for tut.hpp
|
|
||||||
target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
use_prebuilt_binary(googlemock)
|
|
||||||
|
|
||||||
target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
|
|
||||||
|
|
||||||
if (LINUX)
|
|
||||||
# VWR-24366: gmock is underlinked, it needs gtest.
|
|
||||||
target_link_libraries( ll::googlemock INTERFACE gmock gtest)
|
|
||||||
elseif(WINDOWS)
|
|
||||||
target_link_libraries( ll::googlemock INTERFACE gmock)
|
|
||||||
target_include_directories( ll::googlemock SYSTEM INTERFACE
|
|
||||||
${LIBS_PREBUILT_DIR}/include
|
|
||||||
${LIBS_PREBUILT_DIR}/include/gmock)
|
|
||||||
elseif(DARWIN)
|
|
||||||
target_link_libraries( ll::googlemock INTERFACE gmock gtest)
|
|
||||||
endif(LINUX)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
# -*- cmake -*-
|
|
||||||
|
|
||||||
include(Prebuilt)
|
|
||||||
include_guard()
|
|
||||||
add_library( ll::jsoncpp INTERFACE IMPORTED )
|
|
||||||
|
|
||||||
use_system_binary(jsoncpp)
|
|
||||||
|
|
||||||
use_prebuilt_binary(jsoncpp)
|
|
||||||
if (WINDOWS)
|
|
||||||
target_link_libraries( ll::jsoncpp INTERFACE json_libmd.lib )
|
|
||||||
elseif (DARWIN)
|
|
||||||
target_link_libraries( ll::jsoncpp INTERFACE libjson_darwin_libmt.a )
|
|
||||||
elseif (LINUX)
|
|
||||||
target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-11_libmt.a )
|
|
||||||
endif (WINDOWS)
|
|
||||||
target_include_directories( ll::jsoncpp SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
# -*- cmake -*-
|
# -*- cmake -*-
|
||||||
include(00-Common)
|
include(00-Common)
|
||||||
include(LLTestCommand)
|
include(LLTestCommand)
|
||||||
|
|
||||||
# <FS:ND> Google Mock/Test is not used
|
|
||||||
#include(GoogleMock)
|
|
||||||
# </FS:ND>
|
|
||||||
|
|
||||||
include(bugsplat)
|
include(bugsplat)
|
||||||
include(Tut)
|
include(Tut)
|
||||||
|
|
||||||
|
|
@ -23,10 +18,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
||||||
#
|
#
|
||||||
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
|
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
|
||||||
|
|
||||||
# This here looks weird, but is needed. It will inject GoogleMock into projects that forgot to include `this` (LLAddBuildTest.cmake)
|
|
||||||
# But through some other means have access to this macro
|
|
||||||
include(GoogleMock)
|
|
||||||
|
|
||||||
if(LL_TEST_VERBOSE)
|
if(LL_TEST_VERBOSE)
|
||||||
message("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
|
message("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -45,7 +36,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
||||||
|
|
||||||
set(alltest_LIBRARIES
|
set(alltest_LIBRARIES
|
||||||
llcommon
|
llcommon
|
||||||
ll::googlemock
|
|
||||||
)
|
)
|
||||||
if(NOT "${project}" STREQUAL "llmath")
|
if(NOT "${project}" STREQUAL "llmath")
|
||||||
# add llmath as a dep unless the tested module *is* llmath!
|
# add llmath as a dep unless the tested module *is* llmath!
|
||||||
|
|
@ -208,7 +198,6 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
|
||||||
|
|
||||||
set(libraries
|
set(libraries
|
||||||
${library_dependencies}
|
${library_dependencies}
|
||||||
ll::googlemock
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add test executable build target
|
# Add test executable build target
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,5 @@ include(EXPAT)
|
||||||
include(Tracy)
|
include(Tracy)
|
||||||
include(xxHash)
|
include(xxHash)
|
||||||
include(ZLIBNG)
|
include(ZLIBNG)
|
||||||
include(JsonCpp)
|
|
||||||
|
|
||||||
include(XmlRpcEpi)
|
include(XmlRpcEpi)
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ if (USE_OPENAL)
|
||||||
alut
|
alut
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "OpenAL is not available for this platform")
|
target_link_libraries( ll::openal INTERFACE
|
||||||
|
openal
|
||||||
|
alut
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#
|
#
|
||||||
# Platform variables:
|
# Platform variables:
|
||||||
#
|
#
|
||||||
# DARWIN - Mac OS X
|
# DARWIN - macOS
|
||||||
# LINUX - Linux
|
# LINUX - Linux
|
||||||
# WINDOWS - Windows
|
# WINDOWS - Windows
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ BASE_ARGUMENTS=[
|
||||||
dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE),
|
dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE),
|
||||||
dict(name='buildtype', description='Build type (i.e. Debug, Release, RelWithDebInfo).', default=None),
|
dict(name='buildtype', description='Build type (i.e. Debug, Release, RelWithDebInfo).', default=None),
|
||||||
dict(name='bundleid',
|
dict(name='bundleid',
|
||||||
description="""The Mac OS X Bundle identifier.""",
|
description="""The macOS Bundle identifier.""",
|
||||||
default="com.secondlife.indra.viewer"),
|
default="com.secondlife.indra.viewer"),
|
||||||
dict(name='channel',
|
dict(name='channel',
|
||||||
description="""The channel to use for updates, packaging, settings name, etc.""",
|
description="""The channel to use for updates, packaging, settings name, etc.""",
|
||||||
|
|
@ -146,7 +146,7 @@ BASE_ARGUMENTS=[
|
||||||
dict(name='signature',
|
dict(name='signature',
|
||||||
description="""This specifies an identity to sign the viewer with, if any.
|
description="""This specifies an identity to sign the viewer with, if any.
|
||||||
If no value is supplied, the default signature will be used, if any. Currently
|
If no value is supplied, the default signature will be used, if any. Currently
|
||||||
only used on Mac OS X.""",
|
only used on macOS.""",
|
||||||
default=None),
|
default=None),
|
||||||
dict(name='source',
|
dict(name='source',
|
||||||
description='Source directory.',
|
description='Source directory.',
|
||||||
|
|
|
||||||
|
|
@ -64,19 +64,19 @@ class LLAvatarBoneInfo
|
||||||
friend class LLAvatarAppearance;
|
friend class LLAvatarAppearance;
|
||||||
friend class LLAvatarSkeletonInfo;
|
friend class LLAvatarSkeletonInfo;
|
||||||
public:
|
public:
|
||||||
LLAvatarBoneInfo() : mIsJoint(FALSE) {}
|
LLAvatarBoneInfo() : mIsJoint(false) {}
|
||||||
~LLAvatarBoneInfo()
|
~LLAvatarBoneInfo()
|
||||||
{
|
{
|
||||||
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
|
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
|
||||||
mChildren.clear();
|
mChildren.clear();
|
||||||
}
|
}
|
||||||
BOOL parseXml(LLXmlTreeNode* node);
|
bool parseXml(LLXmlTreeNode* node);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mName;
|
std::string mName;
|
||||||
std::string mSupport;
|
std::string mSupport;
|
||||||
std::string mAliases;
|
std::string mAliases;
|
||||||
BOOL mIsJoint;
|
bool mIsJoint;
|
||||||
LLVector3 mPos;
|
LLVector3 mPos;
|
||||||
LLVector3 mEnd;
|
LLVector3 mEnd;
|
||||||
LLVector3 mRot;
|
LLVector3 mRot;
|
||||||
|
|
@ -101,7 +101,7 @@ public:
|
||||||
std::for_each(mBoneInfoList.begin(), mBoneInfoList.end(), DeletePointer());
|
std::for_each(mBoneInfoList.begin(), mBoneInfoList.end(), DeletePointer());
|
||||||
mBoneInfoList.clear();
|
mBoneInfoList.clear();
|
||||||
}
|
}
|
||||||
BOOL parseXml(LLXmlTreeNode* node);
|
bool parseXml(LLXmlTreeNode* node);
|
||||||
S32 getNumBones() const { return mNumBones; }
|
S32 getNumBones() const { return mNumBones; }
|
||||||
S32 getNumCollisionVolumes() const { return mNumCollisionVolumes; }
|
S32 getNumCollisionVolumes() const { return mNumCollisionVolumes; }
|
||||||
|
|
||||||
|
|
@ -164,19 +164,7 @@ LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAv
|
||||||
|
|
||||||
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
|
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
|
||||||
LLCharacter(),
|
LLCharacter(),
|
||||||
mIsDummy(FALSE),
|
mWearableData(wearable_data)
|
||||||
mTexSkinColor( NULL ),
|
|
||||||
mTexHairColor( NULL ),
|
|
||||||
mTexEyeColor( NULL ),
|
|
||||||
mPelvisToFoot(0.f),
|
|
||||||
mHeadOffset(),
|
|
||||||
mRoot(NULL),
|
|
||||||
mWearableData(wearable_data),
|
|
||||||
mNumBones(0),
|
|
||||||
mNumCollisionVolumes(0),
|
|
||||||
mCollisionVolumes(NULL),
|
|
||||||
mIsBuilt(FALSE),
|
|
||||||
mInitFlags(0)
|
|
||||||
{
|
{
|
||||||
llassert_always(mWearableData);
|
llassert_always(mWearableData);
|
||||||
mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
|
mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
|
||||||
|
|
@ -222,14 +210,14 @@ void LLAvatarAppearance::initInstance()
|
||||||
mesh->setName(mesh_name);
|
mesh->setName(mesh_name);
|
||||||
mesh->setMeshID(mesh_index);
|
mesh->setMeshID(mesh_index);
|
||||||
mesh->setPickName(mesh_dict->mPickName);
|
mesh->setPickName(mesh_dict->mPickName);
|
||||||
mesh->setIsTransparent(FALSE);
|
mesh->setIsTransparent(false);
|
||||||
switch((S32)mesh_index)
|
switch((S32)mesh_index)
|
||||||
{
|
{
|
||||||
case MESH_ID_HAIR:
|
case MESH_ID_HAIR:
|
||||||
mesh->setIsTransparent(TRUE);
|
mesh->setIsTransparent(true);
|
||||||
break;
|
break;
|
||||||
case MESH_ID_SKIRT:
|
case MESH_ID_SKIRT:
|
||||||
mesh->setIsTransparent(TRUE);
|
mesh->setIsTransparent(true);
|
||||||
break;
|
break;
|
||||||
case MESH_ID_EYEBALL_LEFT:
|
case MESH_ID_EYEBALL_LEFT:
|
||||||
case MESH_ID_EYEBALL_RIGHT:
|
case MESH_ID_EYEBALL_RIGHT:
|
||||||
|
|
@ -333,7 +321,7 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
|
||||||
avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR + "_lad.xml");
|
avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR + "_lad.xml");
|
||||||
}
|
}
|
||||||
LLXmlTree xml_tree;
|
LLXmlTree xml_tree;
|
||||||
BOOL success = xml_tree.parseFile( avatar_file_name, FALSE );
|
bool success = xml_tree.parseFile( avatar_file_name, false );
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Problem reading avatar configuration file:" << avatar_file_name << LL_ENDL;
|
LL_ERRS() << "Problem reading avatar configuration file:" << avatar_file_name << LL_ENDL;
|
||||||
|
|
@ -576,17 +564,17 @@ F32 LLAvatarAppearance::getAvatarOffset() /*const*/
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseSkeletonFile()
|
// parseSkeletonFile()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree)
|
bool LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree)
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// parse the file
|
// parse the file
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
BOOL parsesuccess = skeleton_xml_tree.parseFile( filename, FALSE );
|
bool parsesuccess = skeleton_xml_tree.parseFile( filename, false );
|
||||||
|
|
||||||
if (!parsesuccess)
|
if (!parsesuccess)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL;
|
LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now sanity check xml file
|
// now sanity check xml file
|
||||||
|
|
@ -594,13 +582,13 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTre
|
||||||
if (!root)
|
if (!root)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
|
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !root->hasName( "linden_skeleton" ) )
|
if( !root->hasName( "linden_skeleton" ) )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL;
|
LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string version;
|
std::string version;
|
||||||
|
|
@ -608,16 +596,16 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTre
|
||||||
if( !root->getFastAttributeString( version_string, version ) || ((version != "1.0") && (version != "2.0")))
|
if( !root->getFastAttributeString( version_string, version ) || ((version != "1.0") && (version != "2.0")))
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
|
LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// setupBone()
|
// setupBone()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &volume_num, S32 &joint_num)
|
bool LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &volume_num, S32 &joint_num)
|
||||||
{
|
{
|
||||||
LLJoint* joint = NULL;
|
LLJoint* joint = NULL;
|
||||||
|
|
||||||
|
|
@ -633,7 +621,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
||||||
if (!joint)
|
if (!joint)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Too many bones" << LL_ENDL;
|
LL_WARNS() << "Too many bones" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
joint->setName( info->mName );
|
joint->setName( info->mName );
|
||||||
}
|
}
|
||||||
|
|
@ -642,7 +630,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
||||||
if (volume_num >= (S32)mNumCollisionVolumes)
|
if (volume_num >= (S32)mNumCollisionVolumes)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Too many collision volumes" << LL_ENDL;
|
LL_WARNS() << "Too many collision volumes" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
joint = (&mCollisionVolumes[volume_num]);
|
joint = (&mCollisionVolumes[volume_num]);
|
||||||
joint->setName( info->mName );
|
joint->setName( info->mName );
|
||||||
|
|
@ -682,17 +670,17 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
||||||
{
|
{
|
||||||
if (!setupBone(child_info, joint, volume_num, joint_num))
|
if (!setupBone(child_info, joint, volume_num, joint_num))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// allocateCharacterJoints()
|
// allocateCharacterJoints()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::allocateCharacterJoints( S32 num )
|
bool LLAvatarAppearance::allocateCharacterJoints( S32 num )
|
||||||
{
|
{
|
||||||
if (mSkeleton.size() != num)
|
if (mSkeleton.size() != num)
|
||||||
{
|
{
|
||||||
|
|
@ -702,14 +690,14 @@ BOOL LLAvatarAppearance::allocateCharacterJoints( S32 num )
|
||||||
mNumBones = num;
|
mNumBones = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// buildSkeleton()
|
// buildSkeleton()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
bool LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||||
{
|
{
|
||||||
LL_DEBUGS("BVH") << "numBones " << info->mNumBones << " numCollisionVolumes " << info->mNumCollisionVolumes << LL_ENDL;
|
LL_DEBUGS("BVH") << "numBones " << info->mNumBones << " numCollisionVolumes " << info->mNumCollisionVolumes << LL_ENDL;
|
||||||
|
|
||||||
|
|
@ -717,7 +705,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||||
if (!allocateCharacterJoints(info->mNumBones))
|
if (!allocateCharacterJoints(info->mNumBones))
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL;
|
LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate volumes
|
// allocate volumes
|
||||||
|
|
@ -726,7 +714,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||||
if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
|
if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL;
|
LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -737,11 +725,11 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||||
if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num))
|
if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num))
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -806,7 +794,7 @@ void LLAvatarAppearance::buildCharacter()
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
mRoot->removeAllChildren();
|
mRoot->removeAllChildren();
|
||||||
mJointMap.clear();
|
mJointMap.clear();
|
||||||
mIsBuilt = FALSE;
|
mIsBuilt = false;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// clear mesh data
|
// clear mesh data
|
||||||
|
|
@ -824,10 +812,10 @@ void LLAvatarAppearance::buildCharacter()
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
LLTimer timer;
|
LLTimer timer;
|
||||||
|
|
||||||
BOOL status = loadAvatar();
|
bool status = loadAvatar();
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
|
|
||||||
// gPrintMessagesThisFrame = TRUE;
|
// gPrintMessagesThisFrame = true;
|
||||||
LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
|
LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
|
||||||
|
|
||||||
if (!status)
|
if (!status)
|
||||||
|
|
@ -897,12 +885,12 @@ void LLAvatarAppearance::buildCharacter()
|
||||||
// SL-315
|
// SL-315
|
||||||
mPelvisp->setPosition( LLVector3(0.0f, 0.0f, 0.0f) );
|
mPelvisp->setPosition( LLVector3(0.0f, 0.0f, 0.0f) );
|
||||||
|
|
||||||
mIsBuilt = TRUE;
|
mIsBuilt = true;
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLAvatarAppearance::loadAvatar()
|
bool LLAvatarAppearance::loadAvatar()
|
||||||
{
|
{
|
||||||
// LL_RECORD_BLOCK_TIME(FTM_LOAD_AVATAR);
|
// LL_RECORD_BLOCK_TIME(FTM_LOAD_AVATAR);
|
||||||
|
|
||||||
|
|
@ -910,7 +898,7 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||||
if( !buildSkeleton(sAvatarSkeletonInfo) )
|
if( !buildSkeleton(sAvatarSkeletonInfo) )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
|
LL_ERRS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize mJointAliasMap
|
// initialize mJointAliasMap
|
||||||
|
|
@ -920,14 +908,14 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||||
if( !loadSkeletonNode() )
|
if( !loadSkeletonNode() )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
|
LL_ERRS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// avatar_lad.xml : <mesh>
|
// avatar_lad.xml : <mesh>
|
||||||
if( !loadMeshNodes() )
|
if( !loadMeshNodes() )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
|
LL_ERRS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// avatar_lad.xml : <global_color>
|
// avatar_lad.xml : <global_color>
|
||||||
|
|
@ -937,13 +925,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||||
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
|
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
|
LL_ERRS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_ERRS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
|
LL_ERRS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if( sAvatarXmlInfo->mTexHairColorInfo )
|
if( sAvatarXmlInfo->mTexHairColorInfo )
|
||||||
{
|
{
|
||||||
|
|
@ -951,13 +939,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||||
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
|
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
|
LL_ERRS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_ERRS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
|
LL_ERRS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if( sAvatarXmlInfo->mTexEyeColorInfo )
|
if( sAvatarXmlInfo->mTexEyeColorInfo )
|
||||||
{
|
{
|
||||||
|
|
@ -965,26 +953,26 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||||
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
|
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
|
LL_ERRS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_ERRS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
|
LL_ERRS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// avatar_lad.xml : <layer_set>
|
// avatar_lad.xml : <layer_set>
|
||||||
if (sAvatarXmlInfo->mLayerInfoList.empty())
|
if (sAvatarXmlInfo->mLayerInfoList.empty())
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: missing <layer_set> node" << LL_ENDL;
|
LL_ERRS() << "avatar file: missing <layer_set> node" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
|
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
|
||||||
{
|
{
|
||||||
LL_ERRS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
|
LL_ERRS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// avatar_lad.xml : <morph_masks>
|
// avatar_lad.xml : <morph_masks>
|
||||||
|
|
@ -998,7 +986,7 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||||
morph_param = getVisualParam(name->c_str());
|
morph_param = getVisualParam(name->c_str());
|
||||||
if (morph_param)
|
if (morph_param)
|
||||||
{
|
{
|
||||||
BOOL invert = info->mInvert;
|
bool invert = info->mInvert;
|
||||||
addMaskedMorph(baked, morph_param, invert, info->mLayer);
|
addMaskedMorph(baked, morph_param, invert, info->mLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1026,24 +1014,24 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||||
{
|
{
|
||||||
delete driver_param;
|
delete driver_param;
|
||||||
LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL;
|
LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// loadSkeletonNode(): loads <skeleton> node from XML tree
|
// loadSkeletonNode(): loads <skeleton> node from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::loadSkeletonNode ()
|
bool LLAvatarAppearance::loadSkeletonNode ()
|
||||||
{
|
{
|
||||||
mRoot->addChild( mSkeleton[0] );
|
mRoot->addChild( mSkeleton[0] );
|
||||||
|
|
||||||
// make meshes children before calling parent version of the function
|
// make meshes children before calling parent version of the function
|
||||||
for (LLAvatarJoint* joint : mMeshLOD)
|
for (LLAvatarJoint* joint : mMeshLOD)
|
||||||
{
|
{
|
||||||
joint->mUpdateXform = FALSE;
|
joint->mUpdateXform = false;
|
||||||
joint->setMeshesToChildren();
|
joint->setMeshesToChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1080,7 +1068,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode ()
|
||||||
if (!param->setInfo(info))
|
if (!param->setInfo(info))
|
||||||
{
|
{
|
||||||
delete param;
|
delete param;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1091,13 +1079,13 @@ BOOL LLAvatarAppearance::loadSkeletonNode ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// loadMeshNodes(): loads <mesh> nodes from XML tree
|
// loadMeshNodes(): loads <mesh> nodes from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::loadMeshNodes()
|
bool LLAvatarAppearance::loadMeshNodes()
|
||||||
{
|
{
|
||||||
for (const LLAvatarXmlInfo::LLAvatarMeshInfo* info : sAvatarXmlInfo->mMeshInfoList)
|
for (const LLAvatarXmlInfo::LLAvatarMeshInfo* info : sAvatarXmlInfo->mMeshInfoList)
|
||||||
{
|
{
|
||||||
|
|
@ -1106,7 +1094,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||||
|
|
||||||
LLAvatarJointMesh* mesh = NULL;
|
LLAvatarJointMesh* mesh = NULL;
|
||||||
U8 mesh_id = 0;
|
U8 mesh_id = 0;
|
||||||
BOOL found_mesh_id = FALSE;
|
bool found_mesh_id = false;
|
||||||
|
|
||||||
/* if (type == "hairMesh")
|
/* if (type == "hairMesh")
|
||||||
switch(lod)
|
switch(lod)
|
||||||
|
|
@ -1119,7 +1107,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||||
if (type.compare(mesh_dict->mName) == 0)
|
if (type.compare(mesh_dict->mName) == 0)
|
||||||
{
|
{
|
||||||
mesh_id = mesh_index;
|
mesh_id = mesh_index;
|
||||||
found_mesh_id = TRUE;
|
found_mesh_id = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1133,13 +1121,13 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Avatar file: <mesh> has invalid lod setting " << lod << LL_ENDL;
|
LL_WARNS() << "Avatar file: <mesh> has invalid lod setting " << lod << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL;
|
LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL;
|
// LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL;
|
||||||
|
|
@ -1162,7 +1150,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||||
{
|
{
|
||||||
// This should never happen
|
// This should never happen
|
||||||
LL_WARNS("Avatar") << "Could not find avatar mesh: " << info->mReferenceMeshName << LL_ENDL;
|
LL_WARNS("Avatar") << "Could not find avatar mesh: " << info->mReferenceMeshName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1174,7 +1162,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||||
if( !poly_mesh )
|
if( !poly_mesh )
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL;
|
LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multimap insert
|
// Multimap insert
|
||||||
|
|
@ -1189,7 +1177,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||||
if (!param->setInfo((LLPolyMorphTargetInfo*)info_pair.first))
|
if (!param->setInfo((LLPolyMorphTargetInfo*)info_pair.first))
|
||||||
{
|
{
|
||||||
delete param;
|
delete param;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1207,15 +1195,15 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// loadLayerSets()
|
// loadLayerSets()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::loadLayersets()
|
bool LLAvatarAppearance::loadLayersets()
|
||||||
{
|
{
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
for (LLTexLayerSetInfo* layerset_info : sAvatarXmlInfo->mLayerInfoList)
|
for (LLTexLayerSetInfo* layerset_info : sAvatarXmlInfo->mLayerInfoList)
|
||||||
{
|
{
|
||||||
if (isSelf())
|
if (isSelf())
|
||||||
|
|
@ -1228,7 +1216,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
delete layer_set;
|
delete layer_set;
|
||||||
LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL;
|
LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// scan baked textures and associate the layerset with the appropriate one
|
// scan baked textures and associate the layerset with the appropriate one
|
||||||
|
|
@ -1250,7 +1238,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
||||||
{
|
{
|
||||||
LL_WARNS() << "<layer_set> has invalid body_region attribute" << LL_ENDL;
|
LL_WARNS() << "<layer_set> has invalid body_region attribute" << LL_ENDL;
|
||||||
delete layer_set;
|
delete layer_set;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// scan morph masks and let any affected layers know they have an associated morph
|
// scan morph masks and let any affected layers know they have an associated morph
|
||||||
|
|
@ -1259,12 +1247,12 @@ BOOL LLAvatarAppearance::loadLayersets()
|
||||||
LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer);
|
LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer);
|
||||||
if (layer)
|
if (layer)
|
||||||
{
|
{
|
||||||
layer->setHasMorph(TRUE);
|
layer->setHasMorph(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL;
|
LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL;
|
||||||
success = FALSE;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1357,19 +1345,19 @@ LLPolyMesh* LLAvatarAppearance::getUpperBodyMesh()
|
||||||
|
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
BOOL LLAvatarAppearance::isValid() const
|
bool LLAvatarAppearance::isValid() const
|
||||||
{
|
{
|
||||||
// This should only be called on ourself.
|
// This should only be called on ourself.
|
||||||
if (!isSelf())
|
if (!isSelf())
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL;
|
LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// adds a morph mask to the appropriate baked texture structure
|
// adds a morph mask to the appropriate baked texture structure
|
||||||
void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer)
|
void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam* morph_target, bool invert, std::string layer)
|
||||||
{
|
{
|
||||||
if (index < BAKED_NUM_INDICES)
|
if (index < BAKED_NUM_INDICES)
|
||||||
{
|
{
|
||||||
|
|
@ -1380,7 +1368,7 @@ void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam*
|
||||||
|
|
||||||
|
|
||||||
//static
|
//static
|
||||||
BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
|
bool LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
|
||||||
{
|
{
|
||||||
switch( te )
|
switch( te )
|
||||||
{
|
{
|
||||||
|
|
@ -1464,27 +1452,27 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
|
||||||
|
|
||||||
default:
|
default:
|
||||||
llassert(0);
|
llassert(0);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color)
|
//void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color)
|
||||||
void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake)
|
void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, bool upload_bake)
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
{
|
{
|
||||||
U32 param_name[3];
|
U32 param_name[3];
|
||||||
if( teToColorParams( te, param_name ) )
|
if( teToColorParams( te, param_name ) )
|
||||||
{
|
{
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setVisualParamWeight( param_name[0], new_color.mV[VX]);
|
//setVisualParamWeight( param_name[0], new_color.mV[VRED]);
|
||||||
//setVisualParamWeight( param_name[1], new_color.mV[VY]);
|
//setVisualParamWeight( param_name[1], new_color.mV[VGREEN]);
|
||||||
//setVisualParamWeight( param_name[2], new_color.mV[VZ]);
|
//setVisualParamWeight( param_name[2], new_color.mV[VBLUE]);
|
||||||
setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake);
|
setVisualParamWeight( param_name[0], new_color.mV[VRED], upload_bake);
|
||||||
setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake);
|
setVisualParamWeight( param_name[1], new_color.mV[VGREEN], upload_bake);
|
||||||
setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake);
|
setVisualParamWeight( param_name[2], new_color.mV[VBLUE], upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1495,9 +1483,9 @@ LLColor4 LLAvatarAppearance::getClothesColor( ETextureIndex te )
|
||||||
U32 param_name[3];
|
U32 param_name[3];
|
||||||
if( teToColorParams( te, param_name ) )
|
if( teToColorParams( te, param_name ) )
|
||||||
{
|
{
|
||||||
color.mV[VX] = getVisualParamWeight( param_name[0] );
|
color.mV[VRED] = getVisualParamWeight( param_name[0] );
|
||||||
color.mV[VY] = getVisualParamWeight( param_name[1] );
|
color.mV[VGREEN] = getVisualParamWeight( param_name[1] );
|
||||||
color.mV[VZ] = getVisualParamWeight( param_name[2] );
|
color.mV[VBLUE] = getVisualParamWeight( param_name[2] );
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
@ -1531,7 +1519,7 @@ LLColor4 LLAvatarAppearance::getGlobalColor( const std::string& color_name ) con
|
||||||
|
|
||||||
// Unlike most wearable functions, this works for both self and other.
|
// Unlike most wearable functions, this works for both self and other.
|
||||||
// virtual
|
// virtual
|
||||||
BOOL LLAvatarAppearance::isWearingWearableType(LLWearableType::EType type) const
|
bool LLAvatarAppearance::isWearingWearableType(LLWearableType::EType type) const
|
||||||
{
|
{
|
||||||
return mWearableData->getWearableCount(type) > 0;
|
return mWearableData->getWearableCount(type) > 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1548,7 +1536,7 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// allocateCollisionVolumes()
|
// allocateCollisionVolumes()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
bool LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||||
{
|
{
|
||||||
if (mNumCollisionVolumes !=num)
|
if (mNumCollisionVolumes !=num)
|
||||||
{
|
{
|
||||||
|
|
@ -1559,27 +1547,27 @@ BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||||
if (!mCollisionVolumes)
|
if (!mCollisionVolumes)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Failed to allocate collision volumes" << LL_ENDL;
|
LL_WARNS() << "Failed to allocate collision volumes" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mNumCollisionVolumes = num;
|
mNumCollisionVolumes = num;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLAvatarBoneInfo::parseXml()
|
// LLAvatarBoneInfo::parseXml()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
bool LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
if (node->hasName("bone"))
|
if (node->hasName("bone"))
|
||||||
{
|
{
|
||||||
mIsJoint = TRUE;
|
mIsJoint = true;
|
||||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||||
if (!node->getFastAttributeString(name_string, mName))
|
if (!node->getFastAttributeString(name_string, mName))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Bone without name" << LL_ENDL;
|
LL_WARNS() << "Bone without name" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle aliases_string = LLXmlTree::addAttributeString("aliases");
|
static LLStdStringHandle aliases_string = LLXmlTree::addAttributeString("aliases");
|
||||||
|
|
@ -1587,7 +1575,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||||
}
|
}
|
||||||
else if (node->hasName("collision_volume"))
|
else if (node->hasName("collision_volume"))
|
||||||
{
|
{
|
||||||
mIsJoint = FALSE;
|
mIsJoint = false;
|
||||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||||
if (!node->getFastAttributeString(name_string, mName))
|
if (!node->getFastAttributeString(name_string, mName))
|
||||||
{
|
{
|
||||||
|
|
@ -1597,28 +1585,28 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL;
|
LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
|
static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
|
||||||
if (!node->getFastAttributeVector3(pos_string, mPos))
|
if (!node->getFastAttributeVector3(pos_string, mPos))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Bone without position" << LL_ENDL;
|
LL_WARNS() << "Bone without position" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
|
static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
|
||||||
if (!node->getFastAttributeVector3(rot_string, mRot))
|
if (!node->getFastAttributeVector3(rot_string, mRot))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Bone without rotation" << LL_ENDL;
|
LL_WARNS() << "Bone without rotation" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
|
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
|
||||||
if (!node->getFastAttributeVector3(scale_string, mScale))
|
if (!node->getFastAttributeVector3(scale_string, mScale))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Bone without scale" << LL_ENDL;
|
LL_WARNS() << "Bone without scale" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle end_string = LLXmlTree::addAttributeString("end");
|
static LLStdStringHandle end_string = LLXmlTree::addAttributeString("end");
|
||||||
|
|
@ -1641,7 +1629,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if (!node->getFastAttributeVector3(pivot_string, mPivot))
|
if (!node->getFastAttributeVector3(pivot_string, mPivot))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Bone without pivot" << LL_ENDL;
|
LL_WARNS() << "Bone without pivot" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1653,23 +1641,23 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if (!child_info->parseXml(child))
|
if (!child_info->parseXml(child))
|
||||||
{
|
{
|
||||||
delete child_info;
|
delete child_info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mChildren.push_back(child_info);
|
mChildren.push_back(child_info);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLAvatarSkeletonInfo::parseXml()
|
// LLAvatarSkeletonInfo::parseXml()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
bool LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
|
static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
|
||||||
if (!node->getFastAttributeS32(num_bones_string, mNumBones))
|
if (!node->getFastAttributeS32(num_bones_string, mNumBones))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Couldn't find number of bones." << LL_ENDL;
|
LL_WARNS() << "Couldn't find number of bones." << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle num_collision_volumes_string = LLXmlTree::addAttributeString("num_collision_volumes");
|
static LLStdStringHandle num_collision_volumes_string = LLXmlTree::addAttributeString("num_collision_volumes");
|
||||||
|
|
@ -1683,11 +1671,11 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mBoneInfoList.push_back(info);
|
mBoneInfoList.push_back(info);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Make aliases for joint and push to map.
|
//Make aliases for joint and push to map.
|
||||||
|
|
@ -1755,13 +1743,13 @@ const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXmlSkeletonNode(): parses <skeleton> nodes from XML tree
|
// parseXmlSkeletonNode(): parses <skeleton> nodes from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root)
|
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
LLXmlTreeNode* node = root->getChildByName( "skeleton" );
|
LLXmlTreeNode* node = root->getChildByName( "skeleton" );
|
||||||
if( !node )
|
if( !node )
|
||||||
{
|
{
|
||||||
LL_WARNS() << "avatar file: missing <skeleton>" << LL_ENDL;
|
LL_WARNS() << "avatar file: missing <skeleton>" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLXmlTreeNode* child;
|
LLXmlTreeNode* child;
|
||||||
|
|
@ -1781,14 +1769,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLPolySkeletalDistortionInfo *info = new LLPolySkeletalDistortionInfo;
|
LLPolySkeletalDistortionInfo *info = new LLPolySkeletalDistortionInfo;
|
||||||
if (!info->parseXml(child))
|
if (!info->parseXml(child))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mSkeletalDistortionInfoList.push_back(info);
|
mSkeletalDistortionInfoList.push_back(info);
|
||||||
|
|
@ -1806,7 +1794,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||||
{
|
{
|
||||||
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
|
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
|
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
|
||||||
|
|
@ -1814,19 +1802,19 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||||
{
|
{
|
||||||
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
|
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle position_string = LLXmlTree::addAttributeString("position");
|
static LLStdStringHandle position_string = LLXmlTree::addAttributeString("position");
|
||||||
if (child->getFastAttributeVector3(position_string, info->mPosition))
|
if (child->getFastAttributeVector3(position_string, info->mPosition))
|
||||||
{
|
{
|
||||||
info->mHasPosition = TRUE;
|
info->mHasPosition = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle rotation_string = LLXmlTree::addAttributeString("rotation");
|
static LLStdStringHandle rotation_string = LLXmlTree::addAttributeString("rotation");
|
||||||
if (child->getFastAttributeVector3(rotation_string, info->mRotationEuler))
|
if (child->getFastAttributeVector3(rotation_string, info->mRotationEuler))
|
||||||
{
|
{
|
||||||
info->mHasRotation = TRUE;
|
info->mHasRotation = true;
|
||||||
}
|
}
|
||||||
static LLStdStringHandle group_string = LLXmlTree::addAttributeString("group");
|
static LLStdStringHandle group_string = LLXmlTree::addAttributeString("group");
|
||||||
if (child->getFastAttributeS32(group_string, info->mGroup))
|
if (child->getFastAttributeS32(group_string, info->mGroup))
|
||||||
|
|
@ -1840,7 +1828,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||||
{
|
{
|
||||||
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
|
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle slot_string = LLXmlTree::addAttributeString("pie_slice");
|
static LLStdStringHandle slot_string = LLXmlTree::addAttributeString("pie_slice");
|
||||||
|
|
@ -1855,13 +1843,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||||
mAttachmentInfoList.push_back(info);
|
mAttachmentInfoList.push_back(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXmlMeshNodes(): parses <mesh> nodes from XML tree
|
// parseXmlMeshNodes(): parses <mesh> nodes from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
for (LLXmlTreeNode* node = root->getChildByName( "mesh" );
|
for (LLXmlTreeNode* node = root->getChildByName( "mesh" );
|
||||||
node;
|
node;
|
||||||
|
|
@ -1875,7 +1863,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << LL_ENDL;
|
LL_WARNS() << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE; // Ignore this element
|
return false; // Ignore this element
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
|
static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
|
||||||
|
|
@ -1883,7 +1871,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << LL_ENDL;
|
LL_WARNS() << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE; // Ignore this element
|
return false; // Ignore this element
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
|
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
|
||||||
|
|
@ -1891,7 +1879,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL;
|
LL_WARNS() << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE; // Ignore this element
|
return false; // Ignore this element
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle reference_string = LLXmlTree::addAttributeString("reference");
|
static LLStdStringHandle reference_string = LLXmlTree::addAttributeString("reference");
|
||||||
|
|
@ -1926,7 +1914,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLPolyMorphTargetInfo *morphinfo = new LLPolyMorphTargetInfo();
|
LLPolyMorphTargetInfo *morphinfo = new LLPolyMorphTargetInfo();
|
||||||
|
|
@ -1934,9 +1922,9 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
delete morphinfo;
|
delete morphinfo;
|
||||||
delete info;
|
delete info;
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
BOOL shared = FALSE;
|
bool shared = false;
|
||||||
static LLStdStringHandle shared_string = LLXmlTree::addAttributeString("shared");
|
static LLStdStringHandle shared_string = LLXmlTree::addAttributeString("shared");
|
||||||
child->getFastAttributeBOOL(shared_string, shared);
|
child->getFastAttributeBOOL(shared_string, shared);
|
||||||
|
|
||||||
|
|
@ -1945,13 +1933,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||||
|
|
||||||
mMeshInfoList.push_back(info);
|
mMeshInfoList.push_back(info);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXmlColorNodes(): parses <global_color> nodes from XML tree
|
// parseXmlColorNodes(): parses <global_color> nodes from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root)
|
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
for (LLXmlTreeNode* color_node = root->getChildByName( "global_color" );
|
for (LLXmlTreeNode* color_node = root->getChildByName( "global_color" );
|
||||||
color_node;
|
color_node;
|
||||||
|
|
@ -1966,14 +1954,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
||||||
if (mTexSkinColorInfo)
|
if (mTexSkinColorInfo)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL;
|
LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mTexSkinColorInfo = new LLTexGlobalColorInfo;
|
mTexSkinColorInfo = new LLTexGlobalColorInfo;
|
||||||
if( !mTexSkinColorInfo->parseXml( color_node ) )
|
if( !mTexSkinColorInfo->parseXml( color_node ) )
|
||||||
{
|
{
|
||||||
delete_and_clear(mTexSkinColorInfo);
|
delete_and_clear(mTexSkinColorInfo);
|
||||||
LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL;
|
LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( global_color_name == "hair_color" )
|
else if( global_color_name == "hair_color" )
|
||||||
|
|
@ -1981,14 +1969,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
||||||
if (mTexHairColorInfo)
|
if (mTexHairColorInfo)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL;
|
LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mTexHairColorInfo = new LLTexGlobalColorInfo;
|
mTexHairColorInfo = new LLTexGlobalColorInfo;
|
||||||
if( !mTexHairColorInfo->parseXml( color_node ) )
|
if( !mTexHairColorInfo->parseXml( color_node ) )
|
||||||
{
|
{
|
||||||
delete_and_clear(mTexHairColorInfo);
|
delete_and_clear(mTexHairColorInfo);
|
||||||
LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL;
|
LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( global_color_name == "eye_color" )
|
else if( global_color_name == "eye_color" )
|
||||||
|
|
@ -1996,24 +1984,24 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
||||||
if (mTexEyeColorInfo)
|
if (mTexEyeColorInfo)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL;
|
LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mTexEyeColorInfo = new LLTexGlobalColorInfo;
|
mTexEyeColorInfo = new LLTexGlobalColorInfo;
|
||||||
if( !mTexEyeColorInfo->parseXml( color_node ) )
|
if( !mTexEyeColorInfo->parseXml( color_node ) )
|
||||||
{
|
{
|
||||||
LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL;
|
LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXmlLayerNodes(): parses <layer_set> nodes from XML tree
|
// parseXmlLayerNodes(): parses <layer_set> nodes from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root)
|
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
for (LLXmlTreeNode* layer_node = root->getChildByName( "layer_set" );
|
for (LLXmlTreeNode* layer_node = root->getChildByName( "layer_set" );
|
||||||
layer_node;
|
layer_node;
|
||||||
|
|
@ -2028,16 +2016,16 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root
|
||||||
{
|
{
|
||||||
delete layer_info;
|
delete layer_info;
|
||||||
LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL;
|
LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
|
// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root)
|
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
LLXmlTreeNode* driver = root->getChildByName( "driver_parameters" );
|
LLXmlTreeNode* driver = root->getChildByName( "driver_parameters" );
|
||||||
if( driver )
|
if( driver )
|
||||||
|
|
@ -2057,23 +2045,23 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* roo
|
||||||
{
|
{
|
||||||
delete driver_info;
|
delete driver_info;
|
||||||
LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL;
|
LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
|
// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root)
|
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root)
|
||||||
{
|
{
|
||||||
LLXmlTreeNode* masks = root->getChildByName( "morph_masks" );
|
LLXmlTreeNode* masks = root->getChildByName( "morph_masks" );
|
||||||
if( !masks )
|
if( !masks )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (LLXmlTreeNode* grand_child = masks->getChildByName( "mask" );
|
for (LLXmlTreeNode* grand_child = masks->getChildByName( "mask" );
|
||||||
|
|
@ -2087,7 +2075,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
||||||
{
|
{
|
||||||
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
|
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
|
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
|
||||||
|
|
@ -2095,7 +2083,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
||||||
{
|
{
|
||||||
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
|
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
|
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
|
||||||
|
|
@ -2103,7 +2091,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
||||||
{
|
{
|
||||||
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
|
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional parameter. don't throw a warning if not present.
|
// optional parameter. don't throw a warning if not present.
|
||||||
|
|
@ -2113,11 +2101,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
||||||
mMorphMaskInfoList.push_back(info);
|
mMorphMaskInfoList.push_back(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer) :
|
LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, bool invert, std::string layer) :
|
||||||
mMorphTarget(morph_target),
|
mMorphTarget(morph_target),
|
||||||
mInvert(invert),
|
mInvert(invert),
|
||||||
mLayer(layer)
|
mLayer(layer)
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,10 @@ public:
|
||||||
static void initClass();
|
static void initClass();
|
||||||
static void cleanupClass(); // Cleanup data that's only init'd once per class.
|
static void cleanupClass(); // Cleanup data that's only init'd once per class.
|
||||||
virtual void initInstance(); // Called after construction to initialize the instance.
|
virtual void initInstance(); // Called after construction to initialize the instance.
|
||||||
S32 mInitFlags;
|
S32 mInitFlags{ 0 };
|
||||||
virtual BOOL loadSkeletonNode();
|
virtual bool loadSkeletonNode();
|
||||||
BOOL loadMeshNodes();
|
bool loadMeshNodes();
|
||||||
BOOL loadLayersets();
|
bool loadLayersets();
|
||||||
|
|
||||||
|
|
||||||
/** Initialization
|
/** Initialization
|
||||||
|
|
@ -108,14 +108,14 @@ public:
|
||||||
**/
|
**/
|
||||||
public:
|
public:
|
||||||
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
|
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
|
||||||
virtual BOOL isValid() const;
|
virtual bool isValid() const;
|
||||||
virtual BOOL isUsingLocalAppearance() const = 0;
|
virtual bool isUsingLocalAppearance() const = 0;
|
||||||
virtual BOOL isEditingAppearance() const = 0;
|
virtual bool isEditingAppearance() const = 0;
|
||||||
|
|
||||||
bool isBuilt() const { return mIsBuilt; }
|
bool isBuilt() const { return mIsBuilt; }
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
virtual BOOL isUsingServerBakes() const = 0;
|
virtual bool isUsingServerBakes() const = 0;
|
||||||
|
|
||||||
/** State
|
/** State
|
||||||
** **
|
** **
|
||||||
|
|
@ -137,8 +137,8 @@ public:
|
||||||
F32 getPelvisToFoot() const { return mPelvisToFoot; }
|
F32 getPelvisToFoot() const { return mPelvisToFoot; }
|
||||||
/*virtual*/ LLJoint* getRootJoint() { return mRoot; }
|
/*virtual*/ LLJoint* getRootJoint() { return mRoot; }
|
||||||
|
|
||||||
LLVector3 mHeadOffset; // current head position
|
LLVector3 mHeadOffset{}; // current head position
|
||||||
LLAvatarJoint *mRoot;
|
LLAvatarJoint* mRoot{ nullptr };
|
||||||
|
|
||||||
// <FS:ND> This map gets queried a huge amount of time.
|
// <FS:ND> This map gets queried a huge amount of time.
|
||||||
// typedef std::map<std::string, LLJoint*> joint_map_t;
|
// typedef std::map<std::string, LLJoint*> joint_map_t;
|
||||||
|
|
@ -152,7 +152,7 @@ public:
|
||||||
joint_state_map_t mCurrBodySizeState;
|
joint_state_map_t mCurrBodySizeState;
|
||||||
void compareJointStateMaps(joint_state_map_t& last_state,
|
void compareJointStateMaps(joint_state_map_t& last_state,
|
||||||
joint_state_map_t& curr_state);
|
joint_state_map_t& curr_state);
|
||||||
void computeBodySize();
|
void computeBodySize();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
|
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
|
||||||
|
|
@ -162,21 +162,21 @@ public:
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static BOOL parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree);
|
static bool parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree);
|
||||||
virtual void buildCharacter();
|
virtual void buildCharacter();
|
||||||
virtual BOOL loadAvatar();
|
virtual bool loadAvatar();
|
||||||
// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8)
|
// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8)
|
||||||
virtual F32 getAvatarOffset() /*const*/;
|
virtual F32 getAvatarOffset() /*const*/;
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
virtual void bodySizeChanged() = 0;
|
virtual void bodySizeChanged() = 0;
|
||||||
|
|
||||||
BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
bool setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||||
BOOL allocateCharacterJoints(S32 num);
|
bool allocateCharacterJoints(S32 num);
|
||||||
BOOL buildSkeleton(const LLAvatarSkeletonInfo *info);
|
bool buildSkeleton(const LLAvatarSkeletonInfo *info);
|
||||||
|
|
||||||
void clearSkeleton();
|
void clearSkeleton();
|
||||||
BOOL mIsBuilt; // state of deferred character building
|
bool mIsBuilt{ false }; // state of deferred character building
|
||||||
avatar_joint_list_t mSkeleton;
|
avatar_joint_list_t mSkeleton;
|
||||||
LLVector3OverrideMap mPelvisFixups;
|
LLVector3OverrideMap mPelvisFixups;
|
||||||
joint_alias_map_t mJointAliasMap;
|
joint_alias_map_t mJointAliasMap;
|
||||||
|
|
@ -193,30 +193,30 @@ public:
|
||||||
LLVector3 mBodySize;
|
LLVector3 mBodySize;
|
||||||
LLVector3 mAvatarOffset;
|
LLVector3 mAvatarOffset;
|
||||||
protected:
|
protected:
|
||||||
F32 mPelvisToFoot;
|
F32 mPelvisToFoot{ 0.f };
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Cached pointers to well known joints
|
// Cached pointers to well known joints
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
LLJoint* mPelvisp;
|
LLJoint* mPelvisp{nullptr};
|
||||||
LLJoint* mTorsop;
|
LLJoint* mTorsop{ nullptr };
|
||||||
LLJoint* mChestp;
|
LLJoint* mChestp{ nullptr };
|
||||||
LLJoint* mNeckp;
|
LLJoint* mNeckp{ nullptr };
|
||||||
LLJoint* mHeadp;
|
LLJoint* mHeadp{ nullptr };
|
||||||
LLJoint* mSkullp;
|
LLJoint* mSkullp{ nullptr };
|
||||||
LLJoint* mEyeLeftp;
|
LLJoint* mEyeLeftp{ nullptr };
|
||||||
LLJoint* mEyeRightp;
|
LLJoint* mEyeRightp{ nullptr };
|
||||||
LLJoint* mHipLeftp;
|
LLJoint* mHipLeftp{ nullptr };
|
||||||
LLJoint* mHipRightp;
|
LLJoint* mHipRightp{ nullptr };
|
||||||
LLJoint* mKneeLeftp;
|
LLJoint* mKneeLeftp{ nullptr };
|
||||||
LLJoint* mKneeRightp;
|
LLJoint* mKneeRightp{ nullptr };
|
||||||
LLJoint* mAnkleLeftp;
|
LLJoint* mAnkleLeftp{ nullptr };
|
||||||
LLJoint* mAnkleRightp;
|
LLJoint* mAnkleRightp{ nullptr };
|
||||||
LLJoint* mFootLeftp;
|
LLJoint* mFootLeftp{ nullptr };
|
||||||
LLJoint* mFootRightp;
|
LLJoint* mFootRightp{ nullptr };
|
||||||
LLJoint* mWristLeftp;
|
LLJoint* mWristLeftp{ nullptr };
|
||||||
LLJoint* mWristRightp;
|
LLJoint* mWristRightp{ nullptr };
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// XML parse tree
|
// XML parse tree
|
||||||
|
|
@ -240,14 +240,14 @@ public:
|
||||||
** RENDERING
|
** RENDERING
|
||||||
**/
|
**/
|
||||||
public:
|
public:
|
||||||
BOOL mIsDummy; // for special views and animated object controllers; local to viewer
|
bool mIsDummy{ false }; // for special views and animated object controllers; local to viewer
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Morph masks
|
// Morph masks
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer);
|
void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, bool invert, std::string layer);
|
||||||
virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0;
|
virtual void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0;
|
||||||
|
|
||||||
/** Rendering
|
/** Rendering
|
||||||
** **
|
** **
|
||||||
|
|
@ -259,7 +259,7 @@ public:
|
||||||
public:
|
public:
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//virtual void invalidateComposite(LLTexLayerSet* layerset) = 0;
|
//virtual void invalidateComposite(LLTexLayerSet* layerset) = 0;
|
||||||
virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) = 0;
|
virtual void invalidateComposite(LLTexLayerSet* layerset, bool upload_result) = 0;
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
** **
|
** **
|
||||||
|
|
@ -296,10 +296,10 @@ protected:
|
||||||
public:
|
public:
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color);
|
//void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color);
|
||||||
void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
|
void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, bool upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
|
LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
|
||||||
static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
|
static bool teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Global colors
|
// Global colors
|
||||||
|
|
@ -308,12 +308,12 @@ public:
|
||||||
LLColor4 getGlobalColor(const std::string& color_name ) const;
|
LLColor4 getGlobalColor(const std::string& color_name ) const;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0;
|
//virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0;
|
||||||
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0;
|
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake) = 0;
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
protected:
|
protected:
|
||||||
LLTexGlobalColor* mTexSkinColor;
|
LLTexGlobalColor* mTexSkinColor{ nullptr };
|
||||||
LLTexGlobalColor* mTexHairColor;
|
LLTexGlobalColor* mTexHairColor{ nullptr };
|
||||||
LLTexGlobalColor* mTexEyeColor;
|
LLTexGlobalColor* mTexEyeColor{ nullptr };
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Visibility
|
// Visibility
|
||||||
|
|
@ -332,11 +332,11 @@ public:
|
||||||
public:
|
public:
|
||||||
LLWearableData* getWearableData() { return mWearableData; }
|
LLWearableData* getWearableData() { return mWearableData; }
|
||||||
const LLWearableData* getWearableData() const { return mWearableData; }
|
const LLWearableData* getWearableData() const { return mWearableData; }
|
||||||
virtual BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index = 0 ) const = 0;
|
virtual bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index = 0 ) const = 0;
|
||||||
virtual BOOL isWearingWearableType(LLWearableType::EType type ) const;
|
virtual bool isWearingWearableType(LLWearableType::EType type ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LLWearableData* mWearableData;
|
LLWearableData* mWearableData{ nullptr };
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
** **
|
** **
|
||||||
|
|
@ -354,11 +354,11 @@ protected:
|
||||||
struct BakedTextureData
|
struct BakedTextureData
|
||||||
{
|
{
|
||||||
LLUUID mLastTextureID;
|
LLUUID mLastTextureID;
|
||||||
LLTexLayerSet* mTexLayerSet; // Only exists for self
|
LLTexLayerSet* mTexLayerSet{ nullptr }; // Only exists for self
|
||||||
bool mIsLoaded;
|
bool mIsLoaded{ false };
|
||||||
bool mIsUsed;
|
bool mIsUsed{ false };
|
||||||
LLAvatarAppearanceDefines::ETextureIndex mTextureIndex;
|
LLAvatarAppearanceDefines::ETextureIndex mTextureIndex{ LLAvatarAppearanceDefines::ETextureIndex::TEX_INVALID };
|
||||||
U32 mMaskTexName;
|
U32 mMaskTexName{ 0 };
|
||||||
// Stores pointers to the joint meshes that this baked texture deals with
|
// Stores pointers to the joint meshes that this baked texture deals with
|
||||||
avatar_joint_mesh_list_t mJointMeshes;
|
avatar_joint_mesh_list_t mJointMeshes;
|
||||||
morph_list_t mMaskedMorphs;
|
morph_list_t mMaskedMorphs;
|
||||||
|
|
@ -375,11 +375,11 @@ protected:
|
||||||
// Collision volumes
|
// Collision volumes
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
S32 mNumBones;
|
S32 mNumBones{ 0 };
|
||||||
S32 mNumCollisionVolumes;
|
S32 mNumCollisionVolumes{ 0 };
|
||||||
LLAvatarJointCollisionVolume* mCollisionVolumes;
|
LLAvatarJointCollisionVolume* mCollisionVolumes{ nullptr };
|
||||||
protected:
|
protected:
|
||||||
BOOL allocateCollisionVolumes(U32 num);
|
bool allocateCollisionVolumes(U32 num);
|
||||||
|
|
||||||
/** Physics
|
/** Physics
|
||||||
** **
|
** **
|
||||||
|
|
@ -395,16 +395,16 @@ protected:
|
||||||
LLAvatarXmlInfo();
|
LLAvatarXmlInfo();
|
||||||
~LLAvatarXmlInfo();
|
~LLAvatarXmlInfo();
|
||||||
|
|
||||||
BOOL parseXmlSkeletonNode(LLXmlTreeNode* root);
|
bool parseXmlSkeletonNode(LLXmlTreeNode* root);
|
||||||
BOOL parseXmlMeshNodes(LLXmlTreeNode* root);
|
bool parseXmlMeshNodes(LLXmlTreeNode* root);
|
||||||
BOOL parseXmlColorNodes(LLXmlTreeNode* root);
|
bool parseXmlColorNodes(LLXmlTreeNode* root);
|
||||||
BOOL parseXmlLayerNodes(LLXmlTreeNode* root);
|
bool parseXmlLayerNodes(LLXmlTreeNode* root);
|
||||||
BOOL parseXmlDriverNodes(LLXmlTreeNode* root);
|
bool parseXmlDriverNodes(LLXmlTreeNode* root);
|
||||||
BOOL parseXmlMorphNodes(LLXmlTreeNode* root);
|
bool parseXmlMorphNodes(LLXmlTreeNode* root);
|
||||||
|
|
||||||
struct LLAvatarMeshInfo
|
struct LLAvatarMeshInfo
|
||||||
{
|
{
|
||||||
typedef std::pair<LLViewerVisualParamInfo*,BOOL> morph_info_pair_t; // LLPolyMorphTargetInfo stored here
|
typedef std::pair<LLViewerVisualParamInfo*,bool> morph_info_pair_t; // LLPolyMorphTargetInfo stored here
|
||||||
typedef std::vector<morph_info_pair_t> morph_info_list_t;
|
typedef std::vector<morph_info_pair_t> morph_info_list_t;
|
||||||
|
|
||||||
LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {}
|
LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {}
|
||||||
|
|
@ -433,8 +433,8 @@ protected:
|
||||||
struct LLAvatarAttachmentInfo
|
struct LLAvatarAttachmentInfo
|
||||||
{
|
{
|
||||||
LLAvatarAttachmentInfo()
|
LLAvatarAttachmentInfo()
|
||||||
: mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE),
|
: mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(false),
|
||||||
mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {}
|
mIsHUDAttachment(false), mHasPosition(false), mHasRotation(false) {}
|
||||||
std::string mName;
|
std::string mName;
|
||||||
std::string mJointName;
|
std::string mJointName;
|
||||||
LLVector3 mPosition;
|
LLVector3 mPosition;
|
||||||
|
|
@ -442,10 +442,10 @@ protected:
|
||||||
S32 mGroup;
|
S32 mGroup;
|
||||||
S32 mAttachmentID;
|
S32 mAttachmentID;
|
||||||
S32 mPieMenuSlice;
|
S32 mPieMenuSlice;
|
||||||
BOOL mVisibleFirstPerson;
|
bool mVisibleFirstPerson;
|
||||||
BOOL mIsHUDAttachment;
|
bool mIsHUDAttachment;
|
||||||
BOOL mHasPosition;
|
bool mHasPosition;
|
||||||
BOOL mHasRotation;
|
bool mHasRotation;
|
||||||
};
|
};
|
||||||
typedef std::vector<LLAvatarAttachmentInfo*> attachment_info_list_t;
|
typedef std::vector<LLAvatarAttachmentInfo*> attachment_info_list_t;
|
||||||
attachment_info_list_t mAttachmentInfoList;
|
attachment_info_list_t mAttachmentInfoList;
|
||||||
|
|
@ -463,11 +463,11 @@ protected:
|
||||||
struct LLAvatarMorphInfo
|
struct LLAvatarMorphInfo
|
||||||
{
|
{
|
||||||
LLAvatarMorphInfo()
|
LLAvatarMorphInfo()
|
||||||
: mInvert(FALSE) {}
|
: mInvert(false) {}
|
||||||
std::string mName;
|
std::string mName;
|
||||||
std::string mRegion;
|
std::string mRegion;
|
||||||
std::string mLayer;
|
std::string mLayer;
|
||||||
BOOL mInvert;
|
bool mInvert;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<LLAvatarMorphInfo*> morph_info_list_t;
|
typedef std::vector<LLAvatarMorphInfo*> morph_info_list_t;
|
||||||
|
|
@ -478,10 +478,10 @@ protected:
|
||||||
class LLMaskedMorph
|
class LLMaskedMorph
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer);
|
LLMaskedMorph(LLVisualParam *morph_target, bool invert, std::string layer);
|
||||||
|
|
||||||
LLVisualParam *mMorphTarget;
|
LLVisualParam *mMorphTarget;
|
||||||
BOOL mInvert;
|
bool mInvert;
|
||||||
std::string mLayer;
|
std::string mLayer;
|
||||||
};
|
};
|
||||||
/** Support Classes
|
/** Support Classes
|
||||||
|
|
|
||||||
|
|
@ -39,56 +39,56 @@ using namespace LLAvatarAppearanceDefines;
|
||||||
|
|
||||||
LLAvatarAppearanceDictionary::Textures::Textures()
|
LLAvatarAppearanceDictionary::Textures::Textures()
|
||||||
{
|
{
|
||||||
addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||||
addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", LLWearableType::WT_SHIRT));
|
addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", true, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", LLWearableType::WT_SHIRT));
|
||||||
addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", LLWearableType::WT_PANTS));
|
addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", true, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", LLWearableType::WT_PANTS));
|
||||||
addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", TRUE, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", LLWearableType::WT_EYES));
|
addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", true, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", LLWearableType::WT_EYES));
|
||||||
addEntry(TEX_HAIR, new TextureEntry("hair_grain", TRUE, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", LLWearableType::WT_HAIR));
|
addEntry(TEX_HAIR, new TextureEntry("hair_grain", true, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", LLWearableType::WT_HAIR));
|
||||||
addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||||
addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||||
addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", LLWearableType::WT_SHOES));
|
addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", true, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", LLWearableType::WT_SHOES));
|
||||||
addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", LLWearableType::WT_SOCKS));
|
addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", true, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", LLWearableType::WT_SOCKS));
|
||||||
addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
||||||
addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
||||||
addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", TRUE, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", LLWearableType::WT_GLOVES));
|
addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", true, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", LLWearableType::WT_GLOVES));
|
||||||
addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT));
|
addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT));
|
||||||
addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS));
|
addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS));
|
||||||
addEntry(TEX_SKIRT, new TextureEntry("skirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", LLWearableType::WT_SKIRT));
|
addEntry(TEX_SKIRT, new TextureEntry("skirt", true, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", LLWearableType::WT_SKIRT));
|
||||||
|
|
||||||
addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||||
addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||||
addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||||
addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||||
addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||||
|
|
||||||
addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||||
addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||||
addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||||
|
|
||||||
addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||||
|
|
||||||
|
|
||||||
addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD, "head"));
|
addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", false, BAKED_HEAD, "head"));
|
||||||
addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER, "upper"));
|
addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", false, BAKED_UPPER, "upper"));
|
||||||
addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER, "lower"));
|
addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", false, BAKED_LOWER, "lower"));
|
||||||
addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES, "eyes"));
|
addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", false, BAKED_EYES, "eyes"));
|
||||||
addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR, "hair"));
|
addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", false, BAKED_HAIR, "hair"));
|
||||||
addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT, "skirt"));
|
addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", false, BAKED_SKIRT, "skirt"));
|
||||||
addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", FALSE, BAKED_LEFT_ARM, "leftarm"));
|
addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", false, BAKED_LEFT_ARM, "leftarm"));
|
||||||
addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", FALSE, BAKED_LEFT_LEG, "leftleg"));
|
addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", false, BAKED_LEFT_LEG, "leftleg"));
|
||||||
addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", FALSE, BAKED_AUX1, "aux1"));
|
addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", false, BAKED_AUX1, "aux1"));
|
||||||
addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", FALSE, BAKED_AUX2, "aux2"));
|
addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", false, BAKED_AUX2, "aux2"));
|
||||||
addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", FALSE, BAKED_AUX3, "aux3"));
|
addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", false, BAKED_AUX3, "aux3"));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLAvatarAppearanceDictionary::BakedTextures::BakedTextures()
|
LLAvatarAppearanceDictionary::BakedTextures::BakedTextures()
|
||||||
|
|
@ -305,15 +305,15 @@ LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIn
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
BOOL LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id)
|
bool LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id)
|
||||||
{
|
{
|
||||||
if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER)
|
if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER)
|
||||||
|| (id == IMG_USE_BAKED_LEFTARM) || (id == IMG_USE_BAKED_LEFTLEG) || (id == IMG_USE_BAKED_AUX1) || (id == IMG_USE_BAKED_AUX2) || (id == IMG_USE_BAKED_AUX3) )
|
|| (id == IMG_USE_BAKED_LEFTARM) || (id == IMG_USE_BAKED_LEFTLEG) || (id == IMG_USE_BAKED_AUX1) || (id == IMG_USE_BAKED_AUX2) || (id == IMG_USE_BAKED_AUX3) )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace LLAvatarAppearanceDefines
|
||||||
extern const S32 SCRATCH_TEX_WIDTH;
|
extern const S32 SCRATCH_TEX_WIDTH;
|
||||||
extern const S32 SCRATCH_TEX_HEIGHT;
|
extern const S32 SCRATCH_TEX_HEIGHT;
|
||||||
|
|
||||||
static const U32 AVATAR_HOVER = 11001;
|
static constexpr U32 AVATAR_HOVER = 11001;
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Enums
|
// Enums
|
||||||
|
|
@ -167,10 +167,10 @@ public:
|
||||||
const std::string mDefaultImageName;
|
const std::string mDefaultImageName;
|
||||||
const LLWearableType::EType mWearableType;
|
const LLWearableType::EType mWearableType;
|
||||||
// It's either a local texture xor baked
|
// It's either a local texture xor baked
|
||||||
BOOL mIsLocalTexture;
|
bool mIsLocalTexture;
|
||||||
BOOL mIsBakedTexture;
|
bool mIsBakedTexture;
|
||||||
// If it's a local texture, it may be used by a baked texture
|
// If it's a local texture, it may be used by a baked texture
|
||||||
BOOL mIsUsedByBakedTexture;
|
bool mIsUsedByBakedTexture;
|
||||||
EBakedTextureIndex mBakedTextureIndex;
|
EBakedTextureIndex mBakedTextureIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -244,7 +244,7 @@ public:
|
||||||
// Given a texture entry, determine which wearable type owns it.
|
// Given a texture entry, determine which wearable type owns it.
|
||||||
LLWearableType::EType getTEWearableType(ETextureIndex index) const;
|
LLWearableType::EType getTEWearableType(ETextureIndex index) const;
|
||||||
|
|
||||||
static BOOL isBakedImageId(const LLUUID& id);
|
static bool isBakedImageId(const LLUUID& id);
|
||||||
static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id);
|
static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id);
|
||||||
static LLUUID localTextureIndexToMagicId(ETextureIndex t);
|
static LLUUID localTextureIndexToMagicId(ETextureIndex t);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const F32 DEFAULT_AVATAR_JOINT_LOD = 0.0f;
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Static Data
|
// Static Data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarJoint::sDisableLOD = FALSE;
|
bool LLAvatarJoint::sDisableLOD = false;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLAvatarJoint()
|
// LLAvatarJoint()
|
||||||
|
|
@ -66,13 +66,13 @@ LLAvatarJoint::LLAvatarJoint(const std::string &name, LLJoint *parent) :
|
||||||
|
|
||||||
void LLAvatarJoint::init()
|
void LLAvatarJoint::init()
|
||||||
{
|
{
|
||||||
mValid = FALSE;
|
mValid = false;
|
||||||
mComponents = SC_JOINT | SC_BONE | SC_AXES;
|
mComponents = SC_JOINT | SC_BONE | SC_AXES;
|
||||||
mMinPixelArea = DEFAULT_AVATAR_JOINT_LOD;
|
mMinPixelArea = DEFAULT_AVATAR_JOINT_LOD;
|
||||||
mPickName = PN_DEFAULT;
|
mPickName = PN_DEFAULT;
|
||||||
mVisible = TRUE;
|
mVisible = true;
|
||||||
mMeshID = 0;
|
mMeshID = 0;
|
||||||
mIsTransparent = FALSE;
|
mIsTransparent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ LLAvatarJoint::~LLAvatarJoint()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// setValid()
|
// setValid()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
void LLAvatarJoint::setValid( bool valid, bool recursive )
|
||||||
{
|
{
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// set visibility for this joint
|
// set visibility for this joint
|
||||||
|
|
@ -103,7 +103,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
||||||
for (LLJoint* child : mChildren)
|
for (LLJoint* child : mChildren)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
|
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
|
||||||
joint->setValid(valid, TRUE);
|
joint->setValid(valid, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// setSkeletonComponents()
|
// setSkeletonComponents()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
|
void LLAvatarJoint::setSkeletonComponents( U32 comp, bool recursive )
|
||||||
{
|
{
|
||||||
mComponents = comp;
|
mComponents = comp;
|
||||||
if (recursive)
|
if (recursive)
|
||||||
|
|
@ -125,7 +125,7 @@ void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
|
void LLAvatarJoint::setVisible(bool visible, bool recursive)
|
||||||
{
|
{
|
||||||
mVisible = visible;
|
mVisible = visible;
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update)
|
void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind, bool terse_update)
|
||||||
{
|
{
|
||||||
for (LLJoint* child : mChildren)
|
for (LLJoint* child : mChildren)
|
||||||
{
|
{
|
||||||
|
|
@ -167,10 +167,10 @@ void LLAvatarJoint::updateJointGeometry()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
|
bool LLAvatarJoint::updateLOD(F32 pixel_area, bool activate)
|
||||||
{
|
{
|
||||||
BOOL lod_changed = FALSE;
|
bool lod_changed = false;
|
||||||
BOOL found_lod = FALSE;
|
bool found_lod = false;
|
||||||
|
|
||||||
for (LLJoint* child : mChildren)
|
for (LLJoint* child : mChildren)
|
||||||
{
|
{
|
||||||
|
|
@ -180,18 +180,18 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
|
||||||
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
||||||
{
|
{
|
||||||
// we've already found a joint to enable, so enable the rest as alternatives
|
// we've already found a joint to enable, so enable the rest as alternatives
|
||||||
lod_changed |= joint->updateLOD(pixel_area, TRUE);
|
lod_changed |= joint->updateLOD(pixel_area, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pixel_area >= jointLOD || sDisableLOD)
|
if (pixel_area >= jointLOD || sDisableLOD)
|
||||||
{
|
{
|
||||||
lod_changed |= joint->updateLOD(pixel_area, TRUE);
|
lod_changed |= joint->updateLOD(pixel_area, true);
|
||||||
found_lod = TRUE;
|
found_lod = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lod_changed |= joint->updateLOD(pixel_area, FALSE);
|
lod_changed |= joint->updateLOD(pixel_area, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -222,11 +222,11 @@ void LLAvatarJoint::setMeshesToChildren()
|
||||||
|
|
||||||
LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
|
LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
|
||||||
{
|
{
|
||||||
mUpdateXform = FALSE;
|
mUpdateXform = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/
|
/*virtual*/
|
||||||
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
|
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, bool first_pass, bool is_dummy )
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
|
LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -234,7 +234,7 @@ U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL i
|
||||||
|
|
||||||
LLVector3 LLAvatarJointCollisionVolume::getVolumePos(LLVector3 &offset)
|
LLVector3 LLAvatarJointCollisionVolume::getVolumePos(LLVector3 &offset)
|
||||||
{
|
{
|
||||||
mUpdateXform = TRUE;
|
mUpdateXform = true;
|
||||||
|
|
||||||
LLVector3 result = offset;
|
LLVector3 result = offset;
|
||||||
result.scaleVec(getScale());
|
result.scaleVec(getScale());
|
||||||
|
|
|
||||||
|
|
@ -52,17 +52,17 @@ public:
|
||||||
virtual ~LLAvatarJoint();
|
virtual ~LLAvatarJoint();
|
||||||
|
|
||||||
// Gets the validity of this joint
|
// Gets the validity of this joint
|
||||||
BOOL getValid() { return mValid; }
|
bool getValid() { return mValid; }
|
||||||
|
|
||||||
// Sets the validity of this joint
|
// Sets the validity of this joint
|
||||||
virtual void setValid( BOOL valid, BOOL recursive=FALSE );
|
virtual void setValid( bool valid, bool recursive=false );
|
||||||
|
|
||||||
// Returns true if this object is transparent.
|
// Returns true if this object is transparent.
|
||||||
// This is used to determine in which order to draw objects.
|
// This is used to determine in which order to draw objects.
|
||||||
virtual BOOL isTransparent() { return mIsTransparent; }
|
virtual bool isTransparent() { return mIsTransparent; }
|
||||||
|
|
||||||
// Returns true if this object should inherit scale modifiers from its immediate parent
|
// Returns true if this object should inherit scale modifiers from its immediate parent
|
||||||
virtual BOOL inheritScale() { return FALSE; }
|
virtual bool inheritScale() { return false; }
|
||||||
|
|
||||||
enum Components
|
enum Components
|
||||||
{
|
{
|
||||||
|
|
@ -72,7 +72,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Selects which skeleton components to draw
|
// Selects which skeleton components to draw
|
||||||
void setSkeletonComponents( U32 comp, BOOL recursive = TRUE );
|
void setSkeletonComponents( U32 comp, bool recursive = true );
|
||||||
|
|
||||||
// Returns which skeleton components are enables for drawing
|
// Returns which skeleton components are enables for drawing
|
||||||
U32 getSkeletonComponents() { return mComponents; }
|
U32 getSkeletonComponents() { return mComponents; }
|
||||||
|
|
@ -90,34 +90,34 @@ public:
|
||||||
void setPickName(LLJointPickName name) { mPickName = name; }
|
void setPickName(LLJointPickName name) { mPickName = name; }
|
||||||
LLJointPickName getPickName() { return mPickName; }
|
LLJointPickName getPickName() { return mPickName; }
|
||||||
|
|
||||||
void setVisible( BOOL visible, BOOL recursive );
|
void setVisible( bool visible, bool recursive );
|
||||||
|
|
||||||
// Takes meshes in mMeshParts and sets each one as a child joint
|
// Takes meshes in mMeshParts and sets each one as a child joint
|
||||||
void setMeshesToChildren();
|
void setMeshesToChildren();
|
||||||
|
|
||||||
// LLViewerJoint interface
|
// LLViewerJoint interface
|
||||||
virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) = 0;
|
virtual U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) = 0;
|
||||||
virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area);
|
virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area);
|
||||||
virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false);
|
virtual void updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind = false, bool terse_update = false);
|
||||||
virtual BOOL updateLOD(F32 pixel_area, BOOL activate);
|
virtual bool updateLOD(F32 pixel_area, bool activate);
|
||||||
virtual void updateJointGeometry();
|
virtual void updateJointGeometry();
|
||||||
virtual void dump();
|
virtual void dump();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static BOOL sDisableLOD;
|
static bool sDisableLOD;
|
||||||
avatar_joint_mesh_list_t mMeshParts; //LLViewerJointMesh*
|
avatar_joint_mesh_list_t mMeshParts; //LLViewerJointMesh*
|
||||||
void setMeshID( S32 id ) {mMeshID = id;}
|
void setMeshID( S32 id ) {mMeshID = id;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
BOOL mValid;
|
bool mValid;
|
||||||
BOOL mIsTransparent;
|
bool mIsTransparent;
|
||||||
U32 mComponents;
|
U32 mComponents;
|
||||||
F32 mMinPixelArea;
|
F32 mMinPixelArea;
|
||||||
LLJointPickName mPickName;
|
LLJointPickName mPickName;
|
||||||
BOOL mVisible;
|
bool mVisible;
|
||||||
S32 mMeshID;
|
S32 mMeshID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -127,8 +127,8 @@ public:
|
||||||
LLAvatarJointCollisionVolume();
|
LLAvatarJointCollisionVolume();
|
||||||
virtual ~LLAvatarJointCollisionVolume() {};
|
virtual ~LLAvatarJointCollisionVolume() {};
|
||||||
|
|
||||||
/*virtual*/ BOOL inheritScale() { return TRUE; }
|
/*virtual*/ bool inheritScale() { return true; }
|
||||||
/*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE );
|
/*virtual*/ U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false );
|
||||||
|
|
||||||
void renderCollision();
|
void renderCollision();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ LLSkinJoint::~LLSkinJoint()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLSkinJoint::setupSkinJoint()
|
// LLSkinJoint::setupSkinJoint()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
bool LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
||||||
{
|
{
|
||||||
// find the named joint
|
// find the named joint
|
||||||
mJoint = joint;
|
mJoint = joint;
|
||||||
|
|
@ -119,7 +119,7 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
||||||
mRootToParentJointSkinOffset = totalSkinOffset(getBaseSkeletonAncestor(joint));
|
mRootToParentJointSkinOffset = totalSkinOffset(getBaseSkeletonAncestor(joint));
|
||||||
mRootToParentJointSkinOffset = -mRootToParentJointSkinOffset;
|
mRootToParentJointSkinOffset = -mRootToParentJointSkinOffset;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -129,7 +129,7 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL LLAvatarJointMesh::sPipelineRender = FALSE;
|
bool LLAvatarJointMesh::sPipelineRender = false;
|
||||||
U32 LLAvatarJointMesh::sClothingMaskImageName = 0;
|
U32 LLAvatarJointMesh::sClothingMaskImageName = 0;
|
||||||
LLColor4 LLAvatarJointMesh::sClothingInnerColor;
|
LLColor4 LLAvatarJointMesh::sClothingInnerColor;
|
||||||
|
|
||||||
|
|
@ -149,7 +149,7 @@ LLAvatarJointMesh::LLAvatarJointMesh()
|
||||||
mColor[2] = 1.0f;
|
mColor[2] = 1.0f;
|
||||||
mColor[3] = 1.0f;
|
mColor[3] = 1.0f;
|
||||||
mShiny = 0.0f;
|
mShiny = 0.0f;
|
||||||
mCullBackFaces = TRUE;
|
mCullBackFaces = true;
|
||||||
|
|
||||||
mMesh = NULL;
|
mMesh = NULL;
|
||||||
|
|
||||||
|
|
@ -159,11 +159,11 @@ LLAvatarJointMesh::LLAvatarJointMesh()
|
||||||
mFace = NULL;
|
mFace = NULL;
|
||||||
|
|
||||||
mMeshID = 0;
|
mMeshID = 0;
|
||||||
mUpdateXform = FALSE;
|
mUpdateXform = false;
|
||||||
|
|
||||||
mValid = FALSE;
|
mValid = false;
|
||||||
|
|
||||||
mIsTransparent = FALSE;
|
mIsTransparent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -182,11 +182,11 @@ LLAvatarJointMesh::~LLAvatarJointMesh()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLAvatarJointMesh::allocateSkinData()
|
// LLAvatarJointMesh::allocateSkinData()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarJointMesh::allocateSkinData( U32 numSkinJoints )
|
bool LLAvatarJointMesh::allocateSkinData( U32 numSkinJoints )
|
||||||
{
|
{
|
||||||
mSkinJoints = new LLSkinJoint[ numSkinJoints ];
|
mSkinJoints = new LLSkinJoint[ numSkinJoints ];
|
||||||
mNumSkinJoints = numSkinJoints;
|
mNumSkinJoints = numSkinJoints;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -247,12 +247,12 @@ void LLAvatarJointMesh::setTexture( LLGLTexture *texture )
|
||||||
{
|
{
|
||||||
mLayerSet = NULL;
|
mLayerSet = NULL;
|
||||||
//texture->bindTexture(0);
|
//texture->bindTexture(0);
|
||||||
//texture->setClamp(TRUE, TRUE);
|
//texture->setClamp(true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLAvatarJointMesh::hasGLTexture() const
|
bool LLAvatarJointMesh::hasGLTexture() const
|
||||||
{
|
{
|
||||||
return mTexture.notNull() && mTexture->hasGLTexture();
|
return mTexture.notNull() && mTexture->hasGLTexture();
|
||||||
}
|
}
|
||||||
|
|
@ -272,7 +272,7 @@ void LLAvatarJointMesh::setLayerSet( LLTexLayerSet* layer_set )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLAvatarJointMesh::hasComposite() const
|
bool LLAvatarJointMesh::hasComposite() const
|
||||||
{
|
{
|
||||||
return (mLayerSet && mLayerSet->hasComposite());
|
return (mLayerSet && mLayerSet->hasComposite());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class LLSkinJoint
|
||||||
public:
|
public:
|
||||||
LLSkinJoint();
|
LLSkinJoint();
|
||||||
~LLSkinJoint();
|
~LLSkinJoint();
|
||||||
BOOL setupSkinJoint( LLAvatarJoint *joint);
|
bool setupSkinJoint( LLAvatarJoint *joint);
|
||||||
|
|
||||||
LLAvatarJoint *mJoint;
|
LLAvatarJoint *mJoint;
|
||||||
LLVector3 mRootToJointSkinOffset;
|
LLVector3 mRootToJointSkinOffset;
|
||||||
|
|
@ -69,7 +69,7 @@ protected:
|
||||||
LLTexLayerSet* mLayerSet; // ptr to a layer set owned by the avatar
|
LLTexLayerSet* mLayerSet; // ptr to a layer set owned by the avatar
|
||||||
U32 mTestImageName; // handle to a temporary texture for previewing uploads
|
U32 mTestImageName; // handle to a temporary texture for previewing uploads
|
||||||
LLPolyMesh* mMesh; // ptr to a global polymesh
|
LLPolyMesh* mMesh; // ptr to a global polymesh
|
||||||
BOOL mCullBackFaces; // true by default
|
bool mCullBackFaces; // true by default
|
||||||
LLFace* mFace; // ptr to a face w/ AGP copy of mesh
|
LLFace* mFace; // ptr to a face w/ AGP copy of mesh
|
||||||
|
|
||||||
U32 mFaceIndexCount;
|
U32 mFaceIndexCount;
|
||||||
|
|
@ -79,7 +79,7 @@ protected:
|
||||||
S32 mMeshID;
|
S32 mMeshID;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static BOOL sPipelineRender;
|
static bool sPipelineRender;
|
||||||
//RN: this is here for testing purposes
|
//RN: this is here for testing purposes
|
||||||
static U32 sClothingMaskImageName;
|
static U32 sClothingMaskImageName;
|
||||||
static LLColor4 sClothingInnerColor;
|
static LLColor4 sClothingInnerColor;
|
||||||
|
|
@ -104,14 +104,14 @@ public:
|
||||||
// Sets the shape texture
|
// Sets the shape texture
|
||||||
void setTexture( LLGLTexture *texture );
|
void setTexture( LLGLTexture *texture );
|
||||||
|
|
||||||
BOOL hasGLTexture() const;
|
bool hasGLTexture() const;
|
||||||
|
|
||||||
void setTestTexture( U32 name ) { mTestImageName = name; }
|
void setTestTexture( U32 name ) { mTestImageName = name; }
|
||||||
|
|
||||||
// Sets layer set responsible for a dynamic shape texture (takes precedence over normal texture)
|
// Sets layer set responsible for a dynamic shape texture (takes precedence over normal texture)
|
||||||
void setLayerSet( LLTexLayerSet* layer_set );
|
void setLayerSet( LLTexLayerSet* layer_set );
|
||||||
|
|
||||||
BOOL hasComposite() const;
|
bool hasComposite() const;
|
||||||
|
|
||||||
// Gets the poly mesh
|
// Gets the poly mesh
|
||||||
LLPolyMesh *getMesh();
|
LLPolyMesh *getMesh();
|
||||||
|
|
@ -122,20 +122,17 @@ public:
|
||||||
// Sets up joint matrix data for rendering
|
// Sets up joint matrix data for rendering
|
||||||
void setupJoint(LLAvatarJoint* current_joint);
|
void setupJoint(LLAvatarJoint* current_joint);
|
||||||
|
|
||||||
// Render time method to upload batches of joint matrices
|
|
||||||
void uploadJointMatrices();
|
|
||||||
|
|
||||||
// Sets ID for picking
|
// Sets ID for picking
|
||||||
void setMeshID( S32 id ) {mMeshID = id;}
|
void setMeshID( S32 id ) {mMeshID = id;}
|
||||||
|
|
||||||
// Gets ID for picking
|
// Gets ID for picking
|
||||||
S32 getMeshID() { return mMeshID; }
|
S32 getMeshID() { return mMeshID; }
|
||||||
|
|
||||||
void setIsTransparent(BOOL is_transparent) { mIsTransparent = is_transparent; }
|
void setIsTransparent(bool is_transparent) { mIsTransparent = is_transparent; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Allocate skin data
|
// Allocate skin data
|
||||||
BOOL allocateSkinData( U32 numSkinJoints );
|
bool allocateSkinData( U32 numSkinJoints );
|
||||||
|
|
||||||
// Free skin data
|
// Free skin data
|
||||||
void freeSkinData();
|
void freeSkinData();
|
||||||
|
|
|
||||||
|
|
@ -41,16 +41,16 @@ LLDriverParamInfo::LLDriverParamInfo() :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
bool LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
llassert( node->hasName( "param" ) && node->getChildByName( "param_driver" ) );
|
llassert( node->hasName( "param" ) && node->getChildByName( "param_driver" ) );
|
||||||
|
|
||||||
if( !LLViewerVisualParamInfo::parseXml( node ))
|
if( !LLViewerVisualParamInfo::parseXml( node ))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
LLXmlTreeNode* param_driver_node = node->getChildByName( "param_driver" );
|
LLXmlTreeNode* param_driver_node = node->getChildByName( "param_driver" );
|
||||||
if( !param_driver_node )
|
if( !param_driver_node )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
for (LLXmlTreeNode* child = param_driver_node->getChildByName( "driven" );
|
for (LLXmlTreeNode* child = param_driver_node->getChildByName( "driven" );
|
||||||
child;
|
child;
|
||||||
|
|
@ -90,10 +90,10 @@ BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
|
LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
|
|
@ -187,20 +187,20 @@ LLDriverParam::~LLDriverParam()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
|
bool LLDriverParam::setInfo(LLDriverParamInfo *info)
|
||||||
{
|
{
|
||||||
llassert(mInfo == NULL);
|
llassert(mInfo == NULL);
|
||||||
if (info->mID < 0)
|
if (info->mID < 0)
|
||||||
return FALSE;
|
return false;
|
||||||
mInfo = info;
|
mInfo = info;
|
||||||
mID = info->mID;
|
mID = info->mID;
|
||||||
info->mDriverParam = this;
|
info->mDriverParam = this;
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setWeight(getDefaultWeight());
|
//setWeight(getDefaultWeight());
|
||||||
setWeight(getDefaultWeight(), FALSE );
|
setWeight(getDefaultWeight(), false );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const
|
/*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const
|
||||||
|
|
@ -211,7 +211,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLDriverParam::setWeight(F32 weight)
|
//void LLDriverParam::setWeight(F32 weight)
|
||||||
void LLDriverParam::setWeight(F32 weight, BOOL upload_bake)
|
void LLDriverParam::setWeight(F32 weight, bool upload_bake)
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
{
|
{
|
||||||
F32 min_weight = getMinWeight();
|
F32 min_weight = getMinWeight();
|
||||||
|
|
@ -435,7 +435,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
|
||||||
|
|
||||||
S32 LLDriverParam::getDrivenParamsCount() const
|
S32 LLDriverParam::getDrivenParamsCount() const
|
||||||
{
|
{
|
||||||
return mDriven.size();
|
return static_cast<S32>(mDriven.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
|
const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
|
||||||
|
|
@ -454,7 +454,7 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
|
||||||
//void LLDriverParam::setAnimationTarget( F32 target_value)
|
//void LLDriverParam::setAnimationTarget( F32 target_value)
|
||||||
//{
|
//{
|
||||||
// LLVisualParam::setAnimationTarget(target_value);
|
// LLVisualParam::setAnimationTarget(target_value);
|
||||||
void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake )
|
void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake )
|
||||||
{
|
{
|
||||||
LLVisualParam::setAnimationTarget(target_value, upload_bake);
|
LLVisualParam::setAnimationTarget(target_value, upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
|
|
@ -480,32 +480,32 @@ void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake )
|
||||||
//void LLDriverParam::stopAnimating()
|
//void LLDriverParam::stopAnimating()
|
||||||
//{
|
//{
|
||||||
// LLVisualParam::stopAnimating();
|
// LLVisualParam::stopAnimating();
|
||||||
void LLDriverParam::stopAnimating(BOOL upload_bake)
|
void LLDriverParam::stopAnimating(bool upload_bake)
|
||||||
{
|
{
|
||||||
LLVisualParam::stopAnimating(upload_bake);
|
LLVisualParam::stopAnimating(upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
|
|
||||||
for(LLDrivenEntry& driven : mDriven)
|
for(LLDrivenEntry& driven : mDriven)
|
||||||
{
|
{
|
||||||
driven.mParam->setAnimating(FALSE);
|
driven.mParam->setAnimating(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/
|
/*virtual*/
|
||||||
BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params)
|
bool LLDriverParam::linkDrivenParams(visual_param_mapper mapper, bool only_cross_params)
|
||||||
{
|
{
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
for (LLDrivenEntryInfo& driven_info : getInfo()->mDrivenInfoList)
|
for (LLDrivenEntryInfo& driven_info : getInfo()->mDrivenInfoList)
|
||||||
{
|
{
|
||||||
S32 driven_id = driven_info.mDrivenID;
|
S32 driven_id = driven_info.mDrivenID;
|
||||||
|
|
||||||
// check for already existing links. Do not overwrite.
|
// check for already existing links. Do not overwrite.
|
||||||
BOOL found = FALSE;
|
bool found = false;
|
||||||
for (auto& driven : mDriven)
|
for (auto& driven : mDriven)
|
||||||
{
|
{
|
||||||
if (driven.mInfo->mDrivenID == driven_id)
|
if (driven.mInfo->mDrivenID == driven_id)
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -520,7 +520,7 @@ BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
success = FALSE;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public:
|
||||||
LLDriverParamInfo();
|
LLDriverParamInfo();
|
||||||
/*virtual*/ ~LLDriverParamInfo() {};
|
/*virtual*/ ~LLDriverParamInfo() {};
|
||||||
|
|
||||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||||
|
|
||||||
/*virtual*/ void toStream(std::ostream &out);
|
/*virtual*/ void toStream(std::ostream &out);
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ public:
|
||||||
// Special: These functions are overridden by child classes
|
// Special: These functions are overridden by child classes
|
||||||
LLDriverParamInfo* getInfo() const { return (LLDriverParamInfo*)mInfo; }
|
LLDriverParamInfo* getInfo() const { return (LLDriverParamInfo*)mInfo; }
|
||||||
// This sets mInfo and calls initialization functions
|
// This sets mInfo and calls initialization functions
|
||||||
BOOL setInfo(LLDriverParamInfo* info);
|
bool setInfo(LLDriverParamInfo* info);
|
||||||
|
|
||||||
LLAvatarAppearance* getAvatarAppearance() { return mAvatarAppearance; }
|
LLAvatarAppearance* getAvatarAppearance() { return mAvatarAppearance; }
|
||||||
const LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
const LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
||||||
|
|
@ -105,11 +105,11 @@ public:
|
||||||
///*virtual*/ void setWeight(F32 weight);
|
///*virtual*/ void setWeight(F32 weight);
|
||||||
///*virtual*/ void setAnimationTarget(F32 target_value);
|
///*virtual*/ void setAnimationTarget(F32 target_value);
|
||||||
///*virtual*/ void stopAnimating();
|
///*virtual*/ void stopAnimating();
|
||||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
/*virtual*/ void setWeight(F32 weight, bool upload_bake);
|
||||||
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
/*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake);
|
||||||
/*virtual*/ void stopAnimating(BOOL upload_bake);
|
/*virtual*/ void stopAnimating(bool upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
|
/*virtual*/ bool linkDrivenParams(visual_param_mapper mapper, bool only_cross_params);
|
||||||
/*virtual*/ void resetDrivenParams();
|
/*virtual*/ void resetDrivenParams();
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
|
|
@ -138,10 +138,10 @@ protected:
|
||||||
|
|
||||||
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
|
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
|
||||||
entry_list_t mDriven;
|
entry_list_t mDriven;
|
||||||
LLViewerVisualParam* mCurrentDistortionParam;
|
LLViewerVisualParam* mCurrentDistortionParam{ nullptr };
|
||||||
// Backlink only; don't make this an LLPointer.
|
// Backlink only; don't make this an LLPointer.
|
||||||
LLAvatarAppearance* mAvatarAppearance;
|
LLAvatarAppearance* mAvatarAppearance{ nullptr };
|
||||||
LLWearable* mWearablep;
|
LLWearable* mWearablep{ nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LL_LLDRIVERPARAM_H
|
#endif // LL_LLDRIVERPARAM_H
|
||||||
|
|
|
||||||
|
|
@ -36,14 +36,14 @@
|
||||||
|
|
||||||
|
|
||||||
LLLocalTextureObject::LLLocalTextureObject() :
|
LLLocalTextureObject::LLLocalTextureObject() :
|
||||||
mIsBakedReady(FALSE),
|
mIsBakedReady(false),
|
||||||
mDiscard(MAX_DISCARD_LEVEL+1)
|
mDiscard(MAX_DISCARD_LEVEL+1)
|
||||||
{
|
{
|
||||||
mImage = NULL;
|
mImage = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLLocalTextureObject::LLLocalTextureObject(LLGLTexture* image, const LLUUID& id) :
|
LLLocalTextureObject::LLLocalTextureObject(LLGLTexture* image, const LLUUID& id) :
|
||||||
mIsBakedReady(FALSE),
|
mIsBakedReady(false),
|
||||||
mDiscard(MAX_DISCARD_LEVEL+1)
|
mDiscard(MAX_DISCARD_LEVEL+1)
|
||||||
{
|
{
|
||||||
mImage = image;
|
mImage = image;
|
||||||
|
|
@ -109,7 +109,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name)
|
||||||
|
|
||||||
U32 LLLocalTextureObject::getNumTexLayers() const
|
U32 LLLocalTextureObject::getNumTexLayers() const
|
||||||
{
|
{
|
||||||
return mTexLayers.size();
|
return static_cast<U32>(mTexLayers.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
LLUUID LLLocalTextureObject::getID() const
|
LLUUID LLLocalTextureObject::getID() const
|
||||||
|
|
@ -122,7 +122,7 @@ S32 LLLocalTextureObject::getDiscard() const
|
||||||
return mDiscard;
|
return mDiscard;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLLocalTextureObject::getBakedReady() const
|
bool LLLocalTextureObject::getBakedReady() const
|
||||||
{
|
{
|
||||||
return mIsBakedReady;
|
return mIsBakedReady;
|
||||||
}
|
}
|
||||||
|
|
@ -132,11 +132,11 @@ void LLLocalTextureObject::setImage(LLGLTexture* new_image)
|
||||||
mImage = new_image;
|
mImage = new_image;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index)
|
bool LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index)
|
||||||
{
|
{
|
||||||
if (index >= getNumTexLayers() )
|
if (index >= getNumTexLayers() )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_tex_layer == NULL)
|
if (new_tex_layer == NULL)
|
||||||
|
|
@ -153,47 +153,47 @@ BOOL LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index)
|
||||||
}
|
}
|
||||||
mTexLayers[index] = layer;
|
mTexLayers[index] = layer;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLLocalTextureObject::addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable)
|
bool LLLocalTextureObject::addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable)
|
||||||
{
|
{
|
||||||
if (new_tex_layer == NULL)
|
if (new_tex_layer == NULL)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLTexLayer *layer = new LLTexLayer(*new_tex_layer, wearable);
|
LLTexLayer *layer = new LLTexLayer(*new_tex_layer, wearable);
|
||||||
layer->setLTO(this);
|
layer->setLTO(this);
|
||||||
mTexLayers.push_back(layer);
|
mTexLayers.push_back(layer);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLLocalTextureObject::addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable)
|
bool LLLocalTextureObject::addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable)
|
||||||
{
|
{
|
||||||
if (new_tex_layer == NULL)
|
if (new_tex_layer == NULL)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLTexLayer *layer = new LLTexLayer(*new_tex_layer, this, wearable);
|
LLTexLayer *layer = new LLTexLayer(*new_tex_layer, this, wearable);
|
||||||
layer->setLTO(this);
|
layer->setLTO(this);
|
||||||
mTexLayers.push_back(layer);
|
mTexLayers.push_back(layer);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLLocalTextureObject::removeTexLayer(U32 index)
|
bool LLLocalTextureObject::removeTexLayer(U32 index)
|
||||||
{
|
{
|
||||||
if (index >= getNumTexLayers())
|
if (index >= getNumTexLayers())
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
tex_layer_vec_t::iterator iter = mTexLayers.begin();
|
tex_layer_vec_t::iterator iter = mTexLayers.begin();
|
||||||
iter += index;
|
iter += index;
|
||||||
|
|
||||||
delete *iter;
|
delete *iter;
|
||||||
mTexLayers.erase(iter);
|
mTexLayers.erase(iter);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLLocalTextureObject::setID(LLUUID new_id)
|
void LLLocalTextureObject::setID(LLUUID new_id)
|
||||||
|
|
@ -206,7 +206,7 @@ void LLLocalTextureObject::setDiscard(S32 new_discard)
|
||||||
mDiscard = new_discard;
|
mDiscard = new_discard;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLLocalTextureObject::setBakedReady(BOOL ready)
|
void LLLocalTextureObject::setBakedReady(bool ready)
|
||||||
{
|
{
|
||||||
mIsBakedReady = ready;
|
mIsBakedReady = ready;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,17 +53,17 @@ public:
|
||||||
U32 getNumTexLayers() const;
|
U32 getNumTexLayers() const;
|
||||||
LLUUID getID() const;
|
LLUUID getID() const;
|
||||||
S32 getDiscard() const;
|
S32 getDiscard() const;
|
||||||
BOOL getBakedReady() const;
|
bool getBakedReady() const;
|
||||||
|
|
||||||
void setImage(LLGLTexture* new_image);
|
void setImage(LLGLTexture* new_image);
|
||||||
BOOL setTexLayer(LLTexLayer *new_tex_layer, U32 index);
|
bool setTexLayer(LLTexLayer *new_tex_layer, U32 index);
|
||||||
BOOL addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable);
|
bool addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable);
|
||||||
BOOL addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable);
|
bool addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable);
|
||||||
BOOL removeTexLayer(U32 index);
|
bool removeTexLayer(U32 index);
|
||||||
|
|
||||||
void setID(LLUUID new_id);
|
void setID(LLUUID new_id);
|
||||||
void setDiscard(S32 new_discard);
|
void setDiscard(S32 new_discard);
|
||||||
void setBakedReady(BOOL ready);
|
void setBakedReady(bool ready);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ private:
|
||||||
|
|
||||||
LLUUID mID;
|
LLUUID mID;
|
||||||
|
|
||||||
BOOL mIsBakedReady;
|
bool mIsBakedReady;
|
||||||
S32 mDiscard;
|
S32 mDiscard;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,8 @@ LLPolyMeshSharedData::LLPolyMeshSharedData()
|
||||||
mTexCoords = NULL;
|
mTexCoords = NULL;
|
||||||
mDetailTexCoords = NULL;
|
mDetailTexCoords = NULL;
|
||||||
mWeights = NULL;
|
mWeights = NULL;
|
||||||
mHasWeights = FALSE;
|
mHasWeights = false;
|
||||||
mHasDetailTexCoords = FALSE;
|
mHasDetailTexCoords = false;
|
||||||
|
|
||||||
mNumFaces = 0;
|
mNumFaces = 0;
|
||||||
mFaces = NULL;
|
mFaces = NULL;
|
||||||
|
|
@ -225,7 +225,7 @@ U32 LLPolyMeshSharedData::getNumKB()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLPolyMeshSharedData::allocateVertexData()
|
// LLPolyMeshSharedData::allocateVertexData()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
bool LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
||||||
{
|
{
|
||||||
U32 i;
|
U32 i;
|
||||||
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||||
|
|
@ -243,34 +243,34 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
||||||
mWeights[i] = 0.f;
|
mWeights[i] = 0.f;
|
||||||
}
|
}
|
||||||
mNumVertices = numVertices;
|
mNumVertices = numVertices;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLPolyMeshSharedData::allocateFaceData()
|
// LLPolyMeshSharedData::allocateFaceData()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPolyMeshSharedData::allocateFaceData( U32 numFaces )
|
bool LLPolyMeshSharedData::allocateFaceData( U32 numFaces )
|
||||||
{
|
{
|
||||||
mFaces = new LLPolyFace[ numFaces ];
|
mFaces = new LLPolyFace[ numFaces ];
|
||||||
mNumFaces = numFaces;
|
mNumFaces = numFaces;
|
||||||
mNumTriangleIndices = mNumFaces * 3;
|
mNumTriangleIndices = mNumFaces * 3;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLPolyMeshSharedData::allocateJointNames()
|
// LLPolyMeshSharedData::allocateJointNames()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPolyMeshSharedData::allocateJointNames( U32 numJointNames )
|
bool LLPolyMeshSharedData::allocateJointNames( U32 numJointNames )
|
||||||
{
|
{
|
||||||
mJointNames = new std::string[ numJointNames ];
|
mJointNames = new std::string[ numJointNames ];
|
||||||
mNumJointNames = numJointNames;
|
mNumJointNames = numJointNames;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// LLPolyMeshSharedData::loadMesh()
|
// LLPolyMeshSharedData::loadMesh()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
bool LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Open the file
|
// Open the file
|
||||||
|
|
@ -278,13 +278,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if(fileName.empty())
|
if(fileName.empty())
|
||||||
{
|
{
|
||||||
LL_ERRS() << "Filename is Empty!" << LL_ENDL;
|
LL_ERRS() << "Filename is Empty!" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
|
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't open: " << fileName << LL_ENDL;
|
LL_ERRS() << "can't open: " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
@ -299,7 +299,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Check for proper binary header
|
// Check for proper binary header
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
BOOL status = FALSE;
|
bool status = false;
|
||||||
if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
|
if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
|
||||||
{
|
{
|
||||||
LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
|
LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
|
||||||
|
|
@ -317,11 +317,11 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (!isLOD())
|
if (!isLOD())
|
||||||
{
|
{
|
||||||
mHasWeights = (hasWeights==0) ? FALSE : TRUE;
|
mHasWeights = hasWeights > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
@ -332,7 +332,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
@ -344,7 +344,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read Position from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read Position from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
setPosition( position );
|
setPosition( position );
|
||||||
|
|
||||||
|
|
@ -357,7 +357,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
U8 rotationOrder;
|
U8 rotationOrder;
|
||||||
|
|
@ -366,7 +366,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
rotationOrder = 0;
|
rotationOrder = 0;
|
||||||
|
|
@ -385,7 +385,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
setScale( scale );
|
setScale( scale );
|
||||||
|
|
||||||
|
|
@ -406,7 +406,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
allocateVertexData( numVertices );
|
allocateVertexData( numVertices );
|
||||||
|
|
@ -421,7 +421,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -435,7 +435,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL;
|
LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -449,7 +449,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL;
|
LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -461,7 +461,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != numVertices)
|
if (numRead != numVertices)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
@ -474,7 +474,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != numVertices)
|
if (numRead != numVertices)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -488,7 +488,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != numVertices)
|
if (numRead != numVertices)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -502,7 +502,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
allocateFaceData( numFaces );
|
allocateFaceData( numFaces );
|
||||||
|
|
||||||
|
|
@ -520,7 +520,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (mReferenceData)
|
if (mReferenceData)
|
||||||
{
|
{
|
||||||
|
|
@ -577,7 +577,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
allocateJointNames( numSkinJoints );
|
allocateJointNames( numSkinJoints );
|
||||||
}
|
}
|
||||||
|
|
@ -593,7 +593,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL;
|
LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string *jn = &mJointNames[i];
|
std::string *jn = &mJointNames[i];
|
||||||
|
|
@ -615,7 +615,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
std::string morph_name(morphName);
|
std::string morph_name(morphName);
|
||||||
LLPolyMorphData* morph_data = new LLPolyMorphData(morph_name);
|
LLPolyMorphData* morph_data = new LLPolyMorphData(morph_name);
|
||||||
|
|
||||||
BOOL result = morph_data->loadBinary(fp, this);
|
bool result = morph_data->loadBinary(fp, this);
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
|
|
@ -705,12 +705,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = TRUE;
|
status = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL;
|
LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL;
|
||||||
status = FALSE;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == mNumJointNames)
|
if (0 == mNumJointNames)
|
||||||
|
|
@ -983,7 +983,7 @@ void LLPolyMesh::initializeForMorph()
|
||||||
LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||||
LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
|
LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
|
||||||
|
|
||||||
for (U32 i = 0; i < mSharedData->mNumVertices; ++i)
|
for (S32 i = 0; i < mSharedData->mNumVertices; ++i)
|
||||||
{
|
{
|
||||||
mClothingWeights[i].clear();
|
mClothingWeights[i].clear();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,8 @@ private:
|
||||||
LLVector2 *mDetailTexCoords;
|
LLVector2 *mDetailTexCoords;
|
||||||
F32 *mWeights;
|
F32 *mWeights;
|
||||||
|
|
||||||
BOOL mHasWeights;
|
bool mHasWeights;
|
||||||
BOOL mHasDetailTexCoords;
|
bool mHasDetailTexCoords;
|
||||||
|
|
||||||
// face data
|
// face data
|
||||||
S32 mNumFaces;
|
S32 mNumFaces;
|
||||||
|
|
@ -119,17 +119,17 @@ private:
|
||||||
void setRotation( const LLQuaternion &rot ) { mRotation = rot; }
|
void setRotation( const LLQuaternion &rot ) { mRotation = rot; }
|
||||||
void setScale( const LLVector3 &scale ) { mScale = scale; }
|
void setScale( const LLVector3 &scale ) { mScale = scale; }
|
||||||
|
|
||||||
BOOL allocateVertexData( U32 numVertices );
|
bool allocateVertexData( U32 numVertices );
|
||||||
|
|
||||||
BOOL allocateFaceData( U32 numFaces );
|
bool allocateFaceData( U32 numFaces );
|
||||||
|
|
||||||
BOOL allocateJointNames( U32 numJointNames );
|
bool allocateJointNames( U32 numJointNames );
|
||||||
|
|
||||||
// Retrieve the number of KB of memory used by this instance
|
// Retrieve the number of KB of memory used by this instance
|
||||||
U32 getNumKB();
|
U32 getNumKB();
|
||||||
|
|
||||||
// Load mesh data from file
|
// Load mesh data from file
|
||||||
BOOL loadMesh( const std::string& fileName );
|
bool loadMesh( const std::string& fileName );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void genIndices(S32 offset);
|
void genIndices(S32 offset);
|
||||||
|
|
@ -138,7 +138,7 @@ public:
|
||||||
|
|
||||||
const S32 *getSharedVert(S32 vert);
|
const S32 *getSharedVert(S32 vert);
|
||||||
|
|
||||||
BOOL isLOD() { return (mReferenceData != NULL); }
|
bool isLOD() { return (mReferenceData != NULL); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -204,13 +204,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns whether or not the mesh has detail texture coords
|
// Returns whether or not the mesh has detail texture coords
|
||||||
BOOL hasDetailTexCoords() {
|
bool hasDetailTexCoords() {
|
||||||
llassert (mSharedData);
|
llassert (mSharedData);
|
||||||
return mSharedData->mHasDetailTexCoords;
|
return mSharedData->mHasDetailTexCoords;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns whether or not the mesh has vertex weights
|
// Returns whether or not the mesh has vertex weights
|
||||||
BOOL hasWeights() const{
|
bool hasWeights() const{
|
||||||
llassert (mSharedData);
|
llassert (mSharedData);
|
||||||
return mSharedData->mHasWeights;
|
return mSharedData->mHasWeights;
|
||||||
}
|
}
|
||||||
|
|
@ -316,7 +316,7 @@ public:
|
||||||
// Get indices
|
// Get indices
|
||||||
U32* getIndices() { return mSharedData ? mSharedData->mTriangleIndices : NULL; }
|
U32* getIndices() { return mSharedData ? mSharedData->mTriangleIndices : NULL; }
|
||||||
|
|
||||||
BOOL isLOD() { return mSharedData && mSharedData->isLOD(); }
|
bool isLOD() { return mSharedData && mSharedData->isLOD(); }
|
||||||
|
|
||||||
void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; }
|
void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; }
|
||||||
LLAvatarAppearance* getAvatar() { return mAvatarp; }
|
LLAvatarAppearance* getAvatar() { return mAvatarp; }
|
||||||
|
|
|
||||||
|
|
@ -104,17 +104,17 @@ LLPolyMorphData::~LLPolyMorphData()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// loadBinary()
|
// loadBinary()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
bool LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||||
{
|
{
|
||||||
S32 numVertices;
|
S32 numVertices;
|
||||||
S32 numRead;
|
size_t numRead;
|
||||||
|
|
||||||
numRead = fread(&numVertices, sizeof(S32), 1, fp);
|
numRead = fread(&numVertices, sizeof(S32), 1, fp);
|
||||||
llendianswizzle(&numVertices, sizeof(S32), 1);
|
llendianswizzle(&numVertices, sizeof(S32), 1);
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
|
LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
@ -151,14 +151,14 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||||
if (numRead != 1)
|
if (numRead != 1)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
|
LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mVertexIndices[v] > 10000)
|
if (mVertexIndices[v] > 10000)
|
||||||
{
|
{
|
||||||
// Bad install? These are usually .llm files from 'character' fodler
|
// Bad install? These are usually .llm files from 'character' fodler
|
||||||
LL_WARNS() << "Bad morph index " << v << ": " << mVertexIndices[v] << LL_ENDL;
|
LL_WARNS() << "Bad morph index " << v << ": " << mVertexIndices[v] << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -167,7 +167,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
|
LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 magnitude = mCoords[v].getLength3().getF32();
|
F32 magnitude = mCoords[v].getLength3().getF32();
|
||||||
|
|
@ -187,7 +187,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
|
LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
numRead = fread(&mBinormals[v], sizeof(F32), 3, fp);
|
numRead = fread(&mBinormals[v], sizeof(F32), 3, fp);
|
||||||
|
|
@ -195,7 +195,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||||
if (numRead != 3)
|
if (numRead != 3)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
|
LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||||
if (numRead != 2)
|
if (numRead != 2)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
|
LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mNumIndices++;
|
mNumIndices++;
|
||||||
|
|
@ -213,7 +213,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||||
mAvgDistortion.mul(1.f/(F32)mNumIndices);
|
mAvgDistortion.mul(1.f/(F32)mNumIndices);
|
||||||
mAvgDistortion.normalize3fast();
|
mAvgDistortion.normalize3fast();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -256,23 +256,23 @@ void LLPolyMorphData::freeData()
|
||||||
// LLPolyMorphTargetInfo()
|
// LLPolyMorphTargetInfo()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLPolyMorphTargetInfo::LLPolyMorphTargetInfo()
|
LLPolyMorphTargetInfo::LLPolyMorphTargetInfo()
|
||||||
: mIsClothingMorph(FALSE)
|
: mIsClothingMorph(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
bool LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
llassert( node->hasName( "param" ) && node->getChildByName( "param_morph" ) );
|
llassert( node->hasName( "param" ) && node->getChildByName( "param_morph" ) );
|
||||||
|
|
||||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// Get mixed-case name
|
// Get mixed-case name
|
||||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||||
if( !node->getFastAttributeString( name_string, mMorphName ) )
|
if( !node->getFastAttributeString( name_string, mMorphName ) )
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
||||||
return FALSE; // Continue, ignoring this tag
|
return false; // Continue, ignoring this tag
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle clothing_morph_string = LLXmlTree::addAttributeString("clothing_morph");
|
static LLStdStringHandle clothing_morph_string = LLXmlTree::addAttributeString("clothing_morph");
|
||||||
|
|
@ -284,7 +284,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
|
LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
|
||||||
<< LL_ENDL;
|
<< LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (LLXmlTreeNode* child_node = paramNode->getFirstChild();
|
for (LLXmlTreeNode* child_node = paramNode->getFirstChild();
|
||||||
|
|
@ -310,7 +310,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -353,16 +353,16 @@ LLPolyMorphTarget::~LLPolyMorphTarget()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// setInfo()
|
// setInfo()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
bool LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||||
{
|
{
|
||||||
llassert(mInfo == NULL);
|
llassert(mInfo == NULL);
|
||||||
if (info->mID < 0)
|
if (info->mID < 0)
|
||||||
return FALSE;
|
return false;
|
||||||
mInfo = info;
|
mInfo = info;
|
||||||
mID = info->mID;
|
mID = info->mID;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setWeight(getDefaultWeight());
|
//setWeight(getDefaultWeight());
|
||||||
setWeight(getDefaultWeight(), FALSE);
|
setWeight(getDefaultWeight(), false);
|
||||||
|
|
||||||
LLAvatarAppearance* avatarp = mMesh->getAvatar();
|
LLAvatarAppearance* avatarp = mMesh->getAvatar();
|
||||||
for (LLPolyVolumeMorphInfo& volume_info : getInfo()->mVolumeInfoList)
|
for (LLPolyVolumeMorphInfo& volume_info : getInfo()->mVolumeInfoList)
|
||||||
|
|
@ -386,8 +386,8 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||||
if (!mMorphData)
|
if (!mMorphData)
|
||||||
{
|
{
|
||||||
const std::string driven_tag = "_Driven";
|
const std::string driven_tag = "_Driven";
|
||||||
U32 pos = morph_param_name.find(driven_tag);
|
auto pos = morph_param_name.find(driven_tag);
|
||||||
if (pos > 0)
|
if (pos != std::string::npos && pos > 0)
|
||||||
{
|
{
|
||||||
morph_param_name = morph_param_name.substr(0,pos);
|
morph_param_name = morph_param_name.substr(0,pos);
|
||||||
mMorphData = mMesh->getMorphData(morph_param_name);
|
mMorphData = mMesh->getMorphData(morph_param_name);
|
||||||
|
|
@ -396,9 +396,9 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||||
if (!mMorphData)
|
if (!mMorphData)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
|
LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
|
||||||
return FALSE; // Continue, ignoring this tag
|
return false; // Continue, ignoring this tag
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const
|
/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const
|
||||||
|
|
@ -410,7 +410,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseData()
|
// parseData()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
|
bool LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
LLPolyMorphTargetInfo* info = new LLPolyMorphTargetInfo;
|
LLPolyMorphTargetInfo* info = new LLPolyMorphTargetInfo;
|
||||||
|
|
||||||
|
|
@ -418,9 +418,9 @@ BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
|
||||||
if (!setInfo(info))
|
if (!setInfo(info))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -661,7 +661,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// applyMask()
|
// applyMask()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert)
|
void LLPolyMorphTarget::applyMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert)
|
||||||
{
|
{
|
||||||
LLVector4a *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
|
LLVector4a *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
|
||||||
|
|
||||||
|
|
@ -751,7 +751,7 @@ void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight)
|
||||||
LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
|
LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
|
||||||
: mWeights(new F32[morph_data->mNumIndices]),
|
: mWeights(new F32[morph_data->mNumIndices]),
|
||||||
mMorphData(morph_data),
|
mMorphData(morph_data),
|
||||||
mWeightsGenerated(FALSE)
|
mWeightsGenerated(false)
|
||||||
{
|
{
|
||||||
llassert(mMorphData != NULL);
|
llassert(mMorphData != NULL);
|
||||||
llassert(mMorphData->mNumIndices > 0);
|
llassert(mMorphData->mNumIndices > 0);
|
||||||
|
|
@ -782,10 +782,10 @@ LLPolyVertexMask::~LLPolyVertexMask()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// generateMask()
|
// generateMask()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights)
|
void LLPolyVertexMask::generateMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert, LLVector4a *clothing_weights)
|
||||||
{
|
{
|
||||||
// RN debug output that uses Image Debugger (http://www.cs.unc.edu/~baxter/projects/imdebug/)
|
// RN debug output that uses Image Debugger (http://www.cs.unc.edu/~baxter/projects/imdebug/)
|
||||||
// BOOL debugImg = FALSE;
|
// bool debugImg = false;
|
||||||
// if (debugImg)
|
// if (debugImg)
|
||||||
// {
|
// {
|
||||||
// if (invert)
|
// if (invert)
|
||||||
|
|
@ -829,7 +829,7 @@ void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height,
|
||||||
clothing_weights[vertIndex].getF32ptr()[VW] = mWeights[index];
|
clothing_weights[vertIndex].getF32ptr()[VW] = mWeights[index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mWeightsGenerated = TRUE;
|
mWeightsGenerated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public:
|
||||||
~LLPolyMorphData();
|
~LLPolyMorphData();
|
||||||
LLPolyMorphData(const LLPolyMorphData &rhs);
|
LLPolyMorphData(const LLPolyMorphData &rhs);
|
||||||
|
|
||||||
BOOL loadBinary(LLFILE* fp, LLPolyMeshSharedData *mesh);
|
bool loadBinary(LLFILE* fp, LLPolyMeshSharedData *mesh);
|
||||||
const std::string& getName() { return mName; }
|
const std::string& getName() { return mName; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -84,14 +84,14 @@ public:
|
||||||
LLPolyVertexMask(const LLPolyVertexMask& pOther);
|
LLPolyVertexMask(const LLPolyVertexMask& pOther);
|
||||||
~LLPolyVertexMask();
|
~LLPolyVertexMask();
|
||||||
|
|
||||||
void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights);
|
void generateMask(const U8 *maskData, S32 width, S32 height, S32 num_components, bool invert, LLVector4a *clothing_weights);
|
||||||
F32* getMorphMaskWeights();
|
F32* getMorphMaskWeights();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
F32* mWeights;
|
F32* mWeights;
|
||||||
LLPolyMorphData *mMorphData;
|
LLPolyMorphData *mMorphData;
|
||||||
BOOL mWeightsGenerated;
|
bool mWeightsGenerated;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -129,11 +129,11 @@ public:
|
||||||
LLPolyMorphTargetInfo();
|
LLPolyMorphTargetInfo();
|
||||||
/*virtual*/ ~LLPolyMorphTargetInfo() {};
|
/*virtual*/ ~LLPolyMorphTargetInfo() {};
|
||||||
|
|
||||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string mMorphName;
|
std::string mMorphName;
|
||||||
BOOL mIsClothingMorph;
|
bool mIsClothingMorph;
|
||||||
typedef std::vector<LLPolyVolumeMorphInfo> volume_info_list_t;
|
typedef std::vector<LLPolyVolumeMorphInfo> volume_info_list_t;
|
||||||
volume_info_list_t mVolumeInfoList;
|
volume_info_list_t mVolumeInfoList;
|
||||||
};
|
};
|
||||||
|
|
@ -154,12 +154,12 @@ public:
|
||||||
// Special: These functions are overridden by child classes
|
// Special: These functions are overridden by child classes
|
||||||
LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; }
|
LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; }
|
||||||
// This sets mInfo and calls initialization functions
|
// This sets mInfo and calls initialization functions
|
||||||
BOOL setInfo(LLPolyMorphTargetInfo *info);
|
bool setInfo(LLPolyMorphTargetInfo *info);
|
||||||
|
|
||||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
|
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
|
||||||
|
|
||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||||
/*virtual*/ void apply( ESex sex );
|
/*virtual*/ void apply( ESex sex );
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
|
|
@ -170,7 +170,7 @@ public:
|
||||||
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||||
|
|
||||||
void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
|
void applyMask(const U8 *maskData, S32 width, S32 height, S32 num_components, bool invert);
|
||||||
void addPendingMorphMask() { mNumMorphMasksPending++; }
|
void addPendingMorphMask() { mNumMorphMasksPending++; }
|
||||||
|
|
||||||
void applyVolumeChanges(F32 delta_weight); // SL-315 - for resetSkeleton()
|
void applyVolumeChanges(F32 delta_weight); // SL-315 - for resetSkeleton()
|
||||||
|
|
@ -183,7 +183,7 @@ protected:
|
||||||
LLPolyVertexMask * mVertMask;
|
LLPolyVertexMask * mVertMask;
|
||||||
ESex mLastSex;
|
ESex mLastSex;
|
||||||
// number of morph masks that haven't been generated, must be 0 before this morph is applied
|
// number of morph masks that haven't been generated, must be 0 before this morph is applied
|
||||||
BOOL mNumMorphMasksPending;
|
S32 mNumMorphMasksPending;
|
||||||
|
|
||||||
typedef std::vector<LLPolyVolumeMorph> volume_list_t;
|
typedef std::vector<LLPolyVolumeMorph> volume_list_t;
|
||||||
volume_list_t mVolumeMorphs;
|
volume_list_t mVolumeMorphs;
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ LLPolySkeletalDistortionInfo::LLPolySkeletalDistortionInfo()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
bool LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
llassert( node->hasName( "param" ) && node->getChildByName( "param_skeleton" ) );
|
llassert( node->hasName( "param" ) && node->getChildByName( "param_skeleton" ) );
|
||||||
|
|
||||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton");
|
LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton");
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")"
|
LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")"
|
||||||
<< LL_ENDL;
|
<< LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( LLXmlTreeNode* bone = skeletalParam->getFirstChild(); bone; bone = skeletalParam->getNextChild() )
|
for( LLXmlTreeNode* bone = skeletalParam->getFirstChild(); bone; bone = skeletalParam->getNextChild() )
|
||||||
|
|
@ -68,7 +68,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||||
std::string name;
|
std::string name;
|
||||||
LLVector3 scale;
|
LLVector3 scale;
|
||||||
LLVector3 pos;
|
LLVector3 pos;
|
||||||
BOOL haspos = FALSE;
|
bool haspos = false;
|
||||||
|
|
||||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||||
if (!bone->getFastAttributeString(name_string, name))
|
if (!bone->getFastAttributeString(name_string, name))
|
||||||
|
|
@ -88,7 +88,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||||
static LLStdStringHandle offset_string = LLXmlTree::addAttributeString("offset");
|
static LLStdStringHandle offset_string = LLXmlTree::addAttributeString("offset");
|
||||||
if (bone->getFastAttributeVector3(offset_string, pos))
|
if (bone->getFastAttributeVector3(offset_string, pos))
|
||||||
{
|
{
|
||||||
haspos = TRUE;
|
haspos = true;
|
||||||
}
|
}
|
||||||
mBoneInfoList.push_back(LLPolySkeletalBoneInfo(name, scale, pos, haspos));
|
mBoneInfoList.push_back(LLPolySkeletalBoneInfo(name, scale, pos, haspos));
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +98,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -133,17 +133,17 @@ LLPolySkeletalDistortion::~LLPolySkeletalDistortion()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
bool LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||||
{
|
{
|
||||||
if (info->mID < 0)
|
if (info->mID < 0)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mInfo = info;
|
mInfo = info;
|
||||||
mID = info->mID;
|
mID = info->mID;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setWeight(getDefaultWeight());
|
//setWeight(getDefaultWeight());
|
||||||
setWeight(getDefaultWeight(), FALSE);
|
setWeight(getDefaultWeight(), false);
|
||||||
|
|
||||||
for (LLPolySkeletalBoneInfo& bone_info : getInfo()->mBoneInfoList)
|
for (LLPolySkeletalBoneInfo& bone_info : getInfo()->mBoneInfoList)
|
||||||
{
|
{
|
||||||
|
|
@ -153,7 +153,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||||
// There's no point continuing after this error - means
|
// There's no point continuing after this error - means
|
||||||
// that either the skeleton or lad file is broken.
|
// that either the skeleton or lad file is broken.
|
||||||
LL_WARNS() << "Joint " << bone_info.mBoneName << " not found." << LL_ENDL;
|
LL_WARNS() << "Joint " << bone_info.mBoneName << " not found." << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// store it
|
// store it
|
||||||
|
|
@ -176,7 +176,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||||
mJointOffsets[joint] = bone_info.mPositionDeformation;
|
mJointOffsets[joint] = bone_info.mPositionDeformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
|
/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class LLAvatarAppearance;
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
struct LLPolySkeletalBoneInfo
|
struct LLPolySkeletalBoneInfo
|
||||||
{
|
{
|
||||||
LLPolySkeletalBoneInfo(std::string &name, LLVector3 &scale, LLVector3 &pos, BOOL haspos)
|
LLPolySkeletalBoneInfo(std::string &name, LLVector3 &scale, LLVector3 &pos, bool haspos)
|
||||||
: mBoneName(name),
|
: mBoneName(name),
|
||||||
mScaleDeformation(scale),
|
mScaleDeformation(scale),
|
||||||
mPositionDeformation(pos),
|
mPositionDeformation(pos),
|
||||||
|
|
@ -59,7 +59,7 @@ struct LLPolySkeletalBoneInfo
|
||||||
std::string mBoneName;
|
std::string mBoneName;
|
||||||
LLVector3 mScaleDeformation;
|
LLVector3 mScaleDeformation;
|
||||||
LLVector3 mPositionDeformation;
|
LLVector3 mPositionDeformation;
|
||||||
BOOL mHasPositionDeformation;
|
bool mHasPositionDeformation;
|
||||||
};
|
};
|
||||||
|
|
||||||
class alignas(16) LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
|
class alignas(16) LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
|
||||||
|
|
@ -71,7 +71,7 @@ public:
|
||||||
LLPolySkeletalDistortionInfo();
|
LLPolySkeletalDistortionInfo();
|
||||||
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
||||||
|
|
||||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
||||||
|
|
@ -92,12 +92,12 @@ public:
|
||||||
// Special: These functions are overridden by child classes
|
// Special: These functions are overridden by child classes
|
||||||
LLPolySkeletalDistortionInfo* getInfo() const { return (LLPolySkeletalDistortionInfo*)mInfo; }
|
LLPolySkeletalDistortionInfo* getInfo() const { return (LLPolySkeletalDistortionInfo*)mInfo; }
|
||||||
// This sets mInfo and calls initialization functions
|
// This sets mInfo and calls initialization functions
|
||||||
BOOL setInfo(LLPolySkeletalDistortionInfo *info);
|
bool setInfo(LLPolySkeletalDistortionInfo *info);
|
||||||
|
|
||||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
|
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
|
||||||
|
|
||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||||
/*virtual*/ void apply( ESex sex );
|
/*virtual*/ void apply( ESex sex );
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ LLTexGlobalColor::~LLTexGlobalColor()
|
||||||
//std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer());
|
//std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer());
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info)
|
bool LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info)
|
||||||
{
|
{
|
||||||
llassert(mInfo == NULL);
|
llassert(mInfo == NULL);
|
||||||
mInfo = info;
|
mInfo = info;
|
||||||
|
|
@ -58,15 +58,15 @@ BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info)
|
||||||
for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList)
|
for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList)
|
||||||
{
|
{
|
||||||
LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this);
|
LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this);
|
||||||
if (!param_color->setInfo(color_info, TRUE))
|
if (!param_color->setInfo(color_info, true))
|
||||||
{
|
{
|
||||||
mInfo = NULL;
|
mInfo = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mParamGlobalColorList.push_back(param_color);
|
mParamGlobalColorList.push_back(param_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLColor4 LLTexGlobalColor::getColor() const
|
LLColor4 LLTexGlobalColor::getColor() const
|
||||||
|
|
@ -140,14 +140,14 @@ LLTexGlobalColorInfo::~LLTexGlobalColorInfo()
|
||||||
mParamColorInfoList.clear();
|
mParamColorInfoList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
bool LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
// name attribute
|
// name attribute
|
||||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||||
if (!node->getFastAttributeString(name_string, mName))
|
if (!node->getFastAttributeString(name_string, mName))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "<global_color> element is missing name attribute." << LL_ENDL;
|
LL_WARNS() << "<global_color> element is missing name attribute." << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
// <param> sub-element
|
// <param> sub-element
|
||||||
for (LLXmlTreeNode* child = node->getChildByName("param");
|
for (LLXmlTreeNode* child = node->getChildByName("param");
|
||||||
|
|
@ -161,10 +161,10 @@ BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if (!info->parseXml(child))
|
if (!info->parseXml(child))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mParamColorInfoList.push_back(info);
|
mParamColorInfoList.push_back(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public:
|
||||||
|
|
||||||
LLTexGlobalColorInfo* getInfo() const { return mInfo; }
|
LLTexGlobalColorInfo* getInfo() const { return mInfo; }
|
||||||
// This sets mInfo and calls initialization functions
|
// This sets mInfo and calls initialization functions
|
||||||
BOOL setInfo(LLTexGlobalColorInfo *info);
|
bool setInfo(LLTexGlobalColorInfo *info);
|
||||||
|
|
||||||
LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
||||||
LLColor4 getColor() const;
|
LLColor4 getColor() const;
|
||||||
|
|
@ -62,7 +62,7 @@ public:
|
||||||
LLTexGlobalColorInfo();
|
LLTexGlobalColorInfo();
|
||||||
~LLTexGlobalColorInfo();
|
~LLTexGlobalColorInfo();
|
||||||
|
|
||||||
BOOL parseXml(LLXmlTreeNode* node);
|
bool parseXml(LLXmlTreeNode* node);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
param_color_info_list_t mParamColorInfoList;
|
param_color_info_list_t mParamColorInfoList;
|
||||||
|
|
|
||||||
|
|
@ -59,17 +59,17 @@ public:
|
||||||
LLTexLayerInfo();
|
LLTexLayerInfo();
|
||||||
~LLTexLayerInfo();
|
~LLTexLayerInfo();
|
||||||
|
|
||||||
BOOL parseXml(LLXmlTreeNode* node);
|
bool parseXml(LLXmlTreeNode* node);
|
||||||
BOOL createVisualParams(LLAvatarAppearance *appearance);
|
bool createVisualParams(LLAvatarAppearance *appearance);
|
||||||
BOOL isUserSettable() { return mLocalTexture != -1; }
|
bool isUserSettable() { return mLocalTexture != -1; }
|
||||||
S32 getLocalTexture() const { return mLocalTexture; }
|
S32 getLocalTexture() const { return mLocalTexture; }
|
||||||
BOOL getOnlyAlpha() const { return mUseLocalTextureAlphaOnly; }
|
bool getOnlyAlpha() const { return mUseLocalTextureAlphaOnly; }
|
||||||
std::string getName() const { return mName; }
|
std::string getName() const { return mName; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mName;
|
std::string mName;
|
||||||
|
|
||||||
BOOL mWriteAllChannels; // Don't use masking. Just write RGBA into buffer,
|
bool mWriteAllChannels; // Don't use masking. Just write RGBA into buffer,
|
||||||
LLTexLayerInterface::ERenderPass mRenderPass;
|
LLTexLayerInterface::ERenderPass mRenderPass;
|
||||||
|
|
||||||
std::string mGlobalColor;
|
std::string mGlobalColor;
|
||||||
|
|
@ -77,11 +77,11 @@ private:
|
||||||
|
|
||||||
S32 mLocalTexture;
|
S32 mLocalTexture;
|
||||||
std::string mStaticImageFileName;
|
std::string mStaticImageFileName;
|
||||||
BOOL mStaticImageIsMask;
|
bool mStaticImageIsMask;
|
||||||
BOOL mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask
|
bool mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask
|
||||||
BOOL mIsVisibilityMask;
|
bool mIsVisibilityMask;
|
||||||
|
|
||||||
typedef std::vector< std::pair< std::string,BOOL > > morph_name_list_t;
|
typedef std::vector< std::pair< std::string,bool > > morph_name_list_t;
|
||||||
morph_name_list_t mMorphNameList;
|
morph_name_list_t mMorphNameList;
|
||||||
param_color_info_list_t mParamColorInfoList;
|
param_color_info_list_t mParamColorInfoList;
|
||||||
param_alpha_info_list_t mParamAlphaInfoList;
|
param_alpha_info_list_t mParamAlphaInfoList;
|
||||||
|
|
@ -130,17 +130,17 @@ void LLTexLayerSetBuffer::preRenderTexLayerSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
void LLTexLayerSetBuffer::postRenderTexLayerSet(BOOL success)
|
void LLTexLayerSetBuffer::postRenderTexLayerSet(bool success)
|
||||||
{
|
{
|
||||||
popProjection();
|
popProjection();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target)
|
bool LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target)
|
||||||
{
|
{
|
||||||
// Default color mask for tex layer render
|
// Default color mask for tex layer render
|
||||||
gGL.setColorMask(true, true);
|
gGL.setColorMask(true, true);
|
||||||
|
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
|
|
||||||
gAlphaMaskProgram.bind();
|
gAlphaMaskProgram.bind();
|
||||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||||
|
|
@ -182,7 +182,7 @@ LLTexLayerSetInfo::LLTexLayerSetInfo() :
|
||||||
mWidth( 1024 ),
|
mWidth( 1024 ),
|
||||||
mHeight( 1024 ),
|
mHeight( 1024 ),
|
||||||
// </FS:Beq>
|
// </FS:Beq>
|
||||||
mClearAlpha( TRUE )
|
mClearAlpha( true )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,12 +192,12 @@ LLTexLayerSetInfo::~LLTexLayerSetInfo( )
|
||||||
mLayerInfoList.clear();
|
mLayerInfoList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
bool LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
llassert( node->hasName( "layer_set" ) );
|
llassert( node->hasName( "layer_set" ) );
|
||||||
if( !node->hasName( "layer_set" ) )
|
if( !node->hasName( "layer_set" ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// body_region
|
// body_region
|
||||||
|
|
@ -205,20 +205,20 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if( !node->getFastAttributeString( body_region_string, mBodyRegion ) )
|
if( !node->getFastAttributeString( body_region_string, mBodyRegion ) )
|
||||||
{
|
{
|
||||||
LL_WARNS() << "<layer_set> is missing body_region attribute" << LL_ENDL;
|
LL_WARNS() << "<layer_set> is missing body_region attribute" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// width, height
|
// width, height
|
||||||
static LLStdStringHandle width_string = LLXmlTree::addAttributeString("width");
|
static LLStdStringHandle width_string = LLXmlTree::addAttributeString("width");
|
||||||
if( !node->getFastAttributeS32( width_string, mWidth ) )
|
if( !node->getFastAttributeS32( width_string, mWidth ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle height_string = LLXmlTree::addAttributeString("height");
|
static LLStdStringHandle height_string = LLXmlTree::addAttributeString("height");
|
||||||
if( !node->getFastAttributeS32( height_string, mHeight ) )
|
if( !node->getFastAttributeS32( height_string, mHeight ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optional alpha component to apply after all compositing is complete.
|
// Optional alpha component to apply after all compositing is complete.
|
||||||
|
|
@ -237,11 +237,11 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if( !info->parseXml( child ))
|
if( !info->parseXml( child ))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mLayerInfoList.push_back( info );
|
mLayerInfoList.push_back( info );
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// creates visual params without generating layersets or layers
|
// creates visual params without generating layersets or layers
|
||||||
|
|
@ -259,11 +259,11 @@ void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||||
// An ordered set of texture layers that get composited into a single texture.
|
// An ordered set of texture layers that get composited into a single texture.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL LLTexLayerSet::sHasCaches = FALSE;
|
bool LLTexLayerSet::sHasCaches = false;
|
||||||
|
|
||||||
LLTexLayerSet::LLTexLayerSet(LLAvatarAppearance* const appearance) :
|
LLTexLayerSet::LLTexLayerSet(LLAvatarAppearance* const appearance) :
|
||||||
mAvatarAppearance( appearance ),
|
mAvatarAppearance( appearance ),
|
||||||
mIsVisible( TRUE ),
|
mIsVisible( true ),
|
||||||
mBakedTexIndex(LLAvatarAppearanceDefines::BAKED_HEAD),
|
mBakedTexIndex(LLAvatarAppearanceDefines::BAKED_HEAD),
|
||||||
mInfo( NULL )
|
mInfo( NULL )
|
||||||
{
|
{
|
||||||
|
|
@ -284,7 +284,7 @@ LLTexLayerSet::~LLTexLayerSet()
|
||||||
// setInfo
|
// setInfo
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
bool LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
||||||
{
|
{
|
||||||
llassert(mInfo == NULL);
|
llassert(mInfo == NULL);
|
||||||
mInfo = info;
|
mInfo = info;
|
||||||
|
|
@ -306,7 +306,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
||||||
if (!layer->setInfo(layer_info, NULL))
|
if (!layer->setInfo(layer_info, NULL))
|
||||||
{
|
{
|
||||||
mInfo = NULL;
|
mInfo = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (!layer->isVisibilityMask())
|
if (!layer->isVisibilityMask())
|
||||||
{
|
{
|
||||||
|
|
@ -322,7 +322,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
||||||
|
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // obsolete
|
#if 0 // obsolete
|
||||||
|
|
@ -330,21 +330,21 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
||||||
// parseData
|
// parseData
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node)
|
bool LLTexLayerSet::parseData(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
LLTexLayerSetInfo *info = new LLTexLayerSetInfo;
|
LLTexLayerSetInfo *info = new LLTexLayerSetInfo;
|
||||||
|
|
||||||
if (!info->parseXml(node))
|
if (!info->parseXml(node))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (!setInfo(info))
|
if (!setInfo(info))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -361,10 +361,10 @@ void LLTexLayerSet::deleteCaches()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target )
|
bool LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target )
|
||||||
{
|
{
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
mIsVisible = TRUE;
|
mIsVisible = true;
|
||||||
|
|
||||||
if (mMaskLayerList.size() > 0)
|
if (mMaskLayerList.size() > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -372,7 +372,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
||||||
{
|
{
|
||||||
if (layer->isInvisibleAlphaMask())
|
if (layer->isInvisibleAlphaMask())
|
||||||
{
|
{
|
||||||
mIsVisible = FALSE;
|
mIsVisible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -432,7 +432,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLTexLayerSet::isBodyRegion(const std::string& region) const
|
bool LLTexLayerSet::isBodyRegion(const std::string& region) const
|
||||||
{
|
{
|
||||||
return mInfo->mBodyRegion == region;
|
return mInfo->mBodyRegion == region;
|
||||||
}
|
}
|
||||||
|
|
@ -491,7 +491,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
||||||
{
|
{
|
||||||
gGL.flush();
|
gGL.flush();
|
||||||
{
|
{
|
||||||
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, TRUE);
|
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, true);
|
||||||
if( tex )
|
if( tex )
|
||||||
{
|
{
|
||||||
LLGLSUIDefault gls_ui;
|
LLGLSUIDefault gls_ui;
|
||||||
|
|
@ -535,21 +535,21 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
||||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components)
|
void LLTexLayerSet::applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components)
|
||||||
{
|
{
|
||||||
mAvatarAppearance->applyMorphMask(tex_data, width, height, num_components, mBakedTexIndex);
|
mAvatarAppearance->applyMorphMask(tex_data, width, height, num_components, mBakedTexIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerSet::isMorphValid() const
|
bool LLTexLayerSet::isMorphValid() const
|
||||||
{
|
{
|
||||||
for(const LLTexLayerInterface* layer : mLayerList)
|
for(const LLTexLayerInterface* layer : mLayerList)
|
||||||
{
|
{
|
||||||
if (layer && !layer->isMorphValid())
|
if (layer && !layer->isMorphValid())
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLTexLayerSet::invalidateMorphMasks()
|
void LLTexLayerSet::invalidateMorphMasks()
|
||||||
|
|
@ -568,13 +568,13 @@ void LLTexLayerSet::invalidateMorphMasks()
|
||||||
// LLTexLayerInfo
|
// LLTexLayerInfo
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLTexLayerInfo::LLTexLayerInfo() :
|
LLTexLayerInfo::LLTexLayerInfo() :
|
||||||
mWriteAllChannels( FALSE ),
|
mWriteAllChannels( false ),
|
||||||
mRenderPass(LLTexLayer::RP_COLOR),
|
mRenderPass(LLTexLayer::RP_COLOR),
|
||||||
mFixedColor( 0.f, 0.f, 0.f, 0.f ),
|
mFixedColor( 0.f, 0.f, 0.f, 0.f ),
|
||||||
mLocalTexture( -1 ),
|
mLocalTexture( -1 ),
|
||||||
mStaticImageIsMask( FALSE ),
|
mStaticImageIsMask( false ),
|
||||||
mUseLocalTextureAlphaOnly(FALSE),
|
mUseLocalTextureAlphaOnly(false),
|
||||||
mIsVisibilityMask(FALSE)
|
mIsVisibilityMask(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -586,7 +586,7 @@ LLTexLayerInfo::~LLTexLayerInfo( )
|
||||||
mParamAlphaInfoList.clear();
|
mParamAlphaInfoList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
bool LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
llassert( node->hasName( "layer" ) );
|
llassert( node->hasName( "layer" ) );
|
||||||
|
|
||||||
|
|
@ -594,7 +594,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||||
if( !node->getFastAttributeString( name_string, mName ) )
|
if( !node->getFastAttributeString( name_string, mName ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle write_all_channels_string = LLXmlTree::addAttributeString("write_all_channels");
|
static LLStdStringHandle write_all_channels_string = LLXmlTree::addAttributeString("write_all_channels");
|
||||||
|
|
@ -616,7 +616,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||||
node->getFastAttributeString( global_color_string, mGlobalColor );
|
node->getFastAttributeString( global_color_string, mGlobalColor );
|
||||||
|
|
||||||
// Visibility mask (optional)
|
// Visibility mask (optional)
|
||||||
BOOL is_visibility;
|
bool is_visibility;
|
||||||
static LLStdStringHandle visibility_mask_string = LLXmlTree::addAttributeString("visibility_mask");
|
static LLStdStringHandle visibility_mask_string = LLXmlTree::addAttributeString("visibility_mask");
|
||||||
if (node->getFastAttributeBOOL(visibility_mask_string, is_visibility))
|
if (node->getFastAttributeBOOL(visibility_mask_string, is_visibility))
|
||||||
{
|
{
|
||||||
|
|
@ -664,13 +664,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if (mLocalTexture == TEX_NUM_INDICES)
|
if (mLocalTexture == TEX_NUM_INDICES)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL;
|
LL_WARNS() << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS() << "<texture> element is missing a required attribute. " << mName << LL_ENDL;
|
LL_WARNS() << "<texture> element is missing a required attribute. " << mName << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -682,10 +682,10 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||||
static LLStdStringHandle morph_name_string = LLXmlTree::addAttributeString("morph_name");
|
static LLStdStringHandle morph_name_string = LLXmlTree::addAttributeString("morph_name");
|
||||||
if (maskNode->getFastAttributeString(morph_name_string, morph_name))
|
if (maskNode->getFastAttributeString(morph_name_string, morph_name))
|
||||||
{
|
{
|
||||||
BOOL invert = FALSE;
|
bool invert = false;
|
||||||
static LLStdStringHandle invert_string = LLXmlTree::addAttributeString("invert");
|
static LLStdStringHandle invert_string = LLXmlTree::addAttributeString("invert");
|
||||||
maskNode->getFastAttributeBOOL(invert_string, invert);
|
maskNode->getFastAttributeBOOL(invert_string, invert);
|
||||||
mMorphNameList.push_back(std::pair<std::string,BOOL>(morph_name,invert));
|
mMorphNameList.push_back(std::pair<std::string,bool>(morph_name,invert));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -701,7 +701,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if (!info->parseXml(child))
|
if (!info->parseXml(child))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mParamColorInfoList.push_back(info);
|
mParamColorInfoList.push_back(info);
|
||||||
}
|
}
|
||||||
|
|
@ -712,37 +712,37 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||||
if (!info->parseXml(child))
|
if (!info->parseXml(child))
|
||||||
{
|
{
|
||||||
delete info;
|
delete info;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
mParamAlphaInfoList.push_back(info);
|
mParamAlphaInfoList.push_back(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
bool LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||||
{
|
{
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
for (LLTexLayerParamColorInfo* color_info : mParamColorInfoList)
|
for (LLTexLayerParamColorInfo* color_info : mParamColorInfoList)
|
||||||
{
|
{
|
||||||
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
|
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
|
||||||
if (!param_color->setInfo(color_info, TRUE))
|
if (!param_color->setInfo(color_info, true))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL;
|
LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||||
delete param_color;
|
delete param_color;
|
||||||
success = FALSE;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (LLTexLayerParamAlphaInfo* alpha_info : mParamAlphaInfoList)
|
for (LLTexLayerParamAlphaInfo* alpha_info : mParamAlphaInfoList)
|
||||||
{
|
{
|
||||||
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
|
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
|
||||||
if (!param_alpha->setInfo(alpha_info, TRUE))
|
if (!param_alpha->setInfo(alpha_info, true))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL;
|
LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||||
delete param_alpha;
|
delete param_alpha;
|
||||||
success = FALSE;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -751,9 +751,9 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||||
|
|
||||||
LLTexLayerInterface::LLTexLayerInterface(LLTexLayerSet* const layer_set):
|
LLTexLayerInterface::LLTexLayerInterface(LLTexLayerSet* const layer_set):
|
||||||
mTexLayerSet( layer_set ),
|
mTexLayerSet( layer_set ),
|
||||||
mMorphMasksValid( FALSE ),
|
mMorphMasksValid( false ),
|
||||||
mInfo(NULL),
|
mInfo(NULL),
|
||||||
mHasMorph(FALSE)
|
mHasMorph(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -767,7 +767,7 @@ LLTexLayerInterface::LLTexLayerInterface(const LLTexLayerInterface &layer, LLWea
|
||||||
mHasMorph = layer.mHasMorph;
|
mHasMorph = layer.mHasMorph;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearable ) // This sets mInfo and calls initialization functions
|
bool LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearable ) // This sets mInfo and calls initialization functions
|
||||||
{
|
{
|
||||||
// setInfo should only be called once. Code is not robust enough to handle redefinition of a texlayer.
|
// setInfo should only be called once. Code is not robust enough to handle redefinition of a texlayer.
|
||||||
// Not a critical warning, but could be useful for debugging later issues. -Nyx
|
// Not a critical warning, but could be useful for debugging later issues. -Nyx
|
||||||
|
|
@ -785,10 +785,10 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
||||||
if (!wearable)
|
if (!wearable)
|
||||||
{
|
{
|
||||||
param_color = new LLTexLayerParamColor(this);
|
param_color = new LLTexLayerParamColor(this);
|
||||||
if (!param_color->setInfo(color_info, TRUE))
|
if (!param_color->setInfo(color_info, true))
|
||||||
{
|
{
|
||||||
mInfo = NULL;
|
mInfo = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -797,7 +797,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
||||||
if (!param_color)
|
if (!param_color)
|
||||||
{
|
{
|
||||||
mInfo = NULL;
|
mInfo = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mParamColorList.push_back( param_color );
|
mParamColorList.push_back( param_color );
|
||||||
|
|
@ -810,10 +810,10 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
||||||
if (!wearable)
|
if (!wearable)
|
||||||
{
|
{
|
||||||
param_alpha = new LLTexLayerParamAlpha( this );
|
param_alpha = new LLTexLayerParamAlpha( this );
|
||||||
if (!param_alpha->setInfo(alpha_info, TRUE))
|
if (!param_alpha->setInfo(alpha_info, true))
|
||||||
{
|
{
|
||||||
mInfo = NULL;
|
mInfo = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -822,13 +822,13 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
||||||
if (!param_alpha)
|
if (!param_alpha)
|
||||||
{
|
{
|
||||||
mInfo = NULL;
|
mInfo = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mParamAlphaList.push_back( param_alpha );
|
mParamAlphaList.push_back( param_alpha );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ void LLTexLayerInterface::requestUpdate()
|
/*virtual*/ void LLTexLayerInterface::requestUpdate()
|
||||||
|
|
@ -900,14 +900,14 @@ const std::string& LLTexLayerInterface::getGlobalColor() const
|
||||||
return mInfo->mGlobalColor;
|
return mInfo->mGlobalColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerInterface::isVisibilityMask() const
|
bool LLTexLayerInterface::isVisibilityMask() const
|
||||||
{
|
{
|
||||||
return mInfo->mIsVisibilityMask;
|
return mInfo->mIsVisibilityMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLTexLayerInterface::invalidateMorphMasks()
|
void LLTexLayerInterface::invalidateMorphMasks()
|
||||||
{
|
{
|
||||||
mMorphMasksValid = FALSE;
|
mMorphMasksValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const
|
LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const
|
||||||
|
|
@ -987,7 +987,7 @@ void LLTexLayer::asLLSD(LLSD& sd) const
|
||||||
// setInfo
|
// setInfo
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
bool LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
||||||
{
|
{
|
||||||
return LLTexLayerInterface::setInfo(info, wearable);
|
return LLTexLayerInterface::setInfo(info, wearable);
|
||||||
}
|
}
|
||||||
|
|
@ -1027,14 +1027,14 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
bool LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
||||||
{
|
{
|
||||||
// *TODO: Is this correct?
|
// *TODO: Is this correct?
|
||||||
//gPipeline.disableLights();
|
//gPipeline.disableLights();
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
|
|
||||||
LLColor4 net_color;
|
LLColor4 net_color;
|
||||||
BOOL color_specified = findNetColor(&net_color);
|
bool color_specified = findNetColor(&net_color);
|
||||||
|
|
||||||
if (mTexLayerSet->getAvatarAppearance()->mIsDummy)
|
if (mTexLayerSet->getAvatarAppearance()->mIsDummy)
|
||||||
{
|
{
|
||||||
|
|
@ -1042,15 +1042,15 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
||||||
net_color = LLAvatarAppearance::getDummyColor();
|
net_color = LLAvatarAppearance::getDummyColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
|
|
||||||
// If you can't see the layer, don't render it.
|
// If you can't see the layer, don't render it.
|
||||||
if( is_approx_zero( net_color.mV[VW] ) )
|
if( is_approx_zero( net_color.mV[VALPHA] ) )
|
||||||
{
|
{
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL alpha_mask_specified = FALSE;
|
bool alpha_mask_specified = false;
|
||||||
param_alpha_list_t::const_iterator iter = mParamAlphaList.begin();
|
param_alpha_list_t::const_iterator iter = mParamAlphaList.begin();
|
||||||
if( iter != mParamAlphaList.end() )
|
if( iter != mParamAlphaList.end() )
|
||||||
{
|
{
|
||||||
|
|
@ -1058,7 +1058,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
||||||
// However, we can't do this optimization if we have morph masks that need updating.
|
// However, we can't do this optimization if we have morph masks that need updating.
|
||||||
/* if (!mHasMorph)
|
/* if (!mHasMorph)
|
||||||
{
|
{
|
||||||
BOOL skip_layer = TRUE;
|
bool skip_layer = true;
|
||||||
|
|
||||||
while( iter != mParamAlphaList.end() )
|
while( iter != mParamAlphaList.end() )
|
||||||
{
|
{
|
||||||
|
|
@ -1066,7 +1066,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
||||||
|
|
||||||
if( !param->getSkip() )
|
if( !param->getSkip() )
|
||||||
{
|
{
|
||||||
skip_layer = FALSE;
|
skip_layer = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1081,7 +1081,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
||||||
|
|
||||||
const bool force_render = true;
|
const bool force_render = true;
|
||||||
renderMorphMasks(x, y, width, height, net_color, bound_target, force_render);
|
renderMorphMasks(x, y, width, height, net_color, bound_target, force_render);
|
||||||
alpha_mask_specified = TRUE;
|
alpha_mask_specified = true;
|
||||||
gGL.flush();
|
gGL.flush();
|
||||||
gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ONE_MINUS_DEST_ALPHA);
|
gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ONE_MINUS_DEST_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
@ -1122,7 +1122,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
||||||
|
|
||||||
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
|
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
|
||||||
|
|
||||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
gGL.getTexUnit(0)->bind(tex, true);
|
||||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
|
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
|
||||||
|
|
||||||
gl_rect_2d_simple_tex( width, height );
|
gl_rect_2d_simple_tex( width, height );
|
||||||
|
|
@ -1137,7 +1137,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
||||||
}
|
}
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// success = FALSE;
|
// success = false;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1148,13 +1148,13 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
||||||
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask);
|
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask);
|
||||||
if( tex )
|
if( tex )
|
||||||
{
|
{
|
||||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
gGL.getTexUnit(0)->bind(tex, true);
|
||||||
gl_rect_2d_simple_tex( width, height );
|
gl_rect_2d_simple_tex( width, height );
|
||||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
success = FALSE;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1206,7 +1206,7 @@ const U8* LLTexLayer::getAlphaData() const
|
||||||
return (iter2 == mAlphaCache.end()) ? 0 : iter2->second;
|
return (iter2 == mAlphaCache.end()) ? 0 : iter2->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayer::findNetColor(LLColor4* net_color) const
|
bool LLTexLayer::findNetColor(LLColor4* net_color) const
|
||||||
{
|
{
|
||||||
// Color is either:
|
// Color is either:
|
||||||
// * one or more color parameters (weighted colors) (which may make use of a global color or fixed color)
|
// * one or more color parameters (weighted colors) (which may make use of a global color or fixed color)
|
||||||
|
|
@ -1220,7 +1220,7 @@ BOOL LLTexLayer::findNetColor(LLColor4* net_color) const
|
||||||
{
|
{
|
||||||
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getInfo()->mGlobalColor ) );
|
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getInfo()->mGlobalColor ) );
|
||||||
}
|
}
|
||||||
else if (getInfo()->mFixedColor.mV[VW])
|
else if (getInfo()->mFixedColor.mV[VALPHA])
|
||||||
{
|
{
|
||||||
net_color->setVec( getInfo()->mFixedColor );
|
net_color->setVec( getInfo()->mFixedColor );
|
||||||
}
|
}
|
||||||
|
|
@ -1230,29 +1230,29 @@ BOOL LLTexLayer::findNetColor(LLColor4* net_color) const
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateTexLayerColor(mParamColorList, *net_color);
|
calculateTexLayerColor(mParamColorList, *net_color);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !getGlobalColor().empty() )
|
if( !getGlobalColor().empty() )
|
||||||
{
|
{
|
||||||
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getGlobalColor() ) );
|
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getGlobalColor() ) );
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( getInfo()->mFixedColor.mV[VW] )
|
if( getInfo()->mFixedColor.mV[VALPHA] )
|
||||||
{
|
{
|
||||||
net_color->setVec( getInfo()->mFixedColor );
|
net_color->setVec( getInfo()->mFixedColor );
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
net_color->setToWhite();
|
net_color->setToWhite();
|
||||||
|
|
||||||
return FALSE; // No need to draw a separate colored polygon
|
return false; // No need to draw a separate colored polygon
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
bool LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
||||||
{
|
{
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
|
|
||||||
gGL.flush();
|
gGL.flush();
|
||||||
|
|
||||||
|
|
@ -1262,14 +1262,14 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
||||||
if( tex )
|
if( tex )
|
||||||
{
|
{
|
||||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
gGL.getTexUnit(0)->bind(tex, true);
|
||||||
gl_rect_2d_simple_tex( width, height );
|
gl_rect_2d_simple_tex( width, height );
|
||||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
success = FALSE;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1304,7 +1304,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
|
|
||||||
llassert( !mParamAlphaList.empty() );
|
llassert( !mParamAlphaList.empty() );
|
||||||
|
|
||||||
|
|
@ -1349,7 +1349,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||||
{
|
{
|
||||||
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
|
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
|
||||||
|
|
||||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
gGL.getTexUnit(0)->bind(tex, true);
|
||||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
|
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
|
||||||
|
|
||||||
gl_rect_2d_simple_tex( width, height );
|
gl_rect_2d_simple_tex( width, height );
|
||||||
|
|
@ -1366,7 +1366,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||||
{
|
{
|
||||||
if( (tex->getComponents() == 4) || (tex->getComponents() == 1) )
|
if( (tex->getComponents() == 4) || (tex->getComponents() == 1) )
|
||||||
{
|
{
|
||||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
gGL.getTexUnit(0)->bind(tex, true);
|
||||||
gl_rect_2d_simple_tex( width, height );
|
gl_rect_2d_simple_tex( width, height );
|
||||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||||
}
|
}
|
||||||
|
|
@ -1380,7 +1380,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||||
|
|
||||||
// Draw a rectangle with the layer color to multiply the alpha by that color's alpha.
|
// Draw a rectangle with the layer color to multiply the alpha by that color's alpha.
|
||||||
// Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO );
|
// Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO );
|
||||||
if ( !is_approx_equal(layer_color.mV[VW], 1.f) )
|
if ( !is_approx_equal(layer_color.mV[VALPHA], 1.f) )
|
||||||
{
|
{
|
||||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||||
gGL.color4fv(layer_color.mV);
|
gGL.color4fv(layer_color.mV);
|
||||||
|
|
@ -1486,8 +1486,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||||
// <FS:ND> Check invariants and allocate memory
|
// <FS:ND> Check invariants and allocate memory
|
||||||
llassert_always(textureH > 0);
|
llassert_always(textureH > 0);
|
||||||
llassert_always(textureW > 0);
|
llassert_always(textureW > 0);
|
||||||
llassert_always(textureH >= height);
|
llassert_always(textureH >= (U32)height);
|
||||||
llassert_always(textureW >= width);
|
llassert_always(textureW >= (U32)width);
|
||||||
llassert_always(x == 0);
|
llassert_always(x == 0);
|
||||||
llassert_always(y == 0);
|
llassert_always(y == 0);
|
||||||
|
|
||||||
|
|
@ -1547,7 +1547,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||||
|
|
||||||
getTexLayerSet()->getAvatarAppearance()->dirtyMesh();
|
getTexLayerSet()->getAvatarAppearance()->dirtyMesh();
|
||||||
|
|
||||||
mMorphMasksValid = TRUE;
|
mMorphMasksValid = true;
|
||||||
getTexLayerSet()->applyMorphMask(alpha_data, width, height, 1);
|
getTexLayerSet()->applyMorphMask(alpha_data, width, height, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1580,17 +1580,17 @@ void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ BOOL LLTexLayer::isInvisibleAlphaMask() const
|
/*virtual*/ bool LLTexLayer::isInvisibleAlphaMask() const
|
||||||
{
|
{
|
||||||
if (mLocalTextureObject)
|
if (mLocalTextureObject)
|
||||||
{
|
{
|
||||||
if (mLocalTextureObject->getID() == IMG_INVISIBLE)
|
if (mLocalTextureObject->getID() == IMG_INVISIBLE)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLUUID LLTexLayer::getUUID() const
|
LLUUID LLTexLayer::getUUID() const
|
||||||
|
|
@ -1649,7 +1649,7 @@ LLTexLayerTemplate::~LLTexLayerTemplate()
|
||||||
// setInfo
|
// setInfo
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
/*virtual*/ BOOL LLTexLayerTemplate::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
/*virtual*/ bool LLTexLayerTemplate::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
||||||
{
|
{
|
||||||
return LLTexLayerInterface::setInfo(info, wearable);
|
return LLTexLayerInterface::setInfo(info, wearable);
|
||||||
}
|
}
|
||||||
|
|
@ -1698,14 +1698,14 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||||
return layer;
|
return layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ BOOL LLTexLayerTemplate::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
/*virtual*/ bool LLTexLayerTemplate::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
||||||
{
|
{
|
||||||
if(!mInfo)
|
if(!mInfo)
|
||||||
{
|
{
|
||||||
return FALSE ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
updateWearableCache();
|
updateWearableCache();
|
||||||
for (LLWearable* wearable : mWearableCache)
|
for (LLWearable* wearable : mWearableCache)
|
||||||
{
|
{
|
||||||
|
|
@ -1730,9 +1730,9 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ BOOL LLTexLayerTemplate::blendAlphaTexture( S32 x, S32 y, S32 width, S32 height) // Multiplies a single alpha texture against the frame buffer
|
/*virtual*/ bool LLTexLayerTemplate::blendAlphaTexture( S32 x, S32 y, S32 width, S32 height) // Multiplies a single alpha texture against the frame buffer
|
||||||
{
|
{
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
U32 num_wearables = updateWearableCache();
|
U32 num_wearables = updateWearableCache();
|
||||||
for (U32 i = 0; i < num_wearables; i++)
|
for (U32 i = 0; i < num_wearables; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -1756,7 +1756,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ void LLTexLayerTemplate::setHasMorph(BOOL newval)
|
/*virtual*/ void LLTexLayerTemplate::setHasMorph(bool newval)
|
||||||
{
|
{
|
||||||
mHasMorph = newval;
|
mHasMorph = newval;
|
||||||
U32 num_wearables = updateWearableCache();
|
U32 num_wearables = updateWearableCache();
|
||||||
|
|
@ -1783,7 +1783,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ BOOL LLTexLayerTemplate::isInvisibleAlphaMask() const
|
/*virtual*/ bool LLTexLayerTemplate::isInvisibleAlphaMask() const
|
||||||
{
|
{
|
||||||
U32 num_wearables = updateWearableCache();
|
U32 num_wearables = updateWearableCache();
|
||||||
for (U32 i = 0; i < num_wearables; i++)
|
for (U32 i = 0; i < num_wearables; i++)
|
||||||
|
|
@ -1793,12 +1793,12 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||||
{
|
{
|
||||||
if (layer->isInvisibleAlphaMask())
|
if (layer->isInvisibleAlphaMask())
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1920,7 +1920,7 @@ LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name)
|
||||||
|
|
||||||
// Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name.
|
// Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name.
|
||||||
// Caches the result to speed identical subsequent requests.
|
// Caches the result to speed identical subsequent requests.
|
||||||
LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, BOOL is_mask)
|
LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, bool is_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
LLPointer<LLGLTexture> tex;
|
LLPointer<LLGLTexture> tex;
|
||||||
|
|
@ -1934,7 +1934,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
llassert(gTextureManagerBridgep);
|
llassert(gTextureManagerBridgep);
|
||||||
tex = gTextureManagerBridgep->getLocalTexture( FALSE );
|
tex = gTextureManagerBridgep->getLocalTexture( false );
|
||||||
LLPointer<LLImageRaw> image_raw = new LLImageRaw;
|
LLPointer<LLImageRaw> image_raw = new LLImageRaw;
|
||||||
if( loadImageRaw( file_name, image_raw ) )
|
if( loadImageRaw( file_name, image_raw ) )
|
||||||
{
|
{
|
||||||
|
|
@ -1950,7 +1950,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
||||||
|
|
||||||
image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black);
|
image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black);
|
||||||
}
|
}
|
||||||
tex->createGLTexture(0, image_raw, 0, TRUE, LLGLTexture::LOCAL);
|
tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL);
|
||||||
|
|
||||||
gGL.getTexUnit(0)->bind(tex);
|
gGL.getTexUnit(0)->bind(tex);
|
||||||
tex->setAddressMode(LLTexUnit::TAM_CLAMP);
|
tex->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||||
|
|
@ -1968,11 +1968,11 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reads a .tga file, decodes it, and puts the decoded data in image_raw.
|
// Reads a .tga file, decodes it, and puts the decoded data in image_raw.
|
||||||
// Returns TRUE if successful.
|
// Returns true if successful.
|
||||||
BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw)
|
bool LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
BOOL success = FALSE;
|
bool success = false;
|
||||||
std::string path;
|
std::string path;
|
||||||
path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name);
|
path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name);
|
||||||
LLPointer<LLImageTGA> image_tga = new LLImageTGA( path );
|
LLPointer<LLImageTGA> image_tga = new LLImageTGA( path );
|
||||||
|
|
|
||||||
|
|
@ -65,13 +65,13 @@ public:
|
||||||
LLTexLayerInterface(const LLTexLayerInterface &layer, LLWearable *wearable);
|
LLTexLayerInterface(const LLTexLayerInterface &layer, LLWearable *wearable);
|
||||||
virtual ~LLTexLayerInterface() {}
|
virtual ~LLTexLayerInterface() {}
|
||||||
|
|
||||||
virtual BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) = 0;
|
virtual bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) = 0;
|
||||||
virtual void deleteCaches() = 0;
|
virtual void deleteCaches() = 0;
|
||||||
virtual BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) = 0;
|
virtual bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) = 0;
|
||||||
virtual BOOL isInvisibleAlphaMask() const = 0;
|
virtual bool isInvisibleAlphaMask() const = 0;
|
||||||
|
|
||||||
const LLTexLayerInfo* getInfo() const { return mInfo; }
|
const LLTexLayerInfo* getInfo() const { return mInfo; }
|
||||||
virtual BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // sets mInfo, calls initialization functions
|
virtual bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // sets mInfo, calls initialization functions
|
||||||
LLWearableType::EType getWearableType() const;
|
LLWearableType::EType getWearableType() const;
|
||||||
LLAvatarAppearanceDefines::ETextureIndex getLocalTextureIndex() const;
|
LLAvatarAppearanceDefines::ETextureIndex getLocalTextureIndex() const;
|
||||||
|
|
||||||
|
|
@ -80,16 +80,16 @@ public:
|
||||||
LLTexLayerSet* const getTexLayerSet() { return mTexLayerSet; }
|
LLTexLayerSet* const getTexLayerSet() { return mTexLayerSet; }
|
||||||
|
|
||||||
void invalidateMorphMasks();
|
void invalidateMorphMasks();
|
||||||
virtual void setHasMorph(BOOL newval) { mHasMorph = newval; }
|
virtual void setHasMorph(bool newval) { mHasMorph = newval; }
|
||||||
BOOL hasMorph() const { return mHasMorph; }
|
bool hasMorph() const { return mHasMorph; }
|
||||||
BOOL isMorphValid() const { return mMorphMasksValid; }
|
bool isMorphValid() const { return mMorphMasksValid; }
|
||||||
|
|
||||||
void requestUpdate();
|
void requestUpdate();
|
||||||
virtual void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target) = 0;
|
virtual void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target) = 0;
|
||||||
BOOL hasAlphaParams() const { return !mParamAlphaList.empty(); }
|
bool hasAlphaParams() const { return !mParamAlphaList.empty(); }
|
||||||
|
|
||||||
ERenderPass getRenderPass() const;
|
ERenderPass getRenderPass() const;
|
||||||
BOOL isVisibilityMask() const;
|
bool isVisibilityMask() const;
|
||||||
|
|
||||||
virtual void asLLSD(LLSD& sd) const {}
|
virtual void asLLSD(LLSD& sd) const {}
|
||||||
|
|
||||||
|
|
@ -100,8 +100,8 @@ protected:
|
||||||
protected:
|
protected:
|
||||||
LLTexLayerSet* const mTexLayerSet;
|
LLTexLayerSet* const mTexLayerSet;
|
||||||
const LLTexLayerInfo* mInfo;
|
const LLTexLayerInfo* mInfo;
|
||||||
BOOL mMorphMasksValid;
|
bool mMorphMasksValid;
|
||||||
BOOL mHasMorph;
|
bool mHasMorph;
|
||||||
|
|
||||||
// Layers can have either mParamColorList, mGlobalColor, or mFixedColor. They are looked for in that order.
|
// Layers can have either mParamColorList, mGlobalColor, or mFixedColor. They are looked for in that order.
|
||||||
param_color_list_t mParamColorList;
|
param_color_list_t mParamColorList;
|
||||||
|
|
@ -121,13 +121,13 @@ public:
|
||||||
LLTexLayerTemplate(LLTexLayerSet* const layer_set, LLAvatarAppearance* const appearance);
|
LLTexLayerTemplate(LLTexLayerSet* const layer_set, LLAvatarAppearance* const appearance);
|
||||||
LLTexLayerTemplate(const LLTexLayerTemplate &layer);
|
LLTexLayerTemplate(const LLTexLayerTemplate &layer);
|
||||||
/*virtual*/ ~LLTexLayerTemplate();
|
/*virtual*/ ~LLTexLayerTemplate();
|
||||||
/*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
/*virtual*/ bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||||
/*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
/*virtual*/ bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
||||||
/*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
/*virtual*/ bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
||||||
/*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
/*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||||
/*virtual*/ void setHasMorph(BOOL newval);
|
/*virtual*/ void setHasMorph(bool newval);
|
||||||
/*virtual*/ void deleteCaches();
|
/*virtual*/ void deleteCaches();
|
||||||
/*virtual*/ BOOL isInvisibleAlphaMask() const;
|
/*virtual*/ bool isInvisibleAlphaMask() const;
|
||||||
protected:
|
protected:
|
||||||
U32 updateWearableCache() const;
|
U32 updateWearableCache() const;
|
||||||
LLTexLayer* getLayer(U32 i) const;
|
LLTexLayer* getLayer(U32 i) const;
|
||||||
|
|
@ -151,18 +151,18 @@ public:
|
||||||
LLTexLayer(const LLTexLayerTemplate &layer_template, LLLocalTextureObject *lto, LLWearable *wearable);
|
LLTexLayer(const LLTexLayerTemplate &layer_template, LLLocalTextureObject *lto, LLWearable *wearable);
|
||||||
/*virtual*/ ~LLTexLayer();
|
/*virtual*/ ~LLTexLayer();
|
||||||
|
|
||||||
/*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
/*virtual*/ bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
||||||
/*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
/*virtual*/ bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||||
|
|
||||||
/*virtual*/ void deleteCaches();
|
/*virtual*/ void deleteCaches();
|
||||||
const U8* getAlphaData() const;
|
const U8* getAlphaData() const;
|
||||||
|
|
||||||
BOOL findNetColor(LLColor4* color) const;
|
bool findNetColor(LLColor4* color) const;
|
||||||
/*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
/*virtual*/ bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
||||||
/*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
/*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||||
void renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, LLRenderTarget* bound_target, bool force_render);
|
void renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, LLRenderTarget* bound_target, bool force_render);
|
||||||
void addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
void addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||||
/*virtual*/ BOOL isInvisibleAlphaMask() const;
|
/*virtual*/ bool isInvisibleAlphaMask() const;
|
||||||
|
|
||||||
void setLTO(LLLocalTextureObject *lto) { mLocalTextureObject = lto; }
|
void setLTO(LLLocalTextureObject *lto) { mLocalTextureObject = lto; }
|
||||||
LLLocalTextureObject* getLTO() { return mLocalTextureObject; }
|
LLLocalTextureObject* getLTO() { return mLocalTextureObject; }
|
||||||
|
|
@ -197,14 +197,14 @@ public:
|
||||||
void gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height, LLRenderTarget* bound_target);
|
void gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||||
|
|
||||||
const LLTexLayerSetInfo* getInfo() const { return mInfo; }
|
const LLTexLayerSetInfo* getInfo() const { return mInfo; }
|
||||||
BOOL setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions
|
bool setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions
|
||||||
|
|
||||||
BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr);
|
bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr);
|
||||||
void renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr, bool forceClear = false);
|
void renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr, bool forceClear = false);
|
||||||
|
|
||||||
BOOL isBodyRegion(const std::string& region) const;
|
bool isBodyRegion(const std::string& region) const;
|
||||||
void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components);
|
void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components);
|
||||||
BOOL isMorphValid() const;
|
bool isMorphValid() const;
|
||||||
virtual void requestUpdate() = 0;
|
virtual void requestUpdate() = 0;
|
||||||
void invalidateMorphMasks();
|
void invalidateMorphMasks();
|
||||||
void deleteCaches();
|
void deleteCaches();
|
||||||
|
|
@ -213,12 +213,12 @@ public:
|
||||||
|
|
||||||
LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
||||||
const std::string getBodyRegionName() const;
|
const std::string getBodyRegionName() const;
|
||||||
BOOL hasComposite() const { return (mComposite.notNull()); }
|
bool hasComposite() const { return (mComposite.notNull()); }
|
||||||
LLAvatarAppearanceDefines::EBakedTextureIndex getBakedTexIndex() const { return mBakedTexIndex; }
|
LLAvatarAppearanceDefines::EBakedTextureIndex getBakedTexIndex() const { return mBakedTexIndex; }
|
||||||
void setBakedTexIndex(LLAvatarAppearanceDefines::EBakedTextureIndex index) { mBakedTexIndex = index; }
|
void setBakedTexIndex(LLAvatarAppearanceDefines::EBakedTextureIndex index) { mBakedTexIndex = index; }
|
||||||
BOOL isVisible() const { return mIsVisible; }
|
bool isVisible() const { return mIsVisible; }
|
||||||
|
|
||||||
static BOOL sHasCaches;
|
static bool sHasCaches;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef std::vector<LLTexLayerInterface *> layer_list_t;
|
typedef std::vector<LLTexLayerInterface *> layer_list_t;
|
||||||
|
|
@ -226,7 +226,7 @@ protected:
|
||||||
layer_list_t mMaskLayerList;
|
layer_list_t mMaskLayerList;
|
||||||
LLPointer<LLTexLayerSetBuffer> mComposite;
|
LLPointer<LLTexLayerSetBuffer> mComposite;
|
||||||
LLAvatarAppearance* const mAvatarAppearance; // note: backlink only; don't make this an LLPointer.
|
LLAvatarAppearance* const mAvatarAppearance; // note: backlink only; don't make this an LLPointer.
|
||||||
BOOL mIsVisible;
|
bool mIsVisible;
|
||||||
|
|
||||||
LLAvatarAppearanceDefines::EBakedTextureIndex mBakedTexIndex;
|
LLAvatarAppearanceDefines::EBakedTextureIndex mBakedTexIndex;
|
||||||
const LLTexLayerSetInfo* mInfo;
|
const LLTexLayerSetInfo* mInfo;
|
||||||
|
|
@ -243,7 +243,7 @@ class LLTexLayerSetInfo
|
||||||
public:
|
public:
|
||||||
LLTexLayerSetInfo();
|
LLTexLayerSetInfo();
|
||||||
~LLTexLayerSetInfo();
|
~LLTexLayerSetInfo();
|
||||||
BOOL parseXml(LLXmlTreeNode* node);
|
bool parseXml(LLXmlTreeNode* node);
|
||||||
void createVisualParams(LLAvatarAppearance *appearance);
|
void createVisualParams(LLAvatarAppearance *appearance);
|
||||||
S32 getWidth() const { return mWidth; }
|
S32 getWidth() const { return mWidth; }
|
||||||
S32 getHeight() const { return mHeight; }
|
S32 getHeight() const { return mHeight; }
|
||||||
|
|
@ -252,7 +252,7 @@ protected:
|
||||||
S32 mWidth;
|
S32 mWidth;
|
||||||
S32 mHeight;
|
S32 mHeight;
|
||||||
std::string mStaticAlphaFileName;
|
std::string mStaticAlphaFileName;
|
||||||
BOOL mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName)
|
bool mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName)
|
||||||
typedef std::vector<LLTexLayerInfo*> layer_info_list_t;
|
typedef std::vector<LLTexLayerInfo*> layer_info_list_t;
|
||||||
layer_info_list_t mLayerInfoList;
|
layer_info_list_t mLayerInfoList;
|
||||||
};
|
};
|
||||||
|
|
@ -275,15 +275,15 @@ protected:
|
||||||
void popProjection() const;
|
void popProjection() const;
|
||||||
virtual void preRenderTexLayerSet();
|
virtual void preRenderTexLayerSet();
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//virtual void midRenderTexLayerSet(BOOL success) {}
|
//virtual void midRenderTexLayerSet(bool success) {}
|
||||||
virtual void midRenderTexLayerSet(BOOL success, LLRenderTarget* bound_target) {}
|
virtual void midRenderTexLayerSet(bool success, LLRenderTarget* bound_target) {}
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
virtual void postRenderTexLayerSet(BOOL success);
|
virtual void postRenderTexLayerSet(bool success);
|
||||||
virtual S32 getCompositeOriginX() const = 0;
|
virtual S32 getCompositeOriginX() const = 0;
|
||||||
virtual S32 getCompositeOriginY() const = 0;
|
virtual S32 getCompositeOriginY() const = 0;
|
||||||
virtual S32 getCompositeWidth() const = 0;
|
virtual S32 getCompositeWidth() const = 0;
|
||||||
virtual S32 getCompositeHeight() const = 0;
|
virtual S32 getCompositeHeight() const = 0;
|
||||||
BOOL renderTexLayerSet(LLRenderTarget* bound_target);
|
bool renderTexLayerSet(LLRenderTarget* bound_target);
|
||||||
|
|
||||||
LLTexLayerSet* const mTexLayerSet;
|
LLTexLayerSet* const mTexLayerSet;
|
||||||
};
|
};
|
||||||
|
|
@ -297,12 +297,12 @@ class LLTexLayerStaticImageList : public LLSingleton<LLTexLayerStaticImageList>
|
||||||
LLSINGLETON(LLTexLayerStaticImageList);
|
LLSINGLETON(LLTexLayerStaticImageList);
|
||||||
~LLTexLayerStaticImageList();
|
~LLTexLayerStaticImageList();
|
||||||
public:
|
public:
|
||||||
LLGLTexture* getTexture(const std::string& file_name, BOOL is_mask);
|
LLGLTexture* getTexture(const std::string& file_name, bool is_mask);
|
||||||
LLImageTGA* getImageTGA(const std::string& file_name);
|
LLImageTGA* getImageTGA(const std::string& file_name);
|
||||||
void deleteCachedImages();
|
void deleteCachedImages();
|
||||||
void dumpByteCount() const;
|
void dumpByteCount() const;
|
||||||
protected:
|
protected:
|
||||||
BOOL loadImageRaw(const std::string& file_name, LLImageRaw* image_raw);
|
bool loadImageRaw(const std::string& file_name, LLImageRaw* image_raw);
|
||||||
private:
|
private:
|
||||||
LLStringTable mImageNames;
|
LLStringTable mImageNames;
|
||||||
typedef std::map<const char*, LLPointer<LLGLTexture> > texture_map_t;
|
typedef std::map<const char*, LLPointer<LLGLTexture> > texture_map_t;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance)
|
bool LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, bool add_to_appearance)
|
||||||
{
|
{
|
||||||
LLViewerVisualParam::setInfo(info);
|
LLViewerVisualParam::setInfo(info);
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appeara
|
||||||
this->setParamLocation(mAvatarAppearance->isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
|
this->setParamLocation(mAvatarAppearance->isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -123,8 +123,8 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer)
|
||||||
mCachedProcessedTexture(NULL),
|
mCachedProcessedTexture(NULL),
|
||||||
mStaticImageTGA(),
|
mStaticImageTGA(),
|
||||||
mStaticImageRaw(),
|
mStaticImageRaw(),
|
||||||
mNeedsCreateTexture(FALSE),
|
mNeedsCreateTexture(false),
|
||||||
mStaticImageInvalid(FALSE),
|
mStaticImageInvalid(false),
|
||||||
mAvgDistortionVec(1.f, 1.f, 1.f),
|
mAvgDistortionVec(1.f, 1.f, 1.f),
|
||||||
mCachedEffectiveWeight(0.f)
|
mCachedEffectiveWeight(0.f)
|
||||||
{
|
{
|
||||||
|
|
@ -136,8 +136,8 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance)
|
||||||
mCachedProcessedTexture(NULL),
|
mCachedProcessedTexture(NULL),
|
||||||
mStaticImageTGA(),
|
mStaticImageTGA(),
|
||||||
mStaticImageRaw(),
|
mStaticImageRaw(),
|
||||||
mNeedsCreateTexture(FALSE),
|
mNeedsCreateTexture(false),
|
||||||
mStaticImageInvalid(FALSE),
|
mStaticImageInvalid(false),
|
||||||
mAvgDistortionVec(1.f, 1.f, 1.f),
|
mAvgDistortionVec(1.f, 1.f, 1.f),
|
||||||
mCachedEffectiveWeight(0.f)
|
mCachedEffectiveWeight(0.f)
|
||||||
{
|
{
|
||||||
|
|
@ -173,17 +173,17 @@ void LLTexLayerParamAlpha::deleteCaches()
|
||||||
mStaticImageTGA = NULL; // deletes image
|
mStaticImageTGA = NULL; // deletes image
|
||||||
mCachedProcessedTexture = NULL;
|
mCachedProcessedTexture = NULL;
|
||||||
mStaticImageRaw = NULL;
|
mStaticImageRaw = NULL;
|
||||||
mNeedsCreateTexture = FALSE;
|
mNeedsCreateTexture = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerParamAlpha::getMultiplyBlend() const
|
bool LLTexLayerParamAlpha::getMultiplyBlend() const
|
||||||
{
|
{
|
||||||
return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend;
|
return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLTexLayerParamAlpha::setWeight(F32 weight)
|
//void LLTexLayerParamAlpha::setWeight(F32 weight)
|
||||||
void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
|
void LLTexLayerParamAlpha::setWeight(F32 weight, bool upload_bake)
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
{
|
{
|
||||||
if (mIsAnimating || mTexLayer == NULL)
|
if (mIsAnimating || mTexLayer == NULL)
|
||||||
|
|
@ -213,7 +213,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value)
|
//void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value)
|
||||||
void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake)
|
void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, bool upload_bake)
|
||||||
{
|
{
|
||||||
// do not animate dummy parameters
|
// do not animate dummy parameters
|
||||||
if (mIsDummy)
|
if (mIsDummy)
|
||||||
|
|
@ -228,7 +228,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setWeight(target_value);
|
//setWeight(target_value);
|
||||||
setWeight(target_value, upload_bake);
|
setWeight(target_value, upload_bake);
|
||||||
mIsAnimating = TRUE;
|
mIsAnimating = true;
|
||||||
if (mNext)
|
if (mNext)
|
||||||
{
|
{
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
|
|
@ -239,7 +239,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLTexLayerParamAlpha::animate(F32 delta)
|
//void LLTexLayerParamAlpha::animate(F32 delta)
|
||||||
void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake)
|
void LLTexLayerParamAlpha::animate(F32 delta, bool upload_bake)
|
||||||
{
|
{
|
||||||
if (mNext)
|
if (mNext)
|
||||||
{
|
{
|
||||||
|
|
@ -249,11 +249,11 @@ void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerParamAlpha::getSkip() const
|
bool LLTexLayerParamAlpha::getSkip() const
|
||||||
{
|
{
|
||||||
if (!mTexLayer)
|
if (!mTexLayer)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LLAvatarAppearance *appearance = mTexLayer->getTexLayerSet()->getAvatarAppearance();
|
const LLAvatarAppearance *appearance = mTexLayer->getTexLayerSet()->getAvatarAppearance();
|
||||||
|
|
@ -263,24 +263,24 @@ BOOL LLTexLayerParamAlpha::getSkip() const
|
||||||
F32 effective_weight = (appearance->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
|
F32 effective_weight = (appearance->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
|
||||||
if (is_approx_zero(effective_weight))
|
if (is_approx_zero(effective_weight))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLWearableType::EType type = (LLWearableType::EType)getWearableType();
|
LLWearableType::EType type = (LLWearableType::EType)getWearableType();
|
||||||
if ((type != LLWearableType::WT_INVALID) && !appearance->isWearingWearableType(type))
|
if ((type != LLWearableType::WT_INVALID) && !appearance->isWearingWearableType(type))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
BOOL success = TRUE;
|
bool success = true;
|
||||||
|
|
||||||
if (!mTexLayer)
|
if (!mTexLayer)
|
||||||
{
|
{
|
||||||
|
|
@ -288,7 +288,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 effective_weight = (mTexLayer->getTexLayerSet()->getAvatarAppearance()->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
|
F32 effective_weight = (mTexLayer->getTexLayerSet()->getAvatarAppearance()->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
|
||||||
BOOL weight_changed = effective_weight != mCachedEffectiveWeight;
|
bool weight_changed = effective_weight != mCachedEffectiveWeight;
|
||||||
if (getSkip())
|
if (getSkip())
|
||||||
{
|
{
|
||||||
return success;
|
return success;
|
||||||
|
|
@ -312,13 +312,13 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||||
// Don't load the image file until we actually need it the first time. Like now.
|
// Don't load the image file until we actually need it the first time. Like now.
|
||||||
mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName);
|
mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName);
|
||||||
// We now have something in one of our caches
|
// We now have something in one of our caches
|
||||||
LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? TRUE : FALSE;
|
LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull();
|
||||||
|
|
||||||
if (mStaticImageTGA.isNull())
|
if (mStaticImageTGA.isNull())
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL;
|
LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL;
|
||||||
mStaticImageInvalid = TRUE; // don't try again.
|
mStaticImageInvalid = true; // don't try again.
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -334,10 +334,10 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||||
if (!mCachedProcessedTexture)
|
if (!mCachedProcessedTexture)
|
||||||
{
|
{
|
||||||
llassert(gTextureManagerBridgep);
|
llassert(gTextureManagerBridgep);
|
||||||
mCachedProcessedTexture = gTextureManagerBridgep->getLocalTexture(image_tga_width, image_tga_height, 1, FALSE);
|
mCachedProcessedTexture = gTextureManagerBridgep->getLocalTexture(image_tga_width, image_tga_height, 1, false);
|
||||||
|
|
||||||
// We now have something in one of our caches
|
// We now have something in one of our caches
|
||||||
LLTexLayerSet::sHasCaches |= mCachedProcessedTexture ? TRUE : FALSE;
|
LLTexLayerSet::sHasCaches |= mCachedProcessedTexture.notNull();
|
||||||
|
|
||||||
mCachedProcessedTexture->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
|
mCachedProcessedTexture->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +346,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||||
mStaticImageRaw = NULL;
|
mStaticImageRaw = NULL;
|
||||||
mStaticImageRaw = new LLImageRaw;
|
mStaticImageRaw = new LLImageRaw;
|
||||||
mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
|
mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
|
||||||
mNeedsCreateTexture = TRUE;
|
mNeedsCreateTexture = true;
|
||||||
LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
|
LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,7 +357,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||||
if (mNeedsCreateTexture)
|
if (mNeedsCreateTexture)
|
||||||
{
|
{
|
||||||
mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw);
|
mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw);
|
||||||
mNeedsCreateTexture = FALSE;
|
mNeedsCreateTexture = false;
|
||||||
gGL.getTexUnit(0)->bind(mCachedProcessedTexture);
|
gGL.getTexUnit(0)->bind(mCachedProcessedTexture);
|
||||||
mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP);
|
mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||||
}
|
}
|
||||||
|
|
@ -390,23 +390,23 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||||
// LLTexLayerParamAlphaInfo
|
// LLTexLayerParamAlphaInfo
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLTexLayerParamAlphaInfo::LLTexLayerParamAlphaInfo() :
|
LLTexLayerParamAlphaInfo::LLTexLayerParamAlphaInfo() :
|
||||||
mMultiplyBlend(FALSE),
|
mMultiplyBlend(false),
|
||||||
mSkipIfZeroWeight(FALSE),
|
mSkipIfZeroWeight(false),
|
||||||
mDomain(0.f)
|
mDomain(0.f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
bool LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
||||||
{
|
{
|
||||||
llassert(node->hasName("param") && node->getChildByName("param_alpha"));
|
llassert(node->hasName("param") && node->getChildByName("param_alpha"));
|
||||||
|
|
||||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
LLXmlTreeNode* param_alpha_node = node->getChildByName("param_alpha");
|
LLXmlTreeNode* param_alpha_node = node->getChildByName("param_alpha");
|
||||||
if (!param_alpha_node)
|
if (!param_alpha_node)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLStdStringHandle tga_file_string = LLXmlTree::addAttributeString("tga_file");
|
static LLStdStringHandle tga_file_string = LLXmlTree::addAttributeString("tga_file");
|
||||||
|
|
@ -428,7 +428,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
||||||
static LLStdStringHandle domain_string = LLXmlTree::addAttributeString("domain");
|
static LLStdStringHandle domain_string = LLXmlTree::addAttributeString("domain");
|
||||||
param_alpha_node->getFastAttributeF32(domain_string, mDomain);
|
param_alpha_node->getFastAttributeF32(domain_string, mDomain);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -482,17 +482,17 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
|
||||||
F32 weight = scaled_weight - index_start;
|
F32 weight = scaled_weight - index_start;
|
||||||
const LLColor4 *start = &info->mColors[ index_start ];
|
const LLColor4 *start = &info->mColors[ index_start ];
|
||||||
const LLColor4 *end = &info->mColors[ index_end ];
|
const LLColor4 *end = &info->mColors[ index_end ];
|
||||||
return LLColor4((1.f - weight) * start->mV[VX] + weight * end->mV[VX],
|
return LLColor4((1.f - weight) * start->mV[VRED] + weight * end->mV[VRED],
|
||||||
(1.f - weight) * start->mV[VY] + weight * end->mV[VY],
|
(1.f - weight) * start->mV[VGREEN] + weight * end->mV[VGREEN],
|
||||||
(1.f - weight) * start->mV[VZ] + weight * end->mV[VZ],
|
(1.f - weight) * start->mV[VBLUE] + weight * end->mV[VBLUE],
|
||||||
(1.f - weight) * start->mV[VW] + weight * end->mV[VW]);
|
(1.f - weight) * start->mV[VALPHA] + weight * end->mV[VALPHA]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLTexLayerParamColor::setWeight(F32 weight)
|
//void LLTexLayerParamColor::setWeight(F32 weight)
|
||||||
void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
|
void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake)
|
||||||
{
|
{
|
||||||
if (mIsAnimating)
|
if (mIsAnimating)
|
||||||
{
|
{
|
||||||
|
|
@ -535,14 +535,14 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLTexLayerParamColor::setAnimationTarget(F32 target_value)
|
//void LLTexLayerParamColor::setAnimationTarget(F32 target_value)
|
||||||
void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake)
|
void LLTexLayerParamColor::setAnimationTarget(F32 target_value, bool upload_bake)
|
||||||
{
|
{
|
||||||
// set value first then set interpolating flag to ignore further updates
|
// set value first then set interpolating flag to ignore further updates
|
||||||
mTargetWeight = target_value;
|
mTargetWeight = target_value;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setWeight(target_value);
|
//setWeight(target_value);
|
||||||
setWeight(target_value, upload_bake);
|
setWeight(target_value, upload_bake);
|
||||||
mIsAnimating = TRUE;
|
mIsAnimating = true;
|
||||||
if (mNext)
|
if (mNext)
|
||||||
{
|
{
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
|
|
@ -553,7 +553,7 @@ void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLTexLayerParamColor::animate(F32 delta)
|
//void LLTexLayerParamColor::animate(F32 delta)
|
||||||
void LLTexLayerParamColor::animate(F32 delta, BOOL upload_bake)
|
void LLTexLayerParamColor::animate(F32 delta, bool upload_bake)
|
||||||
{
|
{
|
||||||
if (mNext)
|
if (mNext)
|
||||||
{
|
{
|
||||||
|
|
@ -572,17 +572,17 @@ LLTexLayerParamColorInfo::LLTexLayerParamColorInfo() :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
bool LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
||||||
{
|
{
|
||||||
llassert(node->hasName("param") && node->getChildByName("param_color"));
|
llassert(node->hasName("param") && node->getChildByName("param_color"));
|
||||||
|
|
||||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
LLXmlTreeNode* param_color_node = node->getChildByName("param_color");
|
LLXmlTreeNode* param_color_node = node->getChildByName("param_color");
|
||||||
if (!param_color_node)
|
if (!param_color_node)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string op_string;
|
std::string op_string;
|
||||||
|
|
@ -615,14 +615,14 @@ BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
||||||
if (!mNumColors)
|
if (!mNumColors)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "<param_color> is missing <value> sub-elements" << LL_ENDL;
|
LL_WARNS() << "<param_color> is missing <value> sub-elements" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
|
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
|
||||||
{
|
{
|
||||||
LL_WARNS() << "<param_color> with operation\"blend\" must have exactly one <value>" << LL_ENDL;
|
LL_WARNS() << "<param_color> with operation\"blend\" must have exactly one <value>" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class LLTexLayerParam : public LLViewerVisualParam
|
||||||
public:
|
public:
|
||||||
LLTexLayerParam(LLTexLayerInterface *layer);
|
LLTexLayerParam(LLTexLayerInterface *layer);
|
||||||
LLTexLayerParam(LLAvatarAppearance *appearance);
|
LLTexLayerParam(LLAvatarAppearance *appearance);
|
||||||
/*virtual*/ BOOL setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance);
|
/*virtual*/ bool setInfo(LLViewerVisualParamInfo *info, bool add_to_appearance);
|
||||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
|
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -74,15 +74,15 @@ public:
|
||||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
|
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
|
||||||
|
|
||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||||
/*virtual*/ void apply( ESex avatar_sex ) {}
|
/*virtual*/ void apply( ESex avatar_sex ) {}
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
///*virtual*/ void setWeight(F32 weight);
|
///*virtual*/ void setWeight(F32 weight);
|
||||||
///*virtual*/ void setAnimationTarget(F32 target_value);
|
///*virtual*/ void setAnimationTarget(F32 target_value);
|
||||||
///*virtual*/ void animate(F32 delta);
|
///*virtual*/ void animate(F32 delta);
|
||||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
/*virtual*/ void setWeight(F32 weight, bool upload_bake);
|
||||||
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
/*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake);
|
||||||
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
/*virtual*/ void animate(F32 delta, bool upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
|
|
@ -100,10 +100,10 @@ public:
|
||||||
// </FS:ND>
|
// </FS:ND>
|
||||||
|
|
||||||
// New functions
|
// New functions
|
||||||
BOOL render( S32 x, S32 y, S32 width, S32 height );
|
bool render( S32 x, S32 y, S32 width, S32 height );
|
||||||
BOOL getSkip() const;
|
bool getSkip() const;
|
||||||
void deleteCaches();
|
void deleteCaches();
|
||||||
BOOL getMultiplyBlend() const;
|
bool getMultiplyBlend() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther);
|
LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther);
|
||||||
|
|
@ -111,8 +111,8 @@ private:
|
||||||
LLPointer<LLGLTexture> mCachedProcessedTexture;
|
LLPointer<LLGLTexture> mCachedProcessedTexture;
|
||||||
LLPointer<LLImageTGA> mStaticImageTGA;
|
LLPointer<LLImageTGA> mStaticImageTGA;
|
||||||
LLPointer<LLImageRaw> mStaticImageRaw;
|
LLPointer<LLImageRaw> mStaticImageRaw;
|
||||||
std::atomic<BOOL> mNeedsCreateTexture;
|
std::atomic<bool> mNeedsCreateTexture;
|
||||||
BOOL mStaticImageInvalid;
|
bool mStaticImageInvalid;
|
||||||
LL_ALIGN_16(LLVector4a mAvgDistortionVec);
|
LL_ALIGN_16(LLVector4a mAvgDistortionVec);
|
||||||
F32 mCachedEffectiveWeight;
|
F32 mCachedEffectiveWeight;
|
||||||
|
|
||||||
|
|
@ -131,12 +131,12 @@ public:
|
||||||
LLTexLayerParamAlphaInfo();
|
LLTexLayerParamAlphaInfo();
|
||||||
/*virtual*/ ~LLTexLayerParamAlphaInfo() {};
|
/*virtual*/ ~LLTexLayerParamAlphaInfo() {};
|
||||||
|
|
||||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mStaticImageFileName;
|
std::string mStaticImageFileName;
|
||||||
BOOL mMultiplyBlend;
|
bool mMultiplyBlend;
|
||||||
BOOL mSkipIfZeroWeight;
|
bool mSkipIfZeroWeight;
|
||||||
F32 mDomain;
|
F32 mDomain;
|
||||||
};
|
};
|
||||||
//
|
//
|
||||||
|
|
@ -168,15 +168,15 @@ public:
|
||||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
|
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
|
||||||
|
|
||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||||
/*virtual*/ void apply( ESex avatar_sex ) {}
|
/*virtual*/ void apply( ESex avatar_sex ) {}
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
///*virtual*/ void setWeight(F32 weight);
|
///*virtual*/ void setWeight(F32 weight);
|
||||||
///*virtual*/ void setAnimationTarget(F32 target_value);
|
///*virtual*/ void setAnimationTarget(F32 target_value);
|
||||||
///*virtual*/ void animate(F32 delta);
|
///*virtual*/ void animate(F32 delta);
|
||||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
/*virtual*/ void setWeight(F32 weight, bool upload_bake);
|
||||||
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
/*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake);
|
||||||
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
/*virtual*/ void animate(F32 delta, bool upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -207,7 +207,7 @@ class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo
|
||||||
public:
|
public:
|
||||||
LLTexLayerParamColorInfo();
|
LLTexLayerParamColorInfo();
|
||||||
virtual ~LLTexLayerParamColorInfo() {};
|
virtual ~LLTexLayerParamColorInfo() {};
|
||||||
BOOL parseXml( LLXmlTreeNode* node );
|
bool parseXml( LLXmlTreeNode* node );
|
||||||
LLTexLayerParamColor::EColorOperation getOperation() const { return mOperation; }
|
LLTexLayerParamColor::EColorOperation getOperation() const { return mOperation; }
|
||||||
private:
|
private:
|
||||||
enum { MAX_COLOR_VALUES = 20 };
|
enum { MAX_COLOR_VALUES = 20 };
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,12 @@
|
||||||
LLViewerVisualParamInfo::LLViewerVisualParamInfo()
|
LLViewerVisualParamInfo::LLViewerVisualParamInfo()
|
||||||
:
|
:
|
||||||
mWearableType( LLWearableType::WT_INVALID ),
|
mWearableType( LLWearableType::WT_INVALID ),
|
||||||
mCrossWearable(FALSE),
|
mCrossWearable(false),
|
||||||
mCamDist( 0.5f ),
|
mCamDist( 0.5f ),
|
||||||
mCamAngle( 0.f ),
|
mCamAngle( 0.f ),
|
||||||
mCamElevation( 0.f ),
|
mCamElevation( 0.f ),
|
||||||
mEditGroupDisplayOrder( 0 ),
|
mEditGroupDisplayOrder( 0 ),
|
||||||
mShowSimple(FALSE),
|
mShowSimple(false),
|
||||||
mSimpleMin(0.f),
|
mSimpleMin(0.f),
|
||||||
mSimpleMax(100.f)
|
mSimpleMax(100.f)
|
||||||
{
|
{
|
||||||
|
|
@ -57,12 +57,12 @@ LLViewerVisualParamInfo::~LLViewerVisualParamInfo()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXml()
|
// parseXml()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
bool LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||||
{
|
{
|
||||||
llassert( node->hasName( "param" ) );
|
llassert( node->hasName( "param" ) );
|
||||||
|
|
||||||
if (!LLVisualParamInfo::parseXml(node))
|
if (!LLVisualParamInfo::parseXml(node))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// VIEWER SPECIFIC PARAMS
|
// VIEWER SPECIFIC PARAMS
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||||
static LLStdStringHandle cross_wearable_string = LLXmlTree::addAttributeString("cross_wearable");
|
static LLStdStringHandle cross_wearable_string = LLXmlTree::addAttributeString("cross_wearable");
|
||||||
if (!node->getFastAttributeBOOL(cross_wearable_string, mCrossWearable))
|
if (!node->getFastAttributeBOOL(cross_wearable_string, mCrossWearable))
|
||||||
{
|
{
|
||||||
mCrossWearable = FALSE;
|
mCrossWearable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optional camera offsets from the current joint center. Used for generating "hints" (thumbnails).
|
// Optional camera offsets from the current joint center. Used for generating "hints" (thumbnails).
|
||||||
|
|
@ -107,7 +107,7 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||||
|
|
||||||
params_loaded++;
|
params_loaded++;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ void LLViewerVisualParamInfo::toStream(std::ostream &out)
|
/*virtual*/ void LLViewerVisualParamInfo::toStream(std::ostream &out)
|
||||||
|
|
@ -146,17 +146,17 @@ LLViewerVisualParam::~LLViewerVisualParam()
|
||||||
// setInfo()
|
// setInfo()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
|
bool LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
|
||||||
{
|
{
|
||||||
llassert(mInfo == NULL);
|
llassert(mInfo == NULL);
|
||||||
if (info->mID < 0)
|
if (info->mID < 0)
|
||||||
return FALSE;
|
return false;
|
||||||
mInfo = info;
|
mInfo = info;
|
||||||
mID = info->mID;
|
mID = info->mID;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setWeight(getDefaultWeight());
|
//setWeight(getDefaultWeight());
|
||||||
setWeight(getDefaultWeight(), FALSE);
|
setWeight(getDefaultWeight(), false);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -168,14 +168,14 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseData()
|
// parseData()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLViewerVisualParam::parseData(LLXmlTreeNode *node)
|
bool LLViewerVisualParam::parseData(LLXmlTreeNode *node)
|
||||||
{
|
{
|
||||||
LLViewerVisualParamInfo* info = new LLViewerVisualParamInfo;
|
LLViewerVisualParamInfo* info = new LLViewerVisualParamInfo;
|
||||||
|
|
||||||
info->parseXml(node);
|
info->parseXml(node);
|
||||||
if (!setInfo(info))
|
if (!setInfo(info))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -43,19 +43,19 @@ public:
|
||||||
LLViewerVisualParamInfo();
|
LLViewerVisualParamInfo();
|
||||||
/*virtual*/ ~LLViewerVisualParamInfo();
|
/*virtual*/ ~LLViewerVisualParamInfo();
|
||||||
|
|
||||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||||
|
|
||||||
/*virtual*/ void toStream(std::ostream &out);
|
/*virtual*/ void toStream(std::ostream &out);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
S32 mWearableType;
|
S32 mWearableType;
|
||||||
BOOL mCrossWearable;
|
bool mCrossWearable;
|
||||||
std::string mEditGroup;
|
std::string mEditGroup;
|
||||||
F32 mCamDist;
|
F32 mCamDist;
|
||||||
F32 mCamAngle; // degrees
|
F32 mCamAngle; // degrees
|
||||||
F32 mCamElevation;
|
F32 mCamElevation;
|
||||||
F32 mEditGroupDisplayOrder;
|
F32 mEditGroupDisplayOrder;
|
||||||
BOOL mShowSimple; // show edit controls when in "simple ui" mode?
|
bool mShowSimple; // show edit controls when in "simple ui" mode?
|
||||||
F32 mSimpleMin; // when in simple UI, apply this minimum, range 0.f to 100.f
|
F32 mSimpleMin; // when in simple UI, apply this minimum, range 0.f to 100.f
|
||||||
F32 mSimpleMax; // when in simple UI, apply this maximum, range 0.f to 100.f
|
F32 mSimpleMax; // when in simple UI, apply this maximum, range 0.f to 100.f
|
||||||
};
|
};
|
||||||
|
|
@ -75,12 +75,12 @@ public:
|
||||||
// Special: These functions are overridden by child classes
|
// Special: These functions are overridden by child classes
|
||||||
LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; };
|
LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; };
|
||||||
// This sets mInfo and calls initialization functions
|
// This sets mInfo and calls initialization functions
|
||||||
BOOL setInfo(LLViewerVisualParamInfo *info);
|
bool setInfo(LLViewerVisualParamInfo *info);
|
||||||
|
|
||||||
virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
|
virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
|
||||||
|
|
||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||||
|
|
||||||
// New Virtual functions
|
// New Virtual functions
|
||||||
virtual F32 getTotalDistortion() = 0;
|
virtual F32 getTotalDistortion() = 0;
|
||||||
|
|
@ -99,11 +99,11 @@ public:
|
||||||
F32 getCameraAngle() const { return getInfo()->mCamAngle; } // degrees
|
F32 getCameraAngle() const { return getInfo()->mCamAngle; } // degrees
|
||||||
F32 getCameraElevation() const { return getInfo()->mCamElevation; }
|
F32 getCameraElevation() const { return getInfo()->mCamElevation; }
|
||||||
|
|
||||||
BOOL getShowSimple() const { return getInfo()->mShowSimple; }
|
bool getShowSimple() const { return getInfo()->mShowSimple; }
|
||||||
F32 getSimpleMin() const { return getInfo()->mSimpleMin; }
|
F32 getSimpleMin() const { return getInfo()->mSimpleMin; }
|
||||||
F32 getSimpleMax() const { return getInfo()->mSimpleMax; }
|
F32 getSimpleMax() const { return getInfo()->mSimpleMax; }
|
||||||
|
|
||||||
BOOL getCrossWearable() const { return getInfo()->mCrossWearable; }
|
bool getCrossWearable() const { return getInfo()->mCrossWearable; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LLViewerVisualParam(const LLViewerVisualParam& pOther);
|
LLViewerVisualParam(const LLViewerVisualParam& pOther);
|
||||||
|
|
|
||||||
|
|
@ -89,16 +89,16 @@ LLAssetType::EType LLWearable::getAssetType() const
|
||||||
return LLWearableType::getInstance()->getAssetType(mType);
|
return LLWearableType::getInstance()->getAssetType(mType);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLWearable::exportFile(const std::string& filename) const
|
bool LLWearable::exportFile(const std::string& filename) const
|
||||||
{
|
{
|
||||||
llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
|
llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
|
||||||
return ofs.is_open() && exportStream(ofs);
|
return ofs.is_open() && exportStream(ofs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
BOOL LLWearable::exportStream( std::ostream& output_stream ) const
|
bool LLWearable::exportStream( std::ostream& output_stream ) const
|
||||||
{
|
{
|
||||||
if (!output_stream.good()) return FALSE;
|
if (!output_stream.good()) return false;
|
||||||
|
|
||||||
// header and version
|
// header and version
|
||||||
output_stream << "LLWearable version " << mDefinitionVersion << "\n";
|
output_stream << "LLWearable version " << mDefinitionVersion << "\n";
|
||||||
|
|
@ -110,13 +110,13 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const
|
||||||
// permissions
|
// permissions
|
||||||
if( !mPermissions.exportLegacyStream( output_stream ) )
|
if( !mPermissions.exportLegacyStream( output_stream ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sale info
|
// sale info
|
||||||
if( !mSaleInfo.exportLegacyStream( output_stream ) )
|
if( !mSaleInfo.exportLegacyStream( output_stream ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// wearable type
|
// wearable type
|
||||||
|
|
@ -142,7 +142,7 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const
|
||||||
const LLUUID& image_id = te_pair.second->getID();
|
const LLUUID& image_id = te_pair.second->getID();
|
||||||
output_stream << te << " " << image_id << "\n";
|
output_stream << te << " " << image_id << "\n";
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
|
void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
|
||||||
|
|
@ -310,7 +310,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
||||||
// permissions. Thus, we read that out, and fix legacy
|
// permissions. Thus, we read that out, and fix legacy
|
||||||
// objects. It's possible this op would fail, but it should pick
|
// objects. It's possible this op would fail, but it should pick
|
||||||
// up the vast majority of the tasks.
|
// up the vast majority of the tasks.
|
||||||
BOOL has_perm_mask = FALSE;
|
bool has_perm_mask = false;
|
||||||
U32 perm_mask = 0;
|
U32 perm_mask = 0;
|
||||||
if( !mSaleInfo.importLegacyStream(input_stream, has_perm_mask, perm_mask) )
|
if( !mSaleInfo.importLegacyStream(input_stream, has_perm_mask, perm_mask) )
|
||||||
{
|
{
|
||||||
|
|
@ -472,11 +472,11 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
||||||
return LLWearable::SUCCESS;
|
return LLWearable::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLWearable::getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size)
|
bool LLWearable::getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size)
|
||||||
{
|
{
|
||||||
if (!input_stream.good())
|
if (!input_stream.good())
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
@ -554,8 +554,8 @@ void LLWearable::revertValues()
|
||||||
{
|
{
|
||||||
F32 value = vp_pair.second;
|
F32 value = vp_pair.second;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//param->setWeight(value);
|
//setVisualParamWeight(id, value);
|
||||||
param->setWeight(value, TRUE);
|
setVisualParamWeight(id, value, true);
|
||||||
mSavedVisualParamMap[id] = param->getWeight();
|
mSavedVisualParamMap[id] = param->getWeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -641,7 +641,7 @@ void LLWearable::addVisualParam(LLVisualParam *param)
|
||||||
{
|
{
|
||||||
delete mVisualParamIndexMap[param->getID()];
|
delete mVisualParamIndexMap[param->getID()];
|
||||||
}
|
}
|
||||||
param->setIsDummy(FALSE);
|
param->setIsDummy(false);
|
||||||
param->setParamLocation(LOC_WEARABLE);
|
param->setParamLocation(LOC_WEARABLE);
|
||||||
mVisualParamIndexMap[param->getID()] = param;
|
mVisualParamIndexMap[param->getID()] = param;
|
||||||
mSavedVisualParamMap[param->getID()] = param->getDefaultWeight();
|
mSavedVisualParamMap[param->getID()] = param->getDefaultWeight();
|
||||||
|
|
@ -650,7 +650,7 @@ void LLWearable::addVisualParam(LLVisualParam *param)
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLWearable::setVisualParamWeight(S32 param_index, F32 value)
|
//void LLWearable::setVisualParamWeight(S32 param_index, F32 value)
|
||||||
void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_bake)
|
void LLWearable::setVisualParamWeight(S32 param_index, F32 value, bool upload_bake)
|
||||||
{
|
{
|
||||||
if( is_in_map(mVisualParamIndexMap, param_index ) )
|
if( is_in_map(mVisualParamIndexMap, param_index ) )
|
||||||
{
|
{
|
||||||
|
|
@ -697,7 +697,7 @@ void LLWearable::getVisualParams(visual_param_vec_t &list)
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLWearable::animateParams(F32 delta)
|
//void LLWearable::animateParams(F32 delta)
|
||||||
void LLWearable::animateParams(F32 delta, BOOL upload_bake)
|
void LLWearable::animateParams(F32 delta, bool upload_bake)
|
||||||
{
|
{
|
||||||
for(visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap)
|
for(visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap)
|
||||||
{
|
{
|
||||||
|
|
@ -724,7 +724,7 @@ LLColor4 LLWearable::getClothesColor(S32 te) const
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLWearable::setClothesColor( S32 te, const LLColor4& new_color)
|
//void LLWearable::setClothesColor( S32 te, const LLColor4& new_color)
|
||||||
void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake)
|
void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake)
|
||||||
{
|
{
|
||||||
U32 param_name[3];
|
U32 param_name[3];
|
||||||
if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) )
|
if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) )
|
||||||
|
|
@ -754,7 +754,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//avatarp->setVisualParamWeight( param_id, weight);
|
//avatarp->setVisualParamWeight( param_id, weight);
|
||||||
avatarp->setVisualParamWeight( param_id, weight, FALSE);
|
avatarp->setVisualParamWeight( param_id, weight, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -763,7 +763,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
|
||||||
std::string terse_F32_to_string(F32 f)
|
std::string terse_F32_to_string(F32 f)
|
||||||
{
|
{
|
||||||
std::string r = llformat("%.2f", f);
|
std::string r = llformat("%.2f", f);
|
||||||
S32 len = r.length();
|
auto len = r.length();
|
||||||
|
|
||||||
// "1.20" -> "1.2"
|
// "1.20" -> "1.2"
|
||||||
// "24.00" -> "24."
|
// "24.00" -> "24."
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,9 @@ public:
|
||||||
SUCCESS,
|
SUCCESS,
|
||||||
BAD_HEADER
|
BAD_HEADER
|
||||||
};
|
};
|
||||||
BOOL exportFile(const std::string& filename) const;
|
bool exportFile(const std::string& filename) const;
|
||||||
EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp );
|
EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp );
|
||||||
virtual BOOL exportStream( std::ostream& output_stream ) const;
|
virtual bool exportStream( std::ostream& output_stream ) const;
|
||||||
virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp );
|
virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp );
|
||||||
|
|
||||||
static void setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; }
|
static void setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; }
|
||||||
|
|
@ -112,18 +112,18 @@ public:
|
||||||
void addVisualParam(LLVisualParam *param);
|
void addVisualParam(LLVisualParam *param);
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void setVisualParamWeight(S32 index, F32 value);
|
//void setVisualParamWeight(S32 index, F32 value);
|
||||||
void setVisualParamWeight(S32 index, F32 value, BOOL upload_bake);
|
void setVisualParamWeight(S32 index, F32 value, bool upload_bake);
|
||||||
F32 getVisualParamWeight(S32 index) const;
|
F32 getVisualParamWeight(S32 index) const;
|
||||||
LLVisualParam* getVisualParam(S32 index) const;
|
LLVisualParam* getVisualParam(S32 index) const;
|
||||||
void getVisualParams(visual_param_vec_t &list);
|
void getVisualParams(visual_param_vec_t &list);
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void animateParams(F32 delta);
|
//void animateParams(F32 delta);
|
||||||
void animateParams(F32 delta, BOOL upload_bake);
|
void animateParams(F32 delta, bool upload_bake);
|
||||||
|
|
||||||
LLColor4 getClothesColor(S32 te) const;
|
LLColor4 getClothesColor(S32 te) const;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void setClothesColor( S32 te, const LLColor4& new_color);
|
//void setClothesColor( S32 te, const LLColor4& new_color);
|
||||||
void setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake);
|
void setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake);
|
||||||
|
|
||||||
virtual void revertValues();
|
virtual void revertValues();
|
||||||
virtual void saveValues();
|
virtual void saveValues();
|
||||||
|
|
@ -144,7 +144,7 @@ protected:
|
||||||
void destroyTextures();
|
void destroyTextures();
|
||||||
void createVisualParams(LLAvatarAppearance *avatarp);
|
void createVisualParams(LLAvatarAppearance *avatarp);
|
||||||
void createLayers(S32 te, LLAvatarAppearance *avatarp);
|
void createLayers(S32 te, LLAvatarAppearance *avatarp);
|
||||||
BOOL getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size);
|
bool getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size);
|
||||||
|
|
||||||
static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml.
|
static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml.
|
||||||
S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created.
|
S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created.
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL
|
||||||
{
|
{
|
||||||
wearable_vec[index] = wearable;
|
wearable_vec[index] = wearable;
|
||||||
old_wearable->setUpdated();
|
old_wearable->setUpdated();
|
||||||
const BOOL removed = FALSE;
|
const bool removed = false;
|
||||||
wearableUpdated(wearable, removed);
|
wearableUpdated(wearable, removed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -116,14 +116,14 @@ void LLWearableData::pushWearable(const LLWearableType::EType type,
|
||||||
// mWearableDatas[type].push_back(wearable); mWearableDatas[type].push_back(wearable);
|
// mWearableDatas[type].push_back(wearable); mWearableDatas[type].push_back(wearable);
|
||||||
if (trigger_updated)
|
if (trigger_updated)
|
||||||
{
|
{
|
||||||
const BOOL removed = FALSE;
|
const bool removed = false;
|
||||||
wearableUpdated(wearable, removed);
|
wearableUpdated(wearable, removed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed)
|
void LLWearableData::wearableUpdated(LLWearable *wearable, bool removed)
|
||||||
{
|
{
|
||||||
wearable->setUpdated();
|
wearable->setUpdated();
|
||||||
if (!removed)
|
if (!removed)
|
||||||
|
|
@ -155,7 +155,7 @@ void LLWearableData::eraseWearable(const LLWearableType::EType type, U32 index)
|
||||||
if (wearable)
|
if (wearable)
|
||||||
{
|
{
|
||||||
mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
|
mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
|
||||||
const BOOL removed = TRUE;
|
const bool removed = true;
|
||||||
wearableUpdated(wearable, removed);
|
wearableUpdated(wearable, removed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -211,11 +211,11 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const
|
bool LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const
|
||||||
{
|
{
|
||||||
if (wearable == NULL)
|
if (wearable == NULL)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LLWearableType::EType type = wearable->getType();
|
const LLWearableType::EType type = wearable->getType();
|
||||||
|
|
@ -223,7 +223,7 @@ BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_fou
|
||||||
if (wearable_iter == mWearableDatas.end())
|
if (wearable_iter == mWearableDatas.end())
|
||||||
{
|
{
|
||||||
LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL;
|
LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
||||||
for(U32 index = 0; index < wearable_vec.size(); index++)
|
for(U32 index = 0; index < wearable_vec.size(); index++)
|
||||||
|
|
@ -231,11 +231,11 @@ BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_fou
|
||||||
if (wearable_vec[index] == wearable)
|
if (wearable_vec[index] == wearable)
|
||||||
{
|
{
|
||||||
index_found = index;
|
index_found = index;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 LLWearableData::getClothingLayerCount() const
|
U32 LLWearableData::getClothingLayerCount() const
|
||||||
|
|
@ -253,7 +253,7 @@ U32 LLWearableData::getClothingLayerCount() const
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const
|
bool LLWearableData::canAddWearable(const LLWearableType::EType type) const
|
||||||
{
|
{
|
||||||
LLAssetType::EType a_type = LLWearableType::getInstance()->getAssetType(type);
|
LLAssetType::EType a_type = LLWearableType::getInstance()->getAssetType(type);
|
||||||
if (a_type==LLAssetType::AT_CLOTHING)
|
if (a_type==LLAssetType::AT_CLOTHING)
|
||||||
|
|
@ -267,13 +267,13 @@ BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLWearableData::isOnTop(LLWearable* wearable) const
|
bool LLWearableData::isOnTop(LLWearable* wearable) const
|
||||||
{
|
{
|
||||||
if (!wearable) return FALSE;
|
if (!wearable) return false;
|
||||||
const LLWearableType::EType type = wearable->getType();
|
const LLWearableType::EType type = wearable->getType();
|
||||||
return ( getTopWearable(type) == wearable );
|
return ( getTopWearable(type) == wearable );
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +346,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
||||||
return wearable_vec.size();
|
return static_cast<U32>(wearable_vec.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 LLWearableData::getWearableCount(const U32 tex_index) const
|
U32 LLWearableData::getWearableCount(const U32 tex_index) const
|
||||||
|
|
@ -357,7 +357,7 @@ U32 LLWearableData::getWearableCount(const U32 tex_index) const
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
LLUUID LLWearableData::computeBakedTextureHash(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index,
|
LLUUID LLWearableData::computeBakedTextureHash(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index,
|
||||||
BOOL generate_valid_hash) // Set to false if you want to upload the baked texture w/o putting it in the cache
|
bool generate_valid_hash) // Set to false if you want to upload the baked texture w/o putting it in the cache
|
||||||
{
|
{
|
||||||
LLUUID hash_id;
|
LLUUID hash_id;
|
||||||
bool hash_computed = false;
|
bool hash_computed = false;
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,11 @@ public:
|
||||||
const LLWearable* getBottomWearable(const LLWearableType::EType type) const;
|
const LLWearable* getBottomWearable(const LLWearableType::EType type) const;
|
||||||
U32 getWearableCount(const LLWearableType::EType type) const;
|
U32 getWearableCount(const LLWearableType::EType type) const;
|
||||||
U32 getWearableCount(const U32 tex_index) const;
|
U32 getWearableCount(const U32 tex_index) const;
|
||||||
BOOL getWearableIndex(const LLWearable *wearable, U32& index) const;
|
bool getWearableIndex(const LLWearable *wearable, U32& index) const;
|
||||||
U32 getClothingLayerCount() const;
|
U32 getClothingLayerCount() const;
|
||||||
BOOL canAddWearable(const LLWearableType::EType type) const;
|
bool canAddWearable(const LLWearableType::EType type) const;
|
||||||
|
|
||||||
BOOL isOnTop(LLWearable* wearable) const;
|
bool isOnTop(LLWearable* wearable) const;
|
||||||
|
|
||||||
static const U32 MAX_CLOTHING_LAYERS = 60;
|
static const U32 MAX_CLOTHING_LAYERS = 60;
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ protected:
|
||||||
void setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable);
|
void setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable);
|
||||||
void pushWearable(const LLWearableType::EType type, LLWearable *wearable,
|
void pushWearable(const LLWearableType::EType type, LLWearable *wearable,
|
||||||
bool trigger_updated = true);
|
bool trigger_updated = true);
|
||||||
virtual void wearableUpdated(LLWearable *wearable, BOOL removed);
|
virtual void wearableUpdated(LLWearable *wearable, bool removed);
|
||||||
void eraseWearable(LLWearable *wearable);
|
void eraseWearable(LLWearable *wearable);
|
||||||
void eraseWearable(const LLWearableType::EType type, U32 index);
|
void eraseWearable(const LLWearableType::EType type, U32 index);
|
||||||
// void clearWearableType(const LLWearableType::EType type);
|
// void clearWearableType(const LLWearableType::EType type);
|
||||||
|
|
@ -91,7 +91,7 @@ private:
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
LLUUID computeBakedTextureHash(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index,
|
LLUUID computeBakedTextureHash(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index,
|
||||||
BOOL generate_valid_hash = TRUE);
|
bool generate_valid_hash = true);
|
||||||
protected:
|
protected:
|
||||||
virtual void invalidateBakedTextureHash(LLMD5& hash) const {}
|
virtual void invalidateBakedTextureHash(LLMD5& hash) const {}
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
|
|
|
||||||
|
|
@ -32,30 +32,30 @@
|
||||||
|
|
||||||
LLWearableType::LLWearableDictionary::LLWearableDictionary(LLTranslationBridge::ptr_t& trans)
|
LLWearableType::LLWearableDictionary::LLWearableDictionary(LLTranslationBridge::ptr_t& trans)
|
||||||
{
|
{
|
||||||
addEntry(LLWearableType::WT_SHAPE, new WearableEntry(trans, "shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SHAPE, FALSE, FALSE));
|
addEntry(LLWearableType::WT_SHAPE, new WearableEntry(trans, "shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SHAPE, false, false));
|
||||||
addEntry(LLWearableType::WT_SKIN, new WearableEntry(trans, "skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SKIN, FALSE, FALSE));
|
addEntry(LLWearableType::WT_SKIN, new WearableEntry(trans, "skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SKIN, false, false));
|
||||||
addEntry(LLWearableType::WT_HAIR, new WearableEntry(trans, "hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_HAIR, FALSE, FALSE));
|
addEntry(LLWearableType::WT_HAIR, new WearableEntry(trans, "hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_HAIR, false, false));
|
||||||
addEntry(LLWearableType::WT_EYES, new WearableEntry(trans, "eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_EYES, FALSE, FALSE));
|
addEntry(LLWearableType::WT_EYES, new WearableEntry(trans, "eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_EYES, false, false));
|
||||||
addEntry(LLWearableType::WT_SHIRT, new WearableEntry(trans, "shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHIRT, FALSE, TRUE));
|
addEntry(LLWearableType::WT_SHIRT, new WearableEntry(trans, "shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHIRT, false, true));
|
||||||
addEntry(LLWearableType::WT_PANTS, new WearableEntry(trans, "pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PANTS, FALSE, TRUE));
|
addEntry(LLWearableType::WT_PANTS, new WearableEntry(trans, "pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PANTS, false, true));
|
||||||
addEntry(LLWearableType::WT_SHOES, new WearableEntry(trans, "shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHOES, FALSE, TRUE));
|
addEntry(LLWearableType::WT_SHOES, new WearableEntry(trans, "shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHOES, false, true));
|
||||||
addEntry(LLWearableType::WT_SOCKS, new WearableEntry(trans, "socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SOCKS, FALSE, TRUE));
|
addEntry(LLWearableType::WT_SOCKS, new WearableEntry(trans, "socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SOCKS, false, true));
|
||||||
addEntry(LLWearableType::WT_JACKET, new WearableEntry(trans, "jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_JACKET, FALSE, TRUE));
|
addEntry(LLWearableType::WT_JACKET, new WearableEntry(trans, "jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_JACKET, false, true));
|
||||||
addEntry(LLWearableType::WT_GLOVES, new WearableEntry(trans, "gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_GLOVES, FALSE, TRUE));
|
addEntry(LLWearableType::WT_GLOVES, new WearableEntry(trans, "gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_GLOVES, false, true));
|
||||||
addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry(trans, "undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERSHIRT, FALSE, TRUE));
|
addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry(trans, "undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERSHIRT, false, true));
|
||||||
addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(trans, "underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERPANTS, FALSE, TRUE));
|
addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(trans, "underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERPANTS, false, true));
|
||||||
addEntry(LLWearableType::WT_SKIRT, new WearableEntry(trans, "skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE));
|
addEntry(LLWearableType::WT_SKIRT, new WearableEntry(trans, "skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, false, true));
|
||||||
addEntry(LLWearableType::WT_ALPHA, new WearableEntry(trans, "alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE));
|
addEntry(LLWearableType::WT_ALPHA, new WearableEntry(trans, "alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, false, true));
|
||||||
addEntry(LLWearableType::WT_TATTOO, new WearableEntry(trans, "tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE));
|
addEntry(LLWearableType::WT_TATTOO, new WearableEntry(trans, "tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, false, true));
|
||||||
addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(trans, "universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, FALSE, TRUE));
|
addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(trans, "universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, false, true));
|
||||||
|
|
||||||
// [SL:KB] - Patch: Appearance-Misc | Checked: 2011-05-29 (Catznip-2.6)
|
// [SL:KB] - Patch: Appearance-Misc | Checked: 2011-05-29 (Catznip-2.6)
|
||||||
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, FALSE));
|
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, true, false));
|
||||||
// [/SL:KB]
|
// [/SL:KB]
|
||||||
// addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE));
|
// addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, true, true));
|
||||||
|
|
||||||
addEntry(LLWearableType::WT_INVALID, new WearableEntry(trans, "invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_UNKNOWN, FALSE, FALSE));
|
addEntry(LLWearableType::WT_INVALID, new WearableEntry(trans, "invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_UNKNOWN, false, false));
|
||||||
addEntry(LLWearableType::WT_NONE, new WearableEntry(trans, "none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE));
|
addEntry(LLWearableType::WT_NONE, new WearableEntry(trans, "none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, false, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -115,17 +115,17 @@ LLInventoryType::EIconName LLWearableType::getIconName(LLWearableType::EType typ
|
||||||
return entry->mIconName;
|
return entry->mIconName;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type)
|
bool LLWearableType::getDisableCameraSwitch(LLWearableType::EType type)
|
||||||
{
|
{
|
||||||
const WearableEntry *entry = mDictionary.lookup(type);
|
const WearableEntry *entry = mDictionary.lookup(type);
|
||||||
if (!entry) return FALSE;
|
if (!entry) return false;
|
||||||
return entry->mDisableCameraSwitch;
|
return entry->mDisableCameraSwitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type)
|
bool LLWearableType::getAllowMultiwear(LLWearableType::EType type)
|
||||||
{
|
{
|
||||||
const WearableEntry *entry = mDictionary.lookup(type);
|
const WearableEntry *entry = mDictionary.lookup(type);
|
||||||
if (!entry) return FALSE;
|
if (!entry) return false;
|
||||||
return entry->mAllowMultiwear;
|
return entry->mAllowMultiwear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,8 @@ public:
|
||||||
LLAssetType::EType getAssetType(EType type);
|
LLAssetType::EType getAssetType(EType type);
|
||||||
EType typeNameToType(const std::string& type_name);
|
EType typeNameToType(const std::string& type_name);
|
||||||
LLInventoryType::EIconName getIconName(EType type);
|
LLInventoryType::EIconName getIconName(EType type);
|
||||||
BOOL getDisableCameraSwitch(EType type);
|
bool getDisableCameraSwitch(EType type);
|
||||||
BOOL getAllowMultiwear(EType type);
|
bool getAllowMultiwear(EType type);
|
||||||
|
|
||||||
static EType inventoryFlagsToWearableType(U32 flags);
|
static EType inventoryFlagsToWearableType(U32 flags);
|
||||||
|
|
||||||
|
|
@ -85,8 +85,8 @@ private:
|
||||||
const std::string& default_new_name,
|
const std::string& default_new_name,
|
||||||
LLAssetType::EType assetType,
|
LLAssetType::EType assetType,
|
||||||
LLInventoryType::EIconName iconName,
|
LLInventoryType::EIconName iconName,
|
||||||
BOOL disable_camera_switch = FALSE,
|
bool disable_camera_switch = false,
|
||||||
BOOL allow_multiwear = TRUE) :
|
bool allow_multiwear = true) :
|
||||||
LLDictionaryEntry(name),
|
LLDictionaryEntry(name),
|
||||||
mAssetType(assetType),
|
mAssetType(assetType),
|
||||||
mDefaultNewName(default_new_name),
|
mDefaultNewName(default_new_name),
|
||||||
|
|
@ -101,8 +101,8 @@ private:
|
||||||
const std::string mLabel;
|
const std::string mLabel;
|
||||||
const std::string mDefaultNewName;
|
const std::string mDefaultNewName;
|
||||||
LLInventoryType::EIconName mIconName;
|
LLInventoryType::EIconName mIconName;
|
||||||
BOOL mDisableCameraSwitch;
|
bool mDisableCameraSwitch;
|
||||||
BOOL mAllowMultiwear;
|
bool mAllowMultiwear;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLWearableDictionary : public LLDictionary<LLWearableType::EType, WearableEntry>
|
class LLWearableDictionary : public LLDictionary<LLWearableType::EType, WearableEntry>
|
||||||
|
|
|
||||||
|
|
@ -70,22 +70,22 @@ public:
|
||||||
|
|
||||||
LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename);
|
LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename);
|
||||||
|
|
||||||
BOOL initDecode();
|
bool initDecode();
|
||||||
BOOL decodeSection(); // Return TRUE if done.
|
bool decodeSection(); // Return true if done.
|
||||||
BOOL finishDecode();
|
bool finishDecode();
|
||||||
|
|
||||||
void flushBadFile();
|
void flushBadFile();
|
||||||
|
|
||||||
void ioComplete(S32 bytes) { mBytesRead = bytes; }
|
void ioComplete(S32 bytes) { mBytesRead = bytes; }
|
||||||
BOOL isValid() const { return mValid; }
|
bool isValid() const { return mValid; }
|
||||||
BOOL isDone() const { return mDone; }
|
bool isDone() const { return mDone; }
|
||||||
const LLUUID &getUUID() const { return mUUID; }
|
const LLUUID &getUUID() const { return mUUID; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~LLVorbisDecodeState();
|
virtual ~LLVorbisDecodeState();
|
||||||
|
|
||||||
BOOL mValid;
|
bool mValid;
|
||||||
BOOL mDone;
|
bool mDone;
|
||||||
LLAtomicS32 mBytesRead;
|
LLAtomicS32 mBytesRead;
|
||||||
LLUUID mUUID;
|
LLUUID mUUID;
|
||||||
|
|
||||||
|
|
@ -164,8 +164,8 @@ long cache_tell (void *datasource)
|
||||||
|
|
||||||
LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename)
|
LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename)
|
||||||
{
|
{
|
||||||
mDone = FALSE;
|
mDone = false;
|
||||||
mValid = FALSE;
|
mValid = false;
|
||||||
mBytesRead = -1;
|
mBytesRead = -1;
|
||||||
mUUID = uuid;
|
mUUID = uuid;
|
||||||
mInFilep = NULL;
|
mInFilep = NULL;
|
||||||
|
|
@ -188,7 +188,7 @@ LLVorbisDecodeState::~LLVorbisDecodeState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLVorbisDecodeState::initDecode()
|
bool LLVorbisDecodeState::initDecode()
|
||||||
{
|
{
|
||||||
ov_callbacks cache_callbacks;
|
ov_callbacks cache_callbacks;
|
||||||
cache_callbacks.read_func = cache_read;
|
cache_callbacks.read_func = cache_read;
|
||||||
|
|
@ -204,14 +204,14 @@ BOOL LLVorbisDecodeState::initDecode()
|
||||||
LL_WARNS("AudioEngine") << "unable to open vorbis source vfile for reading" << LL_ENDL;
|
LL_WARNS("AudioEngine") << "unable to open vorbis source vfile for reading" << LL_ENDL;
|
||||||
delete mInFilep;
|
delete mInFilep;
|
||||||
mInFilep = NULL;
|
mInFilep = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
S32 r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, cache_callbacks);
|
S32 r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, cache_callbacks);
|
||||||
if(r < 0)
|
if(r < 0)
|
||||||
{
|
{
|
||||||
LL_WARNS("AudioEngine") << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL;
|
LL_WARNS("AudioEngine") << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL;
|
||||||
return(FALSE);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
S32 sample_count = (S32)ov_pcm_total(&mVF, -1);
|
S32 sample_count = (S32)ov_pcm_total(&mVF, -1);
|
||||||
|
|
@ -260,7 +260,7 @@ BOOL LLVorbisDecodeState::initDecode()
|
||||||
}
|
}
|
||||||
delete mInFilep;
|
delete mInFilep;
|
||||||
mInFilep = NULL;
|
mInFilep = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -273,7 +273,7 @@ BOOL LLVorbisDecodeState::initDecode()
|
||||||
LL_WARNS("AudioEngine") << "Out of memory when trying to alloc buffer: " << size_guess << LL_ENDL;
|
LL_WARNS("AudioEngine") << "Out of memory when trying to alloc buffer: " << size_guess << LL_ENDL;
|
||||||
delete mInFilep;
|
delete mInFilep;
|
||||||
mInFilep = NULL;
|
mInFilep = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -360,31 +360,31 @@ BOOL LLVorbisDecodeState::initDecode()
|
||||||
// fprintf(stderr,"\nDecoded length: %ld samples\n", (long)ov_pcm_total(&vf,-1));
|
// fprintf(stderr,"\nDecoded length: %ld samples\n", (long)ov_pcm_total(&vf,-1));
|
||||||
// fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
|
// fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
|
||||||
//}
|
//}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLVorbisDecodeState::decodeSection()
|
bool LLVorbisDecodeState::decodeSection()
|
||||||
{
|
{
|
||||||
if (!mInFilep)
|
if (!mInFilep)
|
||||||
{
|
{
|
||||||
LL_WARNS("AudioEngine") << "No cache file to decode in vorbis!" << LL_ENDL;
|
LL_WARNS("AudioEngine") << "No cache file to decode in vorbis!" << LL_ENDL;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
if (mDone)
|
if (mDone)
|
||||||
{
|
{
|
||||||
// LL_WARNS("AudioEngine") << "Already done with decode, aborting!" << LL_ENDL;
|
// LL_WARNS("AudioEngine") << "Already done with decode, aborting!" << LL_ENDL;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
char pcmout[4096]; /*Flawfinder: ignore*/
|
char pcmout[4096]; /*Flawfinder: ignore*/
|
||||||
|
|
||||||
BOOL eof = FALSE;
|
bool eof = false;
|
||||||
long ret=ov_read(&mVF, pcmout, sizeof(pcmout), 0, 2, 1, &mCurrentSection);
|
long ret=ov_read(&mVF, pcmout, sizeof(pcmout), 0, 2, 1, &mCurrentSection);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
/* EOF */
|
/* EOF */
|
||||||
eof = TRUE;
|
eof = true;
|
||||||
mDone = TRUE;
|
mDone = true;
|
||||||
mValid = TRUE;
|
mValid = true;
|
||||||
// LL_INFOS("AudioEngine") << "Vorbis EOF" << LL_ENDL;
|
// LL_INFOS("AudioEngine") << "Vorbis EOF" << LL_ENDL;
|
||||||
}
|
}
|
||||||
else if (ret < 0)
|
else if (ret < 0)
|
||||||
|
|
@ -394,10 +394,10 @@ BOOL LLVorbisDecodeState::decodeSection()
|
||||||
|
|
||||||
LL_WARNS("AudioEngine") << "BAD vorbis decode in decodeSection." << LL_ENDL;
|
LL_WARNS("AudioEngine") << "BAD vorbis decode in decodeSection." << LL_ENDL;
|
||||||
|
|
||||||
mValid = FALSE;
|
mValid = false;
|
||||||
mDone = TRUE;
|
mDone = true;
|
||||||
// We're done, return TRUE.
|
// We're done, return true.
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -409,12 +409,12 @@ BOOL LLVorbisDecodeState::decodeSection()
|
||||||
return eof;
|
return eof;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLVorbisDecodeState::finishDecode()
|
bool LLVorbisDecodeState::finishDecode()
|
||||||
{
|
{
|
||||||
if (!isValid())
|
if (!isValid())
|
||||||
{
|
{
|
||||||
LL_WARNS("AudioEngine") << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << LL_ENDL;
|
LL_WARNS("AudioEngine") << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << LL_ENDL;
|
||||||
return TRUE; // We've finished
|
return true; // We've finished
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mFileHandle == LLLFSThread::nullHandle())
|
if (mFileHandle == LLLFSThread::nullHandle())
|
||||||
|
|
@ -422,7 +422,7 @@ BOOL LLVorbisDecodeState::finishDecode()
|
||||||
ov_clear(&mVF);
|
ov_clear(&mVF);
|
||||||
|
|
||||||
// write "data" chunk length, in little-endian format
|
// write "data" chunk length, in little-endian format
|
||||||
S32 data_length = mWAVBuffer.size() - WAV_HEADER_SIZE;
|
S32 data_length = static_cast<S32>(mWAVBuffer.size()) - WAV_HEADER_SIZE;
|
||||||
mWAVBuffer[40] = (data_length) & 0x000000FF;
|
mWAVBuffer[40] = (data_length) & 0x000000FF;
|
||||||
mWAVBuffer[41] = (data_length >> 8) & 0x000000FF;
|
mWAVBuffer[41] = (data_length >> 8) & 0x000000FF;
|
||||||
mWAVBuffer[42] = (data_length >> 16) & 0x000000FF;
|
mWAVBuffer[42] = (data_length >> 16) & 0x000000FF;
|
||||||
|
|
@ -463,7 +463,7 @@ BOOL LLVorbisDecodeState::finishDecode()
|
||||||
{
|
{
|
||||||
memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/
|
memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/
|
||||||
}
|
}
|
||||||
S32 near_end = mWAVBuffer.size() - (2 * fade_length);
|
S32 near_end = static_cast<S32>(mWAVBuffer.size()) - (2 * fade_length);
|
||||||
if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length))
|
if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length))
|
||||||
{
|
{
|
||||||
memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/
|
memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/
|
||||||
|
|
@ -487,11 +487,11 @@ BOOL LLVorbisDecodeState::finishDecode()
|
||||||
if (36 == data_length)
|
if (36 == data_length)
|
||||||
{
|
{
|
||||||
LL_WARNS("AudioEngine") << "BAD Vorbis decode in finishDecode!" << LL_ENDL;
|
LL_WARNS("AudioEngine") << "BAD Vorbis decode in finishDecode!" << LL_ENDL;
|
||||||
mValid = FALSE;
|
mValid = false;
|
||||||
return TRUE; // we've finished
|
return true; // we've finished
|
||||||
}
|
}
|
||||||
mBytesRead = -1;
|
mBytesRead = -1;
|
||||||
mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, mWAVBuffer.size(),
|
mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, static_cast<S32>(mWAVBuffer.size()),
|
||||||
new WriteResponder(this));
|
new WriteResponder(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -502,21 +502,21 @@ BOOL LLVorbisDecodeState::finishDecode()
|
||||||
if (mBytesRead == 0)
|
if (mBytesRead == 0)
|
||||||
{
|
{
|
||||||
LL_WARNS("AudioEngine") << "Unable to write file in LLVorbisDecodeState::finishDecode" << LL_ENDL;
|
LL_WARNS("AudioEngine") << "Unable to write file in LLVorbisDecodeState::finishDecode" << LL_ENDL;
|
||||||
mValid = FALSE;
|
mValid = false;
|
||||||
return TRUE; // we've finished
|
return true; // we've finished
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return FALSE; // not done
|
return false; // not done
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mDone = TRUE;
|
mDone = true;
|
||||||
|
|
||||||
LL_DEBUGS("AudioEngine") << "Finished decode for " << getUUID() << LL_ENDL;
|
LL_DEBUGS("AudioEngine") << "Finished decode for " << getUUID() << LL_ENDL;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLVorbisDecodeState::flushBadFile()
|
void LLVorbisDecodeState::flushBadFile()
|
||||||
|
|
@ -790,18 +790,18 @@ void LLAudioDecodeMgr::processQueue()
|
||||||
mImpl->processQueue();
|
mImpl->processQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
bool LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||||
{
|
{
|
||||||
// <FS:ND> Protect against corrupted sounds. Just do a quit exit instead of trying to decode over and over.
|
// <FS:ND> Protect against corrupted sounds. Just do a quit exit instead of trying to decode over and over.
|
||||||
if (gAudiop && gAudiop->isCorruptSound(uuid))
|
if (gAudiop && gAudiop->isCorruptSound(uuid))
|
||||||
return FALSE;
|
return false;
|
||||||
// </FS:ND>
|
// </FS:ND>
|
||||||
|
|
||||||
if (gAudiop && gAudiop->hasDecodedFile(uuid))
|
if (gAudiop && gAudiop->hasDecodedFile(uuid))
|
||||||
{
|
{
|
||||||
// Already have a decoded version, don't need to decode it.
|
// Already have a decoded version, don't need to decode it.
|
||||||
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has decoded file already" << LL_ENDL;
|
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has decoded file already" << LL_ENDL;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||||
|
|
@ -816,9 +816,9 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||||
mImpl->mDecodeQueue.push_back(uuid);
|
mImpl->mDecodeQueue.push_back(uuid);
|
||||||
}
|
}
|
||||||
// </FS:Ansariel>
|
// </FS:Ansariel>
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " no file available" << LL_ENDL;
|
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " no file available" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class LLAudioDecodeMgr : public LLSingleton<LLAudioDecodeMgr>
|
||||||
~LLAudioDecodeMgr();
|
~LLAudioDecodeMgr();
|
||||||
public:
|
public:
|
||||||
void processQueue();
|
void processQueue();
|
||||||
BOOL addDecodeRequest(const LLUUID &uuid);
|
bool addDecodeRequest(const LLUUID &uuid);
|
||||||
void addAudioRequest(const LLUUID &uuid);
|
void addAudioRequest(const LLUUID &uuid);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ public:
|
||||||
|
|
||||||
void preload(const LLUUID &audio_id); // Only used for preloading UI sounds, now.
|
void preload(const LLUUID &audio_id); // Only used for preloading UI sounds, now.
|
||||||
|
|
||||||
void addAudioData(LLAudioData *adp, bool set_current = TRUE);
|
void addAudioData(LLAudioData *adp, bool set_current = true);
|
||||||
|
|
||||||
void setForcedPriority(const bool ambient) { mForcedPriority = ambient; }
|
void setForcedPriority(const bool ambient) { mForcedPriority = ambient; }
|
||||||
bool isForcedPriority() const { return mForcedPriority; }
|
bool isForcedPriority() const { return mForcedPriority; }
|
||||||
|
|
|
||||||
|
|
@ -135,10 +135,19 @@ void LLAudioEngine_OpenAL::shutdown()
|
||||||
LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
|
LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
|
||||||
LLAudioEngine::shutdown();
|
LLAudioEngine::shutdown();
|
||||||
|
|
||||||
|
// If a subsequent error occurs while there is still an error recorded
|
||||||
|
// internally, the second error will simply be ignored.
|
||||||
|
// Clear previous error to make sure we will captuare a valid failure reason
|
||||||
|
ALenum error = alutGetError();
|
||||||
|
if (error != ALUT_ERROR_NO_ERROR)
|
||||||
|
{
|
||||||
|
LL_WARNS() << "Uncleared error state prior to shutdown: "
|
||||||
|
<< alutGetErrorString(error) << LL_ENDL;
|
||||||
|
}
|
||||||
|
|
||||||
LL_INFOS() << "About to alutExit()" << LL_ENDL;
|
LL_INFOS() << "About to alutExit()" << LL_ENDL;
|
||||||
if(!alutExit())
|
if(!alutExit())
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Nuts." << LL_ENDL;
|
|
||||||
LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
|
LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -528,7 +537,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
|
||||||
}
|
}
|
||||||
|
|
||||||
alBufferData(buffer,
|
alBufferData(buffer,
|
||||||
AL_FORMAT_STEREO16,
|
AL_FORMAT_STEREO_FLOAT32,
|
||||||
mWindGen->windGenerate(mWindBuf,
|
mWindGen->windGenerate(mWindBuf,
|
||||||
mWindBufSamples),
|
mWindBufSamples),
|
||||||
mWindBufBytes,
|
mWindBufBytes,
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,9 @@ class LLAudioEngine_OpenAL : public LLAudioEngine
|
||||||
/*virtual*/ void updateWind(LLVector3 direction, F32 camera_altitude);
|
/*virtual*/ void updateWind(LLVector3 direction, F32 camera_altitude);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef S16 WIND_SAMPLE_T;
|
typedef F32 WIND_SAMPLE_T;
|
||||||
LLWindGen<WIND_SAMPLE_T> *mWindGen;
|
LLWindGen<WIND_SAMPLE_T> *mWindGen;
|
||||||
S16 *mWindBuf;
|
F32 *mWindBuf;
|
||||||
U32 mWindBufFreq;
|
U32 mWindBufFreq;
|
||||||
U32 mWindBufSamples;
|
U32 mWindBufSamples;
|
||||||
U32 mWindBufBytes;
|
U32 mWindBufBytes;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
#include "AL/al.h"
|
#include "AL/al.h"
|
||||||
#include "AL/alut.h"
|
#include "AL/alut.h"
|
||||||
|
#include "AL/alext.h"
|
||||||
|
|
||||||
class LLListener_OpenAL : public LLListener
|
class LLListener_OpenAL : public LLListener
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
||||||
U32 chunk_length = 0;
|
U32 chunk_length = 0;
|
||||||
U32 raw_data_length = 0;
|
U32 raw_data_length = 0;
|
||||||
U32 bytes_per_sec = 0;
|
U32 bytes_per_sec = 0;
|
||||||
BOOL uncompressed_pcm = FALSE;
|
bool uncompressed_pcm = false;
|
||||||
|
|
||||||
unsigned char wav_header[44]; /*Flawfinder: ignore*/
|
unsigned char wav_header[44]; /*Flawfinder: ignore*/
|
||||||
|
|
||||||
|
|
@ -136,7 +136,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
||||||
{
|
{
|
||||||
if ((wav_header[8] == 0x01) && (wav_header[9] == 0x00))
|
if ((wav_header[8] == 0x01) && (wav_header[9] == 0x00))
|
||||||
{
|
{
|
||||||
uncompressed_pcm = TRUE;
|
uncompressed_pcm = true;
|
||||||
}
|
}
|
||||||
num_channels = ((U16) wav_header[11] << 8) + wav_header[10];
|
num_channels = ((U16) wav_header[11] << 8) + wav_header[10];
|
||||||
sample_rate = ((U32) wav_header[15] << 24)
|
sample_rate = ((U32) wav_header[15] << 24)
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ const char *LLAnimationLibrary::animStateToString( const LLUUID& state )
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Return the animation state for a given name
|
// Return the animation state for a given name
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allow_ids )
|
LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, bool allow_ids )
|
||||||
{
|
{
|
||||||
std::string lower_case_name(name);
|
std::string lower_case_name(name);
|
||||||
LLStringUtil::toLower(lower_case_name);
|
LLStringUtil::toLower(lower_case_name);
|
||||||
|
|
@ -393,7 +393,7 @@ LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allo
|
||||||
else if (allow_ids)
|
else if (allow_ids)
|
||||||
{
|
{
|
||||||
// try to convert string to LLUUID
|
// try to convert string to LLUUID
|
||||||
id.set(name, FALSE);
|
id.set(name, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ public:
|
||||||
// Return the animation state for the given name.
|
// Return the animation state for the given name.
|
||||||
// Retun NULL if the name is invalid.
|
// Retun NULL if the name is invalid.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLUUID stringToAnimState( const std::string& name, BOOL allow_ids = TRUE );
|
LLUUID stringToAnimState( const std::string& name, bool allow_ids = true );
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Associate an anim state with a name
|
// Associate an anim state with a name
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
|
||||||
LL_DEBUGS("BVH") << "After translations and optimize" << LL_ENDL;
|
LL_DEBUGS("BVH") << "After translations and optimize" << LL_ENDL;
|
||||||
dumpBVHInfo();
|
dumpBVHInfo();
|
||||||
|
|
||||||
mInitialized = TRUE;
|
mInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -232,7 +232,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// load data one line at a time
|
// load data one line at a time
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
BOOL loadingGlobals = FALSE;
|
bool loadingGlobals = false;
|
||||||
while ( getLine(fp) )
|
while ( getLine(fp) )
|
||||||
{
|
{
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
@ -256,7 +256,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
||||||
|
|
||||||
if (strcmp(name, "GLOBALS")==0)
|
if (strcmp(name, "GLOBALS")==0)
|
||||||
{
|
{
|
||||||
loadingGlobals = TRUE;
|
loadingGlobals = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -303,7 +303,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
||||||
|
|
||||||
if ( sscanf(mLine, " %*s = %f %f", &loop_in, &loop_out) == 2 )
|
if ( sscanf(mLine, " %*s = %f %f", &loop_in, &loop_out) == 2 )
|
||||||
{
|
{
|
||||||
mLoop = TRUE;
|
mLoop = true;
|
||||||
}
|
}
|
||||||
else if ( sscanf(mLine, " %*s = %127s", trueFalse) == 1 ) /* Flawfinder: ignore */
|
else if ( sscanf(mLine, " %*s = %127s", trueFalse) == 1 ) /* Flawfinder: ignore */
|
||||||
{
|
{
|
||||||
|
|
@ -501,8 +501,8 @@ void LLBVHLoader::makeTranslation(std::string alias_name, std::string joint_name
|
||||||
|
|
||||||
if (joint_name == "mPelvis")
|
if (joint_name == "mPelvis")
|
||||||
{
|
{
|
||||||
newTrans.mRelativePositionKey = TRUE;
|
newTrans.mRelativePositionKey = true;
|
||||||
newTrans.mRelativeRotationKey = TRUE;
|
newTrans.mRelativeRotationKey = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -614,7 +614,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// consume joints
|
// consume joints
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
while (TRUE)
|
while (true)
|
||||||
{
|
{
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// get next line
|
// get next line
|
||||||
|
|
@ -974,7 +974,7 @@ void LLBVHLoader::applyTranslations()
|
||||||
if ( trans.mIgnore )
|
if ( trans.mIgnore )
|
||||||
{
|
{
|
||||||
//LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
|
//LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
|
||||||
joint->mIgnore = TRUE;
|
joint->mIgnore = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -988,10 +988,10 @@ void LLBVHLoader::applyTranslations()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Allow joint position changes as of SL-318
|
//Allow joint position changes as of SL-318
|
||||||
joint->mIgnorePositions = FALSE;
|
joint->mIgnorePositions = false;
|
||||||
if (joint->mNumChannels == 3)
|
if (joint->mNumChannels == 3)
|
||||||
{
|
{
|
||||||
joint->mIgnorePositions = TRUE;
|
joint->mIgnorePositions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
@ -1000,13 +1000,13 @@ void LLBVHLoader::applyTranslations()
|
||||||
if ( trans.mRelativePositionKey )
|
if ( trans.mRelativePositionKey )
|
||||||
{
|
{
|
||||||
// LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
// LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
||||||
joint->mRelativePositionKey = TRUE;
|
joint->mRelativePositionKey = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( trans.mRelativeRotationKey )
|
if ( trans.mRelativeRotationKey )
|
||||||
{
|
{
|
||||||
// LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
// LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
||||||
joint->mRelativeRotationKey = TRUE;
|
joint->mRelativeRotationKey = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( trans.mRelativePosition.magVec() > 0.0f )
|
if ( trans.mRelativePosition.magVec() > 0.0f )
|
||||||
|
|
@ -1070,8 +1070,8 @@ void LLBVHLoader::optimize()
|
||||||
|
|
||||||
for (Joint* joint : mJoints)
|
for (Joint* joint : mJoints)
|
||||||
{
|
{
|
||||||
BOOL pos_changed = FALSE;
|
bool pos_changed = false;
|
||||||
BOOL rot_changed = FALSE;
|
bool rot_changed = false;
|
||||||
|
|
||||||
if ( ! joint->mIgnore )
|
if ( ! joint->mIgnore )
|
||||||
{
|
{
|
||||||
|
|
@ -1084,7 +1084,7 @@ void LLBVHLoader::optimize()
|
||||||
// no keys?
|
// no keys?
|
||||||
if (first_key == joint->mKeys.end())
|
if (first_key == joint->mKeys.end())
|
||||||
{
|
{
|
||||||
joint->mIgnore = TRUE;
|
joint->mIgnore = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1097,13 +1097,13 @@ void LLBVHLoader::optimize()
|
||||||
{
|
{
|
||||||
// *FIX: use single frame to move pelvis
|
// *FIX: use single frame to move pelvis
|
||||||
// if only one keyframe force output for this joint
|
// if only one keyframe force output for this joint
|
||||||
rot_changed = TRUE;
|
rot_changed = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if more than one keyframe, use first frame as reference and skip to second
|
// if more than one keyframe, use first frame as reference and skip to second
|
||||||
first_key->mIgnorePos = TRUE;
|
first_key->mIgnorePos = true;
|
||||||
first_key->mIgnoreRot = TRUE;
|
first_key->mIgnoreRot = true;
|
||||||
++ki;
|
++ki;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1124,7 +1124,7 @@ void LLBVHLoader::optimize()
|
||||||
joint->mNumPosKeys++;
|
joint->mNumPosKeys++;
|
||||||
if (dist_vec_squared(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
|
if (dist_vec_squared(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
|
||||||
{
|
{
|
||||||
pos_changed = TRUE;
|
pos_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1137,12 +1137,12 @@ void LLBVHLoader::optimize()
|
||||||
|
|
||||||
if (dist_vec_squared(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
|
if (dist_vec_squared(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
|
||||||
{
|
{
|
||||||
pos_changed = TRUE;
|
pos_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dist_vec_squared(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD_SQUARED)
|
if (dist_vec_squared(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD_SQUARED)
|
||||||
{
|
{
|
||||||
ki_prev->mIgnorePos = TRUE;
|
ki_prev->mIgnorePos = true;
|
||||||
numPosFramesConsidered++;
|
numPosFramesConsidered++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1163,7 +1163,7 @@ void LLBVHLoader::optimize()
|
||||||
|
|
||||||
if (rot_test > ROTATION_MOTION_THRESHOLD)
|
if (rot_test > ROTATION_MOTION_THRESHOLD)
|
||||||
{
|
{
|
||||||
rot_changed = TRUE;
|
rot_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1185,7 +1185,7 @@ void LLBVHLoader::optimize()
|
||||||
rot_test = x_delta + y_delta;
|
rot_test = x_delta + y_delta;
|
||||||
if (rot_test > ROTATION_MOTION_THRESHOLD)
|
if (rot_test > ROTATION_MOTION_THRESHOLD)
|
||||||
{
|
{
|
||||||
rot_changed = TRUE;
|
rot_changed = true;
|
||||||
}
|
}
|
||||||
x_delta = dist_vec(LLVector3::x_axis * interp_rot, LLVector3::x_axis * test_rot);
|
x_delta = dist_vec(LLVector3::x_axis * interp_rot, LLVector3::x_axis * test_rot);
|
||||||
y_delta = dist_vec(LLVector3::y_axis * interp_rot, LLVector3::y_axis * test_rot);
|
y_delta = dist_vec(LLVector3::y_axis * interp_rot, LLVector3::y_axis * test_rot);
|
||||||
|
|
@ -1207,9 +1207,9 @@ void LLBVHLoader::optimize()
|
||||||
// because it's significantly faster.
|
// because it's significantly faster.
|
||||||
if (diff_max > 0)
|
if (diff_max > 0)
|
||||||
{
|
{
|
||||||
if (ki_max->mIgnoreRot == TRUE)
|
if (ki_max->mIgnoreRot)
|
||||||
{
|
{
|
||||||
ki_max->mIgnoreRot = FALSE;
|
ki_max->mIgnoreRot = false;
|
||||||
joint->mNumRotKeys++;
|
joint->mNumRotKeys++;
|
||||||
}
|
}
|
||||||
diff_max = 0;
|
diff_max = 0;
|
||||||
|
|
@ -1218,7 +1218,7 @@ void LLBVHLoader::optimize()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This keyframe isn't significant enough, throw it away.
|
// This keyframe isn't significant enough, throw it away.
|
||||||
ki_prev->mIgnoreRot = TRUE;
|
ki_prev->mIgnoreRot = true;
|
||||||
numRotFramesConsidered++;
|
numRotFramesConsidered++;
|
||||||
// Store away the keyframe that has the largest deviation from the interpolated line, for insertion later.
|
// Store away the keyframe that has the largest deviation from the interpolated line, for insertion later.
|
||||||
if (rot_test > diff_max)
|
if (rot_test > diff_max)
|
||||||
|
|
@ -1237,7 +1237,7 @@ void LLBVHLoader::optimize()
|
||||||
if (!(pos_changed || rot_changed))
|
if (!(pos_changed || rot_changed))
|
||||||
{
|
{
|
||||||
//LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL;
|
//LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL;
|
||||||
joint->mIgnore = TRUE;
|
joint->mIgnore = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1250,13 +1250,13 @@ void LLBVHLoader::reset()
|
||||||
mDuration = 0.0f;
|
mDuration = 0.0f;
|
||||||
|
|
||||||
mPriority = 2;
|
mPriority = 2;
|
||||||
mLoop = FALSE;
|
mLoop = false;
|
||||||
mLoopInPoint = 0.f;
|
mLoopInPoint = 0.f;
|
||||||
mLoopOutPoint = 0.f;
|
mLoopOutPoint = 0.f;
|
||||||
mEaseIn = 0.3f;
|
mEaseIn = 0.3f;
|
||||||
mEaseOut = 0.3f;
|
mEaseOut = 0.3f;
|
||||||
mHand = 1;
|
mHand = 1;
|
||||||
mInitialized = FALSE;
|
mInitialized = false;
|
||||||
|
|
||||||
mEmoteName = "";
|
mEmoteName = "";
|
||||||
mLineNumber = 0;
|
mLineNumber = 0;
|
||||||
|
|
@ -1269,21 +1269,21 @@ void LLBVHLoader::reset()
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
// <FS:ND> Remove LLVolatileAPRPool/apr_file_t and use FILE* instead
|
// <FS:ND> Remove LLVolatileAPRPool/apr_file_t and use FILE* instead
|
||||||
//BOOL LLBVHLoader::getLine(apr_file_t* fp)
|
//bool LLBVHLoader::getLine(apr_file_t* fp)
|
||||||
BOOL LLBVHLoader::getLine(LLAPRFile::tFiletype* fp)
|
bool LLBVHLoader::getLine(LLAPRFile::tFiletype* fp)
|
||||||
// </FS:ND>
|
// </FS:ND>
|
||||||
{
|
{
|
||||||
if (apr_file_eof(fp) == APR_EOF)
|
if (apr_file_eof(fp) == APR_EOF)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if ( apr_file_gets(mLine, BVH_PARSER_LINE_SIZE, fp) == APR_SUCCESS)
|
if ( apr_file_gets(mLine, BVH_PARSER_LINE_SIZE, fp) == APR_SUCCESS)
|
||||||
{
|
{
|
||||||
mLineNumber++;
|
mLineNumber++;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns required size of output buffer
|
// returns required size of output buffer
|
||||||
|
|
@ -1296,7 +1296,7 @@ U32 LLBVHLoader::getOutputSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
// writes contents to datapacker
|
// writes contents to datapacker
|
||||||
BOOL LLBVHLoader::serialize(LLDataPacker& dp)
|
bool LLBVHLoader::serialize(LLDataPacker& dp)
|
||||||
{
|
{
|
||||||
F32 time;
|
F32 time;
|
||||||
|
|
||||||
|
|
@ -1505,5 +1505,5 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ struct Key
|
||||||
|
|
||||||
F32 mPos[3];
|
F32 mPos[3];
|
||||||
F32 mRot[3];
|
F32 mRot[3];
|
||||||
BOOL mIgnorePos;
|
bool mIgnorePos;
|
||||||
BOOL mIgnoreRot;
|
bool mIgnoreRot;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -89,10 +89,10 @@ struct Joint
|
||||||
Joint(const char *name)
|
Joint(const char *name)
|
||||||
{
|
{
|
||||||
mName = name;
|
mName = name;
|
||||||
mIgnore = FALSE;
|
mIgnore = false;
|
||||||
mIgnorePositions = FALSE;
|
mIgnorePositions = false;
|
||||||
mRelativePositionKey = FALSE;
|
mRelativePositionKey = false;
|
||||||
mRelativeRotationKey = FALSE;
|
mRelativeRotationKey = false;
|
||||||
mOutName = name;
|
mOutName = name;
|
||||||
mOrder[0] = 'X';
|
mOrder[0] = 'X';
|
||||||
mOrder[1] = 'Y';
|
mOrder[1] = 'Y';
|
||||||
|
|
@ -111,10 +111,10 @@ struct Joint
|
||||||
LLVector3 mRelativePosition;
|
LLVector3 mRelativePosition;
|
||||||
//
|
//
|
||||||
std::string mName;
|
std::string mName;
|
||||||
BOOL mIgnore;
|
bool mIgnore;
|
||||||
BOOL mIgnorePositions;
|
bool mIgnorePositions;
|
||||||
BOOL mRelativePositionKey;
|
bool mRelativePositionKey;
|
||||||
BOOL mRelativeRotationKey;
|
bool mRelativeRotationKey;
|
||||||
std::string mOutName;
|
std::string mOutName;
|
||||||
std::string mMergeParentName;
|
std::string mMergeParentName;
|
||||||
std::string mMergeChildName;
|
std::string mMergeChildName;
|
||||||
|
|
@ -161,18 +161,18 @@ class Translation
|
||||||
public:
|
public:
|
||||||
Translation()
|
Translation()
|
||||||
{
|
{
|
||||||
mIgnore = FALSE;
|
mIgnore = false;
|
||||||
mIgnorePositions = FALSE;
|
mIgnorePositions = false;
|
||||||
mRelativePositionKey = FALSE;
|
mRelativePositionKey = false;
|
||||||
mRelativeRotationKey = FALSE;
|
mRelativeRotationKey = false;
|
||||||
mPriorityModifier = 0;
|
mPriorityModifier = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string mOutName;
|
std::string mOutName;
|
||||||
BOOL mIgnore;
|
bool mIgnore;
|
||||||
BOOL mIgnorePositions;
|
bool mIgnorePositions;
|
||||||
BOOL mRelativePositionKey;
|
bool mRelativePositionKey;
|
||||||
BOOL mRelativeRotationKey;
|
bool mRelativeRotationKey;
|
||||||
LLMatrix3 mFrameMatrix;
|
LLMatrix3 mFrameMatrix;
|
||||||
LLMatrix3 mOffsetMatrix;
|
LLMatrix3 mOffsetMatrix;
|
||||||
LLVector3 mRelativePosition;
|
LLVector3 mRelativePosition;
|
||||||
|
|
@ -293,7 +293,7 @@ public:
|
||||||
U32 getOutputSize();
|
U32 getOutputSize();
|
||||||
|
|
||||||
// writes contents to datapacker
|
// writes contents to datapacker
|
||||||
BOOL serialize(LLDataPacker& dp);
|
bool serialize(LLDataPacker& dp);
|
||||||
|
|
||||||
// flags redundant keyframe data
|
// flags redundant keyframe data
|
||||||
void optimize();
|
void optimize();
|
||||||
|
|
@ -302,7 +302,7 @@ public:
|
||||||
|
|
||||||
F32 getDuration() { return mDuration; }
|
F32 getDuration() { return mDuration; }
|
||||||
|
|
||||||
BOOL isInitialized() { return mInitialized; }
|
bool isInitialized() { return mInitialized; }
|
||||||
|
|
||||||
ELoadStatus getStatus() { return mStatus; }
|
ELoadStatus getStatus() { return mStatus; }
|
||||||
|
|
||||||
|
|
@ -312,10 +312,9 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Consumes one line of input from file.
|
// Consumes one line of input from file.
|
||||||
|
|
||||||
// <FS:ND> Remove LLVolatileAPRPool/apr_file_t and use FILE* instead
|
// <FS:ND> Remove LLVolatileAPRPool/apr_file_t and use FILE* instead
|
||||||
// BOOL getLine(apr_file_t *fp);
|
// bool getLine(apr_file_t *fp);
|
||||||
BOOL getLine(LLAPRFile::tFiletype *fp);
|
bool getLine(LLAPRFile::tFiletype *fp);
|
||||||
// </FS:ND>
|
// </FS:ND>
|
||||||
|
|
||||||
// parser state
|
// parser state
|
||||||
|
|
@ -330,7 +329,7 @@ protected:
|
||||||
TranslationMap mTranslations;
|
TranslationMap mTranslations;
|
||||||
|
|
||||||
S32 mPriority;
|
S32 mPriority;
|
||||||
BOOL mLoop;
|
bool mLoop;
|
||||||
F32 mLoopInPoint;
|
F32 mLoopInPoint;
|
||||||
F32 mLoopOutPoint;
|
F32 mLoopOutPoint;
|
||||||
F32 mEaseIn;
|
F32 mEaseIn;
|
||||||
|
|
@ -338,7 +337,7 @@ protected:
|
||||||
S32 mHand;
|
S32 mHand;
|
||||||
std::string mEmoteName;
|
std::string mEmoteName;
|
||||||
|
|
||||||
BOOL mInitialized;
|
bool mInitialized;
|
||||||
ELoadStatus mStatus;
|
ELoadStatus mStatus;
|
||||||
|
|
||||||
// computed values
|
// computed values
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
LLStringTable LLCharacter::sVisualParamNames(1024);
|
LLStringTable LLCharacter::sVisualParamNames(1024);
|
||||||
|
|
||||||
std::vector< LLCharacter* > LLCharacter::sInstances;
|
std::vector< LLCharacter* > LLCharacter::sInstances;
|
||||||
BOOL LLCharacter::sAllowInstancesChange = TRUE ;
|
bool LLCharacter::sAllowInstancesChange = true ;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLCharacter()
|
// LLCharacter()
|
||||||
|
|
@ -73,8 +73,8 @@ LLCharacter::~LLCharacter()
|
||||||
delete param;
|
delete param;
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 i ;
|
size_t i ;
|
||||||
U32 size = sInstances.size() ;
|
size_t size = sInstances.size() ;
|
||||||
for(i = 0 ; i < size ; i++)
|
for(i = 0 ; i < size ; i++)
|
||||||
{
|
{
|
||||||
if(sInstances[i] == this)
|
if(sInstances[i] == this)
|
||||||
|
|
@ -122,7 +122,7 @@ LLJoint *LLCharacter::getJoint( const JointKey &name )
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// registerMotion()
|
// registerMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLCharacter::registerMotion( const LLUUID& id, LLMotionConstructor create )
|
bool LLCharacter::registerMotion( const LLUUID& id, LLMotionConstructor create )
|
||||||
{
|
{
|
||||||
return mMotionController.registerMotion(id, create);
|
return mMotionController.registerMotion(id, create);
|
||||||
}
|
}
|
||||||
|
|
@ -155,7 +155,7 @@ LLMotion* LLCharacter::createMotion( const LLUUID &id )
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// startMotion()
|
// startMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLCharacter::startMotion(const LLUUID &id, F32 start_offset)
|
bool LLCharacter::startMotion(const LLUUID &id, F32 start_offset)
|
||||||
{
|
{
|
||||||
return mMotionController.startMotion(id, start_offset);
|
return mMotionController.startMotion(id, start_offset);
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +164,7 @@ BOOL LLCharacter::startMotion(const LLUUID &id, F32 start_offset)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// stopMotion()
|
// stopMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLCharacter::stopMotion(const LLUUID& id, BOOL stop_immediate)
|
bool LLCharacter::stopMotion(const LLUUID& id, bool stop_immediate)
|
||||||
{
|
{
|
||||||
return mMotionController.stopMotionLocally(id, stop_immediate);
|
return mMotionController.stopMotionLocally(id, stop_immediate);
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +172,7 @@ BOOL LLCharacter::stopMotion(const LLUUID& id, BOOL stop_immediate)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// isMotionActive()
|
// isMotionActive()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLCharacter::isMotionActive(const LLUUID& id)
|
bool LLCharacter::isMotionActive(const LLUUID& id)
|
||||||
{
|
{
|
||||||
LLMotion *motionp = mMotionController.findMotion(id);
|
LLMotion *motionp = mMotionController.findMotion(id);
|
||||||
if (motionp)
|
if (motionp)
|
||||||
|
|
@ -180,7 +180,7 @@ BOOL LLCharacter::isMotionActive(const LLUUID& id)
|
||||||
return mMotionController.isMotionActive(motionp);
|
return mMotionController.isMotionActive(motionp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -288,8 +288,8 @@ void LLCharacter::removeAnimationData(std::string name)
|
||||||
// setVisualParamWeight()
|
// setVisualParamWeight()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight)
|
//bool LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight)
|
||||||
BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, BOOL upload_bake)
|
bool LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, bool upload_bake)
|
||||||
{
|
{
|
||||||
S32 index = which_param->getID();
|
S32 index = which_param->getID();
|
||||||
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
|
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
|
||||||
|
|
@ -298,17 +298,17 @@ BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 wei
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//index_iter->second->setWeight(weight);
|
//index_iter->second->setWeight(weight);
|
||||||
index_iter->second->setWeight(weight, upload_bake);
|
index_iter->second->setWeight(weight, upload_bake);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// setVisualParamWeight()
|
// setVisualParamWeight()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight)
|
//bool LLCharacter::setVisualParamWeight(const char* param_name, F32 weight)
|
||||||
BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake)
|
bool LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake)
|
||||||
{
|
{
|
||||||
std::string tname(param_name);
|
std::string tname(param_name);
|
||||||
LLStringUtil::toLower(tname);
|
LLStringUtil::toLower(tname);
|
||||||
|
|
@ -319,18 +319,18 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//name_iter->second->setWeight(weight);
|
//name_iter->second->setWeight(weight);
|
||||||
name_iter->second->setWeight(weight, upload_bake);
|
name_iter->second->setWeight(weight, upload_bake);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
|
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// setVisualParamWeight()
|
// setVisualParamWeight()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight)
|
//bool LLCharacter::setVisualParamWeight(S32 index, F32 weight)
|
||||||
BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake)
|
bool LLCharacter::setVisualParamWeight(S32 index, F32 weight, bool upload_bake)
|
||||||
{
|
{
|
||||||
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
|
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
|
||||||
if (index_iter != mVisualParamIndexMap.end())
|
if (index_iter != mVisualParamIndexMap.end())
|
||||||
|
|
@ -338,10 +338,10 @@ BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake)
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//index_iter->second->setWeight(weight);
|
//index_iter->second->setWeight(weight);
|
||||||
index_iter->second->setWeight(weight, upload_bake);
|
index_iter->second->setWeight(weight, upload_bake);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
|
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -409,7 +409,7 @@ void LLCharacter::clearVisualParamWeights()
|
||||||
{
|
{
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//param->setWeight( param->getDefaultWeight());
|
//param->setWeight( param->getDefaultWeight());
|
||||||
param->setWeight( param->getDefaultWeight(), FALSE);
|
param->setWeight( param->getDefaultWeight(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// registers a motion with the character
|
// registers a motion with the character
|
||||||
// returns true if successfull
|
// returns true if successfull
|
||||||
BOOL registerMotion( const LLUUID& id, LLMotionConstructor create );
|
bool registerMotion( const LLUUID& id, LLMotionConstructor create );
|
||||||
|
|
||||||
void removeMotion( const LLUUID& id );
|
void removeMotion( const LLUUID& id );
|
||||||
|
|
||||||
|
|
@ -143,13 +143,13 @@ public:
|
||||||
|
|
||||||
// start a motion
|
// start a motion
|
||||||
// returns true if successful, false if an error occurred
|
// returns true if successful, false if an error occurred
|
||||||
virtual BOOL startMotion( const LLUUID& id, F32 start_offset = 0.f);
|
virtual bool startMotion( const LLUUID& id, F32 start_offset = 0.f);
|
||||||
|
|
||||||
// stop a motion
|
// stop a motion
|
||||||
virtual BOOL stopMotion( const LLUUID& id, BOOL stop_immediate = FALSE );
|
virtual bool stopMotion( const LLUUID& id, bool stop_immediate = false );
|
||||||
|
|
||||||
// is this motion active?
|
// is this motion active?
|
||||||
BOOL isMotionActive( const LLUUID& id );
|
bool isMotionActive( const LLUUID& id );
|
||||||
|
|
||||||
// Event handler for motion deactivation.
|
// Event handler for motion deactivation.
|
||||||
// Called when a motion has completely stopped and has been deactivated.
|
// Called when a motion has completely stopped and has been deactivated.
|
||||||
|
|
@ -162,7 +162,7 @@ public:
|
||||||
void updateMotions(e_update_t update_type);
|
void updateMotions(e_update_t update_type);
|
||||||
|
|
||||||
LLAnimPauseRequest requestPause();
|
LLAnimPauseRequest requestPause();
|
||||||
BOOL areAnimationsPaused() const { return mMotionController.isPaused(); }
|
bool areAnimationsPaused() const { return mMotionController.isPaused(); }
|
||||||
void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); }
|
void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); }
|
||||||
void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); }
|
void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); }
|
||||||
|
|
||||||
|
|
@ -197,12 +197,12 @@ public:
|
||||||
void addSharedVisualParam(LLVisualParam *param);
|
void addSharedVisualParam(LLVisualParam *param);
|
||||||
|
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
|
//virtual bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
|
||||||
//virtual BOOL setVisualParamWeight(const char* param_name, F32 weight);
|
//virtual bool setVisualParamWeight(const char* param_name, F32 weight);
|
||||||
//virtual BOOL setVisualParamWeight(S32 index, F32 weight);
|
//virtual bool setVisualParamWeight(S32 index, F32 weight);
|
||||||
virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE );
|
virtual bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight, bool upload_bake = false );
|
||||||
virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE );
|
virtual bool setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake = false );
|
||||||
virtual BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE );
|
virtual bool setVisualParamWeight(S32 index, F32 weight, bool upload_bake = false );
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
|
|
||||||
// get visual param weight by param or name
|
// get visual param weight by param or name
|
||||||
|
|
@ -267,7 +267,7 @@ public:
|
||||||
void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; }
|
void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; }
|
||||||
|
|
||||||
static std::vector< LLCharacter* > sInstances;
|
static std::vector< LLCharacter* > sInstances;
|
||||||
static BOOL sAllowInstancesChange ; //debug use
|
static bool sAllowInstancesChange ; //debug use
|
||||||
|
|
||||||
virtual void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) { mHoverOffset = hover_offset; }
|
virtual void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) { mHoverOffset = hover_offset; }
|
||||||
const LLVector3& getHoverOffset() const { return mHoverOffset; }
|
const LLVector3& getHoverOffset() const { return mHoverOffset; }
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLEditingMotion::onActivate()
|
// LLEditingMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLEditingMotion::onActivate()
|
bool LLEditingMotion::onActivate()
|
||||||
{
|
{
|
||||||
// propagate joint positions to kinematic chain
|
// propagate joint positions to kinematic chain
|
||||||
// SL-315
|
// SL-315
|
||||||
|
|
@ -155,25 +155,25 @@ BOOL LLEditingMotion::onActivate()
|
||||||
mShoulderJoint.setRotation( mShoulderState->getJoint()->getRotation() );
|
mShoulderJoint.setRotation( mShoulderState->getJoint()->getRotation() );
|
||||||
mElbowJoint.setRotation( mElbowState->getJoint()->getRotation() );
|
mElbowJoint.setRotation( mElbowState->getJoint()->getRotation() );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLEditingMotion::onUpdate()
|
// LLEditingMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
LLVector3 focus_pt;
|
LLVector3 focus_pt;
|
||||||
LLVector3* pointAtPt = (LLVector3*)mCharacter->getAnimationData("PointAtPoint");
|
LLVector3* pointAtPt = (LLVector3*)mCharacter->getAnimationData("PointAtPoint");
|
||||||
|
|
||||||
|
|
||||||
BOOL result = TRUE;
|
bool result = true;
|
||||||
|
|
||||||
if (!pointAtPt)
|
if (!pointAtPt)
|
||||||
{
|
{
|
||||||
focus_pt = mLastSelectPt;
|
focus_pt = mLastSelectPt;
|
||||||
result = FALSE;
|
result = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual bool getLoop() { return true; }
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
virtual F32 getDuration() { return 0.0; }
|
virtual F32 getDuration() { return 0.0; }
|
||||||
|
|
@ -94,14 +94,14 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
|
|
|
||||||
|
|
@ -91,17 +91,17 @@ const LLGesture &LLGesture::operator =(const LLGesture &rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLGesture::trigger(KEY key, MASK mask)
|
bool LLGesture::trigger(KEY key, MASK mask)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
|
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL LLGesture::trigger(const std::string& trigger_string)
|
bool LLGesture::trigger(const std::string& trigger_string)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
|
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOT endian-neutral
|
// NOT endian-neutral
|
||||||
|
|
@ -189,12 +189,12 @@ void LLGestureList::deleteAll()
|
||||||
// Iterates through space delimited tokens in string, triggering any gestures found.
|
// Iterates through space delimited tokens in string, triggering any gestures found.
|
||||||
// Generates a revised string that has the found tokens replaced by their replacement strings
|
// Generates a revised string that has the found tokens replaced by their replacement strings
|
||||||
// and (as a minor side effect) has multiple spaces in a row replaced by single spaces.
|
// and (as a minor side effect) has multiple spaces in a row replaced by single spaces.
|
||||||
BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::string* revised_string)
|
bool LLGestureList::triggerAndReviseString(const std::string &string, std::string* revised_string)
|
||||||
{
|
{
|
||||||
std::string tokenized = string;
|
std::string tokenized = string;
|
||||||
|
|
||||||
BOOL found_gestures = FALSE;
|
bool found_gestures = false;
|
||||||
BOOL first_token = TRUE;
|
bool first_token = true;
|
||||||
|
|
||||||
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
||||||
boost::char_separator<char> sep(" ");
|
boost::char_separator<char> sep(" ");
|
||||||
|
|
@ -235,7 +235,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
found_gestures = TRUE;
|
found_gestures = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gesture = NULL;
|
gesture = NULL;
|
||||||
|
|
@ -251,14 +251,14 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
|
||||||
revised_string->append( cur_token );
|
revised_string->append( cur_token );
|
||||||
}
|
}
|
||||||
|
|
||||||
first_token = FALSE;
|
first_token = false;
|
||||||
}
|
}
|
||||||
return found_gestures;
|
return found_gestures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOL LLGestureList::trigger(KEY key, MASK mask)
|
bool LLGestureList::trigger(KEY key, MASK mask)
|
||||||
{
|
{
|
||||||
for (U32 i = 0; i < mList.size(); i++)
|
for (U32 i = 0; i < mList.size(); i++)
|
||||||
{
|
{
|
||||||
|
|
@ -267,7 +267,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
|
||||||
{
|
{
|
||||||
if (gesture->trigger(key, mask))
|
if (gesture->trigger(key, mask))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -275,14 +275,14 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
|
||||||
LL_WARNS() << "NULL gesture in gesture list (" << i << ")" << LL_ENDL;
|
LL_WARNS() << "NULL gesture in gesture list (" << i << ")" << LL_ENDL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOT endian-neutral
|
// NOT endian-neutral
|
||||||
U8 *LLGestureList::serialize(U8 *buffer) const
|
U8 *LLGestureList::serialize(U8 *buffer) const
|
||||||
{
|
{
|
||||||
// a single S32 serves as the header that tells us how many to read
|
// a single S32 serves as the header that tells us how many to read
|
||||||
U32 count = mList.size();
|
auto count = mList.size();
|
||||||
htolememcpy(buffer, &count, MVT_S32, 4);
|
htolememcpy(buffer, &count, MVT_S32, 4);
|
||||||
buffer += sizeof(count);
|
buffer += sizeof(count);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,10 +55,10 @@ public:
|
||||||
const std::string& getOutputString() const { return mOutputString; }
|
const std::string& getOutputString() const { return mOutputString; }
|
||||||
|
|
||||||
// Triggers if a key/mask matches it
|
// Triggers if a key/mask matches it
|
||||||
virtual BOOL trigger(KEY key, MASK mask);
|
virtual bool trigger(KEY key, MASK mask);
|
||||||
|
|
||||||
// Triggers if case-insensitive substring matches (assumes string is lowercase)
|
// Triggers if case-insensitive substring matches (assumes string is lowercase)
|
||||||
virtual BOOL trigger(const std::string &string);
|
virtual bool trigger(const std::string &string);
|
||||||
|
|
||||||
// non-endian-neutral serialization
|
// non-endian-neutral serialization
|
||||||
U8 *serialize(U8 *buffer) const;
|
U8 *serialize(U8 *buffer) const;
|
||||||
|
|
@ -84,13 +84,13 @@ public:
|
||||||
virtual ~LLGestureList();
|
virtual ~LLGestureList();
|
||||||
|
|
||||||
// Triggers if a key/mask matches one in the list
|
// Triggers if a key/mask matches one in the list
|
||||||
BOOL trigger(KEY key, MASK mask);
|
bool trigger(KEY key, MASK mask);
|
||||||
|
|
||||||
// Triggers if substring matches and generates revised string.
|
// Triggers if substring matches and generates revised string.
|
||||||
BOOL triggerAndReviseString(const std::string &string, std::string* revised_string);
|
bool triggerAndReviseString(const std::string &string, std::string* revised_string);
|
||||||
|
|
||||||
// Used for construction from UI
|
// Used for construction from UI
|
||||||
S32 count() const { return mList.size(); }
|
S32 count() const { return static_cast<S32>(mList.size()); }
|
||||||
virtual LLGesture* get(S32 i) const { return mList.at(i); }
|
virtual LLGesture* get(S32 i) const { return mList.at(i); }
|
||||||
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
|
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
|
||||||
void deleteAll();
|
void deleteAll();
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ LLMotion::LLMotionInitStatus LLHandMotion::onInitialize(LLCharacter *character)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLHandMotion::onActivate()
|
// LLHandMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLHandMotion::onActivate()
|
bool LLHandMotion::onActivate()
|
||||||
{
|
{
|
||||||
LLPolyMesh *upperBodyMesh = mCharacter->getUpperBodyMesh();
|
LLPolyMesh *upperBodyMesh = mCharacter->getUpperBodyMesh();
|
||||||
|
|
||||||
|
|
@ -112,14 +112,14 @@ BOOL LLHandMotion::onActivate()
|
||||||
mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], 1.f);
|
mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], 1.f);
|
||||||
mCharacter->updateVisualParams();
|
mCharacter->updateVisualParams();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLHandMotion::onUpdate()
|
// LLHandMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLHandMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
eHandPose *requestedHandPose;
|
eHandPose *requestedHandPose;
|
||||||
|
|
@ -233,7 +233,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual bool getLoop() { return true; }
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
virtual F32 getDuration() { return 0.0; }
|
virtual F32 getDuration() { return 0.0; }
|
||||||
|
|
@ -107,19 +107,19 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
|
|
||||||
virtual BOOL canDeprecate() { return FALSE; }
|
virtual bool canDeprecate() { return false; }
|
||||||
|
|
||||||
static std::string getHandPoseName(eHandPose pose);
|
static std::string getHandPoseName(eHandPose pose);
|
||||||
static eHandPose getHandPose(std::string posename);
|
static eHandPose getHandPose(std::string posename);
|
||||||
|
|
|
||||||
|
|
@ -164,16 +164,16 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLHeadRotMotion::onActivate()
|
// LLHeadRotMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLHeadRotMotion::onActivate()
|
bool LLHeadRotMotion::onActivate()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLHeadRotMotion::onUpdate()
|
// LLHeadRotMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
||||||
LLQuaternion targetHeadRotWorld;
|
LLQuaternion targetHeadRotWorld;
|
||||||
|
|
@ -251,7 +251,7 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local));
|
mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local));
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -279,7 +279,7 @@ LLEyeMotion::LLEyeMotion(const LLUUID &id) : LLMotion(id)
|
||||||
mEyeLookAwayPitch = 0.f;
|
mEyeLookAwayPitch = 0.f;
|
||||||
|
|
||||||
mEyeBlinkTime = 0.f;
|
mEyeBlinkTime = 0.f;
|
||||||
mEyesClosed = FALSE;
|
mEyesClosed = false;
|
||||||
|
|
||||||
mHeadJoint = NULL;
|
mHeadJoint = NULL;
|
||||||
|
|
||||||
|
|
@ -362,9 +362,9 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLEyeMotion::onActivate()
|
// LLEyeMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLEyeMotion::onActivate()
|
bool LLEyeMotion::onActivate()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -373,7 +373,7 @@ BOOL LLEyeMotion::onActivate()
|
||||||
void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_state, LLJointState& right_eye_state)
|
void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_state, LLJointState& right_eye_state)
|
||||||
{
|
{
|
||||||
// Compute eye rotation.
|
// Compute eye rotation.
|
||||||
BOOL has_eye_target = FALSE;
|
bool has_eye_target = false;
|
||||||
LLQuaternion target_eye_rot;
|
LLQuaternion target_eye_rot;
|
||||||
LLVector3 eye_look_at;
|
LLVector3 eye_look_at;
|
||||||
F32 vergence;
|
F32 vergence;
|
||||||
|
|
@ -385,7 +385,7 @@ void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_s
|
||||||
LLVector3 up;
|
LLVector3 up;
|
||||||
|
|
||||||
eye_look_at = *targetPos;
|
eye_look_at = *targetPos;
|
||||||
has_eye_target = TRUE;
|
has_eye_target = true;
|
||||||
F32 lookAtDistance = eye_look_at.normVec();
|
F32 lookAtDistance = eye_look_at.normVec();
|
||||||
|
|
||||||
left.setVec(skyward % eye_look_at);
|
left.setVec(skyward % eye_look_at);
|
||||||
|
|
@ -460,7 +460,7 @@ void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_s
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLEyeMotion::onUpdate()
|
// LLEyeMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
||||||
//calculate jitter
|
//calculate jitter
|
||||||
|
|
@ -508,7 +508,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
|
|
||||||
if (rightEyeBlinkMorph == 1.f)
|
if (rightEyeBlinkMorph == 1.f)
|
||||||
{
|
{
|
||||||
mEyesClosed = TRUE;
|
mEyesClosed = true;
|
||||||
mEyeBlinkTime = EYE_BLINK_CLOSE_TIME;
|
mEyeBlinkTime = EYE_BLINK_CLOSE_TIME;
|
||||||
mEyeBlinkTimer.reset();
|
mEyeBlinkTimer.reset();
|
||||||
}
|
}
|
||||||
|
|
@ -528,7 +528,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
|
|
||||||
if (rightEyeBlinkMorph == 0.f)
|
if (rightEyeBlinkMorph == 0.f)
|
||||||
{
|
{
|
||||||
mEyesClosed = FALSE;
|
mEyesClosed = false;
|
||||||
mEyeBlinkTime = EYE_BLINK_MIN_TIME + ll_frand(EYE_BLINK_MAX_TIME - EYE_BLINK_MIN_TIME);
|
mEyeBlinkTime = EYE_BLINK_MIN_TIME + ll_frand(EYE_BLINK_MAX_TIME - EYE_BLINK_MIN_TIME);
|
||||||
mEyeBlinkTimer.reset();
|
mEyeBlinkTimer.reset();
|
||||||
}
|
}
|
||||||
|
|
@ -540,7 +540,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
adjustEyeTarget(targetPos, *mLeftEyeState, *mRightEyeState);
|
adjustEyeTarget(targetPos, *mLeftEyeState, *mRightEyeState);
|
||||||
adjustEyeTarget(targetPos, *mAltLeftEyeState, *mAltRightEyeState);
|
adjustEyeTarget(targetPos, *mAltLeftEyeState, *mAltRightEyeState);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual bool getLoop() { return true; }
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
virtual F32 getDuration() { return 0.0; }
|
virtual F32 getDuration() { return 0.0; }
|
||||||
|
|
@ -89,14 +89,14 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
|
|
@ -147,7 +147,7 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual bool getLoop() { return true; }
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
virtual F32 getDuration() { return 0.0; }
|
virtual F32 getDuration() { return 0.0; }
|
||||||
|
|
@ -172,16 +172,16 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
|
|
||||||
void adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_state, LLJointState& right_eye_state);
|
void adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_state, LLJointState& right_eye_state);
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
|
|
@ -209,7 +209,7 @@ public:
|
||||||
// eye blinking
|
// eye blinking
|
||||||
LLFrameTimer mEyeBlinkTimer;
|
LLFrameTimer mEyeBlinkTimer;
|
||||||
F32 mEyeBlinkTime;
|
F32 mEyeBlinkTime;
|
||||||
BOOL mEyesClosed;
|
bool mEyesClosed;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LL_LLHEADROTMOTION_H
|
#endif // LL_LLHEADROTMOTION_H
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ JointKey JointKey::construct(const std::string& aName)
|
||||||
return { aName, itr->second };
|
return { aName, itr->second };
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 size = mpStringToKeys.size() + 1;
|
U32 size = static_cast<U32>(mpStringToKeys.size()) + 1;
|
||||||
mpStringToKeys.try_emplace(aName, size);
|
mpStringToKeys.try_emplace(aName, size);
|
||||||
return { aName, size };
|
return { aName, size };
|
||||||
}
|
}
|
||||||
|
|
@ -94,7 +94,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c
|
||||||
|
|
||||||
U32 LLVector3OverrideMap::count() const
|
U32 LLVector3OverrideMap::count() const
|
||||||
{
|
{
|
||||||
return m_map.size();
|
return static_cast<U32>(m_map.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
|
void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
|
||||||
|
|
@ -104,7 +104,7 @@ void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
|
||||||
|
|
||||||
bool LLVector3OverrideMap::remove(const LLUUID& mesh_id)
|
bool LLVector3OverrideMap::remove(const LLUUID& mesh_id)
|
||||||
{
|
{
|
||||||
U32 remove_count = m_map.erase(mesh_id);
|
auto remove_count = m_map.erase(mesh_id);
|
||||||
return (remove_count > 0);
|
return (remove_count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,10 +123,10 @@ void LLJoint::init()
|
||||||
{
|
{
|
||||||
mName = "unnamed";
|
mName = "unnamed";
|
||||||
mParent = NULL;
|
mParent = NULL;
|
||||||
mXform.setScaleChildOffset(TRUE);
|
mXform.setScaleChildOffset(true);
|
||||||
mXform.setScale(LLVector3(1.0f, 1.0f, 1.0f));
|
mXform.setScale(LLVector3(1.0f, 1.0f, 1.0f));
|
||||||
mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY;
|
mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY;
|
||||||
mUpdateXform = TRUE;
|
mUpdateXform = true;
|
||||||
mSupport = SUPPORT_BASE;
|
mSupport = SUPPORT_BASE;
|
||||||
mEnd = LLVector3(0.0f, 0.0f, 0.0f);
|
mEnd = LLVector3(0.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
@ -153,7 +153,7 @@ LLJoint::LLJoint(const std::string &name, LLJoint *parent) :
|
||||||
mJointNum(-2)
|
mJointNum(-2)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
mUpdateXform = FALSE;
|
mUpdateXform = false;
|
||||||
|
|
||||||
setName(name);
|
setName(name);
|
||||||
if (parent)
|
if (parent)
|
||||||
|
|
@ -1017,7 +1017,7 @@ void LLJoint::updateWorldMatrix()
|
||||||
if (mDirtyFlags & MATRIX_DIRTY)
|
if (mDirtyFlags & MATRIX_DIRTY)
|
||||||
{
|
{
|
||||||
sNumUpdates++;
|
sNumUpdates++;
|
||||||
mXform.updateMatrix(FALSE);
|
mXform.updateMatrix(false);
|
||||||
mWorldMatrix.loadu(mXform.getWorldMatrix());
|
mWorldMatrix.loadu(mXform.getWorldMatrix());
|
||||||
mDirtyFlags = 0x0;
|
mDirtyFlags = 0x0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,21 +65,21 @@ inline std::ostream& operator<<(std::ostream &aLHS, JointKey const &aRHS)
|
||||||
}
|
}
|
||||||
// </FS:ND>
|
// </FS:ND>
|
||||||
|
|
||||||
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
|
constexpr S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
|
||||||
// Need to set this to count of animate-able joints,
|
// Need to set this to count of animate-able joints,
|
||||||
// currently = #bones + #collision_volumes + #attachments + 2,
|
// currently = #bones + #collision_volumes + #attachments + 2,
|
||||||
// rounded to next multiple of 4.
|
// rounded to next multiple of 4.
|
||||||
const U32 LL_CHARACTER_MAX_ANIMATED_JOINTS = 216; // must be divisible by 4!
|
constexpr U32 LL_CHARACTER_MAX_ANIMATED_JOINTS = 216; // must be divisible by 4!
|
||||||
const U32 LL_MAX_JOINTS_PER_MESH_OBJECT = 110;
|
constexpr U32 LL_MAX_JOINTS_PER_MESH_OBJECT = 110;
|
||||||
|
|
||||||
// These should be higher than the joint_num of any
|
// These should be higher than the joint_num of any
|
||||||
// other joint, to avoid conflicts in updateMotionsByType()
|
// other joint, to avoid conflicts in updateMotionsByType()
|
||||||
const U32 LL_HAND_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-1);
|
constexpr U32 LL_HAND_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-1);
|
||||||
const U32 LL_FACE_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-2);
|
constexpr U32 LL_FACE_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-2);
|
||||||
const S32 LL_CHARACTER_MAX_PRIORITY = 7;
|
constexpr S32 LL_CHARACTER_MAX_PRIORITY = 7;
|
||||||
const F32 LL_MAX_PELVIS_OFFSET = 5.f;
|
constexpr F32 LL_MAX_PELVIS_OFFSET = 5.f;
|
||||||
|
|
||||||
const F32 LL_JOINT_TRESHOLD_POS_OFFSET = 0.0001f; //0.1 mm
|
constexpr F32 LL_JOINT_TRESHOLD_POS_OFFSET = 0.0001f; //0.1 mm
|
||||||
|
|
||||||
class LLVector3OverrideMap
|
class LLVector3OverrideMap
|
||||||
{
|
{
|
||||||
|
|
@ -158,7 +158,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
U32 mDirtyFlags;
|
U32 mDirtyFlags;
|
||||||
BOOL mUpdateXform;
|
bool mUpdateXform;
|
||||||
|
|
||||||
// describes the skin binding pose
|
// describes the skin binding pose
|
||||||
LLVector3 mSkinOffset;
|
LLVector3 mSkinOffset;
|
||||||
|
|
@ -305,7 +305,7 @@ public:
|
||||||
|
|
||||||
void clampRotation(LLQuaternion old_rot, LLQuaternion new_rot);
|
void clampRotation(LLQuaternion old_rot, LLQuaternion new_rot);
|
||||||
|
|
||||||
virtual BOOL isAnimatable() const { return TRUE; }
|
virtual bool isAnimatable() const { return true; }
|
||||||
|
|
||||||
void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info, bool& active_override_changed );
|
void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info, bool& active_override_changed );
|
||||||
void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info, bool& active_override_changed );
|
void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info, bool& active_override_changed );
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,9 @@ LLJointSolverRP3::LLJointSolverRP3()
|
||||||
mLengthAB = 1.0f;
|
mLengthAB = 1.0f;
|
||||||
mLengthBC = 1.0f;
|
mLengthBC = 1.0f;
|
||||||
mPoleVector.setVec( 1.0f, 0.0f, 0.0f );
|
mPoleVector.setVec( 1.0f, 0.0f, 0.0f );
|
||||||
mbUseBAxis = FALSE;
|
mbUseBAxis = false;
|
||||||
mTwist = 0.0f;
|
mTwist = 0.0f;
|
||||||
mFirstTime = TRUE;
|
mFirstTime = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -114,7 +114,7 @@ void LLJointSolverRP3::setBAxis( const LLVector3& bAxis )
|
||||||
{
|
{
|
||||||
mBAxis = bAxis;
|
mBAxis = bAxis;
|
||||||
mBAxis.normVec();
|
mBAxis.normVec();
|
||||||
mbUseBAxis = TRUE;
|
mbUseBAxis = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -97,11 +97,11 @@ protected:
|
||||||
|
|
||||||
LLVector3 mPoleVector;
|
LLVector3 mPoleVector;
|
||||||
LLVector3 mBAxis;
|
LLVector3 mBAxis;
|
||||||
BOOL mbUseBAxis;
|
bool mbUseBAxis;
|
||||||
|
|
||||||
F32 mTwist;
|
F32 mTwist;
|
||||||
|
|
||||||
BOOL mFirstTime;
|
bool mFirstTime;
|
||||||
LLMatrix4 mSavedJointAMat;
|
LLMatrix4 mSavedJointAMat;
|
||||||
LLMatrix4 mSavedInvPlaneMat;
|
LLMatrix4 mSavedInvPlaneMat;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public:
|
||||||
// joint that this state is applied to
|
// joint that this state is applied to
|
||||||
LLJoint* getJoint() { return mJoint; }
|
LLJoint* getJoint() { return mJoint; }
|
||||||
const LLJoint* getJoint() const { return mJoint; }
|
const LLJoint* getJoint() const { return mJoint; }
|
||||||
BOOL setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; }
|
bool setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; }
|
||||||
|
|
||||||
// transform type (bitwise flags can be combined)
|
// transform type (bitwise flags can be combined)
|
||||||
// Note that these are set automatically when various
|
// Note that these are set automatically when various
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ LLMotion::LLMotionInitStatus LLKeyframeFallMotion::onInitialize(LLCharacter *cha
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeFallMotion::onActivate()
|
// LLKeyframeFallMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeFallMotion::onActivate()
|
bool LLKeyframeFallMotion::onActivate()
|
||||||
{
|
{
|
||||||
LLVector3 ground_pos;
|
LLVector3 ground_pos;
|
||||||
LLVector3 ground_normal;
|
LLVector3 ground_normal;
|
||||||
|
|
@ -119,10 +119,10 @@ BOOL LLKeyframeFallMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeFallMotion::onUpdate()
|
// LLKeyframeFallMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask)
|
bool LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
||||||
BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask);
|
bool result = LLKeyframeMotion::onUpdate(activeTime, joint_mask);
|
||||||
F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f);
|
F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f);
|
||||||
|
|
||||||
if (mPelvisState.notNull())
|
if (mPelvisState.notNull())
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@ public:
|
||||||
// animation callbacks to be implemented by subclasses
|
// animation callbacks to be implemented by subclasses
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
virtual F32 getEaseInDuration();
|
virtual F32 getEaseInDuration();
|
||||||
virtual BOOL onUpdate(F32 activeTime, U8* joint_mask);
|
virtual bool onUpdate(F32 activeTime, U8* joint_mask);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -86,9 +86,9 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() {
|
virtual bool getLoop() {
|
||||||
if (mJointMotionList) return mJointMotionList->mLoop;
|
if (mJointMotionList) return mJointMotionList->mLoop;
|
||||||
else return FALSE;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
|
|
@ -135,14 +135,14 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
|
|
@ -155,14 +155,14 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
U32 getFileSize();
|
U32 getFileSize();
|
||||||
BOOL serialize(LLDataPacker& dp) const;
|
bool serialize(LLDataPacker& dp) const;
|
||||||
BOOL deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints = true);
|
bool deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints = true);
|
||||||
BOOL isLoaded() { return mJointMotionList != NULL; }
|
bool isLoaded() { return mJointMotionList != NULL; }
|
||||||
bool dumpToFile(const std::string& name);
|
bool dumpToFile(const std::string& name);
|
||||||
|
|
||||||
|
|
||||||
// setters for modifying a keyframe animation
|
// setters for modifying a keyframe animation
|
||||||
void setLoop(BOOL loop);
|
void setLoop(bool loop);
|
||||||
|
|
||||||
F32 getLoopIn() {
|
F32 getLoopIn() {
|
||||||
return (mJointMotionList) ? mJointMotionList->mLoopInPoint : 0.f;
|
return (mJointMotionList) ? mJointMotionList->mLoopInPoint : 0.f;
|
||||||
|
|
@ -211,7 +211,7 @@ protected:
|
||||||
mEaseInStopTime(0.f),
|
mEaseInStopTime(0.f),
|
||||||
mEaseOutStartTime(0.f),
|
mEaseOutStartTime(0.f),
|
||||||
mEaseOutStopTime(0.f),
|
mEaseOutStopTime(0.f),
|
||||||
mUseTargetOffset(FALSE),
|
mUseTargetOffset(false),
|
||||||
mConstraintType(CONSTRAINT_TYPE_POINT),
|
mConstraintType(CONSTRAINT_TYPE_POINT),
|
||||||
mConstraintTargetType(CONSTRAINT_TARGET_TYPE_BODY),
|
mConstraintTargetType(CONSTRAINT_TARGET_TYPE_BODY),
|
||||||
mSourceConstraintVolume(0),
|
mSourceConstraintVolume(0),
|
||||||
|
|
@ -231,7 +231,7 @@ protected:
|
||||||
F32 mEaseInStopTime;
|
F32 mEaseInStopTime;
|
||||||
F32 mEaseOutStartTime;
|
F32 mEaseOutStartTime;
|
||||||
F32 mEaseOutStopTime;
|
F32 mEaseOutStopTime;
|
||||||
BOOL mUseTargetOffset;
|
bool mUseTargetOffset;
|
||||||
EConstraintType mConstraintType;
|
EConstraintType mConstraintType;
|
||||||
EConstraintTargetType mConstraintTargetType;
|
EConstraintTargetType mConstraintTargetType;
|
||||||
};
|
};
|
||||||
|
|
@ -251,7 +251,7 @@ protected:
|
||||||
LLVector3 mPositions[MAX_CHAIN_LENGTH];
|
LLVector3 mPositions[MAX_CHAIN_LENGTH];
|
||||||
F32 mJointLengths[MAX_CHAIN_LENGTH];
|
F32 mJointLengths[MAX_CHAIN_LENGTH];
|
||||||
F32 mJointLengthFractions[MAX_CHAIN_LENGTH];
|
F32 mJointLengthFractions[MAX_CHAIN_LENGTH];
|
||||||
BOOL mActive;
|
bool mActive;
|
||||||
LLVector3d mGroundPos;
|
LLVector3d mGroundPos;
|
||||||
LLVector3 mGroundNorm;
|
LLVector3 mGroundNorm;
|
||||||
LLJoint* mSourceVolume;
|
LLJoint* mSourceVolume;
|
||||||
|
|
@ -271,7 +271,7 @@ protected:
|
||||||
|
|
||||||
void applyConstraint(JointConstraint* constraintp, F32 time, U8* joint_mask);
|
void applyConstraint(JointConstraint* constraintp, F32 time, U8* joint_mask);
|
||||||
|
|
||||||
BOOL setupPose();
|
bool setupPose();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum AssetStatus { ASSET_LOADED, ASSET_FETCHED, ASSET_NEEDS_FETCH, ASSET_FETCH_FAILED, ASSET_UNDEFINED };
|
enum AssetStatus { ASSET_LOADED, ASSET_FETCHED, ASSET_NEEDS_FETCH, ASSET_FETCH_FAILED, ASSET_UNDEFINED };
|
||||||
|
|
@ -398,7 +398,7 @@ public:
|
||||||
public:
|
public:
|
||||||
std::vector<JointMotion*> mJointMotionArray;
|
std::vector<JointMotion*> mJointMotionArray;
|
||||||
F32 mDuration;
|
F32 mDuration;
|
||||||
BOOL mLoop;
|
bool mLoop;
|
||||||
F32 mLoopInPoint;
|
F32 mLoopInPoint;
|
||||||
F32 mLoopOutPoint;
|
F32 mLoopOutPoint;
|
||||||
F32 mEaseInDuration;
|
F32 mEaseInDuration;
|
||||||
|
|
@ -413,12 +413,14 @@ public:
|
||||||
// TODO: LLKeyframeDataCache::getKeyframeData should probably return a class containing
|
// TODO: LLKeyframeDataCache::getKeyframeData should probably return a class containing
|
||||||
// JointMotionList and mEmoteName, see LLKeyframeMotion::onInitialize.
|
// JointMotionList and mEmoteName, see LLKeyframeMotion::onInitialize.
|
||||||
std::string mEmoteName;
|
std::string mEmoteName;
|
||||||
|
LLUUID mEmoteID;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
JointMotionList();
|
JointMotionList();
|
||||||
~JointMotionList();
|
~JointMotionList();
|
||||||
U32 dumpDiagInfo();
|
U32 dumpDiagInfo();
|
||||||
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
|
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
|
||||||
U32 getNumJointMotions() const { return mJointMotionArray.size(); }
|
U32 getNumJointMotions() const { return static_cast<U32>(mJointMotionArray.size()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeMotionParam::onActivate()
|
// LLKeyframeMotionParam::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeMotionParam::onActivate()
|
bool LLKeyframeMotionParam::onActivate()
|
||||||
{
|
{
|
||||||
for (motion_map_t::value_type& motion_pair : mParameterizedMotions)
|
for (motion_map_t::value_type& motion_pair : mParameterizedMotions)
|
||||||
{
|
{
|
||||||
|
|
@ -146,14 +146,14 @@ BOOL LLKeyframeMotionParam::onActivate()
|
||||||
paramMotion.mMotion->activate(mActivationTimestamp);
|
paramMotion.mMotion->activate(mActivationTimestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeMotionParam::onUpdate()
|
// LLKeyframeMotionParam::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
bool LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
F32 weightFactor = 1.f / (F32)mParameterizedMotions.size();
|
F32 weightFactor = 1.f / (F32)mParameterizedMotions.size();
|
||||||
|
|
@ -265,7 +265,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
||||||
|
|
||||||
LL_INFOS() << "Param Motion weight " << mPoseBlender.getBlendedPose()->getWeight() << LL_ENDL;
|
LL_INFOS() << "Param Motion weight " << mPoseBlender.getBlendedPose()->getWeight() << LL_ENDL;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -286,13 +286,13 @@ void LLKeyframeMotionParam::onDeactivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeMotionParam::addKeyframeMotion()
|
// LLKeyframeMotionParam::addKeyframeMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value)
|
bool LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value)
|
||||||
{
|
{
|
||||||
LLMotion *newMotion = mCharacter->createMotion( id );
|
LLMotion *newMotion = mCharacter->createMotion( id );
|
||||||
|
|
||||||
if (!newMotion)
|
if (!newMotion)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
newMotion->setName(name);
|
newMotion->setName(name);
|
||||||
|
|
@ -300,7 +300,7 @@ BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char
|
||||||
// now add motion to this list
|
// now add motion to this list
|
||||||
mParameterizedMotions[param].insert(ParameterizedMotion(newMotion, value));
|
mParameterizedMotions[param].insert(ParameterizedMotion(newMotion, value));
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -325,7 +325,7 @@ void LLKeyframeMotionParam::setDefaultKeyframeMotion(char *name)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// loadMotions()
|
// loadMotions()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeMotionParam::loadMotions()
|
bool LLKeyframeMotionParam::loadMotions()
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Load named file by concatenating the character prefix with the motion name.
|
// Load named file by concatenating the character prefix with the motion name.
|
||||||
|
|
@ -352,7 +352,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
||||||
if (!fp || fileSize == 0)
|
if (!fp || fileSize == 0)
|
||||||
{
|
{
|
||||||
LL_INFOS() << "ERROR: can't open: " << path << LL_ENDL;
|
LL_INFOS() << "ERROR: can't open: " << path << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate a text buffer
|
// allocate a text buffer
|
||||||
|
|
@ -391,7 +391,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
||||||
if ( error )
|
if ( error )
|
||||||
{
|
{
|
||||||
LL_INFOS() << "ERROR: error while reading from " << path << LL_ENDL;
|
LL_INFOS() << "ERROR: error while reading from " << path << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LL_INFOS() << "Loading parametric keyframe data for: " << getName() << LL_ENDL;
|
LL_INFOS() << "Loading parametric keyframe data for: " << getName() << LL_ENDL;
|
||||||
|
|
@ -409,7 +409,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// get priority
|
// get priority
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
BOOL isFirstMotion = TRUE;
|
bool isFirstMotion = true;
|
||||||
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
|
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
|
|
@ -418,13 +418,13 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
||||||
if ((num != 3))
|
if ((num != 3))
|
||||||
{
|
{
|
||||||
LL_INFOS() << "WARNING: can't read parametric motion" << LL_ENDL;
|
LL_INFOS() << "WARNING: can't read parametric motion" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
addKeyframeMotion(strA, gAnimLibrary.stringToAnimState(std::string(strA)), strB, floatA);
|
addKeyframeMotion(strA, gAnimLibrary.stringToAnimState(std::string(strA)), strB, floatA);
|
||||||
if (isFirstMotion)
|
if (isFirstMotion)
|
||||||
{
|
{
|
||||||
isFirstMotion = FALSE;
|
isFirstMotion = false;
|
||||||
setDefaultKeyframeMotion(strA);
|
setDefaultKeyframeMotion(strA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -438,7 +438,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
||||||
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
|
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,8 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() {
|
virtual bool getLoop() {
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
|
|
@ -102,14 +102,14 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
|
|
@ -128,12 +128,12 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
// add a motion and associated parameter triplet
|
// add a motion and associated parameter triplet
|
||||||
BOOL addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value);
|
bool addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value);
|
||||||
|
|
||||||
// set default motion for LOD and retrieving blend constants
|
// set default motion for LOD and retrieving blend constants
|
||||||
void setDefaultKeyframeMotion(char *);
|
void setDefaultKeyframeMotion(char *);
|
||||||
|
|
||||||
BOOL loadMotions();
|
bool loadMotions();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ const F32 POSITION_THRESHOLD = 0.1f;
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotion(id)
|
LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotion(id)
|
||||||
{
|
{
|
||||||
mFlipFeet = FALSE;
|
mFlipFeet = false;
|
||||||
mCharacter = NULL;
|
mCharacter = NULL;
|
||||||
|
|
||||||
// create kinematic hierarchy
|
// create kinematic hierarchy
|
||||||
|
|
@ -67,7 +67,7 @@ LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotio
|
||||||
mKneeRightState = NULL;
|
mKneeRightState = NULL;
|
||||||
mAnkleRightState = NULL;
|
mAnkleRightState = NULL;
|
||||||
|
|
||||||
mTrackAnkles = TRUE;
|
mTrackAnkles = true;
|
||||||
|
|
||||||
mFrameNum = 0;
|
mFrameNum = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +90,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch
|
||||||
// save character pointer for later use
|
// save character pointer for later use
|
||||||
mCharacter = character;
|
mCharacter = character;
|
||||||
|
|
||||||
mFlipFeet = FALSE;
|
mFlipFeet = false;
|
||||||
|
|
||||||
// load keyframe data, setup pose and joint states
|
// load keyframe data, setup pose and joint states
|
||||||
LLMotion::LLMotionInitStatus status = LLKeyframeMotion::onInitialize(character);
|
LLMotion::LLMotionInitStatus status = LLKeyframeMotion::onInitialize(character);
|
||||||
|
|
@ -129,7 +129,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeStandMotion::onActivate()
|
// LLKeyframeStandMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeStandMotion::onActivate()
|
bool LLKeyframeStandMotion::onActivate()
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// setup the IK solvers
|
// setup the IK solvers
|
||||||
|
|
@ -158,15 +158,15 @@ void LLKeyframeStandMotion::onDeactivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeStandMotion::onUpdate()
|
// LLKeyframeStandMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// let the base class update the cycle
|
// let the base class update the cycle
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
BOOL status = LLKeyframeMotion::onUpdate(time, joint_mask);
|
bool status = LLKeyframeMotion::onUpdate(time, joint_mask);
|
||||||
if (!status)
|
if (!status)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVector3 root_world_pos = mPelvisState->getJoint()->getParent()->getWorldPosition();
|
LLVector3 root_world_pos = mPelvisState->getJoint()->getParent()->getWorldPosition();
|
||||||
|
|
@ -174,7 +174,7 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
// have we received a valid world position for this avatar?
|
// have we received a valid world position for this avatar?
|
||||||
if (root_world_pos.isExactlyZero())
|
if (root_world_pos.isExactlyZero())
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
@ -185,16 +185,16 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
mLastGoodPelvisRotation = mPelvisState->getJoint()->getWorldRotation();
|
mLastGoodPelvisRotation = mPelvisState->getJoint()->getWorldRotation();
|
||||||
mLastGoodPelvisRotation.normalize();
|
mLastGoodPelvisRotation.normalize();
|
||||||
mTrackAnkles = TRUE;
|
mTrackAnkles = true;
|
||||||
}
|
}
|
||||||
else if ((mCharacter->getCharacterPosition() - mLastGoodPosition).magVecSquared() > POSITION_THRESHOLD)
|
else if ((mCharacter->getCharacterPosition() - mLastGoodPosition).magVecSquared() > POSITION_THRESHOLD)
|
||||||
{
|
{
|
||||||
mLastGoodPosition = mCharacter->getCharacterPosition();
|
mLastGoodPosition = mCharacter->getCharacterPosition();
|
||||||
mTrackAnkles = TRUE;
|
mTrackAnkles = true;
|
||||||
}
|
}
|
||||||
else if (mPose.getWeight() < 1.f)
|
else if (mPose.getWeight() < 1.f)
|
||||||
{
|
{
|
||||||
mTrackAnkles = TRUE;
|
mTrackAnkles = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -255,7 +255,7 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
else if (mFrameNum < 2)
|
else if (mFrameNum < 2)
|
||||||
{
|
{
|
||||||
mFrameNum++;
|
mFrameNum++;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
mFrameNum++;
|
mFrameNum++;
|
||||||
|
|
@ -336,7 +336,7 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
//LL_INFOS() << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << LL_ENDL;
|
//LL_INFOS() << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << LL_ENDL;
|
||||||
|
|
||||||
// LL_INFOS() << "DEBUG: " << speed << " : " << mTrackAnkles << LL_ENDL;
|
// LL_INFOS() << "DEBUG: " << speed << " : " << mTrackAnkles << LL_ENDL;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,9 @@ public:
|
||||||
// animation callbacks to be implemented by subclasses
|
// animation callbacks to be implemented by subclasses
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
void onDeactivate();
|
void onDeactivate();
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
@ -85,7 +85,7 @@ public:
|
||||||
|
|
||||||
LLCharacter *mCharacter;
|
LLCharacter *mCharacter;
|
||||||
|
|
||||||
BOOL mFlipFeet;
|
bool mFlipFeet;
|
||||||
|
|
||||||
LLPointer<LLJointState> mPelvisState;
|
LLPointer<LLJointState> mPelvisState;
|
||||||
|
|
||||||
|
|
@ -109,7 +109,7 @@ public:
|
||||||
|
|
||||||
LLQuaternion mLastGoodPelvisRotation;
|
LLQuaternion mLastGoodPelvisRotation;
|
||||||
LLVector3 mLastGoodPosition;
|
LLVector3 mLastGoodPosition;
|
||||||
BOOL mTrackAnkles;
|
bool mTrackAnkles;
|
||||||
|
|
||||||
S32 mFrameNum;
|
S32 mFrameNum;
|
||||||
} LL_ALIGN_POSTFIX(16);
|
} LL_ALIGN_POSTFIX(16);
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ LLMotion::LLMotionInitStatus LLKeyframeWalkMotion::onInitialize(LLCharacter *cha
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeWalkMotion::onActivate()
|
// LLKeyframeWalkMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeWalkMotion::onActivate()
|
bool LLKeyframeWalkMotion::onActivate()
|
||||||
{
|
{
|
||||||
mRealTimeLast = 0.0f;
|
mRealTimeLast = 0.0f;
|
||||||
mAdjTimeLast = 0.0f;
|
mAdjTimeLast = 0.0f;
|
||||||
|
|
@ -103,7 +103,7 @@ void LLKeyframeWalkMotion::onDeactivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLKeyframeWalkMotion::onUpdate()
|
// LLKeyframeWalkMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
// compute time since last update
|
// compute time since last update
|
||||||
|
|
@ -174,7 +174,7 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLWalkAdjustMotion::onActivate()
|
// LLWalkAdjustMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLWalkAdjustMotion::onActivate()
|
bool LLWalkAdjustMotion::onActivate()
|
||||||
{
|
{
|
||||||
mAnimSpeed = 0.f;
|
mAnimSpeed = 0.f;
|
||||||
mAdjustedSpeed = 0.f;
|
mAdjustedSpeed = 0.f;
|
||||||
|
|
@ -191,13 +191,13 @@ BOOL LLWalkAdjustMotion::onActivate()
|
||||||
F32 rightAnkleOffset = (mRightAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec();
|
F32 rightAnkleOffset = (mRightAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec();
|
||||||
mAnkleOffset = llmax(leftAnkleOffset, rightAnkleOffset);
|
mAnkleOffset = llmax(leftAnkleOffset, rightAnkleOffset);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLWalkAdjustMotion::onUpdate()
|
// LLWalkAdjustMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
// delta_time is guaranteed to be non zero
|
// delta_time is guaranteed to be non zero
|
||||||
|
|
@ -318,7 +318,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
// need to update *some* joint to keep this animation active
|
// need to update *some* joint to keep this animation active
|
||||||
mPelvisState->setPosition(mPelvisOffset);
|
mPelvisState->setPosition(mPelvisOffset);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -365,18 +365,18 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLFlyAdjustMotion::onActivate()
|
// LLFlyAdjustMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLFlyAdjustMotion::onActivate()
|
bool LLFlyAdjustMotion::onActivate()
|
||||||
{
|
{
|
||||||
mPelvisState->setPosition(LLVector3::zero);
|
mPelvisState->setPosition(LLVector3::zero);
|
||||||
mPelvisState->setRotation(LLQuaternion::DEFAULT);
|
mPelvisState->setRotation(LLQuaternion::DEFAULT);
|
||||||
mRoll = 0.f;
|
mRoll = 0.f;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLFlyAdjustMotion::onUpdate()
|
// LLFlyAdjustMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
LLVector3 ang_vel = mCharacter->getCharacterAngularVelocity() * mCharacter->getTimeDilation();
|
LLVector3 ang_vel = mCharacter->getCharacterAngularVelocity() * mCharacter->getTimeDilation();
|
||||||
|
|
@ -391,6 +391,6 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
|
LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
|
||||||
mPelvisState->setRotation(roll);
|
mPelvisState->setRotation(roll);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,9 @@ public:
|
||||||
// animation callbacks to be implemented by subclasses
|
// animation callbacks to be implemented by subclasses
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
@ -100,11 +100,11 @@ public:
|
||||||
// animation callbacks to be implemented by subclasses
|
// animation callbacks to be implemented by subclasses
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGH_PRIORITY;}
|
virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGH_PRIORITY;}
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual bool getLoop() { return true; }
|
||||||
virtual F32 getDuration() { return 0.f; }
|
virtual F32 getDuration() { return 0.f; }
|
||||||
virtual F32 getEaseInDuration() { return 0.f; }
|
virtual F32 getEaseInDuration() { return 0.f; }
|
||||||
virtual F32 getEaseOutDuration() { return 0.f; }
|
virtual F32 getEaseOutDuration() { return 0.f; }
|
||||||
|
|
@ -150,11 +150,11 @@ public:
|
||||||
// animation callbacks to be implemented by subclasses
|
// animation callbacks to be implemented by subclasses
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
virtual void onDeactivate() {};
|
virtual void onDeactivate() {};
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGHER_PRIORITY;}
|
virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGHER_PRIORITY;}
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual bool getLoop() { return true; }
|
||||||
virtual F32 getDuration() { return 0.f; }
|
virtual F32 getDuration() { return 0.f; }
|
||||||
virtual F32 getEaseInDuration() { return 0.f; }
|
virtual F32 getEaseInDuration() { return 0.f; }
|
||||||
virtual F32 getEaseOutDuration() { return 0.f; }
|
virtual F32 getEaseOutDuration() { return 0.f; }
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLMotion::LLMotion( const LLUUID &id ) :
|
LLMotion::LLMotion( const LLUUID &id ) :
|
||||||
mStopped(TRUE),
|
mStopped(true),
|
||||||
mActive(FALSE),
|
mActive(false),
|
||||||
mID(id),
|
mID(id),
|
||||||
mActivationTimestamp(0.f),
|
mActivationTimestamp(0.f),
|
||||||
mStopTimestamp(0.f),
|
mStopTimestamp(0.f),
|
||||||
|
|
@ -132,10 +132,10 @@ void LLMotion::setDeactivateCallback( void (*cb)(void *), void* userdata )
|
||||||
void LLMotion::setStopTime(F32 time)
|
void LLMotion::setStopTime(F32 time)
|
||||||
{
|
{
|
||||||
mStopTimestamp = time;
|
mStopTimestamp = time;
|
||||||
mStopped = TRUE;
|
mStopped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLMotion::isBlending()
|
bool LLMotion::isBlending()
|
||||||
{
|
{
|
||||||
return mPose.getWeight() < 1.f;
|
return mPose.getWeight() < 1.f;
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +146,8 @@ BOOL LLMotion::isBlending()
|
||||||
void LLMotion::activate(F32 time)
|
void LLMotion::activate(F32 time)
|
||||||
{
|
{
|
||||||
mActivationTimestamp = time;
|
mActivationTimestamp = time;
|
||||||
mStopped = FALSE;
|
mStopped = false;
|
||||||
mActive = TRUE;
|
mActive = true;
|
||||||
onActivate();
|
onActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ void LLMotion::activate(F32 time)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLMotion::deactivate()
|
void LLMotion::deactivate()
|
||||||
{
|
{
|
||||||
mActive = FALSE;
|
mActive = false;
|
||||||
mPose.setWeight(0.f);
|
mPose.setWeight(0.f);
|
||||||
|
|
||||||
if (mDeactivateCallback)
|
if (mDeactivateCallback)
|
||||||
|
|
@ -169,9 +169,9 @@ void LLMotion::deactivate()
|
||||||
onDeactivate();
|
onDeactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLMotion::canDeprecate()
|
bool LLMotion::canDeprecate()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|
|
||||||
|
|
@ -91,21 +91,21 @@ public:
|
||||||
|
|
||||||
virtual void setStopTime(F32 time);
|
virtual void setStopTime(F32 time);
|
||||||
|
|
||||||
BOOL isStopped() const { return mStopped; }
|
bool isStopped() const { return mStopped; }
|
||||||
|
|
||||||
void setStopped(BOOL stopped) { mStopped = stopped; }
|
void setStopped(bool stopped) { mStopped = stopped; }
|
||||||
|
|
||||||
BOOL isBlending();
|
bool isBlending();
|
||||||
|
|
||||||
// Activation functions.
|
// Activation functions.
|
||||||
// It is OK for other classes to activate a motion,
|
// It is OK for other classes to activate a motion,
|
||||||
// but only the controller can deactivate it.
|
// but only the controller can deactivate it.
|
||||||
// Thus, if mActive == TRUE, the motion *may* be on the controllers active list,
|
// Thus, if mActive == true, the motion *may* be on the controllers active list,
|
||||||
// but if mActive == FALSE, the motion is gauranteed not to be on the active list.
|
// but if mActive == false, the motion is gauranteed not to be on the active list.
|
||||||
protected:
|
protected:
|
||||||
// Used by LLMotionController only
|
// Used by LLMotionController only
|
||||||
void deactivate();
|
void deactivate();
|
||||||
BOOL isActive() { return mActive; }
|
bool isActive() { return mActive; }
|
||||||
public:
|
public:
|
||||||
void activate(F32 time);
|
void activate(F32 time);
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() = 0;
|
virtual bool getLoop() = 0;
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
virtual F32 getDuration() = 0;
|
virtual F32 getDuration() = 0;
|
||||||
|
|
@ -144,33 +144,33 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character) = 0;
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character) = 0;
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 activeTime, U8* joint_mask) = 0;
|
virtual bool onUpdate(F32 activeTime, U8* joint_mask) = 0;
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate() = 0;
|
virtual void onDeactivate() = 0;
|
||||||
|
|
||||||
// can we crossfade this motion with a new instance when restarted?
|
// can we crossfade this motion with a new instance when restarted?
|
||||||
// should ultimately always be TRUE, but lack of emote blending, etc
|
// should ultimately always be true, but lack of emote blending, etc
|
||||||
// requires this
|
// requires this
|
||||||
virtual BOOL canDeprecate();
|
virtual bool canDeprecate();
|
||||||
|
|
||||||
// optional callback routine called when animation deactivated.
|
// optional callback routine called when animation deactivated.
|
||||||
void setDeactivateCallback( void (*cb)(void *), void* userdata );
|
void setDeactivateCallback( void (*cb)(void *), void* userdata );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate() = 0;
|
virtual bool onActivate() = 0;
|
||||||
|
|
||||||
void addJointState(const LLPointer<LLJointState>& jointState);
|
void addJointState(const LLPointer<LLJointState>& jointState);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LLPose mPose;
|
LLPose mPose;
|
||||||
BOOL mStopped; // motion has been stopped;
|
bool mStopped; // motion has been stopped;
|
||||||
BOOL mActive; // motion is on active list (can be stopped or not stopped)
|
bool mActive; // motion is on active list (can be stopped or not stopped)
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// these are set implicitly by the motion controller and
|
// these are set implicitly by the motion controller and
|
||||||
|
|
@ -199,7 +199,7 @@ public:
|
||||||
LLTestMotion(const LLUUID &id) : LLMotion(id){}
|
LLTestMotion(const LLUUID &id) : LLMotion(id){}
|
||||||
~LLTestMotion() {}
|
~LLTestMotion() {}
|
||||||
static LLMotion *create(const LLUUID& id) { return new LLTestMotion(id); }
|
static LLMotion *create(const LLUUID& id) { return new LLTestMotion(id); }
|
||||||
BOOL getLoop() { return FALSE; }
|
bool getLoop() { return false; }
|
||||||
F32 getDuration() { return 0.0f; }
|
F32 getDuration() { return 0.0f; }
|
||||||
F32 getEaseInDuration() { return 0.0f; }
|
F32 getEaseInDuration() { return 0.0f; }
|
||||||
F32 getEaseOutDuration() { return 0.0f; }
|
F32 getEaseOutDuration() { return 0.0f; }
|
||||||
|
|
@ -208,8 +208,8 @@ public:
|
||||||
F32 getMinPixelArea() { return 0.f; }
|
F32 getMinPixelArea() { return 0.f; }
|
||||||
|
|
||||||
LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; }
|
LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; }
|
||||||
BOOL onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return TRUE; }
|
bool onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return true; }
|
||||||
BOOL onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return TRUE; }
|
bool onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return true; }
|
||||||
void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; }
|
void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -225,7 +225,7 @@ public:
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLNullMotion(id); }
|
static LLMotion *create(const LLUUID &id) { return new LLNullMotion(id); }
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
/*virtual*/ BOOL getLoop() { return TRUE; }
|
/*virtual*/ bool getLoop() { return true; }
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
/*virtual*/ F32 getDuration() { return 1.f; }
|
/*virtual*/ F32 getDuration() { return 1.f; }
|
||||||
|
|
@ -251,14 +251,14 @@ public:
|
||||||
/*virtual*/ LLMotionInitStatus onInitialize(LLCharacter *character) { return STATUS_SUCCESS; }
|
/*virtual*/ LLMotionInitStatus onInitialize(LLCharacter *character) { return STATUS_SUCCESS; }
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
/*virtual*/ BOOL onActivate() { return TRUE; }
|
/*virtual*/ bool onActivate() { return true; }
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return false when the motion is completed.
|
||||||
/*virtual*/ BOOL onUpdate(F32 activeTime, U8* joint_mask) { return TRUE; }
|
/*virtual*/ bool onUpdate(F32 activeTime, U8* joint_mask) { return true; }
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
/*virtual*/ void onDeactivate() {}
|
/*virtual*/ void onDeactivate() {}
|
||||||
|
|
|
||||||
|
|
@ -76,16 +76,16 @@ LLMotionRegistry::~LLMotionRegistry()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// addMotion()
|
// addMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
|
bool LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
|
||||||
{
|
{
|
||||||
// LL_INFOS() << "Registering motion: " << name << LL_ENDL;
|
// LL_INFOS() << "Registering motion: " << name << LL_ENDL;
|
||||||
if (!is_in_map(mMotionTable, id))
|
if (!is_in_map(mMotionTable, id))
|
||||||
{
|
{
|
||||||
mMotionTable[id] = constructor;
|
mMotionTable[id] = constructor;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -134,13 +134,13 @@ LLMotionController::LLMotionController()
|
||||||
mAnimTime(0.f),
|
mAnimTime(0.f),
|
||||||
mPrevTimerElapsed(0.f),
|
mPrevTimerElapsed(0.f),
|
||||||
mLastTime(0.0f),
|
mLastTime(0.0f),
|
||||||
mHasRunOnce(FALSE),
|
mHasRunOnce(false),
|
||||||
mPaused(FALSE),
|
mPaused(false),
|
||||||
mPausedFrame(0),
|
mPausedFrame(0),
|
||||||
mTimeStep(0.f),
|
mTimeStep(0.f),
|
||||||
mTimeStepCount(0),
|
mTimeStepCount(0),
|
||||||
mLastInterp(0.f),
|
mLastInterp(0.f),
|
||||||
mIsSelf(FALSE),
|
mIsSelf(false),
|
||||||
mLastCountAfterPurge(0)
|
mLastCountAfterPurge(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -157,11 +157,11 @@ LLMotionController::~LLMotionController()
|
||||||
|
|
||||||
void LLMotionController::incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions)
|
void LLMotionController::incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions)
|
||||||
{
|
{
|
||||||
num_motions += mAllMotions.size();
|
num_motions += static_cast<S32>(mAllMotions.size());
|
||||||
num_loading_motions += mLoadingMotions.size();
|
num_loading_motions += static_cast<S32>(mLoadingMotions.size());
|
||||||
num_loaded_motions += mLoadedMotions.size();
|
num_loaded_motions += static_cast<S32>(mLoadedMotions.size());
|
||||||
num_active_motions += mActiveMotions.size();
|
num_active_motions += static_cast<S32>(mActiveMotions.size());
|
||||||
num_deprecated_motions += mDeprecatedMotions.size();
|
num_deprecated_motions += static_cast<S32>(mDeprecatedMotions.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -223,7 +223,7 @@ void LLMotionController::purgeExcessMotions()
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up all inactive, loaded motions
|
// clean up all inactive, loaded motions
|
||||||
for (LLUUID motion_id : motions_to_kill)
|
for (const LLUUID& motion_id : motions_to_kill)
|
||||||
{
|
{
|
||||||
// look up the motion again by ID to get canonical instance
|
// look up the motion again by ID to get canonical instance
|
||||||
// and kill it only if that one is inactive
|
// and kill it only if that one is inactive
|
||||||
|
|
@ -234,7 +234,7 @@ void LLMotionController::purgeExcessMotions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 loaded_count = mLoadedMotions.size();
|
U32 loaded_count = static_cast<U32>(mLoadedMotions.size());
|
||||||
// <FS:Ansariel> Can't do anything about it anyway - stop spamming the log
|
// <FS:Ansariel> Can't do anything about it anyway - stop spamming the log
|
||||||
//if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge)
|
//if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge)
|
||||||
//{
|
//{
|
||||||
|
|
@ -278,7 +278,7 @@ void LLMotionController::setTimeStep(F32 step)
|
||||||
LLMotion* motionp = *iter;
|
LLMotion* motionp = *iter;
|
||||||
F32 activation_time = motionp->mActivationTimestamp;
|
F32 activation_time = motionp->mActivationTimestamp;
|
||||||
motionp->mActivationTimestamp = (F32)(llfloor(activation_time / step)) * step;
|
motionp->mActivationTimestamp = (F32)(llfloor(activation_time / step)) * step;
|
||||||
BOOL stopped = motionp->isStopped();
|
bool stopped = motionp->isStopped();
|
||||||
motionp->setStopTime((F32)(llfloor(motionp->getStopTime() / step)) * step);
|
motionp->setStopTime((F32)(llfloor(motionp->getStopTime() / step)) * step);
|
||||||
motionp->setStopped(stopped);
|
motionp->setStopped(stopped);
|
||||||
motionp->mSendStopTimestamp = (F32)llfloor(motionp->mSendStopTimestamp / step) * step;
|
motionp->mSendStopTimestamp = (F32)llfloor(motionp->mSendStopTimestamp / step) * step;
|
||||||
|
|
@ -306,7 +306,7 @@ void LLMotionController::setCharacter(LLCharacter *character)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// registerMotion()
|
// registerMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLMotionController::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
|
bool LLMotionController::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
|
||||||
{
|
{
|
||||||
return sRegistry.registerMotion(id, constructor);
|
return sRegistry.registerMotion(id, constructor);
|
||||||
}
|
}
|
||||||
|
|
@ -399,7 +399,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// startMotion()
|
// startMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
|
bool LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
|
||||||
{
|
{
|
||||||
// do we have an instance of this motion for this character?
|
// do we have an instance of this motion for this character?
|
||||||
LLMotion *motion = findMotion(id);
|
LLMotion *motion = findMotion(id);
|
||||||
|
|
@ -425,12 +425,12 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
|
||||||
|
|
||||||
if (!motion)
|
if (!motion)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
//if the motion is already active and allows deprecation, then let it keep playing
|
//if the motion is already active and allows deprecation, then let it keep playing
|
||||||
else if (motion->canDeprecate() && isMotionActive(motion))
|
else if (motion->canDeprecate() && isMotionActive(motion))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LL_INFOS() << "Starting motion " << name << LL_ENDL;
|
// LL_INFOS() << "Starting motion " << name << LL_ENDL;
|
||||||
|
|
@ -441,7 +441,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// stopMotionLocally()
|
// stopMotionLocally()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate)
|
bool LLMotionController::stopMotionLocally(const LLUUID &id, bool stop_immediate)
|
||||||
{
|
{
|
||||||
// if already inactive, return false
|
// if already inactive, return false
|
||||||
LLMotion *motion = findMotion(id);
|
LLMotion *motion = findMotion(id);
|
||||||
|
|
@ -449,11 +449,11 @@ BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate
|
||||||
return stopMotionInstance(motion, stop_immediate||mPaused);
|
return stopMotionInstance(motion, stop_immediate||mPaused);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLMotionController::stopMotionInstance(LLMotion* motion, BOOL stop_immediate)
|
bool LLMotionController::stopMotionInstance(LLMotion* motion, bool stop_immediate)
|
||||||
{
|
{
|
||||||
if (!motion)
|
if (!motion)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -465,15 +465,15 @@ BOOL LLMotionController::stopMotionInstance(LLMotion* motion, BOOL stop_immediat
|
||||||
{
|
{
|
||||||
deactivateMotionInstance(motion);
|
deactivateMotionInstance(motion);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else if (isMotionLoading(motion))
|
else if (isMotionLoading(motion))
|
||||||
{
|
{
|
||||||
motion->setStopped(TRUE);
|
motion->setStopped(true);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -528,7 +528,7 @@ void LLMotionController::updateIdleMotion(LLMotion* motionp)
|
||||||
if (mLastTime <= motionp->mSendStopTimestamp)
|
if (mLastTime <= motionp->mSendStopTimestamp)
|
||||||
{
|
{
|
||||||
mCharacter->requestStopMotion( motionp );
|
mCharacter->requestStopMotion( motionp );
|
||||||
stopMotionInstance(motionp, FALSE);
|
stopMotionInstance(motionp, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mAnimTime >= motionp->mActivationTimestamp)
|
else if (mAnimTime >= motionp->mActivationTimestamp)
|
||||||
|
|
@ -562,7 +562,7 @@ void LLMotionController::updateIdleActiveMotions()
|
||||||
void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
|
void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
||||||
BOOL update_result = TRUE;
|
bool update_result = true;
|
||||||
U8 last_joint_signature[LL_CHARACTER_MAX_ANIMATED_JOINTS];
|
U8 last_joint_signature[LL_CHARACTER_MAX_ANIMATED_JOINTS];
|
||||||
|
|
||||||
memset(&last_joint_signature, 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS);
|
memset(&last_joint_signature, 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS);
|
||||||
|
|
@ -578,11 +578,11 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL update_motion = FALSE;
|
bool update_motion = false;
|
||||||
|
|
||||||
if (motionp->getPose()->getWeight() < 1.f)
|
if (motionp->getPose()->getWeight() < 1.f)
|
||||||
{
|
{
|
||||||
update_motion = TRUE;
|
update_motion = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -594,7 +594,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||||
if ((*current_signature | test_signature) > (*current_signature))
|
if ((*current_signature | test_signature) > (*current_signature))
|
||||||
{
|
{
|
||||||
*current_signature |= test_signature;
|
*current_signature |= test_signature;
|
||||||
update_motion = TRUE;
|
update_motion = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
*((U32*)&last_joint_signature[i * 4]) = *(U32*)&(mJointSignature[1][i * 4]);
|
*((U32*)&last_joint_signature[i * 4]) = *(U32*)&(mJointSignature[1][i * 4]);
|
||||||
|
|
@ -604,7 +604,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||||
if ((*current_signature | test_signature) > (*current_signature))
|
if ((*current_signature | test_signature) > (*current_signature))
|
||||||
{
|
{
|
||||||
*current_signature |= test_signature;
|
*current_signature |= test_signature;
|
||||||
update_motion = TRUE;
|
update_motion = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -630,7 +630,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||||
if (mLastTime <= motionp->mSendStopTimestamp)
|
if (mLastTime <= motionp->mSendStopTimestamp)
|
||||||
{
|
{
|
||||||
mCharacter->requestStopMotion( motionp );
|
mCharacter->requestStopMotion( motionp );
|
||||||
stopMotionInstance(motionp, FALSE);
|
stopMotionInstance(motionp, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -711,7 +711,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||||
if (mLastTime <= motionp->mSendStopTimestamp)
|
if (mLastTime <= motionp->mSendStopTimestamp)
|
||||||
{
|
{
|
||||||
mCharacter->requestStopMotion( motionp );
|
mCharacter->requestStopMotion( motionp );
|
||||||
stopMotionInstance(motionp, FALSE);
|
stopMotionInstance(motionp, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -757,12 +757,12 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||||
// propagate this to the network
|
// propagate this to the network
|
||||||
// as not all viewers are guaranteed to have access to the same logic
|
// as not all viewers are guaranteed to have access to the same logic
|
||||||
mCharacter->requestStopMotion( motionp );
|
mCharacter->requestStopMotion( motionp );
|
||||||
stopMotionInstance(motionp, FALSE);
|
stopMotionInstance(motionp, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// even if onupdate returns FALSE, add this motion in to the blend one last time
|
// even if onupdate returns false, add this motion in to the blend one last time
|
||||||
mPoseBlender.addMotion(motionp);
|
mPoseBlender.addMotion(motionp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -825,7 +825,7 @@ void LLMotionController::updateMotions(bool force_update)
|
||||||
// The use_quantum optimization or possibly the associated code in setTimeStamp()
|
// The use_quantum optimization or possibly the associated code in setTimeStamp()
|
||||||
// does not work as implemented.
|
// does not work as implemented.
|
||||||
// Currently setting mTimeStep to nonzero is disabled elsewhere.
|
// Currently setting mTimeStep to nonzero is disabled elsewhere.
|
||||||
BOOL use_quantum = (mTimeStep != 0.f);
|
bool use_quantum = (mTimeStep != 0.f);
|
||||||
|
|
||||||
// Always update mPrevTimerElapsed
|
// Always update mPrevTimerElapsed
|
||||||
F32 cur_time = mTimer.getElapsedTimeF32();
|
F32 cur_time = mTimer.getElapsedTimeF32();
|
||||||
|
|
@ -898,7 +898,7 @@ void LLMotionController::updateMotions(bool force_update)
|
||||||
|
|
||||||
if (use_quantum)
|
if (use_quantum)
|
||||||
{
|
{
|
||||||
mPoseBlender.blendAndCache(TRUE);
|
mPoseBlender.blendAndCache(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -906,7 +906,7 @@ void LLMotionController::updateMotions(bool force_update)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mHasRunOnce = TRUE;
|
mHasRunOnce = true;
|
||||||
// LL_INFOS() << "Motion controller time " << motionTimer.getElapsedTimeF32() << LL_ENDL;
|
// LL_INFOS() << "Motion controller time " << motionTimer.getElapsedTimeF32() << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -926,28 +926,28 @@ void LLMotionController::updateMotionsMinimal()
|
||||||
|
|
||||||
deactivateStoppedMotions();
|
deactivateStoppedMotions();
|
||||||
|
|
||||||
mHasRunOnce = TRUE;
|
mHasRunOnce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// activateMotionInstance()
|
// activateMotionInstance()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
|
bool LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
|
||||||
// It's not clear why the getWeight() line seems to be crashing this, but
|
// It's not clear why the getWeight() line seems to be crashing this, but
|
||||||
// hopefully this fixes it.
|
// hopefully this fixes it.
|
||||||
if (motion == NULL || motion->getPose() == NULL)
|
if (motion == NULL || motion->getPose() == NULL)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mLoadingMotions.find(motion) != mLoadingMotions.end())
|
if (mLoadingMotions.find(motion) != mLoadingMotions.end())
|
||||||
{
|
{
|
||||||
// we want to start this motion, but we can't yet, so flag it as started
|
// we want to start this motion, but we can't yet, so flag it as started
|
||||||
motion->setStopped(FALSE);
|
motion->setStopped(false);
|
||||||
// report pending animations as activated
|
// report pending animations as activated
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
motion->mResidualWeight = motion->getPose()->getWeight();
|
motion->mResidualWeight = motion->getPose()->getWeight();
|
||||||
|
|
@ -991,13 +991,13 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// deactivateMotionInstance()
|
// deactivateMotionInstance()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion)
|
bool LLMotionController::deactivateMotionInstance(LLMotion *motion)
|
||||||
{
|
{
|
||||||
motion->deactivate();
|
motion->deactivate();
|
||||||
|
|
||||||
|
|
@ -1014,7 +1014,7 @@ BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion)
|
||||||
mActiveMotions.remove(motion);
|
mActiveMotions.remove(motion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLMotionController::deprecateMotionInstance(LLMotion* motion)
|
void LLMotionController::deprecateMotionInstance(LLMotion* motion)
|
||||||
|
|
@ -1022,7 +1022,7 @@ void LLMotionController::deprecateMotionInstance(LLMotion* motion)
|
||||||
mDeprecatedMotions.insert(motion);
|
mDeprecatedMotions.insert(motion);
|
||||||
|
|
||||||
//fade out deprecated motion
|
//fade out deprecated motion
|
||||||
stopMotionInstance(motion, FALSE);
|
stopMotionInstance(motion, false);
|
||||||
//no longer canonical
|
//no longer canonical
|
||||||
mAllMotions.erase(motion->getID());
|
mAllMotions.erase(motion->getID());
|
||||||
}
|
}
|
||||||
|
|
@ -1137,7 +1137,7 @@ void LLMotionController::pauseAllMotions()
|
||||||
if (!mPaused)
|
if (!mPaused)
|
||||||
{
|
{
|
||||||
//LL_INFOS() << "Pausing animations..." << LL_ENDL;
|
//LL_INFOS() << "Pausing animations..." << LL_ENDL;
|
||||||
mPaused = TRUE;
|
mPaused = true;
|
||||||
mPausedFrame = LLFrameTimer::getFrameCount();
|
mPausedFrame = LLFrameTimer::getFrameCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1151,7 +1151,7 @@ void LLMotionController::unpauseAllMotions()
|
||||||
if (mPaused)
|
if (mPaused)
|
||||||
{
|
{
|
||||||
//LL_INFOS() << "Unpausing animations..." << LL_ENDL;
|
//LL_INFOS() << "Unpausing animations..." << LL_ENDL;
|
||||||
mPaused = FALSE;
|
mPaused = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End
|
// End
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ public:
|
||||||
|
|
||||||
// adds motion classes to the registry
|
// adds motion classes to the registry
|
||||||
// returns true if successfull
|
// returns true if successfull
|
||||||
BOOL registerMotion( const LLUUID& id, LLMotionConstructor create);
|
bool registerMotion( const LLUUID& id, LLMotionConstructor create);
|
||||||
|
|
||||||
// creates a new instance of a named motion
|
// creates a new instance of a named motion
|
||||||
// returns NULL motion is not registered
|
// returns NULL motion is not registered
|
||||||
|
|
@ -85,7 +85,7 @@ class LLMotionController
|
||||||
public:
|
public:
|
||||||
typedef std::list<LLMotion*> motion_list_t;
|
typedef std::list<LLMotion*> motion_list_t;
|
||||||
typedef std::set<LLMotion*> motion_set_t;
|
typedef std::set<LLMotion*> motion_set_t;
|
||||||
BOOL mIsSelf;
|
bool mIsSelf;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
|
|
@ -102,7 +102,7 @@ public:
|
||||||
// registers a motion with the controller
|
// registers a motion with the controller
|
||||||
// (actually just forwards call to motion registry)
|
// (actually just forwards call to motion registry)
|
||||||
// returns true if successfull
|
// returns true if successfull
|
||||||
BOOL registerMotion( const LLUUID& id, LLMotionConstructor create );
|
bool registerMotion( const LLUUID& id, LLMotionConstructor create );
|
||||||
|
|
||||||
// creates a motion from the registry
|
// creates a motion from the registry
|
||||||
LLMotion *createMotion( const LLUUID &id );
|
LLMotion *createMotion( const LLUUID &id );
|
||||||
|
|
@ -115,13 +115,13 @@ public:
|
||||||
// start motion
|
// start motion
|
||||||
// begins playing the specified motion
|
// begins playing the specified motion
|
||||||
// returns true if successful
|
// returns true if successful
|
||||||
BOOL startMotion( const LLUUID &id, F32 start_offset );
|
bool startMotion( const LLUUID &id, F32 start_offset );
|
||||||
|
|
||||||
// stop motion
|
// stop motion
|
||||||
// stops a playing motion
|
// stops a playing motion
|
||||||
// in reality, it begins the ease out transition phase
|
// in reality, it begins the ease out transition phase
|
||||||
// returns true if successful
|
// returns true if successful
|
||||||
BOOL stopMotionLocally( const LLUUID &id, BOOL stop_immediate );
|
bool stopMotionLocally( const LLUUID &id, bool stop_immediate );
|
||||||
|
|
||||||
// Move motions from loading to loaded
|
// Move motions from loading to loaded
|
||||||
void updateLoadingMotions();
|
void updateLoadingMotions();
|
||||||
|
|
@ -147,7 +147,7 @@ public:
|
||||||
// pause and continue all motions
|
// pause and continue all motions
|
||||||
void pauseAllMotions();
|
void pauseAllMotions();
|
||||||
void unpauseAllMotions();
|
void unpauseAllMotions();
|
||||||
BOOL isPaused() const { return mPaused; }
|
bool isPaused() const { return mPaused; }
|
||||||
S32 getPausedFrame() const { return mPausedFrame; }
|
S32 getPausedFrame() const { return mPausedFrame; }
|
||||||
|
|
||||||
void setTimeStep(F32 step);
|
void setTimeStep(F32 step);
|
||||||
|
|
@ -181,10 +181,10 @@ protected:
|
||||||
// internal operations act on motion instances directly
|
// internal operations act on motion instances directly
|
||||||
// as there can be duplicate motions per id during blending overlap
|
// as there can be duplicate motions per id during blending overlap
|
||||||
void deleteAllMotions();
|
void deleteAllMotions();
|
||||||
BOOL activateMotionInstance(LLMotion *motion, F32 time);
|
bool activateMotionInstance(LLMotion *motion, F32 time);
|
||||||
BOOL deactivateMotionInstance(LLMotion *motion);
|
bool deactivateMotionInstance(LLMotion *motion);
|
||||||
void deprecateMotionInstance(LLMotion* motion);
|
void deprecateMotionInstance(LLMotion* motion);
|
||||||
BOOL stopMotionInstance(LLMotion *motion, BOOL stop_imemdiate);
|
bool stopMotionInstance(LLMotion *motion, bool stop_imemdiate);
|
||||||
void removeMotionInstance(LLMotion* motion);
|
void removeMotionInstance(LLMotion* motion);
|
||||||
void updateRegularMotions();
|
void updateRegularMotions();
|
||||||
void updateAdditiveMotions();
|
void updateAdditiveMotions();
|
||||||
|
|
@ -224,8 +224,8 @@ protected:
|
||||||
F32 mPrevTimerElapsed;
|
F32 mPrevTimerElapsed;
|
||||||
F32 mAnimTime;
|
F32 mAnimTime;
|
||||||
F32 mLastTime;
|
F32 mLastTime;
|
||||||
BOOL mHasRunOnce;
|
bool mHasRunOnce;
|
||||||
BOOL mPaused;
|
bool mPaused;
|
||||||
S32 mPausedFrame;
|
S32 mPausedFrame;
|
||||||
F32 mTimeStep;
|
F32 mTimeStep;
|
||||||
S32 mTimeStepCount;
|
S32 mTimeStepCount;
|
||||||
|
|
|
||||||
|
|
@ -54,15 +54,15 @@ LLMultiGesture::~LLMultiGesture()
|
||||||
|
|
||||||
void LLMultiGesture::reset()
|
void LLMultiGesture::reset()
|
||||||
{
|
{
|
||||||
mPlaying = FALSE;
|
mPlaying = false;
|
||||||
mCurrentStep = 0;
|
mCurrentStep = 0;
|
||||||
mWaitTimer.reset();
|
mWaitTimer.reset();
|
||||||
mWaitingAnimations = FALSE;
|
mWaitingAnimations = false;
|
||||||
mWaitingKeyRelease = FALSE;
|
mWaitingKeyRelease = false;
|
||||||
mWaitingTimer = FALSE;
|
mWaitingTimer = false;
|
||||||
mTriggeredByKey = FALSE;
|
mTriggeredByKey = false;
|
||||||
mKeyReleased = FALSE;
|
mKeyReleased = false;
|
||||||
mWaitingAtEnd = FALSE;
|
mWaitingAtEnd = false;
|
||||||
mRequestedAnimIDs.clear();
|
mRequestedAnimIDs.clear();
|
||||||
mPlayingAnimIDs.clear();
|
mPlayingAnimIDs.clear();
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,7 @@ S32 LLMultiGesture::getMaxSerialSize() const
|
||||||
return max_size;
|
return max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLMultiGesture::serialize(LLDataPacker& dp) const
|
bool LLMultiGesture::serialize(LLDataPacker& dp) const
|
||||||
{
|
{
|
||||||
dp.packS32(GESTURE_VERSION, "version");
|
dp.packS32(GESTURE_VERSION, "version");
|
||||||
dp.packU8(mKey, "key");
|
dp.packU8(mKey, "key");
|
||||||
|
|
@ -123,16 +123,16 @@ BOOL LLMultiGesture::serialize(LLDataPacker& dp) const
|
||||||
LLGestureStep* step = mSteps[i];
|
LLGestureStep* step = mSteps[i];
|
||||||
|
|
||||||
dp.packS32(step->getType(), "step_type");
|
dp.packS32(step->getType(), "step_type");
|
||||||
BOOL ok = step->serialize(dp);
|
bool ok = step->serialize(dp);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
bool LLMultiGesture::deserialize(LLDataPacker& dp)
|
||||||
{
|
{
|
||||||
S32 version;
|
S32 version;
|
||||||
dp.unpackS32(version, "version");
|
dp.unpackS32(version, "version");
|
||||||
|
|
@ -141,7 +141,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
||||||
LL_WARNS() << "Bad LLMultiGesture version " << version
|
LL_WARNS() << "Bad LLMultiGesture version " << version
|
||||||
<< " should be " << GESTURE_VERSION
|
<< " should be " << GESTURE_VERSION
|
||||||
<< LL_ENDL;
|
<< LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
dp.unpackU8(mKey, "key");
|
dp.unpackU8(mKey, "key");
|
||||||
|
|
@ -157,7 +157,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Bad LLMultiGesture step count " << count << LL_ENDL;
|
LL_WARNS() << "Bad LLMultiGesture step count " << count << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
S32 i;
|
S32 i;
|
||||||
|
|
@ -172,43 +172,43 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
||||||
case STEP_ANIMATION:
|
case STEP_ANIMATION:
|
||||||
{
|
{
|
||||||
LLGestureStepAnimation* step = new LLGestureStepAnimation();
|
LLGestureStepAnimation* step = new LLGestureStepAnimation();
|
||||||
BOOL ok = step->deserialize(dp);
|
bool ok = step->deserialize(dp);
|
||||||
if (!ok) return FALSE;
|
if (!ok) return false;
|
||||||
mSteps.push_back(step);
|
mSteps.push_back(step);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case STEP_SOUND:
|
case STEP_SOUND:
|
||||||
{
|
{
|
||||||
LLGestureStepSound* step = new LLGestureStepSound();
|
LLGestureStepSound* step = new LLGestureStepSound();
|
||||||
BOOL ok = step->deserialize(dp);
|
bool ok = step->deserialize(dp);
|
||||||
if (!ok) return FALSE;
|
if (!ok) return false;
|
||||||
mSteps.push_back(step);
|
mSteps.push_back(step);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case STEP_CHAT:
|
case STEP_CHAT:
|
||||||
{
|
{
|
||||||
LLGestureStepChat* step = new LLGestureStepChat();
|
LLGestureStepChat* step = new LLGestureStepChat();
|
||||||
BOOL ok = step->deserialize(dp);
|
bool ok = step->deserialize(dp);
|
||||||
if (!ok) return FALSE;
|
if (!ok) return false;
|
||||||
mSteps.push_back(step);
|
mSteps.push_back(step);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case STEP_WAIT:
|
case STEP_WAIT:
|
||||||
{
|
{
|
||||||
LLGestureStepWait* step = new LLGestureStepWait();
|
LLGestureStepWait* step = new LLGestureStepWait();
|
||||||
BOOL ok = step->deserialize(dp);
|
bool ok = step->deserialize(dp);
|
||||||
if (!ok) return FALSE;
|
if (!ok) return false;
|
||||||
mSteps.push_back(step);
|
mSteps.push_back(step);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Bad LLMultiGesture step type " << type << LL_ENDL;
|
LL_WARNS() << "Bad LLMultiGesture step type " << type << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLMultiGesture::dump()
|
void LLMultiGesture::dump()
|
||||||
|
|
@ -255,15 +255,15 @@ S32 LLGestureStepAnimation::getMaxSerialSize() const
|
||||||
return max_size;
|
return max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepAnimation::serialize(LLDataPacker& dp) const
|
bool LLGestureStepAnimation::serialize(LLDataPacker& dp) const
|
||||||
{
|
{
|
||||||
dp.packString(mAnimName, "anim_name");
|
dp.packString(mAnimName, "anim_name");
|
||||||
dp.packUUID(mAnimAssetID, "asset_id");
|
dp.packUUID(mAnimAssetID, "asset_id");
|
||||||
dp.packU32(mFlags, "flags");
|
dp.packU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp)
|
bool LLGestureStepAnimation::deserialize(LLDataPacker& dp)
|
||||||
{
|
{
|
||||||
dp.unpackString(mAnimName, "anim_name");
|
dp.unpackString(mAnimName, "anim_name");
|
||||||
|
|
||||||
|
|
@ -277,7 +277,7 @@ BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp)
|
||||||
|
|
||||||
dp.unpackUUID(mAnimAssetID, "asset_id");
|
dp.unpackUUID(mAnimAssetID, "asset_id");
|
||||||
dp.unpackU32(mFlags, "flags");
|
dp.unpackU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||||
std::vector<std::string> LLGestureStepAnimation::getLabel() const
|
std::vector<std::string> LLGestureStepAnimation::getLabel() const
|
||||||
|
|
@ -337,21 +337,21 @@ S32 LLGestureStepSound::getMaxSerialSize() const
|
||||||
return max_size;
|
return max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepSound::serialize(LLDataPacker& dp) const
|
bool LLGestureStepSound::serialize(LLDataPacker& dp) const
|
||||||
{
|
{
|
||||||
dp.packString(mSoundName, "sound_name");
|
dp.packString(mSoundName, "sound_name");
|
||||||
dp.packUUID(mSoundAssetID, "asset_id");
|
dp.packUUID(mSoundAssetID, "asset_id");
|
||||||
dp.packU32(mFlags, "flags");
|
dp.packU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepSound::deserialize(LLDataPacker& dp)
|
bool LLGestureStepSound::deserialize(LLDataPacker& dp)
|
||||||
{
|
{
|
||||||
dp.unpackString(mSoundName, "sound_name");
|
dp.unpackString(mSoundName, "sound_name");
|
||||||
|
|
||||||
dp.unpackUUID(mSoundAssetID, "asset_id");
|
dp.unpackUUID(mSoundAssetID, "asset_id");
|
||||||
dp.unpackU32(mFlags, "flags");
|
dp.unpackU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||||
std::vector<std::string> LLGestureStepSound::getLabel() const
|
std::vector<std::string> LLGestureStepSound::getLabel() const
|
||||||
|
|
@ -397,19 +397,19 @@ S32 LLGestureStepChat::getMaxSerialSize() const
|
||||||
return max_size;
|
return max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepChat::serialize(LLDataPacker& dp) const
|
bool LLGestureStepChat::serialize(LLDataPacker& dp) const
|
||||||
{
|
{
|
||||||
dp.packString(mChatText, "chat_text");
|
dp.packString(mChatText, "chat_text");
|
||||||
dp.packU32(mFlags, "flags");
|
dp.packU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepChat::deserialize(LLDataPacker& dp)
|
bool LLGestureStepChat::deserialize(LLDataPacker& dp)
|
||||||
{
|
{
|
||||||
dp.unpackString(mChatText, "chat_text");
|
dp.unpackString(mChatText, "chat_text");
|
||||||
|
|
||||||
dp.unpackU32(mFlags, "flags");
|
dp.unpackU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||||
std::vector<std::string> LLGestureStepChat::getLabel() const
|
std::vector<std::string> LLGestureStepChat::getLabel() const
|
||||||
|
|
@ -452,18 +452,18 @@ S32 LLGestureStepWait::getMaxSerialSize() const
|
||||||
return max_size;
|
return max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepWait::serialize(LLDataPacker& dp) const
|
bool LLGestureStepWait::serialize(LLDataPacker& dp) const
|
||||||
{
|
{
|
||||||
dp.packF32(mWaitSeconds, "wait_seconds");
|
dp.packF32(mWaitSeconds, "wait_seconds");
|
||||||
dp.packU32(mFlags, "flags");
|
dp.packU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLGestureStepWait::deserialize(LLDataPacker& dp)
|
bool LLGestureStepWait::deserialize(LLDataPacker& dp)
|
||||||
{
|
{
|
||||||
dp.unpackF32(mWaitSeconds, "wait_seconds");
|
dp.unpackF32(mWaitSeconds, "wait_seconds");
|
||||||
dp.unpackU32(mFlags, "flags");
|
dp.unpackU32(mFlags, "flags");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||||
std::vector<std::string> LLGestureStepWait::getLabel() const
|
std::vector<std::string> LLGestureStepWait::getLabel() const
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ public:
|
||||||
// Maximum number of bytes this could hold once serialized.
|
// Maximum number of bytes this could hold once serialized.
|
||||||
S32 getMaxSerialSize() const;
|
S32 getMaxSerialSize() const;
|
||||||
|
|
||||||
BOOL serialize(LLDataPacker& dp) const;
|
bool serialize(LLDataPacker& dp) const;
|
||||||
BOOL deserialize(LLDataPacker& dp);
|
bool deserialize(LLDataPacker& dp);
|
||||||
|
|
||||||
void dump();
|
void dump();
|
||||||
|
|
||||||
|
|
@ -75,28 +75,28 @@ public:
|
||||||
std::vector<LLGestureStep*> mSteps;
|
std::vector<LLGestureStep*> mSteps;
|
||||||
|
|
||||||
// Is the gesture currently playing?
|
// Is the gesture currently playing?
|
||||||
BOOL mPlaying { FALSE };
|
bool mPlaying { false };
|
||||||
|
|
||||||
// "instruction pointer" for steps
|
// "instruction pointer" for steps
|
||||||
S32 mCurrentStep { 0 };
|
S32 mCurrentStep { 0 };
|
||||||
|
|
||||||
// We're waiting for triggered animations to stop playing
|
// We're waiting for triggered animations to stop playing
|
||||||
BOOL mWaitingAnimations { FALSE };
|
bool mWaitingAnimations { false };
|
||||||
|
|
||||||
// We're waiting for key release
|
// We're waiting for key release
|
||||||
BOOL mWaitingKeyRelease { FALSE };
|
bool mWaitingKeyRelease { false };
|
||||||
|
|
||||||
// We're waiting a fixed amount of time
|
// We're waiting a fixed amount of time
|
||||||
BOOL mWaitingTimer { FALSE };
|
bool mWaitingTimer { false };
|
||||||
|
|
||||||
// We're waiting for triggered animations to stop playing
|
// We're waiting for triggered animations to stop playing
|
||||||
BOOL mTriggeredByKey { FALSE };
|
bool mTriggeredByKey { false };
|
||||||
|
|
||||||
// Has the key been released?
|
// Has the key been released?
|
||||||
BOOL mKeyReleased { FALSE };
|
bool mKeyReleased { false };
|
||||||
|
|
||||||
// Waiting after the last step played for all animations to complete
|
// Waiting after the last step played for all animations to complete
|
||||||
BOOL mWaitingAtEnd { FALSE };
|
bool mWaitingAtEnd { false };
|
||||||
|
|
||||||
// Timer for waiting
|
// Timer for waiting
|
||||||
LLFrameTimer mWaitTimer;
|
LLFrameTimer mWaitTimer;
|
||||||
|
|
@ -138,8 +138,8 @@ public:
|
||||||
virtual std::vector<std::string> getLabel() const = 0;
|
virtual std::vector<std::string> getLabel() const = 0;
|
||||||
|
|
||||||
virtual S32 getMaxSerialSize() const = 0;
|
virtual S32 getMaxSerialSize() const = 0;
|
||||||
virtual BOOL serialize(LLDataPacker& dp) const = 0;
|
virtual bool serialize(LLDataPacker& dp) const = 0;
|
||||||
virtual BOOL deserialize(LLDataPacker& dp) = 0;
|
virtual bool deserialize(LLDataPacker& dp) = 0;
|
||||||
|
|
||||||
virtual void dump() = 0;
|
virtual void dump() = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -160,8 +160,8 @@ public:
|
||||||
virtual std::vector<std::string> getLabel() const;
|
virtual std::vector<std::string> getLabel() const;
|
||||||
|
|
||||||
virtual S32 getMaxSerialSize() const;
|
virtual S32 getMaxSerialSize() const;
|
||||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
virtual bool serialize(LLDataPacker& dp) const;
|
||||||
virtual BOOL deserialize(LLDataPacker& dp);
|
virtual bool deserialize(LLDataPacker& dp);
|
||||||
|
|
||||||
virtual void dump();
|
virtual void dump();
|
||||||
|
|
||||||
|
|
@ -183,8 +183,8 @@ public:
|
||||||
virtual std::vector<std::string> getLabel() const;
|
virtual std::vector<std::string> getLabel() const;
|
||||||
|
|
||||||
virtual S32 getMaxSerialSize() const;
|
virtual S32 getMaxSerialSize() const;
|
||||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
virtual bool serialize(LLDataPacker& dp) const;
|
||||||
virtual BOOL deserialize(LLDataPacker& dp);
|
virtual bool deserialize(LLDataPacker& dp);
|
||||||
|
|
||||||
virtual void dump();
|
virtual void dump();
|
||||||
|
|
||||||
|
|
@ -206,8 +206,8 @@ public:
|
||||||
virtual std::vector<std::string> getLabel() const;
|
virtual std::vector<std::string> getLabel() const;
|
||||||
|
|
||||||
virtual S32 getMaxSerialSize() const;
|
virtual S32 getMaxSerialSize() const;
|
||||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
virtual bool serialize(LLDataPacker& dp) const;
|
||||||
virtual BOOL deserialize(LLDataPacker& dp);
|
virtual bool deserialize(LLDataPacker& dp);
|
||||||
|
|
||||||
virtual void dump();
|
virtual void dump();
|
||||||
|
|
||||||
|
|
@ -232,8 +232,8 @@ public:
|
||||||
virtual std::vector<std::string> getLabel() const;
|
virtual std::vector<std::string> getLabel() const;
|
||||||
|
|
||||||
virtual S32 getMaxSerialSize() const;
|
virtual S32 getMaxSerialSize() const;
|
||||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
virtual bool serialize(LLDataPacker& dp) const;
|
||||||
virtual BOOL deserialize(LLDataPacker& dp);
|
virtual bool deserialize(LLDataPacker& dp);
|
||||||
|
|
||||||
virtual void dump();
|
virtual void dump();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,31 +81,31 @@ LLJointState *LLPose::getNextJointState()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// addJointState()
|
// addJointState()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPose::addJointState(const LLPointer<LLJointState>& jointState)
|
bool LLPose::addJointState(const LLPointer<LLJointState>& jointState)
|
||||||
{
|
{
|
||||||
if (mJointMap.find(jointState->getJoint()->getName()) == mJointMap.end())
|
if (mJointMap.find(jointState->getJoint()->getName()) == mJointMap.end())
|
||||||
{
|
{
|
||||||
mJointMap[jointState->getJoint()->getName()] = jointState;
|
mJointMap[jointState->getJoint()->getName()] = jointState;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// removeJointState()
|
// removeJointState()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPose::removeJointState(const LLPointer<LLJointState>& jointState)
|
bool LLPose::removeJointState(const LLPointer<LLJointState>& jointState)
|
||||||
{
|
{
|
||||||
mJointMap.erase(jointState->getJoint()->getName());
|
mJointMap.erase(jointState->getJoint()->getName());
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// removeAllJointStates()
|
// removeAllJointStates()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPose::removeAllJointStates()
|
bool LLPose::removeAllJointStates()
|
||||||
{
|
{
|
||||||
mJointMap.clear();
|
mJointMap.clear();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -181,7 +181,7 @@ LLJointStateBlender::LLJointStateBlender()
|
||||||
{
|
{
|
||||||
mJointStates[i] = NULL;
|
mJointStates[i] = NULL;
|
||||||
mPriorities[i] = S32_MIN;
|
mPriorities[i] = S32_MIN;
|
||||||
mAdditiveBlends[i] = FALSE;
|
mAdditiveBlends[i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -193,13 +193,13 @@ LLJointStateBlender::~LLJointStateBlender()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// addJointState()
|
// addJointState()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLJointStateBlender::addJointState(const LLPointer<LLJointState>& joint_state, S32 priority, BOOL additive_blend)
|
bool LLJointStateBlender::addJointState(const LLPointer<LLJointState>& joint_state, S32 priority, bool additive_blend)
|
||||||
{
|
{
|
||||||
llassert(joint_state);
|
llassert(joint_state);
|
||||||
|
|
||||||
if (!joint_state->getJoint())
|
if (!joint_state->getJoint())
|
||||||
// this joint state doesn't point to an actual joint, so we don't care about applying it
|
// this joint state doesn't point to an actual joint, so we don't care about applying it
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
for(S32 i = 0; i < JSB_NUM_JOINT_STATES; i++)
|
for(S32 i = 0; i < JSB_NUM_JOINT_STATES; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -208,7 +208,7 @@ BOOL LLJointStateBlender::addJointState(const LLPointer<LLJointState>& joint_sta
|
||||||
mJointStates[i] = joint_state;
|
mJointStates[i] = joint_state;
|
||||||
mPriorities[i] = priority;
|
mPriorities[i] = priority;
|
||||||
mAdditiveBlends[i] = additive_blend;
|
mAdditiveBlends[i] = additive_blend;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else if (priority > mPriorities[i])
|
else if (priority > mPriorities[i])
|
||||||
{
|
{
|
||||||
|
|
@ -225,17 +225,17 @@ BOOL LLJointStateBlender::addJointState(const LLPointer<LLJointState>& joint_sta
|
||||||
mJointStates[i] = joint_state;
|
mJointStates[i] = joint_state;
|
||||||
mPriorities[i] = priority;
|
mPriorities[i] = priority;
|
||||||
mAdditiveBlends[i] = additive_blend;
|
mAdditiveBlends[i] = additive_blend;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// blendJointStates()
|
// blendJointStates()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLJointStateBlender::blendJointStates(BOOL apply_now)
|
void LLJointStateBlender::blendJointStates(bool apply_now)
|
||||||
{
|
{
|
||||||
// we need at least one joint to blend
|
// we need at least one joint to blend
|
||||||
// if there is one, it will be in slot zero according to insertion logic
|
// if there is one, it will be in slot zero according to insertion logic
|
||||||
|
|
@ -468,7 +468,7 @@ LLPoseBlender::~LLPoseBlender()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// addMotion()
|
// addMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLPoseBlender::addMotion(LLMotion* motion)
|
bool LLPoseBlender::addMotion(LLMotion* motion)
|
||||||
{
|
{
|
||||||
LLPose* pose = motion->getPose();
|
LLPose* pose = motion->getPose();
|
||||||
|
|
||||||
|
|
@ -503,7 +503,7 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion)
|
||||||
mActiveBlenders.push_front(joint_blender);
|
mActiveBlenders.push_front(joint_blender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -525,7 +525,7 @@ void LLPoseBlender::blendAndApply()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// blendAndCache()
|
// blendAndCache()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLPoseBlender::blendAndCache(BOOL reset_cached_joints)
|
void LLPoseBlender::blendAndCache(bool reset_cached_joints)
|
||||||
{
|
{
|
||||||
for (blender_list_t::iterator iter = mActiveBlenders.begin();
|
for (blender_list_t::iterator iter = mActiveBlenders.begin();
|
||||||
iter != mActiveBlenders.end(); ++iter)
|
iter != mActiveBlenders.end(); ++iter)
|
||||||
|
|
@ -535,7 +535,7 @@ void LLPoseBlender::blendAndCache(BOOL reset_cached_joints)
|
||||||
{
|
{
|
||||||
jsbp->resetCachedJoint();
|
jsbp->resetCachedJoint();
|
||||||
}
|
}
|
||||||
jsbp->blendJointStates(FALSE);
|
jsbp->blendJointStates(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,11 +65,11 @@ public:
|
||||||
// Destructor
|
// Destructor
|
||||||
~LLPose();
|
~LLPose();
|
||||||
// add a joint state in this pose
|
// add a joint state in this pose
|
||||||
BOOL addJointState(const LLPointer<LLJointState>& jointState);
|
bool addJointState(const LLPointer<LLJointState>& jointState);
|
||||||
// remove a joint state from this pose
|
// remove a joint state from this pose
|
||||||
BOOL removeJointState(const LLPointer<LLJointState>& jointState);
|
bool removeJointState(const LLPointer<LLJointState>& jointState);
|
||||||
// removes all joint states from this pose
|
// removes all joint states from this pose
|
||||||
BOOL removeAllJointStates();
|
bool removeAllJointStates();
|
||||||
// set weight for all joint states in this pose
|
// set weight for all joint states in this pose
|
||||||
void setWeight(F32 weight);
|
void setWeight(F32 weight);
|
||||||
// get weight for this pose
|
// get weight for this pose
|
||||||
|
|
@ -87,12 +87,12 @@ class LLJointStateBlender
|
||||||
protected:
|
protected:
|
||||||
LLPointer<LLJointState> mJointStates[JSB_NUM_JOINT_STATES];
|
LLPointer<LLJointState> mJointStates[JSB_NUM_JOINT_STATES];
|
||||||
S32 mPriorities[JSB_NUM_JOINT_STATES];
|
S32 mPriorities[JSB_NUM_JOINT_STATES];
|
||||||
BOOL mAdditiveBlends[JSB_NUM_JOINT_STATES];
|
bool mAdditiveBlends[JSB_NUM_JOINT_STATES];
|
||||||
public:
|
public:
|
||||||
LLJointStateBlender();
|
LLJointStateBlender();
|
||||||
~LLJointStateBlender();
|
~LLJointStateBlender();
|
||||||
void blendJointStates(BOOL apply_now = TRUE);
|
void blendJointStates(bool apply_now = true);
|
||||||
BOOL addJointState(const LLPointer<LLJointState>& joint_state, S32 priority, BOOL additive_blend);
|
bool addJointState(const LLPointer<LLJointState>& joint_state, S32 priority, bool additive_blend);
|
||||||
void interpolate(F32 u);
|
void interpolate(F32 u);
|
||||||
void clear();
|
void clear();
|
||||||
void resetCachedJoint();
|
void resetCachedJoint();
|
||||||
|
|
@ -120,7 +120,7 @@ public:
|
||||||
~LLPoseBlender();
|
~LLPoseBlender();
|
||||||
|
|
||||||
// request motion joint states to be added to pose blender joint state records
|
// request motion joint states to be added to pose blender joint state records
|
||||||
BOOL addMotion(LLMotion* motion);
|
bool addMotion(LLMotion* motion);
|
||||||
|
|
||||||
// blend all joint states and apply to skeleton
|
// blend all joint states and apply to skeleton
|
||||||
void blendAndApply();
|
void blendAndApply();
|
||||||
|
|
@ -129,7 +129,7 @@ public:
|
||||||
void clearBlenders();
|
void clearBlenders();
|
||||||
|
|
||||||
// blend all joint states and cache results
|
// blend all joint states and cache results
|
||||||
void blendAndCache(BOOL reset_cached_joints);
|
void blendAndCache(bool reset_cached_joints);
|
||||||
|
|
||||||
// interpolate all joints towards cached values
|
// interpolate all joints towards cached values
|
||||||
void interpolate(F32 u);
|
void interpolate(F32 u);
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ bool operator!=(const LLUniqueID &a, const LLUniqueID &b)
|
||||||
LLStateDiagram::LLStateDiagram()
|
LLStateDiagram::LLStateDiagram()
|
||||||
{
|
{
|
||||||
mDefaultState = NULL;
|
mDefaultState = NULL;
|
||||||
mUseDefaultState = FALSE;
|
mUseDefaultState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLStateDiagram::~LLStateDiagram()
|
LLStateDiagram::~LLStateDiagram()
|
||||||
|
|
@ -58,14 +58,14 @@ LLStateDiagram::~LLStateDiagram()
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a state to the state graph
|
// add a state to the state graph
|
||||||
BOOL LLStateDiagram::addState(LLFSMState *state)
|
bool LLStateDiagram::addState(LLFSMState *state)
|
||||||
{
|
{
|
||||||
mStates[state] = Transitions();
|
mStates[state] = Transitions();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a directed transition between 2 states
|
// add a directed transition between 2 states
|
||||||
BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition)
|
bool LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition)
|
||||||
{
|
{
|
||||||
StateMap::iterator state_it;
|
StateMap::iterator state_it;
|
||||||
state_it = mStates.find(&start_state);
|
state_it = mStates.find(&start_state);
|
||||||
|
|
@ -89,17 +89,17 @@ BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_stat
|
||||||
if (transition_it != state_transitions->end())
|
if (transition_it != state_transitions->end())
|
||||||
{
|
{
|
||||||
LL_ERRS() << "LLStateTable::addDirectedTransition() : transition already exists" << LL_ENDL;
|
LL_ERRS() << "LLStateTable::addDirectedTransition() : transition already exists" << LL_ENDL;
|
||||||
return FALSE; // transition already exists
|
return false; // transition already exists
|
||||||
}
|
}
|
||||||
|
|
||||||
(*state_transitions)[&transition] = &end_state;
|
(*state_transitions)[&transition] = &end_state;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add an undirected transition between 2 states
|
// add an undirected transition between 2 states
|
||||||
BOOL LLStateDiagram::addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition)
|
bool LLStateDiagram::addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition)
|
||||||
{
|
{
|
||||||
BOOL result;
|
bool result;
|
||||||
result = addTransition(start_state, end_state, transition);
|
result = addTransition(start_state, end_state, transition);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
|
@ -162,7 +162,7 @@ LLFSMState* LLStateDiagram::processTransition(LLFSMState& start_state, LLFSMTran
|
||||||
|
|
||||||
void LLStateDiagram::setDefaultState(LLFSMState& default_state)
|
void LLStateDiagram::setDefaultState(LLFSMState& default_state)
|
||||||
{
|
{
|
||||||
mUseDefaultState = TRUE;
|
mUseDefaultState = true;
|
||||||
mDefaultState = &default_state;
|
mDefaultState = &default_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -179,13 +179,13 @@ S32 LLStateDiagram::numDeadendStates()
|
||||||
return numDeadends;
|
return numDeadends;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLStateDiagram::stateIsValid(LLFSMState& state)
|
bool LLStateDiagram::stateIsValid(LLFSMState& state)
|
||||||
{
|
{
|
||||||
if (mStates.find(&state) != mStates.end())
|
if (mStates.find(&state) != mStates.end())
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLFSMState* LLStateDiagram::getState(U32 state_id)
|
LLFSMState* LLStateDiagram::getState(U32 state_id)
|
||||||
|
|
@ -200,7 +200,7 @@ LLFSMState* LLStateDiagram::getState(U32 state_id)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLStateDiagram::saveDotFile(const std::string& filename)
|
bool LLStateDiagram::saveDotFile(const std::string& filename)
|
||||||
{
|
{
|
||||||
LLAPRFile outfile ;
|
LLAPRFile outfile ;
|
||||||
outfile.open(filename, LL_APR_W);
|
outfile.open(filename, LL_APR_W);
|
||||||
|
|
@ -213,7 +213,7 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename)
|
||||||
if (!dot_file)
|
if (!dot_file)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << LL_ENDL;
|
LL_WARNS() << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
apr_file_printf(dot_file, "digraph StateMachine {\n\tsize=\"100,100\";\n\tfontsize=40;\n\tlabel=\"Finite State Machine\";\n\torientation=landscape\n\tratio=.77\n");
|
apr_file_printf(dot_file, "digraph StateMachine {\n\tsize=\"100,100\";\n\tfontsize=40;\n\tlabel=\"Finite State Machine\";\n\torientation=landscape\n\tratio=.77\n");
|
||||||
|
|
||||||
|
|
@ -252,7 +252,7 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename)
|
||||||
|
|
||||||
apr_file_printf(dot_file, "}\n");
|
apr_file_printf(dot_file, "}\n");
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream &s, LLStateDiagram &FSM)
|
std::ostream& operator<<(std::ostream &s, LLStateDiagram &FSM)
|
||||||
|
|
@ -312,7 +312,7 @@ void LLStateMachine::runCurrentState(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// set current state
|
// set current state
|
||||||
BOOL LLStateMachine::setCurrentState(LLFSMState *initial_state, void* user_data, BOOL skip_entry)
|
bool LLStateMachine::setCurrentState(LLFSMState *initial_state, void* user_data, bool skip_entry)
|
||||||
{
|
{
|
||||||
llassert(mStateDiagram);
|
llassert(mStateDiagram);
|
||||||
|
|
||||||
|
|
@ -323,13 +323,13 @@ BOOL LLStateMachine::setCurrentState(LLFSMState *initial_state, void* user_data,
|
||||||
{
|
{
|
||||||
initial_state->onEntry(user_data);
|
initial_state->onEntry(user_data);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLStateMachine::setCurrentState(U32 state_id, void* user_data, BOOL skip_entry)
|
bool LLStateMachine::setCurrentState(U32 state_id, void* user_data, bool skip_entry)
|
||||||
{
|
{
|
||||||
llassert(mStateDiagram);
|
llassert(mStateDiagram);
|
||||||
|
|
||||||
|
|
@ -342,10 +342,10 @@ BOOL LLStateMachine::setCurrentState(U32 state_id, void* user_data, BOOL skip_en
|
||||||
{
|
{
|
||||||
state->onEntry(user_data);
|
state->onEntry(user_data);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_data)
|
void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_data)
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ protected:
|
||||||
StateMap mStates;
|
StateMap mStates;
|
||||||
Transitions mDefaultTransitions;
|
Transitions mDefaultTransitions;
|
||||||
LLFSMState* mDefaultState;
|
LLFSMState* mDefaultState;
|
||||||
BOOL mUseDefaultState;
|
bool mUseDefaultState;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LLStateDiagram();
|
LLStateDiagram();
|
||||||
|
|
@ -82,13 +82,13 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// add a state to the state graph, executed implicitly when adding transitions
|
// add a state to the state graph, executed implicitly when adding transitions
|
||||||
BOOL addState(LLFSMState *state);
|
bool addState(LLFSMState *state);
|
||||||
|
|
||||||
// add a directed transition between 2 states
|
// add a directed transition between 2 states
|
||||||
BOOL addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition);
|
bool addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition);
|
||||||
|
|
||||||
// add an undirected transition between 2 states
|
// add an undirected transition between 2 states
|
||||||
BOOL addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition);
|
bool addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition);
|
||||||
|
|
||||||
// add a transition that is taken if none other exist
|
// add a transition that is taken if none other exist
|
||||||
void addDefaultTransition(LLFSMState& end_state, LLFSMTransition& transition);
|
void addDefaultTransition(LLFSMState& end_state, LLFSMTransition& transition);
|
||||||
|
|
@ -103,14 +103,14 @@ protected:
|
||||||
S32 numDeadendStates();
|
S32 numDeadendStates();
|
||||||
|
|
||||||
// does this state exist in the state diagram?
|
// does this state exist in the state diagram?
|
||||||
BOOL stateIsValid(LLFSMState& state);
|
bool stateIsValid(LLFSMState& state);
|
||||||
|
|
||||||
// get a state pointer by ID
|
// get a state pointer by ID
|
||||||
LLFSMState* getState(U32 state_id);
|
LLFSMState* getState(U32 state_id);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// save the graph in a DOT file for rendering and visualization
|
// save the graph in a DOT file for rendering and visualization
|
||||||
BOOL saveDotFile(const std::string& filename);
|
bool saveDotFile(const std::string& filename);
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLStateMachine
|
class LLStateMachine
|
||||||
|
|
@ -138,10 +138,10 @@ public:
|
||||||
void runCurrentState(void *data);
|
void runCurrentState(void *data);
|
||||||
|
|
||||||
// set state by state pointer
|
// set state by state pointer
|
||||||
BOOL setCurrentState(LLFSMState *initial_state, void* user_data, BOOL skip_entry = TRUE);
|
bool setCurrentState(LLFSMState *initial_state, void* user_data, bool skip_entry = true);
|
||||||
|
|
||||||
// set state by unique ID
|
// set state by unique ID
|
||||||
BOOL setCurrentState(U32 state_id, void* user_data, BOOL skip_entry = TRUE);
|
bool setCurrentState(U32 state_id, void* user_data, bool skip_entry = true);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_LL_LLSTATEMACHINE_H
|
#endif //_LL_LLSTATEMACHINE_H
|
||||||
|
|
|
||||||
|
|
@ -93,15 +93,15 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLTargetingMotion::onActivate()
|
// LLTargetingMotion::onActivate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLTargetingMotion::onActivate()
|
bool LLTargetingMotion::onActivate()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLTargetingMotion::onUpdate()
|
// LLTargetingMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
|
bool LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
{
|
{
|
||||||
LL_PROFILE_ZONE_SCOPED;
|
LL_PROFILE_ZONE_SCOPED;
|
||||||
F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_TARGET_HALF_LIFE);
|
F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_TARGET_HALF_LIFE);
|
||||||
|
|
@ -109,11 +109,11 @@ BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
|
||||||
LLVector3 target;
|
LLVector3 target;
|
||||||
LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint");
|
LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint");
|
||||||
|
|
||||||
BOOL result = TRUE;
|
bool result = true;
|
||||||
|
|
||||||
if (!lookAtPoint)
|
if (!lookAtPoint)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual bool getLoop() { return true; }
|
||||||
|
|
||||||
// motions must report their total duration
|
// motions must report their total duration
|
||||||
virtual F32 getDuration() { return 0.0; }
|
virtual F32 getDuration() { return 0.0; }
|
||||||
|
|
@ -91,14 +91,14 @@ public:
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
// called when a motion is activated
|
||||||
// must return TRUE to indicate success, or else
|
// must return true to indicate success, or else
|
||||||
// it will be deactivated
|
// it will be deactivated
|
||||||
virtual BOOL onActivate();
|
virtual bool onActivate();
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return true while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return true when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual bool onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
virtual void onDeactivate();
|
virtual void onDeactivate();
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ LLVisualParamInfo::LLVisualParamInfo()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseXml()
|
// parseXml()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
bool LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||||
{
|
{
|
||||||
// attribute: id
|
// attribute: id
|
||||||
static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
|
static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
|
||||||
|
|
@ -102,7 +102,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Avatar file: <param> has invalid sex attribute: " << sex << LL_ENDL;
|
LL_WARNS() << "Avatar file: <param> has invalid sex attribute: " << sex << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// attribute: name
|
// attribute: name
|
||||||
|
|
@ -110,7 +110,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||||
if( !node->getFastAttributeString( name_string, mName ) )
|
if( !node->getFastAttributeString( name_string, mName ) )
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// attribute: label
|
// attribute: label
|
||||||
|
|
@ -138,7 +138,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||||
mMaxName = "More";
|
mMaxName = "More";
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
|
|
@ -164,8 +164,8 @@ LLVisualParam::LLVisualParam()
|
||||||
mLastWeight( 0.f ),
|
mLastWeight( 0.f ),
|
||||||
mNext( NULL ),
|
mNext( NULL ),
|
||||||
mTargetWeight( 0.f ),
|
mTargetWeight( 0.f ),
|
||||||
mIsAnimating( FALSE ),
|
mIsAnimating( false ),
|
||||||
mIsDummy(FALSE),
|
mIsDummy(false),
|
||||||
mID( -1 ),
|
mID( -1 ),
|
||||||
mInfo( 0 ),
|
mInfo( 0 ),
|
||||||
mParamLocation(LOC_UNKNOWN)
|
mParamLocation(LOC_UNKNOWN)
|
||||||
|
|
@ -207,29 +207,29 @@ LLVisualParam::~LLVisualParam()
|
||||||
// setInfo()
|
// setInfo()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL LLVisualParam::setInfo(LLVisualParamInfo *info)
|
bool LLVisualParam::setInfo(LLVisualParamInfo *info)
|
||||||
{
|
{
|
||||||
llassert(mInfo == NULL);
|
llassert(mInfo == NULL);
|
||||||
if (info->mID < 0)
|
if (info->mID < 0)
|
||||||
return FALSE;
|
return false;
|
||||||
mInfo = info;
|
mInfo = info;
|
||||||
mID = info->mID;
|
mID = info->mID;
|
||||||
setWeight(getDefaultWeight(), FALSE );
|
setWeight(getDefaultWeight(), false );
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// parseData()
|
// parseData()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLVisualParam::parseData(LLXmlTreeNode *node)
|
bool LLVisualParam::parseData(LLXmlTreeNode *node)
|
||||||
{
|
{
|
||||||
LLVisualParamInfo *info = new LLVisualParamInfo;
|
LLVisualParamInfo *info = new LLVisualParamInfo;
|
||||||
|
|
||||||
info->parseXml(node);
|
info->parseXml(node);
|
||||||
if (!setInfo(info))
|
if (!setInfo(info))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -238,7 +238,7 @@ BOOL LLVisualParam::parseData(LLXmlTreeNode *node)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLVisualParam::setWeight(F32 weight)
|
//void LLVisualParam::setWeight(F32 weight)
|
||||||
void LLVisualParam::setWeight(F32 weight, BOOL upload_bake)
|
void LLVisualParam::setWeight(F32 weight, bool upload_bake)
|
||||||
{
|
{
|
||||||
if (mIsAnimating)
|
if (mIsAnimating)
|
||||||
{
|
{
|
||||||
|
|
@ -267,7 +267,7 @@ void LLVisualParam::setWeight(F32 weight, BOOL upload_bake)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLVisualParam::setAnimationTarget(F32 target_value)
|
//void LLVisualParam::setAnimationTarget(F32 target_value)
|
||||||
void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake)
|
void LLVisualParam::setAnimationTarget(F32 target_value, bool upload_bake)
|
||||||
{
|
{
|
||||||
// don't animate dummy parameters
|
// don't animate dummy parameters
|
||||||
if (mIsDummy)
|
if (mIsDummy)
|
||||||
|
|
@ -290,7 +290,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake)
|
||||||
{
|
{
|
||||||
mTargetWeight = target_value;
|
mTargetWeight = target_value;
|
||||||
}
|
}
|
||||||
mIsAnimating = TRUE;
|
mIsAnimating = true;
|
||||||
|
|
||||||
if (mNext)
|
if (mNext)
|
||||||
{
|
{
|
||||||
|
|
@ -323,7 +323,7 @@ void LLVisualParam::clearNextParam()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLVisualParam::animate( F32 delta)
|
//void LLVisualParam::animate( F32 delta)
|
||||||
void LLVisualParam::animate( F32 delta, BOOL upload_bake)
|
void LLVisualParam::animate( F32 delta, bool upload_bake)
|
||||||
{
|
{
|
||||||
if (mIsAnimating)
|
if (mIsAnimating)
|
||||||
{
|
{
|
||||||
|
|
@ -339,11 +339,11 @@ void LLVisualParam::animate( F32 delta, BOOL upload_bake)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//void LLVisualParam::stopAnimating()
|
//void LLVisualParam::stopAnimating()
|
||||||
void LLVisualParam::stopAnimating(BOOL upload_bake)
|
void LLVisualParam::stopAnimating(bool upload_bake)
|
||||||
{
|
{
|
||||||
if (mIsAnimating && isTweakable())
|
if (mIsAnimating && isTweakable())
|
||||||
{
|
{
|
||||||
mIsAnimating = FALSE;
|
mIsAnimating = false;
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
//setWeight(mTargetWeight);
|
//setWeight(mTargetWeight);
|
||||||
setWeight(mTargetWeight, upload_bake);
|
setWeight(mTargetWeight, upload_bake);
|
||||||
|
|
@ -351,10 +351,10 @@ void LLVisualParam::stopAnimating(BOOL upload_bake)
|
||||||
}
|
}
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
BOOL LLVisualParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params)
|
bool LLVisualParam::linkDrivenParams(visual_param_mapper mapper, bool only_cross_params)
|
||||||
{
|
{
|
||||||
// nothing to do for non-driver parameters
|
// nothing to do for non-driver parameters
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ public:
|
||||||
LLVisualParamInfo();
|
LLVisualParamInfo();
|
||||||
virtual ~LLVisualParamInfo() {};
|
virtual ~LLVisualParamInfo() {};
|
||||||
|
|
||||||
virtual BOOL parseXml(LLXmlTreeNode *node);
|
virtual bool parseXml(LLXmlTreeNode *node);
|
||||||
|
|
||||||
S32 getID() const { return mID; }
|
S32 getID() const { return mID; }
|
||||||
|
|
||||||
|
|
@ -113,11 +113,11 @@ public:
|
||||||
// (They can not be virtual because they use specific derived Info classes)
|
// (They can not be virtual because they use specific derived Info classes)
|
||||||
LLVisualParamInfo* getInfo() const { return mInfo; }
|
LLVisualParamInfo* getInfo() const { return mInfo; }
|
||||||
// This sets mInfo and calls initialization functions
|
// This sets mInfo and calls initialization functions
|
||||||
BOOL setInfo(LLVisualParamInfo *info);
|
bool setInfo(LLVisualParamInfo *info);
|
||||||
|
|
||||||
// Virtual functions
|
// Virtual functions
|
||||||
// Pure virtuals
|
// Pure virtuals
|
||||||
//virtual BOOL parseData( LLXmlTreeNode *node ) = 0;
|
//virtual bool parseData( LLXmlTreeNode *node ) = 0;
|
||||||
virtual void apply( ESex avatar_sex ) = 0;
|
virtual void apply( ESex avatar_sex ) = 0;
|
||||||
// Default functions
|
// Default functions
|
||||||
// <FS:Ansariel> [Legacy Bake]
|
// <FS:Ansariel> [Legacy Bake]
|
||||||
|
|
@ -125,13 +125,13 @@ public:
|
||||||
//virtual void setAnimationTarget( F32 target_value);
|
//virtual void setAnimationTarget( F32 target_value);
|
||||||
//virtual void animate(F32 delta);
|
//virtual void animate(F32 delta);
|
||||||
//virtual void stopAnimating();
|
//virtual void stopAnimating();
|
||||||
virtual void setWeight(F32 weight, BOOL upload_bake);
|
virtual void setWeight(F32 weight, bool upload_bake);
|
||||||
virtual void setAnimationTarget( F32 target_value, BOOL upload_bake);
|
virtual void setAnimationTarget( F32 target_value, bool upload_bake);
|
||||||
virtual void animate(F32 delta, BOOL upload_bake);
|
virtual void animate(F32 delta, bool upload_bake);
|
||||||
virtual void stopAnimating(BOOL upload_bake);
|
virtual void stopAnimating(bool upload_bake);
|
||||||
// </FS:Ansariel> [Legacy Bake]
|
// </FS:Ansariel> [Legacy Bake]
|
||||||
|
|
||||||
virtual BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
|
virtual bool linkDrivenParams(visual_param_mapper mapper, bool only_cross_params);
|
||||||
virtual void resetDrivenParams();
|
virtual void resetDrivenParams();
|
||||||
|
|
||||||
// Interface methods
|
// Interface methods
|
||||||
|
|
@ -157,17 +157,17 @@ public:
|
||||||
F32 getCurrentWeight() const { return mCurWeight; }
|
F32 getCurrentWeight() const { return mCurWeight; }
|
||||||
F32 getLastWeight() const { return mLastWeight; }
|
F32 getLastWeight() const { return mLastWeight; }
|
||||||
void setLastWeight(F32 val) { mLastWeight = val; }
|
void setLastWeight(F32 val) { mLastWeight = val; }
|
||||||
BOOL isAnimating() const { return mIsAnimating; }
|
bool isAnimating() const { return mIsAnimating; }
|
||||||
BOOL isTweakable() const { return (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) || (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT); }
|
bool isTweakable() const { return (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) || (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT); }
|
||||||
|
|
||||||
LLVisualParam* getNextParam() { return mNext; }
|
LLVisualParam* getNextParam() { return mNext; }
|
||||||
void setNextParam( LLVisualParam *next );
|
void setNextParam( LLVisualParam *next );
|
||||||
void clearNextParam();
|
void clearNextParam();
|
||||||
|
|
||||||
virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; }
|
virtual void setAnimating(bool is_animating) { mIsAnimating = is_animating && !mIsDummy; }
|
||||||
BOOL getAnimating() const { return mIsAnimating; }
|
bool getAnimating() const { return mIsAnimating; }
|
||||||
|
|
||||||
void setIsDummy(BOOL is_dummy) { mIsDummy = is_dummy; }
|
void setIsDummy(bool is_dummy) { mIsDummy = is_dummy; }
|
||||||
|
|
||||||
void setParamLocation(EParamLocation loc);
|
void setParamLocation(EParamLocation loc);
|
||||||
EParamLocation getParamLocation() const { return mParamLocation; }
|
EParamLocation getParamLocation() const { return mParamLocation; }
|
||||||
|
|
@ -179,8 +179,8 @@ protected:
|
||||||
F32 mLastWeight; // last weight
|
F32 mLastWeight; // last weight
|
||||||
LLVisualParam* mNext; // next param in a shared chain
|
LLVisualParam* mNext; // next param in a shared chain
|
||||||
F32 mTargetWeight; // interpolation target
|
F32 mTargetWeight; // interpolation target
|
||||||
BOOL mIsAnimating; // this value has been given an interpolation target
|
bool mIsAnimating; // this value has been given an interpolation target
|
||||||
BOOL mIsDummy; // this is used to prevent dummy visual params from animating
|
bool mIsDummy; // this is used to prevent dummy visual params from animating
|
||||||
|
|
||||||
|
|
||||||
S32 mID; // id for storing weight/morphtarget compares compactly
|
S32 mID; // id for storing weight/morphtarget compares compactly
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ include(bugsplat)
|
||||||
include(Linking)
|
include(Linking)
|
||||||
include(Boost)
|
include(Boost)
|
||||||
include(LLSharedLibs)
|
include(LLSharedLibs)
|
||||||
include(JsonCpp)
|
|
||||||
include(Copy3rdPartyLibs)
|
include(Copy3rdPartyLibs)
|
||||||
include(ZLIBNG)
|
include(ZLIBNG)
|
||||||
include(URIPARSER)
|
include(URIPARSER)
|
||||||
|
|
@ -194,6 +193,7 @@ set(llcommon_HEADER_FILES
|
||||||
llmetrics.h
|
llmetrics.h
|
||||||
llmetricperformancetester.h
|
llmetricperformancetester.h
|
||||||
llmortician.h
|
llmortician.h
|
||||||
|
llmutex.h
|
||||||
llnametable.h
|
llnametable.h
|
||||||
llpointer.h
|
llpointer.h
|
||||||
llprofiler.h
|
llprofiler.h
|
||||||
|
|
@ -318,7 +318,6 @@ target_link_libraries(
|
||||||
llcommon
|
llcommon
|
||||||
ll::apr
|
ll::apr
|
||||||
ll::expat
|
ll::expat
|
||||||
ll::jsoncpp
|
|
||||||
ll::zlib-ng
|
ll::zlib-ng
|
||||||
ll::boost
|
ll::boost
|
||||||
ll::uriparser
|
ll::uriparser
|
||||||
|
|
|
||||||
|
|
@ -292,10 +292,10 @@ public:
|
||||||
free(m_szSymPath);
|
free(m_szSymPath);
|
||||||
m_szSymPath = NULL;
|
m_szSymPath = NULL;
|
||||||
}
|
}
|
||||||
BOOL Init(LPCSTR szSymPath)
|
bool Init(LPCSTR szSymPath)
|
||||||
{
|
{
|
||||||
if (m_parent == NULL)
|
if (m_parent == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
// Dynamically load the Entry-Points for dbghelp.dll:
|
// Dynamically load the Entry-Points for dbghelp.dll:
|
||||||
// First try to load the newsest one from
|
// First try to load the newsest one from
|
||||||
TCHAR szTemp[4096];
|
TCHAR szTemp[4096];
|
||||||
|
|
@ -364,7 +364,7 @@ public:
|
||||||
if (m_hDbhHelp == NULL) // if not already loaded, try to load a default-one
|
if (m_hDbhHelp == NULL) // if not already loaded, try to load a default-one
|
||||||
m_hDbhHelp = LoadLibrary( _T("dbghelp.dll") );
|
m_hDbhHelp = LoadLibrary( _T("dbghelp.dll") );
|
||||||
if (m_hDbhHelp == NULL)
|
if (m_hDbhHelp == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
pSI = (tSI) GetProcAddress(m_hDbhHelp, "SymInitialize" );
|
pSI = (tSI) GetProcAddress(m_hDbhHelp, "SymInitialize" );
|
||||||
pSC = (tSC) GetProcAddress(m_hDbhHelp, "SymCleanup" );
|
pSC = (tSC) GetProcAddress(m_hDbhHelp, "SymCleanup" );
|
||||||
|
|
||||||
|
|
@ -388,7 +388,7 @@ public:
|
||||||
FreeLibrary(m_hDbhHelp);
|
FreeLibrary(m_hDbhHelp);
|
||||||
m_hDbhHelp = NULL;
|
m_hDbhHelp = NULL;
|
||||||
pSC = NULL;
|
pSC = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SymInitialize
|
// SymInitialize
|
||||||
|
|
@ -415,7 +415,7 @@ public:
|
||||||
GetUserNameA(szUserName, &dwSize);
|
GetUserNameA(szUserName, &dwSize);
|
||||||
this->m_parent->OnSymInit(buf, symOptions, szUserName);
|
this->m_parent->OnSymInit(buf, symOptions, szUserName);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
StackWalker *m_parent;
|
StackWalker *m_parent;
|
||||||
|
|
@ -555,7 +555,7 @@ private:
|
||||||
typedef MODULEENTRY32 * LPMODULEENTRY32;
|
typedef MODULEENTRY32 * LPMODULEENTRY32;
|
||||||
#pragma pack( pop )
|
#pragma pack( pop )
|
||||||
|
|
||||||
BOOL GetModuleListTH32(HANDLE hProcess, DWORD pid)
|
bool GetModuleListTH32(HANDLE hProcess, DWORD pid)
|
||||||
{
|
{
|
||||||
// CreateToolhelp32Snapshot()
|
// CreateToolhelp32Snapshot()
|
||||||
typedef HANDLE (__stdcall *tCT32S)(DWORD dwFlags, DWORD th32ProcessID);
|
typedef HANDLE (__stdcall *tCT32S)(DWORD dwFlags, DWORD th32ProcessID);
|
||||||
|
|
@ -592,13 +592,13 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hToolhelp == NULL)
|
if (hToolhelp == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
hSnap = pCT32S( TH32CS_SNAPMODULE, pid );
|
hSnap = pCT32S( TH32CS_SNAPMODULE, pid );
|
||||||
if (hSnap == (HANDLE) -1)
|
if (hSnap == (HANDLE) -1)
|
||||||
{
|
{
|
||||||
FreeLibrary(hToolhelp);
|
FreeLibrary(hToolhelp);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
keepGoing = !!pM32F( hSnap, &me );
|
keepGoing = !!pM32F( hSnap, &me );
|
||||||
|
|
@ -612,8 +612,8 @@ private:
|
||||||
CloseHandle(hSnap);
|
CloseHandle(hSnap);
|
||||||
FreeLibrary(hToolhelp);
|
FreeLibrary(hToolhelp);
|
||||||
if (cnt <= 0)
|
if (cnt <= 0)
|
||||||
return FALSE;
|
return false;
|
||||||
return TRUE;
|
return true;
|
||||||
} // GetModuleListTH32
|
} // GetModuleListTH32
|
||||||
|
|
||||||
// **************************************** PSAPI ************************
|
// **************************************** PSAPI ************************
|
||||||
|
|
@ -623,7 +623,7 @@ private:
|
||||||
LPVOID EntryPoint;
|
LPVOID EntryPoint;
|
||||||
} MODULEINFO, *LPMODULEINFO;
|
} MODULEINFO, *LPMODULEINFO;
|
||||||
|
|
||||||
BOOL GetModuleListPSAPI(HANDLE hProcess)
|
bool GetModuleListPSAPI(HANDLE hProcess)
|
||||||
{
|
{
|
||||||
// EnumProcessModules()
|
// EnumProcessModules()
|
||||||
typedef BOOL (__stdcall *tEPM)(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded );
|
typedef BOOL (__stdcall *tEPM)(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded );
|
||||||
|
|
@ -652,7 +652,7 @@ private:
|
||||||
|
|
||||||
hPsapi = LoadLibrary( _T("psapi.dll") );
|
hPsapi = LoadLibrary( _T("psapi.dll") );
|
||||||
if (hPsapi == NULL)
|
if (hPsapi == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
pEPM = (tEPM) GetProcAddress( hPsapi, "EnumProcessModules" );
|
pEPM = (tEPM) GetProcAddress( hPsapi, "EnumProcessModules" );
|
||||||
pGMFNE = (tGMFNE) GetProcAddress( hPsapi, "GetModuleFileNameExA" );
|
pGMFNE = (tGMFNE) GetProcAddress( hPsapi, "GetModuleFileNameExA" );
|
||||||
|
|
@ -662,7 +662,7 @@ private:
|
||||||
{
|
{
|
||||||
// we couldn't find all functions
|
// we couldn't find all functions
|
||||||
FreeLibrary(hPsapi);
|
FreeLibrary(hPsapi);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
hMods = (HMODULE*) malloc(sizeof(HMODULE) * (TTBUFLEN / sizeof(HMODULE)));
|
hMods = (HMODULE*) malloc(sizeof(HMODULE) * (TTBUFLEN / sizeof(HMODULE)));
|
||||||
|
|
@ -797,7 +797,7 @@ private:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
BOOL LoadModules(HANDLE hProcess, DWORD dwProcessId)
|
bool LoadModules(HANDLE hProcess, DWORD dwProcessId)
|
||||||
{
|
{
|
||||||
// first try toolhelp32
|
// first try toolhelp32
|
||||||
if (GetModuleListTH32(hProcess, dwProcessId))
|
if (GetModuleListTH32(hProcess, dwProcessId))
|
||||||
|
|
@ -807,13 +807,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL GetModuleInfo(HANDLE hProcess, DWORD64 baseAddr, IMAGEHLP_MODULE64_V3 *pModuleInfo)
|
bool GetModuleInfo(HANDLE hProcess, DWORD64 baseAddr, IMAGEHLP_MODULE64_V3 *pModuleInfo)
|
||||||
{
|
{
|
||||||
memset(pModuleInfo, 0, sizeof(IMAGEHLP_MODULE64_V3));
|
memset(pModuleInfo, 0, sizeof(IMAGEHLP_MODULE64_V3));
|
||||||
if(this->pSGMI == NULL)
|
if(this->pSGMI == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_DLL_INIT_FAILED);
|
SetLastError(ERROR_DLL_INIT_FAILED);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
// First try to use the larger ModuleInfo-Structure
|
// First try to use the larger ModuleInfo-Structure
|
||||||
pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V3);
|
pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V3);
|
||||||
|
|
@ -821,7 +821,7 @@ public:
|
||||||
if (pData == NULL)
|
if (pData == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
memcpy(pData, pModuleInfo, sizeof(IMAGEHLP_MODULE64_V3));
|
memcpy(pData, pModuleInfo, sizeof(IMAGEHLP_MODULE64_V3));
|
||||||
static bool s_useV3Version = true;
|
static bool s_useV3Version = true;
|
||||||
|
|
@ -833,7 +833,7 @@ public:
|
||||||
memcpy(pModuleInfo, pData, sizeof(IMAGEHLP_MODULE64_V3));
|
memcpy(pModuleInfo, pData, sizeof(IMAGEHLP_MODULE64_V3));
|
||||||
pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V3);
|
pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V3);
|
||||||
free(pData);
|
free(pData);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
s_useV3Version = false; // to prevent unneccessarry calls with the larger struct...
|
s_useV3Version = false; // to prevent unneccessarry calls with the larger struct...
|
||||||
}
|
}
|
||||||
|
|
@ -847,11 +847,11 @@ public:
|
||||||
memcpy(pModuleInfo, pData, sizeof(IMAGEHLP_MODULE64_V2));
|
memcpy(pModuleInfo, pData, sizeof(IMAGEHLP_MODULE64_V2));
|
||||||
pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V2);
|
pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V2);
|
||||||
free(pData);
|
free(pData);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
free(pData);
|
free(pData);
|
||||||
SetLastError(ERROR_DLL_INIT_FAILED);
|
SetLastError(ERROR_DLL_INIT_FAILED);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -860,7 +860,7 @@ StackWalker::StackWalker(DWORD dwProcessId, HANDLE hProcess)
|
||||||
{
|
{
|
||||||
this->m_verbose = true;
|
this->m_verbose = true;
|
||||||
this->m_options = OptionsAll;
|
this->m_options = OptionsAll;
|
||||||
this->m_modulesLoaded = FALSE;
|
this->m_modulesLoaded = false;
|
||||||
this->m_hProcess = hProcess;
|
this->m_hProcess = hProcess;
|
||||||
this->m_sw = new StackWalkerInternal(this, this->m_hProcess);
|
this->m_sw = new StackWalkerInternal(this, this->m_hProcess);
|
||||||
this->m_dwProcessId = dwProcessId;
|
this->m_dwProcessId = dwProcessId;
|
||||||
|
|
@ -871,7 +871,7 @@ StackWalker::StackWalker(bool verbose, int options, LPCSTR szSymPath, DWORD dwPr
|
||||||
{
|
{
|
||||||
this->m_verbose = verbose;
|
this->m_verbose = verbose;
|
||||||
this->m_options = options;
|
this->m_options = options;
|
||||||
this->m_modulesLoaded = FALSE;
|
this->m_modulesLoaded = false;
|
||||||
this->m_hProcess = hProcess;
|
this->m_hProcess = hProcess;
|
||||||
this->m_sw = new StackWalkerInternal(this, this->m_hProcess);
|
this->m_sw = new StackWalkerInternal(this, this->m_hProcess);
|
||||||
this->m_dwProcessId = dwProcessId;
|
this->m_dwProcessId = dwProcessId;
|
||||||
|
|
@ -895,15 +895,15 @@ StackWalker::~StackWalker()
|
||||||
this->m_sw = NULL;
|
this->m_sw = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL StackWalker::LoadModules()
|
bool StackWalker::LoadModules()
|
||||||
{
|
{
|
||||||
if (this->m_sw == NULL)
|
if (this->m_sw == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_DLL_INIT_FAILED);
|
SetLastError(ERROR_DLL_INIT_FAILED);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (m_modulesLoaded != FALSE)
|
if (m_modulesLoaded != FALSE)
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
// Build the sym-path:
|
// Build the sym-path:
|
||||||
char *szSymPath = NULL;
|
char *szSymPath = NULL;
|
||||||
|
|
@ -914,7 +914,7 @@ BOOL StackWalker::LoadModules()
|
||||||
if (szSymPath == NULL)
|
if (szSymPath == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
szSymPath[0] = 0;
|
szSymPath[0] = 0;
|
||||||
// Now first add the (optional) provided sympath:
|
// Now first add the (optional) provided sympath:
|
||||||
|
|
@ -994,18 +994,18 @@ BOOL StackWalker::LoadModules()
|
||||||
} // if SymBuildPath
|
} // if SymBuildPath
|
||||||
|
|
||||||
// First Init the whole stuff...
|
// First Init the whole stuff...
|
||||||
BOOL bRet = this->m_sw->Init(szSymPath);
|
bool bRet = this->m_sw->Init(szSymPath);
|
||||||
if (szSymPath != NULL) free(szSymPath); szSymPath = NULL;
|
if (szSymPath != NULL) free(szSymPath); szSymPath = NULL;
|
||||||
if (bRet == FALSE)
|
if (!bRet)
|
||||||
{
|
{
|
||||||
this->OnDbgHelpErr("Error while initializing dbghelp.dll", 0, 0);
|
this->OnDbgHelpErr("Error while initializing dbghelp.dll", 0, 0);
|
||||||
SetLastError(ERROR_DLL_INIT_FAILED);
|
SetLastError(ERROR_DLL_INIT_FAILED);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bRet = this->m_sw->LoadModules(this->m_hProcess, this->m_dwProcessId);
|
bRet = this->m_sw->LoadModules(this->m_hProcess, this->m_dwProcessId);
|
||||||
if (bRet != FALSE)
|
if (bRet)
|
||||||
m_modulesLoaded = TRUE;
|
m_modulesLoaded = true;
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1017,7 +1017,7 @@ BOOL StackWalker::LoadModules()
|
||||||
static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = NULL;
|
static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = NULL;
|
||||||
static LPVOID s_readMemoryFunction_UserData = NULL;
|
static LPVOID s_readMemoryFunction_UserData = NULL;
|
||||||
|
|
||||||
BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *context, PReadProcessMemoryRoutine readMemoryFunction, LPVOID pUserData)
|
bool StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *context, PReadProcessMemoryRoutine readMemoryFunction, LPVOID pUserData)
|
||||||
{
|
{
|
||||||
m_verbose = verbose;
|
m_verbose = verbose;
|
||||||
CONTEXT c;
|
CONTEXT c;
|
||||||
|
|
@ -1029,13 +1029,13 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con
|
||||||
bool bLastEntryCalled = true;
|
bool bLastEntryCalled = true;
|
||||||
int curRecursionCount = 0;
|
int curRecursionCount = 0;
|
||||||
|
|
||||||
if (m_modulesLoaded == FALSE)
|
if (!m_modulesLoaded)
|
||||||
this->LoadModules(); // ignore the result...
|
this->LoadModules(); // ignore the result...
|
||||||
|
|
||||||
if (this->m_sw->m_hDbhHelp == NULL)
|
if (this->m_sw->m_hDbhHelp == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_DLL_INIT_FAILED);
|
SetLastError(ERROR_DLL_INIT_FAILED);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_readMemoryFunction = readMemoryFunction;
|
s_readMemoryFunction = readMemoryFunction;
|
||||||
|
|
@ -1062,7 +1062,7 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con
|
||||||
if (GetThreadContext(hThread, &c) == FALSE)
|
if (GetThreadContext(hThread, &c) == FALSE)
|
||||||
{
|
{
|
||||||
ResumeThread(hThread);
|
ResumeThread(hThread);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1256,13 +1256,13 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con
|
||||||
cleanup:
|
cleanup:
|
||||||
if (pSym) free( pSym );
|
if (pSym) free( pSym );
|
||||||
|
|
||||||
if (bLastEntryCalled == false)
|
if (!bLastEntryCalled)
|
||||||
this->OnCallstackEntry(lastEntry, csEntry);
|
this->OnCallstackEntry(lastEntry, csEntry);
|
||||||
|
|
||||||
if (context == NULL)
|
if (context == NULL)
|
||||||
ResumeThread(hThread);
|
ResumeThread(hThread);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL __stdcall StackWalker::myReadProcMem(
|
BOOL __stdcall StackWalker::myReadProcMem(
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue