Compare commits

...

482 Commits

Author SHA1 Message Date
Liru Færs
77f500cb64 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2020-04-01 01:59:42 -04:00
Liru Færs
d04a8fc677 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-04-01 01:59:32 -04:00
Liru Færs
6028ae7b61 Fix group notices: Have a background for the header for certain skins. 2020-04-01 01:56:58 -04:00
Shyotl
347c2cbd8b Fall in line with LL octree code. 2020-03-31 19:07:55 -05:00
Router Gray
919ffb314b [UI] Add missing 'AlreadyInGroup' to strings.xml 2020-03-30 15:24:28 -05:00
Router Gray
c033d69d54 [Linux] More follow-through on earlier manifest tuning, make always really mean always. 2020-03-30 03:06:21 -05:00
Router Gray
356d289972 User request: Add last owner profile button to object inspect. 2020-03-29 19:16:52 -05:00
Router Gray
eeabbce377 [Lib] Update abseil. (Alchemy sync) 2020-03-29 16:39:16 -05:00
Router Gray
0b992fdd46 [Lib] Update nlohmann json and switch it to FetchContent instead of prebuilts. (Alchemy sync) 2020-03-29 16:38:53 -05:00
Router Gray
a7e56d2af9 Fix an accident in a ternary. 2020-03-29 16:31:40 -05:00
Router Gray
b10619e4d8 [Linux] Don't strip binaries, even when building release, unless packaging. Makes quick debugging in the dev checkout easier.
This may need more work if we want to support building an 'install' target, bypassing packaging, but I never hear of anyone doing that.  I'll address it if needed.
2020-03-29 15:24:10 -05:00
Router Gray
74518f299c Merge remote-tracking branch 'github-liru/master' 2020-03-29 15:21:22 -05:00
Liru Færs
407b527a55 [XPTools] Fix linux crash bug, make Cancel button close Experiences floater 2020-03-29 00:43:21 -04:00
Liru Færs
b21cc835b2 Clean up old Experience UI port code 2020-03-28 16:38:14 -04:00
Shyotl
4de8c3a38e Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-03-27 02:56:20 -05:00
Shyotl
72d8b8f78c Potentially harden against region teardown crash. Screw with branching to delve more information from callstacks since dynamic annotations don't seem to work with sentry.io using crashpad lib... sadface. 2020-03-27 02:55:12 -05:00
Liru Færs
45f4f601bf nopaque 2020-03-27 02:35:06 -04:00
Liru Færs
731283aa0b Friendship accepted notifications as tips with linked names 2020-03-27 00:51:45 -04:00
Liru Færs
89ce328ba5 Fix script dialogs showing UI SLURLs when SinguReplaceLinks is false
All interface SLURLs should be force replaced.
Also fixes text boxes not respecting setting at all
2020-03-26 23:31:52 -04:00
Liru Færs
28e5270d87 All agent SLURLs should use the name system names, not just profile ones. 2020-03-25 23:57:05 -04:00
Shyotl
4a237de72a Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-03-25 22:37:23 -05:00
Shyotl
e91aac1dd9 For science. Let's see if sentry.io accepts these annotations... 2020-03-25 22:35:29 -05:00
Liru Færs
7cab44a17d Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-03-25 05:47:34 -04:00
Liru Færs
cf57624688 Fix IsNearby check having invalid logic and hiding options because of it 2020-03-24 22:41:23 -04:00
Liru Færs
c7448f290d Fix inverted logic for benefits on opensim 2020-03-24 17:42:21 -04:00
Liru Færs
55f9937238 Fix looping over empty age strings on OpenSim, no longer retry on SL 2020-03-24 16:27:16 -04:00
Liru Færs
ac1ef4d1ba Hide temp upload on SL 2020-03-23 21:39:08 -04:00
Liru Færs
ee1baafb59 Actually Delete LLView copy constructor 2020-03-23 21:20:21 -04:00
Liru Færs
9522e385cd Merge viewer-benefits
Replace MAX_AGENT_ATTACHMENTS with sim based response
Replace max groups with benefits based response
Upload costs are now handled by sim response
Removed no-longer-needed lleconomy files and classes
Removed dead fields from hippolimits and hippogridmanager
Also removed lame LL code that is redundant and silly

On non SL grids, when values are not provided for benefits, they will be
set to the values granting maximum liberty.
Old standardized responses still work when benefits aren't implemented.
2020-03-23 20:15:59 -04:00
Router Gray
a9b047b168 Minor compile fixes: move a declaration out of a namespace, add an include 2020-03-23 11:47:17 -05:00
Liru Færs
8c6e6143c2 Fix accidental paste in aosystem init 2020-03-23 09:11:13 -04:00
Liru Færs
0704876dfd Comment out unused macros in llviewerregion.h 2020-03-23 09:10:46 -04:00
Liru Færs
54b75a3219 Add SinguOwnerSayAsErrors to make llOwnerSay spew to debug console instead 2020-03-23 08:44:25 -04:00
Liru Færs
11d59d1b00 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
# Conflicts:
#	indra/newview/llsurface.cpp
2020-03-23 01:04:25 -04:00
Liru Færs
4e042db404 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-03-23 01:03:25 -04:00
Liru Færs
0f6285b2e9 Split up floaterao.* into aosystem.* and aostate.h, also further refactor 2020-03-22 15:02:08 -04:00
Liru Færs
a3d2107bfd Fix an oopsie woopsie, thanks bready doggy 2020-03-22 10:46:30 -04:00
Liru Færs
a66c91bc5a Labels for agent slurls should use the default name system 2020-03-22 10:36:54 -04:00
Liru Færs
4602602a5f Link owner name in inventory offers from objects 2020-03-22 10:03:51 -04:00
Liru Færs
0511d5903a erase iters properly, please 2020-03-22 09:53:47 -04:00
Liru Færs
7597ce3b37 Force Swim button for AO, for when you wanna swim above water
Force Swim forces swims to be enabled
2020-03-22 09:52:54 -04:00
Liru Færs
7509d929d8 Make everyone upset! Reorganize group notices!
Feature request: clickable names and group names
Remove dead space in group notices that has always plagued us
2020-03-22 09:07:46 -04:00
Liru Færs
c7e03600aa Fix constant reallocation of texture fetch command queue because...who..uses a vector..for a fifo...
By Rye, thanks!
2020-03-22 07:46:20 -04:00
Liru Færs
4871f5ed8e AO Refactor
Should fix AO not turning on without opening floater first

Cleans up code
Reduces memory footprint, especially when not in use
Removes unused functions and parameters
Decouples AO from Floater class (AOSystem)
Removes duplicate Idle state
Formalizes singleton patterns of globals
Centralizes override handling into override structs
Fall back on simple english notecard explanation when missing config ini
Fixes sitting override playing when sitting is disabled (and acting weird)
Moves the bulk of override handling into override structs
No longer state-based, now tracks using per-struct playing field
2020-03-22 07:42:24 -04:00
Router Gray
e5a6f1e2d9 [CMake Linux] Fix my being too rushed in Copy3rdParty, restore openal 2020-03-16 03:38:55 -05:00
Shyotl
a29491658b Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git
# Conflicts:
#	indra/llmath/lloctree.h
#	indra/newview/llsurface.cpp
2020-03-15 00:53:20 -05:00
Shyotl
26976b715d Fixup minor use after free issues, and improper mutex usage in meshrepo. Also fixed some compiler warnings. 2020-03-15 00:46:57 -05:00
Liru Færs
8d564d6ed1 Follow Pilot algorithm tweak: Fly if already flying or target is above 2020-03-10 17:00:02 -04:00
Liru Færs
18fbac26dc Correct comment in follow pilot code 2020-03-10 16:32:14 -04:00
Liru Færs
9f82933149 Reduce repeated follow pilot code 2020-03-10 16:31:51 -04:00
Liru Færs
9b7aa959b0 Fix unresolved links in caution notifications 2020-03-10 16:30:37 -04:00
Liru Færs
1c46c26e6b Notifications with tooltips on buttons, for when text is too long! 2020-03-10 16:29:10 -04:00
Liru Færs
506c6aaa9e Use INetC instead of NSISdl, thanks Rye! 2020-03-10 16:27:48 -04:00
Liru Færs
dd61d475cb Prevent use of outdated notecard import by removing it from LLTextEditor
LLViewerTextEditor properly overrides this anyway.
2020-03-05 04:09:46 -05:00
Liru Færs
6e5eed7957 Fix focus on Object Owners
Just noticed this must've slipped out of a previous commit
2020-03-04 15:45:04 -05:00
Liru Færs
7859c0a191 Fix the ancient way of magic text box hack wherein multiple buttons works
Also when muting scripts through notification, properly pop mute dialog
2020-03-03 22:02:44 -05:00
Liru Færs
ef46d21582 Final 2020-03-03 21:51:54 -05:00
Router Gray
5071c1e0cf Merge remote-tracking branch 'github-liru/master' into NixTesting 2020-03-01 09:42:35 -06:00
Router Gray
ecd52a9e1a [Cmake] Comment out unused llplugincookiestore. 2020-03-01 09:42:00 -06:00
Router Gray
0a6a47a099 [Linux] Use system X11. 2020-03-01 09:42:00 -06:00
Router Gray
9880fe225e [Linux] Use system libraries for dbus-glib, gtk-atk-pango-glib, and ogg-vorbis. 2020-03-01 09:42:00 -06:00
Liru Færs
5d44552a60 Allow UI scale values as low as .5 to better meet HiDPI needs
Adapted from Rye's work on Alchemy, Thanks!
2020-03-01 09:21:59 -05:00
Liru Færs
ffa32f8c98 Fix linux compile 2020-03-01 03:51:47 -05:00
Liru Færs
b7086a993d Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
# Conflicts:
#	indra/llmath/lloctree.h
#	indra/newview/llsurface.cpp
2020-03-01 03:39:30 -05:00
Shyotl
d2d172f6ec Allow oversized images when performing raw snapshots. 2020-02-29 22:51:45 -06:00
Shyotl
34f6ea4db2 Rework LLSurface[Patch]. Abuse weak_ptr for now. Rewrote connectNeighbor. LLSurfacePatch no longer calls parent LLSurface with this poiter, instead parent surface just handles return value and controls its own behavior [Requred for weak_ptr/shared_ptr change. 2020-02-29 22:33:51 -06:00
Shyotl
d8c4db17f2 Make gcc happy again.. 2020-02-29 22:15:46 -06:00
Shyotl
c340dde03d Speculative fixes. 2020-02-29 22:15:27 -06:00
Liru Færs
e502b87b63 Ooops, forgot to save the rewrite of this that actually fixes it 2020-02-29 11:16:46 -05:00
Liru Færs
d6f320fb5e Clean up Object SLURL right click menu with a few submenus 2020-02-29 08:20:50 -05:00
Liru Færs
e4eca079e6 Allow right clicking object UI labels to interact with their owners! 2020-02-29 08:19:41 -05:00
Liru Færs
68ceac3678 llDialog & llTextBox with linked owner name and object name 2020-02-29 06:46:20 -05:00
Liru Færs
991d603a0c Don't copy around strings and UUIDs, LL... pls 2020-02-29 05:57:36 -05:00
Liru Færs
74a6f7382a When possible, populate the owner id of our llviewerobjects 2020-02-29 05:51:07 -05:00
Liru Færs
9264482dc3 Small patch to french translation, thanks Nomade 2020-02-29 04:47:53 -05:00
Liru Færs
1a61c49fc7 Display name change notifications that link to the user 2020-02-29 04:47:17 -05:00
Liru Færs
c2480d7227 When muting an object via pie menu, select it in the mute floater 2020-02-29 04:46:15 -05:00
Liru Færs
72b5976605 Merge to fix missing agent slurl handler for removefriend and (un)block 2020-02-29 04:45:37 -05:00
Liru Færs
1b742aa933 Menu finals and overrides 2020-02-28 22:33:37 -05:00
Liru Færs
9412f631fa Object->Derender from Object UIs 2020-02-28 01:31:34 -05:00
Router Gray
be07df3043 [Lib] Update Linux dullahan 2020-02-26 23:54:22 -06:00
Router Gray
8f89127900 [CEF] Catch a missed change for dullahan update. OCDly fix an indentation. 2020-02-26 23:24:36 -06:00
Router Gray
c72059e73f [CMake CEF] How was this even working? Set dependencies and link targets to cef instead of webkit. 2020-02-26 07:21:48 -06:00
Router Gray
2fc2b7c12b Sync some mime types with upstream, also remove erroneous 'video/libvlc' mimetype. There is no such mimetype. 2020-02-26 07:05:41 -06:00
Liru Færs
a652cb4f0a Collaboration between myself and Router the Gray to Flinux 2020-02-25 13:25:12 -05:00
Liru Færs
16b8980d28 Fix the new window inventory folder floater, and opt it to squeak! 2020-02-25 12:52:41 -05:00
Liru Færs
841a55c266 Remove duplicate setText line that was failing anyway. 2020-02-25 10:23:37 -05:00
Liru Færs
2aa6adfd46 Pip, Squeak. 2020-02-25 08:04:31 -05:00
Liru Færs
bac0b3d745 Update FMOD Studio to 2.00.07 2020-02-25 06:55:05 -05:00
Liru Færs
b08b597397 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
# Conflicts:
#	indra/llcommon/llsd.cpp
#	indra/llcommon/llsdserialize.cpp
#	indra/newview/llspeakers.cpp
#	indra/newview/llviewermessage.cpp
2020-02-25 06:51:41 -05:00
Shyotl
25cb81221e Don't use clamp mode on av mesh. 2020-02-25 02:36:32 -06:00
Liru Færs
4f5749878f Merge branch 'master' of https://github.com/RouterGray/SingularityViewer
# Conflicts:
#	indra/newview/llexperiencelog.cpp
2020-02-25 03:33:49 -05:00
Liru Færs
2aa3ba4d36 Fix crashes that were reported when using object right click menu
Menu entries that cannot work when an object vanishes will gracefully fail.
2020-02-25 03:29:41 -05:00
Liru Færs
6a2421e2e7 Fix dumb build warning on windows 2020-02-25 03:27:37 -05:00
Liru Færs
e78061b077 Hide group voting tab on secondlife, it is no longer used there. 2020-02-25 03:27:06 -05:00
Liru Færs
379f97e15a Buncha small fixes, mainly from alchemy
Update firestorm jira url
Maintain sorting and and scroll position when refreshing region tracker
Add missing CrashHostUrl setting
And a buncha other tinies, probably a crash fix or two.
2020-02-25 03:26:33 -05:00
Liru Færs
2afd2c500b Update VLC and Dullahan. Update vcredist deployment. Thanks Alchemy! 2020-02-25 03:21:27 -05:00
Liru Færs
0c3e144547 Properly sized FMOD logo, 40 pixels high. Inspired by Alchemy, thanks Rye!¶ 2020-02-25 03:08:01 -05:00
Liru Færs
842d1b8d93 Add LLIMProcessing and support for new message caps! And UserInfo cap!
Also delayed sound support!
Fixed memory leaks and pass by values that LL likes to introduce.
Extended LLCoroResponder to have a responder for Raw strings, also clean it
Adds friend request message logging.
2020-02-25 03:04:58 -05:00
Shyotl
5c2c2a8c01 Minor cleanup. Octree vfunc reduction. Range-based for loops with map/array llsd types. 2020-02-25 01:50:50 -06:00
Router Gray
61f0837114 Make Linux and LLExperienceLog play nice. Thanks Liru. 2020-02-24 17:30:40 -06:00
Router Gray
aa95d8fe3d [LL] Update the login splash page for LL grids. 2020-02-24 06:37:42 -06:00
Router Gray
a52c4779c8 Make event notifications say 'Dismiss' instead of 'Cancel'. 2020-02-23 13:44:24 -06:00
Router Gray
1ece0e6051 [UI] Add Copy Folder UUID to inventory actions 2020-02-19 12:40:33 -06:00
Liru Færs
6a56d048c0 Don't confuse the user by showing loading when refreshing item's experience
Also reorganize some code in that area to be cleaner
2020-02-11 20:19:04 -05:00
Liru Færs
e34999b6a9 Fix missing string for experience profile button tooltip in scripts 2020-02-11 19:49:11 -05:00
Liru Færs
103b2c0f33 Fix layout of item properties floater 2020-02-11 19:07:39 -05:00
Liru Færs
2fe45cb8c2 Fix group inventory receiveds not displaying properly in chat history
Also fix linking to an avatar profile when a group's object gives an item
2020-02-11 18:34:45 -05:00
Liru Færs
64a44d6c1b Fix size and position of folder floaters not being restored from setting 2020-02-11 18:31:47 -05:00
Liru Færs
3073a175d7 Add LiruUseMarkedColor to disable use of mark color in the new places 2020-02-11 17:39:46 -05:00
Liru Færs
3b550c3a93 Fix the Jira URL bug we brought up at the last TPV meeting 2020-02-11 15:13:42 -05:00
Liru Færs
1d2c0cb8c6 Script permission dialogs should link back to the object and its owner 2020-02-11 15:09:48 -05:00
Liru Færs
2f369299c5 Object info with right-clickable owner naame, also improve code overall 2020-02-11 15:06:39 -05:00
Liru Færs
e65b513562 Syncy stuffs 2020-02-11 13:04:05 -05:00
Liru Færs
6959b688be Fix the issue with thin resize space in inventory folder floaters 2020-02-11 12:20:33 -05:00
Liru Færs
7db999d801 Fix copyright being 2019, thanks Del 2020-02-11 12:17:05 -05:00
Liru Færs
703ad01c8b AntiSpam refactor!
Adds SLURLs to antispam notifications
Reduces weight of antispam to either global queue, multiple queues, or none
Renames variables to make more sense
Repositions code, cleans up code, uses modern C++, etc
This fixes a bit of a leak or two, especially with antispam turned off!
Also fixes the endless leak of queue expansion by cleaning up while idle
When changing between global and individual queues, they're now purged.
Also made some improvements to previous commit, woops.
Also fix wrong logic for is_linden and chat source type for objects
2020-02-11 12:16:44 -05:00
Liru Færs
199879aea8 Break out functions for getting object owner, owner and object slurls 2020-02-09 18:52:06 -05:00
Liru Færs
eefa0f07a7 Reduce reused getBOOL 2020-02-09 18:28:48 -05:00
Liru Færs
6e6fb44bdb Fix potential crash, thanks Rye and Testicular! 2020-02-09 18:28:10 -05:00
Liru Færs
0892d14933 Fix debit permission Allow being too long, and remove newlines from it 2020-02-09 04:34:55 -05:00
Liru Færs
400da6ec92 Fix out of order and duplicate preferences 2020-02-09 04:33:20 -05:00
Liru Færs
18539831d1 Request: Just show viewer's short name in update notification, not channel 2020-02-09 04:32:27 -05:00
Liru Færs
9548270306 Buncha tinies
Link name in inventory offer received chat message
Fix shupdate compile missing ; and include from two commits ago
Update links used in menu_viewer.xml, I have things to do today...
And move inventory button on toolbar to between favs and received
2020-02-07 09:00:03 -05:00
Liru Færs
44aec1384a Fix crash in object weights when null selection 2020-02-07 08:03:57 -05:00
Liru Færs
42139835d5 Redo update checker responder to be more like unstable branch 2020-02-07 08:02:44 -05:00
Liru Færs
49f0f8e28f [XP Tools] Further UI beautification
Refix all the panels that weren't good enough.
Fix settingss and default rects
Remove unused
Fix toolbar prefs floater
Use text editors for "URLs" we can't control, they resolve nicer anyway
Fix Texture Ctrl on profile not popping out on click
Fix Maturity string on profile not displaying
Also update about floater credits according to modern data.
2020-02-07 07:48:58 -05:00
Inusaito Sayori
36b75b2398 A Massive Experience Tools (and Unstable Branch) Merge
[XP Tools] Initial merge Cherry Pick

Also modernize llfloaterauction internally, but leave the ui the same for now.
Breaks out script_question_mute() in llviewermessage.cpp to better sync with upstream
Adds support for UnknownScriptQuestion notification (translators need to translate this one~)
RLVa note: Rewrote RLVa permissions handling block just a bit.
Added 13 new capabilities from the XP Tools, I doubt all of them really exist.
Minor update to LLComboBox, decided against implementing LLIconsComboBox for now.
Modified LLExperienceLog::notify to lookup names and display them along with the slurls since our editors don't do that automatically.
Experience tweak: Changed a few notify's to notifytips so that we can click the links to experience profiles from chat instead of via hacked in buttons
Migrated LLFloaterCompileQueue to a proper Instance Tracker so we can call getKey
Modernized LLSD, gives us reverse iterators and the new debugging impl. We needed the reverse iterators.
Experience tweak: Added virtual destructors to responders.
Updated llhandle.h to allow calling getDerivedHandle in public.
Updated LLScrollContainer and LLScrollBar to be more modern.
Added LLFlatListView/flat_list_view from upstream - these don't seem work though?
Added some newer login/logout strings to strings.xml
Thanks for the default timeout policies, Aleric~
To avoid needing to scroll through tabs, about land tabs now are as big as they need to be to display their labels, same on groups
Group Members and Roles has been renamed to just Members because this allows the new Experiences tab enough room to display.
Thanks to Henri Beauchamp (Cool VL Viewer) for the setupList augmentation. (without it, I'd still be stuck)
Thanks to Shyotl for the helpsies~
Added the LSL constants, events, and functions that LL neglected to put in.
Added click callbacks and name lookups for profile linky texts~

Merge is up to 22b4cdc
Old TODO: Get the uis looking nice (profiles? Experiences... floater) - done
Old TODO: Make sure flatlistviews look okay... - Not using
Old TODO: Fix LLFloaterExperiencePicker, right now the panel does not show. - unsure
Old TODO: Remove the llfloaterabout.cpp change. - done

Merges llexperiencecache with upstream and unstable
Introduces LLCoroResponder, TODO: Make everything use this.
Updates Reporter floater to the latest, supports the new cap thingy

Also adds these commits/changes:
[XPTools] Double clicking experiences in namelists should open the profile
Add List.CopyNames support for Experiences
[XP Tools] Some UI work, I'll do more later
[XPTools] More UI Stuff, Later is now!
Allow getSLURL for experiences
WIP Experience list menu
Also make EXPERIENCE > OBJECT, because mainline started OBJECT already
[XPTools] Add Experience support to Name UI
[XPTools] Fix experience profile UI 9c3067e843265587e91c659200a8d783acf2d9b2
[XPTools] Fix experience location showing "last" and getting set to "last"
[XPTools] Move Experiences floater from view menu to world menu
[XPTools] Fix up more UI
[XPTools] Fix experiences panels
[XPTools] Hide pieces of the Experiences menu when they're not usable
[XPTools] More UI work, mostly to get the menus working
[XPTools] The events list is for events, not experiences, remove menu

# Conflicts:
#	indra/llcommon/llsd.cpp - merge with unstable branch
#	indra/llmessage/message_prehash.cpp
#	indra/llmessage/message_prehash.h
#	indra/llui/llscrollbar.cpp
#	indra/llui/llscrollcontainer.cpp
#	indra/llui/llurlentry.cpp
#	indra/llui/llurlregistry.cpp
#	indra/newview/app_settings/keywords.ini
#	indra/newview/app_settings/settings.xml
#	indra/newview/llappviewer.cpp
#	indra/newview/llappviewer.h
#	indra/newview/llassetuploadresponders.cpp
#	indra/newview/llcompilequeue.* - merge stable
#	indra/newview/llfloaterabout.cpp
#	indra/newview/llfloaterland.* - merge unstable
#	indra/newview/llfloaterproperties.cpp
#	indra/newview/llfloaterregioninfo.* - merge unstable
#	indra/newview/llmenucommands.cpp - merge unstable
#	indra/newview/llpreviewscript.cpp - merge unstable
#	indra/newview/llviewermessage.cpp - merge unstable
#	indra/newview/llviewerregion.cpp - merge unstable
#	indra/newview/skins/default/textures/textures.xml - merge unstable
#	indra/newview/skins/default/xui/en-us/strings.xml - merge unstable
2020-02-04 21:18:47 -05:00
Liru Færs
9a53824d6d Move click_for_profile into LLNameUI base for use in nameboxes
This allows having a linked name text on profiles without it stealing mouse
2020-01-31 14:32:45 -05:00
Router Gray
a9e2672820 [Lib] Update Linux Fmod to 2.00.07 2020-01-22 01:40:52 -06:00
Router Gray
138cf5d4f8 [AIS] Apparently friending a class isn't friendly enough. 2020-01-22 01:38:40 -06:00
Liru Færs
4b2e358783 Sync LLInventoryModel and LLViewerInventory with upstream 2020-01-21 03:18:44 -05:00
Liru Færs
851b3659ee Improve AISv3 code to retry less aggressively
Syncs LLAISAPI with upstream alchemy
Thanks to Kitty Barnett for Appearance-SyncAttach patch
Fixes typos, uses more modern C++ features,
Accounts for VERSION_UNKNOWN so the viewer won't get stuck
Adds in support for 410 GONE response
No longer retries on empty map, malformed response.
2020-01-21 03:18:43 -05:00
Liru Færs
27d4e05f2b Prevent crash 37 2020-01-21 03:18:43 -05:00
Liru Færs
deade4438d Fix login favorites and copy Landmark SLURL missing z-axis (height) 2020-01-21 03:18:43 -05:00
Liru Færs
deafc6814d Fix crashes from badly formed json responses (LL's fault)
Adds LlsdFromJsonString, an exception-free wrapper for parsing json strings
LLSD objects that failed to parse through this will be the type Undefined.

Fixes crashes 36, 1G, 33, 21, and 3A.
2020-01-21 03:18:43 -05:00
Liru Færs
1fd6e91c68 Clean up update checker dependencies 2020-01-21 03:18:42 -05:00
Liru Færs
67126ab494 Wooops, our update checker is broken since the beta started! 2020-01-21 03:18:42 -05:00
Router Gray
e3318fb0d2 Add missing Nvidia GTX cards to gpu table. Used Cool VL Viewer's source, thanks Henri Beauchamp 2020-01-20 16:55:40 -06:00
Liru Færs
e9d28ee5c1 Inventory offers should link offerer avatar/group name 2020-01-17 23:44:41 -05:00
Liru Færs
2ffc99aecf Clean up useless code 2020-01-17 23:35:55 -05:00
Liru Færs
450afff50b [VMM] Drop zone is no longer WIP, and neither are the tabs
Searching tabs is still kinda wonky though... This needs investigation
2020-01-17 17:20:31 -05:00
Liru Færs
570b0d3c5b [VMM] Make the marketplace panel a dropzone, drag and drop anywhere~
Fixes Deltek's issue with not being able to drop in the zone
nor in the empty space where there are not folders in the listings
2020-01-17 17:19:01 -05:00
Liru Færs
09daa2a865 [VMM] Background transparency is important, even in marketplace drop zone 2020-01-17 17:14:25 -05:00
Liru Færs
e97837e103 Friendship Offered should link receiver's name 2020-01-17 14:33:38 -05:00
Liru Færs
84add2d864 This comment forgot to be saved 2020-01-17 10:54:07 -05:00
Liru Færs
4c224def62 Update FMOD Studio 2020-01-17 02:29:52 -05:00
Liru Færs
2242a1d101 Fix a bunch of disconnectNeighbor crashes in LLSurface 2020-01-17 02:27:56 -05:00
Liru Færs
b957c0930d Fix dumb in LLSurface, don't do dumb math 2020-01-17 02:27:48 -05:00
Liru Færs
f7434711ad [Follow] Reset No Progress count when target's position changes 2020-01-17 02:26:40 -05:00
Liru Færs
5f0b23edd7 [Follow] Try to sit on far away objects by moving closer
Groundsit if that still fails
2020-01-17 02:25:45 -05:00
Liru Færs
2eff62ad0d [Follow] Fix orbiting leader after follow sitting and standing up 2020-01-17 01:32:05 -05:00
Liru Færs
686795618a If object sitting while following, bypass follow logic block 2020-01-17 01:30:39 -05:00
Liru Færs
5c8c5a2c45 Condense autopilot no progress code into getAutoPilotNoProgress() 2020-01-17 00:04:31 -05:00
Liru Færs
d98b99f7b3 [Follow] Fall into walking code if RLV Sit restricted
Mostly space changes
2020-01-16 17:47:17 -05:00
Liru Færs
8d472a9c7b Rearrange some Follow code 2020-01-16 17:43:14 -05:00
Liru Færs
3747d79143 [Follow] Fly if we aren't rendering the avatar 2020-01-16 17:40:50 -05:00
Liru Færs
910a5557ab Sync some code in hopes to squish Marketplace wire chewed popups
A query url will no longer be built in making the request
The status of marketplace will no longer get reset to uninitialized upon
region change.
Merchant status will no longer be requested on regions without the DD cap
2020-01-16 17:10:08 -05:00
Liru Færs
8163448a6c [RLVa] Always show your own hover tip 2020-01-15 23:55:42 -05:00
Liru Færs
ac0e93dcad People don't seem to know what an ARC is... it's Complexity 2020-01-15 23:55:13 -05:00
Liru Færs
ed420c3645 Add Edit and Add to Selection to Object UI menus 2020-01-15 19:46:49 -05:00
Liru Færs
b872860443 Fix crash in land floater init when null region (disconnected?)
Fixes crash 2E
Cleans up code
2020-01-15 14:00:00 -05:00
Liru Færs
992f4c7b5d Modernize/sync LLSpeakers code 2020-01-15 12:57:58 -05:00
Liru Færs
8f15478ba4 Condense code~ 2020-01-15 12:56:56 -05:00
Liru Færs
1c371e7be6 Allow touching multiple objects in succession 2020-01-14 19:37:53 -05:00
Liru Færs
937c80f694 Fix an oopsie in Debug Settings, Thanks for the heads up, Yuriko 2020-01-14 15:53:42 -05:00
Liru Færs
15bd41bd71 Add Touch to object ui menus 2020-01-14 15:52:58 -05:00
Liru Færs
b9156b7955 Combine send_ObjectDeGrab and send_ObjectGrab repetitive code 2020-01-14 10:49:46 -05:00
Liru Færs
623a484ae3 Woops, gotta do a char array for that, also set errno to 0 2020-01-13 18:35:08 -05:00
Liru Færs
2ace698101 [Follow] Automatically accept Teleport Requests/Offers from the leader 2020-01-13 02:20:33 -05:00
Liru Færs
34e0c722e7 Don't cancel autopilot when escaping out of customize appearance 2020-01-13 01:34:06 -05:00
Liru Færs
82ee06a6bd Add Find on Map to avatar UI menus 2020-01-13 01:33:26 -05:00
Liru Færs
584ee8fffe const byref autopilot accessors 2020-01-13 00:29:51 -05:00
Liru Færs
d80d232ee5 Don't cancel follow if the target disappears, wait for them 2020-01-12 23:57:20 -05:00
Liru Færs
de47736038 Ignore object kills if our region is null
Fixes crash 1R
2020-01-12 20:06:01 -05:00
Liru Færs
0da16e6034 Some days, I scream in the faces of cats 2020-01-12 16:27:19 -05:00
Liru Færs
6c9a156610 Maybe fix pusssycat's issue with clicking for group profile being broken 2020-01-12 14:47:52 -05:00
Liru Færs
1726c27078 Fix for Linux file rename failures, thanks Taya and Router! 2020-01-12 13:23:02 -05:00
Liru Færs
64b43a47b5 Clean up ScriptCounter code more 2020-01-12 12:33:10 -05:00
Liru Færs
8005a58ed5 Script Counting on an avatar now shows their SLURL, instead of just a name 2020-01-11 21:53:29 -05:00
Liru Færs
d1d42701f5 Fix taya's linux crash, thanks to taya and router!
Crash was due to invalidated iterator
2020-01-11 21:00:16 -05:00
Liru Færs
c57fceff17 Modernizing scriptcounter code 2020-01-11 20:23:31 -05:00
Liru Færs
265336463d Add FMOD Logo to login screen to comply with licensing
Adds code to hide the new UI when compiled without FMOD Studio
2020-01-11 04:32:42 -05:00
Liru Færs
3ba1c88672 Remove reference to dead control 2020-01-11 03:01:28 -05:00
Liru Færs
90e6afe159 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2020-01-10 17:14:39 -05:00
Liru Færs
3209507b6c [Follow] Sit if target is sitting, stand when they stand
Does object and ground sitting.
May fly to sitting target if they're in air
Ground sits as close as it can get if cannot reach ground sitting target

Optimizes following when within desired range of target

Moves sitting/standing autopilot cancels to more proper places
2020-01-10 17:13:28 -05:00
Liru Færs
fa97d8497a [Follow] If the user decides to sit/stand, that should cancel following 2020-01-10 16:47:52 -05:00
Liru Færs
a687273d57 Default column sorting to list sort_ascending attribute value 2020-01-10 16:07:37 -05:00
Liru Færs
28f13b806c Some harmless reorganization 2020-01-10 16:06:44 -05:00
Liru Færs
f1342d7bb8 Fix Name List xml processing (and typing into them to +find names!)
LLNameListCtrl::fromXML was ancient,
and LLScrollListCtrl::fromXML had been getting updated
but that processing should be done in a common virtual function so we have
a valid hierarchy! This fixes that!
Now all of the modern amenities added to scroll lists are in name lists.
2020-01-10 15:49:12 -05:00
Liru Færs
c3428c6d57 When chat scrolls, IDBearer URL menus shouldn't lead to the wrong place
Optimizes away multiple iterations over scroll lists and
multiple parsings of urls to determine the target(s)
At the cost of the last selection being stored statically in a vector

Removes virtual LFIDBearer::getNumSelected
2020-01-10 14:46:54 -05:00
Liru Færs
0efddbd9ff Add Pay to Object UI Menus 2020-01-10 13:12:13 -05:00
Liru Færs
be0aba4bfa Woops, fix this 2020-01-10 03:34:57 -05:00
Liru Færs
c3f03b6bbf [Follow] Specify that Follow has been cancelled, with Cancelled notice 2020-01-10 03:11:19 -05:00
Liru Færs
e15839a2cb Move autoPilot Agent Avatar Valid check to beginning 2020-01-10 02:42:48 -05:00
Shyotl
e0efbd7d26 Fix two race conditions in meshrepo. 2020-01-10 00:09:35 -06:00
Liru Færs
8e57288819 Stand Up by user should cancel autopilot 2020-01-10 01:01:38 -05:00
Liru Færs
107f512545 Teleport notifications now use avatar slurls 2020-01-09 22:53:16 -05:00
Liru Færs
14dc348179 Add Sit On to Object UI Menus
Breaks handle_object_sit out of handle_object_sit_or_stand,
parameterizes offset so that one doesn't need to select a side
still respects RLV, yay~
2020-01-09 22:14:06 -05:00
Liru Færs
eccbd98d79 Change some enables to visibles 2020-01-09 21:18:31 -05:00
Liru Færs
a5115aa69e Fix Crash T, someone broke their install, but we should gracefully exit 2020-01-09 12:41:43 -05:00
Liru Færs
327574db7c Cancel autopilot when user initiates a goto 2020-01-08 22:32:17 -05:00
Liru Færs
8b4a29cbd3 Break simulator autopilot out into its own function 2020-01-08 22:31:18 -05:00
Liru Færs
544feee19f Fix Copy Names in Object Menu not working, oops!! 2020-01-08 20:48:48 -05:00
Liru Færs
bee60da089 Break out get_obj_data into its own function 2020-01-08 20:43:47 -05:00
Liru Færs
c466b44143 Introduce rudimentary objects list menu for Area Search
Enables multiselect in areasearch
2020-01-08 20:09:46 -05:00
Liru Færs
27222d524c Add Object support to List.ShowProfile, via get_slurl_for 2020-01-08 19:49:52 -05:00
Liru Færs
b99e2cbbdd Add support for OBJECT type to get_slurl_for
Caveat: Requires area search to be instantiated (should we break this out?)
Only includes location if in object list
2020-01-08 19:48:50 -05:00
Liru Færs
a5bdc24a14 Refactor get_slurl_for 2020-01-08 19:46:42 -05:00
Liru Færs
0b6d94f202 Request: Change "Log" button on IM Floater to "History"
This is more clear and consistent with all the other places this is used
2020-01-08 19:43:27 -05:00
Liru Færs
bf5035388b Expose ObjectData from AreaSearch 2020-01-08 19:22:36 -05:00
Liru Færs
640c136bcc Add Cam To to Object URL menu 2020-01-08 19:13:36 -05:00
Liru Færs
6ebd2eef00 Feature Request: Add Chat History to Group right click menus 2020-01-08 19:11:46 -05:00
Liru Færs
c954d02125 Add missing Go To to object pie menu 2020-01-08 18:00:51 -05:00
Liru Færs
a34414849c Sync some of llcommandlineparser with alchemy
Might fix Crash R
2020-01-08 17:07:49 -05:00
Liru Færs
c1ffb1b332 [Follow] Do not fly unless flying avatar target or already flying 2020-01-08 16:58:54 -05:00
Liru Færs
d06448cdfd Remove dead german menu entry 2020-01-08 16:53:23 -05:00
Liru Færs
117ef68916 Put object pie Follow where it was actually supposed to go
Thanks for the heads up on this mistake, Router!
2020-01-08 16:07:23 -05:00
Liru Færs
83b384ab97 Combine Marking from Minimap with Radar Mark
Color people right from the Radar!
Mark button on Radar now uses Red.

Removes "Radar.Mark" and its associated code
Thanks for the help on linux, Router!
2020-01-08 15:54:43 -05:00
Liru Færs
5ee5ba473b Small refactor of minimap marking code
Mark is now encapsulated
mm_setcolor is no longer part of LLNetMap
mm_clearMark is now used to erase mark from container
Introduces mm_getMarkerColor that returns a pointer,
instead of needing a ref every time.

Also mark isAgentUnderCursor const
2020-01-08 15:39:49 -05:00
Liru Færs
4055af4afd Add Mark menu to radar 2020-01-08 15:23:51 -05:00
Liru Færs
65dad7acfd Remove weird double newline between single avatar on minimap and distance 2020-01-08 14:53:08 -05:00
Liru Færs
a21927e510 [Follow] If target av isn't rendered, still try to get their position
Mainly moves code around, rather small change.
2020-01-08 13:15:37 -05:00
Liru Færs
094c948a87 Move Minimap Mark submenu back out of Selected Avatars menu for convenience 2020-01-08 13:12:13 -05:00
Liru Færs
31003f13af Fix Crash on text editor right click
Fixes Crashes N  and P
Missing nullcheck, my bad
Never expected there not to be a menu segment url when a menu is open
2020-01-08 10:25:44 -05:00
Router Gray
c1f39e167c Bang bang on the list baby 2020-01-07 20:00:50 -06:00
Router Gray
0e28436aa9 Fix invalid initialization of non-const reference 2020-01-07 19:59:53 -06:00
Liru Færs
bc1c816b99 Fix right click local avatar url menu's Focus being broken 2020-01-07 19:21:06 -05:00
Liru Færs
32424e5640 Fix up presentation of radar and local avs menus 2020-01-07 19:19:05 -05:00
Liru Færs
760f1308f3 Add SinguFollowDistance for setting minimum follow distance 2020-01-07 18:51:49 -05:00
Liru Færs
dfe8e364be Add Follow to pie and right click UI menus for objects and avatars 2020-01-07 18:51:18 -05:00
Liru Færs
33feeb0a01 Make Follow Great Again! 2020-01-07 17:40:43 -05:00
Liru Færs
50eb21ce23 This never got reset... weird 2020-01-07 16:48:27 -05:00
Liru Færs
d2052b9e4c Teleport and move to objects by their IM name links 2020-01-07 15:00:31 -05:00
Liru Færs
2c5ad97697 *Shakes cane* Get off my lawn, you young whippersnapper! 2020-01-07 14:21:24 -05:00
Liru Færs
8283422717 Rename Radar.TeleportTo to List.TeleportTo, and move the code 2020-01-07 11:53:23 -05:00
Liru Færs
4a293ff1e1 Clean up excess teleport to code using get_av_pos 2020-01-07 11:46:06 -05:00
Liru Færs
828307ca96 Sync LLSDSerialize with alchemy, and merge fix for Crash K 2020-01-07 11:00:21 -05:00
Liru Færs
a83901d2e4 Add ARC to avatar hover tips 2020-01-07 10:57:58 -05:00
Liru Færs
878ba534b5 Add Land Impact to object hover tip 2020-01-07 10:46:39 -05:00
Liru Færs
f17e6637d6 Use findAvatar instead of findObject 2020-01-07 10:39:56 -05:00
Liru Færs
66b2ad5f30 Actually fix crash 1, 5, and J
Removes a bad fix for beware's crash from forever ago
2020-01-07 08:12:01 -05:00
Liru Færs
463151c830 Fix crash and generaly wrong duplicate attribute name
NameUI "type" is now "id_type"
Thanks for the help, Router!
2020-01-07 06:19:24 -05:00
Liru Færs
77b6a903ac Remove spurious extra /* in rlvactions.h, thanks Router! 2020-01-07 05:13:37 -05:00
Liru Færs
1813a7bf8b [LLNameUI] Handle LFIDBearer::Type instead of jusst group or not
Removes "is_group" and switches it out for "type"
setValue no longer takes "group", instead it takes "type"
Constructors and setNameID now take Type instead of a boolean
setIsGroup is now setType
2020-01-06 12:31:43 -05:00
Liru Færs
6839cba56a Encapsulate LFIDBearer::sActive, set with member setActive
This function caches the current type when active,
in the future it could be more useful than that.

sActive is now const, getActive returns const,
IDBearers display information, the interface should only be used for that
2020-01-06 12:22:31 -05:00
Liru Færs
f73fb6424b Const qualify copy 2020-01-06 12:14:13 -05:00
Liru Færs
af2ae76ca2 [NameUI] Remove pointless is_group check in refresh 2020-01-06 07:54:18 -05:00
Liru Færs
a870534ea0 This slipped out of an earlier commit, woops. 2020-01-06 03:03:04 -05:00
Liru Færs
ba61314c32 Add Copy Name to radar menu and Move To to radar and avatar url menus 2020-01-06 02:40:22 -05:00
Liru Færs
d32e478456 Clean up some string character literals 2020-01-06 02:16:44 -05:00
Liru Færs
1b29210f16 Feature Request: Add a setting to control the output of key2name command
AscentCmdLineKeyToNameNameSystem
2020-01-06 01:57:26 -05:00
Liru Færs
760f23b370 Sync with upstream to make the simulator version change notification useful 2020-01-06 01:54:30 -05:00
Liru Færs
a7cba5f1a3 Add Alchemy's /sethome command 2020-01-05 23:27:51 -05:00
Liru Færs
27033f4ebb Add /setchannel command to set the nearby chat channel, from Alchemy 2020-01-05 23:27:13 -05:00
Liru Færs
c772179149 Add RlvCommandOption support for Attachment UUID 2020-01-05 23:26:09 -05:00
Liru Færs
4c7eacf4fc Remove unused code 2020-01-05 23:25:36 -05:00
Liru Færs
672037d1f2 Sync LLChatBar with alchemy's LLChatBar and LLChatUtilities
Stops typing anim on chatbar focus loss
Makes a couple classes final
Adds checkChatVolume and canSendChannel to RlvActions
Updates other bits of Rlv, but adds no functionality
2020-01-05 23:25:22 -05:00
Liru Færs
80cedb913a Make Folder inventory window prettier 2020-01-05 17:41:26 -05:00
Liru Færs
734621be82 Add Move To to avatar right click menus 2020-01-05 16:25:55 -05:00
Liru Færs
dd3944161d Fix uninitialized member variable 2020-01-05 15:45:14 -05:00
Liru Færs
1aabbb13c0 Woops, this slipped out of a previous commit. 2020-01-05 15:44:46 -05:00
Liru Færs
5574f263b1 Fix crash in LLControlAvatar::matchVolumeTransform() from Kitty Barnett 2020-01-05 15:44:31 -05:00
Liru Færs
2117c66c9a Further LLControlAvatar sync with Alchemy 2020-01-05 15:41:22 -05:00
Liru Færs
1fbfc498bf Change signature of handle_go_to to be more versatile 2020-01-05 15:39:35 -05:00
Liru Færs
a02693e4dd [Animesh] Hook up more missing parts of LLControlAvatar, maybe fix stuff? 2020-01-05 00:08:26 -05:00
Liru Færs
24118e8e67 [Animesh] Hook up isImposter override for control avatars 2020-01-05 00:07:36 -05:00
Liru Færs
19ad64cc96 AlchSync: Change dynamic_casts to LLVOVolume to asVolume() 2020-01-04 23:31:15 -05:00
Liru Færs
e81affce51 Harmless Alchemy sync
CachedControls, autos, cleaner loops, remove overkill dynamic cast,
and override and final
2020-01-04 23:25:29 -05:00
Liru Færs
dec0bff972 Fix Crash C: mRootVolp wasn't being set null on mark for death 2020-01-04 21:36:47 -05:00
Liru Færs
5daf4aa777 Fix a shutdown crash (Crash B) 2020-01-04 19:46:17 -05:00
Liru Færs
2f24a53a01 Clean up some code 2020-01-04 12:15:00 -05:00
Liru Færs
28af96229b Cleaner port of Ansariel's fix for Attachment loss on TP/Crossing 2020-01-04 12:07:59 -05:00
Liru Færs
6d776632a9 Fix incorrect Link number in build floater. 2020-01-04 09:39:11 -05:00
Liru Færs
1853500e10 Fix Crash A: mFolders was being used without a null check 2020-01-04 02:57:40 -05:00
Liru Færs
8e01fcb7f0 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-01-02 01:55:02 -05:00
Liru Færs
3cddb0df2e Fix Crashes 1 and 5: LLTextEditor::replaceUrl, call to member
When a boost bind is converted into a suitable slot_function_type,
trackables will no longer be tracked, thus using ternary or static casts
breaks tracking, so old text editors were still receiving signals.
2020-01-01 21:35:07 -05:00
Liru Færs
37c4a4bbcb Fix possible unlinked and bad looking names in general tab of build tools 2020-01-01 13:07:49 -05:00
Router Gray
af8f0e1155 Fix gcc error 'extra qualification on member'. 2020-01-01 06:53:08 -06:00
Liru Færs
5df00a481d Code cleanup, now that erase is a member function 2020-01-01 02:59:52 -05:00
Liru Færs
d299c55ea4 Ve must erase ze kinderlach!!
Fixes Error 3, which was caused by deref of invalidated iterator
2020-01-01 02:59:23 -05:00
Liru Færs
d9d83a6807 Fix potential crash when SinguReplaceLinks is off. 2019-12-31 05:27:06 -05:00
Liru Færs
3fec94bb94 Clean up spell check entries properly, yikes.
Thanks for pointing this out, Torric!
2019-12-28 05:54:11 -05:00
Liru Færs
09926d12bb Fix compile, again, oops. 2019-12-28 04:10:21 -05:00
Liru Færs
19bcdae6ac LineEditor: Automatically hide spell check separator when it's not in use
That's the line that likes to linger beneath the menu, looking dumb
so now it won't, yay!
2019-12-28 04:09:35 -05:00
Liru Færs
36025384f4 Space change, remove excess check 2019-12-28 02:22:30 -05:00
Liru Færs
4bdbb89e6f TODONE: create accessor methods for mItems
Adds LLMenuGL::end, LLMenuGL::getItems
Changes LLMenuGL::find to a const function returning a const_iterator
2019-12-28 01:43:01 -05:00
Liru Færs
e94314dc95 LLMenuGL::getItemCount should be const and return size_type
Also put it in the header.
2019-12-28 01:21:33 -05:00
Liru Færs
5dd68a4055 Actually make use of the item_list_t typedef 2019-12-28 00:31:45 -05:00
Liru Færs
fff4e9b4b8 Add optional name parameter to addSeparator 2019-12-28 00:23:46 -05:00
Liru Færs
8a6f5b49a3 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2019-12-27 20:19:49 -05:00
Router Gray
c8290b913e [CMake] Change remaining WORD_SIZE references to ADDDRESS_SIZE. 2019-12-27 06:16:59 -06:00
Liru Færs
e6e6d811c6 Updating crashpad 2019-12-25 21:33:51 -05:00
Router Gray
cdc35b3c32 [CMake] Remove add_dependency entries for items listed in target_link_libraries. Superfluous. (Alchemy sync)
Fixes Linux build errors.
2019-12-25 09:08:56 -06:00
Router Gray
c68e00730e [CMake Linux] Only include pthread and rt in target_link_libraries for ld.gold support (Alchemy sync)
Fixes CMake warnings on Linux
2019-12-25 09:08:48 -06:00
Router Gray
0496374328 [CMake] Use POSITION_INDEPENDENT_CODE property instead of manually setting -fPIC (Alchemy sync) 2019-12-25 09:08:40 -06:00
Liru Færs
6608dd0b8d Fix disabling crashpad and disable using crashpad on win32
Thanks Rye!
The Win32 build is a mess and won't have crash support for this release

We'll fix this all later
2019-12-24 05:33:12 -05:00
Liru Færs
432b4ab69d Allow right clicking to navigate through notify tips that aren't gone
Also clean up logic, since we're now always handling right clicks
2019-12-22 21:56:59 -05:00
Liru Færs
967b3646a6 Allow complex user interaction with notify tips
Hover and active right click menu now maintain their presence
2019-12-22 21:35:53 -05:00
Liru Færs
4110d1975a Give priority to a notify tip's children handling a left click 2019-12-22 21:16:07 -05:00
Liru Færs
b1862ce1c1 Shove textbox pointer of notifies into a member var
Used in future commit, separated for ease of reading
2019-12-22 21:14:14 -05:00
Liru Færs
a432c3429c Mark notify stuffs final/override 2019-12-22 21:06:37 -05:00
Liru Færs
949190b48d Clean up llnotify includes 2019-12-22 21:04:14 -05:00
Liru Færs
6885bf6368 Hack to get right click copy group name to work on my groups floater 2019-12-22 19:04:24 -05:00
Liru Færs
78f354925c Tiny refactor, harmless 2019-12-22 18:35:59 -05:00
Liru Færs
a87b7603d1 Feature Request: Move Tiny Build Floater button to floater's top bar 2019-12-22 18:26:00 -05:00
Liru Færs
1f3a232a9d Add Copy Name/Copy Names to avatar namelink menus 2019-12-22 01:44:06 -05:00
Liru Færs
99346d6486 This should've been committed in f3609b06d7 2019-12-21 04:58:57 -05:00
Liru Færs
067bd3cbd7 Sync with alchemy
Minor installer fix
Fix MSVC update breaking crashAndLoop
Move Variables to their corresponding places
Sync parts of deps/CMakeLists.txt
Update Abseil and fmt
2019-12-19 21:04:01 -05:00
Liru Færs
6e716fe3c5 Sentry and CI improvements from Rye. 2019-12-19 20:35:33 -05:00
Liru Færs
831c7f53b2 Fix bad spacing in Variables.cmake 2019-12-18 19:54:03 -05:00
Liru Færs
1c5a829e82 More of Rye's gitlab CI changes <3 2019-12-18 19:51:29 -05:00
Liru Færs
4751949628 Cleanup and further sync with upstream 2019-12-18 16:27:17 -05:00
Liru Færs
f8abafdefa Code cleanup/sync 2019-12-18 00:05:59 -05:00
Liru Færs
4798d1e3b3 Finish migration from summary.json to build_data.json 2019-12-18 00:00:22 -05:00
Liru Færs
10140d143c Wooops, branding ID separation is necessary, revert that change
Set up VIEWER_BINARY_NAME based on VIEWER_BRANDING_ID, make spaces dashes.
Fix VIEWER_EXE_GLOBS being wrong on Linux, thanks Router!
2019-12-17 23:49:37 -05:00
Liru Færs
f3609b06d7 Further CI/CD & building sync with alchemy
Reorder Variables.cmake for mergeability
Renames CMake Variables:
FMODSTUDIO->USE_FMODSTUDIO, NVAPI->USE_NVAPI,
VIEWER_CHANNEL_BASE->VIEWER_CHANNEL_TYPE
VIEWER_BRANDING_ID->VIEWER_BINARY_NAME,
VIEWER_PRODUCT_NAME->VIEWER_CHANNEL_BASE

Remove unused variables:
VIEWER_PACKAGE_ID, VIEWER_EXE_STRING, VIEWER_SHORTCUT_STRING, VERSION_BUILD

PACKAGE now defaults to on, USE_FMODSTUDIO now defaults to off

Use list append instead of set in some more places

Adds support for Project channels.
2019-12-17 19:31:08 -05:00
Router Gray
f25577649a [BOM] Fix universal wearables more, and correctly: Sync WT_COUNT and WT_UNKNOWN constants in llinventory.cpp and llwearable.h
Reverted previous changes to textures.xml regarding this issue
2019-12-17 06:34:27 -06:00
Liru Færs
cf5586037e Move to gitlab for CI (Rye's work but ported)
d3ddcdae: Update various urls from bitbucket to new alchemy gitlab
c24b176d: Standardize on one vc directory name for ease of build automation
Also add .gitlab-ci.yml

Thanks for the help, Rye!
2019-12-14 23:01:07 -05:00
Liru Færs
c6e3c31fae Clean up logic 2019-12-12 20:21:14 -05:00
Router Gray
0c3e1f602a [BOM] Fix universal wearables: sync a missed change from upstream, and make the inventory icon load. 2019-12-09 01:39:29 -06:00
Router Gray
d3a35e3f8d Fix ancient bug in appearance editor
(ref viewer-release "MAINT-2564 FIXED Alpha mask does not hide hair in the Outfit Editor" and "MAINT-3399 Hairbase renders incorrectly in edit appearance mode")
2019-12-02 22:56:27 -06:00
Router Gray
b34bafc348 [UI] Make graphics preferences Object LOD value limit agree with QuickPrefs limit 2019-12-02 18:03:42 -06:00
Router Gray
cdb316834a Exclude animesh from the AlwaysRenderFriends (and self) complexity exemptions. 2019-12-02 18:03:17 -06:00
Liru Færs
8b30e2e931 Also groups list for EAM panel 2019-11-24 08:04:34 -05:00
Liru Færs
841bd0e515 Add Group menus to group search, profiles, and groups floater
Also expand Group SLURL menu items for links in chat
Calculate ID Type from mPopupMenu's presence in sMenus, if possible.
2019-11-24 07:53:36 -05:00
Liru Færs
90677188ec Fix Minimap menu not working 2019-11-24 06:28:49 -05:00
Liru Færs
6d5df7c9af Make TextEditor an IDBearer, via slurl segments! 2019-11-24 06:03:46 -05:00
Liru Færs
79e1830ba9 Fix compile 2019-11-24 02:54:23 -05:00
Liru Færs
f0db784b46 Oh, this change is needed for the future. 2019-11-24 00:42:42 -05:00
Liru Færs
ef5c9f0175 Make sure that when we open pictures they stay on screen 2019-11-24 00:33:50 -05:00
Liru Færs
84081286f0 Buncha assorted changes 2019-11-24 00:32:58 -05:00
Liru Færs
1b913443ad Add in menus for groups, and rework LFIDBearer to handle its menus
Also allow List.StartIM for multiselect
Add IsInGroup, NotInGroup, Leave, Join, and Activate "List." menu options
2019-11-24 00:27:19 -05:00
Liru Færs
f5c19b9e5c Add List.EnableUnmute and List.CopyNames to menu callbacks 2019-11-23 23:07:13 -05:00
Liru Færs
5a561e03b8 Introduce Types for ID Bearer IDs 2019-11-23 23:05:33 -05:00
Liru Færs
ab207727fd Buncha loopy changes 2019-11-23 22:44:35 -05:00
Liru Færs
b3231883f6 Remove unused menu_url_agent_mini.xml 2019-11-23 22:38:08 -05:00
Liru Færs
d9ff42ab3c Add name_system attribute to NameBoxes and NameEditors
Uses the main one by default.
Removes old show complete names on profile setting in favor of
ProfileNameSystem, which is now offered under Adv. Chat->Chat UI

Forces nameui to refresh on name setting update, or should, not important though
2019-11-23 22:37:50 -05:00
Liru Færs
fb20751330 Create LFIDBearer default virtual functions for IDs and counts for 0/1 ID 2019-11-17 22:42:53 -05:00
Liru Færs
c5bf72f0b3 Merge NameBox initialization up to NameEditor's initialization 2019-11-17 22:34:44 -05:00
Liru Færs
cfdcb8b3df Some finals 2019-11-17 22:33:03 -05:00
Liru Færs
7d0cbf6d02 Add a tiny hack to support <nolink> tag 2019-11-16 15:46:36 -05:00
Liru Færs
0b4f576c54 Touch up merge for llurlentry 2019-11-16 15:36:11 -05:00
Liru Færs
d93bed216a Fix careless mistake breaking item properties floater 2019-11-16 12:34:36 -05:00
Liru Færs
89abfe6f86 Fix group names on certain group profiles sometimes never Loading in 2019-11-16 11:17:42 -05:00
Liru Færs
78fbc214ca Make chat loaded from log file be in LogChatColor instead of hardcoded grey 2019-11-16 10:02:01 -05:00
Liru Færs
fc649854ff Add Selected Avatars submenu to minimap menu
Minimap refactor, make it an LFIDBearer!

Moves listeners to cpp file, no need for header exposure
Removes duplicate ToggleControl listener just for minimap
Removes excess code from ToggleOverlay, we can use two on_clicks instead
Caches direction labels instead of looking them up each frame
Removes weird userdata look up on camera center menu item, fixing it
Respect RLVa by hiding the submenu, shortcutting lookups per child
2019-11-16 09:14:19 -05:00
Liru Færs
60e71f5724 Fix Beware's issue with SinguReplaceLinks failing for system messages
Fixes Teleport Offers in local being links
Fixes System Messages in IMs not enforcing link replacement
Fixes IM Chat History being loaded with replacement support,
at the log point, we can only consider it text from an outside source.
Changes IM Chat History color from hard coded grey to SystemChatColor
2019-11-16 03:49:47 -05:00
Liru Færs
b78807e5ed Merge llnameui changes from future branch to use lighter rlv headers 2019-11-07 13:55:07 -05:00
Liru Færs
4e39027958 Fix Linux build, thanks Router~ 2019-11-07 13:23:50 -05:00
Liru Færs
b527918350 Shorten format string 2019-11-07 12:47:59 -05:00
Liru Færs
16a352c70a Fix Bridge Autodetach yet again, thanks for the report Beware! 2019-11-07 12:30:11 -05:00
Liru Færs
5035f9c3d6 Fix Track item in slurl menus being broken 2019-11-07 11:33:27 -05:00
Liru Færs
a662318417 We must download LibVLC during installation 2019-11-07 09:24:14 -05:00
Liru Færs
573934e505 Disable Breakpad symbol generation, not needed for crashpad 2019-11-07 06:30:37 -05:00
Liru Færs
927e86bdc9 Feature Request: Link names in transaction messages 2019-11-06 06:42:45 -05:00
Liru Færs
cfa2c4e424 Fix Beware's issue with SinguReplaceLinks being partially broken recently 2019-11-06 06:42:13 -05:00
Shyotl
79bafbb943 Merge remote-tracking branch 'singularity-viewer/master' 2019-11-05 21:50:08 -06:00
Shyotl
36bfaf0f05 Clean up appearance editor. 2019-11-05 21:48:12 -06:00
Liru Færs
3d7da6e858 Router's fix for manifest borkage, thankies! 2019-11-03 18:40:41 -05:00
Liru Færs
f81f374ab9 Fix name ui hover handling bypassing necessary base call. Woops. 2019-11-03 18:33:03 -05:00
Liru Færs
82050a5e46 Woops, actually do the script debug link thing. 2019-11-03 18:30:00 -05:00
Liru Færs
9cf26e1fc2 Link names! Online/Offline notifications, Make group item declines better 2019-11-03 16:17:32 -05:00
Liru Færs
fa869f21ad Script Debug should link to object, when possible 2019-11-03 16:08:43 -05:00
Liru Færs
6af65004a5 Don't const_cast LLChat, just accept it as non-const. 2019-11-03 15:36:58 -05:00
Liru Færs
d189aadd12 Squeak
Links for teleport offers, show autoresponded with item to muted in local,
autounmute notification (so you can remute easily :P).

Cleanup redundant strings
2019-11-03 15:12:05 -05:00
Liru Færs
6048019926 When giving inventory to someone, use preferred name and link it in log. 2019-11-03 12:39:28 -05:00
Liru Færs
021ba21b4f Fix Show/Hide spell check clutter
This patch is needed until the future where we discard menus on close
2019-10-30 00:32:21 -04:00
Liru Færs
96b7612d73 EAM Dates now respect ShortDateFormat 2019-10-26 15:17:40 -04:00
Router Gray
7e8ebdb852 [UI] Let clickable link name boxes and name editors have hand cursors instead of I-beams. 2019-10-24 22:49:06 -04:00
Router Gray
2e52fe64b8 [UI] Make avatar profiles honor ShortDateFormat. Thanks Liru.
Feature request/improvement suggested by Torric Rodas.
2019-10-24 22:49:06 -04:00
Router Gray
8b367c8eab Fix a missed variable replacement in the debug settings merge. 2019-10-24 22:49:06 -04:00
Router Gray
68481b8921 [Notifications] Make cpp agree with xml to fix Restore In World confirmation on no-copy inventory items.
Thanks Torric Rodas for reporting.
2019-10-24 22:49:06 -04:00
Liru Færs
a5aeac312c Merge debug settings against my updated alchemy version, gain tooltips! 2019-10-24 00:25:58 -04:00
Router Gray
d29d35ab23 Typo fix in autobuild xml. 2019-10-22 20:37:05 -05:00
Liru Færs
20eb6a3eca Hide http disablers on SL, UDP doesn't work anymore so they do nothing 2019-10-22 21:26:19 -04:00
Liru Færs
54c4b1de83 Fix the common crash, not quite sure why LL doesn't get this one
This fix does a few things:
1. LLMaterialID initializing an LLSD implicitly from a uuid and
thus not having it be a Binary, and not overriding LLSD::asBinary,
UUIDs are now checked for when receiving an LLSD in constructor
2. Implicitly using a UUID shortcuts to just calling set with the mData.
2019-10-22 21:00:17 -04:00
Liru Færs
d3572dd4ec Fix silly warning 2019-10-22 19:23:35 -04:00
Liru Færs
696a5f967d Forgot to rip this out of the headers for nonwindows, woops 2019-10-22 17:45:54 -04:00
Liru Færs
3fa4f73b6f Fix linux build, for the millionth time... is there a record?
Thanks for the help, damian
2019-10-22 01:55:06 -04:00
Liru Færs
afbafbe689 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer
# Conflicts:
#	indra/newview/CMakeLists.txt
2019-10-22 01:03:45 -04:00
Liru Færs
18b02594cb Only have texture picker handle clicks with cb if on a visible portion
Fixes the bug wherein clicking the top of the a profile's groups list
would open that avatar's picture
2019-10-22 00:52:04 -04:00
Liru Færs
8288de7f79 Add Selected Face: display to build floater 2019-10-22 00:49:29 -04:00
Liru Færs
1693c97924 Add translatability to Selected prims/objects and Link number text
Also clean up this area's code a bit.
2019-10-22 00:49:15 -04:00
Router Gray
e3d69b4d8e [Audio] Make Fmod cooperate with the new PCH shiny. Also fixes OpenAL in Windows. 2019-10-21 20:23:55 -05:00
Liru Færs
f8eef33b7b This is fixes the build, woops 2019-10-21 17:31:28 -04:00
Liru Færs
d5af2588bc Let combo box label be default selection via xui 2019-10-21 16:48:14 -04:00
Liru Færs
432bf03f0a Port Crashpad support from alchemy, with some small tweaks
Moved initCrashReporting into LLAppViewer, everything we use there is
crossplatform enough that duplicating code is silly

Removes unused gCrashSettings
Adds MBFatalError, that's right, Crash Loop is now translatable!
Adds consent notification prompt to first login... enjoy that, everyone.
2019-10-21 16:25:29 -04:00
Router Gray
2ba3ff852c [Linux] Switch to Ninja build system. Use compiler feature detection to accomodate the new PCH module. 2019-10-20 22:15:09 -05:00
Router Gray
76e9d912d6 [Linux] Drop prebuilt freetype and fontconfig, use system libraries. 2019-10-20 22:15:03 -05:00
Router Gray
29e71bec86 [CMake] The COMMENT directive needs quotes on output. 2019-10-20 22:14:57 -05:00
Router Gray
1d1857e5a7 [LL] Null checks, and demote a LL_ERRS to LL_WARNS. 2019-10-20 22:14:50 -05:00
Liru Færs
8a2407ecbb fmt, just not for linux 2019-10-20 05:54:05 -04:00
Liru Færs
05146faacf Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2019-10-20 01:49:28 -04:00
Liru Færs
b7fb8fb0ca Restore intentional removal of mGroupName caching
This field rarely changes, once if ever, as far as I can see...
perhaps we shoulld reduce the amount of setValue calls it receives but
they're not hurting too much for now.
2019-10-20 01:49:09 -04:00
Liru Færs
5ddab7d3b2 Feature Request: Link name in "Autoresponded to <name>" text 2019-10-20 01:37:28 -04:00
Liru Færs
ebcbf79237 Rearranging and cleaning up some assorted code 2019-10-20 01:36:41 -04:00
Liru Færs
f5fd05a1e4 Remove unused gPopupMenuView and MENU_BAR_WIDTH and other associated code 2019-10-20 01:32:56 -04:00
Liru Færs
a644b2dee5 Let's let gesture triggers and replacements be 128 characters, why not? 2019-10-20 01:20:20 -04:00
Liru Færs
1d073cd0d9 [BOM] Add a checkbox for Universal wearables to Create New Outfit floater 2019-10-20 01:18:20 -04:00
Liru Færs
a1e74c3286 MakeOutfitDialog should use deltas for xui 2019-10-20 01:17:40 -04:00
Liru Færs
a6cc7eda61 This has been unstaged for too long by accident 2019-10-20 01:15:06 -04:00
Shyotl
a36e128e57 Re-enabling NSIS invocation (???) 2019-10-19 18:41:18 -05:00
Liru Færs
daffb602bb Clean up a bunch of spelling suggestion code that's annoyed me forever 2019-10-19 08:24:33 -04:00
Liru Færs
0f28a1bd86 These are things, I'm sleepy 2019-10-19 07:24:30 -04:00
Shyotl
4043130f75 Update texturelist/volumetexture management with changes from upstream. Note: TEX_LIST_SCALE not utilized in singu... yet. 2019-10-19 04:05:34 -05:00
Shyotl
835083a741 Added a few missing BoM pieces. 2019-10-19 04:00:51 -05:00
Shyotl
daf63eb418 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2019-10-19 00:01:59 -05:00
Shyotl
4d5e5e1635 Merge branch 'animesh' of https://github.com/singularity-viewer/SingularityViewer.git into animesh 2019-10-19 00:00:50 -05:00
Shyotl
15c3ff0544 Minor bits and bobs from upstream. 2019-10-18 23:59:41 -05:00
Router Gray
68d19cd6fb [BOM] More BoM hooking up. 2019-10-18 16:16:16 -05:00
Liru Færs
ecc1730912 GCC 4 is why we can't have nice things... yet 2019-10-18 15:14:05 -04:00
Liru Færs
9c2d062886 Finish up ninja support, thanks Rye! 2019-10-17 23:04:21 -04:00
Liru Færs
7b3c3b9fab Burst Commit for building with ninja and more, thanks Alchemy!
GeneratePrecompiledHeader - Cinder and Rye
Ninja Support - Rye
Fetch Content instead of prebuilds - Rye
Visual Studio Native CMake Support - Rye
2019-10-17 21:15:30 -04:00
Liru Færs
a37299b4ae Cinder's randumb startup messages 2019-10-17 18:41:39 -04:00
Liru Færs
0c2ec8cb71 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2019-10-17 18:32:48 -04:00
Router Gray
7c2af68e3c [BOM] Add the magic BoM defines to isFullyBaked() and applyParsedAppearanceMessage(). 2019-10-17 03:48:53 -05:00
Damian Zhaoying
c0ec1d2c9a New spanish translations for BoM 2019-10-15 08:03:07 -03:00
Liru Færs
28911f03a7 Harmless change that is more right to do than not 2019-10-14 22:13:15 -04:00
Liru Færs
c65b0eb544 Silence these noisy Customize Appearance debugs 2019-10-14 22:12:44 -04:00
Liru Færs
f11eb17313 Woops, forgot partway through why I'd made this early change, needed! 2019-10-14 22:10:29 -04:00
Liru Færs
453386a49a Prevent warnings about missing ui from places it would never be
Layer interaction buttons for single layer wearable types
Buttons for subparts in types with only a single subpart
Take Off button for body parts
2019-10-14 22:05:53 -04:00
Liru Færs
accd69386a Small opt for null ids on name lists 2019-10-14 22:00:25 -04:00
Liru Færs
610d592f5a Let's do participants lists treating them as actual name lists
Adding items to these lists should be somewhat faster now, and that's good
because we usually add a bunch at a time with large groups.
2019-10-14 22:00:04 -04:00
Liru Færs
2b955eb00d Fix the participate lists loading usernames as images bug 2019-10-14 21:56:14 -04:00
Liru Færs
f38d200e93 Fix estate's access panel having an opaque background 2019-10-14 21:55:03 -04:00
Liru Færs
0b1f605bba Fix missing word and words going off the edge of customize info text 2019-10-14 21:54:17 -04:00
Liru Færs
278b617290 [BOM] Add Universal wearables functionality 2019-10-14 21:53:01 -04:00
Liru Færs
27c259bf7c Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2019-10-13 05:23:59 -04:00
Liru Færs
f520251935 Seriously, don't rush things when an Uber is coming
Fixes optional behavior to disable left click for profiles in name editors via xui not working because it wasn't listening to the variable passed in, woops. Yay randomly initialized pods!
2019-10-13 04:48:55 -04:00
Liru Færs
aa888c704e Fix bug noticed by gcc noticed by router 2019-10-13 04:16:08 -04:00
Liru Færs
bbd3cb3469 Fix compile 2019-10-11 16:44:59 -04:00
Liru Færs
bd2c67e8ec Fix win32 warnings 2019-10-11 16:28:48 -04:00
Liru Færs
b5afce0bbd Add flag to enable line editor style left clicks on name editors
Enable this flag on the profile name editor, but not the partner one.
2019-10-11 15:38:38 -04:00
Liru Færs
c5f714def8 Fix build on Linux
Thanks for the heads up and testing, Damian
2019-10-11 14:40:38 -04:00
Liru Færs
fdeb194d0e Fix Creator and Last Owner not showing in edit tools
Also fix special cases where there are owners that are not a single user
2019-10-11 05:33:54 -04:00
Liru Færs
975f3b420e Woops, don't be so tired or you'll miss silly things...
or be super tired and see everything.

This fixes right click name editor logic causing constant menu swaps
every right click, but hey, at least we know that works, right?
2019-10-11 04:55:10 -04:00
Liru Færs
8d5f1191dd Fix Windlight Editor not updating to current windlight's colors
This bug came whenever the color swatches were switched to sliders,
that's a long while ago! Eep!
2019-10-11 04:13:53 -04:00
Liru Færs
7c89a8b178 Remove old pointless code
Somehow fixed my BOM crash
2019-10-11 03:42:20 -04:00
Liru Færs
7c24e67c50 The UI portion of Bakes on Mesh... and the entire thing, sure, why not?
Also let's now select the proper tab when we input an ID or select a face
with an asset ID that we can find in a tab, but that never works for BOM
when applied.
2019-10-11 03:41:42 -04:00
Liru Færs
1cb9ea16da Unlimit the width of a bunch of the name_boxes 2019-10-10 20:28:20 -04:00
Liru Færs
c4a9532784 Feature Request: Option to render only self: AlwaysRenderFriends set to 3 2019-10-10 19:40:01 -04:00
Liru Færs
43163b400d Add support for a bunch of v3isms to scroll list xml parsing 2019-10-10 18:57:42 -04:00
Liru Færs
93e30f44c0 Woops, this looks like it should have been staged a while back 2019-10-10 18:56:57 -04:00
Liru Færs
b6b44a2c86 Texture Picker redesign, more room, better presentation <3 2019-10-10 18:55:44 -04:00
Liru Færs
cb53a4f923 Rename local texture picker tab to Local, Computer is so old school 2019-10-10 15:22:35 -04:00
Liru Færs
85f147f679 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into animesh 2019-10-10 15:09:43 -04:00
Liru Færs
17cb8bd764 Clean up and update all the translations where name ui was switched to
vim macros are powerful
2019-10-10 14:42:01 -04:00
Liru Færs
b2eb4ea70c Remove now redundant partner profile button 2019-10-10 13:14:52 -04:00
Liru Færs
c6089637e7 On second thought, clicking a name editor should open up the profile, too
The initial thinking behind this decision was that people may want to
select, if they do, they can right click for this very rare use case.
2019-10-10 12:37:47 -04:00
Liru Færs
2f72ed2e80 Revert addition of now unused LLLineEditor::mFontStyle 2019-10-10 11:41:58 -04:00
Liru Færs
7b6a4d76a8 Actually, we don't underline links, I forgot, oops! 2019-10-10 11:39:59 -04:00
Liru Færs
8c7e498861 Some opts to avoid things that won't happen 2019-10-10 11:34:40 -04:00
Liru Færs
9824cc7068 Display Name UIs as links when they can be interacted with
Adds font style member to line editors, might be useful in the future?
2019-10-10 03:31:31 -04:00
Liru Færs
d16ff5cb5c Bunch of excess clean up from while I was working on things 2019-10-10 02:49:17 -04:00
Liru Færs
0409a81e36 Renable old feature: Display complete names on profiles 2019-10-10 02:48:30 -04:00
Liru Færs
e0883b72dc All Name UI now uses the user's NameSystem selection instead of legacy 2019-10-10 02:43:02 -04:00
Liru Færs
b592b3c658 Fix whoopses from mid-development commits
Fixes compiles and fixes menu crash and missing menu file
2019-10-10 02:39:11 -04:00
Liru Færs
d277f1750d All places just av/group names were being used are now name ui
Since NameBoxes are clickable, remove redundant profile buttons.
Removes a ton of RLV logic, now centralized inside LLNameUI
Removes excess functions that went largely unused

May no longer show if parcel sale is pending under the owner field,
this is weird and it's hard to keep this behavior

Also includes the missing setValue and getValue so this compiles,
that should've been committed way earlier, oops

Also adds ability for name_box to have is_group attribute, too!
2019-10-10 02:32:47 -04:00
Liru Færs
d54bf78c08 Allow Name UI to be marked rlv_sensitive (via xui)
This allows these parts of UI to be hidden when they need to be
2019-10-09 20:47:21 -04:00
Liru Færs
b1be8bb7f3 Clean up a section of RLVa code 2019-10-09 20:13:16 -04:00
Liru Færs
0b7061afb7 Name UI flag to disallow user interaction
Also bypass setting name text for null ID
2019-10-09 20:07:29 -04:00
Liru Færs
b132578692 Bit of refactor in prep for bigger changes 2019-10-09 20:03:26 -04:00
Liru Færs
c18bdddb60 Woops, forgot to stage this file! 2019-10-09 17:57:10 -04:00
Liru Færs
6cd07b23f1 Name Editors sometimes need to be scrolled through, show tooltip instead 2019-10-09 17:44:31 -04:00
Liru Færs
ab546f54ab Remove unnecessary function 2019-10-09 17:43:26 -04:00
Liru Færs
11068eee38 Woops, these are needed since the change of name to line editor 2019-10-09 17:42:22 -04:00
Liru Færs
f80e23ac5e Name Editors are Name UI too! 2019-10-09 17:30:27 -04:00
Liru Færs
513a4fd16c When a profile is being reused, disable partner info button 2019-10-09 17:23:41 -04:00
Liru Færs
98b3c8a812 These are not name editors, they are line editors. Get it right. 2019-10-09 17:22:31 -04:00
Liru Færs
f5ffa65ea7 Merge Line Editor menu and Text Editor menu, and use EditMenu listeners
Cleans up a ton of logic and some excess memory usage
Translates Line Editor menu, finally
2019-10-09 17:12:10 -04:00
Rye Mutt
a559a09217 Fix a ton of small bugs in 64bit memory value handling 2019-10-09 16:52:46 -04:00
Liru Færs
3cb831bb56 Add the Photo Tools Windlights from FS, thanks FS/original authors 2019-10-09 15:52:12 -04:00
Liru Færs
bce8a3b3cc Add extending existing xml menus by using filename attribute 2019-10-09 15:36:36 -04:00
Liru Færs
65ee3a5345 Move duplicated logic out of NameBox and into new base class LLNameUI
Also clean up includes.
2019-10-09 01:34:00 -04:00
Liru Færs
3c8a8efc03 Merge branch 'animesh' of https://github.com/singularity-viewer/SingularityViewer into animesh 2019-10-07 23:59:45 -04:00
Liru Færs
99facf6764 Make namebox an IDBearer, so now it has a right click menu, yay! 2019-10-07 23:47:35 -04:00
Liru Færs
8f3b10875e Introduce LFIDBearer, a Class for menu bearing UI that offers IDs to menus
Move menu code from scroll list into there
Separate out interface for getting IDs

No longer bother with the focus manager, for menus where not necessary,
this ensures that if focus suddenly changes, it won't break menu UX flow.

Clean up all the static functions by using new static class functions
2019-10-07 23:46:09 -04:00
Liru Færs
33ef6cc3f7 Initial alteration of namebox for clicky stuffs
Should allow left clicking of certain name textboxes to bring up profiles
Removes old dead variables
Cleans up includes
2019-10-07 23:38:34 -04:00
Liru Færs
d21e5db701 Fix the group founder name 2019-10-05 01:54:06 -04:00
Shyotl
1c1e64f48f Merge branch 'animesh' of https://github.com/singularity-viewer/SingularityViewer.git into animesh 2019-09-29 19:29:28 -05:00
Shyotl
4b6d1934c3 Clear out VAOs properly. 2019-09-29 19:29:03 -05:00
714 changed files with 43745 additions and 18044 deletions

2
.gitignore vendored
View File

@@ -3,10 +3,12 @@
*.aps
*.suo
*.vshost.exe
*/.vs
/bin/
/bin-release/
/bin
/bin-release
/indra/out/
/indra/viewer-*
/indra/newview/vivox-runtime/
/indra/newview/dbghelp.dll

166
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,166 @@
stages:
- build
- deploy
variables:
VIEWER_USE_CRASHPAD: "TRUE"
VIEWER_CRASHPAD_URL: $SENTRY_DSN
.win_build: &win_build
stage: build
tags:
- autobuild
- windows
before_script:
- pipenv install
script:
- If ($env:VIEWER_CHANNEL_TYPE -eq 'Project')
{
$env:VIEWER_CHANNEL_CODENAME = $env:CI_COMMIT_REF_NAME[8..100] -join ''
}
- pipenv run autobuild configure -c Release -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DVS_DISABLE_FATAL_WARNINGS=ON
- pipenv run autobuild build -c Release --no-configure
- If ($env:VIEWER_USE_CRASHPAD -eq 'TRUE') {
- Push-Location .\build-vc-*\newview\Release\
- sentry-cli upload-dif --include-sources singularity-bin.exe singularity-bin.pdb crashpad_handler.exe crashpad_handler.pdb fmod.dll libcrypto-1_1.dll libcrypto-1_1.pdb libssl-1_1.dll libssl-1_1.pdb libcrypto-1_1-x64.dll libcrypto-1_1-x64.pdb libssl-1_1-x64.dll libssl-1_1-x64.pdb vcruntime140.dll msvcp140.dll libhunspell.dll libhunspell.pdb glod.dll
- Pop-Location }
artifacts:
name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
expire_in: 2 week
paths:
- build-vc-*/newview/Release/build_data.json
- build-vc-*/newview/Release/singularity-bin.pdb
- build-vc-*/newview/Release/Singularity_*_Setup.exe
.beta_rules: &beta_rules
only:
- /^.*-beta$/
except:
- branches
.release_rules: &release_rules
only:
- /^.*-release$/
except:
- branches
build:master:windows32:
<<: *win_build
interruptible: true
variables:
AUTOBUILD_ADDRSIZE: 32
VIEWER_CHANNEL_TYPE: Test
VIEWER_USE_CRASHPAD: "FALSE"
only:
- schedules
build:master:windows64:
<<: *win_build
interruptible: true
variables:
AUTOBUILD_ADDRSIZE: 64
VIEWER_CHANNEL_TYPE: Test
VIEWER_USE_CRASHPAD: "FALSE"
only:
- schedules
build:project:windows32:
<<: *win_build
interruptible: true
variables:
AUTOBUILD_ADDRSIZE: 32
VIEWER_CHANNEL_TYPE: Project
VIEWER_USE_CRASHPAD: "FALSE"
only:
- /^project-.*$/
build:project:windows64:
<<: *win_build
interruptible: true
variables:
AUTOBUILD_ADDRSIZE: 64
VIEWER_CHANNEL_TYPE: Project
only:
- /^project-.*$/
build:beta:windows32:
<<: *win_build
variables:
AUTOBUILD_ADDRSIZE: 32
VIEWER_CHANNEL_TYPE: Beta
VIEWER_USE_CRASHPAD: "FALSE"
<<: *beta_rules
build:beta:windows64:
<<: *win_build
variables:
AUTOBUILD_ADDRSIZE: 64
VIEWER_CHANNEL_TYPE: Beta
<<: *beta_rules
build:release:windows32:
<<: *win_build
variables:
AUTOBUILD_ADDRSIZE: 32
VIEWER_CHANNEL_TYPE: Release
VIEWER_USE_CRASHPAD: "FALSE"
<<: *release_rules
build:release:windows64:
<<: *win_build
variables:
AUTOBUILD_ADDRSIZE: 64
VIEWER_CHANNEL_TYPE: Release
<<: *release_rules
.deploy_template: &deploy_template
stage: deploy
tags:
- autobuild
- windows
script:
- $BuildData = Get-Content .\build-vc-64\newview\Release\build_data.json | ConvertFrom-Json
- $BuildChannelVersion = $BuildData."Channel" + ' ' + $BuildData."Version"
- $UploadDestViewerDir = $BuildChannelVersion.ToLower().Replace(" ", "/")
- $UploadDestURL = "https://pkg.alchemyviewer.org/repository/viewer/${UploadDestViewerDir}"
- $UploadParams = @{ UseBasicParsing = $true;
Method = "PUT";
Headers = @{
ContentType = "application/x-executable";
Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("$env:AUTOBUILD_HTTP_USER`:$env:AUTOBUILD_HTTP_PASS")))"; };
Verbose = $true; };
- Push-Location .\build-vc-32\newview\Release\
- $FileNameWin32 = Get-ChildItem -Path . -Name -Include Singularity_*_Setup.exe
- Invoke-WebRequest @UploadParams -InFile .\$FileNameWin32 -Uri "${UploadDestURL}/${FileNameWin32}"
- Pop-Location
- Push-Location .\build-vc-64\newview\Release\
- $FileNameWin64 = Get-ChildItem -Path . -Name -Include Singularity_*_Setup.exe
- Invoke-WebRequest @UploadParams -InFile .\$FileNameWin64 -Uri "${UploadDestURL}/${FileNameWin64}"
- Pop-Location
- sentry-cli releases new $BuildChannelVersion
- sentry-cli releases set-commits --auto $BuildChannelVersion
- sentry-cli releases finalize $BuildChannelVersion
when: manual
deploy_project:
<<: *deploy_template
environment:
name: qa
only:
- /^project-.*$/
deploy_beta:
<<: *deploy_template
environment:
name: staging
<<: *beta_rules
deploy_release:
<<: *deploy_template
environment:
name: production
<<: *release_rules

View File

@@ -8,7 +8,7 @@ name = "pypi"
[packages]
llbase = "*"
certifi = "*"
autobuild = {hg = "https://bitbucket.org/alchemyviewer/autobuild-1.1"}
autobuild = {git = "https://git.alchemyviewer.org/alchemy/autobuild.git"}
[requires]
python_version = "2.7"

View File

@@ -47,40 +47,6 @@
<key>version</key>
<string>1.2.15</string>
</map>
<key>abseil-cpp</key>
<map>
<key>canonical_repo</key>
<string>https://bitbucket.org/alchemyviewer/3p-abseil-src</string>
<key>copyright</key>
<string>Copyright 2018 The Abseil Authors.</string>
<key>description</key>
<string>Abseil Common Libraries</string>
<key>license</key>
<string>Apache 2.0</string>
<key>license_file</key>
<string>LICENSES/abseil-cpp.txt</string>
<key>name</key>
<string>abseil-cpp</string>
<key>platforms</key>
<map>
<key>common</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>b82d5aa8380926240f3415279480c831</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/abseil-cpp/common/abseil_cpp-ac78ffc.1-common-1.tar.bz2</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>version</key>
<string>ac78ffc.1</string>
</map>
<key>apr_suite</key>
<map>
<key>copyright</key>
@@ -423,6 +389,54 @@
<key>version</key>
<string>2.3</string>
</map>
<key>crashpad</key>
<map>
<key>canonical_repo</key>
<string>https://git.alchemyviewer.org/alchemy/thirdparty/3p-crashpad</string>
<key>copyright</key>
<string>Copyright 2014 The Crashpad Authors. All rights reserved.</string>
<key>description</key>
<string>Crashpad is a crash-reporting system.</string>
<key>license</key>
<string>Apache 2.0</string>
<key>license_file</key>
<string>LICENSES/crashpad.txt</string>
<key>name</key>
<string>crashpad</string>
<key>platforms</key>
<map>
<key>windows</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>4614b29cc98021cf1770a8290171602b</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows/crashpad-ce32d093.7-windows-7.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>d801461b7a6a40fffab828aa1e01e3e6</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows64/crashpad-ce32d093.7-windows64-7.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>ce32d093.7</string>
</map>
<key>curl</key>
<map>
<key>copyright</key>
@@ -650,11 +664,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>06746b78827e9a0c6b666bd2528d36ad</string>
<string>695efb6fc548a56dc4ff34e8d9a37bfb</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://bitbucket.org/SingularityViewer/libraries/downloads/dullahan-1.1.1320_73.1.12%252Bgee4b49f%252Bchromium-73.0.3683.75-linux64-192030536.tar.bz2</string>
<string>https://bitbucket.org/router_gray/3p-dullahan/downloads/dullahan-1.3.202002250830_79.1.38_gecefb59_chromium-79.0.3945.130-linux64-200580406.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@@ -664,9 +678,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e19b664ad8cf9e7f4a7bf649d28faa76</string>
<string>1b278ff2535f428ea6536683d096fdd0</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://bitbucket.org/SingularityViewer/libraries/downloads/dullahan-1.1.1320_73.1.12+gee4b49f+chromium-73.0.3683.75-windows-191102212.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/dullahan/windows/dullahan-1.3.201911222116_78.3.7_gea7ef34_chromium-78.0.3904.108-windows-2.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -676,18 +692,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>414190fd1ce3876ee3efc682b06ae65c</string>
<string>b9346fea7643b10308c7bd9a769ef5f7</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://depot.alchemyviewer.org/pub/packages/windows64/msvc-1920/dullahan-1.1.1320_73.1.12-gee4b49f-chromium-73.0.3683.75-windows64-190871757.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/dullahan/windows64/dullahan-1.3.201911222103_78.3.7_gea7ef34_chromium-78.0.3904.108-windows64-2.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>1.1.1320_73.1.12+gee4b49f+chromium-73.0.3683.75</string>
<string>1.3.201911222103_78.3.7_gea7ef34_chromium-78.0.3904.108</string>
</map>
<key>elfio</key>
<map>
@@ -802,7 +818,7 @@
<key>fmodstudio</key>
<map>
<key>copyright</key>
<string>FMOD Studio, copyright (c) Firelight Technologies Pty, Ltd., 2012-2019.</string>
<string>FMOD Studio, Copyright (c) Firelight Technologies Pty Ltd.</string>
<key>description</key>
<string>FMOD Studio audio system library</string>
<key>license</key>
@@ -860,11 +876,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>54dbd41322a08a1fc333ca6d96af5502</string>
<string>ccd495598894c8e2e541a348015ee3f0</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>/opt/devel/secondlife/pkg/fmodstudio-2.00.02.191991250-linux64-191991250.tar.bz2</string>
<string>/opt/devel/fmodstudio-2.00.07.200182252-linux64-200182252.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@@ -874,11 +890,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e0e87e0423fa42e4d2997b47b92eac6e</string>
<string>d32efb193ffcd73bcba4875ddfd17bf0</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows/fmodstudio-2.00.03.192211030-windows-192211030.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows/fmodstudio-2.00.07.4-windows-4.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -888,62 +904,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>c2e55e1bfef7e066a0e40867a64b4cce</string>
<string>0604fd6b53ceaf14ce04d0de1bea51b8</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows64/fmodstudio-2.00.03.192211029-windows64-192211029.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows64/fmodstudio-2.00.07.4-windows64-4.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>1.10.10.190360453</string>
</map>
<key>fontconfig</key>
<map>
<key>copyright</key>
<string>Copyright (C) 2000,2001,2002,2003,2004,2006,2007 Keith Packard, 2005 Patrick Lam, 2009 Roozbeh Pournader, 2008,2009 Red Hat, Inc., 2008 Danilo Šegan, 2012 Google, Inc.</string>
<key>description</key>
<string>Fontconfig is a library for configuring and customizing font access.</string>
<key>license</key>
<string>bsd</string>
<key>license_file</key>
<string>LICENSES/fontconfig.txt</string>
<key>name</key>
<string>fontconfig</string>
<key>platforms</key>
<map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>2843c48e6c84a51e3d6aa05dace4c8c0</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-fontconfig-update/rev/290569/arch/Linux/installer/fontconfig-2.11.0-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>25726244f5bcd05f412514b030098c3c</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://depot.alchemyviewer.org/pub/linux64/lib-trusty/fontconfig-2.11.0-linux64-201603241804.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
</map>
<key>version</key>
<string>2.11.0</string>
<string>2.00.07.4</string>
</map>
<key>fonts</key>
<map>
@@ -1026,7 +998,7 @@
<key>freetype</key>
<map>
<key>copyright</key>
<string>Copyright 2006-2017 by David Turner, Robert Wilhelm, and Werner Lemberg.</string>
<string>Copyright 2006-2018 by David Turner, Robert Wilhelm, and Werner Lemberg.</string>
<key>description</key>
<string>Font rendering library</string>
<key>license</key>
@@ -1051,32 +1023,6 @@
<key>name</key>
<string>darwin</string>
</map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>52f87a65cc61ec4b05721c079d015b19</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-freetype-update/rev/290557/arch/Linux/installer/freetype-2.4.4-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>b10ba0775b9f1033daf580a2cb55789d</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://depot.alchemyviewer.org/pub/linux64/lib-trusty/freetype-2.6.3-linux64-201603241755.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows</key>
<map>
<key>archive</key>
@@ -1271,104 +1217,6 @@
<key>version</key>
<string>1.0pre3.190390340</string>
</map>
<key>google_breakpad</key>
<map>
<key>copyright</key>
<string>Copyright (c) 2006, Google Inc.</string>
<key>description</key>
<string>Breakpad is a crossplatform library for capturing crash callstacks and runtime data.</string>
<key>license</key>
<string>bsd</string>
<key>license_file</key>
<string>LICENSES/google_breakpad.txt</string>
<key>name</key>
<string>google_breakpad</string>
<key>platforms</key>
<map>
<key>darwin</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>9f963eb1728e6d5077d4feba805d4896</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://bitbucket.org/alchemyviewer/publiclibs-darwin/downloads/google_breakpad-9e60a27-darwin-201511222009.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
</map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>2d43c6a149cd9c89ba19e884579b1e25</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1836/4096/google_breakpad-1413.501824-darwin64-501824.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<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>
</map>
<key>name</key>
<string>linux</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>3709a51d4d5dff5ec0c4656623eaa05d</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://depot.alchemyviewer.org/pub/linux64/lib-trusty/google_breakpad-9e60a27-linux64-201603240004.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>fa7f683ba4ddd7db777c78c8213d2e46</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://depot.alchemyviewer.org/pub/windows/lib-vc141/google_breakpad-7398ce15b79da-windows-201703090621.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>71ffc5cae4da7e2e7aac856da44cb8c4</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://depot.alchemyviewer.org/pub/windows64/lib-vc141/google_breakpad-7398ce15b79da-windows64-201703081616.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>9e60a27</string>
</map>
<key>gperftools</key>
<map>
<key>copyright</key>
@@ -2085,38 +1933,6 @@
<key>version</key>
<string>7.11.1.297294</string>
</map>
<key>modernjson</key>
<map>
<key>copyright</key>
<string>Copyright (c) 2013-2018 Niels Lohmann</string>
<key>description</key>
<string>JSON for Modern C++</string>
<key>license</key>
<string>MIT</string>
<key>license_file</key>
<string>LICENSES/modernjson.txt</string>
<key>name</key>
<string>modernjson</string>
<key>platforms</key>
<map>
<key>common</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>6f11eca7e2a6ca61f9217e949a64f026</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://depot.alchemyviewer.org/pub/common/lib/modernjson-3.2.0-common-201809210551.tar.bz2</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>version</key>
<string>3.2.0</string>
</map>
<key>nvapi</key>
<map>
<key>copyright</key>
@@ -2660,7 +2476,7 @@
<key>vlc-bin</key>
<map>
<key>copyright</key>
<string>Copyright (C) 1998-2016 VLC authors and VideoLAN</string>
<string>Copyright (C) 1998-2020 VLC authors and VideoLAN</string>
<key>license</key>
<string>GPL2</string>
<key>license_file</key>
@@ -2698,9 +2514,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>add560654a53cb1c554044a4fac3c718</string>
<string>3ff1d097e4f9b8f864a639aff974a506</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12144/71458/vlc_bin-2.2.8.511703-windows-511703.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/vlc-bin/windows/vlc_bin-3.0.8.189-windows-189.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -2710,16 +2526,16 @@
<key>archive</key>
<map>
<key>hash</key>
<string>94bf04b49acc1e1bf2c06e2232f8a083</string>
<string>b890b109b526cc6ad211eadefed83316</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12145/71463/vlc_bin-2.2.8.511703-windows64-511703.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/vlc-bin/windows64/vlc_bin-3.0.8.189-windows64-189.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>2.2.8.511703</string>
<string>3.0.8.189</string>
</map>
<key>xmlrpc-epi</key>
<map>
@@ -2925,7 +2741,7 @@
<key>options</key>
<array>
<string>-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo</string>
<string>-DWORD_SIZE:STRING=$AUTOBUILD_ADDRSIZE</string>
<string>-DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE</string>
<string>-DROOT_PROJECT_NAME:STRING=Singularity</string>
<string>-DINSTALL_PROPRIETARY=FALSE</string>
</array>
@@ -2946,7 +2762,7 @@
<key>options</key>
<array>
<string>-DCMAKE_BUILD_TYPE:STRING=Release</string>
<string>-DWORD_SIZE:STRING=$AUTOBUILD_ADDRSIZE</string>
<string>-DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE</string>
<string>-DROOT_PROJECT_NAME:STRING=Singularity</string>
<string>-DINSTALL_PROPRIETARY=FALSE</string>
</array>
@@ -3029,10 +2845,10 @@
<key>build</key>
<map>
<key>command</key>
<string>make</string>
<string>ninja</string>
<key>options</key>
<array>
<string>-j 7</string>
<string>-v</string>
</array>
</map>
<key>configure</key>
@@ -3040,7 +2856,7 @@
<key>options</key>
<array>
<string>-G</string>
<string>Unix Makefiles</string>
<string>Ninja</string>
</array>
</map>
<key>default</key>
@@ -3053,10 +2869,10 @@
<key>build</key>
<map>
<key>command</key>
<string>make</string>
<string>ninja</string>
<key>options</key>
<array>
<string>-j 7</string>
<string>-v</string>
</array>
</map>
<key>configure</key>
@@ -3064,7 +2880,7 @@
<key>options</key>
<array>
<string>-G</string>
<string>Unix Makefiles</string>
<string>Ninja</string>
</array>
</map>
<key>name</key>
@@ -3085,10 +2901,10 @@
<key>build</key>
<map>
<key>command</key>
<string>make</string>
<string>ninja</string>
<key>options</key>
<array>
<string>-j 7</string>
<string>-v</string>
</array>
</map>
<key>configure</key>
@@ -3096,8 +2912,8 @@
<key>options</key>
<array>
<string>-G</string>
<string>Unix Makefiles</string>
<string>-DWORD_SIZE:STRING=64</string>
<string>Ninja</string>
<string>-DADDRESS_SIZE:STRING=64</string>
</array>
</map>
<key>default</key>
@@ -3110,10 +2926,10 @@
<key>build</key>
<map>
<key>command</key>
<string>make</string>
<string>ninja</string>
<key>options</key>
<array>
<string>-j 7</string>
<string>-v</string>
</array>
</map>
<key>configure</key>
@@ -3121,8 +2937,8 @@
<key>options</key>
<array>
<string>-G</string>
<string>Unix Makefiles</string>
<string>-DWORD_SIZE:STRING=64</string>
<string>Ninja</string>
<string>-DADDRESS_SIZE:STRING=64</string>
</array>
</map>
<key>name</key>
@@ -3135,7 +2951,7 @@
<key>windows</key>
<map>
<key>build_directory</key>
<string>build-vc${AUTOBUILD_WIN_VSVER|161}-$AUTOBUILD_ADDRSIZE</string>
<string>build-vc-$AUTOBUILD_ADDRSIZE</string>
<key>configurations</key>
<map>
<key>RelWithDebInfo</key>
@@ -3194,6 +3010,7 @@
<string>/p:Configuration=Release</string>
<string>/p:Platform=${AUTOBUILD_WIN_VSPLATFORM|NOTWIN}</string>
<string>/t:Build</string>
<string>/p:PreferredToolArchitecture=x64</string>
<string>/p:useenv=true</string>
<string>/verbosity:normal</string>
<string>/m</string>
@@ -3221,7 +3038,7 @@
</map>
</map>
<key>name</key>
<string>windows64</string>
<string>windows</string>
</map>
</map>
<key>version_file</key>

View File

@@ -3,12 +3,7 @@
# cmake_minimum_required should appear before any
# other commands to guarantee full compatibility
# with the version specified
## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly
if(WIN32)
cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
else()
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
endif()
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
set(ROOT_PROJECT_NAME "Singularity" CACHE STRING
"The root project/makefile/solution name. Defaults to Singularity.")
@@ -16,10 +11,6 @@ project(${ROOT_PROJECT_NAME})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Variables)
include(00-Common)
include(BuildVersion)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -28,9 +19,13 @@ if (NOT CMAKE_BUILD_TYPE)
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
include(Abseil-CPP)
# Dependencies
add_subdirectory(${ABSEIL_SRC_DIR} ${ABSEIL_BIN_DIR})
include(Variables)
include(00-Common)
include(BuildVersion)
include(CTest)
add_subdirectory(deps)
add_subdirectory(cmake)
add_subdirectory(${LIBS_OPEN_PREFIX}aistatemachine)
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
@@ -65,8 +60,10 @@ add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
add_subdirectory(${VIEWER_PREFIX}newview)
add_dependencies(viewer ${VIEWER_BRANDING_ID}-bin)
add_dependencies(viewer ${VIEWER_BINARY_NAME})
if (WINDOWS)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${VIEWER_BRANDING_ID}-bin)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY VS_STARTUP_PROJECT ${VIEWER_BINARY_NAME})
endif (WINDOWS)

View File

@@ -5,6 +5,7 @@
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(CheckCCompilerFlag)
include(Variables)
# Portable compilation flags.
@@ -17,19 +18,6 @@ set(CMAKE_C_FLAGS_RELEASE
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
# Configure crash reporting
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
if(RELEASE_CRASH_REPORTING)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1")
endif()
if(NON_RELEASE_CRASH_REPORTING)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
endif()
# Don't bother with a MinSizeRel build.
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
"Supported build types." FORCE)
@@ -51,9 +39,17 @@ if (WINDOWS)
"${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /fp:fast"
CACHE STRING "C compiler release options" FORCE)
if (WORD_SIZE EQUAL 32)
if (ADDRESS_SIZE EQUAL 32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
if (FULL_DEBUG_SYMS OR USE_CRASHPAD)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG:FULL")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG:FULL")
else ()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG:FASTLINK")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG:FASTLINK")
endif ()
if (USE_LTO)
if(INCREMENTAL_LINK)
@@ -107,9 +103,9 @@ if (WINDOWS)
)
endif (USE_LTO)
if (WORD_SIZE EQUAL 32)
if (ADDRESS_SIZE EQUAL 32)
add_compile_options(/arch:SSE2)
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
if (NOT DISABLE_FATAL_WARNINGS)
add_definitions(/WX)
@@ -199,10 +195,13 @@ if (LINUX)
# End of hacks.
if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
endif (NOT STANDALONE)
CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STRONG_STACK_PROTECTOR)
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
if(HAS_STRONG_STACK_PROTECTOR)
add_compile_options(-fstack-protector-strong)
endif(HAS_STRONG_STACK_PROTECTOR)
endif (${CMAKE_BUILD_TYPE} STREQUAL "Release")
if (${ARCH} STREQUAL "x86_64")
add_definitions(-pipe)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math")
@@ -293,19 +292,26 @@ if (LINUX OR DARWIN)
set(CMAKE_C_FLAGS "${UNIX_WARNINGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${UNIX_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
if (WORD_SIZE EQUAL 32)
if (ADDRESS_SIZE EQUAL 32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
elseif (WORD_SIZE EQUAL 64)
elseif (ADDRESS_SIZE EQUAL 64)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
endif (LINUX OR DARWIN)
if (STANDALONE)
add_definitions(-DLL_STANDALONE=1)
else (STANDALONE)
#Enforce compile-time correctness for fmt strings
add_definitions(-DFMT_STRING_ALIAS=1)
if(USE_CRASHPAD)
add_definitions(-DUSE_CRASHPAD=1 -DCRASHPAD_URL="${CRASHPAD_URL}")
endif()
set(${ARCH}_linux_INCLUDES
atk-1.0
cairo

View File

@@ -1,8 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
set(BUILD_TESTING OFF)
use_prebuilt_binary(abseil-cpp)
set(ABSEIL_SRC_DIR ${LIBS_PREBUILT_DIR}/abseil-cpp)
set(ABSEIL_BIN_DIR ${CMAKE_BINARY_DIR}/abseil-cpp)

View File

@@ -1,13 +1,13 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (LINUX)
include(FindPkgConfig)
pkg_check_modules(OGG REQUIRED ogg)
pkg_check_modules(VORBIS REQUIRED vorbis)
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (STANDALONE)
else (LINUX)
use_prebuilt_binary(ogg_vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
@@ -32,7 +32,7 @@ else (STANDALONE)
set(VORBISENC_LIBRARIES vorbisenc)
set(VORBISFILE_LIBRARIES vorbisfile)
endif (WINDOWS)
endif (STANDALONE)
endif (LINUX)
link_directories(
${VORBIS_LIBRARY_DIRS}

View File

@@ -9,7 +9,7 @@ include(Variables)
# building in an IDE, it probably isn't. Set it explicitly using
# run_build_test.py.
add_custom_command(OUTPUT packages-info.txt
COMMENT Generating packages-info.txt for the about box
COMMENT "Generating packages-info.txt for the about box"
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
${CMAKE_SOURCE_DIR}/../autobuild.xml

View File

@@ -8,7 +8,6 @@ set(cmake_SOURCE_FILES
CMakeLists.txt
00-Common.cmake
Abseil-CPP.cmake
AIStateMachine.cmake
APR.cmake
Audio.cmake
@@ -23,6 +22,7 @@ set(cmake_SOURCE_FILES
ConfigurePkgConfig.cmake
CURL.cmake
Copy3rdPartyLibs.cmake
CrashPad.cmake
Cwdebug.cmake
DBusGlib.cmake
DeploySharedLibs.cmake
@@ -33,7 +33,6 @@ set(cmake_SOURCE_FILES
FindCARes.cmake
FindColladadom.cmake
FindGLOD.cmake
FindGoogleBreakpad.cmake
FindGooglePerfTools.cmake
FindHunSpell.cmake
FindNDOF.cmake
@@ -43,15 +42,14 @@ set(cmake_SOURCE_FILES
FindXmlRpcEpi.cmake
FMODSTUDIO.cmake
FreeType.cmake
GeneratePrecompiledHeader.cmake
GLOD.cmake
GStreamer010Plugin.cmake
Glui.cmake
Glut.cmake
GoogleBreakpad.cmake
GooglePerfTools.cmake
Hunspell.cmake
JPEG.cmake
Json.cmake
LLAddBuildTest.cmake
LLAppearance.cmake
LLAudio.cmake

View File

@@ -6,17 +6,17 @@ SET(DEBUG_PKG_CONFIG "YES")
IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
# Guess at architecture-specific system library paths.
if (WORD_SIZE EQUAL 32)
if (ADDRESS_SIZE EQUAL 32)
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib32 /usr/lib)
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib32 /usr/local/lib)
SET(PKG_CONFIG_MULTI_GUESS /usr/lib/i386-linux-gnu)
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/i386-linux-gnu)
else (WORD_SIZE EQUAL 32)
else (ADDRESS_SIZE EQUAL 32)
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib)
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib)
SET(PKG_CONFIG_MULTI_GUESS /usr/lib/x86_64-linux-gnu)
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu)
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
# Use DPKG architecture, if available.
IF (${DPKG_ARCH})

View File

@@ -13,10 +13,6 @@ include(LLCommon)
# set up platform specific lists of files that need to be copied
###################################################################
if(WINDOWS)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibrariesAL)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release")
@@ -82,34 +78,19 @@ if(WINDOWS)
endif(ADDRESS_SIZE EQUAL 64)
if(NOT DISABLE_TCMALLOC)
set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
set(release_files ${release_files} libtcmalloc_minimal.dll)
list(APPEND debug_files libtcmalloc_minimal-debug.dll)
list(APPEND release_files libtcmalloc_minimal.dll)
endif(NOT DISABLE_TCMALLOC)
if (FMODSTUDIO)
set(debug_files ${debug_files} fmodL.dll)
set(release_files ${release_files} fmod.dll)
endif (FMODSTUDIO)
if(OPENAL)
list(APPEND debug_files alut.dll OpenAL32.dll)
list(APPEND release_files alut.dll OpenAL32.dll)
endif(OPENAL)
foreach(redistfullfile IN LISTS CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
get_filename_component(redistfilepath ${redistfullfile} DIRECTORY )
get_filename_component(redistfilename ${redistfullfile} NAME)
copy_if_different(
${redistfilepath}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${redistfilename}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${redistfilepath}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${redistfilename}
)
set(third_party_targets ${third_party_targets} ${out_targets})
endforeach()
if (USE_FMODSTUDIO)
list(APPEND debug_files fmodL.dll)
list(APPEND release_files fmod.dll)
endif (USE_FMODSTUDIO)
elseif(DARWIN)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
@@ -143,10 +124,10 @@ elseif(DARWIN)
libndofdev.dylib
)
if (FMODSTUDIO)
if (USE_FMODSTUDIO)
list(APPEND debug_files libfmodL.dylib)
list(APPEND release_files libfmod.dylib)
endif (FMODSTUDIO)
endif (USE_FMODSTUDIO)
elseif(LINUX)
# linux is weird, multiple side by side configurations aren't supported
@@ -176,29 +157,20 @@ elseif(LINUX)
set(release_files
libapr-1.so.0
libaprutil-1.so.0
libatk-1.0.so
libexpat.so
libexpat.so.1
libfreetype.so.6.12.3
libfreetype.so.6
libfreetype.so
libGLOD.so
libgmodule-2.0.so
libgobject-2.0.so
libopenal.so
libfontconfig.so.1.8.0
libfontconfig.so.1
libfontconfig.so
)
if (USE_TCMALLOC)
set(release_files ${release_files} "libtcmalloc_minimal.so")
list(APPEND release_files "libtcmalloc_minimal.so")
endif (USE_TCMALLOC)
if (FMODSTUDIO)
set(debug_files ${debug_files} "libfmodL.so")
set(release_files ${release_files} "libfmod.so")
endif (FMODSTUDIO)
if (USE_FMODSTUDIO)
list(APPEND debug_files "libfmodL.so")
list(APPEND release_files "libfmod.so")
endif (USE_FMODSTUDIO)
else(WINDOWS)
message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")

View File

@@ -0,0 +1,22 @@
# -*- cmake -*-
include(Prebuilt)
include(Variables)
if(USE_CRASHPAD)
if (USESYSTEMLIBS)
else (USESYSTEMLIBS)
use_prebuilt_binary(crashpad)
if (WINDOWS)
set(CRASHPAD_LIBRARIES
debug client.lib util.lib base.lib
optimized client.lib util.lib base.lib)
elseif (LINUX)
else (DARWIN)
endif ()
set(CRASHPAD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/crashpad)
endif (USESYSTEMLIBS)
endif()

View File

@@ -1,24 +1,11 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (LINUX)
include(FindPkgConfig)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
elseif (LINUX)
use_prebuilt_binary(dbus-glib)
set(DBUSGLIB_FOUND ON FORCE BOOL)
set(DBUSGLIB_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/dbus
)
# We don't need to explicitly link against dbus-glib itself, because
# the viewer probes for the system's copy at runtime.
set(DBUSGLIB_LIBRARIES
gobject-2.0
glib-2.0
)
endif (STANDALONE)
endif (LINUX)
if (DBUSGLIB_FOUND)
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")

View File

@@ -1,7 +1,7 @@
# -*- cmake -*-
include(Variables)
if (FMODSTUDIO)
if (USE_FMODSTUDIO)
use_prebuilt_binary(fmodstudio)
if(WINDOWS)
set(lib_suffix .dll)
@@ -30,22 +30,21 @@ if (FMODSTUDIO)
optimized ${FMOD_LINK_LIBRARY_RELEASE}
)
set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio)
endif(FMODSTUDIO)
set(FMODSTUDIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio)
endif(USE_FMODSTUDIO)
if(FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
if(FMOD_LIBRARY_RELEASE AND FMODSTUDIO_INCLUDE_DIR)
set(FMOD ON)
if (NOT FMOD_LIBRARY_DEBUG) #Use release library in debug configuration if debug library is absent.
set(FMOD_LIBRARY_DEBUG ${FMOD_LIBRARY_RELEASE})
endif (NOT FMOD_LIBRARY_DEBUG)
else (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
else (FMOD_LIBRARY_RELEASE AND FMODSTUDIO_INCLUDE_DIR)
message(STATUS "No support for FMOD Studio audio (need to set FMODSTUDIO_SDK_DIR?)")
set(FMOD OFF)
set(FMODSTUDIO OFF)
endif (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
set(USE_FMODSTUDIO OFF)
endif (FMOD_LIBRARY_RELEASE AND FMODSTUDIO_INCLUDE_DIR)
if (FMOD)
message(STATUS "Building with FMOD Studio audio support")
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODSTUDIO=1")
endif (FMOD)

View File

@@ -1,40 +0,0 @@
# -*- cmake -*-
# - Find Google BreakPad
# Find the Google BreakPad includes and library
# This module defines
# BREAKPAD_INCLUDE_DIRECTORIES, where to find the Goole BreakPad includes.
# BREAKPAD_EXCEPTION_HANDLER_LIBRARIES, the libraries needed to use Google BreakPad.
# BREAKPAD_EXCEPTION_HANDLER_FOUND, If false, do not try to use Google BreakPad.
# also defined, but not for general use are
# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library.
FIND_PATH(BREAKPAD_INCLUDE_DIRECTORIES common/using_std_string.h PATH_SUFFIXES google_breakpad)
SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client)
FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY
NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES}
)
IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY})
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "YES")
ELSE (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "NO")
ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
IF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
IF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
MESSAGE(STATUS "Found Google BreakPad: ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}")
ENDIF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
ELSE (BREAKPAD_EXCEPTION_HANDLER_FOUND)
IF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Google BreakPad library")
ENDIF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
ENDIF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
MARK_AS_ADVANCED(
BREAKPAD_EXCEPTION_HANDLER_LIBRARY
BREAKPAD_INCLUDE_DIRECTORIES
)

View File

@@ -1,14 +1,14 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (LINUX)
include(FindPkgConfig)
pkg_check_modules(FREETYPE REQUIRED freetype2)
else (STANDALONE)
else (LINUX)
use_prebuilt_binary(freetype)
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2)
set(FREETYPE_LIBRARIES freetype)
endif (STANDALONE)
endif (LINUX)
link_directories(${FREETYPE_LIBRARY_DIRS})

View File

@@ -0,0 +1,116 @@
# -*- cmake -*-
# Distributed under the MIT Software License
# Copyright (c) 2015-2017 Borislav Stanimirov
# Modifications Copyright (c) 2019 Cinder Roxley. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# target_precompiled_header
#
# Sets a precompiled header for a given target
# Args:
# TARGET_NAME - Name of the target. Only valid after add_library or add_executable
# PRECOMPILED_HEADER - Header file to precompile
# PRECOMPILED_SOURCE - MSVC specific source to do the actual precompilation. Ignored on other platforms
#
macro(target_precompiled_header TARGET_NAME PRECOMPILED_HEADER PRECOMPILED_SOURCE)
get_filename_component(PRECOMPILED_HEADER_NAME ${PRECOMPILED_HEADER} NAME)
if(MSVC)
get_filename_component(PRECOMPILED_SOURCE_NAME ${PRECOMPILED_SOURCE} NAME)
get_filename_component(PRECOMPILED_HEADER_PATH ${PRECOMPILED_HEADER} DIRECTORY)
target_include_directories(${TARGET_NAME} PRIVATE ${PRECOMPILED_HEADER_PATH}) # fixes occasional IntelliSense glitches
get_filename_component(PRECOMPILED_HEADER_WE ${PRECOMPILED_HEADER} NAME_WE)
if(GEN_IS_MULTI_CONFIG)
set(PRECOMPILED_BINARY "$(IntDir)/${PRECOMPILED_HEADER_WE}.pch")
else()
set(PRECOMPILED_BINARY "${CMAKE_CURRENT_BINARY_DIR}/${PRECOMPILED_HEADER_WE}.pch")
endif()
set_source_files_properties(${PRECOMPILED_SOURCE} PROPERTIES
COMPILE_OPTIONS "/Yc${PRECOMPILED_HEADER_NAME};/Fp${PRECOMPILED_BINARY}"
OBJECT_OUTPUTS "${PRECOMPILED_BINARY}")
get_target_property(TARGET_SOURCES ${TARGET_NAME} SOURCES)
foreach(src ${TARGET_SOURCES})
if(${src} MATCHES \\.\(cpp|cxx|cc\)$)
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${src}" PROPERTIES
COMPILE_OPTIONS "/Yu${PRECOMPILED_HEADER_NAME};/FI${PRECOMPILED_HEADER_NAME};/Fp${PRECOMPILED_BINARY}"
OBJECT_DEPENDS "${PRECOMPILED_BINARY}"
)
endif()
endforeach()
#set_target_properties(${TARGET_NAME} PROPERTIES
# COMPILE_OPTIONS "/Yu${PRECOMPILED_HEADER_NAME};/FI${PRECOMPILED_HEADER_NAME};/Fp${PRECOMPILED_BINARY}")
target_sources(${TARGET_NAME} PRIVATE ${PRECOMPILED_SOURCE} ${PRECOMPILED_HEADER})
elseif(CMAKE_GENERATOR STREQUAL Xcode)
set_target_properties(
${TARGET_NAME}
PROPERTIES
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${PRECOMPILED_HEADER}"
XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES"
)
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Create and set output directory.
set(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${PRECOMPILED_HEADER_NAME}.gch")
make_directory(${OUTPUT_DIR})
set(OUTPUT_NAME "${OUTPUT_DIR}/${PRECOMPILED_HEADER_NAME}.gch")
# Export compiler flags via a generator to a response file
set(PCH_FLAGS_FILE "${OUTPUT_DIR}/${PRECOMPILED_HEADER_NAME}.rsp")
set(_include_directories "$<TARGET_PROPERTY:${TARGET_NAME},INCLUDE_DIRECTORIES>")
set(_compile_definitions "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_DEFINITIONS>")
set(_compile_flags "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_FLAGS>")
set(_compile_options "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_OPTIONS>")
set(_include_directories "$<$<BOOL:${_include_directories}>:-I$<JOIN:${_include_directories},\n-I>\n>")
set(_compile_definitions "$<$<BOOL:${_compile_definitions}>:-D$<JOIN:${_compile_definitions},\n-D>\n>")
set(_compile_flags "$<$<BOOL:${_compile_flags}>:$<JOIN:${_compile_flags},\n>\n>")
set(_compile_options "$<$<BOOL:${_compile_options}>:$<JOIN:${_compile_options},\n>\n>")
file(GENERATE OUTPUT "${PCH_FLAGS_FILE}" CONTENT "${_compile_definitions}${_include_directories}${_compile_flags}${_compile_options}\n")
# Gather global compiler options, definitions, etc.
string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" CXX_FLAGS)
set(COMPILER_FLAGS "${${CXX_FLAGS}} ${CMAKE_CXX_FLAGS}")
separate_arguments(COMPILER_FLAGS)
# Add a custom target for building the precompiled header.
add_custom_command(
OUTPUT ${OUTPUT_NAME}
COMMAND ${CMAKE_CXX_COMPILER} @${PCH_FLAGS_FILE} ${COMPILER_FLAGS} -x c++-header -o ${OUTPUT_NAME} ${PRECOMPILED_HEADER}
DEPENDS ${PRECOMPILED_HEADER})
add_custom_target(${TARGET_NAME}_gch DEPENDS ${OUTPUT_NAME})
add_dependencies(${TARGET_NAME} ${TARGET_NAME}_gch)
# set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_FLAGS "-include ${PRECOMPILED_HEADER_NAME} -Winvalid-pch")
get_target_property(SOURCE_FILES ${TARGET_NAME} SOURCES)
get_target_property(asdf ${TARGET_NAME} COMPILE_FLAGS)
foreach(SOURCE_FILE ${SOURCE_FILES})
if(SOURCE_FILE MATCHES \\.\(c|cc|cxx|cpp\)$)
set_source_files_properties(${SOURCE_FILE} PROPERTIES
COMPILE_FLAGS "-include ${OUTPUT_DIR}/${PRECOMPILED_HEADER_NAME} -Winvalid-pch"
)
endif()
endforeach()
else()
message(FATAL_ERROR "Unknown generator for target_precompiled_header. [${CMAKE_CXX_COMPILER_ID}]")
endif()
endmacro(target_precompiled_header)

View File

@@ -1,26 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
include(FindGoogleBreakpad)
else (STANDALONE)
use_prebuilt_binary(google_breakpad)
if (DARWIN)
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
endif (DARWIN)
if (LINUX)
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client)
endif (LINUX)
if (WINDOWS)
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client crash_generation_server common)
endif (WINDOWS)
# yes, this does look dumb, no, it's not incorrect
# I think it's incorrect: the second one should go --Aleric
set(BREAKPAD_INCLUDE_DIRECTORIES
${LIBS_PREBUILT_DIR}/include/google_breakpad
${LIBS_PREBUILT_LEGACY_DIR}/include/google_breakpad
${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad
${LIBS_PREBUILT_LEGACY_DIR}/include/google_breakpad/google_breakpad
)
endif (STANDALONE)

View File

@@ -2,16 +2,16 @@
include(Prebuilt)
if(WORD_SIZE EQUAL 64)
if(ADDRESS_SIZE EQUAL 64)
set(DISABLE_TCMALLOC TRUE)
endif(WORD_SIZE EQUAL 64)
endif(ADDRESS_SIZE EQUAL 64)
if (STANDALONE)
include(FindGooglePerfTools)
else (STANDALONE)
if (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64)
if (LINUX OR WINDOWS AND NOT ADDRESS_SIZE EQUAL 64)
use_prebuilt_binary(gperftools)
endif (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64)
endif (LINUX OR WINDOWS AND NOT ADDRESS_SIZE EQUAL 64)
if (WINDOWS AND NOT DISABLE_TCMALLOC)
set(TCMALLOC_LIBRARIES libtcmalloc_minimal.lib)
set(TCMALLOC_LINKER_FLAGS "/INCLUDE:\"__tcmalloc\"")

View File

@@ -1,741 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
InstallRequiredSystemLibraries
------------------------------
Include this module to search for compiler-provided system runtime
libraries and add install rules for them. Some optional variables
may be set prior to including the module to adjust behavior:
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS``
Specify additional runtime libraries that may not be detected.
After inclusion any detected libraries will be appended to this.
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP``
Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to
allow the includer to specify its own install rule, using the value of
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries.
``CMAKE_INSTALL_DEBUG_LIBRARIES``
Set to TRUE to install the debug runtime libraries when available
with MSVC tools.
``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY``
Set to TRUE to install only the debug runtime libraries with MSVC
tools even if the release runtime libraries are also available.
``CMAKE_INSTALL_UCRT_LIBRARIES``
Set to TRUE to install the Windows Universal CRT libraries for
app-local deployment (e.g. to Windows XP). This is meaningful
only with MSVC from Visual Studio 2015 or higher.
One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
to an absolute path to tell CMake to look for Windows 10 SDKs in
a custom location. The specified directory is expected to contain
``Redist/ucrt/DLLs/*`` directories.
``CMAKE_INSTALL_MFC_LIBRARIES``
Set to TRUE to install the MSVC MFC runtime libraries.
``CMAKE_INSTALL_OPENMP_LIBRARIES``
Set to TRUE to install the MSVC OpenMP runtime libraries
``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
option. If not specified, the default is ``bin`` on Windows
and ``lib`` elsewhere.
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
Set to TRUE to disable warnings about required library files that
do not exist. (For example, Visual Studio Express editions may
not provide the redistributable files.)
``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
option. If not specified, no such option will be used.
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
set(_IRSL_HAVE_Intel FALSE)
set(_IRSL_HAVE_MSVC FALSE)
foreach(LANG IN ITEMS C CXX Fortran)
if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel")
if(NOT _IRSL_HAVE_Intel)
get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_Intel_archdir intel64)
else()
set(_Intel_archdir x86)
endif()
set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
if(WIN32)
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE)
elseif(APPLE)
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE)
else()
if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}_lin")
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE)
else()
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE)
endif()
endif()
set(_IRSL_HAVE_Intel TRUE)
endif()
elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
set(_IRSL_HAVE_MSVC TRUE)
endif()
endforeach()
if(MSVC)
file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
if(CMAKE_CL_64)
if(MSVC_VERSION GREATER 1599)
# VS 10 and later:
set(CMAKE_MSVC_ARCH x64)
else()
# VS 9 and earlier:
set(CMAKE_MSVC_ARCH amd64)
endif()
else()
set(CMAKE_MSVC_ARCH x86)
endif()
get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
if(MSVC_VERSION EQUAL 1300)
set(__install__libs
"${SYSTEMROOT}/system32/msvcp70.dll"
"${SYSTEMROOT}/system32/msvcr70.dll"
)
endif()
if(MSVC_VERSION EQUAL 1310)
set(__install__libs
"${SYSTEMROOT}/system32/msvcp71.dll"
"${SYSTEMROOT}/system32/msvcr71.dll"
)
endif()
if(MSVC_TOOLSET_VERSION EQUAL 80)
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}")
set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry
endif()
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
PATHS
"${msvc_install_dir}/../../VC/redist"
"${base_dir}/VC/redist"
)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
"${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest"
"${MSVC_CRT_DIR}/msvcm80.dll"
"${MSVC_CRT_DIR}/msvcp80.dll"
"${MSVC_CRT_DIR}/msvcr80.dll"
)
else()
set(__install__libs)
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
"${MSVC_CRT_DIR}/msvcm80d.dll"
"${MSVC_CRT_DIR}/msvcp80d.dll"
"${MSVC_CRT_DIR}/msvcr80d.dll"
)
endif()
endif()
if(MSVC_TOOLSET_VERSION EQUAL 90)
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
get_filename_component(msvc_express_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}")
set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry
endif()
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
PATHS
"${msvc_install_dir}/../../VC/redist"
"${msvc_express_install_dir}/../../VC/redist"
"${base_dir}/VC/redist"
)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
"${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest"
"${MSVC_CRT_DIR}/msvcm90.dll"
"${MSVC_CRT_DIR}/msvcp90.dll"
"${MSVC_CRT_DIR}/msvcr90.dll"
)
else()
set(__install__libs)
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
"${MSVC_CRT_DIR}/msvcm90d.dll"
"${MSVC_CRT_DIR}/msvcp90d.dll"
"${MSVC_CRT_DIR}/msvcr90d.dll"
)
endif()
endif()
set(MSVC_REDIST_NAME "")
set(_MSVC_DLL_VERSION "")
set(_MSVC_IDE_VERSION "")
if(MSVC_VERSION GREATER_EQUAL 2000)
message(WARNING "MSVC ${MSVC_VERSION} not yet supported.")
elseif(MSVC_VERSION_VERSION GREATER_EQUAL 143)
message(WARNING "MSVC toolset v${MSVC_VERSION_VERSION} not yet supported.")
elseif(MSVC_TOOLSET_VERSION EQUAL 142)
set(MSVC_REDIST_NAME VC142)
set(_MSVC_DLL_VERSION 140)
set(_MSVC_IDE_VERSION 16)
if(MSVC_VERSION EQUAL 1920)
# VS2019 named this differently prior to update 1.
set(MSVC_REDIST_NAME VC141)
endif()
elseif(MSVC_TOOLSET_VERSION EQUAL 141)
set(MSVC_REDIST_NAME VC141)
set(_MSVC_DLL_VERSION 140)
set(_MSVC_IDE_VERSION 15)
if(MSVC_VERSION EQUAL 1910)
# VS2017 named this differently prior to update 3.
set(MSVC_REDIST_NAME VC150)
endif()
elseif(MSVC_TOOLSET_VERSION)
set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION})
math(EXPR _MSVC_DLL_VERSION "${MSVC_TOOLSET_VERSION} / 10 * 10")
math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10")
endif()
set(_MSVCRT_DLL_VERSION "")
set(_MSVCRT_IDE_VERSION "")
if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
set(_MSVCRT_DLL_VERSION "${_MSVC_DLL_VERSION}")
set(_MSVCRT_IDE_VERSION "${_MSVC_IDE_VERSION}")
endif()
if(_MSVCRT_DLL_VERSION)
set(v "${_MSVCRT_DLL_VERSION}")
set(vs "${_MSVCRT_IDE_VERSION}")
# Find the runtime library redistribution directory.
if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
endif()
if(NOT vs VERSION_LESS 15)
set(_vs_redist_paths "")
cmake_host_system_information(RESULT _vs_dir QUERY VS_${vs}_DIR) # undocumented query
if(IS_DIRECTORY "${_vs_dir}")
file(GLOB _vs_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
endif()
unset(_vs_dir)
else()
get_filename_component(_vs_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
set(programfilesx86 "ProgramFiles(x86)")
set(_vs_redist_paths
"${_vs_dir}/../../VC/redist"
"${base_dir}/VC/redist"
"$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
"$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
)
unset(_vs_dir)
unset(programfilesx86)
endif()
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
unset(_vs_redist_paths)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
"${MSVC_CRT_DIR}/msvcp${v}.dll"
)
if(NOT vs VERSION_LESS 14)
file(GLOB __msvcr_dlls "${MSVC_CRT_DIR}/*.dll")
list(APPEND __install__libs ${__msvcr_dlls})
else()
list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll")
endif()
else()
set(__install__libs)
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/msvcp${v}d.dll"
)
if(NOT vs VERSION_LESS 14)
list(APPEND __install__libs
"${MSVC_CRT_DIR}/vcruntime${v}d.dll"
"${MSVC_CRT_DIR}/concrt${v}d.dll"
)
else()
list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll")
endif()
endif()
if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14)
# Find the Windows Kits directory.
get_filename_component(windows_kits_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
set(programfilesx86 "ProgramFiles(x86)")
if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=])
set(__ucrt_version "${CMAKE_MATCH_1}/")
else()
set(__ucrt_version "")
endif()
find_path(WINDOWS_KITS_DIR
NAMES
Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
PATHS
$ENV{CMAKE_WINDOWS_KITS_10_DIR}
"${windows_kits_dir}"
"$ENV{ProgramFiles}/Windows Kits/10"
"$ENV{${programfilesx86}}/Windows Kits/10"
)
mark_as_advanced(WINDOWS_KITS_DIR)
# Glob the list of UCRT DLLs.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll")
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
else()
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
endif()
list(APPEND __install__libs ${__ucrt_dlls})
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll")
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll")
else()
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
endif()
list(APPEND __install__libs ${__ucrt_dlls})
endif()
endif()
endif()
if(CMAKE_INSTALL_MFC_LIBRARIES)
if(MSVC_VERSION EQUAL 1300)
set(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc70.dll"
)
endif()
if(MSVC_VERSION EQUAL 1310)
set(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc71.dll"
)
endif()
if(MSVC_VERSION EQUAL 1400)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
"${MSVC_MFC_DIR}/mfc80d.dll"
"${MSVC_MFC_DIR}/mfc80ud.dll"
"${MSVC_MFC_DIR}/mfcm80d.dll"
"${MSVC_MFC_DIR}/mfcm80ud.dll"
)
endif()
set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest"
"${MSVC_MFC_DIR}/mfc80.dll"
"${MSVC_MFC_DIR}/mfc80u.dll"
"${MSVC_MFC_DIR}/mfcm80.dll"
"${MSVC_MFC_DIR}/mfcm80u.dll"
)
endif()
# include the language dll's for vs8 as well as the actual dll's
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
"${MSVC_MFCLOC_DIR}/mfc80chs.dll"
"${MSVC_MFCLOC_DIR}/mfc80cht.dll"
"${MSVC_MFCLOC_DIR}/mfc80enu.dll"
"${MSVC_MFCLOC_DIR}/mfc80esp.dll"
"${MSVC_MFCLOC_DIR}/mfc80deu.dll"
"${MSVC_MFCLOC_DIR}/mfc80fra.dll"
"${MSVC_MFCLOC_DIR}/mfc80ita.dll"
"${MSVC_MFCLOC_DIR}/mfc80jpn.dll"
"${MSVC_MFCLOC_DIR}/mfc80kor.dll"
)
endif()
if(MSVC_VERSION EQUAL 1500)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
"${MSVC_MFC_DIR}/mfc90d.dll"
"${MSVC_MFC_DIR}/mfc90ud.dll"
"${MSVC_MFC_DIR}/mfcm90d.dll"
"${MSVC_MFC_DIR}/mfcm90ud.dll"
)
endif()
set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest"
"${MSVC_MFC_DIR}/mfc90.dll"
"${MSVC_MFC_DIR}/mfc90u.dll"
"${MSVC_MFC_DIR}/mfcm90.dll"
"${MSVC_MFC_DIR}/mfcm90u.dll"
)
endif()
# include the language dll's for vs9 as well as the actual dll's
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
"${MSVC_MFCLOC_DIR}/mfc90chs.dll"
"${MSVC_MFCLOC_DIR}/mfc90cht.dll"
"${MSVC_MFCLOC_DIR}/mfc90enu.dll"
"${MSVC_MFCLOC_DIR}/mfc90esp.dll"
"${MSVC_MFCLOC_DIR}/mfc90deu.dll"
"${MSVC_MFCLOC_DIR}/mfc90fra.dll"
"${MSVC_MFCLOC_DIR}/mfc90ita.dll"
"${MSVC_MFCLOC_DIR}/mfc90jpn.dll"
"${MSVC_MFCLOC_DIR}/mfc90kor.dll"
)
endif()
set(_MFC_DLL_VERSION "")
set(_MFC_IDE_VERSION "")
if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
set(_MFC_DLL_VERSION ${_MSVC_DLL_VERSION})
set(_MFC_IDE_VERSION ${_MSVC_IDE_VERSION})
endif()
if(_MFC_DLL_VERSION)
set(v "${_MFC_DLL_VERSION}")
set(vs "${_MFC_IDE_VERSION}")
# Starting with VS 15 the MFC DLLs may be in a different directory.
if (NOT vs VERSION_LESS 15)
file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
mark_as_advanced(MSVC_REDIST_MFC_DIR)
unset(_MSVC_REDIST_DIRS)
else()
set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}")
endif()
# Multi-Byte Character Set versions of MFC are available as optional
# addon since Visual Studio 12. So for version 12 or higher, check
# whether they are available and exclude them if they are not.
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
"${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}ud.dll"
"${MSVC_MFC_DIR}/mfcm${v}ud.dll"
)
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}d.dll"
)
endif()
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfcm${v}d.dll"
)
endif()
endif()
set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}u.dll"
"${MSVC_MFC_DIR}/mfcm${v}u.dll"
)
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}.dll"
)
endif()
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfcm${v}.dll"
)
endif()
endif()
# include the language dll's as well as the actual dll's
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}deu.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}enu.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}esn.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}fra.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}ita.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}kor.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}rus.dll"
)
endif()
endif()
# MSVC 8 was the first version with OpenMP
# Furthermore, there is no debug version of this
if(CMAKE_INSTALL_OPENMP_LIBRARIES AND _IRSL_HAVE_MSVC)
set(_MSOMP_DLL_VERSION ${_MSVC_DLL_VERSION})
set(_MSOMP_IDE_VERSION ${_MSVC_IDE_VERSION})
if(_MSOMP_DLL_VERSION)
set(v "${_MSOMP_DLL_VERSION}")
set(vs "${_MSOMP_IDE_VERSION}")
set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_OPENMP_DIR}/vcomp${v}.dll")
endif()
endif()
endif()
foreach(lib
${__install__libs}
)
if(EXISTS ${lib})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${lib}'")
# This warning indicates an incomplete Visual Studio installation
# or a bug somewhere above here in this file.
# If you would like to avoid this warning, fix the real problem, or
# set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
# this file.
endif()
endif()
endforeach()
endif()
if(_IRSL_HAVE_Intel)
unset(__install_libs)
if(CMAKE_INSTALL_OPENMP_LIBRARIES)
if(WIN32)
list(APPEND __install_libs "${_Intel_redistdir}/libiomp5md.dll" "${_Intel_redistdir}/libiompstubs5md.dll")
elseif(APPLE)
list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.dylib" "${_Intel_redistdir}/libiompstubs5.dylib")
else()
list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.so" "${_Intel_redistdir}/libiompstubs5.so")
if(_Intel_compiler_ver VERSION_LESS 17)
list(APPEND __install_libs "${_Intel_redistdir}/libomp_db.so")
endif()
if(_Intel_compiler_ver VERSION_LESS 13)
list(APPEND __install_libs "${_Intel_redistdir}/libiompprof5.so")
endif()
endif()
endif()
if(WIN32)
set(__install_dirs "${_Intel_redistdir}/1033")
if(EXISTS "${_Intel_redistdir}/1041")
list(APPEND __install_dirs "${_Intel_redistdir}/1041")
endif()
if(_Intel_compiler_ver VERSION_LESS 18)
list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c")
endif()
foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libioffload_host.dll libirngmd.dll
libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll")
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
elseif(APPLE)
foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
if(_Intel_compiler_ver VERSION_LESS 17)
list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib")
endif()
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
else()
foreach(__Intel_lib IN ITEMS libchkp.so libcilkrts.so libcilkrts.so.5 libimf.so libintlc.so libintlc.so.5 libirc.so libpdbx.so libpdbx.so.5 libsvml.so)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
if(_Intel_compiler_ver VERSION_GREATER_EQUAL 13)
foreach(__Intel_lib IN ITEMS libirng.so liboffload.so liboffload.so.5)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
set(__install_dirs "${_Intel_redistdir}/irml")
list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so")
if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15)
list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so" "${_Intel_redistdir}/libgfxoffload.so")
endif()
endif()
if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16)
foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
if(_Intel_compiler_ver VERSION_LESS 15)
foreach(__Intel_lib IN ITEMS libcxaguard.so libcxaguard.so.5)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
endif()
foreach(lib IN LISTS __install_libs)
if(EXISTS ${lib})
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${lib}'")
endif()
endif()
endforeach()
foreach(dir IN LISTS __install_dirs)
if(EXISTS ${dir})
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES ${dir})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${dir}'")
endif()
endif()
endforeach()
endif()
if(WATCOM)
get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
if(CMAKE_C_COMPILER_VERSION)
set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
else()
set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
endif()
string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
list(GET _watcom_version_list 0 _watcom_major)
list(GET _watcom_version_list 1 _watcom_minor)
set( __install__libs
${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
foreach(lib
${__install__libs}
)
if(EXISTS ${lib})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${lib}'")
# This warning indicates an incomplete Watcom installation
# or a bug somewhere above here in this file.
# If you would like to avoid this warning, fix the real problem, or
# set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
# this file.
endif()
endif()
endforeach()
endif()
# Include system runtime libraries in the installation if any are
# specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
if(WIN32)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
else()
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
endif()
endif()
if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
endif()
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
)
install(DIRECTORY ${CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES}
DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
)
endif()
endif()
cmake_policy(POP)

View File

@@ -7,6 +7,6 @@ set(LLAUDIO_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llaudio
)
add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
#add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES})

View File

@@ -10,7 +10,6 @@ if (DARWIN)
find_library(CORESERVICES_LIBRARY CoreServices)
endif (DARWIN)
set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/cwdebug
${LIBS_OPEN_DIR}/llcommon
@@ -19,14 +18,7 @@ set(LLCOMMON_INCLUDE_DIRS
${Boost_INCLUDE_DIRS}
)
if (LINUX)
# In order to support using ld.gold on linux, we need to explicitely
# specify all libraries that llcommon uses.
# llcommon uses `clock_gettime' which is provided by librt on linux.
set(LLCOMMON_LIBRARIES llcommon rt)
else (LINUX)
set(LLCOMMON_LIBRARIES llcommon)
endif (LINUX)
set(LLCOMMON_LIBRARIES llcommon)
set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a shared library.")
if(LLCOMMON_LINK_SHARED)

View File

@@ -5,10 +5,4 @@ set(LLPLUGIN_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llplugin
)
if (LINUX)
# In order to support using ld.gold on linux, we need to explicitely
# specify all libraries that llplugin uses.
set(LLPLUGIN_LIBRARIES llplugin pthread)
else (LINUX)
set(LLPLUGIN_LIBRARIES llplugin)
endif (LINUX)
set(LLPLUGIN_LIBRARIES llplugin)

View File

@@ -27,15 +27,15 @@ endif (WINDOWS)
# windows) and CMAKE_BUILD_TYPE on Makefile based generators (like linux). The reason for this is
# that CMAKE_BUILD_TYPE is essentially meaningless at configuration time for IDE generators and
# CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators
if(WINDOWS OR DARWIN)
if(GEN_IS_MULTI_CONFIG)
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
# fortunately both windows and darwin are case insensitive filesystems so this works.
set(AUTOBUILD_LIBS_INSTALL_DIRS "${AUTOBUILD_INSTALL_DIR}/lib/")
else(WINDOWS OR DARWIN)
else()
# else block is for linux and any other makefile based generators
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER})
endif(WINDOWS OR DARWIN)
endif()
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
# When we're building something other than Release, append the
@@ -48,10 +48,14 @@ link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
if (LINUX)
set(DL_LIBRARY dl)
set(RT_LIBRARY rt)
set(PTHREAD_LIBRARY pthread)
set(FMT_LIBRARY "")
else (LINUX)
set(DL_LIBRARY "")
set(RT_LIBRARY "")
set(PTHREAD_LIBRARY "")
set(FMT_LIBRARY fmt::fmt)
endif (LINUX)
if (WINDOWS)
@@ -73,6 +77,6 @@ else (WINDOWS)
set(WINDOWS_LIBRARIES "")
endif (WINDOWS)
mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES)
mark_as_advanced(DL_LIBRARY RT_LIBRARY PTHREAD_LIBRARY FMT_LIBRARY WINDOWS_LIBRARIES)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@@ -2,18 +2,18 @@
include(Prebuilt)
include(Variables)
if (NVAPI)
if (USE_NVAPI)
if (WINDOWS)
use_prebuilt_binary(nvapi)
if (WORD_SIZE EQUAL 32)
if (ADDRESS_SIZE EQUAL 32)
set(NVAPI_LIBRARY nvapi)
elseif (WORD_SIZE EQUAL 64)
elseif (ADDRESS_SIZE EQUAL 64)
set(NVAPI_LIBRARY nvapi64)
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
else (WINDOWS)
set(NVAPI_LIBRARY "")
endif (WINDOWS)
else (NVAPI)
else (USE_NVAPI)
set(NVAPI_LIBRARY "")
endif (NVAPI)
endif (USE_NVAPI)

View File

@@ -2,7 +2,6 @@
include(Linking)
include(Prebuilt)
if(NOT FMOD)
if (LINUX)
set(OPENAL ON CACHE BOOL "Enable OpenAL")
else (LINUX)
@@ -10,6 +9,7 @@ else (LINUX)
endif (LINUX)
if (OPENAL)
set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL")
if (STANDALONE)
include(FindPkgConfig)
include(FindOpenAL)
@@ -18,15 +18,16 @@ if (OPENAL)
else (STANDALONE)
use_prebuilt_binary(openal)
endif (STANDALONE)
if(WINDOWS)
set(OPENAL_LIBRARIES
openal
OpenAL32
alut
)
set(OPENAL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (OPENAL)
if (OPENAL)
else()
set(OPENAL_LIBRARIES
openal
alut
)
endif()
message(STATUS "Building with OpenAL audio support")
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL")
endif (OPENAL)
endif(NOT FMOD)

View File

@@ -1,11 +1,9 @@
# -*- cmake -*-
include(Prebuilt)
include(FreeType)
if (STANDALONE)
if (LINUX)
include(FindPkgConfig)
if (LINUX)
set(PKGCONFIG_PACKAGES
atk
cairo
@@ -21,8 +19,8 @@ if (STANDALONE)
pangox
pangoxft
sdl
x11
)
endif (LINUX)
foreach(pkg ${PKGCONFIG_PACKAGES})
pkg_check_modules(${pkg} REQUIRED ${pkg})
@@ -31,39 +29,6 @@ if (STANDALONE)
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
else (STANDALONE)
if (LINUX)
use_prebuilt_binary(gtk-atk-pango-glib)
set(UI_LIBRARIES
atk-1.0
cairo
gdk-x11-2.0
gdk_pixbuf-2.0
Xinerama
glib-2.0
gio-2.0
gmodule-2.0
gobject-2.0
gthread-2.0
gtk-x11-2.0
pango-1.0
pangoft2-1.0
pangoxft-1.0
pangocairo-1.0
pixman-1
X11
${FREETYPE_LIBRARIES}
)
endif (LINUX)
include_directories (
${LIBS_PREBUILT_DIR}/include
)
foreach(include ${${LL_ARCH}_INCLUDES})
include_directories(${LIBS_PREBUILT_DIR}/include/${include})
endforeach(include)
endif (STANDALONE)
if (LINUX)
add_definitions(-DLL_GTK=1 -DLL_X11=1)
endif (LINUX)

View File

@@ -17,24 +17,59 @@ if(NOT DEFINED COMMON_CMAKE_DIR)
set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake")
endif(NOT DEFINED COMMON_CMAKE_DIR)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
option(GEN_IS_MULTI_CONFIG "" ${_isMultiConfig})
mark_as_advanced(GEN_IS_MULTI_CONFIG)
set(LIBS_CLOSED_PREFIX)
set(LIBS_OPEN_PREFIX)
set(SCRIPTS_PREFIX ../scripts)
set(VIEWER_PREFIX)
set(INTEGRATION_TESTS_PREFIX)
option(LL_TESTS "Build and run unit and integration tests (disable for build timing runs to reduce variation" OFF)
option(LL_TESTS "Build and run unit and integration tests (disable for build timing runs to reduce variation" OFF)
option(BUILD_TESTING "Build test suite" OFF)
option(UNATTENDED "Disable use of uneeded tooling for automated builds" OFF)
# Compiler and toolchain options
option(USESYSTEMLIBS "Use libraries from your system rather than Linden-supplied prebuilt libraries." OFF)
option(STANDALONE "Use libraries from your system rather than Linden-supplied prebuilt libraries." OFF)
if (USESYSTEMLIBS)
set(STANDALONE ON)
elseif (STANDALONE)
set(USESYSTEMLIBS ON)
endif (USESYSTEMLIBS)
option(INCREMENTAL_LINK "Use incremental linking on win32 builds (enable for faster links on some machines)" OFF)
option(USE_PRECOMPILED_HEADERS "Enable use of precompiled header directives where supported." ON)
option(USE_LTO "Enable Whole Program Optimization and related folding and binary reduction routines" OFF)
option(UNATTENDED "Disable use of uneeded tooling for automated builds" OFF)
option(USE_LTO "Enable global and interprocedural optimizations" OFF)
# Configure crash reporting
option(USE_CRASHPAD "Build support for crashpad reporting engine" OFF)
if (DEFINED ENV{VIEWER_USE_CRASHPAD})
set(USE_CRASHPAD $ENV{VIEWER_USE_CRASHPAD})
endif()
if (DEFINED ENV{VIEWER_CRASHPAD_URL})
set(CRASHPAD_URL $ENV{VIEWER_CRASHPAD_URL} CACHE STRING "Viewer Channel Base Name")
else()
set(CRASHPAD_URL "" CACHE STRING "Crashpad endpoint url")
endif()
set(VIEWER_SYMBOL_FILE "" CACHE STRING "Name of tarball into which to place symbol files")
# Media Plugins
option(ENABLE_MEDIA_PLUGINS "Turn off building media plugins if they are imported by third-party library mechanism" ON)
option(LIBVLCPLUGIN "Turn off building support for libvlc plugin" ON)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LIBVLCPLUGIN OFF)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -44,13 +79,11 @@ set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
# Audio Engines
option(FMODSTUDIO "Build with support for the FMOD Studio audio engine" ON)
# Window implementation
option(LLWINDOW_SDL2 "Use SDL2 for window and input handling" OFF)
option(USE_FMODSTUDIO "Build with support for the FMOD Studio audio engine" OFF)
# Proprietary Library Features
option(NVAPI "Use nvapi driver interface library" OFF)
option(USE_NVAPI "Use nvapi driver interface library" OFF)
if(LIBS_CLOSED_DIR)
file(TO_CMAKE_PATH "${LIBS_CLOSED_DIR}" LIBS_CLOSED_DIR)
@@ -77,7 +110,7 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py")
set(TEMPLATE_VERIFIER_MASTER_URL "https://forge.alchemyviewer.org/alchemy/tools/Master-Message-Template/raw/master/message_template.msg" CACHE STRING "Location of the master message template")
set(TEMPLATE_VERIFIER_MASTER_URL "https://git.alchemyviewer.org/alchemy/master-message-template/raw/master/message_template.msg" CACHE STRING "Location of the master message template")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
@@ -86,7 +119,6 @@ endif (NOT CMAKE_BUILD_TYPE)
# If someone has specified an address size, use that to determine the
# architecture. Otherwise, let the architecture specify the address size.
set(ADDRESS_SIZE ${WORD_SIZE})
if (ADDRESS_SIZE EQUAL 32)
#message(STATUS "ADDRESS_SIZE is 32")
set(ARCH i686)
@@ -94,34 +126,32 @@ elseif (ADDRESS_SIZE EQUAL 64)
#message(STATUS "ADDRESS_SIZE is 64")
set(ARCH x86_64)
else (ADDRESS_SIZE EQUAL 32)
#message(STATUS "ADDRESS_SIZE is UNRECOGNIZED: '${ADDRESS_SIZE}'")
# Use Python's platform.machine() since uname -m isn't available everywhere.
# Even if you can assume cygwin uname -m, the answer depends on whether
# you're running 32-bit cygwin or 64-bit cygwin! But even 32-bit Python will
# report a 64-bit processor.
execute_process(COMMAND
"${Python2_EXECUTABLE}" "-c"
"import platform; print platform.machine()"
OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
# We expect values of the form i386, i686, x86_64, AMD64.
# In CMake, expressing ARCH.endswith('64') is awkward:
string(LENGTH "${ARCH}" ARCH_LENGTH)
math(EXPR ARCH_LEN_2 "${ARCH_LENGTH} - 2")
string(SUBSTRING "${ARCH}" ${ARCH_LEN_2} 2 ARCH_LAST_2)
if (ARCH_LAST_2 STREQUAL 64)
#message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}")
set(ADDRESS_SIZE 64)
else()
#message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}")
set(ADDRESS_SIZE 32)
endif ()
#message(STATUS "ADDRESS_SIZE is UNDEFINED")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Size of void pointer is detected as 8; ARCH is 64-bit")
set(ARCH x86_64)
set(ADDRESS_SIZE 64)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
message(STATUS "Size of void pointer is detected as 4; ARCH is 32-bit")
set(ADDRESS_SIZE 32)
set(ARCH i686)
else()
message(FATAL_ERROR "Unkown Architecture!")
endif()
endif (ADDRESS_SIZE EQUAL 32)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(WINDOWS ON BOOL FORCE)
if (ADDRESS_SIZE EQUAL 64)
set(LL_ARCH ${ARCH}_win64)
set(LL_ARCH_DIR ${ARCH}-win64)
elseif (ADDRESS_SIZE EQUAL 32)
set(LL_ARCH ${ARCH}_win32)
set(LL_ARCH_DIR ${ARCH}-win32)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
else()
message(FATAL_ERROR "Unkown Architecture!")
endif ()
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON BOOL FORCE)
@@ -152,7 +182,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
set(DARWIN ON BOOL FORCE)
# Architecture
set(CMAKE_OSX_SYSROOT macosx10.14)
@@ -192,57 +222,60 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LL_ARCH_DIR universal-darwin)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Platform specific
if (WINDOWS)
option(LLWINDOW_SDL2 "Use SDL2 for window and input handling. Windows only" OFF)
endif()
# Default deploy grid
set(GRID agni CACHE STRING "Target Grid")
set(VIEWER_PRODUCT_NAME "Singularity" CACHE STRING "Viewer Base Name")
string(TOLOWER ${VIEWER_PRODUCT_NAME} VIEWER_PRODUCT_NAME_LOWER)
if (DEFINED ENV{VIEWER_CHANNEL_BASE})
set(VIEWER_CHANNEL_BASE $ENV{VIEWER_CHANNEL_BASE} CACHE STRING "Viewer Channel Base Name" FORCE)
else()
set(VIEWER_CHANNEL_BASE "Singularity" CACHE STRING "Viewer Channel Base Name")
endif()
if (DEFINED ENV{VIEWER_CHANNEL_TYPE})
set(VIEWER_CHANNEL_TYPE $ENV{VIEWER_CHANNEL_TYPE} CACHE STRING "Viewer Channel Type Name" FORCE)
else()
set(VIEWER_CHANNEL_TYPE "Test" CACHE STRING "Viewer Channel Type Name")
endif()
if (DEFINED ENV{VIEWER_CHANNEL_CODENAME})
set(VIEWER_CHANNEL_CODENAME $ENV{VIEWER_CHANNEL_CODENAME} CACHE STRING "Viewer Channel Code Name for Project type" FORCE)
else()
set(VIEWER_CHANNEL_CODENAME "Default" CACHE STRING "Viewer Channel Code Name for Project type")
endif()
if("${VIEWER_CHANNEL_TYPE}" STREQUAL "Project")
set(VIEWER_CHANNEL "${VIEWER_CHANNEL_BASE} ${VIEWER_CHANNEL_TYPE} ${VIEWER_CHANNEL_CODENAME}")
else()
set(VIEWER_CHANNEL "${VIEWER_CHANNEL_BASE} ${VIEWER_CHANNEL_TYPE}")
endif()
string(TOLOWER "${VIEWER_CHANNEL_BASE}" VIEWER_BRANDING_ID)
string(REPLACE " " "-" VIEWER_BRANDING_ID ${VIEWER_BRANDING_ID})
set(VIEWER_BINARY_NAME "${VIEWER_BRANDING_ID}-bin" CACHE STRING
"The name of the viewer executable to create.")
set(VIEWER_CHANNEL_BASE "Test" CACHE STRING "Viewer Channel Name")
set(VIEWER_CHANNEL "${VIEWER_PRODUCT_NAME} ${VIEWER_CHANNEL_BASE}")
string(TOLOWER ${VIEWER_CHANNEL} VIEWER_CHANNEL_LOWER)
string(REPLACE " " "" VIEWER_CHANNEL_ONEWORD ${VIEWER_CHANNEL})
set(VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL_ONEWORD} CACHE STRING "Prefix used for resulting artifacts.")
option(VIEWER_CHANNEL_GRK "Greek character(s) to represent the viewer channel for support purposes, override only for special branches" "")
if (NOT VIEWER_CHANNEL_GRK)
if (VIEWER_CHANNEL_BASE MATCHES "Test")
set(VIEWER_CHANNEL_GRK "\\u03C4") # "τ"
elseif (VIEWER_CHANNEL_BASE MATCHES "Alpha")
set(VIEWER_CHANNEL_GRK "\\u03B1") # "α"
elseif (VIEWER_CHANNEL_BASE MATCHES "Beta")
set(VIEWER_CHANNEL_GRK "\\u03B2") # "β"
endif ()
if (VIEWER_CHANNEL_TYPE MATCHES "Test")
set(VIEWER_CHANNEL_GRK "\\u03C4") # "τ"
elseif (VIEWER_CHANNEL_TYPE MATCHES "Alpha")
set(VIEWER_CHANNEL_GRK "\\u03B1") # "α"
elseif (VIEWER_CHANNEL_TYPE MATCHES "Beta")
set(VIEWER_CHANNEL_GRK "\\u03B2") # "β"
endif ()
endif (NOT VIEWER_CHANNEL_GRK)
if(VIEWER_CHANNEL_LOWER MATCHES "^${VIEWER_PRODUCT_NAME_LOWER} release")
set(VIEWER_PACKAGE_ID "${VIEWER_PRODUCT_NAME}Release")
set(VIEWER_EXE_STRING "${VIEWER_PRODUCT_NAME}Viewer")
set(VIEWER_SHORTCUT_STRING "${VIEWER_PRODUCT_NAME} Viewer")
else()
set(VIEWER_PACKAGE_ID ${VIEWER_CHANNEL_ONEWORD})
set(VIEWER_EXE_STRING ${VIEWER_CHANNEL_ONEWORD})
set(VIEWER_SHORTCUT_STRING ${VIEWER_CHANNEL})
endif()
set(VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL_ONEWORD} CACHE STRING "Prefix used for resulting artifacts.")
set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id")
option(ENABLE_SIGNING "Enable signing the viewer" OFF)
set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")
set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
# Compiler and toolchain options
option(USESYSTEMLIBS "Use libraries from your system rather than Linden-supplied prebuilt libraries." OFF)
option(STANDALONE "Use libraries from your system rather than Linden-supplied prebuilt libraries." OFF)
if (USESYSTEMLIBS)
set(STANDALONE ON)
elseif (STANDALONE)
set(USESYSTEMLIBS ON)
endif (USESYSTEMLIBS)
source_group("CMake Rules" FILES CMakeLists.txt)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@@ -3,9 +3,6 @@ include(Prebuilt)
if (NOT STANDALONE)
use_prebuilt_binary(slvoice)
if(LINUX)
use_prebuilt_binary(fontconfig)
endif(LINUX)
else (NOT STANDALONE)
# Download there even when using standalone.
set(STANDALONE OFF)
@@ -16,4 +13,9 @@ else (NOT STANDALONE)
set(STANDALONE ON)
endif(NOT STANDALONE)
if(LINUX)
include(FindPkgConfig)
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
endif(LINUX)
use_prebuilt_binary(fonts)

62
indra/deps/CMakeLists.txt Normal file
View File

@@ -0,0 +1,62 @@
project(deps)
include(FetchContent)
set(CMAKE_FOLDER "Third Party")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.11.0
)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 6.1.2
)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.7.3
)
FetchContent_Declare(
absl
GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
GIT_TAG 0033c9ea91a52ade7c6b725aa2ef3cbe15463421
)
# This is a hack because absl has dumb cmake
set(OLD_BUILD_TEST ${BUILD_TESTING})
set(BUILD_TESTING OFF)
FetchContent_MakeAvailable(absl)
set(BUILD_TESTING ${OLD_BUILD_TEST})
# Supress warnings inside abseil under MSVC
if(WINDOWS)
target_compile_options(absl_strings PRIVATE /wd4018)
target_compile_options(absl_str_format_internal PRIVATE /wd4018)
target_compile_options(absl_flags_usage_internal PRIVATE /wd4018)
endif()
if (BUILD_TESTING)
FetchContent_MakeAvailable(Catch2)
endif()
#Download the rest of the libraries
if(WINDOWS)
FetchContent_MakeAvailable(fmt)
endif()
# Typically you don't care so much for a third party library's tests to be
# run from your own project's code.
set(JSON_BuildTests OFF CACHE INTERNAL "")
# If you only include this third party in PRIVATE source files, you do not
# need to install it when your main project gets installed.
set(JSON_Install OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(nlohmann_json)
unset(CMAKE_FOLDER)
unset(CMAKE_POSITION_INDEPENDENT_CODE)

View File

@@ -1565,6 +1565,21 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
param_name[1] = 1072; //"tattoo_green";
param_name[2] = 1073; //"tattoo_blue";
break;
case TEX_HEAD_UNIVERSAL_TATTOO:
case TEX_UPPER_UNIVERSAL_TATTOO:
case TEX_LOWER_UNIVERSAL_TATTOO:
case TEX_SKIRT_TATTOO:
case TEX_HAIR_TATTOO:
case TEX_EYES_TATTOO:
case TEX_LEFT_ARM_TATTOO:
case TEX_LEFT_LEG_TATTOO:
case TEX_AUX1_TATTOO:
case TEX_AUX2_TATTOO:
case TEX_AUX3_TATTOO:
param_name[0] = 1238; //"tattoo_universal_red";
param_name[1] = 1239; //"tattoo_universal_green";
param_name[2] = 1240; //"tattoo_universal_blue";
break;
default:
llassert(0);

View File

@@ -27,8 +27,11 @@
#include "linden_common.h"
#include "llavatarappearancedefines.h"
const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 512;
const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 512;
#include "indra_constants.h"
#include <utility>
const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 1024;
const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 1024;
const S32 LLAvatarAppearanceDefines::IMPOSTOR_PERIOD = 2;
using namespace LLAvatarAppearanceDefines;
@@ -65,12 +68,30 @@ LLAvatarAppearanceDictionary::Textures::Textures()
addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD, "head"));
addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER, "upper"));
addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER, "lower"));
addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES, "eyes"));
addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR, "hair"));
addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT, "skirt"));
addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", FALSE, BAKED_LEFT_ARM, "leftarm"));
addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", FALSE, BAKED_LEFT_LEG, "leftleg"));
addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", FALSE, BAKED_AUX1, "aux1"));
addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", FALSE, BAKED_AUX2, "aux2"));
addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", FALSE, BAKED_AUX3, "aux3"));
}
LLAvatarAppearanceDictionary::BakedTextures::BakedTextures()
@@ -78,35 +99,60 @@ LLAvatarAppearanceDictionary::BakedTextures::BakedTextures()
// Baked textures
addEntry(BAKED_HEAD, new BakedEntry(TEX_HEAD_BAKED,
"head", "a4b9dc38-e13b-4df9-b284-751efb0566ff",
3, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA,
5, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA));
4, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA, TEX_HEAD_UNIVERSAL_TATTOO,
6, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL));
addEntry(BAKED_UPPER, new BakedEntry(TEX_UPPER_BAKED,
"upper_body", "5943ff64-d26c-4a90-a8c0-d61f56bd98d4",
7, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET,
TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA,
8, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_SHIRT, LLWearableType::WT_JACKET, LLWearableType::WT_GLOVES, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA));
8, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET,
TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA, TEX_UPPER_UNIVERSAL_TATTOO,
9, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_SHIRT, LLWearableType::WT_JACKET, LLWearableType::WT_GLOVES, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL));
addEntry(BAKED_LOWER, new BakedEntry(TEX_LOWER_BAKED,
"lower_body", "2944ee70-90a7-425d-a5fb-d749c782ed7d",
8, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS,
TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA,
9, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_PANTS, LLWearableType::WT_SHOES, LLWearableType::WT_SOCKS, LLWearableType::WT_JACKET, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA));
9, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS,
TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA, TEX_LOWER_UNIVERSAL_TATTOO,
10, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_PANTS, LLWearableType::WT_SHOES, LLWearableType::WT_SOCKS, LLWearableType::WT_JACKET, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL));
addEntry(BAKED_EYES, new BakedEntry(TEX_EYES_BAKED,
"eyes", "27b1bc0f-979f-4b13-95fe-b981c2ba9788",
2, TEX_EYES_IRIS, TEX_EYES_ALPHA,
2, LLWearableType::WT_EYES, LLWearableType::WT_ALPHA));
3, TEX_EYES_IRIS, TEX_EYES_TATTOO, TEX_EYES_ALPHA,
3, LLWearableType::WT_EYES, LLWearableType::WT_UNIVERSAL, LLWearableType::WT_ALPHA));
addEntry(BAKED_SKIRT, new BakedEntry(TEX_SKIRT_BAKED,
"skirt", "03e7e8cb-1368-483b-b6f3-74850838ba63",
1, TEX_SKIRT,
1, LLWearableType::WT_SKIRT));
2, TEX_SKIRT, TEX_SKIRT_TATTOO,
2, LLWearableType::WT_SKIRT, LLWearableType::WT_UNIVERSAL ));
addEntry(BAKED_HAIR, new BakedEntry(TEX_HAIR_BAKED,
"hair", "a60e85a9-74e8-48d8-8a2d-8129f28d9b61",
2, TEX_HAIR, TEX_HAIR_ALPHA,
2, LLWearableType::WT_HAIR, LLWearableType::WT_ALPHA));
3, TEX_HAIR, TEX_HAIR_TATTOO, TEX_HAIR_ALPHA,
3, LLWearableType::WT_HAIR, LLWearableType::WT_UNIVERSAL, LLWearableType::WT_ALPHA));
addEntry(BAKED_LEFT_ARM, new BakedEntry(TEX_LEFT_ARM_BAKED,
"leftarm", "9f39febf-22d7-0087-79d1-e9e8c6c9ed19",
1, TEX_LEFT_ARM_TATTOO,
1, LLWearableType::WT_UNIVERSAL));
addEntry(BAKED_LEFT_LEG, new BakedEntry(TEX_LEFT_LEG_BAKED,
"leftleg", "054a7a58-8ed5-6386-0add-3b636fb28b78",
1, TEX_LEFT_LEG_TATTOO,
1, LLWearableType::WT_UNIVERSAL));
addEntry(BAKED_AUX1, new BakedEntry(TEX_AUX1_BAKED,
"aux1", "790c11be-b25c-c17e-b4d2-6a4ad786b752",
1, TEX_AUX1_TATTOO,
1, LLWearableType::WT_UNIVERSAL));
addEntry(BAKED_AUX2, new BakedEntry(TEX_AUX2_BAKED,
"aux2", "d78c478f-48c7-5928-5864-8d99fb1f521e",
1, TEX_AUX2_TATTOO,
1, LLWearableType::WT_UNIVERSAL));
addEntry(BAKED_AUX3, new BakedEntry(TEX_AUX3_BAKED,
"aux3", "6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb",
1, TEX_AUX3_TATTOO,
1, LLWearableType::WT_UNIVERSAL));
}
LLAvatarAppearanceDictionary::MeshEntries::MeshEntries()
@@ -267,3 +313,112 @@ LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIn
return getInstance()->getTexture(index)->mWearableType;
}
// static
BOOL LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id)
{
if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER)
|| (id == IMG_USE_BAKED_LEFTARM) || (id == IMG_USE_BAKED_LEFTLEG) || (id == IMG_USE_BAKED_AUX1) || (id == IMG_USE_BAKED_AUX2) || (id == IMG_USE_BAKED_AUX3) )
{
return TRUE;
}
return FALSE;
}
// static
EBakedTextureIndex LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(const LLUUID& id)
{
if (id == IMG_USE_BAKED_EYES)
{
return BAKED_EYES;
}
else if (id == IMG_USE_BAKED_HAIR)
{
return BAKED_HAIR;
}
else if (id == IMG_USE_BAKED_HEAD)
{
return BAKED_HEAD;
}
else if (id == IMG_USE_BAKED_LOWER)
{
return BAKED_LOWER;
}
else if (id == IMG_USE_BAKED_SKIRT)
{
return BAKED_SKIRT;
}
else if (id == IMG_USE_BAKED_UPPER)
{
return BAKED_UPPER;
}
else if (id == IMG_USE_BAKED_LEFTARM)
{
return BAKED_LEFT_ARM;
}
else if (id == IMG_USE_BAKED_LEFTLEG)
{
return BAKED_LEFT_LEG;
}
else if (id == IMG_USE_BAKED_AUX1)
{
return BAKED_AUX1;
}
else if (id == IMG_USE_BAKED_AUX2)
{
return BAKED_AUX2;
}
else if (id == IMG_USE_BAKED_AUX3)
{
return BAKED_AUX3;
}
return BAKED_NUM_INDICES;
}
//static
LLUUID LLAvatarAppearanceDictionary::localTextureIndexToMagicId(ETextureIndex t)
{
LLUUID id = LLUUID::null;
switch (t)
{
case LLAvatarAppearanceDefines::TEX_HEAD_BAKED:
id = IMG_USE_BAKED_HEAD;
break;
case LLAvatarAppearanceDefines::TEX_UPPER_BAKED:
id = IMG_USE_BAKED_UPPER;
break;
case LLAvatarAppearanceDefines::TEX_LOWER_BAKED:
id = IMG_USE_BAKED_LOWER;
break;
case LLAvatarAppearanceDefines::TEX_EYES_BAKED:
id = IMG_USE_BAKED_EYES;
break;
case LLAvatarAppearanceDefines::TEX_SKIRT_BAKED:
id = IMG_USE_BAKED_SKIRT;
break;
case LLAvatarAppearanceDefines::TEX_HAIR_BAKED:
id = IMG_USE_BAKED_HAIR;
break;
case LLAvatarAppearanceDefines::TEX_LEFT_ARM_BAKED:
id = IMG_USE_BAKED_LEFTARM;
break;
case LLAvatarAppearanceDefines::TEX_LEFT_LEG_BAKED:
id = IMG_USE_BAKED_LEFTLEG;
break;
case LLAvatarAppearanceDefines::TEX_AUX1_BAKED:
id = IMG_USE_BAKED_AUX1;
break;
case LLAvatarAppearanceDefines::TEX_AUX2_BAKED:
id = IMG_USE_BAKED_AUX2;
break;
case LLAvatarAppearanceDefines::TEX_AUX3_BAKED:
id = IMG_USE_BAKED_AUX3;
break;
default:
break;
}
return id;
}

View File

@@ -1,3 +1,4 @@
/**
* @file llavatarappearancedefines.h
* @brief Various LLAvatarAppearance related definitions
@@ -78,6 +79,22 @@ enum ETextureIndex
TEX_HEAD_TATTOO,
TEX_UPPER_TATTOO,
TEX_LOWER_TATTOO,
TEX_HEAD_UNIVERSAL_TATTOO,
TEX_UPPER_UNIVERSAL_TATTOO,
TEX_LOWER_UNIVERSAL_TATTOO,
TEX_SKIRT_TATTOO,
TEX_HAIR_TATTOO,
TEX_EYES_TATTOO,
TEX_LEFT_ARM_TATTOO,
TEX_LEFT_LEG_TATTOO,
TEX_AUX1_TATTOO,
TEX_AUX2_TATTOO,
TEX_AUX3_TATTOO,
TEX_LEFT_ARM_BAKED, // Pre-composited
TEX_LEFT_LEG_BAKED, // Pre-composited
TEX_AUX1_BAKED, // Pre-composited
TEX_AUX2_BAKED, // Pre-composited
TEX_AUX3_BAKED, // Pre-composited
TEX_NUM_INDICES
};
@@ -89,6 +106,11 @@ enum EBakedTextureIndex
BAKED_EYES,
BAKED_SKIRT,
BAKED_HAIR,
BAKED_LEFT_ARM,
BAKED_LEFT_LEG,
BAKED_AUX1,
BAKED_AUX2,
BAKED_AUX3,
BAKED_NUM_INDICES
};
@@ -224,6 +246,9 @@ public:
// Given a texture entry, determine which wearable type owns it.
static LLWearableType::EType getTEWearableType(ETextureIndex index);
static BOOL isBakedImageId(const LLUUID& id);
static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id);
static LLUUID localTextureIndexToMagicId(ETextureIndex t);
}; // End LLAvatarAppearanceDictionary
} // End namespace LLAvatarAppearanceDefines

View File

@@ -184,7 +184,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
{
LLTexLayerSet *layer_set = NULL;
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te);
if (texture_dict->mIsUsedByBakedTexture)
if (texture_dict && texture_dict->mIsUsedByBakedTexture)
{
const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
@@ -197,7 +197,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
}
else
{
LL_ERRS() << "could not find layerset for LTO in wearable!" << LL_ENDL;
LL_WARNS() << "could not find layerset for LTO in wearable!" << LL_ENDL;
}
}
@@ -438,6 +438,12 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
return LLWearable::FAILURE;
}
if (te >= ETextureIndex::TEX_NUM_INDICES) //createLayers() converts to ETextureIndex
{
LL_WARNS() << "Bad Wearable asset: bad texture index: " << te << LL_ENDL;
return LLWearable::FAILURE;
}
if( !LLUUID::validate( uuid_buffer ) )
{
LL_WARNS() << "Bad Wearable asset: bad texture uuid: "

View File

@@ -98,6 +98,7 @@ LLWearableDictionary::LLWearableDictionary()
addEntry(LLWearableType::WT_SKIRT, new WearableEntry("skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE));
addEntry(LLWearableType::WT_ALPHA, new WearableEntry("alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE));
addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE));
addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry("universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, FALSE, TRUE));
// [SL:KB] - Patch: Appearance-Misc | Checked: 2011-05-29 (Catznip-2.6)
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, FALSE));

View File

@@ -54,10 +54,12 @@ public:
WT_ALPHA = 13,
WT_TATTOO = 14,
WT_PHYSICS = 15,
WT_UNKNOWN = 16, // Singu note: used for corrupt wearables that do not have their type set in the inventory database.
WT_UNIVERSAL = 16,
WT_UNKNOWN = 17, // Singu note: used for corrupt wearables that do not have their type set in the inventory database.
// While all the above values are serialized and stored in the database, this value is local only:
// When a new item with value 16 is added by upstream, just increase this value to 17 (and WT_COUNT to 18).
WT_COUNT = 17,
// When a new item with value 17 is added by upstream, just increase this value to 18 (and WT_COUNT to 19).
// Keep WT_UNKNOWN and WT_COUNT in sync with llinventory.cpp
WT_COUNT = 18,
WT_INVALID = 255,
WT_NONE = -1,

View File

@@ -3,8 +3,6 @@
project(llaudio)
include(00-Common)
include(Audio)
include(LLAudio)
include(FMODSTUDIO)
include(OPENAL)
include(LLCommon)
@@ -12,10 +10,6 @@ include(LLMath)
include(LLMessage)
include(LLVFS)
if (FMOD)
include_directories(${FMOD_INCLUDE_DIR})
endif(FMOD)
include_directories(
${LLAUDIO_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
@@ -26,7 +20,7 @@ include_directories(
${VORBISENC_INCLUDE_DIRS}
${VORBISFILE_INCLUDE_DIRS}
${VORBIS_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIRS}
${OPENAL_LIB_INCLUDE_DIRS}
${FREEAULT_LIB_INCLUDE_DIRS}
)
@@ -49,7 +43,10 @@ set(llaudio_HEADER_FILES
llwindgen.h
)
if (FMODSTUDIO)
if (USE_FMODSTUDIO)
include_directories(
${FMODSTUDIO_INCLUDE_DIR}
)
list(APPEND llaudio_SOURCE_FILES
llaudioengine_fmodstudio.cpp
lllistener_fmodstudio.cpp
@@ -61,7 +58,7 @@ if (FMODSTUDIO)
lllistener_fmodstudio.h
llstreamingaudio_fmodstudio.h
)
endif (FMODSTUDIO)
endif (USE_FMODSTUDIO)
if (OPENAL)
list(APPEND llaudio_SOURCE_FILES

View File

@@ -12,8 +12,6 @@ include(Linking)
include(Boost)
include(OpenSSL)
include(LLSharedLibs)
include(Json)
include(GoogleBreakpad)
include(Copy3rdPartyLibs)
include(ZLIB)
include(URIPARSER)
@@ -270,12 +268,6 @@ list(APPEND llcommon_SOURCE_FILES ${cwdebug_SOURCE_FILES})
list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
if(NOT WORD_SIZE EQUAL 32)
if(NOT WINDOWS)
add_definitions(-fPIC)
endif(NOT WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
if(LLCOMMON_LINK_SHARED)
add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
if(WINDOWS)
@@ -287,11 +279,12 @@ else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES})
endif(LLCOMMON_LINK_SHARED)
set_target_properties(llcommon PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
target_link_libraries(
llcommon
PUBLIC
absl::hash
${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}
${APRUTIL_LIBRARIES}
${APR_LIBRARIES}
${EXPAT_LIBRARIES}
@@ -306,6 +299,8 @@ target_link_libraries(
${Boost_SYSTEM_LIBRARY}
${CORESERVICES_LIBRARY}
${URIPARSER_LIBRARY}
nlohmann_json::nlohmann_json
${RT_LIBRARY}
)
if (DARWIN)

View File

@@ -132,7 +132,7 @@ class LL_COMMON_API AIArgs
// Add another replacement.
AIArgs& operator()(char const* key, std::string const& replacement) { mArgs[key] = replacement; return *this; }
// The destructor may not throw.
~AIArgs() throw() { }
~AIArgs() noexcept { }
// Accessor.
LLStringUtil::format_map_t const& operator*() const { return mArgs; }
@@ -193,7 +193,7 @@ class LL_COMMON_API Line
Line(std::string const& xml_desc, AIArgs const& args, bool newline = false) : mNewline(newline), mXmlDesc(xml_desc), mArgs(args), mType(normal) { }
Line(Prefix const& prefix, bool newline = false) : mNewline(newline), mXmlDesc("AIPrefix"), mArgs("[PREFIX]", prefix.str()), mType(prefix.type()) { }
// The destructor may not throw.
~Line() throw() { }
~Line() noexcept { }
// Prepend a newline before this line.
void set_newline(void) { mNewline = true; }
@@ -225,7 +225,7 @@ class LL_COMMON_API Error : public std::exception
typedef std::deque<Line> lines_type;
// The destructor may not throw.
~Error() throw() { }
~Error() noexcept { }
// Accessors.
lines_type const& lines(void) const { return mLines; }
@@ -267,7 +267,7 @@ class LL_COMMON_API ErrorCode : public Error
public:
// The destructor may not throw.
~ErrorCode() throw() { }
~ErrorCode() noexcept { }
// Accessor.
int getCode(void) const { return mCode; }

View File

@@ -45,3 +45,15 @@ 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");
const LLUUID IMG_USE_BAKED_HEAD ("5a9f4a74-30f2-821c-b88d-70499d3e7183");
const LLUUID IMG_USE_BAKED_UPPER ("ae2de45c-d252-50b8-5c6e-19f39ce79317");
const LLUUID IMG_USE_BAKED_LOWER ("24daea5f-0539-cfcf-047f-fbc40b2786ba");
const LLUUID IMG_USE_BAKED_EYES ("52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a");
const LLUUID IMG_USE_BAKED_SKIRT ("43529ce8-7faa-ad92-165a-bc4078371687");
const LLUUID IMG_USE_BAKED_HAIR ("09aac1fb-6bce-0bee-7d44-caac6dbb6c63");
const LLUUID IMG_USE_BAKED_LEFTARM ("ff62763f-d60a-9855-890b-0c96f8f8cd98");
const LLUUID IMG_USE_BAKED_LEFTLEG ("8e915e25-31d1-cc95-ae08-d58a47488251");
const LLUUID IMG_USE_BAKED_AUX1 ("9742065b-19b5-297c-858a-29711d539043");
const LLUUID IMG_USE_BAKED_AUX2 ("03642e83-2bd1-4eb9-34b4-4c47ed586d2d");
const LLUUID IMG_USE_BAKED_AUX3 ("edd51b77-fc10-ce7a-4b3d-011dfc349e4f");

View File

@@ -1,3 +1,4 @@
/**
* @file indra_constants.h
* @brief some useful short term constants for Indra
@@ -243,7 +244,6 @@ const U8 SIM_ACCESS_DOWN = 254;
const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
// attachment constants
const U32 MAX_AGENT_ATTACHMENTS = 38;
const U8 ATTACHMENT_ADD = 0x80;
// god levels
@@ -294,6 +294,19 @@ const U32 START_LOCATION_ID_COUNT = 6;
// group constants
const U32 GROUP_MIN_SIZE = 2;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HEAD;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_UPPER;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LOWER;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_EYES;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_SKIRT;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HAIR;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTARM;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTLEG;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX1;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX2;
LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX3;
// radius within which a chat message is fully audible
const F32 CHAT_WHISPER_RADIUS = 10.f;
const F32 CHAT_NORMAL_RADIUS = 20.f;
@@ -354,13 +367,6 @@ const U32 MAP_ITEM_CLASSIFIED = 0x08;
const U32 MAP_ITEM_ADULT_EVENT = 0x09;
const U32 MAP_ITEM_LAND_FOR_SALE_ADULT = 0x0a;
// Crash reporter behavior
const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml";
const char* const CRASH_BEHAVIOR_SETTING = "CrashSubmitBehavior";
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;

View File

@@ -25,9 +25,8 @@
*/
#include "linden_common.h"
#include "llapp.h"
#include <cstdlib>
#include "llapp.h"
#ifdef LL_DARWIN
#include <sys/types.h>
@@ -45,7 +44,6 @@
#include "llstl.h" // for DeletePointer()
#include "llstring.h"
#include "lleventtimer.h"
#include "exception_handler.h"
//
// Signal handling
@@ -57,12 +55,6 @@
LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop);
BOOL ConsoleCtrlHandler(DWORD fdwCtrlType);
bool windows_post_minidump_callback(const wchar_t* dump_path,
const wchar_t* minidump_id,
void* context,
EXCEPTION_POINTERS* exinfo,
MDRawAssertionInfo* assertion,
bool succeeded);
#else
# include <signal.h>
# include <unistd.h> // for fork()
@@ -70,18 +62,6 @@ bool windows_post_minidump_callback(const wchar_t* dump_path,
void setup_signals();
void default_unix_signal_handler(int signum, siginfo_t *info, void *);
#if LL_LINUX
#include "client/linux/handler/minidump_descriptor.h"
static bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc,
void* context,
bool succeeded);
#else
// Called by breakpad exception handler after the minidump has been generated.
bool unix_post_minidump_callback(const char *dump_dir,
const char *minidump_id,
void *context, bool succeeded);
#endif
# if LL_DARWIN
/* OSX doesn't support SIGRT* */
S32 LL_SMACKDOWN_SIGNAL = SIGUSR1;
@@ -98,7 +78,7 @@ S32 LL_HEARTBEAT_SIGNAL = (SIGRTMAX >= 0) ? (SIGRTMAX-0) : SIGUSR2;
#endif // LL_WINDOWS
// the static application instance
LLApp* LLApp::sApplication = NULL;
LLApp* LLApp::sApplication = nullptr;
// Allows the generation of core files for post mortem under gdb
// and disables crashlogger
@@ -110,7 +90,7 @@ BOOL LLApp::sLogInSignal = FALSE;
// static
LLApp::EAppStatus LLApp::sStatus = LLApp::APP_STATUS_STOPPED; // Keeps track of application status
LLAppErrorHandler LLApp::sErrorHandler = NULL;
LLAppErrorHandler LLApp::sErrorHandler = nullptr;
BOOL LLApp::sErrorThreadRunning = FALSE;
#if !LL_WINDOWS
LLApp::child_map LLApp::sChildMap;
@@ -119,13 +99,12 @@ LLAppChildCallback LLApp::sDefaultChildCallback = NULL;
#endif
LLApp::LLApp() : mThreadErrorp(NULL)
LLApp::LLApp()
: mThreadErrorp(nullptr)
{
commonCtor();
}
static void* sCrashLoggerReserve = NULL;
void LLApp::commonCtor()
{
// Set our status to running
@@ -150,34 +129,11 @@ void LLApp::commonCtor()
// Set the application to this instance.
sApplication = this;
mExceptionHandler = 0;
#if LL_WINDOWS
sCrashLoggerReserve = VirtualAlloc(NULL, 512*1024, MEM_COMMIT|MEM_RESERVE, PAGE_NOACCESS);
#else
sCrashLoggerReserve = malloc(512*1024);
#endif
// initialize the buffer to write the minidump filename to
// (this is used to avoid allocating memory in the crash handler)
memset(mMinidumpPath, 0, MAX_MINDUMP_PATH_LENGTH);
mCrashReportPipeStr = L"\\\\.\\pipe\\LLCrashReporterPipe";
}
#if LL_WINDOWS
static bool clear_CrashLoggerReserve_callback(void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion)
{
VirtualFree(sCrashLoggerReserve, 0, MEM_RELEASE);
return true;
}
#else
static bool clear_CrashLoggerReserve_callback(void* context)
{
free(sCrashLoggerReserve);
return true;
}
#endif
LLApp::LLApp(LLErrorThread *error_thread) :
mThreadErrorp(error_thread)
{
@@ -198,11 +154,9 @@ LLApp::~LLApp()
if (mThreadErrorp)
{
delete mThreadErrorp;
mThreadErrorp = NULL;
mThreadErrorp = nullptr;
}
if(mExceptionHandler != 0) delete mExceptionHandler;
LLCommon::cleanupClass();
}
@@ -216,8 +170,8 @@ LLApp* LLApp::instance()
LLSD LLApp::getOption(const std::string& name) const
{
LLSD rv;
LLSD::array_const_iterator iter = mOptions.beginArray();
LLSD::array_const_iterator end = mOptions.endArray();
auto iter = mOptions.beginArray();
auto end = mOptions.endArray();
for(; iter != end; ++iter)
{
rv = (*iter)[name];
@@ -264,9 +218,9 @@ bool LLApp::parseCommandOptions(int argc, char** argv)
#if LL_WINDOWS
//Windows changed command line parsing. Deal with it.
S32 slen = value.length() - 1;
S32 start = 0;
S32 end = slen;
size_t slen = value.length() - 1;
size_t start = 0;
size_t end = slen;
if (argv[ii][start]=='"')start++;
if (argv[ii][end]=='"')end--;
if (start!=0 || end!=slen)
@@ -343,92 +297,17 @@ void LLApp::setupErrorHandling()
// Error handling is done by starting up an error handling thread, which just sleeps and
// occasionally checks to see if the app is in an error state, and sees if it needs to be run.
#if LL_WINDOWS
#if LL_SEND_CRASH_REPORTS
EnableCrashingOnCrashes();
// This sets a callback to handle w32 signals to the console window.
// The viewer shouldn't be affected, sicne its a windowed app.
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ConsoleCtrlHandler, TRUE);
// Install the Google Breakpad crash handler for Windows
if(mExceptionHandler == 0)
{
mExceptionHandler = new google_breakpad::ExceptionHandler(
std::wstring(mDumpPath.begin(),mDumpPath.end()), //Dump path
clear_CrashLoggerReserve_callback,
windows_post_minidump_callback,
0,
google_breakpad::ExceptionHandler::HANDLER_ALL);
if (mExceptionHandler)
{
mExceptionHandler->set_handle_debug_exceptions(true);
}
}
#endif
#else
#if !LL_WINDOWS
//
// Start up signal handling.
//
// There are two different classes of signals. Synchronous signals are delivered to a specific
// thread, asynchronous signals can be delivered to any thread (in theory)
//
setup_signals();
// Add google breakpad exception handler configured for Darwin/Linux.
bool installHandler = true;
#if LL_DARWIN
// For the special case of Darwin, we do not want to install the handler if
// the process is being debugged as the app will exit with value ABRT (6) if
// we do. Unfortunately, the code below which performs that test relies on
// the structure kinfo_proc which has been tagged by apple as an unstable
// API. We disable this test for shipping versions to avoid conflicts with
// future releases of Darwin. This test is really only needed for developers
// starting the app from a debugger anyway.
#ifndef LL_RELEASE_FOR_DOWNLOAD
int mib[4];
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid();
struct kinfo_proc info;
memset(&info, 0, sizeof(info));
size_t size = sizeof(info);
int result = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
if((result == 0) || (errno == ENOMEM))
{
// P_TRACED flag is set, so this process is being debugged; do not install
// the handler
if(info.kp_proc.p_flag & P_TRACED) installHandler = false;
}
else
{
// Failed to discover if the process is being debugged; default to
// installing the handler.
installHandler = true;
}
if(installHandler && (mExceptionHandler == 0))
{
mExceptionHandler = new google_breakpad::ExceptionHandler(mDumpPath, clear_CrashLoggerReserve_callback, &unix_post_minidump_callback, 0, true, 0);
}
#endif
#elif LL_LINUX
if(installHandler && (mExceptionHandler == 0))
{
if (mDumpPath.empty())
{
mDumpPath = "/tmp";
}
google_breakpad::MinidumpDescriptor desc(mDumpPath);
mExceptionHandler = new google_breakpad::ExceptionHandler(desc, clear_CrashLoggerReserve_callback, unix_minidump_callback, NULL, true, -1);
}
#endif
#endif // ! LL_WINDOWS
#if !defined(USE_CRASHPAD)
startErrorThread();
#endif
}
@@ -466,7 +345,6 @@ void LLApp::setErrorHandler(LLAppErrorHandler handler)
LLApp::sErrorHandler = handler;
}
// static
void LLApp::runErrorHandler()
{
@@ -479,7 +357,6 @@ void LLApp::runErrorHandler()
LLApp::setStopped();
}
// static
void LLApp::setStatus(EAppStatus status)
{
@@ -494,43 +371,12 @@ void LLApp::setError()
setStatus(APP_STATUS_ERROR);
}
void LLApp::setMiniDumpDir(const std::string &path)
{
if (path.empty())
{
mDumpPath = "/tmp";
}
else
{
mDumpPath = path;
}
if(mExceptionHandler == 0) return;
#ifdef LL_WINDOWS
wchar_t buffer[MAX_MINDUMP_PATH_LENGTH];
mbstowcs(buffer, mDumpPath.c_str(), MAX_MINDUMP_PATH_LENGTH);
mExceptionHandler->set_dump_path(std::wstring(buffer));
#elif LL_LINUX
//google_breakpad::MinidumpDescriptor desc("/tmp"); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched.
google_breakpad::MinidumpDescriptor desc(mDumpPath); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched.
mExceptionHandler->set_minidump_descriptor(desc);
#else
mExceptionHandler->set_dump_path(mDumpPath);
#endif
}
void LLApp::setDebugFileNames(const std::string &path)
{
mStaticDebugFileName = path + "static_debug_info.log";
mDynamicDebugFileName = path + "dynamic_debug_info.log";
}
void LLApp::writeMiniDump()
{
if(mExceptionHandler == 0) return;
mExceptionHandler->WriteMinidump();
}
// static
void LLApp::setQuitting()
{
@@ -585,13 +431,6 @@ bool LLApp::isExiting()
void LLApp::disableCrashlogger()
{
// Disable Breakpad exception handler.
if (mExceptionHandler != 0)
{
delete mExceptionHandler;
mExceptionHandler = 0;
}
sDisableCrashlogger = TRUE;
}
@@ -660,12 +499,6 @@ LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *except
ms_sleep(10);
}
//
// Generate a minidump if we can.
//
// TODO: This needs to be ported over form the viewer-specific
// LLWinDebug class
//
// At this point, we always want to exit the app. There's no graceful
// recovery for an unhandled exception.
@@ -965,150 +798,4 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
}
}
}
#if LL_LINUX
bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc, void* context, bool succeeded)
{
// Copy minidump file path into fixed buffer in the app instance to avoid
// heap allocations in a crash handler.
// path format: <dump_dir>/<minidump_id>.dmp
//HACK: *path points to the buffer in getMiniDumpFilename which has already allocated space
//to avoid doing allocation during crash.
char * path = LLApp::instance()->getMiniDumpFilename();
int dir_path_len = strlen(path);
// The path must not be truncated.
S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH - dir_path_len;
llassert( (remaining - strlen(minidump_desc.path())) > 5);
path += dir_path_len;
if (dir_path_len > 0 && path[-1] != '/')
{
*path++ = '/';
--remaining;
}
strncpy(path, minidump_desc.path(), remaining);
LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
LLApp::runErrorHandler();
#ifndef LL_RELEASE_FOR_DOWNLOAD
clear_signals();
return false;
#else
return true;
#endif
}
#endif
bool unix_post_minidump_callback(const char *dump_dir,
const char *minidump_id,
void *context, bool succeeded)
{
// Copy minidump file path into fixed buffer in the app instance to avoid
// heap allocations in a crash handler.
// path format: <dump_dir>/<minidump_id>.dmp
int dirPathLength = strlen(dump_dir);
int idLength = strlen(minidump_id);
// The path must not be truncated.
llassert((dirPathLength + idLength + 5) <= LLApp::MAX_MINDUMP_PATH_LENGTH);
char * path = LLApp::instance()->getMiniDumpFilename();
S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH;
strncpy(path, dump_dir, remaining);
remaining -= dirPathLength;
path += dirPathLength;
if (remaining > 0 && dirPathLength > 0 && path[-1] != '/')
{
*path++ = '/';
--remaining;
}
if (remaining > 0)
{
strncpy(path, minidump_id, remaining);
remaining -= idLength;
path += idLength;
strncpy(path, ".dmp", remaining);
}
LL_INFOS() << "generated minidump: " << path << LL_ENDL;
LLApp::runErrorHandler();
#ifndef LL_RELEASE_FOR_DOWNLOAD
clear_signals();
return false;
#else
return true;
#endif
}
#endif // !WINDOWS
#ifdef LL_WINDOWS
bool windows_post_minidump_callback(const wchar_t* dump_path,
const wchar_t* minidump_id,
void* context,
EXCEPTION_POINTERS* exinfo,
MDRawAssertionInfo* assertion,
bool succeeded)
{
char * path = LLApp::instance()->getMiniDumpFilename();
S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH;
size_t bytesUsed;
bytesUsed = wcstombs(path, dump_path, static_cast<size_t>(remaining));
remaining -= bytesUsed;
path += bytesUsed;
if(remaining > 0 && bytesUsed > 0 && path[-1] != '\\')
{
*path++ = '\\';
--remaining;
}
if(remaining > 0)
{
bytesUsed = wcstombs(path, minidump_id, static_cast<size_t>(remaining));
remaining -= bytesUsed;
path += bytesUsed;
}
if(remaining > 0)
{
strncpy(path, ".dmp", remaining);
}
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
LL_INFOS() << "Entering Windows Exception Handler..." << LL_ENDL;
if (LLApp::isError())
{
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
LLApp::setError();
// Block in the exception handler until the app has stopped
// This is pretty sketchy, but appears to work just fine
while (!LLApp::isStopped())
{
ms_sleep(10);
}
#ifndef LL_RELEASE_FOR_DOWNLOAD
return false;
#else
return true;
#endif
}
#endif

View File

@@ -60,10 +60,6 @@ public:
};
#endif
namespace google_breakpad {
class ExceptionHandler; // See exception_handler.h
}
class LL_COMMON_API LLApp : public LLOptionInterface
{
friend class LLErrorThread;
@@ -233,22 +229,11 @@ public:
static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred.
//@}
// the maximum length of the minidump filename returned by getMiniDumpFilename()
static const U32 MAX_MINDUMP_PATH_LENGTH = 256;
// change the directory where Breakpad minidump files are written to
void setMiniDumpDir(const std::string &path);
void setDebugFileNames(const std::string &path);
// Return the Google Breakpad minidump filename after a crash.
char *getMiniDumpFilename() { return mMinidumpPath; }
std::string* getStaticDebugFile() { return &mStaticDebugFileName; }
std::string* getDynamicDebugFile() { return &mDynamicDebugFileName; }
// Write out a Google Breakpad minidump file.
void writeMiniDump();
#if !LL_WINDOWS
//
// Child process handling (Unix only for now)
@@ -281,8 +266,6 @@ protected:
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
std::wstring mCrashReportPipeStr; //Name of pipe to use for crash reporting.
std::string mDumpPath; //output path for google breakpad. Dependency workaround.
#if !LL_WINDOWS
static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received.
typedef std::map<pid_t, LLChildInfo> child_map; // Map key is a PID
@@ -290,16 +273,13 @@ protected:
static LLAppChildCallback sDefaultChildCallback;
#endif
void startErrorThread();
/**
* @brief This method is called at the end, just prior to deinitializing curl.
*/
void stopErrorThread();
private:
// Contains the filename of the minidump file after a crash.
char mMinidumpPath[MAX_MINDUMP_PATH_LENGTH];
void startErrorThread();
std::string mStaticDebugFileName;
std::string mDynamicDebugFileName;
@@ -323,11 +303,8 @@ private:
std::vector<LLLiveFile*> mLiveFiles;
//@}
private:
// the static application instance if it was created.
static LLApp* sApplication;
google_breakpad::ExceptionHandler * mExceptionHandler;
#if !LL_WINDOWS
friend void default_unix_signal_handler(int signum, siginfo_t *info, void *);

View File

@@ -1338,7 +1338,7 @@ namespace LLError
}
#if LL_WINDOWS
// VC80 was optimizing the error away.
// MSVC is optimizing the error away.
#pragma optimize("", off)
#endif
void crashAndLoop(const std::string& message)
@@ -1347,9 +1347,8 @@ namespace LLError
DoutFatal(dc::core, message);
#else
// Now, we go kaboom!
int* make_me_crash = NULL;
*make_me_crash = 0;
int* make_me_crash = nullptr;
*make_me_crash = 0xDEADBEEF;
while(true)
{

View File

@@ -412,7 +412,7 @@ public:
std::runtime_error(what),
mData(data)
{}
virtual ~LLErrorEvent() throw() {}
virtual ~LLErrorEvent() noexcept {}
LLSD getData() const { return mData; }

View File

@@ -381,10 +381,9 @@ std::string LLSDArgsMapper::formatlist(const LLSD& list)
{
std::ostringstream out;
const char* delim = "";
for (LLSD::array_const_iterator li(list.beginArray()), lend(list.endArray());
li != lend; ++li)
for (auto const& entry : list.array())
{
out << delim << li->asString();
out << delim << entry.asString();
delim = ", ";
}
return out.str();
@@ -494,10 +493,9 @@ struct LLEventDispatcher::MapParamsDispatchEntry: public LLEventDispatcher::Para
{
// Build the set of all param keys, then delete the ones that are
// optional. What's left are the ones that are required.
for (LLSD::array_const_iterator pi(params.beginArray()), pend(params.endArray());
pi != pend; ++pi)
for (auto const& entry : params.array())
{
mRequired[pi->asString()] = LLSD();
mRequired[entry.asString()] = LLSD();
}
if (defaults.isArray() || defaults.isUndefined())

View File

@@ -182,10 +182,10 @@ public:
bool operator! () const { return ! mListener; }
/// explicit accessor
const LLEventListener& getListener() const { return *mListener; }
const ::LLEventListener& getListener() const { return *mListener; }
/// implicit conversion to LLEventListener
operator LLEventListener() const { return *mListener; }
operator ::LLEventListener() const { return *mListener; }
/// allow calling directly
bool operator()(const LLSD& event) const;
@@ -277,7 +277,7 @@ namespace LLEventDetail
/// Any callable capable of connecting an LLEventListener to an
/// LLStandardSignal to produce an LLBoundListener can be mapped to this
/// signature.
typedef boost::function<LLBoundListener(const LLEventListener&)> ConnectFunc;
typedef boost::function<LLBoundListener(const ::LLEventListener&)> ConnectFunc;
/// overload of visit_and_connect() when we have a string identifier available
template <typename LISTENER>
@@ -547,7 +547,7 @@ private:
virtual void reset();
private:
virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&,
virtual LLBoundListener listen_impl(const std::string& name, const ::LLEventListener&,
const NameList& after,
const NameList& before);
std::string mName;
@@ -845,7 +845,7 @@ namespace LLEventDetail
* Visitor binds a reference to LLEventListener so we can track() any
* shared_ptrs we find in the argument list.
*/
Visitor(LLEventListener& listener):
Visitor(::LLEventListener& listener):
mListener(listener)
{
}
@@ -988,7 +988,7 @@ namespace LLEventDetail
|*==========================================================================*/
/// Bind a reference to the LLEventListener to call its track() method.
LLEventListener& mListener;
::LLEventListener& mListener;
};
/**
@@ -1005,7 +1005,7 @@ namespace LLEventDetail
const ConnectFunc& connect_func)
{
// Capture the listener
LLEventListener listener(raw_listener);
::LLEventListener listener(raw_listener);
// Define our Visitor, binding the listener so we can call
// listener.track() if we discover any shared_ptr<Foo>.
LLEventDetail::Visitor visitor(listener);

View File

@@ -54,6 +54,7 @@ std::string LLFile::strerr(int errn)
{
char buffer[256];
strerror_s(buffer, errn); // infers sizeof(buffer) -- love it!
buffer[255] = 0;
return buffer;
}
@@ -281,6 +282,11 @@ int LLFile::rename_nowarn(const std::string& filename, const std::string& newnam
int rc = _wrename(utf16filename.c_str(),utf16newname.c_str());
#else
int rc = ::rename(filename.c_str(),newname.c_str());
if (rc == -1 && errno == EXDEV)
{
rc = std::system(("mv '" + filename + "' '" + newname + '\'').data());
errno = 0;
}
#endif
return rc;
}

View File

@@ -102,39 +102,47 @@ void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_f
//static
void LLMemory::updateMemoryInfo()
{
#if LL_WINDOWS
HANDLE self = GetCurrentProcess();
PROCESS_MEMORY_COUNTERS counters;
if (!GetProcessMemoryInfo(self, &counters, sizeof(counters)))
#if LL_WINDOWS
PROCESS_MEMORY_COUNTERS_EX counters;
counters.cb = sizeof(counters);
if (!GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*) &counters, sizeof(counters)))
{
LL_WARNS() << "GetProcessMemoryInfo failed" << LL_ENDL;
return ;
return;
}
sAllocatedMemInKB = (U32Bytes)(counters.WorkingSetSize) ;
sAllocatedPageSizeInKB = (U32Bytes)(counters.PagefileUsage) ;
sAllocatedMemInKB = U64Bytes(counters.WorkingSetSize);
sAllocatedPageSizeInKB = (counters.PagefileUsage != 0) ? U64Bytes(counters.PagefileUsage) : U64Bytes(counters.PrivateUsage);
U32Kilobytes avail_phys, avail_virtual;
LLMemoryInfo::getAvailableMemoryKB(avail_phys, avail_virtual) ;
sMaxPhysicalMemInKB = llmin(avail_phys + sAllocatedMemInKB, sMaxHeapSizeInKB);
if(sMaxPhysicalMemInKB > sAllocatedMemInKB)
MEMORYSTATUSEX memorystat;
memorystat.dwLength = sizeof(memorystat);
if (!GlobalMemoryStatusEx(&memorystat))
{
sAvailPhysicalMemInKB = sMaxPhysicalMemInKB - sAllocatedMemInKB ;
LL_WARNS() << "GlobalMemoryStatusEx failed" << LL_ENDL;
return;
}
#if (defined(_WIN64) || defined(__amd64__) || defined(__x86_64__))
sMaxPhysicalMemInKB = U64Bytes(memorystat.ullTotalPhys);
sAvailPhysicalMemInKB = U64Bytes(memorystat.ullAvailPhys);
#else
sMaxPhysicalMemInKB = llmin(U32Kilobytes(U64Bytes(memorystat.ullTotalPhys)), sMaxHeapSizeInKB);
if (sMaxPhysicalMemInKB > sAllocatedMemInKB)
{
sAvailPhysicalMemInKB = U64Bytes(memorystat.ullAvailPhys);;
}
else
{
sAvailPhysicalMemInKB = U32Kilobytes(0);
}
#else
//not valid for other systems for now.
sAllocatedMemInKB = (U32Bytes)LLMemory::getCurrentRSS();
sMaxPhysicalMemInKB = (U32Bytes)U32_MAX ;
sAvailPhysicalMemInKB = (U32Bytes)U32_MAX ;
#endif
return ;
#else
//not valid for other systems for now.
sAllocatedMemInKB = U64Bytes(LLMemory::getCurrentRSS());
sMaxPhysicalMemInKB = U64Bytes(U32_MAX);
sAvailPhysicalMemInKB = U64Bytes(U32_MAX);
#endif
}
//
@@ -158,7 +166,7 @@ void* LLMemory::tryToAlloc(void* address, U32 size)
return address ;
#else
return (void*)0x01 ; //skip checking
#endif
#endif
}
//static
@@ -233,31 +241,31 @@ bool LLMemory::isMemoryPoolLow()
//static
U32Kilobytes LLMemory::getAvailableMemKB()
{
return sAvailPhysicalMemInKB ;
return sAvailPhysicalMemInKB;
}
//static
U32Kilobytes LLMemory::getMaxMemKB()
{
return sMaxPhysicalMemInKB ;
return sMaxPhysicalMemInKB;
}
//static
U32Kilobytes LLMemory::getAllocatedMemKB()
{
return sAllocatedMemInKB ;
return sAllocatedMemInKB;
}
//----------------------------------------------------------------------------
#if defined(LL_WINDOWS)
//static
U64 LLMemory::getCurrentRSS()
{
HANDLE self = GetCurrentProcess();
PROCESS_MEMORY_COUNTERS counters;
if (!GetProcessMemoryInfo(self, &counters, sizeof(counters)))
if (!GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters)))
{
LL_WARNS() << "GetProcessMemoryInfo failed" << LL_ENDL;
return 0;
@@ -266,35 +274,7 @@ U64 LLMemory::getCurrentRSS()
return counters.WorkingSetSize;
}
//static
U32 LLMemory::getWorkingSetSize()
{
PROCESS_MEMORY_COUNTERS pmc ;
U32 ret = 0 ;
if (GetProcessMemoryInfo( GetCurrentProcess(), &pmc, sizeof(pmc)) )
{
ret = pmc.WorkingSetSize ;
}
return ret ;
}
#elif defined(LL_DARWIN)
/*
The API used here is not capable of dealing with 64-bit memory sizes, but is available before 10.4.
Once we start requiring 10.4, we can use the updated API, which looks like this:
task_basic_info_64_data_t basicInfo;
mach_msg_type_number_t basicInfoCount = TASK_BASIC_INFO_64_COUNT;
if (task_info(mach_task_self(), TASK_BASIC_INFO_64, (task_info_t)&basicInfo, &basicInfoCount) == KERN_SUCCESS)
Of course, this doesn't gain us anything unless we start building the viewer as a 64-bit executable, since that's the only way
for our memory allocation to exceed 2^32.
*/
// if (sysctl(ctl, 2, &page_size, &size, NULL, 0) == -1)
// {
// LL_WARNS() << "Couldn't get page size" << LL_ENDL;
@@ -307,16 +287,15 @@ U32 LLMemory::getWorkingSetSize()
U64 LLMemory::getCurrentRSS()
{
U64 residentSize = 0;
task_basic_info_data_t basicInfo;
mach_msg_type_number_t basicInfoCount = TASK_BASIC_INFO_COUNT;
if (task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&basicInfo, &basicInfoCount) == KERN_SUCCESS)
mach_task_basic_info_data_t basicInfo;
mach_msg_type_number_t basicInfoCount = MACH_TASK_BASIC_INFO_COUNT;
if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&basicInfo, &basicInfoCount) == KERN_SUCCESS)
{
residentSize = basicInfo.resident_size;
// If we ever wanted it, the process virtual size is also available as:
// virtualSize = basicInfo.virtual_size;
// LL_INFOS() << "resident size is " << residentSize << LL_ENDL;
// residentSize = basicInfo.resident_size;
// Although this method is defined to return the "resident set size,"
// in fact what callers want from it is the total virtual memory
// consumed by the application.
residentSize = basicInfo.virtual_size;
}
else
{
@@ -326,11 +305,6 @@ U64 LLMemory::getCurrentRSS()
return residentSize;
}
U32 LLMemory::getWorkingSetSize()
{
return 0 ;
}
#elif defined(LL_LINUX)
U64 LLMemory::getCurrentRSS()
@@ -342,7 +316,7 @@ U64 LLMemory::getCurrentRSS()
if (fp == NULL)
{
LL_WARNS() << "couldn't open " << statPath << LL_ENDL;
goto bail;
return rss;
}
// Eee-yew! See Documentation/filesystems/proc.txt in your
@@ -361,49 +335,8 @@ U64 LLMemory::getCurrentRSS()
fclose(fp);
bail:
return rss;
}
U32 LLMemory::getWorkingSetSize()
{
return 0 ;
}
#elif LL_SOLARIS
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
U64 LLMemory::getCurrentRSS()
{
char path [LL_MAX_PATH]; /* Flawfinder: ignore */
sprintf(path, "/proc/%d/psinfo", (int)getpid());
int proc_fd = -1;
if((proc_fd = open(path, O_RDONLY)) == -1){
LL_WARNS() << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << LL_ENDL;
return 0;
}
psinfo_t proc_psinfo;
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
LL_WARNS() << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << LL_ENDL;
close(proc_fd);
return 0;
}
close(proc_fd);
return((U64)proc_psinfo.pr_rssize * 1024);
}
U32 LLMemory::getWorkingSetSize()
{
return 0 ;
}
#else
U64 LLMemory::getCurrentRSS()
@@ -411,11 +344,6 @@ U64 LLMemory::getCurrentRSS()
return 0;
}
U32 LLMemory::getWorkingSetSize()
{
return 0;
}
#endif
//--------------------------------------------------------------------------------------------------
@@ -427,7 +355,7 @@ LLMemTracker* LLMemTracker::sInstance = NULL ;
LLMemTracker::LLMemTracker()
{
mLastAllocatedMem = LLMemory::getWorkingSetSize() ;
mLastAllocatedMem = LLMemory::getCurrentRSS() ;
mCapacity = 128 ;
mCurIndex = 0 ;
mCounter = 0 ;
@@ -480,7 +408,7 @@ void LLMemTracker::track(const char* function, const int line)
return ;
}
U32 allocated_mem = LLMemory::getWorkingSetSize() ;
U64 allocated_mem = LLMemory::getCurrentRSS() ;
LLMutexLock lock(mMutexp) ;

View File

@@ -133,11 +133,15 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
#if defined(LL_WINDOWS)
return _aligned_malloc(size, align);
#else
char* aligned = NULL;
void* mem = malloc( size + (align - 1) + sizeof(void*) );
char* aligned = ((char*)mem) + sizeof(void*);
aligned += align - ((uintptr_t)aligned & (align - 1));
if (mem)
{
aligned = ((char*)mem) + sizeof(void*);
aligned += align - ((uintptr_t)aligned & (align - 1));
((void**)aligned)[-1] = mem;
((void**)aligned)[-1] = mem;
}
return aligned;
#endif
}
@@ -365,7 +369,6 @@ public:
// Return the resident set size of the current process, in bytes.
// Return value is zero if not known.
static U64 getCurrentRSS();
static U32 getWorkingSetSize();
static void* tryToAlloc(void* address, U32 size);
static void initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure);
static void updateMemoryInfo() ;

View File

@@ -126,9 +126,9 @@ public:
virtual Date asDate() const { return LLDate(); }
virtual URI asURI() const { return LLURI(); }
virtual const Binary& asBinary() const { static const std::vector<U8> empty; return empty; }
virtual const String& asStringRef() const { static const std::string empty; return empty; }
virtual const String& asStringRef() const { static const std::string empty; return empty; }
virtual bool has(const String&) const { return false; }
virtual LLSD get(const String&) const { return LLSD(); }
virtual LLSD getKeys() const { return LLSD::emptyArray(); }
@@ -140,10 +140,14 @@ public:
virtual void erase(Integer) { }
virtual const LLSD& ref(Integer) const { return undef(); }
virtual LLSD::map_const_iterator beginMap() const { return endMap(); }
virtual LLSD::map_const_iterator endMap() const { static const std::map<String, LLSD> empty; return empty.end(); }
virtual LLSD::array_const_iterator beginArray() const { return endArray(); }
virtual LLSD::array_const_iterator endArray() const { static const std::vector<LLSD> empty; return empty.end(); }
virtual const std::map<String, LLSD>& map() const { static const std::map<String, LLSD> empty; return empty; }
virtual std::map<String, LLSD>& map() { static std::map<String, LLSD> empty; return empty; }
LLSD::map_const_iterator beginMap() const { return map().begin(); }
LLSD::map_const_iterator endMap() const { return map().end(); }
virtual const std::vector<LLSD>& array() const { static const std::vector<LLSD> empty; return empty; }
virtual std::vector<LLSD>& array() { static std::vector<LLSD> empty; return empty; }
LLSD::array_const_iterator beginArray() const { return array().begin(); }
LLSD::array_const_iterator endArray() const { return array().end(); }
virtual void dumpStats() const;
virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
@@ -183,10 +187,11 @@ namespace
public:
ImplBase(DataRef value) : mValue(value) { }
virtual LLSD::Type type() const { return T; }
LLSD::Type type() const override { return T; }
using LLSD::Impl::assign; // Unhiding base class virtuals...
virtual void assign(LLSD::Impl*& var, DataRef value) {
void assign(LLSD::Impl*& var, DataRef value) override
{
if (shared())
{
Impl::assign(var, value);
@@ -199,16 +204,16 @@ namespace
};
class ImplBoolean
class ImplBoolean final
: public ImplBase<LLSD::TypeBoolean, LLSD::Boolean>
{
public:
ImplBoolean(LLSD::Boolean v) : Base(v) { }
virtual LLSD::Boolean asBoolean() const { return mValue; }
virtual LLSD::Integer asInteger() const { return mValue ? 1 : 0; }
virtual LLSD::Real asReal() const { return mValue ? 1 : 0; }
virtual LLSD::String asString() const;
LLSD::Boolean asBoolean() const override { return mValue; }
LLSD::Integer asInteger() const override { return mValue ? 1 : 0; }
LLSD::Real asReal() const override { return mValue ? 1 : 0; }
LLSD::String asString() const override;
};
LLSD::String ImplBoolean::asString() const
@@ -220,32 +225,32 @@ namespace
{ return mValue ? "true" : ""; }
class ImplInteger
class ImplInteger final
: public ImplBase<LLSD::TypeInteger, LLSD::Integer>
{
public:
ImplInteger(LLSD::Integer v) : Base(v) { }
virtual LLSD::Boolean asBoolean() const { return mValue != 0; }
virtual LLSD::Integer asInteger() const { return mValue; }
virtual LLSD::Real asReal() const { return mValue; }
virtual LLSD::String asString() const;
LLSD::Boolean asBoolean() const override { return mValue != 0; }
LLSD::Integer asInteger() const override { return mValue; }
LLSD::Real asReal() const override { return mValue; }
LLSD::String asString() const override;
};
LLSD::String ImplInteger::asString() const
{ return llformat("%d", mValue); }
class ImplReal
class ImplReal final
: public ImplBase<LLSD::TypeReal, LLSD::Real>
{
public:
ImplReal(LLSD::Real v) : Base(v) { }
virtual LLSD::Boolean asBoolean() const;
virtual LLSD::Integer asInteger() const;
virtual LLSD::Real asReal() const { return mValue; }
virtual LLSD::String asString() const;
LLSD::Boolean asBoolean() const override;
LLSD::Integer asInteger() const override;
LLSD::Real asReal() const override { return mValue; }
LLSD::String asString() const override;
};
LLSD::Boolean ImplReal::asBoolean() const
@@ -258,21 +263,21 @@ namespace
{ return llformat("%lg", mValue); }
class ImplString
class ImplString final
: public ImplBase<LLSD::TypeString, LLSD::String, const LLSD::String&>
{
public:
ImplString(const LLSD::String& v) : Base(v) { }
virtual LLSD::Boolean asBoolean() const { return !mValue.empty(); }
virtual LLSD::Integer asInteger() const;
virtual LLSD::Real asReal() const;
virtual LLSD::String asString() const { return mValue; }
virtual LLSD::UUID asUUID() const { return LLUUID(mValue); }
virtual LLSD::Date asDate() const { return LLDate(mValue); }
virtual LLSD::URI asURI() const { return LLURI(mValue); }
virtual int size() const { return mValue.size(); }
virtual const LLSD::String& asStringRef() const { return mValue; }
LLSD::Boolean asBoolean() const override { return !mValue.empty(); }
LLSD::Integer asInteger() const override;
LLSD::Real asReal() const override;
LLSD::String asString() const override { return mValue; }
LLSD::UUID asUUID() const override { return LLUUID(mValue); }
LLSD::Date asDate() const override { return LLDate(mValue); }
LLSD::URI asURI() const override { return LLURI(mValue); }
int size() const override { return mValue.size(); }
const LLSD::String& asStringRef() const override { return mValue; }
};
LLSD::Integer ImplString::asInteger() const
@@ -302,18 +307,18 @@ namespace
}
class ImplUUID
class ImplUUID final
: public ImplBase<LLSD::TypeUUID, LLSD::UUID, const LLSD::UUID&>
{
public:
ImplUUID(const LLSD::UUID& v) : Base(v) { }
virtual LLSD::String asString() const{ return mValue.asString(); }
virtual LLSD::UUID asUUID() const { return mValue; }
LLSD::String asString() const override { return mValue.asString(); }
LLSD::UUID asUUID() const override { return mValue; }
};
class ImplDate
class ImplDate final
: public ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&>
{
public:
@@ -321,41 +326,42 @@ namespace
: ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&>(v)
{ }
virtual LLSD::Integer asInteger() const
LLSD::Integer asInteger() const override
{
return (LLSD::Integer)(mValue.secondsSinceEpoch());
}
virtual LLSD::Real asReal() const
LLSD::Real asReal() const override
{
return mValue.secondsSinceEpoch();
}
virtual LLSD::String asString() const{ return mValue.asString(); }
virtual LLSD::Date asDate() const { return mValue; }
LLSD::String asString() const override { return mValue.asString(); }
LLSD::Date asDate() const override { return mValue; }
};
class ImplURI
class ImplURI final
: public ImplBase<LLSD::TypeURI, LLSD::URI, const LLSD::URI&>
{
public:
ImplURI(const LLSD::URI& v) : Base(v) { }
virtual LLSD::String asString() const{ return mValue.asString(); }
virtual LLSD::URI asURI() const { return mValue; }
LLSD::String asString() const override { return mValue.asString(); }
LLSD::URI asURI() const override { return mValue; }
};
class ImplBinary
class ImplBinary final
: public ImplBase<LLSD::TypeBinary, LLSD::Binary, const LLSD::Binary&>
{
public:
ImplBinary(const LLSD::Binary& v) : Base(v) { }
virtual const LLSD::Binary& asBinary() const{ return mValue; }
const LLSD::Binary& asBinary() const override { return mValue; }
};
class ImplMap : public LLSD::Impl
class ImplMap final : public LLSD::Impl
{
private:
typedef std::map<LLSD::String, LLSD> DataMap;
@@ -368,33 +374,31 @@ namespace
public:
ImplMap() { }
virtual ImplMap& makeMap(LLSD::Impl*&);
ImplMap& makeMap(LLSD::Impl*&) override;
virtual LLSD::Type type() const { return LLSD::TypeMap; }
LLSD::Type type() const override { return LLSD::TypeMap; }
virtual LLSD::Boolean asBoolean() const { return !mData.empty(); }
LLSD::Boolean asBoolean() const override { return !mData.empty(); }
virtual bool has(const LLSD::String&) const;
bool has(const LLSD::String&) const override;
using LLSD::Impl::get; // Unhiding get(LLSD::Integer)
using LLSD::Impl::erase; // Unhiding erase(LLSD::Integer)
using LLSD::Impl::ref; // Unhiding ref(LLSD::Integer)
virtual LLSD get(const LLSD::String&) const;
virtual LLSD getKeys() const;
LLSD get(const LLSD::String&) const override;
LLSD getKeys() const override;
void insert(const LLSD::String& k, const LLSD& v);
virtual void erase(const LLSD::String&);
void erase(const LLSD::String&) override;
LLSD& ref(const LLSD::String&);
virtual const LLSD& ref(const LLSD::String&) const;
const LLSD& ref(const LLSD::String&) const override;
virtual int size() const { return mData.size(); }
int size() const override { return mData.size(); }
LLSD::map_iterator beginMap() { return mData.begin(); }
LLSD::map_iterator endMap() { return mData.end(); }
virtual LLSD::map_const_iterator beginMap() const { return mData.begin(); }
virtual LLSD::map_const_iterator endMap() const { return mData.end(); }
DataMap& map() final override { return mData; }
const DataMap& map() const final override { return mData; }
virtual void dumpStats() const;
virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
void dumpStats() const override;
void calcStats(S32 type_counts[], S32 share_counts[]) const override;
};
ImplMap& ImplMap::makeMap(LLSD::Impl*& var)
@@ -481,7 +485,7 @@ namespace
{
//std::cout << " " << (*iter).first << ": " << (*iter).second << std::endl;
Impl::calcStats((*iter).second, type_counts, share_counts);
iter++;
++iter;
}
// Add in the values for this map
@@ -489,7 +493,7 @@ namespace
}
class ImplArray : public LLSD::Impl
class ImplArray final : public LLSD::Impl
{
private:
typedef std::vector<LLSD> DataVector;
@@ -502,32 +506,28 @@ namespace
public:
ImplArray() { }
virtual ImplArray& makeArray(Impl*&);
ImplArray& makeArray(Impl*&) override;
virtual LLSD::Type type() const { return LLSD::TypeArray; }
LLSD::Type type() const override { return LLSD::TypeArray; }
virtual LLSD::Boolean asBoolean() const { return !mData.empty(); }
LLSD::Boolean asBoolean() const override { return !mData.empty(); }
using LLSD::Impl::get; // Unhiding get(LLSD::String)
using LLSD::Impl::erase; // Unhiding erase(LLSD::String)
using LLSD::Impl::ref; // Unhiding ref(LLSD::String)
virtual int size() const;
virtual LLSD get(LLSD::Integer) const;
int size() const override;
LLSD get(LLSD::Integer) const override;
void set(LLSD::Integer, const LLSD&);
void insert(LLSD::Integer, const LLSD&);
LLSD& append(const LLSD&);
virtual void erase(LLSD::Integer);
void erase(LLSD::Integer) override;
LLSD& ref(LLSD::Integer);
virtual const LLSD& ref(LLSD::Integer) const;
const LLSD& ref(LLSD::Integer) const override;
LLSD::array_iterator beginArray() { return mData.begin(); }
LLSD::array_iterator endArray() { return mData.end(); }
LLSD::reverse_array_iterator rbeginArray() { return mData.rbegin(); }
LLSD::reverse_array_iterator rendArray() { return mData.rend(); }
virtual LLSD::array_const_iterator beginArray() const { return mData.begin(); }
virtual LLSD::array_const_iterator endArray() const { return mData.end(); }
DataVector& array() final override { return mData; }
const DataVector& array() const final override { return mData; }
virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
void calcStats(S32 type_counts[], S32 share_counts[]) const override;
};
ImplArray& ImplArray::makeArray(Impl*& var)
@@ -631,7 +631,7 @@ namespace
while (iter != endArray())
{ // Add values for all items held in the array
Impl::calcStats((*iter), type_counts, share_counts);
iter++;
++iter;
}
// Add in the values for this array
@@ -703,7 +703,7 @@ void LLSD::Impl::assign(Impl*& var, const Impl* other)
void LLSD::Impl::assignUndefined(Impl*& var)
{
reset(var, 0);
reset(var, nullptr);
}
void LLSD::Impl::assign(Impl*& var, LLSD::Boolean v)
@@ -779,7 +779,7 @@ void LLSD::Impl::calcStats(S32 type_counts[], S32 share_counts[]) const
S32 tp = S32(type());
if (0 <= tp && tp < LLSD::TypeLLSDNumTypes)
{
type_counts[tp]++;
type_counts[tp]++;
if (shared())
{
share_counts[tp]++;
@@ -813,10 +813,10 @@ namespace
}
LLSD::LLSD() : impl(0) { ALLOC_LLSD_OBJECT; }
LLSD::~LLSD() { FREE_LLSD_OBJECT; Impl::reset(impl, 0); }
LLSD::LLSD() : impl(nullptr) { ALLOC_LLSD_OBJECT; }
LLSD::~LLSD() { FREE_LLSD_OBJECT; Impl::reset(impl, nullptr); }
LLSD::LLSD(const LLSD& other) : impl(0) { ALLOC_LLSD_OBJECT; assign(other); }
LLSD::LLSD(const LLSD& other) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(other); }
void LLSD::assign(const LLSD& other) { Impl::assign(impl, other.impl); }
@@ -825,17 +825,17 @@ void LLSD::clear() { Impl::assignUndefined(impl); }
LLSD::Type LLSD::type() const { return safe(impl).type(); }
// Scalar Constructors
LLSD::LLSD(Boolean v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(Integer v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(Real v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const UUID& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const String& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const Date& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const URI& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const Binary& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(Boolean v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(Integer v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(Real v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const UUID& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const String& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const Date& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const URI& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const Binary& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
// Convenience Constructors
LLSD::LLSD(F32 v) : impl(0) { ALLOC_LLSD_OBJECT; assign((Real)v); }
LLSD::LLSD(F32 v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign((Real)v); }
// Scalar Assignment
void LLSD::assign(Boolean v) { safe(impl).assign(impl, v); }
@@ -860,7 +860,7 @@ const LLSD::Binary& LLSD::asBinary() const { return safe(impl).asBinary(); }
const LLSD::String& LLSD::asStringRef() const { return safe(impl).asStringRef(); }
// const char * helpers
LLSD::LLSD(const char* v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const char* v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); }
void LLSD::assign(const char* v)
{
if(v) assign(std::string(v));
@@ -927,7 +927,7 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
// sStorage will point to the result of the last call. This will actually
// be one leak, but since this is used only when running under the
// debugger, it should not be an issue.
static char *sStorage = NULL;
static char *sStorage = nullptr;
delete[] sStorage;
std::string out_string;
{
@@ -938,7 +938,7 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
out << LLSDNotationStreamer(llsd);
out_string = out.str();
}
int len = out_string.length();
size_t len = out_string.length();
sStorage = new char[len + 1];
memcpy(sStorage, out_string.c_str(), len);
sStorage[len] = '\0';
@@ -957,18 +957,24 @@ const char *LLSD::dump(const LLSD &llsd)
return llsd_dump(llsd, false);
}
LLSD::map_iterator LLSD::beginMap() { return makeMap(impl).beginMap(); }
LLSD::map_iterator LLSD::endMap() { return makeMap(impl).endMap(); }
LLSD::map_const_iterator LLSD::beginMap() const { return safe(impl).beginMap(); }
LLSD::map_const_iterator LLSD::endMap() const { return safe(impl).endMap(); }
std::map<LLSD::String, LLSD>& LLSD::map() { return makeMap(impl).map(); }
const std::map<LLSD::String, LLSD>& LLSD::map() const { return safe(impl).map(); }
LLSD::array_iterator LLSD::beginArray() { return makeArray(impl).beginArray(); }
LLSD::array_iterator LLSD::endArray() { return makeArray(impl).endArray(); }
LLSD::array_const_iterator LLSD::beginArray() const{ return safe(impl).beginArray(); }
LLSD::array_const_iterator LLSD::endArray() const { return safe(impl).endArray(); }
LLSD::map_iterator LLSD::beginMap() { return map().begin(); }
LLSD::map_iterator LLSD::endMap() { return map().end(); }
LLSD::map_const_iterator LLSD::beginMap() const { return map().cbegin(); }
LLSD::map_const_iterator LLSD::endMap() const { return map().cend(); }
LLSD::reverse_array_iterator LLSD::rbeginArray() { return makeArray(impl).rbeginArray(); }
LLSD::reverse_array_iterator LLSD::rendArray() { return makeArray(impl).rendArray(); }
std::vector<LLSD>& LLSD::array() { return makeArray(impl).array(); }
const std::vector<LLSD>& LLSD::array() const { return safe(impl).array(); }
LLSD::array_iterator LLSD::beginArray() { return array().begin(); }
LLSD::array_iterator LLSD::endArray() { return array().end(); }
LLSD::array_const_iterator LLSD::beginArray() const{ return array().cbegin(); }
LLSD::array_const_iterator LLSD::endArray() const { return array().cend(); }
LLSD::reverse_array_iterator LLSD::rbeginArray() { return array().rbegin(); }
LLSD::reverse_array_iterator LLSD::rendArray() { return array().rend(); }
namespace llsd
{

View File

@@ -320,6 +320,8 @@ public:
typedef std::map<String, LLSD>::iterator map_iterator;
typedef std::map<String, LLSD>::const_iterator map_const_iterator;
std::map<String, LLSD>& map();
const std::map<String, LLSD>& map() const;
map_iterator beginMap();
map_iterator endMap();
map_const_iterator beginMap() const;
@@ -329,6 +331,8 @@ public:
typedef std::vector<LLSD>::const_iterator array_const_iterator;
typedef std::vector<LLSD>::reverse_iterator reverse_array_iterator;
std::vector<LLSD>& array();
const std::vector<LLSD>& array() const;
array_iterator beginArray();
array_iterator endArray();
array_const_iterator beginArray() const;
@@ -385,9 +389,9 @@ public:
using an arbitrary pointer or scalar type to std::string.
*/
//@{
LLSD(const void*); ///< construct from aribrary pointers
void assign(const void*); ///< assign from arbitrary pointers
LLSD& operator=(const void*); ///< assign from arbitrary pointers
LLSD(const void*) = delete; ///< construct from aribrary pointers
void assign(const void*) = delete; ///< assign from arbitrary pointers
LLSD& operator=(const void*) = delete; ///< assign from arbitrary pointers
bool has(Integer) const; ///< has() only works for Maps
//@}

View File

@@ -79,6 +79,17 @@ LLSD LlsdFromJson(const nlohmann::json &val)
return result;
}
LLSD LlsdFromJsonString(const std::string& str)
{
auto json = nlohmann::json::parse(str, nullptr, false);
if (json.is_discarded())
{
LL_WARNS() << "Cannot parse invalid json string:\n" << str << LL_ENDL;
return LLSD();
}
return LlsdFromJson(json);
}
//=========================================================================
nlohmann::json LlsdToJson(const LLSD &val)
{
@@ -111,9 +122,9 @@ nlohmann::json LlsdToJson(const LLSD &val)
}
break;
case LLSD::TypeArray:
for (LLSD::array_const_iterator it = val.beginArray(); it != val.endArray(); ++it)
for (auto const& entry : val.array())
{
result.push_back(LlsdToJson(*it));
result.push_back(LlsdToJson(entry));
}
break;
case LLSD::TypeBinary:

View File

@@ -54,6 +54,7 @@
/// For maps and arrays child entries will be converted and added to the structure.
/// Order is preserved for an array but not for objects.
LLSD LlsdFromJson(const nlohmann::json &val);
LLSD LlsdFromJsonString(const std::string& body);
/// Convert an LLSD object into Parsed JSON object maintaining member names and
/// array indexs.

View File

@@ -267,12 +267,10 @@ void LLParamSDParserUtilities::readSDValues(read_sd_cb_t cb, const LLSD& sd, LLI
}
else if (sd.isArray())
{
for (LLSD::array_const_iterator it = sd.beginArray();
it != sd.endArray();
++it)
for (auto const& entry : sd.array())
{
stack.push_back(make_pair(std::string(), true));
readSDValues(cb, *it, stack);
readSDValues(cb, entry, stack);
stack.pop_back();
}
}

View File

@@ -118,7 +118,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
fail_if_not_legacy = true;
}
if (!strncasecmp(LEGACY_NON_HEADER, hdr_buf, strlen(LEGACY_NON_HEADER))) /* Flawfinder: ignore */
if (!strnicmp(LEGACY_NON_HEADER, hdr_buf, strlen(LEGACY_NON_HEADER))) /* Flawfinder: ignore */
{
legacy_no_header = true;
inbuf = (int)str.gcount();
@@ -141,9 +141,8 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
}
header = hdr_buf;
std::string::size_type start = std::string::npos;
std::string::size_type start = header.find_first_not_of("<? ");
std::string::size_type end = std::string::npos;
start = header.find_first_not_of("<? ");
if (start != std::string::npos)
{
end = header.find_first_of(" ?", start);
@@ -1304,8 +1303,8 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32
}
bool need_comma = false;
LLSD::map_const_iterator iter = data.beginMap();
LLSD::map_const_iterator end = data.endMap();
auto iter = data.beginMap();
auto end = data.endMap();
for(; iter != end; ++iter)
{
if(need_comma) ostr << ",";
@@ -1323,13 +1322,11 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32
{
ostr << post << pre << "[";
bool need_comma = false;
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
for(; iter != end; ++iter)
for (const auto& entry : data.array())
{
if(need_comma) ostr << ",";
if (need_comma) ostr << ",";
need_comma = true;
format_count += format_impl(*iter, ostr, options, level + 1);
format_count += format_impl(entry, ostr, options, level + 1);
}
ostr << "]";
break;
@@ -1392,22 +1389,22 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32
// *FIX: memory inefficient.
const std::vector<U8>& buffer = data.asBinary();
ostr << "b(" << buffer.size() << ")\"";
if(buffer.size())
if(!buffer.empty())
{
if (options & LLSDFormatter::OPTIONS_PRETTY_BINARY)
{
std::ios_base::fmtflags old_flags = ostr.flags();
ostr.setf( std::ios::hex, std::ios::basefield );
ostr << "0x";
for (size_t i = 0; i < buffer.size(); i++)
for (unsigned char i : buffer)
{
ostr << (int) buffer[i];
ostr << static_cast<int>(i);
}
ostr.flags(old_flags);
}
else
{
ostr.write((const char*)&buffer[0], buffer.size());
ostr.write(reinterpret_cast<const char*>(&buffer[0]), buffer.size());
}
}
ostr << "\"";
@@ -1444,9 +1441,9 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
{
ostr.put('{');
U32 size_nbo = htonl(data.size());
ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::map_const_iterator iter = data.beginMap();
LLSD::map_const_iterator end = data.endMap();
ostr.write(reinterpret_cast<const char*>(&size_nbo), sizeof(U32));
auto iter = data.beginMap();
auto end = data.endMap();
for(; iter != end; ++iter)
{
ostr.put('k');
@@ -1461,12 +1458,10 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
{
ostr.put('[');
U32 size_nbo = htonl(data.size());
ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
for(; iter != end; ++iter)
ostr.write(reinterpret_cast<const char*>(&size_nbo), sizeof(U32));
for (const auto& entry : data.array())
{
format_count += format(*iter, ostr);
format_count += format(entry, ostr);
}
ostr.put(']');
break;
@@ -1529,7 +1524,7 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
const std::vector<U8>& buffer = data.asBinary();
U32 size_nbo = htonl(buffer.size());
ostr.write((const char*)(&size_nbo), sizeof(U32));
if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size());
if(!buffer.empty()) ostr.write((const char*)&buffer[0], buffer.size());
break;
}
@@ -1706,12 +1701,12 @@ int deserialize_string_raw(
// *FIX: This is memory inefficient.
S32 len = strtol(buf + 1, NULL, 0);
if((max_bytes>0)&&(len>max_bytes)) return LLSDParser::PARSE_FAILURE;
std::vector<char> buf;
std::vector<char> buf2;
if(len)
{
buf.resize(len);
count += (int)fullread(istr, (char *)&buf[0], len);
value.assign(buf.begin(), buf.end());
buf2.resize(len);
count += (int)fullread(istr, (char *)&buf2[0], len);
value.assign(buf2.begin(), buf2.end());
}
c = istr.get();
++count;
@@ -2095,7 +2090,18 @@ std::string zip_llsd(LLSD& data)
}
have = CHUNK-strm.avail_out;
output = (U8*) realloc(output, cur_size+have);
U8* new_output = (U8*) realloc(output, cur_size+have);
if (new_output == NULL)
{
LL_WARNS() << "Failed to compress LLSD block: can't reallocate memory, current size: " << cur_size << " bytes; requested " << cur_size + have << " bytes." << LL_ENDL;
deflateEnd(&strm);
if (output)
{
free(output);
}
return std::string();
}
output = new_output;
memcpy(output+cur_size, out, have);
cur_size += have;
}
@@ -2114,15 +2120,6 @@ std::string zip_llsd(LLSD& data)
deflateEnd(&strm);
free(output);
#if 0 //verify results work with unzip_llsd
std::istringstream test(result);
LLSD test_sd;
if (!unzip_llsd(test_sd, test, result.size()))
{
LL_ERRS() << "Invalid compression result!" << LL_ENDL;
}
#endif
return result;
}
@@ -2173,7 +2170,19 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
U32 have = CHUNK-strm.avail_out;
result = (U8*) realloc(result, cur_size + have);
U8* new_result = (U8*)realloc(result, cur_size + have);
if (new_result == NULL)
{
LL_WARNS() << "Failed to unzip LLSD block: can't reallocate memory, current size: " << cur_size << " bytes; requested " << cur_size + have << " bytes." << LL_ENDL;
inflateEnd(&strm);
if (result)
{
free(result);
}
delete in;
return false;
}
result = new_result;
memcpy(result+cur_size, out, have);
cur_size += have;
@@ -2219,6 +2228,11 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
//and trailers are different for the formats.
U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32 size )
{
if (size == 0)
{
LL_WARNS() << "No data to unzip." << LL_ENDL;
return NULL;
}
U8* result = NULL;
U32 cur_size = 0;
z_stream strm;
@@ -2258,7 +2272,23 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32
}
U32 have = CHUNK-strm.avail_out;
result = (U8*) realloc(result, cur_size + have);
U8* new_result = (U8*) realloc(result, cur_size + have);
if (new_result == NULL)
{
LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size
<< " bytes; requested " << cur_size + have
<< " bytes; total syze: ." << size << " bytes."
<< LL_ENDL;
inflateEnd(&strm);
if (result)
{
free(result);
}
delete [] in;
valid = false;
return NULL;
}
result = new_result;
memcpy(result+cur_size, out, have);
cur_size += have;

View File

@@ -116,11 +116,9 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti
else
{
ostr << pre << "<array>" << post;
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
for(; iter != end; ++iter)
for (const auto& entry : data.array())
{
format_count += format_impl(*iter, ostr, options, level + 1);
format_count += format_impl(entry, ostr, options, level + 1);
}
ostr << pre << "</array>" << post;
}

View File

@@ -891,9 +891,9 @@ LLSD llsd_clone(LLSD value, LLSD filter)
break;
case LLSD::TypeArray:
clone = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
clone.append(llsd_clone(*ita, filter));
clone.append(llsd_clone(entry, filter));
}
break;
@@ -943,9 +943,9 @@ LLSD llsd_shallow(LLSD value, LLSD filter)
else if (value.isArray())
{
shallow = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
shallow.append(*ita);
shallow.append(entry);
}
}
else

View File

@@ -139,7 +139,7 @@ bool skip_to_end_of_next_keyword(const char* keyword, std::istream& input_stream
}
else
{
int key_index = 1;
size_t key_index = 1;
while ( key_index < key_length
&& keyword[key_index - 1] == c
&& input_stream.good())

View File

@@ -577,7 +577,7 @@ std::string utf8str_truncate(const std::string& utf8str, const S32 max_len)
}
// [RLVa:KB] - Checked: RLVa-2.1.0
std::string utf8str_substr(const std::string& utf8str, const S32 index, const S32 max_len)
std::string utf8str_substr(const std::string& utf8str, const size_t index, const size_t max_len)
{
if (0 == max_len)
{
@@ -589,7 +589,7 @@ std::string utf8str_substr(const std::string& utf8str, const S32 index, const S3
}
else
{
S32 cur_char = max_len;
size_t cur_char = max_len;
// If we're ASCII, we don't need to do anything
if ((U8)utf8str[index + cur_char] > 0x7f)
@@ -648,7 +648,7 @@ void utf8str_split(std::list<std::string>& split_list, const std::string& utf8st
}
// [/RLVa:KB]
std::string utf8str_symbol_truncate(const std::string& utf8str, const S32 symbol_len)
std::string utf8str_symbol_truncate(const std::string& utf8str, const size_t symbol_len)
{
if (0 == symbol_len)
{
@@ -660,7 +660,7 @@ std::string utf8str_symbol_truncate(const std::string& utf8str, const S32 symbol
}
else
{
int len = 0, byteIndex = 0;
size_t len = 0, byteIndex = 0;
const char* aStr = utf8str.c_str();
size_t origSize = utf8str.size();
@@ -1340,7 +1340,8 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
// std::locale() throws if the locale is unknown! (EXT-7926)
try
{
strStream.imbue(std::locale(sLocale.c_str()));
std::locale locale(sLocale.c_str());
strStream.imbue(locale);
} catch (const std::exception &)
{
LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL;

View File

@@ -243,7 +243,7 @@ public:
bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; }
std::size_t length() const { return mString.length(); }
// The destructor may not throw.
~LLFormatMapString() throw() { }
~LLFormatMapString() noexcept { }
private:
std::string mString;

View File

@@ -702,28 +702,10 @@ LLMemoryInfo::LLMemoryInfo()
refresh();
}
#if LL_WINDOWS
static U32Kilobytes LLMemoryAdjustKBResult(U32Kilobytes inKB)
{
// Moved this here from llfloaterabout.cpp
//! \bug
// For some reason, the reported amount of memory is always wrong.
// The original adjustment assumes it's always off by one meg, however
// errors of as much as 2520 KB have been observed in the value
// returned from the GetMemoryStatusEx function. Here we keep the
// original adjustment from llfoaterabout.cpp until this can be
// fixed somehow.
inKB += U32Megabytes(1);
return inKB;
}
#endif
U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const
{
#if LL_WINDOWS
return LLMemoryAdjustKBResult(U32Kilobytes(mStatsMap["Total Physical KB"].asInteger()));
return U32Kilobytes(mStatsMap["Total Physical KB"].asInteger());
#elif LL_DARWIN
// This might work on Linux as well. Someone check...
@@ -740,43 +722,22 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const
phys = (U64)(getpagesize()) * (U64)(get_phys_pages());
return U64Bytes(phys);
#elif LL_SOLARIS
U64 phys = 0;
phys = (U64)(getpagesize()) * (U64)(sysconf(_SC_PHYS_PAGES));
return U64Bytes(phys);
#else
return 0;
#endif
}
U32Bytes LLMemoryInfo::getPhysicalMemoryClamped() const
{
// Return the total physical memory in bytes, but clamp it
// to no more than U32_MAX
U32Kilobytes phys_kb = getPhysicalMemoryKB();
if (phys_kb >= U32Gigabytes(4))
{
return U32Bytes(U32_MAX);
}
else
{
return phys_kb;
}
}
//static
void LLMemoryInfo::getAvailableMemoryKB(U32Kilobytes& avail_physical_mem_kb, U32Kilobytes& avail_virtual_mem_kb)
{
#if LL_WINDOWS
// Sigh, this shouldn't be a static method, then we wouldn't have to
// reload this data separately from refresh()
LLSD statsMap(loadStatsMap());
MEMORYSTATUSEX state;
state.dwLength = sizeof(state);
GlobalMemoryStatusEx(&state);
avail_physical_mem_kb = (U32Kilobytes)statsMap["Avail Physical KB"].asInteger();
avail_virtual_mem_kb = (U32Kilobytes)statsMap["Avail Virtual KB"].asInteger();
avail_physical_mem_kb = U64Bytes(state.ullAvailPhys);
avail_virtual_mem_kb = U64Bytes(state.ullAvailVirtual);
#elif LL_DARWIN
// mStatsMap is derived from vm_stat, look for (e.g.) "kb free":
@@ -924,7 +885,7 @@ LLSD LLMemoryInfo::loadStatsMap()
DWORDLONG div = 1024;
stats.add("Percent Memory use", state.dwMemoryLoad/div);
stats.add("Percent Memory use", state.dwMemoryLoad);
stats.add("Total Physical KB", state.ullTotalPhys/div);
stats.add("Avail Physical KB", state.ullAvailPhys/div);
stats.add("Total page KB", state.ullTotalPageFile/div);
@@ -973,27 +934,33 @@ LLSD LLMemoryInfo::loadStatsMap()
stats.add("PrivateUsage KB", pmem.PrivateUsage/div);
#elif LL_DARWIN
const vm_size_t pagekb(vm_page_size / 1024);
vm_size_t page_size_kb;
if (host_page_size(mach_host_self(), &page_size_kb) != KERN_SUCCESS)
{
LL_WARNS() << "Unable to get host page size. Using default value." << LL_ENDL;
page_size_kb = 4096;
}
page_size_kb = page_size_kb / 1024;
//
// Collect the vm_stat's
//
{
vm_statistics_data_t vmstat;
mach_msg_type_number_t vmstatCount = HOST_VM_INFO_COUNT;
vm_statistics64_data_t vmstat;
mach_msg_type_number_t vmstatCount = HOST_VM_INFO64_COUNT;
if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstat, &vmstatCount) != KERN_SUCCESS)
if (host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info64_t) &vmstat, &vmstatCount) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect memory information" << LL_ENDL;
}
else
{
stats.add("Pages free KB", pagekb * vmstat.free_count);
stats.add("Pages active KB", pagekb * vmstat.active_count);
stats.add("Pages inactive KB", pagekb * vmstat.inactive_count);
stats.add("Pages wired KB", pagekb * vmstat.wire_count);
stats.add("Pages free KB", page_size_kb * vmstat.free_count);
stats.add("Pages active KB", page_size_kb * vmstat.active_count);
stats.add("Pages inactive KB", page_size_kb * vmstat.inactive_count);
stats.add("Pages wired KB", page_size_kb * vmstat.wire_count);
stats.add("Pages zero fill", vmstat.zero_fill_count);
stats.add("Page reactivations", vmstat.reactivations);
@@ -1042,20 +1009,20 @@ LLSD LLMemoryInfo::loadStatsMap()
//
{
task_basic_info_64_data_t taskinfo;
unsigned taskinfoSize = sizeof(taskinfo);
if (task_info(mach_task_self(), TASK_BASIC_INFO_64, (task_info_t) &taskinfo, &taskinfoSize) != KERN_SUCCESS)
mach_task_basic_info_data_t taskinfo;
mach_msg_type_number_t task_count = MACH_TASK_BASIC_INFO_COUNT;
if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t) &taskinfo, &task_count) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
}
else
{
stats.add("Basic suspend count", taskinfo.suspend_count);
stats.add("Basic virtual memory KB", taskinfo.virtual_size / 1024);
stats.add("Basic resident memory KB", taskinfo.resident_size / 1024);
stats.add("Basic new thread policy", taskinfo.policy);
}
LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
}
else
{
stats.add("Basic virtual memory KB", taskinfo.virtual_size / 1024);
stats.add("Basic resident memory KB", taskinfo.resident_size / 1024);
stats.add("Basic max resident memory KB", taskinfo.resident_size_max / 1024);
stats.add("Basic new thread policy", taskinfo.policy);
stats.add("Basic suspend count", taskinfo.suspend_count);
}
}
#elif LL_SOLARIS
@@ -1307,7 +1274,7 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
const S32 UNCOMPRESS_BUFFER_SIZE = 32768;
BOOL retval = FALSE;
gzFile src = NULL;
U8 buffer[UNCOMPRESS_BUFFER_SIZE];
std::array<U8, UNCOMPRESS_BUFFER_SIZE> buffer;
LLFILE *dst = NULL;
S32 bytes = 0;
tmpfile = dstfile + ".t";
@@ -1321,8 +1288,8 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
if (! dst) goto err;
do
{
bytes = gzread(src, buffer, UNCOMPRESS_BUFFER_SIZE);
size_t nwrit = fwrite(buffer, sizeof(U8), bytes, dst);
bytes = gzread(src, buffer.data(), buffer.size());
size_t nwrit = fwrite(buffer.data(), sizeof(U8), bytes, dst);
if (nwrit < (size_t) bytes)
{
LL_WARNS() << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << LL_ENDL;
@@ -1344,7 +1311,7 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
const S32 COMPRESS_BUFFER_SIZE = 32768;
std::string tmpfile;
BOOL retval = FALSE;
U8 buffer[COMPRESS_BUFFER_SIZE];
std::array<U8, COMPRESS_BUFFER_SIZE> buffer;
gzFile dst = NULL;
LLFILE *src = NULL;
S32 bytes = 0;
@@ -1358,9 +1325,9 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */
if (! src) goto err;
while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0)
while ((bytes = (S32)fread(buffer.data(), sizeof(U8), buffer.size(), src)) > 0)
{
if (gzwrite(dst, buffer, bytes) <= 0)
if (gzwrite(dst, buffer.data(), bytes) <= 0)
{
LL_WARNS() << "gzwrite failed: " << gzerror(dst, NULL) << LL_ENDL;
goto err;

View File

@@ -114,11 +114,6 @@ public:
U32Kilobytes getPhysicalMemoryKB() const;
/*! Memory size in bytes, if total memory is >= 4GB then U32_MAX will
** be returned.
*/
U32Bytes getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes
//get the available memory infomation in KiloBytes.
static void getAvailableMemoryKB(U32Kilobytes& avail_physical_mem_kb, U32Kilobytes& avail_virtual_mem_kb);

View File

@@ -17,7 +17,6 @@ include_directories(
set(llinventory_SOURCE_FILES
llcategory.cpp
lleconomy.cpp
llfoldertype.cpp
llinventory.cpp
llinventorydefines.cpp
@@ -40,7 +39,6 @@ set(llinventory_HEADER_FILES
CMakeLists.txt
llcategory.h
lleconomy.h
llfoldertype.h
llinventory.h
llinventorydefines.h

View File

@@ -1,288 +0,0 @@
/**
* @file lleconomy.cpp
*
* $LicenseInfo:firstyear=2002&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 "lleconomy.h"
#include "llerror.h"
#include "message.h"
#include "v3math.h"
LLGlobalEconomy::LLGlobalEconomy()
: mObjectCount( -1 ),
mObjectCapacity( -1 ),
mPriceObjectClaim( -1 ),
mPricePublicObjectDecay( -1 ),
mPricePublicObjectDelete( -1 ),
mPriceEnergyUnit( -1 ),
mPriceUpload( -1 ),
mPriceRentLight( -1 ),
mTeleportMinPrice( -1 ),
mTeleportPriceExponent( -1 ),
mPriceGroupCreate( -1 )
{ }
LLGlobalEconomy::~LLGlobalEconomy()
{ }
void LLGlobalEconomy::addObserver(LLEconomyObserver* observer)
{
mObservers.push_back(observer);
}
void LLGlobalEconomy::removeObserver(LLEconomyObserver* observer)
{
std::list<LLEconomyObserver*>::iterator it =
std::find(mObservers.begin(), mObservers.end(), observer);
if (it != mObservers.end())
{
mObservers.erase(it);
}
}
void LLGlobalEconomy::notifyObservers()
{
for (std::list<LLEconomyObserver*>::iterator it = mObservers.begin();
it != mObservers.end();
++it)
{
(*it)->onEconomyDataChange();
}
}
// static
void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data)
{
S32 i;
F32 f;
msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCapacity, i);
econ_data->setObjectCapacity(i);
msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCount, i);
econ_data->setObjectCount(i);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceEnergyUnit, i);
econ_data->setPriceEnergyUnit(i);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceObjectClaim, i);
econ_data->setPriceObjectClaim(i);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDecay, i);
econ_data->setPricePublicObjectDecay(i);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDelete, i);
econ_data->setPricePublicObjectDelete(i);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceUpload, i);
econ_data->setPriceUpload(i);
#if LL_LINUX
// We can optionally fake the received upload price for testing.
// Note that the server is within its rights to not obey our fake
// price. :)
const char* fakeprice_str = getenv("LL_FAKE_UPLOAD_PRICE");
if (fakeprice_str)
{
S32 fakeprice = (S32)atoi(fakeprice_str);
LL_WARNS() << "LL_FAKE_UPLOAD_PRICE: Faking upload price as L$" << fakeprice << LL_ENDL;
econ_data->setPriceUpload(fakeprice);
}
#endif
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceRentLight, i);
econ_data->setPriceRentLight(i);
msg->getS32Fast(_PREHASH_Info, _PREHASH_TeleportMinPrice, i);
econ_data->setTeleportMinPrice(i);
msg->getF32Fast(_PREHASH_Info, _PREHASH_TeleportPriceExponent, f);
econ_data->setTeleportPriceExponent(f);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i);
econ_data->setPriceGroupCreate(i);
econ_data->notifyObservers();
}
S32 LLGlobalEconomy::calculateTeleportCost(F32 distance) const
{
S32 min_cost = getTeleportMinPrice();
F32 exponent = getTeleportPriceExponent();
F32 divisor = 100.f * pow(3.f, exponent);
S32 cost = (U32)(distance * pow(log10(distance), exponent) / divisor);
if (cost < 0)
{
cost = 0;
}
else if (cost < min_cost)
{
cost = min_cost;
}
return cost;
}
S32 LLGlobalEconomy::calculateLightRent(const LLVector3& object_size) const
{
F32 intensity_mod = llmax(object_size.magVec(), 1.f);
return (S32)(intensity_mod * getPriceRentLight());
}
void LLGlobalEconomy::print()
{
LL_INFOS() << "Global Economy Settings: " << LL_ENDL;
LL_INFOS() << "Object Capacity: " << mObjectCapacity << LL_ENDL;
LL_INFOS() << "Object Count: " << mObjectCount << LL_ENDL;
LL_INFOS() << "Claim Price Per Object: " << mPriceObjectClaim << LL_ENDL;
LL_INFOS() << "Claim Price Per Public Object: " << mPricePublicObjectDecay << LL_ENDL;
LL_INFOS() << "Delete Price Per Public Object: " << mPricePublicObjectDelete << LL_ENDL;
LL_INFOS() << "Release Price Per Public Object: " << getPricePublicObjectRelease() << LL_ENDL;
LL_INFOS() << "Price Per Energy Unit: " << mPriceEnergyUnit << LL_ENDL;
LL_INFOS() << "Price Per Upload: " << mPriceUpload << LL_ENDL;
LL_INFOS() << "Light Base Price: " << mPriceRentLight << LL_ENDL;
LL_INFOS() << "Teleport Min Price: " << mTeleportMinPrice << LL_ENDL;
LL_INFOS() << "Teleport Price Exponent: " << mTeleportPriceExponent << LL_ENDL;
LL_INFOS() << "Price for group creation: " << mPriceGroupCreate << LL_ENDL;
}
LLRegionEconomy::LLRegionEconomy()
: LLGlobalEconomy(),
mPriceObjectRent( -1.f ),
mPriceObjectScaleFactor( -1.f ),
mEnergyEfficiency( -1.f ),
mBasePriceParcelClaimDefault(-1),
mBasePriceParcelClaimActual(-1),
mPriceParcelClaimFactor(-1.f),
mBasePriceParcelRent(-1),
mAreaOwned(-1.f),
mAreaTotal(-1.f)
{ }
LLRegionEconomy::~LLRegionEconomy()
{ }
BOOL LLRegionEconomy::hasData() const
{
return (mBasePriceParcelRent != -1);
}
// static
void LLRegionEconomy::processEconomyData(LLMessageSystem *msg, void** user_data)
{
S32 i;
F32 f;
LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data;
LLGlobalEconomy::processEconomyData(msg, this_ptr);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceParcelClaim, i);
this_ptr->setBasePriceParcelClaimDefault(i);
msg->getF32(_PREHASH_Info, _PREHASH_PriceParcelClaimFactor, f);
this_ptr->setPriceParcelClaimFactor(f);
msg->getF32Fast(_PREHASH_Info, _PREHASH_EnergyEfficiency, f);
this_ptr->setEnergyEfficiency(f);
msg->getF32Fast(_PREHASH_Info, _PREHASH_PriceObjectRent, f);
this_ptr->setPriceObjectRent(f);
msg->getF32Fast(_PREHASH_Info, _PREHASH_PriceObjectScaleFactor, f);
this_ptr->setPriceObjectScaleFactor(f);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceParcelRent, i);
this_ptr->setBasePriceParcelRent(i);
}
// static
void LLRegionEconomy::processEconomyDataRequest(LLMessageSystem *msg, void **user_data)
{
LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data;
if (!this_ptr->hasData())
{
LL_WARNS() << "Dropping EconomyDataRequest, because EconomyData message "
<< "has not been processed" << LL_ENDL;
}
msg->newMessageFast(_PREHASH_EconomyData);
msg->nextBlockFast(_PREHASH_Info);
msg->addS32Fast(_PREHASH_ObjectCapacity, this_ptr->getObjectCapacity());
msg->addS32Fast(_PREHASH_ObjectCount, this_ptr->getObjectCount());
msg->addS32Fast(_PREHASH_PriceEnergyUnit, this_ptr->getPriceEnergyUnit());
msg->addS32Fast(_PREHASH_PriceObjectClaim, this_ptr->getPriceObjectClaim());
msg->addS32Fast(_PREHASH_PricePublicObjectDecay, this_ptr->getPricePublicObjectDecay());
msg->addS32Fast(_PREHASH_PricePublicObjectDelete, this_ptr->getPricePublicObjectDelete());
msg->addS32Fast(_PREHASH_PriceParcelClaim, this_ptr->mBasePriceParcelClaimActual);
msg->addF32Fast(_PREHASH_PriceParcelClaimFactor, this_ptr->mPriceParcelClaimFactor);
msg->addS32Fast(_PREHASH_PriceUpload, this_ptr->getPriceUpload());
msg->addS32Fast(_PREHASH_PriceRentLight, this_ptr->getPriceRentLight());
msg->addS32Fast(_PREHASH_TeleportMinPrice, this_ptr->getTeleportMinPrice());
msg->addF32Fast(_PREHASH_TeleportPriceExponent, this_ptr->getTeleportPriceExponent());
msg->addF32Fast(_PREHASH_EnergyEfficiency, this_ptr->getEnergyEfficiency());
msg->addF32Fast(_PREHASH_PriceObjectRent, this_ptr->getPriceObjectRent());
msg->addF32Fast(_PREHASH_PriceObjectScaleFactor, this_ptr->getPriceObjectScaleFactor());
msg->addS32Fast(_PREHASH_PriceParcelRent, this_ptr->getPriceParcelRent());
msg->addS32Fast(_PREHASH_PriceGroupCreate, this_ptr->getPriceGroupCreate());
msg->sendReliable(msg->getSender());
}
S32 LLRegionEconomy::getPriceParcelClaim() const
{
//return (S32)((F32)mBasePriceParcelClaim * (mAreaTotal / (mAreaTotal - mAreaOwned)));
return (S32)((F32)mBasePriceParcelClaimActual * mPriceParcelClaimFactor);
}
S32 LLRegionEconomy::getPriceParcelRent() const
{
return mBasePriceParcelRent;
}
void LLRegionEconomy::print()
{
this->LLGlobalEconomy::print();
LL_INFOS() << "Region Economy Settings: " << LL_ENDL;
LL_INFOS() << "Land (square meters): " << mAreaTotal << LL_ENDL;
LL_INFOS() << "Owned Land (square meters): " << mAreaOwned << LL_ENDL;
LL_INFOS() << "Daily Object Rent: " << mPriceObjectRent << LL_ENDL;
LL_INFOS() << "Daily Land Rent (per meter): " << getPriceParcelRent() << LL_ENDL;
LL_INFOS() << "Energey Efficiency: " << mEnergyEfficiency << LL_ENDL;
}
void LLRegionEconomy::setBasePriceParcelClaimDefault(S32 val)
{
mBasePriceParcelClaimDefault = val;
if(mBasePriceParcelClaimActual == -1)
{
mBasePriceParcelClaimActual = val;
}
}
void LLRegionEconomy::setBasePriceParcelClaimActual(S32 val)
{
mBasePriceParcelClaimActual = val;
}
void LLRegionEconomy::setPriceParcelClaimFactor(F32 val)
{
mPriceParcelClaimFactor = val;
}
void LLRegionEconomy::setBasePriceParcelRent(S32 val)
{
mBasePriceParcelRent = val;
}

View File

@@ -1,159 +0,0 @@
/**
* @file lleconomy.h
*
* $LicenseInfo:firstyear=2002&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_LLECONOMY_H
#define LL_LLECONOMY_H
#include "llsingleton.h"
class LLMessageSystem;
class LLVector3;
/**
* Register an observer to be notified of economy data updates coming from server.
*/
class LLEconomyObserver
{
public:
virtual ~LLEconomyObserver() {}
virtual void onEconomyDataChange() = 0;
};
class LLGlobalEconomy
{
public:
LLGlobalEconomy();
virtual ~LLGlobalEconomy();
// This class defines its singleton internally as a typedef instead of inheriting from
// LLSingleton like most others because the LLRegionEconomy sub-class might also
// become a singleton and this pattern will more easily disambiguate them.
typedef LLSingleton<LLGlobalEconomy> Singleton;
void initSingleton() { }
virtual void print();
void addObserver(LLEconomyObserver* observer);
void removeObserver(LLEconomyObserver* observer);
void notifyObservers();
static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data);
S32 calculateTeleportCost(F32 distance) const;
S32 calculateLightRent(const LLVector3& object_size) const;
S32 getObjectCount() const { return mObjectCount; }
S32 getObjectCapacity() const { return mObjectCapacity; }
S32 getPriceObjectClaim() const { return mPriceObjectClaim; }
S32 getPricePublicObjectDecay() const { return mPricePublicObjectDecay; }
S32 getPricePublicObjectDelete() const { return mPricePublicObjectDelete; }
S32 getPricePublicObjectRelease() const { return mPriceObjectClaim - mPricePublicObjectDelete; }
S32 getPriceEnergyUnit() const { return mPriceEnergyUnit; }
S32 getPriceUpload() const { return mPriceUpload; }
S32 getPriceRentLight() const { return mPriceRentLight; }
S32 getTeleportMinPrice() const { return mTeleportMinPrice; }
F32 getTeleportPriceExponent() const { return mTeleportPriceExponent; }
S32 getPriceGroupCreate() const { return mPriceGroupCreate; }
void setObjectCount(S32 val) { mObjectCount = val; }
void setObjectCapacity(S32 val) { mObjectCapacity = val; }
void setPriceObjectClaim(S32 val) { mPriceObjectClaim = val; }
void setPricePublicObjectDecay(S32 val) { mPricePublicObjectDecay = val; }
void setPricePublicObjectDelete(S32 val) { mPricePublicObjectDelete = val; }
void setPriceEnergyUnit(S32 val) { mPriceEnergyUnit = val; }
void setPriceUpload(S32 val) { mPriceUpload = val; }
void setPriceRentLight(S32 val) { mPriceRentLight = val; }
void setTeleportMinPrice(S32 val) { mTeleportMinPrice = val; }
void setTeleportPriceExponent(F32 val) { mTeleportPriceExponent = val; }
void setPriceGroupCreate(S32 val) { mPriceGroupCreate = val; }
private:
S32 mObjectCount;
S32 mObjectCapacity;
S32 mPriceObjectClaim; // per primitive
S32 mPricePublicObjectDecay; // per primitive
S32 mPricePublicObjectDelete; // per primitive
S32 mPriceEnergyUnit;
S32 mPriceUpload;
S32 mPriceRentLight;
S32 mTeleportMinPrice;
F32 mTeleportPriceExponent;
S32 mPriceGroupCreate;
std::list<LLEconomyObserver*> mObservers;
};
class LLRegionEconomy : public LLGlobalEconomy
{
public:
LLRegionEconomy();
~LLRegionEconomy();
static void processEconomyData(LLMessageSystem *msg, void **user_data);
static void processEconomyDataRequest(LLMessageSystem *msg, void **user_data);
void print();
BOOL hasData() const;
F32 getPriceObjectRent() const { return mPriceObjectRent; }
F32 getPriceObjectScaleFactor() const {return mPriceObjectScaleFactor;}
F32 getEnergyEfficiency() const { return mEnergyEfficiency; }
S32 getPriceParcelClaim() const;
S32 getPriceParcelRent() const;
F32 getAreaOwned() const { return mAreaOwned; }
F32 getAreaTotal() const { return mAreaTotal; }
S32 getBasePriceParcelClaimActual() const { return mBasePriceParcelClaimActual; }
void setPriceObjectRent(F32 val) { mPriceObjectRent = val; }
void setPriceObjectScaleFactor(F32 val) { mPriceObjectScaleFactor = val; }
void setEnergyEfficiency(F32 val) { mEnergyEfficiency = val; }
void setBasePriceParcelClaimDefault(S32 val);
void setBasePriceParcelClaimActual(S32 val);
void setPriceParcelClaimFactor(F32 val);
void setBasePriceParcelRent(S32 val);
void setAreaOwned(F32 val) { mAreaOwned = val; }
void setAreaTotal(F32 val) { mAreaTotal = val; }
private:
F32 mPriceObjectRent;
F32 mPriceObjectScaleFactor;
F32 mEnergyEfficiency;
S32 mBasePriceParcelClaimDefault;
S32 mBasePriceParcelClaimActual;
F32 mPriceParcelClaimFactor;
S32 mBasePriceParcelRent;
F32 mAreaOwned;
F32 mAreaTotal;
};
#endif

View File

@@ -1165,8 +1165,10 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new)
// mType, these are the two asset types that are IT_WEARABLE:
static U32 AT_BODYPART = 13; // LLAssetType::AT_BODYPART
// Viewer local values:
static U32 WT_UNKNOWN = 16; // LLWearableType::WT_UNKNOWN
static U32 WT_COUNT = 17; // LLWearableType::WT_COUNT
static U32 WT_UNKNOWN = 17; // LLWearableType::WT_UNKNOWN
static U32 WT_COUNT = 18; // LLWearableType::WT_COUNT
// Keep WT_UNKNOWN and WT_COUNT
// in sync with llwearabletype.h
// The last 8 bits of mFlags contain the wearable type.
static U32 II_FLAGS_SUBTYPE_MASK = 0xff; // LLInventoryItemFlags::II_FLAGS_SUBTYPE_MASK

View File

@@ -100,6 +100,7 @@ public:
ICONNAME_CLOTHING_SKIRT,
ICONNAME_CLOTHING_ALPHA,
ICONNAME_CLOTHING_TATTOO,
ICONNAME_CLOTHING_UNIVERSAL,
ICONNAME_ANIMATION,
ICONNAME_GESTURE,

View File

@@ -40,6 +40,8 @@
#include "llsdutil_math.h"
#include "message.h"
#include "u64.h"
#include "llregionflags.h"
#include <boost/range/adaptor/map.hpp>
static const F32 SOME_BIG_NUMBER = 1000.0f;
static const F32 SOME_BIG_NEG_NUMBER = -1000.0f;
@@ -742,8 +744,8 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
void LLParcel::packAccessEntries(LLMessageSystem* msg,
const std::map<LLUUID,LLAccessEntry>& list)
{
access_map_const_iterator cit = list.begin();
access_map_const_iterator end = list.end();
LLAccessEntry::map::const_iterator cit = list.begin();
LLAccessEntry::map::const_iterator end = list.end();
if (cit == end)
{
@@ -794,9 +796,28 @@ void LLParcel::unpackAccessEntries(LLMessageSystem* msg,
}
void LLParcel::unpackExperienceEntries(LLMessageSystem* msg, U32 type)
{
LLUUID id;
S32 i;
S32 count = msg->getNumberOfBlocksFast(_PREHASH_List);
for (i = 0; i < count; i++)
{
msg->getUUIDFast(_PREHASH_List, _PREHASH_ID, id, i);
if (id.notNull())
{
mExperienceKeys[id] = type;
}
}
}
void LLParcel::expirePasses(S32 now)
{
access_map_iterator itor = mAccessList.begin();
LLAccessEntry::map::iterator itor = mAccessList.begin();
while (itor != mAccessList.end())
{
const LLAccessEntry& entry = (*itor).second;
@@ -886,7 +907,7 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time)
// Can't add owner to these lists
return FALSE;
}
access_map_iterator itor = mAccessList.begin();
LLAccessEntry::map::iterator itor = mAccessList.begin();
while (itor != mAccessList.end())
{
const LLAccessEntry& entry = (*itor).second;
@@ -931,7 +952,7 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time)
return FALSE;
}
access_map_iterator itor = mBanList.begin();
LLAccessEntry::map::iterator itor = mBanList.begin();
while (itor != mBanList.end())
{
const LLAccessEntry& entry = (*itor).second;
@@ -970,7 +991,7 @@ BOOL remove_from_access_array(std::map<LLUUID,LLAccessEntry>* list,
const LLUUID& agent_id)
{
BOOL removed = FALSE;
access_map_iterator itor = list->begin();
LLAccessEntry::map::iterator itor = list->begin();
while (itor != list->end())
{
const LLAccessEntry& entry = (*itor).second;
@@ -1091,7 +1112,7 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group)
mSaleTimerExpires.start();
mSaleTimerExpires.setTimerExpirySec(U64Microseconds(DEFAULT_USEC_SALE_TIMEOUT));
mStatus = OS_LEASE_PENDING;
mClaimDate = time(NULL);
mClaimDate = time(nullptr);
setAuctionID(0);
// clear the autoreturn whenever land changes hands
setCleanOtherTime(0);
@@ -1313,3 +1334,58 @@ LLParcel::ECategory category_ui_string_to_category(const std::string& s)
// is a distinct option from "None" and "Other"
return LLParcel::C_ANY;
}
LLAccessEntry::map LLParcel::getExperienceKeysByType(U32 type) const
{
LLAccessEntry::map access;
LLAccessEntry entry;
xp_type_map_t::const_iterator it = mExperienceKeys.begin();
for(/**/; it != mExperienceKeys.end(); ++it)
{
if(it->second == type)
{
entry.mID = it->first;
access[entry.mID] = entry;
}
}
return access;
}
void LLParcel::clearExperienceKeysByType(U32 type)
{
xp_type_map_t::iterator it = mExperienceKeys.begin();
while(it != mExperienceKeys.end())
{
if(it->second == type)
{
mExperienceKeys.erase(it++);
}
else
{
++it;
}
}
}
void LLParcel::setExperienceKeyType(const LLUUID& experience_key, U32 type)
{
if (type == EXPERIENCE_KEY_TYPE_NONE)
{
mExperienceKeys.erase(experience_key);
}
else
{
if (countExperienceKeyType(type) < PARCEL_MAX_EXPERIENCE_LIST)
{
mExperienceKeys[experience_key] = type;
}
}
}
U32 LLParcel::countExperienceKeyType(U32 type)
{
return std::count_if(
boost::begin(mExperienceKeys | boost::adaptors::map_values),
boost::end(mExperienceKeys | boost::adaptors::map_values),
std::bind2nd(std::equal_to<U32>(), type));
}

View File

@@ -60,6 +60,9 @@ const S32 PARCEL_MAX_ACCESS_LIST = 300;
//for access/ban lists.
const F32 PARCEL_MAX_ENTRIES_PER_PACKET = 48.f;
// Maximum number of experiences
const S32 PARCEL_MAX_EXPERIENCE_LIST = 24;
// Weekly charge for listing a parcel in the directory
const S32 PARCEL_DIRECTORY_FEE = 30;
@@ -141,9 +144,11 @@ class LLSD;
class LLAccessEntry
{
public:
typedef std::map<LLUUID,LLAccessEntry> map;
LLAccessEntry()
: mID(),
mTime(0),
: mTime(0),
mFlags(0)
{}
@@ -152,8 +157,6 @@ public:
U32 mFlags; // Not used - currently should always be zero
};
typedef std::map<LLUUID,LLAccessEntry>::iterator access_map_iterator;
typedef std::map<LLUUID,LLAccessEntry>::const_iterator access_map_const_iterator;
class LLParcel
{
@@ -331,6 +334,9 @@ public:
void unpackAccessEntries(LLMessageSystem* msg,
std::map<LLUUID,LLAccessEntry>* list);
void unpackExperienceEntries(LLMessageSystem* msg, U32 type);
void setAABBMin(const LLVector3& min) { mAABBMin = min; }
void setAABBMax(const LLVector3& max) { mAABBMax = max; }
@@ -707,6 +713,17 @@ public:
std::map<LLUUID,LLAccessEntry> mTempBanList;
std::map<LLUUID,LLAccessEntry> mTempAccessList;
typedef std::map<LLUUID, U32> xp_type_map_t;
void setExperienceKeyType(const LLUUID& experience_key, U32 type);
U32 countExperienceKeyType(U32 type);
U32 getExperienceKeyType(const LLUUID& experience_key)const;
LLAccessEntry::map getExperienceKeysByType(U32 type)const;
void clearExperienceKeysByType(U32 type);
private:
xp_type_map_t mExperienceKeys;
};

View File

@@ -1,31 +1,25 @@
/**
* @file llparcelflags.h
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -97,8 +91,10 @@ const U32 PF_DEFAULT = PF_ALLOW_FLY
| PF_USE_ESTATE_VOICE_CHAN;
// Access list flags
const U32 AL_ACCESS = (1 << 0);
const U32 AL_BAN = (1 << 1);
const U32 AL_ACCESS = (1 << 0);
const U32 AL_BAN = (1 << 1);
const U32 AL_ALLOW_EXPERIENCE = (1 << 3);
const U32 AL_BLOCK_EXPERIENCE = (1 << 4);
//const U32 AL_RENTER = (1 << 2);
// Block access return values. BA_ALLOWED is the only success case

View File

@@ -103,9 +103,9 @@ LLSD LLSettingsBase::combineSDMaps(const LLSD &settings, const LLSD &other) cons
break;
case LLSD::TypeArray:
newSettings[key_name] = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
newSettings[key_name].append(*ita);
newSettings[key_name].append(entry);
}
break;
//case LLSD::TypeInteger:
@@ -137,9 +137,9 @@ LLSD LLSettingsBase::combineSDMaps(const LLSD &settings, const LLSD &other) cons
break;
case LLSD::TypeArray:
newSettings[key_name] = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
newSettings[key_name].append(*ita);
newSettings[key_name].append(entry);
}
break;
//case LLSD::TypeInteger:

View File

@@ -240,16 +240,16 @@ bool LLSettingsDay::initialize(bool validate_frames)
{
mDayTracks[i].clear();
LLSD curtrack = tracks[i];
for (LLSD::array_const_iterator it = curtrack.beginArray(); it != curtrack.endArray(); ++it)
for (const auto& entry : curtrack.array())
{
LLSettingsBase::TrackPosition keyframe = LLSettingsBase::TrackPosition((*it)[SETTING_KEYKFRAME].asReal());
LLSettingsBase::TrackPosition keyframe = LLSettingsBase::TrackPosition(entry[SETTING_KEYKFRAME].asReal());
keyframe = llclamp(keyframe, 0.0f, 1.0f);
LLSettingsBase::ptr_t setting;
if ((*it).has(SETTING_KEYNAME))
if (entry.has(SETTING_KEYNAME))
{
std::string key_name = (*it)[SETTING_KEYNAME];
std::string key_name = entry[SETTING_KEYNAME];
if (i == TRACK_WATER)
{
setting = used[key_name];
@@ -469,36 +469,36 @@ namespace
S32 framecount(0);
for (LLSD::array_iterator track = value.beginArray(); track != value.endArray(); ++track)
for (auto& entry : value.array())
{
S32 index = 0;
while (index < (*track).size())
while (index < entry.size())
{
LLSD& elem = (*track)[index];
LLSD& elem = entry[index];
++framecount;
if (index >= LLSettingsDay::FRAME_MAX)
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem.has(LLSettingsDay::SETTING_KEYKFRAME))
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem[LLSettingsDay::SETTING_KEYKFRAME].isReal())
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem.has(LLSettingsDay::SETTING_KEYNAME) &&
!elem.has(LLSettingsDay::SETTING_KEYID))
{
(*track).erase(index);
entry.erase(index);
continue;
}
@@ -608,7 +608,7 @@ LLSettingsDay::validation_list_t LLSettingsDay::validationList()
return validation;
}
LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(S32 track)
LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(size_t track)
{
static CycleTrack_t emptyTrack;
if (mDayTracks.size() <= track)
@@ -617,7 +617,7 @@ LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(S32 track)
return mDayTracks[track];
}
const LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrackConst(S32 track) const
const LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrackConst(size_t track) const
{
static CycleTrack_t emptyTrack;
if (mDayTracks.size() <= track)

View File

@@ -118,8 +118,8 @@ public:
virtual LLSettingsWaterPtr_t buildWater(LLSD) const = 0;
void setInitialized(bool value = true) { mInitialized = value; }
CycleTrack_t & getCycleTrack(S32 track);
const CycleTrack_t & getCycleTrackConst(S32 track) const;
CycleTrack_t & getCycleTrack(size_t track);
const CycleTrack_t & getCycleTrackConst(size_t track) const;
bool clearCycleTrack(S32 track);
bool replaceCycleTrack(S32 track, const CycleTrack_t &source);
bool isTrackEmpty(S32 track) const;

View File

@@ -45,6 +45,7 @@
#endif
extern U32 gOctreeMaxCapacity;
extern float gOctreeMinSize;
extern U32 gOctreeReserveCapacity;
#if LL_DEBUG
#define LL_OCTREE_PARANOIA_CHECK 0
@@ -404,7 +405,7 @@ public:
F32 size = mSize[0];
F32 p_size = size * 2.f;
return (radius <= 0.001f && size <= 0.001f) ||
return (radius <= gOctreeMinSize && size <= gOctreeMinSize) ||
(radius <= p_size && radius > size);
}
@@ -425,7 +426,7 @@ public:
}
void accept(oct_traveler* visitor) { visitor->visit(this); }
virtual bool isLeaf() const { return mChildCount == 0; }
bool isLeaf() const { return mChildCount == 0; }
U32 getElementCount() const { return mData.size(); }
bool isEmpty() const { return mData.size() == 0; }
@@ -498,7 +499,7 @@ public:
return node;
}
virtual bool insert(T* data)
bool insert(T* data) override
{
OctreeGuard::checkGuarded(this);
if (data == NULL || data->getBinIndex() != -1)
@@ -511,7 +512,7 @@ public:
//is it here?
if (isInside(data->getPositionGroup()))
{
if (((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius())) ||
if ((((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius())) ||
(data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity)))
{ //it belongs here
/*mElementCount++;
@@ -537,7 +538,7 @@ public:
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
#endif
BaseType::insert(data);
LLOctreeNode<T>::notifyAddition(data);
return true;
}
else
@@ -566,8 +567,9 @@ public:
LLVector4a val;
val.setSub(center, getCenter());
val.setAbs(val);
S32 lt = val.lessThan(LLVector4a::getEpsilon()).getGatheredBits() & 0x7;
LLVector4a min_diff(gOctreeMinSize);
S32 lt = val.lessThan(min_diff).getGatheredBits() & 0x7;
if( lt == 0x7 )
{
@@ -593,7 +595,7 @@ public:
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
#endif
BaseType::insert(data);
LLOctreeNode<T>::notifyAddition(data);
return true;
}
@@ -616,6 +618,7 @@ public:
}
#endif
llassert(size[0] >= gOctreeMinSize*0.5f);
//make the new kid
child = new LLOctreeNode<T>(center, size, this);
addChild(child);
@@ -623,10 +626,7 @@ public:
child->insert(data);
}
}
// Singu note: now that we allow wider range in octree, discard them here
// if they fall out of range
#if 0
else
else if (parent)
{
//it's not in here, give it to the root
OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL;
@@ -639,12 +639,15 @@ public:
parent = node->getOctParent();
}
if(node != this)
{
node->insert(data);
}
node->insert(data);
}
else
{
// It's not in here, and we are root.
// LLOctreeRoot::insert() should have expanded
// root by now, something is wrong
OCT_ERRS << "Octree insertion failed! Root expansion failed." << LL_ENDL;
}
#endif
return false;
}
@@ -708,7 +711,7 @@ public:
checkAlive();
}
bool remove(T* data)
bool remove(T* data) final override
{
OctreeGuard::checkGuarded(this);
S32 i = data->getBinIndex();
@@ -849,10 +852,9 @@ public:
if (!silent)
{
for (U32 i = 0; i < this->getListenerCount(); i++)
for (auto& entry : this->mListeners)
{
oct_listener* listener = getOctListener(i);
listener->handleChildAddition(this, child);
((oct_listener*)entry.get())->handleChildAddition(this, child);
}
}
}
@@ -861,16 +863,17 @@ public:
{
OctreeGuard::checkGuarded(this);
for (U32 i = 0; i < this->getListenerCount(); i++)
oct_node* child = getChild(index);
for (auto& entry : this->mListeners)
{
oct_listener* listener = getOctListener(i);
listener->handleChildRemoval(this, getChild(index));
((oct_listener*)entry.get())->handleChildRemoval(this, child);
}
if (destroy)
{
mChild[index]->destroy();
delete mChild[index];
child->destroy();
delete child;
}
--mChildCount;
@@ -1012,7 +1015,7 @@ public:
}
// LLOctreeRoot::insert
bool insert(T* data)
bool insert(T* data) final override
{
if (data == NULL)
{
@@ -1050,10 +1053,15 @@ public:
{
LLOctreeNode<T>::insert(data);
}
else
else if (node->isInside(data->getPositionGroup()))
{
node->insert(data);
}
else
{
// calling node->insert(data) will return us to root
OCT_ERRS << "Failed to insert data at child node" << LL_ENDL;
}
}
else if (this->getChildCount() == 0)
{
@@ -1088,6 +1096,8 @@ public:
this->setSize(size2);
this->updateMinMax();
llassert(size[0] >= gOctreeMinSize);
//copy our children to a new branch
LLOctreeNode<T>* newnode = new LLOctreeNode<T>(center, size, this);

View File

@@ -44,7 +44,6 @@ public:
virtual void handleInsertion(const LLTreeNode<T>* node, T* data) = 0;
virtual void handleRemoval(const LLTreeNode<T>* node, T* data) = 0;
virtual void handleDestruction(const LLTreeNode<T>* node) = 0;
virtual void handleStateChange(const LLTreeNode<T>* node) = 0;
};
template <class T>
@@ -53,11 +52,15 @@ class LLTreeNode
public:
virtual ~LLTreeNode();
virtual bool insert(T* data);
virtual bool remove(T* data);
virtual void notifyRemoval(T* data);
virtual U32 getListenerCount() { return mListeners.size(); }
virtual LLTreeListener<T>* getListener(U32 index) const
virtual bool insert(T* data) = 0;
virtual bool remove(T* data) = 0;
bool notifyAddition(T* data);
void notifyRemoval(T* data);
U32 getListenerCount() const
{
return mListeners.size();
}
LLTreeListener<T>* getListener(U32 index) const
{
if(index < mListeners.size())
{
@@ -65,7 +68,10 @@ public:
}
return NULL;
}
virtual void addListener(LLTreeListener<T>* listener) { mListeners.push_back(listener); }
void addListener(LLTreeListener<T>* listener)
{
mListeners.push_back(listener);
}
protected:
void destroyListeners()
@@ -97,7 +103,7 @@ LLTreeNode<T>::~LLTreeNode()
};
template <class T>
bool LLTreeNode<T>::insert(T* data)
bool LLTreeNode<T>::notifyAddition(T* data)
{
for (U32 i = 0; i < mListeners.size(); i++)
{
@@ -106,12 +112,6 @@ bool LLTreeNode<T>::insert(T* data)
return true;
};
template <class T>
bool LLTreeNode<T>::remove(T* data)
{
return true;
};
template <class T>
void LLTreeNode<T>::notifyRemoval(T* data)
{

View File

@@ -6331,7 +6331,9 @@ void LLVolumeFace::allocateIndices(S32 num_indices, bool copy)
S32 new_size = ((num_indices * sizeof(U16)) + 0xF) & ~0xF;
if (copy && num_indices && mIndices && mNumIndices)
{
#if !LL_USE_TCMALLOC
S32 old_size = ((mNumIndices * sizeof(U16)) + 0xF) & ~0xF;
#endif
mIndices = (U16*)ll_aligned_realloc_16(mIndices, new_size, old_size);

View File

@@ -38,7 +38,7 @@ class LLVolumeParams;
class LLProfile;
class LLPath;
template <class T> class LLOctreeNode;
template <class T> class LLOctreeRoot;
class LLVolumeFace;
class LLVolume;
@@ -964,7 +964,7 @@ public:
// vertices per joint.
LLJointRiggingInfoTab mJointRiggingInfoTab;
LLOctreeNode<LLVolumeTriangle>* mOctree;
LLOctreeRoot<LLVolumeTriangle>* mOctree;
//whether or not face has been cache optimized
BOOL mOptimized;

View File

@@ -112,14 +112,13 @@ public:
}
//LISTENER FUNCTIONS
virtual void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent,
LLOctreeNode<LLVolumeTriangle>* child);
virtual void handleStateChange(const LLTreeNode<LLVolumeTriangle>* node) { }
virtual void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent,
const LLOctreeNode<LLVolumeTriangle>* child) { }
virtual void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { }
virtual void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { }
virtual void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) { }
void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent,
LLOctreeNode<LLVolumeTriangle>* child) final override;
void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent,
const LLOctreeNode<LLVolumeTriangle>* child) final override { }
void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) final override { }
void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) final override { }
void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) final override { }
public:

View File

@@ -45,6 +45,7 @@ set(llmessage_SOURCE_FILES
llclassifiedflags.cpp
lldatapacker.cpp
lldispatcher.cpp
llexperiencecache.cpp
llfiltersd2xmlrpc.cpp
llhost.cpp
llhttpclient.cpp
@@ -133,11 +134,13 @@ set(llmessage_HEADER_FILES
llcipher.h
llcircuit.h
llclassifiedflags.h
llcororesponder.h
llcurl.h
lldatapacker.h
lldbstrings.h
lldispatcher.h
lleventflags.h
llexperiencecache.h
llfiltersd2xmlrpc.h
llfollowcamparams.h
llhost.h
@@ -227,7 +230,8 @@ target_link_libraries(
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
${XMLRPCEPI_LIBRARIES}
)
${PTHREAD_LIBRARY}
)
# tests
if (LL_TESTS)

View File

@@ -960,5 +960,4 @@ P(webProfileResponders);
P(wholeModelFeeResponder);
P(wholeModelUploadResponder);
P2(XMLRPCResponder, connect_40s);
P2(crashLoggerResponder, transfer_300s);
P(getUpdateInfoResponder);

View File

@@ -139,7 +139,7 @@ void LLAvatarName::fromString(const std::string& full_name)
mLegacyLastName = full_name.substr(index+1);
if (mLegacyLastName != "Resident")
{
mUsername = mLegacyFirstName + "." + mLegacyLastName;
mUsername = mLegacyFirstName + '.' + mLegacyLastName;
mDisplayName = full_name;
LLStringUtil::toLower(mUsername);
}
@@ -184,7 +184,7 @@ std::string LLAvatarName::getCompleteName(bool linefeed) const
name = mDisplayName;
if (sUseUsernames)
{
name += (linefeed ? "\n(" : " (") + mUsername + ")";
name += (linefeed ? "\n(" : " (") + mUsername + ')';
}
}
}
@@ -238,7 +238,7 @@ std::string LLAvatarName::getUserName() const
}
else
{
name = mLegacyFirstName + " " + mLegacyLastName;
name = mLegacyFirstName + ' ' + mLegacyLastName;
}
return name;
}

View File

@@ -94,7 +94,7 @@ public:
{
case 1 : return getCompleteName();
case 2 : return getDisplayName();
case 3 : return getLegacyName() + (mIsDisplayNameDefault ? "" : " (" + mDisplayName + ")"); break;
case 3 : return getLegacyName() + (mIsDisplayNameDefault ? "" : " (" + mDisplayName + ')'); break;
default : return getLegacyName();
}
}

View File

@@ -335,7 +335,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
while(!sAskQueue.empty())
{
it = sAskQueue.begin();
const LLUUID& agent_id = *it;
const LLUUID agent_id = *it;
sAskQueue.erase(it);
if (url.empty())

View File

@@ -0,0 +1,63 @@
/**
* @file llcororesponder.h
* @brief A responder purposed to call coro functions, to ease transition to LLCoro
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
*
* Copyright (C) 2020, Liru Færs
*
* 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 <functional>
#include "llhttpclient.h"
struct LLCoroResponderBase : public LLHTTPClient::ResponderWithCompleted
{
const AIHTTPReceivedHeaders& getHeaders() const { return mReceivedHeaders; }
const LLSD& getContent() const { return mContent; }
char const* getName() const override final { return "LLCoroResponder"; }
protected:
LLCoroResponderBase() {}
};
struct LLCoroResponder final : public LLCoroResponderBase
{
typedef std::function<void(const LLCoroResponder&)> cb_t;
LLCoroResponder(const cb_t& cb) : mCB(cb) {}
void httpCompleted() override { mCB(*this); }
private:
const cb_t mCB;
};
struct LLCoroResponderRaw final : public LLCoroResponderBase
{
typedef std::function<void(const LLCoroResponderRaw&, const std::string&)> cb_t;
LLCoroResponderRaw(const cb_t& cb) : mCB(cb) {}
void completedRaw(const LLChannelDescriptors& channels, const buffer_ptr_t& buffer) override
{
std::string content;
decode_raw_body(channels, buffer, content);
mCB(*this, content);
}
private:
const cb_t mCB;
};

View File

@@ -0,0 +1,921 @@
/**
* @file llexperiencecache.cpp
* @brief llexperiencecache and related class definitions
*
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, 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 "llexperiencecache.h"
#include "llavatarname.h"
#include "llcororesponder.h"
#include "llsdserialize.h"
#include "lleventfilter.h"
#include "lldir.h"
#include <set>
#include <map>
#include <boost/tokenizer.hpp>
#include <boost/concept_check.hpp>
#include <boost/smart_ptr/make_shared.hpp>
//=========================================================================
namespace LLExperienceCacheImpl
{
void mapKeys(const LLSD& legacyKeys);
F64 getErrorRetryDeltaTime(S32 status, const AIHTTPReceivedHeaders& headers);
bool maxAgeFromCacheControl(const std::string& cache_control, S32 *max_age);
static const std::string PRIVATE_KEY = "private_id";
static const std::string EXPERIENCE_ID = "public_id";
static const std::string MAX_AGE("max-age");
static const boost::char_separator<char> EQUALS_SEPARATOR("=");
static const boost::char_separator<char> COMMA_SEPARATOR(",");
// *TODO$: this seems to be tied to mapKeys which is used by bootstrap.... but I don't think that bootstrap is used.
typedef std::map<LLUUID, LLUUID> KeyMap;
KeyMap privateToPublicKeyMap;
}
//=========================================================================
const std::string LLExperienceCache::PRIVATE_KEY = "private_id";
const std::string LLExperienceCache::MISSING = "DoesNotExist";
const std::string LLExperienceCache::AGENT_ID = "agent_id";
const std::string LLExperienceCache::GROUP_ID = "group_id";
const std::string LLExperienceCache::EXPERIENCE_ID = "public_id";
const std::string LLExperienceCache::NAME = "name";
const std::string LLExperienceCache::PROPERTIES = "properties";
const std::string LLExperienceCache::EXPIRES = "expiration";
const std::string LLExperienceCache::DESCRIPTION = "description";
const std::string LLExperienceCache::QUOTA = "quota";
const std::string LLExperienceCache::MATURITY = "maturity";
const std::string LLExperienceCache::METADATA = "extended_metadata";
const std::string LLExperienceCache::SLURL = "slurl";
// should be in sync with experience-api/experiences/models.py
const int LLExperienceCache::PROPERTY_INVALID = 1 << 0;
const int LLExperienceCache::PROPERTY_PRIVILEGED = 1 << 3;
const int LLExperienceCache::PROPERTY_GRID = 1 << 4;
const int LLExperienceCache::PROPERTY_PRIVATE = 1 << 5;
const int LLExperienceCache::PROPERTY_DISABLED = 1 << 6;
const int LLExperienceCache::PROPERTY_SUSPENDED = 1 << 7;
// default values
const F64 LLExperienceCache::DEFAULT_EXPIRATION = 600.0;
const S32 LLExperienceCache::DEFAULT_QUOTA = 128; // this is megabytes
const int LLExperienceCache::SEARCH_PAGE_SIZE = 30;
//=========================================================================
LLExperienceCache::LLExperienceCache():
mShutdown(false)
{
}
LLExperienceCache::~LLExperienceCache()
{
}
void LLExperienceCache::initSingleton()
{
mCacheFileName = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "experience_cache.xml");
LL_INFOS("ExperienceCache") << "Loading " << mCacheFileName << LL_ENDL;
llifstream cache_stream(mCacheFileName.c_str());
if (cache_stream.is_open())
{
cache_stream >> (*this);
}
}
void LLExperienceCache::cleanup()
{
LL_INFOS("ExperienceCache") << "Saving " << mCacheFileName << LL_ENDL;
llofstream cache_stream(mCacheFileName.c_str());
if (cache_stream.is_open())
{
cache_stream << (*this);
}
mShutdown = true;
}
//-------------------------------------------------------------------------
void LLExperienceCache::importFile(std::istream& istr)
{
LLSD data;
S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr);
if (parse_count < 1) return;
LLSD experiences = data["experiences"];
LLUUID public_key;
for (const auto& it : experiences.map())
{
public_key.set(it.first);
mCache[public_key] = it.second;
}
LL_DEBUGS("ExperienceCache") << "importFile() loaded " << mCache.size() << LL_ENDL;
}
void LLExperienceCache::exportFile(std::ostream& ostr) const
{
LLSD experiences;
cache_t::const_iterator it = mCache.begin();
for (; it != mCache.end(); ++it)
{
if (!it->second.has(EXPERIENCE_ID) || it->second[EXPERIENCE_ID].asUUID().isNull() ||
it->second.has("DoesNotExist") || (it->second.has(PROPERTIES) && it->second[PROPERTIES].asInteger() & PROPERTY_INVALID))
continue;
experiences[it->first.asString()] = it->second;
}
LLSD data;
data["experiences"] = experiences;
LLSDSerialize::toPrettyXML(data, ostr);
}
// *TODO$: Rider: This method does not seem to be used... it may be useful in testing.
void LLExperienceCache::bootstrap(const LLSD& legacyKeys, int initialExpiration)
{
LLExperienceCacheImpl::mapKeys(legacyKeys);
for (auto experience : legacyKeys.array())
{
if (experience.has(EXPERIENCE_ID))
{
if (!experience.has(EXPIRES))
{
experience[EXPIRES] = initialExpiration;
}
processExperience(experience[EXPERIENCE_ID].asUUID(), experience);
}
else
{
LL_WARNS("ExperienceCache")
<< "Skipping bootstrap entry which is missing " << EXPERIENCE_ID
<< LL_ENDL;
}
}
}
LLUUID LLExperienceCache::getExperienceId(const LLUUID& private_key, bool null_if_not_found)
{
if (private_key.isNull())
return LLUUID::null;
LLExperienceCacheImpl::KeyMap::const_iterator it = LLExperienceCacheImpl::privateToPublicKeyMap.find(private_key);
if (it == LLExperienceCacheImpl::privateToPublicKeyMap.end())
{
if (null_if_not_found)
{
return LLUUID::null;
}
return private_key;
}
LL_WARNS("LLExperience") << "converted private key " << private_key << " to experience_id " << it->second << LL_ENDL;
return it->second;
}
//=========================================================================
void LLExperienceCache::processExperience(const LLUUID& public_key, const LLSD& experience)
{
LL_INFOS("ExperienceCache") << "Processing experience \"" << experience[NAME] << "\" with key " << public_key.asString() << LL_ENDL;
mCache[public_key]=experience;
LLSD & row = mCache[public_key];
if(row.has(EXPIRES))
{
row[EXPIRES] = row[EXPIRES].asReal() + LLFrameTimer::getTotalSeconds();
}
if(row.has(EXPERIENCE_ID))
{
mPendingQueue.erase(row[EXPERIENCE_ID].asUUID());
}
//signal
signal_map_t::iterator sig_it = mSignalMap.find(public_key);
if (sig_it != mSignalMap.end())
{
signal_ptr signal = sig_it->second;
(*signal)(experience);
mSignalMap.erase(public_key);
}
}
const LLExperienceCache::cache_t& LLExperienceCache::getCached()
{
return mCache;
}
void LLExperienceCache::requestExperiencesCoro(const LLCoroResponder& responder, RequestQueue_t requests)
{
//LL_INFOS("requestExperiencesCoro") << "url: " << url << LL_ENDL;
LLSD result = responder.getContent();
auto status = responder.getStatus();
if (!responder.isGoodStatus(status))
{
F64 now = LLFrameTimer::getTotalSeconds();
auto headers = responder.getHeaders();
// build dummy entries for the failed requests
for (auto request : requests)
{
LLSD exp = get(request);
//leave the properties alone if we already have a cache entry for this xp
if (exp.isUndefined())
{
exp[PROPERTIES] = PROPERTY_INVALID;
}
exp[EXPIRES] = now + LLExperienceCacheImpl::getErrorRetryDeltaTime(status, headers);
exp[EXPERIENCE_ID] = request;
exp["key_type"] = EXPERIENCE_ID;
exp["uuid"] = request;
exp["error"] = status;
exp[QUOTA] = DEFAULT_QUOTA;
processExperience(request, exp);
}
return;
}
LLSD experiences = result["experience_keys"];
for (const auto& row : experiences.array())
{
LLUUID public_key = row[EXPERIENCE_ID].asUUID();
LL_DEBUGS("ExperienceCache") << "Received result for " << public_key
<< " display '" << row[LLExperienceCache::NAME].asString() << "'" << LL_ENDL;
processExperience(public_key, row);
}
LLSD error_ids = result["error_ids"];
for (const auto& err : error_ids.array())
{
LLUUID id = err.asUUID();
LLSD exp;
exp[EXPIRES] = DEFAULT_EXPIRATION;
exp[EXPERIENCE_ID] = id;
exp[PROPERTIES] = PROPERTY_INVALID;
exp[MISSING] = true;
exp[QUOTA] = DEFAULT_QUOTA;
processExperience(id, exp);
LL_WARNS("ExperienceCache") << "LLExperienceResponder::result() error result for " << id << LL_ENDL;
}
}
void LLExperienceCache::requestExperiences()
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
std::string urlBase = mCapability("GetExperienceInfo");
if (urlBase.empty())
{
LL_DEBUGS("ExperienceCache") << "No Experience capability." << LL_ENDL;
return;
}
if (*urlBase.rbegin() != '/')
{
urlBase += "/";
}
urlBase += "id/";
F64 now = LLFrameTimer::getTotalSeconds();
const U32 EXP_URL_SEND_THRESHOLD = 3000;
constexpr U32 EXP_PAGE_SIZE = EXP_URL_SEND_THRESHOLD / UUID_STR_LENGTH;
std::ostringstream ostr;
ostr << urlBase << "?page_size=" << EXP_PAGE_SIZE;
RequestQueue_t requests;
while (!mRequestQueue.empty())
{
RequestQueue_t::iterator it = mRequestQueue.begin();
LLUUID key = (*it);
mRequestQueue.erase(it);
requests.insert(key);
ostr << "&" << EXPERIENCE_ID << "=" << key.asString();
mPendingQueue[key] = now;
if (mRequestQueue.empty() || (ostr.tellp() > EXP_URL_SEND_THRESHOLD))
{ // request is placed in the coprocedure pool for the ExpCache cache. Throttling is done by the pool itself.
LLHTTPClient::get(ostr.str(), new LLCoroResponder(
boost::bind(&LLExperienceCache::requestExperiencesCoro, this, _1, requests) ));
ostr.str(std::string());
ostr << urlBase << "?page_size=" << EXP_PAGE_SIZE;
requests.clear();
}
}
}
bool LLExperienceCache::isRequestPending(const LLUUID& public_key)
{
bool isPending = false;
const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0;
PendingQueue_t::const_iterator it = mPendingQueue.find(public_key);
if(it != mPendingQueue.end())
{
F64 expire_time = LLFrameTimer::getTotalSeconds() - PENDING_TIMEOUT_SECS;
isPending = (it->second > expire_time);
}
return isPending;
}
void LLExperienceCache::setCapabilityQuery(LLExperienceCache::CapabilityQuery_t queryfn)
{
mCapability = queryfn;
}
void LLExperienceCache::idleCoro()
{
const F32 SECS_BETWEEN_REQUESTS = 0.5f;
const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds
{
static LLFrameTimer sRequestTimer;
if (!sRequestTimer.checkExpirationAndReset(SECS_BETWEEN_REQUESTS)) return;
if (mEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
{
eraseExpired();
}
if (!mRequestQueue.empty())
{
requestExperiences();
}
}
// The coroutine system will likely be shut down by the time we get to this point
// (or at least no further cycling will occur on it since the user has decided to quit.)
}
void LLExperienceCache::erase(const LLUUID& key)
{
cache_t::iterator it = mCache.find(key);
if(it != mCache.end())
{
mCache.erase(it);
}
}
void LLExperienceCache::eraseExpired()
{
F64 now = LLFrameTimer::getTotalSeconds();
cache_t::iterator it = mCache.begin();
while (it != mCache.end())
{
cache_t::iterator cur = it;
LLSD& exp = cur->second;
++it;
//LL_INFOS("ExperienceCache") << "Testing experience \"" << exp[NAME] << "\" with exp time " << exp[EXPIRES].asReal() << "(now = " << now << ")" << LL_ENDL;
if(exp.has(EXPIRES) && exp[EXPIRES].asReal() < now)
{
if(!exp.has(EXPERIENCE_ID))
{
LL_WARNS("ExperienceCache") << "Removing experience with no id " << LL_ENDL ;
mCache.erase(cur);
}
else
{
LLUUID id = exp[EXPERIENCE_ID].asUUID();
LLUUID private_key = exp.has(LLExperienceCache::PRIVATE_KEY) ? exp[LLExperienceCache::PRIVATE_KEY].asUUID():LLUUID::null;
if(private_key.notNull() || !exp.has("DoesNotExist"))
{
fetch(id, true);
}
else
{
LL_WARNS("ExperienceCache") << "Removing invalid experience " << id << LL_ENDL ;
mCache.erase(cur);
}
}
}
}
}
bool LLExperienceCache::fetch(const LLUUID& key, bool refresh/* = true*/)
{
if(!key.isNull() && !isRequestPending(key) && (refresh || mCache.find(key)==mCache.end()))
{
LL_DEBUGS("ExperienceCache") << " queue request for " << EXPERIENCE_ID << " " << key << LL_ENDL;
mRequestQueue.insert(key);
return true;
}
return false;
}
void LLExperienceCache::insert(const LLSD& experience_data)
{
if(experience_data.has(EXPERIENCE_ID))
{
processExperience(experience_data[EXPERIENCE_ID].asUUID(), experience_data);
}
else
{
LL_WARNS("ExperienceCache") << ": Ignoring cache insert of experience which is missing " << EXPERIENCE_ID << LL_ENDL;
}
}
const LLSD& LLExperienceCache::get(const LLUUID& key)
{
static const LLSD empty;
if(key.isNull())
return empty;
cache_t::const_iterator it = mCache.find(key);
if (it != mCache.end())
{
return it->second;
}
fetch(key);
return empty;
}
void LLExperienceCache::get(const LLUUID& key, LLExperienceCache::ExperienceGetFn_t slot)
{
if(key.isNull())
return;
cache_t::const_iterator it = mCache.find(key);
if (it != mCache.end())
{
// ...name already exists in cache, fire callback now
callback_signal_t signal;
signal.connect(slot);
signal(it->second);
return;
}
fetch(key);
signal_ptr signal = boost::make_shared<callback_signal_t>();
std::pair<signal_map_t::iterator, bool> result = mSignalMap.insert(signal_map_t::value_type(key, signal));
if (!result.second)
signal = (*result.first).second;
signal->connect(slot);
}
//=========================================================================
void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, std::string url, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
if (url.empty())
{
url = mCapability("GetMetadata");
if (url.empty())
{
LL_WARNS("ExperienceCache") << "No Metadata capability." << LL_ENDL;
return;
}
}
LLSD fields;
fields.append("experience");
LLSD data;
data["object-id"] = objectId;
data["item-id"] = itemId;
data["fields"] = fields;
LLHTTPClient::post(url, data, new LLCoroResponder(
boost::bind(&LLExperienceCache::fetchAssociatedExperienceCoro, this, _1, fn)));
}
void LLExperienceCache::fetchAssociatedExperienceCoro(const LLCoroResponder& responder, ExperienceGetFn_t fn)
{
LLSD result = responder.getContent();
auto status = responder.getStatus();
if (!responder.isGoodStatus(status) || !result.has("experience"))
{
LLSD failure;
if (!status)
{
failure["error"] = status;
failure["message"] = responder.getReason();
}
else
{
failure["error"] = -1;
failure["message"] = "no experience";
}
if (fn != nullptr)
fn(failure);
return;
}
LLUUID expId = result["experience"].asUUID();
get(expId, fn);
}
//-------------------------------------------------------------------------
void LLExperienceCache::findExperienceByName(const std::string text, int page, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
std::ostringstream url;
url << mCapability("FindExperienceByName") << "?page=" << page << "&page_size=" << SEARCH_PAGE_SIZE << "&query=" << LLURI::escape(text);
LLHTTPClient::get(url.str(), new LLCoroResponder(
boost::bind(&LLExperienceCache::findExperienceByNameCoro, this, _1, fn)));
}
void LLExperienceCache::findExperienceByNameCoro(const LLCoroResponder& responder, ExperienceGetFn_t fn)
{
LLSD result = responder.getContent();
if (!responder.isGoodStatus(responder.getStatus()))
{
fn(LLSD());
return;
}
const LLSD& experiences = result["experience_keys"];
for (const auto& it : experiences.array())
{
insert(it);
}
fn(result);
}
//-------------------------------------------------------------------------
void LLExperienceCache::getGroupExperiences(const LLUUID &groupId, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
// search for experiences owned by the current group
std::string url = mCapability("GroupExperiences");
if (url.empty())
{
LL_WARNS("ExperienceCache") << "No Group Experiences capability" << LL_ENDL;
return;
}
url += "?" + groupId.asString();
LLHTTPClient::get(url, new LLCoroResponder(
boost::bind(&LLExperienceCache::getGroupExperiencesCoro, this, _1, fn)));
}
void LLExperienceCache::getGroupExperiencesCoro(const LLCoroResponder& responder, ExperienceGetFn_t fn)
{
LLSD result = responder.getContent();
if (!responder.isGoodStatus(responder.getStatus()))
{
fn(LLSD());
return;
}
const LLSD& experienceIds = result["experience_ids"];
fn(experienceIds);
}
//-------------------------------------------------------------------------
void LLExperienceCache::getRegionExperiences(CapabilityQuery_t regioncaps, ExperienceGetFn_t fn)
{
regionExperiences(regioncaps, LLSD(), false, fn);
}
void LLExperienceCache::setRegionExperiences(CapabilityQuery_t regioncaps, const LLSD &experiences, ExperienceGetFn_t fn)
{
regionExperiences(regioncaps, experiences, true, fn);
}
void LLExperienceCache::regionExperiences(CapabilityQuery_t regioncaps, const LLSD &experiences, bool update, ExperienceGetFn_t fn)
{
// search for experiences owned by the current group
std::string url = regioncaps("RegionExperiences");
if (url.empty())
{
LL_WARNS("ExperienceCache") << "No Region Experiences capability" << LL_ENDL;
return;
}
auto httpRequest = new LLCoroResponder(
boost::bind(&LLExperienceCache::regionExperiencesCoro, this, _1, fn));
LLSD result;
if (update)
LLHTTPClient::post(url, experiences, httpRequest);
else
LLHTTPClient::get(url, httpRequest);
}
void LLExperienceCache::regionExperiencesCoro(const LLCoroResponder& responder, ExperienceGetFn_t fn)
{
LLSD result = responder.getContent();
if (!responder.isGoodStatus(responder.getStatus()))
{
// fn(LLSD());
return;
}
fn(result);
}
//-------------------------------------------------------------------------
void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
std::string url = mCapability("ExperiencePreferences") + "?" + experienceId.asString();
LLHTTPClient::get(url, new LLCoroResponder(
boost::bind(&LLExperienceCache::experiencePermissionCoro, this, _1, fn)));
}
void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, const std::string &permission, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
std::string url = mCapability("ExperiencePreferences");
if (url.empty())
return;
LLSD permData;
LLSD data;
permData["permission"] = permission;
data[experienceId.asString()] = permData;
LLHTTPClient::put(url, data, new LLCoroResponder(
boost::bind(&LLExperienceCache::experiencePermissionCoro, this, _1, fn)));
}
void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
std::string url = mCapability("ExperiencePreferences") + "?" + experienceId.asString();
LLHTTPClient::del(url, new LLCoroResponder(
boost::bind(&LLExperienceCache::experiencePermissionCoro, this, _1, fn)));
}
void LLExperienceCache::experiencePermissionCoro(const LLCoroResponder& responder, ExperienceGetFn_t fn)
{
// search for experiences owned by the current group
LLSD result = responder.getContent();
if (responder.isGoodStatus(responder.getStatus()))
{
fn(result);
}
}
//-------------------------------------------------------------------------
void LLExperienceCache::getExperienceAdmin(const LLUUID &experienceId, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
std::string url = mCapability("IsExperienceAdmin");
if (url.empty())
{
LL_WARNS("ExperienceCache") << "No Region Experiences capability" << LL_ENDL;
return;
}
url += "?experience_id=" + experienceId.asString();
LLHTTPClient::get(url, new LLCoroResponder(
boost::bind(fn, boost::bind(&LLCoroResponder::getContent, _1))));
}
//-------------------------------------------------------------------------
void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn)
{
if (mCapability == nullptr)
{
LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL;
return;
}
std::string url = mCapability("UpdateExperience");
if (url.empty())
{
LL_WARNS("ExperienceCache") << "No Region Experiences capability" << LL_ENDL;
return;
}
updateData.erase(LLExperienceCache::QUOTA);
updateData.erase(LLExperienceCache::EXPIRES);
updateData.erase(LLExperienceCache::AGENT_ID);
LLHTTPClient::post(url, updateData, new LLCoroResponder(
boost::bind(fn, boost::bind(&LLCoroResponder::getContent, _1))));
}
//=========================================================================
void LLExperienceCacheImpl::mapKeys(const LLSD& legacyKeys)
{
for (const auto& exp : legacyKeys.array())
{
if (exp.has(LLExperienceCacheImpl::EXPERIENCE_ID) && exp.has(LLExperienceCacheImpl::PRIVATE_KEY))
{
LLExperienceCacheImpl::privateToPublicKeyMap[exp[LLExperienceCacheImpl::PRIVATE_KEY].asUUID()] =
exp[LLExperienceCacheImpl::EXPERIENCE_ID].asUUID();
}
}
}
// Return time to retry a request that generated an error, based on
// error type and headers. Return value is seconds-since-epoch.
F64 LLExperienceCacheImpl::getErrorRetryDeltaTime(S32 status, const AIHTTPReceivedHeaders& headers)
{
// Retry-After takes priority
std::string retry_afters;
if (headers.getFirstValue("retry-after", retry_afters))
{
LLSD retry_after(retry_afters);
// We only support the delta-seconds type
S32 delta_seconds = retry_after.asInteger();
if (delta_seconds > 0)
{
// ...valid delta-seconds
return F64(delta_seconds);
}
}
// If no Retry-After, look for Cache-Control max-age
// Allow the header to override the default
std::string cache_control;
if (headers.getFirstValue("cache-control", cache_control))
{
S32 max_age = 0;
if (LLExperienceCacheImpl::maxAgeFromCacheControl(cache_control, &max_age))
{
LL_WARNS("ExperienceCache")
<< "got EXPIRES from headers, max_age " << max_age
<< LL_ENDL;
return (F64)max_age;
}
}
// No information in header, make a guess
if (status == 503)
{
// ...service unavailable, retry soon
const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min
return SERVICE_UNAVAILABLE_DELAY;
}
else if (status == 499)
{
// ...we were probably too busy, retry quickly
const F64 BUSY_DELAY = 10.0; // 10 seconds
return BUSY_DELAY;
}
else
{
// ...other unexpected error
const F64 DEFAULT_DELAY = 3600.0; // 1 hour
return DEFAULT_DELAY;
}
}
bool LLExperienceCacheImpl::maxAgeFromCacheControl(const std::string& cache_control, S32 *max_age)
{
// Split the string on "," to get a list of directives
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
tokenizer directives(cache_control, COMMA_SEPARATOR);
tokenizer::iterator token_it = directives.begin();
for ( ; token_it != directives.end(); ++token_it)
{
// Tokens may have leading or trailing whitespace
std::string token = *token_it;
LLStringUtil::trim(token);
if (token.compare(0, MAX_AGE.size(), MAX_AGE) == 0)
{
// ...this token starts with max-age, so let's chop it up by "="
tokenizer subtokens(token, EQUALS_SEPARATOR);
tokenizer::iterator subtoken_it = subtokens.begin();
// Must have a token
if (subtoken_it == subtokens.end()) return false;
std::string subtoken = *subtoken_it;
// Must exactly equal "max-age"
LLStringUtil::trim(subtoken);
if (subtoken != MAX_AGE) return false;
// Must have another token
++subtoken_it;
if (subtoken_it == subtokens.end()) return false;
subtoken = *subtoken_it;
// Must be a valid integer
// *NOTE: atoi() returns 0 for invalid values, so we have to
// check the string first.
// *TODO: Do servers ever send "0000" for zero? We don't handle it
LLStringUtil::trim(subtoken);
if (subtoken == "0")
{
*max_age = 0;
return true;
}
S32 val = atoi( subtoken.c_str() );
if (val > 0 && val < S32_MAX)
{
*max_age = val;
return true;
}
return false;
}
}
return false;
}

View File

@@ -0,0 +1,181 @@
/**
* @file llexperiencecache.h
* @brief Caches information relating to experience keys
*
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, 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_LLEXPERIENCECACHE_H
#define LL_LLEXPERIENCECACHE_H
#include "linden_common.h"
#include "llsingleton.h"
#include "llframetimer.h"
#include "llsd.h"
#include <boost/signals2.hpp>
struct LLCoroResponder;
class LLSD;
class LLUUID;
class LLExperienceCache final : public LLSingleton < LLExperienceCache >
{
friend class LLSingleton<LLExperienceCache>;
LLExperienceCache();
public:
typedef std::function<std::string(const std::string &)> CapabilityQuery_t;
typedef std::function<void(const LLSD &)> ExperienceGetFn_t;
void idleCoro();
void setCapabilityQuery(CapabilityQuery_t queryfn);
void cleanup();
//-------------------------------------------
// Cache methods
void erase(const LLUUID& key);
bool fetch(const LLUUID& key, bool refresh = false);
void insert(const LLSD& experience_data);
const LLSD& get(const LLUUID& key);
void get(const LLUUID& key, ExperienceGetFn_t slot); // If name information is in cache, callback will be called immediately.
bool isRequestPending(const LLUUID& public_key);
//-------------------------------------------
void fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, ExperienceGetFn_t fn) { fetchAssociatedExperience(objectId, itemId, LLStringUtil::null, fn); }
void fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, std::string url, ExperienceGetFn_t fn);
void findExperienceByName(const std::string text, int page, ExperienceGetFn_t fn);
void getGroupExperiences(const LLUUID &groupId, ExperienceGetFn_t fn);
// the Get/Set Region Experiences take a CapabilityQuery to get the capability since
// the region being queried may not be the region that the agent is standing on.
void getRegionExperiences(CapabilityQuery_t regioncaps, ExperienceGetFn_t fn);
void setRegionExperiences(CapabilityQuery_t regioncaps, const LLSD &experiences, ExperienceGetFn_t fn);
void getExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn);
void setExperiencePermission(const LLUUID &experienceId, const std::string &permission, ExperienceGetFn_t fn);
void forgetExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn);
void getExperienceAdmin(const LLUUID &experienceId, ExperienceGetFn_t fn);
void updateExperience(LLSD updateData, ExperienceGetFn_t fn);
//-------------------------------------------
static const std::string NAME; // "name"
static const std::string EXPERIENCE_ID; // "public_id"
static const std::string AGENT_ID; // "agent_id"
static const std::string GROUP_ID; // "group_id"
static const std::string PROPERTIES; // "properties"
static const std::string EXPIRES; // "expiration"
static const std::string DESCRIPTION; // "description"
static const std::string QUOTA; // "quota"
static const std::string MATURITY; // "maturity"
static const std::string METADATA; // "extended_metadata"
static const std::string SLURL; // "slurl"
static const std::string MISSING; // "DoesNotExist"
// should be in sync with experience-api/experiences/models.py
static const int PROPERTY_INVALID; // 1 << 0
static const int PROPERTY_PRIVILEGED; // 1 << 3
static const int PROPERTY_GRID; // 1 << 4
static const int PROPERTY_PRIVATE; // 1 << 5
static const int PROPERTY_DISABLED; // 1 << 6
static const int PROPERTY_SUSPENDED; // 1 << 7
private:
virtual ~LLExperienceCache();
void initSingleton() override;
// Callback types for get()
typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t;
typedef boost::shared_ptr<callback_signal_t> signal_ptr;
// May have multiple callbacks for a single ID, which are
// represented as multiple slots bound to the signal.
// Avoid copying signals via pointers.
typedef std::map<LLUUID, signal_ptr> signal_map_t;
typedef std::map<LLUUID, LLSD> cache_t;
typedef uuid_set_t RequestQueue_t;
typedef std::map<LLUUID, F64> PendingQueue_t;
//--------------------------------------------
static const std::string PRIVATE_KEY; // "private_id"
// default values
static const F64 DEFAULT_EXPIRATION; // 600.0
static const S32 DEFAULT_QUOTA; // 128 this is megabytes
static const int SEARCH_PAGE_SIZE;
//--------------------------------------------
void processExperience(const LLUUID& public_key, const LLSD& experience);
//--------------------------------------------
cache_t mCache;
signal_map_t mSignalMap;
RequestQueue_t mRequestQueue;
PendingQueue_t mPendingQueue;
LLFrameTimer mEraseExpiredTimer; // Periodically clean out expired entries from the cache
CapabilityQuery_t mCapability;
std::string mCacheFileName;
bool mShutdown;
void eraseExpired();
void requestExperiencesCoro(const LLCoroResponder& responder, RequestQueue_t);
void requestExperiences();
void fetchAssociatedExperienceCoro(const LLCoroResponder& responder, ExperienceGetFn_t);
void findExperienceByNameCoro(const LLCoroResponder& responder, ExperienceGetFn_t);
void getGroupExperiencesCoro(const LLCoroResponder& responder, ExperienceGetFn_t);
void regionExperiences(CapabilityQuery_t regioncaps, const LLSD& experiences, bool update, ExperienceGetFn_t fn);
void regionExperiencesCoro(const LLCoroResponder& responder, ExperienceGetFn_t fn);
void experiencePermissionCoro(const LLCoroResponder& responder, ExperienceGetFn_t fn);
void bootstrap(const LLSD& legacyKeys, int initialExpiration);
void exportFile(std::ostream& ostr) const;
void importFile(std::istream& istr);
//
const cache_t& getCached();
// maps an experience private key to the experience id
LLUUID getExperienceId(const LLUUID& private_key, bool null_if_not_found=false);
//=====================================================================
inline friend std::ostream &operator << (std::ostream &os, const LLExperienceCache &cache)
{
cache.exportFile(os);
return os;
}
inline friend std::istream &operator >> (std::istream &is, LLExperienceCache &cache)
{
cache.importFile(is);
return is;
}
};
#endif // LL_LLEXPERIENCECACHE_H

View File

@@ -168,19 +168,20 @@ const U32 ESTATE_ACCESS_ALL = ESTATE_ACCESS_ALLOWED_AGENTS
| ESTATE_ACCESS_BANNED_AGENTS
| ESTATE_ACCESS_MANAGERS;
// for EstateOwnerRequest, estateaccessdelta message
const U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1 << 0;
const U32 ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES = 1 << 1;
// for EstateOwnerRequest, estateaccessdelta, estateexperiencedelta messages
const U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1U << 0;
const U32 ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES = 1U << 1;
const U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1 << 2;
const U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1 << 3;
const U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1 << 4;
const U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1 << 5;
const U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1 << 6;
const U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1 << 7;
const U32 ESTATE_ACCESS_MANAGER_ADD = 1 << 8;
const U32 ESTATE_ACCESS_MANAGER_REMOVE = 1 << 9;
const U32 ESTATE_ACCESS_NO_REPLY = 1 << 10;
const U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2;
const U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3;
const U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4;
const U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5;
const U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6;
const U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7;
const U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8;
const U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9;
const U32 ESTATE_ACCESS_NO_REPLY = 1U << 10;
const U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11;
const S32 ESTATE_MAX_MANAGERS = 15;
const S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access, banned
@@ -191,6 +192,26 @@ const U32 SWD_OTHERS_LAND_ONLY = (1 << 0);
const U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1);
const U32 SWD_SCRIPTED_ONLY = (1 << 2);
// Controls experience key validity in the estate
const U32 EXPERIENCE_KEY_TYPE_NONE = 0;
const U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1;
const U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2;
const U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3;
const U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED;
const U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED;
//
const U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2;
const U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3;
const U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4;
const U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5;
const U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6;
const U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7;
const S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
#endif

View File

@@ -1393,6 +1393,8 @@ char const* const _PREHASH_AppearanceVersion = LLMessageStringTable::getInstance
char const* const _PREHASH_CofVersion = LLMessageStringTable::getInstance()->getString("CofVersion");
char const* const _PREHASH_AppearanceHover = LLMessageStringTable::getInstance()->getString("AppearanceHover");
char const* const _PREHASH_HoverHeight = LLMessageStringTable::getInstance()->getString("HoverHeight");
char const* const _PREHASH_Experience = LLMessageStringTable::getInstance()->getString("Experience");
char const* const _PREHASH_ExperienceID = LLMessageStringTable::getInstance()->getString("ExperienceID");
// <FS:CR> Aurora Sim
char const* const _PREHASH_RegionSizeX = LLMessageStringTable::getInstance()->getString("RegionSizeX");

View File

@@ -1393,6 +1393,8 @@ extern char const* const _PREHASH_AppearanceVersion;
extern char const* const _PREHASH_CofVersion;
extern char const* const _PREHASH_AppearanceHover;
extern char const* const _PREHASH_HoverHeight;
extern char const* const _PREHASH_Experience;
extern char const* const _PREHASH_ExperienceID;
// <FS:CR> Aurora Sim
extern char const* const _PREHASH_RegionSizeX;

View File

@@ -7,6 +7,7 @@ include(LLCommon)
include(LLMath)
include(LLMessage)
include(LLRender)
include(Boost)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
@@ -18,7 +19,7 @@ include_directories(
set(llplugin_SOURCE_FILES
llpluginclassbasic.cpp
llpluginclassmedia.cpp
llplugincookiestore.cpp
#llplugincookiestore.cpp
llplugininstance.cpp
llpluginmessage.cpp
llpluginmessagepipe.cpp
@@ -33,7 +34,7 @@ set(llplugin_HEADER_FILES
llpluginclassbasic.h
llpluginclassmedia.h
llpluginclassmediaowner.h
llplugincookiestore.h
#llplugincookiestore.h
llplugininstance.h
llpluginmessage.h
llpluginmessageclasses.h
@@ -46,14 +47,6 @@ set(llplugin_HEADER_FILES
set_source_files_properties(${llplugin_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
if(NOT WORD_SIZE EQUAL 32)
if(WINDOWS)
# add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif (NOT WORD_SIZE EQUAL 32)
list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES})
add_library (llplugin ${llplugin_SOURCE_FILES})
@@ -67,6 +60,8 @@ else()
)
endif()
set_target_properties(llplugin PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
add_subdirectory(slplugin)
# # Add tests

View File

@@ -623,12 +623,14 @@ bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifie
return result;
}
void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers)
void LLPluginClassMedia::scrollEvent(int x, int y, int clicks_x, int clicks_y, MASK modifiers)
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "scroll_event");
message.setValueS32("x", x);
message.setValueS32("y", y);
message.setValueS32("clicks_x", clicks_x);
message.setValueS32("clicks_y", clicks_y);
message.setValue("modifiers", translateModifiers(modifiers));
sendMessage(message);
@@ -711,9 +713,9 @@ void LLPluginClassMedia::sendPickFileResponse(const std::vector<std::string> fil
}
LLSD file_list = LLSD::emptyArray();
for (std::vector<std::string>::const_iterator in_iter = files.begin(); in_iter != files.end(); ++in_iter)
for (const auto& file : files)
{
file_list.append(LLSD::String(*in_iter));
file_list.append(LLSD::String(file));
}
message.setValueLLSD("file_list", file_list);

View File

@@ -75,7 +75,7 @@ public:
void setAutoScale(bool auto_scale);
void setZoomFactor(F64 zoom_factor) { mZoomFactor = zoom_factor; }
void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; };
void setBackgroundColor(const LLColor4& color) { mBackgroundColor = color; };
void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; };
@@ -107,7 +107,7 @@ public:
bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data);
void scrollEvent(int x, int y, MASK modifiers);
void scrollEvent(int x, int y, int clicks_x, int clicks_y, MASK modifiers);
// enable/disable media plugin debugging messages and info spam
void enableMediaPluginDebugging( bool enable );

View File

@@ -1,7 +1,6 @@
project(SLPlugin)
include(00-Common)
include(Linking)
include(LLCommon)
include(LLPlugin)
include(Linking)
@@ -69,12 +68,7 @@ target_link_libraries(SLPlugin
${LLCOMMON_LIBRARIES}
${APRUTIL_LIBRARIES}
${PLUGIN_API_WINDOWS_LIBRARIES}
)
add_dependencies(SLPlugin
${LLPLUGIN_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLCOMMON_LIBRARIES}
${PTHREAD_LIBRARY}
)
if (DARWIN)

View File

@@ -42,8 +42,11 @@ LLMaterialID::LLMaterialID()
LLMaterialID::LLMaterialID(const LLSD& pMaterialID)
{
llassert(pMaterialID.isBinary());
parseFromBinary(pMaterialID.asBinary());
llassert(pMaterialID.isBinary() || pMaterialID.isUUID());
if (pMaterialID.isUUID())
set(pMaterialID.asUUID().mData);
else
parseFromBinary(pMaterialID.asBinary());
}
LLMaterialID::LLMaterialID(const LLSD::Binary& pMaterialID)

View File

@@ -36,6 +36,7 @@ class LLMaterialID
{
public:
LLMaterialID();
LLMaterialID(const LLUUID& id) { set(id.mData); }
LLMaterialID(const LLSD& pMaterialID);
LLMaterialID(const LLSD::Binary& pMaterialID);
LLMaterialID(const void* pMemory);

View File

@@ -1037,14 +1037,26 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa
}
//assign exception faces to cur_ptr
if (exception_faces >= (0x1 << 7))
if (exception_faces >= ((U64)0x1 << 7))
{
if (exception_faces >= (0x1 << 14))
if (exception_faces >= ((U64)0x1 << 14))
{
if (exception_faces >= (0x1 << 21))
if (exception_faces >= ((U64)0x1 << 21))
{
if (exception_faces >= (0x1 << 28))
if (exception_faces >= ((U64)0x1 << 28))
{
if (exception_faces >= ((U64)0x1 << 35))
{
if (exception_faces >= ((U64)0x1 << 42))
{
if (exception_faces >= ((U64)0x1 << 49))
{
*cur_ptr++ = (U8)(((exception_faces >> 49) & 0x7F) | 0x80);
}
*cur_ptr++ = (U8)(((exception_faces >> 42) & 0x7F) | 0x80);
}
*cur_ptr++ = (U8)(((exception_faces >> 35) & 0x7F) | 0x80);
}
*cur_ptr++ = (U8)(((exception_faces >> 28) & 0x7F) | 0x80);
}
*cur_ptr++ = (U8)(((exception_faces >> 21) & 0x7F) | 0x80);
@@ -1053,6 +1065,7 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa
}
*cur_ptr++ = (U8)(((exception_faces >> 7) & 0x7F) | 0x80);
}
*cur_ptr++ = (U8)(exception_faces & 0x7F);
@@ -1112,7 +1125,7 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat
// Includes information about image ID, color, scale S,T, offset S,T and rotation
BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
{
const U32 MAX_TES = 32;
const U32 MAX_TES = 45;
U8 image_ids[MAX_TES*16];
U8 colors[MAX_TES*4];
@@ -1197,7 +1210,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
{
const U32 MAX_TES = 32;
const U32 MAX_TES = 45;
U8 image_ids[MAX_TES*16];
U8 colors[MAX_TES*4];
@@ -1401,7 +1414,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
{
// use a negative block_num to indicate a single-block read (a non-variable block)
S32 retval = 0;
const U32 MAX_TES = 32;
const U32 MAX_TES = 45;
// Avoid construction of 32 UUIDs per call
static LLUUID image_ids[MAX_TES];

View File

@@ -320,7 +320,7 @@ public:
// - Vir
struct LLTEContents
{
static const U32 MAX_TES = 32;
static const U32 MAX_TES = 45;
U8 image_data[MAX_TES*16];
U8 colors[MAX_TES*4];

View File

@@ -306,6 +306,13 @@ public:
SPECULAR_MAP,
NUM_TEXTURE_CHANNELS,
};
enum eVolumeTexIndex
{
LIGHT_TEX = 0,
SCULPT_TEX,
NUM_VOLUME_TEXTURE_CHANNELS,
};
typedef enum {
TRIANGLES = 0,

Some files were not shown because too many files have changed in this diff Show More