Merge with lgpl tip.
commit
22e028c9ae
|
|
@ -87,8 +87,8 @@ glob:indra/newview/filters.xml
|
|||
glob:indra/newview/avatar_icons_cache.txt
|
||||
glob:indra/newview/avatar_lad.log
|
||||
glob:*.diff
|
||||
indra/newview/pilot.txt
|
||||
indra/newview/pilot.xml
|
||||
#*.rej
|
||||
glob:fmod*
|
||||
syntax: regexp
|
||||
^indra/build
|
||||
.*\.wixobj
|
||||
2
.hgtags
2
.hgtags
|
|
@ -517,3 +517,5 @@ b842534cb4d76c9ef87676a62b1d2d19e79c015f 3.7.2-release
|
|||
d076568ff7883b41c149e6afb421f39c29dbfe2b 3.7.4-release
|
||||
fc066b82343fca51f9c1b8eda0abc6bee9bb4503 3.7.5-release
|
||||
d029faf69f20a23007f32420a1ac6a3b89a6d441 3.7.6-release
|
||||
83959480cb986522d07b151a0c778ab7f920d41b 3.7.7-release
|
||||
bba9b3722eea08949e4ff69591f736bf0f808434 3.7.8-release
|
||||
|
|
|
|||
|
|
@ -201,8 +201,6 @@ runway.viewer_grid = agni
|
|||
runway.build_debug_release_separately = true
|
||||
runway.build_CYGWIN_Debug = false
|
||||
runway.build_viewer_update_version_manager = false
|
||||
|
||||
|
||||
# eof
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -290,9 +290,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>562bf2c9b6b835b1f36caf96dca9f907</string>
|
||||
<string>9617df1d21e7552888f9a411d202777c</string>
|
||||
<key>url</key>
|
||||
<string>http://downloads.phoenixviewer.com/boost-1.52.0-linux-20130708.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/boost-1.52.0-linux-20140605.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -1024,7 +1024,7 @@
|
|||
<key>hash</key>
|
||||
<string>52257e5eb166a0b69c9c0c38f6e1920e</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273079/arch/Linux/installer/google_breakpad-0.0.0-rev1099-linux-20130329.tar.bz2</string>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273079/arch/Linux/installer/google_breakpad-0.0.0-rev1099-linux-20130329.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -1430,9 +1430,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>ab2ee5cce7db268d28f245ff1a34532b</string>
|
||||
<string>f5a09d25b38c251bc880121f6ca1c857</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/kdu-7.3.2-darwin-20131204.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/kdu-7.4.0-darwin-20140605.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin</string>
|
||||
|
|
@ -1442,9 +1442,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>03350c4f0aa32e56bba4979b598a6fc2</string>
|
||||
<string>ae5e86bbe3376d107960e1364cada76a</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/kdu-7.3.2-linux-20131204.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/kdu-7.4.0-linux-20140605.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -1466,9 +1466,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>20ea3d68affefca2b31b60f2ea3e2a96</string>
|
||||
<string>3c2d8f82e75cab399dbe9eff7c3038f6</string>
|
||||
<key>url</key>
|
||||
<string>file:///c:/cygwin/opt/firestorm//kdu-7.3.2-windows-20131204.tar.bz2</string>
|
||||
<string>file:///c:/cygwin/opt/firestorm/kdu-7.4.0-windows-20140605.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -1730,9 +1730,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>5bc44db15eb3cca021382e40e04a9a38</string>
|
||||
<string>b6d29de20de5c8f31925697b30e8f727</string>
|
||||
<key>url</key>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/271972/arch/Linux/installer/llappearanceutility_source-0.1-linux-20130315.tar.bz2</string>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/283723/arch/Linux/installer/llappearanceutility_source-0.1-linux-20131109.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -2160,9 +2160,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>3d40be8566fa4b9df9a38e2a0f9ea467</string>
|
||||
<string>72a1eaeff0df2fd132447b6b6f5e60c5</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/226882/arch/Linux/installer/openssl-1.0.0d-linux-20110418.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/openssl-1.0.1h-linux-20140606.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -2184,9 +2184,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>85082f3d5fac07ce947622bf6dd3119e</string>
|
||||
<string>6395ebbd46dd6112e7aa0aa54089d9ed</string>
|
||||
<key>url</key>
|
||||
<string>http://downloads.phoenixviewer.com/openssl-1.0.1g-windows-20140410.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/openssl-1.0.1h-windows-20140606.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -2612,9 +2612,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>7b4cf3aa2c04937d0a20761516587896</string>
|
||||
<string>ca53589d8dd4969cd8c42d0b8f8594dd</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-zlib/rev/223739/arch/Linux/installer/zlib-1.2.5-linux-20110314.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/zlib-1.2.8-linux-20140606.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ add_subdirectory(${VIEWER_PREFIX}test)
|
|||
endif (LL_TESTS OR NOT STANDALONE)
|
||||
|
||||
# viewer media plugins
|
||||
if( NOT ( (WINDOWS OR DARWIN) AND ND_BUILD64BIT_ARCH ) )
|
||||
if( NOT WINDOWS OR NOT ND_BUILD64BIT_ARCH )
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
|
||||
endif( NOT ( (WINDOWS OR DARWIN) AND ND_BUILD64BIT_ARCH ) )
|
||||
endif( NOT WINDOWS OR NOT ND_BUILD64BIT_ARCH )
|
||||
|
||||
# <FS:AW opensim currency support>
|
||||
#teapot helper library
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ if (WINDOWS)
|
|||
else (USE_AVX_OPTIMIZATION)
|
||||
add_definitions(
|
||||
/DLL_WINDOWS=1
|
||||
/DNOMINMAX
|
||||
/DDOM_DYNAMIC
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ else (STANDALONE)
|
|||
elseif (DARWIN)
|
||||
set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
|
||||
elseif (LINUX)
|
||||
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
|
||||
if (ND_BUILD64BIT_ARCH)
|
||||
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.4.7_libmt.a)
|
||||
else (ND_BUILD64BIT_ARCH)
|
||||
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
|
||||
endif (ND_BUILD64BIT_ARCH)
|
||||
endif (WINDOWS)
|
||||
set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
|
||||
endif (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
|
|||
if (WINDOWS)
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname}
|
||||
PROPERTIES
|
||||
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS"
|
||||
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
|
||||
LINK_FLAGS_RELEASE ""
|
||||
)
|
||||
|
|
|
|||
|
|
@ -49,6 +49,14 @@ else (STANDALONE)
|
|||
pangox-1.0
|
||||
pangoxft-1.0
|
||||
)
|
||||
|
||||
if (ND_BUILD64BIT_ARCH)
|
||||
set(UI_LIB_NAMES ${UI_LIB_NAMES}
|
||||
gio-2.0
|
||||
pangocairo-1.0
|
||||
)
|
||||
endif(ND_BUILD64BIT_ARCH)
|
||||
|
||||
foreach(libname ${UI_LIB_NAMES})
|
||||
find_library(UI_LIB_${libname}
|
||||
NAMES ${libname}
|
||||
|
|
@ -60,17 +68,6 @@ else (STANDALONE)
|
|||
set(UI_LIBRARIES ${UI_LIBRARIES} ${UI_LIB_${libname}})
|
||||
endforeach(libname)
|
||||
|
||||
if (ND_BUILD64BIT_ARCH)
|
||||
find_library(UI_LIB_gio-2.0
|
||||
NAMES gio-2.0
|
||||
PATHS
|
||||
debug ${LIBS_PREBUILT_DIR}/lib/debug
|
||||
optimized ${LIBS_PREBUILT_DIR}/lib/release
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
set(UI_LIBRARIES ${UI_LIBRARIES} ${UI_LIB_gio-2.0})
|
||||
endif(ND_BUILD64BIT_ARCH)
|
||||
|
||||
set(UI_LIBRARIES ${UI_LIBRARIES} Xinerama)
|
||||
endif (LINUX)
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ void export_test_floaters()
|
|||
// don't re-export other test floaters
|
||||
continue;
|
||||
}
|
||||
llinfos << "Converting " << filename << llendl;
|
||||
LL_INFOS() << "Converting " << filename << LL_ENDL;
|
||||
// Build a floater and output new attributes
|
||||
LLXMLNodePtr output_node = new LLXMLNode();
|
||||
LLFloater* floater = new LLFloater(LLSD());
|
||||
|
|
@ -207,7 +207,7 @@ void export_test_floaters()
|
|||
out_filename.resize(extension_pos);
|
||||
out_filename += "_new.xml";
|
||||
|
||||
llinfos << "Output: " << out_filename << llendl;
|
||||
LL_INFOS() << "Output: " << out_filename << LL_ENDL;
|
||||
LLFILE* floater_file = LLFile::fopen(out_filename.c_str(), "w");
|
||||
LLXMLNode::writeHeaderToFile(floater_file);
|
||||
output_node->writeToFile(floater_file);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
llinfos << "Starting crash reporter." << llendl;
|
||||
LL_INFOS() << "Starting crash reporter." << LL_ENDL;
|
||||
|
||||
LLCrashLoggerLinux app;
|
||||
app.parseCommandOptions(argc, argv);
|
||||
|
|
@ -42,17 +42,17 @@ int main(int argc, char **argv)
|
|||
|
||||
if (!(options.has("pid") && options.has("dumpdir")))
|
||||
{
|
||||
llwarns << "Insufficient parameters to crash report." << llendl;
|
||||
LL_WARNS() << "Insufficient parameters to crash report." << LL_ENDL;
|
||||
}
|
||||
|
||||
if (! app.init())
|
||||
{
|
||||
llwarns << "Unable to initialize application." << llendl;
|
||||
LL_WARNS() << "Unable to initialize application." << LL_ENDL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
app.mainLoop();
|
||||
app.cleanup();
|
||||
llinfos << "Crash reporter finished normally." << llendl;
|
||||
LL_INFOS() << "Crash reporter finished normally." << LL_ENDL;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static BOOL do_ask_dialog(void)
|
|||
#if LL_GTK
|
||||
gtk_disable_setlocale();
|
||||
if (!gtk_init_check(NULL, NULL)) {
|
||||
llinfos << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << llendl;
|
||||
LL_INFOS() << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llerrorcontrol.h"
|
||||
|
|
@ -315,9 +317,9 @@ gpointer worker_thread_cb(gpointer data)
|
|||
("secondlife-update-XXXXXX", &tmp_local_filename, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
llerrs << "Unable to create temporary file: "
|
||||
LL_ERRS() << "Unable to create temporary file: "
|
||||
<< error->message
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
g_error_free(error);
|
||||
throw 0;
|
||||
|
|
@ -332,9 +334,9 @@ gpointer worker_thread_cb(gpointer data)
|
|||
package_file = fdopen(fd, "wb");
|
||||
if (package_file == NULL)
|
||||
{
|
||||
llerrs << "Failed to create temporary file: "
|
||||
LL_ERRS() << "Failed to create temporary file: "
|
||||
<< app_state->file.c_str()
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
|
|
@ -345,12 +347,12 @@ gpointer worker_thread_cb(gpointer data)
|
|||
}
|
||||
|
||||
// initialize curl and start downloading the package
|
||||
llinfos << "Downloading package: " << app_state->url << llendl;
|
||||
LL_INFOS() << "Downloading package: " << app_state->url << LL_ENDL;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if (curl == NULL)
|
||||
{
|
||||
llerrs << "Failed to initialize libcurl" << llendl;
|
||||
LL_ERRS() << "Failed to initialize libcurl" << LL_ENDL;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
|
|
@ -375,9 +377,9 @@ gpointer worker_thread_cb(gpointer data)
|
|||
|
||||
if (result)
|
||||
{
|
||||
llerrs << "Failed to download update: "
|
||||
LL_ERRS() << "Failed to download update: "
|
||||
<< app_state->url
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
|
|
@ -403,9 +405,9 @@ gpointer worker_thread_cb(gpointer data)
|
|||
// thread and show file chooser?
|
||||
if (!install_package(app_state->file.c_str(), app_state->dest_dir))
|
||||
{
|
||||
llwarns << "Failed to install package to destination: "
|
||||
LL_WARNS() << "Failed to install package to destination: "
|
||||
<< app_state->dest_dir
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
|
|
@ -419,9 +421,9 @@ gpointer worker_thread_cb(gpointer data)
|
|||
// try to spawn the new viewer
|
||||
if (!spawn_viewer(app_state))
|
||||
{
|
||||
llwarns << "Viewer was not installed properly in : "
|
||||
LL_WARNS() << "Viewer was not installed properly in : "
|
||||
<< app_state->dest_dir
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
|
|
@ -481,10 +483,10 @@ int
|
|||
rename_with_sudo_fallback(const std::string& filename, const std::string& newname)
|
||||
{
|
||||
int rtncode = ::rename(filename.c_str(), newname.c_str());
|
||||
lldebugs << "rename result is: " << rtncode << " / " << errno << llendl;
|
||||
LL_DEBUGS() << "rename result is: " << rtncode << " / " << errno << LL_ENDL;
|
||||
if (rtncode && (EACCES == errno || EPERM == errno || EXDEV == errno))
|
||||
{
|
||||
llinfos << "Permission problem in rename, or moving between different mount points. Retrying as a mv under a sudo." << llendl;
|
||||
LL_INFOS() << "Permission problem in rename, or moving between different mount points. Retrying as a mv under a sudo." << LL_ENDL;
|
||||
// failed due to permissions, try again as a gksudo or kdesu mv wrapper hack
|
||||
char *sudo_cmd = NULL;
|
||||
sudo_cmd = g_find_program_in_path("gksudo");
|
||||
|
|
@ -515,15 +517,15 @@ rename_with_sudo_fallback(const std::string& filename, const std::string& newnam
|
|||
if (!less_anal_gspawnsync(argv, &stderr_output,
|
||||
&child_exit_status, &spawn_error))
|
||||
{
|
||||
llwarns << "Failed to spawn child process: "
|
||||
LL_WARNS() << "Failed to spawn child process: "
|
||||
<< spawn_error->message
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else if (child_exit_status)
|
||||
{
|
||||
llwarns << "mv command failed: "
|
||||
LL_WARNS() << "mv command failed: "
|
||||
<< (stderr_output ? stderr_output : "(no reason given)")
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -549,19 +551,19 @@ gboolean install_package(std::string package_file, std::string destination)
|
|||
tar_cmd = g_find_program_in_path("tar");
|
||||
if (!tar_cmd)
|
||||
{
|
||||
llerrs << "`tar' was not found in $PATH" << llendl;
|
||||
LL_ERRS() << "`tar' was not found in $PATH" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
llinfos << "Found tar command: " << tar_cmd << llendl;
|
||||
LL_INFOS() << "Found tar command: " << tar_cmd << LL_ENDL;
|
||||
|
||||
// Unpack the tarball in a temporary place first, then move it to
|
||||
// its final destination
|
||||
std::string tmp_dest_dir = gDirUtilp->getTempFilename();
|
||||
if (LLFile::mkdir(tmp_dest_dir, 0744))
|
||||
{
|
||||
llerrs << "Failed to create directory: "
|
||||
LL_ERRS() << "Failed to create directory: "
|
||||
<< destination
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -577,7 +579,7 @@ gboolean install_package(std::string package_file, std::string destination)
|
|||
NULL,
|
||||
};
|
||||
|
||||
llinfos << "Untarring package: " << package_file << llendl;
|
||||
LL_INFOS() << "Untarring package: " << package_file << LL_ENDL;
|
||||
|
||||
// store current SIGCHLD handler if there is one, replace with default
|
||||
// handler to make glib happy
|
||||
|
|
@ -594,17 +596,17 @@ gboolean install_package(std::string package_file, std::string destination)
|
|||
if (!less_anal_gspawnsync(argv, &stderr_output,
|
||||
&child_exit_status, &untar_error))
|
||||
{
|
||||
llwarns << "Failed to spawn child process: "
|
||||
LL_WARNS() << "Failed to spawn child process: "
|
||||
<< untar_error->message
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (child_exit_status)
|
||||
{
|
||||
llwarns << "Untar command failed: "
|
||||
LL_WARNS() << "Untar command failed: "
|
||||
<< (stderr_output ? stderr_output : "(no reason given)")
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -628,9 +630,9 @@ gboolean install_package(std::string package_file, std::string destination)
|
|||
|
||||
if (rename_with_sudo_fallback(destination, backup_dir))
|
||||
{
|
||||
llwarns << "Failed to move directory: '"
|
||||
LL_WARNS() << "Failed to move directory: '"
|
||||
<< destination << "' -> '" << backup_dir
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -639,9 +641,9 @@ gboolean install_package(std::string package_file, std::string destination)
|
|||
// need to move it to its destination.
|
||||
if (rename_with_sudo_fallback(tmp_dest_dir, destination))
|
||||
{
|
||||
llwarns << "Failed to move installation to the destination: "
|
||||
LL_WARNS() << "Failed to move installation to the destination: "
|
||||
<< destination
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -736,8 +738,8 @@ BOOL spawn_viewer(UpdaterAppState *app_state)
|
|||
|
||||
if (!success)
|
||||
{
|
||||
llwarns << "Failed to launch viewer: " << error->message
|
||||
<< llendl;
|
||||
LL_WARNS() << "Failed to launch viewer: " << error->message
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
if (error) g_error_free(error);
|
||||
|
|
@ -841,7 +843,7 @@ int main(int argc, char **argv)
|
|||
// create UI
|
||||
updater_app_ui_init(app_state);
|
||||
|
||||
//llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl;
|
||||
//LL_INFOS() << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << LL_ENDL;
|
||||
|
||||
// create download thread
|
||||
#if ( !defined(GLIB_MAJOR_VERSION) && !defined(GLIB_MINOR_VERSION) ) || ( GLIB_MAJOR_VERSION < 2 ) || ( GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 32 )
|
||||
|
|
|
|||
|
|
@ -35,15 +35,15 @@
|
|||
#include "llavatarappearance.h"
|
||||
#include "llavatarappearancedefines.h"
|
||||
#include "llavatarjointmesh.h"
|
||||
#include "imageids.h"
|
||||
#include "llstl.h"
|
||||
#include "lldir.h"
|
||||
#include "lldeleteutils.h"
|
||||
#include "llpolymorph.h"
|
||||
#include "llpolymesh.h"
|
||||
#include "llpolyskeletaldistortion.h"
|
||||
#include "llstl.h"
|
||||
#include "lltexglobalcolor.h"
|
||||
#include "llwearabledata.h"
|
||||
#include "boost/bind.hpp"
|
||||
|
||||
|
||||
#if LL_MSVC
|
||||
|
|
@ -142,9 +142,9 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
|
|||
std::for_each(mAttachmentInfoList.begin(), mAttachmentInfoList.end(), DeletePointer());
|
||||
mAttachmentInfoList.clear();
|
||||
|
||||
deleteAndClear(mTexSkinColorInfo);
|
||||
deleteAndClear(mTexHairColorInfo);
|
||||
deleteAndClear(mTexEyeColorInfo);
|
||||
delete_and_clear(mTexSkinColorInfo);
|
||||
delete_and_clear(mTexHairColorInfo);
|
||||
delete_and_clear(mTexEyeColorInfo);
|
||||
|
||||
std::for_each(mLayerInfoList.begin(), mLayerInfoList.end(), DeletePointer());
|
||||
mLayerInfoList.clear();
|
||||
|
|
@ -235,7 +235,7 @@ void LLAvatarAppearance::initInstance()
|
|||
mesh->setMeshID(mesh_index);
|
||||
mesh->setPickName(mesh_dict->mPickName);
|
||||
mesh->setIsTransparent(FALSE);
|
||||
switch((int)mesh_index)
|
||||
switch((S32)mesh_index)
|
||||
{
|
||||
case MESH_ID_HAIR:
|
||||
mesh->setIsTransparent(TRUE);
|
||||
|
|
@ -290,13 +290,13 @@ void LLAvatarAppearance::initInstance()
|
|||
// virtual
|
||||
LLAvatarAppearance::~LLAvatarAppearance()
|
||||
{
|
||||
deleteAndClear(mTexSkinColor);
|
||||
deleteAndClear(mTexHairColor);
|
||||
deleteAndClear(mTexEyeColor);
|
||||
delete_and_clear(mTexSkinColor);
|
||||
delete_and_clear(mTexHairColor);
|
||||
delete_and_clear(mTexEyeColor);
|
||||
|
||||
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
|
||||
{
|
||||
deleteAndClear(mBakedTextureDatas[i].mTexLayerSet);
|
||||
delete_and_clear(mBakedTextureDatas[i].mTexLayerSet);
|
||||
mBakedTextureDatas[i].mJointMeshes.clear();
|
||||
|
||||
for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
|
||||
|
|
@ -311,7 +311,7 @@ LLAvatarAppearance::~LLAvatarAppearance()
|
|||
mJointMap.clear();
|
||||
|
||||
clearSkeleton();
|
||||
deleteAndClearArray(mCollisionVolumes);
|
||||
delete_and_clear_array(mCollisionVolumes);
|
||||
|
||||
std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
|
||||
mPolyMeshes.clear();
|
||||
|
|
@ -339,14 +339,14 @@ void LLAvatarAppearance::initClass()
|
|||
BOOL success = sXMLTree.parseFile( xmlFile, FALSE );
|
||||
if (!success)
|
||||
{
|
||||
llerrs << "Problem reading avatar configuration file:" << xmlFile << llendl;
|
||||
LL_ERRS() << "Problem reading avatar configuration file:" << xmlFile << LL_ENDL;
|
||||
}
|
||||
|
||||
// now sanity check xml file
|
||||
LLXmlTreeNode* root = sXMLTree.getRoot();
|
||||
if (!root)
|
||||
{
|
||||
llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl;
|
||||
LL_ERRS() << "No root node found in avatar configuration file: " << xmlFile << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -355,14 +355,14 @@ void LLAvatarAppearance::initClass()
|
|||
//-------------------------------------------------------------------------
|
||||
if( !root->hasName( "linden_avatar" ) )
|
||||
{
|
||||
llerrs << "Invalid avatar file header: " << xmlFile << llendl;
|
||||
LL_ERRS() << "Invalid avatar file header: " << xmlFile << LL_ENDL;
|
||||
}
|
||||
|
||||
std::string version;
|
||||
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
|
||||
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
|
||||
{
|
||||
llerrs << "Invalid avatar file version: " << version << " in file: " << xmlFile << llendl;
|
||||
LL_ERRS() << "Invalid avatar file version: " << version << " in file: " << xmlFile << LL_ENDL;
|
||||
}
|
||||
|
||||
S32 wearable_def_version = 1;
|
||||
|
|
@ -375,7 +375,7 @@ void LLAvatarAppearance::initClass()
|
|||
LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" );
|
||||
if (!skeleton_node)
|
||||
{
|
||||
llerrs << "No skeleton in avatar configuration file: " << xmlFile << llendl;
|
||||
LL_ERRS() << "No skeleton in avatar configuration file: " << xmlFile << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -383,14 +383,14 @@ void LLAvatarAppearance::initClass()
|
|||
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
|
||||
if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name))
|
||||
{
|
||||
llerrs << "No file name in skeleton node in avatar config file: " << xmlFile << llendl;
|
||||
LL_ERRS() << "No file name in skeleton node in avatar config file: " << xmlFile << LL_ENDL;
|
||||
}
|
||||
|
||||
std::string skeleton_path;
|
||||
skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
|
||||
if (!parseSkeletonFile(skeleton_path))
|
||||
{
|
||||
llerrs << "Error parsing skeleton file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
|
||||
// Process XML data
|
||||
|
|
@ -403,43 +403,43 @@ void LLAvatarAppearance::initClass()
|
|||
sAvatarSkeletonInfo = new LLAvatarSkeletonInfo;
|
||||
if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
|
||||
{
|
||||
llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton XML file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
// parse avatar_lad.xml
|
||||
if (sAvatarXmlInfo)
|
||||
{ //this can happen if a login attempt failed
|
||||
deleteAndClear(sAvatarXmlInfo);
|
||||
delete_and_clear(sAvatarXmlInfo);
|
||||
}
|
||||
sAvatarXmlInfo = new LLAvatarXmlInfo;
|
||||
if (!sAvatarXmlInfo->parseXmlSkeletonNode(root))
|
||||
{
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlMeshNodes(root))
|
||||
{
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlColorNodes(root))
|
||||
{
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlLayerNodes(root))
|
||||
{
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlDriverNodes(root))
|
||||
{
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlMorphNodes(root))
|
||||
{
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAvatarAppearance::cleanupClass()
|
||||
{
|
||||
deleteAndClear(sAvatarXmlInfo);
|
||||
delete_and_clear(sAvatarXmlInfo);
|
||||
// *TODO: What about sAvatarSkeletonInfo ???
|
||||
sSkeletonXMLTree.cleanup();
|
||||
sXMLTree.cleanup();
|
||||
|
|
@ -559,7 +559,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
|
|||
|
||||
if (!parsesuccess)
|
||||
{
|
||||
llerrs << "Can't parse skeleton file: " << filename << llendl;
|
||||
LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -567,13 +567,13 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
|
|||
LLXmlTreeNode* root = sSkeletonXMLTree.getRoot();
|
||||
if (!root)
|
||||
{
|
||||
llerrs << "No root node found in avatar skeleton file: " << filename << llendl;
|
||||
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( !root->hasName( "linden_skeleton" ) )
|
||||
{
|
||||
llerrs << "Invalid avatar skeleton file header: " << filename << llendl;
|
||||
LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -581,7 +581,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
|
|||
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
|
||||
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
|
||||
{
|
||||
llerrs << "Invalid avatar skeleton file version: " << version << " in file: " << filename << llendl;
|
||||
LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
|||
joint = getCharacterJoint(joint_num);
|
||||
if (!joint)
|
||||
{
|
||||
llwarns << "Too many bones" << llendl;
|
||||
LL_WARNS() << "Too many bones" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
joint->setName( info->mName );
|
||||
|
|
@ -609,7 +609,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
|||
{
|
||||
if (volume_num >= (S32)mNumCollisionVolumes)
|
||||
{
|
||||
llwarns << "Too many bones" << llendl;
|
||||
LL_WARNS() << "Too many bones" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
joint = (&mCollisionVolumes[volume_num]);
|
||||
|
|
@ -679,7 +679,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
|||
//-------------------------------------------------------------------------
|
||||
if (!allocateCharacterJoints(info->mNumBones))
|
||||
{
|
||||
llerrs << "Can't allocate " << info->mNumBones << " joints" << llendl;
|
||||
LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -690,7 +690,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
|||
{
|
||||
if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
|
||||
{
|
||||
llerrs << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << llendl;
|
||||
LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -703,7 +703,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
|||
LLAvatarBoneInfo *info = *iter;
|
||||
if (!setupBone(info, NULL, current_volume_num, current_joint_num))
|
||||
{
|
||||
llerrs << "Error parsing bone in skeleton file" << llendl;
|
||||
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -763,17 +763,17 @@ void LLAvatarAppearance::buildCharacter()
|
|||
stop_glerror();
|
||||
|
||||
// gPrintMessagesThisFrame = TRUE;
|
||||
lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl;
|
||||
LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
|
||||
|
||||
if (!status)
|
||||
{
|
||||
if (isSelf())
|
||||
{
|
||||
llerrs << "Unable to load user's avatar" << llendl;
|
||||
LL_ERRS() << "Unable to load user's avatar" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Unable to load other's avatar" << llendl;
|
||||
LL_WARNS() << "Unable to load other's avatar" << LL_ENDL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -822,7 +822,7 @@ void LLAvatarAppearance::buildCharacter()
|
|||
mEyeLeftp &&
|
||||
mEyeRightp))
|
||||
{
|
||||
llerrs << "Failed to create avatar." << llendl;
|
||||
LL_ERRS() << "Failed to create avatar." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -838,26 +838,26 @@ void LLAvatarAppearance::buildCharacter()
|
|||
|
||||
BOOL LLAvatarAppearance::loadAvatar()
|
||||
{
|
||||
// LLFastTimer t(FTM_LOAD_AVATAR);
|
||||
// LL_RECORD_BLOCK_TIME(FTM_LOAD_AVATAR);
|
||||
|
||||
// avatar_skeleton.xml
|
||||
if( !buildSkeleton(sAvatarSkeletonInfo) )
|
||||
{
|
||||
llwarns << "avatar file: buildSkeleton() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <skeleton>
|
||||
if( !loadSkeletonNode() )
|
||||
{
|
||||
llwarns << "avatar file: loadNodeSkeleton() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <mesh>
|
||||
if( !loadMeshNodes() )
|
||||
{
|
||||
llwarns << "avatar file: loadNodeMesh() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -867,13 +867,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
mTexSkinColor = new LLTexGlobalColor( this );
|
||||
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
|
||||
{
|
||||
llwarns << "avatar file: mTexSkinColor->setInfo() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "<global_color> name=\"skin_color\" not found" << llendl;
|
||||
LL_WARNS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if( sAvatarXmlInfo->mTexHairColorInfo )
|
||||
|
|
@ -881,13 +881,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
mTexHairColor = new LLTexGlobalColor( this );
|
||||
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
|
||||
{
|
||||
llwarns << "avatar file: mTexHairColor->setInfo() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "<global_color> name=\"hair_color\" not found" << llendl;
|
||||
LL_WARNS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if( sAvatarXmlInfo->mTexEyeColorInfo )
|
||||
|
|
@ -895,26 +895,26 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
mTexEyeColor = new LLTexGlobalColor( this );
|
||||
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
|
||||
{
|
||||
llwarns << "avatar file: mTexEyeColor->setInfo() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "<global_color> name=\"eye_color\" not found" << llendl;
|
||||
LL_WARNS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <layer_set>
|
||||
if (sAvatarXmlInfo->mLayerInfoList.empty())
|
||||
{
|
||||
llwarns << "avatar file: missing <layer_set> node" << llendl;
|
||||
LL_WARNS() << "avatar file: missing <layer_set> node" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
|
||||
{
|
||||
llwarns << "avatar file: missing <morph_masks> node" << llendl;
|
||||
LL_WARNS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -956,14 +956,14 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam;
|
||||
if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false))
|
||||
{
|
||||
llwarns << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << llendl;
|
||||
LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete driver_param;
|
||||
llwarns << "avatar file: driver_param->parseData() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1083,17 +1083,17 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Avatar file: <mesh> has invalid lod setting " << lod << llendl;
|
||||
LL_WARNS() << "Avatar file: <mesh> has invalid lod setting " << lod << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Ignoring unrecognized mesh type: " << type << llendl;
|
||||
LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// llinfos << "Parsing mesh data for " << type << "..." << llendl;
|
||||
// LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL;
|
||||
|
||||
// If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings.
|
||||
// Do not touch!!!
|
||||
|
|
@ -1123,7 +1123,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
|
||||
if( !poly_mesh )
|
||||
{
|
||||
llwarns << "Failed to load mesh of type " << type << llendl;
|
||||
LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1183,7 +1183,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
|||
{
|
||||
stop_glerror();
|
||||
delete layer_set;
|
||||
llwarns << "avatar file: layer_set->setInfo() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1206,7 +1206,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
|||
// if no baked texture was found, warn and cleanup
|
||||
if (baked_index == BAKED_NUM_INDICES)
|
||||
{
|
||||
llwarns << "<layer_set> has invalid body_region attribute" << llendl;
|
||||
LL_WARNS() << "<layer_set> has invalid body_region attribute" << LL_ENDL;
|
||||
delete layer_set;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1224,7 +1224,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl;
|
||||
LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL;
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1320,7 +1320,7 @@ BOOL LLAvatarAppearance::isValid() const
|
|||
// This should only be called on ourself.
|
||||
if (!isSelf())
|
||||
{
|
||||
llerrs << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << llendl;
|
||||
LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1485,7 +1485,7 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||
{
|
||||
deleteAndClearArray(mCollisionVolumes);
|
||||
delete_and_clear_array(mCollisionVolumes);
|
||||
mNumCollisionVolumes = 0;
|
||||
|
||||
mCollisionVolumes = new LLAvatarJointCollisionVolume[num];
|
||||
|
|
@ -1509,7 +1509,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!node->getFastAttributeString(name_string, mName))
|
||||
{
|
||||
llwarns << "Bone without name" << llendl;
|
||||
LL_WARNS() << "Bone without name" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1524,28 +1524,28 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Invalid node " << node->getName() << llendl;
|
||||
LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
|
||||
if (!node->getFastAttributeVector3(pos_string, mPos))
|
||||
{
|
||||
llwarns << "Bone without position" << llendl;
|
||||
LL_WARNS() << "Bone without position" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
|
||||
if (!node->getFastAttributeVector3(rot_string, mRot))
|
||||
{
|
||||
llwarns << "Bone without rotation" << llendl;
|
||||
LL_WARNS() << "Bone without rotation" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
|
||||
if (!node->getFastAttributeVector3(scale_string, mScale))
|
||||
{
|
||||
llwarns << "Bone without scale" << llendl;
|
||||
LL_WARNS() << "Bone without scale" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1554,7 +1554,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot");
|
||||
if (!node->getFastAttributeVector3(pivot_string, mPivot))
|
||||
{
|
||||
llwarns << "Bone without pivot" << llendl;
|
||||
LL_WARNS() << "Bone without pivot" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1582,7 +1582,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
|
||||
if (!node->getFastAttributeS32(num_bones_string, mNumBones))
|
||||
{
|
||||
llwarns << "Couldn't find number of bones." << llendl;
|
||||
LL_WARNS() << "Couldn't find number of bones." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1596,7 +1596,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
|||
if (!info->parseXml(child))
|
||||
{
|
||||
delete info;
|
||||
llwarns << "Error parsing bone in skeleton file" << llendl;
|
||||
LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
mBoneInfoList.push_back(info);
|
||||
|
|
@ -1613,7 +1613,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
LLXmlTreeNode* node = root->getChildByName( "skeleton" );
|
||||
if( !node )
|
||||
{
|
||||
llwarns << "avatar file: missing <skeleton>" << llendl;
|
||||
LL_WARNS() << "avatar file: missing <skeleton>" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1628,11 +1628,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
{
|
||||
if (child->getChildByName("param_morph"))
|
||||
{
|
||||
llwarns << "Can't specify morph param in skeleton definition." << llendl;
|
||||
LL_WARNS() << "Can't specify morph param in skeleton definition." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Unknown param type." << llendl;
|
||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1657,7 +1657,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!child->getFastAttributeString(name_string, info->mName))
|
||||
{
|
||||
llwarns << "No name supplied for attachment point." << llendl;
|
||||
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1665,7 +1665,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
|
||||
if (!child->getFastAttributeString(joint_string, info->mJointName))
|
||||
{
|
||||
llwarns << "No bone declared in attachment point " << info->mName << llendl;
|
||||
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1691,7 +1691,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
|
||||
if (!child->getFastAttributeS32(id_string, info->mAttachmentID))
|
||||
{
|
||||
llwarns << "No id supplied for attachment point " << info->mName << llendl;
|
||||
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1726,7 +1726,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
static LLStdStringHandle type_string = LLXmlTree::addAttributeString("type");
|
||||
if( !node->getFastAttributeString( type_string, info->mType ) )
|
||||
{
|
||||
llwarns << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << llendl;
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
}
|
||||
|
|
@ -1734,7 +1734,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
|
||||
if (!node->getFastAttributeS32( lod_string, info->mLOD ))
|
||||
{
|
||||
llwarns << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << llendl;
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
}
|
||||
|
|
@ -1742,7 +1742,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
|
||||
if( !node->getFastAttributeString( file_name_string, info->mMeshFileName ) )
|
||||
{
|
||||
llwarns << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << llendl;
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
}
|
||||
|
|
@ -1773,11 +1773,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
{
|
||||
if (child->getChildByName("param_skeleton"))
|
||||
{
|
||||
llwarns << "Can't specify skeleton param in a mesh definition." << llendl;
|
||||
LL_WARNS() << "Can't specify skeleton param in a mesh definition." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Unknown param type." << llendl;
|
||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1818,14 +1818,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
|||
{
|
||||
if (mTexSkinColorInfo)
|
||||
{
|
||||
llwarns << "avatar file: multiple instances of skin_color" << llendl;
|
||||
LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
mTexSkinColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexSkinColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
deleteAndClear(mTexSkinColorInfo);
|
||||
llwarns << "avatar file: mTexSkinColor->parseXml() failed" << llendl;
|
||||
delete_and_clear(mTexSkinColorInfo);
|
||||
LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1833,14 +1833,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
|||
{
|
||||
if (mTexHairColorInfo)
|
||||
{
|
||||
llwarns << "avatar file: multiple instances of hair_color" << llendl;
|
||||
LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
mTexHairColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexHairColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
deleteAndClear(mTexHairColorInfo);
|
||||
llwarns << "avatar file: mTexHairColor->parseXml() failed" << llendl;
|
||||
delete_and_clear(mTexHairColorInfo);
|
||||
LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1848,13 +1848,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
|||
{
|
||||
if (mTexEyeColorInfo)
|
||||
{
|
||||
llwarns << "avatar file: multiple instances of eye_color" << llendl;
|
||||
LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
mTexEyeColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexEyeColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
llwarns << "avatar file: mTexEyeColor->parseXml() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1880,7 +1880,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root
|
|||
else
|
||||
{
|
||||
delete layer_info;
|
||||
llwarns << "avatar file: layer_set->parseXml() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1909,7 +1909,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* roo
|
|||
else
|
||||
{
|
||||
delete driver_info;
|
||||
llwarns << "avatar file: driver_param->parseXml() failed" << llendl;
|
||||
LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1938,7 +1938,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("morph_name");
|
||||
if (!grand_child->getFastAttributeString(name_string, info->mName))
|
||||
{
|
||||
llwarns << "No name supplied for morph mask." << llendl;
|
||||
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1946,7 +1946,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
|||
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
|
||||
if (!grand_child->getFastAttributeString(region_string, info->mRegion))
|
||||
{
|
||||
llwarns << "No region supplied for morph mask." << llendl;
|
||||
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1954,7 +1954,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
|||
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
|
||||
if (!grand_child->getFastAttributeString(layer_string, info->mLayer))
|
||||
{
|
||||
llwarns << "No layer supplied for morph mask." << llendl;
|
||||
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
|
|||
/*virtual*/
|
||||
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
|
||||
{
|
||||
llerrs << "Cannot call render() on LLAvatarJointCollisionVolume" << llendl;
|
||||
LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
// Header Files
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "linden_common.h"
|
||||
#include "imageids.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llrender.h"
|
||||
|
||||
|
|
@ -89,7 +88,7 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
|||
mJoint = joint;
|
||||
if ( !mJoint )
|
||||
{
|
||||
llinfos << "Can't find joint" << llendl;
|
||||
LL_INFOS() << "Can't find joint" << LL_ENDL;
|
||||
}
|
||||
|
||||
// compute the inverse root skin matrix
|
||||
|
|
@ -117,7 +116,6 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
BOOL LLAvatarJointMesh::sPipelineRender = FALSE;
|
||||
EAvatarRenderPass LLAvatarJointMesh::sRenderPass = AVATAR_RENDER_PASS_SINGLE;
|
||||
U32 LLAvatarJointMesh::sClothingMaskImageName = 0;
|
||||
LLColor4 LLAvatarJointMesh::sClothingInnerColor;
|
||||
|
||||
|
|
@ -306,7 +304,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
|||
U32 jn;
|
||||
for (jn = 0; jn < numJointNames; jn++)
|
||||
{
|
||||
//llinfos << "Setting up joint " << jointNames[jn] << llendl;
|
||||
//LL_INFOS() << "Setting up joint " << jointNames[jn] << LL_ENDL;
|
||||
LLAvatarJoint* joint = (LLAvatarJoint*)(getRoot()->findJoint(jointNames[jn]) );
|
||||
mSkinJoints[jn].setupSkinJoint( joint );
|
||||
}
|
||||
|
|
@ -318,7 +316,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
|||
setupJoint((LLAvatarJoint*)getRoot());
|
||||
}
|
||||
|
||||
// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
|
||||
LL_DEBUGS() << "joint render entries: " << mMesh->mJointRenderData.size() << LL_ENDL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -326,10 +324,11 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
||||
{
|
||||
// llinfos << "Mesh: " << getName() << llendl;
|
||||
LL_DEBUGS() << "Mesh: " << getName() << LL_ENDL;
|
||||
|
||||
// S32 joint_count = 0;
|
||||
S32 joint_count = 0;
|
||||
U32 sj;
|
||||
|
||||
for (sj=0; sj<mNumSkinJoints; sj++)
|
||||
{
|
||||
LLSkinJoint &js = mSkinJoints[sj];
|
||||
|
|
@ -342,23 +341,20 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
|||
// we've found a skinjoint for this joint..
|
||||
|
||||
// is the last joint in the array our parent?
|
||||
if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
||||
if(mMesh->mJointRenderData.size() && mMesh->mJointRenderData[mMesh->mJointRenderData.size() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
||||
{
|
||||
// ...then just add ourselves
|
||||
LLAvatarJoint* jointp = js.mJoint;
|
||||
mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
||||
// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
|
||||
// joint_count++;
|
||||
mMesh->mJointRenderData.push_back(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
||||
LL_DEBUGS() << "joint " << joint_count++ << js.mJoint->getName() << LL_ENDL;
|
||||
}
|
||||
// otherwise add our parent and ourselves
|
||||
else
|
||||
{
|
||||
mMesh->mJointRenderData.put(new LLJointRenderData(¤t_joint->getParent()->getWorldMatrix(), NULL));
|
||||
// llinfos << "joint " << joint_count << current_joint->getParent()->getName() << llendl;
|
||||
// joint_count++;
|
||||
mMesh->mJointRenderData.put(new LLJointRenderData(¤t_joint->getWorldMatrix(), &js));
|
||||
// llinfos << "joint " << joint_count << current_joint->getName() << llendl;
|
||||
// joint_count++;
|
||||
mMesh->mJointRenderData.push_back(new LLJointRenderData(¤t_joint->getParent()->getWorldMatrix(), NULL));
|
||||
LL_DEBUGS() << "joint " << joint_count++ << current_joint->getParent()->getName() << LL_ENDL;
|
||||
mMesh->mJointRenderData.push_back(new LLJointRenderData(¤t_joint->getWorldMatrix(), &js));
|
||||
LL_DEBUGS() << "joint " << joint_count++ << current_joint->getName() << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ public:
|
|||
static BOOL sPipelineRender;
|
||||
//RN: this is here for testing purposes
|
||||
static U32 sClothingMaskImageName;
|
||||
static EAvatarRenderPass sRenderPass;
|
||||
static LLColor4 sClothingInnerColor;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
|||
}
|
||||
else
|
||||
{
|
||||
llerrs << "<driven> Unable to resolve driven parameter: " << driven_id << llendl;
|
||||
LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -139,9 +139,9 @@ void LLDriverParamInfo::toStream(std::ostream &out)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "could not get parameter " << driven.mDrivenID << " from avatar "
|
||||
LL_WARNS() << "could not get parameter " << driven.mDrivenID << " from avatar "
|
||||
<< mDriverParam->getAvatarAppearance()
|
||||
<< " for driver parameter " << getID() << llendl;
|
||||
<< " for driver parameter " << getID() << LL_ENDL;
|
||||
}
|
||||
out << std::endl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "llviewervisualparam.h"
|
||||
#include "llwearabletype.h"
|
||||
#include <deque>
|
||||
|
||||
class LLAvatarAppearance;
|
||||
class LLDriverParam;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) :
|
|||
LLTexLayer* original_layer = lto.getTexLayer(index);
|
||||
if (!original_layer)
|
||||
{
|
||||
llerrs << "could not clone Local Texture Object: unable to extract texlayer!" << llendl;
|
||||
LL_ERRS() << "could not clone Local Texture Object: unable to extract texlayer!" << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,8 +161,8 @@ void LLPolyMeshSharedData::freeMeshData()
|
|||
// mVertFaceMap.deleteAllData();
|
||||
}
|
||||
|
||||
// compate_int is used by the qsort function to sort the index array
|
||||
int compare_int(const void *a, const void *b);
|
||||
// compare_int is used by the qsort function to sort the index array
|
||||
S32 compare_int(const void *a, const void *b);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// genIndices()
|
||||
|
|
@ -277,13 +277,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
//-------------------------------------------------------------------------
|
||||
if(fileName.empty())
|
||||
{
|
||||
llerrs << "Filename is Empty!" << llendl;
|
||||
LL_ERRS() << "Filename is Empty!" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
|
||||
if (!fp)
|
||||
{
|
||||
llerrs << "can't open: " << fileName << llendl;
|
||||
LL_ERRS() << "can't open: " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
char header[128]; /*Flawfinder: ignore*/
|
||||
if (fread(header, sizeof(char), 128, fp) != 128)
|
||||
{
|
||||
llwarns << "Short read" << llendl;
|
||||
LL_WARNS() << "Short read" << LL_ENDL;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
@ -302,7 +302,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
BOOL status = FALSE;
|
||||
if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
|
||||
{
|
||||
lldebugs << "Loading " << fileName << llendl;
|
||||
LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// File Header (seek past it)
|
||||
|
|
@ -316,7 +316,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
size_t numRead = fread(&hasWeights, sizeof(U8), 1, fp);
|
||||
if (numRead != 1)
|
||||
{
|
||||
llerrs << "can't read HasWeights flag from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if (!isLOD())
|
||||
|
|
@ -331,7 +331,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
numRead = fread(&hasDetailTexCoords, sizeof(U8), 1, fp);
|
||||
if (numRead != 1)
|
||||
{
|
||||
llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(position.mV, sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << "can't read Position from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read Position from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
setPosition( position );
|
||||
|
|
@ -356,7 +356,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(rotationAngles.mV, sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << "can't read RotationAngles from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
|
||||
if (numRead != 1)
|
||||
{
|
||||
llerrs << "can't read RotationOrder from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(scale.mV, sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << "can't read Scale from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
setScale( scale );
|
||||
|
|
@ -405,7 +405,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(&numVertices, sizeof(U16), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
llerrs << "can't read NumVertices from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(&mBaseCoords[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << "can't read Coordinates from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -434,7 +434,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(&mBaseNormals[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << " can't read Normals from " << fileName << llendl;
|
||||
LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -448,7 +448,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(&mBaseBinormals[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << " can't read Binormals from " << fileName << llendl;
|
||||
LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -460,7 +460,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(mTexCoords, sizeof(float), 2*numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
llerrs << "can't read TexCoords from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -473,7 +473,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(mDetailTexCoords, sizeof(float), 2*numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
llerrs << "can't read DetailTexCoords from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -487,7 +487,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(mWeights, sizeof(float), numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
llerrs << "can't read Weights from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -501,7 +501,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(&numFaces, sizeof(U16), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
llerrs << "can't read NumFaces from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
allocateFaceData( numFaces );
|
||||
|
|
@ -519,7 +519,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(face, sizeof(U16), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << "can't read Face[" << i << "] from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if (mReferenceData)
|
||||
|
|
@ -547,10 +547,10 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
// S32 j;
|
||||
// for(j = 0; j < 3; j++)
|
||||
// {
|
||||
// LLDynamicArray<S32> *face_list = mVertFaceMap.getIfThere(face[j]);
|
||||
// std::vector<S32> *face_list = mVertFaceMap.getIfThere(face[j]);
|
||||
// if (!face_list)
|
||||
// {
|
||||
// face_list = new LLDynamicArray<S32>;
|
||||
// face_list = new std::vector<S32>;
|
||||
// mVertFaceMap.addData(face[j], face_list);
|
||||
// }
|
||||
// face_list->put(i);
|
||||
|
|
@ -559,10 +559,10 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
numTris++;
|
||||
}
|
||||
|
||||
lldebugs << "verts: " << numVertices
|
||||
LL_DEBUGS() << "verts: " << numVertices
|
||||
<< ", faces: " << numFaces
|
||||
<< ", tris: " << numTris
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// NumSkinJoints
|
||||
|
|
@ -576,7 +576,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
llerrs << "can't read NumSkinJoints from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
allocateJointNames( numSkinJoints );
|
||||
|
|
@ -592,7 +592,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
jointName[sizeof(jointName)-1] = '\0'; // ensure nul-termination
|
||||
if (numRead != 1)
|
||||
{
|
||||
llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl;
|
||||
LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -687,12 +687,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
S32 remapDst;
|
||||
if (fread(&remapSrc, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
llerrs << "can't read source vertex in vertex remap data" << llendl;
|
||||
LL_ERRS() << "can't read source vertex in vertex remap data" << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
if (fread(&remapDst, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
llerrs << "can't read destination vertex in vertex remap data" << llendl;
|
||||
LL_ERRS() << "can't read destination vertex in vertex remap data" << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
llendianswizzle(&remapSrc, sizeof(S32), 1);
|
||||
|
|
@ -707,7 +707,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
}
|
||||
else
|
||||
{
|
||||
llerrs << "invalid mesh file header: " << fileName << llendl;
|
||||
LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL;
|
||||
status = FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -808,15 +808,8 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_
|
|||
//-----------------------------------------------------------------------------
|
||||
LLPolyMesh::~LLPolyMesh()
|
||||
{
|
||||
S32 i;
|
||||
for (i = 0; i < mJointRenderData.count(); i++)
|
||||
{
|
||||
delete mJointRenderData[i];
|
||||
mJointRenderData[i] = NULL;
|
||||
}
|
||||
|
||||
ll_aligned_free_16(mVertexData);
|
||||
|
||||
delete_and_clear(mJointRenderData);
|
||||
ll_aligned_free_16(mVertexData);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -831,7 +824,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
|
|||
LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)NULL);
|
||||
if (meshSharedData)
|
||||
{
|
||||
// llinfos << "Polymesh " << name << " found in global mesh table." << llendl;
|
||||
// LL_INFOS() << "Polymesh " << name << " found in global mesh table." << LL_ENDL;
|
||||
LLPolyMesh *poly_mesh = new LLPolyMesh(meshSharedData, reference_mesh);
|
||||
return poly_mesh;
|
||||
}
|
||||
|
|
@ -855,7 +848,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
|
|||
|
||||
LLPolyMesh *poly_mesh = new LLPolyMesh(mesh_data, reference_mesh);
|
||||
|
||||
// llinfos << "Polymesh " << name << " added to global mesh table." << llendl;
|
||||
// LL_INFOS() << "Polymesh " << name << " added to global mesh table." << LL_ENDL;
|
||||
sGlobalSharedMeshList[name] = poly_mesh->mSharedData;
|
||||
|
||||
return poly_mesh;
|
||||
|
|
@ -889,10 +882,10 @@ void LLPolyMesh::dumpDiagInfo()
|
|||
|
||||
std::string buf;
|
||||
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
llinfos << " Global PolyMesh Table (DEBUG only)" << llendl;
|
||||
llinfos << " Verts Faces Mem(KB) Name" << llendl;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
LL_INFOS() << " Global PolyMesh Table (DEBUG only)" << LL_ENDL;
|
||||
LL_INFOS() << " Verts Faces Mem(KB) Name" << LL_ENDL;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
|
||||
// print each loaded mesh, and it's memory usage
|
||||
for(LLPolyMeshSharedDataTable::iterator iter = sGlobalSharedMeshList.begin();
|
||||
|
|
@ -906,17 +899,17 @@ void LLPolyMesh::dumpDiagInfo()
|
|||
U32 num_kb = mesh->getNumKB();
|
||||
|
||||
buf = llformat("%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name.c_str());
|
||||
llinfos << buf << llendl;
|
||||
LL_INFOS() << buf << LL_ENDL;
|
||||
|
||||
total_verts += num_verts;
|
||||
total_faces += num_faces;
|
||||
total_kb += num_kb;
|
||||
}
|
||||
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
buf = llformat("%8d %8d %8d TOTAL", total_verts, total_faces, total_kb );
|
||||
llinfos << buf << llendl;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
LL_INFOS() << buf << LL_ENDL;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
#include "llquaternion.h"
|
||||
#include "llpolymorph.h"
|
||||
#include "lljoint.h"
|
||||
//#include "lldarray.h"
|
||||
|
||||
class LLSkinJoint;
|
||||
class LLAvatarAppearance;
|
||||
|
|
@ -322,7 +321,7 @@ public:
|
|||
void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; }
|
||||
LLAvatarAppearance* getAvatar() { return mAvatarp; }
|
||||
|
||||
LLDynamicArray<LLJointRenderData*> mJointRenderData;
|
||||
std::vector<LLJointRenderData*> mJointRenderData;
|
||||
|
||||
U32 mFaceVertexOffset;
|
||||
U32 mFaceVertexCount;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "llxmltree.h"
|
||||
#include "llendianswizzle.h"
|
||||
#include "llpolymesh.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
//#include "../tools/imdebug/imdebug.h"
|
||||
|
||||
|
|
@ -112,7 +113,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
llendianswizzle(&numVertices, sizeof(S32), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
llwarns << "Can't read number of morph target vertices" << llendl;
|
||||
LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -149,13 +150,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
llwarns << "Can't read morph target vertex number" << llendl;
|
||||
LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mVertexIndices[v] > 10000)
|
||||
{
|
||||
llerrs << "Bad morph index: " << mVertexIndices[v] << llendl;
|
||||
LL_ERRS() << "Bad morph index: " << mVertexIndices[v] << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -163,7 +164,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
llendianswizzle(&mCoords[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llwarns << "Can't read morph target vertex coordinates" << llendl;
|
||||
LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +184,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
llendianswizzle(&mNormals[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llwarns << "Can't read morph target normal" << llendl;
|
||||
LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -191,7 +192,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
llendianswizzle(&mBinormals[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llwarns << "Can't read morph target binormal" << llendl;
|
||||
LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +201,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
|
||||
if (numRead != 2)
|
||||
{
|
||||
llwarns << "Can't read morph target uv" << llendl;
|
||||
LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -268,7 +269,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if( !node->getFastAttributeString( name_string, mMorphName ) )
|
||||
{
|
||||
llwarns << "Avatar file: <param> is missing name attribute" << llendl;
|
||||
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
||||
return FALSE; // Continue, ignoring this tag
|
||||
}
|
||||
|
||||
|
|
@ -279,8 +280,8 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
|||
|
||||
if (NULL == paramNode)
|
||||
{
|
||||
llwarns << "Failed to getChildByName(\"param_morph\")"
|
||||
<< llendl;
|
||||
LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -376,7 +377,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
|||
}
|
||||
if (!mMorphData)
|
||||
{
|
||||
llwarns << "No morph target named " << morph_param_name << " found in mesh." << llendl;
|
||||
LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
|
||||
return FALSE; // Continue, ignoring this tag
|
||||
}
|
||||
return TRUE;
|
||||
|
|
@ -524,7 +525,7 @@ F32 LLPolyMorphTarget::getMaxDistortion()
|
|||
//-----------------------------------------------------------------------------
|
||||
// apply()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_APPLY_MORPH_TARGET("Apply Morph");
|
||||
static LLTrace::BlockTimerStatHandle FTM_APPLY_MORPH_TARGET("Apply Morph");
|
||||
|
||||
void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||
{
|
||||
|
|
@ -533,7 +534,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
|||
return;
|
||||
}
|
||||
|
||||
LLFastTimer t(FTM_APPLY_MORPH_TARGET);
|
||||
LL_RECORD_BLOCK_TIME(FTM_APPLY_MORPH_TARGET);
|
||||
|
||||
mLastSex = avatar_sex;
|
||||
|
||||
|
|
@ -619,9 +620,9 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
|||
tangent.setCross3(scaled_binormals[vert_index_mesh], norm);
|
||||
LLVector4a& normalized_binormal = binormals[vert_index_mesh];
|
||||
|
||||
normalized_binormal.setCross3(norm, tangent);
|
||||
normalized_binormal.setCross3(norm, tangent);
|
||||
normalized_binormal.normalize3fast();
|
||||
|
||||
|
||||
tex_coords[vert_index_mesh] += mMorphData->mTexCoords[vert_index_morph] * delta_weight * maskWeight;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,19 +28,12 @@
|
|||
// Header Files
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "llpreprocessor.h"
|
||||
#include "llerrorlegacy.h"
|
||||
//#include "llcommon.h"
|
||||
//#include "llmemory.h"
|
||||
#include "llerror.h"
|
||||
#include "llavatarappearance.h"
|
||||
#include "llavatarjoint.h"
|
||||
#include "llpolymorph.h"
|
||||
//#include "llviewercontrol.h"
|
||||
//#include "llxmltree.h"
|
||||
//#include "llvoavatar.h"
|
||||
#include "llwearable.h"
|
||||
//#include "lldir.h"
|
||||
//#include "llvolume.h"
|
||||
//#include "llendianswizzle.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
#include "llpolyskeletaldistortion.h"
|
||||
|
||||
|
|
@ -62,8 +55,8 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
|||
|
||||
if (NULL == skeletalParam)
|
||||
{
|
||||
llwarns << "Failed to getChildByName(\"param_skeleton\")"
|
||||
<< llendl;
|
||||
LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")"
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -79,14 +72,14 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!bone->getFastAttributeString(name_string, name))
|
||||
{
|
||||
llwarns << "No bone name specified for skeletal param." << llendl;
|
||||
LL_WARNS() << "No bone name specified for skeletal param." << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
|
||||
if (!bone->getFastAttributeVector3(scale_string, scale))
|
||||
{
|
||||
llwarns << "No scale specified for bone " << name << "." << llendl;
|
||||
LL_WARNS() << "No scale specified for bone " << name << "." << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +93,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Unrecognized element " << bone->getName() << " in skeletal distortion" << llendl;
|
||||
LL_WARNS() << "Unrecognized element " << bone->getName() << " in skeletal distortion" << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -139,13 +132,13 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
|||
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
|
||||
if (!joint)
|
||||
{
|
||||
llwarns << "Joint " << bone_info->mBoneName << " not found." << llendl;
|
||||
LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mJointScales.find(joint) != mJointScales.end())
|
||||
{
|
||||
llwarns << "Scale deformation already supplied for joint " << joint->getName() << "." << llendl;
|
||||
LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
}
|
||||
|
||||
// store it
|
||||
|
|
@ -168,7 +161,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
|||
{
|
||||
if (mJointOffsets.find(joint) != mJointOffsets.end())
|
||||
{
|
||||
llwarns << "Offset deformation already supplied for joint " << joint->getName() << "." << llendl;
|
||||
LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
}
|
||||
mJointOffsets[joint] = bone_info->mPositionDeformation;
|
||||
}
|
||||
|
|
@ -186,11 +179,11 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
|||
//-----------------------------------------------------------------------------
|
||||
// apply()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion");
|
||||
static LLTrace::BlockTimerStatHandle FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion");
|
||||
|
||||
void LLPolySkeletalDistortion::apply( ESex avatar_sex )
|
||||
{
|
||||
LLFastTimer t(FTM_POLYSKELETAL_DISTORTION_APPLY);
|
||||
LL_RECORD_BLOCK_TIME(FTM_POLYSKELETAL_DISTORTION_APPLY);
|
||||
|
||||
F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight();
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
//#include "llpolymorph.h"
|
||||
#include "lljoint.h"
|
||||
#include "llviewervisualparam.h"
|
||||
//#include "lldarray.h"
|
||||
|
||||
//class LLSkinJoint;
|
||||
class LLAvatarAppearance;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!node->getFastAttributeString(name_string, mName))
|
||||
{
|
||||
llwarns << "<global_color> element is missing name attribute." << llendl;
|
||||
LL_WARNS() << "<global_color> element is missing name attribute." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
// <param> sub-element
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "llavatarappearance.h"
|
||||
#include "llcrc.h"
|
||||
#include "imageids.h"
|
||||
#include "llimagej2c.h"
|
||||
#include "llimagetga.h"
|
||||
#include "lldir.h"
|
||||
|
|
@ -38,11 +37,13 @@
|
|||
#include "llvfs.h"
|
||||
#include "lltexlayerparams.h"
|
||||
#include "lltexturemanagerbridge.h"
|
||||
#include "lllocaltextureobject.h"
|
||||
#include "../llui/llui.h"
|
||||
#include "llwearable.h"
|
||||
#include "llwearabledata.h"
|
||||
#include "llvertexbuffer.h"
|
||||
#include "llviewervisualparam.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
//#include "../tools/imdebug/imdebug.h"
|
||||
|
||||
|
|
@ -210,7 +211,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle body_region_string = LLXmlTree::addAttributeString("body_region");
|
||||
if( !node->getFastAttributeString( body_region_string, mBodyRegion ) )
|
||||
{
|
||||
llwarns << "<layer_set> is missing body_region attribute" << llendl;
|
||||
LL_WARNS() << "<layer_set> is missing body_region attribute" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -521,10 +522,10 @@ const LLTexLayerSetBuffer* LLTexLayerSet::getComposite() const
|
|||
return mComposite;
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_GATHER_MORPH_MASK_ALPHA("gatherMorphMaskAlpha");
|
||||
static LLTrace::BlockTimerStatHandle FTM_GATHER_MORPH_MASK_ALPHA("gatherMorphMaskAlpha");
|
||||
void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height)
|
||||
{
|
||||
LLFastTimer t(FTM_GATHER_MORPH_MASK_ALPHA);
|
||||
LL_RECORD_BLOCK_TIME(FTM_GATHER_MORPH_MASK_ALPHA);
|
||||
memset(data, 255, width * height);
|
||||
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
|
|
@ -537,10 +538,10 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S
|
|||
renderAlphaMaskTextures(origin_x, origin_y, width, height, true);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_MASK_TEXTURES("renderAlphaMaskTextures");
|
||||
static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_MASK_TEXTURES("renderAlphaMaskTextures");
|
||||
void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, bool forceClear)
|
||||
{
|
||||
LLFastTimer t(FTM_RENDER_ALPHA_MASK_TEXTURES);
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK_TEXTURES);
|
||||
const LLTexLayerSetInfo *info = getInfo();
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
|
@ -740,13 +741,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
|||
}
|
||||
if (mLocalTexture == TEX_NUM_INDICES)
|
||||
{
|
||||
llwarns << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << llendl;
|
||||
LL_WARNS() << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "<texture> element is missing a required attribute. " << mName << llendl;
|
||||
LL_WARNS() << "<texture> element is missing a required attribute. " << mName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -809,7 +810,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
|||
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
|
||||
if (!param_color->setInfo(color_info, TRUE))
|
||||
{
|
||||
llwarns << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << llendl;
|
||||
LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||
delete param_color;
|
||||
success = FALSE;
|
||||
}
|
||||
|
|
@ -823,7 +824,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
|||
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
|
||||
if (!param_alpha->setInfo(alpha_info, TRUE))
|
||||
{
|
||||
llwarns << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << llendl;
|
||||
LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||
delete param_alpha;
|
||||
success = FALSE;
|
||||
}
|
||||
|
|
@ -856,7 +857,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
|||
// Not a critical warning, but could be useful for debugging later issues. -Nyx
|
||||
if (mInfo != NULL)
|
||||
{
|
||||
llwarns << "mInfo != NULL" << llendl;
|
||||
LL_WARNS() << "mInfo != NULL" << LL_ENDL;
|
||||
}
|
||||
mInfo = info;
|
||||
//mID = info->mID; // No ID
|
||||
|
|
@ -1212,7 +1213,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
|
|||
}
|
||||
else
|
||||
{
|
||||
llinfos << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << llendl;
|
||||
LL_INFOS() << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << LL_ENDL;
|
||||
}
|
||||
// if( mTexLayerSet->getAvatarAppearance()->getLocalTextureGL((ETextureIndex)getInfo()->mLocalTexture, &image_gl ) )
|
||||
{
|
||||
|
|
@ -1300,7 +1301,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
|
|||
|
||||
if( !success )
|
||||
{
|
||||
llinfos << "LLTexLayer::render() partial: " << getInfo()->mName << llendl;
|
||||
LL_INFOS() << "LLTexLayer::render() partial: " << getInfo()->mName << LL_ENDL;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
|
@ -1432,15 +1433,15 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
|||
addAlphaMask(data, originX, originY, width, height);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RENDER_MORPH_MASKS("renderMorphMasks");
|
||||
static LLTrace::BlockTimerStatHandle FTM_RENDER_MORPH_MASKS("renderMorphMasks");
|
||||
void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, bool force_render)
|
||||
{
|
||||
if (!force_render && !hasMorph())
|
||||
{
|
||||
lldebugs << "skipping renderMorphMasks for " << getUUID() << llendl;
|
||||
LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
LLFastTimer t(FTM_RENDER_MORPH_MASKS);
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_MORPH_MASKS);
|
||||
BOOL success = TRUE;
|
||||
|
||||
llassert( !mParamAlphaList.empty() );
|
||||
|
|
@ -1478,7 +1479,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
success &= param->render( x, y, width, height );
|
||||
if (!success && !force_render)
|
||||
{
|
||||
lldebugs << "Failed to render param " << param->getID() << " ; skipping morph mask." << llendl;
|
||||
LL_DEBUGS() << "Failed to render param " << param->getID() << " ; skipping morph mask." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1520,8 +1521,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Skipping rendering of " << getInfo()->mStaticImageFileName
|
||||
<< "; expected 1 or 4 components." << llendl;
|
||||
LL_WARNS() << "Skipping rendering of " << getInfo()->mStaticImageFileName
|
||||
<< "; expected 1 or 4 components." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1583,10 +1584,10 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
}
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_ADD_ALPHA_MASK("addAlphaMask");
|
||||
static LLTrace::BlockTimerStatHandle FTM_ADD_ALPHA_MASK("addAlphaMask");
|
||||
void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height)
|
||||
{
|
||||
LLFastTimer t(FTM_ADD_ALPHA_MASK);
|
||||
LL_RECORD_BLOCK_TIME(FTM_ADD_ALPHA_MASK);
|
||||
S32 size = width * height;
|
||||
const U8* alphaData = getAlphaData();
|
||||
if (!alphaData && hasAlphaParams())
|
||||
|
|
@ -1900,18 +1901,18 @@ LLTexLayerStaticImageList::~LLTexLayerStaticImageList()
|
|||
|
||||
void LLTexLayerStaticImageList::dumpByteCount() const
|
||||
{
|
||||
llinfos << "Avatar Static Textures " <<
|
||||
LL_INFOS() << "Avatar Static Textures " <<
|
||||
"KB GL:" << (mGLBytes / 1024) <<
|
||||
"KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
|
||||
"KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLTexLayerStaticImageList::deleteCachedImages()
|
||||
{
|
||||
if( mGLBytes || mTGABytes )
|
||||
{
|
||||
//llinfos << "Clearing Static Textures " <<
|
||||
//LL_INFOS() << "Clearing Static Textures " <<
|
||||
// "KB GL:" << (mGLBytes / 1024) <<
|
||||
// "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
|
||||
// "KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
|
||||
|
||||
//mStaticImageLists uses LLPointers, clear() will cause deletion
|
||||
|
||||
|
|
@ -1929,10 +1930,10 @@ void LLTexLayerStaticImageList::deleteCachedImages()
|
|||
|
||||
// Returns an LLImageTGA that contains the encoded data from a tga file named file_name.
|
||||
// Caches the result to speed identical subsequent requests.
|
||||
static LLFastTimer::DeclareTimer FTM_LOAD_STATIC_TGA("getImageTGA");
|
||||
static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TGA("getImageTGA");
|
||||
LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name)
|
||||
{
|
||||
LLFastTimer t(FTM_LOAD_STATIC_TGA);
|
||||
LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TGA);
|
||||
const char *namekey = mImageNames.addString(file_name);
|
||||
image_tga_map_t::const_iterator iter = mStaticImageListTGA.find(namekey);
|
||||
if( iter != mStaticImageListTGA.end() )
|
||||
|
|
@ -1959,10 +1960,10 @@ 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.
|
||||
// Caches the result to speed identical subsequent requests.
|
||||
static LLFastTimer::DeclareTimer FTM_LOAD_STATIC_TEXTURE("getTexture");
|
||||
static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TEXTURE("getTexture");
|
||||
LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, BOOL is_mask)
|
||||
{
|
||||
LLFastTimer t(FTM_LOAD_STATIC_TEXTURE);
|
||||
LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TEXTURE);
|
||||
LLPointer<LLGLTexture> tex;
|
||||
const char *namekey = mImageNames.addString(file_name);
|
||||
|
||||
|
|
@ -2009,10 +2010,10 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
|||
|
||||
// Reads a .tga file, decodes it, and puts the decoded data in image_raw.
|
||||
// Returns TRUE if successful.
|
||||
static LLFastTimer::DeclareTimer FTM_LOAD_IMAGE_RAW("loadImageRaw");
|
||||
static LLTrace::BlockTimerStatHandle FTM_LOAD_IMAGE_RAW("loadImageRaw");
|
||||
BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw)
|
||||
{
|
||||
LLFastTimer t(FTM_LOAD_IMAGE_RAW);
|
||||
LL_RECORD_BLOCK_TIME(FTM_LOAD_IMAGE_RAW);
|
||||
BOOL success = FALSE;
|
||||
std::string path;
|
||||
path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "lltexturemanagerbridge.h"
|
||||
#include "../llui/llui.h"
|
||||
#include "llwearable.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLTexLayerParam
|
||||
|
|
@ -49,7 +50,7 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
|
|||
}
|
||||
else
|
||||
{
|
||||
llerrs << "LLTexLayerParam constructor passed with NULL reference for layer!" << llendl;
|
||||
LL_ERRS() << "LLTexLayerParam constructor passed with NULL reference for layer!" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +87,7 @@ void LLTexLayerParamAlpha::dumpCacheByteCount()
|
|||
{
|
||||
S32 gl_bytes = 0;
|
||||
getCacheByteCount( &gl_bytes);
|
||||
llinfos << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << llendl;
|
||||
LL_INFOS() << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << LL_ENDL;
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
@ -238,10 +239,10 @@ BOOL LLTexLayerParamAlpha::getSkip() const
|
|||
}
|
||||
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_TEX_LAYER_PARAM_ALPHA("alpha render");
|
||||
static LLTrace::BlockTimerStatHandle FTM_TEX_LAYER_PARAM_ALPHA("alpha render");
|
||||
BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
LLFastTimer t(FTM_TEX_LAYER_PARAM_ALPHA);
|
||||
LL_RECORD_BLOCK_TIME(FTM_TEX_LAYER_PARAM_ALPHA);
|
||||
BOOL success = TRUE;
|
||||
|
||||
if (!mTexLayer)
|
||||
|
|
@ -278,7 +279,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
|
||||
if (mStaticImageTGA.isNull())
|
||||
{
|
||||
llwarns << "Unable to load static file: " << info->mStaticImageFileName << llendl;
|
||||
LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL;
|
||||
mStaticImageInvalid = TRUE; // don't try again.
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -309,7 +310,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
mStaticImageRaw = new LLImageRaw;
|
||||
mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
|
||||
mNeedsCreateTexture = TRUE;
|
||||
lldebugs << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << llendl;
|
||||
LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
|
||||
}
|
||||
|
||||
if (mCachedProcessedTexture)
|
||||
|
|
@ -380,7 +381,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
|||
}
|
||||
// else
|
||||
// {
|
||||
// llwarns << "<param_alpha> element is missing tga_file attribute." << llendl;
|
||||
// LL_WARNS() << "<param_alpha> element is missing tga_file attribute." << LL_ENDL;
|
||||
// }
|
||||
|
||||
static LLStdStringHandle multiply_blend_string = LLXmlTree::addAttributeString("multiply_blend");
|
||||
|
|
@ -481,7 +482,7 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
|
|||
}
|
||||
}
|
||||
|
||||
// llinfos << "param " << mName << " = " << new_weight << llendl;
|
||||
// LL_INFOS() << "param " << mName << " = " << new_weight << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -556,13 +557,13 @@ BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
|||
}
|
||||
if (!mNumColors)
|
||||
{
|
||||
llwarns << "<param_color> is missing <value> sub-elements" << llendl;
|
||||
LL_WARNS() << "<param_color> is missing <value> sub-elements" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
|
||||
{
|
||||
llwarns << "<param_color> with operation\"blend\" must have exactly one <value>" << llendl;
|
||||
LL_WARNS() << "<param_color> with operation\"blend\" must have exactly one <value>" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "llvisualparam.h"
|
||||
#include "llavatarappearancedefines.h"
|
||||
#include "llwearable.h"
|
||||
#include "boost/bind.hpp"
|
||||
|
||||
using namespace LLAvatarAppearanceDefines;
|
||||
|
||||
|
|
@ -149,7 +150,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
|
|||
{
|
||||
if( !param->linkDrivenParams(boost::bind(param_function,avatarp,_1 ), true))
|
||||
{
|
||||
llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
|
||||
LL_WARNS() << "could not link driven params for wearable " << getName() << " id: " << param->getID() << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -173,7 +174,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
|
|||
}
|
||||
else
|
||||
{
|
||||
llerrs << "could not find layerset for LTO in wearable!" << llendl;
|
||||
LL_ERRS() << "could not find layerset for LTO in wearable!" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -207,7 +208,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// read header and version
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Failed to read wearable asset input stream." << llendl;
|
||||
LL_WARNS() << "Failed to read wearable asset input stream." << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
if ( 1 != sscanf( /* Flawfinder: ignore */
|
||||
|
|
@ -225,15 +226,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// these wearables get re-saved with version definition 22.
|
||||
if( mDefinitionVersion > LLWearable::sCurrentDefinitionVersion && mDefinitionVersion != 24 )
|
||||
{
|
||||
llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
|
||||
LL_WARNS() << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
|
||||
// name may be empty
|
||||
if (!input_stream.good())
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading name" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading name" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
input_stream.getline(buffer, PARSE_BUFFER_SIZE);
|
||||
|
|
@ -242,8 +243,8 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// description may be empty
|
||||
if (!input_stream.good())
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading description" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading description" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
input_stream.getline(buffer, PARSE_BUFFER_SIZE);
|
||||
|
|
@ -252,15 +253,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// permissions may have extra empty lines before the correct line
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading permissions" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading permissions" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
S32 perm_version = -1;
|
||||
if ( 1 != sscanf( buffer, " permissions %d\n", &perm_version ) ||
|
||||
perm_version != 0 )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: missing valid permissions" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: missing valid permissions" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
if( !mPermissions.importLegacyStream( input_stream ) )
|
||||
|
|
@ -271,15 +272,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// sale info
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading sale info" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading sale info" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
S32 sale_info_version = -1;
|
||||
if ( 1 != sscanf( buffer, " sale_info %d\n", &sale_info_version ) ||
|
||||
sale_info_version != 0 )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: missing valid sale_info" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: missing valid sale_info" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
// Sale info used to contain next owner perm. It is now in the
|
||||
|
|
@ -305,14 +306,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// wearable type
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading type" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading type" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
S32 type = -1;
|
||||
if ( 1 != sscanf( buffer, "type %d\n", &type ) )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: bad type" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: bad type" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
if( 0 <= type && type < LLWearableType::WT_COUNT )
|
||||
|
|
@ -322,36 +323,36 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
else
|
||||
{
|
||||
mType = LLWearableType::WT_COUNT;
|
||||
llwarns << "Bad Wearable asset: bad type #" << type << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: bad type #" << type << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
|
||||
// parameters header
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading parameters header" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading parameters header" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
S32 num_parameters = -1;
|
||||
if ( 1 != sscanf( buffer, "parameters %d\n", &num_parameters ) )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: missing parameters block" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: missing parameters block" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
if ( num_parameters > MAX_WEARABLE_ASSET_PARAMETERS )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: too many parameters, "
|
||||
<< num_parameters << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: too many parameters, "
|
||||
<< num_parameters << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
if( num_parameters != mVisualParamIndexMap.size() )
|
||||
{
|
||||
llwarns << "Wearable parameter mismatch. Reading in "
|
||||
LL_WARNS() << "Wearable parameter mismatch. Reading in "
|
||||
<< num_parameters << " from file, but created "
|
||||
<< mVisualParamIndexMap.size()
|
||||
<< " from avatar parameters. type: "
|
||||
<< getType() << llendl;
|
||||
<< getType() << LL_ENDL;
|
||||
}
|
||||
|
||||
// parameters
|
||||
|
|
@ -360,15 +361,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
{
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading parameter #" << i << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading parameter #" << i << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
S32 param_id = 0;
|
||||
F32 param_weight = 0.f;
|
||||
if ( 2 != sscanf( buffer, "%d %f\n", ¶m_id, ¶m_weight ) )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: bad parameter, #" << i << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: bad parameter, #" << i << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
mSavedVisualParamMap[param_id] = param_weight;
|
||||
|
|
@ -377,20 +378,20 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// textures header
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading textures header" << i << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading textures header" << i << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
S32 num_textures = -1;
|
||||
if ( 1 != sscanf( buffer, "textures %d\n", &num_textures) )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: missing textures block" << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: missing textures block" << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
if ( num_textures > MAX_WEARABLE_ASSET_TEXTURES )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: too many textures, "
|
||||
<< num_textures << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: too many textures, "
|
||||
<< num_textures << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -399,8 +400,8 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
{
|
||||
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
|
||||
{
|
||||
llwarns << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading textures #" << i << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: early end of input stream "
|
||||
<< "while reading textures #" << i << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
S32 te = 0;
|
||||
|
|
@ -409,14 +410,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
"%d %36s\n",
|
||||
&te, uuid_buffer) )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: bad texture, #" << i << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: bad texture, #" << i << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
|
||||
if( !LLUUID::validate( uuid_buffer ) )
|
||||
{
|
||||
llwarns << "Bad Wearable asset: bad texture uuid: "
|
||||
<< uuid_buffer << llendl;
|
||||
LL_WARNS() << "Bad Wearable asset: bad texture uuid: "
|
||||
<< uuid_buffer << LL_ENDL;
|
||||
return LLWearable::FAILURE;
|
||||
}
|
||||
LLUUID id = LLUUID(uuid_buffer);
|
||||
|
|
@ -655,7 +656,7 @@ void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_ba
|
|||
}
|
||||
else
|
||||
{
|
||||
llerrs << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl;
|
||||
LL_ERRS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -668,7 +669,7 @@ F32 LLWearable::getVisualParamWeight(S32 param_index) const
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl;
|
||||
LL_WARNS() << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
|
||||
}
|
||||
return (F32)-1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,16 +28,15 @@
|
|||
#define LL_LLWEARABLE_H
|
||||
|
||||
#include "llavatarappearancedefines.h"
|
||||
#include "llextendedstatus.h"
|
||||
#include "llpermissions.h"
|
||||
#include "llsaleinfo.h"
|
||||
#include "llwearabletype.h"
|
||||
#include "lllocaltextureobject.h"
|
||||
|
||||
class LLMD5;
|
||||
class LLVisualParam;
|
||||
class LLTexGlobalColorInfo;
|
||||
class LLTexGlobalColor;
|
||||
class LLLocalTextureObject;
|
||||
class LLAvatarAppearance;
|
||||
|
||||
// Abstract class.
|
||||
|
|
|
|||
|
|
@ -75,13 +75,13 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL
|
|||
wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type);
|
||||
if (wearable_iter == mWearableDatas.end())
|
||||
{
|
||||
llwarns << "invalid type, type " << type << " index " << index << llendl;
|
||||
LL_WARNS() << "invalid type, type " << type << " index " << index << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
||||
if (index>=wearable_vec.size())
|
||||
{
|
||||
llwarns << "invalid index, type " << type << " index " << index << llendl;
|
||||
LL_WARNS() << "invalid index, type " << type << " index " << index << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type,
|
|||
if (wearable == NULL)
|
||||
{
|
||||
// no null wearables please!
|
||||
llwarns << "Null wearable sent for type " << type << llendl;
|
||||
LL_WARNS() << "Null wearable sent for type " << type << LL_ENDL;
|
||||
return MAX_CLOTHING_PER_TYPE;
|
||||
}
|
||||
// [RLVa:KB] - Checked: 2010-06-08 (RLVa-1.2.0)
|
||||
|
|
@ -241,7 +241,7 @@ U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const
|
|||
wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type);
|
||||
if (wearable_iter == mWearableDatas.end())
|
||||
{
|
||||
llwarns << "tried to get wearable index with an invalid type!" << llendl;
|
||||
LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL;
|
||||
return MAX_CLOTHING_PER_TYPE;
|
||||
}
|
||||
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@
|
|||
|
||||
#include "vorbis/codec.h"
|
||||
#include "vorbis/vorbisfile.h"
|
||||
#include <iterator>
|
||||
#include <deque>
|
||||
|
||||
extern LLAudioEngine *gAudiop;
|
||||
|
||||
|
|
@ -113,7 +115,7 @@ size_t vfs_read(void *ptr, size_t size, size_t nmemb, void *datasource)
|
|||
}
|
||||
}
|
||||
|
||||
int vfs_seek(void *datasource, ogg_int64_t offset, int whence)
|
||||
S32 vfs_seek(void *datasource, ogg_int64_t offset, S32 whence)
|
||||
{
|
||||
LLVFile *file = (LLVFile *)datasource;
|
||||
|
||||
|
|
@ -149,7 +151,7 @@ int vfs_seek(void *datasource, ogg_int64_t offset, int whence)
|
|||
}
|
||||
}
|
||||
|
||||
int vfs_close (void *datasource)
|
||||
S32 vfs_close (void *datasource)
|
||||
{
|
||||
LLVFile *file = (LLVFile *)datasource;
|
||||
delete file;
|
||||
|
|
@ -208,7 +210,7 @@ BOOL LLVorbisDecodeState::initDecode()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
int r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, vfs_callbacks);
|
||||
S32 r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, vfs_callbacks);
|
||||
if(r < 0)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL;
|
||||
|
|
@ -541,7 +543,7 @@ public:
|
|||
void processQueue(const F32 num_secs = 0.005);
|
||||
|
||||
protected:
|
||||
LLLinkedQueue<LLUUID> mDecodeQueue;
|
||||
std::deque<LLUUID> mDecodeQueue;
|
||||
LLPointer<LLVorbisDecodeState> mCurrentDecodep;
|
||||
};
|
||||
|
||||
|
|
@ -570,9 +572,14 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||
// We had an error when decoding, abort.
|
||||
LL_WARNS("AudioEngine") << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << LL_ENDL;
|
||||
mCurrentDecodep->flushBadFile();
|
||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||
adp->setHasValidData(false);
|
||||
adp->setHasCompletedDecode(true);
|
||||
|
||||
if (gAudiop)
|
||||
{
|
||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||
adp->setHasValidData(false);
|
||||
adp->setHasCompletedDecode(true);
|
||||
}
|
||||
|
||||
mCurrentDecodep = NULL;
|
||||
done = TRUE;
|
||||
}
|
||||
|
|
@ -584,7 +591,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||
}
|
||||
else if (mCurrentDecodep)
|
||||
{
|
||||
if (mCurrentDecodep->finishDecode())
|
||||
if (gAudiop && mCurrentDecodep->finishDecode())
|
||||
{
|
||||
// We finished!
|
||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||
|
|
@ -616,7 +623,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||
|
||||
if (!done)
|
||||
{
|
||||
if (!mDecodeQueue.getLength())
|
||||
if (mDecodeQueue.empty())
|
||||
{
|
||||
// Nothing else on the queue.
|
||||
done = TRUE;
|
||||
|
|
@ -624,14 +631,15 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||
else
|
||||
{
|
||||
LLUUID uuid;
|
||||
mDecodeQueue.pop(uuid);
|
||||
if (gAudiop->hasDecodedFile(uuid))
|
||||
uuid = mDecodeQueue.front();
|
||||
mDecodeQueue.pop_front();
|
||||
if (!gAudiop || gAudiop->hasDecodedFile(uuid))
|
||||
{
|
||||
// This file has already been decoded, don't decode it again.
|
||||
continue;
|
||||
}
|
||||
|
||||
lldebugs << "Decoding " << uuid << " from audio queue!" << LL_ENDL;
|
||||
LL_DEBUGS() << "Decoding " << uuid << " from audio queue!" << LL_ENDL;
|
||||
|
||||
std::string uuid_str;
|
||||
std::string d_path;
|
||||
|
|
@ -680,7 +688,7 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
|||
return FALSE;
|
||||
// </FS:ND>
|
||||
|
||||
if (gAudiop->hasDecodedFile(uuid))
|
||||
if (gAudiop && gAudiop->hasDecodedFile(uuid))
|
||||
{
|
||||
// Already have a decoded version, don't need to decode it.
|
||||
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has decoded file already" << LL_ENDL;
|
||||
|
|
@ -691,7 +699,7 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
|||
{
|
||||
// Just put it on the decode queue.
|
||||
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has local asset file already" << LL_ENDL;
|
||||
mImpl->mDecodeQueue.push(uuid);
|
||||
mImpl->mDecodeQueue.push_back(uuid);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "stdtypes.h"
|
||||
|
||||
#include "lllinkedqueue.h"
|
||||
#include "lluuid.h"
|
||||
|
||||
#include "llassettype.h"
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ void LLAudioEngine::stopInternetStream()
|
|||
}
|
||||
|
||||
// virtual
|
||||
void LLAudioEngine::pauseInternetStream(int pause)
|
||||
void LLAudioEngine::pauseInternetStream(S32 pause)
|
||||
{
|
||||
if (mStreamingAudioImpl)
|
||||
mStreamingAudioImpl->pause(pause);
|
||||
|
|
@ -311,7 +311,7 @@ void LLAudioEngine::idle(F32 max_decode_time)
|
|||
LLAudioChannel *channelp = getFreeChannel(max_priority);
|
||||
if (channelp)
|
||||
{
|
||||
LL_DEBUGS("AudioEngine") << "Replacing source in channel due to priority!" << LL_ENDL;
|
||||
//LL_INFOS() << "Replacing source in channel due to priority!" << LL_ENDL;
|
||||
max_sourcep->setChannel(channelp);
|
||||
channelp->setSource(max_sourcep);
|
||||
if (max_sourcep->isSyncSlave())
|
||||
|
|
@ -482,7 +482,7 @@ void LLAudioEngine::idle(F32 max_decode_time)
|
|||
{
|
||||
if (!mBuffers[i]->mInUse && mBuffers[i]->mLastUseTimer.getElapsedTimeF32() > 30.f)
|
||||
{
|
||||
LL_DEBUGS("AudioEngine") << "Flushing unused buffer!" << LL_ENDL;
|
||||
//LL_INFOS() << "Flushing unused buffer!" << LL_ENDL;
|
||||
mBuffers[i]->mAudioDatap->mBufferp = NULL;
|
||||
delete mBuffers[i];
|
||||
mBuffers[i] = NULL;
|
||||
|
|
@ -594,8 +594,8 @@ LLAudioBuffer * LLAudioEngine::getFreeBuffer()
|
|||
|
||||
if (buffer_id >= 0)
|
||||
{
|
||||
lldebugs << "Taking over unused buffer " << buffer_id << LL_ENDL;
|
||||
LL_DEBUGS("AudioEngine") << "Flushing unused buffer!" << LL_ENDL;
|
||||
LL_DEBUGS() << "Taking over unused buffer " << buffer_id << LL_ENDL;
|
||||
//LL_INFOS() << "Flushing unused buffer!" << LL_ENDL;
|
||||
mBuffers[buffer_id]->mAudioDatap->mBufferp = NULL;
|
||||
delete mBuffers[buffer_id];
|
||||
mBuffers[buffer_id] = createBuffer();
|
||||
|
|
@ -677,13 +677,13 @@ void LLAudioEngine::cleanupBuffer(LLAudioBuffer *bufferp)
|
|||
bool LLAudioEngine::preloadSound(const LLUUID &uuid)
|
||||
{
|
||||
LL_DEBUGS("AudioEngine")<<"( "<<uuid<<" )"<<LL_ENDL;
|
||||
|
||||
|
||||
// <FS:ND> Protect against corrupted sounds. Just do a quick exit instead of trying to preload over and over again.
|
||||
if( gAudiop->isCorruptSound( uuid ) )
|
||||
return false;
|
||||
// </FS:ND>
|
||||
|
||||
gAudiop->getAudioData(uuid); // We don't care about the return value, this is just to make sure
|
||||
getAudioData(uuid); // We don't care about the return value, this is just to make sure
|
||||
// that we have an entry, which will mean that the audio engine knows about this
|
||||
|
||||
if (gAudioDecodeMgrp->addDecodeRequest(uuid))
|
||||
|
|
@ -694,7 +694,7 @@ bool LLAudioEngine::preloadSound(const LLUUID &uuid)
|
|||
|
||||
// At some point we need to have the audio/asset system check the static VFS
|
||||
// before it goes off and fetches stuff from the server.
|
||||
LL_DEBUGS("AudioEngine") << "Used internal preload for non-local sound "<< uuid << LL_ENDL;
|
||||
//LL_WARNS() << "Used internal preload for non-local sound" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -825,7 +825,7 @@ void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_i
|
|||
const S32 type, const LLVector3d &pos_global, const LLUUID source_object)
|
||||
{
|
||||
// Create a new source (since this can't be associated with an existing source.
|
||||
LL_DEBUGS("AudioEngine") << "Localized: " << audio_uuid << LL_ENDL;
|
||||
//LL_INFOS() << "Localized: " << audio_uuid << LL_ENDL;
|
||||
|
||||
// NaCl - Do not load silent sounds.
|
||||
if (mMuted || gain <FLT_EPSILON*2)
|
||||
|
|
@ -837,7 +837,7 @@ void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_i
|
|||
source_id.generate();
|
||||
|
||||
LLAudioSource *asp = new LLAudioSource(source_id, owner_id, gain, type, source_object, true);
|
||||
gAudiop->addAudioSource(asp);
|
||||
addAudioSource(asp);
|
||||
if (pos_global.isExactlyZero())
|
||||
{
|
||||
asp->setAmbient(true);
|
||||
|
|
@ -998,14 +998,15 @@ void LLAudioEngine::cleanupAudioSource(LLAudioSource *asp)
|
|||
iter = mAllSources.find(asp->getID());
|
||||
if (iter == mAllSources.end())
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "Cleaning up unknown audio source!" << LL_ENDL;
|
||||
LL_WARNS() << "Cleaning up unknown audio source!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AudioEngine") << "Cleaning up audio sources for "<< asp->getID() <<LL_ENDL;
|
||||
delete asp;
|
||||
mAllSources.erase(iter);
|
||||
}
|
||||
delete asp;
|
||||
mAllSources.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1043,10 +1044,10 @@ bool LLAudioEngine::hasLocalFile(const LLUUID &uuid)
|
|||
|
||||
void LLAudioEngine::startNextTransfer()
|
||||
{
|
||||
//LL_DEBUGS("AudioEngine") << "LLAudioEngine::startNextTransfer()" << LL_ENDL;
|
||||
//LL_INFOS() << "LLAudioEngine::startNextTransfer()" << LL_ENDL;
|
||||
if (mCurrentTransfer.notNull() || getMuted())
|
||||
{
|
||||
//LL_DEBUGS("AudioEngine") << "Transfer in progress, aborting" << LL_ENDL;
|
||||
//LL_INFOS() << "Transfer in progress, aborting" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1227,15 +1228,15 @@ void LLAudioEngine::startNextTransfer()
|
|||
|
||||
if (asset_id.notNull())
|
||||
{
|
||||
LL_INFOS("AudioEngine") << "Getting audio asset data for: " << asset_id << LL_ENDL;
|
||||
gAudiop->mCurrentTransfer = asset_id;
|
||||
gAudiop->mCurrentTransferTimer.reset();
|
||||
LL_INFOS() << "Getting asset data for: " << asset_id << LL_ENDL;
|
||||
mCurrentTransfer = asset_id;
|
||||
mCurrentTransferTimer.reset();
|
||||
gAssetStorage->getAssetData(asset_id, LLAssetType::AT_SOUND,
|
||||
assetCallback, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
//LL_DEBUGS("AudioEngine") << "No pending transfers?" << LL_ENDL;
|
||||
//LL_INFOS() << "No pending transfers?" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1245,12 +1246,13 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
|
|||
{
|
||||
if (!gAudiop)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (result_code)
|
||||
{
|
||||
LL_INFOS("AudioEngine") << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << LL_ENDL;
|
||||
LL_INFOS() << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << LL_ENDL;
|
||||
// Need to mark data as bad to avoid constant rerequests.
|
||||
LLAudioData *adp = gAudiop->getAudioData(uuid);
|
||||
if (adp)
|
||||
|
|
@ -1267,11 +1269,11 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
|
|||
if (!adp)
|
||||
{
|
||||
// Should never happen
|
||||
LL_WARNS("AudioEngine") << "Got asset callback without audio data for " << uuid << LL_ENDL;
|
||||
LL_WARNS() << "Got asset callback without audio data for " << uuid << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AudioEngine") << "Got asset callback with good audio data for " << uuid << ", making decode request" << LL_ENDL;
|
||||
// LL_INFOS() << "Got asset callback with good audio data for " << uuid << ", making decode request" << LL_ENDL;
|
||||
adp->setHasValidData(true);
|
||||
adp->setHasLocalData(true);
|
||||
gAudioDecodeMgrp->addDecodeRequest(uuid);
|
||||
|
|
@ -1434,7 +1436,7 @@ void LLAudioSource::update()
|
|||
}
|
||||
else if (adp->hasCompletedDecode()) // Only mark corrupted after decode is done
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "Marking LLAudioSource corrupted for " << adp->getID() << LL_ENDL;
|
||||
LL_WARNS() << "Marking LLAudioSource corrupted for " << adp->getID() << LL_ENDL;
|
||||
mCorrupted = true ;
|
||||
gAudiop->markSoundCorrupt( adp->getID() );
|
||||
}
|
||||
|
|
@ -1457,7 +1459,12 @@ void LLAudioSource::updatePriority()
|
|||
// Priority is based on distance
|
||||
LLVector3 dist_vec;
|
||||
dist_vec.setVec(getPositionGlobal());
|
||||
dist_vec -= gAudiop->getListenerPos();
|
||||
|
||||
if (gAudiop)
|
||||
{
|
||||
dist_vec -= gAudiop->getListenerPos();
|
||||
}
|
||||
|
||||
F32 dist_squared = llmax(1.f, dist_vec.magVecSquared());
|
||||
|
||||
mPriority = mGain / dist_squared;
|
||||
|
|
@ -1471,9 +1478,15 @@ bool LLAudioSource::setupChannel()
|
|||
if (!adp->getBuffer())
|
||||
{
|
||||
// We're not ready to play back the sound yet, so don't try and allocate a channel for it.
|
||||
//LL_WARNS() << "Aborting, no buffer" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!gAudiop)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mChannelp)
|
||||
{
|
||||
|
|
@ -1488,7 +1501,7 @@ bool LLAudioSource::setupChannel()
|
|||
// Ugh, we don't have any free channels.
|
||||
// Now we have to reprioritize.
|
||||
// For now, just don't play the sound.
|
||||
//llwarns << "Aborting, no free channels" << LL_ENDL;
|
||||
//LL_WARNS() << "Aborting, no free channels" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1526,6 +1539,12 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
|
|||
// Reset our age timeout if someone attempts to play the source.
|
||||
mAgeTimer.reset();
|
||||
|
||||
if (!gAudiop)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLAudioData *adp = gAudiop->getAudioData(audio_uuid);
|
||||
if( !adp )
|
||||
return false;
|
||||
|
|
@ -1598,7 +1617,7 @@ bool LLAudioSource::isDone() const
|
|||
{
|
||||
// We don't have a channel assigned, and it's been
|
||||
// over 15 seconds since we tried to play it. Don't bother.
|
||||
LL_DEBUGS("AudioEngine") << "No channel assigned, source is done" << LL_ENDL;
|
||||
//LL_INFOS() << "No channel assigned, source is done" << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
@ -1635,6 +1654,13 @@ void LLAudioSource::addAudioData(LLAudioData *adp, const bool set_current)
|
|||
{
|
||||
// Only handle a single piece of audio data associated with a source right now,
|
||||
// until I implement prefetch.
|
||||
|
||||
if (!gAudiop)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (set_current)
|
||||
{
|
||||
if (!mCurrentDatap)
|
||||
|
|
@ -1764,7 +1790,7 @@ LLAudioChannel::LLAudioChannel() :
|
|||
LLAudioChannel::~LLAudioChannel()
|
||||
{
|
||||
// Need to disconnect any sources which are using this channel.
|
||||
LL_DEBUGS("AudioEngine") << "Cleaning up audio channel" << LL_ENDL;
|
||||
//LL_INFOS() << "Cleaning up audio channel" << LL_ENDL;
|
||||
if (mCurrentSourcep)
|
||||
{
|
||||
mCurrentSourcep->setChannel(NULL);
|
||||
|
|
@ -1775,10 +1801,12 @@ LLAudioChannel::~LLAudioChannel()
|
|||
|
||||
void LLAudioChannel::setSource(LLAudioSource *sourcep)
|
||||
{
|
||||
//LL_INFOS() << this << ": setSource(" << sourcep << ")" << LL_ENDL;
|
||||
|
||||
if (!sourcep)
|
||||
{
|
||||
// Clearing the source for this channel, don't need to do anything.
|
||||
LL_DEBUGS("AudioEngine") << "Clearing source" << ( mCurrentSourcep ? mCurrentSourcep->getID() : LLUUID::null ) << LL_ENDL;
|
||||
//LL_INFOS() << "Clearing source for channel" << LL_ENDL;
|
||||
cleanup();
|
||||
mCurrentSourcep = NULL;
|
||||
mWaiting = false;
|
||||
|
|
@ -1787,22 +1815,28 @@ void LLAudioChannel::setSource(LLAudioSource *sourcep)
|
|||
{
|
||||
LL_DEBUGS("AudioEngine") << "( id: " << sourcep->getID() << ")" << LL_ENDL;
|
||||
|
||||
if (sourcep == mCurrentSourcep)
|
||||
{
|
||||
// Don't reallocate the channel, this will make FMOD goofy.
|
||||
//LL_DEBUGS("AudioEngine") << "Calling setSource with same source!" << LL_ENDL;
|
||||
}
|
||||
|
||||
mCurrentSourcep = sourcep;
|
||||
|
||||
updateBuffer();
|
||||
update3DPosition();
|
||||
if (sourcep == mCurrentSourcep)
|
||||
{
|
||||
// Don't reallocate the channel, this will make FMOD goofy.
|
||||
//LL_INFOS() << "Calling setSource with same source!" << LL_ENDL;
|
||||
}
|
||||
|
||||
mCurrentSourcep = sourcep;
|
||||
|
||||
updateBuffer();
|
||||
update3DPosition();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLAudioChannel::updateBuffer()
|
||||
{
|
||||
if (!gAudiop)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mCurrentSourcep)
|
||||
{
|
||||
// This channel isn't associated with any source, nothing
|
||||
|
|
@ -1811,10 +1845,7 @@ bool LLAudioChannel::updateBuffer()
|
|||
}
|
||||
|
||||
// Initialize the channel's gain setting for this sound.
|
||||
if(gAudiop)
|
||||
{
|
||||
setSecondaryGain(gAudiop->getSecondaryGain(mCurrentSourcep->getType()));
|
||||
}
|
||||
setSecondaryGain(gAudiop->getSecondaryGain(mCurrentSourcep->getType()));
|
||||
|
||||
LLAudioBuffer *bufferp = mCurrentSourcep->getCurrentBuffer();
|
||||
if (bufferp == mCurrentBufferp)
|
||||
|
|
@ -1871,8 +1902,14 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
|
|||
// This is a null sound.
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gAudiop)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gAudiop && gAudiop->hasDecodedFile(uuid))
|
||||
if (gAudiop->hasDecodedFile(uuid))
|
||||
{
|
||||
// Already have a decoded version, don't need to decode it.
|
||||
setHasLocalData(true);
|
||||
|
|
@ -1892,15 +1929,21 @@ bool LLAudioData::load()
|
|||
if (mBufferp)
|
||||
{
|
||||
// We already have this sound in a buffer, don't do anything.
|
||||
LL_INFOS("AudioEngine") << "Already have a buffer for this sound, don't bother loading!" << LL_ENDL;
|
||||
LL_INFOS() << "Already have a buffer for this sound, don't bother loading!" << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!gAudiop)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
mBufferp = gAudiop->getFreeBuffer();
|
||||
if (!mBufferp)
|
||||
{
|
||||
// No free buffers, abort.
|
||||
LL_INFOS("AudioEngine") << "Not able to allocate a new audio buffer, aborting." << LL_ENDL;
|
||||
LL_INFOS() << "Not able to allocate a new audio buffer, aborting." << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
enum LLAudioPlayState
|
||||
{
|
||||
// isInternetStreamPlaying() returns an *int*, with
|
||||
// isInternetStreamPlaying() returns an *S32*, with
|
||||
// 0 = stopped, 1 = playing, 2 = paused.
|
||||
AUDIO_STOPPED = 0,
|
||||
AUDIO_PLAYING = 1,
|
||||
|
|
@ -163,7 +163,7 @@ public:
|
|||
// Internet stream methods - these will call down into the *mStreamingAudioImpl if it exists
|
||||
void startInternetStream(const std::string& url);
|
||||
void stopInternetStream();
|
||||
void pauseInternetStream(int pause);
|
||||
void pauseInternetStream(S32 pause);
|
||||
void updateInternetStream(); // expected to be called often
|
||||
LLAudioPlayState isInternetStreamPlaying();
|
||||
// use a value from 0.0 to 1.0, inclusive
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string)
|
|||
{
|
||||
if(result == FMOD_OK)
|
||||
return false;
|
||||
lldebugs << string << " Error: " << FMOD_ErrorString(result) << llendl;
|
||||
LL_DEBUGS() << string << " Error: " << FMOD_ErrorString(result) << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -77,11 +77,11 @@ void* F_STDCALL decode_alloc(unsigned int size, FMOD_MEMORY_TYPE type, const cha
|
|||
{
|
||||
if(type & FMOD_MEMORY_STREAM_DECODE)
|
||||
{
|
||||
llinfos << "Decode buffer size: " << size << llendl;
|
||||
LL_INFOS() << "Decode buffer size: " << size << LL_ENDL;
|
||||
}
|
||||
else if(type & FMOD_MEMORY_STREAM_FILE)
|
||||
{
|
||||
llinfos << "Strean buffer size: " << size << llendl;
|
||||
LL_INFOS() << "Strean buffer size: " << size << LL_ENDL;
|
||||
}
|
||||
return new char[size];
|
||||
}
|
||||
|
|
@ -307,7 +307,7 @@ void LLAudioEngine_FMODEX::allocateListener(void)
|
|||
mListenerp = (LLListener *) new LLListener_FMODEX(mSystem);
|
||||
if (!mListenerp)
|
||||
{
|
||||
llwarns << "Listener creation failed" << llendl;
|
||||
LL_WARNS() << "Listener creation failed" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -316,18 +316,18 @@ void LLAudioEngine_FMODEX::shutdown()
|
|||
{
|
||||
stopInternetStream();
|
||||
|
||||
llinfos << "About to LLAudioEngine::shutdown()" << llendl;
|
||||
LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
|
||||
LLAudioEngine::shutdown();
|
||||
|
||||
llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << LL_ENDL;
|
||||
if ( mSystem ) // speculative fix for MAINT-2657
|
||||
{
|
||||
mSystem->close();
|
||||
// <FS:Ansariel> Additional debug message; viewer might hang somewhere in here
|
||||
llinfos << "LLAudioEngine_FMODEX::shutdown() FMOD Ex system closed. Now releasing..." << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_FMODEX::shutdown() FMOD Ex system closed. Now releasing..." << LL_ENDL;
|
||||
mSystem->release();
|
||||
}
|
||||
llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << LL_ENDL;
|
||||
|
||||
delete mListenerp;
|
||||
mListenerp = NULL;
|
||||
|
|
@ -476,7 +476,7 @@ bool LLAudioChannelFMODEX::updateBuffer()
|
|||
{
|
||||
// This is bad, there should ALWAYS be a sound associated with a legit
|
||||
// buffer.
|
||||
llerrs << "No FMOD sound!" << llendl;
|
||||
LL_ERRS() << "No FMOD sound!" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ bool LLAudioChannelFMODEX::updateBuffer()
|
|||
Check_FMOD_Error(result, "FMOD::System::playSound");
|
||||
}
|
||||
|
||||
//llinfos << "Setting up channel " << std::hex << mChannelID << std::dec << llendl;
|
||||
//LL_INFOS() << "Setting up channel " << std::hex << mChannelID << std::dec << LL_ENDL;
|
||||
}
|
||||
|
||||
// If we have a source for the channel, we need to update its gain.
|
||||
|
|
@ -506,8 +506,8 @@ bool LLAudioChannelFMODEX::updateBuffer()
|
|||
{
|
||||
S32 index;
|
||||
mChannelp->getIndex(&index);
|
||||
llwarns << "Channel " << index << "Source ID: " << mCurrentSourcep->getID()
|
||||
<< " at " << mCurrentSourcep->getPositionGlobal() << llendl;
|
||||
LL_WARNS() << "Channel " << index << "Source ID: " << mCurrentSourcep->getID()
|
||||
<< " at " << mCurrentSourcep->getPositionGlobal() << LL_ENDL;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
|
@ -577,11 +577,11 @@ void LLAudioChannelFMODEX::cleanup()
|
|||
{
|
||||
if (!mChannelp)
|
||||
{
|
||||
//llinfos << "Aborting cleanup with no channel handle." << llendl;
|
||||
//LL_INFOS() << "Aborting cleanup with no channel handle." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
//llinfos << "Cleaning up channel: " << mChannelID << llendl;
|
||||
//LL_INFOS() << "Cleaning up channel: " << mChannelID << LL_ENDL;
|
||||
Check_FMOD_Error(mChannelp->stop(),"FMOD::Channel::stop");
|
||||
|
||||
mCurrentBufferp = NULL;
|
||||
|
|
@ -593,7 +593,7 @@ void LLAudioChannelFMODEX::play()
|
|||
{
|
||||
if (!mChannelp)
|
||||
{
|
||||
llwarns << "Playing without a channel handle, aborting" << llendl;
|
||||
LL_WARNS() << "Playing without a channel handle, aborting" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -701,7 +701,7 @@ bool LLAudioBufferFMODEX::loadWAV(const std::string& filename)
|
|||
if (result != FMOD_OK)
|
||||
{
|
||||
// We failed to load the file for some reason.
|
||||
llwarns << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << llendl;
|
||||
LL_WARNS() << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << LL_ENDL;
|
||||
|
||||
//
|
||||
// If we EVER want to load wav files provided by end users, we need
|
||||
|
|
|
|||
|
|
@ -59,33 +59,33 @@ bool LLAudioEngine_OpenAL::init(const S32 num_channels, void* userdata)
|
|||
|
||||
if(!alutInit(NULL, NULL))
|
||||
{
|
||||
llwarns << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << llendl;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
llinfos << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << LL_ENDL;
|
||||
|
||||
llinfos << "OpenAL version: "
|
||||
<< ll_safe_string(alGetString(AL_VERSION)) << llendl;
|
||||
llinfos << "OpenAL vendor: "
|
||||
<< ll_safe_string(alGetString(AL_VENDOR)) << llendl;
|
||||
llinfos << "OpenAL renderer: "
|
||||
<< ll_safe_string(alGetString(AL_RENDERER)) << llendl;
|
||||
LL_INFOS() << "OpenAL version: "
|
||||
<< ll_safe_string(alGetString(AL_VERSION)) << LL_ENDL;
|
||||
LL_INFOS() << "OpenAL vendor: "
|
||||
<< ll_safe_string(alGetString(AL_VENDOR)) << LL_ENDL;
|
||||
LL_INFOS() << "OpenAL renderer: "
|
||||
<< ll_safe_string(alGetString(AL_RENDERER)) << LL_ENDL;
|
||||
|
||||
ALint major = alutGetMajorVersion ();
|
||||
ALint minor = alutGetMinorVersion ();
|
||||
llinfos << "ALUT version: " << major << "." << minor << llendl;
|
||||
LL_INFOS() << "ALUT version: " << major << "." << minor << LL_ENDL;
|
||||
|
||||
ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext());
|
||||
|
||||
alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major);
|
||||
alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor);
|
||||
llinfos << "ALC version: " << major << "." << minor << llendl;
|
||||
LL_INFOS() << "ALC version: " << major << "." << minor << LL_ENDL;
|
||||
|
||||
llinfos << "ALC default device: "
|
||||
LL_INFOS() << "ALC default device: "
|
||||
<< ll_safe_string(alcGetString(device,
|
||||
ALC_DEFAULT_DEVICE_SPECIFIER))
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -125,24 +125,24 @@ void LLAudioEngine_OpenAL::allocateListener()
|
|||
mListenerp = (LLListener *) new LLListener_OpenAL();
|
||||
if(!mListenerp)
|
||||
{
|
||||
llwarns << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << llendl;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLAudioEngine_OpenAL::shutdown()
|
||||
{
|
||||
llinfos << "About to LLAudioEngine::shutdown()" << llendl;
|
||||
LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
|
||||
LLAudioEngine::shutdown();
|
||||
|
||||
llinfos << "About to alutExit()" << llendl;
|
||||
LL_INFOS() << "About to alutExit()" << LL_ENDL;
|
||||
if(!alutExit())
|
||||
{
|
||||
llwarns << "Nuts." << llendl;
|
||||
llwarns << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << llendl;
|
||||
LL_WARNS() << "Nuts." << LL_ENDL;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
|
||||
}
|
||||
|
||||
llinfos << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << LL_ENDL;
|
||||
|
||||
delete mListenerp;
|
||||
mListenerp = NULL;
|
||||
|
|
@ -160,7 +160,7 @@ LLAudioChannel *LLAudioEngine_OpenAL::createChannel()
|
|||
|
||||
void LLAudioEngine_OpenAL::setInternalGain(F32 gain)
|
||||
{
|
||||
//llinfos << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << llendl;
|
||||
//LL_INFOS() << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << LL_ENDL;
|
||||
alListenerf(AL_GAIN, gain);
|
||||
}
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ void LLAudioChannelOpenAL::play()
|
|||
{
|
||||
if (mALSource == AL_NONE)
|
||||
{
|
||||
llwarns << "Playing without a mALSource, aborting" << llendl;
|
||||
LL_WARNS() << "Playing without a mALSource, aborting" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -215,8 +215,8 @@ void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp)
|
|||
alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET,
|
||||
&master_offset);
|
||||
|
||||
llinfos << "Syncing with master at " << master_offset
|
||||
<< "sec" << llendl;
|
||||
LL_INFOS() << "Syncing with master at " << master_offset
|
||||
<< "sec" << LL_ENDL;
|
||||
// *TODO: detect when this fails, maybe use AL_SAMPLE_
|
||||
alSourcef(mALSource, AL_SEC_OFFSET, master_offset);
|
||||
}
|
||||
|
|
@ -328,7 +328,7 @@ void LLAudioBufferOpenAL::cleanup()
|
|||
// <FS:ND> Print warning on possible leak.
|
||||
ALenum error = alGetError();
|
||||
if( AL_NO_ERROR != error )
|
||||
llwarns << "openal error: " << error << " possible memory leak hit" << llendl;
|
||||
LL_WARNS() << "openal error: " << error << " possible memory leak hit" << LL_ENDL;
|
||||
// </FS:ND>
|
||||
|
||||
mALBuffer = AL_NONE;
|
||||
|
|
@ -344,18 +344,18 @@ bool LLAudioBufferOpenAL::loadWAV(const std::string& filename)
|
|||
ALenum error = alutGetError();
|
||||
if (gDirUtilp->fileExists(filename))
|
||||
{
|
||||
llwarns <<
|
||||
LL_WARNS() <<
|
||||
"LLAudioBufferOpenAL::loadWAV() Error loading "
|
||||
<< filename
|
||||
<< " " << alutGetErrorString(error) << llendl;
|
||||
<< " " << alutGetErrorString(error) << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's common for the file to not actually exist.
|
||||
lldebugs <<
|
||||
LL_DEBUGS() <<
|
||||
"LLAudioBufferOpenAL::loadWAV() Error loading "
|
||||
<< filename
|
||||
<< " " << alutGetErrorString(error) << llendl;
|
||||
<< " " << alutGetErrorString(error) << LL_ENDL;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -379,7 +379,7 @@ U32 LLAudioBufferOpenAL::getLength()
|
|||
bool LLAudioEngine_OpenAL::initWind()
|
||||
{
|
||||
ALenum error;
|
||||
llinfos << "LLAudioEngine_OpenAL::initWind() start" << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_OpenAL::initWind() start" << LL_ENDL;
|
||||
|
||||
mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS;
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ bool LLAudioEngine_OpenAL::initWind()
|
|||
|
||||
if((error=alGetError()) != AL_NO_ERROR)
|
||||
{
|
||||
llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<llendl;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<LL_ENDL;
|
||||
}
|
||||
|
||||
mWindGen = new LLWindGen<WIND_SAMPLE_T>;
|
||||
|
|
@ -402,18 +402,18 @@ bool LLAudioEngine_OpenAL::initWind()
|
|||
|
||||
if(mWindBuf==NULL)
|
||||
{
|
||||
llerrs << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << llendl;
|
||||
LL_ERRS() << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
llinfos << "LLAudioEngine_OpenAL::initWind() done" << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_OpenAL::initWind() done" << LL_ENDL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLAudioEngine_OpenAL::cleanupWind()
|
||||
{
|
||||
llinfos << "LLAudioEngine_OpenAL::cleanupWind()" << llendl;
|
||||
LL_INFOS() << "LLAudioEngine_OpenAL::cleanupWind()" << LL_ENDL;
|
||||
|
||||
if (mWindSource != AL_NONE)
|
||||
{
|
||||
|
|
@ -489,7 +489,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
|
|||
mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed);
|
||||
mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0);
|
||||
|
||||
//llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << llendl;
|
||||
//LL_INFOS() << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << LL_ENDL;
|
||||
|
||||
while(processed--) // unqueue old buffers
|
||||
{
|
||||
|
|
@ -500,7 +500,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
|
|||
error = alGetError();
|
||||
if(error != AL_NO_ERROR)
|
||||
{
|
||||
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -516,7 +516,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
|
|||
alGenBuffers(1,&buffer);
|
||||
if((error=alGetError()) != AL_NO_ERROR)
|
||||
{
|
||||
llwarns << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << llendl;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -529,14 +529,14 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
|
|||
error = alGetError();
|
||||
if(error != AL_NO_ERROR)
|
||||
{
|
||||
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << LL_ENDL;
|
||||
}
|
||||
|
||||
alSourceQueueBuffers(mWindSource, 1, &buffer);
|
||||
error = alGetError();
|
||||
if(error != AL_NO_ERROR)
|
||||
{
|
||||
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << LL_ENDL;
|
||||
}
|
||||
|
||||
--mNumEmptyWindALBuffers;
|
||||
|
|
@ -548,7 +548,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
|
|||
{
|
||||
alSourcePlay(mWindSource);
|
||||
|
||||
lldebugs << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << llendl;
|
||||
LL_DEBUGS() << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,13 +41,13 @@ LLListener_OpenAL::~LLListener_OpenAL()
|
|||
|
||||
void LLListener_OpenAL::translate(LLVector3 offset)
|
||||
{
|
||||
//llinfos << "LLListener_OpenAL::translate() : " << offset << llendl;
|
||||
//LL_INFOS() << "LLListener_OpenAL::translate() : " << offset << LL_ENDL;
|
||||
LLListener::translate(offset);
|
||||
}
|
||||
|
||||
void LLListener_OpenAL::setPosition(LLVector3 pos)
|
||||
{
|
||||
//llinfos << "LLListener_OpenAL::setPosition() : " << pos << llendl;
|
||||
//LL_INFOS() << "LLListener_OpenAL::setPosition() : " << pos << LL_ENDL;
|
||||
LLListener::setPosition(pos);
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ void LLListener_OpenAL::setVelocity(LLVector3 vel)
|
|||
|
||||
void LLListener_OpenAL::orient(LLVector3 up, LLVector3 at)
|
||||
{
|
||||
//llinfos << "LLListener_OpenAL::orient() up: " << up << " at: " << at << llendl;
|
||||
//LL_INFOS() << "LLListener_OpenAL::orient() up: " << up << " at: " << at << LL_ENDL;
|
||||
LLListener::orient(up, at);
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ void LLListener_OpenAL::commitDeferredChanges()
|
|||
|
||||
void LLListener_OpenAL::setDopplerFactor(F32 factor)
|
||||
{
|
||||
//llinfos << "LLListener_OpenAL::setDopplerFactor() : " << factor << llendl;
|
||||
//LL_INFOS() << "LLListener_OpenAL::setDopplerFactor() : " << factor << LL_ENDL;
|
||||
alDopplerFactor(factor);
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ F32 LLListener_OpenAL::getDopplerFactor()
|
|||
{
|
||||
ALfloat factor;
|
||||
factor = alGetFloat(AL_DOPPLER_FACTOR);
|
||||
//llinfos << "LLListener_OpenAL::getDopplerFactor() : " << factor << llendl;
|
||||
//LL_INFOS() << "LLListener_OpenAL::getDopplerFactor() : " << factor << LL_ENDL;
|
||||
return factor;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ void LLStreamingAudio_FMODEX::start(const std::string& url)
|
|||
{
|
||||
//if (!mInited)
|
||||
//{
|
||||
// LL_WARNS("FModEX") << "startInternetStream before audio initialized" << LL_ENDL;
|
||||
// LL_WARNS() << "startInternetStream before audio initialized" << LL_ENDL;
|
||||
// return;
|
||||
//}
|
||||
|
||||
|
|
@ -112,13 +112,13 @@ void LLStreamingAudio_FMODEX::start(const std::string& url)
|
|||
|
||||
if (!url.empty())
|
||||
{
|
||||
LL_INFOS("FmodEX") << "Starting internet stream: " << url << LL_ENDL;
|
||||
LL_INFOS() << "Starting internet stream: " << url << LL_ENDL;
|
||||
mCurrentInternetStreamp = new LLAudioStreamManagerFMODEX(mSystem,url);
|
||||
mURL = url;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS("FmodEX") << "Set internet stream to null" << LL_ENDL;
|
||||
LL_INFOS() << "Set internet stream to null" << LL_ENDL;
|
||||
mURL.clear();
|
||||
}
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ void LLStreamingAudio_FMODEX::update()
|
|||
LLAudioStreamManagerFMODEX *streamp = *iter;
|
||||
if (streamp->stopStream())
|
||||
{
|
||||
LL_INFOS("FmodEX") << "Closed dead stream" << LL_ENDL;
|
||||
LL_INFOS() << "Closed dead stream" << LL_ENDL;
|
||||
delete streamp;
|
||||
mDeadStreams.erase(iter++);
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ void LLStreamingAudio_FMODEX::update()
|
|||
{
|
||||
if (!strcmp(tag.name, "Sample Rate Change"))
|
||||
{
|
||||
LL_INFOS("FmodEX") << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL;
|
||||
LL_INFOS() << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL;
|
||||
mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data));
|
||||
}
|
||||
continue;
|
||||
|
|
@ -287,9 +287,9 @@ void LLStreamingAudio_FMODEX::update()
|
|||
mFMODInternetStreamChannelp->getPaused(&paused);
|
||||
if(!paused)
|
||||
{
|
||||
LL_INFOS("FmodEX") << "Stream starvation detected! Pausing stream until buffer nearly full." << LL_ENDL;
|
||||
LL_INFOS("FmodEX") << " (diskbusy="<<diskbusy<<")" << LL_ENDL;
|
||||
LL_INFOS("FmodEX") << " (progress="<<progress<<")" << LL_ENDL;
|
||||
LL_INFOS() << "Stream starvation detected! Pausing stream until buffer nearly full." << LL_ENDL;
|
||||
LL_INFOS() << " (diskbusy="<<diskbusy<<")" << LL_ENDL;
|
||||
LL_INFOS() << " (progress="<<progress<<")" << LL_ENDL;
|
||||
mFMODInternetStreamChannelp->setPaused(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -312,14 +312,14 @@ void LLStreamingAudio_FMODEX::stop()
|
|||
|
||||
if (mCurrentInternetStreamp)
|
||||
{
|
||||
LL_INFOS("FmodEX") << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
|
||||
LL_INFOS() << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
|
||||
if (mCurrentInternetStreamp->stopStream())
|
||||
{
|
||||
delete mCurrentInternetStreamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("FmodEX") << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
|
||||
LL_WARNS() << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
|
||||
mDeadStreams.push_back(mCurrentInternetStreamp);
|
||||
}
|
||||
mCurrentInternetStreamp = NULL;
|
||||
|
|
@ -427,7 +427,7 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con
|
|||
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
LL_WARNS("FModEX") << "Couldn't open fmod stream, error "
|
||||
LL_WARNS() << "Couldn't open fmod stream, error "
|
||||
<< FMOD_ErrorString(result)
|
||||
<< LL_ENDL;
|
||||
mReady = false;
|
||||
|
|
@ -442,7 +442,7 @@ FMOD::Channel *LLAudioStreamManagerFMODEX::startStream()
|
|||
// We need a live and opened stream before we try and play it.
|
||||
if (!mInternetStream || getOpenState() != FMOD_OPENSTATE_READY)
|
||||
{
|
||||
LL_WARNS("FModEX") << "No internet stream to start playing!" << LL_ENDL;
|
||||
LL_WARNS() << "No internet stream to start playing!" << LL_ENDL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ class LLStreamingAudio_FMODEX : public LLStreamingAudioInterface
|
|||
|
||||
/*virtual*/ void start(const std::string& url);
|
||||
/*virtual*/ void stop();
|
||||
/*virtual*/ void pause(int pause);
|
||||
/*virtual*/ void pause(S32 pause);
|
||||
/*virtual*/ void update();
|
||||
/*virtual*/ int isPlaying();
|
||||
/*virtual*/ S32 isPlaying();
|
||||
/*virtual*/ void setGain(F32 vol);
|
||||
/*virtual*/ F32 getGain();
|
||||
/*virtual*/ std::string getURL();
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
|||
return(LLVORBISENC_CHUNK_SIZE_ERR);
|
||||
}
|
||||
|
||||
// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl;
|
||||
// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL;
|
||||
|
||||
if (!(strncmp((char *)&(wav_header[0]),"fmt ",4)))
|
||||
{
|
||||
|
|
@ -224,7 +224,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
|
|||
std::string error_msg;
|
||||
if ((format_error = check_for_invalid_wav_formats(in_fname, error_msg)))
|
||||
{
|
||||
llwarns << error_msg << ": " << in_fname << llendl;
|
||||
LL_WARNS() << error_msg << ": " << in_fname << LL_ENDL;
|
||||
return(format_error);
|
||||
}
|
||||
|
||||
|
|
@ -237,8 +237,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
|
|||
infile.open(in_fname,LL_APR_RB);
|
||||
if (!infile.getFileHandle())
|
||||
{
|
||||
llwarns << "Couldn't open temporary ogg file for writing: " << in_fname
|
||||
<< llendl;
|
||||
LL_WARNS() << "Couldn't open temporary ogg file for writing: " << in_fname
|
||||
<< LL_ENDL;
|
||||
return(LLVORBISENC_SOURCE_OPEN_ERR);
|
||||
}
|
||||
|
||||
|
|
@ -246,8 +246,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
|
|||
outfile.open(out_fname,LL_APR_WPB);
|
||||
if (!outfile.getFileHandle())
|
||||
{
|
||||
llwarns << "Couldn't open upload sound file for reading: " << in_fname
|
||||
<< llendl;
|
||||
LL_WARNS() << "Couldn't open upload sound file for reading: " << in_fname
|
||||
<< LL_ENDL;
|
||||
return(LLVORBISENC_DEST_OPEN_ERR);
|
||||
}
|
||||
|
||||
|
|
@ -265,7 +265,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
|
|||
+ ((U32) wav_header[5] << 8)
|
||||
+ wav_header[4];
|
||||
|
||||
// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl;
|
||||
// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL;
|
||||
|
||||
if (!(strncmp((char *)&(wav_header[0]),"fmt ",4)))
|
||||
{
|
||||
|
|
@ -308,8 +308,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
|
|||
// vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE_AVG,NULL) ||
|
||||
// vorbis_encode_setup_init(&vi))
|
||||
{
|
||||
llwarns << "unable to initialize vorbis codec at quality " << quality << llendl;
|
||||
// llwarns << "unable to initialize vorbis codec at bitrate " << bitrate << llendl;
|
||||
LL_WARNS() << "unable to initialize vorbis codec at quality " << quality << LL_ENDL;
|
||||
// LL_WARNS() << "unable to initialize vorbis codec at bitrate " << bitrate << LL_ENDL;
|
||||
return(LLVORBISENC_DEST_OPEN_ERR);
|
||||
}
|
||||
|
||||
|
|
@ -498,7 +498,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
|
|||
libvorbis. They're never freed or manipulated directly */
|
||||
|
||||
// fprintf(stderr,"Vorbis encoding: Done.\n");
|
||||
llinfos << "Vorbis encoding: Done." << llendl;
|
||||
LL_INFOS() << "Vorbis encoding: Done." << LL_ENDL;
|
||||
|
||||
#endif
|
||||
return(LLVORBISENC_NOERR);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include <map>
|
||||
|
||||
#include "string_table.h"
|
||||
#include "llstringtable.h"
|
||||
#include "lluuid.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -130,14 +130,14 @@ LLQuaternion::Order bvhStringToOrder( char *str )
|
|||
|
||||
if (mStatus == LLBVHLoader::ST_NO_XLT_FILE)
|
||||
{
|
||||
llwarns << "NOTE: No translation table found." << llendl;
|
||||
LL_WARNS() << "NOTE: No translation table found." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mStatus != LLBVHLoader::ST_OK)
|
||||
{
|
||||
llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
|
||||
LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ LLQuaternion::Order bvhStringToOrder( char *str )
|
|||
mStatus = loadBVHFile(buffer, error_text, error_line);
|
||||
if (mStatus != LLBVHLoader::ST_OK)
|
||||
{
|
||||
llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
|
||||
LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -163,10 +163,10 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
|
|||
errorLine = 0;
|
||||
mStatus = loadTranslationTable("anim.ini");
|
||||
loadStatus = mStatus;
|
||||
llinfos<<"Load Status 00 : "<< loadStatus << llendl;
|
||||
LL_INFOS()<<"Load Status 00 : "<< loadStatus << LL_ENDL;
|
||||
if (mStatus == E_ST_NO_XLT_FILE)
|
||||
{
|
||||
//llwarns << "NOTE: No translation table found." << llendl;
|
||||
//LL_WARNS() << "NOTE: No translation table found." << LL_ENDL;
|
||||
loadStatus = mStatus;
|
||||
return;
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
|
|||
{
|
||||
if (mStatus != E_ST_OK)
|
||||
{
|
||||
//llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
|
||||
//LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
|
||||
errorLine = getLineNumber();
|
||||
loadStatus = mStatus;
|
||||
return;
|
||||
|
|
@ -187,7 +187,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
|
|||
|
||||
if (mStatus != E_ST_OK)
|
||||
{
|
||||
//llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
|
||||
//LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
|
||||
loadStatus = mStatus;
|
||||
errorLine = getLineNumber();
|
||||
return;
|
||||
|
|
@ -231,7 +231,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
|||
if (!fp)
|
||||
return E_ST_NO_XLT_FILE;
|
||||
|
||||
llinfos << "NOTE: Loading translation table: " << fileName << llendl;
|
||||
LL_INFOS() << "NOTE: Loading translation table: " << fileName << LL_ENDL;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// register file to be closed on function exit
|
||||
|
|
@ -295,7 +295,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
|||
return E_ST_NO_XLT_EMOTE;
|
||||
|
||||
mEmoteName.assign( emote_str );
|
||||
// llinfos << "NOTE: Emote: " << mEmoteName.c_str() << llendl;
|
||||
// LL_INFOS() << "NOTE: Emote: " << mEmoteName.c_str() << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -310,7 +310,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
|||
return E_ST_NO_XLT_PRIORITY;
|
||||
|
||||
mPriority = priority;
|
||||
// llinfos << "NOTE: Priority: " << mPriority << llendl;
|
||||
// LL_INFOS() << "NOTE: Priority: " << mPriority << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -703,7 +703,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &
|
|||
|
||||
if ( !strstr(line.c_str(), "HIERARCHY") )
|
||||
{
|
||||
// llinfos << line << llendl;
|
||||
// LL_INFOS() << line << LL_ENDL;
|
||||
return E_ST_NO_HIER;
|
||||
}
|
||||
|
||||
|
|
@ -1050,7 +1050,7 @@ void LLBVHLoader::applyTranslations()
|
|||
//----------------------------------------------------------------
|
||||
if ( trans.mIgnore )
|
||||
{
|
||||
//llinfos << "NOTE: Ignoring " << joint->mName.c_str() << llendl;
|
||||
//LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
|
||||
joint->mIgnore = TRUE;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1060,7 +1060,7 @@ void LLBVHLoader::applyTranslations()
|
|||
//----------------------------------------------------------------
|
||||
if ( ! trans.mOutName.empty() )
|
||||
{
|
||||
//llinfos << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << llendl;
|
||||
//LL_INFOS() << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << LL_ENDL;
|
||||
joint->mOutName = trans.mOutName;
|
||||
}
|
||||
|
||||
|
|
@ -1077,25 +1077,25 @@ void LLBVHLoader::applyTranslations()
|
|||
//----------------------------------------------------------------
|
||||
if ( trans.mRelativePositionKey )
|
||||
{
|
||||
// llinfos << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << llendl;
|
||||
// LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
||||
joint->mRelativePositionKey = TRUE;
|
||||
}
|
||||
|
||||
if ( trans.mRelativeRotationKey )
|
||||
{
|
||||
// llinfos << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << llendl;
|
||||
// LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
||||
joint->mRelativeRotationKey = TRUE;
|
||||
}
|
||||
|
||||
if ( trans.mRelativePosition.magVec() > 0.0f )
|
||||
{
|
||||
joint->mRelativePosition = trans.mRelativePosition;
|
||||
// llinfos << "NOTE: Removing " <<
|
||||
// LL_INFOS() << "NOTE: Removing " <<
|
||||
// joint->mRelativePosition.mV[0] << " " <<
|
||||
// joint->mRelativePosition.mV[1] << " " <<
|
||||
// joint->mRelativePosition.mV[2] <<
|
||||
// " from all position keys in " <<
|
||||
// joint->mOutName.c_str() << llendl;
|
||||
// joint->mOutName.c_str() << LL_ENDL;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
|
@ -1109,9 +1109,9 @@ void LLBVHLoader::applyTranslations()
|
|||
//----------------------------------------------------------------
|
||||
if ( ! trans.mMergeParentName.empty() )
|
||||
{
|
||||
// llinfos << "NOTE: Merging " << joint->mOutName.c_str() <<
|
||||
// LL_INFOS() << "NOTE: Merging " << joint->mOutName.c_str() <<
|
||||
// " with parent " <<
|
||||
// trans.mMergeParentName.c_str() << llendl;
|
||||
// trans.mMergeParentName.c_str() << LL_ENDL;
|
||||
joint->mMergeParentName = trans.mMergeParentName;
|
||||
}
|
||||
|
||||
|
|
@ -1120,8 +1120,8 @@ void LLBVHLoader::applyTranslations()
|
|||
//----------------------------------------------------------------
|
||||
if ( ! trans.mMergeChildName.empty() )
|
||||
{
|
||||
// llinfos << "NOTE: Merging " << joint->mName.c_str() <<
|
||||
// " with child " << trans.mMergeChildName.c_str() << llendl;
|
||||
// LL_INFOS() << "NOTE: Merging " << joint->mName.c_str() <<
|
||||
// " with child " << trans.mMergeChildName.c_str() << LL_ENDL;
|
||||
joint->mMergeChildName = trans.mMergeChildName;
|
||||
}
|
||||
|
||||
|
|
@ -1316,7 +1316,7 @@ void LLBVHLoader::optimize()
|
|||
// don't output joints with no motion
|
||||
if (!(pos_changed || rot_changed))
|
||||
{
|
||||
//llinfos << "Ignoring joint " << joint->mName << llendl;
|
||||
//LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL;
|
||||
joint->mIgnore = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "llcharacter.h"
|
||||
#include "llstring.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
#define SKEL_HEADER "Linden Skeleton 1.0"
|
||||
|
||||
|
|
@ -105,7 +106,7 @@ LLJoint *LLCharacter::getJoint( const std::string &name )
|
|||
|
||||
if (!joint)
|
||||
{
|
||||
llwarns << "Failed to find joint." << llendl;
|
||||
LL_WARNS() << "Failed to find joint." << LL_ENDL;
|
||||
}
|
||||
return joint;
|
||||
}
|
||||
|
|
@ -180,27 +181,27 @@ BOOL LLCharacter::isMotionActive(const LLUUID& id)
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLCharacter::requestStopMotion( LLMotion* motion)
|
||||
{
|
||||
// llinfos << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << llendl;
|
||||
// LL_INFOS() << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// updateMotions()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
|
||||
static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
|
||||
static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS("Update Motions");
|
||||
static LLTrace::BlockTimerStatHandle FTM_UPDATE_ANIMATION("Update Animation");
|
||||
static LLTrace::BlockTimerStatHandle FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
|
||||
static LLTrace::BlockTimerStatHandle FTM_UPDATE_MOTIONS("Update Motions");
|
||||
|
||||
void LLCharacter::updateMotions(e_update_t update_type)
|
||||
{
|
||||
if (update_type == HIDDEN_UPDATE)
|
||||
{
|
||||
LLFastTimer t(FTM_UPDATE_HIDDEN_ANIMATION);
|
||||
LL_RECORD_BLOCK_TIME(FTM_UPDATE_HIDDEN_ANIMATION);
|
||||
mMotionController.updateMotionsMinimal();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFastTimer t(FTM_UPDATE_ANIMATION);
|
||||
LL_RECORD_BLOCK_TIME(FTM_UPDATE_ANIMATION);
|
||||
// unpause if the number of outstanding pause requests has dropped to the initial one
|
||||
if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1)
|
||||
{
|
||||
|
|
@ -208,7 +209,7 @@ void LLCharacter::updateMotions(e_update_t update_type)
|
|||
}
|
||||
bool force_update = (update_type == FORCE_UPDATE);
|
||||
{
|
||||
LLFastTimer t(FTM_UPDATE_MOTIONS);
|
||||
LL_RECORD_BLOCK_TIME(FTM_UPDATE_MOTIONS);
|
||||
mMotionController.updateMotions(force_update);
|
||||
}
|
||||
}
|
||||
|
|
@ -241,14 +242,14 @@ void LLCharacter::dumpCharacter( LLJoint* joint )
|
|||
// handle top level entry into recursion
|
||||
if (joint == NULL)
|
||||
{
|
||||
llinfos << "DEBUG: Dumping Character @" << this << llendl;
|
||||
LL_INFOS() << "DEBUG: Dumping Character @" << this << LL_ENDL;
|
||||
dumpCharacter( getRootJoint() );
|
||||
llinfos << "DEBUG: Done." << llendl;
|
||||
LL_INFOS() << "DEBUG: Done." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
// print joint info
|
||||
llinfos << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << llendl;
|
||||
LL_INFOS() << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << LL_ENDL;
|
||||
|
||||
// recurse
|
||||
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
||||
|
|
@ -312,7 +313,7 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL
|
|||
name_iter->second->setWeight(weight, upload_bake);
|
||||
return TRUE;
|
||||
}
|
||||
llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << llendl;
|
||||
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -327,7 +328,7 @@ BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake)
|
|||
index_iter->second->setWeight(weight, upload_bake);
|
||||
return TRUE;
|
||||
}
|
||||
llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << llendl;
|
||||
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -344,7 +345,7 @@ F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << llendl;
|
||||
LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << LL_ENDL;
|
||||
return 0.f;
|
||||
}
|
||||
}
|
||||
|
|
@ -362,7 +363,7 @@ F32 LLCharacter::getVisualParamWeight(const char* param_name)
|
|||
{
|
||||
return name_iter->second->getWeight();
|
||||
}
|
||||
llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << llendl;
|
||||
LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
|
|
@ -378,7 +379,7 @@ F32 LLCharacter::getVisualParamWeight(S32 index)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << llendl;
|
||||
LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
|
||||
return 0.f;
|
||||
}
|
||||
}
|
||||
|
|
@ -412,7 +413,7 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name)
|
|||
{
|
||||
return name_iter->second;
|
||||
}
|
||||
llwarns << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << llendl;
|
||||
LL_WARNS() << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << LL_ENDL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -437,8 +438,8 @@ void LLCharacter::addSharedVisualParam(LLVisualParam *param)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Shared visual parameter " << param->getName() << " does not already exist with ID " <<
|
||||
param->getID() << llendl;
|
||||
LL_WARNS() << "Shared visual parameter " << param->getName() << " does not already exist with ID " <<
|
||||
param->getID() << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -453,8 +454,8 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
|
|||
idxres = mVisualParamIndexMap.insert(visual_param_index_map_t::value_type(index, param));
|
||||
if (!idxres.second)
|
||||
{
|
||||
llwarns << "Visual parameter " << param->getName() << " already exists with same ID as " <<
|
||||
param->getName() << llendl;
|
||||
LL_WARNS() << "Visual parameter " << param->getName() << " already exists with same ID as " <<
|
||||
param->getName() << LL_ENDL;
|
||||
visual_param_index_map_t::iterator index_iter = idxres.first;
|
||||
index_iter->second = param;
|
||||
}
|
||||
|
|
@ -474,7 +475,7 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
|
|||
name_iter->second = param;
|
||||
}
|
||||
}
|
||||
//llinfos << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << llendl;
|
||||
//LL_INFOS() << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << LL_ENDL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@
|
|||
#include "lljoint.h"
|
||||
#include "llmotioncontroller.h"
|
||||
#include "llvisualparam.h"
|
||||
#include "string_table.h"
|
||||
#include "llstringtable.h"
|
||||
#include "llpointer.h"
|
||||
#include "llthread.h"
|
||||
#include "llrefcount.h"
|
||||
|
||||
class LLPolyMesh;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
|
|||
!mCharacter->getJoint("mElbowLeft") ||
|
||||
!mCharacter->getJoint("mWristLeft"))
|
||||
{
|
||||
llwarns << "Invalid skeleton for editing motion!" << llendl;
|
||||
LL_WARNS() << "Invalid skeleton for editing motion!" << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
|
|||
|
||||
if ( ! mParentState->getJoint() )
|
||||
{
|
||||
llinfos << getName() << ": Can't get parent joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get parent joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -215,14 +215,14 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
if (!target.isFinite())
|
||||
{
|
||||
// Don't error out here, set a fail-safe target vector
|
||||
llwarns << "Non finite target in editing motion with target distance of " << target_dist <<
|
||||
" and focus point " << focus_pt << llendl;
|
||||
LL_WARNS() << "Non finite target in editing motion with target distance of " << target_dist <<
|
||||
" and focus point " << focus_pt << LL_ENDL;
|
||||
target.setVec(1.f, 1.f, 1.f);
|
||||
}
|
||||
|
||||
mTarget.setPosition( target + mParentJoint.getPosition());
|
||||
|
||||
// llinfos << "Point At: " << mTarget.getPosition() << llendl;
|
||||
// LL_INFOS() << "Point At: " << mTarget.getPosition() << LL_ENDL;
|
||||
|
||||
// update the ikSolver
|
||||
if (!mTarget.getPosition().isExactlyZero())
|
||||
|
|
@ -232,7 +232,7 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
mIKSolver.solve();
|
||||
|
||||
// use blending...
|
||||
F32 slerp_amt = LLCriticalDamp::getInterpolant(TARGET_LAG_HALF_LIFE);
|
||||
F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TARGET_LAG_HALF_LIFE);
|
||||
shoulderRot = slerp(slerp_amt, mShoulderJoint.getRotation(), shoulderRot);
|
||||
elbowRot = slerp(slerp_amt, mElbowJoint.getRotation(), elbowRot);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,14 +93,14 @@ const LLGesture &LLGesture::operator =(const LLGesture &rhs)
|
|||
|
||||
BOOL LLGesture::trigger(KEY key, MASK mask)
|
||||
{
|
||||
llwarns << "Parent class trigger called: you probably didn't mean this." << llendl;
|
||||
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL LLGesture::trigger(const std::string& trigger_string)
|
||||
{
|
||||
llwarns << "Parent class trigger called: you probably didn't mean this." << llendl;
|
||||
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size)
|
|||
|
||||
if (tmp + sizeof(mKey) + sizeof(mMask) + 16 > buffer + max_size)
|
||||
{
|
||||
llwarns << "Attempt to read past end of buffer, bad data!!!!" << llendl;
|
||||
LL_WARNS() << "Attempt to read past end of buffer, bad data!!!!" << LL_ENDL;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size)
|
|||
|
||||
if (tmp > buffer + max_size)
|
||||
{
|
||||
llwarns << "Read past end of buffer, bad data!!!!" << llendl;
|
||||
LL_WARNS() << "Read past end of buffer, bad data!!!!" << LL_ENDL;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
|
@ -173,27 +173,7 @@ S32 LLGesture::getMaxSerialSize()
|
|||
|
||||
LLGestureList::LLGestureList()
|
||||
: mList(0)
|
||||
{
|
||||
// add some gestures for debugging
|
||||
// LLGesture *gesture = NULL;
|
||||
/*
|
||||
gesture = new LLGesture(KEY_F2, MASK_NONE, ":-)",
|
||||
SND_CHIRP, "dance2", ":-)" );
|
||||
mList.put(gesture);
|
||||
|
||||
gesture = new LLGesture(KEY_F3, MASK_NONE, "/dance",
|
||||
SND_OBJECT_CREATE, "dance3", "(dances)" );
|
||||
mList.put(gesture);
|
||||
|
||||
gesture = new LLGesture(KEY_F4, MASK_NONE, "/boogie",
|
||||
LLUUID::null, "dance4", LLStringUtil::null );
|
||||
mList.put(gesture);
|
||||
|
||||
gesture = new LLGesture(KEY_F5, MASK_SHIFT, "/tongue",
|
||||
LLUUID::null, "Express_Tongue_Out", LLStringUtil::null );
|
||||
mList.put(gesture);
|
||||
*/
|
||||
}
|
||||
{}
|
||||
|
||||
LLGestureList::~LLGestureList()
|
||||
{
|
||||
|
|
@ -203,12 +183,7 @@ LLGestureList::~LLGestureList()
|
|||
|
||||
void LLGestureList::deleteAll()
|
||||
{
|
||||
S32 count = mList.count();
|
||||
for (S32 i = 0; i < count; i++)
|
||||
{
|
||||
delete mList.get(i);
|
||||
}
|
||||
mList.reset();
|
||||
delete_and_clear(mList);
|
||||
}
|
||||
|
||||
// Iterates through space delimited tokens in string, triggering any gestures found.
|
||||
|
|
@ -235,9 +210,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
|
|||
std::string cur_token_lower = *token_iter;
|
||||
LLStringUtil::toLower(cur_token_lower);
|
||||
|
||||
for (S32 i = 0; i < mList.count(); i++)
|
||||
for (U32 i = 0; i < mList.size(); i++)
|
||||
{
|
||||
gesture = mList.get(i);
|
||||
gesture = mList.at(i);
|
||||
if (gesture->trigger(cur_token_lower))
|
||||
{
|
||||
if( !gesture->getOutputString().empty() )
|
||||
|
|
@ -286,9 +261,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
|
|||
|
||||
BOOL LLGestureList::trigger(KEY key, MASK mask)
|
||||
{
|
||||
for (S32 i = 0; i < mList.count(); i++)
|
||||
for (U32 i = 0; i < mList.size(); i++)
|
||||
{
|
||||
LLGesture* gesture = mList.get(i);
|
||||
LLGesture* gesture = mList.at(i);
|
||||
if( gesture )
|
||||
{
|
||||
if (gesture->trigger(key, mask))
|
||||
|
|
@ -298,7 +273,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "NULL gesture in gesture list (" << i << ")" << llendl;
|
||||
LL_WARNS() << "NULL gesture in gesture list (" << i << ")" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
|
@ -308,7 +283,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
|
|||
U8 *LLGestureList::serialize(U8 *buffer) const
|
||||
{
|
||||
// a single S32 serves as the header that tells us how many to read
|
||||
S32 count = mList.count();
|
||||
U32 count = mList.size();
|
||||
htonmemcpy(buffer, &count, MVT_S32, 4);
|
||||
buffer += sizeof(count);
|
||||
|
||||
|
|
@ -331,7 +306,7 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size)
|
|||
|
||||
if (tmp + sizeof(count) > buffer + max_size)
|
||||
{
|
||||
llwarns << "Invalid max_size" << llendl;
|
||||
LL_WARNS() << "Invalid max_size" << LL_ENDL;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
@ -339,20 +314,20 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size)
|
|||
|
||||
if (count > MAX_GESTURES)
|
||||
{
|
||||
llwarns << "Unreasonably large gesture list count in deserialize: " << count << llendl;
|
||||
LL_WARNS() << "Unreasonably large gesture list count in deserialize: " << count << LL_ENDL;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
tmp += sizeof(count);
|
||||
|
||||
mList.reserve_block(count);
|
||||
mList.resize(count);
|
||||
|
||||
for (S32 i = 0; i < count; i++)
|
||||
{
|
||||
mList[i] = create_gesture(&tmp, max_size - (S32)(tmp - buffer));
|
||||
if (tmp - buffer > max_size)
|
||||
{
|
||||
llwarns << "Deserialization read past end of buffer, bad data!!!!" << llendl;
|
||||
LL_WARNS() << "Deserialization read past end of buffer, bad data!!!!" << LL_ENDL;
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include "llanimationstates.h"
|
||||
#include "lluuid.h"
|
||||
#include "llstring.h"
|
||||
#include "lldarray.h"
|
||||
|
||||
class LLGesture
|
||||
{
|
||||
|
|
@ -67,12 +66,12 @@ public:
|
|||
static S32 getMaxSerialSize();
|
||||
|
||||
protected:
|
||||
KEY mKey; // usually a function key
|
||||
MASK mMask; // usually MASK_NONE, or MASK_SHIFT
|
||||
KEY mKey; // usually a function key
|
||||
MASK mMask; // usually MASK_NONE, or MASK_SHIFT
|
||||
std::string mTrigger; // string, no whitespace allowed
|
||||
std::string mTriggerLower; // lowercase version of mTrigger
|
||||
LLUUID mSoundItemID; // ItemID of sound to play, LLUUID::null if none
|
||||
std::string mAnimation; // canonical name of animation or face animation
|
||||
LLUUID mSoundItemID; // ItemID of sound to play, LLUUID::null if none
|
||||
std::string mAnimation; // canonical name of animation or face animation
|
||||
std::string mOutputString; // string to say
|
||||
|
||||
static const S32 MAX_SERIAL_SIZE;
|
||||
|
|
@ -91,9 +90,9 @@ public:
|
|||
BOOL triggerAndReviseString(const std::string &string, std::string* revised_string);
|
||||
|
||||
// Used for construction from UI
|
||||
S32 count() const { return mList.count(); }
|
||||
virtual LLGesture* get(S32 i) const { return mList.get(i); }
|
||||
virtual void put(LLGesture* gesture) { mList.put( gesture ); }
|
||||
S32 count() const { return mList.size(); }
|
||||
virtual LLGesture* get(S32 i) const { return mList.at(i); }
|
||||
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
|
||||
void deleteAll();
|
||||
|
||||
// non-endian-neutral serialization
|
||||
|
|
@ -106,7 +105,7 @@ protected:
|
|||
virtual LLGesture *create_gesture(U8 **buffer, S32 max_size);
|
||||
|
||||
protected:
|
||||
LLDynamicArray<LLGesture*> mList;
|
||||
std::vector<LLGesture*> mList;
|
||||
|
||||
static const S32 SERIAL_HEADER_SIZE;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Requested hand pose out of range. Ignoring requested pose." << llendl;
|
||||
LL_WARNS() << "Requested hand pose out of range. Ignoring requested pose." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
mCharacter->removeAnimationData("Hand Pose Priority");
|
||||
|
||||
// if (requestedHandPose)
|
||||
// llinfos << "Hand Pose " << *requestedHandPose << llendl;
|
||||
// LL_INFOS() << "Hand Pose " << *requestedHandPose << LL_ENDL;
|
||||
|
||||
// if we are still blending...
|
||||
if (mCurrentPose != mNewPose)
|
||||
|
|
|
|||
|
|
@ -104,49 +104,49 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
|
|||
mPelvisJoint = character->getJoint("mPelvis");
|
||||
if ( ! mPelvisJoint )
|
||||
{
|
||||
llinfos << getName() << ": Can't get pelvis joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mRootJoint = character->getJoint("mRoot");
|
||||
if ( ! mRootJoint )
|
||||
{
|
||||
llinfos << getName() << ": Can't get root joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get root joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mTorsoJoint = character->getJoint("mTorso");
|
||||
if ( ! mTorsoJoint )
|
||||
{
|
||||
llinfos << getName() << ": Can't get torso joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mHeadJoint = character->getJoint("mHead");
|
||||
if ( ! mHeadJoint )
|
||||
{
|
||||
llinfos << getName() << ": Can't get head joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mTorsoState->setJoint( character->getJoint("mTorso") );
|
||||
if ( ! mTorsoState->getJoint() )
|
||||
{
|
||||
llinfos << getName() << ": Can't get torso joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mNeckState->setJoint( character->getJoint("mNeck") );
|
||||
if ( ! mNeckState->getJoint() )
|
||||
{
|
||||
llinfos << getName() << ": Can't get neck joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get neck joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mHeadState->setJoint( character->getJoint("mHead") );
|
||||
if ( ! mHeadState->getJoint() )
|
||||
{
|
||||
llinfos << getName() << ": Can't get head joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -182,8 +182,8 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
LLQuaternion currentRootRotWorld = mRootJoint->getWorldRotation();
|
||||
LLQuaternion currentInvRootRotWorld = ~currentRootRotWorld;
|
||||
|
||||
F32 head_slerp_amt = LLCriticalDamp::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE);
|
||||
F32 torso_slerp_amt = LLCriticalDamp::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE);
|
||||
F32 head_slerp_amt = LLSmoothInterpolation::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE);
|
||||
F32 torso_slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE);
|
||||
|
||||
LLVector3* targetPos = (LLVector3*)mCharacter->getAnimationData("LookAtPoint");
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
{
|
||||
LLVector3 headLookAt = *targetPos;
|
||||
|
||||
// llinfos << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << llendl;
|
||||
// LL_INFOS() << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << LL_ENDL;
|
||||
|
||||
F32 lookatDistance = headLookAt.normVec();
|
||||
|
||||
|
|
@ -310,21 +310,21 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character)
|
|||
mHeadJoint = character->getJoint("mHead");
|
||||
if ( ! mHeadJoint )
|
||||
{
|
||||
llinfos << getName() << ": Can't get head joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mLeftEyeState->setJoint( character->getJoint("mEyeLeft") );
|
||||
if ( ! mLeftEyeState->getJoint() )
|
||||
{
|
||||
llinfos << getName() << ": Can't get left eyeball joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get left eyeball joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
mRightEyeState->setJoint( character->getJoint("mEyeRight") );
|
||||
if ( ! mRightEyeState->getJoint() )
|
||||
{
|
||||
llinfos << getName() << ": Can't get Right eyeball joint." << llendl;
|
||||
LL_INFOS() << getName() << ": Can't get Right eyeball joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ const LLMatrix4 &LLJoint::getWorldMatrix()
|
|||
//--------------------------------------------------------------------
|
||||
void LLJoint::setWorldMatrix( const LLMatrix4& mat )
|
||||
{
|
||||
llinfos << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << llendl;
|
||||
LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL;
|
||||
// extract global translation
|
||||
LLVector3 trans( mat.mMatrix[VW][VX],
|
||||
mat.mMatrix[VW][VY],
|
||||
|
|
@ -560,7 +560,7 @@ void LLJoint::clampRotation(LLQuaternion old_rot, LLQuaternion new_rot)
|
|||
// LLVector3 old_axis = main_axis * old_rot;
|
||||
// LLVector3 new_axis = main_axis * new_rot;
|
||||
|
||||
// for (S32 i = 0; i < mConstraintSilhouette.count() - 1; i++)
|
||||
// for (S32 i = 0; i < mConstraintSilhouette.size() - 1; i++)
|
||||
// {
|
||||
// LLVector3 vert1 = mConstraintSilhouette[i];
|
||||
// LLVector3 vert2 = mConstraintSilhouette[i + 1];
|
||||
|
|
|
|||
|
|
@ -31,14 +31,13 @@
|
|||
// Header Files
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#include "linked_lists.h"
|
||||
#include "v3math.h"
|
||||
#include "v4math.h"
|
||||
#include "m4math.h"
|
||||
#include "llquaternion.h"
|
||||
#include "xform.h"
|
||||
#include "lldarray.h"
|
||||
|
||||
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
|
||||
const U32 LL_CHARACTER_MAX_JOINTS = 32; // must be divisible by 4!
|
||||
|
|
|
|||
|
|
@ -135,8 +135,6 @@ void LLJointSolverRP3::setTwist( F32 twist )
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLJointSolverRP3::solve()
|
||||
{
|
||||
// llinfos << llendl;
|
||||
// llinfos << "LLJointSolverRP3::solve()" << llendl;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// setup joints in their base rotations
|
||||
|
|
@ -152,15 +150,15 @@ void LLJointSolverRP3::solve()
|
|||
LLVector3 cPos = mJointC->getWorldPosition();
|
||||
LLVector3 gPos = mJointGoal->getWorldPosition();
|
||||
|
||||
// llinfos << "bPosLocal = " << mJointB->getPosition() << llendl;
|
||||
// llinfos << "cPosLocal = " << mJointC->getPosition() << llendl;
|
||||
// llinfos << "bRotLocal = " << mJointB->getRotation() << llendl;
|
||||
// llinfos << "cRotLocal = " << mJointC->getRotation() << llendl;
|
||||
|
||||
// llinfos << "aPos : " << aPos << llendl;
|
||||
// llinfos << "bPos : " << bPos << llendl;
|
||||
// llinfos << "cPos : " << cPos << llendl;
|
||||
// llinfos << "gPos : " << gPos << llendl;
|
||||
LL_DEBUGS("JointSolver") << "LLJointSolverRP3::solve()" << LL_NEWLINE
|
||||
<< "bPosLocal = " << mJointB->getPosition() << LL_NEWLINE
|
||||
<< "cPosLocal = " << mJointC->getPosition() << LL_NEWLINE
|
||||
<< "bRotLocal = " << mJointB->getRotation() << LL_NEWLINE
|
||||
<< "cRotLocal = " << mJointC->getRotation() << LL_NEWLINE
|
||||
<< "aPos : " << aPos << LL_NEWLINE
|
||||
<< "bPos : " << bPos << LL_NEWLINE
|
||||
<< "cPos : " << cPos << LL_NEWLINE
|
||||
<< "gPos : " << gPos << LL_ENDL;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// get the poleVector in world space
|
||||
|
|
@ -184,11 +182,6 @@ void LLJointSolverRP3::solve()
|
|||
LLVector3 acVec = cPos - aPos;
|
||||
LLVector3 agVec = gPos - aPos;
|
||||
|
||||
// llinfos << "abVec : " << abVec << llendl;
|
||||
// llinfos << "bcVec : " << bcVec << llendl;
|
||||
// llinfos << "acVec : " << acVec << llendl;
|
||||
// llinfos << "agVec : " << agVec << llendl;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// compute needed lengths of those vectors
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
@ -196,16 +189,19 @@ void LLJointSolverRP3::solve()
|
|||
F32 bcLen = bcVec.magVec();
|
||||
F32 agLen = agVec.magVec();
|
||||
|
||||
// llinfos << "abLen : " << abLen << llendl;
|
||||
// llinfos << "bcLen : " << bcLen << llendl;
|
||||
// llinfos << "agLen : " << agLen << llendl;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// compute component vector of (A->B) orthogonal to (A->C)
|
||||
//-------------------------------------------------------------------------
|
||||
LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec));
|
||||
|
||||
// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl;
|
||||
LL_DEBUGS("JointSolver") << "abVec : " << abVec << LL_NEWLINE
|
||||
<< "bcVec : " << bcVec << LL_NEWLINE
|
||||
<< "acVec : " << acVec << LL_NEWLINE
|
||||
<< "agVec : " << agVec << LL_NEWLINE
|
||||
<< "abLen : " << abLen << LL_NEWLINE
|
||||
<< "bcLen : " << bcLen << LL_NEWLINE
|
||||
<< "agLen : " << agLen << LL_NEWLINE
|
||||
<< "abacCompOrthoVec : " << abacCompOrthoVec << LL_ENDL;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// compute the normal of the original ABC plane (and store for later)
|
||||
|
|
@ -273,13 +269,17 @@ void LLJointSolverRP3::solve()
|
|||
|
||||
LLQuaternion bRot(theta - abbcAng, abbcOrthoVec);
|
||||
|
||||
// llinfos << "abbcAng : " << abbcAng << llendl;
|
||||
// llinfos << "abbcOrthoVec : " << abbcOrthoVec << llendl;
|
||||
// llinfos << "agLenSq : " << agLenSq << llendl;
|
||||
// llinfos << "cosTheta : " << cosTheta << llendl;
|
||||
// llinfos << "theta : " << theta << llendl;
|
||||
// llinfos << "bRot : " << bRot << llendl;
|
||||
// llinfos << "theta abbcAng theta-abbcAng: " << theta*180.0/F_PI << " " << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << llendl;
|
||||
LL_DEBUGS("JointSolver") << "abbcAng : " << abbcAng << LL_NEWLINE
|
||||
<< "abbcOrthoVec : " << abbcOrthoVec << LL_NEWLINE
|
||||
<< "agLenSq : " << agLenSq << LL_NEWLINE
|
||||
<< "cosTheta : " << cosTheta << LL_NEWLINE
|
||||
<< "theta : " << theta << LL_NEWLINE
|
||||
<< "bRot : " << bRot << LL_NEWLINE
|
||||
<< "theta abbcAng theta-abbcAng: "
|
||||
<< theta*180.0/F_PI << " "
|
||||
<< abbcAng*180.0f/F_PI << " "
|
||||
<< (theta - abbcAng)*180.0f/F_PI
|
||||
<< LL_ENDL;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// compute rotation that rotates new A->C to A->G
|
||||
|
|
@ -293,9 +293,9 @@ void LLJointSolverRP3::solve()
|
|||
LLQuaternion cgRot;
|
||||
cgRot.shortestArc( acVec, agVec );
|
||||
|
||||
// llinfos << "bcVec : " << bcVec << llendl;
|
||||
// llinfos << "acVec : " << acVec << llendl;
|
||||
// llinfos << "cgRot : " << cgRot << llendl;
|
||||
LL_DEBUGS("JointSolver") << "bcVec : " << bcVec << LL_NEWLINE
|
||||
<< "acVec : " << acVec << LL_NEWLINE
|
||||
<< "cgRot : " << cgRot << LL_ENDL;
|
||||
|
||||
// update A->B and B->C with rotation from C to G
|
||||
abVec = abVec * cgRot;
|
||||
|
|
@ -353,18 +353,16 @@ void LLJointSolverRP3::solve()
|
|||
pRot.shortestArc( abcNorm, apgNorm );
|
||||
}
|
||||
|
||||
// llinfos << "abcNorm = " << abcNorm << llendl;
|
||||
// llinfos << "apgNorm = " << apgNorm << llendl;
|
||||
// llinfos << "pRot = " << pRot << llendl;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// compute twist rotation
|
||||
//-------------------------------------------------------------------------
|
||||
LLQuaternion twistRot( mTwist, agVec );
|
||||
|
||||
// llinfos << "twist : " << mTwist*180.0/F_PI << llendl;
|
||||
// llinfos << "agNormVec: " << agNormVec << llendl;
|
||||
// llinfos << "twistRot : " << twistRot << llendl;
|
||||
LL_DEBUGS("JointSolver") << "abcNorm = " << abcNorm << LL_NEWLINE
|
||||
<< "apgNorm = " << apgNorm << LL_NEWLINE
|
||||
<< "pRot = " << pRot << LL_NEWLINE
|
||||
<< "twist : " << mTwist*180.0/F_PI << LL_NEWLINE
|
||||
<< "twistRot : " << twistRot << LL_ENDL;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// compute rotation of A
|
||||
|
|
|
|||
|
|
@ -103,30 +103,30 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo()
|
|||
{
|
||||
LLKeyframeMotion::JointMotion* joint_motion_p = mJointMotionArray[i];
|
||||
|
||||
llinfos << "\tJoint " << joint_motion_p->mJointName << llendl;
|
||||
LL_INFOS() << "\tJoint " << joint_motion_p->mJointName << LL_ENDL;
|
||||
if (joint_motion_p->mUsage & LLJointState::SCALE)
|
||||
{
|
||||
llinfos << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
|
||||
<< joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << llendl;
|
||||
LL_INFOS() << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
|
||||
<< joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << LL_ENDL;
|
||||
|
||||
total_size += joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey);
|
||||
}
|
||||
if (joint_motion_p->mUsage & LLJointState::ROT)
|
||||
{
|
||||
llinfos << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
|
||||
<< joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << llendl;
|
||||
LL_INFOS() << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
|
||||
<< joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << LL_ENDL;
|
||||
|
||||
total_size += joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey);
|
||||
}
|
||||
if (joint_motion_p->mUsage & LLJointState::POS)
|
||||
{
|
||||
llinfos << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
|
||||
<< joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << llendl;
|
||||
LL_INFOS() << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
|
||||
<< joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << LL_ENDL;
|
||||
|
||||
total_size += joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey);
|
||||
}
|
||||
}
|
||||
llinfos << "Size: " << total_size << " bytes" << llendl;
|
||||
LL_INFOS() << "Size: " << total_size << " bytes" << LL_ENDL;
|
||||
|
||||
return total_size;
|
||||
}
|
||||
|
|
@ -569,7 +569,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
|
|||
|
||||
if (!sVFS)
|
||||
{
|
||||
llerrs << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << llendl;
|
||||
LL_ERRS() << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << LL_ENDL;
|
||||
}
|
||||
|
||||
BOOL success = FALSE;
|
||||
|
|
@ -595,18 +595,18 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
|
|||
|
||||
if (!success)
|
||||
{
|
||||
llwarns << "Can't open animation file " << mID << llendl;
|
||||
LL_WARNS() << "Can't open animation file " << mID << LL_ENDL;
|
||||
mAssetStatus = ASSET_FETCH_FAILED;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
lldebugs << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << llendl;
|
||||
LL_DEBUGS() << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << LL_ENDL;
|
||||
|
||||
LLDataPackerBinaryBuffer dp(anim_data, anim_file_size);
|
||||
|
||||
if (!deserialize(dp))
|
||||
{
|
||||
llwarns << "Failed to decode asset for animation " << getName() << ":" << getID() << llendl;
|
||||
LL_WARNS() << "Failed to decode asset for animation " << getName() << ":" << getID() << LL_ENDL;
|
||||
mAssetStatus = ASSET_FETCH_FAILED;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
|
@ -993,7 +993,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
|
|||
{
|
||||
case CONSTRAINT_TARGET_TYPE_GROUND:
|
||||
target_pos = mCharacter->getPosAgentFromGlobal(constraint->mGroundPos);
|
||||
// llinfos << "Target Pos " << constraint->mGroundPos << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
|
||||
// LL_INFOS() << "Target Pos " << constraint->mGroundPos << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
|
||||
break;
|
||||
case CONSTRAINT_TARGET_TYPE_BODY:
|
||||
target_pos = mCharacter->getVolumePos(shared_data->mTargetConstraintVolume, shared_data->mTargetConstraintOffset);
|
||||
|
|
@ -1044,11 +1044,11 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
|
|||
if (constraint->mSharedData->mChainLength != 0 &&
|
||||
dist_vec_squared(root_pos, target_pos) * 0.95f > constraint->mTotalLength * constraint->mTotalLength)
|
||||
{
|
||||
constraint->mWeight = lerp(constraint->mWeight, 0.f, LLCriticalDamp::getInterpolant(0.1f));
|
||||
constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 0.f, 0.1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
constraint->mWeight = lerp(constraint->mWeight, 1.f, LLCriticalDamp::getInterpolant(0.3f));
|
||||
constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 1.f, 0.3f);
|
||||
}
|
||||
|
||||
F32 weight = constraint->mWeight * ((shared_data->mEaseOutStopTime == 0.f) ? 1.f :
|
||||
|
|
@ -1095,9 +1095,9 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
|
|||
// convert intermediate joint positions to world coordinates
|
||||
positions[joint_num] = ( constraint->mPositions[joint_num] * mPelvisp->getWorldRotation()) + mPelvisp->getWorldPosition();
|
||||
F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f);
|
||||
// llinfos << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
|
||||
// LL_INFOS() << "Interpolant " << LLSmoothInterpolation::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
|
||||
positions[joint_num] = lerp(positions[joint_num], kinematic_position,
|
||||
LLCriticalDamp::getInterpolant(time_constant, FALSE));
|
||||
LLSmoothInterpolation::getInterpolant(time_constant, FALSE));
|
||||
}
|
||||
|
||||
S32 iteration_count;
|
||||
|
|
@ -1126,8 +1126,8 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
|
|||
if ((iteration_count >= MIN_ITERATION_COUNT) &&
|
||||
(num_joints_finished == shared_data->mChainLength - 1))
|
||||
{
|
||||
// llinfos << iteration_count << " iterations on " <<
|
||||
// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
|
||||
// LL_INFOS() << iteration_count << " iterations on " <<
|
||||
// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1243,13 +1243,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if (!dp.unpackU16(version, "version"))
|
||||
{
|
||||
llwarns << "can't read version number" << llendl;
|
||||
LL_WARNS() << "can't read version number" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackU16(sub_version, "sub_version"))
|
||||
{
|
||||
llwarns << "can't read sub version number" << llendl;
|
||||
LL_WARNS() << "can't read sub version number" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1260,28 +1260,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
else if (version != KEYFRAME_MOTION_VERSION || sub_version != KEYFRAME_MOTION_SUBVERSION)
|
||||
{
|
||||
#if LL_RELEASE
|
||||
llwarns << "Bad animation version " << version << "." << sub_version << llendl;
|
||||
LL_WARNS() << "Bad animation version " << version << "." << sub_version << LL_ENDL;
|
||||
return FALSE;
|
||||
#else
|
||||
llerrs << "Bad animation version " << version << "." << sub_version << llendl;
|
||||
LL_ERRS() << "Bad animation version " << version << "." << sub_version << LL_ENDL;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!dp.unpackS32(temp_priority, "base_priority"))
|
||||
{
|
||||
llwarns << "can't read animation base_priority" << llendl;
|
||||
LL_WARNS() << "can't read animation base_priority" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
mJointMotionList->mBasePriority = (LLJoint::JointPriority) temp_priority;
|
||||
|
||||
if (mJointMotionList->mBasePriority >= LLJoint::ADDITIVE_PRIORITY)
|
||||
{
|
||||
mJointMotionList->mBasePriority = (LLJoint::JointPriority)((int)LLJoint::ADDITIVE_PRIORITY-1);
|
||||
mJointMotionList->mBasePriority = (LLJoint::JointPriority)((S32)LLJoint::ADDITIVE_PRIORITY-1);
|
||||
mJointMotionList->mMaxPriority = mJointMotionList->mBasePriority;
|
||||
}
|
||||
else if (mJointMotionList->mBasePriority < LLJoint::USE_MOTION_PRIORITY)
|
||||
{
|
||||
llwarns << "bad animation base_priority " << mJointMotionList->mBasePriority << llendl;
|
||||
LL_WARNS() << "bad animation base_priority " << mJointMotionList->mBasePriority << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1290,14 +1290,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
//-------------------------------------------------------------------------
|
||||
if (!dp.unpackF32(mJointMotionList->mDuration, "duration"))
|
||||
{
|
||||
llwarns << "can't read duration" << llendl;
|
||||
LL_WARNS() << "can't read duration" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mJointMotionList->mDuration > MAX_ANIM_DURATION ||
|
||||
!llfinite(mJointMotionList->mDuration))
|
||||
{
|
||||
llwarns << "invalid animation duration" << llendl;
|
||||
LL_WARNS() << "invalid animation duration" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1306,13 +1306,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
//-------------------------------------------------------------------------
|
||||
if (!dp.unpackString(mJointMotionList->mEmoteName, "emote_name"))
|
||||
{
|
||||
llwarns << "can't read optional_emote_animation" << llendl;
|
||||
LL_WARNS() << "can't read optional_emote_animation" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(mJointMotionList->mEmoteName==mID.asString())
|
||||
{
|
||||
llwarns << "Malformed animation mEmoteName==mID" << llendl;
|
||||
LL_WARNS() << "Malformed animation mEmoteName==mID" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1322,20 +1322,20 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
if (!dp.unpackF32(mJointMotionList->mLoopInPoint, "loop_in_point") ||
|
||||
!llfinite(mJointMotionList->mLoopInPoint))
|
||||
{
|
||||
llwarns << "can't read loop point" << llendl;
|
||||
LL_WARNS() << "can't read loop point" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackF32(mJointMotionList->mLoopOutPoint, "loop_out_point") ||
|
||||
!llfinite(mJointMotionList->mLoopOutPoint))
|
||||
{
|
||||
llwarns << "can't read loop point" << llendl;
|
||||
LL_WARNS() << "can't read loop point" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackS32(mJointMotionList->mLoop, "loop"))
|
||||
{
|
||||
llwarns << "can't read loop" << llendl;
|
||||
LL_WARNS() << "can't read loop" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1345,14 +1345,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
if (!dp.unpackF32(mJointMotionList->mEaseInDuration, "ease_in_duration") ||
|
||||
!llfinite(mJointMotionList->mEaseInDuration))
|
||||
{
|
||||
llwarns << "can't read easeIn" << llendl;
|
||||
LL_WARNS() << "can't read easeIn" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackF32(mJointMotionList->mEaseOutDuration, "ease_out_duration") ||
|
||||
!llfinite(mJointMotionList->mEaseOutDuration))
|
||||
{
|
||||
llwarns << "can't read easeOut" << llendl;
|
||||
LL_WARNS() << "can't read easeOut" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1362,13 +1362,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
U32 word;
|
||||
if (!dp.unpackU32(word, "hand_pose"))
|
||||
{
|
||||
llwarns << "can't read hand pose" << llendl;
|
||||
LL_WARNS() << "can't read hand pose" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(word > LLHandMotion::NUM_HAND_POSES)
|
||||
{
|
||||
llwarns << "invalid LLHandMotion::eHandPose index: " << word << llendl;
|
||||
LL_WARNS() << "invalid LLHandMotion::eHandPose index: " << word << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1380,18 +1380,18 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
U32 num_motions = 0;
|
||||
if (!dp.unpackU32(num_motions, "num_joints"))
|
||||
{
|
||||
llwarns << "can't read number of joints" << llendl;
|
||||
LL_WARNS() << "can't read number of joints" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (num_motions == 0)
|
||||
{
|
||||
llwarns << "no joints in animation" << llendl;
|
||||
LL_WARNS() << "no joints in animation" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
else if (num_motions > LL_CHARACTER_MAX_JOINTS)
|
||||
{
|
||||
llwarns << "too many joints in animation" << llendl;
|
||||
LL_WARNS() << "too many joints in animation" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1412,13 +1412,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
std::string joint_name;
|
||||
if (!dp.unpackString(joint_name, "joint_name"))
|
||||
{
|
||||
llwarns << "can't read joint name" << llendl;
|
||||
LL_WARNS() << "can't read joint name" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (joint_name == "mScreen" || joint_name == "mRoot")
|
||||
{
|
||||
llwarns << "attempted to animate special " << joint_name << " joint" << llendl;
|
||||
LL_WARNS() << "attempted to animate special " << joint_name << " joint" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1428,11 +1428,11 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
LLJoint *joint = mCharacter->getJoint( joint_name );
|
||||
if (joint)
|
||||
{
|
||||
// llinfos << " joint: " << joint_name << llendl;
|
||||
// LL_INFOS() << " joint: " << joint_name << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "joint not found: " << joint_name << llendl;
|
||||
LL_WARNS() << "joint not found: " << joint_name << LL_ENDL;
|
||||
//return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1449,13 +1449,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
S32 joint_priority;
|
||||
if (!dp.unpackS32(joint_priority, "joint_priority"))
|
||||
{
|
||||
llwarns << "can't read joint priority." << llendl;
|
||||
LL_WARNS() << "can't read joint priority." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (joint_priority < LLJoint::USE_MOTION_PRIORITY)
|
||||
{
|
||||
llwarns << "joint priority unknown - too low." << llendl;
|
||||
LL_WARNS() << "joint priority unknown - too low." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1473,7 +1473,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
//---------------------------------------------------------------------
|
||||
if (!dp.unpackS32(joint_motion->mRotationCurve.mNumKeys, "num_rot_keys") || joint_motion->mRotationCurve.mNumKeys < 0)
|
||||
{
|
||||
llwarns << "can't read number of rotation keys" << llendl;
|
||||
LL_WARNS() << "can't read number of rotation keys" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1498,7 +1498,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
if (!dp.unpackF32(time, "time") ||
|
||||
!llfinite(time))
|
||||
{
|
||||
llwarns << "can't read rotation key (" << k << ")" << llendl;
|
||||
LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1507,7 +1507,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
{
|
||||
if (!dp.unpackU16(time_short, "time"))
|
||||
{
|
||||
llwarns << "can't read rotation key (" << k << ")" << llendl;
|
||||
LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1515,7 +1515,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if (time < 0 || time > mJointMotionList->mDuration)
|
||||
{
|
||||
llwarns << "invalid frame time" << llendl;
|
||||
LL_WARNS() << "invalid frame time" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1549,13 +1549,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if( !(rot_key.mRotation.isFinite()) )
|
||||
{
|
||||
llwarns << "non-finite angle in rotation key" << llendl;
|
||||
LL_WARNS() << "non-finite angle in rotation key" << LL_ENDL;
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
llwarns << "can't read rotation key (" << k << ")" << llendl;
|
||||
LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1567,7 +1567,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
//---------------------------------------------------------------------
|
||||
if (!dp.unpackS32(joint_motion->mPositionCurve.mNumKeys, "num_pos_keys") || joint_motion->mPositionCurve.mNumKeys < 0)
|
||||
{
|
||||
llwarns << "can't read number of position keys" << llendl;
|
||||
LL_WARNS() << "can't read number of position keys" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1592,7 +1592,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
if (!dp.unpackF32(pos_key.mTime, "time") ||
|
||||
!llfinite(pos_key.mTime))
|
||||
{
|
||||
llwarns << "can't read position key (" << k << ")" << llendl;
|
||||
LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1600,7 +1600,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
{
|
||||
if (!dp.unpackU16(time_short, "time"))
|
||||
{
|
||||
llwarns << "can't read position key (" << k << ")" << llendl;
|
||||
LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1628,13 +1628,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if( !(pos_key.mPosition.isFinite()) )
|
||||
{
|
||||
llwarns << "non-finite position in key" << llendl;
|
||||
LL_WARNS() << "non-finite position in key" << LL_ENDL;
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
llwarns << "can't read position key (" << k << ")" << llendl;
|
||||
LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1655,13 +1655,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
S32 num_constraints = 0;
|
||||
if (!dp.unpackS32(num_constraints, "num_constraints"))
|
||||
{
|
||||
llwarns << "can't read number of constraints" << llendl;
|
||||
LL_WARNS() << "can't read number of constraints" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (num_constraints > MAX_CONSTRAINTS || num_constraints < 0)
|
||||
{
|
||||
llwarns << "Bad number of constraints... ignoring: " << num_constraints << llendl;
|
||||
LL_WARNS() << "Bad number of constraints... ignoring: " << num_constraints << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1677,7 +1677,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if (!dp.unpackU8(byte, "chain_length"))
|
||||
{
|
||||
llwarns << "can't read constraint chain length" << llendl;
|
||||
LL_WARNS() << "can't read constraint chain length" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1685,21 +1685,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if((U32)constraintp->mChainLength > mJointMotionList->getNumJointMotions())
|
||||
{
|
||||
llwarns << "invalid constraint chain length" << llendl;
|
||||
LL_WARNS() << "invalid constraint chain length" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackU8(byte, "constraint_type"))
|
||||
{
|
||||
llwarns << "can't read constraint type" << llendl;
|
||||
LL_WARNS() << "can't read constraint type" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( byte >= NUM_CONSTRAINT_TYPES )
|
||||
{
|
||||
llwarns << "invalid constraint type" << llendl;
|
||||
LL_WARNS() << "invalid constraint type" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1709,7 +1709,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
U8 bin_data[BIN_DATA_LENGTH+1];
|
||||
if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "source_volume"))
|
||||
{
|
||||
llwarns << "can't read source volume name" << llendl;
|
||||
LL_WARNS() << "can't read source volume name" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1720,21 +1720,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset"))
|
||||
{
|
||||
llwarns << "can't read constraint source offset" << llendl;
|
||||
LL_WARNS() << "can't read constraint source offset" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( !(constraintp->mSourceConstraintOffset.isFinite()) )
|
||||
{
|
||||
llwarns << "non-finite constraint source offset" << llendl;
|
||||
LL_WARNS() << "non-finite constraint source offset" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume"))
|
||||
{
|
||||
llwarns << "can't read target volume name" << llendl;
|
||||
LL_WARNS() << "can't read target volume name" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1754,28 +1754,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset"))
|
||||
{
|
||||
llwarns << "can't read constraint target offset" << llendl;
|
||||
LL_WARNS() << "can't read constraint target offset" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( !(constraintp->mTargetConstraintOffset.isFinite()) )
|
||||
{
|
||||
llwarns << "non-finite constraint target offset" << llendl;
|
||||
LL_WARNS() << "non-finite constraint target offset" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir"))
|
||||
{
|
||||
llwarns << "can't read constraint target direction" << llendl;
|
||||
LL_WARNS() << "can't read constraint target direction" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( !(constraintp->mTargetConstraintDir.isFinite()) )
|
||||
{
|
||||
llwarns << "non-finite constraint target direction" << llendl;
|
||||
LL_WARNS() << "non-finite constraint target direction" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1788,28 +1788,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start") || !llfinite(constraintp->mEaseInStartTime))
|
||||
{
|
||||
llwarns << "can't read constraint ease in start time" << llendl;
|
||||
LL_WARNS() << "can't read constraint ease in start time" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop") || !llfinite(constraintp->mEaseInStopTime))
|
||||
{
|
||||
llwarns << "can't read constraint ease in stop time" << llendl;
|
||||
LL_WARNS() << "can't read constraint ease in stop time" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start") || !llfinite(constraintp->mEaseOutStartTime))
|
||||
{
|
||||
llwarns << "can't read constraint ease out start time" << llendl;
|
||||
LL_WARNS() << "can't read constraint ease out start time" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop") || !llfinite(constraintp->mEaseOutStopTime))
|
||||
{
|
||||
llwarns << "can't read constraint ease out stop time" << llendl;
|
||||
LL_WARNS() << "can't read constraint ease out stop time" << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1829,8 +1829,8 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
LLJoint* parent = joint->getParent();
|
||||
if (!parent)
|
||||
{
|
||||
llwarns << "Joint with no parent: " << joint->getName()
|
||||
<< " Emote: " << mJointMotionList->mEmoteName << llendl;
|
||||
LL_WARNS() << "Joint with no parent: " << joint->getName()
|
||||
<< " Emote: " << mJointMotionList->mEmoteName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
joint = parent;
|
||||
|
|
@ -1841,7 +1841,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
|
||||
if ( !constraint_joint )
|
||||
{
|
||||
llwarns << "Invalid joint " << j << llendl;
|
||||
LL_WARNS() << "Invalid joint " << j << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1853,7 +1853,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||
}
|
||||
if (constraintp->mJointStateIndices[i] < 0 )
|
||||
{
|
||||
llwarns << "No joint index for constraint " << i << llendl;
|
||||
LL_WARNS() << "No joint index for constraint " << i << LL_ENDL;
|
||||
delete constraintp;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -2174,7 +2174,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
|
|||
U8* buffer = new U8[size];
|
||||
file.read((U8*)buffer, size); /*Flawfinder: ignore*/
|
||||
|
||||
lldebugs << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << llendl;
|
||||
LL_DEBUGS() << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL;
|
||||
|
||||
// <FS:ND> Handle invalid files that cannot be properly loaded
|
||||
try
|
||||
|
|
@ -2188,7 +2188,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl;
|
||||
LL_WARNS() << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL;
|
||||
motionp->mAssetStatus = ASSET_FETCH_FAILED;
|
||||
}
|
||||
|
||||
|
|
@ -2198,7 +2198,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
|
|||
{
|
||||
// Maybe delete the file from the VFS here? It's corrupt, deleting it should be harmless?
|
||||
|
||||
llwarns << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << " error: " << ex.what() << llendl;
|
||||
LL_WARNS() << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << " error: " << ex.what() << LL_ENDL;
|
||||
motionp->mAssetStatus = ASSET_FETCH_FAILED;
|
||||
}
|
||||
// </FS:ND>
|
||||
|
|
@ -2207,13 +2207,13 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl;
|
||||
LL_WARNS() << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL;
|
||||
motionp->mAssetStatus = ASSET_FETCH_FAILED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "No existing motion for asset data. UUID: " << asset_uuid << llendl;
|
||||
LL_WARNS() << "No existing motion for asset data. UUID: " << asset_uuid << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2227,9 +2227,9 @@ void LLKeyframeDataCache::dumpDiagInfo()
|
|||
|
||||
char buf[1024]; /* Flawfinder: ignore */
|
||||
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
llinfos << " Global Motion Table (DEBUG only)" << llendl;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
LL_INFOS() << " Global Motion Table (DEBUG only)" << LL_ENDL;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
|
||||
// print each loaded mesh, and it's memory usage
|
||||
for (keyframe_data_map_t::iterator map_it = sKeyframeDataMap.begin();
|
||||
|
|
@ -2239,18 +2239,18 @@ void LLKeyframeDataCache::dumpDiagInfo()
|
|||
|
||||
LLKeyframeMotion::JointMotionList *motion_list_p = map_it->second.mList;
|
||||
|
||||
llinfos << "Motion: " << map_it->first << llendl;
|
||||
LL_INFOS() << "Motion: " << map_it->first << LL_ENDL;
|
||||
|
||||
joint_motion_kb = motion_list_p->dumpDiagInfo();
|
||||
|
||||
total_size += joint_motion_kb;
|
||||
}
|
||||
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
llinfos << "Motions\tTotal Size" << llendl;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
LL_INFOS() << "Motions\tTotal Size" << LL_ENDL;
|
||||
snprintf(buf, sizeof(buf), "%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size ); /* Flawfinder: ignore */
|
||||
llinfos << buf << llendl;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
LL_INFOS() << buf << LL_ENDL;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2401,8 +2401,7 @@ LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* sh
|
|||
mTargetVolume = NULL;
|
||||
mFixupDistanceRMS = 0.f;
|
||||
|
||||
int i;
|
||||
for (i=0; i<MAX_CHAIN_LENGTH; ++i)
|
||||
for (S32 i=0; i<MAX_CHAIN_LENGTH; ++i)
|
||||
{
|
||||
mJointLengths[i] = 0.f;
|
||||
mJointLengthFractions[i] = 0.f;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
|||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
||||
{
|
||||
const ParameterizedMotion& paramMotion = *iter2;
|
||||
// llinfos << "Weight for pose " << paramMotion.mMotion->getName() << " is " << paramMotion.mMotion->getPose()->getWeight() << llendl;
|
||||
// LL_INFOS() << "Weight for pose " << paramMotion.mMotion->getName() << " is " << paramMotion.mMotion->getPose()->getWeight() << LL_ENDL;
|
||||
paramMotion.mMotion->getPose()->setWeight(0.f);
|
||||
}
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
|||
F32* paramValue = (F32 *)mCharacter->getAnimationData(paramName);
|
||||
if (NULL == paramValue) // unexpected, but...
|
||||
{
|
||||
llwarns << "paramValue == NULL" << llendl;
|
||||
LL_WARNS() << "paramValue == NULL" << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -256,8 +256,8 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
|||
firstPose->setWeight(first_weight * weightFactor);
|
||||
secondPose->setWeight(second_weight * weightFactor);
|
||||
|
||||
// llinfos << "Parameter " << *paramName << ": " << *paramValue << llendl;
|
||||
// llinfos << "Weights " << firstPose->getWeight() << " " << secondPose->getWeight() << llendl;
|
||||
// LL_INFOS() << "Parameter " << *paramName << ": " << *paramValue << LL_ENDL;
|
||||
// LL_INFOS() << "Weights " << firstPose->getWeight() << " " << secondPose->getWeight() << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else if (firstMotion && !secondMotion)
|
||||
|
|
@ -269,7 +269,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
|||
// blend poses
|
||||
mPoseBlender.blendAndApply();
|
||||
|
||||
llinfos << "Param Motion weight " << mPoseBlender.getBlendedPose()->getWeight() << llendl;
|
||||
LL_INFOS() << "Param Motion weight " << mPoseBlender.getBlendedPose()->getWeight() << LL_ENDL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -361,7 +361,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
|||
|
||||
if (!fp || fileSize == 0)
|
||||
{
|
||||
llinfos << "ERROR: can't open: " << path << llendl;
|
||||
LL_INFOS() << "ERROR: can't open: " << path << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -400,11 +400,11 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
|||
|
||||
if ( error )
|
||||
{
|
||||
llinfos << "ERROR: error while reading from " << path << llendl;
|
||||
LL_INFOS() << "ERROR: error while reading from " << path << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
llinfos << "Loading parametric keyframe data for: " << getName() << llendl;
|
||||
LL_INFOS() << "Loading parametric keyframe data for: " << getName() << LL_ENDL;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// parse the text and build keyframe data structures
|
||||
|
|
@ -427,7 +427,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
|||
if (num == 0 || num == EOF) break;
|
||||
if ((num != 3))
|
||||
{
|
||||
llinfos << "WARNING: can't read parametric motion" << llendl;
|
||||
LL_INFOS() << "WARNING: can't read parametric motion" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
#include "lljointstate.h"
|
||||
#include "v3math.h"
|
||||
#include "llquaternion.h"
|
||||
#include "linked_lists.h"
|
||||
#include "llkeyframemotion.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch
|
|||
!mKneeRightState ||
|
||||
!mAnkleRightState )
|
||||
{
|
||||
llinfos << getName() << ": Can't find necessary joint states" << llendl;
|
||||
LL_INFOS() << getName() << ": Can't find necessary joint states" << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -329,9 +329,9 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
mKneeRightState->setRotation( mKneeRightJoint.getRotation() );
|
||||
mAnkleRightState->setRotation( mAnkleRightJoint.getRotation() );
|
||||
|
||||
//llinfos << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << llendl;
|
||||
//LL_INFOS() << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << LL_ENDL;
|
||||
|
||||
// llinfos << "DEBUG: " << speed << " : " << mTrackAnkles << llendl;
|
||||
// LL_INFOS() << "DEBUG: " << speed << " : " << mTrackAnkles << LL_ENDL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara
|
|||
mPelvisState->setJoint( mPelvisJoint );
|
||||
if ( !mPelvisJoint )
|
||||
{
|
||||
llwarns << getName() << ": Can't get pelvis joint." << llendl;
|
||||
LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
// but this will cause the animation playback rate calculation below to
|
||||
// kick in too slowly and sometimes start playing the animation in reverse.
|
||||
|
||||
//mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLCriticalDamp::getInterpolant(0.1f));
|
||||
//mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLSmoothInterpolation::getInterpolant(0.1f));
|
||||
|
||||
////F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL * (llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED);
|
||||
//F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL;
|
||||
|
|
@ -290,7 +290,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
F32 desired_speed_multiplier = llclamp(speed / foot_speed, min_speed_multiplier, ANIM_SPEED_MAX);
|
||||
|
||||
// blend towards new speed adjustment value
|
||||
F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(SPEED_ADJUST_TIME_CONSTANT));
|
||||
F32 new_speed_adjust = LLSmoothInterpolation::lerp(mAdjustedSpeed, desired_speed_multiplier, SPEED_ADJUST_TIME_CONSTANT);
|
||||
|
||||
// limit that rate at which the speed adjustment changes
|
||||
F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time);
|
||||
|
|
@ -308,8 +308,8 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
{ // standing/turning
|
||||
|
||||
// damp out speed adjustment to 0
|
||||
mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(0.2f));
|
||||
//mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(0.2f));
|
||||
mAnimSpeed = LLSmoothInterpolation::lerp(mAnimSpeed, 1.f, 0.2f);
|
||||
//mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLSmoothInterpolation::getInterpolant(0.2f));
|
||||
}
|
||||
|
||||
// broadcast walk speed change
|
||||
|
|
@ -353,7 +353,7 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac
|
|||
mPelvisState->setJoint( pelvisJoint );
|
||||
if ( !pelvisJoint )
|
||||
{
|
||||
llwarns << getName() << ": Can't get pelvis joint." << llendl;
|
||||
LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor;
|
||||
|
||||
// roll is critically damped interpolation between current roll and angular velocity-derived target roll
|
||||
mRoll = lerp(mRoll, target_roll, LLCriticalDamp::getInterpolant(0.1f));
|
||||
mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, U32Milliseconds(100));
|
||||
|
||||
LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
|
||||
mPelvisState->setRotation(roll);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ LLMotion::LLMotion( const LLUUID &id ) :
|
|||
mDeactivateCallback(NULL),
|
||||
mDeactivateCallbackUserData(NULL)
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
for (S32 i=0; i<3; ++i)
|
||||
memset(&mJointSignature[i][0], 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS);
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ void LLMotion::fadeOut()
|
|||
{
|
||||
if (mFadeWeight > 0.01f)
|
||||
{
|
||||
mFadeWeight = lerp(mFadeWeight, 0.f, LLCriticalDamp::getInterpolant(0.15f));
|
||||
mFadeWeight = lerp(mFadeWeight, 0.f, LLSmoothInterpolation::getInterpolant(0.15f));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -88,7 +88,7 @@ void LLMotion::fadeIn()
|
|||
{
|
||||
if (mFadeWeight < 0.99f)
|
||||
{
|
||||
mFadeWeight = lerp(mFadeWeight, 1.f, LLCriticalDamp::getInterpolant(0.15f));
|
||||
mFadeWeight = lerp(mFadeWeight, 1.f, LLSmoothInterpolation::getInterpolant(0.15f));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -204,10 +204,10 @@ public:
|
|||
LLMotionBlendType getBlendType() { return NORMAL_BLEND; }
|
||||
F32 getMinPixelArea() { return 0.f; }
|
||||
|
||||
LLMotionInitStatus onInitialize(LLCharacter*) { llinfos << "LLTestMotion::onInitialize()" << llendl; return STATUS_SUCCESS; }
|
||||
BOOL onActivate() { llinfos << "LLTestMotion::onActivate()" << llendl; return TRUE; }
|
||||
BOOL onUpdate(F32 time, U8* joint_mask) { llinfos << "LLTestMotion::onUpdate(" << time << ")" << llendl; return TRUE; }
|
||||
void onDeactivate() { llinfos << "LLTestMotion::onDeactivate()" << llendl; }
|
||||
LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; }
|
||||
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; }
|
||||
void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "linden_common.h"
|
||||
|
||||
#include "llmotioncontroller.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llkeyframemotion.h"
|
||||
#include "llmath.h"
|
||||
#include "lltimer.h"
|
||||
|
|
@ -76,7 +77,7 @@ LLMotionRegistry::~LLMotionRegistry()
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
|
||||
{
|
||||
// llinfos << "Registering motion: " << name << llendl;
|
||||
// LL_INFOS() << "Registering motion: " << name << LL_ENDL;
|
||||
if (!is_in_map(mMotionTable, id))
|
||||
{
|
||||
mMotionTable[id] = constructor;
|
||||
|
|
@ -236,7 +237,7 @@ void LLMotionController::purgeExcessMotions()
|
|||
|
||||
if (mLoadedMotions.size() > 2*MAX_MOTION_INSTANCES)
|
||||
{
|
||||
LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << llendl;
|
||||
LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +365,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
|
|||
switch(stat)
|
||||
{
|
||||
case LLMotion::STATUS_FAILURE:
|
||||
llinfos << "Motion " << id << " init failed." << llendl;
|
||||
LL_INFOS() << "Motion " << id << " init failed." << LL_ENDL;
|
||||
sRegistry.markBad(id);
|
||||
delete motion;
|
||||
return NULL;
|
||||
|
|
@ -376,7 +377,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
|
|||
mLoadedMotions.insert(motion);
|
||||
break;
|
||||
default:
|
||||
llerrs << "Invalid initialization status" << llendl;
|
||||
LL_ERRS() << "Invalid initialization status" << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -422,7 +423,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
// llinfos << "Starting motion " << name << llendl;
|
||||
// LL_INFOS() << "Starting motion " << name << LL_ENDL;
|
||||
return activateMotionInstance(motion, mAnimTime - start_offset);
|
||||
}
|
||||
|
||||
|
|
@ -545,7 +546,7 @@ void LLMotionController::updateIdleActiveMotions()
|
|||
//-----------------------------------------------------------------------------
|
||||
// updateMotionsByType()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_MOTION_ON_UPDATE("Motion onUpdate");
|
||||
static LLTrace::BlockTimerStatHandle FTM_MOTION_ON_UPDATE("Motion onUpdate");
|
||||
|
||||
void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
|
||||
{
|
||||
|
|
@ -705,7 +706,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
|||
|
||||
// perform motion update
|
||||
{
|
||||
LLFastTimer t(FTM_MOTION_ON_UPDATE);
|
||||
LL_RECORD_BLOCK_TIME(FTM_MOTION_ON_UPDATE);
|
||||
update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature);
|
||||
}
|
||||
}
|
||||
|
|
@ -785,7 +786,7 @@ void LLMotionController::updateLoadingMotions()
|
|||
}
|
||||
else if (status == LLMotion::STATUS_FAILURE)
|
||||
{
|
||||
llinfos << "Motion " << motionp->getID() << " init failed." << llendl;
|
||||
LL_INFOS() << "Motion " << motionp->getID() << " init failed." << LL_ENDL;
|
||||
sRegistry.markBad(motionp->getID());
|
||||
mLoadingMotions.erase(curiter);
|
||||
motion_set_t::iterator found_it = mDeprecatedMotions.find(motionp);
|
||||
|
|
@ -887,7 +888,7 @@ void LLMotionController::updateMotions(bool force_update)
|
|||
}
|
||||
|
||||
mHasRunOnce = TRUE;
|
||||
// llinfos << "Motion controller time " << motionTimer.getElapsedTimeF32() << llendl;
|
||||
// LL_INFOS() << "Motion controller time " << motionTimer.getElapsedTimeF32() << LL_ENDL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -1043,7 +1044,7 @@ LLMotion* LLMotionController::findMotion(const LLUUID& id) const
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLMotionController::dumpMotions()
|
||||
{
|
||||
llinfos << "=====================================" << llendl;
|
||||
LL_INFOS() << "=====================================" << LL_ENDL;
|
||||
for (motion_map_t::iterator iter = mAllMotions.begin();
|
||||
iter != mAllMotions.end(); iter++)
|
||||
{
|
||||
|
|
@ -1058,7 +1059,7 @@ void LLMotionController::dumpMotions()
|
|||
state_string += std::string("A");
|
||||
if (mDeprecatedMotions.find(motion) != mDeprecatedMotions.end())
|
||||
state_string += std::string("D");
|
||||
llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl;
|
||||
LL_INFOS() << gAnimLibrary.animationName(id) << " " << state_string << LL_ENDL;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1117,7 +1118,7 @@ void LLMotionController::pauseAllMotions()
|
|||
{
|
||||
if (!mPaused)
|
||||
{
|
||||
//llinfos << "Pausing animations..." << llendl;
|
||||
//LL_INFOS() << "Pausing animations..." << LL_ENDL;
|
||||
mPaused = TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1130,7 +1131,7 @@ void LLMotionController::unpauseAllMotions()
|
|||
{
|
||||
if (mPaused)
|
||||
{
|
||||
//llinfos << "Unpausing animations..." << llendl;
|
||||
//LL_INFOS() << "Unpausing animations..." << LL_ENDL;
|
||||
mPaused = FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <map>
|
||||
#include <deque>
|
||||
|
||||
#include "lluuidhashmap.h"
|
||||
#include "llmotion.h"
|
||||
#include "llpose.h"
|
||||
#include "llframetimer.h"
|
||||
|
|
|
|||
|
|
@ -147,9 +147,9 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
|||
dp.unpackS32(version, "version");
|
||||
if (version != GESTURE_VERSION)
|
||||
{
|
||||
llwarns << "Bad LLMultiGesture version " << version
|
||||
LL_WARNS() << "Bad LLMultiGesture version " << version
|
||||
<< " should be " << GESTURE_VERSION
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
|||
dp.unpackS32(count, "step_count");
|
||||
if (count < 0)
|
||||
{
|
||||
llwarns << "Bad LLMultiGesture step count " << count << llendl;
|
||||
LL_WARNS() << "Bad LLMultiGesture step count " << count << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
|||
}
|
||||
default:
|
||||
{
|
||||
llwarns << "Bad LLMultiGesture step type " << type << llendl;
|
||||
LL_WARNS() << "Bad LLMultiGesture step type " << type << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -222,10 +222,10 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
|
|||
|
||||
void LLMultiGesture::dump()
|
||||
{
|
||||
llinfos << "key " << S32(mKey) << " mask " << U32(mMask)
|
||||
LL_INFOS() << "key " << S32(mKey) << " mask " << U32(mMask)
|
||||
<< " trigger " << mTrigger
|
||||
<< " replace " << mReplaceText
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
U32 i;
|
||||
for (i = 0; i < mSteps.size(); ++i)
|
||||
{
|
||||
|
|
@ -313,10 +313,10 @@ std::vector<std::string> LLGestureStepAnimation::getLabel() const
|
|||
|
||||
void LLGestureStepAnimation::dump()
|
||||
{
|
||||
llinfos << "step animation " << mAnimName
|
||||
LL_INFOS() << "step animation " << mAnimName
|
||||
<< " id " << mAnimAssetID
|
||||
<< " flags " << mFlags
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
@ -375,10 +375,10 @@ std::vector<std::string> LLGestureStepSound::getLabel() const
|
|||
|
||||
void LLGestureStepSound::dump()
|
||||
{
|
||||
llinfos << "step sound " << mSoundName
|
||||
LL_INFOS() << "step sound " << mSoundName
|
||||
<< " id " << mSoundAssetID
|
||||
<< " flags " << mFlags
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -431,9 +431,9 @@ std::vector<std::string> LLGestureStepChat::getLabel() const
|
|||
|
||||
void LLGestureStepChat::dump()
|
||||
{
|
||||
llinfos << "step chat " << mChatText
|
||||
LL_INFOS() << "step chat " << mChatText
|
||||
<< " flags " << mFlags
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -504,7 +504,7 @@ std::vector<std::string> LLGestureStepWait::getLabel() const
|
|||
|
||||
void LLGestureStepWait::dump()
|
||||
{
|
||||
llinfos << "step wait " << mWaitSeconds
|
||||
LL_INFOS() << "step wait " << mWaitSeconds
|
||||
<< " flags " << mFlags
|
||||
<< llendl;
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include "lljointstate.h"
|
||||
#include "lljoint.h"
|
||||
#include "llmap.h"
|
||||
#include "llpointer.h"
|
||||
|
||||
#include <map>
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_stat
|
|||
Transitions::iterator transition_it = state_transitions->find(&transition);
|
||||
if (transition_it != state_transitions->end())
|
||||
{
|
||||
llerrs << "LLStateTable::addDirectedTransition() : transition already exists" << llendl;
|
||||
LL_ERRS() << "LLStateTable::addDirectedTransition() : transition already exists" << LL_ENDL;
|
||||
return FALSE; // transition already exists
|
||||
}
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename)
|
|||
|
||||
if (!dot_file)
|
||||
{
|
||||
llwarns << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << llendl;
|
||||
LL_WARNS() << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << LL_ENDL;
|
||||
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");
|
||||
|
|
@ -368,7 +368,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
|
|||
|
||||
if (NULL == mCurrentState)
|
||||
{
|
||||
llwarns << "mCurrentState == NULL; aborting processTransition()" << llendl;
|
||||
LL_WARNS() << "mCurrentState == NULL; aborting processTransition()" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
|
|||
|
||||
if (NULL == new_state)
|
||||
{
|
||||
llwarns << "new_state == NULL; aborting processTransition()" << llendl;
|
||||
LL_WARNS() << "new_state == NULL; aborting processTransition()" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -389,9 +389,9 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
|
|||
mCurrentState = new_state;
|
||||
mCurrentState->onEntry(user_data);
|
||||
#if FSM_PRINT_STATE_TRANSITIONS
|
||||
llinfos << "Entering state " << mCurrentState->getName() <<
|
||||
LL_INFOS() << "Entering state " << mCurrentState->getName() <<
|
||||
" on transition " << transition.getName() << " from state " <<
|
||||
mLastState->getName() << llendl;
|
||||
mLastState->getName() << LL_ENDL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac
|
|||
!mTorsoJoint ||
|
||||
!mRightHandJoint)
|
||||
{
|
||||
llwarns << "Invalid skeleton for targeting motion!" << llendl;
|
||||
LL_WARNS() << "Invalid skeleton for targeting motion!" << LL_ENDL;
|
||||
return STATUS_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ BOOL LLTargetingMotion::onActivate()
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
|
||||
{
|
||||
F32 slerp_amt = LLCriticalDamp::getInterpolant(TORSO_TARGET_HALF_LIFE);
|
||||
F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_TARGET_HALF_LIFE);
|
||||
|
||||
LLVector3 target;
|
||||
LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint");
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
|||
mDefaultWeight = llclamp( default_weight, mMinWeight, mMaxWeight );
|
||||
if( default_weight != mDefaultWeight )
|
||||
{
|
||||
llwarns << "value_default attribute is out of range in node " << mName << " " << default_weight << llendl;
|
||||
LL_WARNS() << "value_default attribute is out of range in node " << mName << " " << default_weight << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Avatar file: <param> has invalid sex attribute: " << sex << llendl;
|
||||
LL_WARNS() << "Avatar file: <param> has invalid sex attribute: " << sex << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if( !node->getFastAttributeString( name_string, mName ) )
|
||||
{
|
||||
llwarns << "Avatar file: <param> is missing name attribute" << llendl;
|
||||
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -346,7 +346,7 @@ void LLVisualParam::setParamLocation(EParamLocation loc)
|
|||
}
|
||||
else
|
||||
{
|
||||
lldebugs << "param location is already " << mParamLocation << ", not slamming to " << loc << llendl;
|
||||
LL_DEBUGS() << "param location is already " << mParamLocation << ", not slamming to " << loc << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ enum EVisualParamGroup
|
|||
VISUAL_PARAM_GROUP_TWEAKABLE,
|
||||
VISUAL_PARAM_GROUP_ANIMATABLE,
|
||||
VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT,
|
||||
VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE, // deprecated params that used to be tweakable.
|
||||
NUM_VISUAL_PARAM_GROUPS
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -26,22 +26,20 @@ include_directories(
|
|||
# ${LLCOMMON_LIBRARIES})
|
||||
|
||||
set(llcommon_SOURCE_FILES
|
||||
imageids.cpp
|
||||
indra_constants.cpp
|
||||
llallocator.cpp
|
||||
llallocator_heap_profile.cpp
|
||||
llapp.cpp
|
||||
llapr.cpp
|
||||
llassettype.cpp
|
||||
llavatarname.cpp
|
||||
llbase32.cpp
|
||||
llbase64.cpp
|
||||
llbitpack.cpp
|
||||
llcommon.cpp
|
||||
llcommonutils.cpp
|
||||
llcoros.cpp
|
||||
llcrc.cpp
|
||||
llcriticaldamp.cpp
|
||||
llcursortypes.cpp
|
||||
lldate.cpp
|
||||
lldeadmantimer.cpp
|
||||
lldependencies.cpp
|
||||
|
|
@ -59,7 +57,6 @@ set(llcommon_SOURCE_FILES
|
|||
llfile.cpp
|
||||
llfindlocale.cpp
|
||||
llfixedbuffer.cpp
|
||||
llfoldertype.cpp
|
||||
llformat.cpp
|
||||
llframetimer.cpp
|
||||
llheartbeat.cpp
|
||||
|
|
@ -69,15 +66,15 @@ set(llcommon_SOURCE_FILES
|
|||
llleaplistener.cpp
|
||||
llliveappconfig.cpp
|
||||
lllivefile.cpp
|
||||
lllog.cpp
|
||||
llmd5.cpp
|
||||
llmemory.cpp
|
||||
llmemorystream.cpp
|
||||
llmetrics.cpp
|
||||
llmetricperformancetester.cpp
|
||||
llmortician.cpp
|
||||
lloptioninterface.cpp
|
||||
llmutex.cpp
|
||||
llptrto.cpp
|
||||
llpredicate.cpp
|
||||
llprocess.cpp
|
||||
llprocessor.cpp
|
||||
llprocinfo.cpp
|
||||
|
|
@ -90,9 +87,7 @@ set(llcommon_SOURCE_FILES
|
|||
llsdserialize.cpp
|
||||
llsdserialize_xml.cpp
|
||||
llsdutil.cpp
|
||||
llsecondlifeurls.cpp
|
||||
llsingleton.cpp
|
||||
llstat.cpp
|
||||
llstacktrace.cpp
|
||||
llstreamqueue.cpp
|
||||
llstreamtools.cpp
|
||||
|
|
@ -100,14 +95,16 @@ set(llcommon_SOURCE_FILES
|
|||
llstringtable.cpp
|
||||
llsys.cpp
|
||||
llthread.cpp
|
||||
llthreadlocalstorage.cpp
|
||||
llthreadsafequeue.cpp
|
||||
lltimer.cpp
|
||||
lltrace.cpp
|
||||
lltraceaccumulators.cpp
|
||||
lltracerecording.cpp
|
||||
lltracethreadrecorder.cpp
|
||||
lluri.cpp
|
||||
lluuid.cpp
|
||||
llworkerthread.cpp
|
||||
metaclass.cpp
|
||||
metaproperty.cpp
|
||||
reflective.cpp
|
||||
timing.cpp
|
||||
u64.cpp
|
||||
)
|
||||
|
|
@ -115,53 +112,35 @@ set(llcommon_SOURCE_FILES
|
|||
set(llcommon_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
bitpack.h
|
||||
ctype_workaround.h
|
||||
doublelinkedlist.h
|
||||
fix_macros.h
|
||||
imageids.h
|
||||
indra_constants.h
|
||||
linden_common.h
|
||||
linked_lists.h
|
||||
llaccountingcost.h
|
||||
llalignedarray.h
|
||||
llallocator.h
|
||||
llallocator_heap_profile.h
|
||||
llagentconstants.h
|
||||
llavatarname.h
|
||||
llapp.h
|
||||
llapr.h
|
||||
llassettype.h
|
||||
llassoclist.h
|
||||
llavatarconstants.h
|
||||
llbase32.h
|
||||
llbase64.h
|
||||
llbitpack.h
|
||||
llboost.h
|
||||
llchat.h
|
||||
llclickaction.h
|
||||
llcommon.h
|
||||
llcommonutils.h
|
||||
llcoros.h
|
||||
llcrc.h
|
||||
llcriticaldamp.h
|
||||
llcursortypes.h
|
||||
lldarray.h
|
||||
lldarrayptr.h
|
||||
lldate.h
|
||||
lldeadmantimer.h
|
||||
lldefs.h
|
||||
lldependencies.h
|
||||
lldeleteutils.h
|
||||
lldepthstack.h
|
||||
lldictionary.h
|
||||
lldlinked.h
|
||||
lldoubledispatch.h
|
||||
lldqueueptr.h
|
||||
llendianswizzle.h
|
||||
llenum.h
|
||||
llerror.h
|
||||
llerrorcontrol.h
|
||||
llerrorlegacy.h
|
||||
llerrorthread.h
|
||||
llevent.h
|
||||
lleventapi.h
|
||||
|
|
@ -170,33 +149,25 @@ set(llcommon_HEADER_FILES
|
|||
lleventfilter.h
|
||||
llevents.h
|
||||
lleventemitter.h
|
||||
llextendedstatus.h
|
||||
llfasttimer.h
|
||||
llfile.h
|
||||
llfindlocale.h
|
||||
llfixedbuffer.h
|
||||
llfoldertype.h
|
||||
llformat.h
|
||||
llframetimer.h
|
||||
llhandle.h
|
||||
llhash.h
|
||||
llheartbeat.h
|
||||
llhttpstatuscodes.h
|
||||
llindexedqueue.h
|
||||
llindexedvector.h
|
||||
llinitparam.h
|
||||
llinstancetracker.h
|
||||
llkeythrottle.h
|
||||
lllazy.h
|
||||
llleap.h
|
||||
llleaplistener.h
|
||||
lllistenerwrapper.h
|
||||
lllinkedqueue.h
|
||||
llliveappconfig.h
|
||||
lllivefile.h
|
||||
lllocalidhashmap.h
|
||||
lllog.h
|
||||
lllslconstants.h
|
||||
llmap.h
|
||||
llmd5.h
|
||||
llmemory.h
|
||||
llmemorystream.h
|
||||
|
|
@ -204,15 +175,13 @@ set(llcommon_HEADER_FILES
|
|||
llmetricperformancetester.h
|
||||
llmortician.h
|
||||
llnametable.h
|
||||
lloptioninterface.h
|
||||
llpointer.h
|
||||
llpredicate.h
|
||||
llpreprocessor.h
|
||||
llpriqueuemap.h
|
||||
llprocess.h
|
||||
llprocessor.h
|
||||
llprocinfo.h
|
||||
llptrskiplist.h
|
||||
llptrskipmap.h
|
||||
llptrto.h
|
||||
llqueuedthread.h
|
||||
llrand.h
|
||||
|
|
@ -226,16 +195,9 @@ set(llcommon_HEADER_FILES
|
|||
llsdserialize.h
|
||||
llsdserialize_xml.h
|
||||
llsdutil.h
|
||||
llsecondlifeurls.h
|
||||
llsimplehash.h
|
||||
llsingleton.h
|
||||
llskiplist.h
|
||||
llskipmap.h
|
||||
llsortedvector.h
|
||||
llstack.h
|
||||
llstacktrace.h
|
||||
llstat.h
|
||||
llstatenums.h
|
||||
llstl.h
|
||||
llstreamqueue.h
|
||||
llstreamtools.h
|
||||
|
|
@ -245,29 +207,24 @@ set(llcommon_HEADER_FILES
|
|||
llstaticstringtable.h
|
||||
llsys.h
|
||||
llthread.h
|
||||
llthreadlocalstorage.h
|
||||
llthreadsafequeue.h
|
||||
lltimer.h
|
||||
lltrace.h
|
||||
lltraceaccumulators.h
|
||||
lltracerecording.h
|
||||
lltracethreadrecorder.h
|
||||
lltreeiterators.h
|
||||
lltypeinfolookup.h
|
||||
llunits.h
|
||||
llunittype.h
|
||||
lluri.h
|
||||
lluuid.h
|
||||
lluuidhashmap.h
|
||||
llversionserver.h
|
||||
llwin32headers.h
|
||||
llwin32headerslean.h
|
||||
llworkerthread.h
|
||||
ll_template_cast.h
|
||||
metaclass.h
|
||||
metaclasst.h
|
||||
metaproperty.h
|
||||
metapropertyt.h
|
||||
reflective.h
|
||||
reflectivet.h
|
||||
roles_constants.h
|
||||
stdenums.h
|
||||
stdtypes.h
|
||||
string_table.h
|
||||
stringize.h
|
||||
timer.h
|
||||
timing.h
|
||||
u64.h
|
||||
)
|
||||
|
||||
|
|
@ -280,6 +237,7 @@ SET( llcommon_ND_SOURCE_FILES
|
|||
nd/ndintrin.cpp
|
||||
nd/ndlogthrottle.cpp
|
||||
nd/ndmallocstats.cpp
|
||||
nd/ndetw.cpp
|
||||
)
|
||||
SET( llcommon_ND_HEADER_FILES
|
||||
nd/ndallocstats.h
|
||||
|
|
@ -296,6 +254,7 @@ SET( llcommon_ND_HEADER_FILES
|
|||
nd/ndpooldefines.h
|
||||
nd/ndstackwalk.h
|
||||
nd/ndstlallocator.h
|
||||
nd/ndetw.h
|
||||
)
|
||||
|
||||
SOURCE_GROUP( nd FILES ${llcommon_ND_SOURCE_FILES} ${llcommon_ND_HEADER_FILES} )
|
||||
|
|
@ -370,16 +329,16 @@ if (LL_TESTS)
|
|||
LL_ADD_INTEGRATION_TEST(llerror "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llframetimer "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llinstancetracker "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llprocessor "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llprocinfo "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llsingleton "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(lltrace "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(lluri "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(reflection "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(llunits "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(lleventdispatcher "" "${test_libs}")
|
||||
LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY}")
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,73 +0,0 @@
|
|||
/**
|
||||
* @file imageids.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "imageids.h"
|
||||
|
||||
#include "lluuid.h"
|
||||
|
||||
//
|
||||
// USE OF THIS FILE IS DEPRECATED
|
||||
//
|
||||
// Please use viewerart.ini and the standard
|
||||
// art import path. // indicates if file is only
|
||||
// on dataserver, or also
|
||||
// pre-cached on viewer
|
||||
|
||||
// Grass Images
|
||||
const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER
|
||||
|
||||
const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER
|
||||
|
||||
const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver
|
||||
const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver
|
||||
const LLUUID IMG_CLOUD_POOF ("fc4b9f0b-d008-45c6-96a4-01dd947ac621"); // dataserver
|
||||
const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver
|
||||
const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver
|
||||
const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver
|
||||
const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector
|
||||
const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver
|
||||
const LLUUID IMG_INVISIBLE ("3a367d1c-bef1-6d43-7595-e88c1e3aadb3"); // dataserver
|
||||
|
||||
const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver
|
||||
const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver
|
||||
const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver
|
||||
const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver
|
||||
const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver
|
||||
|
||||
const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver
|
||||
const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver
|
||||
|
||||
const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER
|
||||
const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER
|
||||
const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER
|
||||
const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER
|
||||
const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER
|
||||
|
||||
const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER
|
||||
|
||||
const LLUUID IMG_CHECKERBOARD_RGBA ("2585a0f3-4163-6dd1-0f34-ad48cb909e25"); // dataserver
|
||||
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/**
|
||||
* @file imageids.h
|
||||
* @brief Temporary holder for image IDs
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_IMAGEIDS_H
|
||||
#define LL_IMAGEIDS_H
|
||||
|
||||
//
|
||||
// USE OF THIS FILE IS DEPRECATED
|
||||
//
|
||||
// Please use viewerart.ini and the standard
|
||||
// art import path.
|
||||
|
||||
class LLUUID;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_SMOKE;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_DEFAULT;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_SUN;
|
||||
LL_COMMON_API extern const LLUUID IMG_MOON;
|
||||
LL_COMMON_API extern const LLUUID IMG_CLOUD_POOF;
|
||||
LL_COMMON_API extern const LLUUID IMG_SHOT;
|
||||
LL_COMMON_API extern const LLUUID IMG_SPARK;
|
||||
LL_COMMON_API extern const LLUUID IMG_FIRE;
|
||||
LL_COMMON_API extern const LLUUID IMG_FACE_SELECT;
|
||||
LL_COMMON_API extern const LLUUID IMG_DEFAULT_AVATAR;
|
||||
LL_COMMON_API extern const LLUUID IMG_INVISIBLE;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION;
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION_2;
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION_3;
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION_4;
|
||||
LL_COMMON_API extern const LLUUID IMG_SMOKE_POOF;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_1;
|
||||
LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_2;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_BLOOM1;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_DIRT_DETAIL;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_GRASS_DETAIL;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_MOUNTAIN_DETAIL;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL;
|
||||
|
||||
LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_CHECKERBOARD_RGBA;
|
||||
#endif
|
||||
|
|
@ -35,6 +35,35 @@ const LLUUID LL_UUID_ALL_AGENTS("44e87126-e794-4ded-05b3-7c42da3d5cdb");
|
|||
// Governor Linden's agent id.
|
||||
const LLUUID ALEXANDRIA_LINDEN_ID("ba2a564a-f0f1-4b82-9c61-b7520bfcd09f");
|
||||
const LLUUID GOVERNOR_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
|
||||
const LLUUID REALESTATE_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
|
||||
// Maintenance's group id.
|
||||
const LLUUID MAINTENANCE_GROUP_ID("dc7b21cd-3c89-fcaa-31c8-25f9ffd224cd");
|
||||
// Grass Images
|
||||
const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER
|
||||
|
||||
const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER
|
||||
|
||||
const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver
|
||||
const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver
|
||||
const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver
|
||||
const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver
|
||||
const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver
|
||||
const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector
|
||||
const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver
|
||||
const LLUUID IMG_INVISIBLE ("3a367d1c-bef1-6d43-7595-e88c1e3aadb3"); // dataserver
|
||||
|
||||
const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver
|
||||
const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver
|
||||
const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver
|
||||
const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver
|
||||
const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver
|
||||
|
||||
const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver
|
||||
const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver
|
||||
|
||||
const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER
|
||||
const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER
|
||||
const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER
|
||||
const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER
|
||||
const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER
|
||||
|
||||
const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER
|
||||
|
|
|
|||
|
|
@ -31,130 +31,28 @@
|
|||
|
||||
class LLUUID;
|
||||
|
||||
// At 45 Hz collisions seem stable and objects seem
|
||||
// to settle down at a reasonable rate.
|
||||
// JC 3/18/2003
|
||||
|
||||
// const F32 PHYSICS_TIMESTEP = 1.f / 45.f;
|
||||
// This must be a #define due to anal retentive restrictions on const expressions
|
||||
// CG 2008-06-05
|
||||
#define PHYSICS_TIMESTEP (1.f / 45.f)
|
||||
|
||||
const F32 COLLISION_TOLERANCE = 0.1f;
|
||||
const F32 HALF_COLLISION_TOLERANCE = 0.05f;
|
||||
|
||||
// Time constants
|
||||
const U32 HOURS_PER_LINDEN_DAY = 4;
|
||||
const U32 DAYS_PER_LINDEN_YEAR = 11;
|
||||
|
||||
const U32 SEC_PER_LINDEN_DAY = HOURS_PER_LINDEN_DAY * 60 * 60;
|
||||
const U32 SEC_PER_LINDEN_YEAR = DAYS_PER_LINDEN_YEAR * SEC_PER_LINDEN_DAY;
|
||||
|
||||
static const F32 REGION_WIDTH_METERS = 256.f;
|
||||
static const S32 REGION_WIDTH_UNITS = 256;
|
||||
static const U32 REGION_WIDTH_U32 = 256;
|
||||
|
||||
const F32 REGION_HEIGHT_METERS = 4096.f;
|
||||
|
||||
// Bits for simulator performance query flags
|
||||
enum LAND_STAT_FLAGS
|
||||
{
|
||||
STAT_FILTER_BY_PARCEL = 0x00000001,
|
||||
STAT_FILTER_BY_OWNER = 0x00000002,
|
||||
STAT_FILTER_BY_OBJECT = 0x00000004,
|
||||
STAT_FILTER_BY_PARCEL_NAME = 0x00000008,
|
||||
STAT_REQUEST_LAST_ENTRY = 0x80000000,
|
||||
};
|
||||
|
||||
enum LAND_STAT_REPORT_TYPE
|
||||
{
|
||||
STAT_REPORT_TOP_SCRIPTS = 0,
|
||||
STAT_REPORT_TOP_COLLIDERS
|
||||
};
|
||||
|
||||
const U32 STAT_FILTER_MASK = 0x1FFFFFFF;
|
||||
|
||||
// Region absolute limits
|
||||
static const S32 REGION_AGENT_COUNT_MIN = 1;
|
||||
static const S32 REGION_AGENT_COUNT_MAX = 200; // Must fit in U8 for the moment (RegionInfo msg)
|
||||
static const S32 REGION_PRIM_COUNT_MIN = 0;
|
||||
static const S32 REGION_PRIM_COUNT_MAX = 40000;
|
||||
static const F32 REGION_PRIM_BONUS_MIN = 1.0f;
|
||||
static const F32 REGION_PRIM_BONUS_MAX = 10.0f;
|
||||
|
||||
// Default maximum number of tasks/prims per region.
|
||||
const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
|
||||
|
||||
const F32 MIN_AGENT_DEPTH = 0.30f;
|
||||
const F32 DEFAULT_AGENT_DEPTH = 0.45f;
|
||||
const F32 MAX_AGENT_DEPTH = 0.60f;
|
||||
|
||||
const F32 MIN_AGENT_WIDTH = 0.40f;
|
||||
const F32 DEFAULT_AGENT_WIDTH = 0.60f;
|
||||
const F32 MAX_AGENT_WIDTH = 0.80f;
|
||||
|
||||
const F32 MIN_AGENT_HEIGHT = 1.1f;
|
||||
const F32 DEFAULT_AGENT_HEIGHT = 1.9f;
|
||||
const F32 MAX_AGENT_HEIGHT = 2.45f;
|
||||
|
||||
// For linked sets
|
||||
const S32 MAX_CHILDREN_PER_TASK = 255;
|
||||
const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32;
|
||||
|
||||
const S32 MAX_JOINTS_PER_OBJECT = 1; // limiting to 1 until Havok 2.x
|
||||
|
||||
const char* const DEFAULT_DMZ_SPACE_SERVER = "192.168.0.140";
|
||||
const char* const DEFAULT_DMZ_USER_SERVER = "192.168.0.140";
|
||||
const char* const DEFAULT_DMZ_DATA_SERVER = "192.168.0.140";
|
||||
const char* const DEFAULT_DMZ_ASSET_SERVER = "http://asset.dmz.lindenlab.com:80";
|
||||
|
||||
const char* const DEFAULT_AGNI_SPACE_SERVER = "63.211.139.100";
|
||||
const char* const DEFAULT_AGNI_USER_SERVER = "63.211.139.100";
|
||||
const char* const DEFAULT_AGNI_DATA_SERVER = "63.211.139.100";
|
||||
const char* const DEFAULT_AGNI_ASSET_SERVER = "http://asset.agni.lindenlab.com:80";
|
||||
|
||||
// Information about what ports are for what services is in the wiki Name Space Ports page
|
||||
// https://wiki.lindenlab.com/wiki/Name_Space_Ports
|
||||
const char* const DEFAULT_LOCAL_ASSET_SERVER = "http://localhost:12041/asset/tmp";
|
||||
const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset";
|
||||
|
||||
const U32 DEFAULT_LAUNCHER_PORT = 12029;
|
||||
//const U32 DEFAULT_BIGBOARD_PORT = 12030; // Deprecated
|
||||
//const U32 DEFAULT_QUERYSIM_PORT = 12031; // Deprecated
|
||||
const U32 DEFAULT_DATA_SERVER_PORT = 12032;
|
||||
const U32 DEFAULT_SPACE_SERVER_PORT = 12033;
|
||||
const U32 DEFAULT_VIEWER_PORT = 12034;
|
||||
const U32 DEFAULT_SIMULATOR_PORT = 12035;
|
||||
const U32 DEFAULT_USER_SERVER_PORT = 12036;
|
||||
const U32 DEFAULT_RPC_SERVER_PORT = 12037;
|
||||
const U32 DEFAULT_LOG_DATA_SERVER_PORT = 12039;
|
||||
const U32 DEFAULT_BACKBONE_PORT = 12040;
|
||||
const U32 DEFAULT_LOCAL_ASSET_PORT = 12041;
|
||||
//const U32 DEFAULT_BACKBONE_CAP_PORT = 12042; // Deprecated
|
||||
const U32 DEFAULT_CAP_PROXY_PORT = 12043;
|
||||
const U32 DEFAULT_INV_DATA_SERVER_PORT = 12044;
|
||||
const U32 DEFAULT_CGI_SERVICES_PORT = 12045;
|
||||
|
||||
// Mapserver uses ports 12124 - 12139 to allow multiple mapservers to run
|
||||
// on a single host for map tile generation. JC
|
||||
const U32 DEFAULT_MAPSERVER_PORT = 12124;
|
||||
|
||||
// For automatic port discovery when running multiple viewers on one host
|
||||
const U32 PORT_DISCOVERY_RANGE_MIN = 13000;
|
||||
const U32 PORT_DISCOVERY_RANGE_MAX = PORT_DISCOVERY_RANGE_MIN + 50;
|
||||
|
||||
const char LAND_LAYER_CODE = 'L';
|
||||
const char WATER_LAYER_CODE = 'W';
|
||||
const char WIND_LAYER_CODE = '7';
|
||||
const char CLOUD_LAYER_CODE = '8';
|
||||
|
||||
// <FS:CR> Aurora Sim
|
||||
// Extended land layer for Aurora Sim
|
||||
const char AURORA_LAND_LAYER_CODE = 'M';
|
||||
const char AURORA_WATER_LAYER_CODE = 'X';
|
||||
const char AURORA_WIND_LAYER_CODE = '9';
|
||||
const char AURORA_CLOUD_LAYER_CODE = ':';
|
||||
// </FS:CR> Aurora Sim
|
||||
enum ETerrainBrushType
|
||||
{
|
||||
// the valid brush numbers cannot be reordered, because they
|
||||
// are used in the binary LSL format as arguments to llModifyLand()
|
||||
E_LANDBRUSH_LEVEL = 0,
|
||||
E_LANDBRUSH_RAISE = 1,
|
||||
E_LANDBRUSH_LOWER = 2,
|
||||
E_LANDBRUSH_SMOOTH = 3,
|
||||
E_LANDBRUSH_NOISE = 4,
|
||||
E_LANDBRUSH_REVERT = 5,
|
||||
E_LANDBRUSH_INVALID = 6
|
||||
};
|
||||
|
||||
// keys
|
||||
// Bit masks for various keyboard modifier keys.
|
||||
|
|
@ -273,89 +171,43 @@ LL_COMMON_API extern const LLUUID LL_UUID_ALL_AGENTS;
|
|||
LL_COMMON_API extern const LLUUID ALEXANDRIA_LINDEN_ID;
|
||||
|
||||
LL_COMMON_API extern const LLUUID GOVERNOR_LINDEN_ID;
|
||||
LL_COMMON_API extern const LLUUID REALESTATE_LINDEN_ID;
|
||||
// Maintenance's group id.
|
||||
LL_COMMON_API extern const LLUUID MAINTENANCE_GROUP_ID;
|
||||
|
||||
// Flags for kick message
|
||||
const U32 KICK_FLAGS_DEFAULT = 0x0;
|
||||
const U32 KICK_FLAGS_FREEZE = 1 << 0;
|
||||
const U32 KICK_FLAGS_UNFREEZE = 1 << 1;
|
||||
// image ids
|
||||
LL_COMMON_API extern const LLUUID IMG_SMOKE;
|
||||
|
||||
const U8 UPD_NONE = 0x00;
|
||||
const U8 UPD_POSITION = 0x01;
|
||||
const U8 UPD_ROTATION = 0x02;
|
||||
const U8 UPD_SCALE = 0x04;
|
||||
const U8 UPD_LINKED_SETS = 0x08;
|
||||
const U8 UPD_UNIFORM = 0x10; // used with UPD_SCALE
|
||||
LL_COMMON_API extern const LLUUID IMG_DEFAULT;
|
||||
|
||||
// Agent Update Flags (U8)
|
||||
const U8 AU_FLAGS_NONE = 0x00;
|
||||
const U8 AU_FLAGS_HIDETITLE = 0x01;
|
||||
const U8 AU_FLAGS_CLIENT_AUTOPILOT = 0x02;
|
||||
LL_COMMON_API extern const LLUUID IMG_SUN;
|
||||
LL_COMMON_API extern const LLUUID IMG_MOON;
|
||||
LL_COMMON_API extern const LLUUID IMG_SHOT;
|
||||
LL_COMMON_API extern const LLUUID IMG_SPARK;
|
||||
LL_COMMON_API extern const LLUUID IMG_FIRE;
|
||||
LL_COMMON_API extern const LLUUID IMG_FACE_SELECT;
|
||||
LL_COMMON_API extern const LLUUID IMG_DEFAULT_AVATAR;
|
||||
LL_COMMON_API extern const LLUUID IMG_INVISIBLE;
|
||||
|
||||
// start location constants
|
||||
const U32 START_LOCATION_ID_LAST = 0;
|
||||
const U32 START_LOCATION_ID_HOME = 1;
|
||||
const U32 START_LOCATION_ID_DIRECT = 2; // for direct teleport
|
||||
const U32 START_LOCATION_ID_PARCEL = 3; // for teleports to a parcel
|
||||
const U32 START_LOCATION_ID_TELEHUB = 4; // for teleports to a spawnpoint
|
||||
const U32 START_LOCATION_ID_URL = 5;
|
||||
const U32 START_LOCATION_ID_COUNT = 6;
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION;
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION_2;
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION_3;
|
||||
LL_COMMON_API extern const LLUUID IMG_EXPLOSION_4;
|
||||
LL_COMMON_API extern const LLUUID IMG_SMOKE_POOF;
|
||||
|
||||
// group constants
|
||||
const U32 GROUP_MIN_SIZE = 2;
|
||||
LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_1;
|
||||
LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_2;
|
||||
|
||||
LL_COMMON_API extern const LLUUID IMG_BLOOM1;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_DIRT_DETAIL;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_GRASS_DETAIL;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_MOUNTAIN_DETAIL;
|
||||
LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL;
|
||||
|
||||
LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL;
|
||||
|
||||
// gMaxAgentGroups is now sent by login.cgi, which
|
||||
// looks it up from globals.xml.
|
||||
//
|
||||
// For now we need an old default value however,
|
||||
// so the viewer can be deployed ahead of login.cgi.
|
||||
//
|
||||
const S32 DEFAULT_MAX_AGENT_GROUPS = 42;
|
||||
|
||||
// radius within which a chat message is fully audible
|
||||
const F32 CHAT_WHISPER_RADIUS = 10.f;
|
||||
const F32 CHAT_NORMAL_RADIUS = 20.f;
|
||||
const F32 CHAT_SHOUT_RADIUS = 100.f;
|
||||
const F32 CHAT_MAX_RADIUS = CHAT_SHOUT_RADIUS;
|
||||
const F32 CHAT_MAX_RADIUS_BY_TWO = CHAT_MAX_RADIUS / 2.f;
|
||||
|
||||
// squared editions of the above for distance checks
|
||||
const F32 CHAT_WHISPER_RADIUS_SQUARED = CHAT_WHISPER_RADIUS * CHAT_WHISPER_RADIUS;
|
||||
const F32 CHAT_NORMAL_RADIUS_SQUARED = CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS;
|
||||
const F32 CHAT_SHOUT_RADIUS_SQUARED = CHAT_SHOUT_RADIUS * CHAT_SHOUT_RADIUS;
|
||||
const F32 CHAT_MAX_RADIUS_SQUARED = CHAT_SHOUT_RADIUS_SQUARED;
|
||||
const F32 CHAT_MAX_RADIUS_BY_TWO_SQUARED = CHAT_MAX_RADIUS_BY_TWO * CHAT_MAX_RADIUS_BY_TWO;
|
||||
|
||||
|
||||
// this times above gives barely audible radius
|
||||
const F32 CHAT_BARELY_AUDIBLE_FACTOR = 2.0f;
|
||||
|
||||
// distance in front of speaking agent the sphere is centered
|
||||
const F32 CHAT_WHISPER_OFFSET = 5.f;
|
||||
const F32 CHAT_NORMAL_OFFSET = 10.f;
|
||||
const F32 CHAT_SHOUT_OFFSET = 50.f;
|
||||
|
||||
// first clean starts at 3 AM
|
||||
const S32 SANDBOX_FIRST_CLEAN_HOUR = 3;
|
||||
// clean every <n> hours
|
||||
const S32 SANDBOX_CLEAN_FREQ = 12;
|
||||
|
||||
const F32 WIND_SCALE_HACK = 2.0f; // hack to make wind speeds more realistic
|
||||
|
||||
enum ETerrainBrushType
|
||||
{
|
||||
// the valid brush numbers cannot be reordered, because they
|
||||
// are used in the binary LSL format as arguments to llModifyLand()
|
||||
E_LANDBRUSH_LEVEL = 0,
|
||||
E_LANDBRUSH_RAISE = 1,
|
||||
E_LANDBRUSH_LOWER = 2,
|
||||
E_LANDBRUSH_SMOOTH = 3,
|
||||
E_LANDBRUSH_NOISE = 4,
|
||||
E_LANDBRUSH_REVERT = 5,
|
||||
E_LANDBRUSH_INVALID = 6
|
||||
};
|
||||
|
||||
// media commands
|
||||
const U32 PARCEL_MEDIA_COMMAND_STOP = 0;
|
||||
|
|
@ -373,53 +225,101 @@ const U32 PARCEL_MEDIA_COMMAND_SIZE = 11;
|
|||
const U32 PARCEL_MEDIA_COMMAND_DESC = 12;
|
||||
const U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13;
|
||||
|
||||
// map item types
|
||||
const U32 MAP_ITEM_TELEHUB = 0x01;
|
||||
const U32 MAP_ITEM_PG_EVENT = 0x02;
|
||||
const U32 MAP_ITEM_MATURE_EVENT = 0x03;
|
||||
//const U32 MAP_ITEM_POPULAR = 0x04; // No longer supported, 2009-03-02 KLW
|
||||
//const U32 MAP_ITEM_AGENT_COUNT = 0x05;
|
||||
const U32 MAP_ITEM_AGENT_LOCATIONS = 0x06;
|
||||
const U32 MAP_ITEM_LAND_FOR_SALE = 0x07;
|
||||
const U32 MAP_ITEM_CLASSIFIED = 0x08;
|
||||
const U32 MAP_ITEM_ADULT_EVENT = 0x09;
|
||||
const U32 MAP_ITEM_LAND_FOR_SALE_ADULT = 0x0a;
|
||||
|
||||
// Region map layer numbers
|
||||
const S32 MAP_SIM_OBJECTS = 0;
|
||||
const S32 MAP_SIM_TERRAIN = 1;
|
||||
const S32 MAP_SIM_LAND_FOR_SALE = 2; // Transparent alpha overlay of land for sale
|
||||
const S32 MAP_SIM_IMAGE_TYPES = 3; // Number of map layers
|
||||
const S32 MAP_SIM_INFO_MASK = 0x00FFFFFF; // Agent access may be stuffed into upper byte
|
||||
const S32 MAP_SIM_LAYER_MASK = 0x0000FFFF; // Layer info is in lower 16 bits
|
||||
const S32 MAP_SIM_RETURN_NULL_SIMS = 0x00010000;
|
||||
const S32 MAP_SIM_PRELUDE = 0x00020000;
|
||||
|
||||
// Crash reporter behavior
|
||||
const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml"; // AO legacy from KB
|
||||
const char* const CRASH_BEHAVIOR_SETTING = "CrashSubmitBehavior"; // AO legacy from KB
|
||||
const S32 CRASH_BEHAVIOR_ASK = 0;
|
||||
const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1;
|
||||
const S32 CRASH_BEHAVIOR_NEVER_SEND = 2;
|
||||
|
||||
// Export/Import return values
|
||||
const S32 EXPORT_SUCCESS = 0;
|
||||
const S32 EXPORT_ERROR_PERMISSIONS = -1;
|
||||
const S32 EXPORT_ERROR_UNKNOWN = -2;
|
||||
|
||||
// This is how long the sim will try to teleport you before giving up.
|
||||
const F32 TELEPORT_EXPIRY = 15.0f;
|
||||
// Additional time (in seconds) to wait per attachment
|
||||
const F32 TELEPORT_EXPIRY_PER_ATTACHMENT = 3.f;
|
||||
|
||||
// The maximum size of an object extra parameters binary (packed) block
|
||||
#define MAX_OBJECT_PARAMS_SIZE 1024
|
||||
|
||||
const S32 CHAT_CHANNEL_DEBUG = S32_MAX;
|
||||
|
||||
// PLEASE don't add constants here. Every dev will have to do
|
||||
// a complete rebuild. Try to find another shared header file,
|
||||
// like llregionflags.h, lllslconstants.h, llagentconstants.h,
|
||||
// or create a new one. JC
|
||||
// agent constants
|
||||
const U32 CONTROL_AT_POS_INDEX = 0;
|
||||
const U32 CONTROL_AT_NEG_INDEX = 1;
|
||||
const U32 CONTROL_LEFT_POS_INDEX = 2;
|
||||
const U32 CONTROL_LEFT_NEG_INDEX = 3;
|
||||
const U32 CONTROL_UP_POS_INDEX = 4;
|
||||
const U32 CONTROL_UP_NEG_INDEX = 5;
|
||||
const U32 CONTROL_PITCH_POS_INDEX = 6;
|
||||
const U32 CONTROL_PITCH_NEG_INDEX = 7;
|
||||
const U32 CONTROL_YAW_POS_INDEX = 8;
|
||||
const U32 CONTROL_YAW_NEG_INDEX = 9;
|
||||
const U32 CONTROL_FAST_AT_INDEX = 10;
|
||||
const U32 CONTROL_FAST_LEFT_INDEX = 11;
|
||||
const U32 CONTROL_FAST_UP_INDEX = 12;
|
||||
const U32 CONTROL_FLY_INDEX = 13;
|
||||
const U32 CONTROL_STOP_INDEX = 14;
|
||||
const U32 CONTROL_FINISH_ANIM_INDEX = 15;
|
||||
const U32 CONTROL_STAND_UP_INDEX = 16;
|
||||
const U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
|
||||
const U32 CONTROL_MOUSELOOK_INDEX = 18;
|
||||
const U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
|
||||
const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
|
||||
const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
|
||||
const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
|
||||
const U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
|
||||
const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
|
||||
const U32 CONTROL_TURN_LEFT_INDEX = 25;
|
||||
const U32 CONTROL_TURN_RIGHT_INDEX = 26;
|
||||
const U32 CONTROL_AWAY_INDEX = 27;
|
||||
const U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
|
||||
const U32 CONTROL_LBUTTON_UP_INDEX = 29;
|
||||
const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
|
||||
const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
|
||||
const U32 TOTAL_CONTROLS = 32;
|
||||
|
||||
const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
|
||||
const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
|
||||
const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
|
||||
const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
|
||||
const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
|
||||
const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
|
||||
const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
|
||||
const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
|
||||
const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
|
||||
const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
|
||||
|
||||
const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
|
||||
const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
|
||||
const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
|
||||
|
||||
const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
|
||||
const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
|
||||
const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
|
||||
const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
|
||||
const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
|
||||
const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
|
||||
|
||||
const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
|
||||
const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
|
||||
const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
|
||||
const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
|
||||
const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
|
||||
const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
|
||||
const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
|
||||
const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
|
||||
|
||||
const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
|
||||
|
||||
const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
|
||||
const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
|
||||
const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
|
||||
const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
|
||||
|
||||
// move these up so that we can hide them in "State" for object updates
|
||||
// (for now)
|
||||
const U32 AGENT_ATTACH_OFFSET = 4;
|
||||
const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
|
||||
|
||||
// RN: this method swaps the upper and lower nibbles to maintain backward
|
||||
// compatibility with old objects that only used the upper nibble
|
||||
#define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))
|
||||
|
||||
// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
|
||||
const U8 CLICK_ACTION_NONE = 0;
|
||||
const U8 CLICK_ACTION_TOUCH = 0;
|
||||
const U8 CLICK_ACTION_SIT = 1;
|
||||
const U8 CLICK_ACTION_BUY = 2;
|
||||
const U8 CLICK_ACTION_PAY = 3;
|
||||
const U8 CLICK_ACTION_OPEN = 4;
|
||||
const U8 CLICK_ACTION_PLAY = 5;
|
||||
const U8 CLICK_ACTION_OPEN_MEDIA = 6;
|
||||
const U8 CLICK_ACTION_ZOOM = 7;
|
||||
// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,937 +0,0 @@
|
|||
/**
|
||||
* @file linked_lists.h
|
||||
* @brief LLLinkedList class header amd implementation file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LINKED_LISTS_H
|
||||
#define LL_LINKED_LISTS_H
|
||||
|
||||
/**
|
||||
* Provides a standard doubly linked list for fun and profit
|
||||
* Utilizes a neat trick off of Flipcode where the back pointer is a
|
||||
* pointer to a pointer, allowing easier transfer of nodes between lists, &c
|
||||
* And a template class, of course
|
||||
*/
|
||||
|
||||
#include "llerror.h"
|
||||
|
||||
|
||||
template <class DATA_TYPE> class LLLinkedList
|
||||
{
|
||||
public:
|
||||
friend class LLLinkNode;
|
||||
// External interface
|
||||
|
||||
// basic constructor
|
||||
LLLinkedList() : mHead(NULL), mCurrentp(NULL), mInsertBefore(NULL)
|
||||
{
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
mCount = 0;
|
||||
}
|
||||
|
||||
// basic constructor
|
||||
LLLinkedList(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested)) : mHead(NULL), mCurrentp(NULL), mInsertBefore(insert_before)
|
||||
{
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
mCount = 0;
|
||||
}
|
||||
|
||||
// destructor destroys list and nodes, but not data in nodes
|
||||
~LLLinkedList()
|
||||
{
|
||||
removeAllNodes();
|
||||
}
|
||||
|
||||
// set mInsertBefore
|
||||
void setInsertBefore(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested))
|
||||
{
|
||||
mInsertBefore = insert_before;
|
||||
}
|
||||
|
||||
//
|
||||
// WARNING!!!!!!!
|
||||
// addData and addDataSorted are NOT O(1) operations, but O(n) because they check
|
||||
// for existence of the data in the linked list first. Why, I don't know - djs
|
||||
// If you don't care about dupes, use addDataNoCheck
|
||||
//
|
||||
|
||||
// put data into a node and stick it at the front of the list
|
||||
inline BOOL addData(DATA_TYPE *data);
|
||||
|
||||
// put data into a node and sort into list by mInsertBefore()
|
||||
// calls normal add if mInsertBefore isn't set
|
||||
inline BOOL addDataSorted(DATA_TYPE *data);
|
||||
|
||||
inline BOOL addDataNoCheck(DATA_TYPE *data);
|
||||
|
||||
// bubbleSortList
|
||||
// does an improved bubble sort of the list . . . works best with almost sorted data
|
||||
// does nothing if mInsertBefore isn't set
|
||||
// Nota Bene: Swaps are accomplished by swapping data pointers
|
||||
inline void bubbleSortList();
|
||||
|
||||
// put data into a node and stick it at the end of the list
|
||||
inline BOOL addDataAtEnd(DATA_TYPE *data);
|
||||
|
||||
// returns number of items in the list
|
||||
inline S32 getLength() const;
|
||||
|
||||
inline BOOL isEmpty();
|
||||
|
||||
// search the list starting at mHead.mNextp and remove the link with mDatap == data
|
||||
// leave mCurrentp and mCurrentOperatingp on the next entry
|
||||
// return TRUE if found, FALSE if not found
|
||||
inline BOOL removeData(DATA_TYPE *data);
|
||||
|
||||
// search the list starting at mHead.mNextp and delete the link with mDatap == data
|
||||
// leave mCurrentp and mCurrentOperatingp on the next entry
|
||||
// return TRUE if found, FALSE if not found
|
||||
inline BOOL deleteData(DATA_TYPE *data);
|
||||
|
||||
// remove all nodes from the list and delete the associated data
|
||||
inline void deleteAllData();
|
||||
|
||||
// remove all nodes from the list but do not delete data
|
||||
inline void removeAllNodes();
|
||||
|
||||
// check to see if data is in list
|
||||
// if TRUE then mCurrentp and mCurrentOperatingp point to data
|
||||
inline BOOL checkData(DATA_TYPE *data);
|
||||
|
||||
// place mCurrentp on first node
|
||||
inline void resetList();
|
||||
|
||||
// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
|
||||
inline DATA_TYPE *getCurrentData();
|
||||
|
||||
// same as getCurrentData() but a more intuitive name for the operation
|
||||
inline DATA_TYPE *getNextData();
|
||||
|
||||
// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
|
||||
inline DATA_TYPE *getFirstData();
|
||||
|
||||
// reset the list and return the data at position n, set mCurentOperatingp to that node and bump mCurrentp
|
||||
// Note: n is zero-based
|
||||
inline DATA_TYPE *getNthData( U32 n);
|
||||
|
||||
// reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp
|
||||
inline DATA_TYPE *getLastData();
|
||||
|
||||
// remove the Node at mCurentOperatingp
|
||||
// leave mCurrentp and mCurentOperatingp on the next entry
|
||||
inline void removeCurrentData();
|
||||
|
||||
// remove the Node at mCurentOperatingp and add it to newlist
|
||||
// leave mCurrentp and mCurentOperatingp on the next entry
|
||||
void moveCurrentData(LLLinkedList *newlist, BOOL b_sort);
|
||||
|
||||
BOOL moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort);
|
||||
|
||||
// delete the Node at mCurentOperatingp
|
||||
// leave mCurrentp anf mCurentOperatingp on the next entry
|
||||
void deleteCurrentData();
|
||||
|
||||
private:
|
||||
// node that actually contains the data
|
||||
class LLLinkNode
|
||||
{
|
||||
public:
|
||||
// assign the mDatap pointer
|
||||
LLLinkNode(DATA_TYPE *data) : mDatap(data), mNextp(NULL), mPrevpp(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
// destructor does not, by default, destroy associated data
|
||||
// however, the mDatap must be NULL to ensure that we aren't causing memory leaks
|
||||
~LLLinkNode()
|
||||
{
|
||||
if (mDatap)
|
||||
{
|
||||
llerror("Attempting to call LLLinkNode destructor with a non-null mDatap!", 1);
|
||||
}
|
||||
}
|
||||
|
||||
// delete associated data and NULL out pointer
|
||||
void deleteData()
|
||||
{
|
||||
delete mDatap;
|
||||
mDatap = NULL;
|
||||
}
|
||||
|
||||
// NULL out pointer
|
||||
void removeData()
|
||||
{
|
||||
mDatap = NULL;
|
||||
}
|
||||
|
||||
DATA_TYPE *mDatap;
|
||||
LLLinkNode *mNextp;
|
||||
LLLinkNode **mPrevpp;
|
||||
};
|
||||
|
||||
// add a node at the front of the list
|
||||
void addData(LLLinkNode *node)
|
||||
{
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!node)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::addData", 0);
|
||||
}
|
||||
|
||||
// add the node to the front of the list
|
||||
node->mPrevpp = &mHead.mNextp;
|
||||
node->mNextp = mHead.mNextp;
|
||||
|
||||
// if there's something in the list, fix its back pointer
|
||||
if (node->mNextp)
|
||||
{
|
||||
node->mNextp->mPrevpp = &node->mNextp;
|
||||
}
|
||||
|
||||
mHead.mNextp = node;
|
||||
}
|
||||
|
||||
LLLinkNode mHead; // fake head node. . . makes pointer operations faster and easier
|
||||
LLLinkNode *mCurrentp; // mCurrentp is the Node that getCurrentData returns
|
||||
LLLinkNode *mCurrentOperatingp; // this is the node that the various mumbleCurrentData functions act on
|
||||
BOOL (*mInsertBefore)(DATA_TYPE *data_new, DATA_TYPE *data_tested); // user function set to allow sorted lists
|
||||
U32 mCount;
|
||||
};
|
||||
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::addData(DATA_TYPE *data)
|
||||
{
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!data)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::addData", 0);
|
||||
}
|
||||
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
|
||||
if ( checkData(data))
|
||||
{
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// make the new node
|
||||
LLLinkNode *temp = new LLLinkNode(data);
|
||||
|
||||
// add the node to the front of the list
|
||||
temp->mPrevpp = &mHead.mNextp;
|
||||
temp->mNextp = mHead.mNextp;
|
||||
|
||||
// if there's something in the list, fix its back pointer
|
||||
if (temp->mNextp)
|
||||
{
|
||||
temp->mNextp->mPrevpp = &temp->mNextp;
|
||||
}
|
||||
|
||||
mHead.mNextp = temp;
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
mCount++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::addDataNoCheck(DATA_TYPE *data)
|
||||
{
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!data)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::addData", 0);
|
||||
}
|
||||
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
|
||||
// make the new node
|
||||
LLLinkNode *temp = new LLLinkNode(data);
|
||||
|
||||
// add the node to the front of the list
|
||||
temp->mPrevpp = &mHead.mNextp;
|
||||
temp->mNextp = mHead.mNextp;
|
||||
|
||||
// if there's something in the list, fix its back pointer
|
||||
if (temp->mNextp)
|
||||
{
|
||||
temp->mNextp->mPrevpp = &temp->mNextp;
|
||||
}
|
||||
|
||||
mHead.mNextp = temp;
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
mCount++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::addDataSorted(DATA_TYPE *data)
|
||||
{
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!data)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::addDataSorted", 0);
|
||||
}
|
||||
|
||||
if (checkData(data))
|
||||
{
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// mInsertBefore not set?
|
||||
if (!mInsertBefore)
|
||||
{
|
||||
addData(data);
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// empty list?
|
||||
if (!mHead.mNextp)
|
||||
{
|
||||
addData(data);
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// make the new node
|
||||
LLLinkNode *temp = new LLLinkNode(data);
|
||||
|
||||
// walk the list until mInsertBefore returns true
|
||||
mCurrentp = mHead.mNextp;
|
||||
while (mCurrentp->mNextp)
|
||||
{
|
||||
if (mInsertBefore(data, mCurrentp->mDatap))
|
||||
{
|
||||
// insert before the current one
|
||||
temp->mPrevpp = mCurrentp->mPrevpp;
|
||||
temp->mNextp = mCurrentp;
|
||||
*(temp->mPrevpp) = temp;
|
||||
mCurrentp->mPrevpp = &temp->mNextp;
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
mCount++;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurrentp = mCurrentp->mNextp;
|
||||
}
|
||||
}
|
||||
|
||||
// on the last element, add before?
|
||||
if (mInsertBefore(data, mCurrentp->mDatap))
|
||||
{
|
||||
// insert before the current one
|
||||
temp->mPrevpp = mCurrentp->mPrevpp;
|
||||
temp->mNextp = mCurrentp;
|
||||
*(temp->mPrevpp) = temp;
|
||||
mCurrentp->mPrevpp = &temp->mNextp;
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
}
|
||||
else // insert after
|
||||
{
|
||||
temp->mPrevpp = &mCurrentp->mNextp;
|
||||
temp->mNextp = NULL;
|
||||
mCurrentp->mNextp = temp;
|
||||
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
}
|
||||
mCount++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
template <class DATA_TYPE>
|
||||
void LLLinkedList<DATA_TYPE>::bubbleSortList()
|
||||
{
|
||||
// mInsertBefore not set
|
||||
if (!mInsertBefore)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
|
||||
BOOL b_swapped = FALSE;
|
||||
DATA_TYPE *temp;
|
||||
|
||||
// Nota Bene: This will break if more than 0x7FFFFFFF members in list!
|
||||
S32 length = 0x7FFFFFFF;
|
||||
S32 count = 0;
|
||||
do
|
||||
{
|
||||
b_swapped = FALSE;
|
||||
mCurrentp = mHead.mNextp;
|
||||
count = 0;
|
||||
while ( (count + 1 < length)
|
||||
&&(mCurrentp))
|
||||
{
|
||||
if (mCurrentp->mNextp)
|
||||
{
|
||||
if (!mInsertBefore(mCurrentp->mDatap, mCurrentp->mNextp->mDatap))
|
||||
{
|
||||
// swap data pointers!
|
||||
temp = mCurrentp->mDatap;
|
||||
mCurrentp->mDatap = mCurrentp->mNextp->mDatap;
|
||||
mCurrentp->mNextp->mDatap = temp;
|
||||
b_swapped = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
mCurrentp = mCurrentp->mNextp;
|
||||
}
|
||||
length = count;
|
||||
} while (b_swapped);
|
||||
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
}
|
||||
|
||||
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::addDataAtEnd(DATA_TYPE *data)
|
||||
{
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!data)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::addData", 0);
|
||||
}
|
||||
|
||||
if (checkData(data))
|
||||
{
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// make the new node
|
||||
LLLinkNode *temp = new LLLinkNode(data);
|
||||
|
||||
// add the node to the end of the list
|
||||
|
||||
// if empty, add to the front and be done with it
|
||||
if (!mHead.mNextp)
|
||||
{
|
||||
temp->mPrevpp = &mHead.mNextp;
|
||||
temp->mNextp = NULL;
|
||||
mHead.mNextp = temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
// otherwise, walk to the end of the list
|
||||
mCurrentp = mHead.mNextp;
|
||||
while (mCurrentp->mNextp)
|
||||
{
|
||||
mCurrentp = mCurrentp->mNextp;
|
||||
}
|
||||
temp->mPrevpp = &mCurrentp->mNextp;
|
||||
temp->mNextp = NULL;
|
||||
mCurrentp->mNextp = temp;
|
||||
}
|
||||
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
mCount++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// returns number of items in the list
|
||||
template <class DATA_TYPE>
|
||||
S32 LLLinkedList<DATA_TYPE>::getLength() const
|
||||
{
|
||||
// S32 length = 0;
|
||||
// for (LLLinkNode* temp = mHead.mNextp; temp != NULL; temp = temp->mNextp)
|
||||
// {
|
||||
// length++;
|
||||
// }
|
||||
return mCount;
|
||||
}
|
||||
|
||||
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::isEmpty()
|
||||
{
|
||||
return (mCount == 0);
|
||||
}
|
||||
|
||||
|
||||
// search the list starting at mHead.mNextp and remove the link with mDatap == data
|
||||
// leave mCurrentp and mCurrentOperatingp on the next entry
|
||||
// return TRUE if found, FALSE if not found
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::removeData(DATA_TYPE *data)
|
||||
{
|
||||
BOOL b_found = FALSE;
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!data)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::removeData", 0);
|
||||
}
|
||||
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
|
||||
while (mCurrentOperatingp)
|
||||
{
|
||||
if (mCurrentOperatingp->mDatap == data)
|
||||
{
|
||||
b_found = TRUE;
|
||||
|
||||
// remove the node
|
||||
|
||||
// if there is a next one, fix it
|
||||
if (mCurrentOperatingp->mNextp)
|
||||
{
|
||||
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
|
||||
}
|
||||
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
|
||||
|
||||
// remove the LLLinkNode
|
||||
|
||||
// if we were on the one we want to delete, bump the cached copies
|
||||
if (mCurrentOperatingp == tcurrop)
|
||||
{
|
||||
tcurrop = tcurr = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
else if (mCurrentOperatingp == tcurr)
|
||||
{
|
||||
tcurrop = tcurr = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
|
||||
mCurrentOperatingp->removeData();
|
||||
delete mCurrentOperatingp;
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
mCount--;
|
||||
break;
|
||||
}
|
||||
mCurrentOperatingp = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return b_found;
|
||||
}
|
||||
|
||||
// search the list starting at mHead.mNextp and delete the link with mDatap == data
|
||||
// leave mCurrentp and mCurrentOperatingp on the next entry
|
||||
// return TRUE if found, FALSE if not found
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::deleteData(DATA_TYPE *data)
|
||||
{
|
||||
BOOL b_found = FALSE;
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!data)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::removeData", 0);
|
||||
}
|
||||
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
|
||||
while (mCurrentOperatingp)
|
||||
{
|
||||
if (mCurrentOperatingp->mDatap == data)
|
||||
{
|
||||
b_found = TRUE;
|
||||
|
||||
// remove the node
|
||||
// if there is a next one, fix it
|
||||
if (mCurrentOperatingp->mNextp)
|
||||
{
|
||||
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
|
||||
}
|
||||
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
|
||||
|
||||
// delete the LLLinkNode
|
||||
// if we were on the one we want to delete, bump the cached copies
|
||||
if (mCurrentOperatingp == tcurrop)
|
||||
{
|
||||
tcurrop = tcurr = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
|
||||
// and delete the associated data
|
||||
llassert(mCurrentOperatingp);
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
mCurrentOperatingp->deleteData();
|
||||
delete mCurrentOperatingp;
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
mCount--;
|
||||
break;
|
||||
}
|
||||
mCurrentOperatingp = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return b_found;
|
||||
}
|
||||
|
||||
// remove all nodes from the list and delete the associated data
|
||||
template <class DATA_TYPE>
|
||||
void LLLinkedList<DATA_TYPE>::deleteAllData()
|
||||
{
|
||||
LLLinkNode *temp;
|
||||
// reset mCurrentp
|
||||
mCurrentp = mHead.mNextp;
|
||||
|
||||
while (mCurrentp)
|
||||
{
|
||||
temp = mCurrentp->mNextp;
|
||||
mCurrentp->deleteData();
|
||||
delete mCurrentp;
|
||||
mCurrentp = temp;
|
||||
}
|
||||
|
||||
// reset mHead and mCurrentp
|
||||
mHead.mNextp = NULL;
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
mCount = 0;
|
||||
}
|
||||
|
||||
// remove all nodes from the list but do not delete data
|
||||
template <class DATA_TYPE>
|
||||
void LLLinkedList<DATA_TYPE>::removeAllNodes()
|
||||
{
|
||||
LLLinkNode *temp;
|
||||
// reset mCurrentp
|
||||
mCurrentp = mHead.mNextp;
|
||||
|
||||
while (mCurrentp)
|
||||
{
|
||||
temp = mCurrentp->mNextp;
|
||||
mCurrentp->removeData();
|
||||
delete mCurrentp;
|
||||
mCurrentp = temp;
|
||||
}
|
||||
|
||||
// reset mHead and mCurrentp
|
||||
mHead.mNextp = NULL;
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
mCount = 0;
|
||||
}
|
||||
|
||||
// check to see if data is in list
|
||||
// if TRUE then mCurrentp and mCurrentOperatingp point to data
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::checkData(DATA_TYPE *data)
|
||||
{
|
||||
// reset mCurrentp
|
||||
mCurrentp = mHead.mNextp;
|
||||
|
||||
while (mCurrentp)
|
||||
{
|
||||
if (mCurrentp->mDatap == data)
|
||||
{
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
return TRUE;
|
||||
}
|
||||
mCurrentp = mCurrentp->mNextp;
|
||||
}
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// place mCurrentp on first node
|
||||
template <class DATA_TYPE>
|
||||
void LLLinkedList<DATA_TYPE>::resetList()
|
||||
{
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
}
|
||||
|
||||
// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
|
||||
template <class DATA_TYPE>
|
||||
DATA_TYPE *LLLinkedList<DATA_TYPE>::getCurrentData()
|
||||
{
|
||||
if (mCurrentp)
|
||||
{
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
mCurrentp = mCurrentp->mNextp;
|
||||
return mCurrentOperatingp->mDatap;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// same as getCurrentData() but a more intuitive name for the operation
|
||||
template <class DATA_TYPE>
|
||||
DATA_TYPE *LLLinkedList<DATA_TYPE>::getNextData()
|
||||
{
|
||||
if (mCurrentp)
|
||||
{
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
mCurrentp = mCurrentp->mNextp;
|
||||
return mCurrentOperatingp->mDatap;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
|
||||
template <class DATA_TYPE>
|
||||
DATA_TYPE *LLLinkedList<DATA_TYPE>::getFirstData()
|
||||
{
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
if (mCurrentp)
|
||||
{
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
mCurrentp = mCurrentp->mNextp;
|
||||
return mCurrentOperatingp->mDatap;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Note: n is zero-based
|
||||
template <class DATA_TYPE>
|
||||
DATA_TYPE *LLLinkedList<DATA_TYPE>::getNthData( U32 n )
|
||||
{
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
|
||||
// if empty, return NULL
|
||||
if (!mCurrentOperatingp)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for( U32 i = 0; i < n; i++ )
|
||||
{
|
||||
mCurrentOperatingp = mCurrentOperatingp->mNextp;
|
||||
if( !mCurrentOperatingp )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
return mCurrentOperatingp->mDatap;
|
||||
}
|
||||
|
||||
|
||||
// reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp
|
||||
template <class DATA_TYPE>
|
||||
DATA_TYPE *LLLinkedList<DATA_TYPE>::getLastData()
|
||||
{
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
|
||||
// if empty, return NULL
|
||||
if (!mCurrentOperatingp)
|
||||
return NULL;
|
||||
|
||||
// walk until we're pointing at the last entry
|
||||
while (mCurrentOperatingp->mNextp)
|
||||
{
|
||||
mCurrentOperatingp = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
return mCurrentOperatingp->mDatap;
|
||||
}
|
||||
|
||||
// remove the Node at mCurentOperatingp
|
||||
// leave mCurrentp and mCurentOperatingp on the next entry
|
||||
// return TRUE if found, FALSE if not found
|
||||
template <class DATA_TYPE>
|
||||
void LLLinkedList<DATA_TYPE>::removeCurrentData()
|
||||
{
|
||||
if (mCurrentOperatingp)
|
||||
{
|
||||
// remove the node
|
||||
// if there is a next one, fix it
|
||||
if (mCurrentOperatingp->mNextp)
|
||||
{
|
||||
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
|
||||
}
|
||||
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
|
||||
|
||||
// remove the LLLinkNode
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
|
||||
mCurrentOperatingp->removeData();
|
||||
delete mCurrentOperatingp;
|
||||
mCount--;
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
}
|
||||
}
|
||||
|
||||
// remove the Node at mCurentOperatingp and add it to newlist
|
||||
// leave mCurrentp and mCurentOperatingp on the next entry
|
||||
// return TRUE if found, FALSE if not found
|
||||
template <class DATA_TYPE>
|
||||
void LLLinkedList<DATA_TYPE>::moveCurrentData(LLLinkedList *newlist, BOOL b_sort)
|
||||
{
|
||||
if (mCurrentOperatingp)
|
||||
{
|
||||
// remove the node
|
||||
// if there is a next one, fix it
|
||||
if (mCurrentOperatingp->mNextp)
|
||||
{
|
||||
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
|
||||
}
|
||||
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
|
||||
|
||||
// remove the LLLinkNode
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
// move the node to the new list
|
||||
newlist->addData(mCurrentOperatingp);
|
||||
if (b_sort)
|
||||
bubbleSortList();
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
}
|
||||
}
|
||||
|
||||
template <class DATA_TYPE>
|
||||
BOOL LLLinkedList<DATA_TYPE>::moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort)
|
||||
{
|
||||
BOOL b_found = FALSE;
|
||||
// don't allow NULL to be passed to addData
|
||||
if (!data)
|
||||
{
|
||||
llerror("NULL pointer passed to LLLinkedList::removeData", 0);
|
||||
}
|
||||
|
||||
LLLinkNode *tcurr = mCurrentp;
|
||||
LLLinkNode *tcurrop = mCurrentOperatingp;
|
||||
|
||||
mCurrentp = mHead.mNextp;
|
||||
mCurrentOperatingp = mHead.mNextp;
|
||||
|
||||
while (mCurrentOperatingp)
|
||||
{
|
||||
if (mCurrentOperatingp->mDatap == data)
|
||||
{
|
||||
b_found = TRUE;
|
||||
|
||||
// remove the node
|
||||
|
||||
// if there is a next one, fix it
|
||||
if (mCurrentOperatingp->mNextp)
|
||||
{
|
||||
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
|
||||
}
|
||||
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
|
||||
|
||||
// if we were on the one we want to delete, bump the cached copies
|
||||
if ( (mCurrentOperatingp == tcurrop)
|
||||
||(mCurrentOperatingp == tcurr))
|
||||
{
|
||||
tcurrop = tcurr = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
|
||||
// remove the LLLinkNode
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
// move the node to the new list
|
||||
newlist->addData(mCurrentOperatingp);
|
||||
if (b_sort)
|
||||
newlist->bubbleSortList();
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
break;
|
||||
}
|
||||
mCurrentOperatingp = mCurrentOperatingp->mNextp;
|
||||
}
|
||||
// restore
|
||||
mCurrentp = tcurr;
|
||||
mCurrentOperatingp = tcurrop;
|
||||
return b_found;
|
||||
}
|
||||
|
||||
// delete the Node at mCurentOperatingp
|
||||
// leave mCurrentp anf mCurentOperatingp on the next entry
|
||||
// return TRUE if found, FALSE if not found
|
||||
template <class DATA_TYPE>
|
||||
void LLLinkedList<DATA_TYPE>::deleteCurrentData()
|
||||
{
|
||||
if (mCurrentOperatingp)
|
||||
{
|
||||
// remove the node
|
||||
// if there is a next one, fix it
|
||||
if (mCurrentOperatingp->mNextp)
|
||||
{
|
||||
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
|
||||
}
|
||||
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
|
||||
|
||||
// remove the LLLinkNode
|
||||
mCurrentp = mCurrentOperatingp->mNextp;
|
||||
|
||||
mCurrentOperatingp->deleteData();
|
||||
if (mCurrentOperatingp->mDatap)
|
||||
llerror("This is impossible!", 0);
|
||||
delete mCurrentOperatingp;
|
||||
mCurrentOperatingp = mCurrentp;
|
||||
mCount--;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
/**
|
||||
* @file ll_template_cast.h
|
||||
* @author Nat Goodspeed
|
||||
* @date 2009-11-21
|
||||
* @brief Define ll_template_cast function
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#if ! defined(LL_LL_TEMPLATE_CAST_H)
|
||||
#define LL_LL_TEMPLATE_CAST_H
|
||||
|
||||
/**
|
||||
* Implementation for ll_template_cast() (q.v.).
|
||||
*
|
||||
* Default implementation: trying to cast two completely unrelated types
|
||||
* returns 0. Typically you'd specify T and U as pointer types, but in fact T
|
||||
* can be any type that can be initialized with 0.
|
||||
*/
|
||||
template <typename T, typename U>
|
||||
struct ll_template_cast_impl
|
||||
{
|
||||
T operator()(U)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ll_template_cast<T>(some_value) is for use in a template function when
|
||||
* some_value might be of arbitrary type, but you want to recognize type T
|
||||
* specially.
|
||||
*
|
||||
* It's designed for use with pointer types. Example:
|
||||
* @code
|
||||
* struct SpecialClass
|
||||
* {
|
||||
* void someMethod(const std::string&) const;
|
||||
* };
|
||||
*
|
||||
* template <class REALCLASS>
|
||||
* void somefunc(const REALCLASS& instance)
|
||||
* {
|
||||
* const SpecialClass* ptr = ll_template_cast<const SpecialClass*>(&instance);
|
||||
* if (ptr)
|
||||
* {
|
||||
* ptr->someMethod("Call method only available on SpecialClass");
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* Why is this better than dynamic_cast<>? Because unless OtherClass is
|
||||
* polymorphic, the following won't even compile (gcc 4.0.1):
|
||||
* @code
|
||||
* OtherClass other;
|
||||
* SpecialClass* ptr = dynamic_cast<SpecialClass*>(&other);
|
||||
* @endcode
|
||||
* to say nothing of this:
|
||||
* @code
|
||||
* void function(int);
|
||||
* SpecialClass* ptr = dynamic_cast<SpecialClass*>(&function);
|
||||
* @endcode
|
||||
* ll_template_cast handles these kinds of cases by returning 0.
|
||||
*/
|
||||
template <typename T, typename U>
|
||||
T ll_template_cast(U value)
|
||||
{
|
||||
return ll_template_cast_impl<T, U>()(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for ll_template_cast() (q.v.).
|
||||
*
|
||||
* Implementation for identical types: return same value.
|
||||
*/
|
||||
template <typename T>
|
||||
struct ll_template_cast_impl<T, T>
|
||||
{
|
||||
T operator()(T value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of
|
||||
* type @c source, <tt>ll_template_cast<dest>(s)</tt> will return @c s --
|
||||
* presuming that @c source can be converted to @c dest by the normal rules of
|
||||
* C++.
|
||||
*
|
||||
* By default, <tt>ll_template_cast<dest>(s)</tt> will return 0 unless @c s's
|
||||
* type is literally identical to @c dest. (This is because of the
|
||||
* straightforward application of template specialization rules.) That can
|
||||
* lead to surprising results, e.g.:
|
||||
*
|
||||
* @code
|
||||
* Foo myFoo;
|
||||
* const Foo* fooptr = ll_template_cast<const Foo*>(&myFoo);
|
||||
* @endcode
|
||||
*
|
||||
* Here @c fooptr will be 0 because <tt>&myFoo</tt> is of type <tt>Foo*</tt>
|
||||
* -- @em not <tt>const Foo*</tt>. (Declaring <tt>const Foo myFoo;</tt> would
|
||||
* force the compiler to do the right thing.)
|
||||
*
|
||||
* More disappointingly:
|
||||
* @code
|
||||
* struct Base {};
|
||||
* struct Subclass: public Base {};
|
||||
* Subclass object;
|
||||
* Base* ptr = ll_template_cast<Base*>(&object);
|
||||
* @endcode
|
||||
*
|
||||
* Here @c ptr will be 0 because <tt>&object</tt> is of type
|
||||
* <tt>Subclass*</tt> rather than <tt>Base*</tt>. We @em want this cast to
|
||||
* succeed, but without our help ll_template_cast can't recognize it.
|
||||
*
|
||||
* The following would suffice:
|
||||
* @code
|
||||
* LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
|
||||
* ...
|
||||
* Base* ptr = ll_template_cast<Base*>(&object);
|
||||
* @endcode
|
||||
*
|
||||
* However, as noted earlier, this is easily fooled:
|
||||
* @code
|
||||
* const Base* ptr = ll_template_cast<const Base*>(&object);
|
||||
* @endcode
|
||||
* would still produce 0 because we haven't yet seen:
|
||||
* @code
|
||||
* LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
|
||||
* @endcode
|
||||
*
|
||||
* @TODO
|
||||
* This macro should use Boost type_traits facilities for stripping and
|
||||
* re-adding @c const and @c volatile qualifiers so that invoking
|
||||
* LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all
|
||||
* permitted permutations. It's really not fair to the coder to require
|
||||
* separate:
|
||||
* @code
|
||||
* LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
|
||||
* LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
|
||||
* LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*);
|
||||
* @endcode
|
||||
*
|
||||
* (Naturally we omit <tt>LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*)</tt>
|
||||
* because that's not permitted by normal C++ assignment anyway.)
|
||||
*/
|
||||
#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \
|
||||
template <> \
|
||||
struct ll_template_cast_impl<DEST, SOURCE> \
|
||||
{ \
|
||||
DEST operator()(SOURCE wrapper) \
|
||||
{ \
|
||||
return wrapper; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* ! defined(LL_LL_TEMPLATE_CAST_H) */
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
/**
|
||||
* @file llaccountingcost.h
|
||||
* @
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_ACCOUNTINGQUOTA_H
|
||||
#define LL_ACCOUNTINGQUOTA_H
|
||||
|
||||
struct ParcelQuota
|
||||
{
|
||||
ParcelQuota( F32 ownerRenderCost, F32 ownerPhysicsCost, F32 ownerNetworkCost, F32 ownerSimulationCost,
|
||||
F32 groupRenderCost, F32 groupPhysicsCost, F32 groupNetworkCost, F32 groupSimulationCost,
|
||||
F32 otherRenderCost, F32 otherPhysicsCost, F32 otherNetworkCost, F32 otherSimulationCost,
|
||||
F32 tempRenderCost, F32 tempPhysicsCost, F32 tempNetworkCost, F32 tempSimulationCost,
|
||||
F32 selectedRenderCost, F32 selectedPhysicsCost, F32 selectedNetworkCost, F32 selectedSimulationCost,
|
||||
F32 parcelCapacity )
|
||||
: mOwnerRenderCost( ownerRenderCost ), mOwnerPhysicsCost( ownerPhysicsCost )
|
||||
, mOwnerNetworkCost( ownerNetworkCost ), mOwnerSimulationCost( ownerSimulationCost )
|
||||
, mGroupRenderCost( groupRenderCost ), mGroupPhysicsCost( groupPhysicsCost )
|
||||
, mGroupNetworkCost( groupNetworkCost ), mGroupSimulationCost( groupSimulationCost )
|
||||
, mOtherRenderCost( otherRenderCost ), mOtherPhysicsCost( otherPhysicsCost )
|
||||
, mOtherNetworkCost( otherNetworkCost ), mOtherSimulationCost( otherSimulationCost )
|
||||
, mTempRenderCost( tempRenderCost ), mTempPhysicsCost( tempPhysicsCost )
|
||||
, mTempNetworkCost( tempNetworkCost ), mTempSimulationCost( tempSimulationCost )
|
||||
, mSelectedRenderCost( tempRenderCost ), mSelectedPhysicsCost( tempPhysicsCost )
|
||||
, mSelectedNetworkCost( tempNetworkCost ), mSelectedSimulationCost( selectedSimulationCost )
|
||||
, mParcelCapacity( parcelCapacity )
|
||||
{
|
||||
}
|
||||
|
||||
ParcelQuota(){}
|
||||
F32 mOwnerRenderCost, mOwnerPhysicsCost, mOwnerNetworkCost, mOwnerSimulationCost;
|
||||
F32 mGroupRenderCost, mGroupPhysicsCost, mGroupNetworkCost, mGroupSimulationCost;
|
||||
F32 mOtherRenderCost, mOtherPhysicsCost, mOtherNetworkCost, mOtherSimulationCost;
|
||||
F32 mTempRenderCost, mTempPhysicsCost, mTempNetworkCost, mTempSimulationCost;
|
||||
F32 mSelectedRenderCost, mSelectedPhysicsCost, mSelectedNetworkCost, mSelectedSimulationCost;
|
||||
F32 mParcelCapacity;
|
||||
};
|
||||
|
||||
//SelectionQuota atm does not require a id
|
||||
struct SelectionCost
|
||||
{
|
||||
SelectionCost( /*LLTransactionID transactionId, */ F32 physicsCost, F32 networkCost, F32 simulationCost )
|
||||
//: mTransactionId( transactionId)
|
||||
: mPhysicsCost( physicsCost )
|
||||
, mNetworkCost( networkCost )
|
||||
, mSimulationCost( simulationCost )
|
||||
{
|
||||
}
|
||||
SelectionCost()
|
||||
: mPhysicsCost( 0.0f )
|
||||
, mNetworkCost( 0.0f )
|
||||
, mSimulationCost( 0.0f )
|
||||
{}
|
||||
|
||||
F32 mPhysicsCost, mNetworkCost, mSimulationCost;
|
||||
//LLTransactionID mTransactionId;
|
||||
};
|
||||
|
||||
typedef enum { Roots = 0 , Prims } eSelectionType;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
/**
|
||||
* @file llagentconstants.h
|
||||
* @author James Cook, Andrew Meadows, Richard Nelson
|
||||
* @brief Shared constants through the system for agents.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLAGENTCONSTANTS_H
|
||||
#define LL_LLAGENTCONSTANTS_H
|
||||
|
||||
const U32 CONTROL_AT_POS_INDEX = 0;
|
||||
const U32 CONTROL_AT_NEG_INDEX = 1;
|
||||
const U32 CONTROL_LEFT_POS_INDEX = 2;
|
||||
const U32 CONTROL_LEFT_NEG_INDEX = 3;
|
||||
const U32 CONTROL_UP_POS_INDEX = 4;
|
||||
const U32 CONTROL_UP_NEG_INDEX = 5;
|
||||
const U32 CONTROL_PITCH_POS_INDEX = 6;
|
||||
const U32 CONTROL_PITCH_NEG_INDEX = 7;
|
||||
const U32 CONTROL_YAW_POS_INDEX = 8;
|
||||
const U32 CONTROL_YAW_NEG_INDEX = 9;
|
||||
const U32 CONTROL_FAST_AT_INDEX = 10;
|
||||
const U32 CONTROL_FAST_LEFT_INDEX = 11;
|
||||
const U32 CONTROL_FAST_UP_INDEX = 12;
|
||||
const U32 CONTROL_FLY_INDEX = 13;
|
||||
const U32 CONTROL_STOP_INDEX = 14;
|
||||
const U32 CONTROL_FINISH_ANIM_INDEX = 15;
|
||||
const U32 CONTROL_STAND_UP_INDEX = 16;
|
||||
const U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
|
||||
const U32 CONTROL_MOUSELOOK_INDEX = 18;
|
||||
const U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
|
||||
const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
|
||||
const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
|
||||
const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
|
||||
const U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
|
||||
const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
|
||||
const U32 CONTROL_TURN_LEFT_INDEX = 25;
|
||||
const U32 CONTROL_TURN_RIGHT_INDEX = 26;
|
||||
const U32 CONTROL_AWAY_INDEX = 27;
|
||||
const U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
|
||||
const U32 CONTROL_LBUTTON_UP_INDEX = 29;
|
||||
const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
|
||||
const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
|
||||
const U32 TOTAL_CONTROLS = 32;
|
||||
|
||||
const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
|
||||
const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
|
||||
const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
|
||||
const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
|
||||
const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
|
||||
const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
|
||||
const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
|
||||
const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
|
||||
const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
|
||||
const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
|
||||
|
||||
const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
|
||||
const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
|
||||
const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
|
||||
|
||||
const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
|
||||
const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
|
||||
const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
|
||||
const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
|
||||
const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
|
||||
const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
|
||||
|
||||
const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
|
||||
const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
|
||||
const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
|
||||
const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
|
||||
const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
|
||||
const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
|
||||
const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
|
||||
const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
|
||||
|
||||
const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
|
||||
|
||||
const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
|
||||
const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
|
||||
const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
|
||||
const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
|
||||
|
||||
const U32 AGENT_CONTROL_AT = AGENT_CONTROL_AT_POS
|
||||
| AGENT_CONTROL_AT_NEG
|
||||
| AGENT_CONTROL_NUDGE_AT_POS
|
||||
| AGENT_CONTROL_NUDGE_AT_NEG;
|
||||
|
||||
const U32 AGENT_CONTROL_LEFT = AGENT_CONTROL_LEFT_POS
|
||||
| AGENT_CONTROL_LEFT_NEG
|
||||
| AGENT_CONTROL_NUDGE_LEFT_POS
|
||||
| AGENT_CONTROL_NUDGE_LEFT_NEG;
|
||||
|
||||
const U32 AGENT_CONTROL_UP = AGENT_CONTROL_UP_POS
|
||||
| AGENT_CONTROL_UP_NEG
|
||||
| AGENT_CONTROL_NUDGE_UP_POS
|
||||
| AGENT_CONTROL_NUDGE_UP_NEG;
|
||||
|
||||
const U32 AGENT_CONTROL_HORIZONTAL = AGENT_CONTROL_AT
|
||||
| AGENT_CONTROL_LEFT;
|
||||
|
||||
const U32 AGENT_CONTROL_NOT_USED_BY_LSL = AGENT_CONTROL_FLY
|
||||
| AGENT_CONTROL_STOP
|
||||
| AGENT_CONTROL_FINISH_ANIM
|
||||
| AGENT_CONTROL_STAND_UP
|
||||
| AGENT_CONTROL_SIT_ON_GROUND
|
||||
| AGENT_CONTROL_MOUSELOOK
|
||||
| AGENT_CONTROL_AWAY;
|
||||
|
||||
const U32 AGENT_CONTROL_MOVEMENT = AGENT_CONTROL_AT
|
||||
| AGENT_CONTROL_LEFT
|
||||
| AGENT_CONTROL_UP;
|
||||
|
||||
const U32 AGENT_CONTROL_ROTATION = AGENT_CONTROL_PITCH_POS
|
||||
| AGENT_CONTROL_PITCH_NEG
|
||||
| AGENT_CONTROL_YAW_POS
|
||||
| AGENT_CONTROL_YAW_NEG;
|
||||
|
||||
const U32 AGENT_CONTROL_NUDGE = AGENT_CONTROL_NUDGE_AT_POS
|
||||
| AGENT_CONTROL_NUDGE_AT_NEG
|
||||
| AGENT_CONTROL_NUDGE_LEFT_POS
|
||||
| AGENT_CONTROL_NUDGE_LEFT_NEG;
|
||||
|
||||
|
||||
// move these up so that we can hide them in "State" for object updates
|
||||
// (for now)
|
||||
const U32 AGENT_ATTACH_OFFSET = 4;
|
||||
const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
|
||||
const U32 AGENT_ATTACH_CLEAR = 0x00;
|
||||
|
||||
// RN: this method swaps the upper and lower nibbles to maintain backward
|
||||
// compatibility with old objects that only used the upper nibble
|
||||
#define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))
|
||||
|
||||
// test state for use in testing grabbing the camera
|
||||
const U32 AGENT_CAMERA_OBJECT = 0x1 << 3;
|
||||
|
||||
const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters?
|
||||
|
||||
#endif
|
||||
|
|
@ -60,7 +60,7 @@ LLAlignedArray<T, alignment>::LLAlignedArray()
|
|||
template <class T, U32 alignment>
|
||||
LLAlignedArray<T, alignment>::~LLAlignedArray()
|
||||
{
|
||||
ll_aligned_free(mArray);
|
||||
ll_aligned_free<alignment>(mArray);
|
||||
mArray = NULL;
|
||||
mElementCount = 0;
|
||||
mCapacity = 0;
|
||||
|
|
@ -74,7 +74,7 @@ void LLAlignedArray<T, alignment>::push_back(const T& elem)
|
|||
{
|
||||
mCapacity++;
|
||||
mCapacity *= 2;
|
||||
T* new_buf = (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment);
|
||||
T* new_buf = (T*) ll_aligned_malloc<alignment>(mCapacity*sizeof(T));
|
||||
if (mArray)
|
||||
{
|
||||
ll_memcpy_nonaliased_aligned_16((char*)new_buf, (char*)mArray, sizeof(T)*mElementCount);
|
||||
|
|
@ -86,7 +86,7 @@ void LLAlignedArray<T, alignment>::push_back(const T& elem)
|
|||
mArray[mElementCount++] = elem;
|
||||
|
||||
//delete old array here to prevent error on a.push_back(a[0])
|
||||
ll_aligned_free(old_buf);
|
||||
ll_aligned_free<alignment>(old_buf);
|
||||
}
|
||||
|
||||
template <class T, U32 alignment>
|
||||
|
|
@ -95,11 +95,11 @@ void LLAlignedArray<T, alignment>::resize(U32 size)
|
|||
if (mCapacity < size)
|
||||
{
|
||||
mCapacity = size+mCapacity*2;
|
||||
T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment) : NULL;
|
||||
T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc<alignment>(mCapacity*sizeof(T)) : NULL;
|
||||
if (mArray)
|
||||
{
|
||||
ll_memcpy_nonaliased_aligned_16((char*) new_buf, (char*) mArray, sizeof(T)*mElementCount);
|
||||
ll_aligned_free(mArray);
|
||||
ll_aligned_free<alignment>(mArray);
|
||||
}
|
||||
|
||||
/*for (U32 i = mElementCount; i < mCapacity; ++i)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text)
|
|||
{
|
||||
// *TODO - determine if there should be some better error state than
|
||||
// mLines being empty. -brad
|
||||
llwarns << "invalid heap profile data passed into parser." << llendl;
|
||||
LL_WARNS() << "invalid heap profile data passed into parser." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -232,8 +232,8 @@ bool LLApp::parseCommandOptions(int argc, char** argv)
|
|||
{
|
||||
if(argv[ii][0] != '-')
|
||||
{
|
||||
llinfos << "Did not find option identifier while parsing token: "
|
||||
<< argv[ii] << llendl;
|
||||
LL_INFOS() << "Did not find option identifier while parsing token: "
|
||||
<< argv[ii] << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
int offset = 1;
|
||||
|
|
@ -374,7 +374,7 @@ void LLApp::setupErrorHandling(bool second_instance, EMiniDumpType minidump_type
|
|||
}
|
||||
else
|
||||
{
|
||||
llwarns << "adding breakpad exception handler" << llendl;
|
||||
LL_WARNS() << "adding breakpad exception handler" << LL_ENDL;
|
||||
|
||||
std::wstring wpipe_name;
|
||||
wpipe_name = mCrashReportPipeStr + wstringize(getPid());
|
||||
|
|
@ -506,7 +506,7 @@ void LLApp::startErrorThread()
|
|||
//
|
||||
if(!mThreadErrorp)
|
||||
{
|
||||
llinfos << "Starting error thread" << llendl;
|
||||
LL_INFOS() << "Starting error thread" << LL_ENDL;
|
||||
mThreadErrorp = new LLErrorThread();
|
||||
mThreadErrorp->setUserData((void *) this);
|
||||
mThreadErrorp->start();
|
||||
|
|
@ -526,7 +526,7 @@ void LLApp::runErrorHandler()
|
|||
LLApp::sErrorHandler();
|
||||
}
|
||||
|
||||
//llinfos << "App status now STOPPED" << llendl;
|
||||
//LL_INFOS() << "App status now STOPPED" << LL_ENDL;
|
||||
LLApp::setStopped();
|
||||
}
|
||||
|
||||
|
|
@ -590,7 +590,7 @@ void LLApp::setQuitting()
|
|||
if (!isExiting())
|
||||
{
|
||||
// If we're already exiting, we don't want to reset our state back to quitting.
|
||||
llinfos << "Setting app state to QUITTING" << llendl;
|
||||
LL_INFOS() << "Setting app state to QUITTING" << LL_ENDL;
|
||||
setStatus(APP_STATUS_QUITTING);
|
||||
}
|
||||
}
|
||||
|
|
@ -675,7 +675,7 @@ LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *except
|
|||
|
||||
if (LLApp::isError())
|
||||
{
|
||||
llwarns << "Got another fatal signal while in the error handler, die now!" << llendl;
|
||||
LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL;
|
||||
retval = EXCEPTION_EXECUTE_HANDLER;
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -721,7 +721,7 @@ BOOL ConsoleCtrlHandler(DWORD fdwCtrlType)
|
|||
// We're already trying to die, just ignore this signal
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl;
|
||||
LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -822,7 +822,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llinfos << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << llendl;
|
||||
LL_INFOS() << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -831,7 +831,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
case SIGCHLD:
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llinfos << "Signal handler - Got SIGCHLD from " << info->si_pid << llendl;
|
||||
LL_INFOS() << "Signal handler - Got SIGCHLD from " << info->si_pid << LL_ENDL;
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
@ -839,7 +839,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
// Abort just results in termination of the app, no funky error handling.
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llwarns << "Signal handler - Got SIGABRT, terminating" << llendl;
|
||||
LL_WARNS() << "Signal handler - Got SIGABRT, terminating" << LL_ENDL;
|
||||
}
|
||||
clear_signals();
|
||||
raise(signum);
|
||||
|
|
@ -849,7 +849,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
case SIGTERM:
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llwarns << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << llendl;
|
||||
LL_WARNS() << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << LL_ENDL;
|
||||
}
|
||||
// Graceful exit
|
||||
// Just set our state to quitting, not error
|
||||
|
|
@ -858,7 +858,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
// We're already trying to die, just ignore this signal
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl;
|
||||
LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -880,7 +880,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
// Smackdown treated just like any other app termination, for now
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llwarns << "Signal handler - Handling smackdown signal!" << llendl;
|
||||
LL_WARNS() << "Signal handler - Handling smackdown signal!" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -894,7 +894,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llwarns << "Signal handler - Handling fatal signal!" << llendl;
|
||||
LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL;
|
||||
}
|
||||
if (LLApp::isError())
|
||||
{
|
||||
|
|
@ -904,7 +904,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llwarns << "Signal handler - Got another fatal signal while in the error handler, die now!" << llendl;
|
||||
LL_WARNS() << "Signal handler - Got another fatal signal while in the error handler, die now!" << LL_ENDL;
|
||||
}
|
||||
raise(signum);
|
||||
return;
|
||||
|
|
@ -912,13 +912,13 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
|
||||
LL_WARNS() << "Signal handler - Flagging error status and waiting for shutdown" << LL_ENDL;
|
||||
}
|
||||
|
||||
if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
|
||||
{
|
||||
clear_signals();
|
||||
llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
|
||||
LL_WARNS() << "Fatal signal received, not handling the crash here, passing back to operating system" << LL_ENDL;
|
||||
raise(signum);
|
||||
return;
|
||||
}
|
||||
|
|
@ -933,7 +933,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llwarns << "Signal handler - App is stopped, reraising signal" << llendl;
|
||||
LL_WARNS() << "Signal handler - App is stopped, reraising signal" << LL_ENDL;
|
||||
}
|
||||
clear_signals();
|
||||
raise(signum);
|
||||
|
|
@ -941,7 +941,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
} else {
|
||||
if (LLApp::sLogInSignal)
|
||||
{
|
||||
llinfos << "Signal handler - Unhandled signal " << signum << ", ignoring!" << llendl;
|
||||
LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -975,7 +975,7 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_
|
|||
|
||||
strncpy(path, minidump_desc.path(), remaining);
|
||||
|
||||
llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;
|
||||
LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
|
||||
LLApp::runErrorHandler();
|
||||
|
||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
||||
|
|
@ -1021,7 +1021,7 @@ bool unix_post_minidump_callback(const char *dump_dir,
|
|||
strncpy(path, ".dmp", remaining);
|
||||
}
|
||||
|
||||
llinfos << "generated minidump: " << path << llendl;
|
||||
LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
|
||||
LLApp::runErrorHandler();
|
||||
|
||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
||||
|
|
@ -1130,16 +1130,16 @@ bool windows_post_minidump_callback(const wchar_t* dump_path,
|
|||
|
||||
// </FS:ND>
|
||||
|
||||
llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;
|
||||
LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
|
||||
// *NOTE:Mani - this code is stolen from LLApp, where its never actually used.
|
||||
//OSMessageBox("Attach Debugger Now", "Error", OSMB_OK);
|
||||
// *TODO: Translate the signals/exceptions into cross-platform stuff
|
||||
// Windows implementation
|
||||
llinfos << "Entering Windows Exception Handler..." << llendl;
|
||||
LL_INFOS() << "Entering Windows Exception Handler..." << LL_ENDL;
|
||||
|
||||
if (LLApp::isError())
|
||||
{
|
||||
llwarns << "Got another fatal signal while in the error handler, die now!" << llendl;
|
||||
LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL;
|
||||
}
|
||||
|
||||
// Flag status to error, so thread_error starts its work
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <map>
|
||||
#include "llrun.h"
|
||||
#include "llsd.h"
|
||||
#include "lloptioninterface.h"
|
||||
// Forward declarations
|
||||
template <typename Type> class LLAtomic32;
|
||||
typedef LLAtomic32<U32> LLAtomicU32;
|
||||
|
|
@ -55,7 +54,7 @@ namespace google_breakpad {
|
|||
class ExceptionHandler; // See exception_handler.h
|
||||
}
|
||||
|
||||
class LL_COMMON_API LLApp : public LLOptionInterface
|
||||
class LL_COMMON_API LLApp
|
||||
{
|
||||
friend class LLErrorThread;
|
||||
public:
|
||||
|
|
@ -104,7 +103,7 @@ public:
|
|||
* @param name The name of the option.
|
||||
* @return Returns the option data.
|
||||
*/
|
||||
virtual LLSD getOption(const std::string& name) const;
|
||||
LLSD getOption(const std::string& name) const;
|
||||
|
||||
/**
|
||||
* @brief Parse command line options and insert them into
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "linden_common.h"
|
||||
#include "llapr.h"
|
||||
#include "apr_dso.h"
|
||||
#include "llthreadlocalstorage.h"
|
||||
|
||||
apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool
|
||||
|
||||
|
|
@ -44,12 +45,15 @@ const S32 FULL_VOLATILE_APR_POOL = 1024 ; //number of references to LLVolatileAP
|
|||
|
||||
std::string ndConvertFilename( std::string const &aFilename ); // <FS:ND/> Porper UTF-8 filename handling under windows.
|
||||
|
||||
bool gAPRInitialized = false;
|
||||
|
||||
void ll_init_apr()
|
||||
{
|
||||
// Initialize APR and create the global pool
|
||||
apr_initialize();
|
||||
|
||||
if (!gAPRPoolp)
|
||||
{
|
||||
// Initialize APR and create the global pool
|
||||
apr_initialize();
|
||||
apr_pool_create(&gAPRPoolp, NULL);
|
||||
|
||||
// Initialize the logging mutex
|
||||
|
|
@ -65,11 +69,21 @@ void ll_init_apr()
|
|||
{
|
||||
ll::apr::LLAPRFile::sAPRFilePoolp = new LLVolatileAPRPool(FALSE) ;
|
||||
}
|
||||
|
||||
LLThreadLocalPointerBase::initAllThreadLocalStorage();
|
||||
gAPRInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool ll_apr_is_initialized()
|
||||
{
|
||||
return gAPRInitialized;
|
||||
}
|
||||
|
||||
void ll_cleanup_apr()
|
||||
{
|
||||
gAPRInitialized = false;
|
||||
|
||||
LL_INFOS("APR") << "Cleaning up APR" << LL_ENDL;
|
||||
|
||||
if (gLogMutexp)
|
||||
|
|
@ -88,6 +102,9 @@ void ll_cleanup_apr()
|
|||
apr_thread_mutex_destroy(gCallStacksLogMutexp);
|
||||
gCallStacksLogMutexp = NULL;
|
||||
}
|
||||
|
||||
LLThreadLocalPointerBase::destroyAllThreadLocalStorage();
|
||||
|
||||
if (gAPRPoolp)
|
||||
{
|
||||
apr_pool_destroy(gAPRPoolp);
|
||||
|
|
@ -462,7 +479,7 @@ S32 LLAPRFile::read(void *buf, S32 nbytes)
|
|||
{
|
||||
if(!mFile)
|
||||
{
|
||||
llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ;
|
||||
LL_WARNS() << "apr mFile is removed by somebody else. Can not read." << LL_ENDL ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -484,7 +501,7 @@ S32 LLAPRFile::write(const void *buf, S32 nbytes)
|
|||
{
|
||||
if(!mFile)
|
||||
{
|
||||
llwarns << "apr mFile is removed by somebody else. Can not write." << llendl ;
|
||||
LL_WARNS() << "apr mFile is removed by somebody else. Can not write." << LL_ENDL ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,28 +32,34 @@
|
|||
#if LL_LINUX || LL_SOLARIS
|
||||
#include <sys/param.h> // Need PATH_MAX in APR headers...
|
||||
#endif
|
||||
#if LL_WINDOWS
|
||||
// Limit Windows API to small and manageable set.
|
||||
// If you get undefined symbols, find the appropriate
|
||||
// Windows header file and include that in your .cpp file.
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include "llwin32headerslean.h"
|
||||
#include "apr_thread_proc.h"
|
||||
#include "apr_thread_mutex.h"
|
||||
#include "apr_getopt.h"
|
||||
#include "apr_signal.h"
|
||||
#include "apr_atomic.h"
|
||||
|
||||
#include "llstring.h"
|
||||
|
||||
extern LL_COMMON_API apr_thread_mutex_t* gLogMutexp;
|
||||
extern apr_thread_mutex_t* gCallStacksLogMutexp;
|
||||
|
||||
struct apr_dso_handle_t;
|
||||
/**
|
||||
* @brief Function which appropriately logs error or remains quiet on
|
||||
* APR_SUCCESS.
|
||||
* @return Returns <code>true</code> if status is an error condition.
|
||||
*/
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status);
|
||||
/// There's a whole other APR error-message function if you pass a DSO handle.
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status);
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool
|
||||
|
||||
/**
|
||||
* @brief initialize the common apr constructs -- apr itself, the
|
||||
|
|
@ -66,6 +72,9 @@ void LL_COMMON_API ll_init_apr();
|
|||
*/
|
||||
void LL_COMMON_API ll_cleanup_apr();
|
||||
|
||||
bool LL_COMMON_API ll_apr_is_initialized();
|
||||
|
||||
|
||||
//
|
||||
//LL apr_pool
|
||||
//manage apr_pool_t, destroy allocated apr_pool in the destruction function.
|
||||
|
|
@ -271,19 +280,6 @@ public:
|
|||
};
|
||||
|
||||
} }
|
||||
/**
|
||||
* @brief Function which appropriately logs error or remains quiet on
|
||||
* APR_SUCCESS.
|
||||
* @return Returns <code>true</code> if status is an error condition.
|
||||
*/
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status);
|
||||
/// There's a whole other APR error-message function if you pass a DSO handle.
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status);
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool
|
||||
|
||||
#include "nd/ndfile.h"
|
||||
//typedef ll::apr::LLAPRFile LLAPRFile;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "stdenums.h" // for EDragAndDropType
|
||||
|
||||
class LL_COMMON_API LLAssetType
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,296 +0,0 @@
|
|||
/**
|
||||
* @file llassoclist.h
|
||||
* @brief LLAssocList class header file
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLASSOCLIST_H
|
||||
#define LL_LLASSOCLIST_H
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// LLAssocList is an associative list container class.
|
||||
//
|
||||
// The implementation is a single linked list.
|
||||
// Both index and value objects are stored by value (not reference).
|
||||
// If pointer values are specified for index and/or value, this
|
||||
// container does NOT assume ownership of the referenced objects,
|
||||
// and does NOT delete() them on removal or destruction of the container.
|
||||
//
|
||||
// Note that operations are generally not optimized, and may of them
|
||||
// are O(n) complexity.
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
#include <iostream>
|
||||
|
||||
template<class INDEX_TYPE, class VALUE_TYPE>
|
||||
class LLAssocList
|
||||
{
|
||||
private:
|
||||
// internal list node type
|
||||
class Node
|
||||
{
|
||||
public:
|
||||
Node(const INDEX_TYPE &index, const VALUE_TYPE &value, Node *next)
|
||||
{
|
||||
mIndex = index;
|
||||
mValue = value;
|
||||
mNext = next;
|
||||
}
|
||||
~Node() { }
|
||||
INDEX_TYPE mIndex;
|
||||
VALUE_TYPE mValue;
|
||||
Node *mNext;
|
||||
};
|
||||
|
||||
// head of the linked list
|
||||
Node *mHead;
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
LLAssocList()
|
||||
{
|
||||
mHead = NULL;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
~LLAssocList()
|
||||
{
|
||||
removeAll();
|
||||
}
|
||||
|
||||
// Returns TRUE if list is empty.
|
||||
BOOL isEmpty()
|
||||
{
|
||||
return (mHead == NULL);
|
||||
}
|
||||
|
||||
// Returns the number of items in the list.
|
||||
U32 length()
|
||||
{
|
||||
U32 count = 0;
|
||||
for ( Node *node = mHead;
|
||||
node;
|
||||
node = node->mNext )
|
||||
{
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
// Removes item with the specified index.
|
||||
BOOL remove( const INDEX_TYPE &index )
|
||||
{
|
||||
if (!mHead)
|
||||
return FALSE;
|
||||
|
||||
if (mHead->mIndex == index)
|
||||
{
|
||||
Node *node = mHead;
|
||||
mHead = mHead->mNext;
|
||||
delete node;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for ( Node *prev = mHead;
|
||||
prev->mNext;
|
||||
prev = prev->mNext )
|
||||
{
|
||||
if (prev->mNext->mIndex == index)
|
||||
{
|
||||
Node *node = prev->mNext;
|
||||
prev->mNext = prev->mNext->mNext;
|
||||
delete node;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Removes all items from the list.
|
||||
void removeAll()
|
||||
{
|
||||
while ( mHead )
|
||||
{
|
||||
Node *node = mHead;
|
||||
mHead = mHead->mNext;
|
||||
delete node;
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a new item to the head of the list,
|
||||
// removing any existing item with same index.
|
||||
void addToHead( const INDEX_TYPE &index, const VALUE_TYPE &value )
|
||||
{
|
||||
remove(index);
|
||||
Node *node = new Node(index, value, mHead);
|
||||
mHead = node;
|
||||
}
|
||||
|
||||
// Adds a new item to the end of the list,
|
||||
// removing any existing item with the same index.
|
||||
void addToTail( const INDEX_TYPE &index, const VALUE_TYPE &value )
|
||||
{
|
||||
remove(index);
|
||||
Node *node = new Node(index, value, NULL);
|
||||
if (!mHead)
|
||||
{
|
||||
mHead = node;
|
||||
return;
|
||||
}
|
||||
for ( Node *prev=mHead;
|
||||
prev;
|
||||
prev=prev->mNext )
|
||||
{
|
||||
if (!prev->mNext)
|
||||
{
|
||||
prev->mNext=node;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the value of a specified index.
|
||||
// If index does not exist, a new value will be added only if
|
||||
// 'addIfNotFound' is set to TRUE.
|
||||
// Returns TRUE if successful.
|
||||
BOOL setValue( const INDEX_TYPE &index, const VALUE_TYPE &value, BOOL addIfNotFound=FALSE )
|
||||
{
|
||||
VALUE_TYPE *valueP = getValue(index);
|
||||
if (valueP)
|
||||
{
|
||||
*valueP = value;
|
||||
return TRUE;
|
||||
}
|
||||
if (!addIfNotFound)
|
||||
return FALSE;
|
||||
addToTail(index, value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Sets the ith value in the list.
|
||||
// A new value will NOT be addded, if the ith value does not exist.
|
||||
// Returns TRUE if successful.
|
||||
BOOL setValueAt( U32 i, const VALUE_TYPE &value )
|
||||
{
|
||||
VALUE_TYPE *valueP = getValueAt(i);
|
||||
if (valueP)
|
||||
{
|
||||
*valueP = value;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Returns a pointer to the value for the specified index,
|
||||
// or NULL if no item found.
|
||||
VALUE_TYPE *getValue( const INDEX_TYPE &index )
|
||||
{
|
||||
for ( Node *node = mHead;
|
||||
node;
|
||||
node = node->mNext )
|
||||
{
|
||||
if (node->mIndex == index)
|
||||
return &node->mValue;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Returns a pointer to the ith value in the list, or
|
||||
// NULL if i is not valid.
|
||||
VALUE_TYPE *getValueAt( U32 i )
|
||||
{
|
||||
U32 count = 0;
|
||||
for ( Node *node = mHead;
|
||||
node;
|
||||
node = node->mNext )
|
||||
{
|
||||
if (count == i)
|
||||
return &node->mValue;
|
||||
count++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Returns a pointer to the index for the specified index,
|
||||
// or NULL if no item found.
|
||||
INDEX_TYPE *getIndex( const INDEX_TYPE &index )
|
||||
{
|
||||
for ( Node *node = mHead;
|
||||
node;
|
||||
node = node->mNext )
|
||||
{
|
||||
if (node->mIndex == index)
|
||||
return &node->mIndex;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Returns a pointer to the ith index in the list, or
|
||||
// NULL if i is not valid.
|
||||
INDEX_TYPE *getIndexAt( U32 i )
|
||||
{
|
||||
U32 count = 0;
|
||||
for ( Node *node = mHead;
|
||||
node;
|
||||
node = node->mNext )
|
||||
{
|
||||
if (count == i)
|
||||
return &node->mIndex;
|
||||
count++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Returns a pointer to the value for the specified index,
|
||||
// or NULL if no item found.
|
||||
VALUE_TYPE *operator[](const INDEX_TYPE &index)
|
||||
{
|
||||
return getValue(index);
|
||||
}
|
||||
|
||||
// Returns a pointer to the ith value in the list, or
|
||||
// NULL if i is not valid.
|
||||
VALUE_TYPE *operator[](U32 i)
|
||||
{
|
||||
return getValueAt(i);
|
||||
}
|
||||
|
||||
// Prints the list contents to the specified stream.
|
||||
friend std::ostream &operator<<( std::ostream &os, LLAssocList &map )
|
||||
{
|
||||
os << "{";
|
||||
for ( Node *node = map.mHead;
|
||||
node;
|
||||
node = node->mNext )
|
||||
{
|
||||
os << "<" << node->mIndex << ", " << node->mValue << ">";
|
||||
if (node->mNext)
|
||||
os << ", ";
|
||||
}
|
||||
os << "}";
|
||||
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // LL_LLASSOCLIST_H
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/**
|
||||
* @file llavatarconstants.h
|
||||
* @brief some useful short term constants for Indra
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_AVATAR_CONSTANTS_H
|
||||
#define LL_AVATAR_CONSTANTS_H
|
||||
|
||||
// If this string is passed to dataserver in AvatarPropertiesUpdate
|
||||
// then no change is made to user.profile_web
|
||||
const char* const BLACKLIST_PROFILE_WEB_STR = "featureWebProfilesDisabled";
|
||||
|
||||
// If profile web pages are feature blacklisted then this URL is
|
||||
// shown in the profile instead of the user's set URL
|
||||
const char* const BLACKLIST_PROFILE_WEB_URL = "http://secondlife.com/app/webdisabled";
|
||||
|
||||
// Maximum number of avatar picks
|
||||
const S32 MAX_AVATAR_PICKS = 10;
|
||||
|
||||
// For Flags in AvatarPropertiesReply
|
||||
const U32 AVATAR_ALLOW_PUBLISH = 0x1 << 0; // whether profile is externally visible or not
|
||||
const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature"
|
||||
const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info
|
||||
const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info
|
||||
const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known.
|
||||
const U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified
|
||||
|
||||
char const* const VISIBILITY_DEFAULT = "default";
|
||||
char const* const VISIBILITY_HIDDEN = "hidden";
|
||||
char const* const VISIBILITY_VISIBLE = "visible";
|
||||
char const* const VISIBILITY_INVISIBLE = "invisible";
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -231,8 +231,8 @@ std::string LLBase32::encode(const U8* input, size_t input_size)
|
|||
|
||||
size_t encoded = base32_encode(&output[0], output_size, input, input_size);
|
||||
|
||||
llinfos << "encoded " << encoded << " into buffer of size "
|
||||
<< output_size << llendl;
|
||||
LL_INFOS() << "encoded " << encoded << " into buffer of size "
|
||||
<< output_size << LL_ENDL;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,4 +27,4 @@
|
|||
#include "linden_common.h"
|
||||
|
||||
// implementation is all in the header, this include dep ensures the unit test is rerun if the implementation changes.
|
||||
#include "bitpack.h"
|
||||
#include "llbitpack.h"
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file bitpack.h
|
||||
* @file llbitpack.h
|
||||
* @brief Convert data to packed bit stream
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
*(mBuffer + mBufferSize++) = mLoad;
|
||||
if (mBufferSize > mMaxSize)
|
||||
{
|
||||
llerror("mBufferSize exceeding mMaxSize!", 0);
|
||||
LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
|
||||
}
|
||||
mLoadSize = 0;
|
||||
mLoad = 0x00;
|
||||
|
|
@ -122,7 +122,7 @@ public:
|
|||
*(mBuffer + mBufferSize++) = mLoad;
|
||||
if (mBufferSize > mMaxSize)
|
||||
{
|
||||
llerror("mBufferSize exceeding mMaxSize!", 0);
|
||||
LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
|
||||
}
|
||||
mLoadSize = 0;
|
||||
mLoad = 0x00;
|
||||
|
|
@ -165,8 +165,8 @@ public:
|
|||
#ifdef _DEBUG
|
||||
if (mBufferSize > mMaxSize)
|
||||
{
|
||||
llerrs << "mBufferSize exceeding mMaxSize" << llendl;
|
||||
llerrs << mBufferSize << " > " << mMaxSize << llendl;
|
||||
LL_ERRS() << "mBufferSize exceeding mMaxSize" << LL_ENDL;
|
||||
LL_ERRS() << mBufferSize << " > " << mMaxSize << LL_ENDL;
|
||||
}
|
||||
#endif
|
||||
mLoad = *(mBuffer + mBufferSize++);
|
||||
|
|
@ -190,7 +190,7 @@ public:
|
|||
*(mBuffer + mBufferSize++) = mLoad;
|
||||
if (mBufferSize > mMaxSize)
|
||||
{
|
||||
llerror("mBufferSize exceeding mMaxSize!", 0);
|
||||
LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
|
||||
}
|
||||
mLoadSize = 0;
|
||||
}
|
||||
|
|
@ -27,15 +27,4 @@
|
|||
|
||||
#ifndef LL_LLCLICKACTION_H
|
||||
#define LL_LLCLICKACTION_H
|
||||
// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
|
||||
const U8 CLICK_ACTION_NONE = 0;
|
||||
const U8 CLICK_ACTION_TOUCH = 0;
|
||||
const U8 CLICK_ACTION_SIT = 1;
|
||||
const U8 CLICK_ACTION_BUY = 2;
|
||||
const U8 CLICK_ACTION_PAY = 3;
|
||||
const U8 CLICK_ACTION_OPEN = 4;
|
||||
const U8 CLICK_ACTION_PLAY = 5;
|
||||
const U8 CLICK_ACTION_OPEN_MEDIA = 6;
|
||||
const U8 CLICK_ACTION_ZOOM = 7;
|
||||
// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,10 +29,14 @@
|
|||
|
||||
#include "llmemory.h"
|
||||
#include "llthread.h"
|
||||
#include "lltrace.h"
|
||||
#include "lltracethreadrecorder.h"
|
||||
|
||||
//static
|
||||
BOOL LLCommon::sAprInitialized = FALSE;
|
||||
|
||||
static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL;
|
||||
|
||||
//static
|
||||
void LLCommon::initClass()
|
||||
{
|
||||
|
|
@ -45,15 +49,19 @@ void LLCommon::initClass()
|
|||
LLTimer::initClass();
|
||||
LLThreadSafeRefCount::initThreadSafeRefCount();
|
||||
assert_main_thread(); // Make sure we record the main thread
|
||||
// LLWorkerThread::initClass();
|
||||
// LLFrameCallbackManager::initClass();
|
||||
if (!sMasterThreadRecorder)
|
||||
{
|
||||
sMasterThreadRecorder = new LLTrace::ThreadRecorder();
|
||||
LLTrace::set_master_thread_recorder(sMasterThreadRecorder);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLCommon::cleanupClass()
|
||||
{
|
||||
// LLFrameCallbackManager::cleanupClass();
|
||||
// LLWorkerThread::cleanupClass();
|
||||
delete sMasterThreadRecorder;
|
||||
sMasterThreadRecorder = NULL;
|
||||
LLTrace::set_master_thread_recorder(NULL);
|
||||
LLThreadSafeRefCount::cleanupThreadSafeRefCount();
|
||||
LLTimer::cleanupClass();
|
||||
if (sAprInitialized)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
#ifndef LL_LLCOMMONUTILS_H
|
||||
#define LL_LLCOMMONUTILS_H
|
||||
|
||||
#include "lluuid.h"
|
||||
|
||||
namespace LLCommonUtils
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ void LLCRC::update(const std::string& filename)
|
|||
{
|
||||
if (filename.empty())
|
||||
{
|
||||
llerrs << "No filename specified" << llendl;
|
||||
LL_ERRS() << "No filename specified" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ void LLCRC::update(const std::string& filename)
|
|||
|
||||
if (nread < (size_t) size)
|
||||
{
|
||||
llwarns << "Short read on " << filename << llendl;
|
||||
LL_WARNS() << "Short read on " << filename << LL_ENDL;
|
||||
}
|
||||
|
||||
update(data, nread);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
// crc.update(fgetc(fp));
|
||||
// }
|
||||
// fclose(fp);
|
||||
// llinfos << "File crc: " << crc.getCRC() << llendl;
|
||||
// LL_INFOS() << "File crc: " << crc.getCRC() << LL_ENDL;
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LL_COMMON_API LLCRC
|
||||
|
|
|
|||
|
|
@ -27,18 +27,38 @@
|
|||
#include "linden_common.h"
|
||||
|
||||
#include "llcriticaldamp.h"
|
||||
#include <algorithm>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// static members
|
||||
//-----------------------------------------------------------------------------
|
||||
LLFrameTimer LLCriticalDamp::sInternalTimer;
|
||||
std::map<F32, F32> LLCriticalDamp::sInterpolants;
|
||||
F32 LLCriticalDamp::sTimeDelta;
|
||||
LLFrameTimer LLSmoothInterpolation::sInternalTimer;
|
||||
std::vector<LLSmoothInterpolation::Interpolant> LLSmoothInterpolation::sInterpolants;
|
||||
F32 LLSmoothInterpolation::sTimeDelta;
|
||||
|
||||
// helper functors
|
||||
struct LLSmoothInterpolation::CompareTimeConstants
|
||||
{
|
||||
bool operator()(const F32& a, const LLSmoothInterpolation::Interpolant& b) const
|
||||
{
|
||||
return a < b.mTimeScale;
|
||||
}
|
||||
|
||||
bool operator()(const LLSmoothInterpolation::Interpolant& a, const F32& b) const
|
||||
{
|
||||
return a.mTimeScale < b; // bottom of a is higher than bottom of b
|
||||
}
|
||||
|
||||
bool operator()(const LLSmoothInterpolation::Interpolant& a, const LLSmoothInterpolation::Interpolant& b) const
|
||||
{
|
||||
return a.mTimeScale < b.mTimeScale; // bottom of a is higher than bottom of b
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLCriticalDamp()
|
||||
// LLSmoothInterpolation()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLCriticalDamp::LLCriticalDamp()
|
||||
LLSmoothInterpolation::LLSmoothInterpolation()
|
||||
{
|
||||
sTimeDelta = 0.f;
|
||||
}
|
||||
|
|
@ -47,44 +67,55 @@ LLCriticalDamp::LLCriticalDamp()
|
|||
//-----------------------------------------------------------------------------
|
||||
// updateInterpolants()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLCriticalDamp::updateInterpolants()
|
||||
void LLSmoothInterpolation::updateInterpolants()
|
||||
{
|
||||
sTimeDelta = sInternalTimer.getElapsedTimeAndResetF32();
|
||||
|
||||
F32 time_constant;
|
||||
|
||||
for (std::map<F32, F32>::iterator iter = sInterpolants.begin();
|
||||
iter != sInterpolants.end(); iter++)
|
||||
for (S32 i = 0; i < sInterpolants.size(); i++)
|
||||
{
|
||||
time_constant = iter->first;
|
||||
F32 new_interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant);
|
||||
new_interpolant = llclamp(new_interpolant, 0.f, 1.f);
|
||||
sInterpolants[time_constant] = new_interpolant;
|
||||
Interpolant& interp = sInterpolants[i];
|
||||
interp.mInterpolant = calcInterpolant(interp.mTimeScale);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// getInterpolant()
|
||||
//-----------------------------------------------------------------------------
|
||||
F32 LLCriticalDamp::getInterpolant(const F32 time_constant, BOOL use_cache)
|
||||
F32 LLSmoothInterpolation::getInterpolant(F32SecondsImplicit time_constant, bool use_cache)
|
||||
{
|
||||
if (time_constant == 0.f)
|
||||
{
|
||||
return 1.f;
|
||||
}
|
||||
|
||||
if (use_cache && sInterpolants.count(time_constant))
|
||||
{
|
||||
return sInterpolants[time_constant];
|
||||
}
|
||||
|
||||
F32 interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant);
|
||||
interpolant = llclamp(interpolant, 0.f, 1.f);
|
||||
if (use_cache)
|
||||
{
|
||||
sInterpolants[time_constant] = interpolant;
|
||||
interpolant_vec_t::iterator find_it = std::lower_bound(sInterpolants.begin(), sInterpolants.end(), time_constant.value(), CompareTimeConstants());
|
||||
if (find_it != sInterpolants.end() && find_it->mTimeScale == time_constant)
|
||||
{
|
||||
return find_it->mInterpolant;
|
||||
}
|
||||
else
|
||||
{
|
||||
Interpolant interp;
|
||||
interp.mTimeScale = time_constant.value();
|
||||
interp.mInterpolant = calcInterpolant(time_constant.value());
|
||||
sInterpolants.insert(find_it, interp);
|
||||
return interp.mInterpolant;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return calcInterpolant(time_constant.value());
|
||||
|
||||
return interpolant;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// calcInterpolant()
|
||||
//-----------------------------------------------------------------------------
|
||||
F32 LLSmoothInterpolation::calcInterpolant(F32 time_constant)
|
||||
{
|
||||
return llclamp(1.f - powf(2.f, -sTimeDelta / time_constant), 0.f, 1.f);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,26 +28,46 @@
|
|||
#ifndef LL_LLCRITICALDAMP_H
|
||||
#define LL_LLCRITICALDAMP_H
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "llframetimer.h"
|
||||
#include "llunits.h"
|
||||
|
||||
class LL_COMMON_API LLCriticalDamp
|
||||
class LL_COMMON_API LLSmoothInterpolation
|
||||
{
|
||||
public:
|
||||
LLCriticalDamp();
|
||||
LLSmoothInterpolation();
|
||||
|
||||
// MANIPULATORS
|
||||
static void updateInterpolants();
|
||||
|
||||
// ACCESSORS
|
||||
static F32 getInterpolant(const F32 time_constant, BOOL use_cache = TRUE);
|
||||
static F32 getInterpolant(F32SecondsImplicit time_constant, bool use_cache = true);
|
||||
|
||||
protected:
|
||||
template<typename T>
|
||||
static T lerp(T a, T b, F32SecondsImplicit time_constant, bool use_cache = true)
|
||||
{
|
||||
F32 interpolant = getInterpolant(time_constant, use_cache);
|
||||
return ((a * (1.f - interpolant))
|
||||
+ (b * interpolant));
|
||||
}
|
||||
|
||||
protected:
|
||||
static F32 calcInterpolant(F32 time_constant);
|
||||
|
||||
struct CompareTimeConstants;
|
||||
static LLFrameTimer sInternalTimer; // frame timer for calculating deltas
|
||||
|
||||
static std::map<F32, F32> sInterpolants;
|
||||
struct Interpolant
|
||||
{
|
||||
F32 mTimeScale;
|
||||
F32 mInterpolant;
|
||||
};
|
||||
typedef std::vector<Interpolant> interpolant_vec_t;
|
||||
static interpolant_vec_t sInterpolants;
|
||||
static F32 sTimeDelta;
|
||||
};
|
||||
|
||||
typedef LLSmoothInterpolation LLCriticalDamp;
|
||||
|
||||
#endif // LL_LLCRITICALDAMP_H
|
||||
|
|
|
|||
|
|
@ -1,225 +0,0 @@
|
|||
/**
|
||||
* @file lldarray.h
|
||||
* @brief Wrapped std::vector for backward compatibility.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLDARRAY_H
|
||||
#define LL_LLDARRAY_H
|
||||
|
||||
#include "llerror.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
// class LLDynamicArray<>; // = std::vector + reserves <BlockSize> elements
|
||||
// class LLDynamicArrayIndexed<>; // = std::vector + std::map if indices, only supports operator[] and begin(),end()
|
||||
|
||||
//--------------------------------------------------------
|
||||
// LLDynamicArray declaration
|
||||
//--------------------------------------------------------
|
||||
// NOTE: BlockSize is used to reserve a minimal initial amount
|
||||
template <typename Type, int BlockSize = 32>
|
||||
class LLDynamicArray : public std::vector<Type>
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
OKAY = 0,
|
||||
FAIL = -1
|
||||
};
|
||||
|
||||
LLDynamicArray(S32 size=0) : std::vector<Type>(size) { if (size < BlockSize) std::vector<Type>::reserve(BlockSize); }
|
||||
|
||||
void reset() { std::vector<Type>::clear(); }
|
||||
|
||||
// ACCESSORS
|
||||
const Type& get(S32 index) const { return std::vector<Type>::operator[](index); }
|
||||
Type& get(S32 index) { return std::vector<Type>::operator[](index); }
|
||||
S32 find(const Type &obj) const;
|
||||
|
||||
S32 count() const { return std::vector<Type>::size(); }
|
||||
S32 getLength() const { return std::vector<Type>::size(); }
|
||||
S32 getMax() const { return std::vector<Type>::capacity(); }
|
||||
|
||||
// MANIPULATE
|
||||
S32 put(const Type &obj); // add to end of array, returns index
|
||||
// Type* reserve(S32 num); // reserve a block of indices in advance
|
||||
Type* reserve_block(U32 num); // reserve a block of indices in advance
|
||||
|
||||
S32 remove(S32 index); // remove by index, no bounds checking
|
||||
S32 removeObj(const Type &obj); // remove by object
|
||||
S32 removeLast();
|
||||
|
||||
void operator+=(const LLDynamicArray<Type,BlockSize> &other);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------
|
||||
// LLDynamicArray implementation
|
||||
//--------------------------------------------------------
|
||||
|
||||
template <typename Type,int BlockSize>
|
||||
inline S32 LLDynamicArray<Type,BlockSize>::find(const Type &obj) const
|
||||
{
|
||||
typename std::vector<Type>::const_iterator iter = std::find(this->begin(), this->end(), obj);
|
||||
if (iter != this->end())
|
||||
{
|
||||
return iter - this->begin();
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
|
||||
template <typename Type,int BlockSize>
|
||||
inline S32 LLDynamicArray<Type,BlockSize>::remove(S32 i)
|
||||
{
|
||||
// This is a fast removal by swapping with the last element
|
||||
S32 sz = this->size();
|
||||
if (i < 0 || i >= sz)
|
||||
{
|
||||
return FAIL;
|
||||
}
|
||||
if (i < sz-1)
|
||||
{
|
||||
this->operator[](i) = this->back();
|
||||
}
|
||||
this->pop_back();
|
||||
return i;
|
||||
}
|
||||
|
||||
template <typename Type,int BlockSize>
|
||||
inline S32 LLDynamicArray<Type,BlockSize>::removeObj(const Type& obj)
|
||||
{
|
||||
typename std::vector<Type>::iterator iter = std::find(this->begin(), this->end(), obj);
|
||||
if (iter != this->end())
|
||||
{
|
||||
S32 res = iter - this->begin();
|
||||
typename std::vector<Type>::iterator last = this->end();
|
||||
--last;
|
||||
*iter = *last;
|
||||
this->pop_back();
|
||||
return res;
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
template <typename Type,int BlockSize>
|
||||
inline S32 LLDynamicArray<Type,BlockSize>::removeLast()
|
||||
{
|
||||
if (!this->empty())
|
||||
{
|
||||
this->pop_back();
|
||||
return OKAY;
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
template <typename Type,int BlockSize>
|
||||
inline Type* LLDynamicArray<Type,BlockSize>::reserve_block(U32 num)
|
||||
{
|
||||
U32 sz = this->size();
|
||||
this->resize(sz+num);
|
||||
return &(this->operator[](sz));
|
||||
}
|
||||
|
||||
template <typename Type,int BlockSize>
|
||||
inline S32 LLDynamicArray<Type,BlockSize>::put(const Type &obj)
|
||||
{
|
||||
this->push_back(obj);
|
||||
return this->size() - 1;
|
||||
}
|
||||
|
||||
template <typename Type,int BlockSize>
|
||||
inline void LLDynamicArray<Type,BlockSize>::operator+=(const LLDynamicArray<Type,BlockSize> &other)
|
||||
{
|
||||
// <FS:ND> Fix for GCC 4.7.1
|
||||
//insert(this->end(), other.begin(), other.end());
|
||||
this->insert(this->end(), other.begin(), other.end());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// LLDynamicArrayIndexed declaration
|
||||
//--------------------------------------------------------
|
||||
|
||||
template <typename Type, typename Key, int BlockSize = 32>
|
||||
class LLDynamicArrayIndexed
|
||||
{
|
||||
public:
|
||||
typedef typename std::vector<Type>::iterator iterator;
|
||||
typedef typename std::vector<Type>::const_iterator const_iterator;
|
||||
typedef typename std::vector<Type>::reverse_iterator reverse_iterator;
|
||||
typedef typename std::vector<Type>::const_reverse_iterator const_reverse_iterator;
|
||||
typedef typename std::vector<Type>::size_type size_type;
|
||||
protected:
|
||||
std::vector<Type> mVector;
|
||||
std::map<Key, U32> mIndexMap;
|
||||
|
||||
public:
|
||||
LLDynamicArrayIndexed() { mVector.reserve(BlockSize); }
|
||||
|
||||
iterator begin() { return mVector.begin(); }
|
||||
const_iterator begin() const { return mVector.begin(); }
|
||||
iterator end() { return mVector.end(); }
|
||||
const_iterator end() const { return mVector.end(); }
|
||||
|
||||
reverse_iterator rbegin() { return mVector.rbegin(); }
|
||||
const_reverse_iterator rbegin() const { return mVector.rbegin(); }
|
||||
reverse_iterator rend() { return mVector.rend(); }
|
||||
const_reverse_iterator rend() const { return mVector.rend(); }
|
||||
|
||||
void reset() { mVector.resize(0); mIndexMap.resize(0); }
|
||||
bool empty() const { return mVector.empty(); }
|
||||
size_type size() const { return mVector.size(); }
|
||||
|
||||
Type& operator[](const Key& k)
|
||||
{
|
||||
typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
|
||||
if (iter == mIndexMap.end())
|
||||
{
|
||||
U32 n = mVector.size();
|
||||
mIndexMap[k] = n;
|
||||
mVector.push_back(Type());
|
||||
llassert(mVector.size() == mIndexMap.size());
|
||||
return mVector[n];
|
||||
}
|
||||
else
|
||||
{
|
||||
return mVector[iter->second];
|
||||
}
|
||||
}
|
||||
|
||||
const_iterator find(const Key& k) const
|
||||
{
|
||||
typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
|
||||
if(iter == mIndexMap.end())
|
||||
{
|
||||
return mVector.end();
|
||||
}
|
||||
else
|
||||
{
|
||||
return mVector.begin() + iter->second;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include "lltimer.h"
|
||||
#include "llstring.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
static const F64 DATE_EPOCH = 0.0;
|
||||
|
||||
|
|
@ -48,25 +49,22 @@ static const F64 LL_APR_USEC_PER_SEC = 1000000.0;
|
|||
|
||||
|
||||
LLDate::LLDate() : mSecondsSinceEpoch(DATE_EPOCH)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
LLDate::LLDate(const LLDate& date) :
|
||||
mSecondsSinceEpoch(date.mSecondsSinceEpoch)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
LLDate::LLDate(F64 seconds_since_epoch) :
|
||||
mSecondsSinceEpoch(seconds_since_epoch)
|
||||
{
|
||||
}
|
||||
LLDate::LLDate(F64SecondsImplicit seconds_since_epoch) :
|
||||
mSecondsSinceEpoch(seconds_since_epoch.value())
|
||||
{}
|
||||
|
||||
LLDate::LLDate(const std::string& iso8601_date)
|
||||
{
|
||||
if(!fromString(iso8601_date))
|
||||
{
|
||||
llwarns << "date " << iso8601_date << " failed to parse; "
|
||||
<< "ZEROING IT OUT" << llendl;
|
||||
LL_WARNS() << "date " << iso8601_date << " failed to parse; "
|
||||
<< "ZEROING IT OUT" << LL_ENDL;
|
||||
mSecondsSinceEpoch = DATE_EPOCH;
|
||||
}
|
||||
}
|
||||
|
|
@ -88,11 +86,11 @@ std::string LLDate::asRFC1123() const
|
|||
return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT"));
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer FT_DATE_FORMAT("Date Format");
|
||||
LLTrace::BlockTimerStatHandle FT_DATE_FORMAT("Date Format");
|
||||
|
||||
std::string LLDate::toHTTPDateString (std::string fmt) const
|
||||
{
|
||||
LLFastTimer ft1(FT_DATE_FORMAT);
|
||||
LL_RECORD_BLOCK_TIME(FT_DATE_FORMAT);
|
||||
|
||||
time_t locSeconds = (time_t) mSecondsSinceEpoch;
|
||||
struct tm * gmt = gmtime (&locSeconds);
|
||||
|
|
@ -101,7 +99,7 @@ std::string LLDate::toHTTPDateString (std::string fmt) const
|
|||
|
||||
std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt)
|
||||
{
|
||||
LLFastTimer ft1(FT_DATE_FORMAT);
|
||||
LL_RECORD_BLOCK_TIME(FT_DATE_FORMAT);
|
||||
|
||||
// avoid calling setlocale() unnecessarily - it's expensive.
|
||||
static std::string prev_locale = "";
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "stdtypes.h"
|
||||
#include "llunits.h"
|
||||
|
||||
// <FS:Ansariel> Fix dependency on llviewerprecompiledheaders.h in dependent projects
|
||||
#include "llpreprocessor.h"
|
||||
|
|
@ -59,9 +60,9 @@ public:
|
|||
/**
|
||||
* @brief Construct a date from a seconds since epoch value.
|
||||
*
|
||||
* @pararm seconds_since_epoch The number of seconds since UTC epoch.
|
||||
* @param seconds_since_epoch The number of seconds since UTC epoch.
|
||||
*/
|
||||
LLDate(F64 seconds_since_epoch);
|
||||
LLDate(F64SecondsImplicit seconds_since_epoch);
|
||||
|
||||
/**
|
||||
* @brief Construct a date from a string representation
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue