Compare commits

...

1564 Commits

Author SHA1 Message Date
Rye Mutt
7709a275d6 Update FMOD 2022-09-30 23:58:50 -04:00
Your Name
ca7ea4a541 Correctly use Python2 2021-07-18 15:33:42 -04:00
Liru Færs
e6dc4d404f Don't forget to upload the 32-bit build! 2021-02-18 23:22:20 -05:00
Liru Færs
33cdb8a01f Make a function for trying to upload a platform's build 2021-02-18 23:08:00 -05:00
Liru Færs
dfcdb6ba09 Make gitlab ci work even if there's no linux build 2021-02-14 17:15:37 -05:00
Liru Færs
ae244983b0 Nope, this was broken, woops!~ 2021-02-14 14:36:45 -05:00
Liru Færs
8d2bdd4a18 New year, new gitlab-ci; thanks Rye!~ 2021-02-14 13:51:07 -05:00
Liru Færs
246db973b4 These changes look harmless 2021-02-14 12:43:19 -05:00
Tarocco
d49c38bf18 Refactor LLDAELoader
- Many instances of null-checking if statements include both variable declaration and initialization (for scoping)
- Modern(ish) C++ conventions (e.g. range-based for loops, auto keyword)
- Local variable caching for array/iterator elements
- const keyword for variables that should not be mutated (optimization possible)
- const keyword for instance methods that should not mutate (affects LLModelLoader in one case)
- Consistent usage of un/signed types for array indexing
- Better readability/simplicity of branching
- Consolidated extractTranslation/ViaElement logic (reusability)
- Formatting
- Changes based on code review
2020-10-11 19:32:16 -04:00
Liru Færs
c1aa88c720 Fix bad VLC experience in installer. Thanks Rye~ 2020-10-07 20:02:49 -04:00
Tarocco
937618b177 Model-space transformations applied to skinned model and bind shape matrix
Skin data is retrieved in processElement() by instance_controller elements, and calling processDomModel(), replacing the daeDatabase method
2020-10-07 09:05:26 -04:00
Rye Mutt
4a0936a4b5 Enable running master builds from web 2020-10-01 00:17:09 -04:00
Rye Mutt
891286c447 Merge pull request #35 from tarocco/meshupload
Improved mesh model (DAE) loader compatibility
2020-10-01 00:10:21 -04:00
Rye Mutt
04db5d1075 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer into master 2020-09-29 23:33:09 -04:00
Rye Mutt
997037a232 Update fmodstudio to 2.0.04 build 417 2020-09-29 22:52:11 -04:00
Rye Mutt
f0dfb0b080 Update openjpeg with alchemy changes 2020-09-29 22:48:31 -04:00
Tarocco
f9c07b4806 only use SID if it is not empty 2020-09-24 20:14:19 -07:00
Tarocco
9f9a21bb73 refactor: reuse local variable 2020-09-24 20:04:43 -07:00
Tarocco
386528a892 Improved mesh model (DAE) loader compatibility
Added dynamic SID joint resolution for skinning (adds compatibility for DAE files made using MAXON Cinema 4D)
2020-09-06 21:11:15 -07:00
Router Gray
4efe28cf52 Merge in offline item deliveries fix from upstream. This also reverts commit 24f54572. 2020-07-21 00:23:19 -05:00
Router Gray
2528f71bbf [Media] Add https to allowed audio urls 2020-06-16 10:57:04 -05:00
Router Gray
5610eaa839 [UI] Let the 'Dimensions' text on texture preview floaters be as wide as it wants to be so enbiggenized font sizes don't truncate it. 2020-06-16 10:57:04 -05:00
Router Gray
881cc46aa9 Add missing strings to floater_model_preview.xml 2020-06-16 10:57:04 -05:00
Router Gray
81f342e9bf [Windows][Installer] Add CRC check, add 7z to plugin reserves, remove old MS DLLs, use https for LL web start menu shortcuts 2020-06-16 10:56:49 -05:00
Router Gray
fe9d670800 [Linux] Update the debugging instructions in the viewer launch script to reflect unpackaged unstripped binary availability. 2020-06-05 13:19:32 -05:00
Router Gray
ffb54802d4 [Media] Nuke unused llmime and associated build tests, also remove unneeded includes in llmimetypes header. 2020-05-28 12:14:03 -05:00
Router Gray
518da73ad2 Drop some unused boost lexical_cast includes and associated MSVC pragmas. 2020-05-22 14:48:35 -05:00
Router Gray
3e78b74474 Now that fmt plays nice with gcc let's actually use it: replace std::to_string, boost lexical_cast and a couple miscellaneous llformats with fmt. (Alchemy sync-ish) 2020-05-20 21:07:18 -05:00
Router Gray
34a7ebf53f [Linux] Port some bits from Alchemy & future to stop using dark-ages deprecated GDK/GTK.
Todo: Revisit this and clean up some code duplication I stumbled over in the process. (legacy.cpp llwindowsdl.cpp)
2020-05-19 21:48:57 -05:00
Router Gray
45be739fea [Lib][Linux] Use system SDL not prebuilt. 2020-05-19 21:42:56 -05:00
Router Gray
68ae8afaf9 [Lib] Update abseil and fmt. 2020-05-19 16:51:29 -05:00
Router Gray
2bdcd9d07f [Linux] Target SSE 4.1. (I will make custom builds if anyone on older cpu's turns up. - RG) 2020-05-19 16:50:36 -05:00
Router Gray
24f5457203 Add setting to allow legacy UDP offline message fetch till LL fixes the cap. 2020-05-19 16:46:52 -05:00
Liru Færs
f941bc4334 [RLVa] Lie about our version of the spec, for now, I'll fix this later
RLV_VERSION is supposed to follow Marine Kelley's version,
we support most 2.9.0 features, but no 2.9.20 ones. So this is correct.

RLVa_VERSION is undocumented, play pretend by matching Kitty's version
Kitty's version has no documentation about version differences
that I can find. So we're just going to pretend to be up to date.
2020-05-19 14:00:01 -04:00
Shyotl
ab5bce69ee Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-05-16 22:52:08 -05:00
Shyotl
050a8c3923 Use sse copy for vertex and texcoord data. 2020-05-16 22:48:41 -05:00
Shyotl
8817bf53e3 Fix loading of texture precache list. 2020-05-16 22:45:50 -05:00
Shyotl
5e21037230 Fix rare shutdown crash 2020-05-16 22:44:03 -05:00
Liru Færs
cabaf0fd1c Don't use buildHTTP for login page, it might be https! Copy entire uri! 2020-05-13 19:40:52 -04:00
Shyotl
bd92a09a48 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-05-09 04:51:12 -05:00
Shyotl
61f90c665a Fix issue with persistent notifications. open_notifications.xml was accumulating inaccessible notifications. Added MaxPersistentNotifications to cap notifications. Notifications new stored per account per grid. Startup should be faster too. 2020-05-09 04:50:01 -05:00
Router Gray
32dbd40e64 Unhack the string_view workaround in llpreviewgesture, with a slightly less hacky hack in llstring. lol. Thanks Liru for making this as lean as ancient gcc can stand it to be. 2020-04-26 08:44:23 -05:00
Router Gray
a69e04a817 [Lib] Update Fmtlib, and enable it for Linux builds. This is bare bones; only removing the Linux workarounds in Cmake. 2020-04-26 00:05:02 -05:00
Router Gray
159de683e8 Correct a logical OR in llrender, and add guards against mCount dropping below zero. (Alchemy and LL sync) 2020-04-26 00:04:48 -05:00
Liru Færs
a9dbaf5e0a Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2020-04-23 23:23:38 -04:00
Shyotl
3c3d8c2400 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-23 14:57:55 -05:00
Shyotl
b4080f8e2d Demote this to llassert. 2020-04-23 14:57:30 -05:00
Shyotl
5de94d6610 Address several remaining 1.8.9.8373 crashes reported on 2020-04-23 14:56:47 -05:00
Shyotl
829045c262 Haphazard unsigned to signed casts causing problems? Shocker. 2020-04-23 14:51:06 -05:00
Liru Færs
b02d70fba0 Merge stuff from future branch and a logic bug fix by Router 2020-04-23 11:43:22 -04:00
Liru Færs
64ed6e99f0 Fix [NAME] appearing in certain i18n notifications instead of slurls
Thanks for catching this, Nai
2020-04-19 20:12:23 -04:00
Liru Færs
33d3bb2870 [Chat Logs] When migrating file to new name, respect possible new name file
If a new name file exists, copy its contents into our currently tracked
file, because we update our tracked file, the new file can only contain
more recent text (unless a name change back and forth and back happened
since last run, but then the out of order text isn't entirely our fault)

So we copy the new file's text to the bottom of our old file and then
remove the new file, so we can rename our old tracked file to the updated
name.

If we cannot perform the copy, or the delete, we bypass the migration,
leaving our old tracked file as a remnant and begin to track the new name
file because that is more proper than clinging to the old one, and thus
no history is lost to failure.
2020-04-19 20:04:25 -04:00
Liru Færs
4df2193a4c [Chat Logs] Always read from name cache on start to try to update ID Map 2020-04-19 16:40:17 -04:00
Liru Færs
343be08467 [Chat Logs] Break out migrateFile from makeLogFileName for use elsewhere 2020-04-19 15:50:50 -04:00
Liru Færs
788b83bff3 Woops, thanks for catching this, Shyotl! 2020-04-18 19:15:49 -04:00
Liru Færs
c201ac90ba Track log names in a json map AND Fix processing local log load as system
Update old style callbacks for chatFromLogFile functions to lambdas
Keep track of people's log's name using their IDs, but don't rename.
Fallback on ID if name is empty (if the grid is a meanie)
Also track group names this way, sometimes those change.
Prefer std::array, since we're in the area.
2020-04-18 00:17:05 -04:00
Shyotl
af3c66ad08 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-16 02:23:32 -05:00
Shyotl
9bffc4bb82 Attempt to squash spatial partition crash. 2020-04-16 00:52:55 -05:00
Shyotl
132db6225e Make Debug configuration compile once more. 2020-04-16 00:49:42 -05:00
Shyotl
257086cbfc Revert texture fetching behavior back closer to v3. 2020-04-16 00:36:56 -05:00
Liru Færs
7755f1ec52 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-04-11 10:28:04 -04:00
Router Gray
c5f1ac808b Fix postcard sends, use cap for user info, stop using 'from' email as per upstream. Mark final and overrides. Thanks Nadira Fairport for reporting & Liru for help. 2020-04-11 09:22:26 -05:00
Liru Færs
1a8660909d Copy Folder ID and Open Folder In New Window for ANY folder 2020-04-10 17:40:06 -04:00
Shyotl
e6826a4c7c Fix 'is typing...' notifications never going away. 2020-04-10 16:28:37 -05:00
Router Gray
801bb8a075 Compile fix, make types agree in terniary in octree. Thanks Liru. 2020-04-10 13:21:57 -05:00
Shyotl
b2c965e22d Do not apply internal windlight parameter scaling on the sliders themselves. 2020-04-09 14:20:55 -05:00
Shyotl
be3cbc642b Update current region debug string upon cap seed request. Carry over seed cap if dead region is replaced with new. 2020-04-09 02:12:36 -05:00
Shyotl
24331d3c90 Prefer LLPointer over potential for dangling LLSpatialGroup pointers. 2020-04-09 01:56:32 -05:00
Shyotl
8a16e6c99f Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-08 18:18:19 -05:00
Shyotl
f36e8fbeca Better crashdump context. 2020-04-08 18:11:09 -05:00
Liru Færs
718ef09adf Fix removing/exporting picks when unable to add more
Wooops, wrote that wrong, must've been tired or something
2020-04-08 09:21:21 -04:00
Liru Færs
6443849ea9 Do not lookup strings in the toolbar per frame, ack! 2020-04-08 08:33:41 -04:00
Liru Færs
cbb7e473ba Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2020-04-08 06:59:48 -04:00
Liru Færs
118957362f Fix mismatched tag 2020-04-08 05:11:11 -04:00
Shyotl
ed7f73769f Potentially fix crash in LLSurface 2020-04-07 23:30:12 -05:00
Liru Færs
ae15dcb318 Merge 41224c57317b6c1b44528aa1dc1f13732cdffe6d from viewer-lion... sorta
Fixes broken default perms message sometimes popping up for certain avs
2020-04-07 16:55:58 -04:00
Liru Færs
c4af22481c Update mesh export code, cause why not. 2020-04-07 15:30:13 -04:00
Liru Færs
ae17f76bb4 Remove now unused LLIMInfo 2020-04-07 10:49:48 -04:00
Liru Færs
7e62d17fda Don't try to use region if it's null for permissions defaults 2020-04-07 05:56:06 -04:00
Liru Færs
f9185e8bc8 Fix mutelist popping up, I think
LLMuteList::add should return false if nothing new was added
2020-04-07 05:55:24 -04:00
Liru Færs
1361f9b57d Simplify selection of mute 2020-04-07 04:29:45 -04:00
Liru Færs
b86eae026b Sync to fix using gMessageSystem when it may not have the right message 2020-04-07 04:29:20 -04:00
Liru Færs
79d938a4f4 Sync LLMuteList code with upstream 2020-04-07 02:51:08 -04:00
Liru Færs
23068a70a2 Select Mute when muting object via Object profile 2020-04-06 07:53:42 -04:00
Shyotl
0aa5e0bb88 Close 'default permissions' window on client disconnect. Nonfunctional after that point anyhow. Also applying setting crashes due to null region after dc. 2020-04-05 14:56:35 -05:00
Router Gray
5040275969 [CMake] Releases shouldn't speak Greek. 2020-04-04 06:47:39 -05:00
Liru Færs
1daccf40ee Move the FMOD Powered By text, for Torric and others 2020-04-04 07:28:19 -04:00
Shyotl
4fd302286b Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-03 06:02:48 -05:00
Shyotl
18f9f19e61 Textures mid-decode potentially processing of other textures until complete. Disabled UDP texture fetch fallback when connected to official grid. 2020-04-03 06:01:58 -05:00
Liru Færs
1de6d4461a Add missing EmergencyTeleportSeconds preference to System->Security
Thanks for the heads up about this missing preferences, and for the
Spanish translation, Damian!
2020-04-03 02:53:41 -04:00
Shyotl
4198f47ab6 Fix header breakage in debug/relwithdebug 2020-04-03 00:33:19 -05:00
Shyotl
d9049ba342 Handle AISAPI throttling and status 410 a bit better. 2020-04-02 21:47:07 -05:00
Shyotl
f75ac3e4c2 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-02 20:09:53 -05:00
Liru Færs
06698deaca A couple more sim->region changes 2020-04-02 21:08:23 -04:00
Shyotl
445eb29bd3 Bring aisapi handling closer to LL (code 499 retry, match timeout values, etc) 2020-04-02 20:07:55 -05:00
Shyotl
cc034f6841 Fix inventory scrolling issue when navigating via keyboard. 2020-04-02 20:03:08 -05:00
Liru Færs
3c368651f1 Update crashpad, thanks Rye! 2020-04-02 20:39:01 -04:00
Damian Zhaoying
321730e384 More translations fixes in Area search and menu list owners. 2020-04-02 03:02:23 -03:00
Damian Zhaoying
c2fd88670f Fix some remaining spanish translations. 2020-04-02 02:36:20 -03:00
Liru Færs
7b03103a1f April Fools!
Ha, goteem
2020-04-01 20:52:44 -04:00
Liru Færs
ac3e19c91a Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2020-04-01 20:47:23 -04:00
Liru Færs
4c7d2224e3 Fix reverted xml change, fix formatting 2020-04-01 20:43:00 -04:00
Shyotl
3ab800d99e Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-01 19:26:41 -05:00
Shyotl
332cef0f84 Disable debug logging unless RelWithDeb 2020-04-01 19:26:23 -05:00
Damian Zhaoying
9de6d7627b A lot of updates and fixes for spanish language translations. 2020-04-01 20:44:41 -03:00
Liru Færs
98b42e88c1 Fix SV-2282: Incorrect terminology for TP Sound preference UI 2020-04-01 06:56:51 -04:00
Liru Færs
e642e9561a The sim is actually the region 2020-04-01 04:42:34 -04:00
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
Rye Mutt
bcadee8575 Apply a lil alchemy blackmagic 2019-10-07 12:40:30 -04:00
Rye Mutt
77f8855fd6 Swap to absl hash maps on two extremely hot paths 2019-10-07 12:07:00 -04:00
Rye Mutt
b4243dc95b Enable larger resolution media surfaces for ultrawide monitors 2019-10-07 12:06:42 -04:00
Rye Mutt
2f4d254bc6 Fix calling cmake -E to use proper cmake var 2019-10-07 12:03:15 -04:00
Rye Mutt
e98e9391bf Ignore pip lockfile 2019-10-07 11:57:39 -04:00
Rye Mutt
e1757d68a5 Enable cmake IDE folder generation 2019-10-07 11:56:46 -04:00
Rye Mutt
a46f1145f5 Properly disable WER reporting 2019-10-07 11:56:31 -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
Rye Mutt
8561af1f84 Add abseil hashmaps and use in texture list, also fix bugs in texture list insertion 2019-09-28 19:03:49 -04:00
Rye Mutt
0880c762c9 Update nvapi to new location 2019-09-26 20:35:43 -04:00
Rye Mutt
886619a099 Add files needed for python venv 2019-09-26 20:11:43 -04:00
Liru Færs
64f4df5005 scroll_list -> name_list in translations 2019-09-11 15:21:10 -04:00
Damian Zhaoying
fd5e9fa85f Update spanish translations - Avatar menu 2019-09-10 01:57:08 -03:00
Damian Zhaoying
6a0506386d Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-09-09 14:52:48 -03:00
Liru Færs
c5787381aa Fix up inactive translations to have the new submenus translated 2019-09-09 13:11:13 -04:00
Damian Zhaoying
22ed61f69c Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-09-09 13:19:33 -03:00
Liru Færs
f6e204e4fb Merge branch 'animesh' of https://github.com/DamianZhaoying/SingularityViewer into animesh 2019-09-09 12:14:55 -04:00
Liru Færs
6f5abf105d Fix PT translation graphics reset button overlap 2019-09-09 12:05:30 -04:00
Liru Færs
8106a949bd Actually show tooltip for account info on profile 2019-09-07 18:02:05 -04:00
Liru Færs
497012f98e Clean up focused UI menu code and opt out a common dynamic_cast
Initially I null checked this in testing and debugging, and since
then this code has just lowered performance, ugh.
2019-09-07 13:36:08 -04:00
Liru Færs
46f57756e7 Fix invalid TimestampFormat being generated by custom/old date setting
New Behaviors:
If you have a custom date setting, your TimestampFormat will not be set
(you'll need to set it yourself).
If you have a custom time setting and not a custom date setting, your
TimestampFormat will end with your ShortTimeFormat.
2019-09-07 12:26:09 -04:00
Damian Zhaoying
6a6f3d61bb Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-09-02 13:45:53 -03:00
Damian Zhaoying
956af9177e Update Spanish Translations 2019-08-30 18:55:58 -03:00
Liru Færs
f2d1c820f5 Update FMODStudio for more platforms, yay!~ 2019-08-30 16:58:57 -04:00
Liru Færs
5999998ead On second thought, let's reorganize that menu to be more chat oriented
Send IM should be exposed top level
Profile should be inside the submenu
The submenu should be called Actions
2019-08-30 15:56:12 -04:00
Liru Færs
293820747f Add the Avatar submenu to the agent menus and create parity between them
A little mouse hover to open a submenu is better than an unwieldy menu
Moves Focus into the avatar section
2019-08-30 15:39:23 -04:00
Liru Færs
4b97f76aa7 Make the right click avatar slurl menu as good as the list ones 2019-08-30 15:24:05 -04:00
Liru Færs
2e465ba04a Improve List menu with IsNearby check
Teleport To is now available whenever a user is nearby, regardless of list
The local avs menu's Moderation submenu, Focus, and Track/Untrack has been
adopted into the main avs list menu making the only difference submenuing

Fix track/untrack not working, since it requires the radar to work right
2019-08-29 17:45:55 -04:00
Liru Færs
7c367d4e9c Participant Lists should be name_lists 2019-08-29 13:38:21 -04:00
Liru Færs
773ee898f7 Update fmodstudio 2019-08-29 13:32:23 -04:00
Liru Færs
8b85b9b06b Add Copy Page URL to media right click menu 2019-08-26 09:00:32 -04:00
Liru Færs
7c092411b0 Fix the scrollbar being missing on the estate access lists
Also make the access tab more beautiful overall
2019-08-26 08:59:37 -04:00
Liru Færs
e237c02295 Sometimes account into is too long to display on profiles, show tooltip 2019-08-26 08:38:22 -04:00
Liru Færs
4b36cd4a58 [OpenSim] Sometimes we are given invalid born strings, don't crash! 2019-08-26 08:36:11 -04:00
Liru Færs
a20f4450e9 Revert "update sources"
This reverts commit ce4b35ba1a.
2019-08-25 17:24:02 -04:00
Liru Færs
bc99ceee12 Merge branch 'animesh' of https://github.com/RouterGray/SingularityViewer into animesh 2019-08-25 17:21:56 -04:00
Liru Færs
2c3e37024e A Name List that's double clicked should open a profile
Unless other behavior already exists, name lists aren't all scroll lists,
void where prohibited, other restrictions may apply.
2019-08-25 17:02:48 -04:00
Liru Færs
a399bd7b62 Rework Name List Items to store the name type fully
It's more proper this way, but this will create some merge fighting
2019-08-25 15:51:29 -04:00
Router Gray
c90c303fd4 [Linux] Fix 'error: invalid initialization of non-const reference'. 2019-08-20 21:05:50 -05:00
Liru Færs
29236442de A scroll list doesn't always handle double clicks 2019-08-18 17:27:52 -04:00
Liru Færs
b93f4fa879 Do hitItem opted like drawItems, and be able to click on item slivers 2019-08-18 17:08:00 -04:00
Liru Færs
971083415c This should fix Nai's issue, maybe? 2019-08-18 16:20:26 -04:00
Liru Færs
a1a23cf6c5 At least draw the hidden item... I'll fix this later 2019-08-18 03:33:15 -04:00
Liru Færs
51974891a8 Harmless change 2019-08-18 03:32:37 -04:00
Liru Færs
7670094e7d Rearrange these to where they're needed, and opt draw more 2019-08-18 02:07:37 -04:00
Liru Færs
69addc1d52 Use Cached Control during draw call 2019-08-18 01:33:42 -04:00
Liru Færs
ab4e0127c5 Further optimize LLScrollListCtrl::setFilter for contracted filter cases 2019-08-18 01:22:02 -04:00
Liru Færs
ba9e7d8056 Fix filtering scrolllist scrollies
filterItem now returns a bool whether or not the item was filtered.
2019-08-18 01:13:26 -04:00
Liru Færs
878b200217 Don't bother updating scroll list scrollbar rect when invisible 2019-08-17 23:54:30 -04:00
Liru Færs
1ffa9f7c0c Fix and optimize redundant scroll list drawing logic 2019-08-17 23:52:43 -04:00
Liru Færs
d46b8f9963 Profile 2nd Life tab gets a much needed facelift 2019-08-17 21:54:42 -04:00
Liru Færs
1b52b3e685 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh
# Conflicts:
#	indra/llcommon/llindexedvector.h
2019-08-15 20:50:36 -04:00
Damian Zhaoying
5eef36c47a More updates to spanish language
# Conflicts:
#	indra/newview/skins/default/xui/es/floater_toolbar_prefs.xml
2019-08-15 20:45:38 -04:00
Shyotl
5c156a9d86 Added ll(Start/Stop)ObjectAnimation lsl function awareness 2019-08-11 20:37:00 -05:00
Shyotl
4f72de8289 Make gcc happy with closer to standards compliant code.. 2019-08-10 01:16:37 -05:00
Shyotl
a9c165f8a4 These should be inline now that they arent member functions. 2019-08-09 23:49:16 -05:00
Shyotl
767bdc1a30 Make linux happier? 2019-08-08 13:48:13 -05:00
Shyotl
f09b828217 Use wgl shared context lists to avoid re-creating gl context from scratch. 2019-08-07 23:02:34 -05:00
Shyotl
d2b28f60ff Speed up object param lookups. 2019-08-07 22:50:08 -05:00
Shyotl
21b1d5b52e Hotspot elimination. 2019-08-07 21:21:36 -05:00
Router Gray
f61becccb3 [gpu table] Add AMD Radeon/Asus RX series. 2019-08-07 21:05:00 -05:00
Router Gray
0da6696e83 [gpu table] Make the AMD Vega wildcard wilder. Add Nvidia RTX series cards.
Also banish the VE to near bottom of the AMD/ATI list
2019-08-07 11:47:18 -05:00
Shyotl
4091bf9da5 Template abuse to clean up llkeyframemotion. Only functional change: std::map<F32, curve> to std::vector<std::pair<F32, curve>>. Sorry in advance Linux. 2019-08-06 02:21:56 -05:00
Shyotl
da86dd08c4 Throttle avie complexity calculation frequency to once per 5s per avie. 2019-08-06 00:09:59 -05:00
Liru Færs
59a12dfe1d Clean up some last few QuickTime things 2019-08-05 21:13:32 -04:00
bittenbythedark
468f28941f Remove unneeded notifcations 2019-08-05 21:10:20 -04:00
bittenbythedark
a987bcac6f Fix MP4 Playback on windows, alchesync 2019-08-05 21:08:13 -04:00
Liru Færs
782d71a745 This probably will fix the active voice list issue 2019-08-05 21:03:25 -04:00
Lirusaito
212bd47d36 Revert "This probably won't fix the active voice list issue"
This reverts commit 466f901105.
2019-08-05 16:41:28 -04:00
Lirusaito
bcf301ce6a Add Marketplace option to toolbar and add to world menu
Also hidden in this commit is the ability to add buttons/menu entries for
your favorite websites to be opened in the in-viewer browser
Just make a button that calls "ShowWebFloater" and passes the URL as param
2019-08-03 20:17:30 -04:00
Lirusaito
01b4f52fb0 Add support for better speakerlist for conferences 2019-08-02 20:30:15 -04:00
Lirusaito
2cc41405d2 Restore Access Management lists' sort orders after populating them 2019-08-02 20:09:11 -04:00
Lirusaito
37c6636788 A function to set scroll list sort order
Renames getSortColumns to getSortOrder
2019-08-02 20:05:58 -04:00
Lirusaito
80c24532ba Remove excess getChilds from llfloaterland 2019-08-02 17:55:22 -04:00
Lirusaito
4702e3d586 Fix parcel access management 2019-08-01 22:27:29 -04:00
Lirusaito
466f901105 This probably won't fix the active voice list issue 2019-08-01 16:51:17 -04:00
Router Gray
ed4e91ee7f [Linux] Cmake fix to not do manifest copy twice when packaging. 2019-08-01 08:48:57 -05:00
Router Gray
ee6f919ea7 [Linux] Properly detect full screen resolutions. Thx Laffalott reporting and Henri Beauchamp for code. 2019-08-01 08:48:15 -05:00
Lirusaito
9f84fe6d5a Make it Squeak 2019-07-31 19:43:33 -04:00
Lirusaito
2580ca7afd Fix paused frame overflow, thanks Rye! 2019-07-31 14:22:27 -04:00
bittenbythedark
aee0e75971 Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-07-31 00:55:19 +02:00
bittenbythedark
ce4b35ba1a update sources 2019-07-31 00:53:30 +02:00
Router Gray
dc77a053ea [Alchemy sync] Switch from shipping vc_redist to shipping the dll's from the build host. 2019-07-29 23:04:26 -05:00
Router Gray
565153c5f7 Fix weird gesture deactivation and state-save bug with weird fix.
Also OCDly replace a NULL with nullptr (not part of the above fix).
2019-07-29 17:55:48 -05:00
Lirusaito
6aab72beb8 Remove iffy EAM change 2019-07-29 11:21:00 -04:00
Lirusaito
c8bd1f5f5b Fix the duplicate squeaks 2019-07-26 21:17:02 -04:00
Lirusaito
5f2b3a10ff X-Grid Protocol resolution support 2019-07-26 20:44:17 -04:00
Lirusaito
1466539d88 [Feature Request] Open Muted List Profiles via Double Click 2019-07-26 20:27:17 -04:00
Lirusaito
01b02fd6b1 We must prompt the user before giving them support the first time 2019-07-26 20:24:09 -04:00
Lirusaito
16a6af820a Fix the duplicate squeaks 2019-07-26 19:09:36 -04:00
Lirusaito
ac7e5cb742 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-07-26 04:22:43 -04:00
Shyotl
2dbbec88f7 Fixed bug with LLStat median calculation. Clean up llstatbar a bit. 2019-07-25 23:43:04 -05:00
Shyotl
6dc9210a7e Const is good. Use it for viewer stats. 2019-07-25 22:30:44 -05:00
Lirusaito
4a6031ba38 How did this happen? 2019-07-25 22:00:37 -04:00
Lirusaito
466cc0b98d Chocolate must be really bad for me, I'm super dizzy and dazed... 2019-07-25 11:07:56 -04:00
Lirusaito
ed6dcb6a5b More code cleanup to fix compile 2019-07-25 10:56:20 -04:00
Lirusaito
ec8d2646cd Fix ancient dumb code breaking shiny modern features
Now if you have your date or time format set via debug settings,
they'll only be overwritten if you use the preferences UI for them

Be warned that the cancel button will not restore your custom formats
debug settings are nice to use, but you are an edge case power user

This commit cleans up a buncha duplicated code and makes it look nice and neat
Thanks to Router for making sure I wasn't crazy~
2019-07-25 10:35:50 -04:00
Router Gray
bca94dc4be Fix linux64 dullahan link bc some browsers are so smart they're dumb. Thanks Tazy Scientist. 2019-07-24 21:15:37 -05:00
Router Gray
8e00ae1d44 Allow gstreamer plugin to compile on Gentoo et al. Thanks to Tazy Scientist. 2019-07-24 17:49:39 -05:00
Router Gray
99303883dc Banish WIN_VSVER from not-Windows. Thanks Drake for dealing with my stubbornness. 2019-07-24 03:16:01 -05:00
Shyotl
ea2b1e179e Removed unnecessary lighting assertions. Fixed compiler warning. 2019-07-23 20:49:17 -05:00
Lirusaito
bf10ab4bb1 Fix single line profile button for Group IMs started by others 2019-07-23 02:29:34 -04:00
Lirusaito
0f24c79ce9 Restore storage of list maximum column width
Fixes thin lists in comboboxes and flyout buttons
2019-07-23 02:07:40 -04:00
Lirusaito
c5ad7849ac PathfindingDirty was dirty 2019-07-22 23:42:24 -04:00
Lirusaito
d66c730c30 Back down on overzealous list filter checking and explicitly default filter
For clarity to others in the future: getFiltered() checks are meant for
functions where the user is interacting the scroll list in some way
or we're displaying the scroll list.
2019-07-22 23:38:45 -04:00
Lirusaito
61730f3ee1 Commas, please 2019-07-22 10:33:11 -04:00
Lirusaito
1cc2933c32 Merge branch 'animesh' of https://github.com/RouterGray/SingularityViewer into animesh 2019-07-22 10:13:56 -04:00
Lirusaito
34b42cc5d7 TOS and Voice License stuff 2019-07-22 10:10:01 -04:00
Lirusaito
4cb43c6747 Add in an option for YYYY/MM/DD, for the classical log stampies
Cleanup that prefs code, too!
2019-07-22 10:09:14 -04:00
Lirusaito
189590edb9 Naaaaaaaa 2019-07-22 10:04:31 -04:00
Router Gray
c711847b4e Don't crumble Liru's cookies (less spam in linux manifest) 2019-07-22 07:56:19 -05:00
Lirusaito
b3fcd87a20 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-07-22 08:52:10 -04:00
Lirusaito
3654ff5f5c Fix up EAM to work (Part 2)
Did you know you could type into a list to search it by prefix?!
The Lindens didn't!!
Let's make this search bar an ACTUAL FILTER!
To do this, we add support for filtering to all scroll lists,
so that's cool. Also filtered items will be selected.

Also optimized item selection loop to perform better when selecting in
massive lists (like group members)

Changed the text on the Copy Button to reflect that it copies everything,
not just the applied filter... if you wanted that, you could just
ctrl-a, ctrl-c... I mean, reallly
2019-07-22 08:39:06 -04:00
Lirusaito
31c5b00fed Fix up EAM to work (Part 1)
Move Copy button to bottom because NO ONE KNOWS HOW TO UI ANYMORE,
I am alone, so alone *single tear*

Don't draw headings on single column lists, it just wastes space
2019-07-22 08:36:11 -04:00
Router Gray
2484555854 Linux library updates: FMOD Studio 2.00.02, Dullahan. 2019-07-22 04:49:58 -05:00
Router Gray
9600965bcf Dullahan finally works, thanks Liru, Bitten, Drake. Catch Linux up. 2019-07-22 04:48:34 -05:00
Shyotl
1bd6ba61a7 Improve vram detection on systems with multiple gpu devices. 2019-07-22 01:31:15 -05:00
Shyotl
899d09bfcc Don't /actually/ run in true core context yet as people like to play with settings they don't understand. 2019-07-21 02:33:12 -05:00
Shyotl
35433cb8a4 Added tools->avatar tool submenu when rightclicking rigged mesh. Fixed 'reset skeleton and animations' on self pie menu not working. 2019-07-21 01:57:30 -05:00
Lirusaito
7d9642210d Close on select before selection callback, if desired 2019-07-20 18:52:27 -04:00
Lirusaito
8126418ef3 Sync with upstream to kill dependent floaters appropriately 2019-07-20 18:43:10 -04:00
Lirusaito
d0a6772245 Merge in EAM from viewer-release
Remove the derpy stuff lindens like to do
Wide strings aren't normal strings

Make it all a bit better~
Redid the Duration floater because it was kinda icky,
gave it more flexibility~<3
Display parcel ban and access durations as dates instead of text, sortable!
Reworked the rather icky lookin' Access panel control ordering
Enabled lowering parcel ban time without needing to find and remove first
2019-07-20 18:27:47 -04:00
Lirusaito
3f921251ee Add getAllIDs to LLScrollListCtrl, and make getSelectedIDs a little better 2019-07-18 20:09:47 -04:00
Lirusaito
cf94149dc1 Scroll List Dates need a default format 2019-07-18 18:55:05 -04:00
Lirusaito
74d26eac86 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-07-18 02:52:18 -04:00
Shyotl
225d174ec6 MIN_MEM_FOR_NON_TEXTURE setting doesn't work well with new math. Lower signifigantly. 2019-07-18 01:33:47 -05:00
Shyotl
3bc4d6fd63 Fix UI backgrounds vanishing when toggling basic shaders on and off. 2019-07-17 20:20:41 -05:00
Shyotl
94787c6da8 Quiet down harmless debug warnings on nVidia when using renderDebugGL. 2019-07-15 21:00:09 -05:00
Lirusaito
6d2b530330 Feature Request: Make the build number display check setting persist 2019-07-14 02:29:32 -04:00
Lirusaito
c2fbb6f10f Fix single line group chat button positions 2019-07-14 02:12:03 -04:00
Router Gray
2f54cf26a9 Make gcc happy, silence 'changed meaning' warning. 2019-07-14 02:10:06 -04:00
Lirusaito
9945fc1767 Enable Abuse Report from P2P IM 2019-07-12 17:48:59 -04:00
Pytak
186cf58197 [PyFX] add new windlights and PPE presets from PyFX 0.7 2019-07-12 17:44:32 -04:00
Lirusaito
1c80ae45d8 Sync experience script stuff from future branch~ 2019-07-11 00:38:53 -04:00
Lirusaito
2c992c3f16 This was broken, that's stupid 2019-07-10 23:55:07 -04:00
Lirusaito
e2f7a0ef5c Let's nearly break logging to add a highly requested feature
My keyboard has been broken for almost half a year
and none of you will ever care
but I care about you
I care so much
2019-07-10 23:54:48 -04:00
Lirusaito
665df2fe4e Feature request, allow keywords to trigger on system messages 2019-07-10 20:57:32 -04:00
Lirusaito
311020034e Only render friends when AlwaysRenderFriends is set to 2 2019-07-10 20:50:44 -04:00
Lirusaito
564a9abf42 Enable left mouse menu support, part 1 2019-07-10 18:03:38 -04:00
Lirusaito
6a60fa3458 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-07-10 03:43:44 -04:00
Lirusaito
94cf62f510 Fix issue of Enter not reliably opening items 2019-07-10 03:33:05 -04:00
Lirusaito
1920f529be Feature Request: Add Received Items to menu(under World)/toolbar 2019-07-10 03:32:33 -04:00
Shyotl
1234cf42e9 msg_blk_data_map_t mMemberBlocks must be ordered. Todo: convert to vector, as insertion order should be good enough with minor changes. 2019-07-10 01:37:00 -05:00
Shyotl
ed9307097b Updated LLFloaterMessageLog 2019-07-10 01:16:40 -05:00
Shyotl
f16bde1ac8 No exceptions on unrecognized messages. 2019-07-10 01:06:21 -05:00
Shyotl
49b027f2a0 Rework llindexedvector to be a bit more debugable. 2019-07-10 01:05:42 -05:00
Lirusaito
ff2c0e52b4 Cleanup those menu entries, too, and make them checks as they should be 2019-07-10 00:01:21 -04:00
Lirusaito
8094d13c2e Use type names instead of new category names for built in folder floaters 2019-07-09 23:52:38 -04:00
Shyotl
37839ff247 Fix broken 'create new outfit' checkboxes. Not sure when this broke.. (The checkboxes are wrongly lower-cased. Hack around it in code instead of breaking translations...) 2019-07-09 22:04:46 -05:00
Shyotl
e32b13e226 Disable old hack that was breaking ssl connections, as LL now uses TLS1.1. 2019-07-09 21:39:21 -05:00
Lirusaito
3a678f5a9b Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-07-04 12:39:47 -04:00
Lirusaito
b8cfb5c8be Unbreak my Goat, Fix UDP again 2019-07-04 11:02:40 -04:00
Lirusaito
476721b4b9 Comment out unused variable 2019-07-04 11:01:39 -04:00
Lirusaito
b4a37bf20d I finally got around to uploading the 32-bit windows dullahan package 2019-07-04 10:43:28 -04:00
Naiyako
4a6a81b5d4 Make fmod2.0 compiling
Signed-off-by: Lirusaito <inusaito@gmail.com>
Added libraries to autobuild, mac build from Bitten
2019-07-04 10:42:19 -04:00
Shyotl
d9392d5c39 fix cmake without vc redist. remove double to float warning. 2019-07-04 09:30:59 -05:00
Shyotl
279d919164 Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer.git into animesh 2019-07-03 19:42:40 -05:00
Shyotl
9e47335f98 Revert raised cache cap. Actual impl is not in this branch. Also use actual unit types for cache size logic because it looks nicer. 2019-07-03 17:50:09 -05:00
Shyotl
43ab8a2e36 Do not attenuate specular map with diffuse map trasnparency. 2019-07-03 16:00:33 -05:00
Shyotl
b5cb6459b0 Tweak memory detection algorithm. 2019-07-03 16:00:16 -05:00
Shyotl
4622be4cef Clear sim stats upon stats stat update in new region. 2019-07-03 15:59:51 -05:00
Lirusaito
b9e522fd8d Hide Marketplace Listings folder from main inventory, it bugs filters 2019-07-02 22:47:37 -04:00
Lirusaito
71f2dee332 Yet more TOS Floater tweaks 2019-07-02 22:39:26 -04:00
Lirusaito
b86e402fc0 Remove now unused rectangle setting for opening in folders new floaters 2019-07-02 14:06:19 -04:00
Lirusaito
658be9bd58 Fully combine voice with tos stuffs
Removes separate voice license code
Cleans up tos code
2019-07-02 14:00:46 -04:00
Lirusaito
65df86e741 Integrate voice license code into floatertos 2019-07-02 13:12:46 -04:00
Lirusaito
0197a47007 Support modern event slurls 2019-07-01 20:31:09 -04:00
Lirusaito
ce42937e3f Goats are as delicate as the UDP pipeline 2019-07-01 20:29:08 -04:00
Lirusaito
aec4278292 Unbreak the goat! 2019-06-30 18:25:27 -04:00
Lirusaito
8fef329437 Fix UB, thanks Router and Clang for the heads up 2019-06-29 21:23:07 -04:00
Lirusaito
128d30bd4b Fix Compile 2019-06-16 03:57:04 -04:00
Lirusaito
7dea17cdc7 Fix Xitano's bug by fixing my viewer_manifest bootstrap paradox 2019-06-13 18:27:43 -04:00
Lirusaito
82386fe2ef Negative TeleportHistoryMaxEntries means unlimited now 2019-06-10 09:15:35 -04:00
Lirusaito
c2f56f1881 Woops, now inventory floaters remember their position per folder for real! 2019-05-31 22:57:50 -04:00
Lirusaito
68fc758e94 Do not make installer package unless binary is updated (or touched)
This is bad for production,
adding a touch binary line to the prebuild step should fix it though
2019-05-31 19:35:22 -04:00
Lirusaito
1cd7706461 Actually updaate the binary we put into the installer 2019-05-31 18:22:56 -04:00
Lirusaito
2e5141bd25 Possible fix for Torric's gesture toggle crash 2019-05-27 06:25:29 -04:00
Router Gray
f6d8573221 "Liru: All getters should be const, ideally." Clang agrees.
The values being compared are const, the result should be too.
2019-05-24 12:06:35 -05:00
Router Gray
562982cc30 Null check, sooner is better, and clang is happy. Thanks Liru. 2019-05-24 12:06:34 -05:00
Router Gray
df13aa408b Add missing operand in inventory actions. 2019-05-24 12:06:33 -05:00
Router Gray
4329d46ac4 Properly comment out code so compilers quit whining about 'unreachable'. 2019-05-24 12:06:33 -05:00
Router Gray
bf9e900731 Fix warning about variable promotion. 2019-05-24 12:06:32 -05:00
Router Gray
40ad9fad32 Fix fonts search path on not-Windows. 2019-05-24 12:06:32 -05:00
Router Gray
3951f6f516 Fix no newline at EOF. 2019-05-24 12:06:31 -05:00
Router Gray
58d94e9883 Change some instances of {0} to {} to pacify compilers. 2019-05-24 12:06:30 -05:00
Router Gray
55c0ba5b06 Silence compiler warning destructor on non-final w/virtual functions & non-virtual destructor 2019-05-24 05:57:15 -05:00
Router Gray
e327c5ad0e Merge remote-tracking branch 'github-liru/animesh' into animesh 2019-05-23 11:48:22 -05:00
Lirusaito
bf176ffd4d Prevent the texteditor from parsing highlights when it shouldn't 2019-05-11 22:49:56 -04:00
Lirusaito
6a7695a8f0 Refactor appendAndHighlightTextImpl's Highlight impl and fix selection 2019-05-11 22:40:17 -04:00
Lirusaito
4bb63a9827 Fix SinguReplaceLinks not being respected on various user driven UI
Corrects display for Readonly Notecards, Picks, Group profiles, First/
Second Life, Classifieds, Events, Landmarks, About Land, and Region/Estate

Thanks for giving me the heads-up, Beware
2019-05-10 18:47:06 -04:00
Lirusaito
2a40ca6295 LLTextEditor's setText and setWText shouldn't always enforce linking 2019-05-10 16:45:20 -04:00
Lirusaito
e9c99089e1 No viewer_manifest warnings, please. 2019-05-10 14:04:32 -04:00
Lirusaito
93af7491ee Attempt at fixing beware's selection lost bug once and for all 2019-05-07 01:07:48 -04:00
Lirusaito
2075d92369 Fix crash when SinguReplaceLinks is false reported by Beware 2019-05-07 00:33:39 -04:00
Router Gray
9bcd3298ba Use dictionaries prebuilt instead of in-tree; adds several languages. 2019-05-05 20:15:04 -04:00
Router Gray
2f9a43effd Sync with Alchemy to fix and streamline Windows plugins packaging 2019-05-05 20:14:59 -04:00
Router Gray
535a01ea30 SLVoice update Windows and Mac 2019-05-05 20:14:53 -04:00
Lirusaito
1193f9bb65 Fix Torric's no copy texture crash
Thanks for the research and textures, Cheesy
2019-05-05 20:09:31 -04:00
Lirusaito
623b993fa9 Fix the inventory floater resize bug
Thanks for catching this, Deltek.
2019-05-05 18:52:00 -04:00
Lirusaito
7773f6b4f7 Restore the old toggle behavior of the special inventory floaters 2019-05-04 07:12:40 -04:00
Lirusaito
2b47e62dd8 Remove dumb dynamic cast children loop in toolbar init
:%s/\<button /button sound_flags="0" /
2019-05-04 03:51:12 -04:00
Lirusaito
3d21dc309c Views fromXML can have sound_flags now 2019-05-04 03:40:08 -04:00
Lirusaito
6dadfaffac Improve rect control name of inventory folder floater
This makes it more reliably usable and more understandable to the user.

The downside of this is that folders with the same name will have the same
position, but I don't think that really matters.
2019-05-04 03:34:38 -04:00
Lirusaito
f0ef3a4569 Fix defaulted inventory folder floater title 2019-05-04 03:31:50 -04:00
Lirusaito
140f5d3b0a Make Outbox and Favorites like other new inventory windows
Yay search~
2019-05-04 03:24:28 -04:00
Lirusaito
22f314d158 Dynamically create Rect Controls for storing Inv in New Window Pos/Size 2019-04-29 00:15:43 -04:00
Lirusaito
8653ee79ea Update Floater Inv Panel to be more modern 2019-04-28 09:02:43 -04:00
Lirusaito
0cc146a170 Change LLInstanceTracker to use a boost unordered map
Also remove unused functions and an unused typedef with it
2019-04-28 09:01:38 -04:00
Lirusaito
56378772cc Add operator == for LLSD to llsdutil.h 2019-04-28 09:00:17 -04:00
Lirusaito
64561fa57b [Radar] Feature Request: Make sort order persist 2019-04-28 06:30:20 -04:00
Lirusaito
b34021abd5 Fix Beware's notecard embed crash by immediately reflowing upon remove
We'll want to revisit this later and more optimally fix it.
2019-04-28 06:22:42 -04:00
Lirusaito
c6b17c9005 Probably fix Torric's issue of notes being overwritten 2019-04-28 06:17:57 -04:00
Lirusaito
331023e878 Strings and LLSD settings now get edited with a text editor 2019-04-28 03:39:13 -04:00
Lirusaito
d47fb4da03 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-04-28 01:21:51 -04:00
Lirusaito
40faef0bf8 If a setting is LLSD, display it in pretty print xml in debug
This should probably get its own TextEditor later on, it'd look better.
2019-04-27 03:04:11 -04:00
Lirusaito
b8c9d9c0f3 Clean up LLScrollListCtrl and add ability to getSortColumns() 2019-04-27 03:02:47 -04:00
Lirusaito
d33ae35fb3 OK in preferenes should save per account settings if possible 2019-04-27 03:01:49 -04:00
Shyotl
5f56d2d38f Show channel in script text box dialog popdown 2019-04-26 22:52:59 -05:00
Shyotl
d7e7701927 Make texture fetch type (mFTType) a const member variable and remove from init() call. forceRefetch was clobbering mFFType via init call and firstinit boolean is a stupid hack. 2019-04-26 22:52:48 -05:00
Lirusaito
005ec30d7b Max estate managers is 15 now 2019-04-25 17:07:51 -04:00
Lirusaito
15a8e1f08f Don't limit estate managers on non-SL grids, let the grid do that. 2019-04-25 15:40:51 -04:00
Lirusaito
2d06d455cd ProductEngines are Lindens, I guess. 2019-04-25 01:48:56 -04:00
Lirusaito
f2b773dac7 Fix linux build, thanks Router 2019-04-24 17:34:45 -04:00
Lirusaito
14774b03ad Squash Nai's bug and still fix the issue? 2019-04-23 13:33:09 -04:00
Lirusaito
190e3e8c2f Fix link replacement being enforced improperly, thanks Beware! 2019-04-21 22:06:33 -04:00
Lirusaito
0464e611c7 Sync with future branch for urls 2019-04-21 20:39:54 -04:00
Lirusaito
f7386e8e70 Update python stuff to latest
Probably definitely break linux
2019-04-20 16:28:51 -04:00
Lirusaito
a5be867238 Merge branch 'master' of https://github.com/Pytak/SingularityViewer into animesh 2019-04-20 10:28:58 -04:00
Router Gray
002cbce499 Regextra. Fix URLs with '?' params and probly other stuff too. Thanks Liru. 2019-04-20 09:21:20 -04:00
Router Gray
5f38bb4bf2 Make dullahan autoplay autoplay. Thanks Liru. 2019-04-20 09:15:46 -04:00
Router Gray
726141d6da Fix LLViewerObject processTaskInvFile iterator double .begin() and no .end() 2019-04-20 09:14:48 -04:00
Lirusaito
ed09681479 There's no need to warn or even mention this, thanks Deltek! 2019-04-20 01:35:30 -04:00
Lirusaito
d194dfbc09 Sync with alchemyng for VCRedist update 2019-04-19 23:25:47 -04:00
Lirusaito
8ef3e923e8 Allow bare minimum urls in [url text] syntax 2019-04-19 20:07:46 -04:00
Lirusaito
564410ac7e Fix some warnings and errors 2019-04-19 17:29:55 -04:00
Lirusaito
f2beb4443a This should fix Linux, thanks Drake. 2019-04-19 16:52:40 -04:00
Lirusaito
1a88370566 Finish hooking up VLC and removing quicktime 2019-04-19 15:00:05 -04:00
Lirusaito
01b4339b6f Fix configure
Not sure how Prebuilt.cmake worked in my repo but not others, but okay.
Of course I'd forget to stage the libvlc directory.
And somehow vlc-bin wasn't added to autobuild.xml?!
2019-04-19 13:11:52 -04:00
Lirusaito
308a249891 Pie menus were looking up settings each frame...
How am I the first to notice this.
Also, while we're here, let's clean up duplicate code and make some constexprs
2019-04-19 02:29:12 -04:00
Lirusaito
1244d5df03 Fix the chat bug, save the world~
Also fix badly written parts of LL stuff synced.
2019-04-19 01:16:27 -04:00
Lirusaito
f26425f17a VLC instead of QuickTime
I dunno if it's actually in there yet... meh
2019-04-19 00:05:49 -04:00
Lirusaito
b28313559d Update to VS2019, you now need autobuild-1.1 on windows 2019-04-18 23:49:47 -04:00
Lirusaito
d933472a16 Wooops, I'm sick and blind 2019-04-18 23:29:28 -04:00
Lirusaito
6c034506c3 Does this fix the issue with recent items not updating? 2019-04-18 20:55:17 -04:00
Lirusaito
8979f12111 Fix the chat bug, I think... also momre text base sync, yay! 2019-04-18 14:45:21 -04:00
Lirusaito
289d1055e5 Fix bad md5sum? 2019-04-18 13:55:56 -04:00
Lirusaito
41ebd51fca C'mon, reallly? 2019-04-18 10:16:48 -04:00
Lirusaito
07569d008d Fix compile issues, thanks Router! 2019-04-18 09:19:20 -04:00
Lirusaito
e5f3d1d8bc Break Linux? Fix volume catcher? Only time will tell 2019-04-17 18:41:13 -04:00
Lirusaito
f670c774d3 Oh hey, we can do this part of VLC merge right now too! 2019-04-17 18:28:22 -04:00
Lirusaito
7c41dc2e7e It's a syncing ship
Ha... get it?
I'm so lonely...
2019-04-17 18:09:39 -04:00
Lirusaito
7c40f3332f Myan 2019-04-17 18:07:32 -04:00
Lirusaito
2df95bb4bd Floater About VLC support 2019-04-17 17:57:22 -04:00
Lirusaito
68a4975fe1 Actually fix the removal of Starting session
Thanks for the assistance and testing, Router~!
2019-04-17 15:01:48 -04:00
Lirusaito
41c56f706a It's all Greek to me
Thanks, Router!
2019-04-17 12:43:36 -04:00
Lirusaito
56962a26cc Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-04-17 12:43:28 -04:00
Shyotl
7f776c0d53 Fixed geom never generating in some scenarios. 2019-04-17 00:49:46 -05:00
Shyotl
bee0109e33 Reduce per-frame std::map lookups.. 2019-04-16 20:08:10 -05:00
Router Gray
fd6b367746 Fix missed changes for is_trivially_copyable and make gcc happy about them (#4) 2019-04-13 16:43:47 -04:00
Liru Færs
5e12a9d057 Scream!
Thanks for looking into this Router
2019-04-13 10:07:34 -04:00
Lirusaito
5228451c9c Fix a lag bug of chat vanishing at the start, 'cause that's wrong.
This might break chat, but I'm sleepy, so you get it untested...
do the math yourself if it's wrong.
2019-04-13 03:09:12 -04:00
Lirusaito
c78770138d If a log file doesn't exist, just let the user know with a sound
Also a warning, in the log, displaying the path.
2019-04-13 03:02:26 -04:00
Lirusaito
947cf57100 And then I remembered windows is windows. 2019-04-13 02:53:01 -04:00
Damian Zhaoying
4a59efadeb Fix spaming messages in assert and is_trivially_copyable on GCC 4 2019-04-13 01:02:38 -04:00
Shyotl
66b929c3fa Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer.git into animesh 2019-04-11 23:54:32 -05:00
Shyotl
c1d1059a9a Feature: Hold shift to disable right-clicking rigged mesh. 2019-04-11 23:53:57 -05:00
Shyotl
ccacdf7e6b Remove redundant pick hover logic. Already handled in LLToolPie. 2019-04-11 23:51:05 -05:00
Lirusaito
69100fcca3 Fix Dullazoom 2019-04-11 07:08:47 -04:00
Lirusaito
cd8edf933f [Dullahan] Add browser hotkeys for zooming (doesn't actually work yet) 2019-04-11 06:51:30 -04:00
Lirusaito
00e9960d77 Fix compile 2019-04-11 06:14:35 -04:00
Lirusaito
c9eac98d53 Drake's trivially copyable optimop 2019-04-11 05:02:43 -04:00
Lirusaito
7fc90d3dce Feature Request: Add SinguAlwaysUnderlineLinks to always underline links 2019-04-11 04:15:12 -04:00
Lirusaito
12890af0cc Fix Folder Sharing logic bug, woops, thanks Shy! 2019-04-11 04:15:08 -04:00
Shyotl
3724cf0e68 Fixed some more header issues. 2019-04-11 03:12:48 -05:00
Shyotl
1cfd782bdd Fix some compilation errors. 2019-04-11 02:54:21 -05:00
Shyotl
1351a2695e Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer.git into animesh
# Conflicts:
#	indra/newview/llspatialpartition.cpp
#	indra/newview/llvoavatar.cpp
#	indra/newview/llvovolume.cpp
2019-04-11 02:02:05 -05:00
Shyotl
e49b484c2f Updated rigged mesh selection/cursor hover handling. 2019-04-11 01:16:50 -05:00
Lirusaito
66a94c6778 Hide partner grid stuff always, unless advanced is selected 2019-04-10 15:34:26 -04:00
Lirusaito
278459bdf2 New Fonts to complain about!
Thanks Drake!
Tweaks panels to look good now that font is slightly wider
2019-04-10 15:26:23 -04:00
Lirusaito
ed88e55e04 Yay they updated llstring, who's ready for a full rebuild? 2019-04-10 12:38:35 -04:00
Lirusaito
5e1a102de4 Dullupdate: Fix not shutting down properly?
TODO: Rebuild on Linux
2019-04-10 11:37:59 -04:00
Lirusaito
27ed3ca4b9 Use pkgdir in manifest 2019-04-10 11:37:55 -04:00
Lirusaito
4ea1b8d666 Woah, new libraries? No wai! 2019-04-10 11:37:52 -04:00
Lirusaito
bfe221d571 Oh right, this complained... 2019-04-10 11:37:48 -04:00
Lirusaito
be65834e1b Dullawoof: Okay, this should definitely fix Zoom. 2019-04-10 11:37:41 -04:00
Lirusaito
3b54658e52 Apparently this wasn't even needed? Why did Visual Studio warn me? 2019-04-10 11:37:37 -04:00
Lirusaito
3462f403fe Dullasync
Fixes scaling issue
Also fixes the openid cookie
2019-04-10 06:43:14 -04:00
Shyotl
6675bb2276 Increase disk cache size limit. 2019-04-09 23:27:55 -05:00
Shyotl
3e0b75c4f7 Fix issue where alpha_mode_none and alpha_mode_emissive on rigged faces were being alpha tested and discarded. 2019-04-09 16:01:14 -05:00
Lirusaito
621a342809 What happens to a ShowParcelOwners deferred?
Does it render like a ShowParcelOwners in the forward?
Or fester like a bug when it's run?
Does it get reported like rotten meat?
Or forgot and coded over
giving users a treat?

Maybe it just sags like a heavy bird...
Prepare to Implode!

Thanks to Beware Hax for reporting this
2019-04-09 14:18:42 -04:00
Lirusaito
3ad4770b44 [Support] Show a concise indicator in chat for viewer channel/branch 2019-04-09 04:40:42 -04:00
Lirusaito
2c2d127683 Allow Unicode viewer channels 2019-04-09 04:37:23 -04:00
Lirusaito
6271dba5bf Sync Variables.cmake with future branch 2019-04-09 03:56:59 -04:00
Lirusaito
c85f8345f2 Sync World Map Message as much as possible to retain OpenSim Compat 2019-04-09 03:56:23 -04:00
Lirusaito
1ef5dc2c5d Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-04-09 02:30:24 -04:00
Lirusaito
181c6ddd9d LLGroupMgr Don't copy vectors around, we can use references
getMembersInRole with needs_sort will now sort the vector passed in
At the moment it's not used with this being true so it doesn't matter
Just take note.
2019-04-09 02:08:25 -04:00
Shyotl
8ed9934a87 Fix memory tracking bug with vertex buffers. (Cosmetic. Only affects debug stats) 2019-04-08 18:13:28 -05:00
Shyotl
99f9b98258 Keep llthread.h out of the precompiled header. Thanks. 2019-04-08 15:18:36 -05:00
Shyotl
e2cc2d600b Update event poll to work with expected server changes. Timeout now behaves like status 502 (which is being removed by LL). Keeping 502 handling as well to maintain opensim support. 2019-04-08 15:18:10 -05:00
Lirusaito
6397261a33 Thanks Deltek 2019-04-05 07:52:38 -04:00
Lirusaito
b368664d96 Merge branch 'animesh' of https://github.com/DamianZhaoying/SingularityViewer into animesh 2019-04-05 04:35:26 -04:00
Lirusaito
5617a4e59b This might be necessary for dullahan cleanup 2019-04-05 04:09:22 -04:00
Lirusaito
f137502020 Make sure to reenable the script and notecard editors when we get errors 2019-04-05 04:08:27 -04:00
Lirusaito
6a114ae027 Request: Make the description of Gemini more universally understandable 2019-04-05 03:55:12 -04:00
Lirusaito
8cb1e73fc0 [Animesh] Animated Mesh checkbox on Features tab of build tools 2019-04-05 00:26:23 -04:00
Lirusaito
293ab2c2a2 Remove duplicate toolbar visibility setting
Thanks Router!
2019-04-05 00:09:02 -04:00
Lirusaito
98bb191c4a Quiet down 2019-04-04 23:43:13 -04:00
Lirusaito
d3d72eb03c Wooops, inverted the logic! Look out! 2019-04-04 23:36:45 -04:00
Lirusaito
a3bf40fd69 Boost unordered containers in places, like for uuid types! 2019-04-04 22:22:21 -04:00
Lirusaito
a1d06e682e Switch to using typedef'd uuid types everywhere and auto for iterators
Oh, and some related opts.
2019-04-04 22:20:21 -04:00
Lirusaito
48003c8bc9 Remove pointless forward declaration 2019-04-04 21:52:57 -04:00
Lirusaito
0552c9fde2 Fix incorrect comment 2019-04-04 21:51:21 -04:00
Lirusaito
f7cc3a9e73 Feature Request: Trim spaces off of end of script lines
In order to preserve your ability to edit, this only happens to the asset
we send to the server, you will not notice until you reopen the script.
This is done as optimally as possible, upon each save.
This feature takes into account the possibility that spaces may
be following a quote and therefore it does not trim spaces in these cases.
It is also aware that you may use escaped quotes inside a string, and that
that does not mark the end of a string and therefore whitespace
is not stripped then.
2019-04-04 21:50:39 -04:00
Shyotl
af8bb2a992 Trivial cleanup. 2019-04-03 13:56:26 -05:00
Shyotl
ac2d16b15c Fix potential lod bug in mdodel decode. 2019-04-03 13:55:41 -05:00
Damian Zhaoying
6fb3c399de New spanish translations 2019-04-02 13:09:45 -03:00
Damian Zhaoying
0c44b11e9c Fix menu_radar.xml typo 2019-04-02 12:57:13 -03:00
Damian Zhaoying
5f4e4a0d54 Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-04-01 18:12:27 -03:00
Lirusaito
7d56d772d4 Dullahan on not windows... my bad 2019-04-01 01:40:44 -04:00
Lirusaito
c848af3960 Merge in Dullahan support from future branch! 2019-04-01 01:26:16 -04:00
Damian Zhaoying
ee745a20ef Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-03-31 15:16:45 -03:00
Lirusaito
30f26f462b Give the clock more room, in case of seconds ~ Deltek 2019-03-31 03:36:17 -04:00
Lirusaito
344dc90d56 Use C++11 time format flags 2019-03-31 03:13:02 -04:00
Damian Zhaoying
9b29fd1385 Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-03-31 02:29:06 -03:00
Lirusaito
c8a9efe5c8 [OpenSim] Use x-grid-info everywhere, instead of old HTTPS thing 2019-03-31 00:23:50 -04:00
Router Gray
940994288b [3:39 PM] CmdrCupcake: there is no /arch:SSE3 2019-03-30 19:11:56 -05:00
Router Gray
3e8fbc8179 Update most Windows 32 prebuilts 2019-03-30 19:11:23 -05:00
Damian Zhaoying
1644ee6fad Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-03-30 20:06:37 -03:00
Lirusaito
d419d29cc8 [VMM] Feature Request: Make Market Listings folder a system folder
Can't delete it, but now it's with the other system folders.
2019-03-30 01:26:52 -04:00
Damian Zhaoying
d5fae8dba7 Merge branch 'animesh' of https://github.com/Lirusaito/SingularityViewer into animesh 2019-03-29 21:02:06 -03:00
Damian Zhaoying
7935b2e957 Fix some strings (shortcuts names) in Spanish Translations 2019-03-29 15:01:11 -03:00
Lirusaito
8f0bda3dab Missed change for rigged picking 2019-03-29 05:57:23 -04:00
Lirusaito
8de93f4120 Update contributors/credits list 2019-03-29 00:56:56 -04:00
Lirusaito
84da9d4758 Hold shift to select rigged mesh with SGAllowRiggedMeshSelection = 1
Old behavior + shift with = 2
Thanks for the contribution, Router!
2019-03-29 00:56:01 -04:00
Lirusaito
20c4090f71 Fix LL showing up on employee profiles on other grids 2019-03-28 20:30:34 -04:00
Lirusaito
f3e18d135c This looks wrong, let's fix it. 2019-03-28 03:32:26 -04:00
Lirusaito
0ca9047f8c Optimize the way we send top scripts/object disable/return 2019-03-28 03:31:23 -04:00
Lirusaito
90e9bce8de Boost::unordered is better than std::unordered, apparently 2019-03-27 22:28:29 -04:00
Lirusaito
6d1e9ee3d4 Fix Linux, Thanks Bitten 2019-03-27 19:52:01 -04:00
Virtual Nexus
7331001bb2 Nai did a fix :P 2019-03-27 19:31:27 -04:00
Lirusaito
aac8382cf0 Fix the missing group bug AND make Voice Chat Invite better 2019-03-27 19:24:42 -04:00
Lirusaito
5272c48b7a Add getSLURL function to group and avatar actions 2019-03-27 19:09:38 -04:00
Lirusaito
81862e30d1 Merge branch 'animesh' of https://github.com/DamianZhaoying/SingularityViewer into animesh 2019-03-27 19:08:26 -04:00
Lirusaito
adb0efdf97 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-03-27 18:42:18 -04:00
Damian Zhaoying
2677f06d44 Fix bug in spanish string.xml 2019-03-27 15:22:45 -03:00
Shyotl
3a031e9364 Fix build. 2019-03-27 02:35:59 -05:00
Shyotl
d2a8863384 Added AMD Vega and Radeon VII to gpu_table.txt 2019-03-27 01:39:11 -05:00
Lirusaito
81277c2b25 Fix dev checkout message files path properly
Thanks for the assistance with the Linux path, Router!
2019-03-26 19:31:51 -04:00
Shyotl
a90cdd9c7e Experimental SHOverrideRiggedBounds setting to generate more accurate avatar bboxes. Defaults to off, for now. 2019-03-26 14:59:44 -05:00
Lirusaito
2faca7d7e2 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-03-26 05:23:26 -04:00
Lirusaito
7be177e9ab Fix a text editor bug with selection being lost when url segments updated
By doing it the right way, and calculating where the selection should be
after the change is applied.
Also no longer consider text editor modified if nothing was changed.
Also update cursor position so it doesn't move to the wrong place on update
2019-03-26 05:10:21 -04:00
Lirusaito
f2b39196a0 In dev checkouts, AppViewer now sets AppRoDataDir to newview
Crossplatform, settings, windlights, skins, the works~
No more copying~ <3
2019-03-26 02:23:51 -04:00
Lirusaito
a8f85f0d91 Don't create an empty effect with no name as the default effect...
At least, I think this fixes that
2019-03-26 01:13:25 -04:00
Lirusaito
b0ad7f6bf7 Merge branch 'animesh' of https://github.com/DamianZhaoying/SingularityViewer into animesh 2019-03-25 21:53:52 -04:00
Shyotl
7b5d7376c6 Make opengl extension loading be core compliant. Avoid issuing glGetString before context creation on Windows. 2019-03-25 19:21:45 -05:00
Damian Zhaoying
8bb694a910 Fix typos in menu_radar.xml 2019-03-25 21:12:17 -03:00
Damian Zhaoying
25f3f77849 New Spanish translations in string.xml file. (wereable items) 2019-03-25 19:28:13 -03:00
Lirusaito
06dfeb72d7 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-03-25 17:21:16 -04:00
Lirusaito
f9878e75e3 Fix remaining missing string, thanks Asriazh Frye! 2019-03-25 15:34:58 -04:00
Lirusaito
58ede9caee [EEP] Some text editor stuff 2019-03-25 14:58:45 -04:00
Lirusaito
24beaf6ce4 Add wearable type strings. 2019-03-25 14:38:12 -04:00
Lirusaito
e46380f2d9 Clean up old strings 2019-03-25 14:37:46 -04:00
Lirusaito
ffe729a53b [EEP] Use ExtEnvironment cap where possible 2019-03-25 14:33:14 -04:00
Shyotl
f3afe45e72 Fixed some gl errors. 2019-03-25 02:56:20 -05:00
Lirusaito
059fc7c4fa [EEP] LLMessage Changes 2019-03-25 00:44:00 -04:00
Lirusaito
cb295bfabc 28c814e4ef probably needs this for linux
Thanks for testing bitten!
2019-03-24 23:50:02 -04:00
Lirusaito
0ac2560508 [EEP] LLMath update 2019-03-24 23:18:35 -04:00
Lirusaito
98d315b3f7 Translation Request: Wearables 2019-03-24 22:52:30 -04:00
Lirusaito
28de2ceed8 [EEP] Change to using LLTranslationBridge::ptr_t 2019-03-24 22:52:30 -04:00
Lirusaito
28c814e4ef [EEP] Add all the new llinventory windlight settings files
Also add v3colorutil.h
Also update LLQuaternion and its LLSD pieces
2019-03-24 22:52:30 -04:00
Lirusaito
fdffe2e06a [EEP] LLParcel changes 2019-03-24 22:52:29 -04:00
Lirusaito
fb08f81e75 [EEP] Inventory/Folder type updates 2019-03-24 22:52:29 -04:00
Lirusaito
9affd767e4 [EEP] II_FLAGS_WEARABLES_MASK -> II_FLAGS_SUBTYPE_MASK 2019-03-24 22:52:29 -04:00
Lirusaito
9ccb015411 e5b81dd825 won't compile without this change 2019-03-24 22:51:35 -04:00
Lirusaito
e5b81dd825 [EEP] LLSDUtil changes 2019-03-24 21:04:51 -04:00
Lirusaito
fe33db1620 [EEP] LLSD Serialize Notation additions 2019-03-24 21:04:25 -04:00
Lirusaito
2e02f5ac2c [EEP] LLSD Changes 2019-03-24 20:59:50 -04:00
Lirusaito
198d567df2 [EEP] LLUnitType changes 2019-03-24 20:59:26 -04:00
Lirusaito
b1ecf08013 Feature request: Colon after build number in support chats for nonactions 2019-03-24 19:48:20 -04:00
Lirusaito
7c9eb35568 We optimized llformat, let's not bother caching version string
It would be used less than once per frame, better to save resources.
2019-03-24 19:43:49 -04:00
Lirusaito
1839a37294 Only parse highlights (script keyword parsing) for script editor 2019-03-24 18:54:10 -04:00
Lirusaito
bd39b29c1d Feature Request: Add a notification when receiving items from Marketplace
Turn this off with LiruReceivedItemsNotify
2019-03-23 08:38:59 -04:00
Lirusaito
1cc7c6b4cf Translation Request: Make marketplace received translatable 2019-03-23 08:37:57 -04:00
Lirusaito
0cf4663c7d Wooops, this belongs here, fix not online message translation not working 2019-03-23 05:44:45 -04:00
Lirusaito
424221201c Actually save current Post Process Effect at logout
Also properly cleanup Post Process Singleton
2019-03-23 05:01:13 -04:00
Lirusaito
a14df55bd8 Liru never gets to sleep, not even when sick
Thanks Drake.

We don't get to use std::system, standardization is a sham,
nothing is sacred, why does anyone even bother?

Have a potentially broken Mac Implementation, too, why not?
It's not like we compile on mac anyway right now.
2019-03-23 04:57:56 -04:00
Lirusaito
c16fa02558 Support chats have build in every message, cool. This is optional. 2019-03-23 03:40:20 -04:00
Lirusaito
8946aa9ee5 If a group starts with "Singularity ", mark it as a support session
This is probably not the best way to go about this, but since we're
not in control of support groups on other grids, and we have support
groups in other languages we don't run on Second Life, this is better
than maintaining a list of IDs somewhere.
2019-03-23 02:07:02 -04:00
Lirusaito
c4f868cd89 Fix Deltek's briefly missing icon for adult results in search 2019-03-23 02:03:23 -04:00
Lirusaito
cc88b1edcd Do this instead 2019-03-23 01:00:12 -04:00
Lirusaito
b3f918970b Let's print out nonzero return codes 2019-03-23 00:57:06 -04:00
Lirusaito
3d26f79b8b Dumb 2019-03-23 00:49:53 -04:00
Lirusaito
3d8e05fa2a Remove ze gestures 2019-03-22 18:02:33 -04:00
Lirusaito
aaeb90436c Actually, function operator comma order is impl defined, use erase remove 2019-03-22 17:13:37 -04:00
Lirusaito
42f4c816b7 [Animesh] Restore Quick Settings Hover Slider responsiveness 2019-03-22 03:57:58 -04:00
Lirusaito
8d06ea5a15 [InvOpts] Folder View unordered opt pass 2: Linux Boogaloo 2019-03-22 02:58:51 -04:00
Lirusaito
9f23dcb0c4 [InvOpts] Folder View unordered opt pass 2019-03-22 02:10:43 -04:00
Lirusaito
5f1047c574 [InvOpts] Inventory Observer unordered opt pass 2019-03-22 02:09:44 -04:00
Lirusaito
8d1c345580 [InvOpts] Inventory Panel unordered opt pass 2019-03-22 02:08:12 -04:00
Lirusaito
3a17bf519f Gesture Opts Pass 3, mainly fixes
Fix a linux warning, thanks Router!
Fix Linux compile errors, Thanks Router and Bitten!
Thanks to Gooz for confirming speed boosts.
Also cache end iters maybe minor boost.
2019-03-22 00:56:09 -04:00
Lirusaito
7599b00a13 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-03-21 22:04:46 -04:00
Lirusaito
f5492144ad Gesture Optimization Pass 2 2019-03-21 22:01:13 -04:00
Shyotl
d61f89e3c9 Defer bbox generation for rigged meshes until actually loaded. Fix math bug. 2019-03-21 17:22:33 -05:00
Lirusaito
879cd79fdc Gesture UI optimization, first pass 2019-03-21 03:24:44 -04:00
Lirusaito
c2f15ff47c [Joystick] Detect xBOx cOntrOLLers in ANY cAsE 2019-03-21 01:27:57 -04:00
Lirusaito
c9226f6b63 [Joystick] Use the button layout for the chosen controller type
Using the drop down now FORCES your controller to be detected
as your selection for the duration of the session until you choose another
2019-03-21 01:26:23 -04:00
Lirusaito
95ff7acd6d [Joystick] Do the code better 2019-03-21 01:09:47 -04:00
Lirusaito
0673e70aca Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-03-20 20:24:46 -04:00
Shyotl
fd53ff014e Minor bugfix. 2019-03-20 15:34:23 -05:00
Lirusaito
f5cbae3958 Support Halcyon as though it were opensim, for now. 2019-03-20 00:27:06 -04:00
Lirusaito
273c9b3479 Call ShellEx for launching urls in browser on Windows 2019-03-19 21:28:39 -04:00
Lirusaito
3f9f79c155 Fix an oopsie woopsie, thanks Shyotl 2019-03-19 21:09:26 -04:00
Lirusaito
3a5b8a1075 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh 2019-03-19 20:56:49 -04:00
Shyotl
5a9ad787d5 Made rigged matrix cache toggleable via setting, for testing. Speculative fix for hairbase incorrectly appearing on animesh. 2019-03-19 15:17:14 -05:00
Shyotl
7f7267027e Merge remote-tracking branch 'liru/animesh' into animesh 2019-03-19 13:21:17 -05:00
Shyotl
c19ef521b3 Lazy micro opt. 2019-03-19 13:20:28 -05:00
Lirusaito
83270e13f8 Woops, where'd that semicolon go when we most needed it? 2019-03-19 02:43:53 -04:00
Lirusaito
cfc71a47db Fix up ShellEx
It's now crossplatform wrapper for std::system opening of a file/path/url.
It returns an int just like std::system, 0 means it worked.
It's static so you don't need to gViewerWindow->getWindow() anymore,
honestly it should've been static in the first place.

Clean up other code to use this function because duplicate code sucks.

# Conflicts:
#	indra/llwindow/llwindowmacosx.h
#	indra/llwindow/llwindowsdl2.cpp
2019-03-19 02:43:35 -04:00
Lirusaito
45228f920d Cleanup excess code and gURLProtocolWhitelist, add isWhitelistedProtocol()
# Conflicts:
#	indra/llwindow/llwindowmacosx.cpp
#	indra/llwindow/llwindowsdl2.cpp
2019-03-19 02:41:31 -04:00
Lirusaito
627c0a6b57 Fix overzealous regex not letting ) be part of secondlife.com urls
Thanks to Bitten and Router for reporting and testing.
2019-03-18 18:16:54 -04:00
Lirusaito
573c493d5d Prevent unused variable warning. 2019-03-18 18:14:06 -04:00
Lirusaito
c5329968f7 Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer
# Conflicts:
#	indra/llcommon/llstring.h
#	indra/newview/llviewermenu.cpp
#	indra/newview/llviewerregion.cpp
2019-03-18 17:30:34 -04:00
Lirusaito
d235e045d8 Do better 2019-03-18 15:26:18 -04:00
Lirusaito
bb26127ed5 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2019-03-18 14:38:21 -04:00
Lirusaito
beddc1cb21 Avatar count on map tiles by default 2019-03-18 14:37:59 -04:00
Lirusaito
acc6f6b3c3 Reapply ability to develop UI/skins without needing to copy files 2019-03-18 14:09:18 -04:00
Shyotl
30f6dc2b2d Allow more than 2gigs of texture memory... Fix shader buggles.
# Conflicts:
#	indra/newview/llviewertexturelist.cpp
2019-03-18 00:16:34 -05:00
Shyotl
e0194d4d06 Allow more than 2gigs of texture memory... Fix shader buggles. 2019-03-18 00:11:24 -05:00
Shyotl
a224c392e8 Fixed a few remaining bugs. Including all settings. 2019-03-18 00:05:59 -05:00
Lirusaito
a6e08bfc0f Try to do opensim login stuff if not secondlife, not just if opensim/wc 2019-03-17 19:26:25 -04:00
Lirusaito
b755880dd3 Fetch inventory via udp if http inventory is off 2019-03-17 17:49:58 -04:00
Shyotl
b082bce2b1 Fix build. 2019-03-17 15:40:55 -05:00
Lirusaito
1c13ace366 Let's be real about currency
Fixes grid response for real currency not being heeded in buy currency.
2019-03-17 14:29:45 -04:00
Lirusaito
da8692f6a3 Merge branch 'ManagedMarketplace' of https://github.com/DamianZhaoying/SingularityViewer into ManagedMarketplace 2019-03-17 13:34:00 -04:00
Shyotl
b81373366b Animesh test changes. Also stop screwing with my commit messages, github. 2019-03-17 02:35:07 -05:00
Shyotl
aa37a0b539 Intermediary commit #3 2019-03-17 01:08:34 -05:00
Lirusaito
b71ee44505 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer into ManagedMarketplace 2019-03-17 00:22:55 -04:00
Lirusaito
dea8ac2cf8 Only tell the user that we're refreshing their balance on their actions 2019-03-16 23:02:24 -04:00
Shyotl
3a78568a6f Intermediary commit #2. 2019-03-16 21:35:33 -05:00
Lirusaito
6898697246 Be a gooder wlf 2019-03-16 21:47:32 -04:00
Lirusaito
820b223ea9 Deltek did a fix, thanks. 2019-03-16 21:46:16 -04:00
Lirusaito
769c6a2e03 Fix Region Restart floater not showing Region name 2019-03-16 20:32:23 -04:00
Lirusaito
7991a53f3b Oh yeah, I did this... 2019-03-16 20:28:43 -04:00
Lirusaito
d1f386860c Do not recenter the restart floater if it's been moved. 2019-03-16 20:28:15 -04:00
Lirusaito
eec7385045 [VMM] Fix the inventory key handling issue
Thanks for the help Router
2019-03-16 20:02:12 -04:00
Shyotl
2d8fbb89c9 Intermiediary commit. 2019-03-16 17:51:00 -05:00
Shyotl
7cf55fa993 Add missing files 2019-03-15 16:40:33 -05:00
Lirusaito
c260158a2c Backport translatable not_online responses
Thanks for pointing this out, Damian
2019-03-14 02:23:06 -04:00
Lirusaito
3b654a0986 Be more like C++, please. 2019-03-13 20:27:52 -04:00
Damian Zhaoying
bd60dfb61d Merge branch 'ManagedMarketplace' of https://github.com/Lirusaito/SingularityViewer into ManagedMarketplace 2019-03-13 20:40:39 -03:00
Damian Zhaoying
a07f90c158 Adding more news spanish translations 2019-03-13 20:40:02 -03:00
Lirusaito
9b6c34213b [Voice] Volume numbers, not just a slider! 2019-03-13 19:27:56 -04:00
Lirusaito
c58df7a3d9 Make the viewer lighter by one or two BOOLs per slider! 2019-03-13 18:59:18 -04:00
Lirusaito
62462165b7 [Voice] Actually save the speaker volume settings. 2019-03-13 17:42:26 -04:00
Lirusaito
4069878d54 [VMM] Fix inventory management bug reported by Griss Alexandre 2019-03-13 16:34:31 -04:00
Lirusaito
72479ce61e Fix warning, thanks for the heads up, Router! 2019-03-13 14:32:23 -04:00
Lirusaito
db547a53d6 Double Double HealthText Trouble
Thank Deltek
...And Cauldron Bubble?
2019-03-12 21:42:27 -04:00
Lirusaito
37c8c80b82 Merge branch 'ManagedMarketplace' of https://github.com/DamianZhaoying/SingularityViewer into ManagedMarketplace 2019-03-12 21:29:02 -04:00
Lirusaito
b279f4ce02 Get back in line!! 2019-03-12 20:48:11 -04:00
Lirusaito
4e34328156 Fix resolving grid uri on login screen looking bad 2019-03-12 16:54:31 -04:00
Lirusaito
757cf4c8e7 [Radar] Feature request: Add a checkbox for people with notes
This is off by default,
right click, hide columns to show or find it in Extras tab!
2019-03-12 16:28:00 -04:00
Lirusaito
1e0741cf17 [Radar] This belongs inside the cpp, we never use it from the outside. 2019-03-12 15:03:07 -04:00
Lirusaito
e0ec2bd886 [Radar] Rework mAge code 2019-03-12 14:27:28 -04:00
Damian Zhaoying
dd5a3352fe Fixes & updates in Preferences panel 2019-03-12 09:35:00 -03:00
Damian Zhaoying
054825807a More Spanish translations fixes 2019-03-12 08:27:12 -03:00
Damian Zhaoying
b2b5dd4eb8 My mistake, fixed 2019-03-12 04:19:18 -03:00
Damian Zhaoying
2b92c10625 More Spanish Translations fixes 2019-03-12 04:00:25 -03:00
Damian Zhaoying
29f20096fd Fix typo in notifications.xml Spanish 2019-03-12 03:31:51 -03:00
Damian Zhaoying
8bbb6cf541 Merge branch 'ManagedMarketplace' of https://github.com/Lirusaito/SingularityViewer into ManagedMarketplace 2019-03-12 01:28:45 -03:00
Damian Zhaoying
03d4dde6a4 Fix some spanish translations in VMM build 2019-03-12 01:27:11 -03:00
Lirusaito
68fd65b55a Clean up 2019-03-11 20:45:34 -04:00
Lirusaito
7d97ebf581 [VMM] Fix the labels over labels issue
Reintroduces a searching bug, but only for marketplace top level folders
Arguably a better bug than what appears to be character corruption due
to labels drawing over each other.
2019-03-11 20:45:26 -04:00
Lirusaito
2b40e044c4 [VMM] Opts 2019-03-11 20:40:29 -04:00
Lirusaito
2bc0360d8e Revert "Don't draw what's being filtered!"
This reverts commit eb348c08ad.
2019-03-11 18:52:18 -04:00
Lirusaito
cd68104de1 [VMM] Fix the sort menu, display sort button 2019-03-11 16:59:47 -04:00
Lirusaito
7da511fc32 [VMM] Fix a crash on delete listing, probably due to perceived recursion 2019-03-11 16:59:16 -04:00
bittenbythedark
84608b67fa Update CRT Bundle 2019-03-11 15:46:16 -04:00
Lirusaito
121ba63347 [VMM] Remove this, not needed. 2019-03-11 14:00:49 -04:00
Lirusaito
1ea476b634 [VMM] Hide the WIP dropzone 2019-03-11 14:00:31 -04:00
Lirusaito
8c31a0e2c5 [VMM] Dirty children's filters when dirtying our filter
Fixes inability to expand folders that show up in areas they were
previously filtered in. Yay, VMM is pretty much ready.

Drop Target doesn't work and we're hiding the sort menu because it's
glitchy, but GG!~
2019-03-11 13:50:23 -04:00
Lirusaito
a3365512b3 [VMM] Opt: Only do this when rearranging, actually. 2019-03-11 12:43:36 -04:00
Lirusaito
c231e555da Deltek fixed another font issue on Win7, yay! 2019-03-11 03:07:37 -04:00
Lirusaito
4a0e78fcbc [VMM] Fix the stutter
Introduces a bug where previously filtered folders cannot be opened
2019-03-10 20:01:42 -04:00
Lirusaito
eb348c08ad Don't draw what's being filtered! 2019-03-10 18:57:15 -04:00
Lirusaito
e15a284ae5 [VMM] It's glitchy, but this hides the folders according to filter 2019-03-10 18:56:51 -04:00
Lirusaito
2f0b6e1e09 Small opt for filter stuffs 2019-03-10 16:45:04 -04:00
Lirusaito
feaa9e7def [VMM] Fix warning about deserialization failure
This change looks better without space changes.
2019-03-10 14:25:58 -04:00
Shyotl
50007bbc62 Matrix mul is expensive. Affine transform is not. Do the latter instead. 2019-03-10 03:48:07 -05:00
Shyotl
6c15ee6556 Fix texunit->uniform location mappings disaster inherited from upstream. Kudos to Drake for sharing the nvidia warning logs and bringing this to my attention. 2019-03-10 01:30:26 -06:00
Lirusaito
320ae772f3 [VMM] Sync more, pay less 2019-03-09 21:37:38 -05:00
Lirusaito
be923a9ecb Merge branch 'ManagedMarketplace' of https://github.com/DamianZhaoying/SingularityViewer into ManagedMarketplace 2019-03-09 21:33:23 -05:00
Lirusaito
a94ad1c1fa [VMM] Sync with upstream for setting mHasVisibleChildren 2019-03-09 17:51:38 -05:00
Lirusaito
98ee2cbd7e Gemini tab button flash, dun hurt my eyes! 2019-03-09 17:51:02 -05:00
Lirusaito
c164bd200e Feature request: Report when we're refreshing the currency balance 2019-03-09 17:50:31 -05:00
Lirusaito
d2983deb48 Wrap main loop with try, not wrap try with main loop. 2019-03-09 17:25:12 -05:00
Damian Zhaoying
5071cbfc2e Marketplace listing spanish translations 2019-03-09 19:19:37 -03:00
Lirusaito
7acce90927 Clean up 2019-03-09 15:40:35 -05:00
Lirusaito
f86a194962 Code sync 2019-03-09 15:40:26 -05:00
Lirusaito
a93ea1b90b Remove duplicate code 2019-03-09 15:39:08 -05:00
Lirusaito
f1bb636f91 Feature Request: Build number in window title 2019-03-09 15:38:45 -05:00
Lirusaito
e55c8e20e5 [VMM] Empty Lookup Message
Even though it doesn't seem to show for some reason
2019-03-09 15:37:53 -05:00
Shyotl
5d75b3b223 Prep for animesh. 2019-03-09 01:51:50 -06:00
Lirusaito
c2eeea8b70 Fix linux compile and clean a thing 2019-03-08 19:03:24 -05:00
Lirusaito
b98d0461d1 [VMM] Make sort menu somewhat work 2019-03-08 18:25:36 -05:00
Lirusaito
a3493f5f6b Fix a crash, make Statistics look prettier
Thanks, Aru!
2019-03-08 16:09:19 -05:00
Lirusaito
52245a7fef Nevermind, that looks awful, guess I'll have to actually fix this 2019-03-08 14:27:29 -05:00
Lirusaito
af8eb800e6 Make Top Objeccts Focus work
Thanks for the grid to test on, Bitten!
2019-03-08 14:15:55 -05:00
Lirusaito
c37cb7b2c4 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer into ManagedMarketplace 2019-03-08 14:09:35 -05:00
Lirusaito
f8c8734e79 [PPE] Add SinguPostProcessDefault for setting active and persisting preset 2019-03-08 13:56:07 -05:00
Lirusaito
b7ef79f1b7 Fix missing return statement, thanks for the heads up, Router! 2019-03-08 13:53:43 -05:00
Lirusaito
28e464f368 Code Clean up 2019-03-08 13:51:14 -05:00
Lirusaito
26a7de79c7 [PPE] Preset overrides go in user settings now 2019-03-08 13:50:06 -05:00
Lirusaito
4ddac28142 Code cleanup 2019-03-08 13:38:38 -05:00
Lirusaito
fec7e95406 Fix compile and try to prevent that from happening in the future 2019-03-08 13:33:40 -05:00
Lirusaito
60db043325 Put some settings in order 2019-03-08 12:17:45 -05:00
Lirusaito
dc34799317 Hide the broken stuff with a setting 2019-03-07 23:45:14 -05:00
Lirusaito
77eb745abc Fix notification bugs, sync with upstream, yaaay 2019-03-07 17:06:38 -05:00
Lirusaito
b005b2a53a Rule #1: Do Not Lie!
Don't lie about status codes to responders anymore
This may cause some bugs, but I highly doubt it, anyway, if it does,
that's what responders are for, to specialize handling in these situations.
2019-03-07 16:26:24 -05:00
Lirusaito
c6cc69b01b [VMM] Added Feature "Copy Listing ID"
Take it from me, LGPL or whatever, I don't care, this is QoL
2019-03-07 14:08:19 -05:00
Lirusaito
1e4da55190 No anims, no send 2019-03-07 13:39:12 -05:00
Lirusaito
7c3ba8bd9a Sync? I dunno, not important. 2019-03-07 13:37:39 -05:00
Lirusaito
c7de0ccf99 Sync llinventorybridge and fix activate listing not working 2019-03-07 13:20:16 -05:00
Lirusaito
b601fa2037 Partial fix for teleport detaching
Thanks for the testing Nai.

Hey LL, if you're reading this, regions we've left were letting us know
that our attachments had left. For some reason, our attachments were dying
before we were removed from the list of agents on the region.

Teleporting out of Hippo Hollow does this reliably.
2019-03-07 12:51:55 -05:00
Lirusaito
cab39e31a1 Don't llformat if empty fmt string. 2019-03-07 12:47:29 -05:00
Lirusaito
79f42837f2 Morning, Bitten 2019-03-07 10:54:46 -05:00
Lirusaito
0378869938 Use proper json for Marketplace functions 2019-03-07 03:43:43 -05:00
Lirusaito
fc488959ea Switch out jsoncpp for nlohmann json
Add llsdjson.* too!
2019-03-07 03:38:27 -05:00
Shyotl
cd340f0fb6 Linux compilation fix. 2019-03-07 00:37:17 -06:00
Lirusaito
626351e897 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer into ManagedMarketplace 2019-03-06 21:32:29 -05:00
Shyotl
d176a58d33 Replace in file oopsie. 2019-03-06 19:41:32 -06:00
Lirusaito
88639c2052 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer into ManagedMarketplace 2019-03-06 17:10:33 -05:00
Lirusaito
322484c286 There's no need to dynamic cast. 2019-03-06 17:07:56 -05:00
Lirusaito
324f12641a Remove redundant casts from c_str to string
Thanks Aru
2019-03-06 16:11:42 -05:00
Lirusaito
cd02bbd1cb Fix mixed iterators
Thanks Aru
2019-03-06 16:10:31 -05:00
Lirusaito
22609412e4 Correct undefined behavior: shifting signed 32 by 31 bits
Thanks Aru!
2019-03-06 16:04:42 -05:00
Lirusaito
f0b3527bb5 Fix crash on saving notecards noticed by Torric 2019-03-06 15:58:19 -05:00
Lirusaito
893946879a [VMM] Sync up some llmarketplacefunctions code 2019-03-06 15:57:36 -05:00
Lirusaito
685fda1565 [RLVa] Some cleanup 2019-03-06 15:56:53 -05:00
Lirusaito
f3df997b5b [RLVa] Allow inexact group name matches 2019-03-06 15:56:43 -05:00
Lirusaito
2d222c721b [RLVa] Add remattach:<uuid>
Thanks for the assistance Caeil!
2019-03-06 15:56:01 -05:00
Shyotl
adfc916ea0 Minor SIMD opt. 2019-03-05 20:41:16 -06:00
Lirusaito
f8b355c9d8 Hide the outbox... I think 2019-03-05 18:31:46 -05:00
Lirusaito
d7c7360205 [VMM] Actually connect the sort menu (probably still not) 2019-03-05 18:31:29 -05:00
Lirusaito
2524b407be Woops, that's still needed 2019-03-05 15:51:35 -05:00
Lirusaito
32c44e4883 Toggle typing with AO toggle 2019-03-05 15:23:04 -05:00
Lirusaito
95ab62b286 Clean up image metadata
Thanks Aru!
2019-03-05 14:17:54 -05:00
Lirusaito
ebd852a060 Make the No Listings Text able to do the url replacement thing 2019-03-05 14:09:08 -05:00
Lirusaito
4fdc1f3311 hide_border should save to xml 2019-03-05 13:50:36 -05:00
Lirusaito
4992d19e8f Marketplace Validation look good please~ 2019-03-05 13:50:06 -05:00
Lirusaito
c639b4cf6c Inventory panels can have filename parameter now 2019-03-05 13:14:48 -05:00
Lirusaito
ee465c4169 Fix positioning of Render Compatibility - Deltek 2019-03-05 11:35:30 -05:00
Shyotl
5a7e0b05a4 Fixup texture compression. 2019-03-05 03:11:04 -06:00
Lirusaito
d770034e5c Hook up the menu the old fashioned way 2019-03-04 20:31:17 -05:00
Lirusaito
fcb751ae4a Couple fix ups 2019-03-04 19:37:53 -05:00
Lirusaito
e350824896 Fix layout of Associate Listing floater 2019-03-04 19:10:42 -05:00
Lirusaito
1586475232 Fix the inability to click the buttons 2019-03-04 18:30:03 -05:00
Lirusaito
17c0da930f Spawn the menu on button click
TODO: Make a derived button that uses this showMenu function instead
So we can finally have menu buttons like upstream
2019-03-04 18:12:02 -05:00
Lirusaito
c985afa4f4 Remove more outbox parts, I think these were never even used 2019-03-04 17:34:14 -05:00
Lirusaito
3631396329 We shouldn't be needing these nullchecks anymore 2019-03-04 17:25:37 -05:00
Lirusaito
7cb6b29f1b Toggleable menus don't exist yet 2019-03-04 17:12:25 -05:00
Lirusaito
5f487f4ce1 Don't cache if we already have it 2019-03-04 17:00:08 -05:00
Lirusaito
e1c3585b46 This logic looks backwards 2019-03-04 16:56:34 -05:00
Lirusaito
7766172831 Fix Router's linux error 2019-03-04 16:55:11 -05:00
Lirusaito
10f57e9a87 This didn't fix typing AO, let's not do this. 2019-03-04 16:54:30 -05:00
Lirusaito
59cb20bab8 Validation floater needs a rect setting 2019-03-04 16:54:12 -05:00
Lirusaito
2266a2a662 Let's build it with the factory map then. 2019-03-04 16:53:22 -05:00
Lirusaito
5ff3700203 I guess we're doing this now. 2019-03-04 15:56:10 -05:00
Lirusaito
065c56fce4 Fix HTTP Assets not actually being turned on, woops!
Thanks for the report and testing, Torric!
Thanks for building the test build, Bitten!
2019-03-04 14:59:50 -05:00
Lirusaito
ee3f48bcae class parameter must go in the panel xml itself 2019-03-04 14:58:58 -05:00
Lirusaito
a2c055c379 Don't show root folder by default 2019-03-04 14:58:11 -05:00
Lirusaito
99703b1121 Should've removed this with the rest of Outbox 2019-03-04 14:57:51 -05:00
Lirusaito
4008cf519c Redo start_folder to be like upstream has it now
start_folder in xmls must now be start_folder.name

This reverts commit 1405a7c103.
2019-03-04 14:57:24 -05:00
Shyotl
6dc2e9e6df Use proper symbol names 2019-03-04 11:12:20 -06:00
Shyotl
7317f28ab3 Clean up compressed texture handling. Exclude dynamic/client generated/local textures. Got rid of glh headers. 2019-03-04 02:03:45 -06:00
Lirusaito
a62b7d5ce7 Be more aggressive about stopping typing 2019-03-03 22:23:22 -05:00
Lirusaito
d2b32564b8 Stop typing AO when AO disabled 2019-03-03 22:23:03 -05:00
Lirusaito
c847bfb6a5 Close, please 2019-03-03 22:05:16 -05:00
Lirusaito
b6e36275bb Don't crash, at least 2019-03-03 21:21:49 -05:00
Lirusaito
5e5dafac26 Fix validation text color violating skin colors 2019-03-03 21:19:11 -05:00
Lirusaito
9127b41923 Make Validation floater pretty too! 2019-03-03 20:43:31 -05:00
Lirusaito
74cd0ddd8b I must've been out of it, we can sort, it's just different! 2019-03-03 19:01:18 -05:00
Lirusaito
b57b4dd102 Get this from the tab container and look no further! 2019-03-03 19:01:01 -05:00
Lirusaito
0b08c6bef1 UI Fix ups 2019-03-03 18:56:49 -05:00
Lirusaito
1405a7c103 Fix start folder because meh 2019-03-03 16:40:09 -05:00
Lirusaito
1d0214ed54 Remove the Outbox
Goodbye, old friend.
2019-03-03 16:39:16 -05:00
Lirusaito
21340ac775 Fix inventory not showing 2019-03-03 15:39:19 -05:00
Pytak
d2b1fb8b5d Rename PyFX Water presets to include [PyFX] for consistence with WindLights 2019-03-03 21:36:20 +01:00
Lirusaito
179e2627eb This was actually better before, I think 2019-03-03 15:36:13 -05:00
Lirusaito
c010c098fc Updates 2019-03-03 15:35:13 -05:00
Lirusaito
4218011417 Merge branch 'master' into ManagedMarketplace 2019-03-03 12:56:03 -05:00
Lirusaito
2e97a396ce Remove dupe include, thanks Router! 2019-03-03 10:42:36 -05:00
Lirusaito
58ba9e3617 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2019-03-02 19:01:49 -05:00
Lirusaito
27961f45f0 [OpenSim] Support create event & partner help URLs
Merges branch 'master' of https://github.com/bittenbythedark/singuosfork
2019-03-02 18:51:15 -05:00
Lirusaito
1e94239d06 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2019-03-02 17:01:18 -05:00
Lirusaito
a619d4e82a Fix running, wooopsies, cached controls cannot be global static 2019-03-02 14:48:19 -05:00
Lirusaito
a2bf387147 Fix swimming not flying initially when swimming enabled
Also fix compile, woops!
2019-03-02 13:54:38 -05:00
Lirusaito
d8da1b7ab5 Cleanup some favorites code 2019-03-02 13:52:37 -05:00
Lirusaito
79a81258ec Fix Release Blocker: Favorites not showing on login screen 2019-03-02 13:23:30 -05:00
Lirusaito
1b5b11907e Fix Release Blocker: Swimming is on by default incorrectly initially 2019-03-02 13:19:33 -05:00
Lirusaito
0a80dd0d87 Fix release blocker: Endless swimming anims on water/air transition 2019-03-02 13:18:46 -05:00
Shyotl
64931839cc Add compression textbox. Don't compress local assets. 2019-03-02 03:47:48 -06:00
Damian Zhaoying
f6cf4e2878 Big Update in Spanish language Files 2019-03-02 02:57:10 -03:00
Shyotl
e1cf05c327 Enable compressed texture. Also minor cleanup. 2019-03-01 22:19:11 -06:00
Lirusaito
1c2c10fc58 Set Text Editor Enabled before loading text into it 2019-03-01 16:00:30 -05:00
bittenbythedark
1c6bdf7aef do some magic EXPECTO PATRONUM 2019-03-01 16:23:30 +01:00
bittenbythedark
b80be075d7 Add support for Partner URL on OpenSim Grids 2019-03-01 09:29:16 +01:00
Lirusaito
fb39f2d511 Merge branch 'master' into ManagedMarketplace
# Conflicts:
#	indra/newview/llinventorybridge.cpp
#	indra/newview/lltooldraganddrop.h
2019-02-28 23:58:08 -05:00
Lirusaito
2b8c630922 Merge branch 'master' of https://github.com/Pytak/SingularityViewer 2019-02-28 23:23:53 -05:00
Lirusaito
c420751ffc Get these boost warnings out of our compile logs! 2019-02-28 21:57:52 -05:00
Lirusaito
92fd0f56b4 In the modern era, if we don't recognize a GPU, give it full class 3 support and pray 2019-02-28 21:51:44 -05:00
Lirusaito
28b1ed82a5 Steam Hardware Survey says 100% SSE3
It's been over a decade since SSE3 came out
Almost 95% of CPUs on Steam have support for SSE4.2
Therefore we are enabling optimizations for SSE3
but someone could easily make an SSE2 Build
2019-02-28 21:13:04 -05:00
Lirusaito
1850cd159d My inventory patch everyone's been testing
I'm still wary, but let's toss it into our release, shall we?
This changes the maps in inventorymodel to unordered maps.
On the surface this seems like a good thing, definitely is for inventory loading.
It seemed a lot snappier to literally everyone before the HTTP Asset patch rolled out, so that's good.

Thanks to Router, Bitten, Gooz, Deltek, Damian, Melaniecosti, Torric, and anyone else I might be forgetting at the moment who tested this for me!
2019-02-28 20:23:21 -05:00
Lirusaito
9630632120 Enable wearable export 2019-02-28 20:17:33 -05:00
Lirusaito
8e18f2ab43 So sick of these EEP warnings in my log, add the asset types 2019-02-28 20:09:00 -05:00
Pytak
f599278d8d rename non-prefixed PyFX Ambient windlights to [PyFX], add one new Ambient windlight, add PyFX 0.6 Ice water preset 2019-02-28 21:03:38 +01:00
Lirusaito
e89e57b5a0 [OpenSim] Feature Request: Allow passwords up to 24 characters long 2019-02-28 13:56:18 -05:00
Lirusaito
e3fe8d046a Feature Request: "Focus on" button for Top Scripts 2019-02-28 13:53:15 -05:00
Lirusaito
56d23a03cf Add ViewerAsset over HTTP support
Has fallbacks for grids without HTTP, of course.
Though some assets might be dropped initially, as it is untested,
but better than nothing.
2019-02-28 13:46:26 -05:00
Lirusaito
5de463638c Backwards compatible usage of "ViewerAsset" cap for Textures and Mesh 2019-02-28 11:09:25 -05:00
Lirusaito
d6b5e9f5a5 Fix the wolf
It's cruel and inhumane, but it makes the boy cry less about sheep
2019-02-27 16:44:26 -05:00
Lirusaito
4ddc33e881 Forgot the UI, woopsie~ 2019-02-27 15:39:27 -05:00
Lirusaito
bf17e716e9 Right click edit on a wearable should take you right to that wearable's tab 2019-02-27 15:37:36 -05:00
Lirusaito
43806994eb Layer Tabs Needed Reimplemented 2019-02-27 15:36:56 -05:00
Lirusaito
c4a5b0acc8 Fix wlf camera preset icons not loading in a timely manner 2019-02-27 11:21:08 -05:00
Lirusaito
8c71d22bea More code cleanup 2019-02-27 11:14:21 -05:00
Lirusaito
618ca2f011 Code cleansies 2019-02-27 09:53:36 -05:00
Lirusaito
f04156da0e Add icon for Post Process button on wlf panel, by PyKat 2019-02-27 08:53:03 -05:00
Lirusaito
4ab397dfb2 Feature Request: Add our SL viewer group to the Help menu. 2019-02-27 07:06:21 -05:00
Lirusaito
7eab3337bf Add menu function "URLAction" for menu items that have (sl)url userdata 2019-02-27 07:05:37 -05:00
Lirusaito
2f68adf73d Merge branch 'master' of https://github.com/Pytak/SingularityViewer 2019-02-27 06:51:06 -05:00
Lirusaito
6f5202c8cf Sorta fix Asi Weird and Negative Saturation 2019-02-27 06:50:55 -05:00
Lirusaito
313732ae25 Show Emoji/high unicode on Windows, where possible, thanks Deltek! 2019-02-27 06:36:04 -05:00
Lirusaito
e3ca2594bc Simplify logic, clean up code. 2019-02-27 06:08:19 -05:00
Pytak
812ce207dd update postprocessing and windlights with PyFX 0.6 2019-02-26 23:16:55 +01:00
Lirusaito
3b9a0cfbc8 Lowercase default looks bad next to windlight defaults, capitalize it. 2019-02-25 13:09:04 -05:00
Lirusaito
2a7fd8caa5 Clean up some god tools floater code 2019-02-25 12:50:32 -05:00
Lirusaito
46dff21e97 Feature Request: Post Process Effects from Quick Settings flyout
Adds a neat little signal for post process to fire when effects change
Isn't code wonderful?
2019-02-25 12:50:08 -05:00
Lirusaito
f4a22ef857 Patch AIXML to work now for import
Not bothering with export at the moment

AIXML"Stream" wasn't even using its stream in its constructor...
Someone clearly hadn't been using ACTUAL C++ for longer than C++'s existence like was claimed
...but then, that's literally impossible, so what could we expect...
And dear lord please stop throwing in constructors...
There are so many better ways to do this...
This use of throwing is why people dislike goto
It's hard to follow flow control that would be better done another way...
One day I'll fix it so it is, until then meh.

Rips out AIFile, since nothing is actually using it anymore and GPL code needs purged.
2019-02-25 12:46:41 -05:00
Lirusaito
0cadfbaddb Why was this in the wrong position? 2019-02-25 12:33:24 -05:00
Lirusaito
e0b9f23dad Clean up and simplify wlf panel code 2019-02-25 08:05:37 -05:00
Lirusaito
7071ac29e8 Do Opt Yes 2019-02-25 08:02:11 -05:00
Lirusaito
5578849508 On second thought, there's no reason to disconnect until region isn't alive
So let's not do that anymore, making us resilient against a grid that has
HTTP problems.

Thanks for the help, Aru!
2019-02-24 09:08:08 -05:00
Lirusaito
d096c043f0 Attempt to fix disconnects by syncing to match upstream eventpoll
Upstream no longer repeats requests or force disconnects
upon 404 or internal library error, so we shouldn't either.
2019-02-24 09:06:32 -05:00
Lirusaito
2882cb728f Optimize llformat Even MORE, and clean up some code.
Thanks for the help, Aru!
2019-02-23 04:08:55 -05:00
Lirusaito
f9e3afaad2 Revert "Do llformat even better!"
This reverts commit 4f87e82a19.
string::data can't be nonconst until C++17, maybe one day.
2019-02-21 03:26:08 -05:00
Lirusaito
4f87e82a19 Do llformat even better! 2019-02-20 21:40:05 -05:00
Lirusaito
a2701faa2b Floss Finder: Igor
Igor is a dentist with more on his "plate" than he can handle
Watch as Igor tries to find all the floss in his patients' mouths
Starring Timmy the Tooth, and the Tooth Fairy; join all your favorite
oral hygiene friends in helping Igor solve his terrible tooth travesty!

(May contain traces of knockoff pokemon, talk to your dietician before consumption)
2019-02-20 21:22:24 -05:00
Lirusaito
9f2d8e6fff Fix things, mainly make things more optimal... No, I didn't compile this
Run along, Nothing to see here.
2019-02-20 07:34:56 -05:00
Lirusaito
174a2d36aa I found a leak, viewer-release found it too, let's use their fix
It's close enough to mine, although I disagree with using 0 for a pointer
instead of using nullptr, but alas, mergeability.

This damn leak happened at least every log line on Linux and Mac since
the dawn of time for the viewer... Disgusting.
Well, not every log line, but every log line mentioning a class, which is
most these days.
2019-02-19 11:55:42 -05:00
Lirusaito
2773c22f9b Fix los argumentos truncamientos
Gracias a Damian
2019-02-17 16:46:51 -05:00
Lirusaito
50f9fbd728 Fix automatic bridge detach
Thanks Aru
2019-02-17 12:54:16 -05:00
Lirusaito
8f96442cc7 Woops, truncate, not substr 2019-02-15 23:41:06 -05:00
Lirusaito
0269affb69 I need less unstaged code
Here's pieces of the WIP offline->IM->online fix
2019-02-15 19:33:22 -05:00
Lirusaito
1c9fcbb387 Fix Linux compile 2019-02-15 19:29:06 -05:00
Lirusaito
368afacd14 Fix CSR Urls sometimes being broken
Thanks Aru
2019-02-15 19:28:34 -05:00
Lirusaito
9f160b11fa Actually hook up LLAvatarResetSkeletonAndAnimations
Thanks Aru
2019-02-15 18:52:43 -05:00
Lirusaito
323c0a7e1e Fix compile 2019-02-15 18:51:45 -05:00
Lirusaito
48541479fb Compiles and fixes, fixes and compiles
Pull this commit, get through the trials
2019-02-11 21:49:01 -05:00
Lirusaito
97a6f8aeb0 [Favorites Bar] Compiles, but does it work yet?
Gimme time to put it somewhere and we'll find out~
Also here's navbar/ textures, because we'll need the favorites one.
2019-02-09 21:46:21 -05:00
Lirusaito
2e8e641024 Don't LogInventoryDecline from groups, stop spamming local chat 2019-02-09 21:18:58 -05:00
Lirusaito
1df39f81ee [Local Textures] These should persist through relogs, duh! 2019-02-09 19:54:11 -05:00
Lirusaito
136cffbab9 What a drag 2019-02-09 16:51:53 -05:00
Lirusaito
2493c401f9 Force replacing registered urls everywhere that's not from another user
I think I covered all my bases:
Local Chat, IMs/Group/Conference Chats
Script Dialogs
Group Notices

There are a few others maybe, like notifications EMs can spawn but if
those are intentionally tricking people, grid owners should be informed.
2019-02-09 16:51:15 -05:00
Lirusaito
90285944d9 Line editors need to commit on return 2019-02-07 01:34:09 -05:00
Lirusaito
aa0fea6931 [Local Textures] Small hack to allow changing texture id 2019-02-07 01:33:34 -05:00
Lirusaito
8a4ab08810 Fix compile 2019-02-06 20:43:02 -05:00
Lirusaito
bd442fb412 [Local Textures] Some code polish 2019-02-06 19:51:54 -05:00
Lirusaito
d04067bd09 [Local Textures] Default updating to on 2019-02-06 19:49:39 -05:00
Lirusaito
a62d433262 Favorites on the login screen
Adds some guts for the favorites bar, I'll get to that eventually
2019-02-05 05:17:08 -05:00
Lirusaito
cb16e4edf0 Updat 2019-02-04 20:02:40 -05:00
Lirusaito
b2eb601fc4 We can move whatever we want into favorites 2019-02-04 19:36:01 -05:00
Lirusaito
0ce0f81144 Why do I still use windows, anyway? 2019-02-04 17:40:47 -05:00
Lirusaito
ae308a274c Clean up the chitchat, console url replacement~ 2019-02-04 17:32:04 -05:00
Lirusaito
e536820629 Autoreplace can be as long as chat input 2019-02-04 16:46:15 -05:00
Lirusaito
d2a42e47ce Make agent slurls with name types open profile on click 2019-02-03 18:37:51 -05:00
Lirusaito
62628a66bd Have a menu for agent slurls with name types. 2019-02-03 18:36:49 -05:00
Lirusaito
0478d90578 Right click linked names/groups/objects in chat, copy key 2019-02-03 17:38:43 -05:00
Lirusaito
d29832ce5c Copy SLURL not SLurl, SLurl looks weird!! 2019-02-03 17:00:05 -05:00
Lirusaito
a0875697cd Fix warning 2019-02-03 12:31:49 -05:00
Lirusaito
45c7c711ad You need to wake upYou need to wake upYou need to wake upYou need to wake up
YouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUp
ouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpY
uNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYo
NeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYou
eedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouN
edToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNe
dToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNee
ToWakeUpYouNeedToWakeUpNeedWAKEUPNeedYouNeedYouWakeUpYouNeed
oWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedT
WakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedTo
akeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToW
keUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWa
eUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWak
UpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWake
pYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeU

[~~~~~~~~~~~~~~~~~~~~~~~~~~WakeUp~~~~~~~~~~~~~~~~~~~~~~~~~~]
2019-02-03 12:31:36 -05:00
Lirusaito
c03250f09b Do this better 2019-02-03 10:05:41 -05:00
Lirusaito
50f7893b2f Add back the install while running viewer option 2019-02-03 10:05:23 -05:00
Lirusaito
6c219bd628 Feature Request: Shouts should be in bold.
Yes, they should.
2019-02-02 18:42:15 -05:00
Lirusaito
8208730130 No more temp upload on SL, don't waste the users' time. 2019-02-02 18:41:27 -05:00
Lirusaito
dc96269bc6 Do not grab focus during login, seriously uncool. 2019-02-02 18:39:33 -05:00
Lirusaito
3546b5777b Oops, these are needed for the texture picker clicker 2019-02-02 13:57:01 -05:00
Lirusaito
a45b4ffb43 Code cleanup 2019-02-02 13:56:11 -05:00
Lirusaito
d08d2fdec8 Don't open a null id picture. 2019-02-01 11:55:15 -05:00
Lirusaito
b47ff37612 Allow clicking on pictures in profiles and picks to open them
Only works if it's not gonna spawn a texture picture, of course.
2019-02-01 11:54:55 -05:00
Lirusaito
1ec0eed867 Use link color for names in radar alerts, not white. 2019-02-01 10:28:06 -05:00
Lirusaito
3054be307e Do it for object names too, otherwise talking through scripts looks wrong
Also this is needed for local chat ^^;
2019-02-01 10:16:19 -05:00
Lirusaito
0d22841da1 Woops, that's some inverted logic! 2019-02-01 10:13:07 -05:00
Lirusaito
d20dbaa7d2 Feature Request: Allow use of a separate color for linked usernames.
The setting is HTMLAgentColor, I will not add this to preferences for now.

Note that usernames before the colon in the chat are cached,
set before login to change it for everyone or relog.
Also hook up getStyle() for the registered urls,
cleans up some code in lltexteditor.
2019-02-01 08:12:12 -05:00
Lirusaito
a7886443c5 Do not color the : after names in local chat as a link! 2019-02-01 06:51:58 -05:00
Lirusaito
674abf478b Fix skin previews, allow using images from paths on disk 2019-01-28 20:46:47 -05:00
Damian Zhaoying
0f96939828 Update Spanish Translations. 2019-01-27 20:29:31 -05:00
Lirusaito
2f4689ba37 Woops, forgot I decided not to make an icons subfolder in textures. 2019-01-27 20:11:46 -05:00
Lirusaito
045234912c We can spell 2019-01-26 14:00:35 -05:00
Lirusaito
049c1e16b0 Aurora-Sim is now WhiteCore
Minor Alchemy merge in removing llvlmanager,
indra_constants no longer has *_LAYER_CODE
2019-01-25 21:21:55 -05:00
Lirusaito
c7ca3d9261 Add cinnamon 2019-01-25 19:33:20 -05:00
Lirusaito
a6cd08e056 Fix textures.xml 2019-01-25 19:33:20 -05:00
Lirusaito
d340b74bb9 Silly git, that's not how merges work!
Fix automatic merge errors
Also fix some other compile errors
2019-01-25 19:33:19 -05:00
Inusaito Sayori
fcf4cf88ea More merge 2019-01-25 19:33:19 -05:00
Inusaito Sayori
758d45af68 LLInventoryFilterParams and other stuff to merge. 2019-01-25 19:33:19 -05:00
Inusaito Sayori
50d21405cf More stuff until it works... 2019-01-25 19:33:18 -05:00
Inusaito Sayori
8ea58c8a7e Fix the crash, it was a misplaced closing bracket, with a misplaced codeblock... figures... 2019-01-25 19:33:18 -05:00
Inusaito Sayori
7c1af50bda Double check vmm merge against alchemy. (sync) 2019-01-25 19:33:18 -05:00
Inusaito Sayori
fd4155f4b6 Merge vmm up to 3a62616f3dd8bd512fcdfd29ef033b2505b11213 2019-01-25 19:33:17 -05:00
Inusaito Sayori
1d6e2b4182 Warning fixies. 2019-01-25 19:33:17 -05:00
Inusaito Sayori
630819cfe5 Set visible and set frontmost. 2019-01-25 19:33:16 -05:00
Inusaito Sayori
4b04bc573b Route stuff back into llfolderview until we're ready for the full update. 2019-01-25 19:33:16 -05:00
Inusaito Sayori
e38615d15b Warnings fixes, mostly signed/unsigned mismatch 2019-01-25 19:33:16 -05:00
Inusaito Sayori
f140b4f35c Giant VMM merge, still need to compile it and fix llfloatermarketplacelistings
Merge VMM up to change 187902d9c4afd2990acddeb964c928179a52d189

mAllowWear=>mAllowOpen (should probably just remove this altogether though
inventory_panels now accept the "show_root_folder", "allow_drop_on_root", "allow_open", and "use_marketplace_folders" attributes.

Other stuff in this commit:
LLPanelInjector~
Sync lltooldraganddrop to alchemy
Sync notifications up with alchemy
Reorganize notifications some, to better merge with upstream
Remove duplicate InventorySortOrder in settings map
There's a bit of a weird folderview merge mixed into here, I wouldn't trust it, but this thing is so god damn tangled I can't go back now~

Wouldn't have been possible without help from Shyotl and music by Amanda Palmer
2019-01-25 19:33:15 -05:00
Inusaito Sayori
167d336274 Up to compile phase
at 20fd3e98b4
2019-01-25 19:32:15 -05:00
Lirusaito
0fca6ee425 More seriously C++14
...I hope
2019-01-25 19:30:58 -05:00
Lirusaito
748a952e81 Fix Script Count not being enabled when AllowSelectAvatar is true 2019-01-24 18:00:36 -05:00
Lirusaito
a30119706d Add /setdebug chatbar command. Syntax: /setdebug <debugsetting> <newvalue>
The setting to change this command is SinguCmdLineSetting
This command supports using json for complex data types, like vectors.
If there's no new value passed, the debug will be changed true<->false,
this conversion will have interesting effects on nonboolean types.
Have Fun!!
2019-01-24 17:58:54 -05:00
Lirusaito
77cdc0fa4c Stop spamming the log whenever preferences opens!! 2019-01-24 12:30:14 -05:00
Lirusaito
3bdf6e553d Add InactiveFloaterTransparency and ActiveFloaterTransparency settings
Dear Users,
This removes FloaterUnfocusedBackgroundOpaque, to achieve the same effect,
modify InactiveFloaterTransparency, 1.5 should do the trick.

PS: The settings are in the Vanity tab at the bottom.

Now for developer nonsense:
Also sync a bunch of the UI code with upstream Alchemy for opts and shtuff.
Also let's translate the tooltips on the buttons on the top right of floaters
Translators note that not all new strings have been translated yet as not all are upstream.
2019-01-24 11:57:44 -05:00
Lirusaito
546422609a Cleanup and simplify Script Count code 2019-01-23 23:37:54 -05:00
Lirusaito
b971799638 Woah, woops! Fix double click crash!! 2019-01-23 22:23:15 -05:00
Lirusaito
bedb567eba Don't RenderHiddenSelections, it makes mesh select bad.
This change snuck into upstream in 2010 in a commit by Dave Parks titled
Fix for bad zipping of meshes and add mesh icon back to repository.
2019-01-23 21:35:49 -05:00
Lirusaito
b4cf0b429b Sync LLSelectMgr with upstream Alchemy 2019-01-23 05:05:36 -05:00
Lirusaito
ca5fb91350 We C++14 now. 2019-01-22 03:31:07 -05:00
Lirusaito
621c0a0249 Don't double up separators in the context menu 2019-01-22 00:49:09 -05:00
Lirusaito
d0b7a983d1 Fix an edge case where the radar could now crash loop, woops.
Thanks to Deltek and Router Gray for reporting and testing! <3
2019-01-21 23:38:23 -05:00
Lirusaito
54cf0a6a91 Set up LLButton::Params and LLButton::initFromParams 2019-01-21 23:37:28 -05:00
Lirusaito
bde8782328 Add in LLLoadingIndicator 2019-01-21 22:31:18 -05:00
Lirusaito
c8d95e58c3 LLMenuGL Sync 2019-01-21 22:31:13 -05:00
Lirusaito
95cd6cf775 Sync up textures.xml a bit 2019-01-21 22:31:07 -05:00
Inusaito Sayori
dd7ab5a0ff Underline all registered urls on hover 2019-01-21 08:48:54 -05:00
Lirusaito
865061faf0 Don't split link underlines, since we're not even using the query color 2019-01-20 15:46:29 -05:00
Lirusaito
02c06f1654 Don't leave links underlined if the mouse leaves 2019-01-20 15:45:52 -05:00
Lirusaito
0aa6fa9302 Fix scrolling not taking effect on certain sliders 2019-01-20 14:36:57 -05:00
Lirusaito
8a08964755 Request: Underline links when hovering over them, for distinguishability 2019-01-20 14:25:56 -05:00
Lirusaito
413c24bde8 Bug Fix/Feature: Make the spam of radar on open/close and login optional
Adds RadarAlertFlood and RadarAlertFloodLeaving
RadarAlertFloodLeaving requires RadarAlertFlood
Radar uses new announcements for these events.
These settings are off by default,
Find them in your local debug settings!
2019-01-20 14:23:43 -05:00
Lirusaito
f9fe8a056a Remove duplicate and old/invalid code from llviewertexteditor.cpp 2019-01-20 12:12:27 -05:00
Lirusaito
d8c95f844f Add url menus to the text editor!!
Hey there, Alpha User! This commit is riddled with complex words,
but here's what matters to you: This adds the ability to right click a
Name, URL, SLURL, or Object Name, or even an Email, and get some awesome
options just like v3 gets! Buuuut, unlike V3, if there was something else
you might want to do, we've still got you covered in the same menu!!

Also make the text editor's default menu an xml
Synced a lot from upstream
Unlike Upstream, actually combine the base menu with the url menu if we have a selection
Unlike Upstream and previously, don't create a new menu per text editor
Unlike Upstream, don't create a separate FriendSignal and ObjectBlockedSignal per text editor we need it in!!
Unlike Upstream, always show a Select All option
2019-01-20 09:40:56 -05:00
Lirusaito
61b1128d76 Allow menu xmls from v3 that use context_menu tag instead of menu
Just parse them as LLMenuGL for now, that's what they basically are.
2019-01-20 09:32:13 -05:00
Lirusaito
1317f26d04 Remove debug spew, my bad 2019-01-20 09:24:44 -05:00
Lirusaito
7112e163e6 Update our url stuffs!
Adds support for JIRA link labels from Alchemy. (Made less of a mess by me)
Adds support for x-grid-info, the future of x-grid-info-location from Alchemy.
Updates uriparser latest from Alchemy.
Updates llstring to be more in line with upstream Alchemy.
Fixes our LLURI Implementation
Updates LLURLAction to modern C++ stuffies~
Adds Email protocol support from alchemy
Sync LLSLURL with Alchemy, adding x-grid-info support.
Also keep NoProtocol Support because yaaassss~
(also we won't suffer from MAINT-5019 because we're not dumb.)
2019-01-20 09:13:05 -05:00
Lirusaito
4b4c8c8e37 Woops, each link needs its own style! Thanks for testing, Torric! 2019-01-20 04:37:53 -05:00
Lirusaito
3a159111f3 Don't duplicate code, that's silly. 2019-01-20 04:36:39 -05:00
Lirusaito
f6beee3693 Don't look for clicking urls during draw, do that later upon click 2019-01-20 04:35:21 -05:00
Lirusaito
4f32024d3b Fix nearby media panel fading after time on Nearby Media Floater
How did no one notice I broke this in syncing over two years ago?
2019-01-19 10:47:21 -05:00
Lirusaito
edb6c0e8e9 Feature Request: Add a stop button to MOAP hover controls
Also raise up the speaker button two pixels so it doesn't look so bad.
2019-01-19 10:03:21 -05:00
Lirusaito
74af7dc80e Add LLTextEditor::setLinkColor for when links need to be another color!
This fixes blue on blue in notices for the classic skin,
while it does affect other skins, it's not very noticeable.
Actually this change kinda makes links match skins better overall...
2019-01-19 06:18:44 -05:00
Lirusaito
e284efa648 Improve notifications a bit (mainly lets you click links in notices)
Actually respect the color they're supposed to be by setting text AFTER creation
Don't double up with setEnabled, we're setting read only through the constructor
Be Mouse Opaque, handle mouse events beyond scrolling, match group notices
Don't call things more than once, that's nonsense.
2019-01-19 05:07:27 -05:00
Lirusaito
4a0b012f5b Oops, I never meant to stage this tentative change. 2019-01-18 23:56:43 -05:00
Lirusaito
e643bcfc98 Fix the ran off segmentation end bug properly (Torric's Notes bug)
Default segments are now any segment that have no distinct features,
these segments can be combined into a contiguous segment to save space
and to cut down on calculation complexity!
2019-01-18 23:21:23 -05:00
Lirusaito
526079d76c Text editor small sync with upstream 2019-01-18 05:48:02 -05:00
Lirusaito
0c8f2f1ea0 Cleanup and add back an opt in text editor 2019-01-18 02:14:31 -05:00
Lirusaito
6e05e8d84b Wake up Liru... how did this even build? 2019-01-17 21:20:44 -05:00
Lirusaito
cff27f33dc Wooops, no more setting the muted local chat editor invisible like that! 2019-01-17 04:43:57 -05:00
Lirusaito
ed67f77f9f Request: Add EmergencyTeleportSeconds to configure emergency teleport time 2019-01-17 04:43:01 -05:00
Lirusaito
eb0477f9d7 Fix profile notes being white and having a weird visual glitch 2019-01-17 04:41:55 -05:00
Lirusaito
5fa50192a7 Feature Request: Allow AO Enabled settings to be per account 2019-01-16 22:38:59 -05:00
Lirusaito
bba6ecba65 Request: Allow filtering nonlinks or links in the custom inventory filter 2019-01-16 22:34:22 -05:00
Lirusaito
dcc8013028 Allow scrolling and up and down arrows for slider manipulation. 2019-01-16 18:27:31 -05:00
Lirusaito
0ddfdad180 Fix ShowMutedChat setting not properly restoring. 2019-01-16 16:46:12 -05:00
Lirusaito
466b4bf5e4 Add keyboard shortcut Ctrl-Shift-C for Copy Raw 2019-01-16 14:34:27 -05:00
Lirusaito
a5632c08c7 Add "Copy URL" option to text editor right click menu when right clicking links. 2019-01-16 14:33:53 -05:00
Lirusaito
1dea1123de Fix the issue with profile font and selection
Thanks for testing, Router!
2019-01-16 14:32:31 -05:00
Lirusaito
c419c4d560 Add UI for the replacing of urls to System->Security at the bottom
Moves the region restart preferences into Vanity->main
2019-01-16 13:03:58 -05:00
Lirusaito
269576805b Replace URLs everywhere in text editors, like upstream.
This works for notifications, and profiles, and chats, and even updates!
Amazing, right?
SinguReplaceLinks is on by default, URL highlighting works regardless, no rogue labels with this off.

Select, right click, Copy Raw lets you copy the link with its hidden url shown
and you can paste it back the same way if you're wanting to paste it all over!

LLTextEditor overhaul synced the code with upstream LLTextBase as much as we could.
appendStyledText is now just appendText
Every setText appendText's now and adds a style based on the texteditor's color and font, this could slightly increase the weight of text editors (one extra segment) but it fixes a nasty bug with running past segmentation.
Also no longer update the utf8
Removed append() which was no longer being used
LLTextEditor and LLViewerTextEditor now have an extra boolean at the end of their constructors to have this replacement turned on at construction time (this also sets them read only)
Update TextSegments to have a Tooltip string, like upstream.
Hardened notecard previews so they don't accidentally replace the text when they go read only.

Thanks to Deltek and Router Gray for helping me test and debug this commit!
2019-01-16 01:01:19 -05:00
Lirusaito
0b52275e53 Fix radar popping up on right click focus if not announce when closed. 2019-01-15 17:36:28 -05:00
Lirusaito
9c06bbb8eb Fix the expand buttons in the remote toolbars looking like garbage 2019-01-14 20:02:07 -05:00
Lirusaito
da5717f66e Make the login screen destinations work
Syncs "location_login" from upstream LL viewer
2019-01-14 16:57:29 -05:00
Lirusaito
8250ec1872 Clean up repetitive code in llnotify.cpp 2019-01-14 15:14:13 -05:00
Lirusaito
1efc71db0c Fix mic lock being inverted. 2019-01-14 14:46:50 -05:00
Lirusaito
062b8da2d3 Allow right clicking notifications when on right clickable ui. 2019-01-14 01:08:10 -05:00
Lirusaito
15ef9140da Fix regression of not having a working viewer build without PACKAGE on 2019-01-14 00:35:52 -05:00
Lirusaito
2dc609ff6b Fix Linux compile? 2019-01-11 12:49:00 -05:00
Lirusaito
8c7fceb081 Resolve and link registered SLURLS that are in chat.
Adds handle_registered_urls function
Use this as a drop in replacement for appendStyledText where applicable
2019-01-11 09:11:20 -05:00
Lirusaito
778b89d5c9 Feature request: When creating a new AO notecard, actually show it! 2019-01-11 08:33:49 -05:00
Lirusaito
b61cba8e01 Clean up and optimize the AO
Added the feature of selecting an animation from combo boxes and it playing automatically if it should be at this moment.

Now for the stuff only developers will understand:
FloaterAO is now a FloaterSingleton, because it should've been behaving that way all along.
Refactors a lot, simplifies a lot, best view without space changes.
Reduces a lot of redundant blocks.
Creates some functions to make things like AOStates easier to get
AOStates are now an enum instead of a bunch of const ints.
Cleaned up includes.
NULL -> nullptr, virtual->override, BOOL->bool, for->foreach
Removed struct_tokens,  it was redundant and actually just took up space.
No longer set all the children invisible, their parent does a good job of that.
Relate ComboBoxes to their states, so that we can easily get a setting and do a whole bunch of things with a lot less code.
Remove unused parameters and functions and variables
Remove unused boolean returns from functions.
Don't clear combo boxes just because one id is null.
2019-01-11 06:17:58 -05:00
Lirusaito
0c585aca39 Random cleanup lines here and there before I refactor the AO entirely 2019-01-10 17:44:13 -05:00
Lirusaito
da2a9a5bf5 Add Typing AO
Like scripted AOs, this works whenever you type and AO is ON
Even if the Linden typing animation is not playing.
2019-01-10 17:42:59 -05:00
Lirusaito
47797f4cec First pass at Swimming AO 2019-01-09 23:08:23 -05:00
Lirusaito
aef77312aa Wooops, fix minor bug introduced in the conference thing. 2019-01-09 22:03:20 -05:00
Lirusaito
9a424ff264 Fix SV-2245: Viewer AO Doesn't respond instantly 2019-01-09 13:14:24 -05:00
Lirusaito
022fba2ba4 Add option "Add to Conference" to Conference chats and Instant Messages
Sync code from upstream for inviting people to conference via Avatar Picker
2019-01-08 11:27:51 -05:00
Lirusaito
adba4cf1fa Beware the coral, it adds the reef factor 2019-01-07 17:39:54 -05:00
Lirusaito
0e21b53c2f Sync installer with Alchemy for NSIS 3 support
Add a checkbox for creating desktop shortcut, restoring this functionality.
Fix install folder defaulting to 64-bit for 32-bit.

NOTICE: We now only support NSIS 3, no we don't care about your set up,
see our build-windows page for updated details on this.
2019-01-06 14:52:29 -05:00
Lirusaito
13816b696f Fix reporter spawning notifications over and over
The user needs only one per session if that.
Also no longer have reporter processRegionInfo when it doesn't use that.
2019-01-06 09:46:14 -05:00
Shyotl
04ea11c61e Make gcc happier. 2018-11-20 02:49:57 -06:00
Shyotl
523717477d Experimental. Just busyloop mesh repo thread (hardcoded 60updates/second) instead of semaphore pingpong. Client behavior sucks and fetched meshes weren't being processed unless new mesh requests were being generated. 2018-11-19 00:48:50 -06:00
Shyotl
6d0b1889f2 Draw terrain before grass, because terrain is pretty cheap to draw, and hills are a thing and it would be nice if they z-culled. 2018-11-19 00:45:26 -06:00
Shyotl
bb67cba384 Bring alpha specular face blending in line with official viewer. 2018-11-19 00:43:51 -06:00
Shyotl
14e7b4aefe scrolllists were incredibly slow to render. This included the friends and groups lists. Should be much faster now due to not thrashing the bound texture quite as much. Also ui elements are culled on the cpu side if they are out of the current scissor region. list cells also had no clip logic, so added to that as well. 2018-11-19 00:43:00 -06:00
Shyotl
1b9ce0b511 Prevent camera from freaking (shaking violently and eventually displaying pinkscreen) out if zoomed in unreasonably close. 2018-11-19 00:40:41 -06:00
Shyotl
bf5e7b794e Change mesh fetch strategy a bit. Was getting stuck on stalled downloads forever instead of going on to other pending ones. 2018-11-19 00:39:49 -06:00
Shyotl
d7ee098a10 floorf was eating a fair bit of cpu time here. 2018-11-19 00:38:13 -06:00
Shyotl
736696ac36 Track glEnable states via static refs instead of map lookups.
Sync light state, bound shader, and various gl context states similarly to render matrices.
Texture handles now refcounted, as multiple viewer textures could ref the same handle (cubemaps do this)
Clean up gl extension loading a bit. Not necessary, but only look for ARB variants if not included in current core version. Removed unused extensions.
Use core shader api if supported, else use ARB. (FN signatures are identical. Just doing some pointer substitution to ARB if not core.)
Attempt at improving VBO update batching. Subdata updates better batched to gether per-frame.
There's probably other stuff I forgot that is in this changeset, too.

Todo: Fix lightstate assertion when toggling fullscreen with shaders off.
2018-11-19 00:37:48 -06:00
Shyotl
0b4d789afb Altered LLIndexedVector. There's zero point to having a lookup map into an array like this. Just iterating down the array is faster than the map lookup (which iterates down a linked list...). A hash map would be a different case entirely. 2018-10-12 02:07:45 -05:00
Shyotl
55ad048b3a Bring specular behavior back in line with LL viewer. 2018-10-12 01:40:31 -05:00
Lirusaito
252fdcdd1e Collab with RouterGray to set Startup project automatically via CMake.
Also thanks to Alchemy, we think.
2018-08-27 18:42:27 -04:00
Lirusaito
13e2af8990 Request: Add setting SinguMotionResetsCameraReset to let the user decide if SinguMotionResetsCamera will Reset without their explicit action. 2018-08-27 12:33:02 -04:00
Lirusaito
8ecbf79199 Fix this because it shoulda been this from the start, oops. 2018-08-27 12:29:48 -04:00
Lirusaito
03d686a246 This is unused, remove it. 2018-08-27 12:27:40 -04:00
Shyotl
f03249f5d5 Update manifest and lldir_linux to use new crt file. 2018-08-12 19:53:07 -05:00
Shyotl
0d8dfb41bc Fix gcc 4.9 build errors. 2018-08-12 18:26:07 -05:00
Shyotl
38c6302f11 Attempt to make mesh loading a little less choppy. 2018-08-11 01:09:04 -05:00
Shyotl
dcc13b447c Fix compile post liru merge. 2018-08-10 23:07:27 -05:00
Shyotl
5d2eb3e4cf Fixed hot spot in volume generation. 2018-08-10 23:07:13 -05:00
Shyotl
c8427140bd Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer.git 2018-08-10 19:30:01 -05:00
Shyotl
23228e111c Ohgodthistypobrokeeverything. 2018-08-10 19:29:08 -05:00
Shyotl
2257e8ebe7 Add new required lib to newview. 2018-08-10 18:58:29 -05:00
Shyotl
3c87835f82 Delay mesh fetch retries to avoid hammering server endlessly if something goes wrong. 2018-08-10 18:57:39 -05:00
Shyotl
bc8c95a7f7 Minor cleanup. 2018-08-10 18:17:30 -05:00
Shyotl
369a3ed909 Replace CA file. 2018-08-10 18:16:48 -05:00
Shyotl
eb747e2304 Fix CURL failures 2018-08-10 18:05:00 -05:00
Lirusaito
e0df1a763c Optimize resync_anims so we don't have to iterate over Every Single Object
Also minor opt to partial name2key code.
2018-08-10 15:15:20 -04:00
Shyotl
fe764ae97f Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer.git 2018-08-07 21:46:07 -05:00
Shyotl
0fc962454d Fix shadows on basic alpha faces. 2018-08-07 01:53:06 -05:00
Shyotl
b1b415e862 Actually deallocate oversized mesh loading buffer. 2018-08-07 01:12:09 -05:00
Shyotl
b5f0355015 Dpi awareness should be set before creating the application window. In theory dpi awareness shouldn't have worked without this. 2018-08-07 01:10:48 -05:00
Shyotl
d11899561b Optimization pass. 2018-08-07 01:09:53 -05:00
Shyotl
71f3002717 Merge branch 'master' of github.com:Shyotl/SingularityViewer
# Conflicts:
#	indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
2018-08-06 20:42:32 -05:00
Lirusaito
9f03d1be05 How to enable "show muted text" box by default
Have a feature, Torric.
I should've already set this up long ago, sorry about that!
2018-07-27 15:38:01 -04:00
Lirusaito
899d1955c0 More SV-1908 2018-07-23 06:12:34 -04:00
Lirusaito
c962922e75 SV-1908 2018-07-23 05:53:00 -04:00
Lirusaito
562353929e Actually fix SV-2181 this time? I think. It seems to work. 2018-07-16 02:55:40 -04:00
Lirusaito
4c8bd8d3ca Sync some voice stuff 2018-07-15 12:12:21 -04:00
Lirusaito
e31c088470 Modernize the voice remote some. 2018-07-15 12:09:47 -04:00
Lirusaito
172eee49e5 Give local speakers lists a more radar-like menu 2018-07-15 11:56:35 -04:00
Lirusaito
14fd78a5af Do the scroll list menu thing more cleanly. 2018-07-15 11:54:23 -04:00
Lirusaito
c056eacfab Fix SV-2179: Wireframe - Rendering. Works only when Adv.light.model is disabled.
(Don't toggle ALM while in wireframe, bad things will happen...
or do, who am I to tell you how to live your life?
It'll look pretty cool actually, to fix that noise just toggle Wireframe once or twice.)
2018-07-15 06:26:04 -04:00
Lirusaito
ca2477a521 Update certificates 2018-07-15 06:00:09 -04:00
Lirusaito
c06c627002 Add four settings left out of 55b5f60b68 2018-07-13 20:54:49 -04:00
Lirusaito
6edd21bfe6 Don't limit the length of notecards and scripts, let the server scream at us instead. 2018-07-13 17:38:23 -04:00
Lirusaito
f1e6092b94 Sync LLViewerTexture with upstream 2018-05-02 19:30:47 -04:00
Lirusaito
1014841e2c Feature Request: Repair Uploaded by functionality
Clean up llviewertexture a bit while doing so.
Sync LLImage

Thanks to Cinder and the Alchemy Team for this buncha code.
2018-05-02 19:30:22 -04:00
Lirusaito
dd49033a08 Remove VSTool 2018-05-02 19:20:38 -04:00
Shyotl
07835ea832 Speed up texture cache init. (Was exceptionally slow with a debugger attached) 2018-04-29 01:58:04 -05:00
Drake Arconis
a8e8f6d409 Fix gamma corruption 2018-04-26 15:54:30 -04:00
Drake Arconis
54fe7a8606 Well this...compiles 2018-04-26 15:54:24 -04:00
Shyotl
f9897b607b Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2018-04-09 02:51:22 -05:00
Shyotl
798f4c1a69 Avoid needing winver 601. 2018-04-09 02:50:44 -05:00
Shyotl
7a04780841 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2018-04-09 02:36:30 -05:00
Shyotl
d3e1edcc93 Windows dpi scaling. 2018-04-09 02:08:46 -05:00
Shyotl
50a0902f92 Fix projector reflections. 2018-02-19 01:58:32 -06:00
Shyotl
84da051385 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2018-02-13 23:07:15 -06:00
Shyotl
c77699dcd5 Speakerlist was taking a ridiculous amount of frame time when displaying large groups. 2018-02-13 23:06:41 -06:00
Shyotl
02865a9179 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2018-02-08 03:25:32 -06:00
Shyotl
410d2a83a2 llformat with std::string args is no bueno. 2018-02-08 03:25:02 -06:00
Shyotl
d46f96a8d6 Fix 'function uses ‘auto’ type specifier without trailing return type' spam in gcc due to accidentally using c++14 syntax. 2018-02-08 03:18:09 -06:00
Shyotl
ce1b58dd13 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2018-02-08 01:56:43 -06:00
Shyotl
05b8e08ee8 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2018-02-08 01:35:31 -06:00
Shyotl
24a05a2ebe Add header and remove new unnecessary 'ignore' button handling due to 'ignore' checkbox now working for notify toasts. 2018-02-08 01:31:00 -06:00
Shyotl
2dc46964b4 Simple update check mechanism, and tons of notification tweaking to make the notifications look less crap. 2018-02-08 01:26:09 -06:00
Shyotl
30df7dacde Add bulk speaker updates. Sped up speaker fetching by disabling list sorting during bulk updates. 2018-02-07 21:18:35 -06:00
Shyotl
fa628ce4d1 Use standard SL splash screen. 2018-02-05 01:40:36 -06:00
Shyotl
92eb988f2a Pull in vertex buffer changes from alch. 2018-02-05 00:06:54 -06:00
Shyotl
ecc820f784 Fix shader compilation errors. Pulling bits and pieces out of massive set of unstaged changes never ends well.. 2018-02-04 23:23:04 -06:00
Shyotl
85cb3cb0d0 Clean up deferred shaders by moving common methods into shared glsl file 2018-02-04 23:08:31 -06:00
Shyotl
ec91f9a026 Skip binding emissive shader for alpha glow. Caused huge pipeline stalls. Looking into alternate solution. 2018-02-04 23:08:07 -06:00
Shyotl
8fd728ca59 Clean up generated prepended shader preprocessor mess. 2018-02-04 23:06:16 -06:00
Shyotl
cf1ce7d7e5 Per-frame per-avie rigged transform matrix cache from Alchemy, with minor alterations. 2018-02-04 23:02:07 -06:00
Shyotl
54fc42cc73 Fixed ssao without shadows enabled. (Thanks LightDrake) 2018-02-04 23:02:01 -06:00
Shyotl
a39844f9f3 Double the maximum texture memory. 2018-02-04 23:01:44 -06:00
Shyotl
2195c2af37 And.. a missing line. 2018-02-04 23:01:38 -06:00
Shyotl
a3b37f58e3 Tweak shadows to look a little less crap. 2018-02-04 23:00:55 -06:00
Shyotl
d3dbbed6af Explicitly alphamasked faces on HUD attached prims were not going into correct drawpool. 2018-02-04 23:00:30 -06:00
Shyotl
9b75abdb09 Fixed issues with ring rendering on mini and world map when ui scale was not exactly 1.0 2018-02-04 23:00:19 -06:00
Shyotl
bdf4c1a272 And.. a missing line. 2017-11-25 19:25:41 -06:00
Shyotl
647e6afa14 Tweak shadows to look a little less crap. 2017-11-25 19:20:21 -06:00
Shyotl
0e08d7d703 Explicitly alphamasked faces on HUD attached prims were not going into correct drawpool. 2017-11-25 19:20:11 -06:00
Shyotl
8776876e93 Fixed issues with ring rendering on mini and world map when ui scale was not exactly 1.0 2017-11-25 19:19:20 -06:00
Shyotl
1271eeb808 Merge remote-tracking branch 'liru/Release' 2017-11-18 11:09:40 -06:00
Shyotl
77ebb91d37 Resolve linker errors encountered on linux builds. 2017-11-17 23:21:03 -06:00
Shyotl
ca64b81785 Attempt at fixing windows build issue. Linux breakage TBD. 2017-11-16 17:48:22 -06:00
Liru
4e6eaa2849 New abuse reports upload the screenshot whenever possible 2017-11-01 18:15:47 -04:00
Liru
188704d177 Don't reduce the damn framerate, what's wrong with you?! 2017-11-01 18:14:34 -04:00
Liru
4aa943b871 XML sync report abuse with upstream 2017-11-01 18:13:36 -04:00
Shyotl
68c498163d Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2017-10-03 14:50:28 -05:00
Liru
0b35781d55 Refresh balance when it's clicked 2017-10-02 15:31:07 -04:00
Liru
f838fa5d45 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into Release 2017-10-02 14:12:18 -04:00
Inusaito Sayori
2922f78c20 Merge pull request #30 from nikolas/patch-2
Variables.cmake: typo fix - BOOl -> BOOL
2017-10-02 13:29:24 -04:00
Inusaito Sayori
5be20f26f3 Merge pull request #27 from nikolas/detect-debian
Fix debian detection
2017-10-02 13:10:00 -04:00
Inusaito Sayori
0a01adf101 Merge pull request #31 from nikolas/patch-3
Variables.cmake: fix typo - Unkown -> Unknown
2017-09-30 23:56:55 -04:00
Nik Nyby
5e3e46847e Variables.cmake: fix typo - Unkown -> Unknown 2017-09-30 23:48:25 -04:00
Nik Nyby
c68b7ff4a8 Variables.cmake: typo fix - BOOl -> BOOL 2017-09-30 14:12:58 -04:00
Nik Nyby
740153475c Fix debian detection
My OS wasn't getting detected as Debian. This fixes that.
2017-09-29 14:10:55 -04:00
Inusaito Sayori
71c363e115 Merge pull request #28 from nikolas/patch-1
readme: update issue tracker link
2017-09-26 01:33:27 -04:00
Nik Nyby
8f40538d01 readme: update issue tracker link 2017-09-26 00:56:50 -04:00
Shyotl
733fca3d49 Http asset fetching. 2017-06-20 19:50:22 -05:00
Lirusaito
d7e5d07a77 For no real reason at all, update script limits floater code. 2017-05-13 10:44:09 -04:00
Lirusaito
e199a1a1d6 Make sure we're updating the VisualComplexity whenever we should be (sync w/ upstream) 2017-05-13 10:29:03 -04:00
Lirusaito
e8a0762eee Firestorm can't be trusted. 2017-05-13 09:56:23 -04:00
Lirusaito
8cea1705d1 You asked for it, here's Classic Search back! 2017-04-23 18:49:55 -04:00
Lirusaito
a6236ab593 Prepare for upcoming changes to Region Agent Limit 2017-04-12 19:57:52 -04:00
Lirusaito
bb22201f4a Revert the PyFx Ambient Dark and Ambient White changes
Adds Ambient Not As White and Ambient Not As Dark
2017-04-04 23:00:25 -04:00
Lirusaito
2eaf9a2c22 Add back Latif's CMake-based branding to BuildBranding.cmake 2017-04-04 21:16:29 -04:00
Lirusaito
c92ccf8a44 Branding shtuffs for the Singularity 2017-04-04 20:40:08 -04:00
Shyotl
7a5857e838 Minor cleanup. 2017-04-04 03:40:16 -05:00
Shyotl
b24635d24e RMSE bugfixes. 2017-04-01 21:55:13 -05:00
Shyotl
1230748ef5 Alchemy llcharacter and llcommon merge pass. 2017-03-31 02:08:03 -05:00
Shyotl
f95be54bd5 Merge https://github.com/Lirusaito/SingularityViewer/tree/Release
# Conflicts:
#	indra/newview/app_settings/settings_sh.xml
2017-03-27 23:25:33 -05:00
Shyotl
97a6f3a7b2 noisemap tweaks and cleanup. 2017-03-27 23:13:56 -05:00
Shyotl
f1063afea1 Tweak alphamask RSME and allow multiselect derender. 2017-03-25 00:35:48 -05:00
Lirusaito
0dfef2ab25 PyFx partial integration
Adds PyFx windlights and post process effects, not enabled by default.
Show custom graphics settings by default, because all our users are smart.
Tweaks SHAutoMask, uses Altocumulus as default cloud now
Added TODO into llrender/llpostprocess.cpp
We should also add the option to make the menu bar transparent, instead of pyfx using skin hacks
Also we need to add a settings preset feature at some point in the future.
We also need to add postproc to wlf.
2017-03-20 11:10:21 -04:00
Lirusaito
8e59d9800d Merge branch 'master' of git://github.com/Shyotl/SingularityViewer into Release
Fixed pipeline conflict over Mika/Shyotl variable naming differences.
2017-03-20 08:08:06 -04:00
Shyotl
1ccd8cfd89 Tweak tangents. 2017-03-17 00:54:48 -05:00
Shyotl
f4a713a500 Merge. 2017-03-14 04:02:53 -05:00
Shyotl
4a9ff22eeb I was critically damp once. It was okay. 2017-03-14 01:44:26 -05:00
Shyotl
7dd616357f Match AISAPI refactoring. 2017-03-13 23:58:56 -05:00
Shyotl
d42e380698 Minor cleanup. 2017-03-13 23:54:56 -05:00
Shyotl
75c47e96b6 Fixed numerous bugs. 2017-03-09 23:49:56 -06:00
Shyotl
6523cf43be Fix some remaining callers to ui draw methods that have recently had their winding switched to CCW. 2017-02-26 23:19:12 -06:00
Shyotl
5d96bd8966 Fix winding issues with various ui draw methods. Face culling is actually disabled during ui rendering, but it's still good to do winding correctly regardless. Also automated tri strip batching. 2017-02-24 01:49:31 -06:00
Shyotl
d39ad79986 Update more full-screen shaders to no longer require texcoord attribs. 2017-02-18 01:18:39 -06:00
Shyotl
b9c3ca535d Remove temporary render target used for debugging prior changes. 2017-02-17 23:41:10 -06:00
Shyotl
5e501b9611 Removed TT_RECT_TEXTURE and removed unnecessary shaders. 2017-02-17 23:37:46 -06:00
Shyotl
983a7e31dc Have gl_rect_2d and gl_rect_2d_simple use TRIANGLES instead of TRIANGLE_STRIP 2017-02-17 23:15:45 -06:00
Shyotl
693781a014 Remove all QUADS usage. Replaced with TRIANGLES and TRIANGLE_STRIP. May do another pass and replace un-textured TRIANGLE_STRIPs with TRIANGLES to reduce flush calls. 2017-02-11 02:03:06 -06:00
Shyotl
aee659b518 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2017-02-08 01:00:32 -06:00
Shyotl
271c37442d Prevent menus from clipping off the top of the screen. 2017-02-08 00:54:42 -06:00
miKaぴょん
7a1633abdf Bento German translation 2017-01-19 13:29:10 +01:00
miKaぴょん
14ee1c5189 Make Second Life glow again.
Thank you Shyotl for hand-holding and instructions!
2017-01-14 08:38:00 +01:00
Shyotl
c262210cf3 Merge branch 'Release' of https://github.com/Lirusaito/SingularityViewer 2017-01-13 01:21:33 -06:00
Lirusaito
6707e481de Apply Router Gray's Media Remote Controls for CEF hack. 2017-01-13 02:01:30 -05:00
Lirusaito
0bc98aad3b Merge branch 'master' of https://github.com/miKa-pyon/SingularityViewer into Release 2017-01-13 01:01:58 -05:00
Shyotl
34fd992fb9 Un-break rigged normals when software skinning. 2017-01-12 23:48:23 -06:00
Shyotl
f62fded4bd Use avatar-relative transforms when skinning via software, and translate to world coordinates after. 2017-01-12 23:47:58 -06:00
Shyotl
aa7c5e652c Removed some C++14-only syntax. 2017-01-12 23:45:42 -06:00
Shyotl
632725e788 Prevent Edit->Attach/Detach menus from cumulatively growing larger every time LiruUseContextMenus setting was changed. 2017-01-11 18:10:09 -06:00
Shyotl
98516a2a22 Bento hell and back, and back to hell, and back. 2017-01-11 03:55:36 -06:00
miKaぴょん
b578b639e8 Fix SV-1891 2016-12-10 06:55:17 +01:00
Lirusaito
b5f1d5b435 Default to modern ARC 2016-10-21 18:10:54 -04:00
Lirusaito
efe83160a1 Fix incorrect attribute name resulting in shortened moap homepage urls 2016-09-14 18:13:16 -04:00
Lirusaito
e29776d2b2 :%s/"Block"/"Mute"/g 2016-08-23 15:45:53 -04:00
Shyotl
9dbdf75c14 Merge branch 'Release' of https://github.com/Lirusaito/SingularityViewer.git 2016-08-22 22:37:25 -05:00
Shyotl
583ea76c85 Experimental amd gpu workaround. 2016-08-22 22:33:28 -05:00
Shyotl
8e7574b9ae Propogate correct mats shader mask for rigged alpha faces. 2016-08-09 00:24:28 -05:00
Shyotl
b8f1468ab5 Fix rigged faces not properly displaying mats properties on alpha faces. 2016-08-09 00:22:40 -05:00
Shyotl
4b318d072a Wokaround for viewer crasher. Related to rigged mesh. 2016-08-09 00:18:28 -05:00
Lirusaito
1f53b80c9b Fix nonmatching string literal 2016-07-20 07:33:14 -04:00
Lirusaito
707dc2f56f Remove an extraneous "you" (thanks Fritigern) 2016-07-18 20:30:38 -04:00
Lirusaito
a1e7014524 [MediaFilter] Fix blacklist being swapped with whitelist for media
R&D by Router Gray.
2016-07-16 09:41:55 -04:00
Lirusaito
aacc250481 This seems more right... 2016-07-16 06:35:42 -04:00
Lirusaito
fbb144ede4 Update About Floater with up to date devs and maintainers info. 2016-07-16 06:35:16 -04:00
Lirusaito
b26bd29325 Media filter C++11 changes. 2016-07-16 06:31:28 -04:00
Lirusaito
b7edebf272 Conserve messages when right-click bulk kicking. 2016-07-13 23:44:58 -04:00
Lirusaito
dd74e69ab7 Fix a bug with <x] button, introduced by new behavior discussed in SV-2078 2016-07-12 07:27:30 -04:00
Lirusaito
e4544bec97 Linux BarkBark! 2016-07-10 16:59:16 -04:00
Fritigern
dad825d68d Added icons for alpha versions, updated one icon in default, and modified viewer_manifest to also use these icons.
Signed-off-by: Fritigern <fritigerngothly@gmail.com>
2016-07-10 13:46:48 -07:00
Lirusaito
a9cf5743a3 Sync viewer_manifest mac stuff a bit for cef... pointless~ 2016-07-09 23:10:58 -04:00
Lirusaito
21164d1f01 Silly Liru, bracket initializer lists are not expressions! 2016-07-08 16:59:13 -04:00
Lirusaito
eeb3a096d4 Fix signed/unsigned mismatch 2016-07-08 16:46:34 -04:00
Lirusaito
87b955b2ce Giving your viewer one more std:: 2016-07-08 08:36:12 -04:00
Lirusaito
da13f3599c Woops, forgot to remove static, didn't even notice. 2016-07-08 02:05:25 -04:00
Lirusaito
727a91b689 Actually solve SV-2103
Tons of duplicate code cleanup, yaaaay~
2016-07-07 22:39:06 -04:00
Lirusaito
873b399ee8 Sync with obsidian in attempt to fix SV-2086
Applies MAINT-4897 FIXED Frequent error when texturing a linkset - "Unable to add texture. Please wait a few seconds and try again."
Applies MAINT-5547 FIXED errors when texturing a linkset "Unable to add texture. Please wait a few seconds and try again."
2016-07-07 16:37:25 -04:00
Lirusaito
a6e905020d Package textures/ subdirectories too. 2016-07-06 16:41:21 -04:00
Lirusaito
9fe563c9f3 Solve SV-2103: Estate Kick was Teleporting Home, which wasn't always a kick
Estate Kick button now offers choice between Kicking Home and Kicking Out.
Estate Ban always kicks out

Translators: Please update SV-2103 in notifications.xml appropriately
2016-07-06 00:51:28 -04:00
Lirusaito
755d4c242b Fix SV-2105: Ban lines don't show up
Thanks to Router Gray for researching and solving this issue!!
2016-07-05 18:57:20 -04:00
Lirusaito
8308a0f769 Fix for FIRE-17419: Minimap property line corruption between VarRegions of different sizes
Thanks to Ansariel Hiller for this~
2016-06-30 00:24:10 -04:00
Lirusaito
e23a6f533c Revert fix for SV-2078 until more people give feedback. 2016-06-29 18:52:48 -04:00
Lirusaito
31aa797f0e Compile Fixy 2016-06-28 12:49:01 -04:00
Lirusaito
086af65f89 SV-2093: Add Block option to ScriptDialogs.
Thanks to routergray for helping me test this.
2016-06-28 10:33:48 -04:00
Lirusaito
e11b70415d Satisfy SV-2101: Add LiruOnlineNotificationBehavior to allow configuration of behavior when FriendOnline notification is clicked 2016-06-28 07:56:02 -04:00
Lirusaito
b8ca422e71 Attempt to fix SV-2096 2016-06-28 07:35:23 -04:00
Lirusaito
a68a345c32 Fix SV-2078: Reset inventory type filter on clearing search filter 2016-06-28 04:36:09 -04:00
Lirusaito
31dbe29cae Fix SV-2076: Mouselook button shouldn't show under most circumstances
Thanks to routergray for testing this fix.
2016-06-27 16:36:48 -04:00
Lirusaito
5bb9cda747 Hide Log button on own profile 2016-06-27 13:52:22 -04:00
Lirusaito
afb567265e handle_web_browser_test should spawn internal browser. 2016-06-27 13:17:01 -04:00
Lirusaito
dfb049d13c Update the VC redist package 2016-06-27 10:14:48 -04:00
Lirusaito
734d17c429 Linux Bark!
Thanks router!
2016-06-25 21:18:05 -04:00
Lirusaito
684ab3e3e5 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into Release 2016-06-24 21:35:12 -04:00
Lirusaito
a3c2009a48 Fix GCC 4.8
Thanks Drake
2016-06-24 21:05:54 -04:00
Shyotl
f77df0ab83 Silence 'getCapability called before caps received for' console spam when fetching mesh. TODO: Check if a proper workaround is available in V3, as I worry that some meshes that failed the caps check may not get promptly re-generated upon caps receipt. 2016-06-21 02:22:03 -05:00
Shyotl
cd25894a39 Hack to resolve SV-2036. A lot of this code will probably get wiped out in a merge soonish, so not investing time into a more proper fix. 2016-06-21 01:54:21 -05:00
Shyotl
95f56f040a Do not discard transparent specular-mapped fragments. 2016-06-18 15:35:11 -05:00
Lirusaito
39721e5bcd Fix Chat History in list menus 2016-06-16 04:57:53 -04:00
Shyotl
8e622eaca6 Fix issue with nvapi-disabled path uncovered when performing a full rebuild. 2016-06-16 01:54:53 -05:00
1912 changed files with 142501 additions and 72071 deletions

5
.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
@@ -25,5 +27,4 @@ qtcreator-build/
/.pc
/build-*
/viewer-*
/Pipfile.lock

286
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,286 @@
stages:
- build
- upload
default:
interruptible: true
timeout: 4h
variables:
AUTOBUILD_BUILD_ID: $CI_PIPELINE_ID
AUTOBUILD_INSTALLABLE_CACHE: "$CI_PROJECT_DIR/.cache/autobuild"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
VIEWER_USE_CRASHPAD: "TRUE"
VIEWER_CRASHPAD_URL: $SENTRY_DSN
.win_build:
stage: build
tags:
- autobuild
- windows
cache:
key:
files:
- autobuild.xml
prefix: ${CI_JOB_NAME}
paths:
- .cache/autobuild
- .cache/pip
- .venv/
when: 'always'
before_script:
- virtualenv .venv
- .\.venv\Scripts\activate.ps1
- pip install --upgrade autobuild -i https://pkg.alchemyviewer.org/repository/autobuild/simple --extra-index-url https://pypi.org/simple
script:
- |
autobuild configure -c Release -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DVS_DISABLE_FATAL_WARNINGS=ON -DREVISION_FROM_VCS=FALSE
autobuild build -c Release --no-configure
artifacts:
name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
expire_in: 1 week
paths:
- build-vc-*/newview/Release/build_data.json
- build-vc-*/newview/Release/singularity-bin.exe
- build-vc-*/newview/Release/*.pdb
- build-vc-*/newview/Release/*.dll
- build-vc-*/newview/Release/Singularity_*_Setup.exe
.linux_build:
stage: build
image: r.alchemyviewer.org/singularity/infrastructure/debian-build-image:latest
tags:
- linux
- docker
cache:
key:
files:
- autobuild.xml
prefix: ${CI_JOB_NAME}
paths:
- .cache/autobuild
- .cache/pip
- .venv
when: 'always'
before_script:
- virtualenv .venv -p python2
- source .venv/bin/activate
- pip install --upgrade autobuild -i https://pkg.alchemyviewer.org/repository/autobuild/simple --extra-index-url https://pypi.org/simple
script:
- |
autobuild configure -c Release -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DUNIX_DISABLE_FATAL_WARNINGS=ON -DREVISION_FROM_VCS=FALSE
autobuild build -c Release --no-configure
artifacts:
name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
expire_in: 1 week
paths:
- build-linux-*/build_data.json
- build-linux-*/newview/Singularity_*.tar.xz
.win32_build:
extends: .win_build
variables:
AUTOBUILD_ADDRSIZE: 32
VIEWER_USE_CRASHPAD: "FALSE"
cache:
key:
prefix: windows32
.win64_build:
extends: .win_build
variables:
AUTOBUILD_ADDRSIZE: 64
cache:
key:
prefix: windows64
.linux32_build:
extends: .linux_build
variables:
AUTOBUILD_ADDRSIZE: 32
cache:
key:
prefix: linux32
.linux64_build:
extends: .linux_build
variables:
AUTOBUILD_ADDRSIZE: 64
cache:
key:
prefix: linux64
.master_rules:
rules:
- if: $BUILD_CHANNEL || $CI_COMMIT_TAG
when: never
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
#- if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "push"'
# when: delayed
# start_in: '12 hours'
variables:
VIEWER_CHANNEL_TYPE: Test
VIEWER_USE_CRASHPAD: "FALSE"
.project_rules:
rules:
- if: '$BUILD_CHANNEL == "Project" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
- if: '$CI_COMMIT_TAG =~ /.*-project/'
variables:
VIEWER_CHANNEL_TYPE: Project
.beta_rules:
rules:
- if: '$BUILD_CHANNEL == "Beta" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
- if: '$CI_COMMIT_TAG =~ /.*-beta/'
variables:
VIEWER_CHANNEL_TYPE: Beta
.release_rules:
rules:
- if: '$BUILD_CHANNEL == "Release" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
- if: '$CI_COMMIT_TAG =~ /.*-release/'
variables:
VIEWER_CHANNEL_TYPE: Release
.build:master:linux64:
extends:
- .linux64_build
- .master_rules
build:master:windows32:
extends:
- .win32_build
- .master_rules
build:master:windows64:
extends:
- .win64_build
- .master_rules
.build:project:linux64:
extends:
- .linux64_build
- .project_rules
build:project:windows32:
extends:
- .win32_build
- .project_rules
build:project:windows64:
extends:
- .win64_build
- .project_rules
.build:beta:linux64:
extends:
- .linux64_build
- .beta_rules
build:beta:windows32:
extends:
- .win32_build
- .beta_rules
build:beta:windows64:
extends:
- .win64_build
- .beta_rules
.build:release:linux64:
extends:
- .linux64_build
- .release_rules
build:release:windows32:
extends:
- .win32_build
- .release_rules
build:release:windows64:
extends:
- .win64_build
- .release_rules
.upload_template:
stage: upload
tags:
- autobuild
- windows
allow_failure: false
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; };
Function try_upload($build_type, $file_pattern)
{
$build_newview = ".\build-${build_type}\newview\"
If (Test-Path -LiteralPath $build_newview)
{
Push-Location $build_newview
$FileName = Get-ChildItem -Path . -Name -Include $file_pattern
Invoke-WebRequest @UploadParams -InFile .\$FileName -Uri "${UploadDestURL}/${FileName}"
If (($env:VIEWER_USE_CRASHPAD -eq 'TRUE') -and ($build_type -eq "vc-64"))
{
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
}
}
try_upload("linux-64", "Singularity_*.tar.xz")
try_upload("vc-64", "Singularity_*_Setup.exe")
try_upload("vc-32", "Singularity_*_Setup.exe")
If ($env:VIEWER_USE_CRASHPAD -eq 'TRUE')
{
sentry-cli releases new $BuildChannelVersion
sentry-cli releases set-commits --auto $BuildChannelVersion
sentry-cli releases finalize $BuildChannelVersion
}
upload:project:
extends:
- .upload_template
rules:
- if: '$BUILD_CHANNEL == "Project" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
when: manual
- if: '$CI_COMMIT_TAG =~ /.*-project/'
when: manual
environment:
name: qa
upload:beta:
extends:
- .upload_template
rules:
- if: '$BUILD_CHANNEL == "Beta" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
when: manual
- if: '$CI_COMMIT_TAG =~ /.*-beta/'
when: manual
environment:
name: beta
upload:release:
extends:
- .upload_template
rules:
- if: '$BUILD_CHANNEL == "Release" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
when: manual
- if: '$CI_COMMIT_TAG =~ /.*-release/'
when: manual
environment:
name: release

14
Pipfile Normal file
View File

@@ -0,0 +1,14 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
[packages]
llbase = "*"
certifi = "*"
autobuild = {git = "https://git.alchemyviewer.org/alchemy/autobuild.git"}
[requires]
python_version = "2.7"

2
README
View File

@@ -18,7 +18,7 @@ as those based upon the OpenSim platform.
Singularity is maintained by a small group of volunteers who can be contacted
both, in-world (SingularityViewer group) as well as on IRC (#SingularityViewer
@ FreeNode). Bug requests and features requests can be submitted through our
Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from
Issue Tracker (http://links.singularityviewer.org/?to=issues or from
the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...)

File diff suppressed because it is too large Load Diff

View File

@@ -236,6 +236,14 @@
<boolean>false</boolean>
</map>
<key>ObjectAnimation</key>
<map>
<key>flavor</key>
<string>template</string>
<key>trusted-sender</key>
<boolean>false</boolean>
</map>
<key>AvatarAppearance</key>
<map>
<key>flavor</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,14 +11,21 @@ project(${ROOT_PROJECT_NAME})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Variables)
include(BuildVersion)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
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)
@@ -58,5 +60,10 @@ add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
add_subdirectory(${VIEWER_PREFIX}newview)
add_dependencies(viewer singularity-bin)
add_dependencies(viewer ${VIEWER_BINARY_NAME})
if (WINDOWS)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY VS_STARTUP_PROJECT ${VIEWER_BINARY_NAME})
endif (WINDOWS)

View File

@@ -39,3 +39,9 @@ set_source_files_properties(${aistatemachine_HEADER_FILES}
list(APPEND aistatemachine_SOURCE_FILES ${aistatemachine_HEADER_FILES})
add_library (aistatemachine ${aistatemachine_SOURCE_FILES})
target_link_libraries(
aistatemachine
PUBLIC
llcommon
)

View File

@@ -5,9 +5,9 @@
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(CheckCCompilerFlag)
include(Variables)
# Portable compilation flags.
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
@@ -18,27 +18,11 @@ 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)
# Platform-specific compilation flags.
if (WINDOWS)
# Don't build DLLs.
set(BUILD_SHARED_LIBS OFF)
@@ -55,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)
@@ -88,10 +80,12 @@ if (WINDOWS)
/DNOMINMAX
/DUNICODE
/D_UNICODE
/DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
/GS
/TP
/W3
/c
/Zc:__cplusplus
/Zc:forScope
/Zc:rvalueCast
/Zc:wchar_t
@@ -110,9 +104,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)
@@ -128,21 +122,28 @@ set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math")
if (LINUX)
set(CMAKE_SKIP_RPATH TRUE)
add_compile_options(
-fvisibility=hidden
-fexceptions
-fno-math-errno
-fno-strict-aliasing
-fsigned-char
-g
-pthread
)
add_definitions(
-DLL_LINUX=1
-DAPPID=secondlife
-D_REENTRANT
-fexceptions
-fno-math-errno
-fno-strict-aliasing
-fsigned-char
-fvisibility=hidden
-g
-pthread
)
-DLL_LINUX=1
-DAPPID=secondlife
-D_REENTRANT
-DGDK_DISABLE_DEPRECATED
-DGTK_DISABLE_DEPRECATED
-DGSEAL_ENABLE
-DGTK_DISABLE_SINGLE_INCLUDES
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
@@ -199,37 +200,40 @@ 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")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffast-math")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math -msse4.1")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffast-math -msse4.1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math -msse4.1")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math -msse4.1")
else (${ARCH} STREQUAL "x86_64")
if (NOT STANDALONE)
set(MARCH_FLAG " -march=pentium4")
endif (NOT STANDALONE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
endif (${ARCH} STREQUAL "x86_64")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
if (NOT STANDALONE)
set(MARCH_FLAG " -axsse4.1 -msse2")
set(MARCH_FLAG " -axsse4.1 -msse3")
endif (NOT STANDALONE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline-functions")
@@ -293,19 +297,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,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

@@ -0,0 +1,38 @@
# -*- cmake -*-
if (WINDOWS)
#message(WARNING, ${CMAKE_CURRENT_BINARY_DIR}/newview/viewerRes.rc.in)
configure_file(
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc
)
endif (WINDOWS)
if (DARWIN)
configure_file(
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in
${CMAKE_CURRENT_BINARY_DIR}/English.lproj/InfoPlist.strings
)
endif (DARWIN)
if (LINUX)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh.in
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/wrapper.sh
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh.in
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/handle_secondlifeprotocol.sh
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh.in
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/install.sh
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh.in
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/refresh_desktop_app_entry.sh
@ONLY
)
endif (LINUX)

View File

@@ -3,9 +3,18 @@
include(Python)
include(Variables)
# packages-formatter.py runs autobuild install --versions, which needs to know
# the build_directory, which (on Windows) depends on AUTOBUILD_ADDRSIZE.
# Within an autobuild build, AUTOBUILD_ADDRSIZE is already set. But when
# 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"
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py -p=${AUTOBUILD_PLATFORM_NAME} > packages-info.txt
${CMAKE_SOURCE_DIR}/../autobuild.xml
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE}
${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt
)

View File

@@ -46,6 +46,7 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n
set(VIEWER_CHANNEL_VERSION_DEFINES
"LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\""
"LL_VIEWER_CHANNEL_GRK=L\"${VIEWER_CHANNEL_GRK}\""
"LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}"
"LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}"
"LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}"

View File

@@ -6,7 +6,7 @@ if (USESYSTEMLIBS)
set(CEFPLUGIN OFF CACHE BOOL
"CEFPLUGIN support for the llplugin/llmedia test apps.")
else (USESYSTEMLIBS)
use_prebuilt_binary(llceflib)
use_prebuilt_binary(dullahan)
set(CEFPLUGIN ON CACHE BOOL
"CEFPLUGIN support for the llplugin/llmedia test apps.")
set(CEF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/cef)
@@ -16,7 +16,7 @@ if (WINDOWS)
set(CEF_PLUGIN_LIBRARIES
libcef.lib
libcef_dll_wrapper.lib
llceflib.lib
dullahan.lib
)
elseif (DARWIN)
FIND_LIBRARY(APPKIT_LIBRARY AppKit)
@@ -31,15 +31,15 @@ elseif (DARWIN)
set(CEF_PLUGIN_LIBRARIES
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a
${ARCH_PREBUILT_DIRS_RELEASE}/libLLCefLib.a
${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a
${APPKIT_LIBRARY}
${CEF_LIBRARY}
)
elseif (LINUX)
set(CEF_PLUGIN_LIBRARIES
llceflib
cef_dll_wrapper
dullahan
cef_dll_wrapper.a
cef
)
endif (WINDOWS)

View File

@@ -13,43 +13,43 @@ set(cmake_SOURCE_FILES
Audio.cmake
BasicPluginBase.cmake
Boost.cmake
BuildBranding.cmake
BuildVersion.cmake
CARes.cmake
CEFPlugin.cmake
CMakeCopyIfDifferent.cmake
CURL.cmake
Colladadom.cmake
ConfigurePkgConfig.cmake
CURL.cmake
Copy3rdPartyLibs.cmake
CrashPad.cmake
Cwdebug.cmake
DBusGlib.cmake
DeploySharedLibs.cmake
EXPAT.cmake
ExamplePlugin.cmake
FMODSTUDIO.cmake
FindAPR.cmake
FindAutobuild.cmake
FindCARes.cmake
FindColladadom.cmake
FindGLOD.cmake
FindGoogleBreakpad.cmake
FindGooglePerfTools.cmake
FindHunSpell.cmake
FindJsonCpp.cmake
FindNDOF.cmake
FindOpenJPEG.cmake
FindTut.cmake
FindURIPARSER.cmake
FindXmlRpcEpi.cmake
FMODSTUDIO.cmake
FreeType.cmake
GeneratePrecompiledHeader.cmake
GLOD.cmake
GStreamer010Plugin.cmake
Glui.cmake
Glut.cmake
GoogleBreakpad.cmake
GooglePerfTools.cmake
Hunspell.cmake
JPEG.cmake
JsonCpp.cmake
LLAddBuildTest.cmake
LLAppearance.cmake
LLAudio.cmake
@@ -64,7 +64,6 @@ set(cmake_SOURCE_FILES
LLPlugin.cmake
LLPrimitive.cmake
LLPhysicsExtensions.cmake
LLSharedLibs.cmake
LLRender.cmake
LLSharedLibs.cmake
LLUI.cmake
@@ -85,16 +84,16 @@ set(cmake_SOURCE_FILES
Prebuilt.cmake
PulseAudio.cmake
Python.cmake
QuickTimePlugin.cmake
RunBuildTest.cmake
StateMachine.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake
UnixInstall.cmake
URIPARSER.cmake
Variables.cmake
ViewerMiscLibs.cmake
WinManifest.cmake
LibVLCPlugin.cmake
XmlRpcEpi.cmake
ZLIB.cmake
)

View File

@@ -10,8 +10,8 @@ else (STANDALONE)
use_prebuilt_binary(curl)
if (WINDOWS)
set(CURL_LIBRARIES
debug libcurld
optimized libcurl)
debug libcurl_a_debug
optimized libcurl_a)
else (WINDOWS)
use_prebuilt_binary(libidn)
set(CURL_LIBRARIES curl idn)

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

@@ -6,6 +6,8 @@
include(CMakeCopyIfDifferent)
include(Linking)
include(Variables)
include(LLCommon)
###################################################################
# set up platform specific lists of files that need to be copied
@@ -20,14 +22,19 @@ if(WINDOWS)
set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(vivox_files
SLVoice.exe
ca-bundle.crt
libsndfile-1.dll
vivoxplatform.dll
vivoxsdk.dll
ortp.dll
zlib1.dll
vivoxoal.dll
)
if (ADDRESS_SIZE EQUAL 64)
list(APPEND vivox_files
vivoxsdk_x64.dll
ortp_x64.dll
)
else (ADDRESS_SIZE EQUAL 64)
list(APPEND vivox_files
vivoxsdk.dll
ortp.dll
)
endif (ADDRESS_SIZE EQUAL 64)
#*******************************
# Misc shared libs
@@ -37,8 +44,6 @@ if(WINDOWS)
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
ssleay32.dll
libeay32.dll
glod.dll
libhunspell.dll
)
@@ -48,26 +53,45 @@ if(WINDOWS)
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
ssleay32.dll
libeay32.dll
glod.dll
libhunspell.dll
)
if(ADDRESS_SIZE EQUAL 64)
list(APPEND debug_files
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
)
list(APPEND release_files
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
)
else(ADDRESS_SIZE EQUAL 64)
list(APPEND debug_files
libcrypto-1_1.dll
libssl-1_1.dll
)
list(APPEND release_files
libcrypto-1_1.dll
libssl-1_1.dll
)
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)
if(WORD_SIZE STREQUAL 64)
set(debug_files ${debug_files} fmodL64.dll)
set(release_files ${release_files} fmod64.dll)
else(WORD_SIZE STREQUAL 64)
set(debug_files ${debug_files} fmodL.dll)
set(release_files ${release_files} fmod.dll)
endif(WORD_SIZE STREQUAL 64)
endif (FMODSTUDIO)
if(OPENAL)
list(APPEND debug_files alut.dll OpenAL32.dll)
list(APPEND release_files alut.dll OpenAL32.dll)
endif(OPENAL)
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")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
@@ -100,10 +124,10 @@ elseif(DARWIN)
libndofdev.dylib
)
if (FMODSTUDIO)
set(debug_files ${debug_files} libfmodL.dylib)
set(release_files ${release_files} libfmod.dylib)
endif (FMODSTUDIO)
if (USE_FMODSTUDIO)
list(APPEND debug_files libfmodL.dylib)
list(APPEND release_files libfmod.dylib)
endif (USE_FMODSTUDIO)
elseif(LINUX)
# linux is weird, multiple side by side configurations aren't supported
@@ -120,7 +144,6 @@ elseif(LINUX)
libvivoxplatform.so
libvivoxsdk.so
SLVoice
# ca-bundle.crt #No cert for linux. It is actually still 3.2SDK.
)
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
# or ARCH_PREBUILT_DIRS
@@ -134,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...")
@@ -209,13 +223,13 @@ set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${debug_src_dir}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${debug_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
#copy_if_different(
# ${debug_src_dir}
# "${SHARED_LIB_STAGING_DIR_DEBUG}"
# out_targets
# ${debug_files}
# )
#set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${release_src_dir}

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)
@@ -11,13 +11,8 @@ if (FMODSTUDIO)
set(lib_suffix .so)
endif(WINDOWS)
if(WINDOWS)
if(WORD_SIZE EQUAL 64)
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod64${lib_suffix})
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL64${lib_suffix})
else(WORD_SIZE EQUAL 64)
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod${lib_suffix})
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL${lib_suffix})
endif(WORD_SIZE EQUAL 64)
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod${lib_suffix})
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL${lib_suffix})
else(WINDOWS)
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/libfmod${lib_suffix})
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/libfmodL${lib_suffix})
@@ -35,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,39 +0,0 @@
# -*- cmake -*-
# - Find JSONCpp
# Find the JSONCpp includes and library
# This module defines
# JSONCPP_FOUND, System has libjsoncpp.
# JSONCPP_INCLUDE_DIRS - The libjsoncpp include directories.
# JSONCPP_LIBRARIES - The libraries needed to use libjsoncpp.
# JSONCPP_DEFINITIONS - Compiler switches required for using libjsoncpp.
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_JSONCPP jsoncpp)
SET(JSONCPP_DEFINITIONS ${PC_JSONCPP_CFLAGS_OTHER})
FIND_PATH(JSONCPP_INCLUDE_DIR json/reader.h
HINTS ${PC_JSONCPP_INCLUDE_DIR} ${PC_JSONCPP_INCLUDE_DIRS}
PATH_SUFFIXES jsoncpp)
# Get the GCC compiler version
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE _gcc_COMPILER_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Try to find a library that was compiled with the same compiler version as we currently use.
FIND_LIBRARY(JSONCPP_LIBRARY
NAMES libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so libjsoncpp.so
HINTS ${PC_JSONCPP_LIBDIR} ${PC_JSONCPP_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib)
SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
SET(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JSONCPP DEFAULT_MSG
JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
MARK_AS_ADVANCED(JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)

View File

@@ -0,0 +1,46 @@
# -*- cmake -*-
# - Find uriparser
# Find the URIPARSER includes and library
# This module defines
# URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc.
# URIPARSER_LIBRARY, the libraries needed to use uriparser.
# URIPARSER_FOUND, If false, do not try to use uriparser.
#
# This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x),
# because it doesn't look up the version of uriparser, resulting in a dramatic
# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
#
# Note: Since this file is only used for standalone, the windows
# specific parts were left out.
FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/Uri.h
NO_SYSTEM_ENVIRONMENT_PATH
)
FIND_LIBRARY(URIPARSER_LIBRARY uriparser)
if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR})
SET(URIPARSER_LIBRARY ${URIPARSER_LIBRARY})
SET(URIPARSER_FOUND "YES")
else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
SET(URIPARSER_FOUND "NO")
endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
if (URIPARSER_FOUND)
if (NOT URIPARSER_FIND_QUIETLY)
message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARY}")
SET(URIPARSER_FIND_QUIETLY TRUE)
endif (NOT URIPARSER_FIND_QUIETLY)
else (URIPARSER_FOUND)
if (URIPARSER_FIND_REQUIRED)
message(FATAL_ERROR "Could not find URIPARSER library")
endif (URIPARSER_FIND_REQUIRED)
endif (URIPARSER_FOUND)
mark_as_advanced(
URIPARSER_LIBRARY
URIPARSER_INCLUDE_DIR
)

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

@@ -12,4 +12,5 @@ else (STANDALONE)
set(HUNSPELL_LIBRARY libhunspell)
endif (LINUX OR DARWIN)
set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/hunspell)
use_prebuilt_binary(dictionaries)
endif (STANDALONE)

6
indra/cmake/Json.cmake Normal file
View File

@@ -0,0 +1,6 @@
# -*- cmake -*-
include(Prebuilt)
use_prebuilt_binary(modernjson)
set(JSON_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include")

View File

@@ -1,22 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
set(JSONCPP_FIND_QUIETLY OFF)
set(JSONCPP_FIND_REQUIRED ON)
if (STANDALONE)
include(FindJsonCpp)
else (STANDALONE)
use_prebuilt_binary(jsoncpp)
if (WINDOWS)
set(JSONCPP_LIBRARIES
debug jsoncppd.lib
optimized jsoncpp.lib)
elseif (DARWIN)
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt)
elseif (LINUX)
set(JSONCPP_LIBRARIES jsoncpp)
endif (WINDOWS)
set(JSONCPP_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/)
endif (STANDALONE)

View File

@@ -105,17 +105,6 @@ MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
IF (NOT "$ENV{LD_LIBRARY_PATH}" STREQUAL "")
SET(LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}")
ENDIF (NOT "$ENV{LD_LIBRARY_PATH}" STREQUAL "")
ADD_CUSTOM_COMMAND(
OUTPUT ${TEST_OUTPUT}
COMMAND
${CMAKE_COMMAND}
"-DLD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
"-DTEST_CMD:STRING=${TEST_CMD}"
-P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
DEPENDS ${name}_test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
ADD_CUSTOM_TARGET(${name}_test_ok ALL DEPENDS ${TEST_OUTPUT})
IF (${parent})

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

@@ -3,6 +3,7 @@
include(APR)
include(Boost)
include(EXPAT)
include(Linking)
include(ZLIB)
if (DARWIN)
@@ -10,7 +11,6 @@ if (DARWIN)
find_library(CORESERVICES_LIBRARY CoreServices)
endif (DARWIN)
set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/cwdebug
${LIBS_OPEN_DIR}/llcommon
@@ -19,14 +19,9 @@ 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
fmt::fmt
)
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

@@ -1,32 +1,40 @@
# ll_deploy_sharedlibs_command
# target_exe: the cmake target of the executable for which the shared libs will be deployed.
macro(ll_deploy_sharedlibs_command target_exe)
set(OUTPUT_PATH $<TARGET_FILE_DIR:${target_exe}>)
set(TARGET_LOCATION $<TARGET_FILE:${target_exe}>)
get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
if(DARWIN)
SET_TEST_PATH(SEARCH_DIRS)
get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE)
if(IS_BUNDLE)
set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
endif(IS_BUNDLE)
elseif(WINDOWS)
SET_TEST_PATH(SEARCH_DIRS)
LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32")
elseif(LINUX)
SET_TEST_PATH(SEARCH_DIRS)
set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
endif(DARWIN)
# It's not clear that this does anything useful for us on Darwin. It has
# been broken for some time now; the BIN_NAME was being constructed as a
# ridiculous nonexistent path with duplicated segments. Fixing that only
# produces ominous spammy warnings: at the time the command below is run, we
# have not yet populated the nested mac-crash-logger.app/Contents/Resources
# with the .dylibs with which it was linked. Moreover, the form of the
# embedded @executable_path/../Resources/mumble.dylib pathname confuses the
# GetPrerequisites.cmake tool invoked by DeploySharedLibs.cmake. It seems
# clear that we have long since accomplished by other means what this was
# originally supposed to do. Skipping it only eliminates an annoying
# non-fatal error.
if(NOT DARWIN)
if(WINDOWS)
SET_TEST_PATH(SEARCH_DIRS)
LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32")
elseif(LINUX)
SET_TEST_PATH(SEARCH_DIRS)
set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
endif(WINDOWS)
add_custom_command(
TARGET ${target_exe} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
"-DBIN_NAME=\"$<TARGET_FILE:${target_exe}>\""
"-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
"-DDST_PATH=\"${OUTPUT_PATH}\""
"-P"
"${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake"
)
add_custom_command(
TARGET ${target_exe} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
"-DBIN_NAME=\"${TARGET_LOCATION}\""
"-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
"-DDST_PATH=\"${OUTPUT_PATH}\""
"-P"
"${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake"
)
endif(NOT DARWIN)
endmacro(ll_deploy_sharedlibs_command)

View File

@@ -1,9 +1,8 @@
# -*- cmake -*-
include(OpenGL)
include(Prebuilt)
if (STANDALONE)
if (LINUX)
include(FindSDL)
# This should be done by FindSDL. Sigh.
@@ -12,14 +11,7 @@ if (STANDALONE)
SDL_INCLUDE_DIR
SDL_LIBRARY
)
else (STANDALONE)
if (LINUX)
use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE)
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
set (SDL_LIBRARY SDL)
endif (LINUX)
endif (STANDALONE)
endif (LINUX)
if (SDL_FOUND)
add_definitions(-DLL_SDL=1)

View File

@@ -0,0 +1,30 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
include(Variables)
if (LIBVLCPLUGIN)
if (USESYSTEMLIBS)
else (USESYSTEMLIBS)
use_prebuilt_binary(vlc-bin)
set(VLC_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/vlc)
endif (USESYSTEMLIBS)
if (WINDOWS)
set(VLC_PLUGIN_LIBRARIES
libvlc.lib
libvlccore.lib
)
elseif (DARWIN)
set(VLC_PLUGIN_LIBRARIES
libvlc.dylib
libvlccore.dylib
)
elseif (LINUX)
# Specify a full path to make sure we get a static link
set(VLC_PLUGIN_LIBRARIES
${LIBS_PREBUILT_DIR}/lib/libvlc.a
${LIBS_PREBUILT_DIR}/lib/libvlccore.a
)
endif (WINDOWS)
endif (LIBVLCPLUGIN)

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,9 +48,11 @@ link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
if (LINUX)
set(DL_LIBRARY dl)
set(RT_LIBRARY rt)
set(PTHREAD_LIBRARY pthread)
else (LINUX)
set(DL_LIBRARY "")
set(RT_LIBRARY "")
set(PTHREAD_LIBRARY "")
endif (LINUX)
@@ -73,6 +75,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 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,4 +1,6 @@
# -*- cmake -*-
include(Variables)
include(Prebuilt)
if (NOT (STANDALONE OR DARWIN))
@@ -8,3 +10,5 @@ if (NOT (STANDALONE OR DARWIN))
${LIBS_PREBUILT_LEGACY_DIR}/include
)
endif (NOT (STANDALONE OR DARWIN))
include(FindOpenGL)

View File

@@ -9,7 +9,7 @@ if (STANDALONE OR USE_SYSTEM_OPENSSL)
else (STANDALONE OR USE_SYSTEM_OPENSSL)
use_prebuilt_binary(openssl)
if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32)
set(OPENSSL_LIBRARIES libssl libcrypto)
else (WINDOWS)
set(OPENSSL_LIBRARIES ssl)
endif (WINDOWS)

View File

@@ -4,7 +4,6 @@ if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(FindAutobuild)
include(Variables)
if(INSTALL_PROPRIETARY)
include(FindSCP)
endif(INSTALL_PROPRIETARY)
@@ -40,14 +39,13 @@ macro (use_prebuilt_binary _binary)
if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(DEBUG_PREBUILT)
message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
message(STATUS "cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
--install-dir=${AUTOBUILD_INSTALL_DIR}
${_binary} ")
endif(DEBUG_PREBUILT)
execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}"
install
--install-dir=${AUTOBUILD_INSTALL_DIR}
-p ${AUTOBUILD_PLATFORM_NAME}
${_binary}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE ${_binary}_installed

View File

@@ -5,25 +5,33 @@ set(PYTHONINTERP_FOUND)
if (WINDOWS)
# On Windows, explicitly avoid Cygwin Python.
find_program(PYTHON_EXECUTABLE
NAMES python25.exe python23.exe python.exe
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
)
if (DEFINED ENV{VIRTUAL_ENV})
find_program(PYTHON_EXECUTABLE
NAMES python.exe
PATHS
"$ENV{VIRTUAL_ENV}\\scripts"
NO_DEFAULT_PATH
)
else()
find_program(PYTHON_EXECUTABLE
NAMES python25.exe python23.exe python.exe
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
)
endif()
elseif (EXISTS /etc/arch-release)
# On Archlinux, use Python 2
elseif (EXISTS /usr/bin/python2)
# if this is there, use it
find_program(PYTHON_EXECUTABLE python2 PATHS /usr/bin)

View File

@@ -1,57 +0,0 @@
# -*- cmake -*-
if(INSTALL_PROPRIETARY OR USE_QUICKTIME_PREBUILT)
include(Prebuilt)
if (WINDOWS)
use_prebuilt_binary(quicktime)
endif (WINDOWS)
endif(INSTALL_PROPRIETARY OR USE_QUICKTIME_PREBUILT)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(QUICKTIME_LIBRARY QuickTime)
elseif (WINDOWS AND WORD_SIZE EQUAL 32)
SET(program_files "ProgramFiles(x86)")
SET(program_files $ENV{${program_files}})
if(NOT program_files)
SET(program_files $ENV{ProgramW6432})
endif(NOT program_files)
if(NOT program_files)
SET(program_files $ENV{ProgramFiles})
endif(NOT program_files)
set(QUICKTIME_SDK_DIR "${program_files}/QuickTime SDK"
CACHE PATH "Location of the QuickTime SDK.")
find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient
PATHS
${ARCH_PREBUILT_DIRS_DEBUG}
"${QUICKTIME_SDK_DIR}\\libraries"
)
find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient
PATHS
${ARCH_PREBUILT_DIRS_RELEASE}
"${QUICKTIME_SDK_DIR}\\libraries"
)
if (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
set(QUICKTIME_LIBRARY
optimized ${RELEASE_QUICKTIME_LIBRARY}
debug ${DEBUG_QUICKTIME_LIBRARY}
)
endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
include_directories(
${LIBS_PREBUILT_DIR}/include/quicktime
"${QUICKTIME_SDK_DIR}\\CIncludes"
)
endif (DARWIN)
mark_as_advanced(QUICKTIME_LIBRARY)
if (QUICKTIME_LIBRARY)
set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.")
endif (QUICKTIME_LIBRARY)

View File

@@ -1,20 +0,0 @@
#This cmake script is meant to be run as a build time custom command.
#The script is run using cmake w/ the -P option.
# parameters are passed to this scripts execution with the -D option.
# A full command line would look like this:
# cmake -D LD_LIBRARY_PATH=~/checkout/libraries -D TEST_CMD=./llunit_test -D ARGS=--touch=llunit_test_ok.txt -P RunBuildTest.cmake
# Parameters:
# LD_LIBRARY_PATH: string, What to set the LD_LIBRARY_PATH env var.
# TEST_CMD: string list, command to run the unit test with, followed by its args.
set(ENV{LD_LIBRARY_PATH} ${LD_LIBRARY_PATH})
#message("Running: ${TEST_CMD}")
execute_process(
COMMAND ${TEST_CMD}
RESULT_VARIABLE RES
)
if(NOT ${RES} STREQUAL 0)
message(STATUS "Failure running: ${TEST_CMD}")
message(FATAL_ERROR "Error: ${RES}")
endif(NOT ${RES} STREQUAL 0)

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

@@ -0,0 +1,20 @@
# -*- cmake -*-
set(URIPARSER_FIND_QUIETLY ON)
set(URIPARSER_FIND_REQUIRED ON)
include(Prebuilt)
if (USESYSTEMLIBS)
include(FindURIPARSER)
else (USESYSTEMLIBS)
use_prebuilt_binary(uriparser)
if (WINDOWS)
set(URIPARSER_LIBRARY
debug uriparserd
optimized uriparser)
elseif (DARWIN OR LINUX)
set(URIPARSER_LIBRARY uriparser)
endif (WINDOWS)
set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser)
endif (USESYSTEMLIBS)

View File

@@ -9,9 +9,7 @@
# LINUX - Linux
# WINDOWS - Windows
# Relative and absolute paths to subtrees.
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
@@ -19,21 +17,73 @@ 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)
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
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 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")
# Mallocs
set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)")
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
option(INCREMENTAL_LINK "Use incremental linking or incremental LTCG for LTO on win32 builds (enable for faster links on some machines)" OFF)
option(USE_LTO "Enable Whole Program Optimization and related folding and binary reduction routines" OFF)
# Audio Engines
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)
@@ -60,67 +110,60 @@ 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 "http://bitbucket.org/lindenlab/master-message-template/raw/tip/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
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(WINDOWS ON BOOL FORCE)
if (WORD_SIZE EQUAL 64)
set(ARCH x86_64 CACHE STRING "Viewer Architecture")
set(LL_ARCH ${ARCH}_win64)
set(LL_ARCH_DIR ${ARCH}-win64)
set(WORD_SIZE 64)
set(AUTOBUILD_PLATFORM_NAME "windows64")
else (WORD_SIZE EQUAL 64)
set(ARCH i686 CACHE STRING "Viewer Architecture")
set(LL_ARCH ${ARCH}_win32)
set(LL_ARCH_DIR ${ARCH}-win32)
set(WORD_SIZE 32)
set(AUTOBUILD_PLATFORM_NAME "windows")
endif (WORD_SIZE EQUAL 64)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON BOOl FORCE)
# If someone has specified a word size, use that to determine the
# architecture. Otherwise, let the architecture specify the word size.
if (WORD_SIZE EQUAL 32)
#message(STATUS "WORD_SIZE is 32")
set(ARCH i686)
set(AUTOBUILD_PLATFORM_NAME "linux")
elseif (WORD_SIZE EQUAL 64)
#message(STATUS "WORD_SIZE is 64")
set(ARCH x86_64)
set(AUTOBUILD_PLATFORM_NAME "linux64")
else (WORD_SIZE EQUAL 32)
#message(STATUS "WORD_SIZE is UNDEFINED")
# If someone has specified an address size, use that to determine the
# architecture. Otherwise, let the architecture specify the address size.
if (ADDRESS_SIZE EQUAL 32)
#message(STATUS "ADDRESS_SIZE is 32")
set(ARCH i686)
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 UNDEFINED")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Size of void pointer is detected as 8; ARCH is 64-bit")
set(WORD_SIZE 64)
set(AUTOBUILD_PLATFORM_NAME "linux64")
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(WORD_SIZE 32)
set(AUTOBUILD_PLATFORM_NAME "linux")
set(ADDRESS_SIZE 32)
set(ARCH i686)
else()
message(FATAL_ERROR "Unkown Architecture!")
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
endif (WORD_SIZE EQUAL 32)
endif()
endif (ADDRESS_SIZE EQUAL 32)
if (NOT STANDALONE AND MULTIARCH_HACK)
if (WORD_SIZE EQUAL 32)
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)
else()
message(FATAL_ERROR "Unkown Architecture!")
endif ()
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON BOOL FORCE)
if (ADDRESS_SIZE EQUAL 32)
set(DEB_ARCHITECTURE i386)
set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib32 ${CMAKE_SYSTEM_LIBRARY_PATH})
else (WORD_SIZE EQUAL 32)
else (ADDRESS_SIZE EQUAL 32)
set(DEB_ARCHITECTURE amd64)
set(FIND_LIBRARY_USE_LIB64_PATHS ON)
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
RESULT_VARIABLE DPKG_RESULT
@@ -133,70 +176,108 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif (DPKG_RESULT EQUAL 0)
include(ConfigurePkgConfig)
endif (NOT STANDALONE AND MULTIARCH_HACK)
set(LL_ARCH ${ARCH}_linux)
set(LL_ARCH_DIR ${ARCH}-linux)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
set(DARWIN ON BOOL FORCE)
execute_process(
COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2"
OUTPUT_VARIABLE XCODE_VERSION )
string(REGEX REPLACE "(\r?\n)+$" "" XCODE_VERSION "${XCODE_VERSION}")
# Architecture
set(CMAKE_OSX_SYSROOT macosx10.14)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS "x86_64")
# Hardcode SDK we build against until we can test and allow newer ones
# as autodetected in the code above
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
set(CMAKE_OSX_SYSROOT macosx10.6)
# Build Options
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Debug] "dwarf")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Release] "dwarf-with-dsym")
# Support for Unix Makefiles generator
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
execute_process(COMMAND xcodebuild -version -sdk "${CMAKE_OSX_SYSROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT)
string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
endif (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
# LLVM-GCC has been removed in Xcode5
if (XCODE_VERSION GREATER 4.9)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
else (XCODE_VERSION GREATER 4.9)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
endif (XCODE_VERSION GREATER 4.9)
# Deployment
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
# Linking
set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES)
message(STATUS "Xcode version: ${XCODE_VERSION}")
message(STATUS "OSX sysroot: ${CMAKE_OSX_SYSROOT}")
message(STATUS "OSX deployment target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
# Build only for i386 by default, system default on MacOSX 10.6 is x86_64
set(CMAKE_OSX_ARCHITECTURES i386)
set(ARCH i386)
set(WORD_SIZE 32)
set(AUTOBUILD_PLATFORM_NAME "darwin")
# Apple Clang - Code Gen
set(CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Release] YES)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS sse4.1)
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL[variant=Debug] 0)
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL[variant=Release] 3)
set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO)
# Apple Clang - Custom Compiler Flags
set(CMAKE_XCODE_ATTRIBUTE_WARNING_CFLAGS "-Wall -Wextra -Wno-reorder -Wno-sign-compare -Wno-ignored-qualifiers -Wno-unused-local-typedef -Wno-unused-parameter")
# Apple Clang - Language - C++
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD c++14)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
# Apple Clang - Warning Policies
set(CMAKE_XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS YES)
set(LL_ARCH ${ARCH}_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_CHANNEL "Singularity Test" CACHE STRING "Viewer Channel Name")
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()
string(REPLACE " " "" VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL})
set(VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL_NOSPACE} CACHE STRING "Prefix used for resulting artifacts.")
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()
set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
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.")
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_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") # "β"
else()
set(VIEWER_CHANNEL_GRK "")
endif ()
endif (NOT VIEWER_CHANNEL_GRK)
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")
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")
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)
@@ -15,3 +12,10 @@ else (NOT STANDALONE)
endif(LINUX AND ${ARCH} STREQUAL "x86_64")
set(STANDALONE ON)
endif(NOT STANDALONE)
if(LINUX)
include(FindPkgConfig)
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
endif(LINUX)
use_prebuilt_binary(fonts)

View File

@@ -0,0 +1,340 @@
#!/usr/bin/env python2
"""\
@file run_build_test.py
@author Nat Goodspeed
@date 2009-09-03
@brief Helper script to allow CMake to run some command after setting
environment variables.
CMake has commands to run an external program. But remember that each CMake
command must be backed by multiple build-system implementations. Unfortunately
it seems CMake can't promise that every target build system can set specified
environment variables before running the external program of interest.
This helper script is a workaround. It simply sets the requested environment
variables and then executes the program specified on the rest of its command
line.
Example:
python run_build_test.py -DFOO=bar myprog somearg otherarg
sets environment variable FOO=bar, then runs:
myprog somearg otherarg
$LicenseInfo:firstyear=2009&license=viewerlgpl$
Second Life Viewer Source Code
Copyright (C) 2009-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$
"""
import os
import sys
import errno
import HTMLParser
import re
import signal
import subprocess
import logging
def main(command, arguments=[], libpath=[], vars={}):
"""Pass:
command is the command to be executed
argument is a sequence (e.g. a list) of strings to be passed to command
libpath is a sequence of directory pathnames. These will be appended to
the platform-specific dynamic library search path environment variable.
vars is a dict of arbitrary (var, value) pairs to be added to the
environment before running 'command'.
This function runs the specified command, waits for it to terminate and
returns its return code. This will be negative if the command terminated
with a signal, else it will be the process's specified exit code.
"""
# Handle platform-dependent libpath first.
if sys.platform == "win32":
lpvars = ["PATH"]
elif sys.platform == "darwin":
lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"]
elif sys.platform.startswith("linux"):
lpvars = ["LD_LIBRARY_PATH"]
else:
# No idea what the right pathname might be! But only crump if this
# feature is requested.
if libpath:
raise RuntimeError("run_build_test: unknown platform %s" % sys.platform)
lpvars = []
for var in lpvars:
# Split the existing path. Bear in mind that the variable in question
# might not exist; instead of KeyError, just use an empty string.
dirs = os.environ.get(var, "").split(os.pathsep)
# Append the sequence in libpath
log.info("%s += %r" % (var, libpath))
for dir in libpath:
# append system paths at the end
if dir in ('/lib', '/usr/lib'):
dirs.append(dir)
# prepend non-system paths
else:
dirs.insert(0, dir)
# Filter out some useless pieces
clean_dirs = []
for dir in dirs:
if dir and dir not in ('', '.'):
clean_dirs.append(dir)
# Now rebuild the path string. This way we use a minimum of separators
# -- and we avoid adding a pointless separator when libpath is empty.
os.environ[var] = os.pathsep.join(clean_dirs)
log.info("%s = %r" % (var, os.environ[var]))
# Now handle arbitrary environment variables. The tricky part is ensuring
# that all the keys and values we try to pass are actually strings.
if vars:
log.info("Setting: %s" % ("\n".join(["%s=%s" % (key, value) for key, value in vars.iteritems()])))
os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()]))
# Run the child process.
command_list = [command]
command_list.extend(arguments)
log.info("Running: %s" % " ".join(command_list))
# Make sure we see all relevant output *before* child-process output.
sys.stdout.flush()
try:
return subprocess.call(command_list)
except OSError as err:
# If the caller is trying to execute a test program that doesn't
# exist, we want to produce a reasonable error message rather than a
# traceback. This happens when the build is halted by errors, but
# CMake tries to proceed with testing anyway <eyeroll/>. However, do
# NOT attempt to handle any error but "doesn't exist."
if err.errno != errno.ENOENT:
raise
# In practice, the pathnames into CMake's build tree are so long as to
# obscure the name of the test program. Just log its basename.
log.warn("No such program %s; check for preceding build errors" % \
os.path.basename(command[0]))
# What rc should we simulate for missing executable? Windows produces
# 9009.
return 9009
# swiped from vita, sigh, seems like a Bad Idea to introduce dependency
def translate_rc(rc):
"""
Accept an rc encoded as for subprocess.Popen.returncode:
None means still running
int >= 0 means terminated voluntarily with specified rc
int < 0 means terminated by signal (-rc)
Return a string explaining the outcome. In case of a signal, try to
name the corresponding symbol from the 'signal' module.
"""
if rc is None:
return "still running"
if rc >= 0:
return "terminated with rc %s" % rc
if sys.platform.startswith("win"):
# From http://stackoverflow.com/questions/20629027/process-finished-with-exit-code-1073741571
# [-1073741571] is the signed integer representation of Microsoft's
# "stack overflow/stack exhaustion" error code 0xC00000FD.
# Anytime you see strange, large negative exit codes in windows, convert
# them to hex and then look them up in the ntstatus error codes
# http://msdn.microsoft.com/en-us/library/cc704588.aspx
# Python bends over backwards to give you all the integer precision
# you need, avoiding truncation. But only with 32-bit signed ints is
# -1073741571 equivalent to 0xC00000FD! Explicitly truncate before
# converting.
hexrc = "0x%X" % (rc & 0xFFFFFFFF)
# At this point, we're only trying to format the rc to make it easier
# for a human being to understand. Any exception here -- file doesn't
# exist, HTML parsing error, unrecognized table structure, unknown key
# -- should NOT kill the script! It should only cause us to shrug and
# present our caller with the best information available.
try:
table = get_windows_table()
symbol, desc = table[hexrc]
except Exception, err:
log.error("(%s -- carrying on)" % err)
log.error("terminated with rc %s (%s)" % (rc, hexrc))
else:
log.info("terminated with rc %s: %s: %s" % (hexrc, symbol, desc))
else:
# On Posix, negative rc means the child was terminated by signal -rc.
rc = -rc
for attr in dir(signal):
if attr.startswith('SIG') and getattr(signal, attr) == rc:
strc = attr
break
else:
strc = str(rc)
return "terminated by signal %s" % strc
class TableParser(HTMLParser.HTMLParser):
"""
This HTMLParser subclass is designed to parse the table we know exists
in windows-rcs.html, hopefully without building in too much knowledge of
the specific way that table is currently formatted.
"""
# regular expression matching any string containing only whitespace
whitespace = re.compile(r'\s*$')
def __init__(self):
# Because Python 2.x's HTMLParser is an old-style class, we must use
# old-style syntax to forward the __init__() call -- not super().
HTMLParser.HTMLParser.__init__(self)
# this will collect all the data, eventually
self.table = []
# Stack whose top (last item) indicates where to append current
# element data. When empty, don't collect data at all.
self.dest = []
def handle_starttag(self, tag, attrs):
if tag == "table":
# This is the outermost tag we recognize. Collect nested elements
# within self.table.
self.dest.append(self.table)
elif tag in ("tr", "td"):
# Nested elements whose contents we want to capture as sublists.
# To the list currently designated by the top of the dest stack,
# append a new empty sublist.
self.dest[-1].append([])
# Now push THAT new, empty list as the new top of the dest stack.
self.dest.append(self.dest[-1][-1])
elif tag == "p":
# We could handle <p> ... </p> just like <tr> or <td>, but that
# introduces an unnecessary extra level of nesting. Just skip.
pass
else:
# For any tag we don't recognize (notably <th>), push a new, empty
# list to the top of the dest stack. This new list is NOT
# referenced by anything in self.table; thus, when we pop it, any
# data we've collected inside that list will be discarded.
self.dest.append([])
def handle_endtag(self, tag):
# Because we avoid pushing self.dest for <p> in handle_starttag(), we
# must refrain from popping it for </p> here.
if tag != "p":
# For everything else, including unrecognized tags, pop the dest
# stack, reverting to outer collection.
self.dest.pop()
def handle_startendtag(self, tag, attrs):
# The table of interest contains <td> entries of the form:
# <p>0x00000000<br />STATUS_SUCCESS</p>
# The <br/> is very useful -- we definitely want two different data
# items for "0x00000000" and "STATUS_SUCCESS" -- but we don't need or
# want it to push, then discard, an empty list as it would if we let
# the default HTMLParser.handle_startendtag() call handle_starttag()
# followed by handle_endtag(). Just ignore <br/> or any other
# singleton tag.
pass
def handle_data(self, data):
# Outside the <table> of interest, self.dest is empty. Do not bother
# collecting data when self.dest is empty.
# HTMLParser calls handle_data() with every chunk of whitespace
# between tags. That would be lovely if our eventual goal was to
# reconstitute the original input stream with its existing formatting,
# but for us, whitespace only clutters the table. Ignore it.
if self.dest and not self.whitespace.match(data):
# Here we're within our <table> and we have non-whitespace data.
# Append it to the list designated by the top of the dest stack.
self.dest[-1].append(data)
# cache for get_windows_table()
_windows_table = None
def get_windows_table():
global _windows_table
# If we already loaded _windows_table, no need to load it all over again.
if _windows_table:
return _windows_table
# windows-rcs.html was fetched on 2015-03-24 with the following command:
# curl -o windows-rcs.html \
# https://msdn.microsoft.com/en-us/library/cc704588.aspx
parser = TableParser()
with open(os.path.join(os.path.dirname(__file__), "windows-rcs.html")) as hf:
# We tried feeding the file data to TableParser in chunks, to avoid
# buffering the entire file as a single string. Unfortunately its
# handle_data() cannot tell the difference between distinct calls
# separated by HTML tags, and distinct calls necessitated by a chunk
# boundary. Sigh! Read in the whole file. At the time this was
# written, it was only 500KB anyway.
parser.feed(hf.read())
parser.close()
table = parser.table
# With our parser, any <tr><th>...</th></tr> row leaves a table entry
# consisting only of an empty list. Remove any such.
while table and not table[0]:
table.pop(0)
# We expect rows of the form:
# [['0x00000000', 'STATUS_SUCCESS'],
# ['The operation completed successfully.']]
# The latter list will have multiple entries if Microsoft embedded <br/>
# or <p> ... </p> in the text, in which case joining with '\n' is
# appropriate.
# Turn that into a dict whose key is the hex string, and whose value is
# the pair (symbol, desc).
_windows_table = dict((key, (symbol, '\n'.join(desc)))
for (key, symbol), desc in table)
return _windows_table
log=logging.getLogger(__name__)
logging.basicConfig()
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--debug", dest="loglevel", action="store_const",
const=logging.DEBUG, default=logging.INFO)
parser.add_argument("-D", "--define", dest="vars", default=[], action="append",
metavar="VAR=value",
help="Add VAR=value to the env variables defined")
parser.add_argument("-l", "--libpath", dest="libpath", default=[], action="append",
metavar="DIR",
help="Add DIR to the platform-dependent DLL search path")
parser.add_argument("command")
parser.add_argument('args', nargs=argparse.REMAINDER)
args = parser.parse_args()
log.setLevel(args.loglevel)
# What we have in opts.vars is a list of strings of the form "VAR=value"
# or possibly just "VAR". What we want is a dict. We can build that dict by
# constructing a list of ["VAR", "value"] pairs -- so split each
# "VAR=value" string on the '=' sign (but only once, in case we have
# "VAR=some=user=string"). To handle the case of just "VAR", append "" to
# the list returned by split(), then slice off anything after the pair we
# want.
rc = main(command=args.command, arguments=args.args, libpath=args.libpath,
vars=dict([(pair.split('=', 1) + [""])[:2] for pair in args.vars]))
if rc not in (None, 0):
log.error("Failure running: %s" % " ".join([args.command] + args.args))
log.error("Error %s: %s" % (rc, translate_rc(rc)))
sys.exit((rc < 0) and 255 or rc)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""\
@file start-client.py

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
GIT_SHALLOW TRUE
)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 8d78045e7cb44d39ad4cd95dd27816b8749e1944
)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.7.3
GIT_SHALLOW TRUE
)
FetchContent_Declare(
absl
GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
GIT_TAG 768eb2ca2857342673fcd462792ce04b8bac3fa3
)
# 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
FetchContent_MakeAvailable(fmt)
# 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

@@ -1,27 +0,0 @@
"""\
@file __init__.py
@brief Initialization file for the indra.base module.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""

View File

@@ -1,73 +0,0 @@
#!/usr/bin/python
##
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
from indra.base import llsd, lluuid
from datetime import datetime
import cllsd
import time, sys
class myint(int):
pass
values = (
'&<>',
u'\u81acj',
llsd.uri('http://foo<'),
lluuid.UUID(),
llsd.LLSD(['thing']),
1,
myint(31337),
sys.maxint + 10,
llsd.binary('foo'),
[],
{},
{u'f&\u1212': 3},
3.1,
True,
None,
datetime.fromtimestamp(time.time()),
)
def valuator(values):
for v in values:
yield v
longvalues = () # (values, list(values), iter(values), valuator(values))
for v in values + longvalues:
print '%r => %r' % (v, cllsd.llsd_to_xml(v))
a = [[{'a':3}]] * 1000000
s = time.time()
print hash(cllsd.llsd_to_xml(a))
e = time.time()
t1 = e - s
print t1
s = time.time()
print hash(llsd.LLSDXMLFormatter()._format(a))
e = time.time()
t2 = e - s
print t2
print 'Speedup:', t2 / t1

View File

@@ -1,266 +0,0 @@
"""\
@file config.py
@brief Utility module for parsing and accessing the indra.xml config file.
$LicenseInfo:firstyear=2006&license=mit$
Copyright (c) 2006-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import copy
import errno
import os
import traceback
import time
import types
from os.path import dirname, getmtime, join, realpath
from indra.base import llsd
_g_config = None
class IndraConfig(object):
"""
IndraConfig loads a 'indra' xml configuration file
and loads into memory. This representation in memory
can get updated to overwrite values or add new values.
The xml configuration file is considered a live file and changes
to the file are checked and reloaded periodically. If a value had
been overwritten via the update or set method, the loaded values
from the file are ignored (the values from the update/set methods
override)
"""
def __init__(self, indra_config_file):
self._indra_config_file = indra_config_file
self._reload_check_interval = 30 # seconds
self._last_check_time = 0
self._last_mod_time = 0
self._config_overrides = {}
self._config_file_dict = {}
self._combined_dict = {}
self._load()
def _load(self):
# if you initialize the IndraConfig with None, no attempt
# is made to load any files
if self._indra_config_file is None:
return
config_file = open(self._indra_config_file)
self._config_file_dict = llsd.parse(config_file.read())
self._combine_dictionaries()
config_file.close()
self._last_mod_time = self._get_last_modified_time()
self._last_check_time = time.time() # now
def _get_last_modified_time(self):
"""
Returns the mtime (last modified time) of the config file,
if such exists.
"""
if self._indra_config_file is not None:
return os.path.getmtime(self._indra_config_file)
return 0
def _combine_dictionaries(self):
self._combined_dict = {}
self._combined_dict.update(self._config_file_dict)
self._combined_dict.update(self._config_overrides)
def _reload_if_necessary(self):
now = time.time()
if (now - self._last_check_time) > self._reload_check_interval:
self._last_check_time = now
try:
modtime = self._get_last_modified_time()
if modtime > self._last_mod_time:
self._load()
except OSError, e:
if e.errno == errno.ENOENT: # file not found
# someone messed with our internal state
# or removed the file
print 'WARNING: Configuration file has been removed ' + (self._indra_config_file)
print 'Disabling reloading of configuration file.'
traceback.print_exc()
self._indra_config_file = None
self._last_check_time = 0
self._last_mod_time = 0
else:
raise # pass the exception along to the caller
def __getitem__(self, key):
self._reload_if_necessary()
return self._combined_dict[key]
def get(self, key, default = None):
try:
return self.__getitem__(key)
except KeyError:
return default
def __setitem__(self, key, value):
"""
Sets the value of the config setting of key to be newval
Once any key/value pair is changed via the set method,
that key/value pair will remain set with that value until
change via the update or set method
"""
self._config_overrides[key] = value
self._combine_dictionaries()
def set(self, key, newval):
return self.__setitem__(key, newval)
def update(self, new_conf):
"""
Load an XML file and apply its map as overrides or additions
to the existing config. Update can be a file or a dict.
Once any key/value pair is changed via the update method,
that key/value pair will remain set with that value until
change via the update or set method
"""
if isinstance(new_conf, dict):
overrides = new_conf
else:
# assuming that it is a filename
config_file = open(new_conf)
overrides = llsd.parse(config_file.read())
config_file.close()
self._config_overrides.update(overrides)
self._combine_dictionaries()
def as_dict(self):
"""
Returns immutable copy of the IndraConfig as a dictionary
"""
return copy.deepcopy(self._combined_dict)
def load(config_xml_file = None):
global _g_config
load_default_files = config_xml_file is None
if load_default_files:
## going from:
## "/opt/linden/indra/lib/python/indra/base/config.py"
## to:
## "/opt/linden/etc/indra.xml"
config_xml_file = realpath(
dirname(realpath(__file__)) + "../../../../../../etc/indra.xml")
try:
_g_config = IndraConfig(config_xml_file)
except IOError:
# Failure to load passed in file
# or indra.xml default file
if load_default_files:
try:
config_xml_file = realpath(
dirname(realpath(__file__)) + "../../../../../../etc/globals.xml")
_g_config = IndraConfig(config_xml_file)
return
except IOError:
# Failure to load globals.xml
# fall to code below
pass
# Either failed to load passed in file
# or failed to load all default files
_g_config = IndraConfig(None)
def dump(indra_xml_file, indra_cfg = None, update_in_mem=False):
'''
Dump config contents into a file
Kindof reverse of load.
Optionally takes a new config to dump.
Does NOT update global config unless requested.
'''
global _g_config
if not indra_cfg:
if _g_config is None:
return
indra_cfg = _g_config.as_dict()
if not indra_cfg:
return
config_file = open(indra_xml_file, 'w')
_config_xml = llsd.format_xml(indra_cfg)
config_file.write(_config_xml)
config_file.close()
if update_in_mem:
update(indra_cfg)
def update(new_conf):
global _g_config
if _g_config is None:
# To keep with how this function behaved
# previously, a call to update
# before the global is defined
# make a new global config which does not
# load data from a file.
_g_config = IndraConfig(None)
return _g_config.update(new_conf)
def get(key, default = None):
global _g_config
if _g_config is None:
load()
return _g_config.get(key, default)
def set(key, newval):
"""
Sets the value of the config setting of key to be newval
Once any key/value pair is changed via the set method,
that key/value pair will remain set with that value until
change via the update or set method or program termination
"""
global _g_config
if _g_config is None:
_g_config = IndraConfig(None)
_g_config.set(key, newval)
def get_config():
global _g_config
return _g_config

File diff suppressed because it is too large Load Diff

View File

@@ -1,319 +0,0 @@
"""\
@file lluuid.py
@brief UUID parser/generator.
$LicenseInfo:firstyear=2004&license=mit$
Copyright (c) 2004-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import random, socket, string, time, re
import uuid
try:
# Python 2.6
from hashlib import md5
except ImportError:
# Python 2.5 and earlier
from md5 import new as md5
def _int2binstr(i,l):
s=''
for a in range(l):
s=chr(i&0xFF)+s
i>>=8
return s
def _binstr2int(s):
i = long(0)
for c in s:
i = (i<<8) + ord(c)
return i
class UUID(object):
"""
A class which represents a 16 byte integer. Stored as a 16 byte 8
bit character string.
The string version is to be of the form:
AAAAAAAA-AAAA-BBBB-BBBB-BBBBBBCCCCCC (a 128-bit number in hex)
where A=network address, B=timestamp, C=random.
"""
NULL_STR = "00000000-0000-0000-0000-000000000000"
# the UUIDREGEX_STRING is helpful for parsing UUID's in text
hex_wildcard = r"[0-9a-fA-F]"
word = hex_wildcard + r"{4,4}-"
long_word = hex_wildcard + r"{8,8}-"
very_long_word = hex_wildcard + r"{12,12}"
UUID_REGEX_STRING = long_word + word + word + word + very_long_word
uuid_regex = re.compile(UUID_REGEX_STRING)
rand = random.Random()
ip = ''
try:
ip = socket.gethostbyname(socket.gethostname())
except(socket.gaierror, socket.error):
# no ip address, so just default to somewhere in 10.x.x.x
ip = '10'
for i in range(3):
ip += '.' + str(rand.randrange(1,254))
hexip = ''.join(["%04x" % long(i) for i in ip.split('.')])
lastid = ''
def __init__(self, possible_uuid=None):
"""
Initialize to first valid UUID in argument (if a string),
or to null UUID if none found or argument is not supplied.
If the argument is a UUID, the constructed object will be a copy of it.
"""
self._bits = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
if possible_uuid is None:
return
if isinstance(possible_uuid, type(self)):
self.set(possible_uuid)
return
uuid_match = UUID.uuid_regex.search(possible_uuid)
if uuid_match:
uuid_string = uuid_match.group()
s = string.replace(uuid_string, '-', '')
self._bits = _int2binstr(string.atol(s[:8],16),4) + \
_int2binstr(string.atol(s[8:16],16),4) + \
_int2binstr(string.atol(s[16:24],16),4) + \
_int2binstr(string.atol(s[24:],16),4)
def __len__(self):
"""
Used by the len() builtin.
"""
return 36
def __nonzero__(self):
return self._bits != "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
def __str__(self):
uuid_string = self.toString()
return uuid_string
__repr__ = __str__
def __getitem__(self, index):
return str(self)[index]
def __eq__(self, other):
if isinstance(other, (str, unicode)):
return other == str(self)
return self._bits == getattr(other, '_bits', '')
def __ne__(self, other):
return not self.__eq__(other)
def __le__(self, other):
return self._bits <= other._bits
def __ge__(self, other):
return self._bits >= other._bits
def __lt__(self, other):
return self._bits < other._bits
def __gt__(self, other):
return self._bits > other._bits
def __hash__(self):
return hash(self._bits)
def set(self, uuid):
self._bits = uuid._bits
def setFromString(self, uuid_string):
"""
Given a string version of a uuid, set self bits
appropriately. Returns self.
"""
s = string.replace(uuid_string, '-', '')
self._bits = _int2binstr(string.atol(s[:8],16),4) + \
_int2binstr(string.atol(s[8:16],16),4) + \
_int2binstr(string.atol(s[16:24],16),4) + \
_int2binstr(string.atol(s[24:],16),4)
return self
def setFromMemoryDump(self, gdb_string):
"""
We expect to get gdb_string as four hex units. eg:
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
Which will be translated to:
db547d14-1b3f4bc3-9b984f71-d22f890a
Returns self.
"""
s = string.replace(gdb_string, '0x', '')
s = string.replace(s, ' ', '')
t = ''
for i in range(8,40,8):
for j in range(0,8,2):
t = t + s[i-j-2:i-j]
self.setFromString(t)
def toString(self):
"""
Return as a string matching the LL standard
AAAAAAAA-AAAA-BBBB-BBBB-BBBBBBCCCCCC (a 128-bit number in hex)
where A=network address, B=timestamp, C=random.
"""
return uuid_bits_to_string(self._bits)
def getAsString(self):
"""
Return a different string representation of the form
AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex)
where A=network address, B=timestamp, C=random.
"""
i1 = _binstr2int(self._bits[0:4])
i2 = _binstr2int(self._bits[4:8])
i3 = _binstr2int(self._bits[8:12])
i4 = _binstr2int(self._bits[12:16])
return '%08lx-%08lx-%08lx-%08lx' % (i1,i2,i3,i4)
def generate(self):
"""
Generate a new uuid. This algorithm is slightly different
from c++ implementation for portability reasons.
Returns self.
"""
m = md5()
m.update(uuid.uuid1().bytes)
self._bits = m.digest()
return self
def isNull(self):
"""
Returns 1 if the uuid is null - ie, equal to default uuid.
"""
return (self._bits == "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")
def xor(self, rhs):
"""
xors self with rhs.
"""
v1 = _binstr2int(self._bits[0:4]) ^ _binstr2int(rhs._bits[0:4])
v2 = _binstr2int(self._bits[4:8]) ^ _binstr2int(rhs._bits[4:8])
v3 = _binstr2int(self._bits[8:12]) ^ _binstr2int(rhs._bits[8:12])
v4 = _binstr2int(self._bits[12:16]) ^ _binstr2int(rhs._bits[12:16])
self._bits = _int2binstr(v1,4) + \
_int2binstr(v2,4) + \
_int2binstr(v3,4) + \
_int2binstr(v4,4)
# module-level null constant
NULL = UUID()
def printTranslatedMemory(four_hex_uints):
"""
We expect to get the string as four hex units. eg:
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
Which will be translated to:
db547d14-1b3f4bc3-9b984f71-d22f890a
"""
uuid = UUID()
uuid.setFromMemoryDump(four_hex_uints)
print uuid.toString()
def isUUID(id_str):
"""
This function returns:
- 1 if the string passed is a UUID
- 0 is the string passed is not a UUID
- None if it neither of the if's below is satisfied
"""
if not id_str or len(id_str) < 5 or len(id_str) > 36:
return 0
if isinstance(id_str, UUID) or UUID.uuid_regex.match(id_str):
return 1
return None
def isPossiblyID(id_str):
"""
This function returns 1 if the string passed has some uuid-like
characteristics. Otherwise returns 0.
"""
is_uuid = isUUID(id_str)
if is_uuid is not None:
return is_uuid
# build a string which matches every character.
hex_wildcard = r"[0-9a-fA-F]"
chars = len(id_str)
next = min(chars, 8)
matcher = hex_wildcard+"{"+str(next)+","+str(next)+"}"
chars = chars - next
if chars > 0:
matcher = matcher + "-"
chars = chars - 1
for block in range(3):
next = max(min(chars, 4), 0)
if next:
matcher = matcher + hex_wildcard+"{"+str(next)+","+str(next)+"}"
chars = chars - next
if chars > 0:
matcher = matcher + "-"
chars = chars - 1
if chars > 0:
next = min(chars, 12)
matcher = matcher + hex_wildcard+"{"+str(next)+","+str(next)+"}"
#print matcher
uuid_matcher = re.compile(matcher)
if uuid_matcher.match(id_str):
return 1
return 0
def uuid_bits_to_string(bits):
i1 = _binstr2int(bits[0:4])
i2 = _binstr2int(bits[4:6])
i3 = _binstr2int(bits[6:8])
i4 = _binstr2int(bits[8:10])
i5 = _binstr2int(bits[10:12])
i6 = _binstr2int(bits[12:16])
return '%08lx-%04lx-%04lx-%04lx-%04lx%08lx' % (i1,i2,i3,i4,i5,i6)
def uuid_bits_to_uuid(bits):
return UUID(uuid_bits_to_string(bits))
try:
from mulib import stacked
stacked.NoProducer() # just to exercise stacked
except:
#print "Couldn't import mulib.stacked, not registering UUID converter"
pass
else:
def convertUUID(uuid, req):
req.write(str(uuid))
stacked.add_producer(UUID, convertUUID, "*/*")
stacked.add_producer(UUID, convertUUID, "text/html")

View File

@@ -1,121 +0,0 @@
"""\
@file metrics.py
@author Phoenix
@date 2007-11-27
@brief simple interface for logging metrics
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import sys
try:
import syslog
except ImportError:
# Windows
import sys
class syslog(object):
# wrap to a lame syslog for windows
_logfp = sys.stderr
def syslog(msg):
_logfp.write(msg)
if not msg.endswith('\n'):
_logfp.write('\n')
syslog = staticmethod(syslog)
from indra.base.llsd import format_notation
def record_metrics(table, stats):
"Write a standard metrics log"
_log("LLMETRICS", table, stats)
def record_event(table, data):
"Write a standard logmessage log"
_log("LLLOGMESSAGE", table, data)
def set_destination(dest):
"""Set the destination of metrics logs for this process.
If you do not call this function prior to calling a logging
method, that function will open sys.stdout as a destination.
Attempts to set dest to None will throw a RuntimeError.
@param dest a file-like object which will be the destination for logs."""
if dest is None:
raise RuntimeError("Attempt to unset metrics destination.")
global _destination
_destination = dest
def destination():
"""Get the destination of the metrics logs for this process.
Returns None if no destination is set"""
global _destination
return _destination
class SysLogger(object):
"A file-like object which writes to syslog."
def __init__(self, ident='indra', logopt = None, facility = None):
try:
if logopt is None:
logopt = syslog.LOG_CONS | syslog.LOG_PID
if facility is None:
facility = syslog.LOG_LOCAL0
syslog.openlog(ident, logopt, facility)
import atexit
atexit.register(syslog.closelog)
except AttributeError:
# No syslog module on Windows
pass
def write(str):
syslog.syslog(str)
write = staticmethod(write)
def flush():
pass
flush = staticmethod(flush)
#
# internal API
#
_sequence_id = 0
_destination = None
def _next_id():
global _sequence_id
next = _sequence_id
_sequence_id += 1
return next
def _dest():
global _destination
if _destination is None:
# this default behavior is documented in the metrics functions above.
_destination = sys.stdout
return _destination
def _log(header, table, data):
log_line = "%s (%d) %s %s" \
% (header, _next_id(), table, format_notation(data))
dest = _dest()
dest.write(log_line)
dest.flush()

View File

@@ -1,30 +0,0 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
import warnings
warnings.warn("indra.ipc.httputil has been deprecated; use eventlet.httpc instead", DeprecationWarning, 2)
from eventlet.httpc import *
makeConnection = make_connection

View File

@@ -1,100 +0,0 @@
"""\
@file llsdhttp.py
@brief Functions to ease moving llsd over http
$LicenseInfo:firstyear=2006&license=mit$
Copyright (c) 2006-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import os.path
import os
import urlparse
from indra.base import llsd
from eventlet import httpc
suite = httpc.HttpSuite(llsd.format_xml, llsd.parse, 'application/llsd+xml')
delete = suite.delete
delete_ = suite.delete_
get = suite.get
get_ = suite.get_
head = suite.head
head_ = suite.head_
post = suite.post
post_ = suite.post_
put = suite.put
put_ = suite.put_
request = suite.request
request_ = suite.request_
# import every httpc error exception into our namespace for convenience
for x in httpc.status_to_error_map.itervalues():
globals()[x.__name__] = x
ConnectionError = httpc.ConnectionError
Retriable = httpc.Retriable
for x in (httpc.ConnectionError,):
globals()[x.__name__] = x
def postFile(url, filename):
f = open(filename)
body = f.read()
f.close()
llsd_body = llsd.parse(body)
return post_(url, llsd_body)
# deprecated in favor of get_
def getStatus(url, use_proxy=False):
status, _headers, _body = get_(url, use_proxy=use_proxy)
return status
# deprecated in favor of put_
def putStatus(url, data):
status, _headers, _body = put_(url, data)
return status
# deprecated in favor of delete_
def deleteStatus(url):
status, _headers, _body = delete_(url)
return status
# deprecated in favor of post_
def postStatus(url, data):
status, _headers, _body = post_(url, data)
return status
def postFileStatus(url, filename):
status, _headers, body = postFile(url, filename)
return status, body
def getFromSimulator(path, use_proxy=False):
return get('http://' + simulatorHostAndPort + path, use_proxy=use_proxy)
def postToSimulator(path, data=None):
return post('http://' + simulatorHostAndPort + path, data)

View File

@@ -1,81 +0,0 @@
"""\
@file mysql_pool.py
@brief Thin wrapper around eventlet.db_pool that chooses MySQLdb and Tpool.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import MySQLdb
from eventlet import db_pool
class DatabaseConnector(db_pool.DatabaseConnector):
def __init__(self, credentials, *args, **kwargs):
super(DatabaseConnector, self).__init__(MySQLdb, credentials,
conn_pool=db_pool.ConnectionPool,
*args, **kwargs)
# get is extended relative to eventlet.db_pool to accept a port argument
def get(self, host, dbname, port=3306):
key = (host, dbname, port)
if key not in self._databases:
new_kwargs = self._kwargs.copy()
new_kwargs['db'] = dbname
new_kwargs['host'] = host
new_kwargs['port'] = port
new_kwargs.update(self.credentials_for(host))
dbpool = ConnectionPool(*self._args, **new_kwargs)
self._databases[key] = dbpool
return self._databases[key]
class ConnectionPool(db_pool.TpooledConnectionPool):
"""A pool which gives out saranwrapped MySQLdb connections from a pool
"""
def __init__(self, *args, **kwargs):
super(ConnectionPool, self).__init__(MySQLdb, *args, **kwargs)
def get(self):
conn = super(ConnectionPool, self).get()
# annotate the connection object with the details on the
# connection; this is used elsewhere to check that you haven't
# suddenly changed databases in midstream while making a
# series of queries on a connection.
arg_names = ['host','user','passwd','db','port','unix_socket','conv','connect_timeout',
'compress', 'named_pipe', 'init_command', 'read_default_file', 'read_default_group',
'cursorclass', 'use_unicode', 'charset', 'sql_mode', 'client_flag', 'ssl',
'local_infile']
# you could have constructed this connectionpool with a mix of
# keyword and non-keyword arguments, but we want to annotate
# the connection object with a dict so it's easy to check
# against so here we are converting the list of non-keyword
# arguments (in self._args) into a dict of keyword arguments,
# and merging that with the actual keyword arguments
# (self._kwargs). The arg_names variable lists the
# constructor arguments for MySQLdb Connection objects.
converted_kwargs = dict([ (arg_names[i], arg) for i, arg in enumerate(self._args) ])
converted_kwargs.update(self._kwargs)
conn.connection_parameters = converted_kwargs
return conn

View File

@@ -1,165 +0,0 @@
"""\
@file russ.py
@brief Recursive URL Substitution Syntax helpers
@author Phoenix
Many details on how this should work is available on the wiki:
https://wiki.secondlife.com/wiki/Recursive_URL_Substitution_Syntax
Adding features to this should be reflected in that page in the
implementations section.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import urllib
from indra.ipc import llsdhttp
class UnbalancedBraces(Exception):
pass
class UnknownDirective(Exception):
pass
class BadDirective(Exception):
pass
def format_value_for_path(value):
if type(value) in [list, tuple]:
# *NOTE: treat lists as unquoted path components so that the quoting
# doesn't get out-of-hand. This is a workaround for the fact that
# russ always quotes, even if the data it's given is already quoted,
# and it's not safe to simply unquote a path directly, so if we want
# russ to substitute urls parts inside other url parts we always
# have to do so via lists of unquoted path components.
return '/'.join([urllib.quote(str(item)) for item in value])
else:
return urllib.quote(str(value))
def format(format_str, context):
"""@brief Format format string according to rules for RUSS.
@see https://osiris.lindenlab.com/mediawiki/index.php/Recursive_URL_Substitution_Syntax
@param format_str The input string to format.
@param context A map used for string substitutions.
@return Returns the formatted string. If no match, the braces remain intact.
"""
while True:
#print "format_str:", format_str
all_matches = _find_sub_matches(format_str)
if not all_matches:
break
substitutions = 0
while True:
matches = all_matches.pop()
# we work from right to left to make sure we do not
# invalidate positions earlier in format_str
matches.reverse()
for pos in matches:
# Use index since _find_sub_matches should have raised
# an exception, and failure to find now is an exception.
end = format_str.index('}', pos)
#print "directive:", format_str[pos+1:pos+5]
if format_str[pos + 1] == '$':
value = context[format_str[pos + 2:end]]
if value is not None:
value = format_value_for_path(value)
elif format_str[pos + 1] == '%':
value = _build_query_string(
context.get(format_str[pos + 2:end]))
elif format_str[pos+1:pos+5] == 'http' or format_str[pos+1:pos+5] == 'file':
value = _fetch_url_directive(format_str[pos + 1:end])
else:
raise UnknownDirective, format_str[pos:end + 1]
if value is not None:
format_str = format_str[:pos]+str(value)+format_str[end+1:]
substitutions += 1
# If there were any substitutions at this depth, re-parse
# since this may have revealed new things to substitute
if substitutions:
break
if not all_matches:
break
# If there were no substitutions at all, and we have exhausted
# the possible matches, bail.
if not substitutions:
break
return format_str
def _find_sub_matches(format_str):
"""@brief Find all of the substitution matches.
@param format_str the RUSS conformant format string.
@return Returns an array of depths of arrays of positional matches in input.
"""
depth = 0
matches = []
for pos in range(len(format_str)):
if format_str[pos] == '{':
depth += 1
if not len(matches) == depth:
matches.append([])
matches[depth - 1].append(pos)
continue
if format_str[pos] == '}':
depth -= 1
continue
if not depth == 0:
raise UnbalancedBraces, format_str
return matches
def _build_query_string(query_dict):
"""\
@breif given a dict, return a query string. utility wrapper for urllib.
@param query_dict input query dict
@returns Returns an urlencoded query string including leading '?'.
"""
if query_dict:
keys = query_dict.keys()
keys.sort()
def stringize(value):
if type(value) in (str,unicode):
return value
else:
return str(value)
query_list = [urllib.quote(str(key)) + '=' + urllib.quote(stringize(query_dict[key])) for key in keys]
return '?' + '&'.join(query_list)
else:
return ''
def _fetch_url_directive(directive):
"*FIX: This only supports GET"
commands = directive.split('|')
resource = llsdhttp.get(commands[0])
if len(commands) == 3:
resource = _walk_resource(resource, commands[2])
return resource
def _walk_resource(resource, path):
path = path.split('/')
for child in path:
if not child:
continue
resource = resource[child]
return resource

View File

@@ -1,134 +0,0 @@
"""\
@file servicebuilder.py
@author Phoenix
@brief Class which will generate service urls.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
from indra.base import config
from indra.ipc import llsdhttp
from indra.ipc import russ
# *NOTE: agent presence relies on this variable existing and being current, it is a huge hack
services_config = {}
try:
services_config = llsdhttp.get(config.get('services-config'))
except:
pass
_g_builder = None
def _builder():
global _g_builder
if _g_builder is None:
_g_builder = ServiceBuilder()
return _g_builder
def build(name, context={}, **kwargs):
""" Convenience method for using a global, singleton, service builder. Pass arguments either via a dict or via python keyword arguments, or both!
Example use:
> context = {'channel':'Second Life Release', 'version':'1.18.2.0'}
> servicebuilder.build('version-manager-version', context)
'http://int.util.vaak.lindenlab.com/channel/Second%20Life%20Release/1.18.2.0'
> servicebuilder.build('version-manager-version', channel='Second Life Release', version='1.18.2.0')
'http://int.util.vaak.lindenlab.com/channel/Second%20Life%20Release/1.18.2.0'
> servicebuilder.build('version-manager-version', context, version='1.18.1.2')
'http://int.util.vaak.lindenlab.com/channel/Second%20Life%20Release/1.18.1.2'
"""
global _g_builder
if _g_builder is None:
_g_builder = ServiceBuilder()
return _g_builder.buildServiceURL(name, context, **kwargs)
def build_path(name, context={}, **kwargs):
context = context.copy() # shouldn't modify the caller's dictionary
context.update(kwargs)
return _builder().buildPath(name, context)
class ServiceBuilder(object):
def __init__(self, services_definition = services_config):
"""\
@brief
@brief Create a ServiceBuilder.
@param services_definition Complete services definition, services.xml.
"""
# no need to keep a copy of the services section of the
# complete services definition, but it doesn't hurt much.
self.services = services_definition['services']
self.builders = {}
for service in self.services:
service_builder = service.get('service-builder')
if not service_builder:
continue
if isinstance(service_builder, dict):
# We will be constructing several builders
for name, builder in service_builder.iteritems():
full_builder_name = service['name'] + '-' + name
self.builders[full_builder_name] = builder
else:
self.builders[service['name']] = service_builder
def buildPath(self, name, context):
"""\
@brief given the environment on construction, return a service path.
@param name The name of the service.
@param context A dict of name value lookups for the service.
@returns Returns the
"""
return russ.format(self.builders[name], context)
def buildServiceURL(self, name, context={}, **kwargs):
"""\
@brief given the environment on construction, return a service URL.
@param name The name of the service.
@param context A dict of name value lookups for the service.
@param kwargs Any keyword arguments are treated as members of the
context, this allows you to be all 31337 by writing shit like:
servicebuilder.build('name', param=value)
@returns Returns the
"""
context = context.copy() # shouldn't modify the caller's dictionary
context.update(kwargs)
base_url = config.get('services-base-url')
svc_path = russ.format(self.builders[name], context)
return base_url + svc_path
def on_in(query_name, host_key, schema_key):
"""\
@brief Constructs an on/in snippet (for running named queries)
from a schema name and two keys referencing values stored in
indra.xml.
@param query_name Name of the query.
@param host_key Logical name of destination host. Will be
looked up in indra.xml.
@param schema_key Logical name of destination schema. Will
be looked up in indra.xml.
"""
return "on/config:%s/in/config:%s/%s" % (host_key.strip('/'),
schema_key.strip('/'),
query_name.lstrip('/'))

View File

@@ -1,468 +0,0 @@
"""\
@file siesta.py
@brief A tiny llsd based RESTful web services framework
$LicenseInfo:firstyear=2008&license=mit$
Copyright (c) 2008, Linden Research, Inc.
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.
$/LicenseInfo$
"""
from indra.base import config
from indra.base import llsd
from webob import exc
import webob
import re, socket
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
import cjson
json_decode = cjson.decode
json_encode = cjson.encode
JsonDecodeError = cjson.DecodeError
JsonEncodeError = cjson.EncodeError
except ImportError:
import simplejson
json_decode = simplejson.loads
json_encode = simplejson.dumps
JsonDecodeError = ValueError
JsonEncodeError = TypeError
llsd_parsers = {
'application/json': json_decode,
llsd.BINARY_MIME_TYPE: llsd.parse_binary,
'application/llsd+notation': llsd.parse_notation,
llsd.XML_MIME_TYPE: llsd.parse_xml,
'application/xml': llsd.parse_xml,
}
def mime_type(content_type):
'''Given a Content-Type header, return only the MIME type.'''
return content_type.split(';', 1)[0].strip().lower()
class BodyLLSD(object):
'''Give a webob Request or Response an llsd based "content" property.
Getting the content property parses the body, and caches the result.
Setting the content property formats a payload, and the body property
is set.'''
def _llsd__get(self):
'''Get, set, or delete the LLSD value stored in this object.'''
try:
return self._llsd
except AttributeError:
if not self.body:
raise AttributeError('No llsd attribute has been set')
else:
mtype = mime_type(self.content_type)
try:
parser = llsd_parsers[mtype]
except KeyError:
raise exc.HTTPUnsupportedMediaType(
'Content type %s not supported' % mtype).exception
try:
self._llsd = parser(self.body)
except (llsd.LLSDParseError, JsonDecodeError, TypeError), err:
raise exc.HTTPBadRequest(
'Could not parse body: %r' % err.args).exception
return self._llsd
def _llsd__set(self, val):
req = getattr(self, 'request', None)
if req is not None:
formatter, ctype = formatter_for_request(req)
self.content_type = ctype
else:
formatter, ctype = formatter_for_mime_type(
mime_type(self.content_type))
self.body = formatter(val)
def _llsd__del(self):
if hasattr(self, '_llsd'):
del self._llsd
content = property(_llsd__get, _llsd__set, _llsd__del)
class Response(webob.Response, BodyLLSD):
'''Response class with LLSD support.
A sensible default content type is used.
Setting the llsd property also sets the body. Getting the llsd
property parses the body if necessary.
If you set the body property directly, the llsd property will be
deleted.'''
default_content_type = 'application/llsd+xml'
def _body__set(self, body):
if hasattr(self, '_llsd'):
del self._llsd
super(Response, self)._body__set(body)
def cache_forever(self):
self.cache_expires(86400 * 365)
body = property(webob.Response._body__get, _body__set,
webob.Response._body__del,
webob.Response._body__get.__doc__)
class Request(webob.Request, BodyLLSD):
'''Request class with LLSD support.
Sensible content type and accept headers are used by default.
Setting the content property also sets the body. Getting the content
property parses the body if necessary.
If you set the body property directly, the content property will be
deleted.'''
default_content_type = 'application/llsd+xml'
default_accept = ('application/llsd+xml; q=0.5, '
'application/llsd+notation; q=0.3, '
'application/llsd+binary; q=0.2, '
'application/xml; q=0.1, '
'application/json; q=0.0')
def __init__(self, environ=None, *args, **kwargs):
if environ is None:
environ = {}
else:
environ = environ.copy()
if 'CONTENT_TYPE' not in environ:
environ['CONTENT_TYPE'] = self.default_content_type
if 'HTTP_ACCEPT' not in environ:
environ['HTTP_ACCEPT'] = self.default_accept
super(Request, self).__init__(environ, *args, **kwargs)
def _body__set(self, body):
if hasattr(self, '_llsd'):
del self._llsd
super(Request, self)._body__set(body)
def path_urljoin(self, *parts):
return '/'.join([path_url.rstrip('/')] + list(parts))
body = property(webob.Request._body__get, _body__set,
webob.Request._body__del, webob.Request._body__get.__doc__)
def create_response(self, content=None, status='200 OK',
conditional_response=webob.NoDefault):
resp = self.ResponseClass(status=status, request=self,
conditional_response=conditional_response)
resp.content = content
return resp
def curl(self):
'''Create and fill out a pycurl easy object from this request.'''
import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, self.url())
if self.headers:
c.setopt(pycurl.HTTPHEADER,
['%s: %s' % (k, self.headers[k]) for k in self.headers])
c.setopt(pycurl.FOLLOWLOCATION, True)
c.setopt(pycurl.AUTOREFERER, True)
c.setopt(pycurl.MAXREDIRS, 16)
c.setopt(pycurl.NOSIGNAL, True)
c.setopt(pycurl.READFUNCTION, self.body_file.read)
c.setopt(pycurl.SSL_VERIFYHOST, 2)
if self.method == 'POST':
c.setopt(pycurl.POST, True)
post301 = getattr(pycurl, 'POST301', None)
if post301 is not None:
# Added in libcurl 7.17.1.
c.setopt(post301, True)
elif self.method == 'PUT':
c.setopt(pycurl.PUT, True)
elif self.method != 'GET':
c.setopt(pycurl.CUSTOMREQUEST, self.method)
return c
Request.ResponseClass = Response
Response.RequestClass = Request
llsd_formatters = {
'application/json': json_encode,
'application/llsd+binary': llsd.format_binary,
'application/llsd+notation': llsd.format_notation,
'application/llsd+xml': llsd.format_xml,
'application/xml': llsd.format_xml,
}
formatter_qualities = (
('application/llsd+xml', 1.0),
('application/llsd+notation', 0.5),
('application/llsd+binary', 0.4),
('application/xml', 0.3),
('application/json', 0.2),
)
def formatter_for_mime_type(mime_type):
'''Return a formatter that encodes to the given MIME type.
The result is a pair of function and MIME type.'''
try:
return llsd_formatters[mime_type], mime_type
except KeyError:
raise exc.HTTPInternalServerError(
'Could not use MIME type %r to format response' %
mime_type).exception
def formatter_for_request(req):
'''Return a formatter that encodes to the preferred type of the client.
The result is a pair of function and actual MIME type.'''
ctype = req.accept.best_match(formatter_qualities)
try:
return llsd_formatters[ctype], ctype
except KeyError:
raise exc.HTTPNotAcceptable().exception
def wsgi_adapter(func, environ, start_response):
'''Adapt a Siesta callable to act as a WSGI application.'''
# Process the request as appropriate.
try:
req = Request(environ)
#print req.urlvars
resp = func(req, **req.urlvars)
if not isinstance(resp, webob.Response):
try:
formatter, ctype = formatter_for_request(req)
resp = req.ResponseClass(formatter(resp), content_type=ctype)
resp._llsd = resp
except (JsonEncodeError, TypeError), err:
resp = exc.HTTPInternalServerError(
detail='Could not format response')
except exc.HTTPException, e:
resp = e
except socket.error, e:
resp = exc.HTTPInternalServerError(detail=e.args[1])
return resp(environ, start_response)
def llsd_callable(func):
'''Turn a callable into a Siesta application.'''
def replacement(environ, start_response):
return wsgi_adapter(func, environ, start_response)
return replacement
def llsd_method(http_method, func):
def replacement(environ, start_response):
if environ['REQUEST_METHOD'] == http_method:
return wsgi_adapter(func, environ, start_response)
return exc.HTTPMethodNotAllowed()(environ, start_response)
return replacement
http11_methods = 'OPTIONS GET HEAD POST PUT DELETE TRACE CONNECT'.split()
http11_methods.sort()
def llsd_class(cls):
'''Turn a class into a Siesta application.
A new instance is created for each request. A HTTP method FOO is
turned into a call to the handle_foo method of the instance.'''
def foo(req, **kwargs):
instance = cls()
method = req.method.lower()
try:
handler = getattr(instance, 'handle_' + method)
except AttributeError:
allowed = [m for m in http11_methods
if hasattr(instance, 'handle_' + m.lower())]
raise exc.HTTPMethodNotAllowed(
headers={'Allow': ', '.join(allowed)}).exception
#print "kwargs: ", kwargs
return handler(req, **kwargs)
def replacement(environ, start_response):
return wsgi_adapter(foo, environ, start_response)
return replacement
def curl(reqs):
import pycurl
m = pycurl.CurlMulti()
curls = [r.curl() for r in reqs]
io = {}
for c in curls:
fp = StringIO()
hdr = StringIO()
c.setopt(pycurl.WRITEFUNCTION, fp.write)
c.setopt(pycurl.HEADERFUNCTION, hdr.write)
io[id(c)] = fp, hdr
m.handles = curls
try:
while True:
ret, num_handles = m.perform()
if ret != pycurl.E_CALL_MULTI_PERFORM:
break
finally:
m.close()
for req, c in zip(reqs, curls):
fp, hdr = io[id(c)]
hdr.seek(0)
status = hdr.readline().rstrip()
headers = []
name, values = None, None
# XXX We don't currently handle bogus header data.
for line in hdr.readlines():
if not line[0].isspace():
if name:
headers.append((name, ' '.join(values)))
name, value = line.strip().split(':', 1)
value = [value]
else:
values.append(line.strip())
if name:
headers.append((name, ' '.join(values)))
resp = c.ResponseClass(fp.getvalue(), status, headers, request=req)
route_re = re.compile(r'''
\{ # exact character "{"
(\w*) # "config" or variable (restricted to a-z, 0-9, _)
(?:([:~])([^}]+))? # optional :type or ~regex part
\} # exact character "}"
''', re.VERBOSE)
predefined_regexps = {
'uuid': r'[a-f0-9][a-f0-9-]{31,35}',
'int': r'\d+',
'host': r'[a-z0-9][a-z0-9\-\.]*',
}
def compile_route(route):
fp = StringIO()
last_pos = 0
for match in route_re.finditer(route):
#print "matches: ", match.groups()
fp.write(re.escape(route[last_pos:match.start()]))
var_name = match.group(1)
sep = match.group(2)
expr = match.group(3)
if var_name == 'config':
expr = re.escape(str(config.get(var_name)))
else:
if expr:
if sep == ':':
expr = predefined_regexps[expr]
# otherwise, treat what follows '~' as a regexp
else:
expr = '[^/]+'
if var_name != '':
expr = '(?P<%s>%s)' % (var_name, expr)
else:
expr = '(%s)' % (expr,)
fp.write(expr)
last_pos = match.end()
fp.write(re.escape(route[last_pos:]))
compiled_route = '^%s$' % fp.getvalue()
#print route, "->", compiled_route
return compiled_route
class Router(object):
'''WSGI routing class. Parses a URL and hands off a request to
some other WSGI application. If no suitable application is found,
responds with a 404.'''
def __init__(self):
self._new_routes = []
self._routes = []
self._paths = []
def add(self, route, app, methods=None):
self._new_routes.append((route, app, methods))
def _create_routes(self):
for route, app, methods in self._new_routes:
self._paths.append(route)
self._routes.append(
(re.compile(compile_route(route)),
app,
methods and dict.fromkeys(methods)))
self._new_routes = []
def __call__(self, environ, start_response):
# load up the config from the config file. Only needs to be
# done once per interpreter. This is the entry point of all
# siesta applications, so this is where we trap it.
_conf = config.get_config()
if _conf is None:
import os.path
fname = os.path.join(
environ.get('ll.config_dir', '/local/linden/etc'),
'indra.xml')
config.load(fname)
# proceed with handling the request
self._create_routes()
path_info = environ['PATH_INFO']
request_method = environ['REQUEST_METHOD']
allowed = []
for regex, app, methods in self._routes:
m = regex.match(path_info)
if m:
#print "groupdict:",m.groupdict()
if not methods or request_method in methods:
environ['paste.urlvars'] = m.groupdict()
return app(environ, start_response)
else:
allowed += methods
if allowed:
allowed = dict.fromkeys(allows).keys()
allowed.sort()
resp = exc.HTTPMethodNotAllowed(
headers={'Allow': ', '.join(allowed)})
else:
resp = exc.HTTPNotFound()
return resp(environ, start_response)

View File

@@ -1,235 +0,0 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
from indra.base import llsd, lluuid
from indra.ipc import siesta
import datetime, math, unittest
from webob import exc
class ClassApp(object):
def handle_get(self, req):
pass
def handle_post(self, req):
return req.llsd
def callable_app(req):
if req.method == 'UNDERPANTS':
raise exc.HTTPMethodNotAllowed()
elif req.method == 'GET':
return None
return req.llsd
class TestBase:
def test_basic_get(self):
req = siesta.Request.blank('/')
self.assertEquals(req.get_response(self.server).body,
llsd.format_xml(None))
def test_bad_method(self):
req = siesta.Request.blank('/')
req.environ['REQUEST_METHOD'] = 'UNDERPANTS'
self.assertEquals(req.get_response(self.server).status_int,
exc.HTTPMethodNotAllowed.code)
json_safe = {
'none': None,
'bool_true': True,
'bool_false': False,
'int_zero': 0,
'int_max': 2147483647,
'int_min': -2147483648,
'long_zero': 0,
'long_max': 2147483647L,
'long_min': -2147483648L,
'float_zero': 0,
'float': math.pi,
'float_huge': 3.14159265358979323846e299,
'str_empty': '',
'str': 'foo',
u'unic\u1e51de_empty': u'',
u'unic\u1e51de': u'\u1e4exx\u10480',
}
json_safe['array'] = json_safe.values()
json_safe['tuple'] = tuple(json_safe.values())
json_safe['dict'] = json_safe.copy()
json_unsafe = {
'uuid_empty': lluuid.UUID(),
'uuid_full': lluuid.UUID('dc61ab0530200d7554d23510559102c1a98aab1b'),
'binary_empty': llsd.binary(),
'binary': llsd.binary('f\0\xff'),
'uri_empty': llsd.uri(),
'uri': llsd.uri('http://www.secondlife.com/'),
'datetime_empty': datetime.datetime(1970,1,1),
'datetime': datetime.datetime(1999,9,9,9,9,9),
}
json_unsafe.update(json_safe)
json_unsafe['array'] = json_unsafe.values()
json_unsafe['tuple'] = tuple(json_unsafe.values())
json_unsafe['dict'] = json_unsafe.copy()
json_unsafe['iter'] = iter(json_unsafe.values())
def _test_client_content_type_good(self, content_type, ll):
def run(ll):
req = siesta.Request.blank('/')
req.environ['REQUEST_METHOD'] = 'POST'
req.content_type = content_type
req.llsd = ll
req.accept = content_type
resp = req.get_response(self.server)
self.assertEquals(resp.status_int, 200)
return req, resp
if False and isinstance(ll, dict):
def fixup(v):
if isinstance(v, float):
return '%.5f' % v
if isinstance(v, long):
return int(v)
if isinstance(v, (llsd.binary, llsd.uri)):
return v
if isinstance(v, (tuple, list)):
return [fixup(i) for i in v]
if isinstance(v, dict):
return dict([(k, fixup(i)) for k, i in v.iteritems()])
return v
for k, v in ll.iteritems():
l = [k, v]
req, resp = run(l)
self.assertEquals(fixup(resp.llsd), fixup(l))
run(ll)
def test_client_content_type_json_good(self):
self._test_client_content_type_good('application/json', self.json_safe)
def test_client_content_type_llsd_xml_good(self):
self._test_client_content_type_good('application/llsd+xml',
self.json_unsafe)
def test_client_content_type_llsd_notation_good(self):
self._test_client_content_type_good('application/llsd+notation',
self.json_unsafe)
def test_client_content_type_llsd_binary_good(self):
self._test_client_content_type_good('application/llsd+binary',
self.json_unsafe)
def test_client_content_type_xml_good(self):
self._test_client_content_type_good('application/xml',
self.json_unsafe)
def _test_client_content_type_bad(self, content_type):
req = siesta.Request.blank('/')
req.environ['REQUEST_METHOD'] = 'POST'
req.body = '\0invalid nonsense under all encodings'
req.content_type = content_type
self.assertEquals(req.get_response(self.server).status_int,
exc.HTTPBadRequest.code)
def test_client_content_type_json_bad(self):
self._test_client_content_type_bad('application/json')
def test_client_content_type_llsd_xml_bad(self):
self._test_client_content_type_bad('application/llsd+xml')
def test_client_content_type_llsd_notation_bad(self):
self._test_client_content_type_bad('application/llsd+notation')
def test_client_content_type_llsd_binary_bad(self):
self._test_client_content_type_bad('application/llsd+binary')
def test_client_content_type_xml_bad(self):
self._test_client_content_type_bad('application/xml')
def test_client_content_type_bad(self):
req = siesta.Request.blank('/')
req.environ['REQUEST_METHOD'] = 'POST'
req.body = 'XXX'
req.content_type = 'application/nonsense'
self.assertEquals(req.get_response(self.server).status_int,
exc.HTTPUnsupportedMediaType.code)
def test_request_default_content_type(self):
req = siesta.Request.blank('/')
self.assertEquals(req.content_type, req.default_content_type)
def test_request_default_accept(self):
req = siesta.Request.blank('/')
from webob import acceptparse
self.assertEquals(str(req.accept).replace(' ', ''),
req.default_accept.replace(' ', ''))
def test_request_llsd_auto_body(self):
req = siesta.Request.blank('/')
req.llsd = {'a': 2}
self.assertEquals(req.body, '<?xml version="1.0" ?><llsd><map>'
'<key>a</key><integer>2</integer></map></llsd>')
def test_request_llsd_mod_body_changes_llsd(self):
req = siesta.Request.blank('/')
req.llsd = {'a': 2}
req.body = '<?xml version="1.0" ?><llsd><integer>1337</integer></llsd>'
self.assertEquals(req.llsd, 1337)
def test_request_bad_llsd_fails(self):
def crashme(ctype):
def boom():
class foo(object): pass
req = siesta.Request.blank('/')
req.content_type = ctype
req.llsd = foo()
for mime_type in siesta.llsd_parsers:
self.assertRaises(TypeError, crashme(mime_type))
class ClassServer(TestBase, unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.server = siesta.llsd_class(ClassApp)
class CallableServer(TestBase, unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.server = siesta.llsd_callable(callable_app)
class RouterServer(unittest.TestCase):
def test_router(self):
def foo(req, quux):
print quux
r = siesta.Router()
r.add('/foo/{quux:int}', siesta.llsd_callable(foo), methods=['GET'])
req = siesta.Request.blank('/foo/33')
req.get_response(r)
req = siesta.Request.blank('/foo/bar')
self.assertEquals(req.get_response(r).status_int,
exc.HTTPNotFound.code)
if __name__ == '__main__':
unittest.main()

View File

@@ -1,597 +0,0 @@
"""
@file webdav.py
@brief Classes to make manipulation of a webdav store easier.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import sys, os, httplib, urlparse
import socket, time
import xml.dom.minidom
import syslog
# import signal
__revision__ = '0'
dav_debug = False
# def urlsafe_b64decode (enc):
# return base64.decodestring (enc.replace ('_', '/').replace ('-', '+'))
# def urlsafe_b64encode (str):
# return base64.encodestring (str).replace ('+', '-').replace ('/', '_')
class DAVError (Exception):
""" Base class for exceptions in this module. """
def __init__ (self, status=0, message='', body='', details=''):
self.status = status
self.message = message
self.body = body
self.details = details
Exception.__init__ (self, '%d:%s:%s%s' % (self.status, self.message,
self.body, self.details))
def print_to_stderr (self):
""" print_to_stderr docstring """
print >> sys.stderr, str (self.status) + ' ' + self.message
print >> sys.stderr, str (self.details)
class Timeout (Exception):
""" Timeout docstring """
def __init__ (self, arg=''):
Exception.__init__ (self, arg)
def alarm_handler (signum, frame):
""" alarm_handler docstring """
raise Timeout ('caught alarm')
class WebDAV:
""" WebDAV docstring """
def __init__ (self, url, proxy=None, retries_before_fail=6):
self.init_url = url
self.init_proxy = proxy
self.retries_before_fail = retries_before_fail
url_parsed = urlparse.urlsplit (url)
self.top_path = url_parsed[ 2 ]
# make sure top_path has a trailing /
if self.top_path == None or self.top_path == '':
self.top_path = '/'
elif len (self.top_path) > 1 and self.top_path[-1:] != '/':
self.top_path += '/'
if dav_debug:
syslog.syslog ('new WebDAV %s : %s' % (str (url), str (proxy)))
if proxy:
proxy_parsed = urlparse.urlsplit (proxy)
self.host_header = url_parsed[ 1 ]
host_and_port = proxy_parsed[ 1 ].split (':')
self.host = host_and_port[ 0 ]
if len (host_and_port) > 1:
self.port = int(host_and_port[ 1 ])
else:
self.port = 80
else: # no proxy
host_and_port = url_parsed[ 1 ].split (':')
self.host_header = None
self.host = host_and_port[ 0 ]
if len (host_and_port) > 1:
self.port = int(host_and_port[ 1 ])
else:
self.port = 80
self.connection = False
self.connect ()
def log (self, msg, depth=0):
""" log docstring """
if dav_debug and depth == 0:
host = str (self.init_url)
if host == 'http://int.tuco.lindenlab.com:80/asset/':
host = 'tuco'
if host == 'http://harriet.lindenlab.com/asset-keep/':
host = 'harriet/asset-keep'
if host == 'http://harriet.lindenlab.com/asset-flag/':
host = 'harriet/asset-flag'
if host == 'http://harriet.lindenlab.com/asset/':
host = 'harriet/asset'
if host == 'http://ozzy.lindenlab.com/asset/':
host = 'ozzy/asset'
if host == 'http://station11.lindenlab.com:12041/:':
host = 'station11:12041'
proxy = str (self.init_proxy)
if proxy == 'None':
proxy = ''
if proxy == 'http://int.tuco.lindenlab.com:3128/':
proxy = 'tuco'
syslog.syslog ('WebDAV (%s:%s) %s' % (host, proxy, str (msg)))
def connect (self):
""" connect docstring """
self.log ('connect')
self.connection = httplib.HTTPConnection (self.host, self.port)
def __err (self, response, details):
""" __err docstring """
raise DAVError (response.status, response.reason, response.read (),
str (self.init_url) + ':' + \
str (self.init_proxy) + ':' + str (details))
def request (self, method, path, body=None, headers=None,
read_all=True, body_hook = None, recurse=0, allow_cache=True):
""" request docstring """
# self.log ('request %s %s' % (method, path))
if headers == None:
headers = {}
if not allow_cache:
headers['Pragma'] = 'no-cache'
headers['cache-control'] = 'no-cache'
try:
if method.lower () != 'purge':
if path.startswith ('/'):
path = path[1:]
if self.host_header: # use proxy
headers[ 'host' ] = self.host_header
fullpath = 'http://%s%s%s' % (self.host_header,
self.top_path, path)
else: # no proxy
fullpath = self.top_path + path
else:
fullpath = path
self.connection.request (method, fullpath, body, headers)
if body_hook:
body_hook ()
# signal.signal (signal.SIGALRM, alarm_handler)
# try:
# signal.alarm (120)
# signal.alarm (0)
# except Timeout, e:
# if recurse < 6:
# return self.retry_request (method, path, body, headers,
# read_all, body_hook, recurse)
# else:
# raise DAVError (0, 'timeout', self.host,
# (method, path, body, headers, recurse))
response = self.connection.getresponse ()
if read_all:
while len (response.read (1024)) > 0:
pass
if (response.status == 500 or \
response.status == 503 or \
response.status == 403) and \
recurse < self.retries_before_fail:
return self.retry_request (method, path, body, headers,
read_all, body_hook, recurse)
return response
except (httplib.ResponseNotReady,
httplib.BadStatusLine,
socket.error):
# if the server hangs up on us (keepalive off, broken pipe),
# we need to reconnect and try again.
if recurse < self.retries_before_fail:
return self.retry_request (method, path, body, headers,
read_all, body_hook, recurse)
raise DAVError (0, 'reconnect failed', self.host,
(method, path, body, headers, recurse))
def retry_request (self, method, path, body, headers,
read_all, body_hook, recurse):
""" retry_request docstring """
time.sleep (10.0 * recurse)
self.connect ()
return self.request (method, path, body, headers,
read_all, body_hook, recurse+1)
def propfind (self, path, body=None, depth=1):
""" propfind docstring """
# self.log ('propfind %s' % path)
headers = {'Content-Type':'text/xml; charset="utf-8"',
'Depth':str(depth)}
response = self.request ('PROPFIND', path, body, headers, False)
if response.status == 207:
return response # Multi-Status
self.__err (response, ('PROPFIND', path, body, headers, 0))
def purge (self, path):
""" issue a squid purge command """
headers = {'Accept':'*/*'}
response = self.request ('PURGE', path, None, headers)
if response.status == 200 or response.status == 404:
# 200 if it was purge, 404 if it wasn't there.
return response
self.__err (response, ('PURGE', path, None, headers))
def get_file_size (self, path):
"""
Use propfind to ask a webdav server what the size of
a file is. If used on a directory (collection) return 0
"""
self.log ('get_file_size %s' % path)
# "getcontentlength" property
# 8.1.1 Example - Retrieving Named Properties
# http://docs.python.org/lib/module-xml.dom.html
nsurl = 'http://apache.org/dav/props/'
doc = xml.dom.minidom.Document ()
propfind_element = doc.createElementNS (nsurl, "D:propfind")
propfind_element.setAttributeNS (nsurl, 'xmlns:D', 'DAV:')
doc.appendChild (propfind_element)
prop_element = doc.createElementNS (nsurl, "D:prop")
propfind_element.appendChild (prop_element)
con_len_element = doc.createElementNS (nsurl, "D:getcontentlength")
prop_element.appendChild (con_len_element)
response = self.propfind (path, doc.toxml ())
doc.unlink ()
resp_doc = xml.dom.minidom.parseString (response.read ())
cln = resp_doc.getElementsByTagNameNS ('DAV:','getcontentlength')[ 0 ]
try:
content_length = int (cln.childNodes[ 0 ].nodeValue)
except IndexError:
return 0
resp_doc.unlink ()
return content_length
def file_exists (self, path):
"""
do an http head on the given file. return True if it succeeds
"""
self.log ('file_exists %s' % path)
expect_gzip = path.endswith ('.gz')
response = self.request ('HEAD', path)
got_gzip = response.getheader ('Content-Encoding', '').strip ()
if got_gzip.lower () == 'x-gzip' and expect_gzip == False:
# the asset server fakes us out if we ask for the non-gzipped
# version of an asset, but the server has the gzipped version.
return False
return response.status == 200
def mkdir (self, path):
""" mkdir docstring """
self.log ('mkdir %s' % path)
headers = {}
response = self.request ('MKCOL', path, None, headers)
if response.status == 201:
return # success
if response.status == 405:
return # directory already existed?
self.__err (response, ('MKCOL', path, None, headers, 0))
def delete (self, path):
""" delete docstring """
self.log ('delete %s' % path)
headers = {'Depth':'infinity'} # collections require infinity
response = self.request ('DELETE', path, None, headers)
if response.status == 204:
return # no content
if response.status == 404:
return # hmm
self.__err (response, ('DELETE', path, None, headers, 0))
def list_directory (self, path, dir_filter=None, allow_cache=True,
minimum_cache_time=False):
"""
Request an http directory listing and parse the filenames out of lines
like: '<LI><A HREF="X"> X</A>'. If a filter function is provided,
only return filenames that the filter returns True for.
This is sort of grody, but it seems faster than other ways of getting
this information from an isilon.
"""
self.log ('list_directory %s' % path)
def try_match (lline, before, after):
""" try_match docstring """
try:
blen = len (before)
asset_start_index = lline.index (before)
asset_end_index = lline.index (after, asset_start_index + blen)
asset = line[ asset_start_index + blen : asset_end_index ]
if not dir_filter or dir_filter (asset):
return [ asset ]
return []
except ValueError:
return []
if len (path) > 0 and path[-1:] != '/':
path += '/'
response = self.request ('GET', path, None, {}, False,
allow_cache=allow_cache)
if allow_cache and minimum_cache_time: # XXX
print response.getheader ('Date')
# s = "2005-12-06T12:13:14"
# from datetime import datetime
# from time import strptime
# datetime(*strptime(s, "%Y-%m-%dT%H:%M:%S")[0:6])
# datetime.datetime(2005, 12, 6, 12, 13, 14)
if response.status != 200:
self.__err (response, ('GET', path, None, {}, 0))
assets = []
for line in response.read ().split ('\n'):
lline = line.lower ()
if lline.find ("parent directory") == -1:
# isilon file
assets += try_match (lline, '<li><a href="', '"> ')
# apache dir
assets += try_match (lline, 'alt="[dir]"> <a href="', '/">')
# apache file
assets += try_match (lline, 'alt="[ ]"> <a href="', '">')
return assets
def __tmp_filename (self, path_and_file):
""" __tmp_filename docstring """
head, tail = os.path.split (path_and_file)
if head != '':
return head + '/.' + tail + '.' + str (os.getpid ())
else:
return head + '.' + tail + '.' + str (os.getpid ())
def __put__ (self, filesize, body_hook, remotefile):
""" __put__ docstring """
headers = {'Content-Length' : str (filesize)}
remotefile_tmp = self.__tmp_filename (remotefile)
response = self.request ('PUT', remotefile_tmp, None,
headers, True, body_hook)
if not response.status in (201, 204): # created, no content
self.__err (response, ('PUT', remotefile, None, headers, 0))
if filesize != self.get_file_size (remotefile_tmp):
try:
self.delete (remotefile_tmp)
except:
pass
raise DAVError (0, 'tmp upload error', remotefile_tmp)
# move the file to its final location
try:
self.rename (remotefile_tmp, remotefile)
except DAVError, exc:
if exc.status == 403: # try to clean up the tmp file
try:
self.delete (remotefile_tmp)
except:
pass
raise
if filesize != self.get_file_size (remotefile):
raise DAVError (0, 'file upload error', str (remotefile_tmp))
def put_string (self, strng, remotefile):
""" put_string docstring """
self.log ('put_string %d -> %s' % (len (strng), remotefile))
filesize = len (strng)
def body_hook ():
""" body_hook docstring """
self.connection.send (strng)
self.__put__ (filesize, body_hook, remotefile)
def put_file (self, localfile, remotefile):
"""
Send a local file to a remote webdav store. First, upload to
a temporary filename. Next make sure the file is the size we
expected. Next, move the file to its final location. Next,
check the file size at the final location.
"""
self.log ('put_file %s -> %s' % (localfile, remotefile))
filesize = os.path.getsize (localfile)
def body_hook ():
""" body_hook docstring """
handle = open (localfile)
while True:
data = handle.read (1300)
if len (data) == 0:
break
self.connection.send (data)
handle.close ()
self.__put__ (filesize, body_hook, remotefile)
def create_empty_file (self, remotefile):
""" create an empty file """
self.log ('touch_file %s' % (remotefile))
headers = {'Content-Length' : '0'}
response = self.request ('PUT', remotefile, None, headers)
if not response.status in (201, 204): # created, no content
self.__err (response, ('PUT', remotefile, None, headers, 0))
if self.get_file_size (remotefile) != 0:
raise DAVError (0, 'file upload error', str (remotefile))
def __get_file_setup (self, remotefile, check_size=True):
""" __get_file_setup docstring """
if check_size:
remotesize = self.get_file_size (remotefile)
response = self.request ('GET', remotefile, None, {}, False)
if response.status != 200:
self.__err (response, ('GET', remotefile, None, {}, 0))
try:
content_length = int (response.getheader ("Content-Length"))
except TypeError:
content_length = None
if check_size:
if content_length != remotesize:
raise DAVError (0, 'file DL size error', remotefile)
return (response, content_length)
def __get_file_read (self, writehandle, response, content_length):
""" __get_file_read docstring """
if content_length != None:
so_far_length = 0
while so_far_length < content_length:
data = response.read (content_length - so_far_length)
if len (data) == 0:
raise DAVError (0, 'short file download')
so_far_length += len (data)
writehandle.write (data)
while len (response.read ()) > 0:
pass
else:
while True:
data = response.read ()
if (len (data) < 1):
break
writehandle.write (data)
def get_file (self, remotefile, localfile, check_size=True):
"""
Get a remote file from a webdav server. Download to a local
tmp file, then move into place. Sanity check file sizes as
we go.
"""
self.log ('get_file %s -> %s' % (remotefile, localfile))
(response, content_length) = \
self.__get_file_setup (remotefile, check_size)
localfile_tmp = self.__tmp_filename (localfile)
handle = open (localfile_tmp, 'w')
self.__get_file_read (handle, response, content_length)
handle.close ()
if check_size:
if content_length != os.path.getsize (localfile_tmp):
raise DAVError (0, 'file DL size error',
remotefile+','+localfile)
os.rename (localfile_tmp, localfile)
def get_file_as_string (self, remotefile, check_size=True):
"""
download a file from a webdav server and return it as a string.
"""
self.log ('get_file_as_string %s' % remotefile)
(response, content_length) = \
self.__get_file_setup (remotefile, check_size)
# (tmp_handle, tmp_filename) = tempfile.mkstemp ()
tmp_handle = os.tmpfile ()
self.__get_file_read (tmp_handle, response, content_length)
tmp_handle.seek (0)
ret = tmp_handle.read ()
tmp_handle.close ()
# os.unlink (tmp_filename)
return ret
def get_post_as_string (self, remotefile, body):
"""
Do an http POST, send body, get response and return it.
"""
self.log ('get_post_as_string %s' % remotefile)
# headers = {'Content-Type':'application/x-www-form-urlencoded'}
headers = {'Content-Type':'text/xml; charset="utf-8"'}
# b64body = urlsafe_b64encode (asset_url)
response = self.request ('POST', remotefile, body, headers, False)
if response.status != 200:
self.__err (response, ('POST', remotefile, body, headers, 0))
try:
content_length = int (response.getheader ('Content-Length'))
except TypeError:
content_length = None
tmp_handle = os.tmpfile ()
self.__get_file_read (tmp_handle, response, content_length)
tmp_handle.seek (0)
ret = tmp_handle.read ()
tmp_handle.close ()
return ret
def __destination_command (self, verb, remotesrc, dstdav, remotedst):
"""
self and dstdav should point to the same http server.
"""
if len (remotedst) > 0 and remotedst[ 0 ] == '/':
remotedst = remotedst[1:]
headers = {'Destination': 'http://%s:%d%s%s' % (dstdav.host,
dstdav.port,
dstdav.top_path,
remotedst)}
response = self.request (verb, remotesrc, None, headers)
if response.status == 201:
return # created
if response.status == 204:
return # no content
self.__err (response, (verb, remotesrc, None, headers, 0))
def rename (self, remotesrc, remotedst):
""" rename a file on a webdav server """
self.log ('rename %s -> %s' % (remotesrc, remotedst))
self.__destination_command ('MOVE', remotesrc, self, remotedst)
def xrename (self, remotesrc, dstdav, remotedst):
""" rename a file on a webdav server """
self.log ('xrename %s -> %s' % (remotesrc, remotedst))
self.__destination_command ('MOVE', remotesrc, dstdav, remotedst)
def copy (self, remotesrc, remotedst):
""" copy a file on a webdav server """
self.log ('copy %s -> %s' % (remotesrc, remotedst))
self.__destination_command ('COPY', remotesrc, self, remotedst)
def xcopy (self, remotesrc, dstdav, remotedst):
""" copy a file on a webdav server """
self.log ('xcopy %s -> %s' % (remotesrc, remotedst))
self.__destination_command ('COPY', remotesrc, dstdav, remotedst)
def put_string (data, url):
"""
upload string s to a url
"""
url_parsed = urlparse.urlsplit (url)
dav = WebDAV ('%s://%s/' % (url_parsed[ 0 ], url_parsed[ 1 ]))
dav.put_string (data, url_parsed[ 2 ])
def get_string (url, check_size=True):
"""
return the contents of a url as a string
"""
url_parsed = urlparse.urlsplit (url)
dav = WebDAV ('%s://%s/' % (url_parsed[ 0 ], url_parsed[ 1 ]))
return dav.get_file_as_string (url_parsed[ 2 ], check_size)

View File

@@ -1,273 +0,0 @@
"""\
@file xml_rpc.py
@brief An implementation of a parser/generator for the XML-RPC xml format.
$LicenseInfo:firstyear=2006&license=mit$
Copyright (c) 2006-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
from greenlet import greenlet
from mulib import mu
from xml.sax import handler
from xml.sax import parseString
# States
class Expected(object):
def __init__(self, tag):
self.tag = tag
def __getattr__(self, name):
return type(self)(name)
def __repr__(self):
return '%s(%r)' % (
type(self).__name__, self.tag)
class START(Expected):
pass
class END(Expected):
pass
class STR(object):
tag = ''
START = START('')
END = END('')
class Malformed(Exception):
pass
class XMLParser(handler.ContentHandler):
def __init__(self, state_machine, next_states):
handler.ContentHandler.__init__(self)
self.state_machine = state_machine
if not isinstance(next_states, tuple):
next_states = (next_states, )
self.next_states = next_states
self._character_buffer = ''
def assertState(self, state, name, *rest):
if not isinstance(self.next_states, tuple):
self.next_states = (self.next_states, )
for next in self.next_states:
if type(state) == type(next):
if next.tag and next.tag != name:
raise Malformed(
"Expected %s, got %s %s %s" % (
next, state, name, rest))
break
else:
raise Malformed(
"Expected %s, got %s %s %s" % (
self.next_states, state, name, rest))
def startElement(self, name, attrs):
self.assertState(START, name.lower(), attrs)
self.next_states = self.state_machine.switch(START, (name.lower(), dict(attrs)))
def endElement(self, name):
if self._character_buffer.strip():
characters = self._character_buffer.strip()
self._character_buffer = ''
self.assertState(STR, characters)
self.next_states = self.state_machine.switch(characters)
self.assertState(END, name.lower())
self.next_states = self.state_machine.switch(END, name.lower())
def error(self, exc):
self.bozo = 1
self.exc = exc
def fatalError(self, exc):
self.error(exc)
raise exc
def characters(self, characters):
self._character_buffer += characters
def parse(what):
child = greenlet(xml_rpc)
me = greenlet.getcurrent()
startup_states = child.switch(me)
parser = XMLParser(child, startup_states)
try:
parseString(what, parser)
except Malformed:
print what
raise
return child.switch()
def xml_rpc(yielder):
yielder.switch(START.methodcall)
yielder.switch(START.methodname)
methodName = yielder.switch(STR)
yielder.switch(END.methodname)
yielder.switch(START.params)
root = None
params = []
while True:
state, _ = yielder.switch(START.param, END.params)
if state == END:
break
yielder.switch(START.value)
params.append(
handle(yielder))
yielder.switch(END.value)
yielder.switch(END.param)
yielder.switch(END.methodcall)
## Resume parse
yielder.switch()
## Return result to parse
return methodName.strip(), params
def handle(yielder):
_, (tag, attrs) = yielder.switch(START)
if tag in ['int', 'i4']:
result = int(yielder.switch(STR))
elif tag == 'boolean':
result = bool(int(yielder.switch(STR)))
elif tag == 'string':
result = yielder.switch(STR)
elif tag == 'double':
result = float(yielder.switch(STR))
elif tag == 'datetime.iso8601':
result = yielder.switch(STR)
elif tag == 'base64':
result = base64.b64decode(yielder.switch(STR))
elif tag == 'struct':
result = {}
while True:
state, _ = yielder.switch(START.member, END.struct)
if state == END:
break
yielder.switch(START.name)
key = yielder.switch(STR)
yielder.switch(END.name)
yielder.switch(START.value)
result[key] = handle(yielder)
yielder.switch(END.value)
yielder.switch(END.member)
## We already handled </struct> above, don't want to handle it below
return result
elif tag == 'array':
result = []
yielder.switch(START.data)
while True:
state, _ = yielder.switch(START.value, END.data)
if state == END:
break
result.append(handle(yielder))
yielder.switch(END.value)
yielder.switch(getattr(END, tag))
return result
VALUE = mu.tag_factory('value')
BOOLEAN = mu.tag_factory('boolean')
INT = mu.tag_factory('int')
STRUCT = mu.tag_factory('struct')
MEMBER = mu.tag_factory('member')
NAME = mu.tag_factory('name')
ARRAY = mu.tag_factory('array')
DATA = mu.tag_factory('data')
STRING = mu.tag_factory('string')
DOUBLE = mu.tag_factory('double')
METHODRESPONSE = mu.tag_factory('methodResponse')
PARAMS = mu.tag_factory('params')
PARAM = mu.tag_factory('param')
mu.inline_elements['string'] = True
mu.inline_elements['boolean'] = True
mu.inline_elements['name'] = True
def _generate(something):
if isinstance(something, dict):
result = STRUCT()
for key, value in something.items():
result[
MEMBER[
NAME[key], _generate(value)]]
return VALUE[result]
elif isinstance(something, list):
result = DATA()
for item in something:
result[_generate(item)]
return VALUE[ARRAY[[result]]]
elif isinstance(something, basestring):
return VALUE[STRING[something]]
elif isinstance(something, bool):
if something:
return VALUE[BOOLEAN['1']]
return VALUE[BOOLEAN['0']]
elif isinstance(something, int):
return VALUE[INT[something]]
elif isinstance(something, float):
return VALUE[DOUBLE[something]]
def generate(*args):
params = PARAMS()
for arg in args:
params[PARAM[_generate(arg)]]
return METHODRESPONSE[params]
if __name__ == '__main__':
print parse("""<?xml version="1.0"?> <methodCall> <methodName>examples.getStateName</methodName> <params> <param> <value><i4>41</i4></value> </param> </params> </methodCall>
""")

View File

@@ -1,64 +0,0 @@
"""\
@file fastest_elementtree.py
@brief Concealing some gnarly import logic in here. This should export the interface of elementtree.
$LicenseInfo:firstyear=2008&license=mit$
Copyright (c) 2008-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
# The parsing exception raised by the underlying library depends
# on the ElementTree implementation we're using, so we provide an
# alias here.
#
# Use ElementTreeError as the exception type for catching parsing
# errors.
# Using cElementTree might cause some unforeseen problems, so here's a
# convenient off switch.
use_celementree = True
try:
if not use_celementree:
raise ImportError()
# Python 2.3 and 2.4.
from cElementTree import *
ElementTreeError = SyntaxError
except ImportError:
try:
if not use_celementree:
raise ImportError()
# Python 2.5 and above.
from xml.etree.cElementTree import *
ElementTreeError = SyntaxError
except ImportError:
# Pure Python code.
try:
# Python 2.3 and 2.4.
from elementtree.ElementTree import *
except ImportError:
# Python 2.5 and above.
from xml.etree.ElementTree import *
# The pure Python ElementTree module uses Expat for parsing.
from xml.parsers.expat import ExpatError as ElementTreeError

View File

@@ -1,52 +0,0 @@
"""\
@file helpformatter.py
@author Phoenix
@brief Class for formatting optparse descriptions.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import optparse
import textwrap
class Formatter(optparse.IndentedHelpFormatter):
def __init__(
self,
p_indentIncrement = 2,
p_maxHelpPosition = 24,
p_width = 79,
p_shortFirst = 1) :
optparse.HelpFormatter.__init__(
self,
p_indentIncrement,
p_maxHelpPosition,
p_width,
p_shortFirst)
def format_description(self, p_description):
t_descWidth = self.width - self.current_indent
t_indent = " " * (self.current_indent + 2)
return "\n".join(
[textwrap.fill(descr, t_descWidth, initial_indent = t_indent,
subsequent_indent = t_indent)
for descr in p_description.split("\n")] )

View File

@@ -1,63 +0,0 @@
"""\
@file iterators.py
@brief Useful general-purpose iterators.
$LicenseInfo:firstyear=2008&license=mit$
Copyright (c) 2008-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
from __future__ import nested_scopes
def iter_chunks(rows, aggregate_size=100):
"""
Given an iterable set of items (@p rows), produces lists of up to @p
aggregate_size items at a time, for example:
iter_chunks([1,2,3,4,5,6,7,8,9,10], 3)
Values for @p aggregate_size < 1 will raise ValueError.
Will return a generator that produces, in the following order:
- [1, 2, 3]
- [4, 5, 6]
- [7, 8, 9]
- [10]
"""
if aggregate_size < 1:
raise ValueError()
def iter_chunks_inner():
row_iter = iter(rows)
done = False
agg = []
while not done:
try:
row = row_iter.next()
agg.append(row)
except StopIteration:
done = True
if agg and (len(agg) >= aggregate_size or done):
yield agg
agg = []
return iter_chunks_inner()

View File

@@ -1,72 +0,0 @@
"""\
@file iterators_test.py
@brief Test cases for iterators module.
$LicenseInfo:firstyear=2008&license=mit$
Copyright (c) 2008-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import unittest
from indra.util.iterators import iter_chunks
class TestIterChunks(unittest.TestCase):
"""Unittests for iter_chunks"""
def test_bad_agg_size(self):
rows = [1,2,3,4]
self.assertRaises(ValueError, iter_chunks, rows, 0)
self.assertRaises(ValueError, iter_chunks, rows, -1)
try:
for i in iter_chunks(rows, 0):
pass
except ValueError:
pass
else:
self.fail()
try:
result = list(iter_chunks(rows, 0))
except ValueError:
pass
else:
self.fail()
def test_empty(self):
rows = []
result = list(iter_chunks(rows))
self.assertEqual(result, [])
def test_small(self):
rows = [[1]]
result = list(iter_chunks(rows, 2))
self.assertEqual(result, [[[1]]])
def test_size(self):
rows = [[1],[2]]
result = list(iter_chunks(rows, 2))
self.assertEqual(result, [[[1],[2]]])
def test_multi_agg(self):
rows = [[1],[2],[3],[4],[5]]
result = list(iter_chunks(rows, 2))
self.assertEqual(result, [[[1],[2]],[[3],[4]],[[5]]])
if __name__ == "__main__":
unittest.main()

View File

@@ -33,21 +33,26 @@ import filecmp
import fnmatch
import getopt
import glob
import itertools
import operator
import os
import re
import shutil
import subprocess
import sys
import tarfile
import errno
import subprocess
class ManifestError(RuntimeError):
"""Use an exception more specific than generic Python RuntimeError"""
pass
def __init__(self, msg):
self.msg = msg
super(ManifestError, self).__init__(self.msg)
class MissingError(ManifestError):
"""You specified a file that doesn't exist"""
pass
def __init__(self, msg):
self.msg = msg
super(MissingError, self).__init__(self.msg)
def path_ancestors(path):
drive, path = os.path.splitdrive(os.path.normpath(path))
@@ -88,7 +93,7 @@ DEFAULT_SRCTREE = os.path.dirname(sys.argv[0])
CHANNEL_VENDOR_BASE = 'Singularity'
RELEASE_CHANNEL = CHANNEL_VENDOR_BASE + ' Release'
ARGUMENTS=[
BASE_ARGUMENTS=[
dict(name='actions',
description="""This argument specifies the actions that are to be taken when the
script is run. The meaningful actions are currently:
@@ -106,8 +111,17 @@ ARGUMENTS=[
Example use: %(name)s --arch=i686
On Linux this would try to use Linux_i686Manifest.""",
default=""),
dict(name='artwork', description='Artwork directory.', default=DEFAULT_SRCTREE),
dict(name='branding_id', description="Identifier for the branding set to use.", default='singularity'),
dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE),
dict(name='buildtype', description='Build type (i.e. Debug, Release, RelWithDebInfo).', default=None),
dict(name='channel',
description="""The channel to use for updates, packaging, settings name, etc.""",
default='CHANNEL UNSET'),
dict(name='channel_suffix',
description="""Addition to the channel for packaging and channel value,
but not application name (used internally)""",
default=None),
dict(name='configuration',
description="""The build configuration used.""",
default="Release"),
@@ -115,12 +129,6 @@ ARGUMENTS=[
dict(name='grid',
description="""Which grid the client will try to connect to.""",
default=None),
dict(name='channel',
description="""The channel to use for updates, packaging, settings name, etc.""",
default='CHANNEL UNSET'),
dict(name='channel_suffix',
description="""Addition to the channel for packaging and channel value, but not application name (used internally)""",
default=None),
dict(name='installer_name',
description=""" The name of the file that the installer should be
packaged up into. Only used on Linux at the moment.""",
@@ -132,13 +140,17 @@ ARGUMENTS=[
description="""The current platform, to be used for looking up which
manifest class to run.""",
default=get_default_platform),
dict(name='signature',
description="""This specifies an identity to sign the viewer with, if any.
If no value is supplied, the default signature will be used, if any. Currently
only used on Mac OS X.""",
default=None),
dict(name='source',
description='Source directory.',
default=DEFAULT_SRCTREE),
dict(name='standalone',
description='Set to ON if this is a standalone build.',
default="OFF"),
dict(name='artwork', description='Artwork directory.', default=DEFAULT_SRCTREE),
dict(name='touch',
description="""File to touch when action is finished. Touch file will
contain the name of the final package in a form suitable
@@ -146,20 +158,15 @@ ARGUMENTS=[
default=None),
dict(name='versionfile',
description="""The name of a file containing the full version number."""),
dict(name='signature',
description="""This specifies an identity to sign the viewer with, if any.
If no value is supplied, the default signature will be used, if any. Currently
only used on Mac OS X.""",
default=None)
]
def usage(srctree=""):
def usage(arguments, srctree=""):
nd = {'name':sys.argv[0]}
print """Usage:
%(name)s [options] [destdir]
Options:
""" % nd
for arg in ARGUMENTS:
for arg in arguments:
default = arg['default']
if hasattr(default, '__call__'):
default = "(computed value) \"" + str(default(srctree)) + '"'
@@ -170,11 +177,15 @@ def usage(srctree=""):
default,
arg['description'] % nd)
def main():
## import itertools
def main(extra=[]):
## print ' '.join((("'%s'" % item) if ' ' in item else item)
## for item in itertools.chain([sys.executable], sys.argv))
option_names = [arg['name'] + '=' for arg in ARGUMENTS]
# Supplement our default command-line switches with any desired by
# application-specific caller.
arguments = list(itertools.chain(BASE_ARGUMENTS, extra))
# Alphabetize them by option name in case we display usage.
arguments.sort(key=operator.itemgetter('name'))
option_names = [arg['name'] + '=' for arg in arguments]
option_names.append('help')
options, remainder = getopt.getopt(sys.argv[1:], "", option_names)
@@ -197,11 +208,11 @@ def main():
# early out for help
if 'help' in args:
# *TODO: it is a huge hack to pass around the srctree like this
usage(args['source'])
usage(arguments, srctree=args['source'])
return
# defaults
for arg in ARGUMENTS:
for arg in arguments:
if arg['name'] not in args:
default = arg['default']
if hasattr(default, '__call__'):
@@ -230,101 +241,68 @@ def main():
print "Option:", opt, "=", args[opt]
# pass in sourceid as an argument now instead of an environment variable
try:
args['sourceid'] = os.environ["sourceid"]
except KeyError:
args['sourceid'] = ""
args['sourceid'] = os.environ.get("sourceid", "")
# Build base package.
touch = args.get('touch')
if touch:
print 'Creating base package'
args['package_id'] = "" # base package has no package ID
print '================ Creating base package'
else:
print '================ Starting base copy'
wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
wm.do(*args['actions'])
# Store package file for later if making touched file.
base_package_file = ""
if touch:
print 'Created base package ', wm.package_file
print '================ Created base package ', wm.package_file
base_package_file = "" + wm.package_file
else:
print '================ Finished base copy'
# handle multiple packages if set
try:
additional_packages = os.environ["additional_packages"]
except KeyError:
additional_packages = ""
# ''.split() produces empty list
additional_packages = os.environ.get("additional_packages", "").split()
if additional_packages:
# Determine destination prefix / suffix for additional packages.
base_dest_postfix = args['dest']
base_dest_prefix = ""
base_dest_parts = args['dest'].split(os.sep)
if len(base_dest_parts) > 1:
base_dest_postfix = base_dest_parts[len(base_dest_parts) - 1]
base_dest_prefix = base_dest_parts[0]
i = 1
while i < len(base_dest_parts) - 1:
base_dest_prefix = base_dest_prefix + os.sep + base_dest_parts[i]
i = i + 1
base_dest_parts = list(os.path.split(args['dest']))
base_dest_parts.insert(-1, "{}")
base_dest_template = os.path.join(*base_dest_parts)
# Determine touched prefix / suffix for additional packages.
base_touch_postfix = ""
base_touch_prefix = ""
if touch:
base_touch_postfix = touch
base_touch_parts = touch.split('/')
base_touch_parts = list(os.path.split(touch))
# Because of the special insert() logic below, we don't just want
# [dirpath, basename]; we want [dirpath, directory, basename].
# Further split the dirpath and replace it in the list.
base_touch_parts[0:1] = os.path.split(base_touch_parts[0])
if "arwin" in args['platform']:
if len(base_touch_parts) > 1:
base_touch_postfix = base_touch_parts[len(base_touch_parts) - 1]
base_touch_prefix = base_touch_parts[0]
i = 1
while i < len(base_touch_parts) - 1:
base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
i = i + 1
base_touch_parts.insert(-1, "{}")
else:
if len(base_touch_parts) > 2:
base_touch_postfix = base_touch_parts[len(base_touch_parts) - 2] + '/' + base_touch_parts[len(base_touch_parts) - 1]
base_touch_prefix = base_touch_parts[0]
i = 1
while i < len(base_touch_parts) - 2:
base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
i = i + 1
# Store base channel name.
base_channel_name = args['channel']
# Build each additional package.
package_id_list = additional_packages.split(" ")
args['channel'] = base_channel_name
for package_id in package_id_list:
base_touch_parts.insert(-2, "{}")
base_touch_template = os.path.join(*base_touch_parts)
for package_id in additional_packages:
args['channel_suffix'] = os.environ.get(package_id + "_viewer_channel_suffix")
args['sourceid'] = os.environ.get(package_id + "_sourceid")
args['dest'] = base_dest_template.format(package_id)
if touch:
print '================ Creating additional package for "', package_id, '" in ', args['dest']
else:
print '================ Starting additional copy for "', package_id, '" in ', args['dest']
try:
if package_id + "_viewer_channel_suffix" in os.environ:
args['channel_suffix'] = os.environ[package_id + "_viewer_channel_suffix"]
else:
args['channel_suffix'] = None
if package_id + "_sourceid" in os.environ:
args['sourceid'] = os.environ[package_id + "_sourceid"]
else:
args['sourceid'] = None
args['dest'] = base_dest_prefix + os.sep + package_id + os.sep + base_dest_postfix
except KeyError:
sys.stderr.write("Failed to create package for package_id: %s" % package_id)
sys.stderr.flush()
continue
wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
wm.do(*args['actions'])
except Exception as err:
sys.exit(str(err))
if touch:
print 'Creating additional package for "', package_id, '" in ', args['dest']
wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
wm.do(*args['actions'])
if touch:
print 'Created additional package ', wm.package_file, ' for ', package_id
faketouch = base_touch_prefix + '/' + package_id + '/' + base_touch_postfix
fp = open(faketouch, 'w')
fp.write('set package_file=%s\n' % wm.package_file)
fp.close()
print '================ Created additional package ', wm.package_file, ' for ', package_id
with open(base_touch_template.format(package_id), 'w') as fp:
fp.write('set package_file=%s\n' % wm.package_file)
else:
print '================ Finished additional copy "', package_id, '" in ', args['dest']
# Write out the package file in this format, so that it can easily be called
# and used in a .bat file - yeah, it sucks, but this is the simplest...
touch = args.get('touch')
if touch:
fp = open(touch, 'w')
fp.write('set package_file=%s\n' % base_package_file)
fp.close()
with open(touch, 'w') as fp:
fp.write('set package_file=%s\n' % base_package_file)
print 'touched', touch
return 0
@@ -370,22 +348,113 @@ class LLManifest(object):
in the file list by path()."""
self.excludes.append(glob)
def prefix(self, src='', build=None, dst=None):
""" Pushes a prefix onto the stack. Until end_prefix is
called, all relevant method calls (esp. to path()) will prefix
paths with the entire prefix stack. Source and destination
prefixes can be different, though if only one is provided they
are both equal. To specify a no-op, use an empty string, not
None."""
if dst is None:
dst = src
if build is None:
build = src
def prefix(self, src='', build='', dst='', src_dst=None):
"""
Usage:
with self.prefix(...args as described...):
self.path(...)
For the duration of the 'with' block, pushes a prefix onto the stack.
Within that block, all relevant method calls (esp. to path()) will
prefix paths with the entire prefix stack. Source and destination
prefixes are independent; if omitted (or passed as the empty string),
the prefix has no effect. Thus:
with self.prefix(src='foo'):
# no effect on dst
with self.prefix(dst='bar'):
# no effect on src
If you want to set both at once, use src_dst:
with self.prefix(src_dst='subdir'):
# same as self.prefix(src='subdir', dst='subdir')
# Passing src_dst makes any src or dst argument in the same
# parameter list irrelevant.
Also supports the older (pre-Python-2.5) syntax:
if self.prefix(...args as described...):
self.path(...)
self.end_prefix(...)
Before the arrival of the 'with' statement, one was required to code
self.prefix() and self.end_prefix() in matching pairs to push and to
pop the prefix stacks, respectively. The older prefix() method
returned True specifically so that the caller could indent the
relevant block of code with 'if', just for aesthetic purposes.
"""
if src_dst is not None:
src = src_dst
dst = src_dst
self.src_prefix.append(src)
self.artwork_prefix.append(src)
self.build_prefix.append(build)
self.dst_prefix.append(dst)
return True # so that you can wrap it in an if to get indentation
## self.display_stacks()
# The above code is unchanged from the original implementation. What's
# new is the return value. We're going to return an instance of
# PrefixManager that binds this LLManifest instance and Does The Right
# Thing on exit.
return self.PrefixManager(self)
def display_stacks(self):
width = 1 + max(len(stack) for stack in self.PrefixManager.stacks)
for stack in self.PrefixManager.stacks:
print "{} {}".format((stack + ':').ljust(width),
os.path.join(*getattr(self, stack)))
class PrefixManager(object):
# stack attributes we manage in this LLManifest (sub)class
# instance
stacks = ("src_prefix", "artwork_prefix", "build_prefix", "dst_prefix")
def __init__(self, manifest):
self.manifest = manifest
# If the caller wrote:
# with self.prefix(...):
# as intended, then bind the state of each prefix stack as it was
# just BEFORE the call to prefix(). Since prefix() appended an
# entry to each prefix stack, capture len()-1.
self.prevlen = { stack: len(getattr(self.manifest, stack)) - 1
for stack in self.stacks }
def __nonzero__(self):
# If the caller wrote:
# if self.prefix(...):
# then a value of this class had better evaluate as 'True'.
return True
def __enter__(self):
# nobody uses 'with self.prefix(...) as variable:'
return None
def __exit__(self, type, value, traceback):
# First, if the 'with' block raised an exception, just propagate.
# Do NOT swallow it.
if type is not None:
return False
# Okay, 'with' block completed successfully. Restore previous
# state of each of the prefix stacks in self.stacks.
# Note that we do NOT simply call pop() on them as end_prefix()
# does. This is to cope with the possibility that the coder
# changed 'if self.prefix(...):' to 'with self.prefix(...):' yet
# forgot to remove the self.end_prefix(...) call at the bottom of
# the block. In that case, calling pop() again would be Bad! But
# if we restore the length of each stack to what it was before the
# current prefix() block, it doesn't matter whether end_prefix()
# was called or not.
for stack, prevlen in self.prevlen.items():
# find the attribute in 'self.manifest' named by 'stack', and
# truncate that list back to 'prevlen'
del getattr(self.manifest, stack)[prevlen:]
## self.manifest.display_stacks()
def end_prefix(self, descr=None):
"""Pops a prefix off the stack. If given an argument, checks
@@ -432,6 +501,19 @@ class LLManifest(object):
relative to the destination directory."""
return os.path.join(self.get_dst_prefix(), relpath)
def _relative_dst_path(self, dstpath):
"""
Returns the path to a file or directory relative to the destination directory.
This should only be used for generating diagnostic output in the path method.
"""
dest_root=self.dst_prefix[0]
if dstpath.startswith(dest_root+os.path.sep):
return dstpath[len(dest_root)+1:]
elif dstpath.startswith(dest_root):
return dstpath[len(dest_root):]
else:
return dstpath
def ensure_src_dir(self, reldir):
"""Construct the path for a directory relative to the
source path, and ensures that it exists. Returns the
@@ -449,29 +531,17 @@ class LLManifest(object):
return path
def run_command(self, command):
""" Runs an external command, and returns the output. Raises
an exception if the command returns a nonzero status code. For
debugging/informational purposes, prints out the command's
output as it is received."""
"""
Runs an external command.
Raises ManifestError exception if the command returns a nonzero status.
"""
print "Running command:", command
sys.stdout.flush()
child = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
shell=True)
lines = []
while True:
lines.append(child.stdout.readline())
if lines[-1] == '':
break
else:
print lines[-1],
output = ''.join(lines)
child.stdout.close()
status = child.wait()
if status:
raise ManifestError(
"Command %s returned non-zero status (%s) \noutput:\n%s"
% (command, status, output) )
return output
try:
subprocess.check_call(command)
except subprocess.CalledProcessError as err:
raise ManifestError( "Command %s returned non-zero status (%s)"
% (command, err.returncode) )
def created_path(self, path):
""" Declare that you've created a path in order to
@@ -484,6 +554,7 @@ class LLManifest(object):
def put_in_file(self, contents, dst, src=None):
# write contents as dst
dst_path = self.dst_path_of(dst)
self.cmakedirs(os.path.dirname(dst_path))
f = open(dst_path, "wb")
try:
f.write(contents)
@@ -545,9 +616,16 @@ class LLManifest(object):
# *TODO is this gonna be useful?
print "Cleaning up " + c
def process_either(self, src, dst):
# If it's a real directory, recurse through it --
# but not a symlink! Handle those like files.
if os.path.isdir(src) and not os.path.islink(src):
return self.process_directory(src, dst)
else:
return self.process_file(src, dst)
def process_file(self, src, dst):
if self.includes(src, dst):
# print src, "=>", dst
for action in self.actions:
methodname = action + "_action"
method = getattr(self, methodname, None)
@@ -572,10 +650,7 @@ class LLManifest(object):
for name in names:
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
if os.path.isdir(srcname):
count += self.process_directory(srcname, dstname)
else:
count += self.process_file(srcname, dstname)
count += self.process_either(srcname, dstname)
return count
def includes(self, src, dst):
@@ -615,16 +690,21 @@ class LLManifest(object):
# Don't recopy file if it's up-to-date.
# If we seem to be not not overwriting files that have been
# updated, set the last arg to False, but it will take longer.
## reldst = (dst[len(self.dst_prefix[0]):]
## if dst.startswith(self.dst_prefix[0])
## else dst).lstrip(r'\/')
if os.path.exists(dst) and filecmp.cmp(src, dst, True):
## print "{} (skipping, {} exists)".format(src, reldst)
return
# only copy if it's not excluded
if self.includes(src, dst):
try:
os.unlink(dst)
except OSError, err:
except OSError as err:
if err.errno != errno.ENOENT:
raise
## print "{} => {}".format(src, reldst)
shutil.copy2(src, dst)
def ccopytree(self, src, dst):
@@ -642,7 +722,7 @@ class LLManifest(object):
dstname = os.path.join(dst, name)
try:
self.ccopymumble(srcname, dstname)
except (IOError, os.error), why:
except (IOError, os.error) as why:
errors.append((srcname, dstname, why))
if errors:
raise ManifestError, errors
@@ -723,13 +803,13 @@ class LLManifest(object):
return self.path(os.path.join(path, file), file)
def path(self, src, dst=None):
sys.stdout.write("Processing %s => %s ... " % (src, dst))
sys.stdout.flush()
if src == None:
raise ManifestError("No source file, dst is " + dst)
if dst == None:
dst = src
dst = os.path.join(self.get_dst_prefix(), dst)
sys.stdout.write("Processing %s => %s ... " % (src, self._relative_dst_path(dst)))
def try_path(src):
# expand globs
@@ -742,29 +822,21 @@ class LLManifest(object):
# if we're specifying a single path (not a glob),
# we should error out if it doesn't exist
self.check_file_exists(src)
# if it's a directory, recurse through it
if os.path.isdir(src):
count += self.process_directory(src, dst)
else:
count += self.process_file(src, dst)
count += self.process_either(src, dst)
return count
for pfx in self.get_src_prefix(), self.get_artwork_prefix(), self.get_build_prefix():
try_prefixes = [self.get_src_prefix(), self.get_artwork_prefix(), self.get_build_prefix()]
tried=[]
count=0
while not count and try_prefixes:
pfx = try_prefixes.pop(0)
try:
count = try_path(os.path.join(pfx, src))
except MissingError:
# If src isn't a wildcard, and if that file doesn't exist in
# this pfx, try next pfx.
count = 0
continue
# Here try_path() didn't raise MissingError. Did it process any files?
if count:
break
# Even though try_path() didn't raise MissingError, it returned 0
# files. src is probably a wildcard meant for some other pfx. Loop
# back to try the next.
tried.append(pfx)
if not try_prefixes:
# no more prefixes left to try
print "unable to find '%s'; looked in:\n %s" % (src, '\n '.join(tried))
print "%d files" % count
# Let caller check whether we processed as many files as expected. In

View File

@@ -1,182 +0,0 @@
#!/usr/bin/env python
"""\
@file llperformance.py
$LicenseInfo:firstyear=2010&license=viewerlgpl$
Second Life Viewer Source Code
Copyright (C) 2010-2011, Linden Research, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation;
version 2.1 of the License only.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
$/LicenseInfo$
"""
# ------------------------------------------------
# Sim metrics utility functions.
import glob, os, time, sys, stat, exceptions
from indra.base import llsd
gBlockMap = {} #Map of performance metric data with function hierarchy information.
gCurrentStatPath = ""
gIsLoggingEnabled=False
class LLPerfStat:
def __init__(self,key):
self.mTotalTime = 0
self.mNumRuns = 0
self.mName=key
self.mTimeStamp = int(time.time()*1000)
self.mUTCTime = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
def __str__(self):
return "%f" % self.mTotalTime
def start(self):
self.mStartTime = int(time.time() * 1000000)
self.mNumRuns += 1
def stop(self):
execution_time = int(time.time() * 1000000) - self.mStartTime
self.mTotalTime += execution_time
def get_map(self):
results={}
results['name']=self.mName
results['utc_time']=self.mUTCTime
results['timestamp']=self.mTimeStamp
results['us']=self.mTotalTime
results['count']=self.mNumRuns
return results
class PerfError(exceptions.Exception):
def __init__(self):
return
def __Str__(self):
print "","Unfinished LLPerfBlock"
class LLPerfBlock:
def __init__( self, key ):
global gBlockMap
global gCurrentStatPath
global gIsLoggingEnabled
#Check to see if we're running metrics right now.
if gIsLoggingEnabled:
self.mRunning = True #Mark myself as running.
self.mPreviousStatPath = gCurrentStatPath
gCurrentStatPath += "/" + key
if gCurrentStatPath not in gBlockMap:
gBlockMap[gCurrentStatPath] = LLPerfStat(key)
self.mStat = gBlockMap[gCurrentStatPath]
self.mStat.start()
def finish( self ):
global gBlockMap
global gIsLoggingEnabled
if gIsLoggingEnabled:
self.mStat.stop()
self.mRunning = False
gCurrentStatPath = self.mPreviousStatPath
# def __del__( self ):
# if self.mRunning:
# #SPATTERS FIXME
# raise PerfError
class LLPerformance:
#--------------------------------------------------
# Determine whether or not we want to log statistics
def __init__( self, process_name = "python" ):
self.process_name = process_name
self.init_testing()
self.mTimeStamp = int(time.time()*1000)
self.mUTCTime = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
def init_testing( self ):
global gIsLoggingEnabled
host_performance_file = "/dev/shm/simperf/simperf_proc_config.llsd"
#If file exists, open
if os.path.exists(host_performance_file):
file = open (host_performance_file,'r')
#Read serialized LLSD from file.
body = llsd.parse(file.read())
#Calculate time since file last modified.
stats = os.stat(host_performance_file)
now = time.time()
mod = stats[stat.ST_MTIME]
age = now - mod
if age < ( body['duration'] ):
gIsLoggingEnabled = True
def get ( self ):
global gIsLoggingEnabled
return gIsLoggingEnabled
#def output(self,ptr,path):
# if 'stats' in ptr:
# stats = ptr['stats']
# self.mOutputPtr[path] = stats.get_map()
# if 'children' in ptr:
# children=ptr['children']
# curptr = self.mOutputPtr
# curchildren={}
# curptr['children'] = curchildren
# for key in children:
# curchildren[key]={}
# self.mOutputPtr = curchildren[key]
# self.output(children[key],path + '/' + key)
def done(self):
global gBlockMap
if not self.get():
return
output_name = "/dev/shm/simperf/%s_proc.%d.llsd" % (self.process_name, os.getpid())
output_file = open(output_name, 'w')
process_info = {
"name" : self.process_name,
"pid" : os.getpid(),
"ppid" : os.getppid(),
"timestamp" : self.mTimeStamp,
"utc_time" : self.mUTCTime,
}
output_file.write(llsd.format_notation(process_info))
output_file.write('\n')
for key in gBlockMap.keys():
gBlockMap[key] = gBlockMap[key].get_map()
output_file.write(llsd.format_notation(gBlockMap))
output_file.write('\n')
output_file.close()

View File

@@ -1,117 +0,0 @@
"""\
@file llsubprocess.py
@author Phoenix
@date 2008-01-18
@brief The simplest possible wrapper for a common sub-process paradigm.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import os
import popen2
import time
import select
class Timeout(RuntimeError):
"Exception raised when a subprocess times out."
pass
def run(command, args=None, data=None, timeout=None):
"""\
@brief Run command with arguments
This is it. This is the function I want to run all the time when doing
subprocces, but end up copying the code everywhere. none of the
standard commands are secure and provide a way to specify input, get
all the output, and get the result.
@param command A string specifying a process to launch.
@param args Arguments to be passed to command. Must be list, tuple or None.
@param data input to feed to the command.
@param timeout Maximum number of many seconds to run.
@return Returns (result, stdout, stderr) from process.
"""
cmd = [command]
if args:
cmd.extend([str(arg) for arg in args])
#print "cmd: ","' '".join(cmd)
child = popen2.Popen3(cmd, True)
#print child.pid
out = []
err = []
result = -1
time_left = timeout
tochild = [child.tochild.fileno()]
while True:
time_start = time.time()
#print "time:",time_left
p_in, p_out, p_err = select.select(
[child.fromchild.fileno(), child.childerr.fileno()],
tochild,
[],
time_left)
if p_in:
new_line = os.read(child.fromchild.fileno(), 32 * 1024)
if new_line:
#print "line:",new_line
out.append(new_line)
new_line = os.read(child.childerr.fileno(), 32 * 1024)
if new_line:
#print "error:", new_line
err.append(new_line)
if p_out:
if data:
#print "p_out"
bytes = os.write(child.tochild.fileno(), data)
data = data[bytes:]
if len(data) == 0:
data = None
tochild = []
child.tochild.close()
result = child.poll()
if result != -1:
# At this point, the child process has exited and result
# is the return value from the process. Between the time
# we called select() and poll() the process may have
# exited so read all the data left on the child process
# stdout and stderr.
last = child.fromchild.read()
if last:
out.append(last)
last = child.childerr.read()
if last:
err.append(last)
child.tochild.close()
child.fromchild.close()
child.childerr.close()
break
if time_left is not None:
time_left -= (time.time() - time_start)
if time_left < 0:
raise Timeout
#print "result:",result
out = ''.join(out)
#print "stdout:", out
err = ''.join(err)
#print "stderr:", err
return result, out, err

View File

@@ -1,592 +0,0 @@
"""\
@file named_query.py
@author Ryan Williams, Phoenix
@date 2007-07-31
@brief An API for running named queries.
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import errno
import MySQLdb
import MySQLdb.cursors
import os
import os.path
import re
import time
from indra.base import llsd
from indra.base import config
DEBUG = False
NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '.nq')
NQ_FILE_SUFFIX_LEN = len(NQ_FILE_SUFFIX)
_g_named_manager = None
def _init_g_named_manager(sql_dir = None):
"""Initializes a global NamedManager object to point at a
specified named queries hierarchy.
This function is intended entirely for testing purposes,
because it's tricky to control the config from inside a test."""
global NQ_FILE_SUFFIX
NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '.nq')
global NQ_FILE_SUFFIX_LEN
NQ_FILE_SUFFIX_LEN = len(NQ_FILE_SUFFIX)
if sql_dir is None:
sql_dir = config.get('named-query-base-dir')
# extra fallback directory in case config doesn't return what we want
if sql_dir is None:
sql_dir = os.path.abspath(
os.path.join(
os.path.realpath(os.path.dirname(__file__)), "..", "..", "..", "..", "web", "dataservice", "sql"))
global _g_named_manager
_g_named_manager = NamedQueryManager(
os.path.abspath(os.path.realpath(sql_dir)))
def get(name, schema = None):
"Get the named query object to be used to perform queries"
if _g_named_manager is None:
_init_g_named_manager()
return _g_named_manager.get(name).for_schema(schema)
def sql(connection, name, params):
# use module-global NamedQuery object to perform default substitution
return get(name).sql(connection, params)
def run(connection, name, params, expect_rows = None):
"""\
@brief given a connection, run a named query with the params
Note that this function will fetch ALL rows.
@param connection The connection to use
@param name The name of the query to run
@param params The parameters passed into the query
@param expect_rows The number of rows expected. Set to 1 if return_as_map is true. Raises ExpectationFailed if the number of returned rows doesn't exactly match. Kind of a hack.
@return Returns the result set as a list of dicts.
"""
return get(name).run(connection, params, expect_rows)
class ExpectationFailed(Exception):
""" Exception that is raised when an expectation for an sql query
is not met."""
def __init__(self, message):
Exception.__init__(self, message)
self.message = message
class NamedQuery(object):
def __init__(self, name, filename):
""" Construct a NamedQuery object. The name argument is an
arbitrary name as a handle for the query, and the filename is
a path to a file or a file-like object containing an llsd named
query document."""
self._stat_interval_seconds = 5 # 5 seconds
self._name = name
if (filename is not None and isinstance(filename, (str, unicode))
and NQ_FILE_SUFFIX != filename[-NQ_FILE_SUFFIX_LEN:]):
filename = filename + NQ_FILE_SUFFIX
self._location = filename
self._alternative = dict()
self._last_mod_time = 0
self._last_check_time = 0
self.deleted = False
self.load_contents()
def name(self):
""" The name of the query. """
return self._name
def get_modtime(self):
""" Returns the mtime (last modified time) of the named query
filename. For file-like objects, expect a modtime of 0"""
if self._location and isinstance(self._location, (str, unicode)):
return os.path.getmtime(self._location)
return 0
def load_contents(self):
""" Loads and parses the named query file into self. Does
nothing if self.location is nonexistant."""
if self._location:
if isinstance(self._location, (str, unicode)):
contents = llsd.parse(open(self._location).read())
else:
# we probably have a file-like object. Godspeed!
contents = llsd.parse(self._location.read())
self._reference_contents(contents)
# Check for alternative implementations
try:
for name, alt in self._contents['alternative'].items():
nq = NamedQuery(name, None)
nq._reference_contents(alt)
self._alternative[name] = nq
except KeyError, e:
pass
self._last_mod_time = self.get_modtime()
self._last_check_time = time.time()
def _reference_contents(self, contents):
"Helper method which builds internal structure from parsed contents"
self._contents = contents
self._ttl = int(self._contents.get('ttl', 0))
self._return_as_map = bool(self._contents.get('return_as_map', False))
self._legacy_dbname = self._contents.get('legacy_dbname', None)
# reset these before doing the sql conversion because we will
# read them there. reset these while loading so we pick up
# changes.
self._around = set()
self._append = set()
self._integer = set()
self._options = self._contents.get('dynamic_where', {})
for key in self._options:
if isinstance(self._options[key], basestring):
self._options[key] = self._convert_sql(self._options[key])
elif isinstance(self._options[key], list):
lines = []
for line in self._options[key]:
lines.append(self._convert_sql(line))
self._options[key] = lines
else:
moreopt = {}
for kk in self._options[key]:
moreopt[kk] = self._convert_sql(self._options[key][kk])
self._options[key] = moreopt
self._base_query = self._convert_sql(self._contents['base_query'])
self._query_suffix = self._convert_sql(
self._contents.get('query_suffix', ''))
def _convert_sql(self, sql):
"""convert the parsed sql into a useful internal structure.
This function has to turn the named query format into a pyformat
style. It also has to look for %:name% and :name% and
ready them for use in LIKE statements"""
if sql:
# This first sub is to properly escape any % signs that
# are meant to be literally passed through to mysql in the
# query. It leaves any %'s that are used for
# like-expressions.
expr = re.compile("(?<=[^a-zA-Z0-9_-])%(?=[^:])")
sql = expr.sub('%%', sql)
# This should tackle the rest of the %'s in the query, by
# converting them to LIKE clauses.
expr = re.compile("(%?):([a-zA-Z][a-zA-Z0-9_-]*)%")
sql = expr.sub(self._prepare_like, sql)
expr = re.compile("#:([a-zA-Z][a-zA-Z0-9_-]*)")
sql = expr.sub(self._prepare_integer, sql)
expr = re.compile(":([a-zA-Z][a-zA-Z0-9_-]*)")
sql = expr.sub("%(\\1)s", sql)
return sql
def _prepare_like(self, match):
"""This function changes LIKE statement replace behavior
It works by turning %:name% to %(_name_around)s and :name% to
%(_name_append)s. Since a leading '_' is not a valid keyname
input (enforced via unit tests), it will never clash with
existing keys. Then, when building the statement, the query
runner will generate corrected strings."""
if match.group(1) == '%':
# there is a leading % so this is treated as prefix/suffix
self._around.add(match.group(2))
return "%(" + self._build_around_key(match.group(2)) + ")s"
else:
# there is no leading %, so this is suffix only
self._append.add(match.group(2))
return "%(" + self._build_append_key(match.group(2)) + ")s"
def _build_around_key(self, key):
return "_" + key + "_around"
def _build_append_key(self, key):
return "_" + key + "_append"
def _prepare_integer(self, match):
"""This function adjusts the sql for #:name replacements
It works by turning #:name to %(_name_as_integer)s. Since a
leading '_' is not a valid keyname input (enforced via unit
tests), it will never clash with existing keys. Then, when
building the statement, the query runner will generate
corrected strings."""
self._integer.add(match.group(1))
return "%(" + self._build_integer_key(match.group(1)) + ")s"
def _build_integer_key(self, key):
return "_" + key + "_as_integer"
def _strip_wildcards_to_list(self, value):
"""Take string, and strip out the LIKE special characters.
Technically, this is database dependant, but postgresql and
mysql use the same wildcards, and I am not aware of a general
way to handle this. I think you need a sql statement of the
form:
LIKE_STRING( [ANY,ONE,str]... )
which would treat ANY as their any string, and ONE as their
single glyph, and str as something that needs database
specific encoding to not allow any % or _ to affect the query.
As it stands, I believe it's impossible to write a named query
style interface which uses like to search the entire space of
text available. Imagine the query:
% of brain used by average linden
In order to search for %, it must be escaped, so once you have
escaped the string to not do wildcard searches, and be escaped
for the database, and then prepended the wildcard you come
back with one of:
1) %\% of brain used by average linden
2) %%% of brain used by average linden
Then, when passed to the database to be escaped to be database
safe, you get back:
1) %\\% of brain used by average linden
: which means search for any character sequence, followed by a
backslash, followed by any sequence, followed by ' of
brain...'
2) %%% of brain used by average linden
: which (I believe) means search for a % followed by any
character sequence followed by 'of brain...'
Neither of which is what we want!
So, we need a vendor (or extention) for LIKE_STRING. Anyone
want to write it?"""
if isinstance(value, unicode):
utf8_value = value
else:
utf8_value = unicode(value, "utf-8")
esc_list = []
remove_chars = set(u"%_")
for glyph in utf8_value:
if glyph in remove_chars:
continue
esc_list.append(glyph.encode("utf-8"))
return esc_list
def delete(self):
""" Makes this query unusable by deleting all the members and
setting the deleted member. This is desired when the on-disk
query has been deleted but the in-memory copy remains."""
# blow away all members except _name, _location, and deleted
name, location = self._name, self._location
for key in self.__dict__.keys():
del self.__dict__[key]
self.deleted = True
self._name, self._location = name, location
def ttl(self):
""" Estimated time to live of this query. Used for web
services to set the Expires header."""
return self._ttl
def legacy_dbname(self):
return self._legacy_dbname
def return_as_map(self):
""" Returns true if this query is configured to return its
results as a single map (as opposed to a list of maps, the
normal behavior)."""
return self._return_as_map
def for_schema(self, db_name):
"Look trough the alternates and return the correct query"
if db_name is None:
return self
try:
return self._alternative[db_name]
except KeyError, e:
pass
return self
def run(self, connection, params, expect_rows = None, use_dictcursor = True):
"""given a connection, run a named query with the params
Note that this function will fetch ALL rows. We do this because it
opens and closes the cursor to generate the values, and this
isn't a generator so the cursor has no life beyond the method call.
@param cursor The connection to use (this generates its own cursor for the query)
@param name The name of the query to run
@param params The parameters passed into the query
@param expect_rows The number of rows expected. Set to 1 if return_as_map is true. Raises ExpectationFailed if the number of returned rows doesn't exactly match. Kind of a hack.
@param use_dictcursor Set to false to use a normal cursor and manually convert the rows to dicts.
@return Returns the result set as a list of dicts, or, if the named query has return_as_map set to true, returns a single dict.
"""
if use_dictcursor:
cursor = connection.cursor(MySQLdb.cursors.DictCursor)
else:
cursor = connection.cursor()
full_query, params = self._construct_sql(params)
if DEBUG:
print "SQL:", self.sql(connection, params)
rows = cursor.execute(full_query, params)
# *NOTE: the expect_rows argument is a very cheesy way to get some
# validation on the result set. If you want to add more expectation
# logic, do something more object-oriented and flexible. Or use an ORM.
if(self._return_as_map):
expect_rows = 1
if expect_rows is not None and rows != expect_rows:
cursor.close()
raise ExpectationFailed("Statement expected %s rows, got %s. Sql: '%s' %s" % (
expect_rows, rows, full_query, params))
# convert to dicts manually if we're not using a dictcursor
if use_dictcursor:
result_set = cursor.fetchall()
else:
if cursor.description is None:
# an insert or something
x = cursor.fetchall()
cursor.close()
return x
names = [x[0] for x in cursor.description]
result_set = []
for row in cursor.fetchall():
converted_row = {}
for idx, col_name in enumerate(names):
converted_row[col_name] = row[idx]
result_set.append(converted_row)
cursor.close()
if self._return_as_map:
return result_set[0]
return result_set
def _construct_sql(self, params):
""" Returns a query string and a dictionary of parameters,
suitable for directly passing to the execute() method."""
self.refresh()
# build the query from the options available and the params
base_query = []
base_query.append(self._base_query)
for opt, extra_where in self._options.items():
if type(extra_where) in (dict, list, tuple):
if opt in params:
base_query.append(extra_where[params[opt]])
else:
if opt in params and params[opt]:
base_query.append(extra_where)
if self._query_suffix:
base_query.append(self._query_suffix)
full_query = '\n'.join(base_query)
# Go through the query and rewrite all of the ones with the
# @:name syntax.
rewrite = _RewriteQueryForArray(params)
expr = re.compile("@%\(([a-zA-Z][a-zA-Z0-9_-]*)\)s")
full_query = expr.sub(rewrite.operate, full_query)
params.update(rewrite.new_params)
# build out the params for like. We only have to do this
# parameters which were detected to have ued the where syntax
# during load.
#
# * treat the incoming string as utf-8
# * strip wildcards
# * append or prepend % as appropriate
new_params = {}
for key in params:
if key in self._around:
new_value = ['%']
new_value.extend(self._strip_wildcards_to_list(params[key]))
new_value.append('%')
new_params[self._build_around_key(key)] = ''.join(new_value)
if key in self._append:
new_value = self._strip_wildcards_to_list(params[key])
new_value.append('%')
new_params[self._build_append_key(key)] = ''.join(new_value)
if key in self._integer:
new_params[self._build_integer_key(key)] = int(params[key])
params.update(new_params)
return full_query, params
def sql(self, connection, params):
""" Generates an SQL statement from the named query document
and a dictionary of parameters.
*NOTE: Only use for debugging, because it uses the
non-standard MySQLdb 'literal' method.
"""
if not DEBUG:
import warnings
warnings.warn("Don't use named_query.sql() when not debugging. Used on %s" % self._location)
# do substitution using the mysql (non-standard) 'literal'
# function to do the escaping.
full_query, params = self._construct_sql(params)
return full_query % connection.literal(params)
def refresh(self):
""" Refresh self from the file on the filesystem.
This is optimized to be callable as frequently as you wish,
without adding too much load. It does so by only stat-ing the
file every N seconds, where N defaults to 5 and is
configurable through the member _stat_interval_seconds. If the stat
reveals that the file has changed, refresh will re-parse the
contents of the file and use them to update the named query
instance. If the stat reveals that the file has been deleted,
refresh will call self.delete to make the in-memory
representation unusable."""
now = time.time()
if(now - self._last_check_time > self._stat_interval_seconds):
self._last_check_time = now
try:
modtime = self.get_modtime()
if(modtime > self._last_mod_time):
self.load_contents()
except OSError, e:
if e.errno == errno.ENOENT: # file not found
self.delete() # clean up self
raise # pass the exception along to the caller so they know that this query disappeared
class NamedQueryManager(object):
""" Manages the lifespan of NamedQuery objects, drawing from a
directory hierarchy of named query documents.
In practice this amounts to a memory cache of NamedQuery objects."""
def __init__(self, named_queries_dir):
""" Initializes a manager to look for named queries in a
directory."""
self._dir = os.path.abspath(os.path.realpath(named_queries_dir))
self._cached_queries = {}
def sql(self, connection, name, params):
nq = self.get(name)
return nq.sql(connection, params)
def get(self, name):
""" Returns a NamedQuery instance based on the name, either
from memory cache, or by parsing from disk.
The name is simply a relative path to the directory associated
with the manager object. Before returning the instance, the
NamedQuery object is cached in memory, so that subsequent
accesses don't have to read from disk or do any parsing. This
means that NamedQuery objects returned by this method are
shared across all users of the manager object.
NamedQuery.refresh is used to bring the NamedQuery objects in
sync with the actual files on disk."""
nq = self._cached_queries.get(name)
if nq is None:
nq = NamedQuery(name, os.path.join(self._dir, name))
self._cached_queries[name] = nq
else:
try:
nq.refresh()
except OSError, e:
if e.errno == errno.ENOENT: # file not found
del self._cached_queries[name]
raise # pass exception along to caller so they know that the query disappeared
return nq
class _RewriteQueryForArray(object):
"Helper class for rewriting queries with the @:name syntax"
def __init__(self, params):
self.params = params
self.new_params = dict()
def operate(self, match):
"Given a match, return the string that should be in use"
key = match.group(1)
value = self.params[key]
if type(value) in (list,tuple):
rv = []
for idx in range(len(value)):
# if the value@idx is array-like, we are
# probably dealing with a VALUES
new_key = "_%s_%s"%(key, str(idx))
val_item = value[idx]
if type(val_item) in (list, tuple, dict):
if type(val_item) is dict:
# this is because in Python, the order of
# key, value retrieval from the dict is not
# guaranteed to match what the input intended
# and for VALUES, order is important.
# TODO: Implemented ordered dict in LLSD parser?
raise ExpectationFailed('Only lists/tuples allowed,\
received dict')
values_keys = []
for value_idx, item in enumerate(val_item):
# we want a key of the format :
# key_#replacement_#value_row_#value_col
# ugh... so if we are replacing 10 rows in user_note,
# the first values clause would read (for @:user_notes) :-
# ( :_user_notes_0_1_1, :_user_notes_0_1_2, :_user_notes_0_1_3 )
# the input LLSD for VALUES will look like:
# <llsd>...
# <map>
# <key>user_notes</key>
# <array>
# <array> <!-- row 1 for VALUES -->
# <string>...</string>
# <string>...</string>
# <string>...</string>
# </array>
# ...
# </array>
# </map>
# ... </llsd>
values_key = "%s_%s"%(new_key, value_idx)
self.new_params[values_key] = item
values_keys.append("%%(%s)s"%values_key)
# now collapse all these new place holders enclosed in ()
# from [':_key_0_1_1', ':_key_0_1_2', ':_key_0_1_3,...]
# rv will have [ '(:_key_0_1_1, :_key_0_1_2, :_key_0_1_3)', ]
# which is flattened a few lines below join(rv)
rv.append('(%s)' % ','.join(values_keys))
else:
self.new_params[new_key] = val_item
rv.append("%%(%s)s"%new_key)
return ','.join(rv)
else:
# not something that can be expanded, so just drop the
# leading @ in the front of the match. This will mean that
# the single value we have, be it a string, int, whatever
# (other than dict) will correctly show up, eg:
#
# where foo in (@:foobar) -- foobar is a string, so we get
# where foo in (:foobar)
return match.group(0)[1:]

View File

@@ -1,84 +0,0 @@
'''
@file shutil2.py
@brief a better shutil.copytree replacement
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
'''
#
# shutil2.py
# Taken from http://www.scons.org/wiki/AccumulateBuilder
# the stock copytree sucks because it insists that the
# target dir not exist
#
import os.path
import shutil
def copytree(src, dest, symlinks=False):
"""My own copyTree which does not fail if the directory exists.
Recursively copy a directory tree using copy2().
If the optional symlinks flag is true, symbolic links in the
source tree result in symbolic links in the destination tree; if
it is false, the contents of the files pointed to by symbolic
links are copied.
Behavior is meant to be identical to GNU 'cp -R'.
"""
def copyItems(src, dest, symlinks=False):
"""Function that does all the work.
It is necessary to handle the two 'cp' cases:
- destination does exist
- destination does not exist
See 'cp -R' documentation for more details
"""
for item in os.listdir(src):
srcPath = os.path.join(src, item)
if os.path.isdir(srcPath):
srcBasename = os.path.basename(srcPath)
destDirPath = os.path.join(dest, srcBasename)
if not os.path.exists(destDirPath):
os.makedirs(destDirPath)
copyItems(srcPath, destDirPath)
elif os.path.islink(item) and symlinks:
linkto = os.readlink(item)
os.symlink(linkto, dest)
else:
shutil.copy2(srcPath, dest)
# case 'cp -R src/ dest/' where dest/ already exists
if os.path.exists(dest):
destPath = os.path.join(dest, os.path.basename(src))
if not os.path.exists(destPath):
os.makedirs(destPath)
# case 'cp -R src/ dest/' where dest/ does not exist
else:
os.makedirs(dest)
destPath = dest
# actually copy the files
copyItems(src, destPath)

View File

@@ -1,338 +0,0 @@
#!/usr/bin/env python
"""\
@file simperf_host_xml_parser.py
@brief Digest collector's XML dump and convert to simple dict/list structure
$LicenseInfo:firstyear=2008&license=mit$
Copyright (c) 2008-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import sys, os, getopt, time
import simplejson
from xml import sax
def usage():
print "Usage:"
print sys.argv[0] + " [options]"
print " Convert RRD's XML dump to JSON. Script to convert the simperf_host_collector-"
print " generated RRD dump into JSON. Steps include converting selected named"
print " fields from GAUGE type to COUNTER type by computing delta with preceding"
print " values. Top-level named fields are:"
print
print " lastupdate Time (javascript timestamp) of last data sample"
print " step Time in seconds between samples"
print " ds Data specification (name/type) for each column"
print " database Table of data samples, one time step per row"
print
print "Options:"
print " -i, --in Input settings filename. (Default: stdin)"
print " -o, --out Output settings filename. (Default: stdout)"
print " -h, --help Print this message and exit."
print
print "Example: %s -i rrddump.xml -o rrddump.json" % sys.argv[0]
print
print "Interfaces:"
print " class SimPerfHostXMLParser() # SAX content handler"
print " def simperf_host_xml_fixup(parser) # post-parse value fixup"
class SimPerfHostXMLParser(sax.handler.ContentHandler):
def __init__(self):
pass
def startDocument(self):
self.rrd_last_update = 0 # public
self.rrd_step = 0 # public
self.rrd_ds = [] # public
self.rrd_records = [] # public
self._rrd_level = 0
self._rrd_parse_state = 0
self._rrd_chars = ""
self._rrd_capture = False
self._rrd_ds_val = {}
self._rrd_data_row = []
self._rrd_data_row_has_nan = False
def endDocument(self):
pass
# Nasty little ad-hoc state machine to extract the elements that are
# necessary from the 'rrdtool dump' XML output. The same element
# name '<ds>' is used for two different data sets so we need to pay
# some attention to the actual structure to get the ones we want
# and ignore the ones we don't.
def startElement(self, name, attrs):
self._rrd_level = self._rrd_level + 1
self._rrd_capture = False
if self._rrd_level == 1:
if name == "rrd" and self._rrd_parse_state == 0:
self._rrd_parse_state = 1 # In <rrd>
self._rrd_capture = True
self._rrd_chars = ""
elif self._rrd_level == 2:
if self._rrd_parse_state == 1:
if name == "lastupdate":
self._rrd_parse_state = 2 # In <rrd><lastupdate>
self._rrd_capture = True
self._rrd_chars = ""
elif name == "step":
self._rrd_parse_state = 3 # In <rrd><step>
self._rrd_capture = True
self._rrd_chars = ""
elif name == "ds":
self._rrd_parse_state = 4 # In <rrd><ds>
self._rrd_ds_val = {}
self._rrd_chars = ""
elif name == "rra":
self._rrd_parse_state = 5 # In <rrd><rra>
elif self._rrd_level == 3:
if self._rrd_parse_state == 4:
if name == "name":
self._rrd_parse_state = 6 # In <rrd><ds><name>
self._rrd_capture = True
self._rrd_chars = ""
elif name == "type":
self._rrd_parse_state = 7 # In <rrd><ds><type>
self._rrd_capture = True
self._rrd_chars = ""
elif self._rrd_parse_state == 5:
if name == "database":
self._rrd_parse_state = 8 # In <rrd><rra><database>
elif self._rrd_level == 4:
if self._rrd_parse_state == 8:
if name == "row":
self._rrd_parse_state = 9 # In <rrd><rra><database><row>
self._rrd_data_row = []
self._rrd_data_row_has_nan = False
elif self._rrd_level == 5:
if self._rrd_parse_state == 9:
if name == "v":
self._rrd_parse_state = 10 # In <rrd><rra><database><row><v>
self._rrd_capture = True
self._rrd_chars = ""
def endElement(self, name):
self._rrd_capture = False
if self._rrd_parse_state == 10:
self._rrd_capture = self._rrd_level == 6
if self._rrd_level == 5:
if self._rrd_chars == "NaN":
self._rrd_data_row_has_nan = True
else:
self._rrd_data_row.append(self._rrd_chars)
self._rrd_parse_state = 9 # In <rrd><rra><database><row>
elif self._rrd_parse_state == 9:
if self._rrd_level == 4:
if not self._rrd_data_row_has_nan:
self.rrd_records.append(self._rrd_data_row)
self._rrd_parse_state = 8 # In <rrd><rra><database>
elif self._rrd_parse_state == 8:
if self._rrd_level == 3:
self._rrd_parse_state = 5 # In <rrd><rra>
elif self._rrd_parse_state == 7:
if self._rrd_level == 3:
self._rrd_ds_val["type"] = self._rrd_chars
self._rrd_parse_state = 4 # In <rrd><ds>
elif self._rrd_parse_state == 6:
if self._rrd_level == 3:
self._rrd_ds_val["name"] = self._rrd_chars
self._rrd_parse_state = 4 # In <rrd><ds>
elif self._rrd_parse_state == 5:
if self._rrd_level == 2:
self._rrd_parse_state = 1 # In <rrd>
elif self._rrd_parse_state == 4:
if self._rrd_level == 2:
self.rrd_ds.append(self._rrd_ds_val)
self._rrd_parse_state = 1 # In <rrd>
elif self._rrd_parse_state == 3:
if self._rrd_level == 2:
self.rrd_step = long(self._rrd_chars)
self._rrd_parse_state = 1 # In <rrd>
elif self._rrd_parse_state == 2:
if self._rrd_level == 2:
self.rrd_last_update = long(self._rrd_chars)
self._rrd_parse_state = 1 # In <rrd>
elif self._rrd_parse_state == 1:
if self._rrd_level == 1:
self._rrd_parse_state = 0 # At top
if self._rrd_level:
self._rrd_level = self._rrd_level - 1
def characters(self, content):
if self._rrd_capture:
self._rrd_chars = self._rrd_chars + content.strip()
def _make_numeric(value):
try:
value = float(value)
except:
value = ""
return value
def simperf_host_xml_fixup(parser, filter_start_time = None, filter_end_time = None):
# Fixup for GAUGE fields that are really COUNTS. They
# were forced to GAUGE to try to disable rrdtool's
# data interpolation/extrapolation for non-uniform time
# samples.
fixup_tags = [ "cpu_user",
"cpu_nice",
"cpu_sys",
"cpu_idle",
"cpu_waitio",
"cpu_intr",
# "file_active",
# "file_free",
# "inode_active",
# "inode_free",
"netif_in_kb",
"netif_in_pkts",
"netif_in_errs",
"netif_in_drop",
"netif_out_kb",
"netif_out_pkts",
"netif_out_errs",
"netif_out_drop",
"vm_page_in",
"vm_page_out",
"vm_swap_in",
"vm_swap_out",
#"vm_mem_total",
#"vm_mem_used",
#"vm_mem_active",
#"vm_mem_inactive",
#"vm_mem_free",
#"vm_mem_buffer",
#"vm_swap_cache",
#"vm_swap_total",
#"vm_swap_used",
#"vm_swap_free",
"cpu_interrupts",
"cpu_switches",
"cpu_forks" ]
col_count = len(parser.rrd_ds)
row_count = len(parser.rrd_records)
# Process the last row separately, just to make all values numeric.
for j in range(col_count):
parser.rrd_records[row_count - 1][j] = _make_numeric(parser.rrd_records[row_count - 1][j])
# Process all other row/columns.
last_different_row = row_count - 1
current_row = row_count - 2
while current_row >= 0:
# Check for a different value than the previous row. If everything is the same
# then this is probably just a filler/bogus entry.
is_different = False
for j in range(col_count):
parser.rrd_records[current_row][j] = _make_numeric(parser.rrd_records[current_row][j])
if parser.rrd_records[current_row][j] != parser.rrd_records[last_different_row][j]:
# We're good. This is a different row.
is_different = True
if not is_different:
# This is a filler/bogus entry. Just ignore it.
for j in range(col_count):
parser.rrd_records[current_row][j] = float('nan')
else:
# Some tags need to be converted into deltas.
for j in range(col_count):
if parser.rrd_ds[j]["name"] in fixup_tags:
parser.rrd_records[last_different_row][j] = \
parser.rrd_records[last_different_row][j] - parser.rrd_records[current_row][j]
last_different_row = current_row
current_row -= 1
# Set fixup_tags in the first row to 'nan' since they aren't useful anymore.
for j in range(col_count):
if parser.rrd_ds[j]["name"] in fixup_tags:
parser.rrd_records[0][j] = float('nan')
# Add a timestamp to each row and to the catalog. Format and name
# chosen to match other simulator logging (hopefully).
start_time = parser.rrd_last_update - (parser.rrd_step * (row_count - 1))
# Build a filtered list of rrd_records if we are limited to a time range.
filter_records = False
if filter_start_time is not None or filter_end_time is not None:
filter_records = True
filtered_rrd_records = []
if filter_start_time is None:
filter_start_time = start_time * 1000
if filter_end_time is None:
filter_end_time = parser.rrd_last_update * 1000
for i in range(row_count):
record_timestamp = (start_time + (i * parser.rrd_step)) * 1000
parser.rrd_records[i].insert(0, record_timestamp)
if filter_records:
if filter_start_time <= record_timestamp and record_timestamp <= filter_end_time:
filtered_rrd_records.append(parser.rrd_records[i])
if filter_records:
parser.rrd_records = filtered_rrd_records
parser.rrd_ds.insert(0, {"type": "GAUGE", "name": "javascript_timestamp"})
def main(argv=None):
opts, args = getopt.getopt(sys.argv[1:], "i:o:h", ["in=", "out=", "help"])
input_file = sys.stdin
output_file = sys.stdout
for o, a in opts:
if o in ("-i", "--in"):
input_file = open(a, 'r')
if o in ("-o", "--out"):
output_file = open(a, 'w')
if o in ("-h", "--help"):
usage()
sys.exit(0)
# Using the SAX parser as it is at least 4X faster and far, far
# smaller on this dataset than the DOM-based interface in xml.dom.minidom.
# With SAX and a 5.4MB xml file, this requires about seven seconds of
# wall-clock time and 32MB VSZ. With the DOM interface, about 22 seconds
# and over 270MB VSZ.
handler = SimPerfHostXMLParser()
sax.parse(input_file, handler)
if input_file != sys.stdin:
input_file.close()
# Various format fixups: string-to-num, gauge-to-counts, add
# a time stamp, etc.
simperf_host_xml_fixup(handler)
# Create JSONable dict with interesting data and format/print it
print >>output_file, simplejson.dumps({ "step" : handler.rrd_step,
"lastupdate": handler.rrd_last_update * 1000,
"ds" : handler.rrd_ds,
"database" : handler.rrd_records })
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@@ -1,167 +0,0 @@
#!/usr/bin/env python
"""\
@file simperf_oprof_interface.py
@brief Manage OProfile data collection on a host
$LicenseInfo:firstyear=2008&license=mit$
Copyright (c) 2008-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
import sys, os, getopt
import simplejson
def usage():
print "Usage:"
print sys.argv[0] + " [options]"
print " Digest the OProfile report forms that come out of the"
print " simperf_oprof_ctl program's -r/--report command. The result"
print " is an array of dictionaires with the following keys:"
print
print " symbol Name of sampled, calling, or called procedure"
print " file Executable or library where symbol resides"
print " percentage Percentage contribution to profile, calls or called"
print " samples Sample count"
print " calls Methods called by the method in question (full only)"
print " called_by Methods calling the method (full only)"
print
print " For 'full' reports the two keys 'calls' and 'called_by' are"
print " themselves arrays of dictionaries based on the first four keys."
print
print "Return Codes:"
print " None. Aggressively digests everything. Will likely mung results"
print " if a program or library has whitespace in its name."
print
print "Options:"
print " -i, --in Input settings filename. (Default: stdin)"
print " -o, --out Output settings filename. (Default: stdout)"
print " -h, --help Print this message and exit."
print
print "Interfaces:"
print " class SimPerfOProfileInterface()"
class SimPerfOProfileInterface:
def __init__(self):
self.isBrief = True # public
self.isValid = False # public
self.result = [] # public
def parse(self, input):
in_samples = False
for line in input:
if in_samples:
if line[0:6] == "------":
self.isBrief = False
self._parseFull(input)
else:
self._parseBrief(input, line)
self.isValid = True
return
try:
hd1, remain = line.split(None, 1)
if hd1 == "samples":
in_samples = True
except ValueError:
pass
def _parseBrief(self, input, line1):
try:
fld1, fld2, fld3, fld4 = line1.split(None, 3)
self.result.append({"samples" : fld1,
"percentage" : fld2,
"file" : fld3,
"symbol" : fld4.strip("\n")})
except ValueError:
pass
for line in input:
try:
fld1, fld2, fld3, fld4 = line.split(None, 3)
self.result.append({"samples" : fld1,
"percentage" : fld2,
"file" : fld3,
"symbol" : fld4.strip("\n")})
except ValueError:
pass
def _parseFull(self, input):
state = 0 # In 'called_by' section
calls = []
called_by = []
current = {}
for line in input:
if line[0:6] == "------":
if len(current):
current["calls"] = calls
current["called_by"] = called_by
self.result.append(current)
state = 0
calls = []
called_by = []
current = {}
else:
try:
fld1, fld2, fld3, fld4 = line.split(None, 3)
tmp = {"samples" : fld1,
"percentage" : fld2,
"file" : fld3,
"symbol" : fld4.strip("\n")}
except ValueError:
continue
if line[0] != " ":
current = tmp
state = 1 # In 'calls' section
elif state == 0:
called_by.append(tmp)
else:
calls.append(tmp)
if len(current):
current["calls"] = calls
current["called_by"] = called_by
self.result.append(current)
def main(argv=None):
opts, args = getopt.getopt(sys.argv[1:], "i:o:h", ["in=", "out=", "help"])
input_file = sys.stdin
output_file = sys.stdout
for o, a in opts:
if o in ("-i", "--in"):
input_file = open(a, 'r')
if o in ("-o", "--out"):
output_file = open(a, 'w')
if o in ("-h", "--help"):
usage()
sys.exit(0)
oprof = SimPerfOProfileInterface()
oprof.parse(input_file)
if input_file != sys.stdin:
input_file.close()
# Create JSONable dict with interesting data and format/print it
print >>output_file, simplejson.dumps(oprof.result)
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@@ -1,191 +0,0 @@
#!/usr/bin/env python
"""\
@file simperf_proc_interface.py
@brief Utility to extract log messages from *.<pid>.llsd files containing performance statistics.
$LicenseInfo:firstyear=2008&license=mit$
Copyright (c) 2008-2009, Linden Research, Inc.
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.
$/LicenseInfo$
"""
# ----------------------------------------------------
# Utility to extract log messages from *.<pid>.llsd
# files that contain performance statistics.
# ----------------------------------------------------
import sys, os
if os.path.exists("setup-path.py"):
execfile("setup-path.py")
from indra.base import llsd
DEFAULT_PATH="/dev/shm/simperf/"
# ----------------------------------------------------
# Pull out the stats and return a single document
def parse_logfile(filename, target_column=None, verbose=False):
full_doc = []
# Open source temp log file. Let exceptions percolate up.
sourcefile = open( filename,'r')
if verbose:
print "Reading " + filename
# Parse and output all lines from the temp file
for line in sourcefile.xreadlines():
partial_doc = llsd.parse(line)
if partial_doc is not None:
if target_column is None:
full_doc.append(partial_doc)
else:
trim_doc = { target_column: partial_doc[target_column] }
if target_column != "fps":
trim_doc[ 'fps' ] = partial_doc[ 'fps' ]
trim_doc[ '/total_time' ] = partial_doc[ '/total_time' ]
trim_doc[ 'utc_time' ] = partial_doc[ 'utc_time' ]
full_doc.append(trim_doc)
sourcefile.close()
return full_doc
# Extract just the meta info line, and the timestamp of the first/last frame entry.
def parse_logfile_info(filename, verbose=False):
# Open source temp log file. Let exceptions percolate up.
sourcefile = open(filename, 'rU') # U is to open with Universal newline support
if verbose:
print "Reading " + filename
# The first line is the meta info line.
info_line = sourcefile.readline()
if not info_line:
sourcefile.close()
return None
# The rest of the lines are frames. Read the first and last to get the time range.
info = llsd.parse( info_line )
info['start_time'] = None
info['end_time'] = None
first_frame = sourcefile.readline()
if first_frame:
try:
info['start_time'] = int(llsd.parse(first_frame)['timestamp'])
except:
pass
# Read the file backwards to find the last two lines.
sourcefile.seek(0, 2)
file_size = sourcefile.tell()
offset = 1024
num_attempts = 0
end_time = None
if file_size < offset:
offset = file_size
while 1:
sourcefile.seek(-1*offset, 2)
read_str = sourcefile.read(offset)
# Remove newline at the end
if read_str[offset - 1] == '\n':
read_str = read_str[0:-1]
lines = read_str.split('\n')
full_line = None
if len(lines) > 2: # Got two line
try:
end_time = llsd.parse(lines[-1])['timestamp']
except:
# We couldn't parse this line. Try once more.
try:
end_time = llsd.parse(lines[-2])['timestamp']
except:
# Nope. Just move on.
pass
break
if len(read_str) == file_size: # Reached the beginning
break
offset += 1024
info['end_time'] = int(end_time)
sourcefile.close()
return info
def parse_proc_filename(filename):
try:
name_as_list = filename.split(".")
cur_stat_type = name_as_list[0].split("_")[0]
cur_pid = name_as_list[1]
except IndexError, ValueError:
return (None, None)
return (cur_pid, cur_stat_type)
# ----------------------------------------------------
def get_simstats_list(path=None):
""" Return stats (pid, type) listed in <type>_proc.<pid>.llsd """
if path is None:
path = DEFAULT_PATH
simstats_list = []
for file_name in os.listdir(path):
if file_name.endswith(".llsd") and file_name != "simperf_proc_config.llsd":
simstats_info = parse_logfile_info(path + file_name)
if simstats_info is not None:
simstats_list.append(simstats_info)
return simstats_list
def get_log_info_list(pid=None, stat_type=None, path=None, target_column=None, verbose=False):
""" Return data from all llsd files matching the pid and stat type """
if path is None:
path = DEFAULT_PATH
log_info_list = {}
for file_name in os.listdir ( path ):
if file_name.endswith(".llsd") and file_name != "simperf_proc_config.llsd":
(cur_pid, cur_stat_type) = parse_proc_filename(file_name)
if cur_pid is None:
continue
if pid is not None and pid != cur_pid:
continue
if stat_type is not None and stat_type != cur_stat_type:
continue
log_info_list[cur_pid] = parse_logfile(path + file_name, target_column, verbose)
return log_info_list
def delete_simstats_files(pid=None, stat_type=None, path=None):
""" Delete *.<pid>.llsd files """
if path is None:
path = DEFAULT_PATH
del_list = []
for file_name in os.listdir(path):
if file_name.endswith(".llsd") and file_name != "simperf_proc_config.llsd":
(cur_pid, cur_stat_type) = parse_proc_filename(file_name)
if cur_pid is None:
continue
if pid is not None and pid != cur_pid:
continue
if stat_type is not None and stat_type != cur_stat_type:
continue
del_list.append(cur_pid)
# Allow delete related exceptions to percolate up if this fails.
os.unlink(os.path.join(DEFAULT_PATH, file_name))
return del_list

View File

@@ -1,222 +0,0 @@
'''
@file term.py
@brief a better shutil.copytree replacement
$LicenseInfo:firstyear=2007&license=mit$
Copyright (c) 2007-2009, Linden Research, Inc.
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.
$/LicenseInfo$
'''
#http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475116
import sys, re
class TerminalController:
"""
A class that can be used to portably generate formatted output to
a terminal.
`TerminalController` defines a set of instance variables whose
values are initialized to the control sequence necessary to
perform a given action. These can be simply included in normal
output to the terminal:
>>> term = TerminalController()
>>> print 'This is '+term.GREEN+'green'+term.NORMAL
Alternatively, the `render()` method can used, which replaces
'${action}' with the string required to perform 'action':
>>> term = TerminalController()
>>> print term.render('This is ${GREEN}green${NORMAL}')
If the terminal doesn't support a given action, then the value of
the corresponding instance variable will be set to ''. As a
result, the above code will still work on terminals that do not
support color, except that their output will not be colored.
Also, this means that you can test whether the terminal supports a
given action by simply testing the truth value of the
corresponding instance variable:
>>> term = TerminalController()
>>> if term.CLEAR_SCREEN:
... print 'This terminal supports clearning the screen.'
Finally, if the width and height of the terminal are known, then
they will be stored in the `COLS` and `LINES` attributes.
"""
# Cursor movement:
BOL = '' #: Move the cursor to the beginning of the line
UP = '' #: Move the cursor up one line
DOWN = '' #: Move the cursor down one line
LEFT = '' #: Move the cursor left one char
RIGHT = '' #: Move the cursor right one char
# Deletion:
CLEAR_SCREEN = '' #: Clear the screen and move to home position
CLEAR_EOL = '' #: Clear to the end of the line.
CLEAR_BOL = '' #: Clear to the beginning of the line.
CLEAR_EOS = '' #: Clear to the end of the screen
# Output modes:
BOLD = '' #: Turn on bold mode
BLINK = '' #: Turn on blink mode
DIM = '' #: Turn on half-bright mode
REVERSE = '' #: Turn on reverse-video mode
NORMAL = '' #: Turn off all modes
# Cursor display:
HIDE_CURSOR = '' #: Make the cursor invisible
SHOW_CURSOR = '' #: Make the cursor visible
# Terminal size:
COLS = None #: Width of the terminal (None for unknown)
LINES = None #: Height of the terminal (None for unknown)
# Foreground colors:
BLACK = BLUE = GREEN = CYAN = RED = MAGENTA = YELLOW = WHITE = ''
# Background colors:
BG_BLACK = BG_BLUE = BG_GREEN = BG_CYAN = ''
BG_RED = BG_MAGENTA = BG_YELLOW = BG_WHITE = ''
_STRING_CAPABILITIES = """
BOL=cr UP=cuu1 DOWN=cud1 LEFT=cub1 RIGHT=cuf1
CLEAR_SCREEN=clear CLEAR_EOL=el CLEAR_BOL=el1 CLEAR_EOS=ed BOLD=bold
BLINK=blink DIM=dim REVERSE=rev UNDERLINE=smul NORMAL=sgr0
HIDE_CURSOR=cinvis SHOW_CURSOR=cnorm""".split()
_COLORS = """BLACK BLUE GREEN CYAN RED MAGENTA YELLOW WHITE""".split()
_ANSICOLORS = "BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE".split()
def __init__(self, term_stream=sys.stdout):
"""
Create a `TerminalController` and initialize its attributes
with appropriate values for the current terminal.
`term_stream` is the stream that will be used for terminal
output; if this stream is not a tty, then the terminal is
assumed to be a dumb terminal (i.e., have no capabilities).
"""
# Curses isn't available on all platforms
try: import curses
except: return
# If the stream isn't a tty, then assume it has no capabilities.
if not term_stream.isatty(): return
# Check the terminal type. If we fail, then assume that the
# terminal has no capabilities.
try: curses.setupterm()
except: return
# Look up numeric capabilities.
self.COLS = curses.tigetnum('cols')
self.LINES = curses.tigetnum('lines')
# Look up string capabilities.
for capability in self._STRING_CAPABILITIES:
(attrib, cap_name) = capability.split('=')
setattr(self, attrib, self._tigetstr(cap_name) or '')
# Colors
set_fg = self._tigetstr('setf')
if set_fg:
for i,color in zip(range(len(self._COLORS)), self._COLORS):
setattr(self, color, curses.tparm(set_fg, i) or '')
set_fg_ansi = self._tigetstr('setaf')
if set_fg_ansi:
for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
setattr(self, color, curses.tparm(set_fg_ansi, i) or '')
set_bg = self._tigetstr('setb')
if set_bg:
for i,color in zip(range(len(self._COLORS)), self._COLORS):
setattr(self, 'BG_'+color, curses.tparm(set_bg, i) or '')
set_bg_ansi = self._tigetstr('setab')
if set_bg_ansi:
for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
setattr(self, 'BG_'+color, curses.tparm(set_bg_ansi, i) or '')
def _tigetstr(self, cap_name):
# String capabilities can include "delays" of the form "$<2>".
# For any modern terminal, we should be able to just ignore
# these, so strip them out.
import curses
cap = curses.tigetstr(cap_name) or ''
return re.sub(r'\$<\d+>[/*]?', '', cap)
def render(self, template):
"""
Replace each $-substitutions in the given template string with
the corresponding terminal control string (if it's defined) or
'' (if it's not).
"""
return re.sub(r'\$\$|\${\w+}', self._render_sub, template)
def _render_sub(self, match):
s = match.group()
if s == '$$': return s
else: return getattr(self, s[2:-1])
#######################################################################
# Example use case: progress bar
#######################################################################
class ProgressBar:
"""
A 3-line progress bar, which looks like::
Header
20% [===========----------------------------------]
progress message
The progress bar is colored, if the terminal supports color
output; and adjusts to the width of the terminal.
"""
BAR = '%3d%% ${GREEN}[${BOLD}%s%s${NORMAL}${GREEN}]${NORMAL}\n'
HEADER = '${BOLD}${CYAN}%s${NORMAL}\n\n'
def __init__(self, term, header):
self.term = term
if not (self.term.CLEAR_EOL and self.term.UP and self.term.BOL):
raise ValueError("Terminal isn't capable enough -- you "
"should use a simpler progress dispaly.")
self.width = self.term.COLS or 75
self.bar = term.render(self.BAR)
self.header = self.term.render(self.HEADER % header.center(self.width))
self.cleared = 1 #: true if we haven't drawn the bar yet.
self.update(0, '')
def update(self, percent, message):
if self.cleared:
sys.stdout.write(self.header)
self.cleared = 0
n = int((self.width-10)*percent)
sys.stdout.write(
self.term.BOL + self.term.UP + self.term.CLEAR_EOL +
(self.bar % (100*percent, '='*n, '-'*(self.width-10-n))) +
self.term.CLEAR_EOL + message.center(self.width))
def clear(self):
if not self.cleared:
sys.stdout.write(self.term.BOL + self.term.CLEAR_EOL +
self.term.UP + self.term.CLEAR_EOL +
self.term.UP + self.term.CLEAR_EOL)
self.cleared = 1

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""\
@file test_win32_manifest.py
@brief Test an assembly binding version and uniqueness in a windows dll or exe.

View File

@@ -1,508 +0,0 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() or uuid4().
Note that uuid1() may compromise privacy since it creates a UUID containing
the computer's network address. uuid4() creates a random UUID.
Typical usage:
>>> import uuid
# make a UUID based on the host ID and current time
>>> uuid.uuid1()
UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')
# make a UUID using an MD5 hash of a namespace UUID and a name
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
# make a random UUID
>>> uuid.uuid4()
UUID('16fd2706-8baf-433b-82eb-8c7fada847da')
# make a UUID using a SHA-1 hash of a namespace UUID and a name
>>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
# make a UUID from a string of hex digits (braces and hyphens ignored)
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
# convert a UUID to a string of hex digits in standard form
>>> str(x)
'00010203-0405-0607-0809-0a0b0c0d0e0f'
# get the raw 16 bytes of the UUID
>>> x.bytes
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'
# make a UUID from a 16-byte string
>>> uuid.UUID(bytes=x.bytes)
UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
This module works with Python 2.3 or higher."""
__author__ = 'Ka-Ping Yee <ping@zesty.ca>'
__date__ = '$Date: 2006/06/12 23:15:40 $'.split()[1].replace('/', '-')
__version__ = '$Revision: 1.30 $'.split()[1]
RESERVED_NCS, RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE = [
'reserved for NCS compatibility', 'specified in RFC 4122',
'reserved for Microsoft compatibility', 'reserved for future definition']
class UUID(object):
"""Instances of the UUID class represent UUIDs as specified in RFC 4122.
UUID objects are immutable, hashable, and usable as dictionary keys.
Converting a UUID to a string with str() yields something in the form
'12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts
four possible forms: a similar string of hexadecimal digits, or a
string of 16 raw bytes as an argument named 'bytes', or a tuple of
six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
48-bit values respectively) as an argument named 'fields', or a single
128-bit integer as an argument named 'int'.
UUIDs have these read-only attributes:
bytes the UUID as a 16-byte string
fields a tuple of the six integer fields of the UUID,
which are also available as six individual attributes
and two derived attributes:
time_low the first 32 bits of the UUID
time_mid the next 16 bits of the UUID
time_hi_version the next 16 bits of the UUID
clock_seq_hi_variant the next 8 bits of the UUID
clock_seq_low the next 8 bits of the UUID
node the last 48 bits of the UUID
time the 60-bit timestamp
clock_seq the 14-bit sequence number
hex the UUID as a 32-character hexadecimal string
int the UUID as a 128-bit integer
urn the UUID as a URN as specified in RFC 4122
variant the UUID variant (one of the constants RESERVED_NCS,
RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)
version the UUID version number (1 through 5, meaningful only
when the variant is RFC_4122)
"""
def __init__(self, hex=None, bytes=None, fields=None, int=None,
version=None):
r"""Create a UUID from either a string of 32 hexadecimal digits,
a string of 16 bytes as the 'bytes' argument, a tuple of six
integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
the 'fields' argument, or a single 128-bit integer as the 'int'
argument. When a string of hex digits is given, curly braces,
hyphens, and a URN prefix are all optional. For example, these
expressions all yield the same UUID:
UUID('{12345678-1234-5678-1234-567812345678}')
UUID('12345678123456781234567812345678')
UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
UUID(bytes='\x12\x34\x56\x78'*4)
UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
UUID(int=0x12345678123456781234567812345678)
Exactly one of 'hex', 'bytes', 'fields', or 'int' must be given.
The 'version' argument is optional; if given, the resulting UUID
will have its variant and version number set according to RFC 4122,
overriding bits in the given 'hex', 'bytes', 'fields', or 'int'.
"""
if [hex, bytes, fields, int].count(None) != 3:
raise TypeError('need just one of hex, bytes, fields, or int')
if hex is not None:
hex = hex.replace('urn:', '').replace('uuid:', '')
hex = hex.strip('{}').replace('-', '')
if len(hex) != 32:
raise ValueError('badly formed hexadecimal UUID string')
int = long(hex, 16)
if bytes is not None:
if len(bytes) != 16:
raise ValueError('bytes is not a 16-char string')
int = long(('%02x'*16) % tuple(map(ord, bytes)), 16)
if fields is not None:
if len(fields) != 6:
raise ValueError('fields is not a 6-tuple')
(time_low, time_mid, time_hi_version,
clock_seq_hi_variant, clock_seq_low, node) = fields
if not 0 <= time_low < 1<<32L:
raise ValueError('field 1 out of range (need a 32-bit value)')
if not 0 <= time_mid < 1<<16L:
raise ValueError('field 2 out of range (need a 16-bit value)')
if not 0 <= time_hi_version < 1<<16L:
raise ValueError('field 3 out of range (need a 16-bit value)')
if not 0 <= clock_seq_hi_variant < 1<<8L:
raise ValueError('field 4 out of range (need an 8-bit value)')
if not 0 <= clock_seq_low < 1<<8L:
raise ValueError('field 5 out of range (need an 8-bit value)')
if not 0 <= node < 1<<48L:
raise ValueError('field 6 out of range (need a 48-bit value)')
clock_seq = (clock_seq_hi_variant << 8L) | clock_seq_low
int = ((time_low << 96L) | (time_mid << 80L) |
(time_hi_version << 64L) | (clock_seq << 48L) | node)
if int is not None:
if not 0 <= int < 1<<128L:
raise ValueError('int is out of range (need a 128-bit value)')
if version is not None:
if not 1 <= version <= 5:
raise ValueError('illegal version number')
# Set the variant to RFC 4122.
int &= ~(0xc000 << 48L)
int |= 0x8000 << 48L
# Set the version number.
int &= ~(0xf000 << 64L)
int |= version << 76L
self.__dict__['int'] = int
def __cmp__(self, other):
if isinstance(other, UUID):
return cmp(self.int, other.int)
return NotImplemented
def __hash__(self):
return hash(self.int)
def __int__(self):
return self.int
def __repr__(self):
return 'UUID(%r)' % str(self)
def __setattr__(self, name, value):
raise TypeError('UUID objects are immutable')
def __str__(self):
hex = '%032x' % self.int
return '%s-%s-%s-%s-%s' % (
hex[:8], hex[8:12], hex[12:16], hex[16:20], hex[20:])
def get_bytes(self):
bytes = ''
for shift in range(0, 128, 8):
bytes = chr((self.int >> shift) & 0xff) + bytes
return bytes
bytes = property(get_bytes)
def get_fields(self):
return (self.time_low, self.time_mid, self.time_hi_version,
self.clock_seq_hi_variant, self.clock_seq_low, self.node)
fields = property(get_fields)
def get_time_low(self):
return self.int >> 96L
time_low = property(get_time_low)
def get_time_mid(self):
return (self.int >> 80L) & 0xffff
time_mid = property(get_time_mid)
def get_time_hi_version(self):
return (self.int >> 64L) & 0xffff
time_hi_version = property(get_time_hi_version)
def get_clock_seq_hi_variant(self):
return (self.int >> 56L) & 0xff
clock_seq_hi_variant = property(get_clock_seq_hi_variant)
def get_clock_seq_low(self):
return (self.int >> 48L) & 0xff
clock_seq_low = property(get_clock_seq_low)
def get_time(self):
return (((self.time_hi_version & 0x0fffL) << 48L) |
(self.time_mid << 32L) | self.time_low)
time = property(get_time)
def get_clock_seq(self):
return (((self.clock_seq_hi_variant & 0x3fL) << 8L) |
self.clock_seq_low)
clock_seq = property(get_clock_seq)
def get_node(self):
return self.int & 0xffffffffffff
node = property(get_node)
def get_hex(self):
return '%032x' % self.int
hex = property(get_hex)
def get_urn(self):
return 'urn:uuid:' + str(self)
urn = property(get_urn)
def get_variant(self):
if not self.int & (0x8000 << 48L):
return RESERVED_NCS
elif not self.int & (0x4000 << 48L):
return RFC_4122
elif not self.int & (0x2000 << 48L):
return RESERVED_MICROSOFT
else:
return RESERVED_FUTURE
variant = property(get_variant)
def get_version(self):
# The version bits are only meaningful for RFC 4122 UUIDs.
if self.variant == RFC_4122:
return int((self.int >> 76L) & 0xf)
version = property(get_version)
def _ifconfig_getnode():
"""Get the hardware address on Unix by running ifconfig."""
import os
for dir in ['', '/sbin/', '/usr/sbin']:
try:
path = os.path.join(dir, 'ifconfig')
if os.path.exists(path):
pipe = os.popen(path)
else:
continue
except IOError:
continue
for line in pipe:
words = line.lower().split()
for i in range(len(words)):
if words[i] in ['hwaddr', 'ether']:
return int(words[i + 1].replace(':', ''), 16)
def _ipconfig_getnode():
"""Get the hardware address on Windows by running ipconfig.exe."""
import os, re
dirs = ['', r'c:\windows\system32', r'c:\winnt\system32']
try:
import ctypes
buffer = ctypes.create_string_buffer(300)
ctypes.windll.kernel32.GetSystemDirectoryA(buffer, 300)
dirs.insert(0, buffer.value.decode('mbcs'))
except:
pass
for dir in dirs:
try:
pipe = os.popen(os.path.join(dir, 'ipconfig') + ' /all')
except IOError:
continue
for line in pipe:
value = line.split(':')[-1].strip().lower()
if re.match('([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
return int(value.replace('-', ''), 16)
def _netbios_getnode():
"""Get the hardware address on Windows using NetBIOS calls.
See http://support.microsoft.com/kb/118623 for details."""
import win32wnet, netbios
ncb = netbios.NCB()
ncb.Command = netbios.NCBENUM
ncb.Buffer = adapters = netbios.LANA_ENUM()
adapters._pack()
if win32wnet.Netbios(ncb) != 0:
return
adapters._unpack()
for i in range(adapters.length):
ncb.Reset()
ncb.Command = netbios.NCBRESET
ncb.Lana_num = ord(adapters.lana[i])
if win32wnet.Netbios(ncb) != 0:
continue
ncb.Reset()
ncb.Command = netbios.NCBASTAT
ncb.Lana_num = ord(adapters.lana[i])
ncb.Callname = '*'.ljust(16)
ncb.Buffer = status = netbios.ADAPTER_STATUS()
if win32wnet.Netbios(ncb) != 0:
continue
status._unpack()
bytes = map(ord, status.adapter_address)
return ((bytes[0]<<40L) + (bytes[1]<<32L) + (bytes[2]<<24L) +
(bytes[3]<<16L) + (bytes[4]<<8L) + bytes[5])
# Thanks to Thomas Heller for ctypes and for his help with its use here.
# If ctypes is available, use it to find system routines for UUID generation.
_uuid_generate_random = _uuid_generate_time = _UuidCreate = None
try:
import ctypes, ctypes.util
_buffer = ctypes.create_string_buffer(16)
# The uuid_generate_* routines are provided by libuuid on at least
# Linux and FreeBSD, and provided by libc on Mac OS X.
for libname in ['uuid', 'c']:
try:
lib = ctypes.CDLL(ctypes.util.find_library(libname))
except:
continue
if hasattr(lib, 'uuid_generate_random'):
_uuid_generate_random = lib.uuid_generate_random
if hasattr(lib, 'uuid_generate_time'):
_uuid_generate_time = lib.uuid_generate_time
# On Windows prior to 2000, UuidCreate gives a UUID containing the
# hardware address. On Windows 2000 and later, UuidCreate makes a
# random UUID and UuidCreateSequential gives a UUID containing the
# hardware address. These routines are provided by the RPC runtime.
try:
lib = ctypes.windll.rpcrt4
except:
lib = None
_UuidCreate = getattr(lib, 'UuidCreateSequential',
getattr(lib, 'UuidCreate', None))
except:
pass
def _unixdll_getnode():
"""Get the hardware address on Unix using ctypes."""
_uuid_generate_time(_buffer)
return UUID(bytes=_buffer.raw).node
def _windll_getnode():
"""Get the hardware address on Windows using ctypes."""
if _UuidCreate(_buffer) == 0:
return UUID(bytes=_buffer.raw).node
def _random_getnode():
"""Get a random node ID, with eighth bit set as suggested by RFC 4122."""
import random
return random.randrange(0, 1<<48L) | 0x010000000000L
_node = None
def getnode():
"""Get the hardware address as a 48-bit integer. The first time this
runs, it may launch a separate program, which could be quite slow. If
all attempts to obtain the hardware address fail, we choose a random
48-bit number with its eighth bit set to 1 as recommended in RFC 4122."""
global _node
if _node is not None:
return _node
import sys
if sys.platform == 'win32':
getters = [_windll_getnode, _netbios_getnode, _ipconfig_getnode]
else:
getters = [_unixdll_getnode, _ifconfig_getnode]
for getter in getters + [_random_getnode]:
try:
_node = getter()
except:
continue
if _node is not None:
return _node
def uuid1(node=None, clock_seq=None):
"""Generate a UUID from a host ID, sequence number, and the current time.
If 'node' is not given, getnode() is used to obtain the hardware
address. If 'clock_seq' is given, it is used as the sequence number;
otherwise a random 14-bit sequence number is chosen."""
# When the system provides a version-1 UUID generator, use it (but don't
# use UuidCreate here because its UUIDs don't conform to RFC 4122).
if _uuid_generate_time and node is clock_seq is None:
_uuid_generate_time(_buffer)
return UUID(bytes=_buffer.raw)
import time
nanoseconds = int(time.time() * 1e9)
# 0x01b21dd213814000 is the number of 100-ns intervals between the
# UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
timestamp = int(nanoseconds/100) + 0x01b21dd213814000L
if clock_seq is None:
import random
clock_seq = random.randrange(1<<14L) # instead of stable storage
time_low = timestamp & 0xffffffffL
time_mid = (timestamp >> 32L) & 0xffffL
time_hi_version = (timestamp >> 48L) & 0x0fffL
clock_seq_low = clock_seq & 0xffL
clock_seq_hi_variant = (clock_seq >> 8L) & 0x3fL
if node is None:
node = getnode()
return UUID(fields=(time_low, time_mid, time_hi_version,
clock_seq_hi_variant, clock_seq_low, node), version=1)
def uuid3(namespace, name):
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
try:
# Python 2.6
from hashlib import md5
except ImportError:
# Python 2.5 and earlier
from md5 import new as md5
hash = md5(namespace.bytes + name).digest()
return UUID(bytes=hash[:16], version=3)
def uuid4():
"""Generate a random UUID."""
# When the system provides a version-4 UUID generator, use it.
if _uuid_generate_random:
_uuid_generate_random(_buffer)
return UUID(bytes=_buffer.raw)
# Otherwise, get randomness from urandom or the 'random' module.
try:
import os
return UUID(bytes=os.urandom(16), version=4)
except:
import random
bytes = [chr(random.randrange(256)) for i in range(16)]
return UUID(bytes=bytes, version=4)
def uuid5(namespace, name):
"""Generate a UUID from the SHA-1 hash of a namespace UUID and a name."""
import sha
hash = sha.sha(namespace.bytes + name).digest()
return UUID(bytes=hash[:16], version=5)
# The following standard UUIDs are for use with uuid3() or uuid5().
NAMESPACE_DNS = UUID('6ba7b810-9dad-11d1-80b4-00c04fd430c8')
NAMESPACE_URL = UUID('6ba7b811-9dad-11d1-80b4-00c04fd430c8')
NAMESPACE_OID = UUID('6ba7b812-9dad-11d1-80b4-00c04fd430c8')
NAMESPACE_X500 = UUID('6ba7b814-9dad-11d1-80b4-00c04fd430c8')

View File

@@ -436,7 +436,7 @@ public:
}
~MyMicroAllocator(void)
virtual ~MyMicroAllocator()
{
if ( mMicroChunks )
{
@@ -746,7 +746,7 @@ public:
mMicro = createMicroAllocator(this,defaultChunkSize);
}
~MyHeapManager(void)
virtual ~MyHeapManager()
{
releaseMicroAllocator(mMicro);
}

View File

@@ -33,3 +33,8 @@ set_source_files_properties(${libndhacd_HEADER_FILES}
add_library( nd_hacdConvexDecomposition STATIC ${libndhacd_SOURCE_FILES} ${libndhacd_HEADER_FILES})
target_link_libraries(
nd_hacdConvexDecomposition
PUBLIC
llcommon
)

View File

@@ -26,6 +26,7 @@ set(openjpeg_SOURCE_FILES
mct.c
mqc.c
openjpeg.c
opj_malloc.c
phix_manager.c
pi.c
ppix_manager.c

View File

@@ -31,11 +31,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#define OPJ_SKIP_POISON
#include "opj_includes.h"
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#include "opj_includes.h"
#if defined(__GNUC__)
#pragma GCC poison malloc calloc realloc free
#endif
/** @defgroup DWT DWT - Implementation of a discrete wavelet transform */
/*@{*/
@@ -499,7 +504,7 @@ void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec) {
/* <summary> */
/* Determine maximum computed resolution level for inverse wavelet transform */
/* </summary> */
static int dwt_decode_max_resolution(opj_tcd_resolution_t* restrict r, int i) {
static int dwt_decode_max_resolution(opj_tcd_resolution_t* OPJ_RESTRICT r, int i) {
int mr = 1;
int w;
while( --i ) {
@@ -531,7 +536,7 @@ static void dwt_decode_tile(opj_tcd_tilecomp_t* tilec, int numres, DWT1DFN dwt_1
v.mem = h.mem;
while( --numres) {
int * restrict tiledp = tilec->data;
int * OPJ_RESTRICT tiledp = tilec->data;
int j;
++tr;
@@ -565,48 +570,49 @@ static void dwt_decode_tile(opj_tcd_tilecomp_t* tilec, int numres, DWT1DFN dwt_1
opj_aligned_free(h.mem);
}
static void v4dwt_interleave_h(v4dwt_t* restrict w, float* restrict a, int x, int size){
float* restrict bi = (float*) (w->wavelet + w->cas);
static void v4dwt_interleave_h(v4dwt_t* OPJ_RESTRICT w, float* OPJ_RESTRICT a, int x, int size) {
float* OPJ_RESTRICT bi = (float*)(w->wavelet + w->cas);
int count = w->sn;
int i, k;
for(k = 0; k < 2; ++k){
if (count + 3 * x < size && ((size_t) a & 0x0f) == 0 && ((size_t) bi & 0x0f) == 0 && (x & 0x0f) == 0) {
for (k = 0; k < 2; ++k) {
if (count + 3 * x < size && ((size_t)a & 0x0f) == 0 && ((size_t)bi & 0x0f) == 0 && (x & 0x0f) == 0) {
/* Fast code path */
for(i = 0; i < count; ++i){
for (i = 0; i < count; ++i) {
int j = i;
bi[i*8 ] = a[j];
bi[i * 8] = a[j];
j += x;
bi[i*8 + 1] = a[j];
bi[i * 8 + 1] = a[j];
j += x;
bi[i*8 + 2] = a[j];
bi[i * 8 + 2] = a[j];
j += x;
bi[i*8 + 3] = a[j];
bi[i * 8 + 3] = a[j];
}
} else {
}
else {
/* Slow code path */
for(i = 0; i < count; ++i){
int j = i;
bi[i*8 ] = a[j];
j += x;
if(j > size) continue;
bi[i*8 + 1] = a[j];
j += x;
if(j > size) continue;
bi[i*8 + 2] = a[j];
j += x;
if(j > size) continue;
bi[i*8 + 3] = a[j];
for (i = 0; i < count; ++i) {
int j = i;
bi[i * 8] = a[j];
j += x;
if (j > size) continue;
bi[i * 8 + 1] = a[j];
j += x;
if (j > size) continue;
bi[i * 8 + 2] = a[j];
j += x;
if (j > size) continue;
bi[i * 8 + 3] = a[j];
}
}
}
bi = (float*) (w->wavelet + 1 - w->cas);
bi = (float*)(w->wavelet + 1 - w->cas);
a += w->sn;
size -= w->sn;
count = w->dn;
}
}
static void v4dwt_interleave_v(v4dwt_t* restrict v , float* restrict a , int x){
v4* restrict bi = v->wavelet + v->cas;
static void v4dwt_interleave_v(v4dwt_t* OPJ_RESTRICT v , float* OPJ_RESTRICT a , int x){
v4* OPJ_RESTRICT bi = v->wavelet + v->cas;
int i;
for(i = 0; i < v->sn; ++i){
memcpy(&bi[i*2], &a[i*x], 4 * sizeof(float));
@@ -621,7 +627,7 @@ static void v4dwt_interleave_v(v4dwt_t* restrict v , float* restrict a , int x){
#ifdef __SSE__
static void v4dwt_decode_step1_sse(v4* w, int count, const __m128 c){
__m128* restrict vw = (__m128*) w;
__m128* OPJ_RESTRICT vw = (__m128*) w;
int i;
/* 4x unrolled loop */
for(i = 0; i < count >> 2; ++i){
@@ -642,22 +648,39 @@ static void v4dwt_decode_step1_sse(v4* w, int count, const __m128 c){
}
static void v4dwt_decode_step2_sse(v4* l, v4* w, int k, int m, __m128 c){
__m128* restrict vl = (__m128*) l;
__m128* restrict vw = (__m128*) w;
__m128* OPJ_RESTRICT vl = (__m128*) l;
__m128* OPJ_RESTRICT vw = (__m128*) w;
int i;
__m128 tmp1, tmp2, tmp3;
tmp1 = vl[0];
for(i = 0; i < m; ++i){
for (i = 0; i < m - 3; i += 4) {
__m128 tmp4, tmp5, tmp6, tmp7, tmp8, tmp9;
tmp2 = vw[-1];
tmp3 = vw[0];
tmp4 = vw[1];
tmp5 = vw[2];
tmp6 = vw[3];
tmp7 = vw[4];
tmp8 = vw[5];
tmp9 = vw[6];
vw[-1] = _mm_add_ps(tmp2, _mm_mul_ps(_mm_add_ps(tmp1, tmp3), c));
vw[1] = _mm_add_ps(tmp4, _mm_mul_ps(_mm_add_ps(tmp3, tmp5), c));
vw[3] = _mm_add_ps(tmp6, _mm_mul_ps(_mm_add_ps(tmp5, tmp7), c));
vw[5] = _mm_add_ps(tmp8, _mm_mul_ps(_mm_add_ps(tmp7, tmp9), c));
tmp1 = tmp9;
vw += 8;
}
for ( ; i < m; ++i) {
tmp2 = vw[-1];
tmp3 = vw[ 0];
vw[-1] = _mm_add_ps(tmp2, _mm_mul_ps(_mm_add_ps(tmp1, tmp3), c));
tmp1 = tmp3;
vw += 2;
}
vl = vw - 2;
if(m >= k){
return;
}
vl = vw - 2;
c = _mm_add_ps(c, c);
c = _mm_mul_ps(c, vl[0]);
for(; m < k; ++m){
@@ -670,7 +693,7 @@ static void v4dwt_decode_step2_sse(v4* l, v4* w, int k, int m, __m128 c){
#else
static void v4dwt_decode_step1(v4* w, int count, const float c){
float* restrict fw = (float*) w;
float* OPJ_RESTRICT fw = (float*) w;
int i;
for(i = 0; i < count; ++i){
float tmp1 = fw[i*8 ];
@@ -685,8 +708,8 @@ static void v4dwt_decode_step1(v4* w, int count, const float c){
}
static void v4dwt_decode_step2(v4* l, v4* w, int k, int m, float c){
float* restrict fl = (float*) l;
float* restrict fw = (float*) w;
float* OPJ_RESTRICT fl = (float*) l;
float* OPJ_RESTRICT fw = (float*) w;
int i;
for(i = 0; i < m; ++i){
float tmp1_1 = fl[0];
@@ -737,42 +760,44 @@ static void v4dwt_decode_step2(v4* l, v4* w, int k, int m, float c){
/* <summary> */
/* Inverse 9-7 wavelet transform in 1-D. */
/* </summary> */
static void v4dwt_decode(v4dwt_t* restrict dwt){
static void v4dwt_decode(v4dwt_t* OPJ_RESTRICT dwt){
int a, b;
if(dwt->cas == 0) {
if(!((dwt->dn > 0) || (dwt->sn > 1))){
if (dwt->dn <= 0 && dwt->sn <= 1) {
return;
}
a = 0;
b = 1;
}else{
if(!((dwt->sn > 0) || (dwt->dn > 1))) {
if (dwt->sn <= 0 && dwt->dn <= 1) {
return;
}
a = 1;
b = 0;
}
v4* OPJ_RESTRICT waveleta = dwt->wavelet + a;
v4* OPJ_RESTRICT waveletb = dwt->wavelet + b;
#ifdef __SSE__
v4dwt_decode_step1_sse(dwt->wavelet+a, dwt->sn, _mm_set1_ps(K));
v4dwt_decode_step1_sse(dwt->wavelet+b, dwt->dn, _mm_set1_ps(c13318));
v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(dwt_delta));
v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(dwt_gamma));
v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(dwt_beta));
v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(dwt_alpha));
v4dwt_decode_step1_sse(waveleta, dwt->sn, _mm_set1_ps(K));
v4dwt_decode_step1_sse(waveletb, dwt->dn, _mm_set1_ps(c13318));
v4dwt_decode_step2_sse(waveletb, waveleta + 1, dwt->sn, int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(dwt_delta));
v4dwt_decode_step2_sse(waveleta, waveletb + 1, dwt->dn, int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(dwt_gamma));
v4dwt_decode_step2_sse(waveletb, waveleta + 1, dwt->sn, int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(dwt_beta));
v4dwt_decode_step2_sse(waveleta, waveletb + 1, dwt->dn, int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(dwt_alpha));
#else
v4dwt_decode_step1(dwt->wavelet+a, dwt->sn, K);
v4dwt_decode_step1(dwt->wavelet+b, dwt->dn, c13318);
v4dwt_decode_step2(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, int_min(dwt->sn, dwt->dn-a), dwt_delta);
v4dwt_decode_step2(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, int_min(dwt->dn, dwt->sn-b), dwt_gamma);
v4dwt_decode_step2(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, int_min(dwt->sn, dwt->dn-a), dwt_beta);
v4dwt_decode_step2(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, int_min(dwt->dn, dwt->sn-b), dwt_alpha);
v4dwt_decode_step1(waveleta, dwt->sn, K);
v4dwt_decode_step1(waveletb, dwt->dn, c13318);
v4dwt_decode_step2(waveletb, waveleta + 1, dwt->sn, int_min(dwt->sn, dwt->dn-a), dwt_delta);
v4dwt_decode_step2(waveleta, waveletb + 1, dwt->dn, int_min(dwt->dn, dwt->sn-b), dwt_gamma);
v4dwt_decode_step2(waveletb, waveleta + 1, dwt->sn, int_min(dwt->sn, dwt->dn-a), dwt_beta);
v4dwt_decode_step2(waveleta, waveletb + 1, dwt->dn, int_min(dwt->dn, dwt->sn-b), dwt_alpha);
#endif
}
/* <summary> */
/* Inverse 9-7 wavelet transform in 2-D. */
/* </summary> */
void dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, int numres){
void dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec, int numres){
v4dwt_t h;
v4dwt_t v;
@@ -787,7 +812,7 @@ void dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, int numres){
v.wavelet = h.wavelet;
while( --numres) {
float * restrict aj = (float*) tilec->data;
float * OPJ_RESTRICT aj = (float*) tilec->data;
int bufsize = (tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0);
int j;

View File

@@ -29,11 +29,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#define OPJ_SKIP_POISON
#include "opj_includes.h"
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#include "opj_includes.h"
#if defined(__GNUC__)
#pragma GCC poison malloc calloc realloc free
#endif
/* <summary> */
/* This table contains the norms of the basis function of the reversible MCT. */
@@ -49,17 +54,38 @@ static const double mct_norms_real[3] = { 1.732, 1.805, 1.573 };
/* Foward reversible MCT. */
/* </summary> */
void mct_encode(
int* restrict c0,
int* restrict c1,
int* restrict c2,
int* OPJ_RESTRICT c0,
int* OPJ_RESTRICT c1,
int* OPJ_RESTRICT c2,
int n)
{
int i;
for(i = 0; i < n; ++i) {
int i = 0;
#ifdef __SSE2__
/* Buffers are normally aligned on 16 bytes... */
if (((size_t)c0 & 0xf) == 0 && ((size_t)c1 & 0xf) == 0 && ((size_t)c2 & 0xf) == 0) {
const int cnt = n & ~3U;
for (; i < cnt; i += 4) {
__m128i y, u, v;
__m128i r = _mm_load_si128((const __m128i*) & (c0[i]));
__m128i g = _mm_load_si128((const __m128i*) & (c1[i]));
__m128i b = _mm_load_si128((const __m128i*) & (c2[i]));
y = _mm_add_epi32(g, g);
y = _mm_add_epi32(y, b);
y = _mm_add_epi32(y, r);
y = _mm_srai_epi32(y, 2);
u = _mm_sub_epi32(b, g);
v = _mm_sub_epi32(r, g);
_mm_store_si128((__m128i*) & (c0[i]), y);
_mm_store_si128((__m128i*) & (c1[i]), u);
_mm_store_si128((__m128i*) & (c2[i]), v);
}
}
#endif
for (; i < n; ++i) {
int r = c0[i];
int g = c1[i];
int b = c2[i];
int y = (r + (g * 2) + b) >> 2;
int y = (r + g + g + b) >> 2;
int u = b - g;
int v = r - g;
c0[i] = y;
@@ -72,13 +98,32 @@ void mct_encode(
/* Inverse reversible MCT. */
/* </summary> */
void mct_decode(
int* restrict c0,
int* restrict c1,
int* restrict c2,
int* OPJ_RESTRICT c0,
int* OPJ_RESTRICT c1,
int* OPJ_RESTRICT c2,
int n)
{
int i;
for (i = 0; i < n; ++i) {
int i = 0;
#ifdef __SSE2__
/* Buffers are normally aligned on 16 bytes... */
if (((size_t)c0 & 0xf) == 0 && ((size_t)c1 & 0xf) == 0 && ((size_t)c2 & 0xf) == 0) {
const int cnt = n & ~3U;
for (; i < cnt; i += 4) {
__m128i r, g, b;
__m128i y = _mm_load_si128((const __m128i*) & (c0[i]));
__m128i u = _mm_load_si128((const __m128i*) & (c1[i]));
__m128i v = _mm_load_si128((const __m128i*) & (c2[i]));
g = y;
g = _mm_sub_epi32(g, _mm_srai_epi32(_mm_add_epi32(u, v), 2));
r = _mm_add_epi32(v, g);
b = _mm_add_epi32(u, g);
_mm_store_si128((__m128i*) & (c0[i]), r);
_mm_store_si128((__m128i*) & (c1[i]), g);
_mm_store_si128((__m128i*) & (c2[i]), b);
}
}
#endif
for (; i < n; ++i) {
int y = c0[i];
int u = c1[i];
int v = c2[i];
@@ -102,13 +147,119 @@ double mct_getnorm(int compno) {
/* Foward irreversible MCT. */
/* </summary> */
void mct_encode_real(
int* restrict c0,
int* restrict c1,
int* restrict c2,
int* OPJ_RESTRICT c0,
int* OPJ_RESTRICT c1,
int* OPJ_RESTRICT c2,
int n)
{
int i;
for(i = 0; i < n; ++i) {
int i = 0;
#ifdef __SSE4_1__
/* Buffers are normally aligned on 16 bytes... */
if (((size_t)c0 & 0xf) == 0 && ((size_t)c1 & 0xf) == 0 && ((size_t)c2 & 0xf) == 0) {
const int cnt = n & ~3U;
const __m128i ry = _mm_set1_epi32(2449);
const __m128i gy = _mm_set1_epi32(4809);
const __m128i by = _mm_set1_epi32(934);
const __m128i ru = _mm_set1_epi32(1382);
const __m128i gu = _mm_set1_epi32(2714);
const __m128i gv = _mm_set1_epi32(3430);
const __m128i bv = _mm_set1_epi32(666);
const __m128i mulround = _mm_shuffle_epi32(_mm_cvtsi32_si128(4096), _MM_SHUFFLE(1, 0, 1, 0));
for (; i < cnt; i += 4) {
__m128i lo, hi, y, u, v;
__m128i r = _mm_load_si128((const __m128i*) & (c0[i]));
__m128i g = _mm_load_si128((const __m128i*) & (c1[i]));
__m128i b = _mm_load_si128((const __m128i*) & (c2[i]));
hi = _mm_shuffle_epi32(r, _MM_SHUFFLE(3, 3, 1, 1));
lo = _mm_mul_epi32(r, ry);
hi = _mm_mul_epi32(hi, ry);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
y = _mm_blend_epi16(lo, hi, 0xCC);
hi = _mm_shuffle_epi32(g, _MM_SHUFFLE(3, 3, 1, 1));
lo = _mm_mul_epi32(g, gy);
hi = _mm_mul_epi32(hi, gy);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
y = _mm_add_epi32(y, _mm_blend_epi16(lo, hi, 0xCC));
hi = _mm_shuffle_epi32(b, _MM_SHUFFLE(3, 3, 1, 1));
lo = _mm_mul_epi32(b, by);
hi = _mm_mul_epi32(hi, by);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
y = _mm_add_epi32(y, _mm_blend_epi16(lo, hi, 0xCC));
_mm_store_si128((__m128i*) & (c0[i]), y);
lo = _mm_cvtepi32_epi64(_mm_shuffle_epi32(b, _MM_SHUFFLE(3, 2, 2, 0)));
hi = _mm_cvtepi32_epi64(_mm_shuffle_epi32(b, _MM_SHUFFLE(3, 2, 3, 1)));
lo = _mm_slli_epi64(lo, 12);
hi = _mm_slli_epi64(hi, 12);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
u = _mm_blend_epi16(lo, hi, 0xCC);
hi = _mm_shuffle_epi32(r, _MM_SHUFFLE(3, 3, 1, 1));
lo = _mm_mul_epi32(r, ru);
hi = _mm_mul_epi32(hi, ru);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
u = _mm_sub_epi32(u, _mm_blend_epi16(lo, hi, 0xCC));
hi = _mm_shuffle_epi32(g, _MM_SHUFFLE(3, 3, 1, 1));
lo = _mm_mul_epi32(g, gu);
hi = _mm_mul_epi32(hi, gu);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
u = _mm_sub_epi32(u, _mm_blend_epi16(lo, hi, 0xCC));
_mm_store_si128((__m128i*) & (c1[i]), u);
lo = _mm_cvtepi32_epi64(_mm_shuffle_epi32(r, _MM_SHUFFLE(3, 2, 2, 0)));
hi = _mm_cvtepi32_epi64(_mm_shuffle_epi32(r, _MM_SHUFFLE(3, 2, 3, 1)));
lo = _mm_slli_epi64(lo, 12);
hi = _mm_slli_epi64(hi, 12);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
v = _mm_blend_epi16(lo, hi, 0xCC);
hi = _mm_shuffle_epi32(g, _MM_SHUFFLE(3, 3, 1, 1));
lo = _mm_mul_epi32(g, gv);
hi = _mm_mul_epi32(hi, gv);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
v = _mm_sub_epi32(v, _mm_blend_epi16(lo, hi, 0xCC));
hi = _mm_shuffle_epi32(b, _MM_SHUFFLE(3, 3, 1, 1));
lo = _mm_mul_epi32(b, bv);
hi = _mm_mul_epi32(hi, bv);
lo = _mm_add_epi64(lo, mulround);
hi = _mm_add_epi64(hi, mulround);
lo = _mm_srli_epi64(lo, 13);
hi = _mm_slli_epi64(hi, 32 - 13);
v = _mm_sub_epi32(v, _mm_blend_epi16(lo, hi, 0xCC));
_mm_store_si128((__m128i*) & (c2[i]), v);
}
}
#endif
for (; i < n; ++i) {
int r = c0[i];
int g = c1[i];
int b = c2[i];
@@ -125,19 +276,21 @@ void mct_encode_real(
/* Inverse irreversible MCT. */
/* </summary> */
void mct_decode_real(
float* restrict c0,
float* restrict c1,
float* restrict c2,
float* OPJ_RESTRICT c0,
float* OPJ_RESTRICT c1,
float* OPJ_RESTRICT c2,
int n)
{
int i;
#ifdef __SSE__
int count;
__m128 vrv, vgu, vgv, vbu;
vrv = _mm_set1_ps(1.402f);
vgu = _mm_set1_ps(0.34413f);
vgv = _mm_set1_ps(0.71414f);
vbu = _mm_set1_ps(1.772f);
for (i = 0; i < (n >> 3); ++i) {
count = n >> 3;
for (i = 0; i < count; ++i) {
__m128 vy, vu, vv;
__m128 vr, vg, vb;
@@ -174,7 +327,7 @@ void mct_decode_real(
float u = c1[i];
float v = c2[i];
float r = y + (v * 1.402f);
float g = y - (u * 0.34413f) - (v * (0.71414f));
float g = y - (u * 0.34413f) - (v * 0.71414f);
float b = y + (u * 1.772f);
c0[i] = r;
c1[i] = g;

View File

@@ -40,33 +40,71 @@
==========================================================
*/
/*
The inline keyword is supported by C99 but not by C90.
Most compilers implement their own version of this keyword ...
*/
#ifndef INLINE
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#endif /* INLINE */
#if defined(OPJ_STATIC) || !defined(_WIN32)
#define OPJ_API
#define OPJ_CALLCONV
#else
#define OPJ_CALLCONV __stdcall
/*
The following ifdef block is the standard way of creating macros which make exporting
The following ifdef block is the standard way of creating macros which make exporting
from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
symbol defined on the command line. this symbol should not be defined on any project
that uses this DLL. This way any other project whose source files include this file see
OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
that uses this DLL. This way any other project whose source files include this file see
OPJ_API functions as being imported from a DLL, whereas this DLL sees symbols
defined with this macro as being exported.
*/
#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
#define OPJ_API __declspec(dllexport)
#else
#define OPJ_API __declspec(dllimport)
#endif /* OPJ_EXPORTS */
# if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
# define OPJ_API __declspec(dllexport)
# else
# define OPJ_API __declspec(dllimport)
# endif /* OPJ_EXPORTS */
#endif /* !OPJ_STATIC || !_WIN32 */
typedef int opj_bool;
#define OPJ_TRUE 1
#define OPJ_FALSE 0
typedef char OPJ_CHAR;
typedef float OPJ_FLOAT32;
typedef double OPJ_FLOAT64;
typedef unsigned char OPJ_BYTE;
#include "opj_stdint.h"
typedef int8_t OPJ_INT8;
typedef uint8_t OPJ_UINT8;
typedef int16_t OPJ_INT16;
typedef uint16_t OPJ_UINT16;
typedef int32_t OPJ_INT32;
typedef uint32_t OPJ_UINT32;
typedef int64_t OPJ_INT64;
typedef uint64_t OPJ_UINT64;
typedef int64_t OPJ_OFF_T; /* 64-bit file offset type */
#include <stdio.h>
typedef size_t OPJ_SIZE_T;
/* Avoid compile-time warning because parameter is not used */
#define OPJ_ARG_NOT_USED(x) (void)(x)
/*
/*
==========================================================
Useful constant definitions
==========================================================

View File

@@ -40,6 +40,8 @@
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#include <assert.h>
#include <limits.h>
/*
==========================================================
@@ -54,56 +56,115 @@
==========================================================
*/
/* Are restricted pointers available? (C99) */
#if (__STDC_VERSION__ >= 199901L)
#define OPJ_RESTRICT restrict
#else
/* Not a C99 compiler */
#if defined(__GNUC__)
#define OPJ_RESTRICT __restrict__
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
#define OPJ_RESTRICT __restrict
#else
#define OPJ_RESTRICT /* restrict */
#endif
#endif
/* Ignore GCC attributes if this is not GCC */
#ifndef __GNUC__
#define __attribute__(x) /* __attribute__(x) */
#endif
/*
The inline keyword is supported by C99 but not by C90.
Most compilers implement their own version of this keyword ...
*/
#ifndef INLINE
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#endif /* INLINE */
/* Are restricted pointers available? (C99) */
#if (__STDC_VERSION__ != 199901L)
/* Not a C99 compiler */
#ifdef __GNUC__
#define restrict __restrict__
#else
#define restrict /* restrict */
#endif
#endif
/* MSVC and Borland C do not have lrintf */
#if defined(_MSC_VER) || defined(__BORLANDC__)
static INLINE long lrintf(float f){
/* MSVC before 2013 and Borland C do not have lrintf */
#if defined(_MSC_VER)
#include <intrin.h>
static INLINE long opj_lrintf(float f)
{
#ifdef _M_X64
return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
#else
return _mm_cvt_ss2si(_mm_load_ss(&f));
/* commented out line breaks many tests */
/* return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f)); */
#elif defined(_M_IX86)
int i;
_asm{
fld f
fistp i
};
return i;
#else
return (long)((f>0.0f) ? (f + 0.5f) : (f - 0.5f));
#endif
}
#elif defined(__BORLANDC__)
static INLINE long opj_lrintf(float f)
{
#ifdef _M_X64
return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
#else
int i;
_asm {
fld f
fistp i
};
return i;
#endif
}
#else
static INLINE long opj_lrintf(float f)
{
return lrintf(f);
}
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1400)
#define vsnprintf _vsnprintf
#endif
/* MSVC x86 is really bad at doing int64 = int32 * int32 on its own. Use intrinsic. */
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
# include <intrin.h>
# pragma intrinsic(__emul)
#endif
/* Apparently Visual Studio doesn't define __SSE__ / __SSE2__ macros */
#if defined(_M_X64)
/* Intel 64bit support SSE and SSE2 */
# ifndef __SSE__
# define __SSE__ 1
# endif
# ifndef __SSE2__
# define __SSE2__ 1
# endif
# if !defined(__SSE4_1__) && defined(__AVX__)
# define __SSE4_1__ 1
# endif
#endif
/* For x86, test the value of the _M_IX86_FP macro. */
/* See https://msdn.microsoft.com/en-us/library/b0084kay.aspx */
#if defined(_M_IX86_FP)
# if _M_IX86_FP >= 1
# ifndef __SSE__
# define __SSE__ 1
# endif
# endif
# if _M_IX86_FP >= 2
# ifndef __SSE2__
# define __SSE2__ 1
# endif
# endif
#endif
/* Type to use for bit-fields in internal headers */
typedef unsigned int OPJ_BITFIELD;
#define OPJ_UNUSED(x) (void)x
#include "j2k_lib.h"
#include "opj_malloc.h"
#include "event.h"

View File

@@ -0,0 +1,249 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2015, Mathieu Malaterre <mathieu.malaterre@gmail.com>
* Copyright (c) 2015, Matthieu Darbois
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define OPJ_SKIP_POISON
#include "opj_includes.h"
#if defined(OPJ_HAVE_MALLOC_H) && defined(OPJ_HAVE_MEMALIGN)
# include <malloc.h>
#endif
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
static INLINE void *opj_aligned_alloc_n(size_t alignment, size_t size)
{
void* ptr;
/* alignment shall be power of 2 */
assert((alignment != 0U) && ((alignment & (alignment - 1U)) == 0U));
/* alignment shall be at least sizeof(void*) */
assert(alignment >= sizeof(void*));
if (size == 0U) { /* prevent implementation defined behavior of realloc */
return NULL;
}
#if defined(OPJ_HAVE_POSIX_MEMALIGN)
/* aligned_alloc requires c11, restrict to posix_memalign for now. Quote:
* This function was introduced in POSIX 1003.1d. Although this function is
* superseded by aligned_alloc, it is more portable to older POSIX systems
* that do not support ISO C11. */
if (posix_memalign(&ptr, alignment, size)) {
ptr = NULL;
}
/* older linux */
#elif defined(OPJ_HAVE_MEMALIGN)
ptr = memalign(alignment, size);
/* _MSC_VER */
#elif defined(OPJ_HAVE__ALIGNED_MALLOC)
ptr = _aligned_malloc(size, alignment);
#else
/*
* Generic aligned malloc implementation.
* Uses size_t offset for the integer manipulation of the pointer,
* as uintptr_t is not available in C89 to do
* bitwise operations on the pointer itself.
*/
alignment--;
{
size_t offset;
OPJ_UINT8 *mem;
/* Room for padding and extra pointer stored in front of allocated area */
size_t overhead = alignment + sizeof(void *);
/* let's be extra careful */
assert(alignment <= (SIZE_MAX - sizeof(void *)));
/* Avoid integer overflow */
if (size > (SIZE_MAX - overhead)) {
return NULL;
}
mem = (OPJ_UINT8*)malloc(size + overhead);
if (mem == NULL) {
return mem;
}
/* offset = ((alignment + 1U) - ((size_t)(mem + sizeof(void*)) & alignment)) & alignment; */
/* Use the fact that alignment + 1U is a power of 2 */
offset = ((alignment ^ ((size_t)(mem + sizeof(void*)) & alignment)) + 1U) &
alignment;
ptr = (void *)(mem + sizeof(void*) + offset);
((void**) ptr)[-1] = mem;
}
#endif
return ptr;
}
static INLINE void *opj_aligned_realloc_n(void *ptr, size_t alignment,
size_t new_size)
{
void *r_ptr;
/* alignment shall be power of 2 */
assert((alignment != 0U) && ((alignment & (alignment - 1U)) == 0U));
/* alignment shall be at least sizeof(void*) */
assert(alignment >= sizeof(void*));
if (new_size == 0U) { /* prevent implementation defined behavior of realloc */
return NULL;
}
/* no portable aligned realloc */
#if defined(OPJ_HAVE_POSIX_MEMALIGN) || defined(OPJ_HAVE_MEMALIGN)
/* glibc doc states one can mix aligned malloc with realloc */
r_ptr = realloc(ptr, new_size); /* fast path */
/* we simply use `size_t` to cast, since we are only interest in binary AND
* operator */
if (((size_t)r_ptr & (alignment - 1U)) != 0U) {
/* this is non-trivial to implement a portable aligned realloc, so use a
* simple approach where we do not need a function that return the size of an
* allocated array (eg. _msize on Windows, malloc_size on MacOS,
* malloc_usable_size on systems with glibc) */
void *a_ptr = opj_aligned_alloc_n(alignment, new_size);
if (a_ptr != NULL) {
memcpy(a_ptr, r_ptr, new_size);
}
free(r_ptr);
r_ptr = a_ptr;
}
/* _MSC_VER */
#elif defined(OPJ_HAVE__ALIGNED_MALLOC)
r_ptr = _aligned_realloc(ptr, new_size, alignment);
#else
if (ptr == NULL) {
return opj_aligned_alloc_n(alignment, new_size);
}
alignment--;
{
void *oldmem;
OPJ_UINT8 *newmem;
size_t overhead = alignment + sizeof(void *);
/* let's be extra careful */
assert(alignment <= (SIZE_MAX - sizeof(void *)));
/* Avoid integer overflow */
if (new_size > SIZE_MAX - overhead) {
return NULL;
}
oldmem = ((void**) ptr)[-1];
newmem = (OPJ_UINT8*)realloc(oldmem, new_size + overhead);
if (newmem == NULL) {
return newmem;
}
if (newmem == oldmem) {
r_ptr = ptr;
} else {
size_t old_offset;
size_t new_offset;
/* realloc created a new copy, realign the copied memory block */
old_offset = (size_t)((OPJ_UINT8*)ptr - (OPJ_UINT8*)oldmem);
/* offset = ((alignment + 1U) - ((size_t)(mem + sizeof(void*)) & alignment)) & alignment; */
/* Use the fact that alignment + 1U is a power of 2 */
new_offset = ((alignment ^ ((size_t)(newmem + sizeof(void*)) & alignment)) +
1U) & alignment;
new_offset += sizeof(void*);
r_ptr = (void *)(newmem + new_offset);
if (new_offset != old_offset) {
memmove(newmem + new_offset, newmem + old_offset, new_size);
}
((void**) r_ptr)[-1] = newmem;
}
}
#endif
return r_ptr;
}
void * opj_malloc(size_t size)
{
if (size == 0U) { /* prevent implementation defined behavior of realloc */
return NULL;
}
return malloc(size);
}
void * opj_calloc(size_t num, size_t size)
{
if (num == 0 || size == 0) {
/* prevent implementation defined behavior of realloc */
return NULL;
}
return calloc(num, size);
}
void *opj_aligned_malloc(size_t size)
{
return opj_aligned_alloc_n(16U, size);
}
void * opj_aligned_realloc(void *ptr, size_t size)
{
return opj_aligned_realloc_n(ptr, 16U, size);
}
void *opj_aligned_32_malloc(size_t size)
{
return opj_aligned_alloc_n(32U, size);
}
void * opj_aligned_32_realloc(void *ptr, size_t size)
{
return opj_aligned_realloc_n(ptr, 32U, size);
}
void opj_aligned_free(void* ptr)
{
#if defined(OPJ_HAVE_POSIX_MEMALIGN) || defined(OPJ_HAVE_MEMALIGN)
free(ptr);
#elif defined(OPJ_HAVE__ALIGNED_MALLOC)
_aligned_free(ptr);
#else
/* Generic implementation has malloced pointer stored in front of used area */
if (ptr != NULL) {
free(((void**) ptr)[-1]);
}
#endif
}
void * opj_realloc(void *ptr, size_t new_size)
{
if (new_size == 0U) { /* prevent implementation defined behavior of realloc */
return NULL;
}
return realloc(ptr, new_size);
}
void opj_free(void *ptr)
{
free(ptr);
}

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
* All rights reserved.
@@ -24,8 +29,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __OPJ_MALLOC_H
#define __OPJ_MALLOC_H
#ifndef OPJ_MALLOC_H
#define OPJ_MALLOC_H
#include <stddef.h>
/**
@file opj_malloc.h
@brief Internal functions
@@ -36,6 +43,17 @@ The functions in opj_malloc.h are internal utilities used for memory management.
/** @defgroup MISC MISC - Miscellaneous internal functions */
/*@{*/
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
#ifdef _WIN32
#define OPJ_HAVE__ALIGNED_MALLOC
#else /* Not _WIN32 */
#if defined(__sun)
#define OPJ_HAVE_MEMALIGN
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#define OPJ_HAVE_POSIX_MEMALIGN
#endif
#endif
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
@@ -45,90 +63,32 @@ Allocate an uninitialized memory block
@param size Bytes to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
#ifdef ALLOC_PERF_OPT
void * OPJ_CALLCONV opj_malloc(size_t size);
#else
#define opj_malloc(size) malloc(size)
#endif
void * opj_malloc(size_t size);
/**
Allocate a memory block with elements initialized to 0
@param num Blocks to allocate
@param size Bytes per block to allocate
@param numOfElements Blocks to allocate
@param sizeOfElements Bytes per block to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
#ifdef ALLOC_PERF_OPT
void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);
#else
#define opj_calloc(num, size) calloc(num, size)
#endif
void * opj_calloc(size_t numOfElements, size_t sizeOfElements);
/**
Allocate memory aligned to a 16 byte boundry
Allocate memory aligned to a 16 byte boundary
@param size Bytes to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
#ifdef _WIN32
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
#ifdef __GNUC__
#include <mm_malloc.h>
#define HAVE_MM_MALLOC
#else /* MSVC, Intel C++ */
#include <malloc.h>
#ifdef _mm_malloc
#define HAVE_MM_MALLOC
#endif
#endif
#else /* Not _WIN32 */
#if defined(__sun)
#define HAVE_MEMALIGN
#elif defined(__FreeBSD__)
#define HAVE_POSIX_MEMALIGN
/* Linux x86_64 and OSX always align allocations to 16 bytes */
#elif !defined(__amd64__) && !defined(__APPLE__) && !defined(_AIX)
#define HAVE_MEMALIGN
#include <malloc.h>
#endif
#endif
void * opj_aligned_malloc(size_t size);
void * opj_aligned_realloc(void *ptr, size_t size);
void opj_aligned_free(void* ptr);
#define opj_aligned_malloc(size) malloc(size)
#define opj_aligned_free(m) free(m)
#ifdef HAVE_MM_MALLOC
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
#undef opj_aligned_free
#define opj_aligned_free(m) _mm_free(m)
#endif
#ifdef HAVE_MEMALIGN
extern void* memalign(size_t, size_t);
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) memalign(16, (size))
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
#endif
#ifdef HAVE_POSIX_MEMALIGN
#undef opj_aligned_malloc
extern int posix_memalign(void**, size_t, size_t);
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
void* mem = NULL;
posix_memalign(&mem, 16, size);
return mem;
}
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
#endif
#ifdef ALLOC_PERF_OPT
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) opj_malloc(size)
#undef opj_aligned_free
#define opj_aligned_free(m) opj_free(m)
#endif
/**
Allocate memory aligned to a 32 byte boundary
@param size Bytes to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
void * opj_aligned_32_malloc(size_t size);
void * opj_aligned_32_realloc(void *ptr, size_t size);
/**
Reallocate memory blocks.
@@ -136,23 +96,15 @@ Reallocate memory blocks.
@param s New size in bytes
@return Returns a void pointer to the reallocated (and possibly moved) memory block
*/
#ifdef ALLOC_PERF_OPT
void * OPJ_CALLCONV opj_realloc(void * m, size_t s);
#else
#define opj_realloc(m, s) realloc(m, s)
#endif
void * opj_realloc(void * m, size_t s);
/**
Deallocates or frees a memory block.
@param m Previously allocated memory block to be freed
*/
#ifdef ALLOC_PERF_OPT
void OPJ_CALLCONV opj_free(void * m);
#else
#define opj_free(m) free(m)
#endif
void opj_free(void * m);
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(OPJ_SKIP_POISON)
#pragma GCC poison malloc calloc realloc free
#endif
@@ -161,5 +113,5 @@ void OPJ_CALLCONV opj_free(void * m);
/*@}*/
#endif /* __OPJ_MALLOC_H */
#endif /* OPJ_MALLOC_H */

View File

@@ -0,0 +1,51 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPJ_STDINT_H
#define OPJ_STDINT_H
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || _MSC_VER >= 1900
#include <stdint.h>
#else
#if defined(_WIN32)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#error unsupported platform
#endif
#endif
#endif /* OPJ_STDINT_H */

View File

@@ -1427,7 +1427,7 @@ void t1_encode_cblks(
opj_tcd_resolution_t *res = &tilec->resolutions[resno];
for (bandno = 0; bandno < res->numbands; ++bandno) {
opj_tcd_band_t* restrict band = &res->bands[bandno];
opj_tcd_band_t* OPJ_RESTRICT band = &res->bands[bandno];
int bandconst = 8192 * 8192 / ((int) floor(band->stepsize * 8192));
for (precno = 0; precno < res->pw * res->ph; ++precno) {
@@ -1435,8 +1435,8 @@ void t1_encode_cblks(
for (cblkno = 0; cblkno < prc->cw * prc->ch; ++cblkno) {
opj_tcd_cblk_enc_t* cblk = &prc->cblks.enc[cblkno];
int* restrict datap;
int* restrict tiledp;
int* OPJ_RESTRICT datap;
int* OPJ_RESTRICT tiledp;
int cblk_w;
int cblk_h;
int i, j;
@@ -1517,14 +1517,14 @@ void t1_decode_cblks(
opj_tcd_resolution_t* res = &tilec->resolutions[resno];
for (bandno = 0; bandno < res->numbands; ++bandno) {
opj_tcd_band_t* restrict band = &res->bands[bandno];
opj_tcd_band_t* OPJ_RESTRICT band = &res->bands[bandno];
for (precno = 0; precno < res->pw * res->ph; ++precno) {
opj_tcd_precinct_t* precinct = &band->precincts[precno];
for (cblkno = 0; cblkno < precinct->cw * precinct->ch; ++cblkno) {
opj_tcd_cblk_dec_t* cblk = &precinct->cblks.dec[cblkno];
int* restrict datap;
int* OPJ_RESTRICT datap;
int cblk_w, cblk_h;
int x, y;
int i, j;
@@ -1566,7 +1566,7 @@ void t1_decode_cblks(
}
if (tccp->qmfbid == 1) {
int* restrict tiledp = &tilec->data[(y * tile_w) + x];
int* OPJ_RESTRICT tiledp = &tilec->data[(y * tile_w) + x];
for (j = 0; j < cblk_h; ++j) {
for (i = 0; i < cblk_w; ++i) {
int tmp = datap[(j * cblk_w) + i];
@@ -1574,9 +1574,9 @@ void t1_decode_cblks(
}
}
} else { /* if (tccp->qmfbid == 0) */
float* restrict tiledp = (float*) &tilec->data[(y * tile_w) + x];
float* OPJ_RESTRICT tiledp = (float*) &tilec->data[(y * tile_w) + x];
for (j = 0; j < cblk_h; ++j) {
float* restrict tiledp2 = tiledp;
float* OPJ_RESTRICT tiledp2 = tiledp;
for (i = 0; i < cblk_w; ++i) {
float tmp = *datap * band->stepsize;
*tiledp2 = tmp;

View File

@@ -194,7 +194,7 @@ int main(){
printf("/* This file was automatically generated by t1_generate_luts.c */\n\n");
// lut_ctxno_zc
/* lut_ctxno_zc */
for (j = 0; j < 4; ++j) {
for (i = 0; i < 256; ++i) {
int orient = j;
@@ -215,7 +215,7 @@ int main(){
}
printf("%i\n};\n\n", lut_ctxno_zc[1023]);
// lut_ctxno_sc
/* lut_ctxno_sc */
printf("static char lut_ctxno_sc[256] = {\n ");
for (i = 0; i < 255; ++i) {
printf("0x%x, ", t1_init_ctxno_sc(i << 4));
@@ -224,7 +224,7 @@ int main(){
}
printf("0x%x\n};\n\n", t1_init_ctxno_sc(255 << 4));
// lut_spb
/* lut_spb */
printf("static char lut_spb[256] = {\n ");
for (i = 0; i < 255; ++i) {
printf("%i, ", t1_init_spb(i << 4));

View File

@@ -30,6 +30,7 @@
*/
#include "opj_includes.h"
#include <assert.h>
/** @defgroup T2 T2 - Implementation of a tier-2 coding */
/*@{*/
@@ -340,13 +341,15 @@ static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_t
int precno = pi->precno; /* precinct value */
int layno = pi->layno; /* quality layer value */
opj_tcd_resolution_t* res = &tile->comps[compno].resolutions[resno];
unsigned char *hd = NULL;
int present;
opj_bio_t *bio = NULL; /* BIO component */
opj_tcd_resolution_t* res;
assert(&tile->comps[compno] != NULL);
res = &tile->comps[compno].resolutions[resno];
if (layno == 0) {
for (bandno = 0; bandno < res->numbands; bandno++) {
opj_tcd_band_t *band = &res->bands[bandno];

View File

@@ -1507,7 +1507,7 @@ opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno
for(j = res->y0; j < res->y1; ++j) {
for(i = res->x0; i < res->x1; ++i) {
float tmp = ((float*)tilec->data)[i - res->x0 + (j - res->y0) * tw];
int v = lrintf(tmp);
int v = opj_lrintf(tmp);
v += adjust;
imagec->data[(i - offset_x) + (j - offset_y) * w] = int_clamp(v, min, max);
}

View File

@@ -30,3 +30,8 @@ set_source_files_properties(${libpathing_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
add_library(nd_Pathing STATIC ${libpathing_SOURCE_FILES} ${libpathing_HEADER_FILES} )
target_link_libraries(nd_Pathing
PUBLIC
llcommon
)

View File

@@ -24,11 +24,6 @@
* $/LicenseInfo$
*/
#if LL_MSVC
// disable warning about boost::lexical_cast returning uninitialized data
// when it fails to parse the string
#pragma warning (disable:4701)
#endif
#include "linden_common.h"
@@ -44,6 +39,8 @@
#include "llstl.h"
#include "lltexglobalcolor.h"
#include "llwearabledata.h"
#include "boost/bind.hpp"
#include "boost/tokenizer.hpp"
#if LL_MSVC
@@ -51,8 +48,6 @@
#pragma warning (disable:4702)
#endif
#include <boost/lexical_cast.hpp>
using namespace LLAvatarAppearanceDefines;
//-----------------------------------------------------------------------------
@@ -87,8 +82,11 @@ public:
private:
std::string mName;
std::string mSupport;
std::string mAliases;
BOOL mIsJoint;
LLVector3 mPos;
LLVector3 mEnd;
LLVector3 mRot;
LLVector3 mScale;
LLVector3 mPivot;
@@ -118,6 +116,7 @@ public:
private:
S32 mNumBones;
S32 mNumCollisionVolumes;
LLAvatarAppearance::joint_alias_map_t mJointAliasMap;
typedef std::vector<LLAvatarBoneInfo*> bone_info_list_t;
bone_info_list_t mBoneInfoList;
};
@@ -180,7 +179,10 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
mPelvisToFoot(0.f),
mHeadOffset(),
mRoot(NULL),
mWearableData(wearable_data)
mWearableData(wearable_data),
mNumBones(0),
mIsBuilt(FALSE),
mInitFlags(0)
{
llassert_always(mWearableData);
mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
@@ -193,8 +195,6 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
mBakedTextureDatas[i].mMaskTexName = 0;
mBakedTextureDatas[i].mTextureIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((LLAvatarAppearanceDefines::EBakedTextureIndex)i);
}
mIsBuilt = FALSE;
}
// virtual
@@ -206,8 +206,9 @@ void LLAvatarAppearance::initInstance()
mRoot = createAvatarJoint();
mRoot->setName( "mRoot" );
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
const auto& mesh_entries = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries();
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = mesh_entries.begin();
iter != mesh_entries.end();
++iter)
{
const EMeshIndex mesh_index = iter->first;
@@ -224,7 +225,7 @@ void LLAvatarAppearance::initInstance()
for (U32 lod = 0; lod < mesh_dict->mLOD; lod++)
{
LLAvatarJointMesh* mesh = createAvatarJointMesh();
std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod);
std::string mesh_name = fmt::format(FMT_STRING("m{:s}{:d}"), mesh_dict->mName, lod);
// We pre-pended an m - need to capitalize first character for camelCase
mesh_name[1] = toupper(mesh_name[1]);
mesh->setName(mesh_name);
@@ -252,8 +253,8 @@ void LLAvatarAppearance::initInstance()
//-------------------------------------------------------------------------
// associate baked textures with meshes
//-------------------------------------------------------------------------
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = mesh_entries.begin();
iter != mesh_entries.end();
++iter)
{
const EMeshIndex mesh_index = iter->first;
@@ -277,6 +278,8 @@ void LLAvatarAppearance::initInstance()
}
buildCharacter();
mInitFlags |= 1<<0;
}
// virtual
@@ -292,7 +295,7 @@ LLAvatarAppearance::~LLAvatarAppearance()
mBakedTextureDatas[i].mJointMeshes.clear();
for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); iter2++)
iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); ++iter2)
{
LLMaskedMorph* masked_morph = (*iter2);
delete masked_morph;
@@ -327,36 +330,49 @@ LLAvatarAppearance::~LLAvatarAppearance()
//static
void LLAvatarAppearance::initClass()
{
std::string xmlFile;
initClass("","");
}
xmlFile = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR) + "_lad.xml";
BOOL success = sXMLTree.parseFile( xmlFile, FALSE );
//static
void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, const std::string& skeleton_file_name_arg)
{
std::string avatar_file_name;
if (!avatar_file_name_arg.empty())
{
avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,avatar_file_name_arg);
}
else
{
avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR + "_lad.xml");
}
BOOL success = sXMLTree.parseFile( avatar_file_name, FALSE );
if (!success)
{
LL_ERRS() << "Problem reading avatar configuration file:" << xmlFile << LL_ENDL;
LL_ERRS() << "Problem reading avatar configuration file:" << avatar_file_name << LL_ENDL;
}
// now sanity check xml file
LLXmlTreeNode* root = sXMLTree.getRoot();
if (!root)
{
LL_ERRS() << "No root node found in avatar configuration file: " << xmlFile << LL_ENDL;
LL_ERRS() << "No root node found in avatar configuration file: " << avatar_file_name << LL_ENDL;
return;
}
//-------------------------------------------------------------------------
// <linden_avatar version="1.0"> (root)
// <linden_avatar version="2.0"> (root)
//-------------------------------------------------------------------------
if( !root->hasName( "linden_avatar" ) )
{
LL_ERRS() << "Invalid avatar file header: " << xmlFile << LL_ENDL;
LL_ERRS() << "Invalid avatar file header: " << avatar_file_name << LL_ENDL;
}
std::string version;
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
if( !root->getFastAttributeString( version_string, version ) || ((version != "1.0") && (version != "2.0")))
{
LL_ERRS() << "Invalid avatar file version: " << version << " in file: " << xmlFile << LL_ENDL;
LL_ERRS() << "Invalid avatar file version: " << version << " in file: " << avatar_file_name << LL_ENDL;
}
S32 wearable_def_version = 1;
@@ -364,21 +380,22 @@ void LLAvatarAppearance::initClass()
root->getFastAttributeS32( wearable_definition_version_string, wearable_def_version );
LLWearable::setCurrentDefinitionVersion( wearable_def_version );
std::string mesh_file_name;
LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" );
if (!skeleton_node)
{
LL_ERRS() << "No skeleton in avatar configuration file: " << xmlFile << LL_ENDL;
LL_ERRS() << "No skeleton in avatar configuration file: " << avatar_file_name << LL_ENDL;
return;
}
std::string skeleton_file_name;
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name))
{
LL_ERRS() << "No file name in skeleton node in avatar config file: " << xmlFile << LL_ENDL;
}
std::string skeleton_file_name = skeleton_file_name_arg;
if (skeleton_file_name.empty())
{
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name))
{
LL_ERRS() << "No file name in skeleton node in avatar config file: " << avatar_file_name << LL_ENDL;
}
}
std::string skeleton_path;
skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
@@ -441,11 +458,56 @@ void LLAvatarAppearance::cleanupClass()
using namespace LLAvatarAppearanceDefines;
void LLAvatarAppearance::compareJointStateMaps(joint_state_map_t& last_state,
joint_state_map_t& curr_state)
{
if (!last_state.empty() && (last_state != curr_state))
{
S32 diff_count = 0;
joint_state_map_t::iterator it;
for (it=last_state.begin(); it != last_state.end(); ++it)
{
const std::string& key = it->first;
if (last_state[key] != curr_state[key])
{
LL_DEBUGS("AvatarBodySize") << "BodySize change " << key << " " << last_state[key] << "->" << curr_state[key] << LL_ENDL;
diff_count++;
}
}
if (diff_count > 0)
{
LL_DEBUGS("AvatarBodySize") << "Total of BodySize changes " << diff_count << LL_ENDL;
}
}
}
//------------------------------------------------------------------------
// The viewer can only suggest a good size for the agent,
// the simulator will keep it inside a reasonable range.
void LLAvatarAppearance::computeBodySize()
{
mLastBodySizeState = mCurrBodySizeState;
mCurrBodySizeState["mPelvis scale"] = mPelvisp->getScale();
mCurrBodySizeState["mSkull pos"] = mSkullp->getPosition();
mCurrBodySizeState["mSkull scale"] = mSkullp->getScale();
mCurrBodySizeState["mNeck pos"] = mNeckp->getPosition();
mCurrBodySizeState["mNeck scale"] = mNeckp->getScale();
mCurrBodySizeState["mChest pos"] = mChestp->getPosition();
mCurrBodySizeState["mChest scale"] = mChestp->getScale();
mCurrBodySizeState["mHead pos"] = mHeadp->getPosition();
mCurrBodySizeState["mHead scale"] = mHeadp->getScale();
mCurrBodySizeState["mTorso pos"] = mTorsop->getPosition();
mCurrBodySizeState["mTorso scale"] = mTorsop->getScale();
mCurrBodySizeState["mHipLeft pos"] = mHipLeftp->getPosition();
mCurrBodySizeState["mHipLeft scale"] = mHipLeftp->getScale();
mCurrBodySizeState["mKneeLeft pos"] = mKneeLeftp->getPosition();
mCurrBodySizeState["mKneeLeft scale"] = mKneeLeftp->getScale();
mCurrBodySizeState["mAnkleLeft pos"] = mAnkleLeftp->getPosition();
mCurrBodySizeState["mAnkleLeft scale"] = mAnkleLeftp->getScale();
mCurrBodySizeState["mFootLeft pos"] = mFootLeftp->getPosition();
LLVector3 pelvis_scale = mPelvisp->getScale();
// some of the joints have not been cached
@@ -505,7 +567,8 @@ void LLAvatarAppearance::computeBodySize()
if (new_body_size != mBodySize || old_offset != mAvatarOffset)
{
mBodySize = new_body_size;
bodySizeChanged();
compareJointStateMaps(mLastBodySizeState, mCurrBodySizeState);
}
}
@@ -541,7 +604,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
std::string version;
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
if( !root->getFastAttributeString( version_string, version ) || ((version != "1.0") && (version != "2.0")))
{
LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
return FALSE;
@@ -557,6 +620,12 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
{
LLJoint* joint = NULL;
LL_DEBUGS("BVH") << "bone info: name " << info->mName
<< " isJoint " << info->mIsJoint
<< " volume_num " << volume_num
<< " joint_num " << joint_num
<< LL_ENDL;
if (info->mIsJoint)
{
joint = getCharacterJoint(joint_num);
@@ -571,7 +640,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
{
if (volume_num >= (S32)mCollisionVolumes.size())
{
LL_WARNS() << "Too many bones" << LL_ENDL;
LL_WARNS() << "Too many collision volumes" << LL_ENDL;
return FALSE;
}
joint = (mCollisionVolumes[volume_num]);
@@ -579,26 +648,34 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
}
// add to parent
if (parent)
if (parent && (joint->getParent()!=parent))
{
parent->addChild( joint );
}
// SL-315
joint->setPosition(info->mPos);
joint->setDefaultPosition(info->mPos);
joint->setRotation(mayaQ(info->mRot.mV[VX], info->mRot.mV[VY],
info->mRot.mV[VZ], LLQuaternion::XYZ));
joint->setScale(info->mScale);
joint->setDefaultScale(info->mScale);
joint->setSupport(info->mSupport);
joint->setEnd(info->mEnd);
if (info->mIsJoint)
{
joint->setSkinOffset( info->mPivot );
joint->setJointNum(joint_num);
joint_num++;
}
else // collision volume
{
joint->setJointNum(mNumBones+volume_num);
volume_num++;
}
// setup children
LLAvatarBoneInfo::child_list_t::const_iterator iter;
for (iter = info->mChildList.begin(); iter != info->mChildList.end(); ++iter)
@@ -618,18 +695,12 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
//-----------------------------------------------------------------------------
BOOL LLAvatarAppearance::allocateCharacterJoints( U32 num )
{
clearSkeleton();
for(S32 joint_num = 0; joint_num < (S32)num; joint_num++)
{
mSkeleton.push_back(createAvatarJoint(joint_num));
}
if (mSkeleton.empty() || !mSkeleton[0])
{
return FALSE;
}
if (mSkeleton.size() != num)
{
clearSkeleton();
mSkeleton = avatar_joint_list_t(num,NULL);
mNumBones = num;
}
return TRUE;
}
@@ -642,6 +713,8 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
{
if (!info)
return FALSE;
LL_DEBUGS("BVH") << "numBones " << info->mNumBones << " numCollisionVolumes " << info->mNumCollisionVolumes << LL_ENDL;
//-------------------------------------------------------------------------
// allocate joints
//-------------------------------------------------------------------------
@@ -668,8 +741,8 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
LLAvatarSkeletonInfo::bone_info_list_t::const_iterator iter;
for (iter = info->mBoneInfoList.begin(); iter != info->mBoneInfoList.end(); ++iter)
{
LLAvatarBoneInfo *info = *iter;
if (!setupBone(info, NULL, current_volume_num, current_joint_num))
LLAvatarBoneInfo *bone_info = *iter;
if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num))
{
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
return FALSE;
@@ -849,11 +922,11 @@ void LLAvatarAppearance::buildCharacter()
//-----------------------------------------------------------------------------
// loadAvatar()
//-----------------------------------------------------------------------------
//static LLFastTimer::DeclareTimer FTM_LOAD_AVATAR("Load Avatar");
//static LLTrace::BlockTimerStatHandle FTM_LOAD_AVATAR("Load Avatar");
BOOL LLAvatarAppearance::loadAvatar()
{
// LLFastTimer t(FTM_LOAD_AVATAR);
// LL_RECORD_BLOCK_TIME(FTM_LOAD_AVATAR);
// avatar_skeleton.xml
if( !buildSkeleton(sAvatarSkeletonInfo) )
@@ -969,7 +1042,7 @@ BOOL LLAvatarAppearance::loadAvatar()
addVisualParam( driver_param );
driver_param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam;
if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false))
if( !driver_param->linkDrivenParams(std::bind(avatar_function,(LLAvatarAppearance*)this, std::placeholders::_1 ), false))
{
LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL;
continue;
@@ -1128,6 +1201,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
{
// This should never happen
LL_WARNS("Avatar") << "Could not find avatar mesh: " << info->mReferenceMeshName << LL_ENDL;
return FALSE;
}
}
else
@@ -1143,7 +1217,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
}
// Multimap insert
mPolyMeshes.insert(std::make_pair(info->mMeshFileName, poly_mesh));
mPolyMeshes.emplace(info->mMeshFileName, poly_mesh);
mesh->setMesh( poly_mesh );
mesh->setLOD( info->mMinPixelArea );
@@ -1264,6 +1338,10 @@ LLJoint *LLAvatarAppearance::getCharacterJoint( U32 num )
{
return NULL;
}
if (!mSkeleton[num])
{
mSkeleton[num] = createAvatarJoint();
}
return mSkeleton[num];
}
@@ -1289,12 +1367,12 @@ LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_of
//-----------------------------------------------------------------------------
// findCollisionVolume()
//-----------------------------------------------------------------------------
LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id)
LLJoint* LLAvatarAppearance::findCollisionVolume(S32 volume_id)
{
//SNOW-488: As mNumCollisionVolumes is a S32 and we are casting from a U32 to a S32
//to compare we also need to be sure of the wrap around case producing (S32) <0
//or in terms of the U32 an out of bounds index in the array.
if ((S32)volume_id > (S32)mCollisionVolumes.size() || (S32)volume_id<0)
if ((S32)volume_id > (S32)mCollisionVolumes.size() || volume_id<0)
{
return NULL;
}
@@ -1482,6 +1560,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);
@@ -1563,21 +1656,24 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
//-----------------------------------------------------------------------------
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
{
delete_and_clear(mCollisionVolumes);
mCollisionVolumes.reserve(num);
LLAvatarJointCollisionVolume* cv;
for (U32 i = 0; i < num; ++i)
if(num != mCollisionVolumes.size() )
{
cv = new LLAvatarJointCollisionVolume();
if (cv)
delete_and_clear(mCollisionVolumes);
mCollisionVolumes.reserve(num);
LLAvatarJointCollisionVolume* cv;
for (U32 i = 0; i < num; ++i)
{
mCollisionVolumes.push_back(cv);
}
else
{
delete_and_clear(mCollisionVolumes);
return false;
cv = new LLAvatarJointCollisionVolume();
if (cv)
{
mCollisionVolumes.push_back(cv);
}
else
{
delete_and_clear(mCollisionVolumes);
return false;
}
}
}
return TRUE;
@@ -1597,6 +1693,9 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
LL_WARNS() << "Bone without name" << LL_ENDL;
return FALSE;
}
static LLStdStringHandle aliases_string = LLXmlTree::addAttributeString("aliases");
node->getFastAttributeString(aliases_string, mAliases ); //Aliases are not required.
}
else if (node->hasName("collision_volume"))
{
@@ -1634,6 +1733,20 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
return FALSE;
}
static LLStdStringHandle end_string = LLXmlTree::addAttributeString("end");
if (!node->getFastAttributeVector3(end_string, mEnd))
{
LL_WARNS() << "Bone without end " << mName << LL_ENDL;
mEnd = LLVector3(0.0f, 0.0f, 0.0f);
}
static LLStdStringHandle support_string = LLXmlTree::addAttributeString("support");
if (!node->getFastAttributeString(support_string,mSupport))
{
LL_WARNS() << "Bone without support " << mName << LL_ENDL;
mSupport = "base";
}
if (mIsJoint)
{
static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot");
@@ -1689,6 +1802,75 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
return TRUE;
}
//Make aliases for joint and push to map.
void LLAvatarAppearance::makeJointAliases(LLAvatarBoneInfo *bone_info)
{
if (! bone_info->mIsJoint )
{
return;
}
std::string bone_name = bone_info->mName;
mJointAliasMap[bone_name] = bone_name; //Actual name is a valid alias.
std::string aliases = bone_info->mAliases;
boost::char_separator<char> sep(" ");
boost::tokenizer<boost::char_separator<char> > tok(aliases, sep);
for(boost::tokenizer<boost::char_separator<char> >::iterator i = tok.begin(); i != tok.end(); ++i)
{
if ( mJointAliasMap.find(*i) != mJointAliasMap.end() )
{
LL_WARNS() << "avatar skeleton: Joint alias \"" << *i << "\" remapped from " << mJointAliasMap[*i] << " to " << bone_name << LL_ENDL;
}
mJointAliasMap[*i] = bone_name;
}
LLAvatarBoneInfo::child_list_t::const_iterator iter;
for (iter = bone_info->mChildList.begin(); iter != bone_info->mChildList.end(); ++iter)
{
makeJointAliases( *iter );
}
}
const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases ()
{
LLAvatarAppearance::joint_alias_map_t alias_map;
if (mJointAliasMap.empty())
{
LLAvatarSkeletonInfo::bone_info_list_t::const_iterator iter;
for (iter = sAvatarSkeletonInfo->mBoneInfoList.begin();
iter != sAvatarSkeletonInfo->mBoneInfoList.end();
++iter)
{
//LLAvatarBoneInfo *bone_info = *iter;
makeJointAliases( *iter );
}
LLAvatarXmlInfo::attachment_info_list_t::iterator attach_iter;
for (attach_iter = sAvatarXmlInfo->mAttachmentInfoList.begin();
attach_iter != sAvatarXmlInfo->mAttachmentInfoList.end();
++attach_iter)
{
LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *attach_iter;
std::string bone_name = info->mName;
// Also accept the name with spaces substituted with
// underscores. This gives a mechanism for referencing such joints
// in daes, which don't allow spaces.
std::string sub_space_to_underscore = bone_name;
LLStringUtil::replaceChar(sub_space_to_underscore, ' ', '_');
if (sub_space_to_underscore != bone_name)
{
mJointAliasMap[sub_space_to_underscore] = bone_name;
}
}
}
return mJointAliasMap;
}
//-----------------------------------------------------------------------------
// parseXmlSkeletonNode(): parses <skeleton> nodes from XML tree
@@ -1719,7 +1901,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "Unknown param type." << LL_ENDL;
}
continue;
return FALSE;
}
LLPolySkeletalDistortionInfo *info = new LLPolySkeletalDistortionInfo;
@@ -1744,7 +1926,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
delete info;
continue;
return FALSE;
}
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
@@ -1752,7 +1934,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
delete info;
continue;
return FALSE;
}
static LLStdStringHandle position_string = LLXmlTree::addAttributeString("position");
@@ -1778,7 +1960,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
delete info;
continue;
return FALSE;
}
static LLStdStringHandle slot_string = LLXmlTree::addAttributeString("pie_slice");
@@ -1864,7 +2046,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
{
LL_WARNS() << "Unknown param type." << LL_ENDL;
}
continue;
return FALSE;
}
LLPolyMorphTargetInfo *morphinfo = new LLPolyMorphTargetInfo();
@@ -2025,7 +2207,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
{
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
delete info;
continue;
return FALSE;
}
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
@@ -2033,7 +2215,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
{
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
delete info;
continue;
return FALSE;
}
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
@@ -2041,7 +2223,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
{
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
delete info;
continue;
return FALSE;
}
// optional parameter. don't throw a warning if not present.

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