Compare commits

...

2718 Commits

Author SHA1 Message Date
Shyotl
43aa145c94 It's silly that this was necessary... but it was. AMD... :( 2015-02-25 21:11:06 -06:00
Shyotl
1608ed43c1 Release 1.8.6 2014-09-04 03:20:01 -05:00
Inusaito Sayori
fa103a69f9 I like jackals. 2014-09-03 21:49:08 -04:00
Inusaito Sayori
f8520f9dd3 Em Dash wants build tools to focus properly when the build button is clicked.
If the world is in focus and build button is pressed without the build floater open, don't bother focusing.
If a floater is in focus and build button is pressed without the build floater open, focus the build floater
If the build floater is in the background and the button is pressed, focus the build floater.
If the build floater is in focus and the button is pressed, close the build floater.
If the build floater is  not in focus but nothing else is, close the build floater.
2014-09-03 19:41:07 -04:00
Inusaito Sayori
3a372afc0e Add Render muted avatars check to System->Security & Privacy Preferences
Redefaulted LiruLegacyDisplayMuteds to false due to (at least) two alpha testers noticing it and wanting it back how it is in the current release (since 1.7.0).
True was to get back to the old ways of v1, but it's okay to be false by default, better now since it's exposed.

Also irrelevant tiny voice cleanup from Spatters.
2014-09-03 08:28:16 -04:00
Inusaito Sayori
95d6bec68f Maximum bandwidth is apparently 10000 on SL Viewer, match that. 2014-09-03 08:28:11 -04:00
Inusaito Sayori
56f2e20cb4 Feature Request: Add LiruResizeRootWithScreen to prevent ui getting messed up when the window is resized
This is not complete, and it should only be used if you know what you're getting into.
2014-09-03 08:28:06 -04:00
Shyotl
4cbcaba7f2 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2014-09-03 01:47:43 -05:00
Shyotl
aeeca6e2c0 llcommon.dll doer faster. (set /LTCG and /GL) 2014-09-03 01:45:47 -05:00
Inusaito Sayori
74704d0d2a Fix crash signature 608
This was a crash in LLPanelDirClassified::postBuild(), on the line changed here, probably accessng null pointer.
There are probably a few other signatures for this in our database.
2014-09-02 10:53:36 -04:00
Shyotl
0b384bdd72 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2014-09-02 02:57:28 -05:00
Shyotl
e9cf3a6806 Fix tiled snapshots. Also, LLRender::genRot takes degrees, not radians. 2014-09-02 02:53:10 -05:00
Shyotl
c5f9068664 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2014-09-01 00:49:05 -05:00
Shyotl
992bbbba1c A bit of cleanup, and call subprocess.Popen with shell=True. 2014-09-01 00:47:39 -05:00
Shyotl
fe9dd63558 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2014-08-31 04:58:29 -05:00
Shyotl
8e45003c27 Packaging bugs. I'm drowning in them. (use subprocess.Popen instead of os.popen) 2014-08-31 04:56:55 -05:00
Shyotl
f53d824e07 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer.git 2014-08-31 00:05:11 -05:00
Shyotl
259670af85 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2014-08-31 00:04:59 -05:00
Shyotl
c7e9430f99 Avoid erroneously creating 'About Land' instance. Also avoid issuing 'ParcelPropertiesRequest' excessively. 2014-08-30 23:48:56 -05:00
Shyotl
afe573d2eb Spaces in path... and nsi script... issues. 2014-08-30 23:47:32 -05:00
Shyotl
547d9817db Replace \t with spaces in develop.py. 2014-08-30 18:57:12 -05:00
Shyotl
9c63243fe7 Fix issue with planar face alignment. 2014-08-30 18:56:27 -05:00
Shyotl
5535ba6b47 Fix issue with paths with spaces, in viewer_manifest.py 2014-08-30 16:25:46 -05:00
Inusaito Sayori
52a80f98ed Nomade's touches to french Object Weights Floater
Supposedly fixes a french crash.
2014-08-30 06:09:33 -04:00
Inusaito Sayori
9600319094 Add debug setting LiruHighlightNewInventory to prevent selection being changed on accepting new inventory. 2014-08-27 07:58:08 -04:00
Aleric Inglewood
9b930c8716 Don't set a SSL ctx callback when we don't use openSSL. 2014-08-26 19:19:06 +02:00
Aleric Inglewood
eb0d2e5b2c libcurl-gnutls.so (debian) links with libgnutls.so
In that case we DO reach the assert here.
I verified that curl_global_init() indeed calls gnutls_global_init().
2014-08-26 01:35:13 +02:00
Aleric Inglewood
5e2722475a This header uses LLMatrix4a, not LLMatrix4. 2014-08-26 00:29:59 +02:00
Aleric Inglewood
b1e406731d Merge remote-tracking branch 'singu/master' 2014-08-25 18:39:46 +02:00
Aleric Inglewood
8c6d51cb71 No longer support DEBUG_CURLIO when libcwd isn't installed. 2014-08-25 17:58:45 +02:00
Shyotl
4b205084f8 Fix develop.py 'build' command. 2014-08-23 20:52:01 -05:00
Shyotl
eb910b0bae Use /Zm140 for all windows builds. 2014-08-23 20:50:56 -05:00
Shyotl
09a6a1f259 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2014-08-23 01:37:48 -05:00
Shyotl
315618a18b Fixed materials specularmap + glossiness=0 combination. 2014-08-23 01:34:25 -05:00
Inusaito Sayori
59af03695b Fix debug settings boolean to work with the radiogroup update. 2014-08-23 00:24:57 -04:00
Inusaito Sayori
e1851f7b5b Sync llwindowwin32 with Alchemy. 2014-08-22 21:47:52 -04:00
Inusaito Sayori
a126b4003f Fix the first double click of every session failing. 2014-08-22 21:43:48 -04:00
Inusaito Sayori
9067de26ac Seriously, what is logic? 2014-08-22 17:32:28 -04:00
Inusaito Sayori
260c5345fd Logic, what's that?! 2014-08-22 16:16:08 -04:00
Inusaito Sayori
e3dd05ef21 Fix the broken radio groups
Now can I go to sleep, Papa?
...
But I did my chores and fixed the bugs.
...
YAY! *runs off to bed*
2014-08-22 07:14:19 -04:00
Inusaito Sayori
9379bcedf9 A propos de [SHORT_APP_NAME] 2014-08-22 06:02:03 -04:00
Inusaito Sayori
2c91210d6e Is almost zero approximately zero? 2014-08-22 06:01:45 -04:00
Shyotl
f721d935e4 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer.git 2014-08-22 03:55:21 -05:00
Shyotl
66597cade3 Use [SHORT_APP_NAME] xui/de/floater_about.xml as per liru request. 2014-08-22 03:52:13 -05:00
Shyotl
3c5f39e26a Use a dynamic buffer for LLMeshHeaderResponder. 2014-08-22 03:41:00 -05:00
Shyotl
24e3176f1b Fixed some odd initialization oddness in develop.py. Also changed win64 build targetdir to build-vc###-Win64 2014-08-22 03:38:49 -05:00
Shyotl
e59757e3e8 Clean up a few harmless compiler warnings (signed/unsigned, double to float) 2014-08-20 19:43:32 -05:00
Shyotl
282de8c7f5 Only use LLAvatarJoint when necessary, else LLJoint 2014-08-20 19:40:31 -05:00
Shyotl
541021f29c Fix relwithdebug. 2014-08-20 17:42:48 -05:00
Inusaito Sayori
e01b9dcd39 If it's not a translation, don't change APP_NAME and related strings in strings.xml 2014-08-19 20:06:43 -04:00
Inusaito Sayori
8d4567b930 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2014-08-19 19:55:34 -04:00
Inusaito Sayori
6f6988a487 Add "Move to Lost And Found" option for displaced inventory
Inspired by the work of Kitty Barnett
Fixes Issue 1337: Corrupted Inventory
Fixes Issue 1625: Unattainable inventory is Outside of My Inventoy and no options to move back to My Inventory
Fixes Issue 1580: Deleted folders showing outside of inventory folder.
2014-08-19 19:52:24 -04:00
Inusaito Sayori
435ab2ce77 Modernize llradiogroup, allows v3-style attributes: value, label for radio_item; allow_deselect for radio_group.
LLRadioCtrl moves into llradiogroup.cpp
2014-08-19 19:42:42 -04:00
Shyotl
1afd723c4e Post-merge fixup. 2014-08-19 01:36:24 -05:00
Shyotl
b09f7f5ac7 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer.git
Conflicts:
	indra/newview/llviewerobjectlist.cpp
	indra/newview/llviewerpartsim.cpp
2014-08-18 23:55:03 -05:00
Shyotl
1b3f0f9ec0 Manual texture reloading now re-fetches materials-related textures. 2014-08-18 23:47:37 -05:00
Shyotl
d1d68721ac Pulled mesh header info parsing and VFS fetching into their own procedures to remove duplicate code. 2014-08-18 17:16:45 -05:00
Inusaito Sayori
2f4afe5b68 Fix About [APP_NAME] to read About [SHORT_APP_NAME] 2014-08-18 17:58:45 -04:00
Shyotl
47fcc70756 Write initial mesh data to file in larger chunks. Reduces file i/o stalls. 2014-08-18 00:54:46 -05:00
Shyotl
0e86b696c5 Added more verbose statemachine debug output. 2014-08-18 00:54:01 -05:00
Shyotl
54f05b409c Always use dynamic_cast when casting from an LLJoint* 2014-08-13 18:04:24 -05:00
Inusaito Sayori
350dff9b98 Cinder made some logic enhancements to hippogridmanager.cpp, I've picked them up~ 2014-08-13 02:34:52 -04:00
Inusaito Sayori
f198221812 System preferences and Menu translation updates by Nomade Zhao. 2014-08-13 02:04:17 -04:00
Inusaito Sayori
dee08b4216 Spanish translation pruning, also Manage ban list translation by Damian. 2014-08-13 02:02:34 -04:00
Damian Zhaoying
e02d074a85 Merge remote-tracking branch 'Liru/master' 2014-08-11 18:25:32 -03:00
Damian Zhaoying
8e2da87b97 Update spanish translations to reflect a lot of changes and adds in last Alphas builds. 2014-08-11 18:22:34 -03:00
Inusaito Sayori
2deba06212 Missed a spot with the date column for group bans
I'm thinking of putting a setting here instead of hardcoding the date format, actually, but for now this is good enough.
2014-08-11 14:36:37 -04:00
Latif Khalifa
a6ac8e1f71 Workaround for clang bugs 2014-08-09 11:24:22 -04:00
Inusaito Sayori
69436a9032 Add french translation for connect to neighboring regions from Nomade Zhao 2014-08-09 10:50:24 -04:00
Inusaito Sayori
50d91d13be Allow dragging and dropping to attached objects
There's now a guard serverside that'll prevent the situation that would cause things to break in the past, so there's no reason not to have this.
2014-08-08 16:26:40 -04:00
Inusaito Sayori
54a6db146e Upon further consideration and a bit of feedback, the new matching common characters behavior of gesture autocomplete is probably bad, I've commented it out and brought back the old code. 2014-08-08 14:57:14 -04:00
Inusaito Sayori
3b31fe91a6 Address Deltek's concern that the Open Attachment button wasn't changing text to just say save when the object is not the openable type. 2014-08-08 14:52:52 -04:00
Inusaito Sayori
90c5219be9 Move Media Filter from the View menu to the Singularity menu.
Moves Media Filter in all translations, no need for translators to worry~
Nomade, please translate the Singularity menu at your discretion.. in menu_viewer.xml
2014-08-08 08:43:24 -04:00
Inusaito Sayori
669fe29173 Initialize members of LLMediaFilter, fixes win64 filter being broken. 2014-08-08 08:26:48 -04:00
Inusaito Sayori
d7d06c8234 Oh, and this one too, maybe it is fixed now? 2014-08-08 07:07:51 -04:00
Inusaito Sayori
4754c1322d This should probably be a size_t, perhaps this fixes the win64 mediafilter bug. 2014-08-07 21:56:25 -04:00
Inusaito Sayori
acb093c277 Media Filter code cleanup 2014-08-07 20:37:03 -04:00
Inusaito Sayori
21d54edeb9 Per-slider reset buttons? Sure.
Adds callback to registrar: "Prefs.Reset", pass debug setting name as parameter.
2014-08-07 20:29:12 -04:00
Inusaito Sayori
20ea0968da Feature Request from friti: Add a reset button to Depth of Field tab of graphics.
Actually should've committed this last night. X3
2014-08-07 08:31:26 -04:00
Shyotl
398d8c52a2 Minor cleanup. 2014-08-07 01:57:11 -05:00
Lirusaito
f82d12d381 Fix linker errors on linux after merging Shyotl 2014-08-07 01:54:56 -05:00
Lirusaito
91ee5724ca Fix compile errors and warnings on linux after merging Shyotl. 2014-08-07 01:54:45 -05:00
Inusaito Sayori
a82443f271 Make sure that we have a token when doing sscanf in llinventory.cpp and llviewerobject.cpp
Guards against opensim grids that may leave new/blank lines of sorts after their message blocks
2014-08-06 23:29:23 -04:00
Cinder Biscuits
1cd0b70055 Fix filling in MediaAlert notification. 2014-08-06 16:34:23 -04:00
Inusaito Sayori
8f8904ad0f Feature Request: Autoselect the parcel you are on for about land floater when there's no active parcel selection. 2014-08-05 23:25:39 -04:00
Shyotl
e975e389df Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git
Conflicts:
	indra/newview/llnetmap.cpp
2014-08-05 18:17:13 -05:00
Inusaito Sayori
d3242393e0 Better default rect for those two new v3 floaters (destinations and avatar picker) from Latif. 2014-08-05 13:35:42 -04:00
Inusaito Sayori
ce7d0e81bd Toggle control_name in <floater/>'s like booleans for visibility, if they exist.
Look out for this in the UI Overhaul merge, this is gonna clash big time.
2014-08-05 12:48:28 -04:00
Inusaito Sayori
0cf16e6f8f Allow edit menu shortcuts to work while on login screen~ 2014-08-05 11:20:58 -04:00
Inusaito Sayori
0ab395794e [Warnings] "One more," says friti; "One more," fixes Liru. 2014-08-05 00:57:26 -04:00
Inusaito Sayori
ac06a8394b I'm a sillyfolf, here's a compile fix. 2014-08-05 00:48:13 -04:00
Inusaito Sayori
46dd1ad154 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2014-08-05 00:34:06 -04:00
Inusaito Sayori
e57a7b6f3b [Warnings] Fix the "no biggie" warnings
Thanks to friti for providing the pastebin~
2014-08-05 00:31:52 -04:00
Inusaito Sayori
409128b07f [Warnings] enumeral mismatch in conditional expression: ‘DS3Keys’ vs ‘XBoxKeys’ [-Wenum-compare]
Thought I covered this one already...
2014-08-05 00:31:03 -04:00
Inusaito Sayori
fd562061ee Update simple codeless floater behavior
Such that floater's named according to their filename will now close if they were frontmost
making their menu entries and buttons, toggly.

This effects the behavior of the toolbar preferences floater, the Favorites floater, and the My Outfits floater.
(and any such simple extensions made by forks and those that will come in the future)
2014-08-04 23:36:47 -04:00
Inusaito Sayori
c6a7dc8f9c Nomade's update to Camera and Input preferences. 2014-08-04 23:32:44 -04:00
Shyotl
5275f7e852 Re-determine spatial groups for hud attachments upon teleport. Fixes missing prim issue. 2014-08-03 18:52:06 -05:00
Inusaito Sayori
6ec19e4630 Minor edits to french translation. 2014-08-01 09:01:48 -04:00
Inusaito Sayori
690ac8d4b1 Ooooops, broke showcase tab on SL, needs to expandURLSubstitutions(). 2014-08-01 05:56:20 -04:00
Inusaito Sayori
7ae1cd33be Add debug setting LiruShowTransactionThreshold for filtering out low amount transaction notifications. 2014-08-01 05:21:14 -04:00
Inusaito Sayori
a7c6c184da Now that I'm more awake, this is a far better solution for the default sim features issues.
Adds const Type mDefaultValue reset() and getDefault() to SignaledType
Cleans up code by not needing to reset to the default by value every time, nice template function to do this~
Leaves in hg boolean, but commented out in case opensim ever decides to make that a reality.
2014-07-31 22:50:02 -04:00
Inusaito Sayori
29d6b423a3 Toolbar prefs was filling up quick, gave it an extra 20 pixels of height and reordered. 2014-07-31 14:52:41 -04:00
Inusaito Sayori
b3590c5ae6 Add Default Avatar Picker Floater (World->Default Avatars)
Default Avatars button option added to Toolbar prefs.
Adds debug setting ToolbarVisibleAvatar
Hooks into "avatar_picker_url" login response on opensim.
Also includes hooking up of DestinationGuideShown to startup, which was left unstaged from the initial commit of the Destination Guide.
2014-07-31 14:45:27 -04:00
Inusaito Sayori
67f549d86d SimFeaturesHandler: Work around grids where OpenSimExtras aren't implemented by not overriding hg strings there. 2014-07-31 11:29:26 -04:00
Inusaito Sayori
9096265bff Possible solution for Issue 954: Singularity Alpha Build 4701 EULA file missing on first login. 2014-07-31 11:20:17 -04:00
Inusaito Sayori
ce265b3948 Add Destination Guide
Adds llfloaterdestinations.* and floater_destinations.xml (needs translations, but not really)
Adds GenericErrorPageURL, DestinationGuideURL (not persistent), DestinationGuideShown, and DestinationGuideRect to debug settings
Removes ShowcaseURLDefault in favor of DestinationGuideURL from upstream.
Also Adds ToolbarVisibleDestinations for the toolbar button, but I'll need to set up a nice way to make the button invisible when the url is empty before adding it to the gui... maybe.. or maybe it's just not important.

This commit comes with support for dynamically changing destination guide page based on opensimextras simulator features cap
2014-07-31 10:07:11 -04:00
Inusaito Sayori
7fee70543d Login Response support for destination_guide_url, OpenSimExtras support (properly) search-server-url, and support the new destination-guide-url from OpenSimExtras
Expands SignaledType's callback to accept const Type& as argument.
typedefs Signal::slot_type to slot_t so that SignaledType can be altered without needing to update all lines setting slots.

Merges floater_directory.xml with floater_directory(2|3).xml
Condenses translations down to one xml(, finally the nightmare is over).
Better ui code support for classic find all panel
Not like anyone cares, but ShowcaseURLDefault no longer persists value changes between sessions.

Moves SearchType and getSearchUrl(SearchType ty, bool is_web) from HippoGridInfo into a namespace in llpaneldirfind.cpp, the only place where it is used; so that it may wrap the sim feature lookup.

Thanks to Shyotl for the help in dynamically maintaining tab positions for dynamic tabs.
2014-07-31 08:12:00 -04:00
Inusaito Sayori
f3a48bb0f0 Silk Aeon wants greater precision on the Object Weights Floater. 2014-07-30 08:43:12 -04:00
Inusaito Sayori
c151c12b95 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2014-07-25 20:55:39 -04:00
Aleric Inglewood
b8d999066d Allow usage of default timeout policy 2014-07-26 02:46:11 +02:00
Inusaito Sayori
0e816492b4 Merge branch 'master' of https://bitbucket.org/Shyotl/singularityviewer-internal 2014-07-23 22:08:12 -04:00
Inusaito Sayori
c6ef099e18 When we setTextEntry on a combo box, move the cursor to the beginning of the new text.
This fixes the login location combo box not displaying the location cleanly after appending coordinates and such.
2014-07-23 18:15:14 -04:00
Inusaito Sayori
1c5872da0c Fix the grids combobox on the login panel not being scrollable because of constantly reordering grids
Still select the current grid, just use its index number to select it, instead of hacking it to the top of the combo box.
2014-07-23 18:12:18 -04:00
Shyotl
d95e94fa07 Missed a cast to LLMatrix4. Was causing assorted wonkiness (most noticeably, mouselook oddities) 2014-07-23 16:55:46 -05:00
Inusaito Sayori
d7bbbd9d40 Fix Group Role Data never loading since the group bans merge. 2014-07-23 16:58:41 -04:00
Inusaito Sayori
cf56659b18 Add xcode_fix.sh to scripts/ to avoid users needing to download it. 2014-07-23 16:51:14 -04:00
Inusaito Sayori
4163b8e40b Well that's a strange bug... eh, not too important. 2014-07-22 14:38:29 -04:00
Inusaito Sayori
4ca6a5c52c Sync up most of the realistic mouselook code with alchemy.
This should fix the inverted mouselook when sitting problem
Think the bug was in llvoavatar, but keeping in sync is always good for the future overall.
2014-07-22 07:07:38 -04:00
Inusaito Sayori
511811de3b Fix Media Filtering preferences code to work right. 2014-07-22 07:05:36 -04:00
Inusaito Sayori
6ef4dfb61f Fix Media Filtering preferences UI to look proper. 2014-07-22 05:49:41 -04:00
Inusaito Sayori
5ca2a3b0f7 Feature request: Change status bar search to search in all (applicable) tabs
Opens up to last tab selected now, but puts query text and triggers searches in all tabs.

Singu TODO: Have it search marketplace?
2014-07-22 05:48:30 -04:00
Inusaito Sayori
88794d0288 Add "Connect to neighboring regions" checkbox to Vanity->Main preferences. 2014-07-22 04:40:21 -04:00
Lirusaito
30e76a7c11 Fix linker errors on linux after merging Shyotl 2014-07-22 04:24:26 -04:00
Lirusaito
41eb687243 Fix compile errors and warnings on linux after merging Shyotl. 2014-07-22 03:39:01 -04:00
Inusaito Sayori
5191baa659 Merge branch 'master' of https://bitbucket.org/Shyotl/singularityviewer-internal
Conflicts:
	indra/newview/llnetmap.cpp - Thankies Shyotl~
2014-07-21 23:31:59 -04:00
Inusaito Sayori
8159eff664 Ban From Group option belongs in the Moderation submenu on the radar. 2014-07-21 23:13:12 -04:00
Inusaito Sayori
c6eb3d790e MAINT-4241 FIXED [Group Bans] Ban member(s) button is not greyed out for banning group owners. Viewer gives message that you ejected group owner.
by Andrey Kleshchev
5598f66
2014-07-21 23:11:53 -04:00
Inusaito Sayori
f62fc8ab15 Fix right clicking on lists of avatars and selecting ban/invite not working for nonfriends who aren't nearby.
Also touch up group invite floater to show names we can't get from voavatars in the user's global namesystem preference.
2014-07-21 23:11:03 -04:00
Inusaito Sayori
75e85701c6 Add Ban From Group option to right click menu of avatar lists.
Also missed two touchups for the Responder API merge in llfloaterperms.cpp
2014-07-21 22:56:18 -04:00
Shyotl
cd85afc9a5 Quick workaround to fix issue with simple geom not rendering in deferred 'underwater' pass. 2014-07-21 20:28:23 -05:00
Inusaito Sayori
b9ba472eda Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer
Conflicts:
	indra/newview/llspeakers.cpp
Compile fixes:
	indra/newview/llgroupmgr.cpp - uncomment new API for GroupBanDataResponder
2014-07-21 19:56:35 -04:00
Inusaito Sayori
bf9d3acf33 Factor in mAvatarOffset(hover) when calculating the legacy offset, though I doubt this helps. 2014-07-21 19:07:16 -04:00
Inusaito Sayori
bd7e291787 Debug output that was once useful to me. 2014-07-21 19:05:24 -04:00
Inusaito Sayori
73b34b6d89 When there is nothing selected in a media filter list, don't enable its remove button
Also missed xml parts from last commit.
2014-07-21 18:51:20 -04:00
Inusaito Sayori
f2c7290ee8 Touchups to Cinder's new media filter code! 2014-07-21 18:30:05 -04:00
Inusaito Sayori
6f6938f5bb Function removal in LFFloaterInvPanel, in favor of boost::bind function. 2014-07-21 18:04:20 -04:00
Inusaito Sayori
601ff92871 Address Issue 1570: Make comboboxes scrollable
Note: It appears that mLabel is never set by combo boxes, this should eventually be fixed.
Checking !getFirstSelected() is sufficient to test if we're in the list, however.
2014-07-21 18:00:43 -04:00
Cinder
f119986fad Remove orphaned media filter notifications 2014-07-21 14:49:39 -04:00
Cinder
402cd21f87 Hi. 2014-07-21 14:49:33 -04:00
Cinder
8cb694af89 Orphaned local function 2014-07-21 14:49:26 -04:00
Cinder
73d8cedf7e A few changes after code review from Liru 2014-07-21 14:49:18 -04:00
Cinder
b7e8d36cf8 I do things. 2014-07-21 14:49:09 -04:00
Cinder
45f5eb9671 Replace the media filter with something a little different 2014-07-21 14:48:57 -04:00
Shyotl
16fe6d0dcf Fix compile. Remove call to temporary matrix sanity check. 2014-07-21 01:27:45 -05:00
Inusaito Sayori
b633c3ffea Fix Issue 1593: "Attachment" button on Group Notices 2014-07-15 15:37:02 -04:00
Inusaito Sayori
ca1696823c French translation updates, by me~ 2014-07-14 03:20:48 -04:00
Inusaito Sayori
c1cc9d484a Add AlchemyConnectToNeighbors 2014-07-13 19:43:00 -04:00
Liru
db75cb3e17 Fix down arrow not working in inventory after the v-t sync, I must've missed this spot. 2014-07-13 12:51:11 -04:00
Liru
b8a17c8f22 Finish work on MAINT-3119 FIXED Return common chars for triggers that matches the prefix.
Makes the code cleaner too, upstream made this too messy.
2014-07-13 10:28:41 -04:00
Aleric Inglewood
74dff061ff Support for new LL Responder API.
This adds mStatus, mReason and mContent to ResponderBase
and fills those in instead of passing it to member functions.
The added danger here is that now code can accidently try
to access these variables while they didn't already get a
correct value.

Affected members of ResponderBase (that now have less arguments):
decode_llsd_body, decode_raw_body, completedHeaders,
completed -> httpCompleted, result -> httpSuccess,
errorWithContent and error -> httpFailure.

New API:

ResponderBase::setResult
ResponderBase::getStatus()
ResponderBase::getReason()
ResponderBase::getContent()
ResponderBase::getResponseHeaders() (returns AIHTTPReceivedHeaders though, not LLSD)
ResponderBase::dumpResponse()
ResponderWithCompleted::completeResult
ResponderWithResult::failureResult (previously pubErrorWithContent)
ResponderWithResult::successResult (previously pubResult)

Not implemented:

getHTTPMethod() - use getName() instead which returns the class name of the responder.

completedHeaders() is still called as usual, although you can ignore
it (not implement in a derived responder) and call getResponseHeaders()
instead, provided you implement needsHeaders() and have it return true.

However, classes derived from ResponderHeadersOnly do not have
completedHeaders(), so they still must implement completedHeaders(),
and then call getResponseHeaders() or just access mReceivedHeaders
directly, as usual.
2014-07-12 18:29:44 +02:00
Aleric Inglewood
3dd846b600 Stop people from wearing their whole root folder. 2014-07-12 14:38:54 +02:00
Inusaito Sayori
8a2e24ecd0 Sync with viewer-tiger~
Syncs up llmath stuffs.

Thanks to Shyotl for the CMakeLists fix for Wbemuuid.
2014-07-11 20:36:19 -04:00
Aleric Inglewood
6ccca51fee Compiler warning fixes.
g_thread_init is automatically called since 2.32 (and deprecated since 2.35).
g_type_init is automatically called since 2.36 and will be deprecated in the
future.
2014-07-11 17:10:27 +02:00
Aleric Inglewood
a4b3c3d1ad Remove self dependency of llwindow.
Needed to avoid an error message from cmake 2.8.12.1 and higher
(policy 0022).
2014-07-11 16:32:55 +02:00
Inusaito Sayori
bc8947289b Sync
Includes:
MAINT-3541 (crash in std::vector >::reserve)
MAINT-3364 FIXED Call clearSelection() from root_folder
MAINT-3621 FIXED Set name to "Unnamed" if object's name consists of whitespaces.
MAINT-3412 add gpu_table line with distinct Intel Iris Pro OpenGL regex to match new MBP with forced Intel graphics
MAINT-3119 FIXED Return common chars for triggers that matches the prefix.
MAINT-3661 Fix for crash when uploading corrupt .dae file.
MAINT-3671 FIXED Rename title when new tab is added.
MAINT-3465 FIXED Add check mark to selected entry.
BUG-5537 FIX reverting breaking changes to pectorals and belly.
MAINT-535 FIXED The teleport SLAPP is changed to UNTRUSTED_THROTTLE. Confirmation dialog for teleporting via slapp is added.
2014-07-11 09:31:51 -04:00
Inusaito Sayori
e7c506c6ec MAINT-3496 FIXED Disable "Allow group access" option if "Sell passes to: group" is selected(and vice versa). 2014-07-11 06:52:25 -04:00
Inusaito Sayori
8236964029 Missed the setting for joystick button on toolbar, oops. 2014-07-11 06:42:46 -04:00
Inusaito Sayori
aadecaf102 MAINT-3530 : Add viewer checkbox to extend parcel entry limits to a higher ceiling 2014-07-11 06:42:20 -04:00
Inusaito Sayori
b55e45eef6 Add a joystick on/off toggle to the new joystick toolbar button~ 2014-07-11 01:20:22 -04:00
Inusaito Sayori
adbc928148 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2014-07-10 23:46:47 -04:00
Inusaito Sayori
c4c206076a Add the option to have a toolbar button for joystick configuration 2014-07-10 23:42:43 -04:00
Inusaito Sayori
5c077d7037 Suppress the annoying 404 notification from default perms 2014-07-10 22:43:36 -04:00
Inusaito Sayori
8583a2f4f7 Idea!: Set to defaults flyout button with options for all styles of joystick controller
The button portion does nothing if there is an unknown or no controller connected, otherwise it sets defaults for the controller's identified type.

Joystick buttons are still configured based on identification, however.
DS3 users will likely find that using Motion in Joy switchboards is much more effective, however.
2014-07-10 22:38:30 -04:00
Inusaito Sayori
ed8416ea10 Add a hack to make classified panel in search actually change
We cannot know the creator when we send the request, so use null to trigger the workaround.
2014-07-09 23:22:10 -04:00
Inusaito Sayori
deb7454cf7 Cure Issue 1586: Singularity crashes when adding classified adds on opensim grids (untested in SL)
Following as it is done upstream, no more requests on null ids.
2014-07-09 16:45:40 -04:00
Inusaito Sayori
8c40af5aee Sync up llpanelclassified.* a bit for easier diffings. 2014-07-09 16:18:19 -04:00
Inusaito Sayori
dd893bab41 Work towards curing Issue 1586: Singularity crashes when adding classified adds on opensim grids (untested in SL) 2014-07-09 15:29:38 -04:00
Lirusaito
759ee62e7c /open for opening avatar profiles by id~ 2014-07-09 03:18:08 -04:00
Lirusaito
1e9b79e2c1 Fix old namesystem code that broke initially setting Legacy (w/display) for everything in general.
Also cleans up old logic and directs the friends list to update when the user changes the namesystem for it specifically.
Thanks to um... I think it was Deltek, who discovered this bug.
2014-07-09 03:08:13 -04:00
Lirusaito
315883a28c Fix Issue 1577: Color yellow hard to read on Radar
Thanks to Carla Gomes
2014-07-09 03:00:38 -04:00
Lirusaito
19b85afe12 Allow gtp with implicit current height when z is not provided. 2014-07-09 02:56:09 -04:00
Inusaito Sayori
b2e8a31d68 Address Issue 1571: Newer OSSL functions not recognized by Script Editor 2014-07-08 19:15:19 -04:00
Inusaito Sayori
b4b12732cb Add new materials script constants to keywords.ini 2014-07-08 18:48:59 -04:00
Inusaito Sayori
c714c57bb2 Solve Issue 1572: Checkbox not saving its tick 2014-07-08 18:31:23 -04:00
Shyotl
4697216c5e Utilize vector_replace_with_last 2014-07-05 19:29:10 -05:00
Shyotl
e2fa94e2c3 Fixed water normals. 2014-07-05 19:09:21 -05:00
Siana Gearz
7578a27bf7 Fix RLVa in About floater 2014-07-05 14:11:26 +02:00
Siana Gearz
14e0b3c9e6 Latif's Breakpad from Replex 2014-07-05 04:14:58 +02:00
Shyotl
815acfc7da Don't use SHGetSpecialFolderPath since it's dead. Use SHGetFolderPath instead, as that still is supported on XP, and is merely deprecated, not removed from newer SDKs (yet). 2014-07-04 20:25:35 -05:00
Shyotl
7d8af7d413 Use one shared vbo to draw fullscreen rectangles in LLPipeline, for both deferred and non-deferred. Provides a nice bit of cleanup. 2014-07-03 17:09:27 -05:00
Shyotl
39810ed516 Removed several unused variables from LLPipeline 2014-07-03 02:34:10 -05:00
Shyotl
9cbcf8fe34 Removed glh_linear and glu dependencies from viewer. 2014-07-03 02:11:45 -05:00
Inusaito Sayori
02b476035b Correct Issue 1562: Environment Editor Floater not Opening Initially 2014-06-26 15:08:04 -04:00
Inusaito Sayori
9eb338f417 Merge up RLVa in llinventorybridge.cpp and remove old commented code
Just something I did to ease mergies.
Adds RLVaDebugDeprecateExplicitPoint

Ignore space changes
2014-06-25 15:23:04 -04:00
Inusaito Sayori
15e30604fc Feature Request: Add an option to bypass closing active viewers when (un)installing 2014-06-25 00:12:12 -04:00
Shyotl
21f677cf58 Remove glh::matrix4f variant of glh_get_current_modelview. 2014-06-24 01:23:08 -05:00
Shyotl
3ead892b1c Re-worked animated linden trees to reduce duplicate code and provide a cleaner diff. 2014-06-24 01:17:47 -05:00
Shyotl
a59e87a896 Added a gradient fade to the minimap viewcone visualization. 2014-06-22 03:55:29 -05:00
Shyotl
96df7b82de Change texture default to non-auto-alphamaskable, non-pickable. Only 'fetchable' textures may qualify for either. 2014-06-22 03:53:08 -05:00
Shyotl
5cb5d284c3 Initialize LLRender::mHasTextureSwizzle to false. 2014-06-22 03:44:48 -05:00
Shyotl
869517b9c6 Evidently a line in objectSkinV.glsl escaped earlier staging. 2014-06-22 03:43:43 -05:00
Shyotl
56cefce1cc Enable auto-alphamasking for attachments, and force to use V3 auto-alphamask algorithm for said attachments. 2014-06-22 03:42:37 -05:00
Shyotl
165af85894 Altered vector_replace_with_last to work around MSVC2010 compiler bug. 2014-06-22 03:40:12 -05:00
Shyotl
7c073c1db7 Explicit enforcement of alignment for all aligned types, including structures with aligned members. (Compiler handholding) 2014-06-22 03:39:33 -05:00
Shyotl
061178ad82 Migrated gl matrix stack to LLMatrix4a 2014-06-22 03:34:51 -05:00
Inusaito Sayori
dbc7c6e74d OUYA has different defaults, store its defaultification status uniquely.
Also code cleanup/simplification in the getDescriptiony areas.
2014-06-21 19:08:52 -04:00
Inusaito Sayori
d87a48ea06 Group Bans!
Thankies Baker Linden~

Ported Ansariel's mAvatarNameCacheConnection change to mAvatarNameCacheConnections to llpanelgroupbulkimpl.h

Adds setGroupID in places, in case we ever want to add that.. but for now we don't really need/use it
Adds Refresh_Off icon from upstream.

Viewer Interesting changes:
Moves LLGroupChange out of stdenums.h into llgroupmgr.h
Moves roles_constants.h from llcommon into newview

This looks like it's better without space changes...
2014-06-21 16:44:39 -04:00
Inusaito Sayori
b36bb8b5bb Increase the maximum range of finding avatars to invite near the user
Increased from 40 to 8192, so it works across sims and all the way up.
Also made the value editable, and the slider is now as wide as the list which looks nice.
2014-06-21 15:05:46 -04:00
Inusaito Sayori
2ed16c9736 Right click menus in avatar picker lists and in group invite avatar list. 2014-06-21 15:02:20 -04:00
Inusaito Sayori
c031649979 Added Eject avatar from group notification from v-r. 2014-06-20 18:01:59 -04:00
Inusaito Sayori
e0746fca12 Sync up llgroupactions with v-r/rlv. 2014-06-20 15:53:54 -04:00
Inusaito Sayori
2075042ba7 Fix key2name not working on the first try. Also make it comply with the name system choice. 2014-06-19 12:48:00 -04:00
Inusaito Sayori
499cd48763 More touches for DS3 support. 2014-06-19 11:29:18 -04:00
Inusaito Sayori
5d826b2b62 Use Nebadon's defaults for the Ouya game controller. 2014-06-18 21:32:31 -04:00
Inusaito Sayori
b20943d497 cd36a1fe16 had some mistakes/missing pieces 2014-06-18 21:07:15 -04:00
Inusaito Sayori
b4ab9a4e57 Fix cursorZoom being broken, my bad, forgot to add the increment line 2014-06-18 20:35:03 -04:00
Inusaito Sayori
cd36a1fe16 Add MotioninJoy detection, along with a whole new control set for it.. plus bonus buttons!
Tilt up to go up/jump, tilt down to go down/crouch (flying works nicely this way)
Turn left to roll left, turn right to roll right, while in flycam only.
Controls are mapped to the same buttons as with xbox controller.

Bonus buttons:
PS3 Logo button: Toggle Sit!
L2 and R2... no idea what to make these, I'll come up with something
2014-06-18 20:32:28 -04:00
Lirusaito
1cda80cbe7 Introduce function isXboxLike, to support Xbox-like controllers, even if they don't identify as Xbox.
Support for Ouya controller added.
2014-06-18 16:15:48 -04:00
Latif Khalifa
ffd0e6b79d [Branding] Linux scripts now made from template by cmake 2014-06-18 18:35:29 +02:00
Inusaito Sayori
a7728b87fc Touchup-fix for Issue 1549: Keyboard camera panning only works in 3 directions using WASD keys.
I didn't like the way Advanced menu flickered, so I provided a setting to prevent the toggle that way altogether.

Adds LiruUseAdvancedMenuShortcut
2014-06-18 09:47:08 -04:00
Inusaito Sayori
c218789abc Repeats per meter goes negative when flipping, let it be modified while in the negative without clamping to a positive minimum. 2014-06-18 09:32:59 -04:00
Inusaito Sayori
3656cb9fdb MAINT-4001 : Make Received Items not movable (protected), consolidate Received Items folders which may have been moved
Work by Merov Linden.
2014-06-18 08:05:49 -04:00
Sim Federal
e93fdf4615 Added region positions to the world map tiles
This feature added the setting 'SFMapShowRegionPositions'
2014-06-17 14:06:42 -05:00
Inusaito Sayori
6722e25cbe Fix Issue 1182: Script Window Resize Issue 2014-06-17 13:36:29 -04:00
Lirusaito
790db4283c STORM-2018: Group invite fails to let you join groups when groups maxed even when you leave group 2014-06-17 12:57:52 -04:00
Lirusaito
a0359473ff STORM-2011: Group member lists not loading properly
Work by Ansariel

For us, this is just to disconnect properly, we didn't have this because it was broken.
2014-06-17 12:56:43 -04:00
Lirusaito
ccfdcce5c1 MAINT-3187: Name list controls do not properly resolve avatar names
Work by Ansariel

For us, this is just to disconnect properly, we had this commented out because it was broken.
2014-06-17 12:54:26 -04:00
Lirusaito
811849fa23 Attempt to fix Issue 1154: Streaming Audio Display no longer stays enabled across relogs 2014-06-17 12:51:04 -04:00
Inusaito Sayori
1051fd9d42 Feature Request: Show how many scripts are actually running when doing a script count (also shows mono!) 2014-06-17 11:39:03 -04:00
Inusaito Sayori
5490a992ca Revert "[Preferences Refactor] Remove window size combo box from graphics preferences"
The issue wasn't the resolution box, and it apparently has its uses.
This reverts commit ac106b0aff.

Conflicts:
	indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml
2014-06-16 21:43:43 -04:00
Inusaito Sayori
2d29fb8d15 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2014-06-16 16:09:29 -04:00
Aleric Inglewood
589035c1db Attempt to fix gray avatars on mobile networks.
Ported from
e879862791
2014-06-16 21:02:27 +02:00
Shyotl
8f6a578ec0 Migration to LLMatrix4a instead of glh::matrix4f 2014-06-15 22:42:32 -05:00
Inusaito Sayori
a2fcf4edac Touchup to export perm enablement in default permissions
(not convinced this feature is working, though)
2014-06-14 23:18:48 -04:00
Inusaito Sayori
f56ac5210c [Warnings] Fixed warnings that Friti reported, thanks friti! 2014-06-14 18:21:20 -04:00
Inusaito Sayori
576069a84d Fox knot 2014-06-14 16:26:29 -04:00
Inusaito Sayori
7ea7d4cf6c Fix any and all crashes relating to initialization of UI components that may need the name cache to be initialized already. 2014-06-14 15:40:36 -04:00
Inusaito Sayori
21e1359b37 Confirmation for removing users, also reposition the remove button icon 2014-06-14 15:38:33 -04:00
Inusaito Sayori
eebee9b7c1 [STORM-68b] Default permissions floater overhaul
Adds separated default permissions for Objects, Uploads, Scripts, Notecards, Gestures and Wearables.

Compatible with Export Permission
Backwards compatible with default permissions for objects on regions where AgentPreferences capability is not available (opensim users rejoice!)

These changes to llfloaterperms are made available under lgpl, if there's a v3 that wants to adopt default export permission for opensim.
2014-06-14 15:32:50 -04:00
Sim Federal
bfc986a97d Fixed the spamming of has left sim
Bumping into the edge of a region without
a neighboring simulator would spam has left
and has entered the sim. This will now check
if the position is a valid global, if position not valid
then it will assume you're still in the same simulator.
2014-06-13 04:20:17 -05:00
Inusaito Sayori
d65a52242e Fox a small mistake in the last commit. 2014-06-13 05:12:41 -04:00
Inusaito Sayori
c82c791061 Whoops, that was C++11, that won't work for Linux and Mac. (code change only) 2014-06-12 08:51:54 -04:00
Inusaito Sayori
bcd18a01d8 [Preferences Refactor] In vanity->tags, remove color swatch disable logic since it doesn't make much sense anymore and isn't refreshing soon enough. 2014-06-12 07:26:04 -04:00
Inusaito Sayori
53a4931974 Group feature request: add ability to not turn when right clicking on objects
Adds RightClickTurnsAvatar to debug settings, defaults to true.
2014-06-12 06:13:33 -04:00
Inusaito Sayori
1f7751618e Solve Issue 1541: Remove old Logins
Little trash button next to the username box added, as its tooltip explains, if you have a valid entry selected and you click it, that entry will be removed.
My test avatar was a fake entry by the name Garbage Tax
Just thought I'd give that to the googles... enjoy~
2014-06-12 01:27:54 -04:00
Inusaito Sayori
497babe8e9 Fix Issue 1540: SLURLs not openable from chat? 2014-06-11 20:52:47 -04:00
Inusaito Sayori
973a90a34d Address Issue 1063: Compatibility azerty
It's dynamic, no need to relog!
Look under input preferences for "Use azerty layout instead of qwerty layout"
2014-06-11 20:02:34 -04:00
Inusaito Sayori
3cff5cd1a8 Only determine DumpDir in one place, LLDir::getDumpDir, not in llcrashlogger.
Also spaces tabs in getDumpDir
2014-06-11 14:36:41 -04:00
Inusaito Sayori
8766335708 Up the maximum field of view to 320, from 175, on request from Tazy Scientist
Better for reallllly wide screens and multiscreen setups, apparently.

Also, let's merge with v-r while we're at it, since llcamera.h requires a large-ish recompile
Nothing functional though.
And some license updates to some identical files in llmath.
2014-06-11 03:24:46 -04:00
Inusaito Sayori
908fc939b1 Feature Request: Next owner perms for scripts
In System->Building preferences, on the top right side.
2014-06-10 11:23:27 -04:00
Inusaito Sayori
73c4557a45 STORM-1117 does not affect us, allow calling cards in prims
Issue was due to v2 name resolution, our calling cards are old school and don't do this.
2014-06-10 08:51:09 -04:00
Inusaito Sayori
accfcbbf5c Restore the old behavior of not derendering muted people
This can be switched off with LiruLegacyDisplayMuteds in debug settings.
People have been annoyed that muted avatars disappear, and since we have the derender system anyway..

Also Sync llvoavatar.cpp with v-r a bit
(okay, fine, alot)
2014-06-09 10:10:03 -04:00
Inusaito Sayori
5a36450e01 Allow multi-select for participant lists, for multi-user operations via right click menu. 2014-06-09 06:54:53 -04:00
Inusaito Sayori
839f4eab7e Feature Request: chatbar as commandline "/regionsay msg" to do region-wide messages without needing to go through the region/estate floater. 2014-06-09 06:50:48 -04:00
Inusaito Sayori
fec0559d11 Introduce debug setting, LiruNewMessageSoundIMsOn, for defaulting ding of new IMs on.
This setting is off by default and I don't intend to give it a gui yet.
It probably will go in Chat UI, eventually.
2014-06-09 00:02:54 -04:00
Inusaito Sayori
e46fc0a805 Portability Mode!
Just add --portable to the shortcut
or use the provided shortcut as a template,
though it's likely the provided shortcut will not work on other computers, because the drive letter will change
2014-06-09 00:00:43 -04:00
Inusaito Sayori
fb7751360c Update Windows 64-bit Hunspell, thankies Drake~ 2014-06-08 20:42:26 -04:00
Inusaito Sayori
0c2e7d7028 Pressing up on right stick should turn the camera up in flycam, logically. (xbox controller) 2014-06-08 09:05:39 -04:00
Inusaito Sayori
fe2e68b410 These defaults seem more effective for my DS3 in flycam.
If anyone has a real XBox 360 controller and doesn't like them, let me know, we can totally work together on this
2014-06-08 08:23:48 -04:00
Inusaito Sayori
166c4df0b3 No more gross grey bars on the sides of snapshot thumbnails!!
Also random snapshot floater code sync with upstream in small places because it'll need doing at some point..
2014-06-07 11:50:31 -04:00
Inusaito Sayori
68684855c6 Bump link num starting point from 0 to 1
Based on script testing, and the fact that the root prim is 1, not 0.
2014-06-07 06:30:52 -04:00
Inusaito Sayori
fa0de18ffe [Voice Update] Small sync, less warning spam is likely
Should fix group chats sometimes not showing anyone. (Seemed to for me! ^*^)
2014-06-07 06:27:36 -04:00
Shyotl
24ca32f9f7 Replace gluProjectf/gluUnprojectf with own versions. Also changed gGLModelView/gGLProjection and other related matrices to LLMatrix4a. 2014-06-06 01:59:04 -05:00
Inusaito Sayori
f63de0d0cc Feature Request: Make Inspect button a toggler~ 2014-06-05 23:54:15 -04:00
Inusaito Sayori
f6db6058e1 Mass fixup to appearance mode ui overhead!
Should contain no functional changes, ust that all ui in appearance mode is now cached instead of calling getChild per frame.
Switches from hiding min/max param text every frame to force-drawing in draw call and setting invisible (llscrollingpanelparam.cpp/the corresponding xml)
Cleans up some old commented out code.
Moves some simple, one-call functions into their calling bodies.
Also, for some reason I had to adjust the alpha checkboxes, totally confused why they were out of line... maybe they had been already? I don't see a changed line that did positioning.

Contains spaces to tabs fixes, please view without space changes (You have been warned!)
2014-06-05 21:41:59 -04:00
Inusaito Sayori
d23632ef46 [RLVa] Yay updates~
e4a6e0d257c1 - fixed : @recvim=n isn't actually blocking the incoming message
35869fc884e9 - internal : minor refactoring of the process of updating the navigation and top info bars when toggling @showloc

9688630000ad - changed : show a limited context menu in the nearby people panel when @shownames restricted
    -> "Offer/Request Teleport" (filtered)
    $ Singu Change: Adds Recording of teleport offers to chat (if sending less than 10), one day I'll get around to doing this right into IMs

Noticed RLV.EnableIfNot was not being used, so I plugged it in for windlight.
Future Note: This brings us up to 417d759f0fa9 on the RLVa tree.
2014-06-03 20:29:55 -04:00
Inusaito Sayori
1048f213c7 Fix maximized windows being repositioned to no longer maximized when applying graphics settings. 2014-06-03 00:56:24 -04:00
Inusaito Sayori
98d88bff94 [Preferences Refactor] Oops, that shouldn't be there. 2014-06-02 23:41:03 -04:00
Inusaito Sayori
861fccd2d6 Address Issue 1301: Depth of Field preferences
Thanks a lot to Niran for assistance in this. Tooltips are from Black Dragon's machinima panel.
Note: Moves Depth of Field checkbox into the new Depth of Field tab.
2014-06-02 23:40:35 -04:00
Inusaito Sayori
715c3b8510 [Preferences Refactor] Cleanup on llfloaterpreferences
Moves to calling refreshEnabledState directly from LLPanelDisplay instead of bouncing around in LLFloaterPreferences first or using static proxy functions
Cleans up unused cached button pointers and old style static callbacks.
2014-06-02 23:24:25 -04:00
Inusaito Sayori
3c6c7c4138 [Preferences Refactor] Further cleanup
Moves to visibility_control and enabled_control instead of using callbacks, this lightens the load on opening preferences, and makes them responsive even to debug settings changes
Removes the moving m for meter text with draw distance, I don't think anyone cares if it's a little to the side of the number.
Adjustment of tabs to spaces in xml.
Return early when disabling unavailable settings if shaders are unavailable.
Cuts back on single-call functions in favor of direct binds.
2014-06-02 23:20:30 -04:00
Inusaito Sayori
95106ca1c2 [Preferences Refactor] Handle Hardware tab earlier to avoid early return when custom isn't displayed 2014-06-02 20:25:01 -04:00
Inusaito Sayori
ac106b0aff [Preferences Refactor] Remove window size combo box from graphics preferences
Windows can be resized on their own, we do not need this box
This should also fix window resizing when applying preferences.
2014-06-02 20:22:15 -04:00
Inusaito Sayori
001e45627b Feature Request: Add an option to toggle Animating when going into Appearance Mode, option is in vanity->main preferences 2014-05-30 06:38:13 -04:00
Inusaito Sayori
b8c3457644 Set RenderTextureMemoryMultiple to 1.0 on Macs, because the people asked for it.
If this explodes, I'm sure we'll see issues reported against it soon,
but in private testing we've yielded nothing but good results.
2014-05-29 22:43:55 -04:00
Inusaito Sayori
5f6dcfa82a [UI Overhaul] Restore LLContextMenu::appendContextSubMenu definition, lost in last commit. (Thannks for catching this, Tazy!) 2014-05-29 20:12:31 -04:00
Inusaito Sayori
f2dd944acd [UI Overhaul] Migrate LLContextMenu (and LLPieMenu) to the bottom of llmenugl.cpp to better diff with upstream. 2014-05-28 23:33:53 -04:00
Inusaito Sayori
d0f69ebb75 [UI Overhaul] LLMenuGL sync: doIt() --> onCommit() 2014-05-28 23:03:00 -04:00
Inusaito Sayori
04737fb0e8 [UI Overhaul] Missed this in c640585 2014-05-28 22:59:52 -04:00
Inusaito Sayori
d78550e83e Introduce APP_SITE for easy rebranding of viewer website from strings.xml. 2014-05-28 22:54:40 -04:00
Inusaito Sayori
c640585bc3 [UI Overhaul] Introduce LLMenuGL::insert from upstream and remove append/addChild wrappers in favor of insert 2014-05-28 22:52:29 -04:00
Inusaito Sayori
a926cdc5be [UI Overhaul] LLMenuGL sync 2014-05-28 22:08:01 -04:00
Inusaito Sayori
43e66b57a0 [UI Overhaul] Scrollable Menus.. just the implementation for now, not actually used.
This worked initially(early testing yesterday), but since then it seems not to, either way, implementation part is out of the way, so committing.
2014-05-28 21:50:18 -04:00
Shyotl
ee60a9801b Appease some nVidia cards/driversets regarding skinned shaders. 2014-05-27 20:18:48 -05:00
Inusaito Sayori
fb69220b95 Merge branch 'master' of git://github.com/lkalif/SingularityViewer 2014-05-27 12:57:45 -04:00
Inusaito Sayori
1cf7f67af5 Viewer name branding fixes, make rebranding way easier.
Also fix up french menu leaving functions around..
2014-05-27 12:54:33 -04:00
Latif Khalifa
8497ba1898 Use @style@ cmake escapes for the linux wrapper script
This avoids cmake messing up shell variables
2014-05-27 17:39:37 +02:00
Lirusaito
234259da91 Fix Issue 1299: Default Build settings for transfer permission not applied to a newly rezzed box
Mostly a workaround for next owner transfer being on by default
2014-05-26 13:51:41 -04:00
Lirusaito
ef7f309012 Redundant check is redundant 2014-05-26 09:32:50 -04:00
Lirusaito
d372fa1a0f Whoops, fixup locally experienced crash with lookat beacons. 2014-05-25 14:47:45 -04:00
Lirusaito
ea9005868b Switch out bumpers being roll for bumpers being y axis (up/down) with the xbox controller
This seems more widely used, and roll does nothing in Avatar movement so this is more useful
If people want it the other way, they can just switch it themselves.
2014-05-25 12:57:48 -04:00
Lirusaito
0a3a4a51bd Feature Request: Add an option to "Make rightclick zoom instantaneous, not smooth" (in Input & Camera preferences) 2014-05-25 12:44:48 -04:00
Latif Khalifa
1dbd913d9d Branding: generate wrapper script with cmake 2014-05-25 18:18:47 +02:00
Latif Khalifa
22cded7ccc Made breakpad symbols generation branding neutral 2014-05-25 08:27:00 +02:00
Latif Khalifa
4851f1ad48 Branding support for Linux packaging 2014-05-25 04:07:34 +02:00
Inusaito Sayori
0d94dd7bf8 Pick up a few changes from Alchemy for LookAt beacons
Implements lines from avatar to their lookat beacons
Implements namesystem so that Display Names can also be shown with beacons instead of just legacy

New options are available in the Security & Privacy tab of System preferences
2014-05-24 05:26:32 -04:00
Inusaito Sayori
bbe7f6adfb Enable Multiselect in groups, and enable EditMenuHandler when a scrollable list is focused!
Allows Ctrl-A to select all in a list (Like for selecting all groups and unticking chat with a single click)
Ctrl-E to deselect
Ctrl-X/Ctrl-C to copy a list (useful for saving ban lists and such!)
2014-05-23 19:37:32 -04:00
Inusaito Sayori
828941a204 Meeting Request: Pick up LL's changes to land impact (Also introduces Land Impact floater)
Small change to lltextbox allowing us to use value attribute with <text/>'s YAY!!

Cleaned up in llfloatertools as well to better diff.
2014-05-23 06:19:43 -04:00
Inusaito Sayori
2ce3f2c131 Meeting Request: Display date not just time in Teleport History
Will not change old entries because of the stupid way teleport history is saved.
Seriously, this floater needs a rewrite... we should just use v3.
2014-05-23 03:39:35 -04:00
Inusaito Sayori
8943552c1c Meeting Request: Change System Preferences' Security tab to Security & Privacy 2014-05-22 19:58:16 -04:00
Inusaito Sayori
dadbb00b85 Introduce a setting for Automatically scrolling to the bottom of a chat when the chat gains focus
Preferences->Adv. Chat->Chat UI, Autoscroll to the end of chats when they regain focus.
This defaults to false, unlike the legacy behavior.

Partial revert of "Feature Removal!: Do not scroll to the end of chats when the corresponding chatbar regains focus!"
2014-05-22 19:46:15 -04:00
Inusaito Sayori
852a8407c8 Feature Removal!: Do not scroll to the end of chats when the corresponding chatbar regains focus!
Focus is given to chatbar on floater focus, so this got in the way.
This feature was never really worth it.
2014-05-21 22:57:08 -04:00
Inusaito Sayori
bfbbcad8e5 Feature Touchup: Add backup destination to Emergency Teleport out of region within last 20 seconds before restart feature
Falls back if first landmark is not in inventory or invalid, region is offline, or the current region is your location
Item drop target is right below the original one in System->Security prefs.

Thanks again to the citizens of Fluffy for enduring these restart tests.
2014-05-21 19:07:11 -04:00
Inusaito Sayori
c684987908 Fix bugs introduced in 77a13963bb
Fixes Shiny/Bumpy combo boxes being broken
Fixes UI warning for "label glossy" not existing, it was "label glossiness".
2014-05-20 23:37:59 -04:00
Shyotl
53b8f70de8 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git 2014-05-17 18:26:07 -05:00
Shyotl
a1eb30ae87 Keep old non-swizzle method around since GL_ARB_texture_swizzle has poor support prior to 3.3 (on osx especially) 2014-05-17 18:25:21 -05:00
Shyotl
c4cb9de44b Merge branch 'master' of git@github.com:singularity-viewer/SingularityViewer.git 2014-05-17 16:30:21 -05:00
Shyotl
0a89503edd Renamed glUniformMatrix3x4fvARB to glUniformMatrix3x4fv, since I don't think it ever had the ARB postfix. Also use its the properly named (although identical to the current) function pointer signature. 2014-05-17 04:04:33 -05:00
Shyotl
f12bd741e2 Merge branch 'master' of git@github.com:Shyotl/SingularityViewer.git
Conflicts:
	indra/newview/llvopartgroup.cpp
2014-05-17 03:40:10 -05:00
Shyotl
e35039faf7 Remove deprecated gl call in renderComplexityDisplay. 2014-05-17 03:34:33 -05:00
Shyotl
a756943628 Fix a LLVertexBuffer::validateRange call that I hosed up pretty badly. 2014-05-17 03:33:33 -05:00
Shyotl
a9c3e13e5e Removed some diagnostic spam pertaining to shaders. 2014-05-17 03:32:40 -05:00
Shyotl
67c8ac2b04 Skinned shaders were exceeding maximum amount of vertex uniforms on amd hardware.
-Changed the transform matrix uniform to a 3x4 matrix and packed translation into it to free up uniforms. (3x3 is converted to 3x4 internally, so we were needlessly eating 3*52 extra uniform slots. translationPalette might also have been treated as a vec4 internally too, wasting 52 more slots.)
-matrix3x4 requires opengl2.1 and newer, so added a new featuretable mask.
-Also added a featuretable mask to disable hardware skinning and deferred shading on hardware with less than 1024 vertex uniforms.
NOTE: On old old old amd hardware, evidently a 3x4 matrix might be upgraded to 4x4. I'm unsure, but I doubt such hardware has 1024+ uniform components available to begin with. 4x3 supposedly doesn't do this, but opengl is column-major, so this makes little sense.
2014-05-17 03:31:45 -05:00
Inusaito Sayori
82044399e4 Brought in Realistic Mouselook option from Black Dragon
Look at the top area of Input & Camera preferences
Aside from tweaks to the code, all credit to Niran.
2014-05-15 21:01:11 -04:00
Shyotl
fdcf2eda5a Decouple vbo validation from LLDrawInfo. Such required vbo's to be initialized before drawinfo creation/modification, which is no longer the case with llvovolume. ('RenderDelayVBUpdate'[although removed in Singu] also fails the same assumption.) 2014-05-15 18:44:10 -05:00
Shyotl
e0997f1f04 Decouple vbo validation from LLDrawInfo. Such required vbo's to be initialized before drawinfo creation/modification, which is no longer the case with llvovolume. ('RenderDelayVBUpdate'[although removed in Singu] also fails the same assumption.) 2014-05-15 18:39:35 -05:00
Inusaito Sayori
58859ee709 Minor touchups to spanish translation 2014-05-15 17:36:33 -04:00
Shyotl
c3771e2fd5 Removed unused preprocessor definition in objectSkinV.glsl 2014-05-15 16:23:14 -05:00
Inusaito Sayori
2e49365b0f Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2014-05-15 15:37:42 -04:00
Inusaito Sayori
cd87aadab3 Missed a spot. 2014-05-15 00:42:22 -04:00
Inusaito Sayori
e58f8856f4 Add support for Controller Keys, inspired by similar code by CtrlAltStudio Viewer
Dear Alpha Users who are curious about this:
A = Alt
B = Shift
X = Ctrl
Y = Escape
Back = Toggle Flycam mode (Use this, it's fun!!!)
Start = Toggle Cursor mode
Right Stick Click = Toggle Mouselook
Left Stick Click = Jump/Fly

Enjoy, I know I do!
2014-05-14 23:48:27 -04:00
Inusaito Sayori
18a48e6609 Fix the inverted mouse issue. 2014-05-14 23:16:55 -04:00
Inusaito Sayori
929b75989c Sync with alchemy/v-r for flying instead of jumping on button press (Left Stick Click) 2014-05-14 22:58:16 -04:00
Shyotl
7d98030edc Use the right diffuse shader for skinned deferred diffuse simple object shader. 2014-05-14 19:43:03 -05:00
Shyotl
846d573dd0 Kill stray #endif that snuck into commit. 2014-05-14 16:45:55 -05:00
Shyotl
5805fe636a Determine if to stuff shiny data into alpha component a bit differently. Cuts out a lot of crazy logic and lets us choose based off of target renderpass. 2014-05-14 03:38:16 -05:00
Shyotl
3db9c6a9ff Try mask-based object shader configuration, instead of a bazillion hard-coded shader globals. Should be a bit more consistent. (non-deferred only, for now)
Also abuse discard in alpha shaders, instead of processing invisible fragments.
2014-05-14 03:30:02 -05:00
Shyotl
22bcf83cb9 Toyed with gl init ordering. Fixes adaptive vsync. May explode on linux, not that adaptive vsync works there, but it should in theory work there if we ever port to sdl2. If it does explode, I'll know shortly... probably. 2014-05-14 03:10:34 -05:00
Shyotl
117eca3c98 Try some swizzling instead of forcing everything to rgba8 with core profile. Avoids manual conversions with scratch buffers. Works for all pixel datatypes. Cleaner. Uses less vram.
Also, fixed textures when running core pofile.
2014-05-14 03:05:53 -05:00
Inusaito Sayori
81affe719f Add a setting to automatically decline and leave incoming conferences
Look under Communication preferences for "Block incoming conference chats" to activate.
2014-05-14 03:34:32 -04:00
Inusaito Sayori
3febec4aa4 Merge up CtrlAltStudio and Alchemy for XBox360 support
Can't seem to get scrollies working in cursor mode, odd.. need to look into that.
I need to figure out if inverted Y axis is just for me on my Dual Shock 3, though it seems to work usually... if this is the case I might flip it in the code.
More work needs to be done to get ctrl/alt/shift support from CAS, too.

I just wanted to get today's work out of the way and wrapped up, so here it is.
2014-05-14 02:23:55 -04:00
Inusaito Sayori
a78c6072ce Sync llviewerjoystick with upstream sources.
Replaces old constant of dividing by 3 with debug setting for multiplying: FlycamBuildModeScale
Relicenses to lgpl.
2014-05-13 21:27:18 -04:00
Lirusaito
aa6a57be63 Remove "wanna->want to" from auto replace, it is stylistic. 2014-05-12 19:26:16 -04:00
Inusaito Sayori
fd29dd9508 Spaces to Tabs for Last commit 2014-05-09 22:19:52 -04:00
Bob Shaffer II
5080ebf88f reverting some changes to llvovolume that seems to break animated textures
Signed-off-by: Siana Gearz <siana.sg@live.de>
2014-05-10 03:13:15 +02:00
Siana Gearz
873df7805b Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2014-05-10 03:12:32 +02:00
Inusaito Sayori
009fb10927 Feature Request: Add AutoresponseOnlyIfAway to send autoresponses only if in AFK or FakeAway modes 2014-05-09 20:32:38 -04:00
Inusaito Sayori
3898d29741 [Preferences Refactor] Touchup on voice prefs borkage. 2014-05-09 20:31:05 -04:00
Siana Gearz
1c521a3743 Merge branch 'master' of https://github.com/lkalif/SingularityViewer 2014-05-09 22:18:10 +02:00
Siana Gearz
098d1b30ff Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2014-05-09 22:15:38 +02:00
Siana Gearz
484108dafc Fix VS2012 64-bit debug build 2014-05-09 22:14:47 +02:00
Inusaito Sayori
029d260ad8 Feature Request: Persistent setting for AllowSelectAvatar (su useful!) 2014-05-09 10:39:07 -04:00
Inusaito Sayori
e6bc8f8583 Enable custom and window resolution for snapshots to inventory and set the max size to 1024, not 512. -- on request of Vivena (and the in-world group as a whole) 2014-05-09 09:30:13 -04:00
Inusaito Sayori
77a13963bb Joint effort with Alchemy Viewer to make build floater a lot lighter on FPS
Gets rid of all those pointless callbacks and static workarounds for legacy callback system.
Should massively improve FPS while build floater is open
Fixes getChild UI Warnings
Removes dumb func
2014-05-09 06:40:53 -04:00
Inusaito Sayori
656eacbb09 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2014-05-08 19:57:01 -04:00
Shyotl
98f9a09b39 sunlight_color_copy need only be vec3. 2014-05-08 16:39:41 -05:00
Shyotl
7e8e8bdb26 Disable some diagnostic gunk eating memory. 2014-05-08 16:35:12 -05:00
Shyotl
e2a0f801b9 Have LLRender::color4ub fall back to uniform if bound vbo lacks color attribute. Fixed fixed-function call in LLFacePool::LLOverrideFaceColor::setColor. 2014-05-08 16:29:53 -05:00
Shyotl
75b31b4151 Fix a nullptr usage. 2014-05-08 16:24:24 -05:00
Shyotl
f0763fd31c Tweaked context-recreation logic to force a 0xAA context when fbos are in use. Should also handle toggling of fbo checkbox a bit gracefully as well. 2014-05-08 15:48:08 -05:00
Shyotl
162e7b7699 Fixed a silly mistake that was causing vsync to be enabled when it should have been. Also fix typo in objectSkinV.glsl previous commit 2014-05-08 15:30:02 -05:00
Shyotl
7158a3c83d Fixed an annoying showstopper regarding rigged attachment vertex corruption. Rigged meshes have can have poor weighting, causing potential div-by-zero issues. 2014-05-08 15:11:12 -05:00
Inusaito Sayori
1fa30dd337 Fix Issue 1502: The Builders' Brewery says our prim torture behavior is nonstandard
Our uictrl limits were in need of a quick tune-up.
2014-05-07 06:54:17 -04:00
Inusaito Sayori
250049537f Feature Request: Add option to autominimize the region restart floater And Allow changing/shutting off its sound (from gui)
These new options are at the bottom of System->Security preferences.
2014-05-07 06:53:35 -04:00
Inusaito Sayori
76e5311320 [Preferences Refactor] Cleanup of voice prefs code
Also attempt to add a local enablement control, it's not quite clear where these are supposed to hook in, so it's unused for now, but it would have replaced onCommitEnableVoiceCheck.
Also fix the location of the voice is disabled textytext, it was too on top of the next checkbox.
2014-05-07 03:52:14 -04:00
Inusaito Sayori
11098cd6d4 [Preferences Refactor] Clean up of useless code for enablement and callbacks.
This tag will be used for refactor and updating of most of our preferences panels:
  This will include code changes that remove or condense old code
  This will include preferences being moved around to more logical locations
  This may include splitting up and/or condensing of tabs and/or subtabs for more logical placement of preferences
  This may include code changes that allow making changes to preferences faster and easier
  This will not include adding preferences
2014-05-07 03:20:04 -04:00
Siana Gearz
78a0b347fc Fix 64-bit project generation under Cygwin 2014-05-04 08:05:05 +02:00
Latif Khalifa
08a23de051 Restore compiler warnings flags.
Previous work on enabling the build on the latest Mac OS and
Xcode compiler mistakenly took out compiler warning flags.

This restores previously used flags.

Issue noticed by Sovereign Engineer.
2014-04-30 07:29:23 -07:00
Inusaito Sayori
a02ad53c73 Fix bulk import of notes, scripts and gestures, and clarify file menu 2014-04-28 20:36:46 -04:00
Inusaito Sayori
9400701c96 Synced up llviewerobjectbackup with Cool VL Viewer
Benefits:
-Support for exporting Materials (Normal and Specular textures)
-Fixed support for Object Physics export
-Fixed support for Light Image export
-Switch to use of Boost unordered containers
-Checking for invalid perms on textures is now optimized by saving invalid ids to a container
-GravityMultiplier parameter is now Gravity because that just makes way more sense.
-We support export of legacy flag parameters again to be compatible with older viewers
-Code comments are now a little clearer
-We now wait a little if objects haven't loaded yet when we try to export them
-We no longer allow changing default texture ids via debug settings on opensim regions that support the export permission
-Bit of reordering to better diff with Cool VL Viewer, since it's essentially our only upstream.
-Removes dead code/commented codestuffs

Please view the diff without space changes, otherwise you'll lose your mind.

Merci Henri!
2014-04-28 17:48:39 -04:00
Latif Khalifa
aa983108e8 Possible fox for crash signature 5284 by Aleric 2014-04-28 21:12:37 +02:00
Damian Zhaoying
7dca333166 Update spanish translations. Add translations for news floaters, dinamyc toolbars, RLVa and autoreplace. 2014-04-28 15:51:48 -03:00
Lirusaito
0f1ecf66ab Possible Fix for Issue 1499: Login screen disappears on non-SL grids after logging failure
Also should fix when this would happen on poor/dead connections.
2014-04-27 18:50:37 -04:00
Lirusaito
74984b5a3c Further cleanup of im floater draw call due to last commit 2014-04-27 18:46:50 -04:00
Latif Khalifa
c5d5984885 Checking for ChatSessionRequest cap is not neccessary for establishing private voice calls.
Addresses issue 1293
2014-04-27 21:37:52 +02:00
Damian Zhaoying
c1ccfcb988 Merge remote-tracking branch 'Liru/master' 2014-04-27 13:53:47 -03:00
Lirusaito
51dc0550d5 Minimap mark colors touchup
Now shown in tag without tag color statuses needing to show.
2014-04-27 11:18:31 -04:00
Lirusaito
ac9e36549b Fix right clicking dots no longer working on the minimap, broken {} pair that slipped my eyes. 2014-04-26 18:08:19 -04:00
Lirusaito
009e9a598a Introduce ExodusMapRolloverCircleColor for controlling the color of the new minimap selection circle, turn the alpha to zero to make it disappear completely (it's already quite light now) 2014-04-26 18:07:28 -04:00
Lirusaito
1502ef2661 Fix for an internal crash, could only happen if settings were copied into install improperly, but better safe than sorry. 2014-04-26 10:19:04 -04:00
Lirusaito
40f9e12bdf Fix for Issue 1472, prevent what was probably a null pointer in a bind
Oddly, this only happened to some people, but on any OS, which leads me to believe that initialization order may need some looking at, but that's not terribly important now.

Removes toolbar toggle from floater dictionary, in favor of using setting toggle
Since we could always just hook up a control to a button if we wanted to add such a button somewhere anyhow, this has no effect on future either.
2014-04-26 10:17:47 -04:00
Lirusaito
2fc783e67e The people want link parsing on! Let them have links in all text editors that aren't allow_html="false"! 2014-04-26 09:47:56 -04:00
Inusaito Sayori
4f8e6a188a Bypass canClose check for new groups by calling onClose directly. (Fixes making new groups!) 2014-04-25 11:52:25 -04:00
Inusaito Sayori
b0e44ad1bd Solve Issue 624: minimap multiple selection tool
Adds a circle when you mouse over the minimap, beneath your cursor
-This circle is the effect range of your right click+mark
-Shift+scroll to change the size of this circle (ExodusMinimapAreaEffect)
-- Set the debug to 1 to have basically the same range as before (unless dots are stacked)
-This circle is also how many avatars are shown in the tooltip
-When this circle is over avatar dots, they change color (ExodusMapRolloverColor)
The menu functions still only work on the closest dot to your cursor on right click...
Thanks to Exodus for the majority of this code, the rest is my work and updates to be closer to LL in places.
2014-04-25 04:11:35 -04:00
Inusaito Sayori
4a630b1780 Make it clear that item drop targets are for items. 2014-04-24 22:12:20 -04:00
Inusaito Sayori
ffa5e6099d Address Issue 1290: Bumps recorded in chat window
Adds debug setting AnnounceBumps and a toggle in Preferences->System->Security
2014-04-24 21:46:57 -04:00
Inusaito Sayori
8d1cd7008f Fix bug of being unable to change group owned parcel's visibility in search. 2014-04-24 19:48:27 -04:00
Inusaito Sayori
31b5c5e9dd Enter Export subpiemenu, no longer part of Tools 2014-04-24 19:47:17 -04:00
Inusaito Sayori
0e21a16c1c [STORM-1980] Singu Special: Emergency Teleport out of region within last 20 seconds before restart
Look in System preferences under the Security tab, at the bottom.
Debug setting is EmergencyTeleportLandmark, reset to turn off.

Also, thanks to everyone in Fluffy who put up with the tests of region restart notifications today,
I know it was annoying, thanks especially to the EMs for allowing me a testbed.
2014-04-24 01:33:04 -04:00
Inusaito Sayori
f666384a1d [STORM-1980] Part 3: Region Restarting camera shake reset also pokies at sound trigger
Don't send sound through the region, it's logically a UI sound. What even is that otherwise?
2014-04-24 01:25:52 -04:00
Inusaito Sayori
afacfcee94 [STORM-1980] Part 2: Floater and shakeyshake
Shake is off by default, turn on AlchemyRegionRestartShake to activate
2014-04-23 23:54:59 -04:00
Inusaito Sayori
7262bf96b8 [STORM-1980] Part 1: Notifications with timestamp and sound 2014-04-23 10:58:14 -04:00
Inusaito Sayori
3db489f4df Feature Request: When someone is marked on the minimap have that color persist on the radar and their tags
Jus' look at dat color~
2014-04-23 02:50:51 -04:00
Inusaito Sayori
6526c28e47 Fixup for "Feature Request: On login, open Local Chat, Communicate, and/or Contacts" 2014-04-23 01:35:52 -04:00
Inusaito Sayori
e473b9bf10 Fix a common crash when people would upload invalid xmls
Ill-gotten xmls just don't parse the same way...
2014-04-23 01:05:32 -04:00
Inusaito Sayori
0bde458c27 Allow minimum Sun Size of 0.01 instead of 1, like Black Dragon. 2014-04-22 22:20:46 -04:00
Inusaito Sayori
66739ac820 Preferences touchup now that we have log launching on mac 2014-04-21 18:59:49 -04:00
Inusaito Sayori
4a3763d8d1 Feature Request/Bug Fix: On login, open Local Chat, Communicate, and Contacts if they were open last session. 2014-04-21 18:31:41 -04:00
Cinder
4230127459 De-brand currency exchange 2014-04-21 18:09:08 -04:00
Cinder
a4c672252d Launch transcripts in external text editor on mac too 2014-04-21 18:05:45 -04:00
Lirusaito
d5d0473487 [LLMeshRepo sync] Fix mesh not loading 2014-04-19 01:09:12 -04:00
Lirusaito
9bbad1f8f0 [Warnings] Fix trigraph warning. 2014-04-19 00:47:02 -04:00
Lirusaito
0523965822 [LLMeshRepo sync] relwithdebinfo compile fixes 2014-04-19 00:25:11 -04:00
Lirusaito
cb8cd702e1 [LLMeshRepo sync] Linux compile fixy
Note to self: Windows compiler does not care about file casing, be more careful.
2014-04-18 23:51:52 -04:00
Liru
86b5737d51 [Floater Flexibility] French Translation~ Danke Nomade. 2014-04-18 09:17:41 -04:00
Liru
4027ec7a67 [Floater Flexibility] Fix yet another broken button, this time group titles, thanks again to the french singularity group 2014-04-18 04:58:49 -04:00
Liru
c2748a2246 [LLMeshRepo sync] The rest of the changes from upstream 2014-04-18 04:43:46 -04:00
Inusaito Sayori
5c06afc977 [LLMeshRepo sync] AICurl updates toward LLCurl
LLHTTPClient::getByteRange no longer throws AICurlNoEasyHandle, instead it returns whether or not it threw, to match the true/false convention of LLCurl.
- In addition, the header param has been shifted to earlier in this function to ease diffings.
ResponderBase now has static bool isGoodStatus, introduced into the Responder base class of LLCurl
2014-04-17 20:23:48 -04:00
Inusaito Sayori
4c82a5660f [LLMeshRepo sync] Change camelcase LLConvexDecomp to lowercase, so mergetool is happy~ 2014-04-17 18:20:34 -04:00
Inusaito Sayori
beacb5c701 [Floater Flexibility] Fix that the preferences button wasn't working, thanks Nomade for pointing this one out. 2014-04-17 15:47:50 -04:00
Damian Zhaoying
8355331cbe Merge remote-tracking branch 'Liru/master' 2014-04-17 02:18:56 -03:00
Inusaito Sayori
dc9cb07a81 [Floater Flexibility] Part four: Added a floater to change buttons shown on the toolbar
View->Change toolbar buttons

Reuses the old FloaterUploadRect because I'm allowed to be lazy after creating this large control panel
2014-04-16 19:03:07 -04:00
Inusaito Sayori
57fe7d9ad0 [Radar] WHAT?! Why wasn't this committed last night? I know it was... what the heck... 2014-04-16 16:08:20 -04:00
Latif Khalifa
00336de59a Merge branch 'osx_xcode5' of github.com:lkalif/SingularityViewer 2014-04-16 16:44:31 +02:00
Inusaito Sayori
b37b48f039 [Radar] Code overhaul
Brings a new "voice status" column, showing voice use as active speakers floater does.
- Shown by default, look in Extras tab to hide it
Attempt to blend and fix the visibility of the yellow for shout range.
- Requires user feedback, looks good on default and gemini to me

Refactors pretty much all of the code in the avatar list
-Less duplicate vars, less wasted space, more consistent spacing conventions, eradication of BOOL use.
We no longer add (or even evaluate what should be in) icon columns that are hidden
- This prevents icons from showing up even when their columns are hidden.
Minor work on focusing out of draw avatars, though that still won't work, sadly.
2014-04-16 05:30:19 -04:00
Latif Khalifa
42ca1a8994 [clang] Force build with SDK 10.6 2014-04-16 10:55:36 +02:00
Latif Khalifa
db678238ef Merge branch 'master' into osx_xcode5 2014-04-16 09:56:57 +02:00
Lirusaito
861f88dd30 Awesomeness, yayayay! (allows XML changes in indra/newview/skins/ to count for viewer running from a directory in indra on Windows) 2014-04-15 20:06:08 -04:00
Lirusaito
77d42f1eb9 Attempt to cure stupid people being unable to untar properly over old versions without causing massive issues
(Gawd, that is not even proper installation process.... I need a drink)
2014-04-15 20:03:24 -04:00
Inusaito Sayori
364a13017c Merge remote-tracking branch 'fairydust/master' 2014-04-15 19:57:31 -04:00
Latif Khalifa
8183deeb30 [xcode5] WIP: rebuilt clang friendly boost 2014-04-14 21:17:22 +02:00
Latif Khalifa
bb56d0a752 [xcode5] WIP: clang build fix 2014-04-14 21:16:24 +02:00
Latif Khalifa
41eafa4ede [xcode5] WIP: build system changes 2014-04-14 21:14:42 +02:00
Inusaito Sayori
ce7629200f Object Import/Export improvements
Support exporting "material" "clickaction" "flags" and "ExtraPhysics"
Support export of Light Texture feature, the expansion to Light feature.
Initial work to support firestorm's format.
Switched from exporting individual flags fields in favor of exporting one U32 field
- We still support the old single flag fields though we no longer export them.
2014-04-09 20:24:15 -04:00
Inusaito Sayori
5dca06d3d4 So then I said, "Compile, are you crazy?!" 2014-04-08 04:51:18 -04:00
Inusaito Sayori
b1d18c7f29 Address Issue 1298: Add Auto-replace text feature, borrowed from LL~ 2014-04-08 02:12:51 -04:00
Inusaito Sayori
0b2d019e61 Latif's requested touch-ups for IM windows in concise mode.
Profile option for concise flyout.
Fix for ding in multi-user chats breaking button alignment.
2014-04-08 01:07:19 -04:00
Inusaito Sayori
ab0dde7fe8 [Floater Flexibility] Part three and a half: Toolbar code cleanup, toolbar in mouselook option
Go into Preferences->Input and Camera, to find the new option~

Thanks to Cinder for checking that the mac changes build and look nice.
2014-04-08 00:36:44 -04:00
Inusaito Sayori
ef01d2af82 Fix "zombie" lie and tabs/spaces inconsistency in xml. 2014-04-07 16:06:33 -04:00
Damian Zhaoying
08084799b9 Merge remote-tracking branch 'Liru/master' 2014-04-06 14:42:00 -03:00
Inusaito Sayori
3642e401da Fix About and Toolbar prefs buttons being mushed together, thanks for the heads-up Friti! 2014-04-04 19:57:32 -04:00
Inusaito Sayori
094d284e62 Missed a git mv, mac should build after this. 2014-04-04 17:28:19 -04:00
Latif Khalifa
2c7459e08d Supress bool/BOOL comparison warning 2014-04-04 21:29:41 +02:00
Latif Khalifa
315d2c4daf Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2014-04-04 21:21:00 +02:00
Aleric Inglewood
e61cabf1ce Remove compiler warning. 2014-04-04 21:13:57 +02:00
Aleric Inglewood
994f409291 Attempt 2 2014-04-04 21:06:30 +02:00
Aleric Inglewood
7d124012c2 First attempt to fix windows compile errors. 2014-04-04 20:58:33 +02:00
Latif Khalifa
4d3c80e273 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2014-04-04 20:08:19 +02:00
Aleric Inglewood
a332a7fc35 Compile fix for motions backport. 2014-04-04 17:33:45 +02:00
Aleric Inglewood
2fb945a489 Fix floating point round off error bug that caused mAnimTime to be decreased in value.
Conflicts:
	indra/llcharacter/llmotioncontroller.cpp
2014-04-04 15:22:18 +02:00
Aleric Inglewood
4d2517d163 Freeze also synchronized avatars when editing an attachment.
On the removal of permYouOwner():

Calling permYouOwner() to determine if an attachment is yours is
not correct: grid gods (and that includes BEFORE requesting admin
status) are marked as owner of everything in their sim.

The reason for that is that otherwise,
  <Melanie_T> if they only had it when actually godding u, the viewer
  would have to have an option to either show the proper menus (it
  doesn't) or allow the sim to refresh the object flags without full
  object updates (it hasn't).
  <Melanie_T> gods often have to act fast, for instance with griefers.
  Having transition to god mode take as long as a full rez just isn't an
  option, apart from the sim load caused by resending all objects.
  <Melanie_T> Then i tried resending only the object that was selected
  but there the arriving object update would close the pie menu.
  So you right-click a prim and the pie menu would close again.

The result has always been that if you are on your own sim, in opensim,
and select an attachment on another avatar, then YOU would freeze, not
the selected avatar. This patch fixes that "opensim related" bug as
well.
2014-04-04 15:19:50 +02:00
Aleric Inglewood
b4848f308f Compile fix for Release 2014-04-04 15:19:39 +02:00
Aleric Inglewood
1c8876cead Synchronize looping animations that start at the same moment. 2014-04-04 15:19:28 +02:00
Aleric Inglewood
1bcb6ad20d Version 2 of AISyncClient et al.
A tool to synchronize objects:
Objects derived from AISyncClient can signal that they are
'ready' or 'not ready' for up to 32 events (using a bitmask)
at a time. Clients that are created at roughly the same time
as other clients, and which return the same 'key' (a virtual
function returning an AISyncKey object) will be grouped together
and receive events (by means of virtual functions being called)
to notify them of all clients being ready or not for one of the
events (the least significant bit)). The other events can be polled.

This new version does away with all the templates and explicitly
remembers what events each client is ready for instead of just
updating a counter of the number of clients. This was necessary
because a client is removed then the server needs to know if it
was ready or not when it has to be able to update those counters.
This time I chose to just run over all stored clients and AND
and OR the per-client-ready-masks because 1) that information
is available now and 2) the lists will normally contain only
one or two clients, so it's fast enough.
The new version also allows for real key comparison (and derived
keys) instead of just using "hash" value that is compared.
2014-04-04 15:19:18 +02:00
Aleric Inglewood
66aaa9cf80 Add LLMotionController* LLMotion::mMotionController
This is needed for synchronization: motions will have to start
(with a specific start time offset) from a point in the code where
only the motion object is available.

I added/used LLMotionController& in a previous commit, this was
now changed into a pointer. There is (obviously) not much reason
for that, but also no disadvantage: the diff relative to LLs code
doesn't get larger since the references where already added, too.

Conflicts:
	indra/llcharacter/llkeyframemotion.cpp
	indra/llcharacter/llkeyframemotion.h
2014-04-04 15:19:02 +02:00
Aleric Inglewood
61d365e957 Removed this again... 2014-04-04 15:15:36 +02:00
Aleric Inglewood
006b319c3a Add AISyncClient<> (and AISyncServer).
A tool to synchronize objects:
Objects derived from AISyncClient can signal that they are
'ready' or 'not ready' for up to 4 events (using a bitmask)
at a time. Clients that signal to be ready for anything
at roughly the same time as other clients, and which return
the same 'hash' (a virtual function returning a 64bit value)
will be grouped together and receive events (by means of
virtual functions being called) to notify them of all clients
being ready or not for one of the events (syncevent1).
The other three events can be polled.

The memory usage is low (one pointer per client that points
to its AISyncServer object), servers are released to a cache
after about 100 ms (unless there is actual need for synchronization),
so there aren't much of those either.

The CPU usage is extremely low: all events are handled in
parallel in a 32 bit value (6 bits per event to count the
number of registered clients and the number of ready clients
for each event, and the remaining 8 bits to count the
number of reference pointers (which should only be a constant
higher, so that is overkill). To signal to a server that
a client has become ready or not is mostly a function call,
which then takes 1 clock cycle or so before returning.
Registration of a client is slightly more expensive as it
requires a pointer to be added to the end of a std::list.
This tool could easily be used as part of the graphics engine
(not that I intend to do that :p).
2014-04-04 15:15:26 +02:00
Aleric Inglewood
e38ec797fd Fix lookat and pointat shared experience.
There was a bug that when people turned off sending viewer effects,
they'd also turn off sending LookAt, while there is a seperate
checkbox to turn THAT off, while still seeing their own avatar
happily look around, breaking shared experience (most notably, most
people will be complete oblivious of the fact that they look like
zombies to others and that their friends do not see the same thing
on their screen).

This patch fixes this: both parties now see the same thing. Lookat
and PointAt are only turned off by their respective checkboxes,
and no longer silently influenced by turning off other viewer
effects.
2014-04-04 15:15:15 +02:00
Aleric Inglewood
94b42e7a9b Speed up of particular inefficient part related to motions.
For these standard motions, the viewer likes to very frequently
flood-call startMotion/stopMotion sometimes, which at the very
least needs a LLUUID lookup in a std::map. In particular, this
is done for two of them for every avatar in the sim every frame.
This code makes it possible to test if that makes sense by
merely doing a bit test.

Conflicts:
	indra/llcharacter/llkeyframemotion.h
2014-04-04 15:14:54 +02:00
Aleric Inglewood
61097dac72 Auto clean up motion cache.
Conflicts:
	indra/llcharacter/llkeyframemotion.cpp
	indra/llcharacter/llkeyframemotion.h
	indra/newview/llfloaterbvhpreview.cpp
2014-04-04 15:10:52 +02:00
Aleric Inglewood
116fe01dee Add AIDebugInstanceCounter
Prints number of instances upon construction and destruction.
Usage:

class LLSomething : public AIDebugInstanceCounter<LLSomething>
...
2014-04-04 14:57:55 +02:00
Aleric Inglewood
ba2bf9f366 Get rid of unused and irrepairable code. 2014-04-04 14:57:41 +02:00
Aleric Inglewood
a5b68f2da2 Changes to llkeyframemotionparam.cpp as result of audit.
These changes were the result of my Motion leak audit.
However, there is a serious problem with LLKeyframeMotionParam
in that it stores plain pointers to objects that can and will be deleted
by other objects. Its the classicial LL example of coding
non-Object-Oriented badly maintainable and instable code.

I cannot make sure this won't go wrong for the simple fact
that LLKeyframeMotionParam is not used at ALL in our code.
Hence, the next commit will rather delete this file.
This commit is merely to have a record of this finding.
2014-04-04 14:57:31 +02:00
Inusaito Sayori
97edb0f954 [Floater Flexibility] Part three: Create the flexible toolbar and create the temporary settings for button visibility
Look in debug settings for settings that start with ToolbarVisible
This will have an official interface by part four.
2014-04-03 14:36:20 -04:00
Inusaito Sayori
a3531b931b Feature Request: Ding for groups and conference chats. 2014-04-03 01:27:27 -04:00
Aleric Inglewood
0438f070f7 Merge remote-tracking branch 'singu/master' 2014-04-01 01:28:55 +02:00
Inusaito Sayori
f53e36c430 Fix not being able to buy land because of inversed RLVa logic. 2014-03-31 13:12:33 -04:00
Inusaito Sayori
8889e2de64 Fix icon packaging on mac. 2014-03-31 12:22:12 -04:00
Shyotl
2d0b310e19 Framerate llinfos spew was clobbering cout decimal precision. 2014-03-29 02:19:14 -05:00
Shyotl
dfb465a11b Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2014-03-29 02:13:26 -05:00
Shyotl
9ed2dc755c Always set materials mask if deferred for materials/alpha pools. Fixes potential crash in LLDrawPoolAlpha::renderAlpha 2014-03-28 17:14:57 -05:00
Latif Khalifa
e70342b356 Removed duplicate check introduced in the last change 2014-03-28 16:42:27 +01:00
Latif Khalifa
ba0fd794d7 Compile fix 2014-03-28 16:20:38 +01:00
Latif Khalifa
dbd7de628f Fix compilation with gcc 2014-03-28 08:50:02 +01:00
Shyotl
d6fdaa93a4 Added adaptive vsync support (selectable in preferences->graphics->hardware, provided the driver supports it). Also hide 16x fsaa on amd hardware, as it is not supported on said hardware (unsure about intel). 2014-03-28 02:34:03 -05:00
Latif Khalifa
80076833d1 Fix compilation with gcc 2014-03-28 08:30:22 +01:00
Latif Khalifa
dc9d3fbf96 Fix build with SDL prior to 1.3.0 2014-03-28 08:29:30 +01:00
Latif Khalifa
e12548ab8c Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2014-03-28 08:45:40 +01:00
Shyotl
894261862d Tweaks to stencil handling to allow masking out of sky (or geometry).
Reset stencil clear value to 0 after done clearing.
2014-03-27 22:31:47 -05:00
Shyotl
07a261a259 A little bit of cleanup. 2014-03-27 22:04:30 -05:00
Shyotl
34a7bf4dbb Comment out unused shader. 2014-03-27 21:30:23 -05:00
Shyotl
5988f6cf88 Updated rigged mesh face batch/pool handling.
Fixed issue with fullbright and glow occlusion.
RenderTransparentWater toggling should work more gracefully.
Fixed some bugs in general drawpool classification for faces. Bump pool was superceding more than it should have.
2014-03-27 21:27:40 -05:00
Inusaito Sayori
039be1f8e9 Fix Issue 1413: Local Texture Default Texture Update Settings, Also fix the side issue of the More section not having visible ui at first.
Also I got fed up with the bad code and leaks so I did some refactoring of floaterlocalassetbrowse.*, but just a bit.
2014-03-27 21:33:21 -04:00
Inusaito Sayori
70e92a1cea More helpful fixes and touchups from Cinder 2014-03-27 20:10:06 -04:00
Inusaito Sayori
2af2e37dcd Right clicking folder with only gestures (no worn items) should still offer remove from outfit if any gesture in that folder is active.
Also follow linked folders when wearing folders, this will make linked folders a lot more useful!
Also fixes a warning and some spacing issues
2014-03-27 20:02:12 -04:00
Inusaito Sayori
a6559b1e51 [Floater Flexibility] Part two: Move floater dictionary into menu commands and use a common function to ShowFloaters between LLToolBar and menus. 2014-03-27 00:31:32 -04:00
Inusaito Sayori
361b8852df Fix Issue 1419: Moving a link to an inventory folder moves the pointed folder and not the link 2014-03-25 19:56:41 -04:00
Inusaito Sayori
ff201ce3f9 Fix Issue 1448: Hard crash when emptying the mute list. 2014-03-25 19:51:49 -04:00
Inusaito Sayori
de2ce83a8d Touchups to namesystem update 2014-03-25 19:39:02 -04:00
Inusaito Sayori
f37d83abe1 [Floater Flexibility] Part one: Refactor all floaters to work with the dictionary in one way or another. 2014-03-25 00:23:56 -04:00
Inusaito Sayori
ee610ceb3f The Name System update!
Adds name list specific name settings, Removes boolean for having lists of speakers with legacy names in favor of having a more flexible setting for them
Have a look at the combo boxes on Adv. Chat->Chat UI to customize these new settings.

There is now a fourth option for name display: LegaCy Name (D is play Name)
2014-03-24 17:52:13 -04:00
Inusaito Sayori
5affacab70 Fixes, mainly for Clang/Mac, from Cinder. 2014-03-24 16:56:10 -04:00
Latif Khalifa
924011f36e Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2014-03-23 14:24:47 +01:00
Inusaito Sayori
70b5a6f05b Prevent Issue 1445, reassess enablement of asset browser buttons when selection may have changed 2014-03-23 06:03:20 -04:00
Inusaito Sayori
05c7270dcf Merge changes for STORM-2008
"Remove from outfit" should deactivate gestures in a folder as well as take off items
Credit to Lance Corrimal
2014-03-20 03:53:11 -04:00
Inusaito Sayori
a75e34d1c2 Feature Request: Allow "wear_folder" SLapps 2014-03-20 03:34:17 -04:00
Inusaito Sayori
f7139ac20e Fix Issue 1406: Create Landmark shows name twice, not description 2014-03-18 19:45:18 -04:00
Inusaito Sayori
e43d718e0f Sappadilli's fix for the mini button 2014-03-18 19:18:57 -04:00
Inusaito Sayori
cc0b5e660d Touch missed spots for picking rigged mesh 2014-03-18 18:38:30 -04:00
Latif Khalifa
8f525a37da Typofix 2014-03-17 00:20:32 +01:00
Latif Khalifa
5e62d2b104 Revert to using Vivox SDK 2 on Linux 2014-03-16 22:44:30 +01:00
Damian Zhaoying
6c373ee31e Update Spanish languages files 2014-03-15 05:14:07 -03:00
Lirusaito
d98c46beb0 Extend SGAllowRiggedMeshSelection to work in inspect and on others 2014-03-13 01:31:11 -04:00
Lirusaito
850772a4ce [RLVa] About floater version display adjustment 2014-03-12 22:21:55 -04:00
Latif Khalifa
08be65e649 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2014-03-13 02:04:59 +01:00
Lirusaito
ed8e37ed89 [RLVa] Updates thanks to Kitty
1ea7389, 49be412, ed4c8e6 & 7ce9521
- changed : "Give to #RLV" agent-to-agent and script-to-agent offers can contain subfolders
-> limited to 3 levels (e.g. #RLV/~FolderA/FolderB/FolderC)
-> #RLV folder is auto-created if it doesn't currently exist

8780d84 - Incremented version number to RLVa-1.4.10
f078067 - internal : boolean (custom) debug settings should have a boolean type
72a8ad8 & 401ca14 - internal : added supporting code for "Detach Folder" RLVa lock checks

05718b5
- fixed : RenderResolutionDivisor is non-functional
-> RenderResolutionDivisor isn't actually taken into account when checking the new screen resolution against the current screen buffer size

4fa138b
- fixed : viewer clips mouse to its rectangle when switching into mouselook while it's not the active application
-> Repro:
* rez a prim with a script to llForceMouseLook(TRUE) and force-sit when clicked (with a slight delay)
* click the prim and give focus to another application
=> the viewer will center the mouse cursor on itself and restrict movement to within its own rectangle (requires alt-tab to escape)
+ Singu Note: Thanks to Kitty for this, it is possible that this would happen in our last release

14132c9
- fixed : region name and global coordinates are shown on the About floater when @showloc restricted
+ Singu Note: RLV version is now shown in help->about

9a2af62 - changed : llRegionSayTo messages are no longer subject to @recvchat(from) or @recvemote(from)

2dc4b89
- fixed : @getstatus and @getstatusall should specify an (optional) separator
-> added support for both @getstatus:tp;|=123 and @getstatus:;|=123

fbb3fb1 - Incremented API version number to 2.8.0
92c39b9 - internal : quick and dirty hack fix for RlvUtil::filterNames() but there's no time to do a proper backport from RLVa-1.5
2580f1c - internal : remove hack for legacy viewers without multi-attachment support
2014-03-12 19:41:15 -04:00
Latif Khalifa
1732d6d427 [Voice Update] Sync default voice debug level with upstream. 2014-03-12 23:48:07 +01:00
Latif Khalifa
bb9a958a1e [Voice Update] Update SLVoice prebuilds and packaging script 2014-03-12 22:50:43 +01:00
Latif Khalifa
f1b8c36a28 Merge branch 'VoiceUpdate' of git://github.com/Lirusaito/SingularityViewer 2014-03-12 22:21:43 +01:00
Aleric Inglewood
03ed12a9b1 Merge remote-tracking branch 'singu/master' 2014-03-12 20:36:12 +01:00
Lirusaito
30f5a3a162 Update qtoolalign (Fixes issue 704)
- Removes shortcut ctrl-a for align tool
-- to avoid ctrl-a for select all text in UI controls messing up prim selection
- Adds llselectmgr select all function
-- to replace ctrl-a select all prims functionality that was a side effect of qtoolalign having this shortcut
- Adds toggle button (up/down arrow) to build floater for toggling display of the lower tab container area
-- This is to satisfy users who relied on ctrl-a to use align while the build floater was minimized and out of the way
- Syncs qtoolalign from Alchemy
2014-03-09 19:00:52 -04:00
Latif Khalifa
e4a3f76f55 Fixed an artifact of Root->Avatar Center rename (Sappadilli) 2014-03-02 20:05:49 +01:00
Drake Arconis
f5bdb56a7c Crash fixes in model upload 2014-03-01 18:53:51 -05:00
Drake Arconis
64d4a9e240 Add missing header guards 2014-03-01 18:00:59 -05:00
Drake Arconis
71d9084a95 Clean out old OGPX stuff 2014-03-01 17:34:22 -05:00
Latif Khalifa
9d6092faaa Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2014-02-21 09:30:08 +01:00
Shyotl
bb0f17ae6f Fix poor batching with mac/ancient drivers. Also, some minor tweaks to sorting algorithm. 2014-02-21 02:24:42 -06:00
Latif Khalifa
ebb46999d8 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2014-02-20 10:31:47 +01:00
Shyotl
1c48aa8f97 Added missing can_batch_texture check. Fixes unbatchable faces occasionally getting batched with the last batchable face batch. This was mostly noticeable with animated faces. 2014-02-19 22:35:43 -06:00
Shyotl
bdc0ad2b8f Experimental volume face batching changes (Cursory testing shows: +~10% larger mean batch size).
-Drive pass selection by face pools. Doing such removes a fair bit of redundant (and often buggy) code.
-Ignore irrelivant batch breakers depending on pass/pool type.
-Face sorting algorithm modified to potentially allow larger batches.
-Removed a few unused/broken things (bake_sunlight/no_materials)
-Fullbright handling should hopefully be a little more consistent.
-Prevent fullbright faces from being placed in 'simple' pool. (They are already simple-er)

Fixed attribute error that popped up with bump faces when batching was disabled.
2014-02-18 11:43:50 -06:00
Shyotl
ac8d5e5ab3 Let shaders dictate vertex buffer attributes for alpha faces (if shaders are enabled) 2014-02-18 09:21:31 -06:00
Latif Khalifa
41416dcffe Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2014-02-11 03:23:21 +01:00
Shyotl
dda7cb5791 Lazy workaround avoiding undefined behavior for rigged meshes with invalid joints. 2014-02-10 20:20:03 -06:00
Shyotl
f7fdeeea9b Be super sure not to let rigged vert weights extend beyond actual joint count. 2014-02-10 20:18:39 -06:00
Shyotl
9d7d7590a7 Prevent debug visualizations from writing to the z-buffer (caused occlusion weirdness) 2014-02-09 23:40:03 -06:00
Inusaito Sayori
77848afc94 Tiny patch for Issue 1385: Use normal folders for outfits while still creating links for everything
Adds debug setting LiruLegacyOutfitAllLinks which overrides legacy outfit settings and forces the resulting folder to consist of only links
2014-02-09 14:42:19 -05:00
Inusaito Sayori
8f7e96e2a5 Minimap enhancements!!
Much of this patch comes from upstream and Kitty Barnett, or is inspired from their works
This commit applies the World-Minimap patches from Catznip.

Catznip stuffs:
- Issue 1383: Parcel lines on mini map
 - Show parcels on the minimap
 - Minimap menu: "Show" submenu: "Property Lines" "Parcels for Sale"
- Option to have world map textures on the minimap
 - Minimap menu: "World Map Textures"
 - Singular touch: Made this comply with hypergridding.

The minimap will now scroll zoom based on where your mouse is if centering on camera is off.

A lot of cruft was cleaned up in this merge, a lot of gSavedSettings lookups in draw were converted to LLCachedControls, some license updates were performed.

Finally: By myself, but inspired by upstream and requested in the group before:
- Option to show tracking circles around people selected on the radar while the radar is visible
 - Minimap menu: "Show" submenu: "Radar Tracking Circles"
2014-02-08 18:26:18 -05:00
Shyotl
eab807daeb Fix fullbright alpha in fixed-function. 2014-02-08 01:47:22 -06:00
Inusaito Sayori
c4bfdcbeac Address Issue 1381: Mouse look cross hair coloration
Adds debug setting LiruCrosshairColor
2014-02-07 14:59:03 -05:00
Inusaito Sayori
3801949887 Little bit more touching up to the italian XML, this time for overlay bar 2014-02-06 17:27:53 -05:00
Inusaito Sayori
29d5c951c5 [STORM-1981] Change tracking beacons to extend to the ground and (optionally) vertically indicate direction
Jonathan Yap's beacon enhancements, with a Singular twist!
2014-02-06 17:23:28 -05:00
Inusaito Sayori
eb4b0d630f [MAINT-2287] The rest of the updates so far to outbox. 2014-02-06 14:53:13 -05:00
Inusaito Sayori
b6225d1d9a [MAINT-2287] Handle refactor 2014-02-06 14:51:36 -05:00
Inusaito Sayori
32ec2be0b6 SimFeatures spew demoted to logcontrol debugs. 2014-02-05 21:39:50 -05:00
Inusaito Sayori
d7dfa91f6f Remove incorrect "You should upgrade your viewer." spew, and demote it to lldebugs. 2014-02-05 20:59:10 -05:00
Inusaito Sayori
c4cc9dd417 Stop leaking in object import! 2014-02-05 15:17:44 -05:00
Inusaito Sayori
884b707385 Hey toolbar, toolbar italiano! 2014-02-04 18:41:10 -05:00
Inusaito Sayori
acbc81c1ea Further Italian Translation purification, fixup, and touches. 2014-02-04 18:33:02 -05:00
Inusaito Sayori
cc60dcc8a4 Languages preferences in order with actual languages in the right place above, please, thank you? 2014-02-04 16:20:24 -05:00
Inusaito Sayori
275f85e7a6 Fix god chat not showing up in god color if the god is using a display name. 2014-02-04 15:21:13 -05:00
Latif Khalifa
24f99a2920 Merge remote-tracking branch 'lirusaito/master' 2014-02-04 01:40:42 +01:00
Inusaito Sayori
2acfbf12ed Fix Issue 1368: Camera viewing angle resets after mouselook.
Only reset FOV when right click was held or released just before leaving, now.
2014-02-03 17:20:25 -05:00
Inusaito Sayori
b0972de510 Address Issue 1371: Enhancement: in Edit object Positions X & Y for OpenSim VarRegion 2014-02-02 16:53:55 -05:00
Inusaito Sayori
af58636c7c Fix the Login Panel such that it persists until a successful login and maintains ui values between failed logins
When the login panel used to die, it now hides instead, we only truly kill it upon successful login.
Much of the opening and setting behaviors have been cleaned up to ensure fields are autofilled by the viewer without any user action once
Everything else like changing saved logins will still work the same.
2014-02-02 16:45:37 -05:00
Inusaito Sayori
7341ad5e6e Support the Script Message API 2014-02-02 16:36:05 -05:00
Inusaito Sayori
744e6c63b6 Fix Issue 1237: Last online says 01/01/1970 for group members
For real this time!
2014-02-02 16:29:06 -05:00
Inusaito Sayori
31aa30e3d0 Group Feature Request: Option to Copy SLURL for an avatar's profile
Added to avatar list menus and instant message drop down menu.
2014-02-02 16:27:20 -05:00
Aleric Inglewood
ebb4489c01 Merge remote-tracking branch 'singu/master' 2014-02-01 22:34:13 +01:00
Inusaito Sayori
31b3ae584e Feature request: menus on the region estate panel's scroll lists. 2014-01-31 00:52:59 -05:00
Inusaito Sayori
151afe4663 Translations fix ups 2014-01-31 00:52:16 -05:00
Inusaito Sayori
b03f7c1504 [RLVa] Version 1.4.9
Thanks to Trinity and, of course, her Kitty!
2014-01-31 00:50:45 -05:00
Inusaito Sayori
bceaee6e41 [RLVa] rlva strings floater!
Generalized toggle() visible() call pattern of rlv floaters to a template struct.
2014-01-31 00:47:19 -05:00
Latif Khalifa
2a812e0e81 Revert "Limit avatar physics to 20-40 simulation steps per second to avoid wonky integration"
This reverts commit cde5b23353.
2014-01-28 23:59:05 +01:00
Shyotl
58b7fe5fef Avoid potential buffer over-read in shader, overrun in application. 2014-01-28 16:28:03 -06:00
Latif Khalifa
c4a82fe0d1 Version 1.8.5 2014-01-28 18:12:23 +01:00
Inusaito Sayori
0c33c0de2e [RLVa] rlva_strings update.
rlva strings floater coming soon!

I highly doubt the translations work anymore
If they still can be translated, I leave it up to translators to decide if they should be
Contact me if you need translation code improved here.
2014-01-28 04:41:16 -05:00
Inusaito Sayori
1b32c79a5e [RLVa] Miscellaneous other touches to rlva code 2014-01-28 04:38:05 -05:00
Inusaito Sayori
dd35f1bd68 [RLVa] Missed sections of canStand update in that last commit. 2014-01-28 04:35:43 -05:00
Inusaito Sayori
9c0d8bbeb1 [RLVa] "blocked_wireframe"? Seems half baked, but it compiles. 2014-01-28 04:34:12 -05:00
Inusaito Sayori
02753bfc7d [RLVa] gRlvHandler.canStand --> RlvActions::canStand 2014-01-28 04:31:34 -05:00
Inusaito Sayori
88ae36f4e1 [RLVa] Forced TPRequest response is now supported! 2014-01-28 04:27:38 -05:00
Inusaito Sayori
4dcf8f3f45 [RLVa] Removal of z offset restrictions 2014-01-28 03:16:35 -05:00
Inusaito Sayori
9e82297303 [RLVa] rlvfloaterbehaviour.* -> rlvfloaters.* 2014-01-28 00:31:40 -05:00
Inusaito Sayori
14a885f8d0 [RLVa] Modernizations
License updates, comment updates, settings cleanup, macros cleanup, dead code removal, etc.
2014-01-27 23:43:16 -05:00
Inusaito Sayori
94aee52c64 [RLVa] b15fdd026026 ported
- internal : reviewed @recvim and @sendim for CHUI (SL-3.5)

Singu changes:
- Updated busy to be referred to as do_not_disturb in llviewermessage.cpp
- Don't send autoresponse if we can't send an IM by rlva
- Updated checks for from name being system to be to_id and from_id null checks.
- Minor compile fix in rlvui.cpp for last commit.
2014-01-27 23:42:09 -05:00
Inusaito Sayori
755d3be89b [RLVa] Disallow inventory floaters when inventory restricted.
Formatting eases the diff with rlva upstream
2014-01-27 20:14:02 -05:00
Inusaito Sayori
6a3ee5fac4 [RLVa] f9f8dbe23ec3 ported
- internal : reviewed @startim for CHUI (SL-3.5)
    -> fixed : "Start Conference Chat" on a selection of multiple calling cards opens an IM session
    -> fixed : actions that would result in an IM window opening shouldn't be blocked if the session is already open
    -> added : RlvActions class to mimick LLAvatarActions and lowering the rlvhandler.h include dependency
2014-01-27 13:54:13 -05:00
Latif Khalifa
63ff4e281b Revert "focusFirstItem was no longer being overridden here, this function has proven not needed, thus."
This reverts commit 655081365f.
2014-01-25 22:31:08 +01:00
Inusaito Sayori
d1cfe54bd9 Fix Issue 1344: Weird mesh distorted bug
Animations require consistent names for points like Avatar Center between viewers
To fix this, we now use Avatar Center instead of Root at the lower levels,
but this is okay, we translate Avatar Center into Root at UI level!
2014-01-25 22:07:39 +01:00
Latif Khalifa
838266d710 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2014-01-25 21:22:49 +01:00
Aleric Inglewood
6547452136 Merge remote-tracking branch 'singu/master' 2014-01-25 20:29:46 +01:00
Aleric Inglewood
095f2d2255 Allow users to join a new grid with Singularity without first having to install another viewer.
I've seen this in other grids (InWorldz and OpenGrid) and is a problem
on DreamNation with every new user: they can't put on a shape or skin
until they first logged in with another viewer. See comments in code.

Tested, and now could successfully add shape, skin, eyes and hair.
2014-01-25 20:20:52 +01:00
Inusaito Sayori
42bf70849c Fix Issue 1344: Weird mesh distorted bug
Animations require consistent names for points like Avatar Center between viewers
To fix this, we now use Avatar Center instead of Root at the lower levels,
but this is okay, we translate Avatar Center into Root at UI level!
2014-01-25 09:44:42 -05:00
Inusaito Sayori
236fa2a284 Fix Issue 870: Crouch toggle not reset when pressing "Fly" button, causes avatar to run/fly downhill.
Reimplements crouch toggle such that crouch is now tracked by the agent object
Fixes crouch being reset when restoring focus to the viewer window, as well.
2014-01-24 22:57:19 -05:00
Inusaito Sayori
2450b435a7 Combine commonly created scroll list menus into single menus identified by menu_num instead of their menu_file
sScrollListMenus is an array such that it will hold more menus in the future, such as groups.
fmenu_file still exists and will still exhibit its old behavior if used.
2014-01-24 21:41:56 -05:00
Latif Khalifa
aaf06fa2cc FITMESH-6, FITMESH-20 Fix for some objects disappearing when hardware skinning enabled and ALM disabled.
NOTE: There appears to be a driver bug on some AMD systems that will cause hardware skinning to break given different combinations of shaders. Users should be advised that if they see improper skinning on their avatars, they should either enable advanced lighting model, or disable atmospheric shaders or hardware skinning.

davep
2014-01-24 12:26:43 +01:00
Latif Khalifa
de29ea779a Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2014-01-24 12:24:14 +01:00
Inusaito Sayori
282df98d09 Complete resize-friendly appearance mode UI 2014-01-24 01:29:38 -05:00
Latif Khalifa
cc9f6b7b7b Fitted mesh fixup: change in llvoavatar.cpp enabled extra information
for avatar look at targets which is not something users expect, disabling for now
2014-01-24 05:51:26 +01:00
Inusaito Sayori
e3c91a3ba1 Added lsl functions from Second Life RC LeTigre 13.12.20.285035 2014-01-23 21:19:40 -05:00
Latif Khalifa
8ea156d128 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2014-01-24 02:20:37 +01:00
Latif Khalifa
99db9edfef Fitted mesh: hookup debug display to Advanced -> Charachter -> Show Avatar Joins 2014-01-24 02:20:25 +01:00
Shyotl
a0c7b1f8ac Try manually nulling out vbo data if its entire contents are to be overwritten. Rumored intel/nvidia optimization. 2014-01-23 19:06:52 -06:00
Shyotl
97d57d81b0 Skip particle-glow vbo logic if shaders aren't enabled. 2014-01-23 19:02:43 -06:00
Shyotl
66ebe45b5e Give 'gDeferredNonIndexedDiffuseAlphaMaskProgram' a unique 'name' 2014-01-23 19:01:49 -06:00
Shyotl
7516871b16 Avoid wasting particles on incredibly small/zero length ribbon segments. 2014-01-23 19:00:30 -06:00
Inusaito Sayori
30bd505eab French update touchup, by Nomade Zhao. 2014-01-23 19:58:45 -05:00
Inusaito Sayori
17f7967e39 Issue 97: Disable Leaving Mouselook when viewer window loses focus 2014-01-23 19:39:38 -05:00
Inusaito Sayori
ab55c61dc3 Feature Request: Add option to reset angles/offsets adjustments made to current camera preset.
Adds "Reset Camera Preset Angle to Default" to view menu
Wasn't quite sure where to hook this up, menu seemed the best for the moment, but really it's more of a preferences button function.
2014-01-23 19:35:17 -05:00
Latif Khalifa
066d0221b8 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2014-01-24 01:16:32 +01:00
Latif Khalifa
269deb56e6 Fitted mesh 2014-01-24 01:11:27 +01:00
Lirusaito
7572674fdb Enforce xml follows flags in scroll containers, and allow the appearance floater to resize, enforcing minimum dimensions of its default size
It was requested to let people resize the height to easily display more sections, and well, this is the easiest fix, if width changes in a nasty way, it can just be fixed since default is min.
2014-01-23 19:07:53 -05:00
Lirusaito
63379105b5 Fix the local chat focu bug, yay! 2014-01-23 19:06:33 -05:00
Lirusaito
655081365f focusFirstItem was no longer being overridden here, this function has proven not needed, thus. 2014-01-23 17:42:08 -05:00
Lirusaito
7ac0330e4b Fix a rare glitch where mouselook zoomed field of view would be maintained upon leaving mouselook 2014-01-22 00:57:15 -05:00
Latif Khalifa
bbb1d15b8e Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2014-01-16 08:18:04 +01:00
Latif Khalifa
b7c54301fb Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2014-01-16 08:17:54 +01:00
Inusaito Sayori
75109e14c3 Italics hotfix
Restores use of the old slant_amt offset for italicizing fonts by slanting quads.
Note that this is the wrong way to fix the issue and should eventually be removed.
2014-01-15 20:15:53 -05:00
Latif Khalifa
3446f708ff Syncronized max bandwith const with prefs panel max 2014-01-06 20:27:17 +01:00
Aleric Inglewood
9bce3b38d4 Do not erase cache every login forever, when NewCacheLocation is set a non-existing directory!
I can't believe that I have not have gotten a cache for two years
because of this... I knew I didn't, but didn't really want to fix
it while I working on the network code (AICurl) ;). It kinda made
for a good testing. Bet my ISP is glad I fixed it though.
2013-12-31 23:37:10 +01:00
Aleric Inglewood
93736308c9 Add missing ft2build.h to linux64 freetype package. 2013-12-30 19:38:41 +01:00
Aleric Inglewood
ba9c5c366b Avoid duplicated entries in mAttachedObjectsVector
This fixes Top Crasher signatures 2 and 50.
http://crash.singularityviewer.org/crashes.php?signature_id=2
http://crash.singularityviewer.org/crashes.php?signature_id=50
2013-12-30 03:24:46 +01:00
Aleric Inglewood
e523aadc4a Do not destruct running Responders upon viewer exit.
This hopefully saves some crashes.
2013-12-29 21:50:10 +01:00
Aleric Inglewood
4416dafe73 Erata for last commit (issue 1113). 2013-12-29 01:49:33 +01:00
Aleric Inglewood
2062431f23 Bug fix.
singularity-do-not-run-directly: /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llcommon/llmemory.h:219: void ll_memcpy_nonaliased_aligned_16(char*, const char*, size_t): Assertion `src != __null' failed.

 Program received signal SIGABRT, Aborted.
 [Switching to Thread 0x7fff3342f700 (LWP 18001)]
 0x00007ffff0f951d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
 (gdb) bt
 #0  0x00007ffff0f951d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 #1  0x00007ffff0f98388 in __GI_abort () at abort.c:90
 #2  0x00007ffff0f8e252 in __assert_fail_base (fmt=0x7ffff10cc080 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x2c7ca97 "src != __null",
     file=file@entry=0x2c7ca40 "/opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llcommon/llmemory.h", line=line@entry=219,
     function=function@entry=0x2c7dc60 "void ll_memcpy_nonaliased_aligned_16(char*, const char*, size_t)") at assert.c:92
 #3  0x00007ffff0f8e302 in __GI___assert_fail (assertion=0x2c7ca97 "src != __null", file=0x2c7ca40 "/opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llcommon/llmemory.h",
     line=219, function=0x2c7dc60 "void ll_memcpy_nonaliased_aligned_16(char*, const char*, size_t)") at assert.c:101
 #4  0x0000000001b3ebd9 in ll_memcpy_nonaliased_aligned_16 (dst=0x7fff2c39f440 "\001", src=0x0, bytes=0)
     at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llcommon/llmemory.h:219
 #5  0x0000000001e09d93 in LLVector4a::memcpyNonAliased16 (dst=0x7fff2c39f440, src=0x0, bytes=0)
     at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llmath/llvector4a.cpp:44
 #6  0x0000000001e2a13c in LLVolumeFace::pushVertex (this=0x7fff3342daf0, pos=..., norm=..., tc=...)
     at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llmath/llvolume.cpp:6106
 #7  0x0000000001e2a03f in LLVolumeFace::pushVertex (this=0x7fff3342daf0, cv=...) at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llmath/llvolume.cpp:6080
 #8  0x0000000001e20498 in LLVolumeFace::optimize (this=0x7fff2c39ee20, angle_cutoff=2) at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llmath/llvolume.cpp:4841
 #9  0x0000000001aa61d4 in LLModel::optimizeVolumeFaces (this=0x7fff2c39e100) at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llprimitive/llmodel.cpp:866
 #10 0x0000000001aa5f28 in LLModel::createVolumeFacesFromDomMesh (this=0x7fff2c39e100, mesh=0x7fff2c36cc90)
     at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llprimitive/llmodel.cpp:829
 #11 0x0000000001aa8324 in LLModel::loadModelFromDomMesh (mesh=0x7fff2c36cc90) at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llprimitive/llmodel.cpp:1402
 #12 0x0000000000a9bc11 in LLModelLoader::doLoadModel (this=0x7fff4f74d480) at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/newview/llfloatermodelpreview.cpp:1535
 #13 0x0000000000a9b100 in LLModelLoader::run (this=0x7fff4f74d480) at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/newview/llfloatermodelpreview.cpp:1395
 #14 0x00007ffff5e52e9a in LLThread::staticRun (apr_threadp=0x7ffff7e572e0, datap=0x7fff4f74d480)
     at /opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/llcommon/llthread.cpp:93
 #15 0x00007ffff7bc6e0e in start_thread (arg=0x7fff3342f700) at pthread_create.c:311
 #16 0x00007ffff10490fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

This happened while loading some .dae.
2013-12-28 20:52:11 +01:00
Aleric Inglewood
a4b2ecc4f7 Fix issue 1113, "detaching editted attachment does not unfreeze avatar"
Detaching an attachment didn't reset the select managers pause request
for the avatar.
2013-12-28 18:59:20 +01:00
Aleric Inglewood
c8017c7945 Merge remote-tracking branch 'singu/master' 2013-12-27 17:59:00 +01:00
Aleric Inglewood
f81f5e2374 Show the part of an animation after the loop out point when previewing. 2013-12-27 17:57:45 +01:00
Aleric Inglewood
19a36a6e12 Don't assert at exit.
It's perfectly ok when a responder is being deleted before it finished,
when the application is exiting.
2013-12-27 17:55:49 +01:00
Latif Khalifa
9768b3e42f Build fix 2013-12-25 18:53:29 +01:00
Latif Khalifa
bc6348bb34 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-12-25 18:08:42 +01:00
Shyotl
3da9fe0e94 Avoid calling a few deprecated gl functions when shaders are enabled. 2013-12-25 02:09:36 -06:00
Shyotl
75f94d346d Fixed Alerics favorite assertion. 2013-12-24 20:21:55 -06:00
Shyotl
4eb9dc5191 Use GL_STREAM_DRAW_ARB for post-process fullscreen quad. 2013-12-24 20:17:05 -06:00
Shyotl
e00e704cbd Fix minor error in shader which prevented ssao from working with shadows enabled. 2013-12-24 20:16:05 -06:00
Shyotl
033880c8f9 Kill some vertex attribute / shader attribute inconsistencies. (Issue 1287, 1281) Also hopefully improved face edit overlay behavior when editing normal/specular texture/scale/offset/rotation. 2013-12-24 20:15:29 -06:00
Aleric Inglewood
1f80dac4c0 Don't cause undefined behavior by calling std::vector<>::front() for empty container. 2013-12-24 20:03:27 +01:00
Aleric Inglewood
a17eca6300 Merge remote-tracking branch 'singu/master' 2013-12-23 20:34:11 +01:00
Latif Khalifa
4a2168cf48 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-12-20 04:59:59 +01:00
Latif Khalifa
facd5a76c5 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-12-20 04:59:48 +01:00
Latif Khalifa
85c875e856 Link boost dynamically, bundle its libs. Addresses issue 1152.
Rebuild collada to also use dynamic boost.
SV-1152 #close Fixed by linking boost dynamically
2013-12-20 03:02:17 +01:00
Aleric Inglewood
302bebd80f Merge remote-tracking branch 'singu/master' 2013-12-19 23:03:22 +01:00
Inusaito Sayori
85943b8a03 Rename zmm_mlfov to ExodusAlternativeFOV 2013-12-19 11:57:58 -05:00
Aleric Inglewood
8f2781ca3b Fix bug with adding a new grid. 2013-12-19 03:13:33 +01:00
Inusaito Sayori
101c65098d Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-12-17 00:28:20 -05:00
Inusaito Sayori
195c962d8c Feature request from Issue 1285: Cost per sq. m. display on map. 2013-12-15 09:51:16 -05:00
Siana Gearz
2bb2e05ef9 Merge branch 'master' of https://github.com/Shyotl/SingularityViewer 2013-12-15 14:56:20 +01:00
Siana Gearz
679019f2de Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer 2013-12-15 14:09:29 +01:00
Inusaito Sayori
649c29674c Feature Request: User control over which UI will become hidden when going into mouselook.
Adds three checkboxes to input and camera preferences: Floaters, Notices, and Menubar
Should satisfy Issue 462.
SV-462 #close Done~
2013-12-14 20:48:48 -05:00
Inusaito Sayori
b22cc2c2fa [Warnings] Fixed warning: "_FORTIFY_SOURCE" redefined [enabled by default] 2013-12-14 00:05:10 -05:00
Inusaito Sayori
2642a1c3ff [Warnings] Fix class/struct inconsistency. 2013-12-14 00:00:52 -05:00
Shyotl
9014d56957 Fix 'setBuffer: Shader consumption mismatches data provision.' error in LLPipeline::updateCull. Issue caused by LLDrawPoolAlpha not unbinding shaders when only basic shaders are enabled. https://code.google.com/p/singularity-viewer/issues/detail?id=1281 2013-12-13 02:21:54 -06:00
Shyotl
7da8b012e6 Pulled SSAO out into its own shader to support running at a lower-than-native framebuffer resolution (defaults at half-resolution [SHRenderSSAOResolutionScale=.5] ). This doesn't improve the slow ssao/shadow softening, however, as that bit remains unchanged. 2013-12-13 02:19:57 -06:00
Inusaito Sayori
edabdcf724 log_sStringTemplates_accesses now spews lldebugs, not llinfos 2013-12-11 15:57:05 -05:00
Siana Gearz
c5adb01ed9 Stop occasional crash during shutdown 2013-12-10 23:11:07 +01:00
Inusaito Sayori
13f26e6b5a Feature request: Add EnableNongestureSounds as an opposite to gesture mute 2013-12-10 15:56:07 -05:00
Siana Gearz
64e7be0321 This should make the cache-full situation a lot more benign
I should be ashamed of myself, i took ugly, terrible code and uglied it up even more.
2013-12-09 08:35:21 +01:00
Siana Gearz
e182173ee2 Fatal paranoia cure 2013-12-09 03:39:47 +01:00
Inusaito Sayori
a59940c592 Fix Issue 1273: Typing in Group Chat opens IM Window for other participants
Broken logic, my bad.
2013-12-08 14:21:39 -05:00
Inusaito Sayori
36d8df602c [Radar] Feature request: Have Focus Next/Prev wrap around when it reaches the end 2013-12-06 13:10:12 -05:00
Inusaito Sayori
062973aaaf Default SinguOffsetScrollKeys to false and expose it in Camera prefs.
Adds "Scrolling with control and/or shift held adjusts camera position" to Input & Camera prefs
2013-12-06 08:43:28 -05:00
Inusaito Sayori
be369b5500 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-12-04 14:05:46 -05:00
Aleric Inglewood
ed0628774a Turn noisy AudioEngine debug output into Debug Level. 2013-12-04 01:21:18 +01:00
Inusaito Sayori
f988cd36b6 Attempt to fix Issue 1264: Vacant lines in Friends list 2013-12-02 22:45:44 -05:00
Inusaito Sayori
8fb2812899 LLIconCtrl Params 2013-12-02 20:45:07 -05:00
Inusaito Sayori
b4d0896507 Fixups to mistakes of the past. 2013-12-02 20:30:59 -05:00
Inusaito Sayori
4116ac75f6 LLUICtrl Params
Also adds support for requests_front boolean attribute to lluictrl from upstream
2013-12-02 20:17:48 -05:00
Inusaito Sayori
23958965aa LLInitParam/LLUI Params enhancement
Specialized param handling for common linden types
And pre-viewer-interesting modernized llinitparam.* (includes llsdparam.cpp update)
2013-12-02 00:27:50 -05:00
Inusaito Sayori
9723a45e72 Modernize LLIconCtrl
Adds min_height and min_width attributes
Adds mPriority for controlling priority with which to call LLUI::getUIImage*
Moves specialized setImage()s into setValue
Removes mImageName and mImageID, value is stored in base as LLSD now
2013-12-01 15:58:24 -05:00
Inusaito Sayori
bbb55b0b4d LLUICtrl support for "enabled_control" and "disabled_control" attributes from upstream. 2013-12-01 11:56:45 -05:00
Inusaito Sayori
f3ca4b6e34 Fix Issue 1222 by changing the default Field of View for mouselook zoom
Smooth scroll changes the meaning of the numbers, unfortunately.. so for those who haven't figured out how to customize their mouselook zoom, this'll hafta do.
Also clarified the description of the debug.
SV-1222 #close Fixed up, will require a reset of the debug setting "zmm_mlfov", clean install, or just scroll to modify it.
2013-12-01 00:33:04 -05:00
Aleric Inglewood
1dfd9a9c75 Merge remote-tracking branch 'singu/master' 2013-11-30 18:44:58 +01:00
Latif Khalifa
340286f918 Merge branch 'master' of https://github.com/siana/SingularityViewer 2013-11-29 16:24:36 +01:00
Latif Khalifa
e41b346046 Added CrashReportID debug setting that will be set to the ID of the last crash that was sent to the crash tracker 2013-11-29 16:22:06 +01:00
Latif Khalifa
d8fa14cac5 Notifying users about crash report ID on login creates confusion.
Revert "Added notification that chat report has been sent after the user logs in."

This reverts commit 4e79bce3e2.
2013-11-29 16:09:58 +01:00
Latif Khalifa
2c99e07b93 Fallback to old method of bundling MS C runtime, if automatic one fails 2013-11-29 16:06:56 +01:00
Latif Khalifa
f1ee3a0834 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-11-29 15:33:54 +01:00
Siana Gearz
ff3f6eccf7 One handed walking and running - LMB+RMB on your avatar 2013-11-29 11:33:59 +01:00
Siana Gearz
b7e9a94744 Fix closing the pay floater, reported in chat by Margot 2013-11-29 10:05:17 +01:00
Siana Gearz
faf5a8e694 Translation and debranding fixes 2013-11-29 08:47:25 +01:00
Siana Gearz
8a13599436 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer 2013-11-29 06:27:05 +01:00
Siana Gearz
767597ffe3 Merge branch 'master' of https://github.com/AlericInglewood/SingularityViewer 2013-11-29 06:25:10 +01:00
Siana Gearz
919fdafad5 Language properties clean-up 2013-11-29 06:24:55 +01:00
Shyotl
78e3d61b98 Remove ambient occlusion darkening from all deferred shaders except the one that actually calculates occlusion values.. (aka every shader except class2/softenLightF.glsl) 2013-11-28 21:07:25 -06:00
Inusaito Sayori
fd21afa0b3 French ALM words 2013-11-28 20:47:51 -05:00
Inusaito Sayori
5491ff8a51 [LLIMMgr/LLIMPanel] Fix Issue 1254: bug voice in conference
Conference ids are subject to change, switched to boost::ref to bind the real one.
SV-1247 #close Fixed nao~
2013-11-28 20:18:29 -05:00
Inusaito Sayori
909ce355e2 [LLIMMgr/LLIMPanel] Switched from dialog checks for nothing special to generic P2P session checking 2013-11-28 20:08:57 -05:00
Inusaito Sayori
63a9555d17 Use Links.SingularityViewer for Issue Tracker link. 2013-11-27 12:27:03 -05:00
Aleric Inglewood
e85241d9ab Merge remote-tracking branch 'singu/master' 2013-11-26 22:15:00 +01:00
Aleric Inglewood
38957ff531 Reduce calls to LLHoverView::updateText
Basically to avoid calling LLTrans::getString 250 times per second,
and seeing
INFO: log_sStringTemplates_accesses: LLTrans::getString/findString called 19000 in total.
INFO: log_sStringTemplates_accesses: LLTrans::getString/findString called 20000 in total.
etc, every 40 seconds in the log.
2013-11-26 22:09:46 +01:00
Aleric Inglewood
8357a2b90b Speed up ll_assert_aligned
Although only used in Debug mode, this showed up in a profiling
with a very significant amount of CPU cycles (in a state when
the viewer bogged down to 1 FPS because of drawing terrain,
but still - significant compared to the code that was being
executed (ie, 10%)).

This patch should bring that down from a few hunderd to one clock
cycle.
2013-11-26 17:52:24 +01:00
Salvatore La Bua
dad7228d56 Add Italian skin translation provided by druskus 2013-11-26 11:20:18 +01:00
Latif Khalifa
e2c8e4950d Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-11-26 11:15:48 +01:00
Inusaito Sayori
342c812121 Add initial_mime_type param to LLFloaterWebContent, defaulted to "text/html" 2013-11-26 05:13:02 -05:00
Inusaito Sayori
4c1880acac Default legacy log launch to on, and limit it to platforms it works on(windows) at compile time. 2013-11-26 04:49:37 -05:00
Inusaito Sayori
7383b0a974 Sync mats translation, thanks Nomade. 2013-11-26 04:35:00 -05:00
Inusaito Sayori
748d55ddd0 French Materials! (and cleanup\inclusion of old stuff) 2013-11-26 01:19:48 -05:00
Inusaito Sayori
7fd61c3bf1 Fix delete not working in text editors 2013-11-25 21:03:36 -05:00
Latif Khalifa
48850b2af0 Compile fix.
This appears to be committed blindly without testing even if it build.
ll_sd_from_color4() / ll_color4_from_sd() need to be used to store and get color from LLSD.
2013-11-26 01:03:10 +01:00
Latif Khalifa
4e79bce3e2 Added notification that chat report has been sent after the user logs in.
This will also add a line in the chat log with the report id
2013-11-26 00:38:00 +01:00
Latif Khalifa
362415fe8a Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-11-26 00:36:53 +01:00
Latif Khalifa
38248ac5b3 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-11-26 00:36:43 +01:00
Inusaito Sayori
98d5e4bea8 Possibly fix and restore Report Abuse to avs list menus 2013-11-25 03:44:07 -05:00
Inusaito Sayori
201ca35afb Possible fix for Mute/Unmute from lists of avatars not working 2013-11-25 03:33:13 -05:00
Inusaito Sayori
26655aefe0 Fix last online unknown showing up as zeroed out date.
Adds group_member_status_unknown to strings.xml
SV-1237 #close Fixed~
2013-11-25 03:24:40 -05:00
Aleric Inglewood
f8d9bcf487 Don't reset easy handles after using them.
We create a new easy handle every time.
2013-11-24 19:15:48 +01:00
Aleric Inglewood
ec436b0e3b Improve upload_finished detection for HTTP requests.
We detect the end of an upload when libcurl informs us
that it is no longer interested in knowing if a socket
is writable (which it tells us cause we're doing the call
to select(), by means of a call to MultiHandle::socket_callback).

However, this does not *always* work.
The debug output might look like this:

[...initialization and first part of a TLS handshake...]
0x7f759f0ad700   CURL        :   select(55, {17, 39, 46, 47, 48, 49, 50, 51, 52, 54}, NULL, NULL, timeout = 1 ms) = 7
0x7f759f0ad700   CURLTR      :   curl_multi_socket_action((CURLM*)0x7f758c002920, 46, CURL_CSELECT_IN, <unfinished>	<--- Calling curl_multi_socket_action (socket 46 is readable)
0x7f759f0ad700   CURLIO      0x13fce7b0       * SSLv3, TLS change cipher, Client hello (1):
0x7f759f0ad700   CURLIO      0x13fce7b0       S> 1 bytes
0x7f759f0ad700   CURLIO      0x13fce7b0       * SSLv3, TLS handshake, Finished (20):
0x7f759f0ad700   CURLIO      0x13fce7b0       S> 16 bytes
0x7f759f0ad700   CURLIO      0x13fce7b0       * SSL connection using AES256-SHA
0x7f759f0ad700   CURLIO      0x13fce7b0       * Server certificate:
0x7f759f0ad700   CURLIO      0x13fce7b0       *          subject: C=US; ST=California; L=San Francisco; O=Linden Lab, Inc.; CN=*.agni.lindenlab.com; emailAddress=root@lindenlab.com
0x7f759f0ad700   CURLIO      0x13fce7b0       *          start date: 2012-09-20 22:55:47 GMT
0x7f759f0ad700   CURLIO      0x13fce7b0       *          expire date: 2015-09-20 22:55:47 GMT
0x7f759f0ad700   CURLIO      0x13fce7b0       *          issuer: C=US; ST=California; L=San Francisco; O=Linden Lab, Inc.; OU=Linden Lab Certificate Authority; CN=Linden Lab Certificate Authority; emailAddress=ca@lindenlab.com
0x7f759f0ad700   CURLIO      0x13fce7b0       *          SSL certificate verify ok.
0x7f759f0ad700   CURLIO      0x13fce7b0       * STATE: PROTOCONNECT => DO handle 0x7f758d62d810; (connection #2)
0x7f759f0ad700   CURLIO      0x13fce7b0       H< POST /cap/d67d4540-4504-b3d1-1d26-112010e88bd8 HTTP/1.1\r\nHost: sim10480.agni.lindenlab.com:12043\r\nAccept: */*\r\nAccept-Encoding: deflate, gzip\r\nContent-Type: application/llsd+xml\r\nX-SecondLife-UDP-Listen-Port: 32837\r\nConnection: keep-alive\r\nKeep-alive: 300\r\nContent-Length: 333\r\n\r\n
0x7f759f0ad700   CURLIO      0x13fce7b0       * STATE: DO => DO_DONE handle 0x7f758d62d810; (connection #2)
0x7f759f0ad700   CURL        :       Entering BufferedCurlEasyRequest::curlProgressCallback(0x13fce7b0, 0, 0, 333, 0)	<=== THIS IS NEW: total to upload: 333 bytes, total uploaded: 0 bytes.
0x7f759f0ad700   CURLIO      0x13fce7b0       * STATE: DO_DONE => WAITPERFORM handle 0x7f758d62d810; (connection #2)
0x7f759f0ad700   CURL        :       Entering BufferedCurlEasyRequest::curlProgressCallback(0x13fce7b0, 0, 0, 333, 0)
0x7f759f0ad700   CURLIO      0x13fce7b0       * STATE: WAITPERFORM => PERFORM handle 0x7f758d62d810; (connection #2)
0x7f759f0ad700   CURL        :       Entering BufferedCurlEasyRequest::curlProgressCallback(0x13fce7b0, 0, 0, 333, 0)
0x7f759f0ad700   CURL        :       Entering BufferedCurlEasyRequest::curlProgressCallback(0x13fce7b0, 0, 0, 333, 0)
0x7f759f0ad700   CURL        :       Entering BufferedCurlEasyRequest::curlProgressCallback(0x13fce7b0, 0, 0, 333, 0)
0x7f759f0ad700   CURLTR      :       curl_easy_getinfo((CURL*)0x13fcf320, CURLINFO_PRIVATE, 0x7f759f0abdb0) = CURLE_OK
0x7f759f0ad700   CURL        :       Entering MultiHandle::socket_callback((CURL*)0x13fcf320, 46, CURL_POLL_INOUT, 0x7f758c001508, 0x7f758c2ce4e0) [CURLINFO_PRIVATE = 0x13fce7b0]
0x7f759f0ad700   CURL        :         CurlSocketInfo::set_action(CURL_POLL_IN --> CURL_POLL_INOUT) [0x13fce7b0]	<=== WATING FOR WRITING BUT ALREADY WAITING FOR INPUT!
0x7f759f0ad700   CURL        0x13fce7b0          reset_lowspeed: mLowSpeedClock = 138530973390; mStalled = -1
0x7f759f0ad700   CURLTR      :   <continued> {11}) = 0									<--- Returning from curl_multi_socket_action
0x7f759f0ad700   CURL        :   select(58, {17, 39, 46, 47, 48, 49, 50, 51, 52, 54}, {36, 46, 57}, NULL, timeout = 756 ms) = 5
0x7f759f0ad700   CURLTR      :   curl_multi_socket_action((CURLM*)0x7f758c002920, 46, CURL_CSELECT_OUT, <unfinished>	<=== SOCKET AVAILABLE FOR WRITING
0x7f759f0ad700   CURLIO      0x13fce7b0       * additional stuff not fine transfer.c:1037: 0 0
0x7f759f0ad700   CURLIO      0x13fce7b0       D< 333 bytes: "<llsd><map><key>folders</key><array><map><key>fetch_folders</key>...etc"	<=== WRITING *ALL* DATA
0x7f759f0ad700   CURL        :       Entering BufferedCurlEasyRequest::curlProgressCallback(0x13fce7b0, 0, 0, 333, 333)	<=== THIS IS NEW, DETECT END OF UPLOAD
0x7f759f0ad700   CURL        0x13fce7b0          upload_finished: mStalled set to Time_10ms (138530973390) + 6000 (60 seconds)
0x7f759f0ad700   CURL        :       Entering BufferedCurlEasyRequest::curlProgressCallback(0x13fce7b0, 0, 0, 333, 333)
0x7f759f0ad700   CURL        :   select(58, {17, 39, 46, 47, 50, 52, 54}, {36, 46, 57}, NULL, timeout = 0 ms) = 8
0x7f759f0ad700   CURLTR      :   curl_multi_socket_action((CURLM*)0x7f758c002920, 46, CURL_CSELECT_IN|CURL_CSELECT_OUT, <unfinished>
0x7f759f0ad700   CURLIO      0x13fce7b0       * HTTP 1.1 or later with persistent connection, pipelining supported
0x7f759f0ad700   CURLIO      0x13fce7b0       H> HTTP/1.1 200 OK\r\n

...and the server already replies without a call to MultiHandle::socket_callback between
writing and reading, because the socket was still (already) waiting for input anyway
(since it was waiting for the SSL/TLS handshake before in this case, but
it also happens when the data has to be written in more than one writes).

Using the progress callback however, we are able to detect the end of the upload right
after writing, anyway.
2013-11-24 19:13:17 +01:00
Aleric Inglewood
6714d3585d Improve CURLTR debug output.
It was very confusing that only *after* a call to a libcurl function
it was written to debug output that it was called.
Now it prints it before calling it, and when that leads to additional
debug output while inside the function, it prints that before giving
the return value.

For example:

0x7f529ea15700   CURLTR      :   curl_multi_socket_action((CURLM*)0x7f528c002920, CURL_SOCKET_TIMEOUT, 0, <unfinished>
0x7f529ea15700   CURLIO      0xea8ef30       * About to connect() to login.agni.lindenlab.com port 443 (#0)
0x7f529ea15700   CURLIO      0xea8ef30       *   Trying 216.82.16.97...
0x7f529ea15700   CURLIO      0xea8ef30       * 0xe3240e0 is at send pipe head!
0x7f529ea15700   CURLIO      0xea8ef30       * STATE: CONNECT => WAITCONNECT handle 0x7f528c001df0; (connection #0)
0x7f529ea15700   CURLTR      :       curl_easy_getinfo((CURL*)0xe3240e0, CURLINFO_PRIVATE, 0x7f529ea13db0) = CURLE_OK
0x7f529ea15700   CURL        :       Entering MultiHandle::socket_callback((CURL*)0xe3240e0, 36, CURL_POLL_OUT, 0x7f528c001508, 0) [CURLINFO_PRIVATE = 0xea8ef30]
0x7f529ea15700   CURLTR      :         curl_easy_getinfo((CURL*)0xe3240e0, CURLINFO_PRIVATE, 0x7f529ea13d58) = CURLE_OK
0x7f529ea15700   CURLTR      :         curl_multi_assign((CURLM*)0x7f528c002920, 36, 0x7f528c031680) = 0
0x7f529ea15700   CURL        :         CurlSocketInfo::set_action(CURL_POLL_NONE --> CURL_POLL_OUT) [0xea8ef30]
0x7f529ea15700   CURL        :       MultiHandle::timer_callback(): timeout set to 1 ms.
0x7f529ea15700   CURLTR      :   <continued> {1}) = 0

Unfortunately, this breaks defining DEBUG_CURLIO without using libcwd,
but that was unusable already anyway (even though it compiled).
2013-11-24 18:24:09 +01:00
Inusaito Sayori
44d1b4f1fb A start on the group's feature request to have indication of mute in friends list
We may need to trick the friends list into refreshing when someone is muted to complete this feature...
probably need mutelist callbacks if those exist
2013-11-22 20:21:47 -05:00
Inusaito Sayori
7d98cf1891 [LLIMMgr/LLIMPanel] Woops, only allow invites to Adhocs!! 2013-11-22 18:41:34 -05:00
Inusaito Sayori
2d66022727 [LLIMMgr/LLIMPanel] Clean up the now redundant usage of isInviteAllowed() 2013-11-22 18:18:05 -05:00
Inusaito Sayori
15fefc231b [LLIMMgr/LLIMPanel] isInviteAllowed should return based on mSessionType, not on mDialog. 2013-11-22 18:09:13 -05:00
Inusaito Sayori
53969d05d8 [LLIMMgr/LLIMPanel] Always allow Drag and Drop sharing of any inventory regardless of mDialog so long as mSessionType is P2P_SESSION 2013-11-22 18:00:58 -05:00
Inusaito Sayori
209e64b136 Merge llfloatertools.cpp with upstream to fix MATBUG-240
MATBUG-240: Unable to change media settings for an already applied media texture unless media texture is removed and reapplied.
2013-11-22 17:35:11 -05:00
Inusaito Sayori
f3f1727b49 Actually fix SV-1226
It happened because we filtered mFromName which started out as from_name, and inconsistently used the two after that...
This change switches to just using mFromName after that point..
SV-1226 #close Fixed it~
2013-11-22 00:49:47 -05:00
Inusaito Sayori
15dbce00ee Prevent any RLVa filtering of music information as mentioned in SV-1226 2013-11-21 23:09:13 -05:00
Aleric Inglewood
2a7b96fab2 Increase connect time outs for SSL/TLS connections to 30 seconds.
On (very) slow machines this might improve the experience.
This only has effect on Second Life, since that's currently the only
grid that uses https for capabilities (all of them, except GetMesh,
GetMesh2 and GetTexture).

When linking the viewer with libmemleak, which significantly slows
down calls to malloc (and calloc, realloc, new, memalign and so on)
and free (delete), I no longer could download my inventory.
With this patch this was solved. The reason was that completing
the SSL/TLS handshake took more than 10 seconds (15 to 20).
2013-11-21 19:47:25 +01:00
Aleric Inglewood
1aa0a9be67 Minor bug fix. 2013-11-21 01:28:34 +01:00
Aleric Inglewood
53e26d4909 Compile fix for -DDEBUG_CURLIO
Since that fakes the libcwd macros, this is needed to compile
the recent change that allows to only turn on debugging output
for certain statemachine objects when DEBUG_CURLIO is defined,
but libcwd is not used (CWDEBUG is undefined).
2013-11-21 01:28:16 +01:00
Aleric Inglewood
bdef8dc185 Merge remote-tracking branch 'singu/master' 2013-11-20 15:13:25 +01:00
Siana Gearz
9c29488044 If the text is too skinny to render, don't crash 2013-11-20 10:33:15 +01:00
Siana Gearz
060628397b Merge branch 'master' of https://github.com/Shyotl/SingularityViewer 2013-11-20 05:50:03 +01:00
Siana Gearz
f23dc157be Prevent accidental modification of vital stock grid 2013-11-20 05:49:43 +01:00
Shyotl
3715b7439d Doer fonts fast(er)! (better batching for font glyph rendering) 2013-11-19 19:40:29 -06:00
Siana Gearz
cde5b23353 Limit avatar physics to 20-40 simulation steps per second to avoid wonky integration 2013-11-20 02:22:16 +01:00
Siana Gearz
07736106b1 Suppress asserts in fallback font loading 2013-11-20 02:20:58 +01:00
Siana Gearz
01744730a1 Merge branch 'master' of https://github.com/AlericInglewood/SingularityViewer 2013-11-20 01:11:13 +01:00
Siana Gearz
c162b470b2 Merge branch 'master' of https://github.com/Shyotl/SingularityViewer 2013-11-20 01:09:10 +01:00
Shyotl
5d2511e39e More font cleanup and updating. 2013-11-19 17:56:27 -06:00
Aleric Inglewood
483b97a608 Merge remote-tracking branch 'singu/master' 2013-11-19 22:13:57 +01:00
Aleric Inglewood
ea0e25b92b Make entering a Login URI in the grid manager more robust.
Before, when anything but the exact correct Login URI was entered, the
user would either get no error, or a pop up saying "Cannot retrieve grid
info from server."

With this patch, that pop up includes what went wrong and stresses that
they check if they entered the correct Login URI and where to find it.

I was motivated to write this after looking at crash report 8405 where
a user who had downloaded Singularity for the very first time crashed
twice when entering things like "aviworlds" and " aviworlds.com:8002"
(not the space), and "http:aviworlds.com:8002" (missing '//').

Especially in the light of FS accepting Login URI without the 'http://',
a lot of grid websites (like that of aviworlds) might instruct users
to enter the url without http://. Ie, this user was told to enter
just "aviworlds.com:8002", and when that failed was instructed to
add 'http' in front of it...

Now the code accepts also really WEIRD things, but will never mess
up a good entry. For example, if you enter "pssshht:aviworlds.com:8002"
then that will work, as a side effect. The real objective however is
of course to let things work like: "aviworlds.com:8002  ",
"http:aviworlds.com:8002", " http:/aviworlds.com:8002", and to give
a usable error message when there is a typo in the hostname (Cannot
resolve hostname) or they forget to add a port number (404, or
connection refused), plus the text "Make sure you entered the correct
Login URI. An example of a Login URI is: \"http://cool.grid.com:8002/\",
this url can usually be found on the website of the grid."
2013-11-19 22:00:34 +01:00
Aleric Inglewood
06bebcc5c4 Bug fix for BlockingResponder.
Blocking http requests (code using responders derived from
BlockingResponder) *do* call getRaw() and getLLSD to get the body of
server error messages. It is therefore perfectly ok if mStatus !=
HTTP_OK.
2013-11-19 21:16:12 +01:00
Aleric Inglewood
63a6ed4f43 Fix floater xmls: tooltip must be tool_tip. 2013-11-19 20:26:55 +01:00
Latif Khalifa
26ca140e4b Fixed symbol generation on Mac with channel specific packages 2013-11-19 08:47:18 +01:00
Latif Khalifa
054d67669f Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-19 06:28:45 +01:00
Shyotl
503e5287cd Fix minor oversight that broke openal audio impl. 2013-11-18 23:27:29 -06:00
Latif Khalifa
7187ceb0ac Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-19 05:14:46 +01:00
Latif Khalifa
594eacb480 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-19 04:44:55 +01:00
Latif Khalifa
f21bec1ab9 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-11-19 04:44:47 +01:00
Latif Khalifa
e6977de12f Mac build changes to create specific channel installers 2013-11-19 04:19:48 +01:00
Latif Khalifa
c99f54367d Use viewer channel as the basis for installer file names 2013-11-19 00:50:06 +01:00
Latif Khalifa
c6ec03ab19 Re-enable generating tarballs when packaging on Linux 2013-11-19 00:52:59 +01:00
Latif Khalifa
cce3809a26 Autogenerate version numbers on Mac too 2013-11-19 00:28:05 +01:00
Latif Khalifa
7183797e05 Autogenerated versioned windows resource files 2013-11-19 00:12:34 +01:00
Aleric Inglewood
7b9f854c66 Fix for 'with active responder' llerrs crash.
This fixes at least one case (crash report 8407), which comes
down to not cleanly informing a responder of failure when the
request url is empty (or so badly formed that it isn't a valid
url). As a result, the statemachine would abort() without
informing the responder - which is bad, sort of.

The previous cases where the responder needed to be informed
of a failure, namely "statemachine timed_out()" and "bad_socket()"
when a socket suddenly becomes bad for unknown reason, have been
replaced with the more general 'aborted()' function, which must
be called before the statemachine calls abort(). Clearly this
has been done for all cases of abort() now, so that if the
llerrs fires again in the future then that would have to be
after the statemachine calls finish(), which is still as "impossible"
as it was - hence the llerrs is still there to make sure.

The reason that this seldom happened on SL, and more often on
opensim, even more often on home-brew test grids, seems plausible:
malformed urls happen more in those cases.

I also took the opportunity to improve the robustness of cases
where the curl error code is checked: it makes no sense to check
what curl gives as error code when an internal error occurred.
2013-11-18 18:16:26 +01:00
Shyotl
b9d2ad3132 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2013-11-18 10:38:39 -06:00
Shyotl
8aa4d0fd27 Removed fasttimer that was hurting perf a tiny bit. 2013-11-18 09:58:21 -06:00
Shyotl
030588caaf Underwater shadows. 2013-11-18 09:57:35 -06:00
Shyotl
be249ac8a1 Font update. Minor refactor, and removed some pointless code that was leaking. 2013-11-18 09:56:49 -06:00
Shyotl
2badc1c79c Initialize LLListener_OpenAL::mRolloffFactor just to be safe. 2013-11-18 09:55:15 -06:00
Siana Gearz
3b8fbbc827 Clean up shaders on package and no longer final-package by default on Linux 2013-11-18 07:45:25 +01:00
Siana Gearz
a5103a1fc1 Sprinkle some Intel GPU support on Linux 2013-11-18 04:22:21 +01:00
Siana Gearz
749d0eec28 Merge https://github.com/abaph/SingularityViewer
Brings in support for MESA accelerators.
2013-11-17 16:38:06 +01:00
Latif Khalifa
0af470b2a9 Merge branch 'master' of git://github.com/LightDrake/SingularityViewer 2013-11-17 12:45:32 +01:00
Latif Khalifa
97c505f941 Reset 'MotionResetsCamera' on camera reset 2013-11-17 12:45:14 +01:00
Latif Khalifa
c6ec2a531f Alow alt-camming and terrian parcel selection from farther away.
Thanks to Liru for finding the sport
2013-11-17 12:28:06 +01:00
Drake Arconis
3e2f1a8fd9 Changed singularity prebuilt cache dir to sg.install.cache 2013-11-16 14:28:25 -05:00
Drake Arconis
7fa5abd4d1 Added NVAPI support on windows 2013-11-16 14:01:09 -05:00
Drake Arconis
924908f2ad Imported new revoke anim perms code and refactored related bits 2013-11-15 19:51:21 -05:00
Aleric Inglewood
bddb1ba48c Merge remote-tracking branch 'singu/master' 2013-11-15 18:00:49 +01:00
Aleric Inglewood
a8cded0cf6 Allow calling LLNotificationsUtil::add from any thread.
This makes LLStringUtil thread-safe by removing a rather unnecessary
LLFastTimer from LLStringUtil::format.

Same thing for LLTrans::getString and LLTrans::findString, where
even a comment stated that the author wasn't interested in measuring
cpu time at all. In this case I added some code back to make sure
that we're not calling LLTrans::getString() in an inner loop, which
was the reason that the LLFastTimer was added.

Made one string static to avoid 45000 look ups during login, which
kinda triggered the above test.

Finally, LLNotificationsUtil::add is made thread-safe by making
LLNotificationChannelBase::mItems thread-safe and defering a call
to LLNotifications::updateItem to the main thread when called
from another thread (using a little statemachine).
2013-11-15 17:52:52 +01:00
Latif Khalifa
14c43aa9a2 Fixed camera pan 2013-11-14 20:36:07 +01:00
Latif Khalifa
f273d3ff59 Singularity 1.8.4 2013-11-14 12:51:41 +01:00
Latif Khalifa
1bd78c5398 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-14 02:51:36 +01:00
Shyotl
fc4f0eaa82 Particle glow tweak excluded more faces from glow than intended. 2013-11-13 19:39:14 -06:00
Salvatore La Bua
8ad3b87c0e Fix a render issue with Hightlight Transparent
The smoke texture is currently not applied to transparent objects.
This commit tweaks the red alpha overlay as a workaround for that.
2013-11-13 21:16:58 +01:00
Latif Khalifa
133dffb326 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-13 20:12:25 +01:00
Shyotl
01e27eac76 Kill a tiny bit of dead code. 2013-11-13 13:06:47 -06:00
Shyotl
d4a3cb168c Altered the deferred alpha fragment shader to handle alphamasking when drawing avatar hair/skirts. (Special handling for these two seems weird, considering all other mesh parts are also alphamasked.. It also prevents skirts from casting shadows. Future alteration may be desired.) 2013-11-13 12:59:21 -06:00
Shyotl
f03376cd2a Remove hack for nvidia on osx. 2013-11-13 12:53:43 -06:00
Inusaito Sayori
6bd9649277 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-11-13 13:03:27 -05:00
Damian Zhaoying
6e05e49a45 update spanish translations in strings.xml and floater_model_preview.xml files 2013-11-13 12:56:38 -03:00
Latif Khalifa
fcf061d06b Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-13 13:01:21 +01:00
Latif Khalifa
a3b232f389 Merge remote-tracking branch 'lightdrake/master' 2013-11-13 12:51:31 +01:00
Shyotl
3416b837dc Added setting 'SHAlwaysSoftenShadows' to soften shadows when ssao isn't enabled. Removed a couple dead settings. 2013-11-13 02:31:55 -06:00
Shyotl
ba84bf1461 Avoid needless second pass on non-glow particles. 2013-11-13 02:27:01 -06:00
Shyotl
3ed249cba5 Retain cubemap reflection on shiny faces while in shadowed, but don't bloom the sun reflection. 2013-11-13 01:35:31 -06:00
Shyotl
584e5176a4 Err closer to LL regarding shadows, however also fixed alpha face shadows to look like all other shadows. 2013-11-13 01:30:45 -06:00
Drake Arconis
e5fcd54c92 Add option to disable scroll offset changing modifier 2013-11-12 23:47:28 -05:00
Damian Zhaoying
899a21ca24 Merge remote-tracking branch 'Liru/master' 2013-11-12 16:09:05 -03:00
Inusaito Sayori
29a07f4b5c Actually fix the french translations (codepage borks yay) Thanks Nomade 2013-11-12 03:03:20 -05:00
Inusaito Sayori
2e7d80e9ba Let shift-left-clicking in the middle of subpiemenus move back to the parent piemenu! 2013-11-12 02:02:16 -05:00
Inusaito Sayori
d678735cf6 Code cleanup in pie menu
Cleaned up hover logic and slice from x and y code duplication
(Best viewed without space changes)
2013-11-12 02:00:21 -05:00
Latif Khalifa
6b5875c008 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-12 02:00:53 +01:00
Shyotl
203ae9dfa3 Fix uninitialized variable warning in alphaF.glsl. Also made USE_VERTEX_COLOR actually work if FOR_IMPOSTOR is set. 2013-11-11 18:56:16 -06:00
Latif Khalifa
00b57dd40e Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-12 01:01:10 +01:00
Latif Khalifa
f10402cbdb Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-11-12 01:01:01 +01:00
Shyotl
32ecf444bd Attempt to resolve shader compilation errors on osx since it's particularly picky. 2013-11-11 17:48:54 -06:00
Latif Khalifa
3430a31e9d Fixed fetching inventory when UseHTTPInventory is disabled 2013-11-11 11:50:07 +01:00
Inusaito Sayori
943f77eed0 Fix the UI Warnings in LLFloaterModelPreview
Adds the green check and red x icons
Adds Price Breakdown text to the mesh upload floater, quite useful!

Removes useless ui element references in only code
Comments out ui element references in only code that we don't have and don't have a clear place
2013-11-10 19:12:20 -05:00
Damian Zhaoying
801723813a update spanish traslation to reflect new materials feature options 2013-11-10 17:39:51 -03:00
Inusaito Sayori
69f2203d11 The rest of the french updates from Nomade Zhao 2013-11-10 13:05:58 -05:00
Latif Khalifa
7879509727 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-10 11:14:08 +01:00
Latif Khalifa
c6a7ae51e6 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-11-10 11:13:55 +01:00
Inusaito Sayori
91ed289a93 [Warnings] Fix signed/unsigned mismatch in llpartdata.cpp 2013-11-10 02:51:30 -05:00
Inusaito Sayori
be7c33e3c7 [LLScrollColumnHeader] Fix the ImageOverlay icons being overwritten every draw and thus destroying our image_overlay parameter!
Seriously, whose idea was that?
Ignore space changes and this will be a lot easier for all of us.
2013-11-10 02:49:10 -05:00
Inusaito Sayori
a510af9480 [LLScrollColumnHeader] Fix icons disappearing in certain states, such as click. 2013-11-10 02:46:23 -05:00
Shyotl
297cd58295 Revert upstream change to particle index accounting. (Fixes flicker issues) 2013-11-09 22:23:48 -06:00
Aleric Inglewood
5f9c6f1b08 AIAlert fixup. 2013-11-09 15:43:58 +01:00
Shyotl
0d1c98b5f7 Fix shadow dithering. It's still pretty ugly tho, but looks okay if ssao is enabled. May add random kern in the future. 2013-11-08 02:03:21 -06:00
Aleric Inglewood
a7e72ceb32 AIFile bug fixes.
Compare with errno instead of rc.
Make sure errno is preserved.
2013-11-07 18:20:49 +01:00
Latif Khalifa
c629d2625c Fixed Mac build 2013-11-07 04:35:39 +01:00
Latif Khalifa
27322c07db Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-11-07 02:01:35 +01:00
Aleric Inglewood
caa82cf5e4 Workaround for window min/max macros 2013-11-07 02:00:24 +01:00
Aleric Inglewood
ee1ca0ed99 Compile fixes for windows(?) 2013-11-07 01:44:57 +01:00
Latif Khalifa
a7a2b0c227 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-11-07 01:07:21 +01:00
Latif Khalifa
1ab5c6a32a Merge branch 'master' of git://github.com/LightDrake/SingularityViewer 2013-11-07 01:07:14 +01:00
Latif Khalifa
2234e95d5c Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-11-07 01:06:53 +01:00
Inusaito Sayori
511b0cfb9c ContextMenu Support!
LLContextMenu functionality pulled out of LLPieMenu, PieMenu is now derived from LLContextMenu
- The more attribute boolean of pie_menu element determines whether or not to have an actual submenu if it's not a pie, defaults to false which means actual submenu..
-- in the future we may want to have more more="true" depending on feedback
- Pie menu labels now dynamically get " >" appended to them (avoids stupid looking context menus)
- Positioning logic combined in part, mostly conditional still, in the future we could probably combine it more.
- handleHoverOver function combines common functionality between context and pies given an item and hover mouse coords.

LiruUseContextMenus debug setting determines which to use, default is pie, of course
- Context(/Pie) Menus are rebuilt when the setting changes value
-- this is safe at any point because all startup states have been accounted for
- "Use context menus instead of pie menus" added to System->General preferences (it's close to the bottom)
2013-11-06 18:47:02 -05:00
Inusaito Sayori
f41c4dd273 Don't open disabled submenus! 2013-11-06 17:44:11 -05:00
Inusaito Sayori
cb0cc571ee Mats UI.
Includes Chalice Yao's pause agent on attachment selection in LLSelectMgr::updateSelectionCenter()
Includes some of Cinder Roxley's enhancements to the build floater for materials (flip buttons, sync materials, consistent control hiding)
Includes Ansariel Hiller's fix for FIRE-8298 [BUG-869] [MAINT-1961], since this updates lltexturectrl.* to have related behaviors.
Switches from using MIN_MANHATTAN_DIST for threshold in LLToolDragAndDrop to using the existing DragAndDropDistanceThreshold debug, like upstream.

Translators:
panel_tools_texture.xml should now be translated, floater_tools.xml should have the old panel removed.
strings.xml now has "use_texture" string.
notifications.xml Now has "LivePreviewUnavailable" alert. (don't forget to translate the ignoretext)
2013-11-06 17:39:04 -05:00
Inusaito Sayori
06186e6c7e [VarRegions] Pseudosupport for region_size_y. 2013-11-06 15:53:15 -05:00
Inusaito Sayori
659874dce0 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-06 01:10:47 -05:00
Shyotl
322ceceb60 Added shaders needed to display texture 'edit' overlay using the specular/normalmap texcoords. 2013-11-05 23:51:09 -06:00
Aleric Inglewood
254396596c Merge remote-tracking branch 'singu/master' 2013-11-05 22:40:08 +01:00
Aleric Inglewood
c516a71804 Move AIAlert* into namespace AIAlert and rename classes.
Instead of having several AI* classes, it turned out to be easier to
have a namespace: this allows me to define the classes in llcommon but
add (new) 'add' and 'add_modal' functions to 'AIAlert' in llui.
This is needed to avoid a collision with the 'add' functions in
LLNotificationsUtil.

The new add/add_modal makes it a lot easier to just show a caught
alert, prepending or appending new text: it turns out that that is
way more common then a re-throw.

Adjusted code as appropriate.
2013-11-05 22:30:02 +01:00
Aleric Inglewood
8ab9039ff6 Use " and ' instead of &quot; and &apos; for new msgs in strings.xml.
Since it works... this might actually be better readable and therefore
easier to work with for the translators.
2013-11-05 18:10:05 +01:00
Aleric Inglewood
b5b51bd73b Typo fix in example code. 2013-11-05 15:11:18 +01:00
Latif Khalifa
d8db37f3fb Simplify tag decoding,
Disable showing other's tags by default as it appears broken in most viewers
2013-11-05 07:25:11 +01:00
Inusaito Sayori
5a2ec28ddf Refactor panel_tools_texture.xml file in preparation to merge (nothing changed yet)
Pulled out defaulted/dead attributes, switched to v3 markup stylings.  Merged in some norspec comments.
2013-11-04 23:00:15 -05:00
Inusaito Sayori
31e2fdc16e Allow v3 xui alternative naming of combo_item as combo_box.item 2013-11-04 22:56:36 -05:00
Inusaito Sayori
f935453859 Allow v3 xui style strings for anything panel derived. <panel.string/> 2013-11-04 22:54:44 -05:00
Aleric Inglewood
1a9cf9b013 Bug fix for 54b43f1ad7
Initialize mLastSimAccess.
2013-11-05 03:55:40 +01:00
Aleric Inglewood
2453c13e11 Add AIXMLLindenGenepool - redo of archetype export/import using AIXML*.
In order to remove code duplication, and as prove of concept,
I redid the linden_genepool archetype export and import (from the Edit
Appearance Floater), using AIXML and AIAlert.

The import/export code did shrink significantly, and became a lot
simpler. Although a new file pair (aixmllindengenepool.{cpp,h}) is
added to define the (de)serialization of the linden_genepool XML format,
that code is now centralized in one place, and still a lot simpler.

As a bonus however, every possible error is now semi-automatically
reported to the user with all details that might help to overcome
the problem, like file names and system errors.
2013-11-05 03:01:49 +01:00
Aleric Inglewood
d174b7fcf8 Add AIXMLRootElement, AIXMLElement, AIXMLParser and AIXMLElementParser
The AIXML* classes provide an Object Oriented way to serialize objects
to and from an XML file. Documentation is added at the top of aixml.cpp

These classes will be used by AIMultiGrid.
2013-11-05 03:01:48 +01:00
Aleric Inglewood
d549e549d8 Fix xml parser.
This fixes quoted strings, like <tag>"Hello \"World\""</tag>,
which otherwise might not be processed correctly because
the XML_CharacterDataHandler isn't guaranteed to be called
exactly once per element. It certainly isn't when a string
contains entities, ie: <tag>"&apos;Hello \"World\"&apos;"</tag>
certainly fails to be unescaped with the old code.
Moreover, the old unescape code things that a singly quote
is actually a quoted string (not noting that begin and end
quote are the same) and destructs all &quot; entities; also
fixed with this commit.
2013-11-05 03:01:47 +01:00
Aleric Inglewood
78673e4a94 Add AIFile - LLFile but throws AIAlertCode exceptions on error.
The code is the current errno.
2013-11-05 03:01:47 +01:00
Aleric Inglewood
193010e947 Add THROW_[MF]ALERT[EC] (AIArgs, AIAlert, AIAlertCode, AIAlertPrefix, AIAlertLine)
A system to throw errors that allow for easy error reporting to the user
by showing a translated pop-up alert box with the error message.

The messages use strings.xml for translation and allow the usual
replacement args (ie [FILE] is replaced with a filename).

The exceptions can be cascaded, by adding more (translated) text
when caught and then re-throwing the result.

Macros are being used to support adding a function name prefix
to a message of the current function that the exception is thrown
from.

The syntax is:

  <macro>(<line>);		to show 'line'
  <macro>(<alert>, <line>);	to append 'line' to a caught alert.
  <macro>(<line>, <alert>);	to prepend 'line' to a caught alert.

  where <macro> is one of:
  THROW_ALERT, THROW_MALERT, THROW_FALERT, THROW_FMALERT,
  THROW_ALERTE, THROW_MALERTE, THROW_FALERTE, THROW_FMALERTE, where
  M = modal, F = Function name.
  and where <line> is one of:

  <xmldesc>
  <xmldesc>, AIArgs<args>

  where <xmldesc> is a string literal that will be looked up
  in strings.xml, and <args> is:

  (<key>, <replacement>)[<args>]

  There are more variations of the macros to throw an arbitrary
  class (append _CLASS), include an int code (append C) or
  to store the current errno as code (append E).

  For example, THROW_MALERTC(code, ...), or THROW_FALERT_CLASS(Foobar, ...),
  where the ... is the same as for the macros above.

Documentation and example usage has been added to aialert.h.
2013-11-05 03:01:47 +01:00
Aleric Inglewood
b7d2683b76 Removed LLXMLNode::writeHeaderToFile
Isn't used. This header is written else where already,
and will be written from now on (also) by AIXML*, which
will be committed next.
2013-11-05 03:01:46 +01:00
Aleric Inglewood
2f53f7232b Minor LLMD5 extension and cleanup.
* Add LLMD5::clone(unsigned char const*), the inverse of LLMD5::raw_digest.
* Add LLMD5::clone(std::string const&), the inverse of LLMD5::hex_digest.
* Add LLMD5::isFinalized(), returns true if the object is finalized.
* Turn all binary operators into inline friends in the class.
* Fix operator<< to take a LLMD5 const& instead of a LLMD5&.

These changes are needed for / used by AIMultiGrid.
2013-11-05 03:01:46 +01:00
Aleric Inglewood
b424d0232b Make #includes in llcommon header files more complete.
These includes are needed. The current code includes them
in .cpp files *before* including these include files, but
that is not very clean, and not useful.

Actually including what a header file needs makes it more
clear what it drags in, it doesn't drag in more then before.
It also allows to include these headers without having to
includes needed for the included header file in a specific
order, in every .cpp file.
2013-11-05 03:01:46 +01:00
Aleric Inglewood
54b43f1ad7 Cache the lookup of the sim access level.
Being part of the state line, it is called every frame, causing a
translation lookup every frame.
2013-11-05 03:01:46 +01:00
Latif Khalifa
7ffb751ead In preparation to release, change defalt for crash reporting to 'Ask' 2013-11-05 02:35:08 +01:00
Inusaito Sayori
7129d97ee5 panel_tools_texture.xml splits off from floater_tools.xml (No real changes here, but this change will make life so nice for me) 2013-11-04 17:49:29 -05:00
Inusaito Sayori
ec55c53b62 French menu gets Motion Resets Camera courtesy of Nomade (more translation on the way) 2013-11-04 17:10:42 -05:00
Drake Arconis
e1356b7aaf Fix slight breakage in the osx cmake 2013-11-03 23:00:56 -05:00
Latif Khalifa
0cbaa752a6 At the request of LL, append more info to channel string sent to the login server
Send versio number bare, without channel name, as V3 does
2013-11-04 04:04:39 +01:00
Inusaito Sayori
2f80012ccd Feature Request: If EditLinkedParts is on, Copy Key should copy keys of any selected prim(s) 2013-11-03 20:51:48 -05:00
Drake Arconis
1553a90ebb Merged master 2013-11-03 20:15:41 -05:00
Latif Khalifa
7fe411cd85 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-11-03 21:48:21 +01:00
Inusaito Sayori
083aaffec7 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-11-03 15:28:01 -05:00
Andros Baphomet
997fdebb9f Re-fix shader compilation errors 2013-11-03 13:12:27 -05:00
Andros Baphomet
fe0a761ce6 Merge remote-tracking branch 'upstream/master'
Conflicts:
	indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
	indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
	indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
	indra/newview/app_settings/shaders/class1/deferred/giF.glsl
	indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
	indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
	indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
	indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
	indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
	indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
	indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
	indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
2013-11-03 12:17:50 -05:00
Latif Khalifa
232b1cf28c Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-03 04:56:31 +01:00
Shyotl
6bbb24b974 Revert occlusion changes to try and pinpoint flicker issue. 2013-11-02 22:43:11 -05:00
Shyotl
827bbc9b89 Fix up a few glowies. 2013-11-02 19:15:28 -05:00
Latif Khalifa
822b728adb Only build Quicktime on 32 bit Windows
Helps address issue 1180
2013-11-03 00:32:01 +01:00
Latif Khalifa
8ed527af24 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-02 12:46:16 +01:00
Shyotl
77eb928380 Add LLGLManager::mIsMobileGF 2013-11-02 03:33:21 -05:00
Shyotl
378dd14ade Return to our nice ssao. 2013-11-02 03:29:32 -05:00
Shyotl
e5d71560e8 Fix fullbright stuff in deferred. Have to re-assess old glow occlusion bugfixes. 2013-11-02 02:38:23 -05:00
Latif Khalifa
824f23082b Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-11-02 07:25:36 +01:00
Shyotl
af8f8bb040 Mats. 2013-11-02 01:20:05 -05:00
Inusaito Sayori
23e9eabedb These new icons need tooltips 2013-11-01 17:57:52 -04:00
Latif Khalifa
b9c487a0c7 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer 2013-11-01 22:50:22 +01:00
Inusaito Sayori
96e8f37c81 The rest of some touchups to wlf xml for nicer alignment of elements 2013-11-01 17:43:32 -04:00
Inusaito Sayori
0fc9d540bf Feature Request: Add Camera preset switching functionality (part of quicksettings)
Hitting Escape will reset to the normal Back preset
Adds new Cam_Preset_*_(On|Off).png textures, these should probably be reskinned, any volunteers?
2013-11-01 17:35:12 -04:00
Latif Khalifa
1f587d1ad1 Don't crash when trying to export linked parts
Fixes issue #1176
2013-11-01 22:34:55 +01:00
Inusaito Sayori
2d421a27e1 Let Ctrl/Shift + scrollwheel changing the camera/focus offsets affect the current preset's setting, not the back preset. 2013-11-01 16:56:55 -04:00
Inusaito Sayori
3934e0c9d3 Fix Issue 1163: Mouselook zoom (silly control group confusion) 2013-11-01 11:18:12 -04:00
Inusaito Sayori
ba1a29aae2 French Translation updates! Provided by Nomade Zhao 2013-11-01 02:56:21 -04:00
Aleric Inglewood
66a43ea537 Make global strerr() functions in llfile.cpp static member functions of LLFile.
This is the cleanest way to make them available to the rest of the
viewer as exported functions.

This change is needed for / use by AIMultiGrid.
2013-11-01 00:47:47 +01:00
Latif Khalifa
3d47d6f0dc Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-10-31 16:39:08 +01:00
Latif Khalifa
5583445c4d Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-31 16:38:40 +01:00
Aleric Inglewood
198840f839 Merge remote-tracking branch 'singu/master' 2013-10-31 05:45:25 +01:00
Latif Khalifa
78843493cc Syntax error fix 2013-10-31 03:31:12 +01:00
Aleric Inglewood
4aa3863f17 Merge remote-tracking branch 'singu/master' 2013-10-31 02:54:00 +01:00
Latif Khalifa
fcfffbb322 breakpad filter signature is different on windows compated to other platforms 2013-10-31 02:51:58 +01:00
Aleric Inglewood
e4b35a050d This makes more sense 2013-10-31 02:38:23 +01:00
Aleric Inglewood
8506a16dcb Merge remote-tracking branch 'singu/master' 2013-10-31 02:19:37 +01:00
Latif Khalifa
8dab5df746 Revert "Prevent LLFace::getGeometryVolume from overwriting vbos past their end."
This reverts commit 02067f973e.
2013-10-31 02:10:57 +01:00
Aleric Inglewood
811191cc7c Merge remote-tracking branch 'singu/master' 2013-10-30 21:57:39 +01:00
Aleric Inglewood
a9972bbf02 Suppress spammy warning (debug mode) 2013-10-30 20:32:22 +01:00
Latif Khalifa
51d5984afa Allocate half a megabyte that is freed just before minidump is written in the breakpad exception handler (Siana) 2013-10-30 19:10:17 +01:00
Latif Khalifa
f1eab3f2c5 Added architecture fields to the crash report 2013-10-30 19:09:05 +01:00
Latif Khalifa
139aad333a Looks like the older version of freetype has more sever issues.
Revert "Downgraded freetype to 2.3.9 to avoid font issues in the newer version"

This reverts commit 3284b77df2.
2013-10-30 18:43:17 +01:00
Andros Baphomet
c009866d86 Merge remote-tracking branch 'upstream/master' 2013-10-30 09:42:58 -04:00
Inusaito Sayori
73cb43e71f [Warnings] Fix ..\..\libhacd\hacdRaycastMesh.cpp(109): warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
All the other involved types are of size_t, so static_cast 1 should work here.
2013-10-30 08:40:47 -04:00
Inusaito Sayori
b34a8db34a Modernize constructor of LLPreviewSound and cure crash signature 314 2013-10-30 08:37:20 -04:00
Damian Zhaoying
9be72ffb47 add spanish translation for prefs editor open log in windows option 2013-10-30 05:01:12 -03:00
Latif Khalifa
e6f70a0864 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-10-30 05:24:53 +01:00
Latif Khalifa
0933b8c43d Merge branch 'master' of https://github.com/MelanieT/SingularityViewer 2013-10-30 05:24:31 +01:00
Melanie
dfc965954e Remove attachments from the avatar's attached list before destroying them.
This should prevent the idle callbacks from accessing deleted attachments when looking for the CCS signature.
2013-10-29 22:26:58 +01:00
Latif Khalifa
02067f973e Prevent LLFace::getGeometryVolume from overwriting vbos past their end.
Possible fix for a crash in LLFace::getGeometryVolume()
Patch by NickyD/Firestorm
Crash signature: 14 and 20
2013-10-29 16:29:59 +01:00
Inusaito Sayori
ec4679c2a8 Fix the bug in which right click and then delete key would no longer work to delete objects
Navigation handling without a currently selected menu entry now only happens if key is up or down arrow
(mind the space changes)
2013-10-29 06:25:22 -04:00
Latif Khalifa
bdcc4189be Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-28 22:22:29 +01:00
Latif Khalifa
6b2628db44 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-10-28 22:22:22 +01:00
Latif Khalifa
664d5ab7fc Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-28 22:22:14 +01:00
Latif Khalifa
3284b77df2 Downgraded freetype to 2.3.9 to avoid font issues in the newer version 2013-10-28 22:21:07 +01:00
Latif Khalifa
2c1512dcbe Try finding FMOD Ex from registry intall path instead of hard coded location 2013-10-28 20:38:51 +01:00
Latif Khalifa
d8728f17ee Don't install 64 bit viewer on 32 bit OS 2013-10-28 20:23:35 +01:00
Latif Khalifa
603221fa48 Rebuilt glod using VC11 runtime 2013-10-28 19:26:17 +01:00
Inusaito Sayori
8670f45287 Fix mouselook crosshair drawing properly 2013-10-28 12:22:58 -04:00
Aleric Inglewood
aa5bc7bc25 Compile fix (libcwd) 2013-10-27 15:14:11 +01:00
Shyotl
5e8c7264da Fix artifacts from local stash merge. 2013-10-26 19:58:54 -05:00
Shyotl
6474568125 Call updateLOD when geom enters rigged state. 2013-10-26 19:09:43 -05:00
Shyotl
c1feb11d98 SH-3860. Cloud on first load issue. I'm sure the inaccessible jira has more details... 2013-10-26 18:56:39 -05:00
Shyotl
edf75a7174 setCommitOnReturn moved to from llbutton to lluictrl, cleanup some focus/key handling, avoid needless reshape calls. 2013-10-26 18:12:56 -05:00
Shyotl
30c5b9514e Let the rendertarget dictate internal format when resizing. 2013-10-26 18:09:34 -05:00
Shyotl
8e55d5499e Occlusion FBOs in deferred. 2013-10-26 18:07:56 -05:00
Shyotl
574022ed2c Made a few more fullbright face types occlude any glow behind them. 2013-10-26 18:01:36 -05:00
Shyotl
fc04f6b2e1 Added handling of GL_LUMINANCE pixel format to setManualImage. Was missing, although GL_LUMINANCE_ALPHA and GL_ALPHA were handled.
Also added missing file hurr.
2013-10-26 16:42:41 -05:00
Shyotl
7c7c64bde3 Minor upstream catchup. Added LLImageRaw::duplicate and no_copy parameter to LLImageRaw::LLImageRaw 2013-10-26 16:39:31 -05:00
Shyotl
2a432f73da Try and squelch some warnings regarding nightvision post shader on amd gpus. 2013-10-26 16:36:38 -05:00
Shyotl
f4863527aa Migrate ui scale/translation transform matrix stacks to LLAlignedArray. 2013-10-26 16:29:38 -05:00
Shyotl
8441bc80a4 Use LLStaticHashedString for faster uniform lookup. 2013-10-26 16:26:46 -05:00
Latif Khalifa
3979ad46f6 Separate out the cache directory for windows 64 2013-10-24 10:24:18 +02:00
Latif Khalifa
f4f4a39c01 Revert accidental removal of tcmalloc for 32 bit 2013-10-24 09:53:51 +02:00
Inusaito Sayori
fcce986266 Fix crash signature 256 2013-10-24 02:38:47 -04:00
Latif Khalifa
bcfe5232fb Merge branch 'windows64' of github.com:lkalif/SingularityViewer 2013-10-24 01:37:45 +02:00
Latif Khalifa
6708019a40 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-24 01:37:27 +02:00
Latif Khalifa
8565616c9d Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-24 01:37:19 +02:00
Latif Khalifa
938736b77f Win64: moved prebuilts to their permanent location 2013-10-24 01:25:45 +02:00
Shyotl
8e94c43a54 Fix a tp crash, and rework sound preloading slightly. 2013-10-23 17:23:20 -05:00
Inusaito Sayori
2b7e78cb3b That commit where I touch all the ascentprefs headers to make them conform to standard because it's been annoying me too long. 2013-10-23 17:47:33 -04:00
Inusaito Sayori
41303d0c9c Added "Log button opens external text editor (Windows only)" to Adv. Chat UI 2013-10-23 17:44:27 -04:00
Inusaito Sayori
4821d02051 Sometimes UI get this syncing feeling... but then everything seems fine. 2013-10-22 23:59:50 -04:00
Inusaito Sayori
fd42029a61 LLViewerWindow::handleKey(): Partial Fix for Issue 704: Keyboard shortcuts that should be passed to focused text fields are instead passed to selected prims when building
All edit keys now work, but Ctrl-A still doesn't work right, it must be grabbed by something else...
Adds LLFocusMgr::keyboardFocusHasAccelerators()
Adds virtual bool LLView::hasAccelerators() which returns false by default, overrides returning true placed in LLPreviewScript and LLPreviewNotecard
Shortcut keys added to notecard and script menu xmls

I'm thinking Qarl's Align tool handling may be receiving the Ctrl-A, we do seem to handle it differently than Exodus and Firestorm something modern could have broken the old way..
Come to think of it, those two features(Align and Select all prims) have a longstanding shortcut conflict in shortcuts... that's pretty nasty
2013-10-22 23:35:53 -04:00
Inusaito Sayori
574d0dab8d LLViewerWindow::handleKey(): Also handle keys for navigating through the displayed menu 2013-10-22 22:39:15 -04:00
Inusaito Sayori
1aee941cb6 LLViewerWindow::handleKey(): The work in progress bits of the sync, commented out 2013-10-22 09:19:38 -04:00
Inusaito Sayori
75ee99f4d5 LLViewerWindow::handleKey(): More harmlessness (sync)
Handle Tabbing through elements/floaters earlier.
Combine g*Menu*View handleKey() checks.
2013-10-22 09:08:41 -04:00
Inusaito Sayori
45cd0157ef LLViewerWindow::handleKey(): Code cleanup, bit of harmless sync
Moved Notifications Console into the advanced menu for login, so it's not shoved in as a hack, also a bit easier to access
2013-10-22 08:16:12 -04:00
Latif Khalifa
b800e877f9 More manifest gymnastics 2013-10-22 14:01:46 +02:00
Inusaito Sayori
9ec10cf246 Reworked LLToolCompGun so piemenu in mouselook plays nicer with zoom feature
Switches to exodus implementation
Includes relicensing of LLViewerCamera and LLToolComp
Maintains use of the old saved zoomed setting
2013-10-22 07:47:43 -04:00
Latif Khalifa
f545952136 Copy vc++ runtime libs, ignore size_t related warnings in the release build on win64 2013-10-22 11:25:32 +02:00
Latif Khalifa
f7cea9ac74 Added a way to identify 64 bit viewer in help -> about 2013-10-22 01:08:39 +02:00
Latif Khalifa
22db8f56f1 WIP[win64]: installer 2013-10-22 00:59:26 +02:00
Latif Khalifa
5cd7f05851 VS2012 related changes 2013-10-22 00:58:05 +02:00
Inusaito Sayori
dde18dfc0f Added a setting, LiruMouselookMenu, in case people don't want this feature. 2013-10-21 16:01:31 -04:00
Inusaito Sayori
d95e1800e1 Miscellaneous touchups
Fixes chatbar not handling ctrl+shift+arrow for word selection
lltoolmgr.cpp sync
Removes some pointless dead code from llviewertexteditor.cpp
2013-10-21 15:15:17 -04:00
Latif Khalifa
73e1a9ad78 WIP[win64]: we haz 64 bit webkit 2013-10-21 20:42:31 +02:00
Latif Khalifa
ea6adb7ae4 WIP[win64]: Sync this snipped with upstream to avoid texture indexing issues on Windows 64 2013-10-21 15:56:13 +02:00
Latif Khalifa
93e62a375c WIP[win64]: Rebuilt jpeglib, libpng, fixed loading of fmodex 2013-10-20 20:17:03 +02:00
Latif Khalifa
52c8c68d12 Reduce unbearable notification span when a plugin fails to load 2013-10-20 20:16:21 +02:00
Latif Khalifa
f9531904f5 WIP[win64]: Rebuilt jpeglib 2013-10-20 18:07:23 +02:00
Latif Khalifa
17c59f25f5 WIP[win64]: it builds, runs. webkit disabled in cmake for now 2013-10-20 17:03:48 +02:00
Latif Khalifa
6bae4a8d92 WIP: native win64 support 2013-10-20 12:37:35 +02:00
Inusaito Sayori
a33efc61a2 Feature request by StephiDreamEvermore Doune: Implement the convenience of being able to set view offsets while modifier keys are held during scroll in third person camera (Play with camera position/angle) 2013-10-19 20:54:02 -04:00
Inusaito Sayori
bd4e988397 Fix crash signature 222 2013-10-19 20:38:50 -04:00
Latif Khalifa
32bed5660a WIP win64 support 2013-10-19 23:05:53 +02:00
Latif Khalifa
d03a012a41 Added support for Visual Studio 2012 to develop.py and VSTool 2013-10-19 21:10:24 +02:00
Andros Baphomet
c264607207 Merge remote-tracking branch 'upstream/master' 2013-10-19 10:03:17 -04:00
Latif Khalifa
290b3d7106 Added Windows 64 support to repackage.sh 2013-10-19 15:29:08 +02:00
Inusaito Sayori
65d2775e2a Address jonhboy's Request: Round land impact instead of chopping off the decimal 2013-10-18 08:58:13 -04:00
Inusaito Sayori
ef3f78175c Satisfy Issue 699: Let Alt-right clicking in mouselook bring up pie menu
Also lltoolpie.cpp cleanup
2013-10-18 08:28:39 -04:00
Inusaito Sayori
7813ca03da LLFloaterInspect: bit of cleanup and allow sorting by creation date regardless of format 2013-10-18 08:21:57 -04:00
Inusaito Sayori
ec5aaa2af8 Modernize LLSelectMgr and fix leaks 2013-10-18 08:20:19 -04:00
Latif Khalifa
4feb1985b0 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-18 09:28:19 +02:00
Shyotl
addd687bf8 What is this? Where am I? Oh god. (Fix mistake in openal audioimpl) 2013-10-18 02:27:09 -05:00
Latif Khalifa
153f783922 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-18 08:51:51 +02:00
Shyotl
e2954fdbfd Fixed a bug where multisampled renderbuffers were being attached to non-FBO-enabled LLRenderTargets. 2013-10-18 01:43:32 -05:00
Shyotl
6fd73ee8bb Use GL_RED instead of GL_LUMINANCE for post-process noise texture. 2013-10-17 22:07:58 -05:00
Shyotl
19d7186508 Merge branch 'master' of git://github.com/siana/SingularityViewer.git 2013-10-17 21:08:30 -05:00
Latif Khalifa
c67f848b5c Merge branch 'master' of https://github.com/siana/SingularityViewer 2013-10-17 05:25:14 +02:00
Latif Khalifa
683bd9375f Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-17 05:25:02 +02:00
Shyotl
d18fa5ba42 Modified LLRenderTarget to handle sCurFBO and mPreviousFBO as pointers instead of arbiturary indexes. 2013-10-16 21:35:04 -05:00
Shyotl
03c4535648 Made further refinements to the audioengine:
-Looping syncslaves are stopped when there is no syncmaster.
-Hardened against edge cases regarding soundsource priority sorting.
-Fixed issue with syncmasters being marked as having looped when instead they just started playing (caused double-start of syncslaves).
-Updated some comments.
2013-10-16 21:32:08 -05:00
Aleric Inglewood
811f670199 AIStateMachine fixes.
Things (one debug code only) that don't happen currently,
but that I ran into with AIMultiGrid.
2013-10-16 00:30:28 +02:00
Inusaito Sayori
9dd995a287 Old dead code poofpoof 2013-10-15 17:21:54 -04:00
Aleric Inglewood
e40d622b8c Merge remote-tracking branch 'singu/master' 2013-10-15 23:07:34 +02:00
Aleric Inglewood
09708b6318 Added AICondition.
AICondition is like AIThreadSafeSimpleDC (it is derived from it),
and wraps some variable, protecting it with a builtin mutex.

While in a statemachine, one can call wait(condition) to make
the state machine go idle, and call condition.signal() to
wake it (or another) up again.

While normally a condition variable is used as follows:

condition.lock();
while (!whatwerewaitingfor)
{
  condition.wait();
}
// Here the condition is guaranteed to be true and we're
// still in the critical area of the mutex.
condition.unlock();

where the thread blocks in wait(), the statemachine actually
returns CPU to the thread (the AIEngine), so there is no
while loop involved, and our wait() doesn't even unlock
the mutex: that happens because the state machine returns:

condition_wat condition_w(condition);		// Lock condition.
if (!condition_w->whatwerewaitingfor())		// The variable(s) involved can only be accessed when condition is locked.
{
  wait(condition);				// Causes the state machine to go idle. This does not block.
  break;					// Leave scope (unlock condition) and return to the mainloop - but as idle state machine.
}
// Here the condition is guaranteed to be true and we're
// still in the critical area of the condition variable.

In this case, when condition.signal() is called, the thread
doesn't return from wait() with a locked mutex - but the
statemachine executes the same state again, and enters from
the top: locking the condition and doing the test again,
just like it would be when this was a while loop.
2013-10-15 22:30:53 +02:00
Aleric Inglewood
9114f04ef6 Add AIStateMachine::yield_if_not
This can be used to switch to a specific engine.
If the state machine is not running in the passed engine,
then it performs a yield to that engine, otherwise it keeps
running. Hence, putting this at the top of a state
guarantees that it runs in that engine.

For example:

    case FrontEnd_done:
    {
      // Unlock must be called by the same thread that locked it.
      if (yield_if_not(&gStateMachineThreadEngine))
      {
        break;
      }
      // Here we are running in gStateMachineThreadEngine.
    ...
2013-10-15 22:30:16 +02:00
Aleric Inglewood
9db6bc0557 Add AIStateMachine::mSMDebug
The patch is exclusively libcwd related.

Turns off output from statemachines to dc::statemachine by default.
Allows to turn on the debug output on a per statemachine basis (at
compile time).
2013-10-15 22:29:52 +02:00
Inusaito Sayori
9ea59b06d5 Fix crash signature 140 2013-10-15 08:58:32 -04:00
Latif Khalifa
897392f7e0 Don't log debug level info during shader loading 2013-10-15 07:23:23 +02:00
Latif Khalifa
7f52f78517 Breaking pad: restore 'Ask' preference for sending reports, cleanup remaining out-of-process bits 2013-10-15 07:20:57 +02:00
Latif Khalifa
bb7793283d Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-15 07:18:58 +02:00
Inusaito Sayori
43f25fed9b [Warnings] Fix linux32 warnings again (missed some spots) 2013-10-14 19:42:08 -04:00
Shyotl
4da896682d Fixed a couple obscure crashes. 2013-10-13 19:37:01 -05:00
Shyotl
6155e64086 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2013-10-13 19:27:03 -05:00
Shyotl
dbfd0cb7a6 Fixed a shutdown crash in LLAudioEngine::assetCallback, and fixed behavior when soundsource re-issues a sound whilst a sound is currently playing for same source. (LLAudioChannel[Impl]::play now re-starts sound if already playing) 2013-10-13 16:22:24 -05:00
Siana Gearz
19625ea6b8 MAINT-2968 disable client GL namegen, go spec 2013-10-13 17:07:45 +02:00
Andros Baphomet
e363aeb618 Merge remote-tracking branch 'upstream/master' 2013-10-12 21:23:07 -04:00
Latif Khalifa
aa077032b7 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-12 22:45:05 +02:00
Aleric Inglewood
1389bf76ce Bug fix. 2013-10-12 22:36:27 +02:00
Latif Khalifa
f096f181f3 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-12 22:09:37 +02:00
Aleric Inglewood
1df09dec35 Remove assert that 100% reproducible fired - stopping me from logging in.
I wanted to fix the problem, but:
[21:45] <Aleric> Talking about dense - you guys want this to be fixed or not???
[21:45] <lkalif> no
2013-10-12 21:48:51 +02:00
Aleric Inglewood
8e0e532ea8 Merge remote-tracking branch 'singu/master' 2013-10-12 21:48:32 +02:00
Shyotl
daa07d031c Fixed a couple of compilation errors when using GCC. 2013-10-12 12:13:58 -05:00
Andros Baphomet
ffb4abebdd Merge remote-tracking branch 'upstream/master' 2013-10-12 12:59:26 -04:00
Latif Khalifa
cb12a35102 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
Conflicts:
	indra/llaudio/llaudioengine.cpp
2013-10-12 10:04:05 +02:00
Latif Khalifa
e8c286308d Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-12 10:01:52 +02:00
Shyotl
7fb05e6a48 Audio engine changes:
-Idle tick is now responsible for dispatching all pending sound sources, as such improves priority sorting.
-Added ui sound precache mechanisms (to fetch sounds without associated soundsources)
-Audio engine no logner available pre-login or upon disconnect, for simplicity.
-General cleanup to the audio engine/impl.
-Fixed some gAudiop calls that were lacking prerequisite null checks.
-Added 'isUpstreamOK' procuedure to LLAssetStorage to allow avoidance of making requests when there is no upstream host connection.
2013-10-12 02:49:11 -05:00
Andros Baphomet
12abca8954 Merge remote-tracking branch 'upstream/master' 2013-10-12 01:50:26 -04:00
Aleric Inglewood
3b2393dbda Merge remote-tracking branch 'singu/master' 2013-10-11 13:42:06 +02:00
Aleric Inglewood
0261eac2a4 Fix for crash report 1272 2013-10-11 13:35:32 +02:00
Latif Khalifa
69f273eb0e Don't crash if pay floater is closed before reply arrives from the server
Fix from upstream
Potentially fixes http://crash.singularityviewer.org/crashes.php?stacktrace=processPayPriceReply
2013-10-11 13:14:59 +02:00
Inusaito Sayori
477daff92f [Warnings] Fix linux32's "format ‘%lu’ expects type ‘long unsigned int’, but argument has type ‘size_t’" 2013-10-11 05:53:57 -04:00
Latif Khalifa
926e76adea Dump the whole login response to the log file only in the debug builds 2013-10-11 10:12:35 +02:00
Inusaito Sayori
9429b875aa Demote common "Splitting" warning to debugs 2013-10-11 04:06:38 -04:00
Inusaito Sayori
f268c26a3a [LLIMMgr/LLIMPanel] Fix the crashes in notifyParticularFriendObservers()
Forgot to write this line amidst everything else, my bad.
2013-10-11 03:25:32 -04:00
Inusaito Sayori
aa86730df2 [LLIMMgr/LLIMPanel] Fix race condition between name lookup and title setting 2013-10-11 00:45:23 -04:00
Inusaito Sayori
80bb529220 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-10-10 22:16:39 -04:00
Damian Zhaoying
7cc99ebf72 update spanish messages in IM floaters 2013-10-10 23:15:33 -03:00
Inusaito Sayori
be5727548b Fix a warning typo and a minor bug I thought I'd fixed long ago indicated by some getString warning spam 2013-10-10 20:25:15 -04:00
Inusaito Sayori
54c08b3ea0 Localize the new Silent Accept/Decline messages 2013-10-10 18:28:06 -04:00
Inusaito Sayori
8964cfd58b [LLIMMgr/LLIMPanel Revision] Compile Fixies
How did these even
2013-10-10 17:01:18 -04:00
Latif Khalifa
cf214e4f9e Silence compiler warnings 2013-10-10 22:07:43 +02:00
Latif Khalifa
2a830c3184 Merge branch 'master' of https://github.com/slabua/SingularityViewer 2013-10-10 21:58:25 +02:00
Latif Khalifa
c313d5fe28 Merge branch 'master' of https://github.com/AdeonWriter/SingularityViewer 2013-10-10 21:58:19 +02:00
Inusaito Sayori
390c097c6a Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-10-10 15:53:32 -04:00
Salvatore La Bua
ebc839d540 Rearrange silent keep/discard inventory offer buttons 2013-10-10 21:49:49 +02:00
Salvatore La Bua
20ee6cdb72 Add silent keep/discard inventory offer buttons
Adapted from Phoenix code
2013-10-10 20:21:46 +02:00
Inusaito Sayori
d503662b58 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-10-10 04:41:08 -04:00
Inusaito Sayori
91f6a4efa3 [OpenSim] Feature Request: Don't clamp max_import_scale to 240 on NonSL grids, and make max_import_scale start off based on the hippolimits' MaxPrimScale, not the SL-constant 2013-10-10 04:36:47 -04:00
Inusaito Sayori
13e25cfe6a Feature Request: Add MiniMapPrimMaxAltitudeDelta and MiniMapPrimMaxAltitudeDeltaOwn to debug settings for users to configure how much altitude difference prims can have to be shown on the minimap 2013-10-10 04:29:12 -04:00
Inusaito Sayori
3fad577f2b Fix spammy Texture WARNS to be DEBUGS as they should, also spellind fix 2013-10-10 04:22:48 -04:00
Inusaito Sayori
2f334b021f [LLIMMgr/LLIMPanel Revision] Two last things
Handle display of popped out IM floaters better
send_start_session_messages(): cut early if ids is empty, fallback on UDP if there is a region but there isn't ChatSessionRequest Cap
2013-10-10 04:21:19 -04:00
Inusaito Sayori
363fa450fb [LLIMMgr/LLIMPanel Revision] More Miscellaneous Code Cleanup 2013-10-10 04:18:08 -04:00
Inusaito Sayori
b049353178 [LLIMMgr/LLIMPanel Revision] Clean up construction of IM Floaters, so much redundant code!!
Removes mProfileButtonEnabled and lookupName()
2013-10-10 04:14:09 -04:00
Inusaito Sayori
0a874b0768 [LLIMMgr/LLIMPanel Revision] Don't let new messages ever change the active communications tab (perhaps fixes StockMaster's issue?) 2013-10-10 04:10:02 -04:00
Inusaito Sayori
a179f95057 [LLIMMgr/LLIMPanel Revision] Clean up ignored groups logic 2013-10-10 04:08:01 -04:00
Inusaito Sayori
402f4f7068 [LLIMMgr/LLIMPanel Revision] Feature Request: Friendship operations from IM
Also adds the toggle mute option, but this was deemed too risky and has been left commented out for future projects to decide for themselves on
2013-10-10 04:03:41 -04:00
Inusaito Sayori
42d9b425e9 [LLIMMgr/LLIMPanel Revision] Dynamic dropdown entries handling functions
Adds addDynamics(), removeDynamics(), rebuildDynamics()
2013-10-10 03:48:17 -04:00
Inusaito Sayori
d15ec04dba [LLIMMgr/LLIMPanel Revision] Missed function declaration for closeIfNotPinned in a past commit, it's here 2013-10-10 03:40:15 -04:00
Inusaito Sayori
0cc5484b60 [LLIMMgr/LLIMPanel Revision] Add convert_roleplay_text() to centralize roleplay chat preprocessing
Unifies CAPSLock /ME handling
Unifies AutoCloseOOC impls so they share full common functionality
Adds AutoCloseOOC functionality to do /me ((autocompleted out of character action))

Also, RP Mode now uses parentheses rather than square brackets, by popular demand
2013-10-10 03:35:54 -04:00
Inusaito Sayori
d04820507c [LLIMMgr/LLIMPanel Revision] LLFloaterIMPanel constructor combination and removal of LLFloaterIMPanel::init()
Also changes Session Label to Log Label because that's really what it is at this point
Also rearranges members in LLFloaterIMPanel, and war on BOOLs
Also removes mSessionInitialTargetIDs because it's no longer needed outside of the constructor
2013-10-10 03:26:51 -04:00
Inusaito Sayori
260723f2a4 [LLIMMgr/LLIMPanel Revision] Fix PinTalkViewOpen=false mechanics
If the user is holding a modifier key with enter, it bypasses the unpinned setting
If a chat is popped out, this setting now only minimizes that chat, not toggles the main communications floater.
LLIMPanel::closeIfNotPinned() now condenses the logic.

Also makes LLIMMgr::toggle() non-static and requiring no args.
2013-10-10 02:49:02 -04:00
Inusaito Sayori
9e312a3808 [LLIMMgr/LLIMPanel Revision] Cleanup of unused/useless classes, functions, members and xmls 2013-10-10 02:27:26 -04:00
Latif Khalifa
5f0b1ab05b Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-10-10 05:17:41 +02:00
Shyotl
3132d2b0d0 Avoid perpetual re-entry for LLOctreeNode::octree_pool_alloc::malloc if LL_USE_TCMALLOC is defined. 2013-10-09 22:16:19 -05:00
Latif Khalifa
c3226b25fe Fixed Windows build 2013-10-10 00:18:47 +02:00
Latif Khalifa
d98402b13f Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
Conflicts:
	indra/newview/llvotree.h
2013-10-10 00:03:36 +02:00
Latif Khalifa
b2979ca3a4 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-10 00:01:56 +02:00
Shyotl
7a913af2c7 Use camera enums instead of magic numbers. 2013-10-09 16:09:09 -05:00
Shyotl
e324ffd9ad In render_disconnected_background don't bind a shader or flush unless a disconnect image is actually being drawn. 2013-10-09 16:05:15 -05:00
Shyotl
e96caa78a1 Removed a little bit of unnecessary code from pipeline.cpp 2013-10-09 15:45:33 -05:00
Shyotl
b6bf5545c9 Change lightfunc from GL_R8 to GL_R16F/R32F 2013-10-09 15:44:15 -05:00
Shyotl
f25eb07fab Unstaged changes cleanup. Further vectorization. Change in binormal/bitangent calculation. 2013-10-09 15:43:23 -05:00
Adeon Writer
9f6b89ff18 Don't shorten avatar skeleton while in mouselook 2013-10-08 18:17:51 -04:00
Damian Zhaoying
24463b7d04 update panel_login.xml and menu_minimap.xml files and fix labels in master language file menu-minimap.xml to make translations works 2013-10-08 17:49:52 -03:00
Aleric Inglewood
909be9e169 Add AITESTPLUGIN
Usage:

nc -l -p 61916
AITESTPLUGIN=1 LL_WRAPPER='gdb --args' ./singularity

Then paste into nc:

<llsd>
    <map>
        <key>class</key>
            <string>internal</string>
        <key>name</key>
            <string>load_plugin</string>
        <key>params</key>
            <map>
                <key>dir</key>
                    <string>/opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/viewer-linux-x86_64-debug/newview/packaged/bin/llplugin</string>
                <key>file</key>
                    <string>/opt/secondlife/viewers/singularity/SingularityViewer/linden/indra/viewer-linux-x86_64-debug/newview/packaged/bin/llplugin/libbasic_plugin_filepicker.so</string>
            </map>
    </map>
</llsd>

and press control-v control-shift-2

Where the path should match the library you want to load.
2013-10-08 15:34:22 +02:00
Drake Arconis
010723eea6 Merge branch 'master' of https://github.com/LightDrake/SingularityViewer 2013-10-07 23:24:04 -04:00
Drake Arconis
a4fa66655e Unbreak OSX Make File builds 2013-10-07 23:23:51 -04:00
Drake Arconis
610f7ac5de Fix a Clang error 2013-10-07 23:23:40 -04:00
Adeon Writer
be10c2d7fb Focus depth of field under cursor in flycam 2013-10-07 22:28:26 -04:00
Aleric Inglewood
e3ce473639 Compiler warning fix.
My guess is that this fixes the warning:

/singularity/singularity-master/indra/newview/llfloaterdirectory.cpp: In
function ‘void* createWebPanel(void*)’:
/singularity/singularity-master/indra/newview/llfloaterdirectory.cpp:167:
warning: ‘createWebPanel(void*)::LLPanelDirWeb’ declared with
greater visibility than the type of its field
‘createWebPanel(void*)::LLPanelDirWeb::<anonymous>’
/singularity/singularity-master/indra/newview/llfloaterdirectory.cpp:167:
warning: ‘createWebPanel(void*)::LLPanelDirWeb’ declared with
greater visibility than its base ‘LLPanelDirFind’

That I see in https://files.streamgrid.net/singularity/linux-i686.log
2013-10-08 02:06:28 +02:00
Drake Arconis
008eac5a8d Merge branch 'master' of https://github.com/LightDrake/SingularityViewer 2013-10-07 17:46:37 -04:00
Damian Zhaoying
08dd2f72ec Merge remote-tracking branch 'Liru/master' 2013-10-07 14:22:25 -03:00
Latif Khalifa
c7ff14f224 Address issue #1128 2013-10-07 17:06:14 +02:00
Latif Khalifa
942f4ce225 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-07 16:59:20 +02:00
Latif Khalifa
7aed929af5 Attempted fix in Linux build and Linux32 packaging 2013-10-07 15:11:54 +02:00
Inusaito Sayori
99f81daa99 Feature Request: Add a debug setting, LiruLegacyLogLaunch, to use the old, non-browser method to open chat logs. 2013-10-07 05:43:56 -04:00
Drake Arconis
a1751dcc1e Warning fix 2013-10-06 22:55:30 -04:00
Drake Arconis
817c01595f I really really hate you microsoft. More windows sdk cmake poke 2013-10-06 22:55:21 -04:00
Drake Arconis
128503fd7f Attempt to fix linking issues 2013-10-06 22:54:38 -04:00
Sean Devin
cf100fc36c Do not use pcre on linux64
Conflicts:
	indra/newview/viewer_manifest.py

Merged with a patch that I wrote.

The linux pcre prebuilts can also be removed from install.xml,
but for now leaving them there because the prebuilts are still
in use by the libcollada prebuilt (probably should just move
them into that git repository).
2013-10-06 21:56:11 +02:00
Aleric Inglewood
64513e7229 Fix boost upgrade for standalone 2013-10-06 19:42:58 +02:00
Aleric Inglewood
8262e899f8 Merge remote-tracking branch 'singu/master' 2013-10-06 17:11:58 +02:00
Latif Khalifa
a1c43e3539 Fixed mac build. How the heck did this get there? 2013-10-06 16:34:56 +02:00
Andros Baphomet
7ab20726e4 Merge remote-tracking branch 'upstream/master'
Conflicts:
	indra/llrender/llshadermgr.cpp (resolved)
2013-10-06 10:32:23 -04:00
Aleric Inglewood
f7614dced3 Fix possible problem with negative mQueuedCommands
mQueuedCommands was unsigned, but can become shortly negative.
Unfortunately this means I had to remove the assert that
keeps track of possible errors, but I believe that already
has been proven that it works anyway.

The reason it can become negative is because its meaning is
"Number of added ADD (request) commands minus number of REMOVE (request)
commands". Hence, it is incremented when an ADD command is added to the
queue and decremented when that ADD command is removed from the queue.
However, it is first decremented when a REMOVE command is added to the
queue and then incremented again when that REMOVE command is removed
again from the queue. Such a remove command is current extremely rare:
it only happens when curl fails to time out - and the backup timeout of
the statemachine fires after 10 minutes of a curl request being idle.
That should normally only happen if a request never reached curl of
course, and is queued in the curl thread, waiting to be added to curl,
aka: -0-0-1,{...} for 10 minutes...

Now that, in turn should be impossible (since the "don't count long poll
connections) unless the Curl* Debug Setting variables are changed to
wrong values.. but ok, can only guess here.
2013-10-06 15:27:40 +02:00
Aleric Inglewood
cfad646748 Removed left over debug output. 2013-10-06 11:54:11 +02:00
Latif Khalifa
85f4fa9000 Merge branch 'boost152' 2013-10-06 08:13:31 +02:00
Latif Khalifa
dd680f27d4 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-06 08:13:11 +02:00
Latif Khalifa
2c091a954f Breaking pad: try to send the correct log file 2013-10-06 08:12:17 +02:00
Latif Khalifa
26f4c4a773 Boost throws exceptions 2013-10-06 08:11:07 +02:00
Latif Khalifa
ee007f322b Rebuilt Collada with new boost from https://github.com/singularity-viewer/3p-colladadom/commits/singularity 2013-10-06 07:50:38 +02:00
Latif Khalifa
aece3c7069 Don't copy pcre on linux64 2013-10-06 07:49:38 +02:00
Latif Khalifa
9f0af64963 More boosted fun 2013-10-06 01:55:12 +02:00
Inusaito Sayori
337c0d9cbb [Warnings] Remove warning suppressions for colladadom
I have fixed the warnings internally, so this wraps up my work
But our colladadom source and our prebuilds must be updated with my changes before this change is tolerable
2013-10-05 19:02:17 -04:00
Inusaito Sayori
4423bef896 [Warnings] Reduce collada includes to bare minimum to lessen Mac warnings 2013-10-05 18:33:07 -04:00
Inusaito Sayori
23e72f3978 [Warnings] Fix signed/unsigned mismatches rather than disabling 4018 2013-10-05 18:23:13 -04:00
Andros Baphomet
f6861cd5ba Fix shader compilation/out-of-spec issues 2013-10-05 17:33:34 -04:00
Andros Baphomet
988009d84d Don't explicitly set LIBGL_DRIVERS_PATH by default; breaks autodetection 2013-10-05 17:32:42 -04:00
Latif Khalifa
200b812182 Link boost statically 2013-10-05 22:09:54 +02:00
Latif Khalifa
4118afc146 Boost upgrade to 1.52 2013-10-05 20:27:20 +02:00
Aleric Inglewood
034ff0a305 Fix google breakpad for standalone.
The normal usage is to include the src/ directory of google breakpad
in your application and then include client/ARCH/handler/exception_handler.h
where ARCH is windows, mac or linux.

However, Linden Lab for some reason packaged the breakpad prebuilt
with exception_handler.h installed in ../google_breakpad/exception_handler.h
where "../google_breakpad" is the 'root' of the include tree comparable
with 'src' in the source tree of google breakpad.

Hence, instead of including 'src' one now must include '../include/google_breakpad'
which was already done correctly for non-standable, but not for
standalone (BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR was set to '../include'
with the 'google_breakpad' and is subsequently never used: instead
BREAKPAD_INCLUDE_DIRECTORIES is used (which is set for non-standalone)).

Therefore one much not include "google_breakpad/exception_handler.h",
but just "exception_handler.h" or you rely on somehow the directory
*below* BREAKPAD_INCLUDE_DIRECTORIES to be part of the include path as
well.

Finally LL packages the prebuilt if another duplicate minidump_descriptor.h
in the include root. Also here including "minidump_descriptor.h" would
be better correct, but following the instructions by Google this time
we might as well include the original "client/linux/handler/minidump_descriptor.h".

My repo (http://github.com/AlericInglewood/3p-google-breakpad) doesn't
even put minidump_descriptor.h in the root anymore, only
exception_handler.h. The rest is an exact copy of the 'src' tree with
regard to the headers.

Tested to compile both standalone and non-standalone.
2013-10-05 19:44:37 +02:00
Inusaito Sayori
eeeca2197e Revert "Harden agains network packet overruns"
This reverts commit 6c1ea557b5.
2013-10-05 04:31:57 -04:00
Inusaito Sayori
16a8b92d84 [OpenSimExtras] Added callback setters to for the new chat ranges
Though they're not in use yet.. they should be in use soon, either way should exist.
2013-10-05 03:39:59 -04:00
Inusaito Sayori
de1a459bcb [OpenSimExtras] Variable chat ranges viewer awareness, thanks Diva Canto!! 2013-10-05 03:20:25 -04:00
Inusaito Sayori
7448ca1046 Bit of cleanup for simfeature handler 2013-10-05 03:04:58 -04:00
Inusaito Sayori
8f5337cc67 Tooltip for grids combo box to clarify its new uses for unfamiliar users 2013-10-04 21:01:02 -04:00
Inusaito Sayori
d7782383f1 Brokepad Mountain: Fix mac compiler warning by removing unused function and its unused static variable 2013-10-04 18:29:25 -04:00
Latif Khalifa
5f5943548b Merge branch 'master', remote-tracking branch 'origin' 2013-10-04 23:06:24 +02:00
Latif Khalifa
4cd3291bd1 Merge branch 'master' of https://github.com/slabua/SingularityViewer 2013-10-04 23:05:52 +02:00
Latif Khalifa
d595eb3314 Breaking pad: link SLPlugin.app with the exacption handler
Fixes loading of SLPlugin on OS X
2013-10-04 23:00:48 +02:00
Inusaito Sayori
f770cb1a29 There's no such thing as ATI Geforce... this seems to have been added because of VWR-29593, but there's no such thing... 2013-10-04 04:43:14 -04:00
Inusaito Sayori
36d658c4c4 Feature Request: Make Log viewing cross platform by opening in a browser window
INB4 Windows users express discomfort.
2013-10-03 19:59:11 -04:00
Inusaito Sayori
cfeb50ae4d Breaking pad: warning: 'OSStatus CarbonEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)' defined but not used 2013-10-03 13:46:16 -04:00
Inusaito Sayori
2b61394234 Fix /singularity/singularity-master/indra/plugins/filepicker/llfilepicker.cpp:762:61: warning: multi-character character constant
OSTypes are four byte sequences, therefore we should use 'JP2 ' instead of 'JP2'
2013-10-03 13:20:47 -04:00
Inusaito Sayori
1c96fa09fd Fix a few signed unsigned mismatches 2013-10-03 12:41:10 -04:00
Damian Zhaoying
1c93ca6360 Merge remote-tracking branch 'Liru/master' 2013-10-03 12:44:11 -03:00
Salvatore La Bua
5183adbcaa Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-10-03 11:47:23 +02:00
Salvatore La Bua
6abffb2ce4 Merge branch 'master' of github.com:DamianZhaoying/SingularityViewer 2013-10-03 11:47:01 +02:00
Latif Khalifa
8bdc92c99b Breaking pad: don't add special pre-copy files to build dir 2013-10-03 07:53:43 +02:00
Latif Khalifa
8da3e86250 Don't copy files unless we need to extract the debug symbols 2013-10-03 07:19:14 +02:00
Inusaito Sayori
f3df986647 Merge branch 'master' of https://github.com/abaph/SingularityViewer 2013-10-03 00:53:44 -04:00
Latif Khalifa
2a8b424b85 Merge branch 'breakpad3' 2013-10-03 06:38:41 +02:00
Latif Khalifa
7e02a5825e Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-10-03 06:37:57 +02:00
Latif Khalifa
c49907e5a4 Breaking pad: typofix 2013-10-03 06:20:14 +02:00
Latif Khalifa
60cd95b31f Breaking pad: more cmake fun 2013-10-03 06:09:49 +02:00
Andros Baphomet
c39d66b547 Improved X log parser to handle VirtualGL systems, removed old X log parser 2013-10-02 21:35:17 -04:00
Inusaito Sayori
a5928f4dbf Chatbar as cmdline, return false to avoid chatting certain commands 2013-10-02 20:34:20 -04:00
Latif Khalifa
9d4b978474 Breaking pad: Linux symbol dumping 2013-10-03 02:18:53 +02:00
Latif Khalifa
3447e9bd78 Brealpad: fixed symbol extraction on Mac 2013-10-03 00:26:54 +02:00
Latif Khalifa
a27dad4db0 Breakpad: added symbol extraction to the build.
Add -DRELEASE_CRASH_REPORTING:BOOL=ON to enable symbol extraction
on build time. Viewer without this set won't sent crash
reports to the crash server
2013-10-02 18:23:19 +02:00
Latif Khalifa
ba1b482025 Also repackage bin folder 2013-10-02 17:49:57 +02:00
Andros Baphomet
f6f9e5b802 Rewrote X log parser in VRAM detection code 2013-10-02 00:17:45 -04:00
Damian Zhaoying
d57dcd2a9c Merge remote-tracking branch 'Liru/master' 2013-10-02 01:03:09 -03:00
Latif Khalifa
399a0038cb Breakpad: now working Mac OS X 2013-10-02 04:14:58 +02:00
Latif Khalifa
c8cb600ba6 Breakpad: workaround for boost crash on Linux 2013-10-02 02:59:40 +02:00
Inusaito Sayori
a415b34c28 Fix a crash noticed while working on the last commit, when asserts aren't always, we should return before using null pointers. 2013-10-01 20:02:45 -04:00
Inusaito Sayori
ffd32542cc [VarRegions] Prevent crashing on regions at the edge of reality itself (such as Null, Null)
Demotes "Asking for patch out of bounds" to llwarns to prevent crashies, guards against some seemingly potent cases.
2013-10-01 20:00:54 -04:00
Latif Khalifa
90e71db462 Breakpad: removed merge artifact, fixes Linux build 2013-10-02 01:26:27 +02:00
Latif Khalifa
b125ec8d51 Breakpad: untested update to linux/mac specific parts of llappviewer 2013-10-02 00:51:29 +02:00
Latif Khalifa
d20b7815df Check user pref for sending logs 2013-10-02 00:39:11 +02:00
Latif Khalifa
98d7721ab2 Breakpad: Commence nuclear bombardment of the unused stuff
Windows breakpad crash reports implemented and uploaded
TODO: llappviewer linux and mac port of breakpad3
2013-10-01 23:41:38 +02:00
Latif Khalifa
81fa147450 Breakpad: don't fork logger process on startup. Use singularity-debug as the dir for dumps 2013-10-01 21:47:12 +02:00
Aleric Inglewood
9f50b6942e Fix random crashes when opening HTTP debug console. 2013-10-01 18:49:53 +02:00
Latif Khalifa
c87f7b0576 Breakpad3: WIP, minidump files created
TODO: re-work sending crash logs
get rid of standalone loggers
2013-10-01 13:43:45 +02:00
Latif Khalifa
6c45bf0353 Breakpad3: Added linux64 prebuild thanks to Kokua 2013-10-01 06:18:08 +02:00
Latif Khalifa
428a3bafb8 Breakpad3: cmake and prebuilds 2013-10-01 06:04:17 +02:00
Salvatore La Bua
9233f873ef Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-10-01 03:39:00 +02:00
Salvatore La Bua
aa54d82c5a Fix a render issue with Hightlight Transparent
The smoke texture is currently not applied to transparent objects.
This commit tweaks the red alpha overlay as a workaround for that.
2013-10-01 03:33:49 +02:00
Latif Khalifa
bc64e3aa29 Don't display both username and display name if they're the same.
This is issue especially on Aurora based grids.
Patch by  Liru
2013-10-01 03:29:57 +02:00
Damian Zhaoying
db2fb32dd8 Merge remote-tracking branch 'Liru/master' 2013-09-30 21:42:46 -03:00
Damian Zhaoying
4f863689a9 update floater_tools.xml and other minor fixes 2013-09-30 21:40:37 -03:00
Salvatore La Bua
214ed0403d Add toggle for RenderAnimateTrees in Advanced > Rendering 2013-10-01 02:08:59 +02:00
Latif Khalifa
e4202c361b Don't skip transparent faces by default in Collada export 2013-09-30 23:35:51 +02:00
Latif Khalifa
b90512fea0 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-09-30 23:24:11 +02:00
Latif Khalifa
f7c19ed3fb Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-09-30 23:24:04 +02:00
Inusaito Sayori
77d52d0435 Correct git's var region merge botch, fixes dark streaks on terrain 2013-09-30 17:19:53 -04:00
Inusaito Sayori
2333a684a3 Feature Request: Allow typing login uris into the grids combo box on the login screen
Furthermore, users may now type in grid name, grid nick, or grid login uri into the box and it will resolve to an existing grid they've used before, or (for uris only) try to add the new grid with the data it provides.
Input will have trailing and leading spaces trimmed.

Thanks to Diva Canto for this brilliant request!
2013-09-30 17:18:41 -04:00
Salvatore La Bua
bed0ed73d9 Remove unused userdata fields from the MiniMap menu 2013-09-30 22:45:50 +02:00
Salvatore La Bua
c975339641 Fix copy/paste clumsiness in settings.xml 2013-09-30 22:36:08 +02:00
Salvatore La Bua
c0961e9760 Remove unnecessary listeners for the MiniMap
New class ToggleControl is used in place of the removed listeners.
Much cleaner code for the MiniMap chat rings.
Remove redundant debug setting: MiniMapChatRings.

-Thanks Liru for the advices.
2013-09-30 22:21:11 +02:00
Inusaito Sayori
705de655a9 Enable grids button portuguese translation 2013-09-30 14:42:02 -04:00
Aleric Inglewood
723f4963e0 Do not count long poll connections against CurlConcurrentConnectionsPerService
This is necessary for opensim mega regions that can have up to 16 long
poll connections for a single service, while upping the maximum number
of connections per service just for that is clearly nonsense.

I also changed that long poll connections do not "use" the "Other"
capability type (which shows that the debug info in the HTTP debug
console for the Other capability type turns grey when it only has event
poll connections). As a result additional connections become available
for textures, mesh and the inventory (the other capability types) on
opensim, which has all types on the same service, because now Other
does no longer constantly reserves a full share of the available
connections. This makes the actual number of connections used for
textures and mesh a lot more like it is on Second Life.
2013-09-30 17:39:17 +02:00
Salvatore La Bua
ddae988aa5 Minor change in class listing order in llnetmap.h 2013-09-30 12:27:33 +02:00
Inusaito Sayori
979d139af1 Address Issue 352: Ctrl-Backspace in editable text fields 2013-09-29 19:14:56 -04:00
Inusaito Sayori
ca84e68da0 Bug fix? Prevent squares showing up on windows by only using spaces in keywords.ini
There were, and may still be, squares showing up in some tooltips in script editor... this in effort to prevent them
2013-09-29 13:33:44 -04:00
Latif Khalifa
5817040956 Merge branch 'master' of https://github.com/slabua/SingularityViewer 2013-09-29 17:34:55 +02:00
Salvatore La Bua
8f9de319bf Use correct matrixMode to draw chat rings, thanks LightDrake 2013-09-29 17:31:17 +02:00
Inusaito Sayori
aa14bcc754 [VarRegions] Permanently guard against Issue 1125 sneaking back in, as best we can. 2013-09-29 11:14:57 -04:00
Inusaito Sayori
da0a092d42 [VarRegions] Fix Issue 1125: Chat Window Links open up browser 2013-09-29 11:14:00 -04:00
Aleric Inglewood
227c621dad Merge remote-tracking branch 'slb/master'
Conflicts:
	indra/newview/llnetmap.cpp
	indra/newview/llnetmap.h
	indra/newview/skins/default/xui/en-us/menu_mini_map.xml
2013-09-29 16:56:55 +02:00
Sean Devin
ffc44a7010 Implemented right click option on MiniMap to hide or show objects 2013-09-29 15:56:38 +02:00
Salvatore La Bua
af1480615f Add optional chat ranges rings on MiniMap
Ability to show Whisper, Chat and Shout range circles on the MiniMap.
Range values are at the moment hardcoded as [10, 20, 100].

Each ring is binded to the following Debug Settings:
Whisper ring:	MiniMapWhisperRing
Chat Ring:	MiniMapChatRing
Shout Ring:	MiniMapShoutRing

Each ring colour can be customised through the following Debug Settings:
Whisper ring:	MiniMapWhisperRingColor
Chat Ring:	MiniMapChatRingColor
Shout Ring:	MiniMapShoutRingColor

The following Debug Setting is used to enable/disable all the rings at once:
MiniMapChatRings
2013-09-29 14:53:51 +02:00
Salvatore La Bua
6b26561605 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-09-29 02:06:32 +02:00
Latif Khalifa
1e7f984ce6 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-09-29 01:34:00 +02:00
Aleric Inglewood
1ef90525b7 Add support for GetMesh2
Tested that it's actually being used - and it seems to download
everything at high speed. Certainly an improvement.

Textures are still *requested* in the wrong order though; for
example - baked textures are simply not requested for a long time -
while they are even downloaded from another service!
2013-09-29 01:00:30 +02:00
Salvatore La Bua
aa4bee448d Remove unnecessary CommitCallback 2013-09-29 00:01:11 +02:00
Aleric Inglewood
1c0f87d82f Let curl follow redirects by default.
Turns out that the only responders that want to get the redirect
status codes themselves are the ones that already had a
redirect_status_ok() exception.
2013-09-28 20:41:10 +02:00
Inusaito Sayori
af36d63975 Remove duplicate entries from message_prehash.h 2013-09-28 11:34:57 -04:00
Aleric Inglewood
243b499b95 Merge remote-tracking branch 'singu/master' 2013-09-28 16:52:37 +02:00
Latif Khalifa
b5ba5b8d3a Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-09-28 16:23:28 +02:00
Salvatore La Bua
b4cdd2c175 Enable Client tags on a new line by default
Change default value for SLBDisplayClientTagOnNewLine to 1
2013-09-28 16:18:52 +02:00
Salvatore La Bua
792cc12ebc Comment out an unused variable e_state_name[] in lltexturefetch.cpp 2013-09-28 05:38:09 +02:00
Salvatore La Bua
df7c60de35 Add option to show Client tags on a new line
The checkbox is available in Preferences > Vanity > Tags/Colors.
Debug Setting: SLBDisplayClientTagOnNewLine
2013-09-28 05:32:54 +02:00
Salvatore La Bua
afe0f7ef3d Revert "Trees shadow parameters use actual debug settings"
This reverts commit 3c5a0efb8d.
2013-09-28 05:15:45 +02:00
Inusaito Sayori
da38d4bc48 [VarRegions] Fix copy slurl on map to take the fmod of the x and y against the width of the region in question, instead of 256 2013-09-27 13:41:45 -04:00
Inusaito Sayori
fe29521298 [VarRegions] Made the radar aware that region width may not be 256 always anymore 2013-09-27 11:58:03 -04:00
Inusaito Sayori
4725db2d2f Merge branch 'VarRegion' of https://github.com/Lirusaito/SingularityViewer into aurora-sim
Merged cleanly:
	indra/llkeyframewalkmotion.cpp - 36e6946c96 - worked around a bug in Aurora walking motion
	indra/llrender/llimagegl.cpp - fa8e1f033b - An llerrs here becomes an llwarns, to avoid bothering the user with non power of two dimensioned images
	indra/newview/llmanip.cpp, indra/newview/llmanipscale.cpp - "Changed hardcoded 256 constants and such to width functions" - a50f0008b2
	indra/newview/llpatchvertexarray.cpp - fa8e1f033b - Support patches of non power of two width
	indra/newview/llworldmap.h - conflict

Conflicts:
	indra/llmessage/patch_code.cpp - My version cleaned up a bit of code duplication, so this was applied, within the new tags
	indra/llmessage/patch_code.h - b_large_patch in decode_patch_header defaults to false, indra/newview/llcloud.cpp patch removed.
	indra/llmessage/patch_dct.h - false positive
	indra/newview/llagent.cpp - false positive
	indra/newview/llfloaterregioninfo.cpp - nonsl wacky textures support meets the refactor.
	indra/newview/llfloaterworldmap.cpp - false positive
	indra/newview/llglsandbox.cpp - false positive
	indra/newview/llnetmap.cpp - small changes for type consistency brought into FS' patch, nothing important; also adds change to LLNetMap:draw removing getRegionWidthInMeters to keep using the constant REGION_WIDTH
	indra/newview/llpanelobject.cpp - Get the region width of the object we're editing for maximum pasted x/y coords
	indra/newview/llstartup.cpp - [Fixes old issues] My old patch did not fully use first_sim_size_x here, this has been fixed.  The unused first_sim_size_y has been removed.
	indra/newview/llsurface.cpp - rebuildWater isn't used, removed for now.  Styling conflicts otherwise.
	indra/newview/llsurfacepatch.cpp - remove FS patch that comments out code that isn't even in the modern source; cleaned up a mess of tags with more clear explanation, perhaps it can be expanded upon though.  Some styling conflicts.
	indra/newview/llviewermessage.cpp - Fix the problem? setRegionWidth by number.
	indra/newview/llviewerobject.cpp - false positive
	indra/newview/llviewerparcelmgr.cpp - just styling conflicts
	indra/newview/llviewerparcelmgr.h - false positive
	indra/newview/llviewerparceloverlay.cpp - false positive
	indra/newview/llviewerparceloverlay.h - false positive
	indra/newview/llviewerregion.cpp - cleaned up LLViewerRegion::getCompositionXY patches, they're more in the way than they're worth; removed DispatchOpenRegionSettings capability mention for now, it's not related to variable regions.  Also remove rebuildWater, it's not used right now.
	indra/newview/llvowater.cpp - false positive
	indra/newview/llwind.cpp - remove decode_patch_header patches for false, since we have a default; otherwise false positive.
	indra/newview/llworld.*
		- [Fixes old issues] Remove setRegionWidth by LLMessageSystem as the messages used are not always the same, the by number one remains of course.
		- Retained separation of connecting neighbors through the old method when the width is 256
		- updateLimits() would never have been merged in, we have an entirely different grid manager, therefore it's removed.
		- Fix the stupidity passed on over the years wherein a static constant variable would hold the same value as the first call to setLandFarClip..
	indra/newview/llworldmap.cpp - 36e6946c96 Aurora map workaround stuffs, parts removed; rework of LLWorldMap::simInfoFromHandle
	indra/newview/llworldmap.h - Cleaned up organization, avoid making members public, and fixed tagging
2013-09-27 09:51:39 -04:00
Latif Khalifa
d08c34cc2e Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-09-27 03:22:26 +02:00
Latif Khalifa
ad8ea07a7a Aurora var region support
Firestorm patch by Cinders
Adopted from Angstrom viewer with assistance of nhede Core
and Revolution Smythe.
2013-09-27 03:14:51 +02:00
Inusaito Sayori
2cc1658eda Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-09-26 04:39:55 -04:00
Inusaito Sayori
e58180a59e Revert "Revert OCD commit tick."
This reverts commit 7346931f7f.
2013-09-26 04:34:55 -04:00
Inusaito Sayori
0a67fa3520 Satisfy Issue 1115: Make clock on top status line toggleable
Click the clock to change from server time to local~
2013-09-26 04:34:17 -04:00
Latif Khalifa
6c1ea557b5 Harden agains network packet overruns
Patch by NickyD from Firestorm
2013-09-26 04:09:01 +02:00
Latif Khalifa
3066dcac58 Merge branch 'master' of https://github.com/slabua/SingularityViewer 2013-09-26 02:45:48 +02:00
Inusaito Sayori
34738593eb Allow species selection for plant creation
Fixes hardcoded "Random" string for translation of this new combobox.
2013-09-25 17:04:44 -04:00
Damian Zhaoying
0eba360416 update spanish language file floater_dae_export.xml 2013-09-25 13:30:03 -03:00
Damian Zhaoying
116a4048b7 Merge remote-tracking branch 'Liru/master' 2013-09-24 04:14:07 -03:00
Salvatore La Bua
2bc9b8a1b9 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-09-24 01:43:28 +02:00
Latif Khalifa
18859e44c7 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-09-24 01:39:58 +02:00
Shyotl
b473661cf4 ilu gcc (fix preprocessor macro typo that VS thought was dandy for some reason.) 2013-09-23 18:38:48 -05:00
Salvatore La Bua
dad4f4f9a0 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-09-24 01:20:35 +02:00
Latif Khalifa
7263b87e62 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-09-24 00:57:47 +02:00
Shyotl
3fcc92ccad FOLDERID_LocalAppData should have been FOLDERID_RoamingAppData 2013-09-23 17:55:32 -05:00
Latif Khalifa
c06c909700 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-09-24 00:26:35 +02:00
Shyotl
c47f6405d2 Texfetch/cache changes:
Added SEND_UDP_REQ and	WAIT_UDP_REQ fetch states.
Parse 'content-range' from headers.
Purge 'complete' textures from the cache if they lack 'end of codestream' marker.
Added boostlevel/category to textureview display.
More diagnostic output.
Discard handling tweaks/bugfixes from v3.
2013-09-23 17:19:44 -05:00
Shyotl
55f43c5fcd Missed a SHGetSpecialFolderPath call. 2013-09-23 16:16:18 -05:00
Salvatore La Bua
3c5a0efb8d Trees shadow parameters use actual debug settings
Use RenderDeferredTreeShadowOffset, RenderDeferredTreeShadowBias,
RenderDeferredSpotShadowOffset and RenderDeferredSpotShadowBias
in place of hard coded values.
2013-09-23 22:34:41 +02:00
Aleric Inglewood
c448908200 Merge remote-tracking branch 'singu/master' 2013-09-23 20:24:33 +02:00
Inusaito Sayori
13077bc132 Fix group search's copy uri button copying the link for a personal group always.. Thanks to Malakina Gummibaum for pointing this out~ 2013-09-23 14:07:14 -04:00
Aleric Inglewood
f0c7dadfa6 Fix crash when previewing an animation.
When uploading an animation, playing the to-be-uploaded
animation on ones own avatar while ground sitting would
crash the viewer.

This fixes that, and makes the avatar cleanly stand up first.
Rationale: the alternative is to make the user learn by
means of crashing, being frozen or just not seeing the right
animation that they have to stand before uploading an animation.
There is no reason not to automate that.
2013-09-23 20:05:56 +02:00
Latif Khalifa
b6dfea6e5f Merge branch 'master' of git://github.com/LightDrake/SingularityViewer 2013-09-23 01:56:29 +02:00
Aleric Inglewood
5df5074090 Merge remote-tracking branch 'singu/master' 2013-09-23 01:43:52 +02:00
Aleric Inglewood
e3939c3632 Avoid long viewer freezes when region doesn't have reverse DNS.
Some opensim servers might not have a reverse DNS, which causes
a stall of up to 5 seconds for each call. This means that
every time you up the parcel music stream (or any other media)
the viewer would freeze six times 5 seconds.. 30 seconds.

With this patch it only freeze once ;) (when you enter a region).
It already did that before (too), but after that opening the
parcel media doesn't freeze the viewer at all anymore.
2013-09-23 01:41:11 +02:00
Aleric Inglewood
12d3873aa7 Crash fix for empty media URL.
Apparently LLViewerMediaImpl::navigateInternal could be called with
an empty url. That lead to a curl request with an empty url, which
failed because that leads to an empty 'service' string, which is
not allowed.

Patched the code to ignore empty media urls and hardened AICurl
to deal with any remaining cases.
2013-09-22 23:25:40 +02:00
Salvatore La Bua
083d569e35 Reverted Objects LOD slider max value to 2 and fixed presets values for the Trees LOD slider according to the new maximum 2013-09-22 22:33:09 +02:00
Salvatore La Bua
da942d4968 Increased in Preferences > Graphics the maximum value for the Objects LOD slider from 2 to 4 and for the Trees LOD slider from 1 to 2 2013-09-22 19:13:21 +02:00
Drake Arconis
681f10d8b7 Make ubuntu cmake hack do yes up go now 2013-09-22 12:33:10 -04:00
Salvatore La Bua
4db8234da5 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-09-22 06:24:06 +02:00
Salvatore La Bua
da4196c246 Re-enabled RenderAnimateTrees. Fixes issue 1101: http://goo.gl/YIvqSY 2013-09-22 05:52:35 +02:00
Latif Khalifa
67142f3080 Merge branch 'master' of https://github.com/slabua/SingularityViewer 2013-09-22 02:04:52 +02:00
Salvatore La Bua
67720c6a6a Fixed position of ui element Show FPS to the bottom right corner 2013-09-22 01:14:47 +02:00
Salvatore La Bua
df6aa397f9 Added a menu toggle item at Advanced > UI > Show FPS to show fps as an ui element. The related Debug Setting is: SLBShowFPS 2013-09-22 00:11:54 +02:00
Latif Khalifa
791b64f74b Merge branch 'patch-1' of https://github.com/aragornarda/SingularityViewer 2013-09-21 18:37:55 +02:00
Latif Khalifa
f4f888c172 Potential fix for a crash on HG OpenSim teleports by Liru 2013-09-21 18:22:59 +02:00
Damian Zhaoying
68aa60595e update string.xml file for user status in panel avatar 2013-09-20 16:17:01 -03:00
Damian Zhaoying
2ec2b92bc5 Merge remote-tracking branch 'Liru/master' 2013-09-20 14:19:58 -03:00
Latif Khalifa
992d8e960c Copypasta typo fix. Spotted by Cinder Biscuits 2013-09-20 13:51:38 +02:00
Latif Khalifa
9f48485b9c Strip newline chars from the end of the log line string 2013-09-20 13:34:17 +02:00
Inusaito Sayori
e9ca27322b Run trim on input start locations, in case copy paste brought some spaces along for the ride 2013-09-19 23:40:14 -04:00
Inusaito Sayori
104099aed5 [Issue 1105] Fix Last Login row in groups not sorting properly
Updated llgroupmgr.cpp's formatDateString() from upstream
 -Corrected it to actually use ISO 8601 format.

Also fixes notices tab to use the new format parameter to sort properly.
2013-09-19 23:37:58 -04:00
Inusaito Sayori
892d224b9c [Issue 1105] Add Parameter "format" to scroll list cells to define how a date cell will format its displayed date
Defaults to use RFC1123 to maintain expected behavior
2013-09-19 23:29:36 -04:00
Latif Khalifa
ae38835959 Version 1.8.3 2013-09-18 06:55:30 +02:00
Damian Zhaoying
fb88ad737f Merge remote-tracking branch 'Liru/master' 2013-09-17 23:43:37 -03:00
Inusaito Sayori
a4c0cab6a0 Fix 1098 (caused by silly mistake in filepicker bit for windows) 2013-09-17 18:32:54 -04:00
Latif Khalifa
dd1cb4921f Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-09-17 21:41:58 +02:00
Aleric Inglewood
9ac7a139af Rewrite of LLLogChat::loadHistory.
Tested to work.
2013-09-17 21:41:49 +02:00
Damian Zhaoying
652e498cc5 added new floater_dae_export.xml translation file and other minor changes 2013-09-17 03:16:05 -03:00
Drake Arconis
eeeaaa3535 Translation poking for my last commit 2013-09-17 01:58:48 -04:00
Drake Arconis
08654cc859 Fixed profile floater not displaying custom account type strings from server 2013-09-17 01:31:54 -04:00
Damian Zhaoying
2f2d140be5 Merge remote-tracking branch 'Liru/master' 2013-09-17 00:30:42 -03:00
Latif Khalifa
3f1d05b839 Re-apply warning fix after the previous revert 2013-09-17 05:04:44 +02:00
Latif Khalifa
7346931f7f Revert OCD commit tick.
Revert "Appease VS2010 warning and make ui code more consistent with the modern standard in daeexport.cpp"

This reverts commit cb6dec62ec.
2013-09-17 04:59:25 +02:00
Inusaito Sayori
132574f53c Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-09-16 22:46:32 -04:00
Inusaito Sayori
37c2bb0a6e Merge branch 'master' of git://github.com/lkalif/SingularityViewer 2013-09-16 22:46:21 -04:00
Inusaito Sayori
9b33e592fa Fix log being read from the top, woops 2013-09-16 22:44:31 -04:00
Inusaito Sayori
69a6968775 Request: Add menu item separator between replace and remove. 2013-09-16 22:36:48 -04:00
Latif Khalifa
afec67e596 Kill a compiler warning 2013-09-17 01:48:39 +02:00
Latif Khalifa
97c8218463 Don't crash when chanelp returned is null 2013-09-17 01:48:11 +02:00
Inusaito Sayori
f73caef7a5 Fix log timestamp inconsistency when including seconds 2013-09-16 14:31:58 -04:00
Damian Zhaoying
d16e93f62f Merge remote-tracking branch 'Liru/master' 2013-09-16 13:28:04 -03:00
Inusaito Sayori
cb6dec62ec Appease VS2010 warning and make ui code more consistent with the modern standard in daeexport.cpp 2013-09-15 18:01:21 -04:00
Latif Khalifa
a2b2af6eb7 Don't pass std::string to llformat 2013-09-15 10:40:16 +02:00
Latif Khalifa
a5aedfb783 Typo fix 2013-09-15 10:29:52 +02:00
Latif Khalifa
b4697bf732 Made texture export on by default when exporting Collada. 2013-09-15 09:26:49 +02:00
Latif Khalifa
b2ae9feda0 Collada export, now with more awesome
* Added support for exporting textures
* Added support for applying texture parameters
* Added support for merging faces with same textures
* Added support for skipping transparent faces
2013-09-15 09:19:21 +02:00
Latif Khalifa
0de1e27470 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-09-15 09:14:23 +02:00
Inusaito Sayori
e5f2d5f76e Fix Save Preview As... for textures, now save as any type we can encode to!
Removes the previous method and condenses the menu entries back into one.
 - Translations have been updated except for German, German will need to update the translation for "Save Preview As..." since the name hasn't changed.
Adds FFSAVE_IMAGE to the filepicker enums
Crossplatformity:
 - The Windows version works nicely
 - The Linux version may not work or even compile but it should..
 - The Mac version hasn't been added, instead it will default to accept any(all filter), should the provided file extension be invalid a notification will display.
2013-09-14 21:21:36 -04:00
Inusaito Sayori
42f8875d69 Group chat seems to want script reset from object inventory, so here you go. 2013-09-14 21:07:01 -04:00
Inusaito Sayori
0d1c4def2d Feature Request: Add a debug setting to prevent double clicking on the world map resulting in a teleport
Adds DoubleClickTeleportMap to debug settings.
2013-09-14 20:59:12 -04:00
Inusaito Sayori
0b20babd35 Feature Request: Add a debug setting for how many lines of history to show when LogShowHistory
LogShowHistoryLines is the setting
This change cleans up some very C code in lllogchat.cpp
2013-09-14 20:55:19 -04:00
Inusaito Sayori
9b984d425d Feature Request: Add an option to show the grid name in title
LiruGridInTitle is the debug
2013-09-14 20:51:03 -04:00
Inusaito Sayori
461f6f6ade Since views cleanup their children, drop target's destructor doesn't need to. 2013-09-13 19:08:52 -04:00
Damian Zhaoying
701d8ba37b fix typo and update text for new option in avatar menu 2013-09-13 14:16:49 -03:00
Aleric Inglewood
dcbcc7ea3c Avoid compile error when using glh and boost at the same time.
Defining a macro in a header that doesn't have any namespace prefix
like GLH_ ugh. Very bad.

Changed the macro into an inline function inside namespace glh.
2013-09-13 17:22:56 +02:00
Inusaito Sayori
a0a51fb762 Max prim scale on opensim is now 8192 (server restrictions may apply, limit one per customer) 2013-09-12 22:35:31 -04:00
Inusaito Sayori
5058e3e87d Don't changeCameraToDefault when notecards open. 2013-09-12 18:44:30 -04:00
Inusaito Sayori
c6e2559d3e Correct a typo in setting name for preferences panel 2013-09-12 17:11:26 -04:00
Latif Khalifa
c14d46074c Re initiate spatial partitions in the main region after a long teleport jump.
Also kill objects in the regions we left behind.
Restore max octree range to 1024 * 1024
2013-09-12 09:42:55 +02:00
Inusaito Sayori
5b73586b95 Display the current region's grid coordinates in Help->About Singularity 2013-09-12 00:42:03 -04:00
Latif Khalifa
5573499b9d Reduce max size of octree root to 2048^2 in an attempt to avoid float errors leading to crashes on very long teleports 2013-09-12 03:09:51 +02:00
Inusaito Sayori
5575ff2b90 Default all available items to be included in new outfits 2013-09-11 18:54:27 -04:00
Latif Khalifa
3d6b94d2ed Avoid infinite recursion crashes with wider octree range 2013-09-11 23:28:26 +02:00
Inusaito Sayori
312a58584e Fix some cases where busy and muted were not evaluated properly for automated handling of incoming messages 2013-09-11 15:38:35 -04:00
Latif Khalifa
170d9c7983 Made max octree range power of two.
Fixes crashes observed in "Forum" region in SL where some
avatars seem to be flying millions of meters up in the air.
2013-09-11 19:58:02 +02:00
Inusaito Sayori
9786bc47fb Clear out comment text when saving to solve Issue 1078
Thanks to Zi Ree for this fix
2013-09-11 03:11:10 -04:00
Latif Khalifa
3045f93f62 Increased octree limit to 32k. Addresses "4096 bug" in Opensim
Thanks to NickyD for tracking down the cause.

Refereces:

https://jira.secondlife.com/browse/SVC-2941
http://redmine.kokuaviewer.org/issues/465
http://jira.phoenixviewer.com/browse/FIRE-11593
2013-09-10 19:19:05 +02:00
Latif Khalifa
56af88fb94 Revert "Removed internal limit 2^20 for lloctree"
This reverts commit 7376c833c7.
2013-09-10 19:16:02 +02:00
Latif Khalifa
7376c833c7 Removed internal limit 2^20 for lloctree
This addresses "4096 bug" affecting long Opensim teleports

Patch by NickyD (Firestorm)

Refereces:

https://jira.secondlife.com/browse/SVC-2941
http://redmine.kokuaviewer.org/issues/465
http://jira.phoenixviewer.com/browse/FIRE-11593
2013-09-10 13:22:01 +02:00
Latif Khalifa
0d893c5217 Revert "Possible fix for "4096 bug" affecting long Opensim teleports"
This reverts commit f7cf69ec95.
2013-09-10 13:02:38 +02:00
Latif Khalifa
8a69b9e50d Revert "Patch tool completely misplaced a hunk in previous commit"
This reverts commit 99893ee992.
2013-09-10 13:02:17 +02:00
Latif Khalifa
99893ee992 Patch tool completely misplaced a hunk in previous commit 2013-09-10 04:19:01 +02:00
Latif Khalifa
f7cf69ec95 Possible fix for "4096 bug" affecting long Opensim teleports
Patch by Tonya Souther (Firestorm)
Refereces:

https://jira.secondlife.com/browse/SVC-2941
http://redmine.kokuaviewer.org/issues/465
http://jira.phoenixviewer.com/browse/FIRE-11593
2013-09-10 03:53:03 +02:00
Inusaito Sayori
27b2f14193 Fix for STORM-1948; modified version of viewer-release's 683b1ecc6ce8255d31cad3c674ffaf87353c6469
To maintain compatibility with grids that still use the old home position set notification method, a common function is called.
The fix has also been applied for the special case of death teleports.
2013-09-09 21:27:33 -04:00
Inusaito Sayori
e36c0095e0 Add NewIMsPerConversationReset to reset the visibility of the New IMs button when the communicate floater has been opened and closed and NewIMsPerConversation is in use
(this is now the default behavior of NewIMsPerConversation)
2013-09-09 21:08:38 -04:00
Inusaito Sayori
0b1a172a91 Fix up spanish translation for the IM flyout button 2013-09-09 21:03:41 -04:00
Inusaito Sayori
b5cc29ebbc Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-09-09 20:56:07 -04:00
Inusaito Sayori
88af3cabc3 Fix the issue of system messages being counted towards unread IMs 2013-09-09 20:55:21 -04:00
Latif Khalifa
f838c235cb Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-09-09 10:24:29 +02:00
Inusaito Sayori
0e5085e6bc Fix owner mask being displayed in the debug permissions for everyone mask 2013-09-08 10:50:16 -04:00
Inusaito Sayori
380642044f Revert "Mewmew"
This reverts commit 27dcbef8fa.
2013-09-06 15:42:14 -04:00
Inusaito Sayori
22fee625e5 Revert "You, my friend, are a victim of disorganized thinking."
This reverts commit d956f60c0b.
2013-09-06 15:39:00 -04:00
Damian Zhaoying
7d4c633514 Update changes in floater IMs 2013-09-02 18:12:31 -03:00
Latif Khalifa
c7d5ef31c0 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-09-01 02:26:05 +02:00
Aleric Inglewood
fc70dd436f Fix of issue 1055
Thanks to sappadillidallagio and warctor/Parker for reporting.
2013-08-31 22:56:37 +02:00
Inusaito Sayori
d9bff43dd8 At the Singularity group's request: Another attempt to mute voice upon reconnecting to local voice if the setting requests such 2013-08-29 14:05:24 -04:00
Inusaito Sayori
50a85109a0 Improvements to NewIMsPerConversation mechaics and includes cleanup in lloverlaybar.cpp 2013-08-29 14:01:23 -04:00
Inusaito Sayori
adeb340e93 Includes cleanup in llimpanel.* and llimview.cpp 2013-08-29 13:57:54 -04:00
Inusaito Sayori
539eb2e348 Add buttons back to the IM floater, taking the space that RP Mode once occupied
Also fix concise IM buttons from looking awful, concise stays concise, only the dropdown button there.
2013-08-29 13:56:14 -04:00
Inusaito Sayori
b3f414c4ad Move RP Mode check into the Profile button dropdown 2013-08-29 13:45:24 -04:00
Inusaito Sayori
83c66c978b Option to ding on each new IM for given private IM sessions
Ding noises configurable via LiruNewMessageSound* debug settings
2013-08-29 13:35:35 -04:00
Inusaito Sayori
344909c0a3 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-08-28 03:38:02 -04:00
Damian Zhaoying
ce1c554fa3 Spanish Translation. Added new option in voice control panel. Added new option web profile in calling card options in menu inventory 2013-08-28 04:34:08 -03:00
Inusaito Sayori
e032c53bc6 Feature Request: Make the map dot color for everyone else customizable
Switches MapAvatar from being part of a skin's colors.xml to being a user setting (optionally vanity per account)
This makes sense because all the other dots were at the user's control already.
2013-08-28 03:29:57 -04:00
Inusaito Sayori
e08c05fbd6 Feature Request: Add debug setting ResetViewTurnsAvatar to solve the problem described in Issue 715 Comment 10
Solves https://jira.secondlife.com/browse/VWR-27956
2013-08-28 01:12:03 -04:00
Latif Khalifa
64c6a8a3ed Bump version to 1.8.2 2013-08-28 06:44:35 +02:00
Inusaito Sayori
c57191b951 Feature Request: Ability to have the New IMs button display the amount of unread conversations instead of the amount of new IMs therein
Set NewIMsPerConversation true to activate.
2013-08-28 00:35:31 -04:00
Inusaito Sayori
9c80f58d34 Fix tabs and spaces mixup and typo in llvoicevivox. 2013-08-27 23:27:09 -04:00
Inusaito Sayori
e571b9a585 Merge branch 'master' of git://github.com/TighMacFanatic/SingularityViewer 2013-08-27 23:18:45 -04:00
Inusaito Sayori
9df7808dc8 Add Web Profile option to calling card inventory menu
Only shown when web profiles are available and web profiles aren't used by default
2013-08-27 21:37:08 -04:00
Latif Khalifa
27480c1718 Issue #1049, additional checks for sculpt prims 2013-08-27 21:21:12 +02:00
Inusaito Sayori
01e31cc711 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-08-27 10:04:40 -04:00
Latif Khalifa
bd8a44ad21 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-08-27 15:19:36 +02:00
Latif Khalifa
8ff867e792 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-08-27 14:47:50 +02:00
Damian Zhaoying
302d9e1e50 Update notifications.xml and other files and add new file floater_inv_panel.xml 2013-08-26 17:51:51 -03:00
Inusaito Sayori
67180f40fc Merge branch 'master' of https://github.com/LightDrake/SingularityViewer 2013-08-25 14:24:56 -04:00
Drake Arconis
fdc855cd37 Trivial changes to better sync with viewer 3 2013-08-25 14:14:51 -04:00
Drake Arconis
cdeea281cd Fix debugging info left on from win8 fixes 2013-08-25 03:04:47 -04:00
Drake Arconis
4ec56904e7 Make perlin nosie repeatable for consistent ground textures 2013-08-25 03:02:59 -04:00
Drake Arconis
01bba31c8d Crash fixes to deal with janky FBX to DAE converters 2013-08-25 03:02:40 -04:00
Drake Arconis
5968708207 Fixed non-localizable strings in world map 2013-08-25 02:45:00 -04:00
Drake Arconis
5bf7281525 Fixes to build against windows 8 sdk 2013-08-25 02:16:35 -04:00
Inusaito Sayori
a2b0731dd0 Satisfy Issue 613: TIme-stamp when viewing old notices in groups
To activate set LiruGroupNoticeTimes to true via debug settings
Depending on your date and time settings, you may need to resize the date column of the scroll list and hit refresh to see the times, alternatively, the tooltips will display the whole time always.
2013-08-24 21:57:42 -04:00
Inusaito Sayori
c9482ecac5 Feature request: Add an option to open inventory folders in a new separate window 2013-08-24 21:52:53 -04:00
Inusaito Sayori
c3b7c6999f Implemented decrement and distance_to for LLInstanceTracker::instance_iter and LLInstanceTracker::key_iter
Technically, both nested iterator classes in llinstance tracker should be derived from a common base implementation of boost::iterator_facade for std::maps(LLInstanceTracker::InstanceMap), they'd only need to implement dereference individually
2013-08-24 21:49:01 -04:00
Inusaito Sayori
323adeb224 Increment unread message count for IM floaters that are popped out but not focused. 2013-08-24 21:35:14 -04:00
Inusaito Sayori
74698fa3d8 Yet another attempt to solve Issue 929, bridge autodetach
This time we go through with the bridge attach but we setup a callback to detach once attachment process has gone through
2013-08-24 21:24:23 -04:00
Inusaito Sayori
8fc74855da Solve Issue 925: Add "Show on Map" to right-click menu for landmarks in inventory 2013-08-24 19:41:39 -04:00
Inusaito Sayori
e9d8ceaa38 Finish Singu TODO: Texture Save As from inventory menu. 2013-08-24 19:35:30 -04:00
Inusaito Sayori
cde66a4169 Fix for Issue 598: shortcut ctrl+alt+F1(disable UI) conflicts with linux (switch to other tty)
Reload personal setting overrides no longer has a shortcut.
On Linux, ctrl-shift-F# is now used instead of ctrl-alt-F#
On other platforms, nothing else changes.
2013-08-24 19:28:32 -04:00
Inusaito Sayori
0c40a38a45 Append the count of unread IMs to the IM session's name in the communicate button's flyout list
ShowUnreadIMsCount can be set false to turn this off
2013-08-24 19:20:56 -04:00
Inusaito Sayori
a4802a4511 Set MeshMaxConcurrentRequests default back down to 32
The Lindens prefer it be this low and our users have found that lower is better lately.
2013-08-24 16:09:15 -04:00
Inusaito Sayori
fea628fd82 Fix a conflict with the inventory offer button enum and the profile button's index 2013-08-22 10:09:12 -04:00
Inusaito Sayori
f90752e81c Correct a potential memory leak
Thanks to Ratany for drawing my attention to it.
2013-08-22 10:06:34 -04:00
Inusaito Sayori
4607bb6ea0 Feature request: Hang onto last values for Ease In and Ease Out for future animation uploads (Issue 984) 2013-08-20 06:09:07 -04:00
Inusaito Sayori
241b153aaf Restore Legacy Behavior: Display tooltips on scrolllisttext cells as long as there's text there, not just if that text is truncated 2013-08-19 22:59:57 -04:00
TighMacFanatic
7783b835f0 Fix swapped enum so I don't break anything unexpected. 2013-08-18 02:07:12 -04:00
Aleric Inglewood
cc9fc6b868 First attempt to deal with broken (pre multiwear) inventory items.
Since multiwear, the low 8 bit of inventory items, if they are of type
IT_WEARABLE, is used for the wearable type (WT_*). Older viewers and
bots (like Second Inventory) create inventory items with 0 in those
bits. This causes all those item to appear as shapes in multi-wear
capable viewers.

This gives rise to many problems:
1) You can't wear them, because the inventory and asset wearable type
mismatch, which makes Singularity just abort.
2) Before it aborts, it already removed your old shape, thinking you
are about to wear another shape - and told the server that you are
wearing this broken item now. The result is that you see no change,
until you relog when you are suddenly wearing the broken "shape"
and stay a cloud forever.

This commit detects the problem for AT_CLOTHING wearables, because
they are not compatible with the type 'shape' after all (which is
is AT_BODYPART). It still doesn't know what the wearable type is, but
sets the type temporarily to the new value WT_UNKNOWN. Since this is
at least not a shape anymore, it doesn't cause you shape to be removed
when wearing it. Moreover, once the asset is downloaded, the mismatch
is detected and corrected: you can now wear -say- pants, or other
clothing.

Inventory clothing items with an unknown wearable type now have a
red question mark icon in the inventory.

What does NOT work yet:

1) If you copy such an item and paste it, then the new copy has
a shape icon again (and all the previously mentioned problems).

2) If you wear broken hair, skin or eyes (which still show as
shapes in the inventory) then your shape is still removed, and
wearing them fails because they are not multiwear capable and you
are already wearing such a body part. What should be done here
is that the removed shape is added back and the real body part
that you're trying to wear is removed.

3) Although this code attempts to fix the mFlags in the inventory,
the icon in the inventory doesn't change from question mark to the
right thing.
2013-08-18 02:50:31 +02:00
TighMacFanatic
9fc7c84f74 Added a third option to hear voice from everywhere so position does not affect volume/panning. 2013-08-17 12:20:03 -04:00
Inusaito Sayori
51532aa22c Fix Issue 1012: Private voice call
The original purpose of the patch removed here was to fix this very bug, though I could not reproduce it at that time...
There must still be an edge case where this bug will reproduce but I tweaked the involved settings around quite a bit and could not reproduce it
2013-08-16 00:49:34 -04:00
Inusaito Sayori
6910a2feca User-configurable log filename date formatting (When using "Append date to log filename")
The old defaults remain the same, so no worries for old users of this feature
Modify LogFileLocalChatDateFormat and LogFileIMsDateFormat in debug settings, use strftime's format specifiers.
The above mentioned settings are per account.

Inspired by irssi
2013-08-15 23:25:00 -04:00
Inusaito Sayori
a5287ee975 Adjust chat log opening functions to use LLLogChat functions to determine log file
This eliminates the possibility of the history button not opening the log file, which has been reported in the past.
This also corrects cases where log files named with date would not be opened.
2013-08-15 21:52:40 -04:00
Damian Zhaoying
1e64d41bdc Fixed typos and Syntax errors in notifications.xml and strings.xml files, update other strings 2013-08-15 20:35:04 -03:00
Inusaito Sayori
03b384334c Feature Request: Show profile from inventory offer notifications 2013-08-15 01:36:07 -04:00
Inusaito Sayori
a5705bd459 IRC Feature Request: Ability to show only legacy names for speakers (in Adv. Chat->Chat UI preferences) 2013-08-15 00:06:09 -04:00
Inusaito Sayori
0b9f14fff7 Feature request: Show profile on Teleport Offer notifications 2013-08-14 22:02:15 -04:00
Inusaito Sayori
b00e39f211 Continuation of the ongoing effort to change intrusive notifications into notifytips 2013-08-14 21:32:54 -04:00
Inusaito Sayori
75e5f87998 Fix Issue 1011: Intrusive on death teleport notification 2013-08-14 21:19:56 -04:00
Inusaito Sayori
e21a631b87 Feature Request: Parse periods in query as spaces in legacy people search 2013-08-14 21:00:10 -04:00
Latif Khalifa
c07646ff38 Include winmm.dll in the Windows installer 2013-08-14 22:41:43 +02:00
Inusaito Sayori
709c3ec877 Fix the crash upon opening Bumps, Pushes & Hits Floater
There are two types of font names, the camelcase and the all uppercase
Since mostly uppercase is used for scroll lists, this issue went undetected
but both types are used upstream, so we now look for camelcase if we couldn't get an uppercase one
The crash itself is avoided by falling back on SansSerifSmall if no known font has the name provided.
2013-08-14 14:25:59 -04:00
Inusaito Sayori
07e09be280 Modernization of LLFloaterBump that took place while working on the issue solved in next commit 2013-08-14 14:17:08 -04:00
Inusaito Sayori
56a6c91aac Fix the issue of script limits floater popping up after it was closed 2013-08-14 11:13:00 -04:00
Inusaito Sayori
7aaef519d4 Cleanup translations (mainly to not have control names and blank labels copied over) 2013-08-13 18:03:58 -04:00
Inusaito Sayori
04c91a1393 Touchup to conform to format standard 2013-08-13 17:20:00 -04:00
Inusaito Sayori
2dc63a3463 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-08-13 17:18:35 -04:00
Latif Khalifa
20687aee86 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-08-13 03:17:24 +02:00
Shyotl
2f7b1e3d9b Added bits required for webkit volume adjustment to work on windows (xp included). 2013-08-12 20:15:57 -05:00
Latif Khalifa
4b1329095e Merge branch 'master' of https://github.com/MelanieT/SingularityViewer 2013-08-13 02:53:13 +02:00
Latif Khalifa
d0a6531bbf Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-08-13 02:52:47 +02:00
Aleric Inglewood
d7d361004a Allow export full perm item on opensim if it doesn't support the export bit.
This addresses
https://code.google.com/p/singularity-viewer/issues/detail?id=1003
2013-08-13 02:31:30 +02:00
Melanie
c6661cf789 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-08-13 01:38:35 +02:00
Melanie
c8d301f05d Replace FIRST LAST markers with NAME 2013-08-13 01:38:12 +02:00
Latif Khalifa
8f43868f82 1.8.1 2013-08-12 16:57:27 +02:00
Latif Khalifa
03af92c93e Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-08-11 04:55:26 +02:00
Shyotl
f68e89cec6 LLMeshHeaderResponder and LLMeshLODResponder retry mechanisms. 2013-08-10 20:18:31 -05:00
Damian Zhaoying
62e0db83bd Merge remote-tracking branch 'Liru/master' 2013-08-10 20:11:47 -03:00
Melanie
c9888fb72f Translation update - now 83% complete. Much was merged from Firestorm. 2013-08-10 23:41:05 +02:00
Inusaito Sayori
650f9857bf Bump RLVa version to 1.4.8, turn Prim Media Autoplay and Idle status tag settings off by default 2013-08-09 19:31:37 -04:00
Damian Zhaoying
412459ec3d Update Spanish Translations. 2013-08-09 13:30:59 -03:00
Damian Zhaoying
aa818eb32e Merge remote-tracking branch 'Liru/master' 2013-08-09 10:17:00 -03:00
Inusaito Sayori
d6aace58b3 Fix the borders of drop targets to look like they did back in 1.8.0 2013-08-08 22:02:24 -04:00
Inusaito Sayori
5b4b2b1078 Fix the load button on web tab of profiles not working, thanks to goldlatias for pointing this out. 2013-08-08 21:52:36 -04:00
Inusaito Sayori
7a2a7f531f Add default object texture id to perms check 2013-08-08 20:32:02 -04:00
Inusaito Sayori
fb32e500dc Fix the spinners on the map and on the god tools floater being too small because of unused label_width. 2013-08-08 16:03:01 -04:00
Inusaito Sayori
4b8db31073 Fix Issue 992: Singularity will not allow teleports above 4096, nor building above 4096.
Teleport height restrictions have been increased to 8192
 -The 4096 limit isn't in much of the teleport code anyhow, and it's certainly not enforced.
Building height restrictions are now hooked up to hippolimits, apparently they hadn't been
 -MAX_OBJECT_Z, and hardcoded 4096s now use gHippoLimits->getMaxHeight() instead
 -On floater_tools.xml max_val is left out, instead it is set with the rest of the gHippoLimits edit constraints in LLPanelObject::getState
2013-08-08 16:00:49 -04:00
Damian Zhaoying
ca61a11825 Merge remote-tracking branch 'Liru/master' 2013-08-08 13:43:19 -03:00
Inusaito Sayori
4c69074564 Fix squares showing up on God Tools floater because of tabs being used for xml spacing 2013-08-08 01:57:05 -04:00
Inusaito Sayori
cc534487c0 Fix StockMaster's issue of the radar alerting ten seconds after avatars have departed 2013-08-08 00:06:32 -04:00
Inusaito Sayori
b17cebd87f Allow multi select on the group members list in the general tab (How did this slip by me?) 2013-08-07 13:55:38 -04:00
Inusaito Sayori
102bf18195 Typo fix 2013-08-07 11:02:44 -04:00
Damian Zhaoying
2679148aec Merge remote-tracking branch 'Liru/master' 2013-08-07 04:32:26 -03:00
Inusaito Sayori
cac18c1bc6 Typo fix: onPatialExportConfirm should be onPartialExportConfirm 2013-08-06 23:46:47 -04:00
Latif Khalifa
8fb8a1af34 Merge branch 'master' of https://github.com/MelanieT/SingularityViewer 2013-08-07 03:42:51 +02:00
Inusaito Sayori
ae9eb0003e Fix Issue 938: Pressing enter on the login screen doesn't log in
Fixes side issue with location combo's focus not being lost during onClickConnect
2013-08-06 21:30:09 -04:00
Damian Zhaoying
8f16460bdb update spanish translation: fix in panel_login.xml file 2013-08-06 16:05:23 -03:00
Damian Zhaoying
1a59de0db8 Merge remote-tracking branch 'Liru/master' 2013-08-06 15:26:08 -03:00
Inusaito Sayori
2e36b569ad Fix focusing marked via the radar menu not working 2013-08-06 10:05:20 -04:00
Inusaito Sayori
7de20f8e98 Eep, this escaped the dummy ui warning commit yesterday. 2013-08-06 09:55:17 -04:00
Inusaito Sayori
fb01a95622 Fix Tobi Genesis' issue of the console sitting over the login fields after a failed login when hiding login screens. 2013-08-06 09:54:26 -04:00
Inusaito Sayori
3fa69e0337 Fix creating dummy ui warning on the login panel
Part of my ongoing work to fix enter not working on the login screen
2013-08-05 20:19:56 -04:00
Inusaito Sayori
c5782d9b90 Correct a typo: AntiSpamNotFriends should be AntiSpamNotFriend 2013-08-05 14:34:07 -04:00
Inusaito Sayori
f194a884db Fix SignaledType not compiling on Windows 2013-08-05 14:15:33 -04:00
Inusaito Sayori
95175016d3 Fix assert caused by misuse of ScriptTeleportRequest message block data
Thanks to Nomade and Esmeralda for catching this one!
2013-08-05 11:10:18 -04:00
Melanie
5a5b18b475 German translation: Remove entries that don't actually translate anything. Add new translateable strings that the parser missed before. 2013-08-05 01:03:17 +02:00
Inusaito Sayori
8ca1079dee Minor improvement to SignaledType
Allows using non-void functions as callbacks, as originally intended.
2013-08-04 14:13:45 -04:00
Damian Zhaoying
67a57bd35f update spanish translation: add New menu avatar floater, Multiple voice support checkbox in preferences 2013-08-03 22:51:02 -03:00
Melanie
52c956ab38 Update the changes to the German translation after merge. 2013-08-03 23:47:29 +02:00
Melanie
fa6b021d83 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-08-03 23:44:26 +02:00
Melanie
5197449598 Remove some horrid translation artefacts from German translation. Remove unnecessary end tags. Add new translations. 2013-08-03 23:40:33 +02:00
Latif Khalifa
e939f0f7bc Merge branch 'bug_fix_20130802' of git://github.com/Apelsin/EffervescenceViewer 2013-08-03 01:41:45 +02:00
Inusaito Sayori
9411b463e2 Expose VoiceMultiInstance as a checkbox on the Voice tab of Preferences 2013-08-02 19:41:04 -04:00
Latif Khalifa
11b904af36 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-08-02 23:56:34 +02:00
Inusaito Sayori
b3c1271215 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-08-02 17:53:04 -04:00
Inusaito Sayori
b98f970399 Missed a few lines in the initial radar menu commit, my bad. (fixes radar specific menu entries not working) 2013-08-02 17:52:53 -04:00
Inusaito Sayori
73021182b2 Basic menus for all the remaining avatar lists in group profiles. 2013-08-02 17:33:31 -04:00
Inusaito Sayori
1ccba509a8 Feature Request: If web profiles are available and are not shown by default, offer a menu entry to show them from avatar lists 2013-08-02 17:04:48 -04:00
Inusaito Sayori
ba7d55be73 Removed Report Abuse from the avatar list menus for now, it doesn't work 2013-08-02 17:03:19 -04:00
Inusaito Sayori
740513b097 Broke out duplicated list menu code blocks into functions 2013-08-02 17:02:13 -04:00
Inusaito Sayori
35a99acdaf Fix the issue where mic gets left on after leaving a voice call 2013-08-02 16:54:36 -04:00
Inusaito Sayori
d7ac52afd7 Fix MyBrains Gottfried's issue of device settings switching to default device on apply 2013-08-02 16:52:36 -04:00
Inusaito Sayori
19f03e179d Bug fix for is_owned_by_me check: if session_id can't be found as a source object, try from_id 2013-08-02 16:50:31 -04:00
Inusaito Sayori
ea69a7bfa9 Ratany's Feature Request: Add antispam dialog filter bypasses(own objects and friends) and condense antispam dialog blocking into a single function 2013-08-02 16:49:19 -04:00
Aleric Inglewood
6f733f6f62 Documentation update. 2013-08-02 13:04:56 +02:00
Apelsin
47b59d146b LLVOVolume::getApproximateFaceNormal bug fix 2013-08-02 01:11:48 -07:00
Inusaito Sayori
27dcbef8fa Mewmew 2013-08-01 19:58:37 -04:00
Damian Zhaoying
2c76d0c156 fix update spanish translations for menu avi list 2013-08-01 16:02:03 -03:00
Damian Zhaoying
811935b43c update spanish translations for menu avi list 2013-08-01 15:00:00 -03:00
Shyotl
52f6c5830c Lazy startup crash fix. Do we really care about a browser init message, especially before the UI is even initialized? I'd say probably not. 2013-08-01 02:31:20 -05:00
Inusaito Sayori
d956f60c0b You, my friend, are a victim of disorganized thinking. 2013-07-31 17:19:01 -04:00
Inusaito Sayori
8b0b0b092f Compile fixie 2013-07-31 17:05:58 -04:00
Latif Khalifa
944db75b89 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-07-31 22:19:30 +02:00
Inusaito Sayori
d0dee3da59 Pre-fill the Request Teleport text box 2013-07-31 16:18:43 -04:00
Inusaito Sayori
ff6dc9341d Add basic menu_avs_list to Friends List and People Search 2013-07-31 15:56:12 -04:00
Inusaito Sayori
9042ccde00 Exchange most of the buttons on the instant message floater for a flyout button that offers more like Request Teleport! 2013-07-31 15:54:55 -04:00
Latif Khalifa
94947ac58d Changed license to be V3 compatible
Fixed count when stride is > 1
2013-07-31 21:53:29 +02:00
Latif Khalifa
e4b446217c Enable export menus if anything is exportable 2013-07-31 21:52:01 +02:00
Inusaito Sayori
d1f3acdd28 Fix estate eject/ban via list crash 2013-07-31 15:51:56 -04:00
Inusaito Sayori
f4dc82784f Allow flyout button items to have the label attribute 2013-07-31 15:51:00 -04:00
Inusaito Sayori
04c78a1d8a Merge in Storm-1838 2013-07-31 15:49:34 -04:00
Inusaito Sayori
9676eac3db Add invite to group to the avatar list menus 2013-07-31 12:44:18 -04:00
Inusaito Sayori
246449192f Explicitly check for OpenSimExtras and subfields 2013-07-31 10:30:03 -04:00
Inusaito Sayori
d6b7e61918 Make mSearchURL a SignaledType and add setSearchURLCallback for setting callbacks on it. 2013-07-31 02:55:06 -04:00
Inusaito Sayori
1c447a107e Give SignalType a default constructor that calls the default constructor of Type 2013-07-31 02:53:51 -04:00
Inusaito Sayori
9d47090852 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-07-31 02:28:08 -04:00
Inusaito Sayori
7a1afcabb9 Change modes for llpanelvoiceeffect.* 2013-07-31 02:26:19 -04:00
Inusaito Sayori
41bf9681c4 Introduce menu_avs_list.xml and use it for Active Speakers list, About Land's ban/allow lists, Group profile general tab list, and chat participants lists. 2013-07-31 02:25:35 -04:00
Inusaito Sayori
d0c18bc54c Modernize LLPreviewScript
Should fix Fritigern's recent issues, seems to. (Mainly, the double clicking on script errors not working right thing)
Should also fix that issue someone has brought up in group chat about the delay in our external editor sync in comparison to V3
2013-07-31 02:20:55 -04:00
Inusaito Sayori
c4610214fc Prevent that annoying issue where new scroll list menu flashes in the bottom left corner briefly when created.\ 2013-07-31 01:36:29 -04:00
Latif Khalifa
b4bc9727f1 Confirm to new OpenSimExtras specification of SimulatorFeatures cap
See: http://opensimulator.org/wiki/SimulatorFeatures_Extras
* Moved SupportsExport inside this map to avoid possible
  collision with Linden Lab
* Added the ability for a sim to specify map server
  (Fixes maps after hypergrid jumps)
2013-07-31 04:24:13 +02:00
Latif Khalifa
8cb7c2cb2f Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-07-31 02:45:34 +02:00
Shyotl
353586f631 Missed a couple lines in earlier commit. 2013-07-30 19:41:13 -05:00
Latif Khalifa
bde1ce7577 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2013-07-31 01:53:58 +02:00
Inusaito Sayori
545d104212 Scriptcounter touchup: Fix end when deleting inventory 2013-07-30 11:26:58 -04:00
Shyotl
1c0d86a383 Fix issue displaying material faces with a shine value applied when performing deferred rendering. Also attempt to fix rigged material faces when performing deferred rendering (Todo: test rigged mesh material+(shiny|alpha|alphamask|fullbright) combinations) 2013-07-30 03:01:09 -05:00
Shyotl
8e40d6b52c Added some missing drawpool determination logic pertaining to face materials. 2013-07-29 19:39:59 -05:00
Shyotl
44909af372 Removed CLEAR_INVISIBLE drawable flag. 2013-07-29 19:32:15 -05:00
Shyotl
45b85070f3 A bit of harmless cleanup, null checking, nan checking. Removed sphericalProjection and cylindricalProjection from llface (broken/dead). 2013-07-29 19:23:30 -05:00
Latif Khalifa
e427e1b93f Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-07-30 02:11:02 +02:00
Latif Khalifa
fb3e24cfa3 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-07-30 02:10:50 +02:00
Inusaito Sayori
87be371042 Feature Request: Add shortcut, Ctrl-Alt-Shift-C, for Avatar Rendering Cost 2013-07-29 20:09:38 -04:00
Inusaito Sayori
977adf250b Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-07-29 20:05:52 -04:00
Inusaito Sayori
f6fb0ca8a0 Enable Parcel Ban and Access lists regardless of parcel rights. 2013-07-29 13:41:26 -04:00
Damian Zhaoying
f680c27bdf Merge remote-tracking branch 'Liru/master' 2013-07-29 14:28:33 -03:00
Inusaito Sayori
8680e4599c Satisfy Issue 904: Add option to close appearance floater with Esc
Setting AppearanceCloseOnEscape to true will turn this on.
2013-07-29 13:27:07 -04:00
Latif Khalifa
74c3903393 Always send version and channel to the login page 2013-07-29 19:08:02 +02:00
Inusaito Sayori
258c0da8d3 Apply fix for windows compile warning from internal 2013-07-29 12:42:48 -04:00
Aleric Inglewood
e88a0d2f9f Merge remote-tracking branch 'singu/master' 2013-07-29 00:08:05 +02:00
Aleric Inglewood
694085ab78 Fix crash in LLDrawable::getSpatialBridge
Fixes https://code.google.com/p/singularity-viewer/issues/detail?id=972
2013-07-29 00:05:23 +02:00
Inusaito Sayori
353e2977d6 [Voice Update] Further sync llvoiceclient and llvoicevivox with upstream
Mainly tiny motions to ease merging as viewer-vivox2 work continues
Condenses MultiVoice block
2013-07-27 16:48:35 -04:00
Inusaito Sayori
641067c399 [Voice Update] Apply updates from Viewer-Vivox2
Applies the following commits:
 4c13e7c - Interim version with SLIM removed from voice.
   4c13e7c753
 9cad21a - Thanks mercurial.
   9cad21adc1
   Only the changes that should have been in 4c13e7c (removal of LLVivoxVoiceClient::accountListBlockRulesSendMessage() and LLVivoxVoiceClient::accountListAutoAcceptRulesSendMessage())
 9c94b96 - Removed debugging.
   9c94b96ed3
 ec77595 - Turn off logging.
   ec775958ef
 857cab1 - Kill all the vivox logs
   857cab153e
2013-07-27 16:41:08 -04:00
Inusaito Sayori
2b2a6d5ea6 Touchups to scroll list building
Moved handling of mouse_wheel_opaque and menu_file to setScrollListParameters
Removed setToolTip block from LLScrollListCtrl::fromXML since setToolTip lives inside of LLView::initFromXML which is called by LLUICtrl::initFromXML which was already called at this point
Added support for building columns from xml with relative_width which is synonymous with relwidth
Fixed namelist columns not supporting dynamic_width in xml (dynamicwidth is only acceptable in older xmls)
2013-07-27 16:40:26 -04:00
Damian Zhaoying
4cda1e61c4 Spanish translations updates: new notifications strings 2013-07-27 15:54:59 -03:00
Latif Khalifa
6088ed50a8 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-07-27 17:48:16 +02:00
Latif Khalifa
858e1806eb Make prim media autoplay setting in line with what the other viewers
Turning it on by default
2013-07-27 17:48:01 +02:00
Damian Zhaoying
bfbdd12a7f Spanish translations updates / Radar Menu 2013-07-27 06:25:19 -03:00
Lirusaito
a864acd74b [Radar] Add menu to the radar 2013-07-26 16:30:44 -04:00
Lirusaito
d82a2d0392 Add support for generic list menu listeners
This adds enablers/visiblers: "List.EnableAnySelected" "List.EnableMultipleSelected" "List.EnableSingleSelected" "List.EnableCall" "List.EnableIsFriend" "List.EnableIsNotFriend" "List.EnableMute" "List.EnableOfferTeleport"
This adds click callbacks: "List.CopyUUIDs" "List.OfferTeleport" "List.Pay" "List.RemoveFriend" "List.RequestFriendship" "List.ShowProfile" "List.StartAdhocCall" "List.StartCall" "List.StartConference" "List.StartIM" "List.AbuseReport" "List.ParcelEject" "List.Freeze" "List.EstateBan" "List.EstateEject" "List.ToggleMute"

Exposes LLRegionInfoModel::sendEstateOwnerMessage to the public to avoid further duplicated code
2013-07-26 16:29:28 -04:00
Aleric Inglewood
1475832617 Crash fix in LLPipeline::renderDeferredLighting 2013-07-26 17:32:03 +02:00
Lirusaito
deee31d04a Add LLAvatarActions::copyUUIDs
An adaptation of a similarly named function in Alchemy Viewer
Thanks Alchemy, Thalchemy.
2013-07-26 09:00:40 -04:00
Lirusaito
37669a8abc Add LLAvatarActions::buildResidentsString 2013-07-26 08:59:14 -04:00
Lirusaito
cfaaac3c96 Add LLAvatarActions::showProfiles that takes a vector of uuids, for opening a bunch of profiles at once 2013-07-26 03:20:42 -04:00
Damian Zhaoying
b0c00e1c15 minor spanish translations updates 2013-07-26 01:50:05 -03:00
Lirusaito
5bc9ce41c7 Feature Request: Add an option to disable camera resetting upon motion
Adds View->Motion Resets Camera, and keyboard shortcut Alt-Shift-R
Adds debug setting SinguMotionResetsCamera
2013-07-25 23:39:32 -04:00
Lirusaito
e03d469bcf Feature Request: Provide a way to open SLURLs without needing to post them in chat
Adds chatbar as commandline command /open, which also allows opening urls as a bonus.
2013-07-25 12:43:22 -04:00
Lirusaito
b16072b640 Feature Request/Bug Fix: Restore the old behavior of allowing mapto region/x/y/z for specifying coordinates
Also swaps settings to be alphabetical, forgot to save that change before last commit.
2013-07-25 12:39:22 -04:00
Lirusaito
fe65520794 Color improvement for radar shout range color for skins that don't override the default, contributed by Aquafox Ruggles 2013-07-25 08:15:18 -04:00
Lirusaito
389cf5399e Feature Request: Create landmarks with the legacy style names: Parcel, Region (x, y, z) 2013-07-25 08:06:49 -04:00
Lirusaito
b1004f9f53 Patch from internal: Keep gWindowTitle consistent with the window title. 2013-07-25 06:41:52 -04:00
Lirusaito
b17b0615c6 Another stab at fixing bridge autodetach 2013-07-25 06:40:44 -04:00
Damian Zhaoying
ccddd13631 Fix and Update some spanish UI files 2013-07-25 04:45:14 -04:00
Damian Zhaoying
a248d8c3c0 update and fix spanish translations
Conflicts:
	indra/newview/skins/default/xui/es/floater_customize.xml
2013-07-25 04:44:58 -04:00
Aleric Inglewood
779cc82750 Stop viewer from flooding the server.
On a parcel with voice disabled, the viewer keeps requesting voice info
every two frames, cycling between states stateNoChannel and
stateRetrievingParcelVoiceInfo.

This commit fixes that: if voice is disabled on the parcel then mAreaVoiceDisabled
is set (because the url is empty) and we stop requesting voice info until the parcel changes again.

If voice is enabled while we are in the stateNoChannel then we drop
out of that because mNextAudioSession gets set (to stateJoiningSession).

If the viewer has voice disabled, then now it drops correctly
out of the stateNoChannel into stateDisabled.
2013-07-23 21:31:53 +02:00
Aleric Inglewood
f154ff8f8a Crash bug fix.
I ran into this on opensim.
The value of 'bucket' passed to parse_lure_bucket was empty.

In general, we should check we HAVE eight tokens, and not
just keep incrementing the iterator without checking.
2013-07-23 21:29:35 +02:00
Latif Khalifa
bd88b91b42 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-07-23 14:53:47 +02:00
Latif Khalifa
b129108245 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-07-23 14:53:38 +02:00
Lirusaito
b082bc5056 Support <string name="foobar" value="foobar "/> in panel classes, like upstream 2013-07-22 23:58:03 -04:00
Lirusaito
8b5a654c5b General cleanup of LLFloaterCustomize 2013-07-22 23:50:03 -04:00
Lirusaito
4e63a64a1d Feature Request: Add tooltip to Save Outfit button showing where it will save to
Adds refreshCurrentOutfitName() from upstream
2013-07-22 23:49:19 -04:00
Lirusaito
989e4332b7 Feature Request: Setting to disable lighting change of appearance mode 2013-07-22 23:02:02 -04:00
Lirusaito
d64c9a343c Fix issue of columns not sorting in ascending order by default 2013-07-22 20:02:45 -04:00
Aleric Inglewood
dcf1cdbc4e Move export permission check to LLPermissions, try two.
Removes code duplication.

Several parts of the code ignored the PERM_EXPORT but
and still did demand that things are full perm next
to being a creator. This has now changed the export
rules are the same for everything as they were for mesh:
you need to be the owner and the creator for every element
that is exported (not just the root prim, of course).
2013-07-22 22:48:42 +02:00
Aleric Inglewood
be6699198f Revert "Handle PERM_EXPORT in LLPermissions."
This reverts commit 9c71afe73e.
2013-07-22 19:49:00 +02:00
Latif Khalifa
e60032da6f Default service for Singularity pages is on Github 2013-07-22 18:42:33 +02:00
Latif Khalifa
b70c306e5f Pass-through login splash page that allows update notifications.
Page source: https://github.com/singularity-viewer/login-page
2013-07-22 16:31:20 +02:00
Latif Khalifa
fe49fe1928 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-07-22 16:11:48 +02:00
Latif Khalifa
b3c0a693f1 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-07-22 16:11:31 +02:00
Aleric Inglewood
937322cc93 Update wearable import to use the new export data.
Better/more notifications.
No longer applies UUIDs of textures exported on a different grid,
except for secondlife <--> secondlife_beta, but with a warning.
2013-07-22 02:34:25 +02:00
Aleric Inglewood
9c71afe73e Handle PERM_EXPORT in LLPermissions.
This moves all export test code to where it belongs:
in LLPermissions.

Added LLPermissions::allowExportBy, next to
allowModifyBy, allowCopyBy and allowMoveBy.
Then changed all code to use this call.

Because LLPermissions is part of llinventory, I had
to add a proxy for LFSimFeatureHandler.
Added a new class LFSimFeatureHandlerInterface that can be
used by LLPermissions to check simulator features by
accessing the LFSimFeatureHandler singleton.

Several parts of the code ignored the PERM_EXPORT but
and still did demand that things are full perm next
to being a creator. This has now changed the export
rules are the same for everything as they were for mesh:
you need to be the owner and the creator for every element
that is exported (not just the root prim, of course).

Export rules can now be easily made a function on
simulator features. If different rules apply for different
types (wearables, objects, mesh etc) then an extra variable
indicating the type will have to be passed though.
2013-07-22 02:22:21 +02:00
Lirusaito
c3b4ceff97 Fix venusmari's issue of not being able to drag and drop calling cards to people via profile or IM 2013-07-21 12:48:57 -04:00
Lirusaito
f98f1e9f5d [Radar] In expireAvatarList, use the return value of erase 2013-07-21 09:59:35 -04:00
Lirusaito
799b5408e4 [Radar] Fix up expireAvatarList to actually expire all the dead avatar entries, not just the back one. 2013-07-21 04:57:33 -04:00
Lirusaito
845088166a [Radar] Switch from using frames in keeping track of ranges to using a bitset
Renames ALERT_TYPE_* to STAT_TYPE_* and ERadarAlertType to ERadarStatType
Removes mIn*Frame and accessors for these in favor of checking for the bit in mStats
Use mStats instead of mAgeAlert now.
Moves the range leave handling out of getAlive and into setPosition, where it logically belongs

Should fix Issue 43: Radar reports multiple times for agent entry upon rendering
2013-07-21 04:43:01 -04:00
Lirusaito
3650a56407 [Radar] Remove id null checks where null id is an impossibility due to earlier checks 2013-07-21 02:06:57 -04:00
Lirusaito
82c37ca9a3 [Radar] Remove unused member mDrawPosition 2013-07-21 01:24:58 -04:00
Lirusaito
6fb68b4913 [Radar] Add a debug setting RadarRangeRadius to limit how far away avatars showing up on radar can be (0, the default, is unlimited) 2013-07-20 23:16:29 -04:00
Lirusaito
2d55b1ab1c [Radar] Condense updateAvatarList to have less duplicate code 2013-07-20 23:07:04 -04:00
Lirusaito
98813c75f3 [Radar] Remove duplicate code from updateAvatarList that was already performed during LLWorld::getAvatars 2013-07-20 23:02:14 -04:00
Lirusaito
72a335daf0 [Radar] Move avatar age block into processProperties as this is more logical 2013-07-20 22:52:50 -04:00
Lirusaito
414ffb3a94 Further attempt to fix Issue 929 by having the appearance manager remove the attached bridge item 2013-07-20 13:59:15 -04:00
Latif Khalifa
742d36a79f Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-07-20 18:36:40 +02:00
Aleric Inglewood
85ff52be30 Bug fix: circumvent using LLs notify system.
Can't use LLs LLFolderViewItem::rename from
LLInventoryPanel::modelChanged because it's nonrobust spaghetti code
and causes randomly sized loops.

Also cleaned up the number of unused nameOrDescriptionChanged functions
introduced in a previous commit.
2013-07-20 18:28:52 +02:00
Latif Khalifa
d012c822a2 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-07-20 08:14:23 +02:00
Lirusaito
791266fc27 Moved age alert and title changing blocks out of refreshAvatarList and updateAvatarList to fix them not working as well as they should 2013-07-19 23:56:20 -04:00
Lirusaito
ed1dbfaa81 Switch the IM and teleport callbacks of right-clicked inventory calling cards to LLAvatarActions
This is partially in attempt to reduce possible suspects for Issue 936: Talking to users with the lastname Resident sometimes creates logs without the delimiting space stripped out
2013-07-19 20:34:39 -04:00
Lirusaito
b2522a06b4 Attempt to fix Issue 929: [Regression] Automatic Bridge Detach does not work 2013-07-19 19:54:11 -04:00
Aleric Inglewood
7162214c01 Bug fix for last commit 2013-07-20 00:44:05 +02:00
Lirusaito
b4d33fe0e1 Fix up some logic with always allow fly
The fly button on the toolbar would enable itself despite RLVa restrictions
 - This was because always fly was checked after gAgent.canFly(), despite the fact that gAgent.canFly() itself checks always fly setting at the correct time.

When teleporting to a region that blocks flying, the agent would start flying due to a strange check inherited from upstream.. My opinion is, they want gods to fly, but that's kinda strange too, so I've changed it to set flying false in this case.
2013-07-19 18:10:02 -04:00
Lirusaito
ab19bfb70e Don't open inventory offers if busy, busy means busy. 2013-07-19 17:53:20 -04:00
Lirusaito
fe8df82c8d Allow autoaccept to work when in busy mode by handling it first 2013-07-19 17:24:24 -04:00
Lirusaito
4dd0daa942 Feature Request: Ability to automatically accept all inventory offers
Replaces the exposed setting in popups preferences
However, for users wanting the old behavior of just landmarks, notecards, and textures being automatically accepted, the original setting(AutoAcceptNewInventory) stays as is, it can be turned on and off in debug
2013-07-19 17:05:07 -04:00
Lirusaito
c0c561c605 Tiny changes to have llviewermessage.cpp line up better with upstream 2013-07-19 16:24:41 -04:00
Lirusaito
7912eb1748 Update rlva (mainly in llviewermessage.cpp) 2013-07-19 16:17:34 -04:00
Aleric Inglewood
67a75ab4b6 Fix link problem: link with libboost_date_time-mt 2013-07-19 22:15:31 +02:00
Aleric Inglewood
611c4bd5fa Merge remote-tracking branch 'singu/master' 2013-07-19 21:26:55 +02:00
Aleric Inglewood
325ef60a8c Wearable export improvements.
Add grid nick to default filename.
Add grid nick and date to exported XML.
Add inventory path, name and description of item to exported XML.
2013-07-19 21:22:59 +02:00
Aleric Inglewood
1fdb36cc40 Actually use mask in LLInventoryView::changed 2013-07-19 21:20:21 +02:00
Aleric Inglewood
95a228b2e9 Actually use LLWearable::mDescription.
Set LLWearable::mDescription and keep it up to date.
This allows to export (and import) the description of wearables.
2013-07-19 21:17:42 +02:00
Lirusaito
3be04fc90b Attempt to solve Issue 935: Script Chat Show The Owner? 2013-07-19 10:41:19 -04:00
Aleric Inglewood
66ef619415 Bug fix: Update name of worn wearable when changing the name in the Properties floater of an inventory item. 2013-07-19 16:13:48 +02:00
Lirusaito
7f57dd24d8 Satisfy Issue 852: Implement way to stop\start single non-fullperm script in modiable objects 2013-07-19 08:45:30 -04:00
Lirusaito
863c35710f Feature Request: Add an option to keep last name Resident.
Should work to solve Issue 517: Legacy log handling of "Resident" name
2013-07-19 07:16:51 -04:00
Lirusaito
aaf010da4c Feature Request: Make new ARC threshold change based on debug setting
Adds LiruNewARCLimit debug setting
2013-07-19 07:07:26 -04:00
Lirusaito
663d0a29f2 Attempt to satisfy Issue 82: Idle status in nametags doesn't always update properly 2013-07-18 23:19:34 -04:00
Lirusaito
85e667bb35 Don't use mAvatarNameCacheConnection, because it does indeed lead to partially populated namelists as predicted 2013-07-18 21:55:18 -04:00
Latif Khalifa
a74b8ddc6b Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-07-19 01:05:30 +02:00
Lirusaito
5286276d71 Fix names not appearing on the group inviter 2013-07-18 19:01:10 -04:00
Lirusaito
fc7cdc016a Added menu listener for showing things on non-SL grids. 2013-07-18 18:53:52 -04:00
Aleric Inglewood
d21b3cb19b Enforce a 60s reply delay for LLEventPollResponder 2013-07-19 00:47:56 +02:00
Lirusaito
ceb9c99736 Allow right clicking anywhere on a scroll list for a menu, except the header buttons 2013-07-18 15:51:28 -04:00
Lirusaito
306e587ae9 Fix the issue with having a column labeled "1" put on the end of the search results for places and land sales
Apparently when you skip a number for an LLSD, when it becomes a param that number translates to the expected field in all its emptiness
Since the column didn't exist in the scrolllist, a new one was added to the end
2013-07-18 12:49:50 -04:00
Lirusaito
813bb5cc7f Don't send busy respond message when to_id is null, it will confuse the respondee 2013-07-18 10:14:29 -04:00
Lirusaito
080b807e38 Bug Fix: Don't use an empty string for the session name/label of autoresponse stuffs, that tries to log to nameless file. 2013-07-18 09:49:15 -04:00
Lirusaito
9db44e67e8 Oopsies, misplaced busy response block 2013-07-18 08:35:10 -04:00
Lirusaito
a5b8c173ac Do not autorespond when incoming message is to everyone (null to_id) 2013-07-18 08:06:37 -04:00
Lirusaito
f1e792fde0 Separate busy response block from autoresponse, and use busy_message() function to avoid duplicate code 2013-07-18 08:05:11 -04:00
Lirusaito
90590e20ec Fix issue with busy response to certain message types not respecting busy response settings such as wildcard resolution 2013-07-18 08:00:19 -04:00
Lirusaito
780019f0d6 Fix the About Land->Objects list 2013-07-18 06:44:17 -04:00
Lirusaito
d631ae8072 Add support for scrolllists with menus
In xml menu_file attribute can point to the file
In code, setContextMenu can take a prebuilt menu
2013-07-18 06:04:17 -04:00
Lirusaito
8d87d3410e When the mouse leaves a scroll list, don't leave the mouse-over highlight shown 2013-07-18 04:58:29 -04:00
Lirusaito
baef50e451 Feature Request: Add the ability to see count of avatars in regions on the map without needing to hover
Adds LiruMapShowAvCount, which must be set true for this to work.
2013-07-17 13:49:05 -04:00
Lirusaito
52544f020e Update RLVa bits in LLWorldMapView 2013-07-17 13:40:15 -04:00
Lirusaito
2b7c70d765 Update lsl stuffs (Adds support for all the new stuff we'd fallen behind on) 2013-07-17 12:59:01 -04:00
Lirusaito
a1d9473fde Move ScriptQuestion strings from floater_chat_history.xml to strings.xml 2013-07-17 11:56:02 -04:00
Lirusaito
ede1282307 Feature Request: Support the expected behavior of F1 opening a browser for those who are used to this 2013-07-17 11:18:25 -04:00
Lirusaito
4b7a9dbd22 Commenting out Second Life Help menu entry until we decide what to do with it 2013-07-17 11:11:58 -04:00
Lirusaito
d7dddd29aa Feature Request: Add Ctrl-Shift-E for edit linked parts 2013-07-17 10:43:30 -04:00
Lirusaito
cf8fe0c721 Actually fix combobox arrow positioning issue 2013-07-17 09:08:34 -04:00
Lirusaito
037b341931 When building media settings floater, don't open it. This fixes the annoying clicking sound whenever one would begin editing. 2013-07-17 03:21:23 -04:00
Lirusaito
56fd2f8bba Touch up debug settings filter_editor 2013-07-17 02:48:39 -04:00
Lirusaito
a61d88c701 Don't setText to gibberish when building a search_editor or filter_editor fromXML 2013-07-17 02:43:53 -04:00
Lirusaito
bee21033b8 Fix Last Owner button on inventory item properties not working 2013-07-17 02:07:55 -04:00
Lirusaito
76f0f42f20 Update LLNameListCtrl, mostly to use Params for its elements 2013-07-17 02:07:17 -04:00
Lirusaito
c35a1c36e9 Translate "No group data found for group " with strings.xml string NoGroupDataFound 2013-07-16 20:40:58 -04:00
Lirusaito
300a23b6ad Portuguese translation was falling too far behind, to avoid hassle, strings.xml and notifications.xml are now near identical to upstream 2013-07-16 20:23:01 -04:00
Lirusaito
c89a245323 Feature Request: Add Profile button to friendship offer notices 2013-07-16 17:34:36 -04:00
Lirusaito
fb22cfc6db Fix name lists being derpy due to an apparent parsing failure 2013-07-16 17:29:57 -04:00
Lirusaito
d3d5f00453 Retro skin 2013-07-16 17:04:53 -04:00
Lirusaito
fcfa488cb5 Suppress warnings caused by additional parameters used in namelistitems not being convertible to scrolllistitem params 2013-07-16 11:54:05 -04:00
Lirusaito
887efcea14 Save personal attachments to mesh formats without having to drop them first 2013-07-16 11:02:32 -04:00
Latif Khalifa
817ce372a9 Build fix 2013-07-16 16:46:36 +02:00
Latif Khalifa
5dc0ba1712 ColladaExport: move root library nodes outside the loope 2013-07-16 16:27:32 +02:00
Latif Khalifa
01a675de0f ColladaExport: made face transparency compatible with SL mesh import 2013-07-16 16:27:31 +02:00
Latif Khalifa
1852656661 ColladaExport: Added support for per-face materials 2013-07-16 16:27:31 +02:00
Latif Khalifa
b844b63f72 Factor out some common code when saving <source> element 2013-07-16 16:27:31 +02:00
Latif Khalifa
e0473b5292 Avoid crashing when trying to export non-volumes 2013-07-16 16:27:30 +02:00
Latif Khalifa
dc24e1b038 Merge remote-tracking branch 'lirusaito/master' 2013-07-16 16:26:53 +02:00
Lirusaito
bc753455df French Translation Update by Nomade Zhao 2013-07-16 10:19:14 -04:00
Lirusaito
f9304faaec Merge branch 'master' of https://github.com/LightDrake/SingularityViewer 2013-07-16 09:50:58 -04:00
Lirusaito
824bec5d69 Two scrolllist update scraps find a home in this commit 2013-07-16 09:45:00 -04:00
Lirusaito
599704cf40 Display tooltip for scrolllist when not over headers or cells 2013-07-16 09:42:54 -04:00
Lirusaito
f05fa67786 Fix column header tooltips showing up when not over the header itself 2013-07-16 09:40:33 -04:00
Lirusaito
1b734e190c Scroll List Classes Params
Params for LLScrollListCell, LLScrollListItem, and LLScrollListColumn
Moves code block for creating a LLScrollListCell out of LLScrollListCtrl::fromXML and into LLScrollListCell::create
Removes mDefaultListTextColor from LLScrollListCtrl, it is now used only in LLScrollListCell::create
Adds LLScrollListCtrl::addRow and LLScrollListCtrl::addColumn functions that take these Params
Separators are now built from an icon.. we may want to tweak it in the future, looks alright though

LLFloaterAvatarList::refreshAvatarList now builds elements with these Params instead of by LLSD
2013-07-16 09:33:26 -04:00
Lirusaito
af15010c79 Make radar string "Out Of Range" translatable 2013-07-16 08:04:38 -04:00
Lirusaito
67970ab2db Allow tooltips for any scrolllist cell
Finally the radar activity icons have working tooltips to explain their meanings
This probably won't do anything until Params are plugged in, though.
2013-07-16 06:58:17 -04:00
Lirusaito
7113916d74 Prevent the radar from dividing by zero (May not be an issue yet) 2013-07-16 05:46:30 -04:00
Lirusaito
4b210c1bbf Tiny update to voice code to avoid falling behind the Lindens
Adds support for secondlife:///app/voice SLapps
2013-07-16 05:41:14 -04:00
Lirusaito
d497e0d10e Remove ancient emerald metadata commented out code from radar 2013-07-16 05:34:09 -04:00
Lirusaito
54bc9e18a9 Take advantage of the LLButton constructor for setting defaults of LLScrollColumnHeader 2013-07-16 05:32:11 -04:00
Lirusaito
3052bb38e6 Update llfloatertopobjects in preparation for using Params in certain scrolllist classes 2013-07-16 05:08:44 -04:00
Lirusaito
c261eb7433 Remove final parameter from LLScrollListCtrl::addStringUUIDItem, it was unused. 2013-07-16 00:56:40 -04:00
Lirusaito
9b92b51b2c Fix internal issue of column headers not displaying tooltips 2013-07-16 00:52:59 -04:00
Lirusaito
cee9e976b1 Remove unused function LLScrollListCtrl::setDisplayHeading 2013-07-15 22:31:38 -04:00
Lirusaito
cb01bbb8ef Move tooltip hosting from llscrolllistitem to llscrolllistcell 2013-07-15 22:24:34 -04:00
Lirusaito
1ef0cba32c Fix internal issue with scroll column header font 2013-07-15 01:57:28 -04:00
Latif Khalifa
1c2cdd4166 Work in progress: Collada export 2013-07-15 06:38:12 +02:00
Latif Khalifa
6d1b4c5b27 Merge remote-tracking branch 'aleric/master' 2013-07-15 06:31:08 +02:00
Aleric Inglewood
6fd0baae5d Bug fix: don't get web profile when grid does not support that. 2013-07-15 02:38:10 +02:00
Lirusaito
75c4503a46 Derive LLScrollColumnHeader from a button
Fixes the issue with single-click sorting not working
Fixes internal issue with initial column header names being used as their labels
2013-07-14 17:27:51 -04:00
Drake Arconis
a9d23a049c Fix ugly left and right arrows in silver skin 2013-07-13 23:49:27 -04:00
Latif Khalifa
085947a557 Merge remote-tracking branch 'shyotl/master' 2013-07-14 02:38:13 +02:00
Shyotl
bec3ba985e DIFFUSE_ALPHA_MODE_BLEND flag should disable auto-alphamasking on applicable face. 2013-07-13 19:36:33 -05:00
Lirusaito
02253563ce IRC Feature Request: Show Last Owner in item properties
Translators should add these new bits (floater_inventory_item_properties.xml_
(also tossed in xml change I should've staged in 4da47de90c)
2013-07-13 17:40:19 -04:00
Lirusaito
4ef32a3805 Sync more stuff with upstream! (Mainly updates stuff involving LLFloaterGroupPicker)
Updates llfloatergroups to be a lot similar to upstream
- Adds LLFLoaterGroupPicker::removeNoneOption and changes LLFloaterGroupPicker to use modern style callback
- Switched from using per ui xml string for the none entry in groups to the strings.xml one, updated and cleaned existing translations to use this.
- Changes LLFLoaterGroupPicker into an instance tracker by id, because it was already acting like one.
Updates llpanelpermissions RLVa bits and fixes last owner label never enabled
2013-07-13 17:28:09 -04:00
Lirusaito
ffe403e0f0 Update administrative tools code from upstream
Updates LLFloaterTopObjects code to have parcel filter(STAT_FILTER_BY_PARCEL_NAME) and use the CallbackRegistrar
Top Objects XML (and Translation) bits updated in part from Firestorm, as LL Viewer lacks certain buttons and the old xml was too far behind
- Translators may want to have a look at this... although you sorta need to have estate powers for it to be of any worth... *sigh*
Updates LLFloaterGodTools to use CallbackRegistrar
2013-07-13 16:38:20 -04:00
Lirusaito
cf2f455430 Update LLFloaterInspect, updates RLVa code, fixes inspect not always working at first 2013-07-13 15:40:45 -04:00
Lirusaito
4da47de90c Sync with upstream, improve RLVa and make use of the callback registrar 2013-07-12 18:43:59 -04:00
Lirusaito
c77f0de9cf Refactor LLScrollList* and relatives
Breaks out llscrolllistcolumn, llscrolllistcell, and llscrolllistitem from llscrolllistctrl and llflyoutbutton from llcombobox
2013-07-12 17:47:01 -04:00
Shyotl
94ab22f6d6 Cursory materials alphamask parameter support (and only alpha mask) 2013-07-12 16:41:36 -05:00
Shyotl
e4da971026 Hooked up underlying material fetching mechanism and added material-related structures. Not integrated into rendering pipeline. 2013-07-12 13:56:31 -05:00
Latif Khalifa
5669b01873 Ask for confirmation of partial Wavefront exports
Fix some signed/unsigned warnings
2013-07-12 09:50:04 +02:00
Latif Khalifa
c769510c6f Merge remote-tracking branch 'lirusaito/master' 2013-07-12 08:15:05 +02:00
Latif Khalifa
77f77b03b0 Merge remote-tracking branch 'shyotl/master' 2013-07-12 07:23:27 +02:00
Shyotl
ccff8475c1 Mesh vertex corruption fix taken from LL upstream. 2013-07-11 20:54:04 -05:00
Shyotl
6be6f488ba Added setting to toggle autoplaying of prim media, independent of parcel media. Audio autoplay also now yieds to sounds being stopped via nearby media panel. 2013-07-11 20:53:12 -05:00
Lirusaito
1398d8afbc Remove two unused LLScrollListItem::addColumn and LLScrollListIcon constructor via LLUIImagePtr. 2013-07-10 21:12:58 -04:00
Lirusaito
6d32a39544 Remove unused LLScrollListLineEditor class 2013-07-10 19:54:13 -04:00
Lirusaito
781bb288ab Removed "textbox autofix" from translations and llpanelface.cpp, syncs up with Materials and fixes warnings 2013-07-10 19:26:31 -04:00
Aleric Inglewood
6a7f7bf4de Oops - forgot something in last commit.
Now it works :). Tested with ssb too.
2013-07-11 00:31:21 +02:00
Aleric Inglewood
df71d4518e Merge remote-tracking branch 'singu/master' 2013-07-10 21:31:49 +02:00
Aleric Inglewood
96b5f7bdc8 Add wearable exporting / importing in linden_genepool format.
As importing has been broken for a long time, I decided to
hijack the existing (broken) buttons of the Appearance floater
for the following new implementation:

The currently selected wearable, if full perm and the agent
is owner (of course) and creator, then that wearable can be
exported to disk with AIFilePicker in the context "archetype".

The used format is now XML, linden_genepool version 1.0, the
same format that is used when saving from Advanced --> Character
--> Character Tests --> Appearance to XML in any viewer.
However, unlike that Advanced option (which normally only
works when DebugAvatarAppearanceMessage is set to TRUE, ie in
the official Linden Viewer; but that does a lot more, most
likely unwanted things: it causes to dump files in this format
to the LL_PATH_LOGS directory whenever appearance data comes
by and other stuff for debugging purposes only), now ONLY the
selected wearable is written to the file. In the case of multiwear
with several layers, that means the selected layer, as well.

When importing these XML files again, only the selected
wearable/layer is overwritten (assuming it is modifiable) with
the data in the file that corresponds to that wearable (if
the file contains data of another wearable then nothing happens).

Note that this file format can be read by blender-avastar:
Using this feature to save the shape you created in SL will
allow you to import that into blender. Likewise, a shape created
or modified in blender can be imported into SL using this feature.
2013-07-10 21:19:42 +02:00
Aleric Inglewood
b97caa77d4 Add versioning support to AIFilePicker.
When saving a file, if the suggested filename has the form
PREFIX?000.EXT then the viewer checks if that file already
exists and if so, increments the number until it finds a
name that does not already exist (in the suggested directory).
The '?' is replaced with an underscore.

This allows to fast saving of the same data without overwriting
previous data.
2013-07-10 21:19:04 +02:00
Lirusaito
dfb4370a56 Remove iamHereLogin remnants overlooked in 62f03bc489 2013-07-10 08:12:13 -04:00
Lirusaito
7e874d7d56 Fix Issue 931: When viewing the profile of a muted avatar, the Mute button should be changed to Unmute 2013-07-10 07:35:50 -04:00
Lirusaito
742ccdcf0c Touched up awavefront once more to conform to permissions and be used as intended
Added debug settings OBJExportNotifyFailed and OBJExportNotifySuccess for whether or not to notify about OBJ Exports failing or succeeding respectively
Moved exports back into tools submenu, there's not enough variety to justify a menu dedicated to exportation
Removed hardcoded "Insufficient Permissions" string, there's already a notification for this.
Implemented proper permissions checking, along with own Avatar Export.
2013-07-10 06:30:19 -04:00
Shyotl
8f3c1af82d Fixed textentry combobox arrow positioning issues. 2013-07-10 02:15:47 -05:00
Latif Khalifa
8e503f2596 Added Wavefront OBJ format exporter
Exporter written by Apelsin:
https://github.com/Apelsin

TODO: Hookup avatar export
2013-07-09 22:04:27 +02:00
Aleric Inglewood
4779f91d5d Fix Appearance Import button.
Params are driven by wearable; changing the base character gets
overwritten real quick.

Fixed to call the appropriate LLWearable::setVisualParamWeight.

I didn't test this in the light of multiwear -but it works for
the shape, which is good enough.
2013-07-09 03:09:06 +02:00
Latif Khalifa
62f03bc489 Fix loading the splash page from some broken OpenSim servers
Remove HTTP HEAD request that was made before the attempt to load
the splash web page before the URL was handed over to the WebKit
plugin
2013-07-08 21:18:09 +02:00
Latif Khalifa
f9b174c1c2 Merge branch 'master' of https://github.com/MelanieT/SingularityViewer 2013-07-08 17:54:57 +02:00
Aleric Inglewood
6103cb23e6 Allow people to login again. 2013-07-08 17:25:06 +02:00
Aleric Inglewood
d725be37f9 Merge remote-tracking branch 'singu/master' 2013-07-08 02:05:09 +02:00
Aleric Inglewood
fcf099a115 Add file picker for issue 630 2013-07-08 00:57:03 +02:00
Aleric Inglewood
ebfbdac5ab Compile error work around. 2013-07-07 23:37:05 +02:00
Melanie
d43d103870 Remove the untranslated credits and licenses and the empty elements from the German translation. 2013-07-07 04:27:51 +02:00
Melanie
c20cffa33d Change "Object say, text" to "Object: text" like it used to be. The former is just bad english. 2013-07-07 04:25:48 +02:00
Apelsin
a5edfdd376 Non-MO adjustment
(Gross typo)
2013-07-06 08:37:11 +02:00
Apelsin
9226c65e0c Disable this by default... 2013-07-06 08:25:46 +02:00
Apelsin
7439f48223 Featurebug
=== Pull request version ===
Re-enabled fix for avatar body invisibility featurebug (archaic)
Added option to adjust maximum attachment span with settings
Added option to enable automatic derendering of huge attachments (use with care)

Conflicts:
	indra/newview/app_settings/settings_effervescence.xml
2013-07-06 08:25:10 +02:00
Aleric Inglewood
ad6c539609 Crash fix 2013-07-06 00:06:51 +02:00
Aleric Inglewood
008a0936da Compile fix 2013-07-05 23:55:20 +02:00
Latif Khalifa
f1e493291a Merge remote-tracking branch 'shyotl/master' 2013-07-05 22:37:13 +02:00
Latif Khalifa
a329928dcd Merge remote-tracking branch 'melanie_t/master' 2013-07-05 22:36:52 +02:00
Latif Khalifa
f2323c0c83 Merge remote-tracking branch 'aleric/master' 2013-07-05 22:36:35 +02:00
Shyotl
bbb0bd54bf Fixed location combobox not updating properly when a slurl link is clicked. Reset the location combobox when a different grid is selected (added setCurrentGridChangeCallback to hippogridmanager). Moved login panel elements into a layout_stack so hiding the grid or location columns no longer leaves big empty gaps. 2013-07-05 02:28:36 -05:00
Melanie
5395de3e34 Add german translation preview (81% complete) 2013-07-05 06:11:19 +02:00
Shyotl
624141a31a A break was missing from case logic in LLPanelLogin::onUpdateStartSLURL 2013-07-03 17:21:45 -05:00
Shyotl
7f981e6f17 'Typeregionname' combobox should have an empty value. Was hosing up logic in LPanelLogin::onUpdateStartSLURL. 2013-07-03 17:19:39 -05:00
Shyotl
c82ac0b0af Added several missing mouse-event callback signals to LLUICtrl 2013-07-03 17:18:26 -05:00
Shyotl
0219186106 Use SHGetKnownFolderPath on vista/win7/win8, instead of deprecated SHGetSpecialFolderPath. 2013-07-03 17:16:37 -05:00
Shyotl
8310575fc3 added LLProgressView::abortShowProgress. Issue upon failed login to terminate pending loginpanel destruction which was killing the actual 'new' replacement loginpanel instead of the old to-be-deleted version. 2013-07-03 17:15:30 -05:00
Shyotl
4455dd7eff When requesting an avatar reload, also reload all attachments (prior to this it was not possible to actually reload attachments on non-agent avatars) 2013-07-03 17:13:11 -05:00
Shyotl
b3d97b0860 Avoid running the motionblur shader if there hasn't been camera movement. Also clamp per-frame fragment velocity to reduce visual artifacts. 2013-07-03 17:12:12 -05:00
Aleric Inglewood
4b0b83797c CURLIO (and libcwd): add number of established connections to http console.
I need to parse the debug output of libcurl for this, and choose
to not do that for a Release build - at which point it makes little
sense to even do it for a Debug build, since also the Alpha release
are 'Release'. Even though it would probably have no impact on FPS,
there would be like two persons looking at that number and understanding
it.
2013-07-04 00:02:28 +02:00
Aleric Inglewood
e0c66138c7 Increase connect timeouts for capabilities that demand short transfer times.
The automatic adjustment sets the connect time to 3 seconds, which might
be a bit on the short side sometimes.

Also remove the HACK and use CurlTimeoutConnect again.
The default is still 10 seconds, but is overridden to be 30 for mesh
now (which needs a reconnect for every mesh, since LL does not support
connection reuse for mesh). Note that I never saw any successful
connect under 8 seconds while I had the connect time out at 30:
Over 8 seconds is a sure fail (except for mesh, where in rare cases
there were connect times of 15 seconds (never 14 or 16).

On quiet servers, the connect time is normally sub-second. This is
the bulk of connections for my own SL use.
2013-07-04 00:02:28 +02:00
Lirusaito
e9ce1a6357 Whoops, source code shouldn't be executable. 2013-07-03 05:49:50 -04:00
Lirusaito
d623fd37cc Feature Request: Web Search Tab in Legacy Search! 2013-07-03 05:44:48 -04:00
Lirusaito
27145699bf Update/cleanup llpanelpermissions 2013-07-02 19:05:53 -04:00
Lirusaito
92633b8c65 Solve Issue 907: Build -> Objecttexture -> Searchfield-activation 2013-07-02 04:22:59 -04:00
Lirusaito
e199d5f867 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-07-01 21:13:11 -04:00
Lirusaito
1de076c9c0 Fix two bugs for web search
1. When web search was open, because it had no id, it would steal the links clicked for the in-viewer browser, now it identifies as search and will not.
2. Work around an oddity with the browser being unresponsive to certain category only slurls, by temporarily removing the expected behavior of it returning as last seen when reopened (no setVisible(false) in onClose, just close out as normal)
2013-07-01 21:10:06 -04:00
Aleric Inglewood
6ee1bf3fae Merge remote-tracking branch 'singu/master' 2013-07-02 02:13:03 +02:00
Aleric Inglewood
59716ba86b Added progress meter in HTTP debug console. 2013-07-02 02:12:34 +02:00
Lirusaito
e0dd871a96 Fix Issue 706: 4000Alpha terrain downloads fail 2013-07-01 16:57:35 -04:00
Lirusaito
4572c556f7 Fix Issue 630: Appareance to XMl don't work
Removes the enable callback for Appearance To XML, LL no longer has that hooked in, why should we?
Tested and confirmed to work with or without DebugAvatarAppearanceMessage the same way.
2013-07-01 16:54:29 -04:00
Lirusaito
11c311cd49 Optional V3 Web Search and support for search SLURLs
Added "Use web-based search instead of legacy v1 search" checkbox to System->General preferences

Unified all functions to display search floater into toggle_search_floater and LLFloaterSearch::showInstance
Added UseWebSearch and UseWebSearchSLURL debug settings for flexible configurations
- SLURLs with legacy search cannot always present the same results as web
Added SearchURL debug setting, a separate setting from the one used in the all tab, slightly different and always set by response["search"] on OSGrid logins to detect if websearch is supported
Cleaned up llfloaterdirectory includes and added "Search.WebFloater" to the CommitCallbackRegistrar in case we ever want to add a button or something to open web search (couldn't find a nice place for it, sadly), also added more functions to show specific tabs and performQueryOn to search a tab with specific query on LLPanelDirBrowser's
2013-07-01 16:17:46 -04:00
Aleric Inglewood
0353498b9c Set CURLOPT_FORBID_REUSE for XMLRPCResponder
XMLRPCResponder is used to login, which is a HTTP 1.0 server
that doesn't support reuse of connections.
It's cleaner to close connections from our side too.

This changes,
0x7fffdcf93700   CURLIO      0x7fffcd86db40   * Connection #0 to host login.agni.lindenlab.com left intact
into
0x7fffdcf93700   CURLIO      0x7fffcd8b0bd0   * Closing connection #0
2013-07-01 15:44:47 +02:00
Aleric Inglewood
982921e495 Add AICurlTimer - timer support for the curl thread.
Not used yet. Deliberately not threadsafe.
Usage the same as AIFrameTimer, upon which is was based.
2013-07-01 15:41:44 +02:00
Lirusaito
609dba3926 Update Floater World Map, add support for worldmap and maptrackavatar slurls (Find on map and show pick on map in web profiles)
Cleaned up includes, switched callbacks over to mCommitCallbackRegistrar, updated RLVa portions to RLVa 1.4.5, changed mSLURL from a string to a real SLURL
2013-06-30 15:38:27 -04:00
Latif Khalifa
0e159e47cd Merge remote-tracking branch 'shyotl/master' 2013-06-28 23:18:39 +02:00
Shyotl
8ccf3a20b3 Fix crash that would happen upon revealing then closing the wl pref panel and then overriding region windlight settings. 2013-06-28 16:11:54 -05:00
Shyotl
8bca439a5a Fixed layout_panel being incorrectly resizeable in browser floater, and made layout_panel width more consistent in panel_progress.xml 2013-06-28 14:39:13 -05:00
Lirusaito
cf189beb86 Update French vanity preferences and put a name in for a checkbox I'd forgotten to name, thanks Nomade~ 2013-06-28 09:12:23 -04:00
Lirusaito
6f701c413a Remove the makeshift visibility_control from llprefsvoice.cpp in favor of using a real one 2013-06-28 08:25:13 -04:00
Lirusaito
b1abffbce1 Address Issue 879: Ability to copy Group URI
Spanish Button Translation from Firestorm
Also: Realigned includes in llpanelgroup.cpp to diff nicer with upstream
2013-06-28 08:22:30 -04:00
Lirusaito
9bdbf6b987 French Translation positioning fix-up from Nomade Zhao 2013-06-28 07:22:05 -04:00
Lirusaito
b7c4532766 Solve Issue 521: Web profile support
Adds a checkbox "Use web profiles instead of legacy v1 profiles" to System->General preferences
Adds a button "Web Profile" to the first life tab of legacy profiles (only available on grids that provide a web profile url)

When connecting to an OSGrid, always set the WebProfileURL setting to whatever is in web_profile_url, this way we know if web profiles are not supported.

Borrowed translations of the preference checkbox from Firestorm, translators may want to tweak
Translators may want to update panel_avatar.xml as it now has a web profile button, and contents have shifted slightly.
2013-06-28 07:18:59 -04:00
Latif Khalifa
5cea153542 Consolidate prebuilt libs 2013-06-28 05:49:29 +02:00
Latif Khalifa
34dad3ba04 Merge remote-tracking branch 'shyotl/master' 2013-06-28 05:48:46 +02:00
Shyotl
eab05d49d8 Added [in]visibility_control support. 2013-06-27 22:08:17 -05:00
Shyotl
93ca5d3482 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git into Moap
Conflicts:
	indra/newview/skins/default/xui/en-us/floater_active_speakers.xml
2013-06-27 22:07:31 -05:00
Shyotl
dbf8845834 Fixup active speakers floater 2013-06-27 20:21:32 -05:00
Shyotl
54bf2943be Use proper list column when when generating teleport url from teleport history list. 2013-06-27 20:11:34 -05:00
Lirusaito
de97a7c9f7 Add floater_media_settings.xml to translations, and fix its title to fit in with the other floater titles 2013-06-27 18:58:01 -04:00
Latif Khalifa
321a7ffbd4 Merge remote-tracking branch 'aleric/master' 2013-06-28 00:12:57 +02:00
Lirusaito
a31316f46a By default, retain the expected behavior of not showing quick settings expanded 2013-06-27 18:11:54 -04:00
Aleric Inglewood
33e275c999 Temporary hack to easy the mesh connect timeout problem. 2013-06-28 00:09:10 +02:00
Aleric Inglewood
f74ad5eafa Fix global connection threshold not to count non-approved queued request as being in the pipeline.
This make more sense when comparing the threshold against 2 times the
maximum allowed total connections.

As a result, textures won't stall when there are around 128 mesh
requests queued.
2013-06-28 00:09:10 +02:00
Aleric Inglewood
73ea6eb80e Rewrite of AIPerService::add_queued_to
This should fix any 'stalls' with zero added requests for mesh.
2013-06-28 00:09:09 +02:00
Latif Khalifa
7855071ce8 Merge remote-tracking branch 'lirusaito/VoiceUpdate' 2013-06-27 23:31:46 +02:00
Lirusaito
f6a1371f70 Fix the issue with the doubleclick callback for the script compile errors list breaking when the user has opted not to let script errors steal focus 2013-06-27 17:27:55 -04:00
Lirusaito
fe238d0563 Delete all the fake toolbar icons in alternative skins
The proper way to hide toolbar icons is by falling back on the default skin's 1x1 transparent texture for them, not by making a a larger version of the icon and using that.
This should fix the awkwardly offset alignment of the text on the buttons in these skins
2013-06-27 13:51:43 -04:00
Lirusaito
e07581f14d Merge branch 'master' of https://github.com/LightDrake/SingularityViewer 2013-06-27 06:00:21 -04:00
Drake Arconis
258d39e432 Coffee time. 2013-06-27 05:57:36 -04:00
Drake Arconis
d00fca05e9 Cleanup from review 2013-06-27 05:39:04 -04:00
Lirusaito
198091c2a0 Solve Issue 738: Improve .anim upload floater 2013-06-27 02:31:42 -04:00
Lirusaito
19367b517c Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into VoiceUpdate
Conflicts:
	indra/llui/lluictrl.cpp - Silly mergestuffs
	indra/newview/llfloatermediabrowser.cpp - deleted
	indra/newview/llpanellogin.cpp - updated functions went poof

Compile Fixies:
	indra/newview/llfloaterwater.cpp - I missed a spot with notificationsutil, it seems.
2013-06-26 12:37:31 -04:00
Lirusaito
f6df34e40a Remove mCommitCallback, mValidateCallback, and mCallbackUserData and related functions from LLUICtrl and derived classes 2013-06-26 11:16:44 -04:00
Lirusaito
d7d5925fd1 And finally, update the callbacks on the last few panels to use boost
Cleans up LLPanelSkins enough to remove sInstance hack.
Modernizes some callbacks on wlfPanel
2013-06-26 11:14:32 -04:00
Lirusaito
14736d24a5 Update LLFloaterWater and LLFloaterWindLight, to be closer to their upstream counterparts. 2013-06-26 09:07:34 -04:00
Aleric Inglewood
32681403c6 Fixed a typo: mConcurrectConnections -> mConcurrentConnections
That's what you get for only copy&pasting variable names.
2013-06-26 13:23:10 +02:00
Lirusaito
dbe646c943 Some minor tweaks to llfloaterpostprocess
Just to make it a little nicer and cleaner, a few changes are from upstream.
2013-06-26 05:32:57 -04:00
Lirusaito
32dc35d582 Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate
Conflicts:
	indra/newview/lloverlaybar.cpp - Shyotl did some caching, VoiceUpdate turned LLVoiceClient::voiceEnabled non-static.
	indra/newview/llvoiceclient.cpp - Change actually belongs in llvoicevivox.cpp
2013-06-26 04:43:46 -04:00
Lirusaito
5a9a0e0b1b Upload code cleansing
I found our upload classes were in need of a tune up while researching Issue 896: Animation upload setting causes viewer crash
So I started working to clean up llfloaterbvhpreview which lead me to llfloaternamedesc and the rest of our upload floaters
I ended up pulling the sound upload hack out of LLFloaterNameDesc and into LLFloaterSoundPreview and moving LLFloaterAnimPreview into llfloaternamedesc.*
Updated llviewermenufile.cpp a bit
Removed setUploadAmount from LLFloaterImagePreview and LLFloaterBvhPreview as its purpose is served by LLGlobalEconomy::getPriceUpload and the hippogridmanager too.
Fixed an issue with floater_animation_anim_preview.xml using [AMOUNT] instead of [UPLOADFEE] for its label.

I'd say this might fix Issue 896, I certainly can't reproduce the crash I was having when testing for it anymore.
2013-06-26 03:51:27 -04:00
Shyotl
84d76f437f Toggle chat_bars parent layout panel instead of the actual chat bar. Fixes layout stack collapse not working. Also, cache a few more things in LLOverlayBar (reduces per-frame setting lookups, etc). Also added debug rect drawing for layout_stack/layout_panel. 2013-06-26 02:14:13 -05:00
Lirusaito
5aaea47a81 Removed setCallbackUserData calls from the last few newview files 2013-06-25 23:54:09 -04:00
Lirusaito
139a10e77c Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into VoiceUpdate
Conflicts:
	indra/newview/llpanelface.* -Knew these would conflict just from proximity
2013-06-25 23:49:04 -04:00
Lirusaito
8fb8e74e54 Fix the crash upon hitting select for an object's light color feature
Modernizes LLTextureControl(, LLFloaterTexturePicker) and LLColorSwatch
Updates LLPanelVolume, LLPanelObject, and LLPanelFace to prevent related crashes and compile.

Adds translation string InventoryNoTexture to strings.xml (added to all existing translations from upstream translation)
2013-06-25 23:02:15 -04:00
Lirusaito
c2cc398339 Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate
Conflicts(Actually git being dumb, I already merged these, just lost history):
	indra/newview/llfloateractivespeakers.h - local
	indra/newview/lloverlaybar.cpp - local
	indra/newview/skins/default/xui/en-us/panel_prim_media_controls.xml - remote
2013-06-25 19:37:50 -04:00
Shyotl
2793ca9e04 Applied moap beacon patch. 2013-06-25 16:21:51 -05:00
Shyotl
e011517849 Widen login/teleport progress bar. Fixed toolbar/overlaybar appearing over login progressview. Updated progressview a bit. Added drawcontext alpha support to llprogressbar. Fixed issue with prim media control panel blocking mouseclicks on upper portion of on-prim media. 2013-06-25 10:29:48 -05:00
Lirusaito
306df58793 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into VoiceUpdate 2013-06-24 14:22:36 -04:00
Latif Khalifa
26aea5f16e Merge remote-tracking branch 'aleric/master' 2013-06-24 19:42:50 +02:00
Aleric Inglewood
58972a1f87 Bug fix and improvement (HTTP debug console) 2013-06-24 19:12:37 +02:00
Aleric Inglewood
1d04b4af24 Actually use CapabilityType::mConcurrentConnections for Approvements. 2013-06-24 18:57:42 +02:00
Aleric Inglewood
719f57e00d Fix documentation at top of AIPerService::approveHTTPRequestFor 2013-06-24 18:37:57 +02:00
Aleric Inglewood
6c36b6efa0 Add AIPerService::mCTInUse and AIPerService::mUsedCT
Keep track of which capability types are used and in use
at the moment for each service.

Update the http debug console to only show services
that have at least one capability type marked as used (this resets upon
restart of the debug console) and show previously used but currently
unused capability types in grey.

Update CapabilityType::mConcurrentConnections based on usage of the
capability type (CT): Each currently in-use CT gets an (approximate)
equal portion of the available number of connections, currently
unused CTs get 1 connection for future use, so that requests can and
will be added to them if they occur. If a CT is currently not in use
but was used before then it's connection (but at most one connection)
is kept in reserve. For example, if there are 8 connections available
and a service served textures and mesh in the past, but currently
there are no texture downloads, then mesh get at most 7 connections,
so that at all times there is a connection available for textures.
When one texture is added, both get 4 connections.
2013-06-24 16:13:00 +02:00
Lirusaito
45bbf52771 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into VoiceUpdate 2013-06-23 22:36:55 -04:00
Lirusaito
3739639295 Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate
Conflicts:
	indra/newview/llfloateractivespeakers.h - llparticipantlist.h got changed from a panel to a layoutpanel
	indra/newview/lloverlaybar.cpp - Silly conflict, I change one line, Shyotl changes the next two.

Compile fixies:
	indra/newview/llavataractions.cpp needed to include llnotifications.h
	indra/newview/llvoicechannel.cpp needed to include llnotifications.h
2013-06-23 22:36:04 -04:00
Lirusaito
7a88b9a8a4 Fix the issue reported in group chat in which closing preferences with Device Settings open does not return to local voice 2013-06-23 22:16:40 -04:00
Lirusaito
64bd7af0ca Update childSetCommitCallback to upstream version, fixes the issue of crashing out upon using spinners in the colorpicker 2013-06-23 22:14:35 -04:00
Lirusaito
64cb1109e2 Update/Modernize LLFloaterColorPicker
Not very important, just something I did while working on the related spinner bug..
This actually fixed the crash when using the hex editor field.
2013-06-23 19:07:27 -04:00
Lirusaito
9f3c4e909a Removed the need for LLPanelAvatarNotes::onCommitNotes with a bind 2013-06-23 19:01:39 -04:00
Lirusaito
b4f0b29035 Switched the Ascent Prefs callbacks over to modern boost::bind
It's simple to compile fix, but I'll handle any necessary merge conflicts, if necessary.
Hunspell stuff needs revisiting still, works as poorly as it always did.
2013-06-23 19:00:49 -04:00
Aleric Inglewood
af9018f35f Add AIPerService::CapabilityType::mConcurrectConnections
Prepares for throttling number of connections per capability type.
The value is current left at AIPerService::mConcurrectConnections,
so not having an effect yet.
2013-06-23 18:09:09 +02:00
Aleric Inglewood
87176418a2 Change CurlConcurrentConnectionsPerService to U16 and clamp it between 1 and 32.
Also fixes a bug where going from 1 to 2 would not update
AIPerService::mConcurrectConnections correctly.
2013-06-23 18:05:23 +02:00
Lirusaito
498b63be99 Revert "Fix the issue reported by Beware Hax in which the group name text is missing from build floater."
This reverts commit 142e8fff19.
Shyotl fixed this in Moap, which I am about to merge.
2013-06-23 04:25:55 -04:00
Lirusaito
e7669cc94b Add setting to prevent script errors from stealing focus 2013-06-23 04:05:25 -04:00
Lirusaito
d4bed6382c Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into VoiceUpdate 2013-06-23 02:25:15 -04:00
Shyotl
67df523f10 LLChatBar can't betreated as a LLPanel and a LLLayoutPanel at the same time. Demoted to just an LLPanel (fixes issues with follow attribute). 2013-06-22 17:27:09 -05:00
Aleric Inglewood
ee59617c5e Always add new http requests to the back the queue. 2013-06-22 22:20:37 +02:00
Aleric Inglewood
8a825c4228 Merge remote-tracking branch 'singu/master' 2013-06-22 20:09:45 +02:00
Aleric Inglewood
432d6b5697 More comment fixes to refer to services instead of hostnames. 2013-06-22 20:08:15 +02:00
Drake Arconis
dde335da2d Fix button misalignment in gemini skin 2013-06-21 03:23:53 -04:00
Drake Arconis
43a7cbaa85 Rip out the globals :D 2013-06-21 03:23:52 -04:00
Drake Arconis
7a0e3d8abd Remove more old stuff 2013-06-21 03:23:51 -04:00
Lirusaito
62f5e73767 Copypasta went stale, I had to throw it out.
This commit removes the hardcoded see avatars text that replaced the label of the checkbox on the about land floater regardless of conditions.
Also adds the checkbox translation from v3 for Portuguese.
2013-06-20 22:43:41 -04:00
Shyotl
3f1e67d9df Added LLMediaCtrl rightclick context menu. Also added some v3-esque xml handling for menus (*.on_visible, *.on_enable, *.on_click). 2013-06-20 03:15:42 -05:00
Shyotl
57ba76825c Made LLPanel::initPanelXML virtual and override it in LLLayoutPanel. Fixes issue with some panels /still/ being user resizeable if derived from LLLayoutPanel and built from an arbiturary sub-xml file. 2013-06-20 00:55:07 -05:00
Shyotl
f24fe44df8 wlfPanel_AdvSettings cleanup. Removed some duplicate code, and register to rlv to catch behavior change instead of polling every draw call. Also now references wlfAdvSettingsPopup setting only during build. 2013-06-20 00:49:02 -05:00
Shyotl
e015771c64 Pulled llnotifications.h dependency from LLFloater. llnotifications.h includes llevents.h, which can cause conflicts with llevent.h (Legacy events vs non-legacy) 2013-06-20 00:45:12 -05:00
Latif Khalifa
788ea1316f Fix build on arch where python 3 is default
Patch by Jimmy Buse
2013-06-20 02:59:04 +02:00
Latif Khalifa
ca42589a82 SH-4274 FIX Adding RegionHandshakeReply flags for SSA
Adding a flag to hint to the sim that this viewer knows how to handle
AvatarAppearance messages for self in SSA-enabled regions.

Upstream patch: 5fdc790f6d
2013-06-19 17:37:40 +02:00
Latif Khalifa
859ad8efd8 Merge remote-tracking branch 'melanie_t/master' 2013-06-19 16:57:28 +02:00
Melanie
94cfa613ec Rename inner scope floater var to satisfy MSVC 2013-06-19 16:54:41 +02:00
Melanie
76219cd459 Fix the Octopus to hold on to connections and to disconnect them using boost rather than setting a zero callback. 2013-06-19 16:08:47 +02:00
Shyotl
8d0a514712 Added missing setting. Fixed login grid combobox. Using skin-dependent scrolllist text color in nearbymedia panel. Fixed media face toggle not triggering face rebuild. Added incon that was missed in previous commits. bar_stack layout panels were incorrectly resizeable. Fixed comboboxes/scrolllists in panel_nearby_media.xml translations 2013-06-19 03:32:33 -05:00
Lirusaito
2c1f14e27f AscentMutedColor is not in gColors, it's a setting, oops. Thanks to LaMont Zuzu for helping me sort this all out.
Fixes muting people who are/having muted people who are in a participant list(active speakers or that << pop out in group chats) that is displayed
2013-06-18 21:01:11 -04:00
Shyotl
49cbc80ee0 Added 'NearbyMedia' floater (accessable via new button in Media Remote popup)
-Floater utilizes a slightly modified LLPanelNearbyMedia, which has fading and the 'minimal' mode disabled when its parent is a floater.

  -Due to how LL designed LLPanelNearbyMedia, only one instance should ever be allowed at a time.

Added LLNameBox. To avoid having dupilcate code, logic in LLTextBox::fromXML had to be moved to LLTextBox::initFromXML.

  -Perfomed some additional cleanup. 'name' attribute now parsed in LLUICtrl::initFromXML, or as-needed for elements not based off of LLUICtrl.

LLSlider now respects current DrawContext

Fixed the AO toolbar widget reserving too much width.

Made the "wlfAdvSettingsPopup" setting persist, and un-inverted its logic.

Altered ui initilization order. Toolbar/overlay panels now constructed further into login process.
2013-06-18 08:09:17 -05:00
Lirusaito
3116e4923c Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-06-18 01:18:28 -04:00
Lirusaito
12a23c98a1 Fix Issue 459: Appearance, Create Outfit does not keep edits to outfit - HAPPENS EVERY TIME
Automatically detach copyable attachments early, so that changes will be kept (LLMakeOutfitDialog was changed to update the outfit correctly, despite items being removed. It should probably be cleaned up further)
Adds an extra checkbox to make outfit dialog to disable this new auto-detach behavior, for users who rely on the old behavior.

Also fixes a bug I noticed in LLMakeOutfitDialog in which the use links checkbox would be enabled even if the grid doesn't support links
Had to reposition everything to get the new checkbox to sit nicely, but in doing so changed bottoms to bottom_deltas so it should be easier in the future, layout remains the same, of course, shouldn't be noticed.
2013-06-18 00:02:50 -04:00
Latif Khalifa
55ab1429af Merge remote-tracking branch 'aleric/master' 2013-06-18 03:34:07 +02:00
Latif Khalifa
4607ff1317 Merge remote-tracking branch 'lirusaito/master' 2013-06-18 03:33:55 +02:00
Lirusaito
4016c9d756 Silly profiles, display the proper title. 2013-06-17 12:37:22 -04:00
Aleric Inglewood
ff6e25b342 Compile fix 2013-06-17 17:59:39 +02:00
Lirusaito
f27f4a7d48 Minor LLViewerTextEditor update
Support for opening embedded calling cards
Switched to llnotificationsutil.h instead of llnotify.h
Cleaned up and reorganized includes list to better match upstream
Fixed embedded notecards not popping up when you click them, someone at LL decided new inventory should only be shown if the user doesn't want it to be shown for the case of embedded notecards.
2013-06-17 11:34:48 -04:00
Aleric Inglewood
1754b97e5c Need to export BackTrace::S_Number to use BACKTRACE. 2013-06-17 17:28:42 +02:00
Shyotl
884c67e641 Added LLViewDrawContext. Implemented in a few select ui elements. Just enough to support the panel prim media controller fading out all fancy-like. 2013-06-16 22:48:50 -05:00
Shyotl
10f61f6f00 Old habits die hard. Fix gcc compile. 2013-06-16 22:45:48 -05:00
Shyotl
d4f5c25612 Fix up some of the broken SLURL<->HippoGridManager logic. 2013-06-16 21:47:55 -05:00
Lirusaito
7303bfcb78 Eliminated most instances of the legacy setCallbackUserData (and modernized up a bunch of callbacks)
Also cleaned up slfloatermediafilter to act as a proper singleton.
Removes childSetUserData entirely.
2013-06-16 20:00:00 -04:00
Melanie
6025af25be Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-06-16 20:49:54 +02:00
Lirusaito
4fe2396203 Relicensed LLDropTarget to LGPL, since I've rewritten it. 2013-06-16 01:13:52 -04:00
Shyotl
be94087bee Fixed a focus issue that prevented face media floater from updating on face change if said floater had current focus. 2013-06-15 20:08:05 -05:00
Lirusaito
93ce490ba3 Forgot to update the search floaters used on alternate grids 2013-06-15 18:36:56 -04:00
Lirusaito
657d3f704c Add Open Picture button to Pick Panels (and Further LLPanelPick cleanup) 2013-06-15 18:34:14 -04:00
Shyotl
ad89c3e401 Added media support to prim face editor. Todo: Translations for all these floaters and panels. 2013-06-15 05:14:27 -05:00
Lirusaito
c5d21cfb1c Updated pick panel code, removed dead stuff including xmls. 2013-06-15 06:10:31 -04:00
Lirusaito
8ce71811c5 Feature Request (from IRC): Allow less restrictive access to group profiles from search
mAllowEdit has really signified whether or not llpanelgroup was in its own standalone floater
This change removes the restrictions the lindens chose to put on group search, allowing the user as much control as possible over a group from outside a dedicated floater

Notices and Land & Money get their information from messages passed through viewermessage, addressed to the right instance by id, as such they must be unique to the standalone floater
Cancel button in group search will only enable when changes have been made and will refresh the group, clearing changes.
The OK button is not visible in group search as it serves the same purpose as the Apply button here.
2013-06-14 23:08:56 -04:00
Lirusaito
cf675c3748 Feature Request (from IRC): Add option to display complete name on profile (Available on Vanity Preferences at the bottom of the main tab)
Note: This will not work with legacy names selected because that disables the display name system altogether right now, if we ever separate the disabling to another setting, this would work.
2013-06-14 22:04:27 -04:00
Lirusaito
35bcf34f06 Removing unused panel_group_finder.xml, looks like some ancient version of panel_group.xml 2013-06-14 14:49:24 -04:00
Latif Khalifa
8574f1ee23 Merge remote-tracking branch 'aleric/master' 2013-06-14 18:31:48 +02:00
Latif Khalifa
a6a5983fbe Merge remote-tracking branch 'lirusaito/master' 2013-06-14 18:31:35 +02:00
Latif Khalifa
4552c5f878 Merge remote-tracking branch 'melanie_t/master' 2013-06-14 18:31:23 +02:00
Shyotl
5f4091b4d2 Update LLFloaterTools to use commit callback registrar where convenient. 2013-06-14 03:55:40 -05:00
Shyotl
9d0f7bacfc Tweak focus handling so media faces behave properly, and tweaked tooltip handling for media faces. 2013-06-13 20:10:24 -05:00
Lirusaito
c8427e1c63 [Voice Update] Remove old xmls from back when the voice setup wizard was a thing 2013-06-13 08:56:12 -04:00
Lirusaito
2d71b9be17 [Voice Update] LLPanelVoiceEffect added to LLFloaterActiveSpeakers
Comments out xml menu entry for LLFloaterVoiceEffect access from LLPanelVoiceEffect is the intended method
TODO: Once Shyotl's new layout stack code comes in, make LLFloaterActiveSpeakers into a vertical stack so we can properly hide LLPanelVoiceEffect upon a debug setting.
2013-06-13 06:29:00 -04:00
Shyotl
dceb1a64fe Added mouse entry/mouse leave ui callback support. Works manually or through CommitCallbackRegistry (*.mouseenter_callback & *.mouseleave_callback attributes) 2013-06-13 04:33:49 -05:00
Shyotl
e617ff0763 New LLLayoutStack, and cursory LLPanelPrimMediaControl panel. 2013-06-13 04:28:15 -05:00
Lirusaito
01ec6905ab [Voice Update] LLFloaterVoiceEffect (Lives in File->Show Voice Morpher for now) 2013-06-13 05:23:35 -04:00
Aleric Inglewood
34b921a101 Disable llassert(!mUploadFinished)
This fires so little that it isn't worth anymore to look into it
(the only problem resulting from this is a wrong timeout on one
of the http requests); and therefore no longer makes sense to
have it triggered in alpha builds at all, since those do not
produce enough debug output to understand what caused it in the
first place.
2013-06-12 21:21:41 +02:00
Aleric Inglewood
af1eaac79d Bug fix.
Revert an incorrect change made in
c5fc945f33 (imported from viewer 3).

This stops ASSERT(mSegments.back()->getEnd() == getLength())
in LLTextEditor::loadKeywords.
2013-06-12 14:55:46 +02:00
Aleric Inglewood
def40055b0 Don't add windows filesname to service list. 2013-06-12 03:10:11 +02:00
Lirusaito
08ab202a06 Fix avatar "inspect" commandhandler 2013-06-11 19:03:15 -04:00
Lirusaito
b7136b2b4f [Voice Update] startCall and endCall use Session UUID, not Other Participant UUID. 2013-06-11 16:59:32 -04:00
Lirusaito
7e9c75ef6b Use the translatable string Saved_message everywhere needed, instead of just one place. 2013-06-11 15:43:27 -04:00
Lirusaito
d947912bb0 [Voice Update] Start/End call functions
Adds llvoicecallhandler.cpp
Enables the Group and Avatar Actions requiring the voice refactor.
Adds autoStartCallOnStartup, processAgentListUpdates, startCall, and endCall to LLIMMgr.
Gives llimpanel some LLIMModel functionality to see if a floater was opened with the intent of being a call.
Cleans up LLIMPanel with new functions from the voice refactor.
2013-06-11 15:41:53 -04:00
Lirusaito
fd453593b3 Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate
Conflicts:
	indra/newview/llfloateravatarinfo.cpp - llpanelprofile.cpp update
	indra/newview/llfloatergroupinfo.cpp - llgroupactions.cpp update
	indra/newview/llfloaterobjectiminfo.cpp - simple merge
	indra/newview/llstartup.cpp - Followed Shyotl's directions from 07165961dc
	indra/newview/llviewermedia.cpp - includes conflict, simple stuff.

SLURL update:
	indra/newview/llavataractions.cpp
	indra/newview/llgroupactions.cpp
2013-06-11 15:32:18 -04:00
Lirusaito
9ffd531ce6 Missed a spot 2013-06-11 09:41:33 -04:00
Lirusaito
8a37ac2439 class LLOfferInfo update 2013-06-11 07:36:49 -04:00
Lirusaito
62a96b8b33 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into VoiceUpdate 2013-06-11 05:56:24 -04:00
Lirusaito
c8657504f6 Fix WARNING: LLNotificationTemplates::addTemplate: LLNotifications -- attempted to add template 'LandBuyAccessBlocked' twice. 2013-06-10 11:49:03 -04:00
Aleric Inglewood
aca39d8c11 Fix crash when granting/removing build rights to others.
Bug was introduced in c701c61566
for single persons, but already existed for when granting rights
to more than one person at a time.

There is still a problem left now that you have to confirm
several times (once, but also had to confirm two or three times)
before it gets through. That doesn't seem related to THIS bug,
but seems to be a new bug, possibly introduced in the same commit
mentioned above.
2013-06-10 16:07:45 +02:00
Lirusaito
cc107c55cd [Voice Update] Fix the current voice chat button
If the current voice chat's floater is undocked, grab it by session id so that it's not labeled blank
When the button is clicked, open the current voice chat floater, not the communications floater, this is the intended action.. how it should have acted in the first place.
2013-06-09 11:32:51 -04:00
Lirusaito
cbfa47c0da [Voice Update] LLPanelActiveSpeakers to LLParticipantList
Minor updates to code, mostly just a migration with some v3 stuff commented, since we don't have LLAvatarList and must use buttons since scrolllist menus don't actually exist nicely yet.
Added toggleMuteVoice and isVoiceMuted to LLAvatarActions
Added a minor touch to the voice volume slider, it'll now offer changing your own volume while in an active voice session.. nice to not drop out of an import voice session just to fix yourself.

Also, fix a bug with SpeakerMgr's not flagging speakers for removal properly, causing external speakers and speakers managed by LLActiveSpeakerMgr to never actually get removed.
2013-06-09 11:28:49 -04:00
Aleric Inglewood
e59cefa0cc Bug fix of LLPipeline::setRenderDebugFeatureControl
This commit has no effect on how the viewer behaves currently.
2013-06-07 16:19:46 +02:00
Shyotl
72c186f0f4 Fixed some unused variable warnings/errors when not compiling with assertions enabled. (eg 'release' configuration). Also snagged a nullcheck from upstream. 2013-06-06 02:12:45 -05:00
Lirusaito
fc07727281 [Voice Update] Minor update to llvoicechannel class
Incompatible things left in from upstream are commented out
Just need to wrap things up to a point.
2013-06-04 23:27:18 -04:00
Shyotl
909fc0d9ce Blah blah fix non-windows builds. 2013-06-04 17:08:59 -05:00
Lirusaito
89963b018b [Voice Update] llfloateractivespeakers.* to llspeakers.*
Condenses the three moderation responders to one.
Adds Speakers settings.
Uses dedicated timer class to track speakers on the list
Adds temporary getSpeakerManager() function to LLFloaterIMPanel to play the role of LLIMModel::getSpeakerManager
2013-06-04 10:18:49 -04:00
Shyotl
3a7955192e Temporary super-obsessive audioengine debugging/diagnostics. 2013-06-04 04:39:51 -05:00
Shyotl
821fd1f7d6 Handle fmodex internal channel release by registering channel callbacks. Harden channel<->source associations. Assign console output for audio system "AudioEngine" and "AudioImpl" tags. Added base LLAudioChannel::cleanup() vfunc to handle non-impl-related variable cleanup. Killed some redundant code. 2013-06-04 03:46:26 -05:00
Lirusaito
c273e34ed8 [Voice Update] LLVoiceClient
Migrate a bunch of classes out of llvoiceclient.* and into new llvoicevivox.*
Update most of these to match their counterparts
Introduce VoiceFonts support (voice morphing, floater still to come)
Support for a bunch of v3 voice settings.
Move volume settings management from LLMutelist into LLSpeakerVolumeStorage
Support for Avaline mutes (WIP)
Adds voice section to LLAgent
Moved llfloatervoicedevicesettings to llpanelvoicedevicesettings, v3's voice device panel design is more intuitive.
2013-06-03 22:20:27 -04:00
Aleric Inglewood
c5489932cf Fix ASSERT(!mUploadFinished || mBeingRedirected)
Hopefully this is the last case.
2013-06-04 00:31:44 +02:00
Shyotl
9c8cfcfd0a Fixed crash upon clicking media prim (disabled prim media control floater for now). Fleshed out media browser replacement (LLFloaterWebContent). 2013-06-02 23:47:47 -05:00
Melanie
b8cc9a7c04 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-06-03 03:28:36 +02:00
Melanie
f497a8a3d5 Fox the Octopus break I caused 2013-06-03 03:27:25 +02:00
Latif Khalifa
edf8c337ee Silence warnings, LLOfferInfo is a struct for now 2013-06-03 02:02:11 +02:00
Latif Khalifa
d4431e14d7 Merge remote-tracking branch 'lirusaito/master' 2013-06-03 01:36:35 +02:00
Latif Khalifa
986871c5a6 Merge remote-tracking branch 'aleric/master' 2013-06-03 01:33:03 +02:00
Latif Khalifa
5ee7244b45 Merge remote-tracking branch 'shyotl/master' 2013-06-03 01:30:36 +02:00
Shyotl
07165961dc Handle "indeterminate" login response (indicating login server redirection). (This changeset will conflict in a future merge. Prefer this commits changeset where there's overlap) 2013-06-02 17:51:17 -05:00
Lirusaito
07e1b5c3b9 [Voice Update] Remove gVoiceClient occurrences in favor of using LLVoiceClient as a Singleton everywhere. 2013-06-02 01:34:03 -04:00
Lirusaito
b6096720b1 [Voice Update] Break out llvoicechannel.* from llimpanel.* 2013-06-01 22:47:41 -04:00
Aleric Inglewood
24fb76907d Compile fix 2013-06-01 16:37:02 +02:00
Aleric Inglewood
98badb94da Add AIHTTPView, a HTTP Debug Console - press Ctrl-Shift-7 2013-06-01 16:14:32 +02:00
Aleric Inglewood
5c05a04a2c Fix of 'LLError::NoClassInfo::~AIFilePicker: Calling AIFilePicker::~AIFilePicker()' 2013-06-01 13:32:55 +02:00
Shyotl
c2cc65ecdc Removed dead STATE_LOGIN_AUTHENTICATE login state, and added login redirect response ('indeterminate'). 2013-06-01 05:13:56 -05:00
Shyotl
d4a545fb16 More WIP moap changes. Browser elements now function, added many required settings and notifications, and fixed some crashes and other bugs. 2013-06-01 05:11:18 -05:00
Lirusaito
e27914a57e RLVa update 2013-06-01 02:49:21 -04:00
Lirusaito
a06a6f4624 Remove randgauss.h, it hasn't been used since before 1.6.0 2013-06-01 02:23:36 -04:00
Lirusaito
142e8fff19 Fix the issue reported by Beware Hax in which the group name text is missing from build floater. 2013-05-31 21:31:07 -04:00
Lirusaito
6b03d2ddae Dummy Views in PanelPermissions 2013-05-31 21:16:52 -04:00
Lirusaito
9d6d82c4a0 GroupActions fixup.
Missed a tiny spot for displaying group notifications in profile, slipped by me.
2013-05-31 21:04:14 -04:00
Lirusaito
9dc99d0b08 Update keywords.ini in skins to match c5fc945f33 changes 2013-05-31 17:31:18 -04:00
Aleric Inglewood
98eecb319a Merge remote-tracking branch 'singu/master' 2013-05-31 20:02:50 +02:00
Aleric Inglewood
34e0398ddf Fix of issue 855 #12 second image.
This should fix 'Received 302 (Moved Temporarily) for responder
"AgentStateResponder" which has no followRedir().

Some responders want to deal with redirections themselves, I checked if
this (new, pathfinder related) responder wants that in viewer-release,
but it doesn't. Turning this on requires to also keep track of cookies,
so it's a bit slower and therefore left at the old default: to not let
curl follow redirections. Optionally we would turn it on by default and
explicitely off for those responders that want to deal with 302's
themselves and for those that really don't need it and are used most
heavily.
2013-05-31 19:52:23 +02:00
Lirusaito
fcd6f217d2 LLGroupActions too! (Strengthens RLVa restrictions!)
Cleans up llfloatergroupinfo, makes it an instance tracker... pretty much as nice as llfloateravatarinfo now ^*^
Adds notifications JoinGroupNoCost and JoinedTooManyGroups (added to our existing translations, of course)
Cleans up all around, placing groupactions around.

Touches up bits for avataractions
2013-05-31 07:37:00 -04:00
Shyotl
ef3e918558 Initial moap commit. /VERY/ WIP. Primarily committed to clean up unstaged changes. Do not run this, even if it may compile, as it will NOT work (for a myriad of reasons)! 2013-05-31 05:33:41 -05:00
Shyotl
a8b2a10c61 Switch pie menu over to ui-local transform matrix stack. 2013-05-31 04:46:38 -05:00
Siana Gearz
06c286a8a8 Merge commit '6ef3ba4e113a4f87440f0ad3cafb348383c61504' 2013-05-31 11:07:51 +02:00
Siana Gearz
746f1236d5 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-05-31 10:54:31 +02:00
Siana Gearz
9b31bd9ad6 Fix inventory move logic 2013-05-31 10:54:17 +02:00
Lirusaito
8d10a21a7a One more fix for removing system folders, thanks Swiftkill! 2013-05-30 19:56:49 -04:00
Lirusaito
59e7b1c777 Touchups to deleting system folders, now use DELETE_SYSTEM_FOLDERS instead of not LL_RELEASE_FOR_DOWNLOAD, and bypass the folder protection check if this is the case. 2013-05-30 19:29:27 -04:00
Lirusaito
dc4a52e1c4 Added Delete System Folder entry to xmls, it won't work on release builds, of course. 2013-05-30 18:30:06 -04:00
Lirusaito
f3f76c280b [Issue 850] Add a control for unfocused window opacity.
Adds debug setting FloaterUnfocusedBackgroundOpaque
Adds "Make unfocused floaters opaque" to Vanity->Main preferences.

One line patch to llfloater.cpp
2013-05-30 18:28:36 -04:00
Lirusaito
a395e2f1b9 Removed the profile tab container gap. 2013-05-30 17:02:56 -04:00
Lirusaito
c701c61566 LLAvatarActions all hooked up!
Rlva style~ So update to RLVa stuff!
Adds support for @startim and @startimto
Enables hasOpenIM and hasOpenProfile, Yay functionality!
RLV_BHVR_STARTIM and RLV_BHVR_STARTIMTO added

While I was working, I was updating LLAgentHandler, after long enough it was identical enough to the one in llpanelprofile, so we're using that now.
Cleans up llfloateravatarinfo to the point of being a floater and instancetracker wrapper for a panelavatar (profile panel)
Bypasses looking up expired names that we know via get, this should avoid chats (and profiles, but that bug never got out) never opening for people we already know the name of on a bad connection; of course, this will only cause a faster reaction on the UI's part, messages may never get sent still (and profiles may never load) if the connection is truly terrible.
Cleans up llfloaterfriends and some parts of llfloateravatarlist (avatarlist could be cleaned up more from this perhaps in the future)
May slightly look better with copy detection and without space changes..

llgivemoney.cpp changes fix up some dummy view warnings I noticed while testing these changes
llpreview.cpp changes avoid segfault caused by llfloateravatarinfo not being a preview anymore but being inside a multipreview nonetheless.

Translators, don't worry, I covered this one with updates from v3 (Except German team)
2013-05-29 23:56:33 -04:00
Aleric Inglewood
dc265ff9a1 Attempt to fix issue 848
https://code.google.com/p/singularity-viewer/issues/detail?id=848

If advance_state is called, then the state is NOT changed (only
sub_state_w->advance_state is set), but sub_state_w->skip_idle is set to
true in order to ignore the next call to idle (if the state machine is
already in the middle of executing a state). Therefore, this assert
would trigger. The solution is to not trigger when skip_idle is set.
2013-05-29 02:37:48 +02:00
Lirusaito
6ef3ba4e11 Definitely avoid IMs never opening from friends list, and attempt to look up friend names we don't have to prevent this "waiting" chat session problem.
The const LLRelationship* info was likely null at times, or names weren't looked up, we just failed silently and played the start IM sound as though nothing had happened, this won't happen anymore.
2013-05-28 17:38:58 -04:00
Aleric Inglewood
48677d348f Fix issue 679
https://code.google.com/p/singularity-viewer/issues/detail?id=679

Instead of making the cursor just always an arrow, I changed the
'working' cursor from a watch to an arrow + hour glass. Note that the
BMP of the 'wait' cursor was exactly the same as the 'working' cursor,
so if anywhere 'working' should NOT have an arrow, then that should be
replaced with the UI_CURSOR_WAIT to restore the old cursor.

Obviously, the blinking is fixed too - cause that is what this all was
about.
2013-05-28 03:59:35 +02:00
Siana Gearz
1734370682 Merge branch 'master' of https://github.com/lkalif/SingularityViewer 2013-05-28 03:31:52 +02:00
Siana Gearz
dd82997076 Merge branch 'UICleanup' of https://github.com/Shyotl/SingularityViewer 2013-05-28 03:30:50 +02:00
Siana Gearz
0f90991533 OS X build fix 2013-05-28 03:24:12 +02:00
Shyotl
641ada030e Didn't actually want to commit the latter ui-scale related change, but rebasing is too annoying, so revert. 2013-05-27 19:23:36 -05:00
Shyotl
ba9c8f3d6d Merge branch 'master' into UICleanup 2013-05-27 19:19:38 -05:00
Shyotl
d5e1a0dd4b Unbreak ui scaling. 2013-05-27 19:18:47 -05:00
Shyotl
00269e8358 Unbork ui scaling. 2013-05-27 19:18:11 -05:00
Latif Khalifa
fc80adaf7a Remove duplicates in the list of files passed to NSIS 2013-05-28 01:42:38 +02:00
Lirusaito
ee1f1cdde2 Use isNull instead of checking equal to LLUUID::null in hbfloatergrouptitles 2013-05-27 08:11:09 -04:00
Lirusaito
6b83dd5210 LLPanelDebug isn't doing anything, it goes poof. 2013-05-27 08:10:12 -04:00
Lirusaito
4eae554812 Merge branch 'UICleanup' of git://github.com/Shyotl/SingularityViewer
Conflicts:
	indra/llappearance/llwearable.h
	indra/llui/llcombobox.h
	indra/newview/jcfloaterareasearch.cpp
	indra/newview/jcfloaterareasearch.h
	indra/newview/llpanelgrouproles.cpp
	indra/newview/llpanelgrouproles.h
	indra/newview/llviewermenu.cpp - Plugged in new MenuFloaterDict for AssetBlacklist and SoundExplorer in menu_viewer.xml and removed the old listeners for them.
	indra/newview/skins/default/xui/es/floater_inventory.xml
Compile Fixes:
	indra/llcommon/llstl.h - error: expected nested-name-specifier before ‘const’
	indra/llui/llmultisliderctrl.cpp:283:12: error: ‘caller’ was not declared in this scope
	indra/llui/lltexteditor.cpp
		- error: operands to ?: have different types ‘const LLPointer<LLTextSegment>’ and ‘long int’
		- error: passing ‘const LLPointer<LLTextSegment>’ as ‘this’ argument of ‘LLPointer<Type>& LLPointer<Type>::operator=(const LLPointer<Type>&) [with Type = LLTextSegment]’ discards qualifiers
	indra/newview/llfloaterpermissionsmgr.cpp - Silly Shyotl, boost bind, not std bind.
	indra/newview/llfloaterproperties.* - error: ‘LLInstanceTracker<LLFloaterProperties, LLUUID>’ is an inaccessible base of ‘LLFloaterProperties’
	indra/newview/llgivemoney.cpp - Again, boost::ref, not std::ref
	indra/newview/llpreviewscript.cpp - no known conversion for argument 1 from ‘std::vector<const LLPointer<LLTextSegment> >’ to ‘std::vector<LLPointer<LLTextSegment> >&
2013-05-27 08:09:28 -04:00
Lirusaito
a10708e9be Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-05-27 04:07:38 -04:00
Lirusaito
8769b98b31 Add Bottom offset spinner to the Chat Console section of Text Chat prefs, thanks Ratany! 2013-05-27 03:08:09 -04:00
Siana Gearz
6fca791632 Fortify on release doesn't work and throws warnings on F18 2013-05-27 08:48:45 +02:00
Siana Gearz
7c675af943 Merge branch 'master' of https://github.com/MelanieT/SingularityViewer 2013-05-27 08:40:26 +02:00
Siana Gearz
074e6c135b Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer 2013-05-27 08:37:39 +02:00
Siana Gearz
e9a323af9f Merge branch 'master' of https://github.com/AlericInglewood/SingularityViewer 2013-05-27 08:36:56 +02:00
Siana Gearz
8b085bd03d Matching movement rebuild code with V3 again 2013-05-27 08:35:07 +02:00
Siana Gearz
772f5e0e5d Somebody just won the prize for the least working contributed code.
Just made it compile and look like it does something sane, don't have time to test it at the moment.
2013-05-27 08:12:39 +02:00
Siana Gearz
62be5ae913 Merge branch 'v2URI' of https://github.com/Swiftkill/SingularityViewer 2013-05-27 06:48:51 +02:00
Siana Gearz
3cd16c84ef Dirty patch Intel HD4000 shader-confusion 2013-05-27 06:47:00 +02:00
Aleric Inglewood
b6f6dfbe99 Fix french assert.
Fixes a possible ASSERT(!(need_new_run && !mYieldEngine &&
sub_state_r->run_state == run_state)).

When over all multiplex_impl functions and this is the only case that I
found where it could return without changing the state and without
calling either idle() or yield().
2013-05-27 02:15:28 +02:00
Melanie
4abe27f7f5 Move the octopus so the swirlies will not happen when CCS is attached in SL 2013-05-26 17:10:23 +02:00
Siana Gearz
c61415d785 Canonicalize detach crash fix to RLVa 2013-05-26 15:56:22 +02:00
Siana Gearz
89e7decc12 Bring chat focus behaviour closer to Phoenix by default, and an option 2013-05-26 14:34:19 +02:00
Siana Gearz
d4251e3f69 This should fix bridge detach and crash, thx Ansariel 2013-05-26 05:45:00 +02:00
Siana Gearz
bc145c95fb Silence VC10 warnings 2013-05-26 05:43:28 +02:00
Lirusaito
9b4748ae71 Fix deleting all scripts in selection
Two real changes: 1. Don't tell the user we're counting scripts when they just want them gone; 2. When deleting a script, counter-iterate to avoid a crash
Adds a bit more debug spew commented out, helped me out with this.

Thanks to Sentinel for catching this early!
2013-05-25 20:51:15 -04:00
Lirusaito
9d3cc2a03b Fix the issue with chat bubbles having the chatter's name at the start of normal messages, also connect the italicize actions option to chat bubbles.
Moves the "We have a real utterance now" block back above the concatenation of names and verbs and the message.
Maybe italicize should be tied to a separate setting for bubble chat, but for now let's see if it is fine in its current state.
2013-05-25 16:19:59 -04:00
Aleric Inglewood
a8880983c4 Fix WARNING: addData: Type mismatch in LLMsgVarData::addData for Set 2013-05-25 22:07:50 +02:00
Lirusaito
67c6864f5e Update to french translation, thanks Nomade. 2013-05-25 15:30:55 -04:00
aragornarda
f7e45332bd small typo fix 2013-05-25 18:26:42 +03:00
Melanie
326008c553 Correct curreny display in "serverside is now viewerside" currency dialogs on OpenSim 2013-05-25 05:36:11 +02:00
Aleric Inglewood
b1be8802ca Fix URL to correct section for store creation. 2013-05-25 03:20:14 +02:00
Aleric Inglewood
3af2c13cd3 Compile fix for libcwd. 2013-05-25 03:19:33 +02:00
Lirusaito
1abd7f18f5 Tweak the increment and the minimum value of the draw distance slider on the graphics prefs panel to display the same values as seen on the quick prefs.
Thanks to Xanthe Yordstorm for pointing out this inconsistency!
2013-05-24 20:53:15 -04:00
Lirusaito
6cfaeeb37b Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into Frosting 2013-05-24 17:30:54 -04:00
Latif Khalifa
bd2b25b12b Merge remote-tracking branch 'lirusaito/master' 2013-05-24 19:56:34 +02:00
Latif Khalifa
f67ac97fcf Revert the last change of VSTool.exe 2013-05-24 06:00:22 +02:00
Lirusaito
19996468c1 Correct a flipped bool 2013-05-23 17:37:19 -04:00
Lirusaito
0e8fed0dc5 Minor update to group roles panel from upstream
Don't add names that haven't been looked up yet to the group roles list, wait for them to be looked up, then check them against the filter.. this avoids unrelated names getting turned up in the list under a filter.
Also diverged a bit from upstream to filter using the displayed names, since people who are only having Display Name shown will get inconsistent names turned up by the filter, otherwise. (Searching "Inusaito Kanya" would turn up "Aur'a Færs" in the results, which obviously isn't what they're looking for... maybe this should be done with complete name, but logically you should see what you searched in your results)
2013-05-23 17:36:41 -04:00
Lirusaito
99ea3facce Just some touch-ups to the radar, they compile and won't affect anything, but they'll help in the future. 2013-05-23 14:28:11 -04:00
Lirusaito
2b6f49a398 Warning missing a space between "avatar" and appended uuid was annoying me. 2013-05-22 21:52:19 -04:00
Lirusaito
ceea30977e Merge branch 'Frosting' of git://github.com/Lirusaito/SingularityViewer 2013-05-22 12:50:45 -04:00
Lirusaito
0509fdfdf2 Apparently the navmesh can be dirty when dynamic pathfinding is disabled... fixed the icons to anticipate this silliness. 2013-05-22 11:41:06 -04:00
Lirusaito
a0d6f11c4e Merge branch 'Frosting' of git://github.com/Lirusaito/SingularityViewer 2013-05-22 11:05:05 -04:00
Lirusaito
e3bd635510 Redid ScriptCounter entirely, should fix 182, if not just prevent the permanent failure condition.
Script Counter now shows the names of avatars in the user's desired format.
Adds "Count Scripts in Selection" to the Tools menu. (Can count for multiple objects, quite useful for land owners, no?)
Makes the Script Counting strings translatable. (ScriptCounting, ScriptCountAvatar, ScriptCountObject, and ScriptDeleteObject)

ScriptCounter is no longer a giant pile of static, it goes away when it has run its course and multiple instances can exist simultaneously.
Removes the silly unneeded parts of ScriptCounter, and thus removes it from llstartup.cpp
Adds some nice documentation in comments, and moves some log output to proper places (although I commented it out, it proved quite spammy for high primcount objects, initial loop runs super fast)
Trying to view this diff with no space changes is the best course of action, but even that will be tough...
Adds a header guard to scriptcounter.h
Hooks up menu function LLObjectVisibleScriptCount to Object.VisibleScriptCount, apparently this was never hooked up.... strange
2013-05-22 11:01:43 -04:00
Latif Khalifa
f03a76c3c4 Merge remote-tracking branch 'lirusaito/master' 2013-05-22 02:11:22 +02:00
Lirusaito
ea52583510 LLFloaterNewIM was no longer used, I plucked it out. 2013-05-21 19:09:41 -04:00
Aleric Inglewood
ed8fa9229f Merge remote-tracking branch 'singu/master' 2013-05-21 23:58:53 +02:00
Aleric Inglewood
cf4c4a72c2 Added AICapabilityType and related.
This splits the AIPerService queue up into four queues: one for each
"capability type". On Second Life that doesn't make a difference in
itself for textures because the texture service only serves one
capability type: textures. Other services however can serve two types,
while on Avination - that currently only has one services for everything
- this really makes a difference because that single service now has
four queues.

More importantly however is that the administration of how many requests
are in the "pipeline" (from approving that a new HTTP request may be
added for given service, till curl finished it) is now per capability
type (or service/capabitity type pair actually). This means downloads of
a certain capability type (textures, inventory, mesh, other) will no
longer stall because unapproved requests cluttered the queue for a given
service.

Moreover, before when a request did finished, it would only look for a
new request in the queue of the service that just finished. This simple
algorithm worked when there were no 'PerSerice' objects, and only one
'Curl' queue: because if anything was queued that that was because there
were running requests, and when one of those running requests finished
it made sense to see if one of those queued requests could be added now.
However, after adding multiple queues, one for each service, it could
happen that service A had queued requests while only requests from
service B were actually running: only requests of B would ever finish
and the requests of A would be queued forever.

With this patch the algorithm is to look alternating first in the
texture request queue and then in the inventory request queue - or vice
versa, and if there are none of those, look for a request of a different
type. If also that cannot be found, look for a request in another
service. This is still not optimal and subject to change.
2013-05-21 23:34:23 +02:00
Lirusaito
619b6723ea French Translation update, Merci Selvone et Nomade! 2013-05-21 07:31:27 -04:00
Lirusaito
58eee7e88b Translation cleanups and xml fixes
Removes some areas where grid-specific currency was not being used.
Removes old, obsolete files.
2013-05-21 05:41:51 -04:00
Shyotl
a8fb7e812a Fix rightclicking fully transparent prims when show-transparent is enabled. 2013-05-20 20:51:27 +02:00
Inusaito Sayori
ee785f0f17 Allow turning flying on and off while seated, if using Continue Fly On Unsit
Note: Redundant code, but these functions will likely be merged eventually(FUI-esque project), so it doesn't matter for now.
2013-05-20 12:14:58 -04:00
Inusaito Sayori
370b41e7b0 Fix Issue 448: Minimum window size too large 2013-05-20 10:09:27 -04:00
Inusaito Sayori
5c9286f460 Modernize and improve upon LLFloaterReporter to fix Issue 822: Report Abuse does not populate Region Name or screenshot correctly
Cleans up related bits in xmls/translations
2013-05-20 09:09:03 -04:00
Inusaito Sayori
6048c2405b Correct the (hopefully) last chat color issues~ 2013-05-20 08:39:51 -04:00
Shyotl
20af325e2c Increased horizontal axis ranges for fps and ktri statistics in statistics view. 2013-05-20 00:38:58 -05:00
Shyotl
c5fc945f33 Updated LLResizeBar and LLResizeHandle to use LLView::Param based ctors.
Cleaned up LLKeyWords
Cleaned up LLStatBar
Added per-account setting access to ui library
Added LLUICachedControl
Updated LLUIString
2013-05-20 00:36:34 -05:00
Inusaito Sayori
0c3f8f77e1 Fix the issue in which during conference chats the user's name is displayed as legacy, not linked, the wrong color, and their chat is not in their chosen color
Removes the "not sure why" block of code that sets the other_participant_id null if it's really from the user.
I have no idea why this ever was needed, it's a hack for certain, and only breaks things now.
2013-05-19 15:21:08 -04:00
Inusaito Sayori
c77c0b641b Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2013-05-19 12:26:07 -04:00
Inusaito Sayori
1ca2a567cd Improve upon the nametag system
Use the user-desired name with Resident stripped out, when on SecondLife grid.
When using legacy names without group titles, don't show the last name on a new line.
When using chat bubbles or typing bubbles, use the desired tag color.
2013-05-18 19:24:42 -04:00
Inusaito Sayori
8f3fe5dfae File mode fixes for some exe, plist, and glsl files. 2013-05-18 11:45:27 -04:00
Inusaito Sayori
949fa829c2 Improve enable_object_edit() so that the Edit pie menu entry doesn't take forever to enable
Bypasses pointless call to LLSelectMgr::getInstance()->selectGetAllValidAndObjectsFound()
Cleans up RLVa patch to read more clearly (this change is better viewed without spaces)
2013-05-18 10:57:19 -04:00
Latif Khalifa
f4261e35f4 Merge remote-tracking branch 'lirusaito/master' 2013-05-18 15:12:46 +02:00
Latif Khalifa
4f2534790c Merge remote-tracking branch 'shyotl/master' 2013-05-18 15:12:26 +02:00
Shyotl
df404c42d0 Migrated baser LLStat* classes and their LLContainerView dependency to llui library and renamed LLScrollableContainerView to LLScrollContainer 2013-05-17 16:46:40 -05:00
Shyotl
b1d69d05c3 Further pluggged in LLView::Params. For now just used for a few exclusively hard-coded elements. XUI parsing not yet implemented. New element registry not yet implemented. 2013-05-17 14:45:23 -05:00
Inusaito Sayori
00bbbe70a7 Fix a bug pointed out by LaMont Zuzu in which a texture dragged and dropped to one's profile image would be sent back to the user
Removes the unnecessary drop target and give item text in these cases.
On someone else's profile, you may drag and drop a replacement texture
On your profile, you have no reason to drag and drop an item, in fact this can cause bad inventory issues (yes, I've tested it)
2013-05-17 10:06:08 -04:00
Aleric Inglewood
74102e4964 Force running AIMeshUpload in the main thread.
I don't think it did -- but theoretically it could run in any thread
the way it was.
2013-05-17 15:07:45 +02:00
Aleric Inglewood
8688f6e772 Detect infinite loop. 2013-05-17 15:07:45 +02:00
Aleric Inglewood
ca66f44c0e Obscure bug fix. Not relevant in the current viewer code. 2013-05-17 15:07:32 +02:00
Inusaito Sayori
36e218cf19 One more git ignore needed, thanks Latif! 2013-05-17 04:03:42 -04:00
Inusaito Sayori
9742794d08 If possible, figure out the typing person's name according to the name system before showing that they are typing.
(IE: "Aur'a Færs (inusaito.kanya)is typing..." instead of "Inusaito Kanya is typing...")
This adds consistency between chat and messages, and should Resident strip in most cases.
2013-05-17 03:12:10 -04:00
Inusaito Sayori
0f2a4707a3 Add top level build directory to gitignore, and mode change on files that certainly shouldn't be executable. 2013-05-17 03:02:57 -04:00
Shyotl
182b15aee5 Forgot to put changes to pipeline.cpp into the previous vbo commit. Oh well. 2013-05-16 01:59:15 -05:00
Shyotl
2b30a5a4e7 Catch case in llaudioengine where audio buffers are released with channels still consuming them(A proper fix should be done to avoid this scenario in the future).
Added stricter checking for fmodex errors.
Demote a harmless message from llinfos to lldebugs when audio buffers are all consumed.
Initialize LLAudioBuffer member variables.
-LLAudioBuffer::mInUse is inited to TRUE to avoid buffers that just got created from getting deleted during the same frame by new audio sources further down the chain.
2013-05-16 01:58:35 -05:00
Shyotl
2bdd695d5f Updated LLVertexBuffer to match v3 a bit better. Let's see how it fares. 2013-05-16 01:42:45 -05:00
Shyotl
be29088103 Bad merge introduced superfluous drawable clearstate call. 2013-05-15 22:47:56 -05:00
Siana Gearz
42e42dedd7 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer 2013-05-14 10:04:31 +02:00
Siana Gearz
3c7f3b2af9 Speculative linux buildbot build fix 2013-05-14 10:00:44 +02:00
Lirusaito
048fe6e862 French translation update/cleanup 2013-05-13 06:05:39 -04:00
Siana Gearz
63f152e78d Merge branch 'master' of https://github.com/AlericInglewood/SingularityViewer 2013-05-13 02:43:49 +02:00
Lirusaito
a861a90013 Merge branch 'Frosting' of git://github.com/Lirusaito/SingularityViewer 2013-05-12 20:13:19 -04:00
Lirusaito
5730abb6c8 French Translation Update 2013-05-12 20:09:34 -04:00
Lirusaito
42a14952e7 Merge branch 'master' of https://github.com/LightDrake/SingularityViewer 2013-05-12 15:15:06 -04:00
Lirusaito
36e2ee5dfb Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into Frosting 2013-05-12 14:31:29 -04:00
Swiftkill
afa82fb0a5 updated secondlife:///app/group and secondlife:///app/agent namespaces to 2.0 2013-05-12 21:56:02 +04:00
Drake Arconis
eef53e3eac Merge branch 'master' of git://github.com/singularity-viewer/SingularityViewer 2013-05-12 10:08:49 -07:00
Drake Arconis
075bbe6831 NyanNyanNyan 2013-05-12 10:08:33 -07:00
Aleric Inglewood
67e88561dc Queue/throttle fix.
If AIPerService::add_queued_to fails because a new request is throttled,
then do not add the request to the end of the queue, nor remove it from
the queue: do nothing: it makes no sense to move the request to the back
because they all belong to the same service and all of them will be
either throttled or not.

Note: Still need to fix that in this case we should look in queues of
other services.
2013-05-12 18:10:49 +02:00
Aleric Inglewood
f8aac1f3dd Lets CurlEasyHandle::approved() stay consisten throughout its lifetime. 2013-05-12 17:56:29 +02:00
Aleric Inglewood
80c8eaab2a Ask approvement for each HTTP request.
The old code could do up till four requests with only one approvement.
Now we just start to assemble the four types of requests until either we
can get approvement for one, or one of them gets too large. This way we
still request everything in the same order, and at LEAST as many per
call as before, assuming we get the approvement of course.
The result should actually be faster because now we will request up to 5
folders or items per capability, and not spread those 5 out over 2 to 4
capability requests.
2013-05-12 16:51:48 +02:00
Lirusaito
5fc712104a Merge branch 'master' of https://bitbucket.org/SingularityViewer/singularityviewer into Frosting
Conflicts:
	indra/newview/linux_tools/wrapper.sh
2013-05-12 03:33:34 -04:00
Lirusaito
417dcb4e49 Frosting touchups
Cleaned up flaws in LLUUID
- Removed deprecated LLUUID::toString(char*) and LLUUID::toCompressedString(char*)
Cleaned up some comments
2013-05-11 23:14:16 -04:00
Lirusaito
9b5360a40b Chat Frosting
Basic Summary:
Issue 743: [Chat UI] Option to italicize actions (/me) in chat
- Adds debug LiruItalicizeActions, and a checkbox to Adv. Chat->Chat UI preferences
Issue 737: [Frosting] Annoyance Removal (Red beacon after teleport using LM's)
- Adds debug ClearBeaconAfterTeleport, checkbox under System->General
Issue 639: [Frosting] The agent isn't identified properly in chat
- Oh what a silly issue this was, it's as though whoever wrote this didn't care.
Fixes issue where names in logs do not match names in chat due to display name system
Fixes the issue in which Unnamed objects got named by a hardcoded string under certain circumstances.
Issue 813: [Frosting] When only accepting from friends, do not display incoming chat notification for nonfriends
- Also broke the setting out, separating it from the voice calls friend only setting
- Adds InstantMessagesFriendsOnly debug setting and checkbox in Adv. Chat->Chat/IM
Issue 764: Copy SLURL from Map returns correct region but wrong coordinates.
Satisfied the longstanding issue of inflexible autoresponse options.
- Autoresponse now has its own tab in Adv. Chat preferences: Busy, Muted, nonfriends, and anyone (or just friends) can have separate responses, along with items of your choosing.
- Prevent doubling up with the first repeated autoresponse due to typing message and normal message.

Translator Summary:
Adv. Chat->Chat UI->"Italicize action messages (/me)"
System->General->"Clear red destination beacon after teleporting"
Drop Targets for floater_ao.xml, panel_avatar.xml, panel_group_notices.xml, and panel_preferences_ascent_system.xml
Adv. Chat->Chat/IM->"Only accept IMs from Friends"
Please clean up the Busy Mode Response elements from panel_preferences_im.xml
strings.xml now has "IM_autoresponse_minutes"
Adv. Chat (panel_preferences_ascent_chat.xml) now has a new panel "Autoresponse", please clean up the old Autoresponse elements from Chat/IM tab and translate this panel.

Developer Summary:
Adds EChatStyle to LLChat, used for identifying what style a piece of chat is.
Update settings_per_account.xml
- Reorganized the ascent specific section.
- Removes a few old and unused settings
Better organize settings_per_account_ascent.xml
- TODO: Actually get this include system working and remove the Ascent specific section in settings_per_account.xml
Modernize LLDropTarget and make it more flexible and stand alone
- The Text of drop targets is now a child of the target itself, meaning the necessity of having a static instance to the parent is eliminated
- Drop targets are now one element in UI XML.
- Drop targets now have fill_parent option which allows the target to spread over the parent, while the text, tool_tip, and border stays in place
- If Drop Targets have a control_name, it is from the per account settings group, since Items must be in the inventory of the account in question.
- All drop targets now use the common LLDropTarget class instead of their own.
- LLGroupDropTarget is now derived from LLDropTarget and has its own tag group_drop_target.
Cleaned up the focus functions we use to focus the input bar, setInputFocus exists for their purpose.
Updated our llim* code to line up better with upstream and conform to styling.
Polished LLTracker and LLFloaterWorldMap a bit
Cleaned/Updated up LLStyleMap a bit.
Optimized autoresponse code:
- wildcards are now replaced via boost::algorithm::replace_all
- Autoresponse and related chat enhancements are now performed inside their case, instead of by the large if block above.
2013-05-11 22:36:46 -04:00
Aleric Inglewood
929badb110 Let statemachine honor approvements.
The inventory bulk fetch is not thread-safe, so the it doesn't start
right away, causing the approvement not to be honored upon return from
post_approved (formerly post_nb).

This patch renames wantsMoreHTTPReqestsFor to approveHTTPRequestFor,
and has it return NULL or a AIPerService::Approvement object.
The latter is now passed to the CurlEasyHandle object instead of just a
boolean mQueueIfTooMuchBandwidthUsage, and then the Approvement is
honored by the state machine right after the request is actually added
to the command queue.

This should avoid a flood of inventory requests in the case
approveHTTPRequestFor is called multiple times before the main thread
adds the requests to the command queue. I don't think that actually ever
happens, but I added debug code (to find some problem) that is so damn
strictly checking everything that I need to be this precise in order to
do that testing.
2013-05-12 04:19:44 +02:00
Siana Gearz
54983bcc89 Fixing some syntactic and build system stupidity 2013-05-11 23:40:26 +02:00
Siana Gearz
b344873954 Forgotten file and fix 2013-05-11 21:46:41 +02:00
Siana Gearz
c43dd499d0 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2013-05-11 20:45:00 +02:00
Siana Gearz
6c2d5eea30 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer 2013-05-11 20:39:06 +02:00
Siana Gearz
9183cffb44 Merge branch 'master' of https://github.com/AlericInglewood/SingularityViewer 2013-05-11 20:36:41 +02:00
Siana Gearz
e86f3a5cbd Starting war on std::map. Peeked at what NickyD and Zwag were doing. 2013-05-11 17:52:13 +02:00
Aleric Inglewood
3d63f9cd24 WIP on inventory background fetch 2013-05-11 16:04:34 +02:00
Aleric Inglewood
de1d44080d Fix terrain textures not updating after terraform or elevation range change. 2013-05-08 20:16:40 +02:00
Lirusaito
c13ed02ec8 Compile fixes (for GCC 4.8) 2013-05-08 00:55:50 -04:00
Lirusaito
f48eca366a Issue 773: Add option to update currently worn outfit 2013-05-08 00:47:55 -04:00
Lirusaito
29c2bc2bed It may be a little misleading, but Script Info in the attachment piemenu is useful
I hadn't committed it at first since it gives more than just information about the selected attachment,
and there was no way to scroll to the selected attachment in the list and highlight it,
but sometimes the avatar's body is covered in attachments, so the entry in the avatar body menu alone isn't enough.
2013-05-07 19:30:02 -04:00
Aleric Inglewood
d2af4a3c23 WIP: comment out llasserts.
This way my master isn't totally broken, at least ;).
2013-05-07 23:02:56 +02:00
Aleric Inglewood
5b1984ed0c WIP: Added AIPerService::Approvement 2013-05-07 19:36:10 +02:00
Aleric Inglewood
e3fec7c715 AIPerService improvements.
* Removed the 'RequestQueue' from other PerServiceRequestQueue occurances
  in the code.
* Made wantsMoreHTTPRequestsFor and checkBandwidthUsage threadsafe (by
  grouping the static variables of AIPerService into thread ThreadSafe
  groups.
2013-05-07 16:10:09 +02:00
Aleric Inglewood
410f9d92a5 Minor improvemnt of coding style. 2013-05-07 02:01:31 +02:00
Drake Arconis
47e83bf677 Merge remote-tracking branch 'LiruFox/master' 2013-05-06 11:44:21 -07:00
Siana Gearz
30332cff3f Sanitize cmake, cleanup develop.py 2013-05-06 06:07:23 +02:00
Drake Arconis
e0ef803ed5 Fix issue a different way and supress new gcc 4.8 warning 2013-05-05 19:24:13 -07:00
Aleric Inglewood
84e7f15dc5 Fix initialization list order (compiler warnings) 2013-05-06 03:26:22 +02:00
Drake Arconis
36416743d4 fix a buggy 2013-05-05 18:23:26 -07:00
Drake Arconis
73b10e6b29 Made compiler detection more reliable and cleanup clang warnings 2013-05-05 17:56:16 -07:00
Aleric Inglewood
1d629438c0 Add HTTP bandwidth throttling for every other responder.
Most notably getMesh (the only one possibly using any significant
bandwidth), but in general every type of requests that just have to
happen anyway and in the order they are requested: they are just passed
to the curl thread, but now the curl thread will queue them and hold
back if the (general) service they use is loaded too heavily.
2013-05-06 02:54:10 +02:00
Aleric Inglewood
75a45f501e Moved a part of AIPerService::wantsMoreHTTPRequestsFor to a new function.
The new function is AIPerService::checkBandwidthUsage.
No functional changes were made.
2013-05-06 02:54:10 +02:00
Aleric Inglewood
fd3e8e4a23 Preparation for AIPerService::checkBandwidthUsage.
Don't pass arguments to wantsMoreHTTPRequestsFor, but use globals in
llmessage: AIPerService::sHTTPThrottleBandwidth125 and
AIPerService::sNoHTTPBandwidthThrottling instead.

This is needed later on.
2013-05-06 02:54:03 +02:00
Aleric Inglewood
32a5494c79 Limit sMaxPipelinedRequests changes to once per 40ms, plus code clean up.
Mostly renaming stuff and moving static variables to class AIPerSerive.
2013-05-04 20:02:21 +02:00
Shyotl
6fb0c158de Fix rightclicking fully transparent prims when show-transparent is enabled. 2013-05-03 21:42:14 -05:00
Shyotl
e8ce35ebf8 Merge branch 'master' into UICleanup
Conflicts:
	indra/llcommon/llstl.h
	indra/newview/jcfloaterareasearch.cpp
	indra/newview/jcfloaterareasearch.h
	indra/newview/llfloateranimpreview.cpp
	indra/newview/llfloateranimpreview.h
	indra/newview/llfloaterperms.cpp
	indra/newview/llfloaterproperties.cpp
	indra/newview/llpanelpermissions.cpp
	indra/newview/llviewermenu.cpp
2013-05-03 21:41:51 -05:00
Shyotl
532fc68657 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2013-05-03 15:36:05 -05:00
Shyotl
525f3c6a1d Added new transformfeedback fasttimers, and disabled rasterizing when performing transform feedback. 2013-05-03 14:35:10 -05:00
Shyotl
808341e184 Testing: Be a bit more OCD about avoiding starting new streams before the previous one has been successfully been released. 2013-05-03 14:32:18 -05:00
Shyotl
701fc87c05 Minor cleanup and additional nullchecks. 2013-05-03 14:29:55 -05:00
Shyotl
31eb3e8d24 Cleaned up LLManipScale::nearestAxis to dodge a compiler crash that was found when playing with particular compiler options. 2013-05-03 14:28:20 -05:00
Latif Khalifa
a2df4b6693 Merge remote-tracking branch 'aleric/master' 2013-05-03 19:40:56 +02:00
Latif Khalifa
25dd719e39 Revert "Spot-fix the CAPS issue preventing UseHTTPInventory debug setting from working."
On-the-fly switching of UseHTTPInventory provided in patch by Aleric.

This reverts commit bdb74add3c.
2013-05-03 19:39:54 +02:00
Aleric Inglewood
4cc42cd5bd Fix for file-5.14 2013-05-03 19:05:31 +02:00
Aleric Inglewood
4983fd6ab6 Allow switching between HTTP and UDP inventory without relogging.
This also makes the viewer immune for grids that send the FetchInventory2 et al
capabilities regardsless of whether we requested them (in fact, we always
request them now: we need them when someone switches in the middle of a session).

Note that (I tested that) textures could already be switched between
HTTP and UDP without relogging.
2013-05-03 18:24:33 +02:00
Aleric Inglewood
673e96e829 Linux script fix at exit viewer. 2013-05-03 00:06:32 +02:00
Shyotl
b0778bf27e Template fun to compress our legacy menu<->floater glue. 2013-04-30 20:30:51 -05:00
Shyotl
b474b3c680 Avoid bogging down main thread with excessive LLInstanceTrackerBase::getInstances calls. 2013-04-30 20:27:03 -05:00
Melanie
bdb74add3c Spot-fix the CAPS issue preventing UseHTTPInventory debug setting from working. 2013-05-01 02:29:34 +02:00
Melanie
fc183be845 Add RLV toggle to prefs 2013-05-01 02:29:17 +02:00
Melanie
e00293baba Add the Limit Select Distance control to the input&camera panel 2013-05-01 01:56:36 +02:00
Melanie
ec266b895e XMLize the "Singularity" menu and add Rebake and Region Debug Console to it. 2013-05-01 00:23:10 +02:00
Aleric Inglewood
13e246611d Make refresh_desktop_app_entry.sh executable. 2013-04-30 22:48:32 +02:00
Aleric Inglewood
873b61c39d Fix comment. 2013-04-30 22:16:29 +02:00
Aleric Inglewood
60a47b8915 Merge remote-tracking branch 'singu/master' 2013-04-30 20:43:40 +02:00
Aleric Inglewood
0c7e62ab59 Add throttling to HTTP inventory (bulk) fetching.
Call AIPerService::wantsMoreHTTPRequestsFor in
LLInventoryModelBackgroundFetch::bulkFetch to determine if curl is ready
for the next batch or not, instead of using inaccurate heuristic code
that is just guessing a bit.
2013-04-30 20:36:00 +02:00
Aleric Inglewood
a1a019d319 Don't call LLInventoryModelBackgroundFetch::backgroundFetchCB unnecessarily
Remove LLInventoryModelBackgroundFetch::backgroundFetchCB from
gIdleCallbacks when we don't need it anymore.
2013-04-30 20:34:01 +02:00
Aleric Inglewood
3cedc7bb81 Stats floater fix up.
Add '(UDP)' after Objects, to show that this is UDP bandwidth.
Do not add the received HTTP texture bytes to gTextureList.sTextureBits,
making it (and the 'UDP Textures' graph) indeed pure UDP.
2013-04-30 20:30:46 +02:00
Aleric Inglewood
74023d5303 Compile fix.
Move the destructor (and copy constructor while I was at it) to the .cpp
file in order to avoid instantiating the destructor of
boost::intrusive_ptr<ThreadSafeBufferedCurlEasyRequest> from a header,
which would require the class ThreadSafeBufferedCurlEasyRequest
to be defined in that header, which is unnecessary. In other words,
this avoid the need to include "aicurl.h" in headers using
AIPerService[Ptr].

Also fixed indentation of a comment.
2013-04-30 20:23:42 +02:00
Aleric Inglewood
2a9c48d8d3 Add debug function 'is_single_threaded'
Usage:

AIThreadID foo(AIThreadID::none);

...

  llassert(is_single_threaded(foo));
...
  llassert(is_single_threaded(foo));
...
etc

The first call to is_single_threaded(foo) remembers the thread,
and after that it is enforced that any call from anywhere that uses foo
is done by the same thread.

If AIThreadID::none is omitted then the thread is enforced to the thread
that creates the AIThreadID.
2013-04-30 20:22:38 +02:00
Aleric Inglewood
19e16240d4 Less overshoot in HTTP bandwidth graph for higher values. 2013-04-30 19:13:06 +02:00
Latif Khalifa
e1df1b98f7 Merge remote-tracking branch 'aleric/master' 2013-04-28 23:35:30 +02:00
Melanie
c1e31c403e Make sure we only do a show in inventory if a sinle item is given. Enything else makes no sense or bombs 2013-04-28 23:32:17 +02:00
Melanie
2cfafadbcd Merge branch 'master' of github.com:singularity-viewer/SingularityViewer
Conflicts:
	indra/newview/hippogridmanager.cpp
	indra/newview/hippogridmanager.h
2013-04-28 20:32:58 +02:00
Melanie
aa996a3a1b Finally allow a very small communicate window to be saved and restored properly at the size the user set it. 2013-04-28 19:42:18 +02:00
Damian Zhaoying
3cb6e5fa9f Little fix in some spanish translations 2013-04-28 13:35:52 -03:00
Aleric Inglewood
1d2b3d3dc9 Derived classes may access this. 2013-04-28 03:31:16 +02:00
Melanie
77fdb895e6 Add CURRECY_TEXT definition and handling for internationalization 2013-04-27 02:39:39 +02:00
Damian Zhaoying
ecf87fd720 add new all spanish translations files 2013-04-26 20:51:14 -03:00
Damian Zhaoying
d2acf3c6a1 update and fix all spanish translations files 2013-04-26 20:03:28 -03:00
Aleric Inglewood
ebfb76c284 Renamed AIPerServiceRequestQueue[Ptr] to AIPerService[Ptr]
This because AIPerService now contains a lot more than just the request
queue.
2013-04-26 19:20:10 +02:00
Aleric Inglewood
6c1335af50 Moved connect limits per service to AIPerServiceRequestQueue.
Added AIPerServiceRequestQueue::mConcurrectConnections and
AIPerServiceRequestQueue::mMaxPipelinedRequests.
2013-04-26 19:13:18 +02:00
Aleric Inglewood
304e2b4958 Pass LLControlGroup* to AICurlInterface::startCurlThread instead of each Debug Setting separately. 2013-04-26 16:47:22 +02:00
Aleric Inglewood
fb2f0dd164 Add support for uploading .anim files.
Mostly works, but
indra/newview/skins/default/xui/en-us/floater_animation_anim_preview.xml
needs work (the 'Name:' should be at the top, not the bottom).

Also, it asks if you want to upload this as temporary. It shouldn't do
that.
2013-04-25 19:05:52 +02:00
Lirusaito
570c857128 XML corrections
French corrections
Correct Aleric's mistype of tool_tip
2013-04-25 04:38:53 -04:00
Latif Khalifa
b1ffc5b349 Merge remote-tracking branch 'lirusaito/master' 2013-04-25 07:27:13 +02:00
Latif Khalifa
dc4d458e87 Merge remote-tracking branch 'aleric/master' 2013-04-25 07:26:45 +02:00
Aleric Inglewood
e422a89de8 Bring back "Refresh Grid Info" button in grid manager.
If you clicked on 'Add' and then filled in the fields that say
'<required>'.. and then click on OK... Then all the URL's stay blank and
there is no way to fix that anymore (short of deleting the entry first
and NOT filling in the required name?!).

I added the button back to get the URL, at any time. Much more clear.
While at it, I added some tool tips and renamed 'Add' to 'Create'
because it confused the hell out of me to have a grid selected and then
needing to press 'Add' below that.. as if you add something to the
selected grid (Better would be to have the Add button above the
selector, or even be part of the selector drop down).
2013-04-25 03:32:48 +02:00
Shyotl
ef9fbe2193 Attempt to speed up agent idle update by optimizing wearable/visualparam related lookups/iterations a bit more.
Generalized several templates in llstl.h in order to support more containers.
Removed several instances of is_in_map/getWearableCount being followed immediately by another lookup with the same key. find is more efficient, as we get an iterator to use instead of a simple boolean.
2013-04-24 17:52:17 -05:00
Aleric Inglewood
45e6b7975f First version of HTTP bandwidth throttling.
Adds throttling based on on average bandwidth usage per HTTP service.
Since only HTTP textures are using this, they are still starved by other
services like inventory and mesh dowloads. Also, it will be needed to
move the maximum number of connections per service the to the PerService
class, and dynamically tune them: reducing the number of connections is
the first thing to do when using too much bandwidth.

I also added a graph for HTTP texture bandwidth to the stats floater.
For some reason the average bandwidth (over 1 second) look almost like
scattered noise... weird for something that is averaged...
2013-04-24 22:04:21 +02:00
Lirusaito
b0c331266d Merge branch 'Frosting' of git://github.com/Lirusaito/SingularityViewer 2013-04-24 14:22:35 -04:00
Lirusaito
0aeafdcca7 French Translation Update! 2013-04-24 14:17:31 -04:00
Lirusaito
bca8f830f2 Group Feature Request: Optionally display indicator over typing avatar's heads.
Adds Debug Setting UseTypingBubbles
Adds "Use overhead typing indicator bubbles" to Adv. Chat-> Chat/IM
Thanks to Firestorm for this simple addition
2013-04-24 14:15:00 -04:00
Lirusaito
3a4714edb1 File Menu Frosting~
Adds Minimize All, and Change Local Textures options
People keep adding how to do Local Textures, here's an easy way right where it'd be expected!
2013-04-24 14:09:04 -04:00
Lirusaito
464b1890f5 Update to linux_tools
Modernizes viewer_manifest.py
adds install.sh and refresh_desktop_app_entry.sh for those who want to "install" Singularity to their applications.
Updates client-readme-voice.txt to explain about Multi-Voice
2013-04-24 11:37:26 -04:00
Latif Khalifa
ec8212f472 Merge remote-tracking branch 'aleric/master' 2013-04-24 04:56:19 +02:00
Latif Khalifa
891417d0a5 Merge remote-tracking branch 'lirusaito/master' 2013-04-24 04:56:05 +02:00
Lirusaito
b60ee67b0c Make GCC 4.8 a little happier by removing a copy pasted pointless line 2013-04-23 22:14:56 -04:00
Melanie
9cd9fcdfbe Allow the export check box to show for rezzed objects in opensim - fixes a copypasta error 2013-04-24 02:47:07 +02:00
Aleric Inglewood
dc5e94812c Inline accessors of HippoGridInfo. 2013-04-23 21:50:51 +02:00
Aleric Inglewood
bbee0bfdd5 Add -Wno-sign-compare back. 2013-04-23 21:37:22 +02:00
Aleric Inglewood
27549584aa Merge remote-tracking branch 'singu/master' 2013-04-23 19:41:11 +02:00
Aleric Inglewood
96d8380099 Remove -Wno-sign-compare and fix DISABLE_FATAL_WARNINGS
Turn on sign-compare warnings and allow fatal warnings when
using -DDISABLE_FATAL_WARNINGS:BOOL=OFF during configuration.
The default is no -Werror.
2013-04-23 19:37:53 +02:00
Lirusaito
c7a9bd0f4f Translation updates 2013-04-23 09:23:23 -04:00
Latif Khalifa
1f58d1250f Merge remote-tracking branch 'lirusaito/master' 2013-04-23 12:57:33 +02:00
Latif Khalifa
f1ce3c89c3 Silence warnings 2013-04-23 12:57:02 +02:00
Latif Khalifa
a5bb6114b7 Merge remote-tracking branch 'siana/master' 2013-04-23 12:19:09 +02:00
Latif Khalifa
e0077b6941 Merge remote-tracking branch 'lirusaito/master'
Conflicts:
	indra/newview/llviewermessage.cpp
	indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml
	indra/newview/skins/default/xui/fr/panel_preferences_general.xml
2013-04-23 12:17:08 +02:00
Latif Khalifa
5396d17f2a Merge remote-tracking branch 'aleric/master'
Conflicts:
	indra/newview/lltexturefetch.cpp
	indra/newview/llviewerwindow.cpp
2013-04-23 12:13:54 +02:00
Siana Gearz
d6d5d5ae1b Bring back memory stat! Someone is a clobbermonster. 2013-04-23 11:46:44 +02:00
Lirusaito
24f08f7b0c Linux64 should be mentioned in the usage of repackage.sh 2013-04-23 04:47:48 -04:00
Melanie
ca95c68af5 A fix to the octopus - use dialog channel for value replies 2013-04-23 04:58:28 +02:00
Melanie
274c51c536 Serverside outfits, part tow - final - call a CAP if outfit is changed successfully 2013-04-23 04:52:51 +02:00
Melanie
6addfdfd93 Small bug fix - this could never work 2013-04-23 03:23:14 +02:00
Melanie
72db1a02b7 Fix audio the proper way 2013-04-23 03:16:31 +02:00
Melanie
ba6b2ef865 Revert "Add the new audio init code (experimental)"
This reverts commit 1bc887f887.
2013-04-23 03:15:59 +02:00
Melanie
df16ef39c5 Merge branch 'master' into Avination-4.0 2013-04-22 23:47:57 +02:00
Melanie
6296b5157b Limit the number of texture fetchers to two for Avination as this gives a better user experience (less timeouts) with AVN server side throttling. 2013-04-22 23:47:41 +02:00
Melanie
a4032e5e70 Add the option to dynamically enable/disable controls to the octopus 2013-04-22 23:47:34 +02:00
Melanie
7923323031 Limit the number of texture fetchers to two for Avination as this gives a better user experience (less timeouts) with AVN server side throttling. 2013-04-22 23:46:28 +02:00
Melanie
1934e49f99 Add the option to dynamically enable/disable controls to the octopus 2013-04-22 23:45:56 +02:00
Melanie
1b15b5bf5d Stage one of the new "change clothing" function. Introcuce an easy way to add generic packet handlers. 2013-04-22 15:02:23 +02:00
Melanie
1bc887f887 Add the new audio init code (experimental) 2013-04-21 05:55:47 +02:00
Melanie
cfe5236263 Remove info spam for empty event queue response - those can happen on opensim and we don't really need to know. 2013-04-21 05:55:15 +02:00
Lirusaito
bfb6e852a2 Added the serverside notifications that are localized now.
One snuck up on me, so I figured I'd add the bunch. Left out some at the end that looked like CHUI.
2013-04-20 22:09:50 -04:00
Melanie
fa5dba63dc Merge branch 'master' into Avination-4.0 2013-04-21 03:35:54 +02:00
Melanie
c216e75d23 Fix a duplicate element name (copypasta error) 2013-04-21 03:31:38 +02:00
Melanie
3f6e0580af Disable HTTP throttling for Avination as it's done serverside there 2013-04-21 03:31:29 +02:00
Melanie
fb781ab8f2 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-04-21 03:31:16 +02:00
Melanie
c38eb88915 Disable HTTP throttling for Avination as it's done serverside there 2013-04-21 03:30:27 +02:00
Melanie
43179bf853 Fix a duplicate element name (copypasta error) 2013-04-20 20:27:41 +02:00
Siana Gearz
e484904e3b Version 1.8.0 2013-04-20 14:44:01 +02:00
Siana Gearz
24047c933a No longer stall to death on unreadable streams 2013-04-20 13:27:32 +02:00
Latif Khalifa
41fba80cb5 More french translation updates 2013-04-20 08:51:15 +02:00
Melanie
11ba4d0d7d Merge branch 'master' into Avination-4.0 2013-04-20 08:08:53 +02:00
Melanie
3075429bca Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-04-20 08:08:40 +02:00
Latif Khalifa
abc60bb235 Merge remote-tracking branch 'shyotl/master' 2013-04-20 08:06:04 +02:00
Shyotl
c9f93a82ce Improved the logic in LLPipeline::updateDrawableGeom a bit. 2013-04-20 01:02:40 -05:00
Shyotl
39c4d9ad50 Merge branch 'master' of git@github.com:singularity-viewer/SingularityViewer.git 2013-04-20 01:01:26 -05:00
Shyotl
2121e78b45 Lessen occurrence of missing prims. Also added 'ctrl-shift-v' to rebuild vbos. 2013-04-20 01:00:24 -05:00
Melanie
37f3695e78 Merge branch 'master' into Avination-4.0 2013-04-20 06:40:51 +02:00
Melanie
1849b5ba1e Add isAvination() function to hippo grid manager 2013-04-20 06:40:16 +02:00
Latif Khalifa
2580aad939 Re-apply saphira's Linux build patch that somehow got lost in merges 2013-04-20 05:26:47 +02:00
Aleric Inglewood
0b86c9eec1 Merge remote-tracking branch 'singu/master'
Conflicts:
	indra/newview/llviewerwindow.cpp

c_str() dropped out (50f03d83c0).
Added it back.
2013-04-20 05:18:27 +02:00
Aleric Inglewood
368d675f24 Compile warning fix. 2013-04-20 05:07:44 +02:00
Aleric Inglewood
e12aaa3f5f Compile warning fix. 2013-04-20 05:06:30 +02:00
Aleric Inglewood
55a676e85d Compile warning fix. 2013-04-20 05:04:07 +02:00
Aleric Inglewood
9fb3fe21bc Compile warning fix. 2013-04-20 05:03:17 +02:00
Aleric Inglewood
8d028e6948 Fix for AIStateMachineThread (LLThreadSafeRefCount: deleting non-zero reference)
This fixes
https://code.google.com/p/singularity-viewer/issues/detail?id=736

The problem was that we need to keep the 'user' derived THREAD_IMPL
alive in the thread, and therefore used an LLPointer<THREAD_IMPL>
(as base class of AIStateMachineThread<THREAD_IMPL>), and therefore
THREAD_IMPL, derived from AIThreadImpl had to be derived from
LLThreadSafeRefCount. However, AIStateMachineThread<THREAD_IMPL> also
needed to be a statemachine of itself and is derived from
AIStateMachineThreadBase derived from AIStateMachine which is ALSO
derived from LLThreadSafeRefCount - that in this case wasn't really
needed. An attempt to deactive it by calling ref() from the constructor
of AIStateMachineThreadBase failed on the fact that LLThreadSafeRefCount
insists that its ref count mRef is exactly zero when it is being
deleted.

The chosen solution is to remove the ref count from AIThreadImpl and use
the LLThreadSafeRefCount base class of AIStateMachineThreadBase. The
result is that not only THREAD_IMPL, but also the state machine object
is kept alive, but that doesn't seem like a problem.

Thus, instead of passing a AIThreadImpl* to
AIStateMachineThreadBase::Thread, we now pass a
AIStateMachineThreadBase* to it to keep the whole of the
AIStateMachineThread<THREAD_IMPL> object alive, which has a THREAD_IMPL
as member now. This member then can be accessed through a virtual
function impl(). Another result of this change is that the 'user' (the
class derived from AIThreadImpl, THREAD_IMPL) now has to deal with the
LLPointer, and use LLPointer<AIStateMachineThread<THREAD_IMPL> >
instead of just AIStateMachineThread<THREAD_IMPL> and also allocate
this object himself. The access from there then changes into a -> to
access the state machine (as opposed to a .) and ->thread_impl() to
access the THREAD_IMPL object (as opposed to a ->).
2013-04-20 04:54:25 +02:00
Latif Khalifa
70eb45e923 Revert "TEMPORARILY disable erroring out during mesh upload"
This reverts commit 3bdeb8e8a8.
2013-04-20 04:53:44 +02:00
Latif Khalifa
7b42ad5e2a Demote assert and allow UDP fallback in case COF fetching times out 2013-04-20 04:49:18 +02:00
Latif Khalifa
f6f505d487 Merge remote-tracking branch 'shyotl/master' 2013-04-20 04:29:59 +02:00
Aleric Inglewood
e0aa3489f8 Fix for AIStateMachineThread (LLThreadSafeRefCount: deleting non-zero reference)
This fixes
https://code.google.com/p/singularity-viewer/issues/detail?id=736

The problem was that we need to keep the 'user' derived THREAD_IMPL
alive in the thread, and therefore used an LLPointer<THREAD_IMPL>
(as base class of AIStateMachineThread<THREAD_IMPL>), and therefore
THREAD_IMPL, derived from AIThreadImpl had to be derived from
LLThreadSafeRefCount. However, AIStateMachineThread<THREAD_IMPL> also
needed to be a statemachine of itself and is derived from
AIStateMachineThreadBase derived from AIStateMachine which is ALSO
derived from LLThreadSafeRefCount - that in this case wasn't really
needed. An attempt to deactive it by calling ref() from the constructor
of AIStateMachineThreadBase failed on the fact that LLThreadSafeRefCount
insists that its ref count mRef is exactly zero when it is being
deleted.

The chosen solution is to remove the ref count from AIThreadImpl and use
the LLThreadSafeRefCount base class of AIStateMachineThreadBase. The
result is that not only THREAD_IMPL, but also the state machine object
is kept alive, but that doesn't seem like a problem.

Thus, instead of passing a AIThreadImpl* to
AIStateMachineThreadBase::Thread, we now pass a
AIStateMachineThreadBase* to it to keep the whole of the
AIStateMachineThread<THREAD_IMPL> object alive, which has a THREAD_IMPL
as member now. This member then can be accessed through a virtual
function impl(). Another result of this change is that the 'user' (the
class derived from AIThreadImpl, THREAD_IMPL) now has to deal with the
LLPointer, and use LLPointer<AIStateMachineThread<THREAD_IMPL> >
instead of just AIStateMachineThread<THREAD_IMPL> and also allocate
this object himself. The access from there then changes into a -> to
access the state machine (as opposed to a .) and ->thread_impl() to
access the THREAD_IMPL object (as opposed to a ->).
2013-04-20 04:28:23 +02:00
Shyotl
91db5a854f Wrap std::filebuf to work with unicode filepaths on Windows. (Use UTF-16) 2013-04-19 21:27:47 -05:00
Lirusaito
b7c1b9f42b Added OverrideAnimations string, so that notifications present an actual permission QUESTION when asking for the perm.
Conflicts:

	indra/newview/llviewermessage.cpp
2013-04-20 03:45:15 +02:00
Melanie
2d717dcf17 Merge branch 'master' into Avination-4.0 2013-04-20 03:13:18 +02:00
Melanie
f83717255f Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-04-20 03:13:00 +02:00
Melanie
d593ebfa34 Add another menu insert point in the admin menu. 2013-04-20 03:12:49 +02:00
Melanie
35544cac74 Add another menu insert point in the admin menu. 2013-04-20 03:12:12 +02:00
Lirusaito
eac5a45562 Added OverrideAnimations string, so that notifications present an actual permission QUESTION when asking for the perm. 2013-04-19 20:10:05 -04:00
Latif Khalifa
3bdeb8e8a8 TEMPORARILY disable erroring out during mesh upload 2013-04-20 00:28:36 +02:00
Lirusaito
b8d2bd578c French translation update 2013-04-19 23:59:18 +02:00
Lirusaito
6c93dc1d82 Update LSL information (Adds new AnimationOverride) 2013-04-19 23:59:05 +02:00
Lirusaito
c79487d3da [Frosting] Modernize llpanelmsgs.* and the Popups Preferences
Makes the scrolllists multiselect, adds a disable button, rearranges the buttons, and maximizes vertical and horizontal use of real estate for scroll lists.
Finally notifications can easily be passed back and forth between the two lists
Removes the pointless alerts for explaining what "en/dis-able all" does.  If some language needs larger explanation, there's always tooltips, but it should be obvious enough without notifications.

As for code changes, this swaps a whole bunch of static functions over to boost::bind and removes includes.

Translators will need to update panel_preferences_popups.xml (and notifications.xml)
2013-04-19 11:49:29 -04:00
Lirusaito
4cb28f1dea Update/Sync in llviewermessage, makes more things auto-previewable, like in v3. 2013-04-19 11:21:32 -04:00
Lirusaito
8f3ff01703 Picked up changes from viewer-maint-2287
Adaptation of current merchant outbox project viewer to conform to Singularity's needs.

Adds the following commits by Merov Linden:
a5db366 MAINT-2287 : WIP : Implement a market place state
43fc74b MAINT-2287 : WIP : Fix compile issue
cb887fe MAINT-2287 : Fixed : Test the merchant/no merchant status without relying on outbox, Recreate missing outbox for a merchant, UI clean up on init.
f1934c0 MAINT-2301 : WIP : Catch a bit more 4xx and 5xx error codes, display the error code in the alert.
3fbbe6c MAINT-2301 : Fixed : Ignoring 499 timeout errors on POST (safe).
3dc6263 MAINT-2301 : Do not treat 404 errors (server returns not found) as 403 errors (forbidden, i.e. resident is not a merchant)
94039ee MAINT-2301 : Change messaging in the Merchant Outbox panel when an error happened, so not to be confused with the not-a-merchant case.
7c9cb2e MAINT-2452 : Fixed : Do not clear the cookie in IMPORT_DONE_WITH_ERRORS case so future retry have a chance to work.
67b872e WENG-618   : Added debug printout for POST and GET when InventoryOutboxLogging is turned on

Translators, you will need to update strings.xml and notifications.xml for this change.
2013-04-18 23:28:09 -04:00
Shyotl
7863484f10 Less prim peekaboo antics. 2013-04-18 17:25:27 -05:00
Shyotl
733b8e75ac Less prim peekaboo antics. 2013-04-18 23:44:25 +02:00
Latif Khalifa
7e66eb08cf Merge remote-tracking branch 'shyotl/master' 2013-04-18 23:24:40 +02:00
Lirusaito
b51615be20 Support Legacy Region/Estate Environment
Also Disable Environment Tab when the cap required to use it isn't supported.
2013-04-18 23:24:30 +02:00
Shyotl
0261f13670 LLSliderCtrl callbacks actually get the child LLSlider object, not the LLSliderCtrl object. 2013-04-18 16:02:10 -05:00
Shyotl
6f415118ef LLSliderCtrl callbacks actually get the child LLSlider object, not the LLSliderCtrl object. 2013-04-18 15:54:05 -05:00
Melanie
63b7b6ddc9 Merge branch 'master' into Avination-4.0 2013-04-18 06:04:52 +02:00
Melanie
ceade84fb0 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-04-18 06:04:30 +02:00
Shyotl
d1e86e66d8 Less prim peekaboo antics. 2013-04-17 22:32:53 -05:00
Melanie
4cf8780711 Merge branch 'master' into Avination-4.0 2013-04-18 05:19:15 +02:00
Melanie
765a4749c9 Allow the octopus to set a channel at floater level to disambiguate between simultaneously open floaters 2013-04-18 05:15:34 +02:00
Lirusaito
2b3350d686 Compile fix for internal pieces accidentally staged. 2013-04-17 22:21:07 -04:00
Lirusaito
22435b4b91 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into Frosting
Conflicts:
	indra/newview/llviewerwindow.cpp
2013-04-17 21:06:57 -04:00
Lirusaito
c9f235a5d9 French translation update 2013-04-17 21:00:32 -04:00
Lirusaito
11b4eb153c Support Legacy Region/Estate Environment
Also Disable Environment Tab when the cap required to use it isn't supported.
2013-04-17 19:42:56 -04:00
Melanie
5d3f50c307 Merge branch 'master' into Avination-4.0 2013-04-18 00:45:10 +02:00
saphira
50f03d83c0 Fix SuSe Linux build break 2013-04-18 00:44:50 +02:00
Lirusaito
5ac2a23b8d Update LSL information (Adds new AnimationOverride) 2013-04-16 20:16:44 -04:00
Latif Khalifa
110f502960 Merge remote-tracking branch 'shyotl/master' 2013-04-16 17:50:26 +02:00
Shyotl
11358746da Use legacy function pointer for old legacy setTextEntryCallback signature. 2013-04-16 10:49:56 -05:00
Melanie
88ef66f90f Merge branch 'master' into Avination-4.0 2013-04-16 17:49:49 +02:00
Latif Khalifa
e2a9d83b3e Merge remote-tracking branch 'melanie_t/master' 2013-04-16 17:35:44 +02:00
Melanie
0909bf1133 Remove the spammy leftover debug message. Thought I'd done that already... 2013-04-16 14:07:34 +02:00
Melanie
2803c4ddf6 Merge branch 'master' into Avination-4.0 2013-04-16 13:33:41 +02:00
Melanie
a2f7bee568 Extend the octopus to allow avatar pickers to be used. 2013-04-16 13:32:35 +02:00
Melanie
12b98eedbe Extend the octopus to allow avatar pickers to be used. 2013-04-16 13:20:24 +02:00
Latif Khalifa
97809b3a22 Merge remote-tracking branch 'melanie_t/master' 2013-04-16 12:53:37 +02:00
Melanie
ab2f06d64e Add some much needed parens 2013-04-16 12:50:22 +02:00
Melanie
ab29c73ff5 Hide the export check boxes when on SL. 2013-04-16 12:35:02 +02:00
Melanie
a52fdd0dd0 Extend the octopus to allow avatar pickers - step 1 2013-04-16 12:15:43 +02:00
Melanie
f921e551a2 Merge branch 'master' into Avination-4.0 2013-04-16 07:44:55 +02:00
Melanie
f960a79118 Kill some compiler warnings by removing three unused locals that were in there for debugging 2013-04-16 07:41:12 +02:00
Shyotl
a5dad6be5c UI cleanup.
-Added ui-local transformation matrix.
-Gutted legacy commitcallbacks throughout ui widget ctors.
-Created filter_editor ui widget which issues commit on keypress
   -search_editor commits on focus loss/enter press
   -search_editor and filter_editor now have a built in 'x' button to clear text.
-LLComboBox::setPrearrangeCallback now uses boost::function
-LLComboBox::setTextEntryCallback now uses boost::function
-LLLineEditor::setKeystrokeCallback now uses boost::function
-LLLineEditor::setPrevalidate now uses boost::function
-LLPanel::childSetKeystrokeCallback removed
-LLPanel::childSetPrevalidate removed
-LLPanel::childSetActionTextbox now uses boost::function
-LLTextBox::setClickedCallback now uses boost::function
-LLTextEditor::setKeystrokeCallback added.
-Cleaned up JCFloaterAreaSearch
2013-04-16 00:25:59 -05:00
Shyotl
4cbf8b16b6 Streaming FBO checkbox in preferences->graphics->advanced enable switch was inverted due to vbo rebuild being deferred to a later frame. 2013-04-16 00:21:12 -05:00
Latif Khalifa
c1d5f33a4c Merge remote-tracking branch 'shyotl/master' 2013-04-16 06:36:13 +02:00
Shyotl
f52b97d588 Fix llalertdialog.cpp (accidentally grabbed some changes that only work with future alterations I've yet to push to master.) 2013-04-15 23:29:51 -05:00
Melanie
e897fbcea5 Merge branch 'master' into Avination-4.0 2013-04-16 05:46:43 +02:00
Melanie
158a434899 Set focus in all necessary ways, not just the keyboard alone, when tabs are changed by alt-arrows 2013-04-16 05:45:27 +02:00
Shyotl
fed6639e44 Renamed SHAlphaMaskMaxRMSE to SHAutoMaskMaxRMSE. Disabled alpha masking on attachments. 2013-04-15 18:16:12 -05:00
Shyotl
75c1e74e48 Avoid using invalid iterator in LLNotifications::getChannel if channel is not found. 2013-04-15 18:12:15 -05:00
Shyotl
70e008bf98 Fix some subtle bugs in llrender. 2013-04-15 18:10:38 -05:00
Shyotl
e22e8d92b8 Disable AA when drawing ui. 2013-04-15 18:09:00 -05:00
Shyotl
d51b0f8701 Tweaked alert dialogs. Clicking 'x' issues a response. Either 'close', 'cancel', 'ok' or a dummy 'close' which will result in LLNotification::getSelectedOption returning -1 in callback. Listed in order of preference. 2013-04-15 18:06:46 -05:00
Melanie
09965b0cdf Add support for Avination's "Upload Credits" 2013-04-15 15:55:46 +02:00
Latif Khalifa
adb535421d Fixed build with DEBUG_CURLIO defined 2013-04-13 22:08:19 +02:00
Latif Khalifa
3a54d4b4ab Fixed windows build in debug mode 2013-04-13 22:07:45 +02:00
Melanie
0b70e32f15 Remove spammy debug - that part works now 2013-04-13 20:03:16 +02:00
Lirusaito
6f027c5535 commitCallbacks have the new value built in, let's not bother with childGetValue for the export check =^*^= 2013-04-13 20:03:05 +02:00
Lirusaito
2bc966ad24 Condensed export mask checks into boolean functions
Thins out that overly thick block of checks in the middle of LLPanelPermissions::refresh
Also corrected incorrect log output, after First stage comes contents not textures, Melanie.
2013-04-13 20:02:51 +02:00
Lirusaito
09e7017f06 Added handleVisibilityChange to LLPanelPermissions
TODO: Find out if this change is worthwhile by checking for log spam
2013-04-13 20:02:40 +02:00
Melanie
eacd1d7eb9 Fix export permission checks to look for face textures by asset ID 2013-04-13 20:01:57 +02:00
Melanie
469ef079b9 Fix export enable controls 2013-04-13 20:01:49 +02:00
Melanie
121de1fc12 Fix debug permissions display to show the transfer permission again. 2013-04-13 20:01:38 +02:00
Lirusaito
345c5c751c Space changes 2013-04-13 20:00:38 +02:00
Lirusaito
fd76b7bf20 Added simSupportsExport function
Hide E and export checked from regions without export support
No longer allow PERM_EXPORT from being added to default everyone permission flags if it's not supported by the sim.
2013-04-13 20:00:17 +02:00
Lirusaito
7e7190ce6e Such a silly mistake it's "checkbox allow export" not "checkbox export" 2013-04-13 19:59:47 +02:00
Lirusaito
5a8ab82257 Bit more cleanup in llpanelpermissions.cpp 2013-04-13 19:57:24 +02:00
Lirusaito
fec3b6c79f Space changes 2013-04-13 19:57:17 +02:00
Lirusaito
dd711d51c0 Clean up in llpanelpermissions.cpp 2013-04-13 19:57:08 +02:00
Lirusaito
d5e6f9950d Add Allow exportation checkbox to Default Upload Permissions floater.
Setting is per account and defaults to false.
2013-04-13 19:55:50 +02:00
Lirusaito
e7cf0b716d Permissions corrections. 2013-04-13 19:55:37 +02:00
Lirusaito
d269b66623 Space changes. 2013-04-13 19:54:41 +02:00
Lirusaito
9e6e801d49 Check if objects textures prevent it from being exportable. 2013-04-13 19:54:11 +02:00
Lirusaito
c67563dfe4 Bits and pieces
Disable next owner perms boxes when PERM_EXPORT
Added checks disabling the export toggle conditionally.
All cases covered except textures, couldn't figure that one out...
Mind the TODO's in the diff..
2013-04-13 19:53:58 +02:00
Lirusaito
11604ae5de Compile fixes.. I thought I'd done this... 2013-04-13 19:53:20 +02:00
Lirusaito
45f3a171be Enter PERM_EXPORT, stage right. 2013-04-13 19:53:02 +02:00
Lirusaito
15fea2ef54 Export perm added to UI!
Code added, Along with all the potential PERM_EXPORT bits...
Actual PERM_EXPORT bit still needs to be added.
SimulatorFeature comes next.
2013-04-13 19:52:44 +02:00
Latif Khalifa
3005b9dd2c Merge remote-tracking branch 'melanie_t/master' 2013-04-13 05:03:50 +02:00
Melanie
273f57d5a2 Fix chat focus issues once and for all 2013-04-13 04:59:02 +02:00
Aleric Inglewood
b5e70e11c4 Compile fix for libcwd 2013-04-12 20:55:54 +02:00
Lirusaito
8c49716eae Merge branch 'Cupcake' of https://github.com/LightDrake/SingularityViewer into Frosting
Conflicts:
	indra/newview/llviewerwindow.cpp - Also two compile fixes.
2013-04-10 13:26:48 -04:00
Lirusaito
fd9f8fa71f Cleanup and Synchronization (pre-merge wrap-up commit) 2013-04-10 09:14:16 -04:00
Lirusaito
c2046025e3 Tiny fix to the Scripts sub-piemenu 2013-04-10 05:39:21 -04:00
Aleric Inglewood
734d2e658d Rename HTTPTimeout::sClockCount (in clock ticks) to sTime_10ms (in 10ms units).
Note that HTTPTimeout::sClockWidth is no longer used for HTTPTimeout (as
if it's value became a constant of 0.01, the fraction 10ms / 1s).
A new variable, HTTPTimeout::sClockWidth_10ms is used to calculate
sTime_10ms (only).

Also HTTPTimeout::mStalled and HTTPTimeout::mLowSpeedClock changed units
to the same as of sTime_10ms (time since epoch in 10ms units).
2013-04-09 22:27:23 +02:00
Latif Khalifa
99bda78f37 Merge commit 'e9330f8a8752d6b6effce438204cd0d2e69a1d0f' 2013-04-09 19:56:55 +02:00
Latif Khalifa
9f897f0e2c Merge remote-tracking branch 'upstream/release' 2013-04-09 19:52:13 +02:00
Drake Arconis
eb25270df0 Only Aurora supports not having a last name. So lets just default it to Resident. 2013-04-09 10:51:11 -04:00
Drake Arconis
e9330f8a87 This should fix OSX blah blah 2013-04-09 08:12:13 -04:00
Lirusaito
b909a70413 [Frosting] Feature Request: Add Scripts sub-piemenu
Thanks in part to the FS team for already having something close, that made adding this all easier~
2013-04-09 00:31:00 -04:00
Lirusaito
f11f6618ab [Frosting:268] Sit via self pie menu 2013-04-09 00:25:42 -04:00
Aleric Inglewood
fce106f7e2 PerHost became PerService
Reflect the fact that we include port number in its name.
2013-04-09 05:06:32 +02:00
Aleric Inglewood
29a1d0e4e1 Renamed aicurlperhost.{cpp,h} --> aicurlperservice.{cpp,h}
Next commit will rename everything else.
2013-04-09 04:40:47 +02:00
Aleric Inglewood
bb948ce6d5 Use host:port as key for the "PerHost" request queue, instead of just the hostname.
Rationale: LL is doing all throttling per service (host:port), not per
service hostname. Also, textures and capabilities use the same host: the
sim you are connected to. Splitting the queues up on a per-service basis
will stop the textures from blocking a capability request.
2013-04-09 04:32:36 +02:00
Aleric Inglewood
3af89dd685 Temporarily add old bandwidth throttle method back. 2013-04-09 04:25:28 +02:00
Aleric Inglewood
748d339ee6 Move decision whether or not to add new HTTP request from texture fetcher to AICurl
After commit things compile again :).
The HTTP bandwidth throttling is not yet implemented. I'll put a
temporary fix back the next commit that just does it the "old way"...
2013-04-08 22:46:01 +02:00
Aleric Inglewood
8d6f5c6ffc Compile error fix.
Cannot pass non-trivially copyable type std::string through '...'.
2013-04-08 19:54:07 +02:00
Aleric Inglewood
9cc801f669 Added LLTextureFetchWorker::PerHostPtr
Points to the AIPerHostRequestQueue instance corresponding to the
hostname in LLTextureFetchWorker::mUrl. This is basically a cache as we
could of course just retrieve that instance from mUrl at any time,
everytime. Needed in a future commit.
2013-04-08 06:41:08 +02:00
Aleric Inglewood
79bcb1ec07 Print info in texture console about curl request queuing
This includes also non-texture requests (not sure if it's worth it to
explicitely separate this data for just textures).

The texture console now prints: HTTP:c/q/a/r
Where, c = number of 'add' request commands in the command queue
(minus the number of 'remove' request in the command queue and not
taking into account the command_being_processed, nor entirely being
thread-safe with regard to adding requests to 'q' or 'a' next: it is
possible that a request is no longer counted in 'c' but not yet is added
to 'q' or 'a'.
q = number of queued (throttled) requests (by the curl thread).
a = number of actually added requests (to the multi handle).
r = last returned value of 'running handles' by libcurl.

Obviously, c and q should be small (0 or 1) most of the time and a and r
should be equal and maxed out. This turns out to be the case.
2013-04-08 06:41:07 +02:00
Aleric Inglewood
c20e33c7f4 Added AIPerHostRequestQueue::queued_commands()
Returns the number of add commands minus the number of remove commands
in the command_queue for this host.
2013-04-08 06:41:07 +02:00
Aleric Inglewood
d26241c0f2 Move extract_canonical_hostname to AIPerHostRequestQueue::extract_canonical_hostname.
This to make it available to the texture fetcher.
2013-04-08 06:41:07 +02:00
Aleric Inglewood
7866c68ab2 Moved PerHostRequestQueue[Ptr] outside of AICurlPrivate.
Renamed PerHostRequestQueue and PerHostRequestQueuePtr to
AIPerHostRequestQueue and AIPerHostRequestQueuePtr respectively and
moved them to global namespace. This in preparation for using them in
the texture fetcher (as function of the hostname of the url that is
contructed there).
2013-04-08 06:41:07 +02:00
Aleric Inglewood
db7c378160 Added MultiHandle::sTotalAdded
This new variable is updated to contain the total number of requests in
MultiHandle::mAddedEasyRequests. It can be a static because MultiHandle
is a singleton (there is only one curl thread) and it has to be an
(atomic) static because we don't want to need to take the lock on
MultiHandle for accessing this variable.
2013-04-08 06:40:48 +02:00
Aleric Inglewood
6c9b136d32 Removal of HTTPRequestRate and dead code. 2013-04-08 06:39:52 +02:00
Aleric Inglewood
17455e2442 Add PerHostRequestQueue::sTotalQueued
The new variable is updated to contain the sum of the size of
PerHostRequestQueue::mQueuedRequests of every PerHostRequestQueue
object, and thus the total number of queued requests for all hosts
together.

Also added PerHostRequestQueue::host_queued_plus_added_size() which
returns the the sum of queued requests plus the requests already added
to the multi handle for this particular hostname.
2013-04-08 06:39:52 +02:00
Aleric Inglewood
f58bc148ba Add a 'size' to command_queue.
This adds a size (command_queue_st::size) to the ThreadSafe deque<Command> that was
AICurlPrivate::command_queue that is kept equal to the number of 'add'
commands in the deque minus the number of 'remove' commands in the
deque. The deque itself is now command_queue_st::commands.
2013-04-08 06:39:51 +02:00
Aleric Inglewood
07201a5cfe Add AICurlInterface::getNumHTTPRunning
Replaces LLTextureFetch::getNumHTTPRequests.
Returns AICurlInterface::Stats::running_handles.
This is work in progress that temporarily doesn't compile because
LLTextureFetch::getNumHTTPRequests is still being used somewhere.
2013-04-08 06:39:06 +02:00
Latif Khalifa
59a7c1cd9c Fixed windows build with the latest cmake 2013-04-06 17:59:42 +02:00
Latif Khalifa
fc4fcc9450 Merge remote-tracking branch 'shyotl/master' 2013-04-06 09:26:23 +02:00
Shyotl
b16bb264cc Added an experimental new alphamask detection method(set SHUseRMSEAutoMask to TRUE to use. Adjust SHAlphaMaskMaxRMSE to tweak cutoff). Fixed per-frame sky updates hammering analyzeAlpha. 2013-04-06 02:04:46 -05:00
Latif Khalifa
5ad2e32712 Merge remote-tracking branch 'lirusaito/master' 2013-04-05 23:11:30 +02:00
Nyx Linden
987ab9c07f SH-4059 FIX other's hover parameters affects your avatar's setting
Added an additional sanity check to make sure that other avatars don't
affect your wearables.
2013-04-05 23:10:17 +02:00
Nyx Linden
1a3e2ff18e SH-4050 FIX camera goes below ground when avatar offset set to 0
Added a constraint to ensure that the avatar's height (with offset)
does not go below 0.1 meters. Camera was getting confused since the avatar's
effective height was negative.

Note the avatar is mostly underground/contorted even at 0.1 meters, but
most users setting values this low will be making ultra-tinies and would
be hiding the avatar mesh. Camera stays above ground when height is at 0.1.

Conflicts:

	indra/llappearance/llavatarappearance.cpp
2013-04-05 23:10:16 +02:00
Nyx Linden
add9bb9945 SH-4044 FIX voice dot is offset vertically if using avatar height offset
Added the height offset in one too many places. fixing.
2013-04-05 23:10:16 +02:00
Lirusaito
da55a4a51c Fix Issue 726
Instead of focusing the chat bar when the chat history floater is visible, focus it onFocusReceived
This avoids the floater grabbing focus when returning from mouselook.
2013-04-04 18:31:35 -04:00
Lirusaito
fda82da3e9 Made mClickActionBuyEnabled and mClickActionPayEnabled CachedControl members, so they can be changed without a restart. 2013-04-03 08:23:23 -04:00
Lirusaito
0969f72bad Fix a bug in the pie menu, in v3 there is a separate pie menu for others' attachments, we don't have this yet. 2013-04-03 08:21:42 -04:00
Lirusaito
d064a54be3 [Frosting:288] Ability to left-click sit on one's own objects only.
Debug Settings DisableClickSitOtherOwner added.
Checkbox added to System Preferences for disabling click-to-sit on objects you don't own.

Also redid onCommitCheckBox a bit, best viewed without space changes.
There's more to this feature, but it doesn't work yet.
2013-04-02 18:54:16 -04:00
Latif Khalifa
82ecdd1079 Merge remote-tracking branch 'lirusaito/master' 2013-04-01 17:14:56 +02:00
Latif Khalifa
1fe3bf8357 Align whitespace with upstream in hope of avoiding future merge conflicts 2013-04-01 15:19:48 +02:00
Latif Khalifa
7e11ab9e95 Merge remote-tracking branch 'shyotl/master' 2013-04-01 14:44:07 +02:00
Latif Khalifa
7c7722a049 Merge remote-tracking branch 'aleric/master' 2013-04-01 14:43:59 +02:00
Siana Gearz
6d0fee3de9 War on ugly icon in inventory 2013-04-01 10:08:03 +02:00
Siana Gearz
9ce24b7ec5 Someone forgot to compact the wolf remote 2013-04-01 07:09:19 +02:00
Lirusaito
d3dce27077 [Frosting:268] Quick fixes to LLViewerMenu
Fixes Stand Up slice not being hooked up in attachment menu
Translators, please update the pie menu accordingly. userdata="Translate,These"
Also fixes an instance where Continue Flying On Unsit would be ignored
2013-03-31 19:48:34 -04:00
Shyotl
e2255f419d Commented out a spammy llinfos message. 2013-03-30 01:26:30 -05:00
Shyotl
b07ab02f54 Added blendfunc checks when RenderDebugGL is TRUE. 2013-03-30 01:26:07 -05:00
Shyotl
03272c8875 Clamp LLMeshSkinInfo::mJointNames to a max of 64 entries. Also checking size in lldrawpoolavatar(Redundant checks added to just match similar logic LLRiggedVolume::update more closely.) 2013-03-30 01:01:53 -05:00
Shyotl
1965224912 Stabbed some blendfunc state issues. This fixes some ui flicker which popped up recently (perhaps after merging, or I just never noticed it before then) 2013-03-30 00:57:49 -05:00
Nyx Linden
2d6bc052ab SUN-57 SH-4039 FIX bake fail on non-ssb regions
We were getting the texture ID from the type,index couple, but were not
passing in index, which defaulted to 0. texture ID is available from the
texture object itself, so using that and removing the index parameter
to prevent future confusion.

Conflicts:

	indra/newview/llvoavatarself.cpp
2013-03-30 00:42:43 +01:00
Brad Payne (Vir Linden)
201647e1cf SH-4001 FIX - made local texture loading universal.
Conflicts:

	indra/newview/llvoavatarself.cpp
2013-03-30 00:37:21 +01:00
Latif Khalifa
20fe807271 First re-apply "SH-3941 SH-3954 FIX local appearance does not update properly" 2013-03-30 00:30:07 +01:00
Lirusaito
b3c78b0ca5 Fix ups for 6525ccc384
If log_path is empty, we shouldn't setChatLogsDir to it.
In fact, this may have been the cause of something Nomade Zhao brought up.

Also, InstantMessageLogPathAnyAccount was accidentally being set as a PerAccount
2013-03-29 15:53:30 -04:00
Lirusaito
401ea93b57 ToolPie Frosting
Easiest read with Copy/Move detection and no space changes
Adds debug settings: DragAndDropDistanceThreshold, EnableGrab, ClickToWalk, ClickActionBuyEnabled, ClickActionPayEnabled
ClickToWalk was redefaulted to false, though if you are curious enough to read this, you should give it a try, it takes some getting used to but it might be fun.
2013-03-29 03:56:26 -04:00
Lirusaito
126eeb9244 Inventory Updates and Clean Up
Better viewed without space changes
Adds translatable inventory strings
2013-03-29 03:25:03 -04:00
Lirusaito
e44ba343a6 Further LLViewerMenu updates 2013-03-29 03:01:18 -04:00
Lirusaito
dff59ab455 Fix Issue 719: Calling Cards can be opened more than just one at a time 2013-03-29 01:18:48 -04:00
Aleric Inglewood
c14601f7c2 Avoid assertion in ~AIStateMachine upon viewer exit.
Force the state to bs_killed before clearing the list of statemachines
in AIEngine::flush().
2013-03-28 03:01:27 +01:00
Aleric Inglewood
ac84e02018 Do not use a timer for HTTP get in LLTextureFetchWorker::doWork
All HTTP timing is done by AIHTTPTimeoutPolicy.

Inside LLTextureFetchWorker::doWork when mState == SEND_HTTP_REQ,
mCanUseHTTP is true, throttling is not in effect and mURL is not empty,
mLoaded is set to FALSE, mState is set to WAIT_HTTP_REQ and
LLHTTPClient::request is called that starts the download by curl.
A call back to LLTextureFetchWorker::callbackHttpGet is guaranteed,
which causes mLoaded to be set to TRUE (HTTPGetResponder::completedRaw
calls LLTextureFetchWorker::callbackHttpGet which sets mRequestedSize to -1
(if there was an error) and mLoaded to TRUE).

Being in state WAIT_HTTP_REQ, once mLoaded == TRUE (and mRequestedSize
is -1), the different timeout errors are handled.
2013-03-27 22:37:21 +01:00
Aleric Inglewood
bbf24b4994 Indentation fix. 2013-03-27 21:45:09 +01:00
Lirusaito
d7c4ce6b0a Spanish translation fixies 2013-03-27 14:50:04 -04:00
Lirusaito
cce43326c3 French translation touchup 2013-03-27 14:20:44 -04:00
Latif Khalifa
f63286b333 Merge remote-tracking branch 'shyotl/master' 2013-03-27 10:16:30 +01:00
Shyotl
92cc65bf5e Decoupled rlva/setting based z-offset from param based z-offset. This reverts questionable changes introduced in the recent rlva merge. 2013-03-27 01:36:23 -05:00
Shyotl
60f1bada3d Undo a bit of regression in llphysicsmotion 2013-03-26 23:10:26 -05:00
Aleric Inglewood
41a0681768 Revert "Snapshot floater aesthetics"
This reverts commit 63dcd7ba32.

That commit is nonsense and only shows that Liru has no clue what he is
doing when it comes to the snapshot stuff :/.

And no, I wasn't even AWARE he made this commit, I was just happily
exploring and wanted to make a few snapshots when I suddenly noticed
that several things were BROKEN: the aspect that the fullscreen preview
was shown with was wrong, and when I wanted to limit the aspect of my
feed upload that wasn't possible anymore ?!?!??  WTF

Please don't screw up the hard work of others without at LEAST first
consulting them.
2013-03-27 02:22:48 +01:00
Aleric Inglewood
fa05647068 Compile fix 2013-03-27 00:56:28 +01:00
Latif Khalifa
303840f729 Merge remote-tracking branch 'shyotl/sunshine'
Conflicts:
	indra/llappearance/llavatarappearance.cpp
	indra/newview/character/avatar_lad.xml
	indra/newview/llagent.cpp
2013-03-26 23:54:36 +01:00
Aleric Inglewood
779f697ffb Fix yield_ms().
This fixes
https://code.google.com/p/singularity-viewer/issues/detail?id=714

The problem was a typo in AIStateMachine::sleep, >= should have been <=
which caused a state machine that uses yield_ms() to never run anymore
when next run it already should have run again. AIFilePicker is the only
state machine that currently uses yield_ms and I hadn't spotted this
because I don't have plugin messages on by default which made my viewer
just that much faster that it the yield never expired the first run
already (causing it to expire immediately).

The rest of the changes in this commit are just minor improvements /
conformation to the EXAMPLE_CODE in aistatemachine.cpp.
2013-03-26 23:30:04 +01:00
Lirusaito
b80a509ae2 Fix Issue 702: Copy Paste Parameters glitch
Also improves the related code.
It seems the main problem was calling updateVolume before setting sculpt params because this call relies on the isSculpted()
2013-03-26 18:16:50 -04:00
Aleric Inglewood
524fdf033d Merge remote-tracking branch 'singu/master' 2013-03-26 21:10:00 +01:00
Shyotl
441b564afe RLVa update. 2013-03-26 00:46:11 -05:00
Shyotl
1705167998 Fixed non-debug compile. 2013-03-24 23:20:40 -05:00
Aleric Inglewood
b20886a481 Allow TOS redirect. Fix upload finished detection when redirecting.
This fixes https://code.google.com/p/singularity-viewer/issues/detail?id=705

Adds 'bool redirect_status_ok(void) const { return true; }' to LLIamHere,
because it's ok to receive a 302 status there. Likewise added to LLIamHereVoice,
because that has the same comment in its error() method.

Also fixes the problem that if two redirects occur on a row, then the
upload_finished detection asserted because it would detect the third
time that libcurl turned off writing to the socket as a failure (the
second time wasn't a problem because mUploadFinished was reset upon
receiving the first 302 header, but not upon receiving the second
header).
2013-03-25 04:41:07 +01:00
Lirusaito
16babd38e0 Phantom Avatar no longer works, not on SL, not on OpenSim. Bye Phantom~ 2013-03-24 12:44:29 -04:00
Lirusaito
7aa0b439a8 Updates and clean up and frosting, oh my~
Removes old code for permitting emerald attachment points
Removes other old dead code...
Updates RLVa a bit.
Adds more translation flexibility via strings.xml
2013-03-24 12:29:58 -04:00
Latif Khalifa
cfa3766bc7 Quick fix for the Mac build.
TODO: Make this version dependant so it works with newer Xcode too
2013-03-24 17:11:03 +01:00
Latif Khalifa
ea4f2ec7a7 Merge remote-tracking branch 'origin/sunshine2' 2013-03-24 14:23:18 +01:00
Latif Khalifa
97c340be54 Merge remote-tracking branch 'lightdrake/CupCake' 2013-03-24 14:22:44 +01:00
Latif Khalifa
afc137bb3f Merge remote-tracking branch 'aleric/master' 2013-03-24 14:22:28 +01:00
Latif Khalifa
db497ccf57 Merge remote-tracking branch 'lirusato/Frosting' 2013-03-24 14:22:02 +01:00
Aleric Inglewood
2916d9353e Comment fix. 2013-03-23 22:22:38 +01:00
Aleric Inglewood
d526d388ef Make AIRegisteredStateMachines more robust.
Now that a call to cont() can schedule a run of the statemachine, we
need this change to make it robust (the comment that cont() does never
access mRegisteredStateMachines no longer holds).
2013-03-23 22:17:27 +01:00
Drake Arconis
43ed77f4d5 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer into Cupcake 2013-03-23 11:05:20 -04:00
Latif Khalifa
ef6549ce32 Set default network buffer size to 6000ms for music streaming 2013-03-22 22:43:31 +01:00
Latif Khalifa
f1cf73b8af Reverted addition of soon to be obsolete way of setting z offset to quick prefs 2013-03-22 22:40:37 +01:00
Latif Khalifa
40133643c0 Revert "SH-3941 SH-3954 FIX local appearance does not update properly"
This causes SUN-57

This reverts commit 707f3959f9.
2013-03-22 21:52:17 +01:00
Drake Arconis
91b3cdde39 Unbreak non-debian derived and standalone linux 2013-03-21 16:55:25 -04:00
Aleric Inglewood
712c46a74e Add comment with regard to LLSD in the body of pages with an HTTP error code. 2013-03-21 20:56:21 +01:00
Aleric Inglewood
835240fda1 Fix crash in LLTextureFetch::getWorker upon viewer exit.
This is now necessary since the curl thread no longer syncs with the
main thread: it is possible that a request finishes after a texture
fetch thread was shot down but before curl was stopped, and curl
calling BufferedCurlEasyRequest::processOutput while objects that the
responder uses were already destructed (most notably
LLTextureFetch itself).
2013-03-21 20:26:01 +01:00
Aleric Inglewood
00b223f2a4 Do not request empty folders.
Doing this resulted in a 404 on Aditi, and although that was a server
bug; it still doesn't seem to make much sense to do the request in the
first place.
2013-03-20 22:51:11 +01:00
Lirusaito
212faab988 Merge branch 'Cupcake' of https://github.com/LightDrake/SingularityViewer into Frosting 2013-03-20 09:01:37 -04:00
Lirusaito
f87a967c0d Pathfinding UI: Fix the open with selection via pie menu bug.
Also comments out an unnecessary excess call.
2013-03-20 08:37:06 -04:00
Drake Arconis
5dd957f117 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into Cupcake 2013-03-20 08:31:21 -04:00
Drake Arconis
0eeddb0607 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer into Cupcake
Conflicts:
	indra/newview/llappviewer.cpp
2013-03-20 08:31:04 -04:00
Lirusaito
c2b3322594 Pathfinding UI: Hide Capsule doesn't seem to work without havok 2013-03-20 08:30:36 -04:00
Aleric Inglewood
4be1d057bc Fix windows compile warnings. 2013-03-19 23:59:15 +01:00
Aleric Inglewood
06730d1a7e Fix recursive calls to LLWaterParamManager::initSingleton and LLWLParamManager::initSingleton 2013-03-19 22:44:01 +01:00
Aleric Inglewood
fc642019b3 Fix recursive call to LLNotifications::initSingleton 2013-03-19 19:56:20 +01:00
prep
7ef75fef4f Fix for sh-4014. This was a regression caused by fix for sh-3650. 2013-03-19 19:20:06 +01:00
prep
45e6c3f2e4 modified_cof_cb() issues a updateAppearanceFromCOF() right before this function - removed extra update call. Sh-3650 & Sh-3985 2013-03-19 19:19:17 +01:00
Nyx Linden
707f3959f9 SH-3941 SH-3954 FIX local appearance does not update properly
We were using an indicator of whether there *was* a baked texture to whether we
were *using* a baked texture. Switched to one of the (several) proper indicators
of whether a baked texture was in use. This should allow local texture data to
get marked for download when we enter appearance mode.

Local testing confirms that old apperances linger for a second or two, but are
soon replaced by the correct local renders.
2013-03-19 19:13:51 +01:00
Nyx Linden
554a03d569 SH-3649 WIP newly created pants do not show up on mac/windows.
Added an initializer for the wearable definition version when creating a new wearable.
Should fix the issue but need to test.
2013-03-19 02:20:58 +01:00
Nyx Linden
0866685971 SH-3954 SH-3941 SH-3910 FIX local appearance does not update
We suppress texture downloads for local textures not needed with server side
baking. We need to explicitly re-set texture priority for local textures
when entering appearance mode.
2013-03-19 02:20:17 +01:00
Brad Payne (Vir Linden)
bb528a4398 Periodic log messages to explain why user is still clouded, if they are 2013-03-19 02:19:53 +01:00
Brad Payne (Vir Linden)
4179730552 Increase number of retries for requestServerAppearanceUpdate() 2013-03-19 02:14:40 +01:00
Nyx Linden
9ff1c8b879 SH-3798 FIX avatar skins look dull
Wearable parsing error caused last texture in some assets to fail to parse.
Parser now does not throw an error if the wearable does not end in a newline
2013-03-19 02:09:23 +01:00
Nyx Linden
07850410b5 SH-3909 Support avatar height offset
Adding a new visual param that allows users to manually adjust an offset for
how far off the ground (+ or -) their avatar's root bone is.

Supports the +-2m range people are used to adjusting in their viewers, but
new implementation should support server-generated appearances.

Conflicts:

	indra/newview/character/avatar_lad.xml
	indra/newview/llagent.cpp
	indra/newview/llcallingcard.cpp
	indra/newview/skins/default/xui/en/strings.xml
2013-03-19 02:06:22 +01:00
Shyotl
13d55cbeba Changed several setting lookups to cachedcontrols in LLAgentCamera 2013-03-14 14:38:23 -05:00
Shyotl
1dbaa19e99 Reworked control variable lookup profiling. Should practically be free, and is now enabled for relwithdebinfo. Use dumpcalls for output. 2013-03-14 14:37:20 -05:00
Lirusaito
b0459b08b6 Fix up a bunch more run-time UI warnings. 2013-03-14 05:24:10 -04:00
Drake Arconis
20cdb35172 Import some changes from internal 2013-03-12 06:03:06 -04:00
Drake Arconis
9bce5d479a Merge remote-tracking branch 'Lirusaito/master' into Cupcake 2013-03-12 01:47:14 -04:00
Drake Arconis
ce7966b750 Merge remote-tracking branch 'Lirusaito/Frosting' into Cupcake 2013-03-12 01:36:59 -04:00
Lirusaito
655e0bc30d Apollo skin upkeep 2013-03-12 01:27:06 -04:00
Lirusaito
2ae966fe6b Strings fix ups
Order was a little incorrect
Minor change to hippogridmanager.cpp
2013-03-12 01:26:19 -04:00
Drake Arconis
e08f4316ab New lsl function added 2013-03-12 01:08:03 -04:00
Lirusaito
ca71bf00c2 Fix for Issue 694, use gSavedSettings instead of restricting globals.
Removes gAllowTapTapHoldRun and not much else we may want to remove a few more in the future, though.
2013-03-12 01:04:09 -04:00
Drake Arconis
98641d5d54 Fix small copy paste buggy 2013-03-12 00:59:24 -04:00
Drake Arconis
aac7fa84c2 Added per skin lsl highlighting and move function color to an actual color 2013-03-12 00:46:18 -04:00
Drake Arconis
e93bddcbed Update lsl keywords 2013-03-12 00:45:47 -04:00
Drake Arconis
d345630b2c Merge remote-tracking branch 'Aleric/master' into Cupcake 2013-03-11 19:55:38 -04:00
Drake Arconis
8c09a3c6af Rip out emerald boob physics 2013-03-11 19:21:45 -04:00
Drake Arconis
e6ee833d45 Add in droid sans license file 2013-03-11 03:44:32 -04:00
Aleric Inglewood
7de15e7acd Update AIHTTPTimeoutPolicy objects when their base changes.
Actually propagate changes to CurlTimeout* Debug Settings to the timeout policy objects.
2013-03-10 20:59:48 +01:00
Aleric Inglewood
5a8308109b Lowered CurlTimeoutLowSpeedLimit from 56 kB/s to 7 kB/s.
This value really IS in bytes/s (not for the total), and apparently 56
kB/s is too optimistic. The value was used by LL for transfers that went
beyond the total download time (2 minutes?), adding enough seconds per
received bytes to the timeout to allow a download at 56 kB/s to finish.

Our meaning is different however: we time out immediately and whenever
the download drops below this speed.

Perhaps a better algorithm is where the speed demand is based on the
total size of the download, but I'm not sure we always know the size of
downloads at this point.
2013-03-10 17:45:39 +01:00
Aleric Inglewood
7dfef31469 Possible upload timeout improvement.
When uploading finishes, but is not detected, the timeout should be for
"reply delay", the time that the server takes before it replies, and not
CurlTimeoutLowSpeedTime. This patch adds code that takes this failure
into account (which happened only ONCE for me on Metropolis while flying
around and using trickle (not sure if that is relevant), so it's not
that likely to improvement anything in practise. Note that it is
detected by an assertion when it happens, so that we can safely assume
it normally never happened on SL).

* Generalized PUT / POST configuration by adding
  CurlEasyRequest::setPut, which now also supports keep-alive (which
  still isn't used).
* Upload content length is now stored in CurlEasyRequest::mContentLength
* CurlEasyRequest::has_stalled() now return false if it was possbile
  that the 'upload finished' detect failed AND calls upload_finished()
  itself in that case, so it is no longer 'const'.
* If low speed is detect exactly when the last bytes are being attempted
  to be sent (unlikely scenario), then the upload gets 4 more seconds
  after which is switches to CurlTimeoutReplyDelay.
* Added EDoesAuthentication and EAllowCompressedReply to replace
  booleans, for readability and type-safety, as did EKeepAlive. Note
  that this change inverts the meaning of the compression related parameter.
* Unrelated: removed an unnecessary #include "llurlrequest.h" from
  llxmlrpcresponder.h
2013-03-10 16:43:15 +01:00
Aleric Inglewood
96d302aa42 Be more verbose about internal (curl / timeout) errors.
Translates the CURLE_WRITE_ERROR into what it really means: that the low
speed check failed.
2013-03-09 05:26:52 +01:00
Aleric Inglewood
df93ebb8f6 Bug fix for AIStateMachine.
When a state machine is aborted after it switched to bs_initialize,
but before it executed initialize_impl(), then we should set the
state back to bs_reset and abort cleanly by switching to bs_killed
and then handle that. Before the state was set to bs_abort, resulting
in calling abort_impl(), finish_impl(), the call back and unref()
for an not initialized state machine! (detected by the assert that
makes sure that ref()/unref() are called in balance).
2013-03-09 04:20:54 +01:00
Lirusaito
d2c7ee8b45 Warning fixfix~ 2013-03-08 14:51:17 -05:00
Aleric Inglewood
50caf98cd6 Dont enter AIStateMachine::multiplex recursively. 2013-03-08 16:58:25 +01:00
Lirusaito
78e1804381 Add Pathfinding UI from v3
Added libpathing to LLPHYSICSEXTENSIONS_INCLUDE_DIRS
llviewermenu updated a bit to be closer to v-d/rlva. Best viewed without space changes.
Updated llresmgr.cpp from v-d to "handle special case of input value being zero"
pipeline update: hideObject, restoreHiddenObject, hideDrawable, and unhideDrawable added.

Thanks to Henri Beauchamp for some UI code touchups, thanks to Zi Ree for Rebake notification.
Thanks to Mobius Ryba and Ansariel Hiller for the V1-style pathfinding icons.

Note: When opening from pie menu object selection is lost, unless the floater is already open..
This provides a more reliable reproduction of the bug we've been having with inspect.
2013-03-08 03:17:11 -05:00
Lirusaito
95bd81ee7e Merge branch 'Cupcake' of https://github.com/LightDrake/SingularityViewer into Frosting 2013-03-08 02:57:48 -05:00
Lirusaito
06a73061ce More UI warnings fixup stuffs 2013-03-08 01:20:15 -05:00
Aleric Inglewood
933ca23348 Bug fix for ASSERT(previewp->mFormattedUpToDate || ret == SIZE_TOO_LARGE || ret == ENCODING_FAILED) 2013-03-08 03:37:00 +01:00
Lirusaito
bede980527 Fix Issue 689: ATTACH_NECK and ATTACH_AVATAR_CENTER are missing strings 2013-03-07 20:58:15 -05:00
Lirusaito
63dcd7ba32 Snapshot floater aesthetics
Restores the cancel button with new functionality! In Freeze mode, it will exit freeze! Otherwise it will just close the floater as it used to do.
Lines up everything nicely, and removes overly complex tool tips.
Does not change or remove any existing functionality.
2013-03-07 20:43:33 -05:00
Aleric Inglewood
e8ef74156a Added print_statemachine_diagnostics
The responder name is now cached in LLURLRequest
(ResponderBase::getName() must return a string literal).
The run time (in the main thread) per state machine is now accumulated
in AIStateMachine (instead of AIEngine::QueueElement).
When AIStateMachine::mainloop runs longer than StateMachineMaxTime
then a warning is printed that now includes the time spent in the
slowest state machine (that frame) and (if it is a LLURLRequest)
what the corresponding responder is. Also the total accumulated run
time of that state machine is printed.

From this is can be concluded that the only responder currently
regularly holding up the main thread is LLMeshLODResponder (mostly 30 to
100 ms, but with spikes in the 1 to 2 second range some times).
2013-03-08 01:50:02 +01:00
Aleric Inglewood
e3f4022ffa Merge remote-tracking branch 'singu/master'
Conflicts:
	indra/newview/llvoavatar.cpp

Bug fix is no longer needed.
2013-03-07 16:53:15 +01:00
Drake Arconis
b4356107ed Updated droid sans to current version 2013-03-07 10:46:39 -05:00
Aleric Inglewood
dd42577a2a Fix crashlogger wrt AIEngine. 2013-03-07 13:50:36 +01:00
Aleric Inglewood
f52e055414 Merge branch 'master' into curlthreading4 2013-03-07 13:49:42 +01:00
Aleric Inglewood
65d750b190 Add CPU cycles to AIStateMachine in the crashlogger
Also removes unused Debug Setting CurlMaximumNumberOfHandles.
The maximum number of handles is limitted by
CurlMaxTotalConcurrentConnections.
2013-03-07 13:44:40 +01:00
Lirusaito
661e135778 Restore DEV-12255 patch
Refresh the snapshot when calling show after instance exists (IE: Via Keyboard shortcut)
Should never have been removed in the first place, the purpose of 7faa19b297 was to have an explicit click to refresh, this patch requires an explicit click.
This does NOT break keeping the same snapshot while switching settings
2013-03-07 07:44:38 -05:00
Drake Arconis
f6713559e9 Some minor llfont cleanup..more to come 2013-03-07 01:41:42 -05:00
Drake Arconis
394d8afa17 Well this explains why fonts look like ass in v3 2013-03-06 23:42:14 -05:00
Aleric Inglewood
4e0269b3d0 Bug fix in debug code. 2013-03-07 05:23:23 +01:00
Aleric Inglewood
58c07f8054 Don't return from abort() until the current execution, if any, finished. 2013-03-07 04:20:17 +01:00
Aleric Inglewood
380eec10fb Initialize mDebugRefCalled on restart. 2013-03-07 02:23:23 +01:00
Aleric Inglewood
b9b5f13624 Run HTTPGetResponder in any thread.
This fixes a bug where unref() was called when a state machine was
aborted before it reached bs_initialized. Debug code was added to detect
errors related to that.

In order to run HTTPGetResponder in any thread, I needed direct access
to LLHTTPClient::request, so I had to move that to the header file,
and therefore had to move ERequestAction from LLURLRequest to
LLHTTPClient to avoid include problems.

With this, textures are fetched with no latency: call to
LLHTTPClient::request runs all the way till the state machine is idle
(AICurlEasyRequestStateMachine_waitAdded). There is small delay till the
curl thread wakes up, which then processes the request and opens the url
etc. When the transaction is finished, it calls
AIStateMachine::advance_state(AICurlEasyRequestStateMachine_removed_after_finished)
which subsequently doesn't return until the state machine is completely
finished (bs_killed). The LLURLRequest isn't deleted yet at that point
because the AITimer of the LLURLRequest runs in the main thread: it is
aborted, but only the next time the main thread state engines run that
is deleted and the timer keeps an LLPointer to it's parent, the
LLURLRequest, so only then the LLURLRequest object is destructed. This
however has nothing to do with the texture-bandwidth loop.
2013-03-07 01:52:21 +01:00
Lirusaito
6153beabff Fix logic in toggle_active_speakers. 2013-03-06 05:06:36 -05:00
Lirusaito
00e5fc1632 Byebye run-time warnings from llgivemoney.cpp 2013-03-05 22:15:53 -05:00
Aleric Inglewood
4cd7dec92b Merge branch 'master' into curlthreading4
Conflicts:
	indra/aistatemachine/aistatemachine.cpp
	indra/aistatemachine/aistatemachine.h
	indra/llmessage/aicurleasyrequeststatemachine.cpp
2013-03-06 03:34:05 +01:00
Aleric Inglewood
c4dceaf3e9 Rewrite of AIStateMachine, version 2. 2013-03-06 03:26:43 +01:00
Lirusaito
32b513a025 Finish up last commit
Fixes the segfault that was accidentally overlooked because voice decided to not return after the first run as I worked on all the other warnings
Thanks to Latif Khalifa for the VoiceMultiInstance debug setting which enabled me to use voice again.
2013-03-05 20:56:14 -05:00
Lirusaito
db39bab95b Fix a ton of run-time warnings about UI.
Cleans up some related code, probably looks nicer with space changes off.. though this is a pretty straightforward change.
Comments out code that still exists in xmls or might likely be added in future.
Each piece tested quite a bit.
2013-03-05 20:20:59 -05:00
Drake Arconis
565786ead1 Cleanup unused things 2013-03-05 13:35:58 -05:00
Drake Arconis
0e3a9b28bd CMake cleanup and organization 2013-03-05 12:24:51 -05:00
Drake Arconis
28eec629ec Remove executable bit from xml 2013-03-05 10:17:08 -05:00
Drake Arconis
bc2d26464f Remove dead code 2013-03-05 09:08:47 -05:00
Drake Arconis
e725a2915e Fix typo in local asset browser 2013-03-04 21:59:04 -05:00
Aleric Inglewood
d1d09d7c18 Bail out instead of crash when parseTEMessage fails. 2013-03-05 03:51:45 +01:00
Drake Arconis
5cf556fa09 And now it actually compiles... 2013-03-04 18:05:21 -05:00
Drake Arconis
c718bc4214 Make the actual skin folders lowercase 2013-03-04 17:10:19 -05:00
Drake Arconis
6e72ec2e12 Fix rigged mesh stack smashing 2013-03-04 16:13:58 -05:00
Drake Arconis
3fac86158c General cleanup of unused variable warnings 2013-03-04 16:04:05 -05:00
Drake Arconis
17067de2dc Fixed uninitialized warning in hacd 2013-03-04 16:00:00 -05:00
Drake Arconis
b667c81f84 Merge remote-tracking branch 'Lirusaito/Canon' into Cupcake 2013-03-04 12:17:41 -05:00
Drake Arconis
b800320a49 Remove LLMemType and related files 2013-03-04 12:02:01 -05:00
Drake Arconis
425db80fea Fix warning on non-windows platforms about unknown pragma 2013-03-04 03:31:44 -05:00
Drake Arconis
43c0c4ce91 Some CMake Cleanup
Clean up leftover SERVER and VIEWER from when they were a single tree
Fixed debian multiarch cmake
Small bits of OSX cleanup
2013-03-04 03:31:24 -05:00
Lirusaito
79f6883bdf [Issue 662] Translations retouch
Fixes overlaps and text running out of boundaries.
2013-03-03 14:48:03 -05:00
Lirusaito
3effb23f08 Call LLTrans::parseStrings before setting up notifications during LLAppViewer::init
Fixes the issue with notifications not translating

Moves the UI initialization code block up a few lines to the same area as v-d and sunshine-external have it.
This more clearly shows how it relates with upstream code such that future changes in this area might avoid similar issues.
2013-03-03 11:42:38 -05:00
Lirusaito
9ffa700c97 xmllint fixups 2013-03-03 09:58:02 -05:00
Lirusaito
198ef8feb0 Fix French role_actions.xml parsing warning 2013-03-02 22:20:42 -05:00
Lirusaito
fcd343af69 Small touches
Missed a line during Issue 662
Correct order of contributors to be alphabetical
Present existing translations before others.
2013-03-02 19:25:47 -05:00
Lirusaito
11856180aa [Issue 662] Translations from upstream to ease the resulting load on translators. 2013-03-02 14:32:26 -05:00
Lirusaito
4060db34fa [Issue 662] The text replacing certain heading texts to be as wide as it needs to be 2013-03-01 19:53:29 -05:00
Lirusaito
ab21a74bfc [Issue 662] Plug in LLPanelEstateInfo::updateEstate* functions 2013-03-01 19:31:18 -05:00
Lirusaito
bbe81a86f5 [Issue 662] Allow Version text on Region/Estate region tab to be as long as it needs to be 2013-03-01 15:36:24 -05:00
Lirusaito
1c0f222028 [Issue 662] Add Environment tab to Region/Estate Floater. 2013-03-01 15:23:44 -05:00
Lirusaito
cfd24e0f09 [Issue 662] Switch to using LLEstateInfoModel
Applies part of STORM-1506 patch from https://codereview.secondlife.com/r/397/
Removes old WindLight parts from code.
2013-03-01 11:23:43 -05:00
Lirusaito
c2c9d53000 [Issue 662] In preparation for Environment panel, sync panel_region_estate.xml 2013-02-28 23:38:49 -05:00
Lirusaito
8eff717612 [Issue 662] STORM-1265: Combine Terrain and Ground Textures tabs in Region/Estate floater 2013-02-28 23:37:23 -05:00
Lirusaito
c509378b24 [Issue 662] Make the Region/Estate's Covenant panel's text editor take up as much space as the LL Viewer's. 2013-02-28 19:44:29 -05:00
Lirusaito
df8595b72e [Issue 662] Update llfloaterregioninfo.* in preparation for adding new functionality. 2013-02-28 15:04:05 -05:00
Lirusaito
6525ccc384 Group Feature Request/Bug Fix: Allow setting a log location for any account before log in
The new setting gets overridden by the per account setting, if it has been set, but provides users the ability to set log location pre-login.
2013-02-28 14:41:08 -05:00
Lirusaito
7617f560ab Fix up a mistake in antispam logic where only the user, not any other residents might be blocked.
Adds can_block() to NACLantispam.cpp to unify the blocking checks, so mistakes like this shouldn't happen again.
Best viewed without space changes.
2013-02-28 14:05:01 -05:00
Lirusaito
4990af9cfd Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into Canon 2013-02-27 15:47:03 -05:00
Lirusaito
09c8be1673 Workaround the chat bar no longer focusing because it is within a layout_stack 2013-02-27 15:35:38 -05:00
Aleric Inglewood
186c3ef88a Add support for xdg-open. 2013-02-27 17:22:10 +01:00
Latif Khalifa
ad03c27805 Tell cmake to only search paths we tell it to 2013-02-27 00:49:51 +01:00
Siana Gearz
c9ab38d449 Stream frequency change support and new anti-starvation strategy 2013-02-26 23:13:39 +01:00
Lirusaito
cef61db77f Feature Request: Add debug setting for showing Position Before Parcel in the Status Bar
Adds StatusBarPositionBeforeParcel
Enables builders on parcels with keywords in their names to see their position.
2013-02-26 16:59:35 -05:00
Lirusaito
c0c32c4b70 Minimal update of llpanelgrouproles.cpp to get the owner role checkbox to enable properly. 2013-02-26 16:56:59 -05:00
Lirusaito
620849607e Fulfill feature request: Optionally, don't ShowDisplayNameChanges in notifications.
Show display name changes checkbox added to Adv. Chat->Chat/IM tab.
Better viewed without space changes.
2013-02-26 16:35:02 -05:00
Lirusaito
180d1862a8 Dim seconds text in general preferences when AllowIdleAFK is false. 2013-02-26 16:07:21 -05:00
Siana Gearz
6ee8cc5798 Unbreak skinning on low end hardware 2013-02-26 20:47:43 +01:00
Siana Gearz
f3b7102034 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-02-26 00:23:35 +01:00
Siana Gearz
13e0bc2742 Merge branch 'sunshine' of git://github.com/Shyotl/SingularityViewer
Conflicts:
	indra/newview/lldrawable.cpp
	indra/newview/llviewerwindow.cpp
2013-02-26 00:20:26 +01:00
Siana Gearz
a4b49e3fc2 Random stab at object updates. Tell me if it breaks anything. 2013-02-26 00:00:45 +01:00
Siana Gearz
e2659b801a Dirty fix object import 2013-02-25 23:58:43 +01:00
Lirusaito
c3e63e7ab7 handleLocalChatBar visibility whenever ShowLocalChatFloaterBar changes value 2013-02-25 17:39:53 -05:00
Shyotl
d27b329afb Minor bit of cleanup. Also now using glTexGenf instead of glTexGeni for fixed-function water texcoords. 2013-02-25 13:02:22 -06:00
Shyotl
e187e642c0 Restored some RLVa shownames logic that was clobbered a while ago. 2013-02-25 13:00:07 -06:00
Shyotl
fd21197d2a Wedged high-res non-tiled deferred snapshot logic into LLViewerWindow::rawRawSnapshot 2013-02-25 12:59:17 -06:00
Shyotl
34cf0329ab Crahfix for avatars, as destruction can be delayed via llpointer refs, meaning the region the av was in could be long gone before the avs destructor is actually called. Calling logPendingPhases in a more reasonable place (markDead). 2013-02-25 12:55:50 -06:00
Shyotl
94a0040ddb Sunshine catchup. 2013-02-25 12:53:18 -06:00
Lirusaito
9d6d8da54d Missed a spot in last commit. 2013-02-24 16:50:11 -05:00
Lirusaito
8e08e98c61 Only don't ShowLocalChatFloaterBar when Local Chat is torn-off. (Setting no longer requires relog) 2013-02-24 15:23:52 -05:00
Melanie
3036f74b69 Send the currently selected object list in the custom menu options request so that options can be created that operate on items. 2013-02-24 11:03:14 -05:00
Lirusaito
2ad9476961 Support SimulatorFeature MarketplaceURL for Marketplace Search tab on non-SL grids. 2013-02-24 10:54:46 -05:00
Aleric Inglewood
13e032fb04 Make AICurlThread::wakeup_thread thread-safe. 2013-02-23 23:29:43 +01:00
Aleric Inglewood
803e92020b Renamed AICurlThread::mWakeUpMutex --> AICurlThread::mWakeUpFlagMutex 2013-02-23 23:23:48 +01:00
Aleric Inglewood
b6cbed838f Assertion bug fix for libcwd with dc::curl on and curlio off. 2013-02-23 21:37:07 +01:00
Aleric Inglewood
19314b6686 Removed two unnecessary states from AICurlEasyRequestStateMachine
Removed AICurlEasyRequestStateMachine_added and
AICurlEasyRequestStateMachine_finished because the state machine is not
taking any action there anyway, and those states might be skipped all
together even, so they make no sense / shouldn't exist.
2013-02-23 21:33:37 +01:00
Aleric Inglewood
5d329d9e55 Fix initialization list order.
Also fixes a Dout line and initializes mState to 0 so
that if ever set_state would be called first from
a non-main thread then it will be larger (probably
not needed currently).
2013-02-23 21:13:26 +01:00
Aleric Inglewood
4851cc174e Revert "Work in progress"
This reverts commit ef35aa7954
because it contained too much wrong things that I won't be
using. I'll re-commit stuff from it after that that I do
want to keep.
2013-02-23 20:00:13 +01:00
Aleric Inglewood
78bb94eb42 Bug fix: remove remainder of test code 2013-02-23 19:36:18 +01:00
Lirusaito
c6aa1bb3ea French network preferences update 2013-02-21 04:42:27 -05:00
Lirusaito
489f17b6b2 Fix compile warning 'unused variable' 2013-02-21 02:18:45 -05:00
Latif Khalifa
b2b24cee7a Compile fix 2013-02-21 01:11:03 +01:00
Aleric Inglewood
ef35aa7954 Work in progress
This work extends AIStateMachine to run multiplex() in the thread
that calls run(), cont() or set_state(). Note that all three
eventually call locked_cont(), so thats where multiplex() is called
from. Calling multiplex() means "running the state machine", as in
"calling multiplex_impl".

Currently only LLURLRequest uses this feature, and then only
for the HTTPGetResponder, and well only for the initializing,
start up and normal finish states.

A current/remaining problem is that we run into a situation where
the curl thread runs a statemachine to it's finish and kills it,
while the main thread is also 'running' it and tries to call
multiplex while the statemachine isn't running anymore.
2013-02-20 23:29:38 +01:00
Siana Gearz
8f5c58ff3c Merge branch 'Canon' of git://github.com/Lirusaito/SingularityViewer 2013-02-20 21:21:15 +01:00
Siana Gearz
408811c319 Merge branch 'sunshine' of git://github.com/Shyotl/SingularityViewer 2013-02-20 21:20:22 +01:00
Siana Gearz
1555d70230 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-02-20 21:19:39 +01:00
Lirusaito
b9da20f0d6 Added new controls to Network Preferences
Adds Texture Bandwidth slider
Adds Use HTTP for Inventory and Textures checkboxes.
Also, swaps out the bandwidth slider for a new Z Offset slider on quick settings, as bandwidth sliders should be set and forget, there is no modern need for them to be changed so frequently.

[Note to translators: please examine the network preferences after this update, controls have been moved and may now overlap.]
2013-02-20 06:16:53 -05:00
Shyotl
041481db89 Snap grid was pulling colors from wrong control group. 2013-02-19 22:33:31 -06:00
Shyotl
beeef8d5b9 Fix crash if periodic av metric update happens after disconnect. 2013-02-19 21:54:35 -06:00
Shyotl
8d09539fcc Added a couple missing entries to settings.xml 2013-02-19 21:52:13 -06:00
Shyotl
07bc115b1c Stars had nonsensical and broken face winding. 2013-02-19 20:58:13 -06:00
Siana Gearz
00cb7a0e51 Merge branch 'sunshine' of git://github.com/Shyotl/SingularityViewer 2013-02-19 21:12:14 +01:00
Siana Gearz
657484fedc Merge branch 'Canon' of git://github.com/Lirusaito/SingularityViewer 2013-02-19 21:10:40 +01:00
Siana Gearz
3b86a39293 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-02-19 21:10:06 +01:00
Lirusaito
49eb78db27 Added the ever-requested marketplace tab to search floater (When on SL Grids, only) 2013-02-19 08:40:12 -05:00
Shyotl
dbf646f266 More verbose fmodex llinfos output upon init. (will be useful when I add more output options.. if we keep fmodex) 2013-02-19 01:52:29 -06:00
Shyotl
76f3dc9e19 Massive sunshine/viewer-dev catchup. Further implemented serverside baking and added/updated metrics feedback. 2013-02-19 01:50:46 -06:00
Melanie
994dfc5b29 Simplify the previous commit because commit callback for buttons is now
identical to the clicked callback, obviating the need to distinguish between
these control types.
2013-02-18 23:21:00 -05:00
Melanie
2b9c0e34c7 Fix the Octopus to not segfault anymore 2013-02-18 21:54:16 -05:00
Lirusaito
4c33328906 If RLVa is off, RLVa z offset should not be enforced.
Easier diff view without space changes.
2013-02-18 17:57:40 -05:00
Aleric Inglewood
ff3910a705 Merge remote-tracking branch 'singu/master' 2013-02-18 15:38:58 +01:00
Lirusaito
e01dd3292f Add Script Info menu entry to the self pie menu...
From the comments in llfloaterscriptlimits.cpp, it seems like this was intended to be a feature.
2013-02-17 23:19:23 -05:00
Lirusaito
833a6e8acf Fix up merge of llviewermessage.cpp between Shyotl/sunshine and Canon. 2013-02-17 21:00:51 -05:00
Lirusaito
3c544bceb3 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer into Canon 2013-02-17 19:47:48 -05:00
Lirusaito
036328c3ac Allow finding objects by typing on the script info scrolllists
Also tweaks columns widths and sort order to present information more effectively.
2013-02-17 19:41:59 -05:00
Aleric Inglewood
14a2788ac4 Don't even crop in rawRawSnapshot.
This causes LLSnapshotLivePreview::getAspectSizeProblem to never return
CANNOT_CROP_HORIZONTALLY or CANNOT_CROP_VERTICALLY anymore, making
the chance to successfully upload or save to a different target larger.
2013-02-17 22:31:32 +01:00
Siana Gearz
6123c9b80a Enable broadcast viewer effects by default 2013-02-17 16:00:59 +01:00
Siana Gearz
dbdd0ec4f1 Merge branch 'Canon' of git://github.com/Lirusaito/SingularityViewer 2013-02-17 15:40:27 +01:00
Siana Gearz
0f54a2777e Merge branch 'master' of git://github.com/lkalif/SingularityViewer 2013-02-17 15:36:59 +01:00
Siana Gearz
49c872c86d Merge branch 'sunshine' of https://github.com/Shyotl/SingularityViewer 2013-02-17 15:28:48 +01:00
Siana Gearz
6bf661e079 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-02-17 15:27:28 +01:00
Siana Gearz
ef4c7d9433 Some transform update fixes.
Thanks to MartinRJ and Henri for updateXform poking.
2013-02-17 15:23:25 +01:00
Shyotl
c3c34deb10 Added reload option to attachment 'tool' pie submenu. 2013-02-17 02:55:05 -06:00
Shyotl
4cc35d6c66 Fixed up some silly issues with the client tag system. 2013-02-17 02:54:30 -06:00
Latif Khalifa
e83befcb6b Updated 32 bit Linux prebuilt of PCRE based on NickyP's work in Kokua. Includes unicode support. 2013-02-16 02:19:57 +01:00
Latif Khalifa
bb527b6ed1 Updated 64 bit Linux prebuilt of PCRE based on NickyP's work in Kokua. Hopefully fixes startup crash on some distros 2013-02-16 01:03:43 +01:00
Lirusaito
cd6bda876d Add RememberName setting to settings.xml (No wonder it wasn't saving!) 2013-02-15 08:28:54 -05:00
Shyotl
51cbb8d6bd Catch up with LL regarding viewer stat recording. 2013-02-14 17:45:10 -06:00
Lirusaito
8cc601c3e2 Fix ups for the Permissions Panel
Minor update and cleanup to llpanelpermissions.cpp
Hide the You can modify this object text properly when Debugging Permissions
Show Debug Permissions on the same line on the build panel.
2013-02-14 15:48:00 -05:00
Aleric Inglewood
dc3f33717c Fixed assertion in HTTPTimeout::lowspeed
mTotalBytes had the meaning of "the sum of all elements in the vector",
but was reset to 0 at the start of a transaction. The meaning is now
changed to "total number of bytes in the vector that belong to the
current transaction".
2013-02-14 00:09:42 +01:00
Shyotl
2f5ab6f8e8 Once more, with feeling. (currency transaction messages) 2013-02-13 16:31:16 -06:00
Lirusaito
7a319d26d5 Extend support for custom menus by accepting messages issued by the server without question 2013-02-13 16:51:42 -05:00
Lirusaito
5d3341bc00 Correctly position custom dropdown menus 2013-02-13 14:17:34 -05:00
Lirusaito
7ca767275f Add support for CustomMenuAction Capability 2013-02-13 13:00:40 -05:00
Aleric Inglewood
86a0536131 Compile error fix: __value is reserved on Windows. 2013-02-13 17:20:41 +01:00
Lirusaito
4d3fb7affe Support SimulatorFeature god_names, used for identifying those the Sim reveals to be gods. 2013-02-13 03:11:20 -05:00
Lirusaito
c7fcaa8e5b Add setFeaturesReceivedCallback for when SimulatorFeatures cap is received 2013-02-13 03:04:29 -05:00
Shyotl
8ec5915b7c Removed some logic in llfloateravatarlist that shouldn't have been there. 2013-02-12 20:49:39 -06:00
Shyotl
a31ba15dbc Updated LLFloaterBuyContents 2013-02-12 20:49:17 -06:00
Shyotl
f147a734b1 LLStat dead code removal 2013-02-12 20:47:55 -06:00
Lirusaito
43bb5d6e39 Add bool LLMuteList::isLinden(const LLUUID& id) for use in situations where the available name may be just display name, but there is a UUID available instead. 2013-02-12 20:43:10 -05:00
Aleric Inglewood
c6c343a45b Compile bug fixes when -DDEBUG_CURLIO 2013-02-12 23:44:55 +01:00
Aleric Inglewood
b40e8fb508 Add checkbox "Keep aspect ratio" to snapshot floater. 2013-02-12 22:21:39 +01:00
Shyotl
6725c17f01 LLSys merge and cleanup. 2013-02-12 15:10:15 -06:00
Shyotl
24efffc68a LLInitParam merge. 2013-02-12 15:08:11 -06:00
Shyotl
c92c68dee2 A few more preview-related changes. 2013-02-12 15:07:07 -06:00
Shyotl
1eb142535c Merge in changes to avoid a few potential problems with LLUUID when accessed from multiple threads. 2013-02-12 15:02:17 -06:00
Shyotl
b901e57c55 Start culling of llmemtype (for now just #ifdef'd to nothingness. 2013-02-12 15:00:50 -06:00
Shyotl
0742610674 Updated gObjectPreviewProgram shader (simple lighting) 2013-02-12 14:59:02 -06:00
Shyotl
655c9348de Minor adjsutment to llcontrolgroup. Demote non-critical failure from llerrs to llwarns. 2013-02-12 14:53:56 -06:00
Shyotl
0a8147a9da Merged some alignment adjustments from sunshine-external 2013-02-12 14:52:53 -06:00
Shyotl
5180fbfc23 Clean up llfloaterurlentry 2013-02-12 14:50:29 -06:00
Shyotl
0759f2dae8 Actually use the namecache callback results when displaying currency transaction notifications. 2013-02-12 14:47:59 -06:00
Shyotl
c799f9f7eb Avoid sculpt discard-level 5 spam. 2013-02-12 14:46:31 -06:00
Latif Khalifa
69c43947ed Don't include warnings of singleton access from initSingleton() to the end users (release build) 2013-02-12 03:30:13 +01:00
Lirusaito
f95830fe23 Extend fuctionality of non-SL capability 2013-02-11 19:12:17 -05:00
Lirusaito
491af1cbf0 Remove gAllowIdleAFK (makes the general preferences checkbox functional) 2013-02-11 15:01:18 -05:00
Aleric Inglewood
b1892eb238 DoutEntering was hiding variable 'on' 2013-02-11 20:08:58 +01:00
Lirusaito
2d0e3daef3 When we don't have a parcel selected (About Land is closed), allow Script Limits refreshes to use our current parcel instead. 2013-02-11 03:55:58 -05:00
Lirusaito
8a76b5d1d2 Silly fox missed a spot! 2013-02-11 02:15:00 -05:00
Lirusaito
88ce171f1e Initial Portuguese translation, contributed by Knolan Falconer 2013-02-11 01:19:36 -05:00
Lirusaito
1d4858ae85 Add support for two non-SL grid features/flags.
Adds support for GamingData cap, and flags: PF_GAMING, DFQ_FILTER_GAMING, REGION_FLAGS_GAMING, and REGION_FLAGS_HIDE_FROM_SEARCH
Adds GamingCheck to floater_about_land.xml
Adds filter_gaming checkboxes to floater_directory* xmls
Adds "is gaming" and "hide from search" checkboxes to floater_god_tools.xml
2013-02-11 01:14:09 -05:00
Lirusaito
cff7a2a464 Brought in Script Limits from v-d! (Accessible from About Land) 2013-02-11 01:12:21 -05:00
Aleric Inglewood
c18b156d8b Bug fix for scrolling folder views.
An LLFolderView is added as child to LLScrollableContainerView,
but also adds the LLScrollableContainerView to it's mScrollContainer.
As a result, when scrolling inside a LLFolderView the event is passed to
the mScrollContainer, which then passes it first on to it's children
(see the "Bad UI design" remark in the code), causing an infinite loop.
This patch breaks that loop for those objects that have a
mScrollContainer: LLFolderView and LLContainerView.
2013-02-11 03:36:46 +01:00
Aleric Inglewood
2a177c6614 Fix for libcwd configured with --disable-location 2013-02-10 18:18:50 +01:00
Lirusaito
085d6cc806 Derive LLPanelPlace from LLRemoteParcelInfoObserver, and update affected sections to v-d. 2013-02-09 17:06:38 -05:00
Lirusaito
818734878d Update LLFloaterLand to v-d 2013-02-09 16:17:29 -05:00
Aleric Inglewood
2d7ab61c6e Make keyboard focus more robust under closed floaters. 2013-02-08 18:40:14 +01:00
Aleric Inglewood
dd6f95cd33 Make AIList resilient against invalidating iterators.
This adds a counter and a 'dead' flag to the data stored in the linked
list. The counter counts the number of iterators (still) pointing to an
element and the dead flag is set to indicate the element was erased when
iterators are still pointing to it. As a result, iterators are NEVER
invalidated. Of course, such elements are subsequentially skipped when
iterating over the list. Assertions protect against dereferencing an
erased iterator, but incrementing or decremention still works: it is
still well-defined what the next (non erased) element is, assuming the
element wasn't erased (yet), but would be erased delayed - or assuming
the iterator would have been incremented (decremented) in advance to
erasing the element.
2013-02-08 17:28:22 +01:00
Aleric Inglewood
d5482e6c74 Do not pre- increment the loop iterator in LLView::drawChildren
This is in fact much safer, because the only way to invalidate an
interator in the first place (in this code) is by calling removeChild,
which *already* has an assert never to remove a child that is being
iterated over (by means of the mInDraw flag).
2013-02-08 17:28:21 +01:00
Aleric Inglewood
baab1d81a7 Wrap LLView::child_list_t in a class AIList.
So far not doing anything. Iterators already keep a pointer to the
container they belong to.
2013-02-08 17:28:21 +01:00
Aleric Inglewood
ea114986be Use viewList_t and child_list_t in appropriate places.
Both types are currently the same, but soon they will be made different.
Currently they are used a bit mixed up. This patch fixes that.
2013-02-08 17:28:21 +01:00
Aleric Inglewood
c1e6812f41 Remove unused variable. 2013-02-08 17:28:21 +01:00
Aleric Inglewood
e7aeb3feaf Add AINRLock for debugging purposes.
This class can be used as RWLOCK parameter to AIThreadSafe to check that
data is only accessed by a single thread (like
AIThreadSafeSingleThreaded) AND is never write locked when a read or
write lock was already obtained (by the same thread). It doesn't
actually lock anything, it just keeps track if the "lock" was obtained
before. The use case is to check if STL containers aren't being used
(read or write locked) by a calling function when additional write
access is necessary, as write access might invalidate iterator that
point to the container (where the previous lock was taken).
2013-02-08 17:28:21 +01:00
Aleric Inglewood
adf4c9a0ce Make the type of the read/write lock of AIThreadSafe a template parameter.
This allows passing a different type than the default AIRWLock for
debugging purposes.

The signature of the class used for RWLOCK should be:

struct RWLock {
  // Default constructor.
  RWLock(void);

  // Block until it's safe to read the data.
  // high_priority is a hint that granting this thread the read lock is more important than granting another thread a write lock.
  void rdlock(bool high_priority = false);
  // Release the obtained read lock.
  void rdunlock();
  // Block until it's safe to write to the data.
  void wrlock();
  // Release the obtained write lock.
  void wrunlock();
  // Convert the obtained write lock into a read lock.
  void wr2rdlock();
  // Block until it is possible to convert the obtained read lock into a write lock.
  void rd2wrlock();

  // Return true when a read or write is obtained and subsequent calls to release the lock are expected.
  bool isLocked() const;
};
2013-02-08 17:28:21 +01:00
Aleric Inglewood
38d1525092 Merge remote-tracking branch 'singu/master' 2013-02-08 17:26:14 +01:00
Latif Khalifa
56b2c10312 Renamed deferred rendering switch from 'Lightning and Shadows' to 'Advanced Lighting Model' as per upstream 2013-02-07 18:17:15 +01:00
Aleric Inglewood
db5846c145 Added documentation on LLHTTPClient Responders. 2013-02-07 17:43:40 +01:00
Lirusaito
73dab7e00b Fix Sappa's issue with getString log spam, three strings weren't quite in the right xml. 2013-02-06 22:55:19 -05:00
Lirusaito
54c1fcf33d Override the viewer's Z offset with the RLV one, if the RLV one has been set. 2013-02-06 22:41:10 -05:00
Lirusaito
604acd8939 Fix Issue 628: Currency exchanges no longer notify in chat 2013-02-06 16:44:08 -05:00
Lirusaito
3d9c287410 Minor french translation update, thanks Nomade~ 2013-02-06 00:27:22 -05:00
Latif Khalifa
78dbaf2ed1 Moved RLVa menu back to advanced by default 2013-02-04 00:47:19 +01:00
Siana Gearz
7852da1506 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-02-04 00:21:07 +01:00
Latif Khalifa
e7a2f171d9 Merge remote-tracking branch 'upstream/master' 2013-02-03 23:48:05 +01:00
Siana Gearz
dc3f91b121 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-02-03 22:27:53 +01:00
Siana Gearz
064601ae5e Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-02-03 22:18:44 +01:00
Siana Gearz
2b036c7334 Split out HTTP texture bandwidth 2013-02-03 22:18:34 +01:00
Siana Gearz
6a774e4685 This should fix voice decline crash 2013-02-03 21:56:13 +01:00
Aleric Inglewood
83fb898852 Bug fix: Wake up curl thread at exit of viewer. 2013-02-03 17:24:26 +01:00
Latif Khalifa
4317fc36a8 Merge remote-tracking branch 'shyotl/sunshine' 2013-02-02 02:56:23 +01:00
Siana Gearz
57d43786ab Merge branch 'sunshine' of https://github.com/Shyotl/SingularityViewer 2013-02-02 02:22:46 +01:00
Shyotl
1069d5dec4 Draw trees before sky. Z-cull may be beneficial. Also, was incorrectly setting alphawrite off for deferred wlsky pass. 2013-02-01 17:16:01 -06:00
Aleric Inglewood
d055494706 Libcwd compile fixes
include linden_common.h first (is already included through the used
headers).
2013-02-01 21:26:08 +01:00
Lirusaito
0a6bebf9db Added ShowSimChannel debug setting to display sim channel information in the status bar. 2013-01-31 22:22:40 -05:00
Lirusaito
5b2e1a0aae Remove remaining dead LCD code(, also fix typo in a comment) 2013-01-31 21:32:29 -05:00
Lirusaito
46ddc9b6be Skins Request: Nano Green and Nano Purple 2013-01-31 21:18:50 -05:00
Latif Khalifa
5cbe633117 Fixed compile under older GCCs by Siana Gearz 2013-02-01 00:18:01 +01:00
Latif Khalifa
719ea47a35 Merge remote-tracking branch 'lirusato/Canon' 2013-01-31 17:21:08 +01:00
Latif Khalifa
70eeddabba Merge remote-tracking branch 'shyotl/sunshine' 2013-01-31 17:20:58 +01:00
Lirusaito
d756225684 Minimal change to fix folder->Add Items, purgeCategory wasn't supposed to be called in this case. 2013-01-31 02:41:17 -05:00
Shyotl
26de17f2de Avoid occasional DoF-related crash upon region disconnection. 2013-01-30 22:04:57 -06:00
Shyotl
be0d751334 Cleanup, further hardening of namecache callbacks, and update to avatar picker. 2013-01-30 22:04:04 -06:00
Latif Khalifa
4b0bac34dd Added the ability to have the voice enabled in multiple viewer instances 2013-01-31 01:26:39 +01:00
Lirusaito
bf8bd9cb1a Further notifications.xml touchup. 2013-01-30 19:16:56 -05:00
Lirusaito
e009b8f4b4 Added simple codeless floaters for My Outfits and Favorites folders, entries are in World menu. 2013-01-30 14:11:22 -05:00
Lirusaito
47cbaeed23 XML-Driven floater feature (and documentation)
Changes:
Adds LLUICtrlFactory::getBuiltFloater() to return LLFloater* when a floater has been built.
In llviewermenu.cpp's LLShowFloater::handleEvent():
Return early if the floater_name is empty,
otherwise if no anticipated floater is found, build one,
unless one of the same name is already built, then bring it to focus.



Documentation:
In order to add simple codeless floaters, a general understanding of our XMLs is necessary...
A simple codeless floater can be a few things, perhaps not limited to: media browsers, settings controls, and holders for inventory_panels.

So how do you make them conform to the codeless standard?
For the purpose of these examples, my floater file will always be floater_name.xml
Let's start with a shortened xml menu entry:
<menu_item_call label="Name!" name="name">
  <on_click function="ShowFloater" userdata="floater_name.xml"/>
</menu_item_call>
Alright, that wasn't so hard, just remember the key in this is ShowFloater is the function and userdata is the filename.

The next part is the actual floater, which isn't so different from making a complex floater..
There are two ways to do this, depending upon desired behavior:

The first behavior is to have only one of the floater open at a time, the following short xml exemplifies this:
<floater name="floater_name.xml" title="Name!"/>
Having a floater with this behavior will cause the menu entry to bring it into focus.

The other behavior is to allow more than one of the floater open at a time:
<floater name="name" title="Name!"/>
In this case, the menu entry will spawn a new version of the floater with every click, regardless of previous ones existing.

Granted, these short <floater/>'s probably aren't but examples and will not likely stand alone.
2013-01-30 14:07:59 -05:00
Latif Khalifa
4e29b6752e Fixed packaging of the mac build 2013-01-30 14:17:16 +01:00
Latif Khalifa
046735f043 Merge remote-tracking branch 'upstream/exp' 2013-01-30 05:49:45 +01:00
Latif Khalifa
a9b05fd029 Merge remote-tracking branch 'lirusato/master' 2013-01-30 05:48:45 +01:00
Latif Khalifa
5c8e436401 Fix windows build: warnings management 2013-01-30 05:45:00 +01:00
Latif Khalifa
4d805da6ac Package glod and colladadom dlls 2013-01-30 05:43:17 +01:00
Latif Khalifa
085800f6e0 Tell the compiler we are using colladadom dll, and not a static lib. Use our current boost libs 2013-01-30 05:27:10 +01:00
Latif Khalifa
1934fc9bd4 Temporarily disable HACD file save functions (not used) to avoid strange linking issue on windows 2013-01-30 05:25:05 +01:00
Latif Khalifa
8c1848b487 Silence secure CRT warnings when building HACD 2013-01-30 05:14:48 +01:00
Latif Khalifa
8edb10fb88 Merge remote-tracking branch 'aleric/meshupload' into meshupload 2013-01-30 05:12:04 +01:00
Aleric Inglewood
8aecc49456 Add missing notifications. 2013-01-30 03:58:42 +01:00
Latif Khalifa
b8919c21d8 Merge remote-tracking branch 'aleric/meshupload' into meshupload 2013-01-30 03:46:45 +01:00
Aleric Inglewood
9203b24eb9 Remove AIStateMachineThreadBase* argument from AIThreadImpl constructor.
Also removes the use of 'this' to initialize base classes, which led to
a compiler warning on vs2010.
2013-01-30 03:44:02 +01:00
Latif Khalifa
8584e6da4c Merge branch 'master' into meshupload
Conflicts:
	indra/llcommon/llhash.h
	indra/newview/CMakeLists.txt
	indra/newview/llfloatermodelpreview.cpp
	indra/newview/llfloatermodelpreview.h
	indra/newview/llpanelprofile.h
2013-01-30 00:36:31 +01:00
Aleric Inglewood
1d673df1bd Add AIMeshUpload and fix LLMeshUploadThread
* Removes polling stuff (call to gMeshRepo.update()) which did
  nothing but check if uploads already finished.
* Just creates and runs the state machine (AIMeshUpload) instead
  of creating an LLThread derived class (LLMeshUploadThread) and
  adding that to a queue, then have the main thread start it
  after adding it to another queue in order to keep track of
  the instances (both queues are gone).
* mWholeModelUploadURL was moved to the state machine, because
  it needs a life time till the responders finishes (can't be
  part of the thread object).
* LLMeshUploadThread is now derived from AIThreadImpl instead
  of LLThread, so it can be run in a state machine thread.
* The call to LLHTTPClient::post is now done from the main
  thread instead of from the thread, but I don't think that is
  a problem.
2013-01-29 23:42:06 +01:00
Aleric Inglewood
b3adf71ed7 Remember floater rectangle 2013-01-29 23:20:02 +01:00
Aleric Inglewood
7ba0b6482c Fix example code. 2013-01-29 20:49:53 +01:00
Aleric Inglewood
e99175444f Bike fix: Always set mStatus to STOPPED 2013-01-29 20:45:08 +01:00
Aleric Inglewood
d5ed31ca9b Allow passing a name to underlaying LLThread in debug mode. 2013-01-29 20:44:14 +01:00
Aleric Inglewood
1c8027b1e6 Add statemachine parent callback support to LLHTTPClient::post 2013-01-27 22:02:19 +01:00
Aleric Inglewood
ebac80b5b7 Fix termination race condition. 2013-01-27 20:52:21 +01:00
Siana Gearz
4cab6a89a9 1024-sized terrain texture support 2013-01-27 06:06:13 +01:00
Siana Gearz
50a360d314 Silence voice complaint about missing cap 2013-01-27 04:42:00 +01:00
Lirusaito
4e96dccd7c Fix Issue 385: Group chat announces in window not in Instant message
Improved Ignore Group functions
Best viewed without space changes.
2013-01-26 21:47:32 -05:00
Siana Gearz
7755033017 Lazily fix static deinitialization fiasco 2013-01-27 01:43:38 +01:00
Siana Gearz
aed472af77 Try to fix long-standing crash-on-resize in Linux.
It appear's SDL's SetVideoMode can cause repeat SDL_VIDEORESIZE message and shouldn't be called again.
2013-01-27 01:41:17 +01:00
Aleric Inglewood
c528a15e95 Added AIStateMachineThread 2013-01-26 19:19:09 +01:00
Aleric Inglewood
6dc4a60724 Changes to LLThread
* Call a virtual terminated() that by default sets mStatus to STOPPED,
  instead of setting it to STOPPED directly, allowing to override
  the behavior of a LLThread derived class when the thread is about
  the exit.
* Make setQuitting() public, so it can also be used to hint to a
  thread that it should stop at its earliest convience.
2013-01-26 19:15:57 +01:00
Aleric Inglewood
f6785c399d Added support for LLCondition to AIThreadSafeSimple. 2013-01-26 18:35:42 +01:00
Latif Khalifa
237f84cde0 Merge remote-tracking branch 'shyotl/sunshine' 2013-01-26 13:49:50 +01:00
Shyotl
485ad8e645 Reworked name loading for vivox speaker list. LLSpeaker now boost::signals2::trackable to avoid accessing after destruction. Opening new sessions via doubleclick on list(sessions managed by legacyname) or using the mute button(legacyname needed to exclude lindens) are both disabled until namecache lookup complete. 2013-01-26 01:57:13 -06:00
Lirusaito
1582bf43c5 Allow RLVa Z Offset and Vanity Body Dynamics Offset to coexist. 2013-01-25 11:26:52 -05:00
Aleric Inglewood
a1fa43850b Comment fixes. 2013-01-25 16:09:34 +01:00
Latif Khalifa
5e799b1f81 Respect always rez under owned land group setting for objects
duplicated by shift-dragging or duplicating.

Based on Phoenix changeset 5b50018c63d4 by Kadah
2013-01-23 12:02:04 +01:00
Siana Gearz
5bc8102864 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-01-23 00:08:38 +01:00
Aleric Inglewood
0296812e88 Add cmake file for collada and glod.
This fixes standalone when those libraries are installed
elsewhere. Note that it "breaks" standalone if you just
installed the prebuilt manually. For that to work you
have to add /.../libraries/include to CMAKE_INCLUDE_PATH,
which is not recommended because it would pick up any
other prebuilt over your system installed libraries.

Instead, for standalone, install the libraries somewhere
with some prefix and then add that prefix to the environment
variable CMAKE_PREFIX_PATH.

For example, $prefix/include/collada and $prefix/lib/libcollada4dom.so
2013-01-22 20:51:43 +01:00
Latif Khalifa
d8c846288e Merge remote-tracking branch 'lirusato/master' 2013-01-22 20:06:03 +01:00
Lirusaito
dd1e9a68d4 Removal of the deprecated lltabcontainervertical. 2013-01-22 01:38:25 -05:00
Lirusaito
36e6946c96 AuroraSim: More tiny bits to help life be normal on the grid. 2013-01-21 21:32:37 -05:00
Lirusaito
fa8e1f033b AuroraSim: non-power-of-two support. 2013-01-21 21:32:06 -05:00
Lirusaito
415bcd2b6c Merge branch 'master' into VarRegion 2013-01-21 21:31:34 -05:00
Lirusaito
21860ded90 Support web_profile_url response from OSGrid servers for setting WebProfileURL 2013-01-21 21:27:53 -05:00
Lirusaito
48113f8506 AuroraSim: HippoLimits and HippoGridManager update, and support for Aurora's MaxDrag 2013-01-21 21:22:04 -05:00
Aleric Inglewood
db7155666d Merge branch 'master' into meshupload
Conflicts:
	indra/cmake/00-Common.cmake

One diff added /MP to CMAKE_CXX_FLAGS_DEBUG while
another removed /arch:SSE2 from the same line.

Fixed to honor both changes.
2013-01-21 19:16:06 +01:00
Latif Khalifa
b758014ebc Adjust to recent change in the API for Responder objects 2013-01-21 11:25:32 +01:00
Latif Khalifa
18816ae146 Merge remote-tracking branch 'shyotl/sunshine' 2013-01-21 11:25:10 +01:00
Shyotl
dc106c5442 Fix some compiler warnings/errors. Error in llinventorymodelbackgroundfetch was introduced by partial commit. 2013-01-20 17:10:38 -06:00
Lirusaito
aa3228be76 French translation update, thanks Nomade~ 2013-01-20 10:25:19 -05:00
Lirusaito
c2ce72ed94 Issue 604: Reset Button for inventory
Attempted Spanish translation.
Nomade Zhao provided French.
2013-01-20 10:15:23 -05:00
Siana Gearz
4cd2de0fff Version 1.7.3 2013-01-20 05:57:05 +01:00
Siana Gearz
b318a0703b Use standard way on windows to find default file picker path 2013-01-20 05:55:18 +01:00
Siana Gearz
ea67aca955 This should de-clog the tubes on the map 2013-01-20 03:32:51 +01:00
Siana Gearz
0ab140a071 Potential permission fix 2013-01-20 01:49:55 +01:00
Siana Gearz
d5eb2432ef Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-01-20 01:49:14 +01:00
Lirusaito
a6c2d256c6 Hooked up RLVaTopLevelMenu setting so it actually works.
Changes to llviewermenu.cpp are better viewed without space changes
^Put together both RLVa Embedded and RLVa Main menus while building Advanced menu, labeling them RLVa; once the advanced menu is built and added to MenuBar, rlvMenuToggleVisible() is called.
Added onChangedMenuLevel() to rlvcommon.cpp
Added rlvMenuToggleVisible(), tweaked to only perform necessary operations for now, other parts left commented out for future use.
Removed menu visibility handling from RlvHandler::setEnabled()

NOTE: RLVa has only been updated in pertinent areas, from what I can tell we are a bit behind in other places, too.
2013-01-18 15:14:33 -05:00
Aleric Inglewood
7a8a2757db Add comment for sake of translation. 2013-01-18 16:10:18 +01:00
Aleric Inglewood
d8d3cafc32 Merge remote-tracking branch 'singu/master' 2013-01-18 02:28:17 +01:00
Aleric Inglewood
604824335c Keep focus during Freeze Time so that pressing ESC always leaves Freeze Time. 2013-01-18 02:26:43 +01:00
Latif Khalifa
9240147874 Merge remote-tracking branch 'lirusato/master' 2013-01-17 17:26:00 +01:00
Lirusaito
05a6323d2c French antispam controls touchup 2013-01-17 09:17:43 -05:00
Lirusaito
1dd0b7713b French translation fixies~ 2013-01-17 03:38:53 -05:00
Lirusaito
795f70a0b0 d520053 - MAINT-852 / VWR-8761 : Cannot delete object description. Now you can. 2013-01-17 01:11:59 -05:00
Lirusaito
5831af0fb6 OPEN-161: Typo in the header guard of lltexturecache.h 2013-01-17 01:10:47 -05:00
Aleric Inglewood
e8e3e43711 Update llqtwebkit with recompiled version. 2013-01-17 00:43:21 +01:00
Latif Khalifa
460b05d37a Merge remote-tracking branch 'shyotl/master' 2013-01-16 16:25:51 +01:00
Latif Khalifa
f03405ca47 Merge remote-tracking branch 'lirusato/master' 2013-01-16 16:25:37 +01:00
Lirusaito
0405ed9e3d French Translation update. 2013-01-16 09:27:25 -05:00
Lirusaito
2eb8f2f84a 07e5202 MAINT-1942 Increase maximum animation length from 30 seconds to 60 seconds 2013-01-16 05:00:35 -05:00
Shyotl
6894d4c0bc Changed how the 'client' column in avatar radar is handled. Initially was not designed nor tested to be toggleable on user-demand (was one shot deal depending on detected grid). 2013-01-15 23:14:58 -06:00
Lirusaito
53c04b7299 Issue 220: Copy/paste params in the build tools like phoenix
Adds mClipboardFlexiParams, mClipboardLightParams, mClipboardSculptParams, and mClipboardLightImageParams to LLPanelObject.
Corrects the tooltip on the the copy button.
2013-01-15 22:43:22 -05:00
Latif Khalifa
3bf307abb0 Merge remote-tracking branch 'shyotl/master' 2013-01-15 18:37:09 +01:00
Latif Khalifa
4928d29a8e Merge remote-tracking branch 'aleric/master' 2013-01-15 18:36:51 +01:00
Latif Khalifa
8cec9c7b73 Merge remote-tracking branch 'lirusato/master' 2013-01-15 18:36:39 +01:00
Shyotl
a6e3352073 Setting camera toolset as current sticks us into build mode (??)... Avoid when taking snapshots. 2013-01-14 23:09:12 -06:00
Aleric Inglewood
0eeea37662 Fix 'Open floater in Freeze Time mode'
When the floater was opened in Freeze Time mode, then parent of the
widget that triggers it to open is the 'Floater View'. We do NOT
want to set that MouseOpaque :p. Using getParent here is just
nonsense.
2013-01-15 03:31:57 +01:00
Shyotl
2a8f55e99e Updated gesture floater to use more modern (and actual working) method of adding list elements via xml. 2013-01-14 18:41:48 -06:00
Aleric Inglewood
db7b0c1785 Revert last part (work in progress of last two commits, I guess). 2013-01-15 00:11:17 +01:00
Aleric Inglewood
55e64f6ab0 Fix for last commit.
Show sculpties with no (or not enough) data as spheres with default LOD
stepping.
2013-01-14 23:53:58 +01:00
Aleric Inglewood
6fce7062e5 Fix gcc 4.4 problem.
When a sculptie has too few vertices, especially when we bluntly assume
it's stitched around and don't want to get less than 4 vertices in
either direction, then instead we end up with even ZERO vertices, which
causes a division by zero in LLPath::genNGon with undefined behavior.
2013-01-14 23:14:29 +01:00
Aleric Inglewood
2df8ba19f4 Fix last compiler warning. 2013-01-14 22:59:49 +01:00
Aleric Inglewood
e4a3b3b5ba Merge remote-tracking branch 'shyotl/master' 2013-01-14 16:12:57 +01:00
Lirusaito
0494dc8d32 Fix Issue 432: Radar Keeps Popping Up and side issue I got still the window "An object owned by you ..."
Unified key message sending to function send_keys_message()
Switched a few getBOOLs to CachedControls
Added RadarChatKeysStopAsking, and RadarChatKeysRequest as a three button notification so the user can decide to permanently say no.
Corrected RadarChatKeys description to be more accurate.
If we want to know if the radar is open, we check instanceExists, not getInstance.
Also enabled using the announce button when RadarChatKeys is false to announce keys, for manual updates.
2013-01-14 06:34:27 -05:00
Latif Khalifa
3dd33518c4 Merge remote-tracking branch 'shyotl/master' 2013-01-14 10:53:27 +01:00
Shyotl
db8225a078 Fixup LLScrollListCtrl::setCommentText, and incorrect behaviors with script editor and bulk perm editor pertaining to setCommentText inherited from V3. 2013-01-14 03:36:04 -06:00
Siana Gearz
8bc05f6d15 Fix double upload dialog 2013-01-14 00:04:43 +01:00
Damian Zhaoying
00fb7804da Spanish Translate for new Group/Chat/IM floaters and some general string fixed 2013-01-13 19:05:35 -03:00
Siana Gearz
3091d9c847 Potential permission fix 2013-01-13 21:50:31 +01:00
Siana Gearz
d1de4d53fe Merge branch 'meshupload' of git://github.com/LightDrake/SingularityViewer into meshupload 2013-01-13 20:37:04 +01:00
Commander Cupcake
c08c2a55e5 Revert changes that broke bump 2013-01-13 14:30:41 -05:00
Siana Gearz
cddd21d879 Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-01-13 20:11:15 +01:00
Siana Gearz
188e42ee4a Merge branch 'meshupload' of git://github.com/AlericInglewood/SingularityViewer into meshup 2013-01-13 20:10:25 +01:00
Aleric Inglewood
f606477ae5 Use "mesh" as context everywhere (for loading and saving). 2013-01-13 19:48:35 +01:00
Aleric Inglewood
5250b218c5 LLPanelProfile is not a floater: onOpen is not virtual. 2013-01-13 19:47:32 +01:00
Aleric Inglewood
909247a179 Keep decimal format the default. 2013-01-13 19:46:35 +01:00
Aleric Inglewood
e7dea2714e Merge branch 'master' into meshupload 2013-01-13 18:02:28 +01:00
Aleric Inglewood
dcc2e52c61 Merge remote-tracking branch 'singu/master' 2013-01-13 18:01:48 +01:00
Aleric Inglewood
db17b93156 Merge branch 'master' into meshupload
Conflicts:
	indra/newview/llmeshrepository.cpp

Added /* */ around the 'virtual' keyword in two places
that collided with changes in meshupload from lightdrake.
2013-01-13 17:59:49 +01:00
Latif Khalifa
11c5e1cf4c Merge branch 'master' into 1.7.3-dev 2013-01-13 12:45:43 +01:00
Latif Khalifa
cef7ea9f5e Merge remote-tracking branch 'lirusato/master' into 1.7.3-dev 2013-01-13 12:45:37 +01:00
Latif Khalifa
31d2a15957 Merge remote-tracking branch 'aleric/master' into 1.7.3-dev 2013-01-13 12:45:25 +01:00
Shyotl
e622e03d2a Bulk of server-baking impelmentation and a bit of cleanup. 2013-01-13 02:37:12 -06:00
Siana Gearz
5b0597ea47 Suppress 400 GCC warnings in Collada DOM headers 2013-01-13 06:27:02 +01:00
Siana Gearz
5f3ca7fda0 Linux64 support, integrated physics/decomposition 2013-01-13 03:23:56 +01:00
Aleric Inglewood
3a414b21fa Temporary workaround for release. 2013-01-13 02:18:00 +01:00
Aleric Inglewood
e99a906f54 Testsuite part 1: make it compile alone. 2013-01-13 01:58:49 +01:00
Aleric Inglewood
fc4b02cee8 Moved HTTPTimeout to it's own files. 2013-01-12 23:00:21 +01:00
Aleric Inglewood
e01567553e Added default message for feed uploads.
By default show 'Type your message here...' and if the text editor
never got focus, replace that with a default message.
2013-01-12 21:31:21 +01:00
Aleric Inglewood
bf7b0bf4bf Hide floater until success/failure (or floater is re-opened) 2013-01-12 21:16:40 +01:00
Lirusaito
ece92a1b7c Optionally, have group chat and conference buttons on title line.
Adds UseConciseGroupChatButtons, and UseConciseConferenceButtons
Adds "Buttons on group chat name line (Affects new group chats)" and "Buttons on conference title line (Affects new conferences)" checkboxes to Adv. Chat's Chat UI tab.
Adds floater_instant_message_ad_hoc_concisebuttons.xml, floater_instant_message_group_concisebuttons.xml

Brings panel_speaker_controls.xml's speakers_list down by 7 pixels, which is necessary because it is awkwardly high in old places as well, such as Local Chat.
2013-01-12 14:42:55 -05:00
Aleric Inglewood
2da5c51e42 Do not freeze UI when snapshot floater is opened the first time. 2013-01-12 17:35:01 +01:00
Aleric Inglewood
57228fa208 Fix upload snapshot to inventory callback mechanism. 2013-01-12 17:27:33 +01:00
Aleric Inglewood
024c62aed4 Fix the "map/set iterators incompatible" bug.
cookies is only valid when AIHTTPReceivedHeaders::getValues return true.
2013-01-12 04:24:21 +01:00
Aleric Inglewood
e56f14502e Fill fd_sets AFTER processing command queue. 2013-01-12 02:51:44 +01:00
Lirusaito
82eb1a946e Fix group buttons in horizontal and allow the horizontal buttoned friends and groups floater to take up minimal space. 2013-01-11 19:17:06 -05:00
Siana Gearz
85855ecd85 Merge branch 'meshupload' of git://github.com/LightDrake/SingularityViewer into meshup 2013-01-12 01:12:33 +01:00
Siana Gearz
cbfd31a576 Merge branch 'master' of git://github.com/LightDrake/SingularityViewer into meshup 2013-01-12 01:11:01 +01:00
Siana Gearz
b6f1bb570f Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-01-12 00:59:06 +01:00
Siana Gearz
896036b3c2 Removing ReSit, because it's not so very nice 2013-01-12 00:50:24 +01:00
Lirusaito
e51937cee7 Warn more clearly about LLRadioGroup::setValue being used wrong, and attempt to recover with LLUICtrl::setValue. 2013-01-11 18:21:48 -05:00
Lirusaito
a47dbf88bb Fix Issue 590: Debug Settings parameters setting is seriously bugged 2013-01-11 15:50:47 -05:00
Aleric Inglewood
f9a868a979 Compile fix for VC++ 2013-01-11 17:16:05 +01:00
Latif Khalifa
56542a02e8 Use multiple cores for compilation of the Debug build 2013-01-11 11:28:21 +01:00
Lirusaito
2dda9499fa Unhide Client column properly on non-SL Grids. 2013-01-11 03:56:55 -05:00
Aleric Inglewood
f9738cb611 Add getName() to every non-base class Responder object. 2013-01-11 04:15:55 +01:00
Aleric Inglewood
741a160913 Fine tune of private (libcwd) assertion.
It turns out that it's possible to receive data before an upload
finished when the server sends HTTP_BAD_REQUEST in the middle of the
upload (this happens to me when I try to upload a 6000x6000 image to my
profile feed, with is a 44MB file). So, in that case the finished upload
detection did not fail and we shouldn't assert.
2013-01-11 01:28:46 +01:00
Aleric Inglewood
5daf817e7e Upload larger original to profile feed. 2013-01-10 19:42:19 +01:00
Aleric Inglewood
9175bc0e16 Fixed LLUploadDialog to display it's text.
Also made the view rectangle have some minimal size (1/10th of the
screens width and height).
Increased the used font a bit.
Fixed removal of the dialog in the case of uploading to profile feed.
2013-01-10 18:48:02 +01:00
Lirusaito
b7f1fdd9cc Vertical space recovered 2013-01-09 11:25:46 -05:00
Lirusaito
07f88d21bd Applied STORM-1209 and added string AGroupMemberNamed for translation. 2013-01-09 11:05:37 -05:00
Lirusaito
a7d1a4611f Optionally, have IM buttons on the same line as the person's name.
Adds UseConciseIMButtons.
Adds floater_instant_message_concisebuttons.xml
Adds Have buttons on the same line as name for IMs (Affects new IMs) checkbox to Adv. Chat's Chat UI tab.
2013-01-09 10:19:41 -05:00
Lirusaito
c96b840c53 Split off certain preferences into new Adv. Chat subtab Chat UI
From Text Chat: Disallow communicate shortcut opening detached friends list
From Vanity: Use horizontal buttons for contacts floater (needs restart)
The rest were in Chat/IM of Vanity.
2013-01-09 07:30:49 -05:00
Lirusaito
70445ab8a3 Add option for Horizontal buttons on Contacts floater.
Adds Use horizontal buttons for contacts floater (needs restart) to Vanity Preferences.
Adds ContactsUseHorizontalButtons.
Adds FloaterContactsHorizRect for saving horizontal contacts rect.
Adds panel_friends_horiz.xml, panel_group_horiz.xml, and floater_my_friends_horiz.xml

Also corrects string value for FloaterContactsRect
2013-01-08 20:21:15 -05:00
Aleric Inglewood
136e6dd389 New debug channel dc::snapshot. 2013-01-09 00:54:53 +01:00
Siana Gearz
94edef2c3f Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-01-09 00:07:57 +01:00
Siana Gearz
1434e8d6e9 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-01-09 00:07:34 +01:00
Siana Gearz
54a53b574f Follow fix and clean-up 2013-01-09 00:07:17 +01:00
Shyotl
c9954cf14e Some cleanup missed in merge. 2013-01-08 17:07:05 -06:00
Shyotl
7ca974f731 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git into sunshine 2013-01-08 17:06:08 -06:00
Shyotl
54771409d6 Merge branch 'master' into sunshine
Conflicts:
	indra/llimage/llimage.cpp
	indra/llui/llui.cpp
	indra/newview/llvoavatar.cpp
2013-01-08 17:05:29 -06:00
Aleric Inglewood
63ae33eca7 Fix crash in AICurlPrivate::curlthread::PollSet::next
Introduced in
6dcda3595e
(Add recovery for randomly closed socket desciptors.)

By copying CurlSocketInfo* into mCopiedFileDescriptors, it was possible
that we accessed a deleted CurlSocketInfo for it's filedescriptor,
returning a random value, which, when passed to FD_ISSET could cause a
SIGSEGV.

I reverted this change and now store the literal socket descriptors in
mCopiedFileDescriptors again. It is not a problem when libcurl deletes
the corresponding CurlSocketInfo (through a callback to
MultiHandle::socket_callback) in that case, because the fd_set we test
against isn't updated as a result of that, not until we're down with
mCopiedFileDescriptors (at the re-entry of select()).
2013-01-08 23:43:25 +01:00
Lirusaito
b485048f6b Show local chat bar in floater... (Needs restart) 2013-01-08 17:17:52 -05:00
Lirusaito
3ed2da9282 Once more change the behavior of minimizing new chats in open in separate floater mode, to be a little more truthful. 2013-01-08 14:53:08 -05:00
Drake Arconis
7aa95debf1 Merge branch 'master' into meshupload 2013-01-08 14:37:54 -05:00
Drake Arconis
f178de2ff8 Merge remote-tracking branch 'Lirusaito/master' 2013-01-08 14:37:45 -05:00
Drake Arconis
2d9402fd2d Merge branch 'master' into meshupload 2013-01-08 14:37:25 -05:00
Aleric Inglewood
5188693469 Compile fix for last commit and Release 2013-01-08 20:33:29 +01:00
Lirusaito
68911876b9 Option to Disallow communicate shortcut opening detached friends list
Added CommunicateSpecificShortcut
Added checkbox to Text Chat preferences
2013-01-08 13:48:18 -05:00
Drake Arconis
10c19731b3 Merge remote-tracking branch 'Aleric/master' 2013-01-08 13:11:43 -05:00
Lirusaito
820b4ea358 Optionally, remove chatbar from local chat floater.
FloaterChatBarlessRect keeps the size of this separate, for those who want to switch by mood.
ShowLocalChatFloaterBar toggles this.
Show local chat bar in floater entry added to Adv. Chat prefs.
floater_chat_history_barless.xml added for this.
2013-01-08 12:16:51 -05:00
Aleric Inglewood
d8485350e7 Address clang warnings.
* Split off AIThreadSafeBitsPOD, because offsetof may only be used on POD types.
* Added ASSERT_ONLY and ASSERT_ONLY_COMMA
* Removed a few unused class members
* Fixed a bug in AIHTTPReceivedHeaders::equal that more or less only
  compared the length of the headers before :/
2013-01-08 17:50:09 +01:00
Lirusaito
b4b6186f54 Re: 3ea353bef3, fix minimize case to minimize and not steal focus. Also apply to group chats. 2013-01-08 08:43:55 -05:00
Drake Arconis
8889f6b837 Merge remote-tracking branch 'Lirusaito/master' 2013-01-08 06:38:08 -05:00
Lirusaito
3ea353bef3 Change default behavior of separated non-local chats mode to open minimized. 2013-01-08 06:33:07 -05:00
Drake Arconis
ca746f3b47 Merge remote-tracking branch 'Lirusaito/master' into altcompilers 2013-01-08 06:17:47 -05:00
Drake Arconis
9f7e81cec2 Alt Compiler fixes 2013-01-08 06:17:39 -05:00
Drake Arconis
bc3ad59dd5 Revert "Fixed a build issue in clang"
This reverts commit 6d379448be.
2013-01-08 06:16:28 -05:00
Drake Arconis
979adcd6e2 Minor fix to OSX 2013-01-07 22:11:19 -05:00
Shyotl
c5c1294d7d Finished LLGLTexture. Migrated opengl related code from llui.h/cpp to llrender2dutils.h/cpp. Moved lluiimage to llrender library. 2013-01-07 20:12:14 -06:00
Drake Arconis
0ce91ce5ed Build fixes 2013-01-07 18:44:51 -05:00
Lirusaito
67e4518132 Scroll to the object's texture if the user has a copy in their inventory. EXT-5403? Fixes part of Issue 501. 2013-01-07 18:32:54 -05:00
Drake Arconis
b76cb36c0f Merge remote-tracking branch 'Lirusaito/meshupload' into meshupload 2013-01-07 18:31:02 -05:00
Lirusaito
0636f0049a Rectify the problem in which profile images would be below the window border when first opened. 2013-01-07 18:20:02 -05:00
Drake Arconis
8346ce4cd8 Merge remote-tracking branch 'Aleric/meshupload' into meshupload 2013-01-07 18:10:38 -05:00
Drake Arconis
e565341e90 Merge branch 'master' into meshupload 2013-01-07 18:09:56 -05:00
Lirusaito
1b2c0ba02b v-d llviewermenufile.cpp functions (and order) for meshupload, decide when Upload Mesh entry should be enabled. 2013-01-07 18:08:42 -05:00
Aleric Inglewood
cbbe678f9e Remove FloaterModelPreviewRect 2013-01-07 23:31:40 +01:00
Aleric Inglewood
5efcc7186e Fixed mesh file picker and then some 2013-01-07 23:12:09 +01:00
Aleric Inglewood
d188ecae70 Fix crash because of missing debug setting 2013-01-07 23:01:10 +01:00
Shyotl
d71210e942 Trivial changes, mostly to clean up diff noise. Majority of changes are comment corrections or licenseinfo updates. (does not include newview directory) 2013-01-07 14:44:54 -06:00
Aleric Inglewood
9c20139ae8 Fix memory leak. This auto deletes the file picker, the old code did't. 2013-01-07 20:21:45 +01:00
Aleric Inglewood
da19e770a2 Renamed FFLOAD/SAVE_LSL to FFLOAD/SAVE_SCRIPT 2013-01-07 20:11:18 +01:00
Aleric Inglewood
5e7acb9f3a Add support for ".dae" (and others) to filepicker load filter.
* Brought llfilepicker.{cpp,h} up to speed with V3 by adding
  FFLOAD_MODEL, FFLOAD_COLLADA, FFLOAD_SCRIPT, FFLOAD_DICTIONARY
  However, note that we used FFLOAD_LSL, so I renamed their
  FFLOAD_SCRIPT to FFLOAD_LSL and kept our way of filtering.
* Fixed the filter token that is sent to the plugin for
  collada (from "dae" to "collada").
2013-01-07 20:00:54 +01:00
Drake Arconis
6d379448be Fixed a build issue in clang 2013-01-07 11:59:25 -05:00
Aleric Inglewood
79763aacf7 Merge branch 'master' into meshupload 2013-01-07 17:59:21 +01:00
Aleric Inglewood
4b592f7507 Merge remote-tracking branch 'singu/master' 2013-01-07 17:58:53 +01:00
Aleric Inglewood
e7ef9eff4f Merge branch 'master' into meshupload 2013-01-07 17:50:03 +01:00
Drake Arconis
9e2049c463 Added darwin and windows libraries and added copying of collada and glod 2013-01-06 21:58:26 -05:00
Drake Arconis
8aa7113480 Merge branch 'master' into meshupload 2013-01-06 21:46:34 -05:00
Drake Arconis
b1b9172f28 Merge branch 'meshupload' of https://bitbucket.org/LightDrake/singularityviewer-test into meshupload 2013-01-06 21:21:02 -05:00
Drake Arconis
3a691e0c23 Fixed linking 2013-01-06 21:20:41 -05:00
Aleric Inglewood
a9a308e5e9 Never freeze again.
Put snapshot related floaters always on top of the full screen preview.
Make having multiple running uploads more robust.
Fix infinite recursion when clicking on the bottom 'Snapshot' button
under certain conditions.
Unfreeze time more robust; unfreeze time out of precaution when
starting an upload (if 'Keep open' not checked).
Fixed a bug that caused all callbacks for successful feed uploads to be
ignored.
2013-01-06 23:40:53 +01:00
Lirusaito
e7f4fc7107 Added colors for mesh upload MeshImportTableNormalColor and MeshImportTableHighlightColor to default/colors_base.xml 2013-01-06 12:46:56 -05:00
Lirusaito
ac60260da2 Update LLFloaterModelPreview and make it compile~
Collada include_directories and llfloatermodelpreview.*s added to CMakeLists.txt
Update to v-d, compile with AIFilePicker, comment spelling fixes.
Upload Mesh... entry added to File menu.
Updated AIFilePicker to have FFLOAD_COLLADA with an mFilter of "dae"
And, finally, add floater_model_preview.xml~
2013-01-06 11:56:33 -05:00
Drake Arconis
364cf1ec73 Bug fix from v3 2013-01-06 09:47:02 -05:00
Drake Arconis
297c386b16 Fixed glod 2013-01-06 07:30:42 -05:00
Drake Arconis
152a3685fa Merge branch 'master' into meshupload 2013-01-06 04:03:49 -05:00
Drake Arconis
bb7464a975 Merge branch 'master' of https://bitbucket.org/LightDrake/singularityviewer-test 2013-01-06 04:03:14 -05:00
Drake Arconis
9c1237ca05 Initial work. 2013-01-06 03:59:38 -05:00
Siana Gearz
cd27184332 Take out buggy padding removal in OJ 2013-01-06 04:01:28 +01:00
Drake Arconis
cadf654fae Merge branch 'master' of github.com:singularity-viewer/SingularityViewer 2013-01-05 20:50:49 -05:00
Siana Gearz
d5892bbb32 My preliminary thoughts on OpenJPEG 2013-01-06 02:38:12 +01:00
Siana Gearz
20ae72e5fa CMake needs proper quoting 2013-01-05 23:25:47 +01:00
Siana Gearz
7fc4348f64 Fix build deselect 2013-01-05 22:14:10 +01:00
Lirusaito
5ec116021a Feature request: Alt-R for Region/Estate floater 2013-01-05 01:45:55 -05:00
Lirusaito
a992333744 Zi Ree's Debug Setting Floater awesomeness (Search!!)
Made to work with Singularity, and also be a bit better..
Alphabetizes includes.
Switches settings combobox to a scrolllist, and Boolean combobox to a radiogroup.
Makes floater resizable, aligns a lot of the UI, and prepares it all for proper resize behavior.
Adds Copy button for copying the name of the debug setting.
Yay, verbosity! Also adds FloaterDebugSettingsRect to keep track of the floater's size.

Also somehow the getInstance line snuck out of last commit... tossed it in here.
2013-01-05 01:43:17 -05:00
Siana Gearz
fefe0df922 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-01-03 23:37:00 +01:00
Siana Gearz
509bdcb891 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-01-03 23:36:55 +01:00
Aleric Inglewood
2fbd53807c Do not use LLCachedControl as global variables. 2013-01-03 23:25:18 +01:00
Lirusaito
9498375e75 Update LLFloaterSettingsDebug to match up with v-d.
Adds boost::bind and makes the floater a singleton.
2013-01-03 17:20:57 -05:00
Aleric Inglewood
639b264d2d Do not crash upon corrupted HTTP header.
This addresses the reported assertion by luis thibodeaux.
2013-01-03 21:06:20 +01:00
Lirusaito
c3829485e4 Fixed LLCompileQueue messages via update to v-d in parts. Script resets now output properly~ 2013-01-03 14:08:39 -05:00
Lirusaito
88de1b28a2 Add MoyMiniMapCustomColor swatch to Vanity Preferences.
Fixed spacing of MoyMiniMapCustomColor in settings_ascent_coa.xml and removed it from settings_per_account.xml

TODO: Make MoyMiniMapCustomColor more flexible.
-Added ColorCustomChat checkbox, pref code, and setting commented out.
2013-01-03 13:59:14 -05:00
Lirusaito
a50f0008b2 Variable Size Regions! Support for prehash RegionSizeX and large patches. (WIP)
Mostly from Ukando, tweaked a bit to be cleaner, and a little less dramatic.

decode_patch_header now takes a bool optionally, as third argument.
_PREHASH_RegionSizeX is the only used of the two _PREHASH_RegionSize*.
llsurface.cpp: Copy the connectNeighbor for variable size regions almost directly from Ukando
llsurfacepatch.cpp: Patch code from ukando and voodoo.
Changed hardcoded 256 constants and such to width functions in: llglsandbox.cpp, llsurface.cpp, llviewerregion.cpp, llviewerparcelmanager, llviewerparcelmgr.cpp, llvowater.cpp, llworld.cpp
Use region specific width in: llagent.cpp, llglsandbox.cpp, llmanip.cpp, llmanipscale.cpp, llpanelobject.cpp, llviewerbject.cpp, llwind.cpp
Use 256 in llnetmap.cpp in places...
llfloaterregioninfo.cpp: Aurora grid has wacky textures.
Add LLViewerParcelMgr::widthUpdate() for updating mParcelsPerEdge given a region's width. Used in llstartup now.
Add LLWorld::setWidth() for getting a region's size from LLMessageSystem pointers and setting mWidth and mWidthInMeters, accordingly. Called in llviewermessage.cpp as well.
2013-01-03 05:57:55 -05:00
Siana Gearz
17e0c79fe7 Build fix Linux 2013-01-03 03:03:06 +01:00
Siana Gearz
ddef80d2cf Revert "Attempt to fix frame timer on broken mainboards"
This reverts commit 5eb99b7d2f.
2013-01-03 03:02:15 +01:00
Siana Gearz
1872337f5f Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2013-01-03 02:17:20 +01:00
Siana Gearz
6e219f0a4e Merge branch 'master' of https://github.com/Shyotl/SingularityViewer 2013-01-03 02:15:51 +01:00
Shyotl
a408c2211b Workaround for targetomega'd objects turning jittery when zoomed in on. 2013-01-02 18:42:26 -06:00
Siana Gearz
8b2dcb6cb0 We're supposed to use HTTP bake fetch now 2013-01-03 00:10:56 +01:00
Aleric Inglewood
b0fe12f597 Snapshot Freeze Time: add Langolier tag for new (invisible) avatars.
If an avatar TP's in while you are in Freeze Time mode, they now have a
visible tag with the tag 'Langolier' in it. After exiting Freeze Time
mode they become visible. Before they would stay invisible.
2013-01-03 00:02:28 +01:00
Siana Gearz
9a1cc8b9a8 Translation cleanup script fix 2013-01-02 23:47:05 +01:00
Siana Gearz
cce4d50378 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2013-01-02 23:00:46 +01:00
Siana Gearz
e732e62b39 Tiny cleanup 2013-01-02 22:56:04 +01:00
Lirusaito
728056acdb Add support for Aurora's extended land layer codes to llvlmanager.cpp 2013-01-01 20:15:21 -05:00
Lirusaito
b85d282dfb WindLightRefresh added for compliance with Aurora's windlight event system. 2013-01-01 18:09:45 -05:00
Lirusaito
194902798b HippoGridManager and HippoLimits updated with Aurora bits from Voodoo.
Adds isAurora() to HippoGridManager
Adds setAuroraLimits and Aurora case to setLimits() in HippoLimits
2013-01-01 18:04:39 -05:00
Aleric Inglewood
cc276ff232 More snapshot UI tweaks. 2013-01-01 22:34:22 +01:00
Aleric Inglewood
5538fe27e5 Snapshot improvements.
* Warn when it was not possible to make a snapshot because the difference
between the aspect of the required target size and the required target
aspect itself is too large.
* Reset Feed and Postcard Aspect to Default when making a new snapshot.
* Fixed a rounding error that caused one-pixel size error.
2013-01-01 21:30:13 +01:00
Lirusaito
c0ba3e95f3 Ability to change default behavior of Chats being torn off so that all chats appear minimized upon opening, as well, regardless of conditions.
Adds debug setting OtherChatsTornOffAndMinimized
Not added to ui xml because the default behavior is likely fine.
2012-12-31 19:06:23 -05:00
Lirusaito
4ec6f853d8 In-Group feature request: Ability to have chats torn off, by default.
Best viewed without space changes... or maybe it doesn't matter any more.
Debug setting OtherChatsTornOff added.
Added Open new IMs in separate floaters checkbox to  Adv. Chat.
Moved Show group name in chat to the right column on top of Adv. Chat panel.

So how's this work?
Two ways.. 1. The user opens a chat; 2. A chat is started from another party to the user.
In 1, we open the chat in a separate floater and focus the floater.
In 2, we check if there is a floater currently in focus before opening the chat
if so, we minimize the floater, setting focus back to whatever floater the user was focused on;
if not, we leave the new chat floater open and focused.

Note that this will NOT alter the default behavior at all, we can't be having that.
2012-12-31 17:06:30 -05:00
Aleric Inglewood
6dcda3595e Add recovery for randomly closed socket desciptors.
Although it should never happen that a file descriptor is suddenly
closed, it appeared that this happens on linux 64bit when using
FMODex... Not really sure how useful this is, but at least now the
viewer just continues to work, as if -say- the socket was closed
remotely. Before the curl thread would go into a tight loop that it
wouldn't recover from until the watchdog thread terminated the viewer.
2012-12-31 19:24:37 +01:00
Aleric Inglewood
c4a9eb9e44 Work around for 'version `OPENSSL_1.0.0' not found'
When linking against the prebuilt libcrypto.so.1.0.0 and
libssl.so.1.0.0 there is a problem running the viewer in
gdb (on debian) because gdb links with libpython2.7.so
which needs a newer openssl on my system (OPENSSL_1.0.1).

The patch allows to work around this problem by defining
-DUSE_SYSTEM_OPENSSL:BOOL=ON when configuring, which then
causes the viewer to be compiled against the system libs.
(If you already installed the prebuilt, you have to manually
remove them with script/install.py --uninstall openSSL).

The prebuilt libcurl expects a function SSLv2_client_method
however, which is not present in my openssl system libs.
A stub was added which is possible because the function
in question isn't used anyway.
2012-12-31 16:15:36 +01:00
Lirusaito
ba57bb1396 In-group feature request: Allow coloring chat of special people (Friends, Estate Owner, Lindens, Muted Residents)
Added ColorFriendChat, ColorEstateOwnerChat, ColorLindenChat, and ColorMutedChat.
Did some spaces to tabs work, view without space changes.
Add checkboxes beneath corresponding color swatches and "Use colors for chat:" text to Vanity.
Fix Ascent*Color Comments strings.

Also fix the issue where clicking ones name in a group chat would result in it opening a random profile.
2012-12-31 06:24:35 -05:00
Lirusaito
f94f4a1191 Satisfy Issue 100: When timestamp it set to include seconds, the seconds do not get included with IM & chat logs.
Best viewed without space changes.
SecondsInLog debug setting added.
Seconds in Log timestamps checkbox added to Adv. Chat prefs.
2012-12-31 04:54:59 -05:00
Lirusaito
469f76e690 Added "Request New Feature..." to Help->Bug Reporting menu. 2012-12-30 16:21:01 -05:00
Lirusaito
0098466704 Fix for WordFromTheWise's missing lsl strings issue. 2012-12-30 16:09:08 -05:00
Lirusaito
48ddfd25d4 Skins request! Black Red, Black Light Blue, and Black Dark! 2012-12-30 16:07:07 -05:00
Aleric Inglewood
2f3841d7e6 Update of print_diagnostics.
CURLE_COULDNT_CONNECT only happens when we actually get
an error (ie, 'connection refused'). If we time out while the connect
attempt is still running then we get CURLE_OPERATION_TIMEDOUT.
2012-12-30 21:11:10 +01:00
Lirusaito
1cde242f06 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2012-12-30 14:05:35 -05:00
Damian Zhaoying
a0b227fdd8 fixes and UI translations tweeks to fit in spanish language 2012-12-30 15:38:11 -03:00
Aleric Inglewood
36a79d7cbe Merge remote-tracking branch 'shyotl/master' 2012-12-30 02:57:11 +01:00
Lirusaito
2c491bc905 Break out LLMakeOutfitDialog.
Added "Make Outfit..." to Edit menu and Create->"New Outfit" to inventory floater menu.
Cleaned up LLMakeOutfitDialog, using boost::bind and less waste.
Moved onMakeOutfitCommit() to LLMakeOutfitDialog as makeOutfit()
Also changes LLFloaterCustomize's callbacks to use boost::bind
Give new outfit dialog a title instead of a heading.

Small fix to mistake with AnnounceSnapshots xmlstuffs.
2012-12-29 19:24:17 -05:00
Aleric Inglewood
a25c405eae Fix assert after failed login.
reset_login(), among others, sets the state back to STATE_LOGIN_SHOW,
which then causes gViewerWindow->initWorldUI() to be called, which
is the (only) function that calls
LLMenuOptionPathfindingRebakeNavmesh::initialize.
In other words, it's perfectly normal to enter that function
a second time and the assert is erroneous.
2012-12-29 18:08:46 +01:00
Aleric Inglewood
e666c60e7d Merge remote-tracking branch 'singu/master' 2012-12-29 17:05:15 +01:00
Aleric Inglewood
6a45e68c73 Merge branch 'master' into llwebprofile 2012-12-29 17:03:46 +01:00
Aleric Inglewood
59b313352b Third time I have to fix this... weird 2012-12-29 17:03:16 +01:00
Aleric Inglewood
9e04f9ba80 Enable/disable upload/send button correctly.
Passes an 'index' magic number to the upload/save functions which
pass that back to the *Done callbacks, so we know if the *raw*
snapshot is still up to date when the upload succeeds or fails.
2012-12-29 16:51:29 +01:00
Lirusaito
cf5838505f In-world feature request: Announce in chat when someone has taken a snapshot.
AnnounceSnapshots debug setting.
"Announce when someone takes a snapshot" added to Vanity Main Preferences.
took_a_snapshot translatable string added to strings.xml

Also in this commit:
Turned PlayTypingSound check into LLCachedControl.
In preparation for the crippling of all old viewers, the Vanity Main tab shall henceforth only be called Main, not Main  (General)
This change has been made in the code comments and the UI itself.
2012-12-29 07:58:06 -05:00
Lirusaito
23469c00de Satisfy Issue 411: Song list in local chat - not a floater
AnnounceStreamMetadata debug setting.
"Announce music stream's metadata in local chat when tuned in" checkbox added to vanity main preferences.
Made the words Title and Artist translatable, as well as the "Now playing" string.
2012-12-29 07:45:05 -05:00
Siana Gearz
66083d6531 Removing leftover dead code 2012-12-28 21:07:19 +01:00
Aleric Inglewood
1c3748e923 Merge remote-tracking branch 'lirusaito/llwebprofile' into llwebprofile 2012-12-28 17:04:29 +01:00
Aleric Inglewood
88bf01fe6f Avoid crashing at exit by joining the curl thread. 2012-12-28 16:59:04 +01:00
Siana Gearz
a969a8f99c UseNewTargetOmegaCode loosely ported from Henri 2012-12-28 16:46:06 +01:00
Aleric Inglewood
ef0e34a278 Do not attach cam to avatar in Freeze Time mode.
We do, and the avatar moves then the cam jumps
away from the frozen avatar to where it really is.

Unfortunately, it's still not possible to attach
the cam to moving objects with this patch.
Also, scripted changes to objects are still visible,
like changes in local lights of texture full brightness.
2012-12-28 16:40:08 +01:00
Lirusaito
50eb45991d "attachments and wearables", not "clothing and wearables" 2012-12-28 02:13:50 -05:00
Lirusaito
ffa405dad9 Comment cleanup. 2012-12-28 01:25:11 -05:00
Lirusaito
1f966eb6c3 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2012-12-28 01:21:28 -05:00
Lirusaito
b503540075 Always remember to save after making a change. (Location works now) 2012-12-28 00:33:08 -05:00
Lirusaito
2be305d39e Improvements!
Fix CMakeLists being out of order.
Add setting SnapshotFeedAddLocation to keep track of user's preference whether or not to include location in uploads to profile feed.
Clean up LLFloaterFeed to take only what it needs, also gave it a boost~
Remove saveFeed() from LLFloaterSnapshot, removing the dependency on LLWebProfile.
Compile fixes for LLFloaterSnapshot.
Prettied up the upload to feed floater.

TODO: Does Location even work? I can't get it to appear, never seems to get used right in v-d either.
2012-12-28 00:14:54 -05:00
Shyotl
f6ee966e17 Clean up LLAvatarListEntry creation/destruction and resolve LLAvatarPropertiesProcessor retaining deleted observers. 2012-12-27 21:59:59 -06:00
Drake Arconis
246315c723 This is the Cupcake Commit. Cupcakes. Also may fix linux fmodex64. 2012-12-27 15:15:27 -05:00
Aleric Inglewood
be8f16a8e6 Disable upload/send button immediately.
Immediately disables button and reenables it
again when upload/save was a failure.
The callback is now ignored if the snapshot
was refresh in the meantime.
2012-12-27 19:02:58 +01:00
Aleric Inglewood
32614d3539 Compile bug fix 2012-12-27 17:38:28 +01:00
Aleric Inglewood
aab978c7ea WIP: floater_snapshot_feed.xml and code.
This is just a skeleton, roughly copied from the Postcoard
code, which is very similar. Nothing in indra/newview/llfloaterfeed.cpp
has been changed yet, apart from a few deletions (to make it compile)
and the literal replacement of "Postcard" with "Feed".
indra/newview/llfloatersnapshot.cpp was updated however to
open the new floater when one tries to upload a snapshot to the feed.
It is still needed to make a callback to saveFeed(), or rather to
move that function to the saveFeed that is in llfloatersnapshot.cpp.
2012-12-27 17:13:47 +01:00
Lirusaito
d4b48fae6f Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer 2012-12-26 15:50:38 -05:00
Lirusaito
0433bd8560 Gemini young age color should look more natural for Gemini. 2012-12-26 13:09:05 -05:00
Shyotl
71eb0fedd9 Merge branch 'master' of git://github.com/lkalif/SingularityViewer.git 2012-12-25 06:17:42 -06:00
Latif Khalifa
9056ae72d3 Point library downloads to bitbucket since github is depreciating binary downloads 2012-12-25 11:57:59 +01:00
Latif Khalifa
430a5359ac Merge remote-tracking branch 'upstream/master' 2012-12-25 11:47:32 +01:00
Inusaito Sayori
5468bc8447 Fix compile warning/error in aihttptimeoutpolicy.cpp 2012-12-25 04:53:16 -05:00
Inusaito Sayori
059005a4a7 Fly after teleport, off by default. 2012-12-25 04:47:07 -05:00
Shyotl
3ca39ab3f1 Client-side maturity handling when teleporting. Adds new notification that asks if you want to change maturity settings with a single click and automatically re-fire the teleport request. 2012-12-25 02:30:51 -06:00
Shyotl
f8a6e2e19f Moved region rebake button to 'Tools' menu 2012-12-25 02:27:15 -06:00
Shyotl
1f5c2095a5 Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer.git 2012-12-24 18:26:52 -06:00
Shyotl
afaaba6b3c OSX was choking on transformfeedback shaders. Make failure to load such shaders non-critical to the shader loading process. Also clean up glColorMask state properly in wlsky. 2012-12-24 17:56:32 -06:00
Aleric Inglewood
c85f976ed6 Fix outbox notifications. 2012-12-24 22:08:44 +01:00
Aleric Inglewood
b22832ba54 Fix cookie handling.
Cookies are now collected during redirects, one the last cookie
of a given name is kept. Cookies are then set by looking for
the right cookie name (instead of what viewer 3 does: just
use the last cookie that was set).

This fixes the merchant outbox.
2012-12-24 19:58:54 +01:00
Inusaito Sayori
977f17a893 Add feature to Continue flying upon standing, if the user was flying when they sat down.
A couple users said this could be handy.
Useful for birds, fairies, and otherwise flying critters.
2012-12-24 05:24:57 -05:00
Inusaito Sayori
60621a300c Satisfy in-world feature request: Avatar Count on Radar. 2012-12-24 03:09:09 -05:00
Aleric Inglewood
fac3fc67b6 Add filtering for curl debug output.
Add CURLTR debug channel for libcurl API calls,
and use CURLIO only for libcurl debug output.
Note: need to set gDebugCurlTerse to true for
filtering to take effect, then pass 'debug_on'
to the LLHttpClient methods that require debugging.
2012-12-24 02:54:36 +01:00
Inusaito Sayori
8e3da75c3c Missed a spot for 487. 2012-12-23 15:10:53 -05:00
Inusaito Sayori
c9dc2eaad4 Satisfy Issue 487: Walking Backwards, Turning Around
TurnAroundWhenWalkingBackwards added.
Turn Around When Walking Backwards added to Vanity Main Preferences.
Code borrowed, in part, from Firestorm.
2012-12-23 00:26:49 -05:00
Aleric Inglewood
8095d6c48c Large snapshot update (part 3) 2012-12-22 19:07:08 +01:00
Inusaito Sayori
6f2e192947 Complete Issue 545: OSSL Updates
Updates keywords.ini, lsl_functions_os.xml, and en-us/strings.xml
Thanks WhiteStar, ThiteStar.
2012-12-22 12:25:46 -05:00
Inusaito Sayori
0b9d8c7b47 Satisfy Issue 512: Increase RenderVolume LOD Factor Threshold to 4.000
Phoenix users are used to this.
The setting clamps to the max here, so it must be 4.
2012-12-22 05:29:21 -05:00
Inusaito Sayori
1ecea32933 An hour is not a circle. 2012-12-22 02:07:36 -05:00
Inusaito Sayori
ceae4470f5 Fix a windows compiley thing. 2012-12-21 05:49:14 -05:00
Lirusaito
237455f4b7 Use boost::date_time for displaying avatar age.
llpanelavatar change may be better viewed without space changes.
2012-12-20 23:34:05 -05:00
Lirusaito
3d25f8ee79 Merge branch 'master' of https://github.com/DamianZhaoying/SingularityViewer 2012-12-20 09:25:33 -05:00
Lirusaito
86572462e6 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2012-12-20 09:25:21 -05:00
Lirusaito
245eaa1fd9 Satisfy radar issues: 51(Avatar Age), 382(Time duration), 245(Hide columns on command)
Overall:
Extras tab added to radar.
Activities given tool_tip strings, TODO: Get icon entries to have tool_tips.
Added tab_min_width="0" to tab container so tabs take up only as much space as necessary.

Issue 51:
RadarAlertAge, AvatarAgeAlertDays debugs added.
RadarTextYoung color added to colors_base and gemini.
UI bits added to radar.
ALERT_TYPE_AGE, LIST_AGE, and boost::lexical_cast added.
LLAvatarListEntry is now derived from LLAvatarPropertiesObserver for processProperties and all that fun stuff. Also has mAgeAlert and mAge.
processProperties is basically copied directly from LLAvatarPanel, it can probably be bettered.

Issue 382:
mTime, getTime(), LIST_TIME
Time column.

Issue 245:
Hide columns text and checkboxes added to UI.
assessColumns() now used to determine which columns to show. Also once used during postBuild()
col_helper() function added to help decide to hide or resize a column based on given params.
checkboxes all use assessColumns as callback.
RadarColumn* debug settings added.

If you read this all, that's a sign the 'pocalypse is coming.
2012-12-20 08:58:18 -05:00
Damian Zhaoying
e7b712660e update spanish translations 2012-12-19 23:29:36 -03:00
Inusaito Sayori
c35f762826 Satisfy Issue 476: Option to mute gesture sounds
Enable Gesture Sounds checkbox added to Adv. Chat->Spam tab.
2012-12-19 03:35:06 -05:00
Inusaito Sayori
66386d6eec Fix an issue introduced in V2MultiWear in which double-clicking or hitting an enter on a worn wearable would rewear it, not detach it. 2012-12-17 19:32:40 -05:00
Inusaito Sayori
9e8dafc4ca Satisfy Issue 167: Ability to set global "add instead of wear" option in prefs
Adds debug setting LiruAddNotReplace.
Adds "Add clothing and wearables instead of replacing them" to Main (General) tab of Vanity Preferences.
2012-12-17 17:17:12 -05:00
Inusaito Sayori
36a698fee4 Satisfy Issue 271: Fly after teleport feature.
Add debug setting LiruFlyAfterTeleports
Add Always fly after Teleports to General tab of System preferences.
(Also, fixed tabs where spaces should be in settings.xml)
2012-12-16 20:50:40 -05:00
Aleric Inglewood
aab764a6e5 Don't crash when user forgets last name on non-SL grids. 2012-12-16 23:39:58 +01:00
Aleric Inglewood
11f30bc28d Removed gFullName which isn't used anywhere 2012-12-16 23:17:10 +01:00
Inusaito Sayori
46b5595c3f Don't leave Group Copy check enabled unless we have trans and copy perms.
Also some code consistency chages that won't change anything.
2012-12-16 15:32:06 -05:00
Inusaito Sayori
c380f1f399 Don't show Paste As Link when Paste As Copy is shown enabled because it'll just be disabled in these cases. 2012-12-16 15:31:53 -05:00
Aleric Inglewood
a9963bcdb3 In FreezeTime mode, keep avatars that TP away.
If an avatar TP's away (or quits), he will not
disappear anymore from a frozen scene. Unfreezing
makes him disappear of course (and clean up).

Known bug: if during Freeze Time mode someone
TPs away and then back, then he becomes a cloud
after Freeze Time is ended, which can only be
reset by another teleport (or relog) from either
the cloud or the one seeing him as cloud.
I decided not to fix this, cause there are things
with a higher priority and this - if it happens
at all - is rare and easy to recognize and work
around.
2012-12-16 00:13:06 +01:00
Aleric Inglewood
e0c0da7dff In Freeze Time re-show fullscreen preview when clicking thumbnail. 2012-12-15 02:20:53 +01:00
Aleric Inglewood
cfa8df0575 Merge branch 'master' into llwebprofile 2012-12-14 20:43:17 +01:00
Aleric Inglewood
c34f2941aa Merge remote-tracking branch 'github/master' 2012-12-14 20:41:18 +01:00
Aleric Inglewood
555b397067 Install vivox runtime also on standalone when linux64 2012-12-14 20:40:27 +01:00
Aleric Inglewood
65ce7dabe3 Merge remote-tracking branch 'github/master' 2012-12-14 16:42:27 +01:00
Aleric Inglewood
4d7d3ea937 Compile fix for non-standalone with DEBUG_CURLIO
Oops, that option doesn't exist in the prebuilt curl version.
2012-12-14 16:40:03 +01:00
Aleric Inglewood
15b6593143 Large snapshot update (part 2) 2012-12-14 02:31:08 +01:00
Aleric Inglewood
4bb3ed0d85 Login crash bug fix.
XMLRPCResponder constructor was missing.
This fixes the following crash signature:

VIEWER      : 2012-12-12T14:25:13Z INFO("AppInit"): setStartupState: Startup state changing from STATE_LOGIN_NO_DATA_YET to STATE_LOGIN_DOWNLOADING
VIEWER      : 2012-12-12T14:25:14Z INFO("AppInit"): transferRate: Buffer size:   1308 B
VIEWER      : 2012-12-12T14:25:14Z INFO("AppInit"): transferRate: Transfer rate: 11 kb/s

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff33df7f5 in XMLRPC_RequestGetData () from /usr/lib/x86_64-linux-gnu/libxmlrpc-epi.so.0
(gdb) bt

Reason was that if the server replied with some error code then
mResponse was undefined.

I also added code to retry three times in that case;
the http status code that I get was 503, which really
mean "Service *temporarily* unavailable", so a retry
is in order.
2012-12-12 16:27:32 +01:00
Aleric Inglewood
d8bc84adb1 Snapshot fixes and improvements.
* Allow to pass -1 to LLImageBase::reallocateData too (default parameter),
  causing it to allocate what is necessary for the size set (same
  behavior as allocateData).
* Speed up LLImageRaw::scale with factor 2 or 3 by copying the data less
  often and calling LLImageBase::reallocateData instead of destroying
  and recreating always.
* Fix gl_rect_2d to not decrement top and right with one pixel.
* Remove the vague "Constrain Proportions" checkbox and replace it with
  a new combo box and spinner to explicitly set the target aspect ratio,
  allowing to set it also to something different than either the window
  aspect ratio (ie, 1.6) or the target image dimension (1.0 for textures)
  which was totally lacking when, for example, uploading a profile image
  (which needs to be 4:3). This also allows to show snapshots on prims
  of arbitrary aspects.
2012-12-04 00:45:01 +01:00
Drake Arconis
5e71d9578f A bit of cleanup in preperation for VS2012 2012-11-30 11:17:10 -05:00
Aleric Inglewood
e788ee5faf Merge branch 'master' into llwebprofile 2012-11-28 18:50:31 +01:00
Aleric Inglewood
de52eebe7a Allow setting a custom size when uploading a texture. 2012-11-26 23:21:34 +01:00
Aleric Inglewood
d7069a2a66 Fix cancelling "Save" while "Keep open after save" is unchecked.
This causes a failure to save local file, or when clicking
Cancel in the file chooser, to keep the image and keep the
snapshot floater open so a retry to save the image can be
attempted.
2012-11-26 20:41:25 +01:00
Aleric Inglewood
7faa19b297 Large snapshot update (part 1)
This commit concentrates on remembering what parameters
where used for the last snapshot (the actual source, not
the formatted one), thus - the parameters passed to
rawSnapshot() - and then shows this snapshot as if it
was just made whenever the UI parameter selection matches.
The result is that the user can make a snapshot, save
it (for example) to their harddisk and then change the
destination and upload the same thing as snapshot.
The code tries hard to make this possible by automatically
adjusting the UI parameters to match every time the destination
is changed PROVIDED it was already saved or uploaded before.
If a snapshot wasn't saved and one changes destination
then this currently doesn't happen (by you could manually
make the parameters match, and still upload it). Also, if
the resolution is changed for a particular destination then
it won't automatically adjust it again.

Obviously, snapshots are no longer refreshed when changing
destination etc. You have to explicitly click "Refresh
Snapshot" before the last one is deleted / replaced.

The Debug Setting variables reflect the (last) manual choices
in most cases (set in the onCommit functions). If such a choice
is not allowed for a different destination then the UI is
changed to reflect the current behavior and the checkbox is
disabled so the user can't change it anymore. Then, if they
change destination back - the Debug Setting variable is used
to remember their last preference. A new Debug Setting has
been added for this purpose: SnapshotLayerType (colors or depth).

The old mSnapshotUpToDate has been removed and replaced with
mShowFreezeFrameSnapshot. The old getSnapshotUpToDate() now
returns something else (than mShowFreezeFrameSnapshot), namely
whether or not the current raw snapshot was taken with the same
parameters as are currently set in the UI.

The unused functions getImageAspect() and getAspect() were
removed.

mCurImageIndex has been deleted. Index 0 now means "the last
snapshot" and index 1 is temporarily used for the Falling Away
animation.

mDataSize was renamed to mFormattedDataSize.

The size spinner arrows are now disabled too whenever the spinner
edit field is disabled.

A bug in Freeze Time was fixed, where avatars would still
rotate around their axis in place (and without that their
attachments moved!)

Pressing ESC would return keyboard control to "walking"
for the own avatar with the above as result for the own
avatar. We now intercept ESC and use it (in Freeze Time mode)
to return to the cammable preview when a 2D preview was
being shown.
2012-11-26 18:12:41 +01:00
Aleric Inglewood
14c046108e Snapshot floater changes
* Added a radio button for "Post to my.secondlife.com feed"
* Moved the snapshot to the top of the floater.
* Increased the size of the snapshot to match the size used in V3
  (floater is only 4 pixels wider though).
* Disable the "Temporary upload" checkbox when the Destination isn't the
  inventory.
* Update the shown Upload Fee to L$ 0 if temporary is checked.
* Added a size chooser for the Feed destination, using exclusively
  preset sizes with an aspect ratio of 4:3.
* Added two new preset sizes: 1024x1024 for texture uploads, and
  1680x1050 for save to disk.
2012-11-20 22:27:48 +01:00
Aleric Inglewood
b5a8850d65 Fix deinitialization order fiasco. 2012-11-19 08:32:00 +01:00
Aleric Inglewood
3f51bb6e1d Clear the command queue after flushing statemachines
Flushing the state machines can cause remove commands to be added to the
command queue, so clearing it needs to be after.
2012-11-19 08:31:46 +01:00
Siana Gearz
bf4100c024 Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer 2012-11-19 05:10:16 +01:00
4908 changed files with 260480 additions and 118998 deletions

11
.gitignore vendored
View File

@@ -24,3 +24,14 @@
/edited-files.txt
qtcreator-build/
/.pc
/build-*
/viewer-*
/indra/newview/res/viewerRes.rc
/indra/newview/res/viewerRes_bc.rc
/indra/newview/English.lproj/InfoPlist.strings
/indra/newview/linux_tools/handle_secondlifeprotocol.sh
/indra/newview/linux_tools/install.sh
/indra/newview/linux_tools/refresh_desktop_app_entry.sh
/indra/newview/linux_tools/wrapper.sh

View File

@@ -0,0 +1,29 @@
INTEL LICENSE AGREEMENT
IMPORTANT - READ BEFORE COPYING OR USING.
Do not use or load this library and any associated materials (collectively,
the "Software") until you have read the following terms and conditions. By
loading or using the Software, you agree to the terms of this Agreement. If
you do not wish to so agree, do not use the Software.
LICENSE: Subject to the restrictions below, Intel Corporation ("Intel")
grants to you the permission to use, copy, distribute and prepare derivative
works of this Software for any purpose and without fee, provided, that
Intel's copyright notice appear in all copies of the Software files.
The distribution of derivative works of the Software is also subject to the
following limitations: you (i) are solely responsible to your customers for
any liability which may arise from the distribution, (ii) do not make any
statement that your product is "certified", or that its performance is
guaranteed, by Intel, and (iii) do not use Intel's name or trademarks to
market your product without written permission.
EXCLUSION OF ALL WARRANTIES. The Software is provided "AS IS" without any
express or implies warranty of any kind including warranties of
merchantability, noninfringement, or fitness for a particular purpose.
Intel does not warrant or assume responsibility for the accuracy or
completeness of any information contained within the Software.
As this Software is given free of charge, in no event shall Intel be liable
for any damages whatsoever arising out of the use of or inability to use the
Software, even if Intel has been adviced of the possibility of such damages.
Intel does not assume any responsibility for any errors which may appear in
this Software nor any responsibility to update it.

4
README
View File

@@ -15,8 +15,8 @@ Singularity Viewer is a SecondLife(tm) protocol compatible client application.
It can be used to access SecondLife services as well as a number of others such
as those based upon the OpenSim platform.
Singulariy is maintained by a small group of volunteers who can be contacted
both, in-world (SingularityViewer group) as well on IRC (#SingularityViewer
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
the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...)

82
doc/responders.txt Normal file
View File

@@ -0,0 +1,82 @@
All Responders are derived from ResponderBase, however you normally do never derived from that directly yourself.
Instead, Responder classes are derived from one of:
1. Responder base classes
ResponderHeadersOnly -- Derived classes are used with HTTPClient::head or HTTPClient::getHeaderOnly.
ResponderWithCompleted -- Derived classes implement completed(U32, std::string const&, LLSD const&),
or completedRaw(U32, std::string const&, LLChannelDescriptors const&, buffer_ptr_t const&)
if the response is not (always) LLSD.
ResponderWithResult -- Derived classes implement result(LLSD const&) and optionally
errorWithContent(U32, std::string const&, LLSD const&) OR error(U32, std::string const&).
2. Special base classes
ResponderIgnoreBody -- Same as ResponderWithResult but already implements result() that ignored the body.
LLAssetUploadResponder -- Derived from ResponderWithResult. Base class for responders that upload assets via capabilities.
LegacyPolledResponder -- Used for old code that needs polling (do not use).
There is one non-base class Responder with a more general purpose:
3. Special purpose responders:
ResponderIgnore -- Derived from ResponderIgnoreBody. Used for "fire and forget" requests as it ignores any response.
4. Signatures.
Every final (derived) responder class must implement 'getName(void) const' and 'getHTTPTimeoutPolicy(void)',
except the base classes (this is to alert the developer they have to implement getName as it is pure virtual).
For example:
extern AIHTTPTimeoutPolicy myResponder_timeout; // Add 'P(myResponder)' to indra/llmessage/aihttptimeoutpolicy.cpp.
class MyResponder : public LLHTTPClient::SomeResponderBaseClass {
...
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return myResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "MyResponder"; }
};
Note the convention that the name of a AIHTTPTimeoutPolicy (what goes between the brackets of P()) is
the class name minus any 'AI' or 'LL' prefix and starting with a lowercase character.
Then, depending on the three main base classes that was derived from, the signatures should be:
class MyResponder1 : public LLHTTPClient::ResponderHeadersOnly {
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers);
// See for example PostImageResponder
...
};
class MyResponder2 : public LLHTTPClient::ResponderWithCompleted {
/*virtual*/ void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer);
// See for example PostImageRedirectResponder
>>>OR<<<
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content); // See for example LLImportPostResponder
};
class MyResponder3 : public LLHTTPClient::ResponderWithResult {
/*virtual*/ void result(const LLSD& content); // See for example LLInventoryModelFetchItemResponder
/*virtual*/ void error(U32 status, const std::string& reason);
>>>OR instead error()<<<
/*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
// See for example LLSDMessage::EventResponder
};
Finally, if a responder derived from ResponderWithCompleted or ResponderWithResult needs to process
individual headers, you need to override 'needsHeaders':
/*virtual*/ bool needsHeaders(void) const { return true; } // See for example LLWebProfileResponders::PostImageResponder
// which will cause this to be called:
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers);
And if it needs redirection to work (you'll get an assert if you forget this and it is being redirected):
/*virtual*/ bool followRedir(void) const { return true; } // See for example LLWebProfileResponders::ConfigResponder
This is not necessary for ResponderHeadersOnly because that already defines both.

View File

@@ -378,6 +378,14 @@
<boolean>true</boolean>
</map>
<key>WindLightRefresh</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>ParcelVoiceInfo</key>
<map>
<key>flavor</key>
@@ -386,7 +394,6 @@
<boolean>true</boolean>
</map>
<key>ParcelNavigateMedia</key>
<map>
<key>flavor</key>
@@ -656,7 +663,7 @@
<boolean>false</boolean>
<key>RequestTextureDownload</key>
<boolean>false</boolean>
<boolean>true</boolean>
<key>EventQueueGet</key>
<boolean>false</boolean>
@@ -708,7 +715,17 @@
<key>FetchLib2</key>
<boolean>true</boolean>
</map>
<key>UploadBakedTexture</key>
<boolean>true</boolean>
<key>ObjectMedia</key>
<boolean>false</boolean>
<key>ObjectMediaNavigate</key>
<boolean>false</boolean>
</map>
<key>messageBans</key>
<map>

View File

@@ -30,8 +30,6 @@ include(BuildVersion)
include(UnixInstall)
set (DISABLE_FATAL_WARNINGS TRUE)
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
@@ -53,6 +51,9 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
add_subdirectory(${LIBS_OPEN_PREFIX}libopenjpeg)
add_subdirectory(${LIBS_OPEN_PREFIX}libhacd)
add_subdirectory(${LIBS_OPEN_PREFIX}libndhacd)
add_subdirectory(${LIBS_OPEN_PREFIX}libpathing)
add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
@@ -67,10 +68,6 @@ if(STANDALONE)
add_subdirectory(${LIBS_OPEN_PREFIX}llqtwebkit)
endif(STANDALONE)
if (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE)
add_subdirectory(${LIBS_CLOSED_PREFIX}llkdu)
endif (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE)
#add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
@@ -78,73 +75,20 @@ if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
add_custom_target(viewer)
if (VIEWER)
add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
# viewer plugins directory
add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
# viewer plugins directory
add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
# llplugin testbed code (is this the right way to include it?)
#if (NOT LINUX)
# add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
#endif (NOT LINUX)
# llplugin testbed code (is this the right way to include it?)
#if (NOT LINUX)
# add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
#endif (NOT LINUX)
if (LINUX)
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
add_dependencies(viewer linux-crash-logger-strip-target)
elseif (DARWIN)
#add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
#add_subdirectory(${VIEWER_PREFIX}mac_updater)
add_dependencies(viewer mac-crash-logger)
#add_dependencies(viewer mac-updater)
elseif (WINDOWS)
add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
# cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
if (EXISTS ${VIEWER_DIR}win_setup)
add_subdirectory(${VIEWER_DIR}win_setup)
endif (EXISTS ${VIEWER_DIR}win_setup)
add_subdirectory(${VIEWER_PREFIX}win_updater)
add_dependencies(viewer windows-updater)
add_dependencies(viewer windows-crash-logger)
elseif (SOLARIS)
add_subdirectory(solaris_crash_logger)
add_dependencies(viewer solaris-crash-logger)
endif (LINUX)
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
add_subdirectory(${VIEWER_PREFIX}newview)
add_dependencies(viewer secondlife-bin)
endif (VIEWER)
# Linux builds the viewer and server in 2 separate projects
# In order for ./develop.py build server to work on linux,
# the viewer project needs a server target.
# This is not true for mac and windows.
if (LINUX)
add_custom_target(server)
endif (LINUX)
if (SERVER)
if (NOT LINUX)
add_custom_target(server)
endif (NOT LINUX)
include(${SERVER_PREFIX}Server.cmake)
endif (SERVER)
# Windows builds include tools like VFS tool
if (SERVER)
if (WINDOWS)
add_subdirectory(${SERVER_PREFIX}tools)
endif (WINDOWS)
endif (SERVER)
# Configure prebuilt binary download. This must be done last so that
# all subdirectories have a chance to list the packages they need.
# We need scp for proprietary downloads.
if(INSTALL_PROPRIETARY)
include(FindSCP)
endif(INSTALL_PROPRIETARY)
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
add_subdirectory(${VIEWER_PREFIX}newview)
add_dependencies(viewer secondlife-bin)
# The use_prebuilt_binary macro in cmake/Prebuilt.cmake records
# packages in the PREBUILT property of the 'prepare' target.

View File

@@ -19,14 +19,18 @@ include_directories(
set(aistatemachine_SOURCE_FILES
aistatemachine.cpp
aistatemachinethread.cpp
aitimer.cpp
aicondition.cpp
)
set(aistatemachine_HEADER_FILES
CMakeLists.txt
aistatemachine.h
aistatemachinethread.h
aitimer.h
aicondition.h
)
set_source_files_properties(${aistatemachine_HEADER_FILES}

View File

@@ -0,0 +1,89 @@
/**
* @file aicondition.cpp
* @brief Implementation of AICondition
*
* Copyright (c) 2013, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 14/10/2013
* Initial version, written by Aleric Inglewood @ SL
*/
#include "sys.h"
#include "aicondition.h"
#include "aistatemachine.h"
void AIConditionBase::wait(AIStateMachine* state_machine)
{
// The condition must be locked before calling AIStateMachine::wait().
llassert(mutex().isSelfLocked());
// Add the new state machine at the end.
mWaitingStateMachines.push_back(state_machine);
}
void AIConditionBase::remove(AIStateMachine* state_machine)
{
mutex().lock();
// Remove all occurances of state_machine from the queue.
queue_t::iterator const end = mWaitingStateMachines.end();
queue_t::iterator last = end;
for (queue_t::iterator iter = mWaitingStateMachines.begin(); iter != last; ++iter)
{
if (iter->get() == state_machine)
{
if (--last == iter)
{
break;
}
queue_t::value_type::swap(*iter, *last);
}
}
// This invalidates all iterators involved, including end, but not any iterators to the remaining elements.
mWaitingStateMachines.erase(last, end);
mutex().unlock();
}
void AIConditionBase::signal(int n)
{
// The condition must be locked before calling AICondition::signal or AICondition::broadcast.
llassert(mutex().isSelfLocked());
// Signal n state machines.
while (n > 0 && !mWaitingStateMachines.empty())
{
LLPointer<AIStateMachine> state_machine = mWaitingStateMachines.front();
bool success = state_machine->signalled();
// Only state machines that are actually still blocked should be in the queue:
// they are removed from the queue by calling AICondition::remove whenever
// they are unblocked for whatever reason...
llassert(success);
if (success)
{
++n;
}
else
{
// We never get here...
remove(state_machine.get());
}
}
}

View File

@@ -0,0 +1,110 @@
/**
* @file aicondition.h
* @brief Condition variable for statemachines.
*
* Copyright (c) 2013, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 14/10/2013
* Initial version, written by Aleric Inglewood @ SL
*/
#ifndef AICONDITION_H
#define AICONDITION_H
#include <deque>
#include <llpointer.h>
#include "aithreadsafe.h"
class AIStateMachine;
class LLMutex;
// class AICondition
//
// Call AIStateMachine::wait(AICondition&) in the multiplex_impl of a state machine to
// make the state machine go idle until some thread calls AICondition::signal().
//
// If the state machine is no longer running or wasn't waiting anymore because
// something else woke it up, then AICondition::signal() will wake up another
// state machine (if any).
//
// Usage:
//
// struct Foo { bool met(); }; // Returns true when the condition is met.
// AICondition<Foo> Condition_t;
// AIAccess<Foo> Condition_wat;
//
// // Some thread-safe condition variable.
// Condition_t condition;
//
// // Inside the state machine:
// {
// ...
// state WAIT_FOR_CONDITION:
// {
// // Lock condition and check it. Wait if condition is not met yet.
// {
// Condition_wat condition_w(condition);
// if (!condition_w->met())
// {
// wait(condition);
// break;
// }
// }
// set_state(CONDITION_MET);
// break;
// }
// CONDITION_MET:
// {
//
class AIConditionBase
{
public:
virtual ~AIConditionBase() { }
void signal(int n = 1); // Call this when the condition was met to release n state machines.
void broadcast(void) { signal(mWaitingStateMachines.size()); } // Release all blocked state machines.
private:
// These functions are called by AIStateMachine.
friend class AIStateMachine;
void wait(AIStateMachine* state_machine);
void remove(AIStateMachine* state_machine);
protected:
virtual LLMutex& mutex(void) = 0;
protected:
typedef std::deque<LLPointer<AIStateMachine> > queue_t;
queue_t mWaitingStateMachines;
};
template<typename T>
class AICondition : public AIThreadSafeSimpleDC<T>, public AIConditionBase
{
protected:
/*virtual*/ LLMutex& mutex(void) { return this->mMutex; }
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
* @file aistatemachine.h
* @brief State machine base class
*
* Copyright (c) 2010, Aleric Inglewood.
* Copyright (c) 2010 - 2013, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,397 +26,451 @@
*
* 01/03/2010
* Initial version, written by Aleric Inglewood @ SL
*
* 28/02/2013
* Rewritten from scratch to fully support threading.
*/
#ifndef AISTATEMACHINE_H
#define AISTATEMACHINE_H
#include "aithreadsafe.h"
#include <llpointer.h>
#include "lltimer.h"
#include <list>
#include <boost/signals2.hpp>
//!
// A AIStateMachine is a base class that allows derived classes to
// go through asynchronous states, while the code still appears to
// be more or less sequential.
//
// These state machine objects can be reused to build more complex
// objects.
//
// It is important to note that each state has a duality: the object
// can have a state that will cause a corresponding function to be
// called; and often that function will end with changing the state
// again, to signal that it was handled. It is easy to confuse the
// function of a state with the state at the end of the function.
// For example, the state "initialize" could cause the member
// function 'init()' to be called, and at the end one would be
// inclined to set the state to "initialized". However, this is the
// wrong approach: the correct use of state names does reflect the
// functions that will be called, never the function that just was
// called.
//
// Each (derived) class goes through a series of states as follows:
//
// Creation
// |
// v
// (idle) <----. Idle until run() is called.
// | |
// Initialize | Calls initialize_impl().
// | |
// | (idle) | Idle until cont() or set_state() is called.
// | | ^ |
// v v | |
// .-------. | |
// | Run |_, | Call multiplex_impl() until idle(), abort() or finish() is called.
// '-------' |
// | | |
// v | |
// Abort | | Calls abort_impl().
// | | |
// v v |
// Finish | Calls finish_impl() (which may call kill()) or
// | | | the callback function passed to run(), if any,
// | v |
// | Callback | which may call kill() and/or run().
// | | | |
// | | `-----'
// v v
// Killed Delete the statemachine (all statemachines must be allocated with new).
//
// Each state causes corresponding code to be called.
// Finish cleans up whatever is done by Initialize.
// Abort should clean up additional things done by Run.
//
// The Run state is entered by calling run().
//
// While the base class is in the Run state, it is the derived class
// that goes through different states. The state variable of the derived
// class is only valid while the base class is in the state Run.
//
// A derived class can exit the Run state by calling one of two methods:
// abort() in case of failure, or finish() in case of success.
// Respectively these set the state to Abort and Finish.
//
// finish_impl may call kill() for a (default) destruction upon finish.
// Even in that case the callback (passed to run()) may call run() again,
// which overrides the request for a default kill. Or, if finish_impl
// doesn't call kill() the callback may call kill() to request the
// destruction of the state machine object.
//
// State machines are run from the "idle" part of the viewer main loop.
// Often a state machine has nothing to do however. In that case it can
// call the method idle(). This will stop the state machine until
// external code changes it's state (by calling set_state()), or calls
// cont() to continue with the last state.
//
// The methods of the derived class call set_state() to change their
// own state within the bs_run state, or by calling either abort()
// or finish().
//
// Restarting a finished state machine can also be done by calling run(),
// which will cause a re-initialize.
//
// Derived classes should implement the following constants:
//
// static state_type const min_state = first_state;
// static state_type const max_state = last_state + 1;
//
// Where first_state should be equal to BaseClass::max_state.
// These should represent the minimum and (one past) the maximum
// values of mRunState.
//
// virtual void initialize_impl(void)
//
// Initializes the derived class.
//
// virtual void multiplex_impl(void);
//
// This method should handle mRunState in a switch.
// For example:
//
// switch(mRunState)
// {
// case foo:
// handle_foo();
// break;
// case wait_state:
// if (still_waiting())
// {
// idle();
// break;
// }
// set_state(working);
// /*fall-through*/
// case working:
// do_work();
// if (failure())
// abort();
// break;
// case etc:
// etc();
// finish();
// break;
// }
//
// virtual void abort_impl(void);
//
// A call to this method should bring the object to a state
// where finish_impl() can be called.
//
// virtual void finish_impl(void);
//
// Should cleanup whatever init_impl() did, or any of the
// states of the object where multiplex_impl() calls finish().
// Call kill() from here to make that the default behavior
// (state machine is deleted unless the callback calls run()).
//
// virtual char const* state_str_impl(state_type run_state);
//
// Should return a stringified value of run_state.
//
class AIStateMachine {
//! The type of mState
class AIConditionBase;
class AIStateMachine;
class AIEngine
{
private:
struct QueueElementComp;
class QueueElement {
private:
LLPointer<AIStateMachine> mStateMachine;
public:
QueueElement(AIStateMachine* statemachine) : mStateMachine(statemachine) { }
friend bool operator==(QueueElement const& e1, QueueElement const& e2) { return e1.mStateMachine == e2.mStateMachine; }
friend bool operator!=(QueueElement const& e1, QueueElement const& e2) { return e1.mStateMachine != e2.mStateMachine; }
friend struct QueueElementComp;
AIStateMachine const& statemachine(void) const { return *mStateMachine; }
AIStateMachine& statemachine(void) { return *mStateMachine; }
};
struct QueueElementComp {
inline bool operator()(QueueElement const& e1, QueueElement const& e2) const;
};
public:
typedef std::list<QueueElement> queued_type;
struct engine_state_type {
queued_type list;
bool waiting;
engine_state_type(void) : waiting(false) { }
};
private:
AIThreadSafeSimpleDC<engine_state_type, LLCondition> mEngineState;
typedef AIAccessConst<engine_state_type, LLCondition> engine_state_type_crat;
typedef AIAccess<engine_state_type, LLCondition> engine_state_type_rat;
typedef AIAccess<engine_state_type, LLCondition> engine_state_type_wat;
char const* mName;
static U64 sMaxCount;
public:
AIEngine(char const* name) : mName(name) { }
void add(AIStateMachine* state_machine);
void mainloop(void);
void threadloop(void);
void wake_up(void);
void flush(void);
char const* name(void) const { return mName; }
static void setMaxCount(F32 StateMachineMaxTime);
};
extern AIEngine gMainThreadEngine;
extern AIEngine gStateMachineThreadEngine;
#ifndef STATE_MACHINE_PROFILING
#ifndef LL_RELEASE_FOR_DOWNLOAD
#define STATE_MACHINE_PROFILING 1
#endif
#endif
class AIStateMachine : public LLThreadSafeRefCount
{
public:
typedef U32 state_type; //!< The type of run_state
// A simple timer class that will calculate time delta between ctor and GetTimerData call.
// Time data is stored as a nested TimeData object.
// If STATE_MACHINE_PROFILING is defined then a stack of all StateTimers from root is maintained for debug output.
class StateTimerBase
{
public:
class TimeData
{
friend class StateTimerBase;
public:
TimeData() : mStart(-1), mEnd(-1) {}
U64 GetDuration() { return mEnd - mStart; }
private:
U64 mStart, mEnd;
#if !STATE_MACHINE_PROFILING
TimeData(const std::string& name) : mStart(get_clock_count()), mEnd(get_clock_count()) {}
#else
TimeData(const std::string& name) : mName(name), mStart(get_clock_count()), mEnd(get_clock_count()) {}
void DumpTimer(std::ostringstream& msg, std::string prefix);
std::vector<TimeData> mChildren;
std::string mName;
static TimeData sRoot;
#endif
};
#if !STATE_MACHINE_PROFILING
StateTimerBase(const std::string& name) : mData(name) {}
~StateTimerBase() {}
protected:
TimeData mData;
// Return a copy of the underlying timer data.
// This allows the data live beyond the scope of the state timer.
public:
const TimeData GetTimerData()
{
mData.mEnd = get_clock_count(); //set mEnd to current time, since GetTimerData() will always be called before the dtor, obv.
return mData;
}
#else
protected:
// Ctors/dtors are hidden. Only StateTimerRoot and StateTimer are permitted to access them.
StateTimerBase() : mData(NULL) {}
~StateTimerBase()
{
// If mData is null then the timer was not registered due to being in the wrong thread or the root timer wasn't in the expected state.
if (!mData)
return;
mData->mEnd = get_clock_count();
mTimerStack.pop_back();
}
// Also hide internals from everything except StateTimerRoot and StateTimer
bool AddAsRoot(const std::string& name)
{
if (!is_main_thread())
return true; //Ignoring this timer, but pretending it was added.
if (!mTimerStack.empty())
return false;
TimeData::sRoot = TimeData(name);
mData = &TimeData::sRoot;
mData->mChildren.clear();
mTimerStack.push_back(this);
return true;
}
bool AddAsChild(const std::string& name)
{
if (!is_main_thread())
return true; //Ignoring this timer, but pretending it was added.
if (mTimerStack.empty())
return false;
mTimerStack.back()->mData->mChildren.push_back(TimeData(name));
mData = &mTimerStack.back()->mData->mChildren.back();
mTimerStack.push_back(this);
return true;
}
TimeData* mData;
static std::vector<StateTimerBase*> mTimerStack;
public:
// Debug spew
static void DumpTimers(std::ostringstream& msg)
{
TimeData::sRoot.DumpTimer(msg, "");
}
// Return a copy of the underlying timer data.
// This allows the data live beyond the scope of the state timer.
const TimeData GetTimerData() const
{
if (mData)
{
TimeData ret = *mData;
ret.mEnd = get_clock_count(); //set mEnd to current time, since GetTimerData() will always be called before the dtor, obv.
return ret;
}
return TimeData();
}
#endif
};
public:
#if !STATE_MACHINE_PROFILING
typedef StateTimerBase StateTimerRoot;
typedef StateTimerBase StateTimer;
#else
class StateTimerRoot : public StateTimerBase
{ //A StateTimerRoot can become a child if a root already exists.
public:
StateTimerRoot(const std::string& name)
{
if(!AddAsRoot(name))
AddAsChild(name);
}
};
class StateTimer : public StateTimerBase
{ //A StateTimer can never become a root
public:
StateTimer(const std::string& name)
{
AddAsChild(name);
}
};
#endif
protected:
// The type of event that causes multiplex() to be called.
enum event_type {
initial_run,
schedule_run,
normal_run,
insert_abort
};
// The type of mState
enum base_state_type {
bs_initialize,
bs_run,
bs_reset, // Idle state before run() is called. Reference count is zero (except for a possible external LLPointer).
bs_initialize, // State after run() and before/during initialize_impl().
bs_multiplex, // State after initialize_impl() before finish() or abort().
bs_abort,
bs_finish,
bs_callback,
bs_killed
};
//! The type of mActive
enum active_type {
as_idle, // State machine is on neither list.
as_queued, // State machine is on continued_statemachines list.
as_active // State machine is on active_statemachines list.
};
//! Type of continued_statemachines.
typedef std::vector<AIStateMachine*> continued_statemachines_type;
//! Type of sContinuedStateMachinesAndMainloopEnabled.
struct csme_type
{
continued_statemachines_type continued_statemachines;
bool mainloop_enabled;
};
public:
typedef U32 state_type; //!< The type of mRunState
//! Integral value equal to the state with the lowest value.
static state_type const min_state = bs_initialize;
//! Integral value one more than the state with the highest value.
static state_type const max_state = bs_killed + 1;
protected:
struct multiplex_state_type {
base_state_type base_state;
AIEngine* current_engine; // Current engine.
multiplex_state_type(void) : base_state(bs_reset), current_engine(NULL) { }
};
struct sub_state_type {
state_type run_state;
state_type advance_state;
AIConditionBase* blocked;
bool reset;
bool need_run;
bool idle;
bool skip_idle;
bool aborted;
bool finished;
};
private:
base_state_type mState; //!< State of the base class.
bool mIdle; //!< True if this state machine is not running.
bool mAborted; //!< True after calling abort() and before calling run().
active_type mActive; //!< Whether statemachine is idle, queued to be added to the active list, or already on the active list.
S64 mSleep; //!< Non-zero while the state machine is sleeping.
LLMutex mIdleActive; //!< Used for atomic operations on the pair mIdle / mActive.
#ifdef SHOW_ASSERT
AIThreadID mContThread; //!< Thread that last called locked_cont().
bool mCalledThreadUnsafeIdle; //!< Set to true when idle() is called.
#endif
// Base state.
AIThreadSafeSimpleDC<multiplex_state_type> mState;
typedef AIAccessConst<multiplex_state_type> multiplex_state_type_crat;
typedef AIAccess<multiplex_state_type> multiplex_state_type_rat;
typedef AIAccess<multiplex_state_type> multiplex_state_type_wat;
protected:
// Sub state.
AIThreadSafeSimpleDC<sub_state_type> mSubState;
typedef AIAccessConst<sub_state_type> sub_state_type_crat;
typedef AIAccess<sub_state_type> sub_state_type_rat;
typedef AIAccess<sub_state_type> sub_state_type_wat;
private:
// Mutex protecting everything below and making sure only one thread runs the state machine at a time.
LLMutex mMultiplexMutex;
// Mutex that is locked while calling *_impl() functions and the call back.
LLMutex mRunMutex;
S64 mSleep; //!< Non-zero while the state machine is sleeping.
// Callback facilities.
// From within an other state machine:
AIStateMachine* mParent; //!< The parent object that started this state machine, or NULL if there isn't any.
state_type mNewParentState; //!< The state at which the parent should continue upon a successful finish.
bool mAbortParent; //!< If true, abort parent on abort(). Otherwise continue as normal.
bool mOnAbortSignalParent; //!< If true and mAbortParent is false, change state of parent even on abort.
LLPointer<AIStateMachine> mParent; // The parent object that started this state machine, or NULL if there isn't any.
state_type mNewParentState; // The state at which the parent should continue upon a successful finish.
bool mAbortParent; // If true, abort parent on abort(). Otherwise continue as normal.
bool mOnAbortSignalParent; // If true and mAbortParent is false, change state of parent even on abort.
// From outside a state machine:
struct callback_type {
typedef boost::signals2::signal<void (bool)> signal_type;
callback_type(signal_type::slot_type const& slot) { connection = signal.connect(slot); }
~callback_type() { connection.disconnect(); }
void callback(bool success) const { signal(success); }
private:
boost::signals2::connection connection;
signal_type signal;
typedef boost::signals2::signal<void (bool)> signal_type;
callback_type(signal_type::slot_type const& slot) { connection = signal.connect(slot); }
~callback_type() { connection.disconnect(); }
void callback(bool success) const { signal(success); }
private:
boost::signals2::connection connection;
signal_type signal;
};
callback_type* mCallback; //!< Pointer to signal/connection, or NULL when not connected.
callback_type* mCallback; // Pointer to signal/connection, or NULL when not connected.
static U64 sMaxCount; //!< Number of cpu clocks below which we start a new state machine within the same frame.
static AIThreadSafeDC<csme_type> sContinuedStateMachinesAndMainloopEnabled; //!< Read/write locked variable pair.
// Engine stuff.
AIEngine* mDefaultEngine; // Default engine.
AIEngine* mYieldEngine; // Requested engine.
protected:
LLMutex mSetStateLock; //!< For critical areas in set_state() and locked_cont().
//! State of the derived class. Only valid if mState == bs_run. Call set_state to change.
volatile state_type mRunState;
public:
//! Create a non-running state machine.
AIStateMachine(void) : mState(bs_initialize), mIdle(true), mAborted(true), mActive(as_idle), mSleep(0), mParent(NULL), mCallback(NULL)
#ifdef SHOW_ASSERT
, mContThread(AIThreadID::none), mCalledThreadUnsafeIdle(false)
// Debug stuff.
AIThreadID mThreadId; // The thread currently running multiplex().
base_state_type mDebugLastState; // The previous state that multiplex() had a normal run with.
bool mDebugShouldRun; // Set if we found evidence that we should indeed call multiplex_impl().
bool mDebugAborted; // True when abort() was called.
bool mDebugContPending; // True while cont() was called by not handled yet.
bool mDebugSetStatePending; // True while set_state() was called by not handled yet.
bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet.
bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex).
#endif
{ }
#ifdef CWDEBUG
protected:
bool mSMDebug; // Print debug output only when true.
#endif
private:
U64 mRuntime; // Total time spent running in the main thread (in clocks).
public:
AIStateMachine(CWD_ONLY(bool debug)) : mCallback(NULL), mDefaultEngine(NULL), mYieldEngine(NULL),
#ifdef SHOW_ASSERT
mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false),
mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false),
#endif
#ifdef CWDEBUG
mSMDebug(debug),
#endif
mRuntime(0)
{ }
protected:
//! The user should call 'kill()', not delete a AIStateMachine (derived) directly.
virtual ~AIStateMachine() { llassert((mState == bs_killed && mActive == as_idle) || mState == bs_initialize); }
public:
//! Halt the state machine until cont() is called (not thread-safe).
void idle(void);
//! Halt the state machine until cont() is called, provided it is still in 'cur_run_state'.
void idle(state_type current_run_state);
//! Temporarily halt the state machine.
void yield_frame(unsigned int frames) { mSleep = -(S64)frames; }
//! Temporarily halt the state machine.
void yield_ms(unsigned int ms) { mSleep = get_clock_count() + calc_clock_frequency() * ms / 1000; }
//! Continue running after calling idle.
void cont(void)
// The user should call finish() (or abort(), or kill() from the call back when finish_impl() calls run()),
// not delete a class derived from AIStateMachine directly. Deleting it directly before calling run() is
// ok however.
virtual ~AIStateMachine()
{
mSetStateLock.lock();
// Ignore calls to cont() if the statemachine isn't idle. See comments in set_state().
// Calling cont() twice or after calling set_state(), without first calling idle(), is an error.
if (mState != bs_run || !mIdle) { llassert(mState != bs_run || !mContThread.equals_current_thread()); mSetStateLock.unlock(); return; }
locked_cont();
#ifdef SHOW_ASSERT
base_state_type state = multiplex_state_type_rat(mState)->base_state;
llassert(state == bs_killed || state == bs_reset);
#endif
}
private:
void locked_cont(void);
public:
//---------------------------------------
// Changing the state.
// These functions may be called directly after creation, or from within finish_impl(), or from the call back function.
void run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent = true, bool on_abort_signal_parent = true, AIEngine* default_engine = &gMainThreadEngine);
void run(callback_type::signal_type::slot_type const& slot, AIEngine* default_engine = &gMainThreadEngine);
void run(void) { run(NULL, 0, false, true, mDefaultEngine); }
//! Change state to <code>bs_run</code>. May only be called after creation or after returning from finish().
// If <code>parent</code> is non-NULL, change the parent state machine's state to <code>new_parent_state</code>
// upon finish, or in the case of an abort and when <code>abort_parent</code> is true, call parent->abort() instead.
void run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent = true, bool on_abort_signal_parent = true);
//! Change state to 'bs_run'. May only be called after creation or after returning from finish().
// Does not cause a callback.
void run(void) { run(NULL, 0, false); }
//! The same as above, but pass the result of a boost::bind with _1.
//
// Here _1, if present, will be replaced with a bool indicating success.
//
// For example:
//
// <code>
// struct Foo { void callback(AIStateMachineDerived* ptr, bool success); };
// ...
// AIStateMachineDerived* magic = new AIStateMachineDerived; // Deleted by callback
// // Call foo_ptr->callback(magic, _1) on finish.
// state_machine->run(boost::bind(&Foo::callback, foo_ptr, magic, _1));
// </code>
//
// or
//
// <code>
// struct Foo { void callback(bool success, AIStateMachineDerived const& magic); };
// ...
// AIStateMachineDerived magic;
// // Call foo_ptr->callback(_1, magic) on finish.
// magic.run(boost::bind(&Foo::callback, foo_ptr, _1, magic));
// </code>
//
// or
//
// <code>
// static void callback(void* userdata);
// ...
// AIStateMachineDerived magic;
// // Call callback(userdata) on finish.
// magic.run(boost::bind(&callback, userdata));
// </code>
void run(callback_type::signal_type::slot_type const& slot);
//! Change state to 'bs_abort'. May only be called while in the bs_run state.
void abort(void);
//! Change state to 'bs_finish'. May only be called while in the bs_run state.
void finish(void);
//! Refine state while in the bs_run state. May only be called while in the bs_run state.
void set_state(state_type run_state);
//! Change state to 'bs_killed'. May only be called while in the bs_finish state.
// This function may only be called from the call back function (and cancels a call to run() from finish_impl()).
void kill(void);
//---------------------------------------
// Other.
//! Called whenever the StateMachineMaxTime setting is changed.
static void setMaxCount(F32 StateMachineMaxTime);
//---------------------------------------
// Accessors.
//! Return true if state machine was aborted (can be used in finish_impl).
bool aborted(void) const { return mAborted; }
//! Return true if the derived class is running (also when we are idle).
bool running(void) const { return mState == bs_run; }
//! Return true if it's safe to call abort.
bool abortable(void) const { return mState == bs_run || mState == bs_initialize; }
//! Return true if the derived class is running but idle.
bool waiting(void) const { return mState == bs_run && mIdle; }
// Use some safebool idiom (http://www.artima.com/cppsource/safebool.html) rather than operator bool.
typedef volatile state_type AIStateMachine::* const bool_type;
//! Return true if state machine successfully finished.
operator bool_type() const { return ((mState == bs_initialize || mState == bs_callback) && !mAborted) ? &AIStateMachine::mRunState : 0; }
//! Return a stringified state, for debugging purposes.
char const* state_str(state_type state);
private:
static void add_continued_statemachines(AIReadAccess<csme_type>& csme_r);
static void dowork(void);
void multiplex(U64 current_time);
protected:
// This function can be called from initialize_impl() and multiplex_impl() (both called from within multiplex()).
void set_state(state_type new_state); // Run this state the NEXT loop.
// These functions can only be called from within multiplex_impl().
void idle(void); // Go idle unless cont() or advance_state() were called since the start of the current loop, or until they are called.
void wait(AIConditionBase& condition); // The same as idle(), but wake up when AICondition<T>::signal() is called.
void finish(void); // Mark that the state machine finished and schedule the call back.
void yield(void); // Yield to give CPU to other state machines, but do not go idle.
void yield(AIEngine* engine); // Yield to give CPU to other state machines, but do not go idle. Continue running from engine 'engine'.
void yield_frame(unsigned int frames); // Run from the main-thread engine after at least 'frames' frames have passed.
void yield_ms(unsigned int ms); // Run from the main-thread engine after roughly 'ms' miliseconds have passed.
bool yield_if_not(AIEngine* engine); // Do not really yield, unless the current engine is not 'engine'. Returns true if it switched engine.
public:
//! Call this once per frame to give the statemachines CPU cycles.
static void mainloop(void)
// This function can be called from multiplex_imp(), but also by a child state machine and
// therefore by any thread. The child state machine should use an LLPointer<AIStateMachine>
// to access this state machine.
void abort(void); // Abort the state machine (unsuccessful finish).
// These are the only three functions that can be called by any thread at any moment.
// Those threads should use an LLPointer<AIStateMachine> to access this state machine.
void cont(void); // Guarantee at least one full run of multiplex() after this function is called. Cancels the last call to idle().
void advance_state(state_type new_state); // Guarantee at least one full run of multiplex() after this function is called
// iff new_state is larger than the last state that was processed.
bool signalled(void); // Call cont() iff this state machine is still blocked after a call to wait(). Returns false if it already unblocked.
public:
// Accessors.
// Return true if the derived class is running (also when we are idle).
bool running(void) const { return multiplex_state_type_crat(mState)->base_state == bs_multiplex; }
// Return true if the derived class is running and idle.
bool waiting(void) const
{
{
AIReadAccess<csme_type> csme_r(sContinuedStateMachinesAndMainloopEnabled, true);
if (!csme_r->mainloop_enabled)
return;
if (!csme_r->continued_statemachines.empty())
add_continued_statemachines(csme_r);
}
dowork();
multiplex_state_type_crat state_r(mState);
return state_r->base_state == bs_multiplex && sub_state_type_crat(mSubState)->idle;
}
// Return true if the derived class is running and idle or already being aborted.
bool waiting_or_aborting(void) const
{
multiplex_state_type_crat state_r(mState);
return state_r->base_state == bs_abort || ( state_r->base_state == bs_multiplex && sub_state_type_crat(mSubState)->idle);
}
// Return true if are added to the engine.
bool active(AIEngine const* engine) const { return multiplex_state_type_crat(mState)->current_engine == engine; }
bool aborted(void) const { return sub_state_type_crat(mSubState)->aborted; }
// Use some safebool idiom (http://www.artima.com/cppsource/safebool.html) rather than operator bool.
typedef state_type AIStateMachine::* const bool_type;
// Return true if state machine successfully finished.
operator bool_type() const
{
sub_state_type_crat sub_state_r(mSubState);
return (sub_state_r->finished && !sub_state_r->aborted) ? &AIStateMachine::mNewParentState : 0;
}
//! Abort all running state machines and then run mainloop until all state machines are idle (called when application is exiting).
static void flush(void);
// Return stringified state, for debugging purposes.
char const* state_str(base_state_type state);
#ifdef CWDEBUG
char const* event_str(event_type event);
#endif
void add(U64 count) { mRuntime += count; }
U64 getRuntime(void) const { return mRuntime; }
// For diagnostics. Every derived class must override this.
virtual const char* getName() const = 0;
protected:
//---------------------------------------
// Derived class implementations.
// Handle initializing the object.
virtual void initialize_impl(void) = 0;
// Handle mRunState.
virtual void multiplex_impl(void) = 0;
// Handle aborting from current bs_run state.
virtual void abort_impl(void) = 0;
// Handle cleaning up from initialization (or post abort) state.
virtual void finish_impl(void) = 0;
// Implemenation of state_str for run states.
virtual void multiplex_impl(state_type run_state) = 0;
virtual void abort_impl(void) { }
virtual void finish_impl(void) { }
virtual char const* state_str_impl(state_type run_state) const = 0;
virtual void force_killed(void); // Called from AIEngine::flush().
private:
void reset(void); // Called from run() to (re)initialize a (re)start.
void multiplex(event_type event); // Called from AIEngine to step through the states (and from reset() to kick start the state machine).
state_type begin_loop(base_state_type base_state); // Called from multiplex() at the start of a loop.
void callback(void); // Called when the state machine finished.
bool sleep(U64 current_time) // Count frames if necessary and return true when the state machine is still sleeping.
{
if (mSleep == 0)
return false;
else if (mSleep < 0)
++mSleep;
else if ((U64)mSleep <= current_time)
mSleep = 0;
return mSleep != 0;
}
friend class AIEngine; // Calls multiplex() and force_killed().
};
// This case be used in state_str_impl.
bool AIEngine::QueueElementComp::operator()(QueueElement const& e1, QueueElement const& e2) const
{
return e1.mStateMachine->getRuntime() < e2.mStateMachine->getRuntime();
}
// This can be used in state_str_impl.
#define AI_CASE_RETURN(x) do { case x: return #x; } while(0)
#endif

View File

@@ -0,0 +1,196 @@
/**
* @file aistatemachinethread.cpp
* @brief Implementation of AIStateMachineThread
*
* Copyright (c) 2013, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 23/01/2013
* Initial version, written by Aleric Inglewood @ SL
*/
#include "linden_common.h"
#include "aistatemachinethread.h"
class AIStateMachineThreadBase::Thread : public LLThread {
private:
LLPointer<AIStateMachineThreadBase> mImpl;
bool mNeedCleanup;
public:
Thread(AIStateMachineThreadBase* impl) :
#ifdef LL_DEBUG
LLThread(impl->impl().getName()),
#else
LLThread("AIStateMachineThreadBase::Thread"),
#endif
mImpl(impl) { }
protected:
/*virtual*/ void run(void)
{
mNeedCleanup = mImpl->impl().thread_done(mImpl->impl().run());
}
/*virtual*/ void terminated(void)
{
mStatus = STOPPED;
if (mNeedCleanup)
{
// The state machine that started us has disappeared! Clean up ourselves.
// This is OK now because in our case nobody is watching us and having set
// the status to STOPPED didn't change anything really, although it will
// prevent LLThread::shutdown from blocking a whole minute and then calling
// apr_thread_exit to never return! Normally, the LLThread might be deleted
// immediately (by the main thread) after setting mStatus to STOPPED.
Thread::completed(this);
}
}
public:
// TODO: Implement a thread pool. For now, just create a new one every time.
static Thread* allocate(AIStateMachineThreadBase* impl) { return new Thread(impl); }
static void completed(Thread* threadp) { delete threadp; }
};
// MAIN THREAD
char const* AIStateMachineThreadBase::state_str_impl(state_type run_state) const
{
switch(run_state)
{
AI_CASE_RETURN(start_thread);
AI_CASE_RETURN(wait_stopped);
}
return "UNKNOWN STATE";
}
void AIStateMachineThreadBase::initialize_impl(void)
{
mThread = NULL;
mAbort = false;
set_state(start_thread);
}
void AIStateMachineThreadBase::multiplex_impl(state_type run_state)
{
switch(run_state)
{
case start_thread:
mThread = Thread::allocate(this);
// Set next state.
set_state(wait_stopped);
idle(); // Wait till the thread returns.
mThread->start();
break;
case wait_stopped:
if (!mThread->isStopped())
{
yield();
break;
}
// We're done!
//
// We can only get here when AIThreadImpl::done called cont(), (very
// shortly after which it will be STOPPED), which means we need to do
// the clean up of the thread.
// Also, the thread has really stopped now, so it's safe to delete it.
//
// Clean up the thread.
Thread::completed(mThread);
mThread = NULL; // Stop abort_impl() from doing anything.
if (mAbort)
abort();
else
finish();
break;
}
}
void AIStateMachineThreadBase::abort_impl(void)
{
if (mThread)
{
// If this AIStateMachineThreadBase still exists then the AIStateMachineThread<THREAD_IMPL>
// that is derived from it still exists and therefore its member THREAD_IMPL also still exists
// and therefore impl() is valid.
bool need_cleanup = impl().state_machine_done(mThread); // Signal the fact that we aborted.
if (need_cleanup)
{
// This is an unlikely race condition. We have been aborted by our parent,
// but at the same time the thread finished!
// We can only get here when AIThreadImpl::thread_done already returned
// (VERY shortly after the thread will stop (if not already)).
// Just go into a tight loop while waiting for that, when it is safe
// to clean up the thread.
while (!mThread->isStopped())
{
mThread->yield();
}
Thread::completed(mThread);
}
else
{
// The thread is still happily running (and will clean up itself).
// Lets make sure we're not flooded with this situation.
llwarns << "Thread state machine aborted while the thread is still running. That is a waste of CPU and should be avoided." << llendl;
}
}
}
bool AIThreadImpl::state_machine_done(LLThread* threadp)
{
StateMachineThread_wat state_machine_thread_w(mStateMachineThread);
AIStateMachineThreadBase* state_machine_thread = *state_machine_thread_w;
bool need_cleanup = !state_machine_thread;
if (!need_cleanup)
{
// If state_machine_thread is non-NULL, then AIThreadImpl::thread_done wasnt called yet
// (or at least didn't return yet) which means the thread is still running.
// Try telling the thread that it can stop.
threadp->setQuitting();
// Finally, mark that we are NOT going to do the cleanup by setting mStateMachineThread to NULL.
*state_machine_thread_w = NULL;
}
return need_cleanup;
}
// AIStateMachineThread THREAD
bool AIThreadImpl::thread_done(bool result)
{
StateMachineThread_wat state_machine_thread_w(mStateMachineThread);
AIStateMachineThreadBase* state_machine_thread = *state_machine_thread_w;
bool need_cleanup = !state_machine_thread;
if (!need_cleanup)
{
// If state_machine_thread is non-NULL then AIThreadImpl::abort_impl wasn't called,
// which means the state machine still exists. In fact, it should be in the waiting() state.
// It can also happen that the state machine is being aborted right now.
llassert(state_machine_thread->waiting_or_aborting());
state_machine_thread->schedule_abort(!result);
// Note that if the state machine is not running (being aborted, ie - hanging in abort_impl
// waiting for the lock on mStateMachineThread) then this is simply ignored.
state_machine_thread->cont();
// Finally, mark that we are NOT going to do the cleanup by setting mStateMachineThread to NULL.
*state_machine_thread_w = NULL;
}
return need_cleanup;
}

View File

@@ -0,0 +1,247 @@
/**
* @file aistatemachinethread.h
* @brief Run code in a thread.
*
* Copyright (c) 2013, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 23/01/2013
* Initial version, written by Aleric Inglewood @ SL
*/
#ifndef AISTATEMACHINETHREAD_H
#define AISTATEMACHINETHREAD_H
#include "aistatemachine.h"
#include "llthread.h"
#include "aithreadsafe.h"
#ifdef EXAMPLE_CODE // undefined
class HelloWorldThread : public AIThreadImpl {
private:
bool mStdErr; // input
bool mSuccess; // output
public:
// Constructor.
HelloWorldThread(void) : AIThreadImpl("HelloWorldThread"), // MAIN THREAD
mStdErr(false), mSuccess(false) { }
// Some initialization function (if needed).
void init(bool err) { mStdErr = err; } // MAIN THREAD
// Read back output.
bool successful(void) const { return mSuccess; }
// Mandatory signature.
/*virtual*/ bool run(void) // NEW THREAD
{
if (mStdErr)
std::cerr << "Hello world" << std::endl;
else
std::cout << "Hello world" << std::endl;
mSuccess = true;
return true; // true = finish, false = abort.
}
};
// The states of this state machine.
enum hello_world_state_type {
HelloWorld_start = AIStateMachine::max_state,
HelloWorld_done
};
// The statemachine class (this is almost a template).
class HelloWorld : public AIStateMachine {
private:
LLPointer<AIStateMachineThread<HelloWorldThread> > mHelloWorld;
bool mErr;
public:
HelloWorld() : mHelloWorld(new AIStateMachineThread<HelloWorldThread>), mErr(false) { }
// Print to stderr or stdout?
void init(bool err) { mErr = err; }
protected:
// Call finish() (or abort()), not delete.
/*virtual*/ ~HelloWorld() { }
// Handle initializing the object.
/*virtual*/ void initialize_impl(void);
// Handle run_state.
/*virtual*/ void multiplex_impl(state_type run_state);
// Implemenation of state_str for run states.
/*virtual*/ char const* state_str_impl(state_type run_state) const
{
switch(run_state)
{
AI_CASE_RETURN(HelloWorld_start);
AI_CASE_RETURN(HelloWorld_done);
}
return "UNKNOWN STATE";
}
};
// The actual implementation of this statemachine starts here!
void HelloWorld::initialize_impl(void)
{
mHelloWorld->thread_impl().init(mErr); // Initialize the thread object.
set_state(HelloWorld_start);
}
void HelloWorld::multiplex_impl(state_type run_state)
{
switch (run_state)
{
case HelloWorld_start:
{
mHelloWorld->run(this, HelloWorld_done); // Run HelloWorldThread and set the state of 'this' to HelloWorld_done when finished.
idle(HelloWorld_start); // Always go idle after starting a thread!
break;
}
case HelloWorld_done:
{
// We're done. Lets also abort when the thread reported no success.
if (mHelloWorld->thread_impl().successful()) // Read output/result of thread object.
finish();
else
abort();
break;
}
}
}
#endif // EXAMPLE CODE
class AIStateMachineThreadBase;
// Derive from this to implement the code that must run in another thread.
class AIThreadImpl {
private:
template<typename THREAD_IMPL> friend class AIStateMachineThread;
typedef AIAccess<AIStateMachineThreadBase*> StateMachineThread_wat;
AIThreadSafeSimpleDC<AIStateMachineThreadBase*> mStateMachineThread;
public:
virtual bool run(void) = 0;
bool thread_done(bool result);
bool state_machine_done(LLThread* threadp);
#ifdef LL_DEBUG
private:
char const* mName;
protected:
AIThreadImpl(char const* name = "AIStateMachineThreadBase::Thread") : mName(name) { }
public:
char const* getName(void) const { return mName; }
#endif
protected:
virtual ~AIThreadImpl() { }
};
// The base class for statemachine threads.
class AIStateMachineThreadBase : public AIStateMachine {
private:
// The actual thread (derived from LLThread).
class Thread;
protected:
typedef AIStateMachine direct_base_type;
// The states of this state machine.
enum thread_state_type {
start_thread = direct_base_type::max_state, // Start the thread (if necessary create it first).
wait_stopped // Wait till the thread is stopped.
};
public:
static state_type const max_state = wait_stopped + 1;
protected:
AIStateMachineThreadBase(CWD_ONLY(bool debug))
#ifdef CWDEBUG
: AIStateMachine(debug)
#endif
{ }
private:
// Handle initializing the object.
/*virtual*/ void initialize_impl(void);
// Handle mRunState.
/*virtual*/ void multiplex_impl(state_type run_state);
// Handle aborting from current bs_run state.
/*virtual*/ void abort_impl(void);
// Implemenation of state_str for run states.
/*virtual*/ char const* state_str_impl(state_type run_state) const;
// Returns a reference to the implementation code that needs to be run in the thread.
virtual AIThreadImpl& impl(void) = 0;
private:
Thread* mThread; // The thread that the code is run in.
bool mAbort; // (Inverse of) return value of AIThreadImpl::run(). Only valid in state wait_stopped.
public:
void schedule_abort(bool do_abort) { mAbort = do_abort; }
};
// The state machine that runs T::run() in a thread.
// THREAD_IMPL Must be derived from AIThreadImpl.
template<typename THREAD_IMPL>
class AIStateMachineThread : public AIStateMachineThreadBase {
private:
THREAD_IMPL mThreadImpl;
public:
// Constructor.
AIStateMachineThread(CWD_ONLY(bool debug))
#ifdef CWDEBUG
: AIStateMachineThreadBase(debug)
#endif
{
*AIThreadImpl::StateMachineThread_wat(mThreadImpl.mStateMachineThread) = this;
}
// Accessor.
THREAD_IMPL& thread_impl(void) { return mThreadImpl; }
/*virtual*/ const char* getName() const
{
#define STRIZE(arg) #arg
return "AIStateMachineThread<"STRIZE(THREAD_IMPL)">";
#undef STRIZE
}
protected:
/*virtual*/ AIThreadImpl& impl(void) { return mThreadImpl; }
};
#endif

View File

@@ -31,11 +31,6 @@
#include "linden_common.h"
#include "aitimer.h"
enum timer_state_type {
AITimer_start = AIStateMachine::max_state,
AITimer_expired
};
char const* AITimer::state_str_impl(state_type run_state) const
{
switch(run_state)
@@ -43,6 +38,7 @@ char const* AITimer::state_str_impl(state_type run_state) const
AI_CASE_RETURN(AITimer_start);
AI_CASE_RETURN(AITimer_expired);
}
llassert(false);
return "UNKNOWN STATE";
}
@@ -54,12 +50,12 @@ void AITimer::initialize_impl(void)
void AITimer::expired(void)
{
set_state(AITimer_expired);
advance_state(AITimer_expired);
}
void AITimer::multiplex_impl(void)
void AITimer::multiplex_impl(state_type run_state)
{
switch (mRunState)
switch (run_state)
{
case AITimer_start:
{
@@ -79,18 +75,3 @@ void AITimer::abort_impl(void)
{
mFrameTimer.cancel();
}
void AITimer::finish_impl(void)
{
// Kill object by default.
// This can be overridden by calling run() from the callback function.
kill();
}
void AIPersistentTimer::finish_impl(void)
{
// Don't kill object by default.
if (aborted())
kill();
// Callback function should always call kill() or run().
}

View File

@@ -59,12 +59,28 @@
// just reuse the old ones (call the same callback).
//
class AITimer : public AIStateMachine {
protected:
// The base class of this state machine.
typedef AIStateMachine direct_base_type;
// The different states of the state machine.
enum timer_state_type {
AITimer_start = direct_base_type::max_state,
AITimer_expired
};
public:
static state_type const max_state = AITimer_expired + 1;
private:
AIFrameTimer mFrameTimer; //!< The actual timer that this object wraps.
F64 mInterval; //!< Input variable: interval after which the event will be generated, in seconds.
public:
AITimer(void) : mInterval(0) { DoutEntering(dc::statemachine, "AITimer(void) [" << (void*)this << "]"); }
AITimer(CWD_ONLY(bool debug = false)) :
#ifdef CWDEBUG
AIStateMachine(debug),
#endif
mInterval(0) { DoutEntering(dc::statemachine(mSMDebug), "AITimer(void) [" << (void*)this << "]"); }
/**
* @brief Set the interval after which the timer should expire.
@@ -82,22 +98,21 @@ class AITimer : public AIStateMachine {
*/
F64 getInterval(void) const { return mInterval; }
/*virtual*/ const char* getName() const { return "AITimer"; }
protected:
// Call finish() (or abort()), not delete.
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine, "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine(mSMDebug), "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
// Handle initializing the object.
/*virtual*/ void initialize_impl(void);
// Handle mRunState.
/*virtual*/ void multiplex_impl(void);
/*virtual*/ void multiplex_impl(state_type run_state);
// Handle aborting from current bs_run state.
/*virtual*/ void abort_impl(void);
// Handle cleaning up from initialization (or post abort) state.
/*virtual*/ void finish_impl(void);
// Implemenation of state_str for run states.
/*virtual*/ char const* state_str_impl(state_type run_state) const;
@@ -106,12 +121,4 @@ class AITimer : public AIStateMachine {
void expired(void);
};
// Same as above but does not delete itself automatically by default after use.
// Call kill() on it yourself (from the callback function) when you're done with it!
class AIPersistentTimer : public AITimer {
protected:
// Handle cleaning up from initialization (or post abort) state.
/*virtual*/ void finish_impl(void);
};
#endif

View File

@@ -2,6 +2,9 @@
#
# Compilation options shared by all Second Life components.
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(Variables)
@@ -9,11 +12,25 @@ include(Variables)
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
set(CMAKE_CXX_FLAGS_RELEASE
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG")
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
"-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.
@@ -23,28 +40,39 @@ set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
# Platform-specific compilation flags.
if (WINDOWS)
# Various libs are compiler specific, generate some variables here we can just use
# when we require them instead of reimplementing the test each time.
if (MSVC10)
set(MSVC_DIR 10.0)
set(MSVC_SUFFIX 100)
endif (MSVC10)
if (MSVC11)
set(MSVC_DIR 11.0)
set(MSVC_SUFFIX 110)
endif (MSVC11)
# Remove default /Zm1000 flag that cmake inserts
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# Always use /Zm140
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm140")
# Don't build DLLs.
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /arch:SSE2"
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP"
CACHE STRING "C++ compiler debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /arch:SSE2"
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP"
CACHE STRING "C++ compiler release-with-debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast"
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /fp:fast -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
CACHE STRING "C++ compiler release options" FORCE)
set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast"
"${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /fp:fast"
CACHE STRING "C compiler release options" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
if(NOT CMAKE_EXE_LINKER_FLAGS_RELEASE MATCHES LARGEADDRESSAWARE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LARGEADDRESSAWARE")
endif()
set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(CMAKE_C_STANDARD_LIBRARIES "")
@@ -57,54 +85,31 @@ if (WINDOWS)
/W3
/c
/Zc:forScope
/Zc:wchar_t-
/nologo
/Oy-
)
# SSE2 is implied on win64
if(WORD_SIZE EQUAL 32)
add_definitions(/arch:SSE2)
else(WORD_SIZE EQUAL 32)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244")
endif(WORD_SIZE EQUAL 32)
# configure win32 API for windows XP+ compatibility
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
if(MSVC80 OR MSVC90 OR MSVC10)
set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
CACHE STRING "C++ compiler release options" FORCE)
set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "C compiler release options" FORCE)
add_definitions(
/Zc:wchar_t-
)
endif (MSVC80 OR MSVC90 OR MSVC10)
# Are we using the crummy Visual Studio KDU build workaround?
if (NOT DISABLE_FATAL_WARNINGS)
add_definitions(/WX)
endif (NOT DISABLE_FATAL_WARNINGS)
# Various libs are compiler specific, generate some variables here we can just use
# when we require them instead of reimplementing the test each time.
if (MSVC71)
set(MSVC_DIR 7.1)
set(MSVC_SUFFIX 71)
elseif (MSVC80)
set(MSVC_DIR 8.0)
set(MSVC_SUFFIX 80)
elseif (MSVC90)
set(MSVC_DIR 9.0)
set(MSVC_SUFFIX 90)
elseif (MSVC10)
set(MSVC_DIR 10.0)
set(MSVC_SUFFIX 100)
endif (MSVC71)
if (MSVC10)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
endif(MSVC10)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
endif (WINDOWS)
set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math")
@@ -125,12 +130,14 @@ if (LINUX)
-pthread
)
# Don't catch SIGCHLD in our base application class for the viewer
# some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh!
# The viewer doesn't need to catch SIGCHLD anyway.
add_definitions(-DLL_IGNORE_SIGCHLD)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ")
if(${CMAKE_C_COMPILER} MATCHES "gcc*")
# Don't catch SIGCHLD in our base application class for the viewer
# some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh!
# The viewer doesn't need to catch SIGCHLD anyway.
add_definitions(-DLL_IGNORE_SIGCHLD)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
find_program(GXX g++)
mark_as_advanced(GXX)
@@ -158,16 +165,6 @@ if (LINUX)
OUTPUT_VARIABLE CXX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Here's a giant hack for Fedora 8, where we can't use
# _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1.
if (${GXX_VERSION} STREQUAL ${CXX_VERSION})
add_definitions(-D_FORTIFY_SOURCE=2)
else (${GXX_VERSION} STREQUAL ${CXX_VERSION})
if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
add_definitions(-D_FORTIFY_SOURCE=2)
endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
endif (${GXX_VERSION} STREQUAL ${CXX_VERSION})
#Lets actually get a numerical version of gxx's version
STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION})
@@ -181,6 +178,11 @@ if (LINUX)
add_definitions(-Wno-unused-but-set-variable)
endif (NOT ${CXX_VERSION} LESS 460)
#gcc 4.8 boost spam wall
if(NOT ${CXX_VERSION} LESS 480)
add_definitions(-Wno-unused-local-typedefs)
endif (NOT ${CXX_VERSION} LESS 480)
# End of hacks.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
@@ -206,39 +208,19 @@ if (LINUX)
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}")
endif (${ARCH} STREQUAL "x86_64")
elseif(${CMAKE_C_COMPILER} MATCHES "clang*")
find_program(CLANG clang)
mark_as_advanced(CLANG)
find_program(CLANGXX clang++)
mark_as_advanced(CLANGXX)
add_definitions(
-D_FORTIFY_SOURCE=2
)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
endif (NOT STANDALONE)
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} -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")
elseif(${CMAKE_C_COMPILER} MATCHES "icc*" AND ${CMAKE_CXX_COMPILER} MATCHES "icpc*")
find_program(ICC icc)
mark_as_advanced(ICC)
add_definitions(
-D_FORTIFY_SOURCE=2
)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime
@@ -267,44 +249,45 @@ endif (LINUX)
if (DARWIN)
add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
add_definitions(-DLL_DARWIN=1)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
if(${CMAKE_C_COMPILER} MATCHES "gcc*")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
elseif(${CMAKE_C_COMPILER} MATCHES "clang*")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3")
endif()
set(DARWIN_extra_cstar_flags "-g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -ftemplate-depth=256")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS SSE3)
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL -O3)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_C_FLAGS_RELEASE}")
if (XCODE_VERSION GREATER 4.2)
set(ENABLE_SIGNING TRUE)
set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
endif (XCODE_VERSION GREATER 4.2)
endif (DARWIN)
if (LINUX OR DARWIN)
if(${CMAKE_C_COMPILER} MATCHES "gcc*")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_definitions(-DLL_GNUC=1)
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
elseif(${CMAKE_C_COMPILER} MATCHES "clang*")
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-tautological-compare -Wno-char-subscripts -Wno-gnu -Wno-logical-op-parentheses -Wno-non-virtual-dtor ")
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Woverloaded-virtual -Wno-parentheses-equality -Wno-reorder -Wno-unused-function -Wno-unused-value -Wno-unused-variable")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_definitions(-DLL_CLANG=1)
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-tautological-compare -Wno-char-subscripts -Wno-gnu -Wno-logical-op-parentheses -Wno-logical-not-parentheses -Wno-non-virtual-dtor -Wno-deprecated")
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Woverloaded-virtual -Wno-parentheses-equality -Wno-reorder -Wno-unused-function -Wno-unused-value -Wno-unused-variable -Wno-unused-private-field -Wno-parentheses")
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
elseif(${CMAKE_C_COMPILER} MATCHES "icc")
set(UNIX_WARNINGS "-wd327 -wd597 -wd858")
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
add_definitions(-DLL_ICC=1)
endif ()
if (NOT DISABLE_FATAL_WARNINGS)
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Werror")
set(UNIX_CXX_WARNINGS "${UNIX_CXX_WARNINGS} -Werror")
endif (NOT DISABLE_FATAL_WARNINGS)
set(CMAKE_C_FLAGS "${UNIX_WARNINGS} ${CMAKE_C_FLAGS}")
@@ -334,8 +317,6 @@ else (STANDALONE)
endif (STANDALONE)
if(1 EQUAL 1)
add_definitions(-DOPENSIM_RULES=1)
add_definitions(-DMESH_ENABLED=1)
add_definitions(-DENABLE_CLASSIC_CLOUDS=1)
if (NOT "$ENV{SHY_MOD}" STREQUAL "")
add_definitions(-DSHY_MOD=1)
@@ -356,3 +337,7 @@ MARK_AS_ADVANCED(
CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE
)
include(GooglePerfTools)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@@ -21,8 +21,6 @@ else (STANDALONE)
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapriconv-1.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapriconv-1.lib
)
# Doesn't need to link with iconv.dll
set(APRICONV_LIBRARIES "")
set(APRUTIL_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.lib ${APRICONV_LIBRARIES}
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.lib ${APRICONV_LIBRARIES}
@@ -44,7 +42,7 @@ else (STANDALONE)
endif (WINDOWS)
set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/apr-1)
if (LINUX AND VIEWER)
if (LINUX)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})
endif (LINUX AND VIEWER)
endif (LINUX)
endif (STANDALONE)

View File

@@ -8,44 +8,77 @@ if (STANDALONE)
include(FindBoost)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.40.0 COMPONENTS date_time filesystem program_options regex system thread wave)
find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context)
else (STANDALONE)
use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
set(Boost_VERSION "1.52")
if (WINDOWS)
set(BOOST_VERSION 1_45)
# SNOW-788
# 00-Common.cmake alreay sets MSVC_SUFFIX to be correct for the VS we are using eg VC71, VC80, VC90 etc
# The precompiled boost libs for VC71 use a different suffix to VS80 and VS90
# This code should ensure the cmake rules are valid for any VS being used in future as long as the approprate
# boost libs are avaiable - RC.
if (MSVC71)
set(BOOST_OPTIM_SUFFIX mt-s)
set(BOOST_DEBUG_SUFFIX mt-sgd)
else (MSVC71)
set(BOOST_OPTIM_SUFFIX mt)
set(BOOST_DEBUG_SUFFIX mt-gd)
endif (MSVC71)
set(Boost_CONTEXT_LIBRARY
optimized libboost_context-mt
debug libboost_context-mt-gd)
set(Boost_FILESYSTEM_LIBRARY
optimized libboost_filesystem-mt
debug libboost_filesystem-mt-gd)
set(Boost_PROGRAM_OPTIONS_LIBRARY
optimized libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION}
debug libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
optimized libboost_program_options-mt
debug libboost_program_options-mt-gd)
set(Boost_REGEX_LIBRARY
optimized libboost_regex-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION}
debug libboost_regex-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
elseif (DARWIN)
set(Boost_FILESYSTEM_LIBRARY boost_filesystem)
set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
set(Boost_REGEX_LIBRARY boost_regex)
set(Boost_SYSTEM_LIBRARY boost_system)
optimized libboost_regex-mt
debug libboost_regex-mt-gd)
set(Boost_SIGNALS_LIBRARY
optimized libboost_signals-mt
debug libboost_signals-mt-gd)
set(Boost_SYSTEM_LIBRARY
optimized libboost_system-mt
debug libboost_system-mt-gd)
set(Boost_THREAD_LIBRARY
optimized libboost_thread-mt
debug libboost_thread-mt-gd)
elseif (LINUX)
set(Boost_FILESYSTEM_LIBRARY boost_filesystem-mt)
set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(Boost_REGEX_LIBRARY boost_regex-mt)
set(Boost_SYSTEM_LIBRARY boost_system-mt)
set(Boost_CONTEXT_LIBRARY
optimized boost_context-mt
debug boost_context-mt-d)
set(Boost_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
set(Boost_PROGRAM_OPTIONS_LIBRARY
optimized boost_program_options-mt
debug boost_program_options-mt-d)
set(Boost_REGEX_LIBRARY
optimized boost_regex-mt
debug boost_regex-mt-d)
set(Boost_SIGNALS_LIBRARY
optimized boost_signals-mt
debug boost_signals-mt-d)
set(Boost_SYSTEM_LIBRARY
optimized boost_system-mt
debug boost_system-mt-d)
set(Boost_THREAD_LIBRARY
optimized boost_thread-mt
debug boost_thread-mt-d)
elseif (DARWIN)
set(Boost_CONTEXT_LIBRARY
optimized boost_context-mt
debug boost_context-mt-d)
set(Boost_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
set(Boost_PROGRAM_OPTIONS_LIBRARY
optimized boost_program_options-mt
debug boost_program_options-mt-d)
set(Boost_REGEX_LIBRARY
optimized boost_regex-mt
debug boost_regex-mt-d)
set(Boost_SIGNALS_LIBRARY
optimized boost_signals-mt
debug boost_signals-mt-d)
set(Boost_SYSTEM_LIBRARY
optimized boost_system-mt
debug boost_system-mt-d)
set(Boost_THREAD_LIBRARY
optimized boost_thread-mt
debug boost_thread-mt-d)
endif (WINDOWS)
endif (STANDALONE)

View File

@@ -33,6 +33,48 @@ configure_file(
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h
)
if (WINDOWS)
configure_file(
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc
)
configure_file(
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc.in
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc
)
endif (WINDOWS)
if (DARWIN)
configure_file(
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings
)
endif (DARWIN)
if (LINUX)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh.in
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh.in
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh.in
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh.in
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh
@ONLY
)
endif (LINUX)
# Compose the version.
set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")

View File

@@ -8,77 +8,100 @@ set(cmake_SOURCE_FILES
CMakeLists.txt
00-Common.cmake
AIStateMachine.cmake
APR.cmake
Audio.cmake
BasicPluginBase.cmake
BerkeleyDB.cmake
Boost.cmake
BuildVersion.cmake
CARes.cmake
CURL.cmake
CMakeCopyIfDifferent.cmake
CURL.cmake
Colladadom.cmake
ConfigurePkgConfig.cmake
CopyBackToSource.cmake
CopyWinLibs.cmake
CSharpMacros.cmake
Cwdebug.cmake
DBusGlib.cmake
DirectX.cmake
DownloadPrebuilt.cmake.in
ELFIO.cmake
EXPAT.cmake
ExamplePlugin.cmake
FMOD.cmake
FMODEX.cmake
FindAPR.cmake
FindBerkeleyDB.cmake
FindCARes.cmake
FindColladadom.cmake
FindELFIO.cmake
FindGLOD.cmake
FindGoogleBreakpad.cmake
FindGooglePerfTools.cmake
FindHunSpell.cmake
FindMT.cmake
FindJsonCpp.cmake
FindLLQtWebkit.cmake
FindNDOF.cmake
FindOpenJPEG.cmake
FindTut.cmake
FindXmlRpcEpi.cmake
FMOD.cmake
FMODEX.cmake
FreeType.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
LLCharacter.cmake
LLCommon.cmake
LLCrashLogger.cmake
LLDatabase.cmake
LLImage.cmake
LLImageJ2COJ.cmake
LLInventory.cmake
LLKDU.cmake
LLMath.cmake
LLMessage.cmake
LLPhysicsExtensions.cmake
LLPlugin.cmake
LLPrimitive.cmake
LLPhysicsExtensions.cmake
LLSharedLibs.cmake
LLQtWebkit.cmake
LLRender.cmake
LLScene.cmake
LLUI.cmake
LLVFS.cmake
LLWindow.cmake
LLXML.cmake
# LScript.cmake
LScript.cmake
Linking.cmake
MediaPluginBase.cmake
NDOF.cmake
NVAPI.cmake
OPENAL.cmake
OpenGL.cmake
OpenJPEG.cmake
OpenSSL.cmake
PNG.cmake
Python.cmake
PluginAPI.cmake
Prebuilt.cmake
PulseAudio.cmake
Python.cmake
Qt4.cmake
QuickTimePlugin.cmake
RunBuildTest.cmake
StateMachine.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake
UnixInstall.cmake
Variables.cmake
ViewerMiscLibs.cmake
WebKitLibPlugin.cmake
XmlRpcEpi.cmake
ZLIB.cmake
)
@@ -90,10 +113,6 @@ set(master_SOURCE_FILES
../develop.py
)
if (SERVER)
list(APPEND master_SOURCE_FILES ../Server.cmake)
endif (SERVER)
source_group("Master Rules" FILES ${master_SOURCE_FILES})
set_source_files_properties(${cmake_SOURCE_FILES} ${master_SOURCE_FILES}

View File

@@ -1,142 +0,0 @@
# - This is a support module for easy Mono/C# handling with CMake
# It defines the following macros:
#
# ADD_CS_LIBRARY (<target> <source>)
# ADD_CS_EXECUTABLE (<target> <source>)
# INSTALL_GAC (<target>)
#
# Note that the order of the arguments is important.
#
# You can optionally set the variable CS_FLAGS to tell the macros whether
# to pass additional flags to the compiler. This is particularly useful to
# set assembly references, unsafe code, etc... These flags are always reset
# after the target was added so you don't have to care about that.
#
# copyright (c) 2007 Arno Rehn arno@arnorehn.de
#
# Redistribution and use is allowed according to the terms of the GPL license.
# ----- support macros -----
MACRO(GET_CS_LIBRARY_TARGET_DIR)
IF (NOT LIBRARY_OUTPUT_PATH)
SET(CS_LIBRARY_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
ELSE (NOT LIBRARY_OUTPUT_PATH)
SET(CS_LIBRARY_TARGET_DIR ${LIBRARY_OUTPUT_PATH})
ENDIF (NOT LIBRARY_OUTPUT_PATH)
ENDMACRO(GET_CS_LIBRARY_TARGET_DIR)
MACRO(GET_CS_EXECUTABLE_TARGET_DIR)
IF (NOT EXECUTABLE_OUTPUT_PATH)
SET(CS_EXECUTABLE_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
ELSE (NOT EXECUTABLE_OUTPUT_PATH)
SET(CS_EXECUTABLE_TARGET_DIR ${EXECUTABLE_OUTPUT_PATH})
ENDIF (NOT EXECUTABLE_OUTPUT_PATH)
ENDMACRO(GET_CS_EXECUTABLE_TARGET_DIR)
MACRO(MAKE_PROPER_FILE_LIST)
FOREACH(file ${ARGN})
# first assume it's a relative path
FILE(GLOB globbed ${CMAKE_CURRENT_SOURCE_DIR}/${file})
IF(globbed)
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${file} native)
ELSE(globbed)
FILE(TO_NATIVE_PATH ${file} native)
ENDIF(globbed)
SET(proper_file_list ${proper_file_list} ${native})
SET(native "")
ENDFOREACH(file)
ENDMACRO(MAKE_PROPER_FILE_LIST)
# ----- end support macros -----
MACRO(ADD_CS_LIBRARY target)
GET_CS_LIBRARY_TARGET_DIR()
SET(target_DLL "${CS_LIBRARY_TARGET_DIR}/${target}.dll")
MAKE_PROPER_FILE_LIST(${ARGN})
FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_DLL})
SET(target_KEY "${CMAKE_CURRENT_SOURCE_DIR}/${target}.key")
SET(target_CS_FLAGS "${CS_FLAGS}")
IF(${target}_CS_FLAGS)
LIST(APPEND target_CS_FLAGS ${${target}_CS_FLAGS})
ENDIF(${target}_CS_FLAGS)
IF(EXISTS ${target_KEY})
LIST(APPEND target_CS_FLAGS -keyfile:${target_KEY})
ENDIF(EXISTS ${target_KEY})
FOREACH(ref ${${target}_REFS})
SET(ref_DLL ${CMAKE_CURRENT_BINARY_DIR}/${ref}.dll)
IF(EXISTS ${ref_DLL})
LIST(APPEND target_CS_FLAGS -r:${ref_DLL})
ELSE(EXISTS ${ref_DLL})
LIST(APPEND target_CS_FLAGS -r:${ref})
ENDIF(EXISTS ${ref_DLL})
ENDFOREACH(ref ${${target}_REFS})
ADD_CUSTOM_COMMAND (OUTPUT ${target_DLL}
COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_DLL} -target:library ${proper_file_list}
MAIN_DEPENDENCY ${proper_file_list}
DEPENDS ${ARGN}
COMMENT "Building ${relative_path}")
ADD_CUSTOM_TARGET (${target} ALL DEPENDS ${target_DLL})
FOREACH(ref ${${target}_REFS})
GET_TARGET_PROPERTY(is_target ${ref} TYPE)
IF(is_target)
ADD_DEPENDENCIES(${target} ${ref})
ENDIF(is_target)
ENDFOREACH(ref ${${target}_REFS})
SET(relative_path "")
SET(proper_file_list "")
ENDMACRO(ADD_CS_LIBRARY)
MACRO(ADD_CS_EXECUTABLE target)
GET_CS_EXECUTABLE_TARGET_DIR()
# Seems like cmake doesn't like the ".exe" ending for custom commands.
# If we call it ${target}.exe, 'make' will later complain about a missing rule.
# Create a fake target instead.
SET(target_EXE "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe")
SET(target_TOUCH "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe-built")
GET_DIRECTORY_PROPERTY(clean ADDITIONAL_MAKE_CLEAN_FILES)
LIST(APPEND clean ${target}.exe)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${clean}")
MAKE_PROPER_FILE_LIST(${ARGN})
FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_EXE})
SET(target_CS_FLAGS "${CS_FLAGS}")
FOREACH(ref ${${target}_REFS})
SET(ref_DLL ${CMAKE_CURRENT_SOURCE_DIR}/${ref}.dll)
IF(EXISTS ${ref_DLL})
LIST(APPEND target_CS_FLAGS -r:${ref_DLL})
ELSE(EXISTS ${ref_DLL})
LIST(APPEND target_CS_FLAGS -r:${ref})
ENDIF(EXISTS ${ref_DLL})
ENDFOREACH(ref ${${target}_REFS})
ADD_CUSTOM_COMMAND (OUTPUT "${target_TOUCH}"
COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_EXE} ${proper_file_list}
COMMAND ${CMAKE_COMMAND} -E touch ${target_TOUCH}
MAIN_DEPENDENCY ${ARGN}
DEPENDS ${ARGN}
COMMENT "Building ${relative_path}")
ADD_CUSTOM_TARGET ("${target}" ALL DEPENDS "${target_TOUCH}")
FOREACH(ref ${${target}_REFS})
GET_TARGET_PROPERTY(is_target ${ref} TYPE)
IF(is_target)
ADD_DEPENDENCIES(${target} ${ref})
ENDIF(is_target)
ENDFOREACH(ref ${${target}_REFS})
SET(relative_path "")
SET(proper_file_list "")
ENDMACRO(ADD_CS_EXECUTABLE)
MACRO(INSTALL_GAC target)
GET_CS_LIBRARY_TARGET_DIR()
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GACUTIL_EXECUTABLE} -i ${CS_LIBRARY_TARGET_DIR}/${target}.dll -package 2.0)")
ENDMACRO(INSTALL_GAC target)

View File

@@ -0,0 +1,40 @@
# -*- cmake -*-
include(Prebuilt)
set(COLLADADOM_FIND_QUIETLY OFF)
set(COLLADADOM_FIND_REQUIRED ON)
if (STANDALONE)
include (FindColladadom)
else (STANDALONE)
use_prebuilt_binary(colladadom)
if (NOT WINDOWS AND NOT LINUX)
use_prebuilt_binary(pcre)
endif (NOT WINDOWS AND NOT LINUX)
if (NOT DARWIN AND NOT WINDOWS)
use_prebuilt_binary(libxml)
endif (NOT DARWIN AND NOT WINDOWS)
set(COLLADADOM_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada/1.4
)
if (WINDOWS)
add_definitions(-DDOM_DYNAMIC)
set(COLLADADOM_LIBRARIES
debug libcollada14dom22-d
optimized libcollada14dom22
)
else (WINDOWS)
set(COLLADADOM_LIBRARIES
collada14dom
minizip
xml2
)
endif (WINDOWS)
endif (STANDALONE)

View File

@@ -0,0 +1,74 @@
# -*- cmake -*-
SET(DEBUG_PKG_CONFIG "YES")
# Don't change this if manually set by user.
IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
# Guess at architecture-specific system library paths.
if (WORD_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)
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)
# Use DPKG architecture, if available.
IF (${DPKG_ARCH})
SET(PKG_CONFIG_MULTI_GUESS /usr/lib/${DPKG_ARCH})
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usrlocal/lib/${DPKG_ARCH})
ENDIF (${DPKG_ARCH})
# Explicitly include anything listed in PKG_CONFIG_PATH
string(REPLACE ":" ";" PKG_CONFIG_PATH_LIST "$ENV{PKG_CONFIG_PATH}")
FOREACH(PKG_CONFIG_DIR ${PKG_CONFIG_PATH_LIST})
SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_DIR}/pkgconfig")
ENDFOREACH(PKG_CONFIG_DIR)
# Look for valid pkgconfig directories.
FIND_PATH(PKG_CONFIG_ENV pkgconfig ENV LD_LIBRARY_PATH)
FIND_PATH(PKG_CONFIG_MULTI pkgconfig HINT ${PKG_CONFIG_MULTI_GUESS})
FIND_PATH(PKG_CONFIG_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_MULTI_LOCAL_GUESS})
FIND_PATH(PKG_CONFIG_NO_MULTI pkgconfig HINT ${PKG_CONFIG_NO_MULTI_GUESS})
FIND_PATH(PKG_CONFIG_NO_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_NO_MULTI_LOCAL_GUESS})
# Add anything we found to our list.
IF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND)
SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_ENV}/pkgconfig")
ENDIF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND)
IF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND)
SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI}/pkgconfig")
ENDIF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND)
IF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND)
SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI_LOCAL}/pkgconfig")
ENDIF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND)
IF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND)
SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI}/pkgconfig")
ENDIF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND)
IF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND)
SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI_LOCAL}/pkgconfig")
ENDIF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND)
# Also add some non-architecture specific package locations.
SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:/usr/share/pkgconfig:/usr/local/share/pkgconfig")
# Remove first unwanted ':'
string(SUBSTRING ${VALID_PKG_LIBDIRS} 1 -1 VALID_PKG_LIBDIRS)
# Set PKG_CONFIG_LIBDIR environment.
SET(ENV{PKG_CONFIG_LIBDIR} ${VALID_PKG_LIBDIRS})
ENDIF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
IF(DEBUG_PKG_CONFIG)
MESSAGE(STATUS "Using PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}")
ENDIF(DEBUG_PKG_CONFIG)

View File

@@ -6,13 +6,24 @@
include(CMakeCopyIfDifferent)
if(WORD_SIZE EQUAL 32)
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
else(WORD_SIZE EQUAL 32)
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/debug")
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/release")
endif(WORD_SIZE EQUAL 32)
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
set(vivox_files
SLVoice.exe
alut.dll
vivoxsdk.dll
ca-bundle.crt
libsndfile-1.dll
ortp.dll
wrap_oal.dll
SLVoice.exe
vivoxoal.dll
vivoxplatform.dll
vivoxsdk.dll
zlib1.dll
)
copy_if_different(
${vivox_src_dir}
@@ -23,7 +34,7 @@ copy_if_different(
set(all_targets ${all_targets} ${out_targets})
set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
set(debug_src_dir "${debug_libs_dir}")
set(debug_files
libhunspell.dll
libapr-1.dll
@@ -31,6 +42,8 @@ set(debug_files
libapriconv-1.dll
libeay32.dll
ssleay32.dll
libcollada14dom22-d.dll
glod.dll
)
copy_if_different(
@@ -42,7 +55,7 @@ copy_if_different(
set(all_targets ${all_targets} ${out_targets})
# Debug config runtime files required for the plugin test mule
set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
set(plugintest_debug_src_dir "${debug_libs_dir}")
set(plugintest_debug_files
libeay32.dll
qtcored4.dll
@@ -61,7 +74,7 @@ copy_if_different(
set(all_targets ${all_targets} ${out_targets})
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug/imageformats")
set(plugintest_debug_src_dir "${debug_libs_dir}/imageformats")
set(plugintest_debug_files
qgifd4.dll
qicod4.dll
@@ -87,7 +100,7 @@ copy_if_different(
set(all_targets ${all_targets} ${out_targets})
# Release & ReleaseDebInfo config runtime files required for the plugin test mule
set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
set(plugintest_release_src_dir "${release_libs_dir}")
set(plugintest_release_files
libeay32.dll
qtcore4.dll
@@ -114,7 +127,7 @@ copy_if_different(
set(all_targets ${all_targets} ${out_targets})
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release/imageformats")
set(plugintest_release_src_dir "${release_libs_dir}/imageformats")
set(plugintest_release_files
qgif4.dll
qico4.dll
@@ -156,7 +169,7 @@ copy_if_different(
set(all_targets ${all_targets} ${out_targets})
# Debug config runtime files required for the plugins
set(plugins_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
set(plugins_debug_src_dir "${debug_libs_dir}")
set(plugins_debug_files
libeay32.dll
qtcored4.dll
@@ -175,7 +188,7 @@ copy_if_different(
set(all_targets ${all_targets} ${out_targets})
# Release & ReleaseDebInfo config runtime files required for the plugins
set(plugins_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
set(plugins_release_src_dir "${release_libs_dir}")
set(plugins_release_files
libeay32.dll
qtcore4.dll
@@ -201,30 +214,46 @@ copy_if_different(
)
set(all_targets ${all_targets} ${out_targets})
set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
set(release_src_dir "${release_libs_dir}")
set(release_files
libtcmalloc_minimal.dll
libhunspell.dll
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
libeay32.dll
ssleay32.dll
libcollada14dom22.dll
glod.dll
)
if(WORD_SIZE EQUAL 32)
set(release_files ${release_files}
libtcmalloc_minimal.dll
)
endif(WORD_SIZE EQUAL 32)
if(FMODEX)
find_path(FMODEX_BINARY_DIR fmodex.dll
${release_src_dir}
${FMODEX_SDK_DIR}/api
${FMODEX_SDK_DIR}
if (WORD_SIZE EQUAL 32)
set(fmodex_dll_file "fmodex.dll")
else (WORD_SIZE EQUAL 32)
set(fmodex_dll_file "fmodex64.dll")
endif (WORD_SIZE EQUAL 32)
find_path(FMODEX_BINARY_DIR "${fmodex_dll_file}"
"${release_src_dir}"
"${FMODEX_SDK_DIR}/api"
"${FMODEX_SDK_DIR}"
NO_DEFAULT_PATH
)
if(FMODEX_BINARY_DIR)
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmodex.dll)
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets "${fmodex_dll_file}")
set(all_targets ${all_targets} ${out_targets})
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmodex.dll)
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets "${fmodex_dll_file}")
set(all_targets ${all_targets} ${out_targets})
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmodex.dll)
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets "${fmodex_dll_file}")
set(all_targets ${all_targets} ${out_targets})
endif(FMODEX_BINARY_DIR)
endif(FMODEX)
@@ -280,152 +309,6 @@ copy_if_different(
)
set(all_targets ${all_targets} ${out_targets})
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
if(EXISTS ${internal_llkdu_path})
set(internal_llkdu_src "${CMAKE_BINARY_DIR}/llkdu/${CMAKE_CFG_INTDIR}/llkdu.dll")
set(llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llkdu.dll")
ADD_CUSTOM_COMMAND(
OUTPUT ${llkdu_dst}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${internal_llkdu_src} ${llkdu_dst}
DEPENDS ${internal_llkdu_src}
COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
)
set(all_targets ${all_targets} ${llkdu_dst})
else(EXISTS ${internal_llkdu_path})
if (EXISTS "${debug_src_dir}/llkdu.dll")
set(debug_llkdu_src "${debug_src_dir}/llkdu.dll")
set(debug_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/Debug/llkdu.dll")
ADD_CUSTOM_COMMAND(
OUTPUT ${debug_llkdu_dst}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst}
DEPENDS ${debug_llkdu_src}
COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Debug"
)
set(all_targets ${all_targets} ${debug_llkdu_dst})
endif (EXISTS "${debug_src_dir}/llkdu.dll")
if (EXISTS "${release_src_dir}/llkdu.dll")
set(release_llkdu_src "${release_src_dir}/llkdu.dll")
set(release_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/Release/llkdu.dll")
ADD_CUSTOM_COMMAND(
OUTPUT ${release_llkdu_dst}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst}
DEPENDS ${release_llkdu_src}
COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Release"
)
set(all_targets ${all_targets} ${release_llkdu_dst})
set(relwithdebinfo_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llkdu.dll")
ADD_CUSTOM_COMMAND(
OUTPUT ${relwithdebinfo_llkdu_dst}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst}
DEPENDS ${release_llkdu_src}
COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
)
set(all_targets ${all_targets} ${relwithdebinfo_llkdu_dst})
endif (EXISTS "${release_src_dir}/llkdu.dll")
endif (EXISTS ${internal_llkdu_path})
# Copy MS C runtime dlls, required for packaging.
# *TODO - Adapt this to support VC9
if (MSVC80)
FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
NO_DEFAULT_PATH
NO_DEFAULT_PATH
)
if(EXISTS ${debug_msvc8_redist_path})
set(debug_msvc8_files
msvcr80d.dll
msvcp80d.dll
Microsoft.VC80.DebugCRT.manifest
)
copy_if_different(
${debug_msvc8_redist_path}
"${CMAKE_CURRENT_BINARY_DIR}/Debug"
out_targets
${debug_msvc8_files}
)
set(all_targets ${all_targets} ${out_targets})
set(debug_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/Debug/${VIEWER_BINARY_NAME}.exe.config)
add_custom_command(
OUTPUT ${debug_appconfig_file}
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
${CMAKE_CURRENT_SOURCE_DIR}/SecondLifeDebug.exe.config
${debug_appconfig_file}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
COMMENT "Creating debug app config file"
)
endif (EXISTS ${debug_msvc8_redist_path})
FIND_PATH(release_msvc8_redist_path msvcr80.dll
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
NO_DEFAULT_PATH
NO_DEFAULT_PATH
)
if(EXISTS ${release_msvc8_redist_path})
set(release_msvc8_files
msvcr80.dll
msvcp80.dll
Microsoft.VC80.CRT.manifest
)
copy_if_different(
${release_msvc8_redist_path}
"${CMAKE_CURRENT_BINARY_DIR}/Release"
out_targets
${release_msvc8_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${release_msvc8_redist_path}
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
out_targets
${release_msvc8_files}
)
set(all_targets ${all_targets} ${out_targets})
set(release_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/Release/${VIEWER_BINARY_NAME}.exe.config)
add_custom_command(
OUTPUT ${release_appconfig_file}
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
${release_appconfig_file}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
COMMENT "Creating release app config file"
)
set(relwithdebinfo_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/${VIEWER_BINARY_NAME}.exe.config)
add_custom_command(
OUTPUT ${relwithdebinfo_appconfig_file}
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
${relwithdebinfo_appconfig_file}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
COMMENT "Creating relwithdebinfo app config file"
)
endif (EXISTS ${release_msvc8_redist_path})
endif (MSVC80)
add_custom_target(copy_win_libs ALL
DEPENDS
${all_targets}
@@ -435,6 +318,3 @@ add_custom_target(copy_win_libs ALL
)
add_dependencies(copy_win_libs prepare)
if(EXISTS ${internal_llkdu_path})
add_dependencies(copy_win_libs llkdu)
endif(EXISTS ${internal_llkdu_path})

View File

@@ -1,18 +1,60 @@
# -*- cmake -*-
if (VIEWER AND WINDOWS)
find_path(DIRECTX_INCLUDE_DIR dxdiag.h
"$ENV{DXSDK_DIR}/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Include"
"C:/DX90SDK/Include"
"$ENV{PROGRAMFILES}/DX90SDK/Include"
include(Variables)
if (WINDOWS)
if (WORD_SIZE EQUAL 32)
set (DIRECTX_ARCHITECTURE x86)
elseif (WORD_SIZE EQUAL 64)
set (DIRECTX_ARCHITECTURE x64)
else (WORD_SIZE EQUAL 32)
set (DIRECTX_ARCHITECTURE x86)
endif (WORD_SIZE EQUAL 32)
find_path(DIRECTX_ROOT_DIR Include/dxdiag.h
PATHS
"$ENV{DXSDK_DIR}"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2010)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2010)"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (February 2010)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (February 2010)"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2009)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2009)"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2008)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2008)"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2008)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2008)"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2008)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2008)"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (November 2007)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (November 2007)"
"$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2007)"
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2007)"
)
if (DIRECTX_ROOT_DIR)
set (DIRECTX_INCLUDE_DIR "${DIRECTX_ROOT_DIR}/Include")
set (DIRECTX_LIBRARY_DIR "${DIRECTX_ROOT_DIR}/Lib/${DIRECTX_ARCHITECTURE}")
else (DIRECTX_ROOT_DIR)
find_path (WIN_KIT_ROOT_DIR Include/um/windows.h
PATHS
"$ENV{ProgramFiles}/Windows Kits/8.1"
"$ENV{ProgramFiles(x86)}/Windows Kits/8.1"
"$ENV{ProgramFiles}/Windows Kits/8.0"
"$ENV{ProgramFiles(x86)}/Windows Kits/8.0"
)
find_path (WIN_KIT_LIB_DIR dxguid.lib
"${WIN_KIT_ROOT_DIR}/Lib/winv6.3/um/${DIRECTX_ARCHITECTURE}"
"${WIN_KIT_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}"
)
if (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
set (DIRECTX_INCLUDE_DIR "${WIN_KIT_ROOT_DIR}/Include/um" "${WIN_KIT_ROOT_DIR}/Include/shared")
set (DIRECTX_LIBRARY_DIR "${WIN_KIT_LIB_DIR}")
endif (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
endif (DIRECTX_ROOT_DIR)
if (DIRECTX_INCLUDE_DIR)
include_directories(${DIRECTX_INCLUDE_DIR})
if (DIRECTX_FIND_QUIETLY)
@@ -22,19 +64,6 @@ if (VIEWER AND WINDOWS)
message(FATAL_ERROR "Could not find DirectX SDK Include")
endif (DIRECTX_INCLUDE_DIR)
find_path(DIRECTX_LIBRARY_DIR dxguid.lib
"$ENV{DXSDK_DIR}/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Lib/x86"
"C:/DX90SDK/Lib"
"$ENV{PROGRAMFILES}/DX90SDK/Lib"
)
if (DIRECTX_LIBRARY_DIR)
if (DIRECTX_FIND_QUIETLY)
message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}")
@@ -43,4 +72,4 @@ if (VIEWER AND WINDOWS)
message(FATAL_ERROR "Could not find DirectX SDK Libraries")
endif (DIRECTX_LIBRARY_DIR)
endif (VIEWER AND WINDOWS)
endif (WINDOWS)

View File

@@ -2,54 +2,62 @@
include(Linking)
if(INSTALL_PROPRIETARY)
include(Prebuilt)
use_prebuilt_binary(fmodex)
endif(INSTALL_PROPRIETARY)
find_library(FMODEX_LIBRARY
NAMES fmodex fmodexL fmodex_vc fmodexL_vc
PATHS
optimized ${ARCH_PREBUILT_DIRS_RELEASE}
debug ${ARCH_PREBUILT_DIRS_DEBUG}
)
if (NOT FMODEX_LIBRARY)
set(FMODEX_SDK_DIR CACHE PATH "Path to the FMOD Ex SDK.")
if (FMODEX_SDK_DIR)
find_library(FMODEX_LIBRARY
fmodex_vc fmodexL_vc fmodex fmodexL fmodex64 fmodexL64
PATHS
${FMODEX_SDK_DIR}/api/lib
${FMODEX_SDK_DIR}/api
${FMODEX_SDK_DIR}/lib
${FMODEX_SDK_DIR}
)
if(WORD_SIZE EQUAL 32)
find_library(FMODEX_LIBRARY
fmodex_vc fmodexL_vc fmodex fmodexL
PATHS
"${FMODEX_SDK_DIR}/api/lib"
"${FMODEX_SDK_DIR}/api"
"${FMODEX_SDK_DIR}/lib"
"${FMODEX_SDK_DIR}"
)
elseif(WORD_SIZE EQUAL 64)
find_library(FMODEX_LIBRARY
fmodex64_vc fmodexL64_vc fmodex64 fmodexL64
PATHS
"${FMODEX_SDK_DIR}/api/lib"
"${FMODEX_SDK_DIR}/api"
"${FMODEX_SDK_DIR}/lib"
"${FMODEX_SDK_DIR}"
)
endif(WORD_SIZE EQUAL 32)
endif(FMODEX_SDK_DIR)
if(WINDOWS AND NOT FMODEX_LIBRARY)
set(FMODEX_PROG_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows")
find_library(FMODEX_LIBRARY
fmodex_vc fmodexL_vc
PATHS
${FMODEX_PROG_DIR}/api/lib
${FMODEX_PROG_DIR}/api
${FMODEX_PROG_DIR}
)
if(WINDOWS AND NOT FMODEX_SDK_DIR)
GET_FILENAME_COMPONENT(FMODEX_PROG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Programmers\ API\ Windows] ABSOLUTE CACHE)
if(WORD_SIZE EQUAL 32)
find_library(FMODEX_LIBRARY
fmodex_vc fmodexL_vc
PATHS
"${FMODEX_PROG_DIR}/api/lib"
"${FMODEX_PROG_DIR}/api"
"${FMODEX_PROG_DIR}"
)
else(WORD_SIZE EQUAL 32)
find_library(FMODEX_LIBRARY
fmodex64_vc fmodexL64_vc
PATHS
"${FMODEX_PROG_DIR}/api/lib"
"${FMODEX_PROG_DIR}/api"
"${FMODEX_PROG_DIR}"
)
endif(WORD_SIZE EQUAL 32)
if(FMODEX_LIBRARY)
message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}")
set(FMODEX_SDK_DIR ${FMODEX_PROG_DIR})
set(FMODEX_SDK_DIR ${FMODEX_PROG_DIR} CACHE PATH "Path to the FMOD Ex SDK." FORCE)
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}")
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}" CACHE PATH "Path to the FMOD Ex SDK." FORCE)
endif(FMODEX_LIBRARY)
endif(WINDOWS AND NOT FMODEX_LIBRARY)
endif(WINDOWS AND NOT FMODEX_SDK_DIR)
endif (NOT FMODEX_LIBRARY)
find_path(FMODEX_INCLUDE_DIR fmod.hpp
${LIBS_PREBUILT_DIR}/include/fmodex
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/fmodex
${FMODEX_SDK_DIR}/api/inc
${FMODEX_SDK_DIR}/inc
${FMODEX_SDK_DIR}
"${LIBS_PREBUILT_DIR}/include/fmodex"
"${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/fmodex"
"${FMODEX_SDK_DIR}/api/inc"
"${FMODEX_SDK_DIR}/inc"
"${FMODEX_SDK_DIR}"
)
if(DARWIN)

View File

@@ -0,0 +1,31 @@
# -*- cmake -*-
# - Find collada14dom
# Find the colladadom version 1.4 includes and library
# This module defines
# COLLADADOM_FOUND, System has libcollada14dom.so.
# COLLADADOM_INCLUDE_DIRS - The collada include directories.
# COLLADADOM_LIBRARIES - The libraries needed to use libcollada14dom.
# COLLADADOM_DEFINITIONS - Compiler switches required for using libcollada14dom.
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_COLLADADOM collada)
SET(COLLADADOM_DEFINITIONS ${PC_COLLADADOM_CFLAGS_OTHER})
FIND_PATH(COLLADADOM_INCLUDE_DIR dae.h
HINTS ${PC_COLLADADOM_INCLUDE_DIR} ${PC_COLLADADOM_INCLUDE_DIRS}
PATH_SUFFIXES collada)
FIND_LIBRARY(COLLADADOM_LIBRARY
NAMES libcollada14dom.so
HINTS ${PC_COLLADADOM_LIBDIR} ${PC_COLLADADOM_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib)
SET(COLLADADOM_LIBRARIES ${COLLADADOM_LIBRARY})
SET(COLLADADOM_INCLUDE_DIRS ${COLLADADOM_INCLUDE_DIR} ${COLLADADOM_INCLUDE_DIR}/1.4)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(COLLADADOM DEFAULT_MSG
COLLADADOM_LIBRARY COLLADADOM_INCLUDE_DIR)
MARK_AS_ADVANCED(COLLADADOM_LIBRARY COLLADADOM_INCLUDE_DIR)

View File

@@ -0,0 +1,32 @@
# -*- cmake -*-
# - Find GLOD
# Find the GLOD includes and library
# This module defines
# GLOD_FOUND, System has libglod.so.
# GLOD_INCLUDE_DIRS - The GLOD include directories.
# GLOD_LIBRARIES - The libraries needed to use libglod.
# GLOD_DEFINITIONS - Compiler switches required for using libglod.
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_GLOD glod)
SET(GLOD_DEFINITIONS ${PC_GLOD_CFLAGS_OTHER})
FIND_PATH(GLOD_INCLUDE_DIR glod/glod.h
HINTS ${PC_GLOD_INCLUDE_DIR} ${PC_GLOD_INCLUDE_DIRS}
)
FIND_LIBRARY(GLOD_LIBRARY
NAMES libGLOD.so
HINTS ${PC_GLOD_LIBDIR} ${PC_GLOD_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib)
SET(GLOD_LIBRARIES ${GLOD_LIBRARY})
SET(GLOD_INCLUDE_DIRS ${GLOD_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLOD DEFAULT_MSG
GLOD_LIBRARY GLOD_INCLUDE_DIR)
MARK_AS_ADVANCED(GLOD_LIBRARY GLOD_INCLUDE_DIR)

View File

@@ -0,0 +1,40 @@
# -*- 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,17 +0,0 @@
#Find the windows manifest tool.
if (MSVC80)
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
PATHS
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
IF(HAVE_MANIFEST_TOOL)
MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
ELSE(HAVE_MANIFEST_TOOL)
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
ENDIF(HAVE_MANIFEST_TOOL)
STRING(REPLACE "/MANIFEST " "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS})
endif (MSVC80)

13
indra/cmake/GLOD.cmake Normal file
View File

@@ -0,0 +1,13 @@
# -*- cmake -*-
include(Prebuilt)
set(GLOD_FIND_QUIETLY OFF)
set(GLOD_FIND_REQUIRED ON)
if (STANDALONE)
include(FindGLOD)
else (STANDALONE)
use_prebuilt_binary(GLOD)
set(GLOD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
set(GLOD_LIBRARIES glod)
endif (STANDALONE)

View File

@@ -0,0 +1,21 @@
# -*- 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}/${LL_ARCH_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad/google_breakpad")
endif (STANDALONE)

View File

@@ -1,4 +1,5 @@
# -*- cmake -*-
include(Prebuilt)
if(WORD_SIZE EQUAL 64)
@@ -47,9 +48,14 @@ else (USE_GOOGLE_PERFTOOLS)
endif (USE_GOOGLE_PERFTOOLS)
if (NOT(DISABLE_TCMALLOC OR USE_GOOGLE_PERFTOOLS OR STANDALONE))
message(STATUS "Building with Google TCMalloc")
set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1)
include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR})
set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES})
if (NOT STATUS_Building_with_Google_TCMalloc)
message(STATUS "Building with Google TCMalloc")
set(STATUS_Building_with_Google_TCMalloc true PARENT_SCOPE)
endif (NOT STATUS_Building_with_Google_TCMalloc)
set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1)
include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR})
set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES})
set(GOOGLE_PERFTOOLS_LINKER_FLAGS ${TCMALLOC_LINKER_FLAGS})
endif()
add_definitions(${TCMALLOC_FLAG})

View File

@@ -18,5 +18,5 @@ else (STANDALONE)
elseif (LINUX)
set(JSONCPP_LIBRARIES jsoncpp)
endif (WINDOWS)
set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/jsoncpp)
set(JSONCPP_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/jsoncpp)
endif (STANDALONE)

View File

@@ -159,3 +159,23 @@ MACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper)
## MESSAGE(STATUS "ADD_VIEWER_COMM_BUILD_TEST ${name} wrapper = ${wrapper}")
ADD_COMM_BUILD_TEST("${name}" "${parent}" "${wrapper}" llviewerprecompiledheaders.cpp)
ENDMACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper)
MACRO(SET_TEST_PATH LISTVAR)
IF(WINDOWS)
# We typically build/package only Release variants of third-party
# libraries, so append the Release staging dir in case the library being
# sought doesn't have a debug variant.
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release)
ELSEIF(DARWIN)
# We typically build/package only Release variants of third-party
# libraries, so append the Release staging dir in case the library being
# sought doesn't have a debug variant.
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
ELSE(WINDOWS)
# Linux uses a single staging directory anyway.
IF (STANDALONE)
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
ELSE (STANDALONE)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
ENDIF (STANDALONE)
ENDIF(WINDOWS)
ENDMACRO(SET_TEST_PATH)

View File

@@ -1,7 +0,0 @@
# -*- cmake -*-
set(LLCRASHLOGGER_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llcrashlogger
)
set(LLCRASHLOGGER_LIBRARIES llcrashlogger)

View File

@@ -1,10 +0,0 @@
# -*- cmake -*-
include(MySQL)
set(LLDATABASE_INCLUDE_DIRS
${LIBS_SERVER_DIR}/lldatabase
${MYSQL_INCLUDE_DIR}
)
set(LLDATABASE_LIBRARIES lldatabase)

View File

@@ -1,18 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
use_prebuilt_binary(kdu)
if (WINDOWS)
set(KDU_LIBRARY debug kdu_cored optimized kdu_core)
else (WINDOWS)
set(KDU_LIBRARY kdu)
endif (WINDOWS)
set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
set(LLKDU_LIBRARY llkdu)
set(LLKDU_STATIC_LIBRARY llkdu_static)
set(LLKDU_LIBRARIES ${LLKDU_LIBRARY})
set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY})
endif (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)

View File

@@ -0,0 +1,7 @@
# -*- cmake -*-
set(LLPHYSICSEXTENSIONS_LIBRARIES nd_hacdConvexDecomposition hacd nd_Pathing )
set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_OPEN_DIR}/libndhacd ${LIBS_OPEN_DIR}/libpathing)

View File

@@ -1,7 +1,22 @@
# -*- cmake -*-
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
include(Colladadom)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
${COLLADADOM_INCLUDE_DIRS}
)
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
${COLLADADOM_LIBRARIES}
)
else (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
llprimitive
${COLLADADOM_LIBRARIES}
)
endif (WINDOWS)
set(LLPRIMITIVE_LIBRARIES llprimitive)

View File

@@ -6,27 +6,7 @@ set(LLRENDER_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llrender
)
if (SERVER AND LINUX)
set(LLRENDER_LIBRARIES
llrenderheadless
)
else (SERVER AND LINUX)
set(LLRENDER_LIBRARIES
llrender
)
endif (SERVER AND LINUX)
# mapserver requires certain files to be copied so LL_MESA_HEADLESS can be set
# differently for different object files.
macro (copy_server_sources )
foreach (PREFIX ${ARGV})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp
${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp
)
list(APPEND server_SOURCE_FILES ${PREFIX}_server.cpp)
endforeach (PREFIX ${_copied_SOURCES})
endmacro (copy_server_sources _copied_SOURCES)

View File

@@ -1,7 +0,0 @@
# -*- cmake -*-
set(LLSCENE_INCLUDE_DIRS
${LIBS_SERVER_DIR}/llscene
)
set(LLSCENE_LIBRARIES llscene)

View File

@@ -0,0 +1,73 @@
# 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)
get_target_property(TARGET_LOCATION ${target_exe} LOCATION)
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)
# If its a bundle the exe is not in the target location, this should find it.
get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME)
set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS)
set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE})
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)
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"
)
endmacro(ll_deploy_sharedlibs_command)
# ll_stage_sharedlib
# Performs config and adds a copy command for a sharedlib target.
macro(ll_stage_sharedlib DSO_TARGET)
# target gets written to the DLL staging directory.
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
if(NOT WINDOWS)
get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
get_filename_component(DSO_FILE ${DSO_PATH} NAME)
if(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
else(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
endif(DARWIN)
# *TODO - maybe make this a symbolic link? -brad
add_custom_command(
TARGET ${DSO_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${DSO_PATH}
${SHARED_LIB_STAGING_DIR_CONFIG}/${DSO_FILE}
COMMENT "Copying llcommon to the staging folder."
)
endif(NOT WINDOWS)
if (DARWIN)
set_target_properties(${DSO_TARGET} PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@executable_path/../Resources"
)
endif(DARWIN)
endmacro(ll_stage_sharedlib)

View File

@@ -36,17 +36,12 @@ set(LLWINDOW_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llwindow
)
if (SERVER AND LINUX)
set(LLWINDOW_LIBRARIES
llwindowheadless
)
else (SERVER AND LINUX)
set(LLWINDOW_LIBRARIES
llwindow
)
if (WINDOWS)
list(APPEND LLWINDOW_LIBRARIES
comdlg32
)
endif (WINDOWS)
endif (SERVER AND LINUX)
set(LLWINDOW_LIBRARIES
llwindow
)
if (WINDOWS)
list(APPEND LLWINDOW_LIBRARIES
comdlg32
)
endif (WINDOWS)

View File

@@ -1,22 +1,33 @@
# -*- cmake -*-
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(Variables)
if (NOT STANDALONE)
if (WINDOWS)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
elseif (LINUX)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
elseif (DARWIN)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
endif (WINDOWS)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
if(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
# 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(ARCH_PREBUILT_LINK_DIRS "${ARCH_PREBUILT_DIRS}")
else(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
# else block is for linux and any other makefile based generators
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
set(ARCH_PREBUILT_LINK_DIRS ${ARCH_PREBUILT_DIRS}/${CMAKE_BUILD_TYPE_LOWER})
endif(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
# When we're building something other than Release, append the
# packages/lib/release directory to deal with autobuild packages that don't
# provide (e.g.) lib/debug libraries.
list(APPEND ARCH_PREBUILT_LINK_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
endif (NOT STANDALONE)
link_directories(${ARCH_PREBUILT_DIRS})
link_directories(${ARCH_PREBUILT_LINK_DIRS})
if (LINUX)
set(DL_LIBRARY dl)
@@ -45,3 +56,5 @@ else (WINDOWS)
endif (WINDOWS)
mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

21
indra/cmake/NVAPI.cmake Normal file
View File

@@ -0,0 +1,21 @@
# -*- cmake -*-
include(Prebuilt)
include(Variables)
set(NVAPI ON CACHE BOOL "Use NVAPI.")
if (NVAPI)
if (WINDOWS)
use_prebuilt_binary(nvapi)
if (WORD_SIZE EQUAL 32)
set(NVAPI_LIBRARY nvapi)
elseif (WORD_SIZE EQUAL 64)
set(NVAPI_LIBRARY nvapi64)
endif (WORD_SIZE EQUAL 32)
else (WINDOWS)
set(NVAPI_LIBRARY "")
endif (WINDOWS)
else (NVAPI)
set(NVAPI_LIBRARY "")
endif (NVAPI)

View File

@@ -3,8 +3,5 @@ include(Prebuilt)
if (NOT (STANDALONE OR DARWIN))
use_prebuilt_binary(glext)
# possible glh_linear should have its own .cmake file instead
#use_prebuilt_binary(glh_linear)
# actually... not any longer, it's now in git -SG
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
endif ()
endif (NOT (STANDALONE OR DARWIN))

View File

@@ -4,9 +4,9 @@ include(Prebuilt)
set(OpenSSL_FIND_QUIETLY ON)
set(OpenSSL_FIND_REQUIRED ON)
if (STANDALONE)
if (STANDALONE OR USE_SYSTEM_OPENSSL)
include(FindOpenSSL)
else (STANDALONE)
else (STANDALONE OR USE_SYSTEM_OPENSSL)
use_prebuilt_binary(openSSL)
if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32)
@@ -14,7 +14,7 @@ else (STANDALONE)
set(OPENSSL_LIBRARIES ssl)
endif (WINDOWS)
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
endif (STANDALONE)
endif (STANDALONE OR USE_SYSTEM_OPENSSL)
if (LINUX OR DARWIN)
set(CRYPTO_LIBRARIES crypto)

View File

@@ -1,5 +1,8 @@
# -*- cmake -*-
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
macro (use_prebuilt_binary _binary)
if(NOT STANDALONE)
get_property(PREBUILT_PACKAGES TARGET prepare PROPERTY PREBUILT)
@@ -9,3 +12,5 @@ macro (use_prebuilt_binary _binary)
endif(_index LESS 0)
endif(NOT STANDALONE)
endmacro (use_prebuilt_binary _binary)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@@ -20,10 +20,12 @@ if (WINDOWS)
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
)
elseif (EXISTS /etc/debian_version)
# On Debian and Ubuntu, avoid Python 2.4 if possible.
find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin)
elseif (EXISTS /etc/arch-release)
# On Archlinux, use Python 2
find_program(PYTHON_EXECUTABLE python2 PATHS /usr/bin)
if (PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND ON)

View File

@@ -8,7 +8,7 @@ endif(INSTALL_PROPRIETARY)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(QUICKTIME_LIBRARY QuickTime)
elseif (WINDOWS)
elseif (WINDOWS AND WORD_SIZE EQUAL 32)
set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK"
CACHE PATH "Location of the QuickTime SDK.")

View File

@@ -8,47 +8,44 @@
# DARWIN - Mac OS X
# LINUX - Linux
# WINDOWS - Windows
#
# What to build:
#
# VIEWER - viewer and other viewer-side components
# SERVER - simulator and other server-side bits
# Relative and absolute paths to subtrees.
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
if(NOT DEFINED COMMON_CMAKE_DIR)
set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake")
endif(NOT DEFINED COMMON_CMAKE_DIR)
set(LIBS_CLOSED_PREFIX)
set(LIBS_OPEN_PREFIX)
set(LIBS_SERVER_PREFIX)
set(SCRIPTS_PREFIX ../scripts)
set(SERVER_PREFIX)
set(VIEWER_PREFIX)
set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)")
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
set(VISTA_ICON OFF CACHE BOOL "Allow vista icon with pre 2008 Visual Studio IDEs. (Assumes replacement old rcdll.dll with new rcdll.dll from win sdk 7.0 or later)")
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH
"Location of prebuilt libraries.")
if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
# We use this as a marker that you can try to use the proprietary libraries.
set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(WINDOWS ON BOOL FORCE)
set(ARCH i686)
set(LL_ARCH ${ARCH}_win32)
set(LL_ARCH_DIR ${ARCH}-win32)
set(WORD_SIZE 32)
if (WORD_SIZE EQUAL 32)
set(ARCH i686)
set(LL_ARCH ${ARCH}_win32)
set(LL_ARCH_DIR ${ARCH}-win32)
elseif (WORD_SIZE EQUAL 64)
set(ARCH x86_64)
set(LL_ARCH ${ARCH}_win)
set(LL_ARCH_DIR ${ARCH}-win)
endif (WORD_SIZE EQUAL 32)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -70,6 +67,29 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif(CMAKE_SIZEOF_VOID_P MATCHES 4)
endif (WORD_SIZE EQUAL 32)
if (NOT STANDALONE AND MULTIARCH_HACK)
if (WORD_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)
set(DEB_ARCHITECTURE amd64)
set(FIND_LIBRARY_USE_LIB64_PATHS ON)
endif (WORD_SIZE EQUAL 32)
execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
RESULT_VARIABLE DPKG_RESULT
OUTPUT_VARIABLE DPKG_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
#message (STATUS "DPKG_RESULT ${DPKG_RESULT}, DPKG_ARCH ${DPKG_ARCH}")
if (DPKG_RESULT EQUAL 0)
set(CMAKE_LIBRARY_ARCHITECTURE ${DPKG_ARCH})
set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/${DPKG_ARCH} /usr/local/lib/${DPKG_ARCH} ${CMAKE_SYSTEM_LIBRARY_PATH})
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")
@@ -77,75 +97,89 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
if(${CMAKE_GENERATOR} MATCHES Xcode)
#SDK Compiler and Deployment targets for XCode
if (${XCODE_VERSION} VERSION_LESS 4.0.0)
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
set(CMAKE_XCODE_ATTIBUTE_GCC_VERSION "4.2")
else (${XCODE_VERSION} VERSION_LESS 4.0.0)
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
endif (${XCODE_VERSION} VERSION_LESS 4.0.0)
else()
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
endif(${CMAKE_GENERATOR} MATCHES Xcode)
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}")
# # To support a different SDK update these Xcode settings:
# if (XCODE_VERSION GREATER 4.9) # (Which would be 5.0+)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
# set(CMAKE_OSX_SYSROOT macosx10.9)
# else (XCODE_VERION GREATER 4.9)
# if (XCODE_VERSION GREATER 4.5)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
# set(CMAKE_OSX_SYSROOT macosx10.8)
# else (XCODE_VERSION GREATER 4.5)
# if (XCODE_VERSION GREATER 4.2)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
# set(CMAKE_OSX_SYSROOT macosx10.7)
# else (XCODE_VERSION GREATER 4.2)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
# set(CMAKE_OSX_SYSROOT macosx10.7)
# endif (XCODE_VERSION GREATER 4.2)
# endif (XCODE_VERSION GREATER 4.5)
# endif (XCODE_VERSION GREATER 4.9)
## We currently support only 32-bit i386 builds, so use these:
# 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)
# 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)
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
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)
## But if you want to compile for mixed 32/64 bit, try these:
# set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
# set(ARCH universal)
# set(WORD_SIZE 64)
## Finally, set up the build output directories
set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (WINDOWS)
if (WINDOWS AND WORD_SIZE EQUAL 32)
set(PREBUILT_TYPE windows)
elseif (WINDOWS AND WORD_SIZE EQUAL 64)
set(PREBUILT_TYPE windows64)
elseif(DARWIN)
set(PREBUILT_TYPE darwin)
elseif(LINUX AND WORD_SIZE EQUAL 32)
set(PREBUILT_TYPE linux)
elseif(LINUX AND WORD_SIZE EQUAL 64)
set(PREBUILT_TYPE linux64)
endif(WINDOWS)
endif(WINDOWS AND WORD_SIZE EQUAL 32)
# Default deploy grid
set(GRID agni CACHE STRING "Target Grid")
set(VIEWER ON CACHE BOOL "Build Second Life viewer.")
set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name")
set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing")
set(VIEWER_LOGIN_CHANNEL "${VIEWER_CHANNEL}" CACHE STRING "Fake login channel for A/B Testing")
set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)")
# *TODO: break out proper Branding-secondlife.cmake, Branding-snowglobe.cmake, etc
set(VIEWER_BRANDING_NAME "Singularity")
set(VIEWER_BRANDING_NAME_CAMELCASE "Singularity")
string(REGEX REPLACE " +" "" VIEWER_CHANNEL_ONE_WORD "${VIEWER_CHANNEL}")
set(VIEWER_BRANDING_NAME "${VIEWER_CHANNEL_ONE_WORD}")
set(VIEWER_BRANDING_NAME_CAMELCASE "${VIEWER_CHANNEL_ONE_WORD}")
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
if (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
set(SERVER ON CACHE BOOL "Build Second Life server software.")
endif (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
if (LINUX AND SERVER AND VIEWER)
MESSAGE(FATAL_ERROR "
The indra source does not currently support building SERVER and VIEWER at the same time.
Please set one of these values to OFF in your CMake cache file.
(either by running ccmake or by editing CMakeCache.txt by hand)
For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both VIEWER and SERVER in one build environment
")
endif (LINUX AND SERVER AND VIEWER)
source_group("CMake Rules" FILES CMakeLists.txt)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@@ -236,8 +236,10 @@ void stop_recording_backtraces(void)
channel_ct backtrace DDCN("BACKTRACE"); //!< This debug channel is used for backtraces.
channel_ct statemachine DDCN("STATEMACHINE"); //!< This debug channel is used for output related to class AIStateMachine.
channel_ct caps DDCN("CAPS"); //!< This debug channel is used for output related to Capabilities.
channel_ct curl DDCN("CURL"); //!< This debug channel is used for output related to Curl.
channel_ct curlio DDCN("CURLIO"); //!< This debug channel is used to print debug output of libcurl.
channel_ct curl DDCN("CURL"); //!< This debug channel is used for output related to AICurl.
channel_ct curlio DDCN("CURLIO"); //!< This debug channel is used to print debug output of libcurl. This includes all HTTP network traffic.
channel_ct curltr DDCN("CURLTR"); //!< This debug channel is used to print libcurl API calls.
channel_ct snapshot DDCN("SNAPSHOT"); //!< This debug channel is used for output related to snapshots.
} // namespace dc
} // namespace DEBUGCHANNELS
@@ -560,8 +562,10 @@ namespace dc
fake_channel const warning(1, "WARNING ");
fake_channel const curl(1, "CURL ");
fake_channel const curlio(1, "CURLIO ");
fake_channel const curltr(1, "CURLTR ");
fake_channel const statemachine(1, "STATEMACHINE");
fake_channel const notice(1, "NOTICE ");
fake_channel const snapshot(0, "SNAPSHOT ");
} // namespace dc
} // namespace debug

View File

@@ -28,93 +28,16 @@
#ifndef CWDEBUG
#ifdef DEBUG_CURLIO
// If CWDEBUG is not defined, but DEBUG_CURLIO is, then replace
// some of the cwd macro's with something that generates viewer
// specific debug output. Note that this generates a LOT of
// output and should not normally be defined.
#include <string>
#include "llpreprocessor.h"
namespace debug {
namespace libcwd {
struct buf2str {
buf2str(char const* buf, int size) : mBuf(buf), mSize(size) { }
char const* mBuf;
int mSize;
};
struct libcwd_do_type {
void on() const { }
};
extern LL_COMMON_API libcwd_do_type const libcw_do;
} // namespace libcwd
enum print_thread_id_t { print_thread_id };
inline void init() { }
struct Indent {
int M_indent;
static ll_thread_local int S_indentation;
enum LL_COMMON_API print_nt { print };
LL_COMMON_API Indent(int indent);
LL_COMMON_API ~Indent();
};
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, libcwd::buf2str const& b2s);
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, Indent::print_nt);
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, print_thread_id_t);
namespace dc {
struct fake_channel {
int mOn;
char const* mLabel;
fake_channel(int on, char const* label) : mOn(on), mLabel(label) { }
fake_channel(void) : mOn(0) { }
bool is_on() const { return !!mOn; }
bool is_off() const { return !mOn; }
void on() const { }
void off() const { }
};
extern LL_COMMON_API fake_channel const warning;
extern LL_COMMON_API fake_channel const curl;
extern LL_COMMON_API fake_channel const curlio;
extern LL_COMMON_API fake_channel const statemachine;
extern LL_COMMON_API fake_channel const notice;
} // namespace dc
} // namespace debug
#define LIBCWD_DEBUG_CHANNELS debug
#define LibcwDoutScopeBegin(a, b, c) do { using namespace debug; using namespace debug::libcwd; llinfos_nf << print_thread_id << (c).mLabel << ": " << Indent::print;
#define LibcwDoutStream llcont
#define LibcwDoutScopeEnd llcont << llendl; } while(0)
#define Debug(x) do { using namespace debug; using namespace debug::libcwd; x; } while(0)
#define Dout(a, b) do { using namespace debug; using namespace debug::libcwd; if ((a).mOn) { llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << b << llendl; } } while(0)
#define DoutEntering(a, b) \
int __slviewer_debug_indentation = 2; \
{ \
using namespace debug; \
using namespace debug::libcwd; \
if ((a).mOn) \
llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << "Entering " << b << llendl; \
else \
__slviewer_debug_indentation = 0; \
} \
debug::Indent __slviewer_debug_indent(__slviewer_debug_indentation);
#else // !DEBUG_CURLIO
#error DEBUG_CURLIO is not supported without libcwd.
// In order to use DEBUG_CURLIO you must install and use libcwd.
// Download libcwd:
// git clone https://github.com/CarloWood/libcwd.git
#endif
#define Debug(x)
#define Dout(a, b)
#define DoutEntering(a, b)
#endif // !DEBUG_CURLIO
#ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info.
#include <iostream>
@@ -142,6 +65,11 @@ extern LL_COMMON_API fake_channel const notice;
#define CWDEBUG_MARKER 0
#define BACKTRACE do { } while(0)
#ifdef DEBUG_CURLIO
#define CWD_ONLY(...) __VA_ARGS__
#else
#define CWD_ONLY(...)
#endif
#endif // !DOXYGEN
@@ -173,11 +101,12 @@ extern LL_COMMON_API fake_channel const notice;
#include <boost/shared_array.hpp>
#if CWDEBUG_LOCATION
#include <execinfo.h> // Needed for 'backtrace'.
#include "llpreprocessor.h"
#endif
#include "llpreprocessor.h" // LL_COMMON_API
#include <set>
#define CWD_API __attribute__ ((visibility("default")))
#define CWD_ONLY(...) __VA_ARGS__
//! Debug specific code.
namespace debug {
@@ -207,6 +136,8 @@ extern CWD_API channel_ct statemachine;
extern CWD_API channel_ct caps;
extern CWD_API channel_ct curl;
extern CWD_API channel_ct curlio;
extern CWD_API channel_ct curltr;
extern CWD_API channel_ct snapshot;
#endif
@@ -271,7 +202,7 @@ class TeeStream : public std::ostream {
};
#if CWDEBUG_LOCATION
class BackTrace {
class LL_COMMON_API BackTrace {
private:
boost::shared_array<void*> M_buffer;
int M_frames;
@@ -380,26 +311,60 @@ void InstanceTracker<T>::dump(void)
} // namespace debug
template<class T>
class AIDebugInstanceCounter
{
public:
static int sInstanceCount;
protected:
static void print_count(char const* name, int count, bool destruction);
AIDebugInstanceCounter()
{
print_count(typeid(T).name(), ++sInstanceCount, false);
}
AIDebugInstanceCounter(AIDebugInstanceCounter const&)
{
print_count(typeid(T).name(), ++sInstanceCount, false);
}
~AIDebugInstanceCounter()
{
print_count(typeid(T).name(), --sInstanceCount, true);
}
};
//static
template<class T>
int AIDebugInstanceCounter<T>::sInstanceCount;
//static
template<class T>
void AIDebugInstanceCounter<T>::print_count(char const* name, int count, bool destruction)
{
Dout(dc::notice, (destruction ? "Destructed " : "Constructing ") << name << ", now " << count << " instance" << ((count == 1) ? "." : "s."));
}
//! Debugging macro.
//
// Print "Entering " << \a data to channel \a cntrl and increment
// debugging output indentation until the end of the current scope.
#define DoutEntering(cntrl, data) \
int __slviewer_debug_indentation = 2; \
int __slviewer_debug_indentation = 2; \
{ \
LIBCWD_TSD_DECLARATION; \
if (LIBCWD_DO_TSD_MEMBER_OFF(::libcwd::libcw_do) < 0) \
{ \
::libcwd::channel_set_bootstrap_st __libcwd_channel_set(LIBCWD_DO_TSD(::libcwd::libcw_do) LIBCWD_COMMA_TSD); \
bool on; \
bool __slviewer_debug_on; \
{ \
using namespace LIBCWD_DEBUGCHANNELS; \
on = (__libcwd_channel_set|cntrl).on; \
__slviewer_debug_on = (__libcwd_channel_set|cntrl).on; \
} \
if (on) \
if (__slviewer_debug_on) \
Dout(cntrl, "Entering " << data); \
else \
__slviewer_debug_indentation = 0; \
__slviewer_debug_indentation = 0; \
} \
} \
debug::Indent __slviewer_debug_indent(__slviewer_debug_indentation);

View File

@@ -45,7 +45,6 @@ import commands
class CommandError(Exception):
pass
def mkdir(path):
try:
os.mkdir(path)
@@ -54,15 +53,19 @@ def mkdir(path):
if err.errno != errno.EEXIST or not os.path.isdir(path):
raise
def getcwd():
cwd = os.getcwd()
if 'a' <= cwd[0] <= 'z' and cwd[1] == ':':
def prettyprint_path_for_cmake(path):
if 'a' <= path[0] <= 'z' and path[1] == ':':
# CMake wants DOS drive letters to be in uppercase. The above
# condition never asserts on platforms whose full path names
# always begin with a slash, so we don't need to test whether
# we are running on Windows.
cwd = cwd[0].upper() + cwd[1:]
return cwd
path = path[0].upper() + path[1:]
return path
def getcwd():
return prettyprint_path_for_cmake(os.getcwd())
source_indra = prettyprint_path_for_cmake(os.path.dirname(os.path.realpath(__file__)))
def quote(opts):
return '"' + '" "'.join([ opt.replace('"', '') for opt in opts ]) + '"'
@@ -81,7 +84,6 @@ class PlatformSetup(object):
distcc = True
cmake_opts = []
word_size = 32
opensim_rules = 'OFF' #whether or not to use rules fit for opensim
using_express = False
def __init__(self):
@@ -125,7 +127,6 @@ class PlatformSetup(object):
standalone=self.standalone,
unattended=self.unattended,
word_size=self.word_size,
opensim_rules=self.opensim_rules,
type=self.build_type.upper(),
)
#if simple:
@@ -134,7 +135,6 @@ class PlatformSetup(object):
'-DSTANDALONE:BOOL=%(standalone)s '
'-DUNATTENDED:BOOL=%(unattended)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DOPENSIM_RULES:BOOL=%(opensim_rules)s '
'-G %(generator)r %(opts)s %(dir)r' % args)
def run_cmake(self, args=[]):
@@ -153,7 +153,7 @@ class PlatformSetup(object):
simple = False
try:
os.chdir(d)
cmd = self.cmake_commandline(cwd, d, args, simple)
cmd = self.cmake_commandline(source_indra, d, args, simple)
print 'Running %r in %r' % (cmd, d)
self.run(cmd, 'cmake')
finally:
@@ -169,7 +169,7 @@ class PlatformSetup(object):
raise
def parse_build_opts(self, arguments):
opts, targets = getopt.getopt(arguments, 'o:', ['option='])
opts, targets = getopt.getopt(arguments, 'D:o:', ['option='])
build_opts = []
for o, a in opts:
if o in ('-o', '--option'):
@@ -221,6 +221,7 @@ class UnixSetup(PlatformSetup):
exe_suffixes = ('',)
def __init__(self):
PlatformSetup.__init__(self)
super(UnixSetup, self).__init__()
self.generator = 'Unix Makefiles'
@@ -263,6 +264,7 @@ class UnixSetup(PlatformSetup):
class LinuxSetup(UnixSetup):
def __init__(self):
UnixSetup.__init__(self)
super(LinuxSetup, self).__init__()
try:
self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1'
@@ -273,18 +275,9 @@ class LinuxSetup(UnixSetup):
return 'linux'
def build_dirs(self):
# Only build the server code if we have it.
platform_build = '%s-%s' % (self.platform(), self.build_type.lower())
if self.arch() == 'i686' and self.is_internal_tree():
return ['viewer-' + platform_build, 'server-' + platform_build]
elif self.arch() == 'x86_64' and self.is_internal_tree():
# the viewer does not build in 64bit -- kdu5 issues
# we can either use openjpeg, or overhaul our viewer to handle kdu5 or higher
# doug knows about kdu issues
return ['server-' + platform_build]
else:
return ['viewer-' + platform_build]
return ['viewer-' + platform_build]
def cmake_commandline(self, src_dir, build_dir, opts, simple):
args = dict(
@@ -296,34 +289,12 @@ class LinuxSetup(UnixSetup):
type=self.build_type.upper(),
project_name=self.project_name,
word_size=self.word_size,
opensim_rules=self.opensim_rules,
cxx="g++"
)
if not self.is_internal_tree():
args.update({'cxx':'g++', 'server':'OFF', 'viewer':'ON'})
else:
if self.distcc:
distcc = self.find_in_path('distcc')
baseonly = True
else:
distcc = []
baseonly = False
if 'server' in build_dir:
gcc = distcc + self.find_in_path(
self.debian_sarge and 'g++-3.3' or 'g++-4.1',
'g++', baseonly)
args.update({'cxx': ' '.join(gcc), 'server': 'ON',
'viewer': 'OFF'})
else:
gcc41 = distcc + self.find_in_path('g++-4.1', 'g++', baseonly)
args.update({'cxx': ' '.join(gcc41),
'server': 'OFF',
'viewer': 'ON'})
cmd = (('cmake -DCMAKE_BUILD_TYPE:STRING=%(type)s '
'-G %(generator)r -DSERVER:BOOL=%(server)s '
'-DVIEWER:BOOL=%(viewer)s -DSTANDALONE:BOOL=%(standalone)s '
'-DUNATTENDED:BOOL=%(unattended)s '
'-G %(generator)r -DSTANDALONE:BOOL=%(standalone)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DOPENSIM_RULES:BOOL=%(opensim_rules)s '
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
'%(opts)s %(dir)r')
% args)
@@ -415,6 +386,7 @@ class LinuxSetup(UnixSetup):
class DarwinSetup(UnixSetup):
def __init__(self):
UnixSetup.__init__(self)
super(DarwinSetup, self).__init__()
self.generator = 'Xcode'
@@ -437,7 +409,6 @@ class DarwinSetup(UnixSetup):
unattended=self.unattended,
project_name=self.project_name,
universal=self.universal,
opensim_rules=self.opensim_rules,
type=self.build_type.upper(),
)
if self.universal == 'ON':
@@ -449,7 +420,6 @@ class DarwinSetup(UnixSetup):
'-DSTANDALONE:BOOL=%(standalone)s '
'-DUNATTENDED:BOOL=%(unattended)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DOPENSIM_RULES:BOOL=%(opensim_rules)s '
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
'%(universal)s '
'%(opts)s %(dir)r' % args)
@@ -473,53 +443,45 @@ class DarwinSetup(UnixSetup):
class WindowsSetup(PlatformSetup):
gens = {
'vc71' : {
'gen' : r'Visual Studio 7 .NET 2003',
'ver' : r'7.1'
},
'vc80' : {
'gen' : r'Visual Studio 8 2005',
'ver' : r'8.0'
},
'vc90' : {
'gen' : r'Visual Studio 9 2008',
'ver' : r'9.0'
},
'vc100' : {
'gen' : r'Visual Studio 10',
'ver' : r'10.0'
},
'vc110' : {
'gen' : r'Visual Studio 11',
'ver' : r'11.0'
}
}
gens['vs2003'] = gens['vc71']
gens['vs2005'] = gens['vc80']
gens['vs2008'] = gens['vc90']
gens['vs2010'] = gens['vc100']
gens['vs2012'] = gens['vc110']
search_path = r'C:\windows'
exe_suffixes = ('.exe', '.bat', '.com')
def __init__(self):
PlatformSetup.__init__(self)
super(WindowsSetup, self).__init__()
self._generator = None
self.incredibuild = False
def _get_generator(self):
if self._generator is None:
for version in 'vc80 vc90 vc100 vc71'.split():
for version in 'vc100'.split():
if self.find_visual_studio(version):
self._generator = version
print 'Building with ', self.gens[version]['gen']
break
else:
print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions'
for version in 'vc80 vc90 vc100 vc71'.split():
for version in 'vc100'.split():
if self.find_visual_studio_express(version):
self._generator = version
self.using_express = True
print 'Building with ', self.gens[version]['gen'] , "Express edition"
break
else:
for version in 'vc80 vc90 vc100 vc71'.split():
for version in 'vc100'.split():
if self.find_visual_studio_express_single(version):
self._generator = version
self.using_express = True
@@ -539,7 +501,10 @@ class WindowsSetup(PlatformSetup):
return 'win32'
def build_dirs(self):
return ['build-' + self.generator]
if self.word_size == 64:
return ['build-' + self.generator + '-Win64']
else:
return ['build-' + self.generator]
def cmake_commandline(self, src_dir, build_dir, opts, simple):
args = dict(
@@ -550,15 +515,16 @@ class WindowsSetup(PlatformSetup):
unattended=self.unattended,
project_name=self.project_name,
word_size=self.word_size,
opensim_rules=self.opensim_rules,
)
if self.word_size == 64:
args["generator"] += r' Win64'
#if simple:
# return 'cmake %(opts)s "%(dir)s"' % args
return ('cmake -G "%(generator)s" '
'-DSTANDALONE:BOOL=%(standalone)s '
'-DUNATTENDED:BOOL=%(unattended)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DOPENSIM_RULES:BOOL=%(opensim_rules)s '
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
'%(opts)s "%(dir)s"' % args)
@@ -646,15 +612,15 @@ class WindowsSetup(PlatformSetup):
if environment == '':
environment = self.find_visual_studio_express()
if environment == '':
environment = self.find_visual_studio_express_single()
if environment == '':
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
else:
build_dirs=self.build_dirs()
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
exit(0)
environment = self.find_visual_studio_express_single()
if environment == '':
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
else:
build_dirs=self.build_dirs()
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
exit(0)
# devenv.com is CLI friendly, devenv.exe... not so much.
return ('"%sdevenv.com" %s.sln /build %s' %
@@ -696,7 +662,7 @@ class WindowsSetup(PlatformSetup):
os.path.join(build_dir,'Singularity.sln') +
' --config ' + self.build_type +
' --startup secondlife-bin')
print 'Running %r in %r' % (vstool_cmd, getcwd())
print 'Running vstool %r in %r' % (vstool_cmd, getcwd())
self.run(vstool_cmd)
print >> open(stamp, 'w'), self.build_type
@@ -710,11 +676,11 @@ class WindowsSetup(PlatformSetup):
if targets:
for t in targets:
cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts))
print 'Running %r in %r' % (cmd, d)
print 'Running build(targets) %r in %r' % (cmd, d)
self.run(cmd)
else:
cmd = '%s %s' % (build_cmd, ' '.join(opts))
print 'Running %r in %r' % (cmd, d)
print 'Running build %r in %r' % (cmd, d)
self.run(cmd)
finally:
os.chdir(cwd)
@@ -734,15 +700,15 @@ class CygwinSetup(WindowsSetup):
unattended=self.unattended,
project_name=self.project_name,
word_size=self.word_size,
opensim_rules=self.opensim_rules,
)
if self.word_size == 64:
args["generator"] += r' Win64'
#if simple:
# return 'cmake %(opts)s "%(dir)s"' % args
return ('cmake -G "%(generator)s" '
'-DUNATTENDED:BOOl=%(unattended)s '
'-DSTANDALONE:BOOL=%(standalone)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DOPENSIM_RULES:BOOL=%(opensim_rules)s '
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
'%(opts)s "%(dir)s"' % args)
@@ -768,8 +734,7 @@ Options:
-m32 | -m64 build architecture (32-bit or 64-bit)
-N | --no-distcc disable use of distcc
-G | --generator=NAME generator name
Windows: VC71 or VS2003 (default), VC80 (VS2005)
VC90 (VS2008), or VC100 (VS2010)
Windows: VC100 (VS2010) (default)
Mac OS X: Xcode (default), Unix Makefiles
Linux: Unix Makefiles (default), KDevelop3
-p | --project=NAME set the root project name. (Doesn't effect makefiles)
@@ -782,21 +747,15 @@ Commands:
Command-options for "configure":
We use cmake variables to change the build configuration.
-DSERVER:BOOL=OFF Don't configure simulator/dataserver/etc
-DVIEWER:BOOL=OFF Don't configure the viewer
-DPACKAGE:BOOL=ON Create "package" target to make installers
-DLOCALIZESETUP:BOOL=ON Create one win_setup target per supported language
-DLL_TESTS:BOOL=OFF Don't generate unit test projects
-DEXAMPLEPLUGIN:BOOL=OFF Don't generate example plugin project
-DDISABLE_TCMALLOC:BOOL=ON Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)
-DVISTA_ICON:BOOL=ON Allow pre-2008 VS to use vista-optimized resource file. (Requires updated rcdll.dll!)
Examples:
Set up a viewer-only project for your system:
develop.py configure -DSERVER:BOOL=OFF
Set up a Visual Studio 2005 project with "package" target:
develop.py -G vc80 configure -DPACKAGE:BOOL=ON
Set up a Visual Studio 2010 project with "package" target:
develop.py -G vc100 configure -DPACKAGE:BOOL=ON
'''
def main(arguments):

View File

@@ -39,6 +39,7 @@ import shutil
import sys
import tarfile
import errno
import subprocess
def path_ancestors(path):
drive, path = os.path.splitdrive(os.path.normpath(path))
@@ -192,6 +193,8 @@ def usage(srctree=""):
arg['description'] % nd)
def main():
print "cwd:", os.getcwd()
print " ".join(sys.argv)
option_names = [arg['name'] + '=' for arg in ARGUMENTS]
option_names.append('help')
options, remainder = getopt.getopt(sys.argv[1:], "", option_names)
@@ -266,7 +269,7 @@ class LLManifest(object):
__metaclass__ = LLManifestRegistry
manifests = {}
def for_platform(self, platform, arch = None):
if arch:
if arch and platform != "windows":
platform = platform + '_' + arch
return self.manifests[platform.lower()]
for_platform = classmethod(for_platform)
@@ -391,20 +394,19 @@ class LLManifest(object):
debugging/informational purpoases, prints out the command's
output as it is received."""
print "Running command:", command
fd = os.popen(command, 'r')
fd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
lines = []
while True:
lines.append(fd.readline())
lines.append(fd.stdout.readline())
if lines[-1] == '':
break
else:
print lines[-1],
print lines[-1].rstrip('\n'),
output = ''.join(lines)
status = fd.close()
if status:
if fd.returncode:
raise RuntimeError(
"Command %s returned non-zero status (%s) \noutput:\n%s"
% (command, status, output) )
% (command, fd.returncode, output) )
return output
def created_path(self, path):

View File

@@ -0,0 +1,39 @@
# -*- cmake -*-
project(libhacd)
include(00-Common)
set(libhacd_SOURCE_FILES
hacdGraph.cpp
hacdHACD.cpp
hacdICHull.cpp
hacdManifoldMesh.cpp
hacdMeshDecimator.cpp
hacdMicroAllocator.cpp
hacdRaycastMesh.cpp
)
set(libhacd_HEADER_FILES
hacdCircularList.h
hacdCircularList.inl
hacdGraph.h
hacdHACD.h
hacdICHull.h
hacdManifoldMesh.h
hacdMeshDecimator.h
hacdMicroAllocator.h
hacdRaycastMesh.h
hacdSArray.h
hacdVector.h
hacdVector.inl
hacdVersion.h
)
set_source_files_properties(${libhacd_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
IF(WINDOWS)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
ENDIF(WINDOWS)
add_library(hacd ${libhacd_SOURCE_FILES} ${libhacd_INCLUDE_FILES})

View File

@@ -0,0 +1,85 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_CIRCULAR_LIST_H
#define HACD_CIRCULAR_LIST_H
#include <stdlib.h>
#include "hacdVersion.h"
#include "hacdMicroAllocator.h"
namespace HACD
{
//! CircularListElement class.
template < typename T > class CircularListElement
{
public:
T & GetData() { return m_data; }
const T & GetData() const { return m_data; }
CircularListElement<T> * & GetNext() { return m_next; }
CircularListElement<T> * & GetPrev() { return m_prev; }
const CircularListElement<T> * & GetNext() const { return m_next; }
const CircularListElement<T> * & GetPrev() const { return m_prev; }
//! Constructor
CircularListElement(const T & data) {m_data = data;}
CircularListElement(void){}
//! Destructor
~CircularListElement(void){}
private:
T m_data;
CircularListElement<T> * m_next;
CircularListElement<T> * m_prev;
CircularListElement(const CircularListElement & rhs);
};
//! CircularList class.
template < typename T > class CircularList
{
public:
HeapManager * const GetHeapManager() const { return m_heapManager;}
void SetHeapManager(HeapManager * const heapManager) { m_heapManager = heapManager;}
CircularListElement<T> * & GetHead() { return m_head;}
const CircularListElement<T> * GetHead() const { return m_head;}
bool IsEmpty() const { return (m_size == 0);}
size_t GetSize() const { return m_size; }
const T & GetData() const { return m_head->GetData(); }
T & GetData() { return m_head->GetData();}
bool Delete() ;
bool Delete(CircularListElement<T> * element);
CircularListElement<T> * Add(const T * data = 0);
CircularListElement<T> * Add(const T & data);
bool Next();
bool Prev();
void Clear() { while(Delete());};
const CircularList& operator=(const CircularList& rhs);
//! Constructor
CircularList(HeapManager * heapManager)
{
m_head = 0;
m_size = 0;
m_heapManager = heapManager;
}
CircularList(const CircularList& rhs);
//! Destructor
virtual ~CircularList(void) {Clear();};
private:
CircularListElement<T> * m_head; //!< a pointer to the head of the circular list
size_t m_size; //!< number of element in the circular list
HeapManager * m_heapManager;
};
}
#include "hacdCircularList.inl"
#endif

View File

@@ -0,0 +1,230 @@
#pragma once
#ifndef HACD_CIRCULAR_LIST_INL
#define HACD_CIRCULAR_LIST_INL
#include <stdlib.h>
#include "hacdVersion.h"
namespace HACD
{
template < typename T >
inline bool CircularList<T>::Delete(CircularListElement<T> * element)
{
if (!element)
{
return false;
}
if (m_size > 1)
{
CircularListElement<T> * next = element->GetNext();
CircularListElement<T> * prev = element->GetPrev();
if (m_heapManager)
{
element->~CircularListElement<T>();
heap_free(m_heapManager, element);
}
else
{
delete element;
}
m_size--;
if (element == m_head)
{
m_head = next;
}
next->GetPrev() = prev;
prev->GetNext() = next;
return true;
}
else if (m_size == 1)
{
if (m_heapManager)
{
element->~CircularListElement<T>();
heap_free(m_heapManager, m_head);
}
else
{
delete m_head;
}
m_size--;
m_head = 0;
return true;
}
else
{
return false;
}
}
template < typename T >
inline bool CircularList<T>::Delete()
{
if (m_size > 1)
{
CircularListElement<T> * next = m_head->GetNext();
CircularListElement<T> * prev = m_head->GetPrev();
if (m_heapManager)
{
m_head->~CircularListElement<T>();
heap_free(m_heapManager, m_head);
}
else
{
delete m_head;
}
m_size--;
m_head = next;
next->GetPrev() = prev;
prev->GetNext() = next;
return true;
}
else if (m_size == 1)
{
if (m_heapManager)
{
m_head->~CircularListElement<T>();
heap_free(m_heapManager, m_head);
}
else
{
delete m_head;
}
m_size--;
m_head = 0;
return true;
}
else
{
return false;
}
}
template < typename T >
inline CircularListElement<T> * CircularList<T>::Add(const T * data)
{
if (m_size == 0)
{
if (data)
{
if (m_heapManager)
{
m_head = static_cast< CircularListElement<T> * > (heap_malloc(m_heapManager, sizeof(CircularListElement<T>)));
m_head->GetData().Initialize();
m_head->GetData() = (*data);
}
else
{
m_head = new CircularListElement<T>(*data);
}
}
else
{
if (m_heapManager)
{
m_head = static_cast< CircularListElement<T> * > (heap_malloc(m_heapManager, sizeof(CircularListElement<T>)));
m_head->GetData().Initialize();
}
else
{
m_head = new CircularListElement<T>();
}
}
m_head->GetNext() = m_head->GetPrev() = m_head;
}
else
{
CircularListElement<T> * next = m_head->GetNext();
CircularListElement<T> * element = m_head;
if (data)
{
if (m_heapManager)
{
m_head = static_cast< CircularListElement<T> * > (heap_malloc(m_heapManager, sizeof(CircularListElement<T>)));
m_head->GetData().Initialize();
m_head->GetData() = (*data);
}
else
{
m_head = new CircularListElement<T>(*data);
}
}
else
{
if (m_heapManager)
{
m_head = static_cast< CircularListElement<T> * > (heap_malloc(m_heapManager, sizeof(CircularListElement<T>)));
m_head->GetData().Initialize();
}
else
{
m_head = new CircularListElement<T>();
}
}
m_head->GetNext() = next;
m_head->GetPrev() = element;
element->GetNext() = m_head;
next->GetPrev() = m_head;
}
m_size++;
return m_head;
}
template < typename T >
inline CircularListElement<T> * CircularList<T>::Add(const T & data)
{
const T * pData = &data;
return Add(pData);
}
template < typename T >
inline bool CircularList<T>::Next()
{
if (m_size == 0)
{
return false;
}
m_head = m_head->GetNext();
return true;
}
template < typename T >
inline bool CircularList<T>::Prev()
{
if (m_size == 0)
{
return false;
}
m_head = m_head->GetPrev();
return true;
}
template < typename T >
inline CircularList<T>::CircularList(const CircularList& rhs)
{
if (rhs.m_size > 0)
{
CircularListElement<T> * current = rhs.m_head;
do
{
current = current->GetNext();
Add(current->GetData());
}
while ( current != rhs.m_head );
}
}
template < typename T >
inline const CircularList<T>& CircularList<T>::operator=(const CircularList& rhs)
{
if (&rhs != this)
{
Clear();
m_heapManager = rhs.m_heapManager;
if (rhs.m_size > 0)
{
CircularListElement<T> * current = rhs.m_head;
do
{
current = current->GetNext();
Add(current->GetData());
}
while ( current != rhs.m_head );
}
}
return (*this);
}
}
#endif

278
indra/libhacd/hacdGraph.cpp Normal file
View File

@@ -0,0 +1,278 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#include "hacdGraph.h"
namespace HACD
{
GraphEdge::GraphEdge()
{
m_v1 = -1;
m_v2 = -1;
m_name = -1;
m_error = 0;
m_concavity = 0;
m_deleted = false;
#ifdef HACD_PRECOMPUTE_CHULLS
m_convexHull = 0;
#endif
}
GraphVertex::GraphVertex()
{
m_convexHull = 0;
m_name = -1;
m_cc = -1;
m_concavity = 0;
m_surf = 0;
m_deleted = false;
}
bool GraphVertex::DeleteEdge(long name)
{
return m_edges.Erase(name);
}
Graph::Graph()
{
m_nV = 0;
m_nE = 0;
m_nCCs = 0;
}
Graph::~Graph()
{
}
void Graph::Allocate(size_t nV, size_t nE)
{
m_nV = nV;
m_edges.reserve(nE);
m_vertices.resize(nV);
for(size_t i = 0; i < nV; i++)
{
m_vertices[i].m_name = static_cast<long>(i);
}
}
long Graph::AddVertex()
{
size_t name = m_vertices.size();
m_vertices.resize(name+1);
m_vertices[name].m_name = static_cast<long>(name);
m_nV++;
return static_cast<long>(name);
}
long Graph::AddEdge(long v1, long v2)
{
size_t name = m_edges.size();
m_edges.push_back(GraphEdge());
m_edges[name].m_name = static_cast<long>(name);
m_edges[name].m_v1 = v1;
m_edges[name].m_v2 = v2;
m_vertices[v1].AddEdge(static_cast<long>(name));
m_vertices[v2].AddEdge(static_cast<long>(name));
m_nE++;
return static_cast<long>(name);
}
bool Graph::DeleteEdge(long name)
{
if (name < static_cast<long>(m_edges.size()))
{
long v1 = m_edges[name].m_v1;
long v2 = m_edges[name].m_v2;
m_edges[name].m_deleted = true;
m_vertices[v1].DeleteEdge(name);
m_vertices[v2].DeleteEdge(name);
m_nE--;
return true;
}
return false;
}
bool Graph::DeleteVertex(long name)
{
if (name < static_cast<long>(m_vertices.size()))
{
m_vertices[name].m_deleted = true;
m_vertices[name].m_edges.Clear();
m_vertices[name].m_ancestors = std::vector<long>();
delete m_vertices[name].m_convexHull;
m_vertices[name].m_distPoints.Clear();
m_vertices[name].m_boudaryEdges.Clear();
m_vertices[name].m_convexHull = 0;
m_nV--;
return true;
}
return false;
}
bool Graph::EdgeCollapse(long v1, long v2)
{
long edgeToDelete = GetEdgeID(v1, v2);
if (edgeToDelete >= 0)
{
// delete the edge (v1, v2)
DeleteEdge(edgeToDelete);
// add v2 to v1 ancestors
m_vertices[v1].m_ancestors.push_back(v2);
// add v2's ancestors to v1's ancestors
m_vertices[v1].m_ancestors.insert(m_vertices[v1].m_ancestors.begin(),
m_vertices[v2].m_ancestors.begin(),
m_vertices[v2].m_ancestors.end());
// update adjacency information
SArray<long, SARRAY_DEFAULT_MIN_SIZE> & v1Edges = m_vertices[v1].m_edges;
long b = -1;
long idEdge;
for(size_t ed = 0; ed < m_vertices[v2].m_edges.Size(); ++ed)
{
idEdge = m_vertices[v2].m_edges[ed];
if (m_edges[idEdge].m_v1 == v2)
{
b = m_edges[idEdge].m_v2;
}
else
{
b = m_edges[idEdge].m_v1;
}
if (GetEdgeID(v1, b) >= 0)
{
m_edges[idEdge].m_deleted = true;
m_vertices[b].DeleteEdge(idEdge);
m_nE--;
}
else
{
m_edges[idEdge].m_v1 = v1;
m_edges[idEdge].m_v2 = b;
v1Edges.Insert(idEdge);
}
}
// delete the vertex v2
DeleteVertex(v2);
return true;
}
return false;
}
long Graph::GetEdgeID(long v1, long v2) const
{
if (v1 < static_cast<long>(m_vertices.size()) && !m_vertices[v1].m_deleted)
{
long idEdge;
for(size_t ed = 0; ed < m_vertices[v1].m_edges.Size(); ++ed)
{
idEdge = m_vertices[v1].m_edges[ed];
if ( (m_edges[idEdge].m_v1 == v2) ||
(m_edges[idEdge].m_v2 == v2) )
{
return m_edges[idEdge].m_name;
}
}
}
return -1;
}
void Graph::Print() const
{
std::cout << "-----------------------------" << std::endl;
std::cout << "vertices (" << m_nV << ")" << std::endl;
for (size_t v = 0; v < m_vertices.size(); ++v)
{
const GraphVertex & currentVertex = m_vertices[v];
if (!m_vertices[v].m_deleted)
{
std::cout << currentVertex.m_name << "\t";
long idEdge;
for(size_t ed = 0; ed < currentVertex.m_edges.Size(); ++ed)
{
idEdge = currentVertex.m_edges[ed];
std::cout << "(" << m_edges[idEdge].m_v1 << "," << m_edges[idEdge].m_v2 << ") ";
}
std::cout << std::endl;
}
}
std::cout << "vertices (" << m_nE << ")" << std::endl;
for (size_t e = 0; e < m_edges.size(); ++e)
{
const GraphEdge & currentEdge = m_edges[e];
if (!m_edges[e].m_deleted)
{
std::cout << currentEdge.m_name << "\t("
<< m_edges[e].m_v1 << ","
<< m_edges[e].m_v2 << ") "<< std::endl;
}
}
}
void Graph::Clear()
{
m_vertices.clear();
m_edges.clear();
m_nV = 0;
m_nE = 0;
}
long Graph::ExtractCCs()
{
// all CCs to -1
for (size_t v = 0; v < m_vertices.size(); ++v)
{
if (!m_vertices[v].m_deleted)
{
m_vertices[v].m_cc = -1;
}
}
// we get the CCs
m_nCCs = 0;
long v2 = -1;
long idEdge;
std::vector<long> temp;
for (size_t v = 0; v < m_vertices.size(); ++v)
{
if (!m_vertices[v].m_deleted && m_vertices[v].m_cc == -1)
{
m_vertices[v].m_cc = static_cast<long>(m_nCCs);
temp.clear();
temp.push_back(m_vertices[v].m_name);
while (temp.size())
{
long vertex = temp[temp.size()-1];
temp.pop_back();
for(size_t ed = 0; ed < m_vertices[vertex].m_edges.Size(); ++ed)
{
idEdge = m_vertices[vertex].m_edges[ed];
if (m_edges[idEdge].m_v1 == vertex)
{
v2 = m_edges[idEdge].m_v2;
}
else
{
v2 = m_edges[idEdge].m_v1;
}
if ( !m_vertices[v2].m_deleted && m_vertices[v2].m_cc == -1)
{
m_vertices[v2].m_cc = static_cast<long>(m_nCCs);
temp.push_back(v2);
}
}
}
m_nCCs++;
}
}
return static_cast<long>(m_nCCs);
}
}

118
indra/libhacd/hacdGraph.h Normal file
View File

@@ -0,0 +1,118 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_GRAPH_H
#define HACD_GRAPH_H
#include "hacdVersion.h"
#include "hacdVector.h"
#include "hacdICHull.h"
#include <map>
#include <vector>
#include "hacdSArray.h"
//#define HACD_PRECOMPUTE_CHULLS
namespace HACD
{
class GraphVertex;
class GraphEdge;
class Graph;
class HACD;
class GraphVertex
{
public:
bool AddEdge(long name)
{
m_edges.Insert(name);
return true;
}
bool DeleteEdge(long name);
GraphVertex();
~GraphVertex(){ delete m_convexHull;};
private:
long m_name;
long m_cc;
SArray<long, SARRAY_DEFAULT_MIN_SIZE> m_edges;
bool m_deleted;
std::vector<long> m_ancestors;
SArray<DPoint, SARRAY_DEFAULT_MIN_SIZE> m_distPoints;
Real m_concavity;
double m_surf;
ICHull * m_convexHull;
SArray<unsigned long long, SARRAY_DEFAULT_MIN_SIZE> m_boudaryEdges;
friend class GraphEdge;
friend class Graph;
friend class HACD;
};
class GraphEdge
{
public:
GraphEdge();
~GraphEdge()
{
#ifdef HACD_PRECOMPUTE_CHULLS
delete m_convexHull;
#endif
};
private:
long m_name;
long m_v1;
long m_v2;
double m_concavity;
Real m_error;
#ifdef HACD_PRECOMPUTE_CHULLS
ICHull * m_convexHull;
#endif
bool m_deleted;
friend class GraphVertex;
friend class Graph;
friend class HACD;
};
class Graph
{
public:
size_t GetNEdges() const { return m_nE;}
size_t GetNVertices() const { return m_nV;}
bool EdgeCollapse(long v1, long v2);
long AddVertex();
long AddEdge(long v1, long v2);
bool DeleteEdge(long name);
bool DeleteVertex(long name);
long GetEdgeID(long v1, long v2) const;
void Clear();
void Print() const;
long ExtractCCs();
Graph();
virtual ~Graph();
void Allocate(size_t nV, size_t nE);
private:
size_t m_nCCs;
size_t m_nV;
size_t m_nE;
std::vector<GraphEdge> m_edges;
std::vector<GraphVertex> m_vertices;
friend class HACD;
};
}
#endif

1142
indra/libhacd/hacdHACD.cpp Normal file

File diff suppressed because it is too large Load Diff

333
indra/libhacd/hacdHACD.h Normal file
View File

@@ -0,0 +1,333 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_HACD_H
#define HACD_HACD_H
#include "hacdVersion.h"
#include "hacdVector.h"
#include "hacdGraph.h"
#include "hacdICHull.h"
#include <set>
#include <vector>
#include <queue>
#if defined(_MSC_VER) && _MSC_VER >= 1700
#include <functional>
#endif
namespace HACD
{
const double sc_pi = 3.14159265;
class HACD;
// just to be able to set the capcity of the container
template<class _Ty, class _Container = std::vector<_Ty>, class _Pr = std::less<typename _Container::value_type> >
class reservable_priority_queue: public std::priority_queue<_Ty, _Container, _Pr>
{
typedef typename std::priority_queue<_Ty, _Container, _Pr>::size_type size_type;
public:
reservable_priority_queue(size_type capacity = 0) { reserve(capacity); };
void reserve(size_type capacity) { this->c.reserve(capacity); }
size_type capacity() const { return this->c.capacity(); }
};
//! priority queque element
class HACD;
class GraphEdgePriorityQueue
{
public:
//! Constructor
//! @param name edge's id
//! @param priority edge's priority
GraphEdgePriorityQueue(long name, Real priority)
{
m_name = name;
m_priority = priority;
}
//! Destructor
~GraphEdgePriorityQueue(void){}
private:
long m_name; //!< edge name
Real m_priority; //!< priority
//! Operator < for GraphEdgePQ
friend bool operator<(const GraphEdgePriorityQueue & lhs, const GraphEdgePriorityQueue & rhs);
//! Operator > for GraphEdgePQ
friend bool operator>(const GraphEdgePriorityQueue & lhs, const GraphEdgePriorityQueue & rhs);
friend class HACD;
};
inline bool operator<(const GraphEdgePriorityQueue & lhs, const GraphEdgePriorityQueue & rhs)
{
return (lhs.m_priority<rhs.m_priority);
}
inline bool operator>(const GraphEdgePriorityQueue & lhs, const GraphEdgePriorityQueue & rhs)
{
return lhs.m_priority>rhs.m_priority;
}
class ICallback
{
public:
virtual void operator()( char const *aMsg, double aProgress, double aConcavity, size_t aVertices) = 0;
virtual ~ICallback() {}
};
typedef ICallback* CallBackFunction;
//! Provides an implementation of the Hierarchical Approximate Convex Decomposition (HACD) technique described in "A Simple and Efficient Approach for 3D Mesh Approximate Convex Decomposition" Game Programming Gems 8 - Chapter 2.8, p.202. A short version of the chapter was published in ICIP09 and is available at ftp://ftp.elet.polimi.it/users/Stefano.Tubaro/ICIP_USB_Proceedings_v2/pdfs/0003501.pdf
class HACD
{
public:
//! Gives the targeted number of triangles of the decimated mesh
//! @return targeted number of triangles of the decimated mesh
size_t GetTargetNTrianglesDecimatedMesh() const { return m_targetNTrianglesDecimatedMesh;}
//! Sets the targeted number of triangles of the decimated mesh
//! @param targeted number of triangles of the decimated mesh
void SetNTargetTrianglesDecimatedMesh(size_t targetNTrianglesDecimatedMesh) { m_targetNTrianglesDecimatedMesh = targetNTrianglesDecimatedMesh;}
//! Gives the triangles partitionas an array of size m_nTriangles where the i-th element specifies the cluster to which belong the i-th triangle
//! @return triangles partition
const long * const GetPartition() const { return m_partition;}
//! Sets the scale factor
//! @param scale scale factor
void SetScaleFactor(double scale) { m_scale = scale;}
//! Gives the scale factor
//! @return scale factor
const double GetScaleFactor() const { return m_scale;}
//! Sets the threshold to detect small clusters. The threshold is expressed as a percentage of the total mesh surface (default 0.25%)
//! @param smallClusterThreshold threshold to detect small clusters
void SetSmallClusterThreshold(double smallClusterThreshold) { m_smallClusterThreshold = smallClusterThreshold;}
//! Gives the threshold to detect small clusters. The threshold is expressed as a percentage of the total mesh surface (default 0.25%)
//! @return threshold to detect small clusters
const double GetSmallClusterThreshold() const { return m_smallClusterThreshold;}
//! Sets the call-back function
//! @param callBack pointer to the call-back function
void SetCallBack(CallBackFunction callBack) { m_callBack = callBack;}
//! Gives the call-back function
//! @return pointer to the call-back function
const CallBackFunction GetCallBack() const { return m_callBack;}
//! Specifies whether faces points should be added when computing the concavity
//! @param addFacesPoints true = faces points should be added
void SetAddFacesPoints(bool addFacesPoints) { m_addFacesPoints = addFacesPoints;}
//! Specifies wheter faces points should be added when computing the concavity
//! @return true = faces points should be added
const bool GetAddFacesPoints() const { return m_addFacesPoints;}
//! Specifies whether extra points should be added when computing the concavity
//! @param addExteraDistPoints true = extra points should be added
void SetAddExtraDistPoints(bool addExtraDistPoints) { m_addExtraDistPoints = addExtraDistPoints;}
//! Specifies wheter extra points should be added when computing the concavity
//! @return true = extra points should be added
const bool GetAddExtraDistPoints() const { return m_addExtraDistPoints;}
//! Sets the points of the input mesh (Remark: the input points will be scaled and shifted. Use DenormalizeData() to invert those operations)
//! @param points pointer to the input points
void SetPoints(Vec3<Real> * points) { m_points = points;}
//! Gives the points of the input mesh (Remark: the input points will be scaled and shifted. Use DenormalizeData() to invert those operations)
//! @return pointer to the input points
const Vec3<Real> * GetPoints() const { return m_points;}
//! Gives the points of the decimated mesh
//! @return pointer to the decimated mesh points
const Vec3<Real> * GetDecimatedPoints() const { return m_pointsDecimated;}
//! Gives the triangles in the decimated mesh
//! @return pointer to the decimated mesh triangles
const Vec3<long> * GetDecimatedTriangles() const { return m_trianglesDecimated;}
//! Gives the number of points in the decimated mesh.
//! @return number of points the decimated mesh mesh
const size_t GetNDecimatedPoints() const { return m_nPointsDecimated;}
//! Gives the number of triangles in the decimated mesh.
//! @return number of triangles the decimated mesh
const size_t GetNDecimatedTriangles() const { return m_nTrianglesDecimated;}
//! Sets the triangles of the input mesh.
//! @param triangles points pointer to the input points
void SetTriangles(Vec3<long> * triangles) { m_triangles = triangles;}
//! Gives the triangles in the input mesh
//! @return pointer to the input triangles
const Vec3<long> * GetTriangles() const { return m_triangles;}
//! Sets the number of points in the input mesh.
//! @param nPoints number of points the input mesh
void SetNPoints(size_t nPoints) { m_nPoints = nPoints;}
//! Gives the number of points in the input mesh.
//! @return number of points the input mesh
const size_t GetNPoints() const { return m_nPoints;}
//! Sets the number of triangles in the input mesh.
//! @param nTriangles number of triangles in the input mesh
void SetNTriangles(size_t nTriangles) { m_nTriangles = nTriangles;}
//! Gives the number of triangles in the input mesh.
//! @return number of triangles the input mesh
const size_t GetNTriangles() const { return m_nTriangles;}
//! Sets the minimum number of clusters to be generated.
//! @param nClusters minimum number of clusters
void SetNClusters(size_t nClusters) { m_nMinClusters = nClusters;}
//! Gives the number of generated clusters.
//! @return number of generated clusters
const size_t GetNClusters() const { return m_nClusters;}
//! Sets the maximum allowed concavity.
//! @param concavity maximum concavity
void SetConcavity(double concavity) { m_concavity = concavity;}
//! Gives the maximum allowed concavity.
//! @return maximum concavity
double GetConcavity() const { return m_concavity;}
//! Sets the maximum allowed distance to get CCs connected.
//! @param concavity maximum distance to get CCs connected
void SetConnectDist(double ccConnectDist) { m_ccConnectDist = ccConnectDist;}
//! Gives the maximum allowed distance to get CCs connected.
//! @return maximum distance to get CCs connected
double GetConnectDist() const { return m_ccConnectDist;}
//! Sets the volume weight.
//! @param beta volume weight
void SetVolumeWeight(double beta) { m_beta = beta;}
//! Gives the volume weight.
//! @return volume weight
double GetVolumeWeight() const { return m_beta;}
//! Sets the compacity weight (i.e. parameter alpha in ftp://ftp.elet.polimi.it/users/Stefano.Tubaro/ICIP_USB_Proceedings_v2/pdfs/0003501.pdf).
//! @param alpha compacity weight
void SetCompacityWeight(double alpha) { m_alpha = alpha;}
//! Gives the compacity weight (i.e. parameter alpha in ftp://ftp.elet.polimi.it/users/Stefano.Tubaro/ICIP_USB_Proceedings_v2/pdfs/0003501.pdf).
//! @return compacity weight
double GetCompacityWeight() const { return m_alpha;}
//! Sets the maximum number of vertices for each generated convex-hull.
//! @param nVerticesPerCH maximum # vertices per CH
void SetNVerticesPerCH(size_t nVerticesPerCH) { m_nVerticesPerCH = nVerticesPerCH;}
//! Gives the maximum number of vertices for each generated convex-hull.
//! @return maximum # vertices per CH
const size_t GetNVerticesPerCH() const { return m_nVerticesPerCH;}
//! Gives the number of vertices for the cluster number numCH.
//! @return number of vertices
size_t GetNPointsCH(size_t numCH) const;
//! Gives the number of triangles for the cluster number numCH.
//! @param numCH cluster's number
//! @return number of triangles
size_t GetNTrianglesCH(size_t numCH) const;
//! Gives the vertices and the triangles of the cluster number numCH.
//! @param numCH cluster's number
//! @param points pointer to the vector of points to be filled
//! @param triangles pointer to the vector of triangles to be filled
//! @return true if sucess
bool GetCH(size_t numCH, Vec3<Real> * const points, Vec3<long> * const triangles);
//! Computes the HACD decomposition.
//! @param fullCH specifies whether to generate convex-hulls with a full or limited (i.e. < m_nVerticesPerCH) number of vertices
//! @param exportDistPoints specifies wheter distance points should ne exported or not (used only for debugging).
//! @return true if sucess
bool Compute(bool fullCH=false, bool exportDistPoints=false);
#if 0
//! Saves the generated convex-hulls in a VRML 2.0 file.
//! @param fileName the output file name
//! @param uniColor specifies whether the different convex-hulls should have the same color or not
//! @param numCluster specifies the cluster to be saved, if numCluster < 0 export all clusters
//! @return true if sucess
bool Save(const char * fileName, bool uniColor, long numCluster=-1) const;
#endif
//! Shifts and scales to the data to have all the coordinates between 0.0 and 1000.0.
void NormalizeData();
//! Inverse the operations applied by NormalizeData().
void DenormalizeData();
//! Destructor.
~HACD(void);
private:
//! Constructor.
HACD(HeapManager * heapManager = 0);
//! Gives the edge index.
//! @param a first vertex id
//! @param b second vertex id
//! @return edge's index
static unsigned long long GetEdgeIndex(unsigned long long a, unsigned long long b)
{
if (a > b) return (a << 32) + b;
else return (b << 32) + a;
}
//! Computes the concavity of a cluster.
//! @param ch the cluster's convex-hull
//! @param distPoints the cluster's points
//! @return cluster's concavity
double Concavity(ICHull & ch, std::map<long, DPoint> & distPoints);
//! Computes the perimeter of a cluster.
//! @param triIndices the cluster's triangles
//! @param distPoints the cluster's points
//! @return cluster's perimeter
double ComputePerimeter(const std::vector<long> & triIndices) const;
//! Creates the Graph by associating to each mesh triangle a vertex in the graph and to each couple of adjacent triangles an edge in the graph.
void CreateGraph();
//! Initializes the graph costs and computes the vertices normals
void InitializeDualGraph();
//! Computes the cost of an edge
//! @param e edge's id
void ComputeEdgeCost(size_t e);
//! Initializes the priority queue
//! @param fast specifies whether fast mode is used
//! @return true if success
bool InitializePriorityQueue();
//! Cleans the intersection between convex-hulls
void CleanClusters();
//! Computes convex-hulls from partition information
//! @param fullCH specifies whether to generate convex-hulls with a full or limited (i.e. < m_nVerticesPerCH) number of vertices
void ComputeConvexHulls(bool fullCH);
//! Simplifies the graph
//! @param fast specifies whether fast mode is used
void Simplify();
private:
Vec3<long> * m_trianglesDecimated; //>! pointer the triangles array
Vec3<Real> * m_pointsDecimated; //>! pointer the points array
Vec3<long> * m_triangles; //>! pointer the triangles array
Vec3<Real> * m_points; //>! pointer the points array
Vec3<Real> * m_facePoints; //>! pointer to the faces points array
Vec3<Real> * m_faceNormals; //>! pointer to the faces normals array
Vec3<Real> * m_normals; //>! pointer the normals array
Vec3<Real> * m_extraDistPoints; //>! pointer to the faces points array
Vec3<Real> * m_extraDistNormals; //>! pointer to the faces normals array
size_t m_nTrianglesDecimated; //>! number of triangles in the original mesh
size_t m_nPointsDecimated; //>! number of vertices in the original mesh
size_t m_nTriangles; //>! number of triangles in the original mesh
size_t m_nPoints; //>! number of vertices in the original mesh
size_t m_nClusters; //>! number of clusters
size_t m_nMinClusters; //>! minimum number of clusters
double m_ccConnectDist; //>! maximum allowed distance to connect CCs
double m_concavity; //>! maximum concavity
double m_alpha; //>! compacity weigth
double m_beta; //>! volume weigth
double m_gamma; //>! computation cost
double m_diag; //>! length of the BB diagonal
double m_scale; //>! scale factor used for NormalizeData() and DenormalizeData()
double m_flatRegionThreshold; //>! threshhold to control the contirbution of flat regions concavity (default 1% of m_scale)
double m_smallClusterThreshold; //>! threshhold to detect small clusters (default 0.25% of the total mesh surface)
double m_area; //>! surface area
Vec3<Real> m_barycenter; //>! barycenter of the mesh
std::vector< long > m_cVertices; //>! array of vertices each belonging to a different cluster
ICHull * m_convexHulls; //>! convex-hulls associated with the final HACD clusters
Graph m_graph; //>! simplification graph
size_t m_nVerticesPerCH; //>! maximum number of vertices per convex-hull
reservable_priority_queue<GraphEdgePriorityQueue,
std::vector<GraphEdgePriorityQueue>,
std::greater<std::vector<GraphEdgePriorityQueue>::value_type> > m_pqueue; //!> priority queue
HACD(const HACD & rhs);
CallBackFunction m_callBack; //>! call-back function
long * m_partition; //>! array of size m_nTriangles where the i-th element specifies the cluster to which belong the i-th triangle
size_t m_targetNTrianglesDecimatedMesh; //>! specifies the target number of triangles in the decimated mesh. If set to 0 no decimation is applied.
HeapManager * m_heapManager; //>! Heap Manager
bool m_addFacesPoints; //>! specifies whether to add faces points or not
bool m_addExtraDistPoints; //>! specifies whether to add extra points for concave shapes or not
friend HACD * const CreateHACD(HeapManager * heapManager);
friend void DestroyHACD(HACD * const hacd);
};
inline HACD * const CreateHACD(HeapManager * heapManager)
{
return new HACD(heapManager);
}
inline void DestroyHACD(HACD * const hacd)
{
delete hacd;
}
}
#endif

1004
indra/libhacd/hacdICHull.cpp Normal file

File diff suppressed because it is too large Load Diff

133
indra/libhacd/hacdICHull.h Normal file
View File

@@ -0,0 +1,133 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_ICHULL_H
#define HACD_ICHULL_H
#include "hacdVersion.h"
#include "hacdManifoldMesh.h"
#include "hacdVector.h"
#include <vector>
#include <map>
#include "hacdMicroAllocator.h"
namespace HACD
{
class DPoint;
class HACD;
//! Incremental Convex Hull algorithm (cf. http://maven.smith.edu/~orourke/books/ftp.html ).
enum ICHullError
{
ICHullErrorOK = 0,
ICHullErrorCoplanarPoints,
ICHullErrorNoVolume,
ICHullErrorInconsistent,
ICHullErrorNotEnoughPoints
};
class ICHull
{
public:
static const double sc_eps;
//!
HeapManager * const GetHeapManager() const { return m_heapManager;}
//!
void SetHeapManager(HeapManager * const heapManager)
{
m_heapManager = heapManager;
m_mesh.SetHeapManager(m_heapManager);
}
//!
bool IsFlat() { return m_isFlat;}
//!
std::map<long, DPoint> * GetDistPoints() const { return m_distPoints;}
//!
void SetDistPoints(std::map<long, DPoint> * distPoints) { m_distPoints = distPoints;}
//! Returns the computed mesh
TMMesh & GetMesh() { return m_mesh;}
//! Add one point to the convex-hull
bool AddPoint(const Vec3<Real> & point) {return AddPoints(&point, 1);}
//! Add one point to the convex-hull
bool AddPoint(const Vec3<Real> & point, long id);
//! Add points to the convex-hull
bool AddPoints(const Vec3<Real> * points, size_t nPoints);
bool AddPoints(std::vector< Vec3<Real> > points);
//!
ICHullError Process();
//!
ICHullError Process(unsigned long nPointsCH);
//!
double ComputeVolume();
//!
double ComputeArea();
//!
bool IsInside(const Vec3<Real> & pt0, const double eps = 0.0);
//!
double ComputeDistance(long name, const Vec3<Real> & pt, const Vec3<Real> & normal, bool & insideHull, bool updateIncidentPoints);
//!
const ICHull & operator=(ICHull & rhs);
//! Constructor
ICHull(HeapManager * const heapManager=0);
//! Destructor
virtual ~ICHull(void) {};
private:
//! DoubleTriangle builds the initial double triangle. It first finds 3 noncollinear points and makes two faces out of them, in opposite order. It then finds a fourth point that is not coplanar with that face. The vertices are stored in the face structure in counterclockwise order so that the volume between the face and the point is negative. Lastly, the 3 newfaces to the fourth point are constructed and the data structures are cleaned up.
ICHullError DoubleTriangle();
//! MakeFace creates a new face structure from three vertices (in ccw order). It returns a pointer to the face.
CircularListElement<TMMTriangle> * MakeFace(CircularListElement<TMMVertex> * v0,
CircularListElement<TMMVertex> * v1,
CircularListElement<TMMVertex> * v2,
CircularListElement<TMMTriangle> * fold);
//!
CircularListElement<TMMTriangle> * MakeConeFace(CircularListElement<TMMEdge> * e, CircularListElement<TMMVertex> * v);
//!
bool ProcessPoint();
//!
bool ComputePointVolume(double &totalVolume, bool markVisibleFaces);
//!
bool FindMaxVolumePoint();
//!
bool CleanEdges();
//!
bool CleanVertices(unsigned long & addedPoints);
//!
bool CleanTriangles();
//!
bool CleanUp(unsigned long & addedPoints);
//!
bool MakeCCW(CircularListElement<TMMTriangle> * f,
CircularListElement<TMMEdge> * e,
CircularListElement<TMMVertex> * v);
void Clear();
private:
static const long sc_dummyIndex;
static const double sc_distMin;
TMMesh m_mesh;
std::vector<CircularListElement<TMMEdge> *> m_edgesToDelete;
std::vector<CircularListElement<TMMEdge> *> m_edgesToUpdate;
std::vector<CircularListElement<TMMTriangle> *> m_trianglesToDelete;
std::map<long, DPoint> * m_distPoints;
// CircularListElement<TMMVertex> * m_dummyVertex;
Vec3<Real> m_normal;
bool m_isFlat;
HeapManager * m_heapManager;
ICHull(const ICHull & rhs);
friend class HACD;
};
}
#endif

View File

@@ -0,0 +1,604 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#include "hacdManifoldMesh.h"
using namespace std;
namespace HACD
{
Material::Material(void)
{
m_diffuseColor.X() = 0.5;
m_diffuseColor.Y() = 0.5;
m_diffuseColor.Z() = 0.5;
m_specularColor.X() = 0.5;
m_specularColor.Y() = 0.5;
m_specularColor.Z() = 0.5;
m_ambientIntensity = 0.4;
m_emissiveColor.X() = 0.0;
m_emissiveColor.Y() = 0.0;
m_emissiveColor.Z() = 0.0;
m_shininess = 0.4;
m_transparency = 0.0;
}
TMMVertex::TMMVertex(void)
{
Initialize();
}
void TMMVertex::Initialize()
{
m_name = 0;
m_id = 0;
m_duplicate = 0;
m_onHull = false;
m_tag = false;
}
TMMVertex::~TMMVertex(void)
{
}
TMMEdge::TMMEdge(void)
{
Initialize();
}
void TMMEdge::Initialize()
{
m_id = 0;
m_triangles[0] = m_triangles[1] = m_newFace = 0;
m_vertices[0] = m_vertices[1] = 0;
}
TMMEdge::~TMMEdge(void)
{
}
void TMMTriangle::Initialize()
{
m_id = 0;
for(int i = 0; i < 3; i++)
{
m_edges[i] = 0;
m_vertices[0] = 0;
}
m_visible = false;
m_incidentPoints.Initialize();
}
TMMTriangle::TMMTriangle(void)
{
Initialize();
}
TMMTriangle::~TMMTriangle(void)
{
}
TMMesh::TMMesh(HeapManager * const heapManager):
m_vertices(heapManager),
m_edges(heapManager),
m_triangles(heapManager)
{
m_barycenter = Vec3<Real>(0,0,0);
m_diag = 1;
m_heapManager = heapManager;
}
TMMesh::~TMMesh(void)
{
}
void TMMesh::Print()
{
size_t nV = m_vertices.GetSize();
std::cout << "-----------------------------" << std::endl;
std::cout << "vertices (" << nV << ")" << std::endl;
for(size_t v = 0; v < nV; v++)
{
const TMMVertex & currentVertex = m_vertices.GetData();
std::cout << currentVertex.m_id << ", "
<< currentVertex.m_pos.X() << ", "
<< currentVertex.m_pos.Y() << ", "
<< currentVertex.m_pos.Z() << std::endl;
m_vertices.Next();
}
size_t nE = m_edges.GetSize();
std::cout << "edges (" << nE << ")" << std::endl;
for(size_t e = 0; e < nE; e++)
{
const TMMEdge & currentEdge = m_edges.GetData();
const CircularListElement<TMMVertex> * v0 = currentEdge.m_vertices[0];
const CircularListElement<TMMVertex> * v1 = currentEdge.m_vertices[1];
const CircularListElement<TMMTriangle> * f0 = currentEdge.m_triangles[0];
const CircularListElement<TMMTriangle> * f1 = currentEdge.m_triangles[1];
std::cout << "-> (" << v0->GetData().m_name << ", " << v1->GetData().m_name << ")" << std::endl;
std::cout << "-> F0 (" << f0->GetData().m_vertices[0]->GetData().m_name << ", "
<< f0->GetData().m_vertices[1]->GetData().m_name << ", "
<< f0->GetData().m_vertices[2]->GetData().m_name <<")" << std::endl;
std::cout << "-> F1 (" << f1->GetData().m_vertices[0]->GetData().m_name << ", "
<< f1->GetData().m_vertices[1]->GetData().m_name << ", "
<< f1->GetData().m_vertices[2]->GetData().m_name << ")" << std::endl;
m_edges.Next();
}
size_t nT = m_triangles.GetSize();
std::cout << "triangles (" << nT << ")" << std::endl;
for(size_t t = 0; t < nT; t++)
{
const TMMTriangle & currentTriangle = m_triangles.GetData();
const CircularListElement<TMMVertex> * v0 = currentTriangle.m_vertices[0];
const CircularListElement<TMMVertex> * v1 = currentTriangle.m_vertices[1];
const CircularListElement<TMMVertex> * v2 = currentTriangle.m_vertices[2];
const CircularListElement<TMMEdge> * e0 = currentTriangle.m_edges[0];
const CircularListElement<TMMEdge> * e1 = currentTriangle.m_edges[1];
const CircularListElement<TMMEdge> * e2 = currentTriangle.m_edges[2];
std::cout << "-> (" << v0->GetData().m_name << ", " << v1->GetData().m_name << ", "<< v2->GetData().m_name << ")" << std::endl;
std::cout << "-> E0 (" << e0->GetData().m_vertices[0]->GetData().m_name << ", "
<< e0->GetData().m_vertices[1]->GetData().m_name << ")" << std::endl;
std::cout << "-> E1 (" << e1->GetData().m_vertices[0]->GetData().m_name << ", "
<< e1->GetData().m_vertices[1]->GetData().m_name << ")" << std::endl;
std::cout << "-> E2 (" << e2->GetData().m_vertices[0]->GetData().m_name << ", "
<< e2->GetData().m_vertices[1]->GetData().m_name << ")" << std::endl;
m_triangles.Next();
}
}
#if 0
bool TMMesh::Save(const char *fileName)
{
std::ofstream fout(fileName);
std::cout << "Saving " << fileName << std::endl;
if (SaveVRML2(fout))
{
fout.close();
return true;
}
return false;
}
bool TMMesh::SaveVRML2(std::ofstream &fout)
{
return SaveVRML2(fout, Material());
}
bool TMMesh::SaveVRML2(std::ofstream &fout, const Material & material)
{
if (fout.is_open())
{
size_t nV = m_vertices.GetSize();
size_t nT = m_triangles.GetSize();
fout <<"#VRML V2.0 utf8" << std::endl;
fout <<"" << std::endl;
fout <<"# Vertices: " << nV << std::endl;
fout <<"# Triangles: " << nT << std::endl;
fout <<"" << std::endl;
fout <<"Group {" << std::endl;
fout <<" children [" << std::endl;
fout <<" Shape {" << std::endl;
fout <<" appearance Appearance {" << std::endl;
fout <<" material Material {" << std::endl;
fout <<" diffuseColor " << material.m_diffuseColor.X() << " "
<< material.m_diffuseColor.Y() << " "
<< material.m_diffuseColor.Z() << std::endl;
fout <<" ambientIntensity " << material.m_ambientIntensity << std::endl;
fout <<" specularColor " << material.m_specularColor.X() << " "
<< material.m_specularColor.Y() << " "
<< material.m_specularColor.Z() << std::endl;
fout <<" emissiveColor " << material.m_emissiveColor.X() << " "
<< material.m_emissiveColor.Y() << " "
<< material.m_emissiveColor.Z() << std::endl;
fout <<" shininess " << material.m_shininess << std::endl;
fout <<" transparency " << material.m_transparency << std::endl;
fout <<" }" << std::endl;
fout <<" }" << std::endl;
fout <<" geometry IndexedFaceSet {" << std::endl;
fout <<" ccw TRUE" << std::endl;
fout <<" solid TRUE" << std::endl;
fout <<" convex TRUE" << std::endl;
if (GetNVertices() > 0) {
fout <<" coord DEF co Coordinate {" << std::endl;
fout <<" point [" << std::endl;
for(size_t v = 0; v < nV; v++)
{
TMMVertex & currentVertex = m_vertices.GetData();
fout <<" " << currentVertex.m_pos.X() << " "
<< currentVertex.m_pos.Y() << " "
<< currentVertex.m_pos.Z() << "," << std::endl;
currentVertex.m_id = v;
m_vertices.Next();
}
fout <<" ]" << std::endl;
fout <<" }" << std::endl;
}
if (GetNTriangles() > 0) {
fout <<" coordIndex [ " << std::endl;
for(size_t f = 0; f < nT; f++)
{
TMMTriangle & currentTriangle = m_triangles.GetData();
fout <<" " << currentTriangle.m_vertices[0]->GetData().m_id << ", "
<< currentTriangle.m_vertices[1]->GetData().m_id << ", "
<< currentTriangle.m_vertices[2]->GetData().m_id << ", -1," << std::endl;
m_triangles.Next();
}
fout <<" ]" << std::endl;
}
fout <<" }" << std::endl;
fout <<" }" << std::endl;
fout <<" ]" << std::endl;
fout <<"}" << std::endl;
}
return true;
}
#endif
void TMMesh::GetIFS(Vec3<Real> * const points, Vec3<long> * const triangles)
{
size_t nV = m_vertices.GetSize();
size_t nT = m_triangles.GetSize();
for(size_t v = 0; v < nV; v++)
{
points[v] = m_vertices.GetData().m_pos;
m_vertices.GetData().m_id = v;
m_vertices.Next();
}
for(size_t f = 0; f < nT; f++)
{
TMMTriangle & currentTriangle = m_triangles.GetData();
triangles[f].X() = static_cast<long>(currentTriangle.m_vertices[0]->GetData().m_id);
triangles[f].Y() = static_cast<long>(currentTriangle.m_vertices[1]->GetData().m_id);
triangles[f].Z() = static_cast<long>(currentTriangle.m_vertices[2]->GetData().m_id);
m_triangles.Next();
}
}
void TMMesh::Clear()
{
m_vertices.Clear();
m_edges.Clear();
m_triangles.Clear();
}
void TMMesh::Copy(TMMesh & mesh)
{
Clear();
// updating the id's
size_t nV = mesh.m_vertices.GetSize();
size_t nE = mesh. m_edges.GetSize();
size_t nT = mesh.m_triangles.GetSize();
for(size_t v = 0; v < nV; v++)
{
mesh.m_vertices.GetData().m_id = v;
mesh.m_vertices.Next();
}
for(size_t e = 0; e < nE; e++)
{
mesh.m_edges.GetData().m_id = e;
mesh.m_edges.Next();
}
for(size_t f = 0; f < nT; f++)
{
mesh.m_triangles.GetData().m_id = f;
mesh.m_triangles.Next();
}
// copying data
m_vertices = mesh.m_vertices;
m_edges = mesh.m_edges;
m_triangles = mesh.m_triangles;
m_heapManager = mesh.m_heapManager;
// generating mapping
CircularListElement<TMMVertex> ** vertexMap = new CircularListElement<TMMVertex> * [nV];
CircularListElement<TMMEdge> ** edgeMap = new CircularListElement<TMMEdge> * [nE];
CircularListElement<TMMTriangle> ** triangleMap = new CircularListElement<TMMTriangle> * [nT];
for(size_t v = 0; v < nV; v++)
{
vertexMap[v] = m_vertices.GetHead();
m_vertices.Next();
}
for(size_t e = 0; e < nE; e++)
{
edgeMap[e] = m_edges.GetHead();
m_edges.Next();
}
for(size_t f = 0; f < nT; f++)
{
triangleMap[f] = m_triangles.GetHead();
m_triangles.Next();
}
// updating pointers
for(size_t v = 0; v < nV; v++)
{
if (vertexMap[v]->GetData().m_duplicate)
{
vertexMap[v]->GetData().m_duplicate = edgeMap[vertexMap[v]->GetData().m_duplicate->GetData().m_id];
}
}
for(size_t e = 0; e < nE; e++)
{
if (edgeMap[e]->GetData().m_newFace)
{
edgeMap[e]->GetData().m_newFace = triangleMap[edgeMap[e]->GetData().m_newFace->GetData().m_id];
}
if (nT > 0)
{
for(int f = 0; f < 2; f++)
{
if (edgeMap[e]->GetData().m_triangles[f])
{
edgeMap[e]->GetData().m_triangles[f] = triangleMap[edgeMap[e]->GetData().m_triangles[f]->GetData().m_id];
}
}
}
for(int v = 0; v < 2; v++)
{
if (edgeMap[e]->GetData().m_vertices[v])
{
edgeMap[e]->GetData().m_vertices[v] = vertexMap[edgeMap[e]->GetData().m_vertices[v]->GetData().m_id];
}
}
}
for(size_t f = 0; f < nT; f++)
{
if (nE > 0)
{
for(int e = 0; e < 3; e++)
{
if (triangleMap[f]->GetData().m_edges[e])
{
triangleMap[f]->GetData().m_edges[e] = edgeMap[triangleMap[f]->GetData().m_edges[e]->GetData().m_id];
}
}
}
for(int v = 0; v < 3; v++)
{
if (triangleMap[f]->GetData().m_vertices[v])
{
triangleMap[f]->GetData().m_vertices[v] = vertexMap[triangleMap[f]->GetData().m_vertices[v]->GetData().m_id];
}
}
}
delete [] vertexMap;
delete [] edgeMap;
delete [] triangleMap;
}
long IntersectRayTriangle(const Vec3<double> & P0, const Vec3<double> & dir,
const Vec3<double> & V0, const Vec3<double> & V1,
const Vec3<double> & V2, double &t)
{
const double EPS = 1e-9;
const double EPS1 = 1e-6;
t = 0.0;
Vec3<double> edge1, edge2, edge3;
double det;
edge1 = V1 - V2;
edge2 = V2 - V0;
Vec3<double> pvec = dir ^ edge2;
det = edge1 * pvec;
if (det < EPS && det > -EPS)
return 0;
Vec3<double> tvec = P0 - V0;
Vec3<double> qvec = tvec ^ edge1;
t = (edge2 * qvec) / det;
if (t < 0.0)
{
return 0;
}
edge3 = V0 - V1;
Vec3<double> I(P0 + t * dir);
Vec3<double> s0 = (I-V0) ^ edge3;
Vec3<double> s1 = (I-V1) ^ edge1;
Vec3<double> s2 = (I-V2) ^ edge2;
Vec3<double> normal = edge1 ^ edge2;
double diff = normal.GetNorm() - s0.GetNorm() - s1.GetNorm() - s2.GetNorm();
if (diff < EPS1 && diff > -EPS1)
{
return 1;
}
return 0;
}
bool IntersectLineLine(const Vec3<double> & p1, const Vec3<double> & p2,
const Vec3<double> & p3, const Vec3<double> & p4,
Vec3<double> & pa, Vec3<double> & pb,
double & mua, double & mub)
{
Vec3<double> p13,p43,p21;
double d1343,d4321,d1321,d4343,d2121;
double numer,denom;
p13.X() = p1.X() - p3.X();
p13.Y() = p1.Y() - p3.Y();
p13.Z() = p1.Z() - p3.Z();
p43.X() = p4.X() - p3.X();
p43.Y() = p4.Y() - p3.Y();
p43.Z() = p4.Z() - p3.Z();
if (p43.X()==0.0 && p43.Y()==0.0 && p43.Z()==0.0)
return false;
p21.X() = p2.X() - p1.X();
p21.Y() = p2.Y() - p1.Y();
p21.Z() = p2.Z() - p1.Z();
if (p21.X()==0.0 && p21.Y()==0.0 && p21.Z()==0.0)
return false;
d1343 = p13.X() * p43.X() + p13.Y() * p43.Y() + p13.Z() * p43.Z();
d4321 = p43.X() * p21.X() + p43.Y() * p21.Y() + p43.Z() * p21.Z();
d1321 = p13.X() * p21.X() + p13.Y() * p21.Y() + p13.Z() * p21.Z();
d4343 = p43.X() * p43.X() + p43.Y() * p43.Y() + p43.Z() * p43.Z();
d2121 = p21.X() * p21.X() + p21.Y() * p21.Y() + p21.Z() * p21.Z();
denom = d2121 * d4343 - d4321 * d4321;
if (denom==0.0)
return false;
numer = d1343 * d4321 - d1321 * d4343;
mua = numer / denom;
mub = (d1343 + d4321 * (mua)) / d4343;
pa.X() = p1.X() + mua * p21.X();
pa.Y() = p1.Y() + mua * p21.Y();
pa.Z() = p1.Z() + mua * p21.Z();
pb.X() = p3.X() + mub * p43.X();
pb.Y() = p3.Y() + mub * p43.Y();
pb.Z() = p3.Z() + mub * p43.Z();
return true;
}
long IntersectRayTriangle2(const Vec3<double> & P0, const Vec3<double> & dir,
const Vec3<double> & V0, const Vec3<double> & V1,
const Vec3<double> & V2, double &r)
{
Vec3<double> u, v, n; // triangle vectors
Vec3<double> w0, w; // ray vectors
double a, b; // params to calc ray-plane intersect
// get triangle edge vectors and plane normal
u = V1 - V0;
v = V2 - V0;
n = u ^ v; // cross product
if (n.GetNorm() == 0.0) // triangle is degenerate
return -1; // do not deal with this case
w0 = P0 - V0;
a = - n * w0;
b = n * dir;
if (fabs(b) <= 0.0) { // ray is parallel to triangle plane
if (a == 0.0) // ray lies in triangle plane
return 2;
else return 0; // ray disjoint from plane
}
// get intersect point of ray with triangle plane
r = a / b;
if (r < 0.0) // ray goes away from triangle
return 0; // => no intersect
// for a segment, also test if (r > 1.0) => no intersect
Vec3<double> I = P0 + r * dir; // intersect point of ray and plane
// is I inside T?
double uu, uv, vv, wu, wv, D;
uu = u * u;
uv = u * v;
vv = v * v;
w = I - V0;
wu = w * u;
wv = w * v;
D = uv * uv - uu * vv;
// get and test parametric coords
double s, t;
s = (uv * wv - vv * wu) / D;
if (s < 0.0 || s > 1.0) // I is outside T
return 0;
t = (uv * wu - uu * wv) / D;
if (t < 0.0 || (s + t) > 1.0) // I is outside T
return 0;
return 1; // I is in T
}
bool TMMesh::CheckConsistancy()
{
size_t nE = m_edges.GetSize();
size_t nT = m_triangles.GetSize();
for(size_t e = 0; e < nE; e++)
{
for(int f = 0; f < 2; f++)
{
if (!m_edges.GetHead()->GetData().m_triangles[f])
{
return false;
}
}
m_edges.Next();
}
for(size_t f = 0; f < nT; f++)
{
for(int e = 0; e < 3; e++)
{
int found = 0;
for(int k = 0; k < 2; k++)
{
if (m_triangles.GetHead()->GetData().m_edges[e]->GetData().m_triangles[k] == m_triangles.GetHead())
{
found++;
}
}
if (found != 1)
{
return false;
}
}
m_triangles.Next();
}
return true;
}
bool TMMesh::Normalize()
{
size_t nV = m_vertices.GetSize();
if (nV == 0)
{
return false;
}
m_barycenter = m_vertices.GetHead()->GetData().m_pos;
Vec3<Real> min = m_barycenter;
Vec3<Real> max = m_barycenter;
Real x, y, z;
for(size_t v = 1; v < nV; v++)
{
m_barycenter += m_vertices.GetHead()->GetData().m_pos;
x = m_vertices.GetHead()->GetData().m_pos.X();
y = m_vertices.GetHead()->GetData().m_pos.Y();
z = m_vertices.GetHead()->GetData().m_pos.Z();
if ( x < min.X()) min.X() = x;
else if ( x > max.X()) max.X() = x;
if ( y < min.Y()) min.Y() = y;
else if ( y > max.Y()) max.Y() = y;
if ( z < min.Z()) min.Z() = z;
else if ( z > max.Z()) max.Z() = z;
m_vertices.Next();
}
m_barycenter /= static_cast<Real>(nV);
m_diag = static_cast<Real>(0.001 * (max-min).GetNorm());
const Real invDiag = static_cast<Real>(1.0 / m_diag);
if (m_diag != 0.0)
{
for(size_t v = 0; v < nV; v++)
{
m_vertices.GetHead()->GetData().m_pos = (m_vertices.GetHead()->GetData().m_pos - m_barycenter) * invDiag;
m_vertices.Next();
}
}
return true;
}
bool TMMesh::Denormalize()
{
size_t nV = m_vertices.GetSize();
if (nV == 0)
{
return false;
}
if (m_diag != 0.0)
{
for(size_t v = 0; v < nV; v++)
{
m_vertices.GetHead()->GetData().m_pos = m_vertices.GetHead()->GetData().m_pos * m_diag + m_barycenter;
m_vertices.Next();
}
}
return false;
}
}

View File

@@ -0,0 +1,269 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_MANIFOLD_MESH_H
#define HACD_MANIFOLD_MESH_H
#include <iostream>
#include <fstream>
#include "hacdVersion.h"
#include "hacdCircularList.h"
#include "hacdVector.h"
#include "hacdSArray.h"
#include <set>
#include "hacdMicroAllocator.h"
namespace HACD
{
class TMMTriangle;
class TMMEdge;
class TMMesh;
class ICHull;
class HACD;
class DPoint
{
public:
DPoint(long name=0, Real dist=0, bool computed=false, bool distOnly=false)
:m_name(name),
m_dist(dist),
m_computed(computed),
m_distOnly(distOnly){};
~DPoint(){};
private:
long m_name;
Real m_dist;
bool m_computed;
bool m_distOnly;
friend class TMMTriangle;
friend class TMMesh;
friend class GraphVertex;
friend class GraphEdge;
friend class Graph;
friend class ICHull;
friend class HACD;
};
//! Vertex data structure used in a triangular manifold mesh (TMM).
class TMMVertex
{
public:
void Initialize();
TMMVertex(void);
~TMMVertex(void);
private:
Vec3<Real> m_pos;
long m_name;
size_t m_id;
CircularListElement<TMMEdge> * m_duplicate; // pointer to incident cone edge (or NULL)
bool m_onHull;
bool m_tag;
TMMVertex(const TMMVertex & rhs);
friend class HACD;
friend class ICHull;
friend class TMMesh;
friend class TMMTriangle;
friend class TMMEdge;
};
//! Edge data structure used in a triangular manifold mesh (TMM).
class TMMEdge
{
public:
void Initialize();
TMMEdge(void);
~TMMEdge(void);
private:
size_t m_id;
CircularListElement<TMMTriangle> * m_triangles[2];
CircularListElement<TMMVertex> * m_vertices[2];
CircularListElement<TMMTriangle> * m_newFace;
TMMEdge(const TMMEdge & rhs);
friend class HACD;
friend class ICHull;
friend class TMMTriangle;
friend class TMMVertex;
friend class TMMesh;
};
//! Triangle data structure used in a triangular manifold mesh (TMM).
class TMMTriangle
{
public:
void Initialize();
TMMTriangle(void);
~TMMTriangle(void);
private:
size_t m_id;
CircularListElement<TMMEdge> * m_edges[3];
CircularListElement<TMMVertex> * m_vertices[3];
SArray<long, SARRAY_DEFAULT_MIN_SIZE> m_incidentPoints;
bool m_visible;
TMMTriangle(const TMMTriangle & rhs);
friend class HACD;
friend class ICHull;
friend class TMMesh;
friend class TMMVertex;
friend class TMMEdge;
};
class Material
{
public:
Material(void);
~Material(void){}
// private:
Vec3<double> m_diffuseColor;
double m_ambientIntensity;
Vec3<double> m_specularColor;
Vec3<double> m_emissiveColor;
double m_shininess;
double m_transparency;
friend class TMMesh;
friend class HACD;
};
//! triangular manifold mesh data structure.
class TMMesh
{
public:
//!
HeapManager * const GetHeapManager() const { return m_heapManager;}
//!
void SetHeapManager(HeapManager * const heapManager)
{
m_heapManager = heapManager;
m_vertices.SetHeapManager(m_heapManager);
m_edges.SetHeapManager(m_heapManager);
m_triangles.SetHeapManager(m_heapManager);
}
//! Returns the number of vertices>
inline size_t GetNVertices() const { return m_vertices.GetSize();}
//! Returns the number of edges
inline size_t GetNEdges() const { return m_edges.GetSize();}
//! Returns the number of triangles
inline size_t GetNTriangles() const { return m_triangles.GetSize();}
//! Returns the vertices circular list
inline const CircularList<TMMVertex> & GetVertices() const { return m_vertices;}
//! Returns the edges circular list
inline const CircularList<TMMEdge> & GetEdges() const { return m_edges;}
//! Returns the triangles circular list
inline const CircularList<TMMTriangle> & GetTriangles() const { return m_triangles;}
//! Returns the vertices circular list
inline CircularList<TMMVertex> & GetVertices() { return m_vertices;}
//! Returns the edges circular list
inline CircularList<TMMEdge> & GetEdges() { return m_edges;}
//! Returns the triangles circular list
inline CircularList<TMMTriangle> & GetTriangles() { return m_triangles;}
//! Add vertex to the mesh
CircularListElement<TMMVertex> * AddVertex() {return m_vertices.Add();}
//! Add vertex to the mesh
CircularListElement<TMMEdge> * AddEdge() {return m_edges.Add();}
//! Add vertex to the mesh
CircularListElement<TMMTriangle> * AddTriangle() {return m_triangles.Add();}
//! Print mesh information
void Print();
//!
void GetIFS(Vec3<Real> * const points, Vec3<long> * const triangles);
#if 0
//! Save mesh
bool Save(const char *fileName);
//! Save mesh to VRML 2.0 format
bool SaveVRML2(std::ofstream &fout);
//! Save mesh to VRML 2.0 format
bool SaveVRML2(std::ofstream &fout, const Material & material);
#endif
//!
void Clear();
//!
void Copy(TMMesh & mesh);
//!
bool CheckConsistancy();
//!
bool Normalize();
//!
bool Denormalize();
//! Constructor
TMMesh(HeapManager * const heapManager);
//! Destructor
virtual ~TMMesh(void);
private:
CircularList<TMMVertex> m_vertices;
CircularList<TMMEdge> m_edges;
CircularList<TMMTriangle> m_triangles;
Real m_diag; //>! length of the BB diagonal
Vec3<Real> m_barycenter; //>! barycenter of the mesh
HeapManager * m_heapManager;
// not defined
TMMesh(const TMMesh & rhs);
friend class ICHull;
friend class HACD;
};
//! IntersectRayTriangle(): intersect a ray with a 3D triangle
//! Input: a ray R, and a triangle T
//! Output: *I = intersection point (when it exists)
//! 0 = disjoint (no intersect)
//! 1 = intersect in unique point I1
long IntersectRayTriangle( const Vec3<double> & P0, const Vec3<double> & dir,
const Vec3<double> & V0, const Vec3<double> & V1,
const Vec3<double> & V2, double &t);
// intersect_RayTriangle(): intersect a ray with a 3D triangle
// Input: a ray R, and a triangle T
// Output: *I = intersection point (when it exists)
// Return: -1 = triangle is degenerate (a segment or point)
// 0 = disjoint (no intersect)
// 1 = intersect in unique point I1
// 2 = are in the same plane
long IntersectRayTriangle2(const Vec3<double> & P0, const Vec3<double> & dir,
const Vec3<double> & V0, const Vec3<double> & V1,
const Vec3<double> & V2, double &r);
/*
Calculate the line segment PaPb that is the shortest route between
two lines P1P2 and P3P4. Calculate also the values of mua and mub where
Pa = P1 + mua (P2 - P1)
Pb = P3 + mub (P4 - P3)
Return FALSE if no solution exists.
*/
bool IntersectLineLine(const Vec3<double> & p1, const Vec3<double> & p2,
const Vec3<double> & p3, const Vec3<double> & p4,
Vec3<double> & pa, Vec3<double> & pb,
double & mua, double &mub);
}
#endif

View File

@@ -0,0 +1,684 @@
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include "hacdMeshDecimator.h"
namespace HACD
{
MeshDecimator::MeshDecimator(void)
{
m_triangles = 0;
m_points = 0;
m_nPoints = 0;
m_nInitialTriangles = 0;
m_nVertices = 0;
m_nTriangles = 0;
m_nEdges = 0;
m_trianglesTags = 0;
m_ecolManifoldConstraint = true;
m_callBack = 0;
}
MeshDecimator::~MeshDecimator(void)
{
ReleaseMemory();
}
void MeshDecimator::ReleaseMemory()
{
delete [] m_trianglesTags;
std::vector< MDVertex > emptyVertices(0);
m_vertices.swap(emptyVertices);
std::vector<MDEdge> emptyEdges(0);
m_edges.swap(emptyEdges);
m_pqueue = std::priority_queue<
MDEdgePriorityQueue,
std::vector<MDEdgePriorityQueue>,
std::less<MDEdgePriorityQueue> >();
m_triangles = 0;
m_points = 0;
m_nPoints = 0;
m_nInitialTriangles = 0;
m_nVertices = 0;
m_nTriangles = 0;
m_nEdges = 0;
m_trianglesTags = 0;
}
void MeshDecimator::Initialize(size_t nVertices, size_t nTriangles, Vec3<Float> * points, Vec3<long> * triangles)
{
m_nVertices = nVertices;
m_nTriangles = nTriangles;
m_nInitialTriangles = nTriangles;
m_points = points;
m_nPoints = nVertices;
m_triangles = triangles;
m_trianglesTags = new bool[m_nTriangles];
m_edges.reserve(3*m_nTriangles);
m_vertices.resize(m_nVertices);
for(size_t v = 0; v < m_nVertices; ++v)
{
m_vertices[v].m_tag = true;
}
long tri[3];
MDEdge edge;
edge.m_tag = true;
edge.m_onBoundary = true;
long nEdges = 0;
long idEdge;
long nTris = static_cast<long>(m_nTriangles);
for(long t = 0; t < nTris; ++t)
{
tri[0] = m_triangles[t].X();
tri[1] = m_triangles[t].Y();
tri[2] = m_triangles[t].Z();
m_trianglesTags[t] = true;
for(int k = 0; k < 3; ++k)
{
edge.m_v1 = tri[k];
edge.m_v2 = tri[(k+1)%3];
m_vertices[edge.m_v1].m_triangles.Insert(t);
idEdge = GetEdge(edge.m_v1, edge.m_v2);
if (idEdge == -1)
{
m_edges.push_back(edge);
m_vertices[edge.m_v1].m_edges.Insert(nEdges);
m_vertices[edge.m_v2].m_edges.Insert(nEdges);
++nEdges;
}
else
{
m_edges[idEdge].m_onBoundary = false;
}
}
}
m_nEdges = static_cast<size_t>(nEdges);
for(size_t v = 0; v < m_nVertices; ++v)
{
m_vertices[v].m_onBoundary = false;
for(size_t itE = 0; itE < m_vertices[v].m_edges.Size(); ++itE)
{
idEdge = m_vertices[v].m_edges[itE];
if (m_edges[idEdge].m_onBoundary)
{
m_vertices[v].m_onBoundary = true;
break;
}
}
}
}
long MeshDecimator::GetTriangle(long v1, long v2, long v3) const
{
long i, j, k;
long idTriangle;
for(size_t it = 0; it < m_vertices[v1].m_triangles.Size(); ++it)
{
idTriangle = m_vertices[v1].m_triangles[it];
i = m_triangles[idTriangle].X();
j = m_triangles[idTriangle].Y();
k = m_triangles[idTriangle].Z();
if ( (i==v1 && j==v2 && k==v3) || (i==v1 && j==v3 && k==v2) ||
(i==v2 && j==v1 && k==v3) || (i==v2 && j==v3 && k==v1) ||
(i==v3 && j==v2 && k==v1) || (i==v3 && j==v1 && k==v2) )
{
return idTriangle;
}
}
return -1;
}
long MeshDecimator::GetEdge(long v1, long v2) const
{
long idEdge;
for(size_t it = 0; it < m_vertices[v1].m_edges.Size(); ++it)
{
idEdge = m_vertices[v1].m_edges[it];
if ( (m_edges[idEdge].m_v1==v1 && m_edges[idEdge].m_v2==v2) ||
(m_edges[idEdge].m_v1==v2 && m_edges[idEdge].m_v2==v1) )
{
return idEdge;
}
}
return -1;
}
void MeshDecimator::EdgeCollapse(long v1, long v2)
{
long u, w;
int shift;
long idTriangle;
for(size_t itT = 0; itT < m_vertices[v2].m_triangles.Size(); ++itT)
{
idTriangle = m_vertices[v2].m_triangles[itT];
if (m_triangles[idTriangle].X() == v2)
{
shift = 0;
u = m_triangles[idTriangle].Y();
w = m_triangles[idTriangle].Z();
}
else if (m_triangles[idTriangle].Y() == v2)
{
shift = 1;
u = m_triangles[idTriangle].X();
w = m_triangles[idTriangle].Z();
}
else
{
shift = 2;
u = m_triangles[idTriangle].X();
w = m_triangles[idTriangle].Y();
}
if ((u == v1) || (w == v1))
{
m_trianglesTags[idTriangle] = false;
m_vertices[u].m_triangles.Erase(idTriangle);
m_vertices[w].m_triangles.Erase(idTriangle);
m_nTriangles--;
}
else if (GetTriangle(v1, u, w) == -1)
{
m_vertices[v1].m_triangles.Insert(idTriangle);
m_triangles[idTriangle][shift] = v1;
}
else
{
m_trianglesTags[idTriangle] = false;
m_vertices[u].m_triangles.Erase(idTriangle);
m_vertices[w].m_triangles.Erase(idTriangle);
m_nTriangles--;
}
}
long idEdge = 0;
for(size_t itE = 0; itE < m_vertices[v2].m_edges.Size(); ++itE)
{
idEdge = m_vertices[v2].m_edges[itE];
w = (m_edges[idEdge].m_v1 == v2)? m_edges[idEdge].m_v2 : m_edges[idEdge].m_v1;
if (w==v1)
{
m_edges[idEdge].m_tag = false;
m_vertices[w].m_edges.Erase(idEdge);
m_nEdges--;
}
else if ( GetEdge(v1, w) == -1)
{
if (m_edges[idEdge].m_v1 == v2) m_edges[idEdge].m_v1 = v1;
else m_edges[idEdge].m_v2 = v1;
m_vertices[v1].m_edges.Insert(idEdge);
}
else
{
m_edges[idEdge].m_tag = false;
m_vertices[w].m_edges.Erase(idEdge);
m_nEdges--;
}
}
m_vertices[v2].m_tag = false;
m_nVertices--;
// update boundary edges
SArray<long, 64> incidentVertices;
incidentVertices.PushBack(v1);
for(size_t itE = 0; itE < m_vertices[v1].m_edges.Size(); ++itE)
{
incidentVertices.PushBack((m_edges[idEdge].m_v1!= v1)?m_edges[idEdge].m_v1:m_edges[idEdge].m_v2);
idEdge = m_vertices[v1].m_edges[itE];
m_edges[idEdge].m_onBoundary = (IsBoundaryEdge(m_edges[idEdge].m_v1, m_edges[idEdge].m_v2) != -1);
}
// update boundary vertices
long idVertex;
for(size_t itV = 0; itV < incidentVertices.Size(); ++itV)
{
idVertex = incidentVertices[itV];
m_vertices[idVertex].m_onBoundary = false;
for(size_t itE = 0; itE < m_vertices[idVertex].m_edges.Size(); ++itE)
{
idEdge = m_vertices[idVertex].m_edges[itE];
if (m_edges[idEdge].m_onBoundary)
{
m_vertices[idVertex].m_onBoundary = true;
break;
}
}
}
}
long MeshDecimator::IsBoundaryEdge(long v1, long v2) const
{
long commonTri = -1;
long itTriangle1, itTriangle2;
for(size_t itT1 = 0; itT1 < m_vertices[v1].m_triangles.Size(); ++itT1)
{
itTriangle1 = m_vertices[v1].m_triangles[itT1];
for(size_t itT2 = 0; itT2 < m_vertices[v2].m_triangles.Size(); ++itT2)
{
itTriangle2 = m_vertices[v2].m_triangles[itT2];
if (itTriangle1 == itTriangle2)
{
if (commonTri == -1)
{
commonTri = itTriangle1;
}
else
{
return -1;
}
}
}
}
return commonTri;
}
bool MeshDecimator::IsBoundaryVertex(long v) const
{
long idEdge;
for(size_t itE = 0; itE < m_vertices[v].m_edges.Size(); ++itE)
{
idEdge = m_vertices[v].m_edges[itE];
if ( IsBoundaryEdge(m_edges[idEdge].m_v1, m_edges[idEdge].m_v2) != -1) return true;
}
return false;
}
void MeshDecimator::GetMeshData(Vec3<Float> * points, Vec3<long> * triangles) const
{
long * map = new long [m_nPoints];
long counter = 0;
for (size_t v = 0; v < m_nPoints; ++v)
{
if ( m_vertices[v].m_tag )
{
points[counter] = m_points[v];
map[v] = counter++;
}
}
counter = 0;
for (size_t t = 0; t < m_nInitialTriangles; ++t)
{
if ( m_trianglesTags[t] )
{
triangles[counter].X() = map[m_triangles[t].X()];
triangles[counter].Y() = map[m_triangles[t].Y()];
triangles[counter].Z() = map[m_triangles[t].Z()];
counter++;
}
}
delete [] map;
}
void MeshDecimator::InitializeQEM()
{
Vec3<Float> coordMin = m_points[0];
Vec3<Float> coordMax = m_points[0];
Vec3<Float> coord;
for (size_t p = 1; p < m_nPoints ; ++p)
{
coord = m_points[p];
if (coordMin.X() > coord.X()) coordMin.X() = coord.X();
if (coordMin.Y() > coord.Y()) coordMin.Y() = coord.Y();
if (coordMin.Z() > coord.Z()) coordMin.Z() = coord.Z();
if (coordMax.X() < coord.X()) coordMax.X() = coord.X();
if (coordMax.Y() < coord.Y()) coordMax.Y() = coord.Y();
if (coordMax.Z() < coord.Z()) coordMax.Z() = coord.Z();
}
coordMax -= coordMin;
m_diagBB = coordMax.GetNorm();
long i, j, k;
Vec3<Float> n;
Float d = 0;
Float area = 0;
for(size_t v = 0; v < m_nPoints; ++v)
{
memset(m_vertices[v].m_Q, 0, 10 * sizeof(Float));
long idTriangle;
for(size_t itT = 0; itT < m_vertices[v].m_triangles.Size(); ++itT)
{
idTriangle = m_vertices[v].m_triangles[itT];
i = m_triangles[idTriangle].X();
j = m_triangles[idTriangle].Y();
k = m_triangles[idTriangle].Z();
n = (m_points[j] - m_points[i])^(m_points[k] - m_points[i]);
area = n.GetNorm();
n.Normalize();
d = - (m_points[v] * n);
m_vertices[v].m_Q[0] += area * (n.X() * n.X());
m_vertices[v].m_Q[1] += area * (n.X() * n.Y());
m_vertices[v].m_Q[2] += area * (n.X() * n.Z());
m_vertices[v].m_Q[3] += area * (n.X() * d);
m_vertices[v].m_Q[4] += area * (n.Y() * n.Y());
m_vertices[v].m_Q[5] += area * (n.Y() * n.Z());
m_vertices[v].m_Q[6] += area * (n.Y() * d);
m_vertices[v].m_Q[7] += area * (n.Z() * n.Z());
m_vertices[v].m_Q[8] += area * (n.Z() * d);
m_vertices[v].m_Q[9] += area * (d * d);
}
}
Vec3<Float> u1, u2;
const Float w = static_cast<Float>(1000);
long t, v1, v2, v3;
for(size_t e = 0; e < m_edges.size(); ++e)
{
v1 = m_edges[e].m_v1;
v2 = m_edges[e].m_v2;
t = IsBoundaryEdge(v1, v2);
if (t != -1)
{
if (m_triangles[t].X() != v1 && m_triangles[t].X() != v2) v3 = m_triangles[t].X();
else if (m_triangles[t].Y() != v1 && m_triangles[t].Y() != v2) v3 = m_triangles[t].Y();
else v3 = m_triangles[t].Z();
u1 = m_points[v2] - m_points[v1];
u2 = m_points[v3] - m_points[v1];
area = w * (u1^u2).GetNorm();
u1.Normalize();
n = u2 - (u2 * u1) * u1;
n.Normalize();
d = - (m_points[v1] * n);
m_vertices[v1].m_Q[0] += area * (n.X() * n.X());
m_vertices[v1].m_Q[1] += area * (n.X() * n.Y());
m_vertices[v1].m_Q[2] += area * (n.X() * n.Z());
m_vertices[v1].m_Q[3] += area * (n.X() * d);
m_vertices[v1].m_Q[4] += area * (n.Y() * n.Y());
m_vertices[v1].m_Q[5] += area * (n.Y() * n.Z());
m_vertices[v1].m_Q[6] += area * (n.Y() * d);
m_vertices[v1].m_Q[7] += area * (n.Z() * n.Z());
m_vertices[v1].m_Q[8] += area * (n.Z() * d);
m_vertices[v1].m_Q[9] += area * (d * d);
d = - (m_points[v2] * n);
m_vertices[v2].m_Q[0] += area * (n.X() * n.X());
m_vertices[v2].m_Q[1] += area * (n.X() * n.Y());
m_vertices[v2].m_Q[2] += area * (n.X() * n.Z());
m_vertices[v2].m_Q[3] += area * (n.X() * d);
m_vertices[v2].m_Q[4] += area * (n.Y() * n.Y());
m_vertices[v2].m_Q[5] += area * (n.Y() * n.Z());
m_vertices[v2].m_Q[6] += area * (n.Y() * d);
m_vertices[v2].m_Q[7] += area * (n.Z() * n.Z());
m_vertices[v2].m_Q[8] += area * (n.Z() * d);
m_vertices[v2].m_Q[9] += area * (d * d);
}
}
}
void MeshDecimator::InitializePriorityQueue()
{
double progressOld = -1.0;
double progress = 0.0;
char msg[1024];
double ptgStep = 1.0;
long v1, v2;
MDEdgePriorityQueue pqEdge;
size_t nE = m_edges.size();
for(size_t e = 0; e < nE; ++e)
{
progress = e * 100.0 / nE;
if (fabs(progress-progressOld) > ptgStep && m_callBack)
{
sprintf(msg, "%3.2f %% \t \t \r", progress);
(*m_callBack)(msg, progress, 0.0, m_nVertices);
progressOld = progress;
}
if (m_edges[e].m_tag)
{
v1 = m_edges[e].m_v1;
v2 = m_edges[e].m_v2;
if ( (!m_ecolManifoldConstraint) || (ManifoldConstraint(v1, v2)))
{
pqEdge.m_qem = m_edges[e].m_qem = ComputeEdgeCost(v1, v2, m_edges[e].m_pos);
pqEdge.m_name = static_cast<long>(e);
m_pqueue.push(pqEdge);
}
}
}
}
double MeshDecimator::ComputeEdgeCost(long v1, long v2, Vec3<Float> & newPos) const
{
double Q[10];
double M[12];
Vec3<double> pos;
for(int i = 0; i < 10; ++i) Q[i] = m_vertices[v1].m_Q[i] + m_vertices[v2].m_Q[i];
M[0] = Q[0]; // (0, 0)
M[1] = Q[1]; // (0, 1)
M[2] = Q[2]; // (0, 2)
M[3] = Q[3]; // (0, 3)
M[4] = Q[1]; // (1, 0)
M[5] = Q[4]; // (1, 1)
M[6] = Q[5]; // (1, 2)
M[7] = Q[6]; // (1, 3)
M[8] = Q[2]; // (2, 0)
M[9] = Q[5]; // (2, 1)
M[10] = Q[7]; // (2, 2);
M[11] = Q[8]; // (2, 3);
double det = M[0] * M[5] * M[10] + M[1] * M[6] * M[8] + M[2] * M[4] * M[9]
- M[0] * M[6] * M[9] - M[1] * M[4] * M[10]- M[2] * M[5] * M[8];
if (det != 0.0)
{
double d = 1.0 / det;
pos.X() = d * (M[1]*M[7]*M[10] + M[2]*M[5]*M[11] + M[3]*M[6]*M[9]
-M[1]*M[6]*M[11] - M[2]*M[7]*M[9] - M[3]*M[5]*M[10]);
pos.Y() = d * (M[0]*M[6]*M[11] + M[2]*M[7]*M[8] + M[3]*M[4]*M[10]
-M[0]*M[7]*M[10] - M[2]*M[4]*M[11] - M[3]*M[6]*M[8]);
pos.Z() = d * (M[0]*M[7]*M[9] + M[1]*M[4]*M[11] + M[3]*M[5]*M[8]
-M[0]*M[5]*M[11] - M[1]*M[7]*M[8] - M[3]*M[4]*M[9]);
newPos.X() = static_cast<Float>(pos.X());
newPos.Y() = static_cast<Float>(pos.Y());
newPos.Z() = static_cast<Float>(pos.Z());
}
else
{
const Float w = static_cast<Float>(0.5f);
newPos = w * m_points[v1] + w * m_points[v2];
pos.X() = static_cast<double>(newPos.X());
pos.Y() = static_cast<double>(newPos.Y());
pos.Z() = static_cast<double>(newPos.Z());
}
double qem = pos.X() * (Q[0] * pos.X() + Q[1] * pos.Y() + Q[2] * pos.Z() + Q[3]) +
pos.Y() * (Q[1] * pos.X() + Q[4] * pos.Y() + Q[5] * pos.Z() + Q[6]) +
pos.Z() * (Q[2] * pos.X() + Q[5] * pos.Y() + Q[7] * pos.Z() + Q[8]) +
(Q[3] * pos.X() + Q[6] * pos.Y() + Q[8] * pos.Z() + Q[9]) ;
Vec3<Float> d1;
Vec3<Float> d2;
Vec3<Float> n1;
Vec3<Float> n2;
Vec3<Float> oldPosV1 = m_points[v1];
Vec3<Float> oldPosV2 = m_points[v2];
SArray<long, SARRAY_DEFAULT_MIN_SIZE> triangles = m_vertices[v1].m_triangles;
long idTriangle;
for(size_t itT = 0; itT < m_vertices[v2].m_triangles.Size(); ++itT)
{
idTriangle = m_vertices[v2].m_triangles[itT];
triangles.Insert(idTriangle);
}
long a[3];
for(size_t itT = 0; itT != triangles.Size(); ++itT)
{
idTriangle = triangles[itT];
a[0] = m_triangles[idTriangle].X();
a[1] = m_triangles[idTriangle].Y();
a[2] = m_triangles[idTriangle].Z();
d1 = m_points[a[1]] - m_points[a[0]];
d2 = m_points[a[2]] - m_points[a[0]];
n1 = d1^d2;
m_points[v1] = newPos;
m_points[v2] = newPos;
d1 = m_points[a[1]] - m_points[a[0]];
d2 = m_points[a[2]] - m_points[a[0]];
n2 = d1^d2;
m_points[v1] = oldPosV1;
m_points[v2] = oldPosV2;
n1.Normalize();
n2.Normalize();
if (n1*n2 < 0.0)
{
return std::numeric_limits<double>::max();
}
}
if ( m_ecolManifoldConstraint && !ManifoldConstraint(v1, v2))
{
return std::numeric_limits<double>::max();
}
return qem;
}
bool MeshDecimator::ManifoldConstraint(long v1, long v2) const
{
std::set<long> vertices;
long a, b;
long idEdge1;
long idEdge2;
long idEdgeV1V2 = 0;
for(size_t itE1 = 0; itE1 < m_vertices[v1].m_edges.Size(); ++itE1)
{
idEdge1 = m_vertices[v1].m_edges[itE1];
a = (m_edges[idEdge1].m_v1 == v1) ? m_edges[idEdge1].m_v2 : m_edges[idEdge1].m_v1;
vertices.insert(a);
if (a != v2)
{
for(size_t itE2 = 0; itE2 < m_vertices[v2].m_edges.Size(); ++itE2)
{
idEdge2 = m_vertices[v2].m_edges[itE2];
b = (m_edges[idEdge2].m_v1 == v2) ? m_edges[idEdge2].m_v2 : m_edges[idEdge2].m_v1;
vertices.insert(b);
if ( a==b )
{
if (GetTriangle(v1, v2, a) == -1)
{
return false;
}
}
}
}
else
{
idEdgeV1V2 = idEdge1;
}
}
if (vertices.size() <= 4 || ( m_vertices[v1].m_onBoundary && m_vertices[v2].m_onBoundary && !m_edges[idEdgeV1V2].m_onBoundary))
{
return false;
}
return true;
}
bool MeshDecimator::EdgeCollapse(double & qem)
{
MDEdgePriorityQueue currentEdge;
long v1, v2;
bool done = false;
do
{
done = false;
if (m_pqueue.size() == 0)
{
done = true;
break;
}
else
{
currentEdge = m_pqueue.top();
m_pqueue.pop();
}
}
while ( (!m_edges[currentEdge.m_name].m_tag) || (m_edges[currentEdge.m_name].m_qem != currentEdge.m_qem));
if (done) return false;
v1 = m_edges[currentEdge.m_name].m_v1;
v2 = m_edges[currentEdge.m_name].m_v2;
qem = currentEdge.m_qem;
EdgeCollapse(v1, v2);
m_points[v1] = m_edges[currentEdge.m_name].m_pos ;
for(int k = 0; k < 10; k++) m_vertices[v1].m_Q[k] += m_vertices[v2].m_Q[k];
// Update priority queue
long idEdge;
long a, b;
SArray<long, SARRAY_DEFAULT_MIN_SIZE> incidentVertices;
for(size_t itE = 0; itE < m_vertices[v1].m_edges.Size(); ++itE)
{
idEdge = m_vertices[v1].m_edges[itE];
a = m_edges[idEdge].m_v1;
b = m_edges[idEdge].m_v2;
incidentVertices.PushBack((a != v1)?a:b);
MDEdgePriorityQueue pqEdge;
pqEdge.m_qem = m_edges[idEdge].m_qem = ComputeEdgeCost(a, b, m_edges[idEdge].m_pos);
pqEdge.m_name = idEdge;
m_pqueue.push(pqEdge);
}
long idVertex;
for(size_t itV = 0; itV< incidentVertices.Size(); ++itV)
{
idVertex = incidentVertices[itV];
for(size_t itE = 0; itE < m_vertices[idVertex].m_edges.Size(); ++itE)
{
idEdge = m_vertices[idVertex].m_edges[itE];
a = m_edges[idEdge].m_v1;
b = m_edges[idEdge].m_v2;
if ( a!=v1 && b!=v1)
{
MDEdgePriorityQueue pqEdge;
pqEdge.m_qem = m_edges[idEdge].m_qem = ComputeEdgeCost(a, b, m_edges[idEdge].m_pos);
pqEdge.m_name = idEdge;
m_pqueue.push(pqEdge);
}
}
}
return true;
}
bool MeshDecimator::Decimate(size_t targetNVertices, size_t targetNTriangles, double targetError)
{
double qem = 0.0;
double progressOld = -1.0;
double progress = 0.0;
char msg[1024];
double ptgStep = 1.0;
if (m_callBack)
{
std::ostringstream msg;
msg << "+ Mesh" << std::endl;
msg << "\t # vertices \t" << m_nPoints << std::endl;
msg << "\t # triangles \t" << m_nTriangles << std::endl;
msg << "+ Parameters" << std::endl;
msg << "\t target # of vertices \t" << targetNVertices << std::endl;
msg << "\t target # of triangles \t" << targetNTriangles << std::endl;
msg << "\t QEM \t" << targetError << std::endl;
(*m_callBack)(msg.str().c_str(), 0.0, 0.0, m_nPoints);
}
if (m_callBack) (*m_callBack)("+ Initialize QEM \n", 0.0, 0.0, m_nPoints);
InitializeQEM();
if (m_callBack) (*m_callBack)("+ Initialize priority queue \n", 0.0, 0.0, m_nPoints);
InitializePriorityQueue();
if (m_callBack) (*m_callBack)("+ Simplification \n", 0.0, 0.0, m_nPoints);
double invDiag2 = 1.0 / (m_diagBB * m_diagBB);
while((m_pqueue.size() > 0) &&
(m_nEdges > 0) &&
(m_nVertices > targetNVertices) &&
(m_nTriangles > targetNTriangles) &&
(qem < targetError))
{
progress = 100.0 - m_nVertices * 100.0 / m_nPoints;
if (fabs(progress-progressOld) > ptgStep && m_callBack)
{
sprintf(msg, "%3.2f %% V = %lu \t QEM = %f \t \t \r", progress, static_cast<unsigned long>(m_nVertices), sqrt(qem));
(*m_callBack)(msg, progress, qem, m_nVertices);
progressOld = progress;
}
if (!EdgeCollapse(qem)) break;
qem *= invDiag2;
}
if (m_callBack)
{
std::ostringstream msg;
msg << "+ Simplification output" << std::endl;
msg << "\t # vertices \t" << m_nVertices << std::endl;
msg << "\t # triangles \t" << m_nTriangles << std::endl;
msg << "\t QEM \t" << qem << std::endl;
(*m_callBack)(msg.str().c_str(), 100.0, qem, m_nVertices);
}
return true;
}
}

View File

@@ -0,0 +1,116 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_MESH_DECEMATOR_H
#define HACD_MESH_DECEMATOR_H
#include <queue>
#include <set>
#include <vector>
#include <limits>
#include "hacdVersion.h"
#include "hacdVector.h"
#include "hacdSArray.h"
#include "hacdHACD.h"
namespace HACD
{
typedef double Float;
struct MDVertex
{
SArray<long, SARRAY_DEFAULT_MIN_SIZE> m_edges;
SArray<long, SARRAY_DEFAULT_MIN_SIZE> m_triangles;
Float m_Q[10];
// 0 1 2 3
// 4 5 6
// 7 8
// 9
bool m_tag;
bool m_onBoundary;
};
struct MDEdge
{
long m_v1;
long m_v2;
double m_qem;
Vec3<Float> m_pos;
bool m_onBoundary;
bool m_tag;
};
struct MDEdgePriorityQueue
{
long m_name;
double m_qem;
inline friend bool operator<(const MDEdgePriorityQueue & lhs, const MDEdgePriorityQueue & rhs) { return (lhs.m_qem > rhs.m_qem);}
inline friend bool operator>(const MDEdgePriorityQueue & lhs, const MDEdgePriorityQueue & rhs) { return (lhs.m_qem < rhs.m_qem);}
};
class MeshDecimator
{
public:
//! Sets the call-back function
//! @param callBack pointer to the call-back function
void SetCallBack(CallBackFunction callBack) { m_callBack = callBack;}
//! Gives the call-back function
//! @return pointer to the call-back function
const CallBackFunction GetCallBack() const { return m_callBack;}
inline void SetEColManifoldConstraint(bool ecolManifoldConstraint) { m_ecolManifoldConstraint = ecolManifoldConstraint; }
inline size_t GetNVertices()const {return m_nVertices;};
inline size_t GetNTriangles() const {return m_nTriangles;};
inline size_t GetNEdges() const {return m_nEdges;};
void GetMeshData(Vec3<Float> * points, Vec3<long> * triangles) const;
void ReleaseMemory();
void Initialize(size_t nVertices, size_t nTriangles,
Vec3<Float> * points,
Vec3<long> * triangles);
bool Decimate(size_t targetNVertices = 100,
size_t targetNTriangles = 0,
double targetError = std::numeric_limits<double>::max());
MeshDecimator(void);
~MeshDecimator(void);
private :
void EdgeCollapse(long v1, long v2);
long GetTriangle(long v1, long v2, long v3) const;
long GetEdge(long v1, long v2) const;
long IsBoundaryEdge(long v1, long v2) const;
bool IsBoundaryVertex(long v) const;
void InitializePriorityQueue();
void InitializeQEM();
bool ManifoldConstraint(long v1, long v2) const;
double ComputeEdgeCost(long v1, long v2, Vec3<Float> & pos) const;
bool EdgeCollapse(double & error);
private:
Vec3<long> * m_triangles;
Vec3<Float> * m_points;
size_t m_nPoints;
size_t m_nInitialTriangles;
size_t m_nVertices;
size_t m_nTriangles;
size_t m_nEdges;
double m_diagBB;
std::vector<MDVertex> m_vertices;
std::vector<MDEdge> m_edges;
std::priority_queue<
MDEdgePriorityQueue,
std::vector<MDEdgePriorityQueue>,
std::less<MDEdgePriorityQueue> > m_pqueue;
CallBackFunction m_callBack; //>! call-back function
bool * m_trianglesTags;
bool m_ecolManifoldConstraint;
};
}
#endif

View File

@@ -0,0 +1,994 @@
#include "hacdMicroAllocator.h"
/*!
**
** Copyright (c) 2009 by John W. Ratcliff mailto:jratcliffscarab@gmail.com
**
** If you find this code useful or you are feeling particularily generous I would
** ask that you please go to http://www.amillionpixels.us and make a donation
** to Troy DeMolay.
**
**
** If you wish to contact me you can use the following methods:
**
** Skype ID: jratcliff63367
** email: jratcliffscarab@gmail.com
**
**
** The MIT license:
**
** 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.
*/
#include <new>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#ifdef WIN32
#include <windows.h>
#endif
#if defined(__APPLE__) || defined(LINUX)
#include <pthread.h>
#endif
#if defined(_WIN32)
#pragma warning(disable:4100)
#endif
namespace HACD
{
//==================================================================================
class MemMutex
{
public:
MemMutex(void);
~MemMutex(void);
public:
// Blocking Lock.
void Lock(void);
// Unlock.
void Unlock(void);
private:
#if defined(_WIN32) || defined(_XBOX)
CRITICAL_SECTION m_Mutex;
#elif defined(__APPLE__) || defined(LINUX)
pthread_mutex_t m_Mutex;
#endif
};
//==================================================================================
MemMutex::MemMutex(void)
{
#if defined(_WIN32) || defined(_XBOX)
InitializeCriticalSection(&m_Mutex);
#elif defined(__APPLE__) || defined(LINUX)
pthread_mutexattr_t mta;
pthread_mutexattr_init(&mta);
pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&m_Mutex, &mta);
pthread_mutexattr_destroy(&mta);
#endif
}
//==================================================================================
MemMutex::~MemMutex(void)
{
#if defined(_WIN32) || defined(_XBOX)
DeleteCriticalSection(&m_Mutex);
#elif defined(__APPLE__) || defined(LINUX)
pthread_mutex_destroy(&m_Mutex);
#endif
}
//==================================================================================
// Blocking Lock.
//==================================================================================
void MemMutex::Lock(void)
{
#if defined(_WIN32) || defined(_XBOX)
EnterCriticalSection(&m_Mutex);
#elif defined(__APPLE__) || defined(LINUX)
pthread_mutex_lock(&m_Mutex);
#endif
}
//==================================================================================
// Unlock.
//==================================================================================
void MemMutex::Unlock(void)
{
#if defined(_WIN32) || defined(_XBOX)
LeaveCriticalSection(&m_Mutex);
#elif defined(__APPLE__) || defined(LINUX)
pthread_mutex_unlock(&m_Mutex);
#endif
}
struct ChunkHeader
{
ChunkHeader *mNextChunk;
};
// interface to add and remove new chunks to the master list.
class MicroChunkUpdate
{
public:
virtual void addMicroChunk(NxU8 *memStart,NxU8 *memEnd,MemoryChunk *chunk) = 0;
virtual void removeMicroChunk(MemoryChunk *chunk) = 0;
};
class MemoryHeader
{
public:
MemoryHeader *mNext;
};
// a single fixed size chunk for micro-allocations.
class MemoryChunk
{
public:
MemoryChunk(void)
{
mData = 0;
mDataEnd = 0;
mUsedCount = 0;
mFreeList = 0;
mMyHeap = false;
mChunkSize = 0;
}
NxU8 * init(NxU8 *chunkBase,NxU32 chunkSize,NxU32 maxChunks)
{
mChunkSize = chunkSize;
mData = chunkBase;
mDataEnd = mData+(chunkSize*maxChunks);
mFreeList = (MemoryHeader *) mData;
MemoryHeader *scan = mFreeList;
NxU8 *data = mData;
data+=chunkSize;
for (NxU32 i=0; i<(maxChunks-1); i++)
{
MemoryHeader *next = (MemoryHeader *)data;
scan->mNext = next;
data+=chunkSize;
scan = next;
}
scan->mNext = 0;
return mDataEnd;
}
inline void * allocate(MicroHeap *heap,NxU32 chunkSize,NxU32 maxChunks,MicroChunkUpdate *update)
{
void *ret = 0;
if ( mData == 0 )
{
mMyHeap = true;
mData = (NxU8 *)heap->micro_malloc( chunkSize * maxChunks );
init(mData,chunkSize,maxChunks);
update->addMicroChunk(mData,mDataEnd,this);
}
if ( mFreeList )
{
mUsedCount++;
ret = mFreeList;
mFreeList = mFreeList->mNext;
}
return ret;
}
inline void deallocate(void *p,MicroHeap *heap,MicroChunkUpdate *update)
{
#ifdef _DEBUG
assert(mUsedCount);
NxU8 *s = (NxU8 *)p;
assert( s >= mData && s < mDataEnd );
#endif
MemoryHeader *mh = mFreeList;
mFreeList = (MemoryHeader *)p;
mFreeList->mNext = mh;
mUsedCount--;
if ( mUsedCount == 0 && mMyHeap ) // free the heap back to the application if we are done with this.
{
update->removeMicroChunk(this);
heap->micro_free(mData);
mMyHeap = false;
mData = 0;
mDataEnd = 0;
mFreeList = 0;
}
}
NxU32 getChunkSize(void) const { return mChunkSize; };
bool isInside(const NxU8 *p) const
{
return p>=mData && p < mDataEnd;
}
private:
bool mMyHeap;
NxU8 *mData;
NxU8 *mDataEnd;
NxU32 mUsedCount;
MemoryHeader *mFreeList;
NxU32 mChunkSize;
};
#define DEFAULT_CHUNKS 32
class MemoryChunkChunk
{
public:
MemoryChunkChunk(void)
{
mNext = 0;
mChunkSize = 0;
mMaxChunks = 0;
}
~MemoryChunkChunk(void)
{
}
inline void * allocate(MemoryChunk *&current,MicroChunkUpdate *update)
{
void *ret = 0;
MemoryChunkChunk *scan = this;
while ( scan && ret == 0 )
{
for (NxU32 i=0; i<DEFAULT_CHUNKS; i++)
{
ret = scan->mChunks[i].allocate(mHeap,mChunkSize,mMaxChunks,update);
if ( ret )
{
current = &scan->mChunks[i];
scan = 0;
break;
}
}
if ( scan )
scan = scan->mNext;
}
if ( !ret )
{
MemoryChunkChunk *mcc = (MemoryChunkChunk *)mHeap->micro_malloc( sizeof(MemoryChunkChunk) );
new ( mcc ) MemoryChunkChunk;
MemoryChunkChunk *onext = mNext;
mNext = mcc;
mcc->mNext = onext;
ret = mcc->mChunks[0].allocate(mHeap,mChunkSize,mMaxChunks,update);
current = &mcc->mChunks[0];
}
return ret;
}
NxU8 * init(NxU8 *chunkBase,NxU32 fixedSize,NxU32 chunkSize,MemoryChunk *&current,MicroHeap *heap)
{
mHeap = heap;
mChunkSize = chunkSize;
mMaxChunks = fixedSize/chunkSize;
current = &mChunks[0];
chunkBase = mChunks[0].init(chunkBase,chunkSize,mMaxChunks);
return chunkBase;
}
MicroHeap *mHeap;
NxU32 mChunkSize;
NxU32 mMaxChunks;
MemoryChunkChunk *mNext;
MemoryChunk mChunks[DEFAULT_CHUNKS];
};
class FixedMemory
{
public:
FixedMemory(void)
{
mCurrent = 0;
}
void * allocate(MicroChunkUpdate *update)
{
void *ret = mCurrent->allocate(mChunks.mHeap,mChunks.mChunkSize,mChunks.mMaxChunks,update);
if ( ret == 0 )
{
ret = mChunks.allocate(mCurrent,update);
}
return ret;
}
NxU8 * init(NxU8 *chunkBase,NxU32 chunkSize,NxU32 fixedSize,MicroHeap *heap)
{
mMemBegin = chunkBase;
mMemEnd = chunkBase+fixedSize;
mChunks.init(chunkBase,fixedSize,chunkSize,mCurrent,heap);
return mMemEnd;
}
NxU8 *mMemBegin;
NxU8 *mMemEnd;
MemoryChunk *mCurrent; // the current memory chunk we are operating in.
MemoryChunkChunk mChunks; // the collection of all memory chunks used.
};
class MicroChunk
{
public:
void set(NxU8 *memStart,NxU8 *memEnd,MemoryChunk *mc)
{
mMemStart = memStart;
mMemEnd = memEnd;
mChunk = mc;
mPad = 0;
}
inline bool inside(const NxU8 *p) const
{
return p >= mMemStart && p < mMemEnd;
}
NxU8 *mMemStart;
NxU8 *mMemEnd;
MemoryChunk *mChunk;
NxU8 *mPad; // padding to make it 16 byte aligned.
};
class MyMicroAllocator : public MicroAllocator, public MicroChunkUpdate, public MemMutex
{
public:
MyMicroAllocator(MicroHeap *heap,void *baseMem,NxU32 initialSize,NxU32 chunkSize)
{
mLastMicroChunk = 0;
mMicroChunks = 0;
mMicroChunkCount = 0;
mMaxMicroChunks = 0;
mHeap = heap;
mChunkSize = chunkSize;
// 0 through 8 bytes
for (NxU32 i=0; i<=8; i++)
{
mFixedAllocators[i] = &mAlloc[0];
}
// 9 through 16 bytes
for (NxU32 i=9; i<=16; i++)
{
mFixedAllocators[i] = &mAlloc[1];
}
// 17 through 32 bytes
for (NxU32 i=17; i<=32; i++)
{
mFixedAllocators[i] = &mAlloc[2];
}
// 33 through 64
for (NxU32 i=33; i<=64; i++)
{
mFixedAllocators[i] = &mAlloc[3];
}
// 65 through 128
for (NxU32 i=65; i<=128; i++)
{
mFixedAllocators[i] = &mAlloc[4];
}
// 129 through 255
for (NxU32 i=129; i<257; i++)
{
mFixedAllocators[i] = &mAlloc[5];
}
mBaseMem = (NxU8 *)baseMem;
mBaseMemEnd = mBaseMem+initialSize;
NxU8 *chunkBase = (NxU8 *)baseMem+sizeof(MyMicroAllocator);
chunkBase+=32;
NxU64 ptr = (NxU64)chunkBase;
ptr = ptr>>4;
ptr = ptr<<4; // make sure it is 16 byte aligned.
chunkBase = (NxU8 *)ptr;
mChunkStart = chunkBase;
chunkBase = mAlloc[0].init(chunkBase,8,chunkSize,heap);
chunkBase = mAlloc[1].init(chunkBase,16,chunkSize,heap);
chunkBase = mAlloc[2].init(chunkBase,32,chunkSize,heap);
chunkBase = mAlloc[3].init(chunkBase,64,chunkSize,heap);
chunkBase = mAlloc[4].init(chunkBase,128,chunkSize,heap);
chunkBase = mAlloc[5].init(chunkBase,256,chunkSize,heap);
mChunkEnd = chunkBase;
assert(chunkBase <= mBaseMemEnd );
}
~MyMicroAllocator(void)
{
if ( mMicroChunks )
{
mHeap->micro_free(mMicroChunks);
}
}
virtual NxU32 getChunkSize(MemoryChunk *chunk)
{
return chunk ? chunk->getChunkSize() : 0;
}
// we have to steal one byte out of every allocation to record the size, so we can efficiently de-allocate it later.
virtual void * malloc(size_t size)
{
void *ret = 0;
Lock();
assert( size <= 256 );
if ( size <= 256 )
{
ret = mFixedAllocators[size]->allocate(this);
}
Unlock();
return ret;
}
virtual void free(void *p,MemoryChunk *chunk)
{
Lock();
chunk->deallocate(p,mHeap,this);
Unlock();
}
// perform a binary search on the sorted list of chunks.
MemoryChunk * binarySearchMicroChunks(const NxU8 *p)
{
MemoryChunk *ret = 0;
NxU32 low = 0;
NxU32 high = mMicroChunkCount;
while ( low != high )
{
NxU32 mid = (high-low)/2+low;
MicroChunk &chunk = mMicroChunks[mid];
if ( chunk.inside(p))
{
mLastMicroChunk = &chunk;
ret = chunk.mChunk;
break;
}
else
{
if ( p > chunk.mMemEnd )
{
low = mid+1;
}
else
{
high = mid;
}
}
}
return ret;
}
virtual MemoryChunk * isMicroAlloc(const void *p) // returns true if this pointer is handled by the micro-allocator.
{
MemoryChunk *ret = 0;
Lock();
const NxU8 *s = (const NxU8 *)p;
if ( s >= mChunkStart && s < mChunkEnd )
{
NxU32 index = (NxU32)(s-mChunkStart)/mChunkSize;
assert(index>=0 && index < 6 );
ret = &mAlloc[index].mChunks.mChunks[0];
assert( ret->isInside(s) );
}
else if ( mMicroChunkCount )
{
if ( mLastMicroChunk && mLastMicroChunk->inside(s) )
{
ret = mLastMicroChunk->mChunk;
}
else
{
if ( mMicroChunkCount >= 4 )
{
ret = binarySearchMicroChunks(s);
#ifdef _DEBUG
if (ret )
{
assert( ret->isInside(s) );
}
else
{
for (NxU32 i=0; i<mMicroChunkCount; i++)
{
assert( !mMicroChunks[i].inside(s) );
}
}
#endif
}
else
{
for (NxU32 i=0; i<mMicroChunkCount; i++)
{
if ( mMicroChunks[i].inside(s) )
{
ret = mMicroChunks[i].mChunk;
assert( ret->isInside(s) );
mLastMicroChunk = &mMicroChunks[i];
break;
}
}
}
}
}
#ifdef _DEBUG
if ( ret )
assert( ret->isInside(s) );
#endif
Unlock();
return ret;
}
MicroHeap * getMicroHeap(void) const { return mHeap; };
void allocateMicroChunks(void)
{
if ( mMaxMicroChunks == 0 )
{
mMaxMicroChunks = 64; // initial reserve.
mMicroChunks = (MicroChunk *)mHeap->micro_malloc( sizeof(MicroChunk)*mMaxMicroChunks );
}
else
{
mMaxMicroChunks*=2;
mMicroChunks = (MicroChunk *)mHeap->micro_realloc( mMicroChunks, sizeof(MicroChunk)*mMaxMicroChunks);
}
}
// perform an insertion sort of the new chunk.
virtual void addMicroChunk(NxU8 *memStart,NxU8 *memEnd,MemoryChunk *chunk)
{
if ( mMicroChunkCount >= mMaxMicroChunks )
{
allocateMicroChunks();
}
bool inserted = false;
for (NxU32 i=0; i<mMicroChunkCount; i++)
{
if ( memEnd < mMicroChunks[i].mMemStart )
{
for (NxU32 j=mMicroChunkCount; j>i; j--)
{
mMicroChunks[j] = mMicroChunks[j-1];
}
mMicroChunks[i].set( memStart, memEnd, chunk );
mLastMicroChunk = &mMicroChunks[i];
mMicroChunkCount++;
inserted = true;
break;
}
}
if ( !inserted )
{
mMicroChunks[mMicroChunkCount].set(memStart,memEnd,chunk);
mLastMicroChunk = &mMicroChunks[mMicroChunkCount];
mMicroChunkCount++;
}
}
virtual void removeMicroChunk(MemoryChunk *chunk)
{
mLastMicroChunk = 0;
#ifdef _DEBUG
bool removed = false;
#endif
for (NxU32 i=0; i<mMicroChunkCount; i++)
{
if ( mMicroChunks[i].mChunk == chunk )
{
mMicroChunkCount--;
for (NxU32 j=i; j<mMicroChunkCount; j++)
{
mMicroChunks[j] = mMicroChunks[j+1];
}
#ifdef _DEBUG
removed = true;
#endif
break;
}
}
#ifdef _DEBUG
assert(removed);
#endif
}
inline void * inline_malloc(size_t size)
{
Lock();
void *ret = mFixedAllocators[size]->allocate(this);
Unlock();
return ret;
}
inline void inline_free(void *p,MemoryChunk *chunk) // free relative to previously located MemoryChunk
{
Lock();
chunk->deallocate(p,mHeap,this);
Unlock();
}
inline MemoryChunk * inline_isMicroAlloc(const void *p) // returns pointer to the chunk this memory belongs to, or null if not a micro-allocated block.
{
MemoryChunk *ret = 0;
Lock();
const NxU8 *s = (const NxU8 *)p;
if ( s >= mChunkStart && s < mChunkEnd )
{
NxU32 index = (NxU32)(s-mChunkStart)/mChunkSize;
assert(index>=0 && index < 6 );
ret = &mAlloc[index].mChunks.mChunks[0];
}
else if ( mMicroChunkCount )
{
if ( mLastMicroChunk && mLastMicroChunk->inside(s) )
{
ret = mLastMicroChunk->mChunk;
}
else
{
if ( mMicroChunkCount >= 4 )
{
ret = binarySearchMicroChunks(s);
}
else
{
for (NxU32 i=0; i<mMicroChunkCount; i++)
{
if ( mMicroChunks[i].inside(s) )
{
ret = mMicroChunks[i].mChunk;
mLastMicroChunk = &mMicroChunks[i];
break;
}
}
}
}
}
Unlock();
return ret;
}
private:
MicroHeap *mHeap;
NxU8 *mBaseMem;
NxU8 *mBaseMemEnd;
FixedMemory *mFixedAllocators[257];
NxU32 mChunkSize;
NxU8 *mChunkStart;
NxU8 *mChunkEnd;
NxU32 mMaxMicroChunks;
NxU32 mMicroChunkCount;
MicroChunk *mLastMicroChunk;
MicroChunk *mMicroChunks;
FixedMemory mAlloc[6];
};
MicroAllocator *createMicroAllocator(MicroHeap *heap,NxU32 chunkSize)
{
NxU32 initialSize = chunkSize*6+sizeof(MyMicroAllocator)+32;
void *baseMem = heap->micro_malloc(initialSize);
MyMicroAllocator *mc = (MyMicroAllocator *)baseMem;
new ( mc ) MyMicroAllocator(heap,baseMem,initialSize,chunkSize);
return static_cast< MicroAllocator *>(mc);
}
void releaseMicroAllocator(MicroAllocator *m)
{
MyMicroAllocator *mc = static_cast< MyMicroAllocator *>(m);
MicroHeap *mh = mc->getMicroHeap();
mc->~MyMicroAllocator();
mh->micro_free(mc);
}
class MyHeapManager : public MicroHeap, public HeapManager
{
public:
MyHeapManager(NxU32 defaultChunkSize)
{
mMicro = createMicroAllocator(this,defaultChunkSize);
}
~MyHeapManager(void)
{
releaseMicroAllocator(mMicro);
}
// heap allocations used by the micro allocator.
virtual void * micro_malloc(size_t size)
{
return ::malloc(size);
}
virtual void micro_free(void *p)
{
return ::free(p);
}
virtual void * micro_realloc(void *oldMem,size_t newSize)
{
return ::realloc(oldMem,newSize);
}
virtual void * heap_malloc(size_t size)
{
void *ret;
if ( size <= 256 ) // micro allocator only handles allocations between 0 and 256 bytes in length.
{
ret = mMicro->malloc(size);
}
else
{
ret = ::malloc(size);
}
return ret;
}
virtual void heap_free(void *p)
{
MemoryChunk *chunk = mMicro->isMicroAlloc(p);
if ( chunk )
{
mMicro->free(p,chunk);
}
else
{
::free(p);
}
}
virtual void * heap_realloc(void *oldMem,size_t newSize)
{
void *ret = 0;
MemoryChunk *chunk = mMicro->isMicroAlloc(oldMem);
if ( chunk )
{
ret = heap_malloc(newSize);
NxU32 oldSize = chunk->getChunkSize();
if ( oldSize < newSize )
{
memcpy(ret,oldMem,oldSize);
}
else
{
memcpy(ret,oldMem,newSize);
}
mMicro->free(oldMem,chunk);
}
else
{
ret = ::realloc(oldMem,newSize);
}
return ret;
}
inline void * inline_heap_malloc(size_t size)
{
return size<=256 ? ((MyMicroAllocator *)mMicro)->inline_malloc(size) : ::malloc(size);
}
inline void inline_heap_free(void *p)
{
MemoryChunk *chunk = ((MyMicroAllocator *)mMicro)->inline_isMicroAlloc(p);
if ( chunk )
{
((MyMicroAllocator *)mMicro)->inline_free(p,chunk);
}
else
{
::free(p);
}
}
private:
MicroAllocator *mMicro;
};
HeapManager * createHeapManager(NxU32 defaultChunkSize)
{
MyHeapManager *m = (MyHeapManager *)::malloc(sizeof(MyHeapManager));
new ( m ) MyHeapManager(defaultChunkSize);
return static_cast< HeapManager *>(m);
}
void releaseHeapManager(HeapManager *heap)
{
MyHeapManager *m = static_cast< MyHeapManager *>(heap);
m->~MyHeapManager();
free(m);
}
#define TEST_SIZE 63
#define TEST_ALLOC_COUNT 8192
#define TEST_RUN 40000000
#define TEST_INLINE 1
#ifdef WIN32
#include <windows.h>
#pragma comment(lib,"winmm.lib")
#else
static NxU32 timeGetTime(void)
{
return 0;
}
#endif
#include <stdio.h>
void performUnitTests(void)
{
void *allocs[TEST_ALLOC_COUNT];
for (NxU32 i=0; i<TEST_ALLOC_COUNT; i++)
{
allocs[i] = 0;
}
HeapManager *hm = createHeapManager(65536*32);
{
NxU32 stime = timeGetTime();
srand(0);
for (NxU32 i=0; i<TEST_RUN; i++)
{
NxU32 index = rand()&(TEST_ALLOC_COUNT-1);
if ( allocs[index] )
{
#if TEST_INLINE
heap_free(hm, allocs[index] );
#else
hm->heap_free( allocs[index] );
#endif
allocs[index] = 0;
}
else
{
NxU32 asize = (rand()&TEST_SIZE);
if ( (rand()&127)==0) asize+=256; // one out of every 15 allocs is larger than 256 bytes.
#if TEST_INLINE
allocs[index] = heap_malloc(hm,asize);
#else
allocs[index] = hm->heap_malloc(asize);
#endif
}
}
for (NxU32 i=0; i<TEST_ALLOC_COUNT; i++)
{
if ( allocs[i] )
{
#if TEST_INLINE
heap_free(hm,allocs[i] );
#else
hm->heap_free(allocs[i] );
#endif
allocs[i] = 0;
}
}
NxU32 etime = timeGetTime();
printf("Micro allocation test took %d milliseconds.\r\n", etime - stime );
}
{
NxU32 stime = timeGetTime();
srand(0);
for (NxU32 i=0; i<TEST_RUN; i++)
{
NxU32 index = rand()&(TEST_ALLOC_COUNT-1);
if ( allocs[index] )
{
::free( allocs[index] );
allocs[index] = 0;
}
else
{
NxU32 asize = (rand()&TEST_SIZE);
if ( (rand()&127)==0) asize+=256; // one out of every 15 allocs is larger than 256 bytes.
allocs[index] = ::malloc(asize);
}
}
for (NxU32 i=0; i<TEST_ALLOC_COUNT; i++)
{
if ( allocs[i] )
{
::free(allocs[i] );
allocs[i] = 0;
}
}
NxU32 etime = timeGetTime();
printf("Standard malloc/free test took %d milliseconds.\r\n", etime - stime );
}
releaseHeapManager(hm);
}
void * heap_malloc(HeapManager *hm,size_t size)
{
return ((MyHeapManager *)hm)->inline_heap_malloc(size);
}
void heap_free(HeapManager *hm,void *p)
{
((MyHeapManager *)hm)->inline_heap_free(p);
}
void * heap_realloc(HeapManager *hm,void *oldMem,size_t newSize)
{
return hm->heap_realloc(oldMem,newSize);
}
}; // end of namespace

View File

@@ -0,0 +1,204 @@
#ifndef MICRO_ALLOCATOR_H
#define MICRO_ALLOCATOR_H
/*!
**
** Copyright (c) 2009 by John W. Ratcliff mailto:jratcliffscarab@gmail.com
**
** If you find this code useful or you are feeling particularily generous I would
** ask that you please go to http://www.amillionpixels.us and make a donation
** to Troy DeMolay.
**
** If you wish to contact me you can use the following methods:
**
** Skype ID: jratcliff63367
** email: jratcliffscarab@gmail.com
**
**
** The MIT license:
**
** 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.
*/
// This code snippet provides a high speed micro-allocator.
//
// The concept is that you reserve an initial bank of memory for small allocations. Ideally a megabyte or two.
// The amount of memory reserved is equal to chunkSize*6
//
// All micro-allocations are split into 6 seperate pools.
// They are: 0-8 bytes
// 9-32 bytes
// 33-64 bytes
// 65-128 bytes
// 129-256 bytes
//
// On creation of the micro-allocation system you preserve a certiain amount of memory for each of these banks.
//
// The user provides a heap interface to callback for additional memory as needed.
//
// In most cases allocations are order-N and frees are order-N as well.
//
// The larger a buffer you provide, the closer to 'order-N' the allocator behaves.
//
// This kind of a micro-allocator is ideal for use with STL as it does many tiny allocations.
// All allocations are 16 byte aligned (with the exception of the 8 byte allocations, which are 8 byte aligned every other one).
//
#include <stdio.h>
#ifdef WIN32
typedef __int64 NxI64;
typedef signed int NxI32;
typedef signed short NxI16;
typedef signed char NxI8;
typedef unsigned __int64 NxU64;
typedef unsigned int NxU32;
typedef unsigned short NxU16;
typedef unsigned char NxU8;
typedef float NxF32;
typedef double NxF64;
#elif __gnu_linux__
typedef long long NxI64;
typedef signed int NxI32;
typedef signed short NxI16;
typedef signed char NxI8;
typedef unsigned long long NxU64;
typedef unsigned int NxU32;
typedef unsigned short NxU16;
typedef unsigned char NxU8;
typedef float NxF32;
typedef double NxF64;
#elif __APPLE__
typedef long long NxI64;
typedef signed int NxI32;
typedef signed short NxI16;
typedef signed char NxI8;
typedef unsigned long long NxU64;
typedef unsigned int NxU32;
typedef unsigned short NxU16;
typedef unsigned char NxU8;
typedef float NxF32;
typedef double NxF64;
#elif __CELLOS_LV2__
typedef long long NxI64;
typedef signed int NxI32;
typedef signed short NxI16;
typedef signed char NxI8;
typedef unsigned long long NxU64;
typedef unsigned int NxU32;
typedef unsigned short NxU16;
typedef unsigned char NxU8;
typedef float NxF32;
typedef double NxF64;
#elif _XBOX
typedef __int64 NxI64;
typedef signed int NxI32;
typedef signed short NxI16;
typedef signed char NxI8;
typedef unsigned __int64 NxU64;
typedef unsigned int NxU32;
typedef unsigned short NxU16;
typedef unsigned char NxU8;
typedef float NxF32;
typedef double NxF64;
#elif defined(__PPCGEKKO__)
typedef long long NxI64;
typedef signed int NxI32;
typedef signed short NxI16;
typedef signed char NxI8;
typedef unsigned long long NxU64;
typedef unsigned int NxU32;
typedef unsigned short NxU16;
typedef float NxF32;
typedef double NxF64;
#else
#error Unknown platform!
#endif
namespace HACD
{
// user provided heap allocator
class MicroHeap
{
public:
virtual void * micro_malloc(size_t size) = 0;
virtual void micro_free(void *p) = 0;
virtual void * micro_realloc(void *oldMen,size_t newSize) = 0;
};
class MemoryChunk;
class MicroAllocator
{
public:
virtual void * malloc(size_t size) = 0;
virtual void free(void *p,MemoryChunk *chunk) = 0; // free relative to previously located MemoryChunk
virtual MemoryChunk * isMicroAlloc(const void *p) = 0; // returns pointer to the chunk this memory belongs to, or null if not a micro-allocated block.
virtual NxU32 getChunkSize(MemoryChunk *chunk) = 0;
};
MicroAllocator *createMicroAllocator(MicroHeap *heap,NxU32 chunkSize=32768); // initial chunk size 32k per block.
void releaseMicroAllocator(MicroAllocator *m);
class HeapManager
{
public:
virtual void * heap_malloc(size_t size) = 0;
virtual void heap_free(void *p) = 0;
virtual void * heap_realloc(void *oldMem,size_t newSize) = 0;
};
// creates a heap manager that uses micro-allocations for all allocations < 256 bytes and standard malloc/free for anything larger.
HeapManager * createHeapManager(NxU32 defaultChunkSize=32768);
void releaseHeapManager(HeapManager *heap);
// about 10% faster than using the virtual interface, inlines the functions as much as possible.
void * heap_malloc(HeapManager *hm,size_t size);
void heap_free(HeapManager *hm,void *p);
void * heap_realloc(HeapManager *hm,void *oldMem,size_t newSize);
void performUnitTests(void);
//
}; // end of namespace
#endif

View File

@@ -0,0 +1,280 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#include "hacdRaycastMesh.h"
#include <math.h>
#include <assert.h>
#include <limits>
#include "hacdManifoldMesh.h"
namespace HACD
{
bool BBox::Raycast(const Vec3<Float> & origin, const Vec3<Float> & dir, Float & distMin) const
{
Vec3<Float> d = m_max - m_min;
Float r2 = 0.25 * (d.X()*d.X()+d.Y()*d.Y()+d.Z()*d.Z());
Vec3<Float> c = 0.5 * m_max + 0.5 * m_min;
Vec3<Float> u = (c-origin);
Vec3<Float> a = u - (u * dir) * dir;
Float dist2 = (a.X()*a.X()+a.Y()*a.Y()+a.Z()*a.Z());
distMin = (u.X()*u.X()+u.Y()*u.Y()+u.Z()*u.Z());
if ( distMin > r2 ) // origin outside the sphere of center c and radius r
{
distMin = sqrt(distMin) - sqrt(r2); // the distance to any point inside the sphere is higher than |origin - c| - r
}
else
{
distMin = 0.0;
}
if (dist2 > r2) return false;
return true;
}
void RMNode::ComputeBB()
{
if (m_triIDs.Size() == 0)
{
return;
}
Vec3<long> * const triangles = m_rm->m_triangles;
Vec3<Float> * const vertices = m_rm->m_vertices;
const Float minFloat = std::numeric_limits<Float>::min();
const Float maxFloat = std::numeric_limits<Float>::max();
m_bBox.m_max = Vec3<Float>(minFloat, minFloat, minFloat);
m_bBox.m_min = Vec3<Float>(maxFloat, maxFloat, maxFloat);
Float x, y, z;
long v, f;
for(size_t id = 0; id < m_triIDs.Size(); ++id)
{
f = m_triIDs[id];
for(size_t k = 0; k < 3; ++k)
{
v = triangles[f][k];
x = vertices[v].X();
y = vertices[v].Y();
z = vertices[v].Z();
if ( x < m_bBox.m_min.X()) m_bBox.m_min.X() = x;
if ( x > m_bBox.m_max.X()) m_bBox.m_max.X() = x;
if ( y < m_bBox.m_min.Y()) m_bBox.m_min.Y() = y;
if ( y > m_bBox.m_max.Y()) m_bBox.m_max.Y() = y;
if ( z < m_bBox.m_min.Z()) m_bBox.m_min.Z() = z;
if ( z > m_bBox.m_max.Z()) m_bBox.m_max.Z() = z;
}
}
}
void RaycastMesh::ComputeBB()
{
if (m_nVertices == 0)
{
return;
}
m_bBox.m_min = m_vertices[0];
m_bBox.m_max = m_vertices[0];
Float x, y, z;
for (size_t v = 1; v < m_nVertices ; v++)
{
x = m_vertices[v].X();
y = m_vertices[v].Y();
z = m_vertices[v].Z();
if ( x < m_bBox.m_min.X()) m_bBox.m_min.X() = x;
else if ( x > m_bBox.m_max.X()) m_bBox.m_max.X() = x;
if ( y < m_bBox.m_min.Y()) m_bBox.m_min.Y() = y;
else if ( y > m_bBox.m_max.Y()) m_bBox.m_max.Y() = y;
if ( z < m_bBox.m_min.Z()) m_bBox.m_min.Z() = z;
else if ( z > m_bBox.m_max.Z()) m_bBox.m_max.Z() = z;
}
}
void RaycastMesh::Initialize(size_t nVertices, size_t nTriangles,
Vec3<Float> * vertices, Vec3<long> * triangles,
size_t maxDepth, size_t minLeafSize, Float minAxisSize)
{
m_triangles = triangles;
m_vertices = vertices;
m_nVertices = nVertices;
m_nTriangles = nTriangles;
delete [] m_nodes;
m_nNodes = 0;
m_nMaxNodes = 0;
for(size_t k = 0; k < maxDepth; k++)
{
m_nMaxNodes += (static_cast<size_t>(1) << maxDepth);
}
m_nodes = new RMNode[m_nMaxNodes];
RMNode & root = m_nodes[AddNode()];
root.m_triIDs.Resize(nTriangles);
for(size_t t = 0; t < m_nTriangles; ++t) root.m_triIDs.PushBack(t);
root.m_rm = this;
root.m_id = 0;
root.Create(0, maxDepth, minLeafSize, minAxisSize);
}
RaycastMesh::RaycastMesh(void)
{
m_triangles = 0;
m_vertices = 0;
m_nVertices = 0;
m_nTriangles = 0;
m_nodes = 0;
m_nNodes = 0;
m_nMaxNodes = 0;
}
RaycastMesh::~RaycastMesh(void)
{
delete [] m_nodes;
}
void RMNode::Create(size_t depth, size_t maxDepth, size_t minLeafSize, Float minAxisSize)
{
ComputeBB();
Vec3<Float> d = m_bBox.m_max - m_bBox.m_min;
Float maxDiff = std::max<Float>(d.X(), std::max<Float>(d.Y(), d.Z()));
RMSplitAxis split;
if (d.X() == maxDiff) split = RMSplitAxis_X;
else if (d.Y() == maxDiff) split = RMSplitAxis_Y;
else split = RMSplitAxis_Z;
if (depth == maxDepth || minLeafSize >= m_triIDs.Size() || maxDiff < minAxisSize)
{
m_leaf = true;
return;
}
m_idLeft = m_rm->AddNode();
m_idRight = m_rm->AddNode();
RMNode & leftNode = m_rm->m_nodes[m_idLeft];
RMNode & rightNode = m_rm->m_nodes[m_idRight];
leftNode.m_id = m_idLeft;
rightNode.m_id = m_idRight;
leftNode.m_bBox = m_bBox;
rightNode.m_bBox = m_bBox;
leftNode.m_rm = m_rm;
rightNode.m_rm = m_rm;
if ( split == RMSplitAxis_X)
{
leftNode.m_bBox.m_max.X() = leftNode.m_bBox.m_max.X() - d.X() * 0.5;
rightNode.m_bBox.m_min.X() = leftNode.m_bBox.m_max.X();
}
else if ( split == RMSplitAxis_Y)
{
leftNode.m_bBox.m_max.Y() = leftNode.m_bBox.m_max.Y() - d.Y() * 0.5;
rightNode.m_bBox.m_min.Y() = leftNode.m_bBox.m_max.Y();
}
else
{
leftNode.m_bBox.m_max.Z() = leftNode.m_bBox.m_max.Z() - d.Z() * 0.5;
rightNode.m_bBox.m_min.Z() = leftNode.m_bBox.m_max.Z();
}
long f;
long pts[3];
long v;
Vec3<long> * const triangles = m_rm->m_triangles;
Vec3<Float> * const vertices = m_rm->m_vertices;
leftNode.m_triIDs.Resize(m_triIDs.Size());
rightNode.m_triIDs.Resize(m_triIDs.Size());
bool found;
for(size_t id = 0; id < m_triIDs.Size(); ++id)
{
f = m_triIDs[id];
pts[0] = triangles[f].X();
pts[1] = triangles[f].Y();
pts[2] = triangles[f].Z();
found = false;
for (int k = 0; k < 3; ++k)
{
v = pts[k];
if ( vertices[v].X() <= leftNode.m_bBox.m_max.X() &&
vertices[v].X() >= leftNode.m_bBox.m_min.X() &&
vertices[v].Y() <= leftNode.m_bBox.m_max.Y() &&
vertices[v].Y() >= leftNode.m_bBox.m_min.Y() &&
vertices[v].Z() <= leftNode.m_bBox.m_max.Z() &&
vertices[v].Z() >= leftNode.m_bBox.m_min.Z() )
{
leftNode.m_triIDs.PushBack(f);
found = true;
break;
}
}
if (!found)
{
for (int k = 0; k < 3; ++k)
{
v = pts[k];
if ( vertices[v].X() <= rightNode.m_bBox.m_max.X() &&
vertices[v].X() >= rightNode.m_bBox.m_min.X() &&
vertices[v].Y() <= rightNode.m_bBox.m_max.Y() &&
vertices[v].Y() >= rightNode.m_bBox.m_min.Y() &&
vertices[v].Z() <= rightNode.m_bBox.m_max.Z() &&
vertices[v].Z() >= rightNode.m_bBox.m_min.Z() )
{
rightNode.m_triIDs.PushBack(f);
break;
}
}
}
}
rightNode.Create(depth+1, maxDepth, minLeafSize, minAxisSize);
leftNode.Create(depth+1, maxDepth, minLeafSize, minAxisSize);
m_triIDs.Clear();
}
bool RaycastMesh::Raycast(const Vec3<Float> & from, const Vec3<Float> & dir, long & triID, Float & distance, Vec3<Real> & hitPoint, Vec3<Real> & hitNormal) const
{
distance = std::numeric_limits<Float>::max();
if (m_nNodes == 0) return false;
return m_nodes[0].Raycast(from, dir, triID, distance, hitPoint, hitNormal);
}
bool RMNode::Raycast(const Vec3<Float> & from, const Vec3<Float> & dir, long & triID, Float & distance, Vec3<Real> & hitPoint, Vec3<Real> & hitNormal) const
{
Float distToSphere;
if (m_bBox.Raycast(from, dir, distToSphere) && (distToSphere < distance))
{
if (m_leaf)
{
long f, i1, j1, k1;
Vec3<long> * const triangles = m_rm->m_triangles;
Vec3<Float> * const vertices = m_rm->m_vertices;
Vec3<Real> u1, v1, normal1;
double dist = 0.0;
long nhit = 0;
bool ret = false;
for(size_t id = 0; id < m_triIDs.Size(); ++id)
{
f = m_triIDs[id];
i1 = triangles[f].X();
j1 = triangles[f].Y();
k1 = triangles[f].Z();
u1 = vertices[j1] - vertices[i1];
v1 = vertices[k1] - vertices[i1];
normal1 = (u1 ^ v1);
if (dir * normal1 > 0.0)
{
nhit = IntersectRayTriangle(from, dir, vertices[i1], vertices[j1], vertices[k1], dist);
if (nhit==1 && distance>dist)
{
normal1.Normalize();
hitNormal = normal1;
hitPoint = from + dist * dir;
distance = dist;
triID = f;
ret = true;
}
}
}
return ret;
}
bool ret1 = false;
bool ret2 = false;
if (m_idRight >= 0) ret1 = m_rm->m_nodes[m_idRight].Raycast(from, dir, triID, distance, hitPoint, hitNormal);
if (m_idLeft >= 0) ret2 = m_rm->m_nodes[m_idLeft].Raycast(from, dir, triID, distance, hitPoint, hitNormal);
return ret1 || ret2;
}
return false;
}
}

View File

@@ -0,0 +1,97 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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 RAYCAST_MESH_H
#define RAYCAST_MESH_H
#include "hacdSArray.h"
#include <vector>
#include "hacdVersion.h"
#include "hacdVector.h"
#include "hacdSArray.h"
namespace HACD
{
typedef double Float;
class RaycastMesh;
class RMNode;
class BBox
{
public:
bool Raycast(const Vec3<Float> & origin, const Vec3<Float> & dir, Float & distance) const;
BBox(void){}
~BBox(void){}
private:
Vec3<Float> m_min;
Vec3<Float> m_max;
friend class RMNode;
friend class RaycastMesh;
};
enum RMSplitAxis
{
RMSplitAxis_X,
RMSplitAxis_Y,
RMSplitAxis_Z
};
class RMNode
{
public:
void ComputeBB();
bool Raycast(const Vec3<Float> & from, const Vec3<Float> & dir, long & triID, Float & distance, Vec3<Real> & hitPoint, Vec3<Real> & hitNormal) const;
void Create(size_t depth, size_t maxDepth, size_t minLeafSize, Float minAxisSize);
~RMNode(void){}
RMNode(void)
{
m_idRight = m_idLeft = m_id = -1;
m_rm = 0;
m_leaf = false;
}
long m_id;
long m_idLeft;
long m_idRight;
BBox m_bBox;
SArray<long, SARRAY_DEFAULT_MIN_SIZE> m_triIDs;
RaycastMesh * m_rm;
bool m_leaf;
};
class RaycastMesh
{
public:
size_t GetNNodes() const { return m_nNodes;}
size_t AddNode() { m_nNodes++; return m_nNodes-1; }
void ComputeBB();
bool Raycast(const Vec3<Float> & from, const Vec3<Float> & dir, long & triID, Float & distance, Vec3<Real> & hitPoint, Vec3<Real> & hitNormal) const;
void Initialize(size_t nVertices, size_t nTriangles,
Vec3<Float> * vertices, Vec3<long> * triangles,
size_t maxDepth=15, size_t minLeafSize = 4, Float minAxisSize = 2.0);
RaycastMesh(void);
~RaycastMesh(void);
private :
private:
Vec3<long> * m_triangles;
Vec3<Float> * m_vertices;
size_t m_nVertices;
size_t m_nTriangles;
RMNode * m_nodes;
BBox m_bBox;
size_t m_nNodes;
size_t m_nMaxNodes;
friend class RMNode;
};
}
#endif

154
indra/libhacd/hacdSArray.h Normal file
View File

@@ -0,0 +1,154 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_SARRAY_H
#define HACD_SARRAY_H
#include "hacdVersion.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define SARRAY_DEFAULT_MIN_SIZE 16
namespace HACD
{
//! SArray.
template < typename T, size_t N > class SArray
{
public:
T & operator[](size_t i)
{
T * const data = Data();
return data[i];
}
const T & operator[](size_t i) const
{
const T * const data = Data();
return data[i];
}
size_t Size() const
{
return m_size;
}
T * const Data()
{
return (m_maxSize == N)? m_data0 : m_data;
}
const T * const Data() const
{
return (m_maxSize == N)? m_data0 : m_data;
}
void Clear()
{
m_size = 0;
delete [] m_data;
m_data = 0;
m_maxSize = N;
}
void PopBack()
{
--m_size;
}
void Resize(size_t size)
{
if (size > m_maxSize)
{
T * temp = new T[size];
memcpy(temp, Data(), m_size*sizeof(T));
delete [] m_data;
m_data = temp;
m_maxSize = size;
}
}
void PushBack(const T & value)
{
if (m_size==m_maxSize)
{
size_t maxSize = (m_maxSize << 1);
T * temp = new T[maxSize];
memcpy(temp, Data(), m_maxSize*sizeof(T));
delete [] m_data;
m_data = temp;
m_maxSize = maxSize;
}
T * const data = Data();
data[m_size++] = value;
}
bool Find(const T & value, size_t & pos)
{
T * const data = Data();
for(pos = 0; pos < m_size; ++pos)
if (value == data[pos]) return true;
return false;
}
bool Insert(const T & value)
{
size_t pos;
if (Find(value, pos)) return false;
PushBack(value);
return true;
}
bool Erase(const T & value)
{
size_t pos;
T * const data = Data();
if (Find(value, pos))
{
for(size_t j = pos+1; j < m_size; ++j)
data[j-1] = data[j];
--m_size;
return true;
}
return false;
}
void operator=(const SArray & rhs)
{
if (m_maxSize < rhs.m_size)
{
delete [] m_data;
m_maxSize = rhs.m_maxSize;
m_data = new T[m_maxSize];
}
m_size = rhs.m_size;
memcpy(Data(), rhs.Data(), m_size*sizeof(T));
}
void Initialize()
{
m_data = 0;
m_size = 0;
m_maxSize = N;
}
SArray(const SArray & rhs)
{
m_data = 0;
m_size = 0;
m_maxSize = N;
*this = rhs;
}
SArray()
{
Initialize();
}
~SArray()
{
delete [] m_data;
}
private:
T m_data0[N];
T * m_data;
size_t m_size;
size_t m_maxSize;
};
}
#endif

View File

@@ -0,0 +1,69 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_VECTOR_H
#define HACD_VECTOR_H
#include <math.h>
#include <iostream>
#include "hacdVersion.h"
namespace HACD
{
typedef double Real;
//! Vector dim 3.
template < typename T > class Vec3
{
public:
T & operator[](size_t i) { return m_data[i];}
const T & operator[](size_t i) const { return m_data[i];}
T & X();
T & Y();
T & Z();
const T & X() const;
const T & Y() const;
const T & Z() const;
void Normalize();
T GetNorm() const;
void operator= (const Vec3 & rhs);
void operator+=(const Vec3 & rhs);
void operator-=(const Vec3 & rhs);
void operator-=(T a);
void operator+=(T a);
void operator/=(T a);
void operator*=(T a);
Vec3 operator^ (const Vec3 & rhs) const;
T operator* (const Vec3 & rhs) const;
Vec3 operator+ (const Vec3 & rhs) const;
Vec3 operator- (const Vec3 & rhs) const;
Vec3 operator- () const;
Vec3 operator* (T rhs) const;
Vec3 operator/ (T rhs) const;
Vec3();
Vec3(T a);
Vec3(T x, T y, T z);
Vec3(const Vec3 & rhs);
/*virtual*/ ~Vec3(void);
private:
T m_data[3];
};
template<typename T>
const bool Colinear(const Vec3<T> & a, const Vec3<T> & b, const Vec3<T> & c);
template<typename T>
const T Volume(const Vec3<T> & a, const Vec3<T> & b, const Vec3<T> & c, const Vec3<T> & d);
}
#include "hacdVector.inl" // template implementation
#endif

View File

@@ -0,0 +1,178 @@
#pragma once
#ifndef HACD_VECTOR_INL
#define HACD_VECTOR_INL
namespace HACD
{
template <typename T>
inline Vec3<T> operator*(T lhs, const Vec3<T> & rhs)
{
return Vec3<T>(lhs * rhs.X(), lhs * rhs.Y(), lhs * rhs.Z());
}
template <typename T>
inline T & Vec3<T>::X()
{
return m_data[0];
}
template <typename T>
inline T & Vec3<T>::Y()
{
return m_data[1];
}
template <typename T>
inline T & Vec3<T>::Z()
{
return m_data[2];
}
template <typename T>
inline const T & Vec3<T>::X() const
{
return m_data[0];
}
template <typename T>
inline const T & Vec3<T>::Y() const
{
return m_data[1];
}
template <typename T>
inline const T & Vec3<T>::Z() const
{
return m_data[2];
}
template <typename T>
inline void Vec3<T>::Normalize()
{
T n = sqrt(m_data[0]*m_data[0]+m_data[1]*m_data[1]+m_data[2]*m_data[2]);
if (n != 0.0) (*this) /= n;
}
template <typename T>
inline T Vec3<T>::GetNorm() const
{
return sqrt(m_data[0]*m_data[0]+m_data[1]*m_data[1]+m_data[2]*m_data[2]);
}
template <typename T>
inline void Vec3<T>::operator= (const Vec3 & rhs)
{
this->m_data[0] = rhs.m_data[0];
this->m_data[1] = rhs.m_data[1];
this->m_data[2] = rhs.m_data[2];
}
template <typename T>
inline void Vec3<T>::operator+=(const Vec3 & rhs)
{
this->m_data[0] += rhs.m_data[0];
this->m_data[1] += rhs.m_data[1];
this->m_data[2] += rhs.m_data[2];
}
template <typename T>
inline void Vec3<T>::operator-=(const Vec3 & rhs)
{
this->m_data[0] -= rhs.m_data[0];
this->m_data[1] -= rhs.m_data[1];
this->m_data[2] -= rhs.m_data[2];
}
template <typename T>
inline void Vec3<T>::operator-=(T a)
{
this->m_data[0] -= a;
this->m_data[1] -= a;
this->m_data[2] -= a;
}
template <typename T>
inline void Vec3<T>::operator+=(T a)
{
this->m_data[0] += a;
this->m_data[1] += a;
this->m_data[2] += a;
}
template <typename T>
inline void Vec3<T>::operator/=(T a)
{
this->m_data[0] /= a;
this->m_data[1] /= a;
this->m_data[2] /= a;
}
template <typename T>
inline void Vec3<T>::operator*=(T a)
{
this->m_data[0] *= a;
this->m_data[1] *= a;
this->m_data[2] *= a;
}
template <typename T>
inline Vec3<T> Vec3<T>::operator^ (const Vec3<T> & rhs) const
{
return Vec3<T>(m_data[1] * rhs.m_data[2] - m_data[2] * rhs.m_data[1],
m_data[2] * rhs.m_data[0] - m_data[0] * rhs.m_data[2],
m_data[0] * rhs.m_data[1] - m_data[1] * rhs.m_data[0]);
}
template <typename T>
inline T Vec3<T>::operator*(const Vec3<T> & rhs) const
{
return (m_data[0] * rhs.m_data[0] + m_data[1] * rhs.m_data[1] + m_data[2] * rhs.m_data[2]);
}
template <typename T>
inline Vec3<T> Vec3<T>::operator+(const Vec3<T> & rhs) const
{
return Vec3<T>(m_data[0] + rhs.m_data[0],m_data[1] + rhs.m_data[1],m_data[2] + rhs.m_data[2]);
}
template <typename T>
inline Vec3<T> Vec3<T>::operator-(const Vec3<T> & rhs) const
{
return Vec3<T>(m_data[0] - rhs.m_data[0],m_data[1] - rhs.m_data[1],m_data[2] - rhs.m_data[2]) ;
}
template <typename T>
inline Vec3<T> Vec3<T>::operator-() const
{
return Vec3<T>(-m_data[0],-m_data[1],-m_data[2]) ;
}
template <typename T>
inline Vec3<T> Vec3<T>::operator*(T rhs) const
{
return Vec3<T>(rhs * this->m_data[0], rhs * this->m_data[1], rhs * this->m_data[2]);
}
template <typename T>
inline Vec3<T> Vec3<T>::operator/ (T rhs) const
{
return Vec3<T>(m_data[0] / rhs, m_data[1] / rhs, m_data[2] / rhs);
}
template <typename T>
inline Vec3<T>::Vec3(T a)
{
m_data[0] = m_data[1] = m_data[2] = a;
}
template <typename T>
inline Vec3<T>::Vec3(T x, T y, T z)
{
m_data[0] = x;
m_data[1] = y;
m_data[2] = z;
}
template <typename T>
inline Vec3<T>::Vec3(const Vec3 & rhs)
{
m_data[0] = rhs.m_data[0];
m_data[1] = rhs.m_data[1];
m_data[2] = rhs.m_data[2];
}
template <typename T>
inline Vec3<T>::~Vec3(void){};
template <typename T>
inline Vec3<T>::Vec3() {}
template<typename T>
inline const bool Colinear(const Vec3<T> & a, const Vec3<T> & b, const Vec3<T> & c)
{
return ((c.Z() - a.Z()) * (b.Y() - a.Y()) - (b.Z() - a.Z()) * (c.Y() - a.Y()) == 0.0 /*EPS*/) &&
((b.Z() - a.Z()) * (c.X() - a.X()) - (b.X() - a.X()) * (c.Z() - a.Z()) == 0.0 /*EPS*/) &&
((b.X() - a.X()) * (c.Y() - a.Y()) - (b.Y() - a.Y()) * (c.X() - a.X()) == 0.0 /*EPS*/);
}
template<typename T>
inline const T Volume(const Vec3<T> & a, const Vec3<T> & b, const Vec3<T> & c, const Vec3<T> & d)
{
return (a-d) * ((b-d) ^ (c-d));
}
}
#endif //HACD_VECTOR_INL

View File

@@ -0,0 +1,20 @@
/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot 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.
3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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.
*/
#pragma once
#ifndef HACD_VERSION_H
#define HACD_VERSION_H
#define HACD_VERSION_MAJOR 0
#define HACD_VERSION_MINOR 0
#endif

View File

@@ -0,0 +1,35 @@
# -*- cmake -*-
project(libndhacd)
include(00-Common)
include_directories(${LIBS_OPEN_DIR}/libhacd)
set (libndhacd_SOURCE_FILES
llconvexdecomposition.cpp
nd_hacdConvexDecomposition.cpp
nd_hacdStructs.cpp
nd_hacdUtils.cpp
nd_EnterExitTracer.cpp
nd_StructTracer.cpp
)
set (libndhacd_HEADER_FILES
llconvexdecomposition.h
ndConvexDecomposition.h
nd_hacdConvexDecomposition.h
nd_hacdStructs.h
nd_StructTracer.h
llconvexdecompositionstubimpl.h
nd_EnterExitTracer.h
nd_hacdDefines.h
nd_hacdUtils.h
windowsincludes.h
)
set_source_files_properties(${libndhacd_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
add_library( nd_hacdConvexDecomposition STATIC ${libndhacd_SOURCE_FILES} ${libndhacd_HEADER_FILES})

View File

@@ -0,0 +1,80 @@
/**
* @file llconvexdecomposition.cpp
* @author falcon@lindenlab.com
* @brief A stub implementation of LLConvexDecomposition interface
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if defined(_WINDOWS)
# include "windowsincludes.h"
#endif
#ifndef NULL
#define NULL 0
#endif
#include "nd_hacdConvexDecomposition.h"
#include "llconvexdecomposition.h"
/*static */bool LLConvexDecomposition::s_isInitialized = false;
/*static*/LLConvexDecomposition* LLConvexDecomposition::getInstance()
{
if ( !s_isInitialized )
{
return NULL;
}
else
{
return nd_hacdConvexDecomposition::getInstance();
}
}
/*static */LLCDResult LLConvexDecomposition::initSystem()
{
LLCDResult result = nd_hacdConvexDecomposition::initSystem();
if ( result == LLCD_OK )
{
s_isInitialized = true;
}
return result;
}
/*static */LLCDResult LLConvexDecomposition::initThread()
{
return nd_hacdConvexDecomposition::initThread();
}
/*static */LLCDResult LLConvexDecomposition::quitThread()
{
return nd_hacdConvexDecomposition::quitThread();
}
/*static */LLCDResult LLConvexDecomposition::quitSystem()
{
return nd_hacdConvexDecomposition::quitSystem();
}

View File

@@ -0,0 +1,231 @@
/**
* @file llconvexdecomposition.cpp
* @brief LLConvexDecomposition interface definition
*
* $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$
*/
#ifndef LL_CONVEX_DECOMPOSITION
#define LL_CONVEX_DECOMPOSITION
typedef int bool32;
#if defined(_WIN32) || defined(_WIN64)
#define LLCD_CALL __cdecl
#else
#define LLCD_CALL
#endif
struct LLCDParam
{
enum LLCDParamType
{
LLCD_INVALID = 0,
LLCD_INTEGER,
LLCD_FLOAT,
LLCD_BOOLEAN,
LLCD_ENUM
};
struct LLCDEnumItem
{
const char* mName;
int mValue;
};
union LLCDValue
{
float mFloat;
int mIntOrEnumValue;
bool32 mBool;
};
union LLCDParamDetails
{
struct {
LLCDValue mLow;
LLCDValue mHigh;
LLCDValue mDelta;
} mRange;
struct {
int mNumEnums;
LLCDEnumItem* mEnumsArray;
} mEnumValues;
};
const char* mName;
const char* mDescription;
LLCDParamType mType;
LLCDParamDetails mDetails;
LLCDValue mDefault;
int mStage;
// WARNING: Only the LLConvexDecomposition implementation
// should change this value
int mReserved;
};
struct LLCDStageData
{
const char* mName;
const char* mDescription;
bool32 mSupportsCallback;
};
struct LLCDMeshData
{
enum IndexType
{
INT_16,
INT_32
};
const float* mVertexBase;
int mVertexStrideBytes;
int mNumVertices;
const void* mIndexBase;
IndexType mIndexType;
int mIndexStrideBytes;
int mNumTriangles;
};
struct LLCDHull
{
const float* mVertexBase;
int mVertexStrideBytes;
int mNumVertices;
};
enum LLCDResult
{
LLCD_OK = 0,
LLCD_UNKOWN_ERROR,
LLCD_NULL_PTR,
LLCD_INVALID_STAGE,
LLCD_UNKNOWN_PARAM,
LLCD_BAD_VALUE,
LLCD_REQUEST_OUT_OF_RANGE,
LLCD_INVALID_MESH_DATA,
LLCD_INVALID_HULL_DATA,
LLCD_STAGE_NOT_READY,
LLCD_INVALID_THREAD,
LLCD_NOT_IMPLEMENTED
};
// This callback will receive a string describing the current subtask being performed
// as well as a pair of numbers indicating progress. (The values should not be interpreted
// as a completion percentage as 'current' may be greater than 'final'.)
// If the callback returns zero, the decomposition will be terminated
typedef int (LLCD_CALL *llcdCallbackFunc)(const char* description, int current, int final);
class LLConvexDecomposition
{
public:
// Obtain a pointer to the actual implementation
static LLConvexDecomposition* getInstance();
static LLCDResult initSystem();
static LLCDResult initThread();
static LLCDResult quitThread();
static LLCDResult quitSystem();
// Generate a decomposition object handle
virtual void genDecomposition(int& decomp) = 0;
// Delete decomposition object handle
virtual void deleteDecomposition(int decomp) = 0;
// Bind given decomposition handle
// Commands operate on currently bound decomposition
virtual void bindDecomposition(int decomp) = 0;
// Sets *paramsOut to the address of the LLCDParam array and returns
// the number of parameters
virtual int getParameters(const LLCDParam** paramsOut) = 0;
// Sets *stagesOut to the address of the LLCDStageData array and returns
// the number of stages
virtual int getStages(const LLCDStageData** stagesOut) = 0;
// Set a parameter by name. Pass enum values as integers.
virtual LLCDResult setParam(const char* name, float val) = 0;
virtual LLCDResult setParam(const char* name, int val) = 0;
virtual LLCDResult setParam(const char* name, bool val) = 0;
// Set incoming mesh data. Data is copied to local buffers and will
// persist until the next setMeshData call
virtual LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based ) = 0;
// Register a callback to be called periodically during the specified stage
// See the typedef above for more information
virtual LLCDResult registerCallback( int stage, llcdCallbackFunc callback ) = 0;
// Execute the specified decomposition stage
virtual LLCDResult executeStage(int stage) = 0;
virtual LLCDResult buildSingleHull() = 0 ;
// Gets the number of hulls generated by the specified decompositions stage
virtual int getNumHullsFromStage(int stage) = 0;
// Populates hullOut to reference the internal copy of the requested hull
// The data will persist only until the next executeStage call for that stage.
virtual LLCDResult getHullFromStage( int stage, int hull, LLCDHull* hullOut ) = 0;
virtual LLCDResult getSingleHull( LLCDHull* hullOut ) = 0 ;
// TODO: Implement lock of some kind to disallow this call if data not yet ready
// Populates the meshDataOut to reference the utility's copy of the mesh geometry
// for the hull and stage specified.
// You must copy this data if you want to continue using it after the next executeStage
// call
virtual LLCDResult getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut) = 0;
// Creates a mesh from hullIn and temporarily stores it internally in the utility.
// The mesh data persists only until the next call to getMeshFromHull
virtual LLCDResult getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut ) = 0;
// Takes meshIn, generates a single convex hull from it, converts that to a mesh
// stored internally, and populates meshOut to reference the internally stored data.
// The data is persistent only until the next call to generateSingleHullMeshFromMesh
virtual LLCDResult generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut) = 0;
//
/// Debug
virtual void loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut) = 0;
virtual bool isFunctional()=0;
private:
static bool s_isInitialized;
};
// Pull in our trace interface
#include "ndConvexDecomposition.h"
#endif //LL_CONVEX_DECOMPOSITION

View File

@@ -0,0 +1,148 @@
/**
* @file llconvexdecompositionstubimpl.cpp
* @author falcon@lindenlab.com
* @brief A stub implementation of LLConvexDecomposition
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include <string.h>
#include <memory>
#include "llconvexdecompositionstubimpl.h"
LLConvexDecomposition* LLConvexDecompositionImpl::getInstance()
{
return NULL;
}
LLCDResult LLConvexDecompositionImpl::initSystem()
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::initThread()
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::quitThread()
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::quitSystem()
{
return LLCD_NOT_IMPLEMENTED;
}
void LLConvexDecompositionImpl::genDecomposition(int& decomp)
{
}
void LLConvexDecompositionImpl::deleteDecomposition(int decomp)
{
}
void LLConvexDecompositionImpl::bindDecomposition(int decomp)
{
}
LLCDResult LLConvexDecompositionImpl::setParam(const char* name, float val)
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::setParam(const char* name, bool val)
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::setParam(const char* name, int val)
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::setMeshData( const LLCDMeshData* data, bool vertex_based )
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::registerCallback(int stage, llcdCallbackFunc callback )
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::buildSingleHull()
{
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::executeStage(int stage)
{
return LLCD_NOT_IMPLEMENTED;
}
int LLConvexDecompositionImpl::getNumHullsFromStage(int stage)
{
return 0;
}
LLCDResult LLConvexDecompositionImpl::getSingleHull( LLCDHull* hullOut )
{
memset( hullOut, 0, sizeof(LLCDHull) );
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::getHullFromStage( int stage, int hull, LLCDHull* hullOut )
{
memset( hullOut, 0, sizeof(LLCDHull) );
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut )
{
memset( meshDataOut, 0, sizeof(LLCDMeshData) );
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut )
{
memset( meshOut, 0, sizeof(LLCDMeshData) );
return LLCD_NOT_IMPLEMENTED;
}
LLCDResult LLConvexDecompositionImpl::generateSingleHullMeshFromMesh(LLCDMeshData* meshIn, LLCDMeshData* meshOut)
{
memset( meshOut, 0, sizeof(LLCDMeshData) );
return LLCD_NOT_IMPLEMENTED;
}
void LLConvexDecompositionImpl::loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut)
{
static LLCDMeshData meshData;
memset( &meshData, 0, sizeof(LLCDMeshData) );
*meshDataOut = &meshData;
}

View File

@@ -0,0 +1,97 @@
/**
* @file llconvexdecompositionstubimpl.h
* @author falcon@lindenlab.com
* @brief A stub implementation of LLConvexDecomposition
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_CONVEX_DECOMP_UTIL_H
#define LL_CONVEX_DECOMP_UTIL_H
#include "llconvexdecomposition.h"
class LLConvexDecompositionImpl : public LLConvexDecomposition
{
public:
virtual ~LLConvexDecompositionImpl() {}
static LLConvexDecomposition* getInstance();
static LLCDResult initSystem();
static LLCDResult initThread();
static LLCDResult quitThread();
static LLCDResult quitSystem();
// Generate a decomposition object handle
void genDecomposition(int& decomp);
// Delete decomposition object handle
void deleteDecomposition(int decomp);
// Bind given decomposition handle
// Commands operate on currently bound decomposition
void bindDecomposition(int decomp);
// Sets *paramsOut to the address of the LLCDParam array and returns
// the length of the array
int getParameters(const LLCDParam** paramsOut)
{
*paramsOut = NULL;
return 0;
}
int getStages(const LLCDStageData** stagesOut)
{
*stagesOut = NULL;
return 0;
}
// Set a parameter by name. Returns false if out of bounds or unsupported parameter
LLCDResult setParam(const char* name, float val);
LLCDResult setParam(const char* name, int val);
LLCDResult setParam(const char* name, bool val);
LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based );
LLCDResult registerCallback(int stage, llcdCallbackFunc callback );
LLCDResult executeStage(int stage);
LLCDResult buildSingleHull() ;
int getNumHullsFromStage(int stage);
LLCDResult getHullFromStage( int stage, int hull, LLCDHull* hullOut );
LLCDResult getSingleHull( LLCDHull* hullOut ) ;
// TODO: Implement lock of some kind to disallow this call if data not yet ready
LLCDResult getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut);
LLCDResult getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut );
// For visualizing convex hull shapes in the viewer physics shape display
LLCDResult generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut);
/// Debug
void loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut);
private:
LLConvexDecompositionImpl() {}
};
#endif //LL_CONVEX_DECOMP_UTIL_H

View File

@@ -0,0 +1,58 @@
#ifndef ND_CONVEXDECOMPOSITION_H
#define ND_CONVEXDECOMPOSITION_H
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#ifndef ND_HASCONVEXDECOMP_TRACER
#define ND_HASCONVEXDECOMP_TRACER
#endif
class ndConvexDecompositionTracer
{
public:
enum ETraceLevel
{
eNone = 0,
eTraceFunctions = 0x1,
eTraceData = 0x2,
};
virtual ~ndConvexDecompositionTracer()
{ }
virtual void trace( char const *a_strMsg ) = 0;
virtual void startTraceData( char const *a_strWhat) = 0;
virtual void traceData( char const *a_strData ) = 0;
virtual void endTraceData() = 0;
virtual int getLevel() = 0;
virtual void addref() = 0;
virtual void release() = 0;
};
class ndConvexDecompositionTracable
{
public:
virtual void setTracer( ndConvexDecompositionTracer *) = 0;
};
#endif

View File

@@ -0,0 +1,51 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#include "nd_EnterExitTracer.h"
#include <vector>
#include <sstream>
void EnterExitTracer::doTrace( char const *aPrefix )
{
if( !mFunc || !mTracer )
return;
if( ndConvexDecompositionTracer::eTraceFunctions == (mTracer->getLevel() & ndConvexDecompositionTracer::eTraceFunctions ) )
return;
std::stringstream str;
if( aPrefix )
str << aPrefix;
str << mFunc;
mTracer->trace( str.str().c_str() );
}
EnterExitTracer::EnterExitTracer( char const *aFunc, ndConvexDecompositionTracer *aTracer )
: mFunc( aFunc )
, mTracer( aTracer )
{
doTrace( "enter: " );
}
EnterExitTracer::~EnterExitTracer( )
{
doTrace( "exit: " );
}

View File

@@ -0,0 +1,43 @@
#ifndef ND_ENTEREXITTRACER_H
#define ND_ENTEREXITTRACER_H
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#include "ndConvexDecomposition.h"
class EnterExitTracer
{
char const *mFunc;
ndConvexDecompositionTracer *mTracer;
void doTrace( char const *aPrefix );
public:
EnterExitTracer( char const *aFunc, ndConvexDecompositionTracer *aTracer );
~EnterExitTracer( );
};
#ifdef __GNUC__
#define TRACE_FUNC(ATRACER) EnterExitTracer oETTrace( __PRETTY_FUNCTION__, ATRACER );
#else
#define TRACE_FUNC(ATRACER) EnterExitTracer oETTrace( __FUNCTION__, ATRACER );
#endif
#endif

View File

@@ -0,0 +1,188 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#include "nd_StructTracer.h"
#include <sstream>
#include <iomanip>
using namespace std;
namespace ndStructTracer
{
bool doTrace( ndConvexDecompositionTracer *aTracer )
{
if( !aTracer )
return false;
return ndConvexDecompositionTracer::eTraceData == (aTracer->getLevel() & ndConvexDecompositionTracer::eTraceData) ;
}
template<typename T> void traceVecDbl( T const &aValue, ndConvexDecompositionTracer *aTracer )
{
stringstream str;
str << fixed
<< "\tX: " << aValue.X()
<< " Y: " << aValue.Y()
<< " Z: " << aValue.Z();
aTracer->traceData( str.str().c_str() );
}
template< typename T> void traceVecDoubles( vector< T > const &aVertices, ndConvexDecompositionTracer *aTracer )
{
for( size_t i = 0; i < aVertices.size(); ++i )
traceVecDbl( aVertices[i], aTracer );
}
void traceVertices( vector< tVecDbl > const &aVertices, ndConvexDecompositionTracer *aTracer )
{
aTracer->traceData( "Triangles\n" );
traceVecDoubles( aVertices, aTracer );
}
void traceTriangles( vector< tVecLong > const &aTriangles, ndConvexDecompositionTracer *aTracer )
{
aTracer->traceData( "Vertices\n" );
traceVecDoubles( aTriangles, aTracer );
}
void trace( DecompData const &aData, ndConvexDecompositionTracer *aTracer )
{
if( !doTrace( aTracer ) )
return;
aTracer->startTraceData("Hulls");
stringstream str;
str << "Hulls: " << aData.mHulls.size();
aTracer->traceData( str.str().c_str() );
str.seekp(0);
for( size_t i = 0; i < aData.mHulls.size(); ++i )
{
str << "Hull #" << i;
aTracer->traceData( str.str().c_str() );
str.seekp(0);
DecompHull const &oHull( aData.mHulls[i] );
traceVertices( oHull.mVertices, aTracer );
traceTriangles( oHull.mTriangles, aTracer );
}
aTracer->endTraceData();
}
template< typename T> void traceVertex( T aX, T aY, T aZ, ndConvexDecompositionTracer *aTracer )
{
stringstream str;
str << fixed
<< "X: " << aX
<< "Y: " << aY
<< "Z: " << aZ;
aTracer->traceData( str.str().c_str() );
}
template< typename T> void traceTriangle( void *& aPtr, int aStride, ndConvexDecompositionTracer *aTracer )
{
T *pData = reinterpret_cast< T* >(aPtr);
long X( pData[0] ), Y( pData[1] ), Z( pData[2] );
traceVertex( X, Y, Z, aTracer );
pData += aStride;
aPtr = pData;
}
void traceVertices( int aNumVertices, float const *aVertices, int aStride, ndConvexDecompositionTracer *aTracer )
{
for( int i = 0; i < aNumVertices; ++i )
{
float X( aVertices[0] ), Y( aVertices[1] ), Z( aVertices[2] );
traceVertex( X, Y, Z, aTracer );
aVertices += aStride;
}
}
void traceTriangles( LLCDMeshData const *aData, ndConvexDecompositionTracer *aTracer )
{
int nCount = aData->mNumTriangles;
int nStride = aData->mIndexStrideBytes;
void *pData = const_cast<void*>( aData->mIndexBase );
int nIndexType = aData->mIndexType;
if ( LLCDMeshData::INT_16 == nIndexType )
nStride /= 2;
else
nStride /= 4;
for ( int i = 0; i < nCount; ++i )
{
if( LLCDMeshData::INT_16 == nIndexType )
traceTriangle< hacdUINT16 >( pData, nStride, aTracer );
else
traceTriangle< hacdUINT32 >( pData, nStride, aTracer );
}
}
void trace( LLCDMeshData const *aData, bool aVertexBased, ndConvexDecompositionTracer *aTracer )
{
if( !doTrace( aTracer ) )
return;
aTracer->startTraceData("LLCDMeshData");
string strVBased("true");
if( !aVertexBased )
strVBased = "false";
stringstream str;
str << "LLCDMeshData vertex based: " << strVBased
<< "# vertices " << aData->mNumVertices
<< "# triangles " << aData->mNumTriangles;
aTracer->traceData( str.str().c_str() );
traceVertices( aData->mNumVertices, aData->mVertexBase, aData->mVertexStrideBytes/sizeof(float), aTracer );
if( !aVertexBased )
traceTriangles( aData, aTracer );
aTracer->endTraceData();
}
void trace( LLCDHull const *aData, ndConvexDecompositionTracer *aTracer )
{
if( !doTrace( aTracer ) )
return;
aTracer->startTraceData("LLCDHull");
stringstream str;
str << "LLCDHull # vertices " << aData->mNumVertices;
aTracer->traceData( str.str().c_str() );
traceVertices( aData->mNumVertices, aData->mVertexBase, aData->mVertexStrideBytes/sizeof(float), aTracer );
aTracer->endTraceData();
}
};

View File

@@ -0,0 +1,34 @@
#ifndef ND_STRUCTTRACER_H
#define ND_STRUCTTRACER_H
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#include "ndConvexDecomposition.h"
#include "llconvexdecomposition.h"
#include "nd_hacdStructs.h"
namespace ndStructTracer
{
void trace( DecompData const &aData, ndConvexDecompositionTracer *aTracer );
void trace( LLCDMeshData const *aData, bool aVertexBased, ndConvexDecompositionTracer *aTracer );
void trace( LLCDHull const *aData, ndConvexDecompositionTracer *aTracer );
};
#endif

View File

@@ -0,0 +1,393 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#include <string.h>
#include <memory>
#include "nd_hacdConvexDecomposition.h"
#include "nd_hacdDefines.h"
#include "nd_hacdStructs.h"
#include "nd_hacdUtils.h"
#include "ndConvexDecomposition.h"
#include "nd_EnterExitTracer.h"
#include "nd_StructTracer.h"
LLCDStageData nd_hacdConvexDecomposition::mStages[1];
LLCDParam nd_hacdConvexDecomposition::mParams[4];
LLCDParam::LLCDEnumItem nd_hacdConvexDecomposition::mMethods[1];
LLCDParam::LLCDEnumItem nd_hacdConvexDecomposition::mQuality[1];
LLCDParam::LLCDEnumItem nd_hacdConvexDecomposition::mSimplify[1];
LLConvexDecomposition* nd_hacdConvexDecomposition::getInstance()
{
static nd_hacdConvexDecomposition sImpl;
return &sImpl;
}
nd_hacdConvexDecomposition::nd_hacdConvexDecomposition()
{
mNextId = 0;
mCurrentDecoder = 0;
mSingleHullMeshFromMesh = new HACDDecoder();
mTracer = 0;
}
nd_hacdConvexDecomposition::~nd_hacdConvexDecomposition()
{
if( mTracer )
mTracer->release();
}
LLCDResult nd_hacdConvexDecomposition::initSystem()
{
memset( &mStages[0], 0, sizeof( mStages ) );
memset( &mParams[0], 0, sizeof( mParams ) );
memset( &mMethods[0], 0, sizeof( mMethods ) );
memset( &mQuality[0], 0, sizeof( mQuality ) );
memset( &mSimplify[0], 0, sizeof( mSimplify ) );
mStages[0].mName = "Decompose";
mStages[0].mDescription = NULL;
mMethods[0].mName = "Default";
mMethods[0].mValue = 0;
mQuality[0].mName = "Default";
mQuality[0].mValue = 0;
mSimplify[0].mName = "None";
mSimplify[0].mValue = 0;
mParams[0].mName = "nd_AlwaysNeedTriangles";
mParams[0].mDescription = 0;
mParams[0].mType = LLCDParam::LLCD_BOOLEAN;
mParams[0].mDefault.mBool = true;
mParams[1].mName = "Method";
mParams[1].mType = LLCDParam::LLCD_ENUM;
mParams[1].mDetails.mEnumValues.mNumEnums = sizeof(mMethods)/sizeof(LLCDParam::LLCDEnumItem);
mParams[1].mDetails.mEnumValues.mEnumsArray = mMethods;
mParams[1].mDefault.mIntOrEnumValue = 0;
mParams[2].mName = "Decompose Quality";
mParams[2].mType = LLCDParam::LLCD_ENUM;
mParams[2].mDetails.mEnumValues.mNumEnums = sizeof(mQuality)/sizeof(LLCDParam::LLCDEnumItem);
mParams[2].mDetails.mEnumValues.mEnumsArray = mQuality;
mParams[2].mDefault.mIntOrEnumValue = 0;
mParams[3].mName = "Simplify Method";
mParams[3].mType = LLCDParam::LLCD_ENUM;
mParams[3].mDetails.mEnumValues.mNumEnums = sizeof(mSimplify)/sizeof(LLCDParam::LLCDEnumItem);
mParams[3].mDetails.mEnumValues.mEnumsArray = mSimplify;
mParams[3].mDefault.mIntOrEnumValue = 0;
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::initThread()
{
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::quitThread()
{
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::quitSystem()
{
return LLCD_OK;
}
void nd_hacdConvexDecomposition::genDecomposition( int& decomp )
{
HACDDecoder *pGen = new HACDDecoder();
decomp = mNextId;
++mNextId;
mDecoders[ decomp ] = pGen;
}
void nd_hacdConvexDecomposition::deleteDecomposition( int decomp )
{
delete mDecoders[ decomp ];
mDecoders.erase( decomp );
}
void nd_hacdConvexDecomposition::bindDecomposition( int decomp )
{
TRACE_FUNC( mTracer );
mCurrentDecoder = decomp;
}
LLCDResult nd_hacdConvexDecomposition::setParam( const char* name, float val )
{
TRACE_FUNC( mTracer );
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::setParam( const char* name, bool val )
{
TRACE_FUNC( mTracer );
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::setParam( const char* name, int val )
{
TRACE_FUNC( mTracer );
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::setMeshData( const LLCDMeshData* data, bool vertex_based )
{
TRACE_FUNC( mTracer );
ndStructTracer::trace( data, vertex_based, mTracer );
HACDDecoder *pC = mDecoders[ mCurrentDecoder ];
return ::setMeshData( data, vertex_based, pC );
}
LLCDResult nd_hacdConvexDecomposition::registerCallback( int stage, llcdCallbackFunc callback )
{
TRACE_FUNC( mTracer );
if( mDecoders.end() == mDecoders.find( mCurrentDecoder ) )
return LLCD_STAGE_NOT_READY;
HACDDecoder *pC = mDecoders[ mCurrentDecoder ];
pC->mCallback = callback;
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::buildSingleHull()
{
TRACE_FUNC( mTracer );
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::executeStage( int stage )
{
TRACE_FUNC( mTracer );
if ( stage < 0 || stage >= NUM_STAGES )
return LLCD_INVALID_STAGE;
HACDDecoder *pC = mDecoders[ mCurrentDecoder ];
tHACD *pHACD = init( 1, MIN_NUMBER_OF_CLUSTERS, MAX_VERTICES_PER_HULL, CONNECT_DISTS[0], pC );
DecompData oRes = decompose( pHACD );
ndStructTracer::trace( oRes, mTracer );
delete pHACD;
pC->mStages[ stage ] = oRes;
return LLCD_OK;
}
int nd_hacdConvexDecomposition::getNumHullsFromStage( int stage )
{
TRACE_FUNC( mTracer );
HACDDecoder *pC = mDecoders[ mCurrentDecoder ];
if ( !pC )
return 0;
if ( stage < 0 || static_cast<size_t>(stage) >= pC->mStages.size() )
return 0;
return pC->mStages[stage].mHulls.size();
}
DecompData toSingleHull( HACDDecoder *aDecoder, LLCDResult &aRes, ndConvexDecompositionTracer *aTracer )
{
TRACE_FUNC( aTracer );
aRes = LLCD_REQUEST_OUT_OF_RANGE;
for ( int i = 0; i < TO_SINGLE_HULL_TRIES; ++i )
{
tHACD *pHACD = init( CONCAVITY_FOR_SINGLE_HULL[i], 1, MAX_VERTICES_PER_HULL, CONNECT_DISTS[i], aDecoder );
DecompData oRes = decompose( pHACD );
delete pHACD;
ndStructTracer::trace( oRes, aTracer );
if ( oRes.mHulls.size() == 1 )
{
aRes = LLCD_OK;
return oRes;
}
}
return DecompData();
}
LLCDResult nd_hacdConvexDecomposition::getSingleHull( LLCDHull* hullOut )
{
TRACE_FUNC( mTracer );
HACDDecoder *pC = mDecoders[ mCurrentDecoder ];
memset( hullOut, 0, sizeof( LLCDHull ) );
LLCDResult res;
// Will already trace oRes
DecompData oRes = ::toSingleHull( pC, res, mTracer );
if ( LLCD_OK != res || oRes.mHulls.size() != 1 )
return res;
pC->mSingleHull = oRes.mHulls[0];
pC->mSingleHull.toLLHull( hullOut );
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::getHullFromStage( int stage, int hull, LLCDHull* hullOut )
{
TRACE_FUNC( mTracer );
HACDDecoder *pC = mDecoders[ mCurrentDecoder ];
memset( hullOut, 0, sizeof( LLCDHull ) );
if ( stage < 0 || static_cast<size_t>(stage) >= pC->mStages.size() )
return LLCD_INVALID_STAGE;
DecompData &oData = pC->mStages[ stage ];
if ( hull < 0 ||static_cast<size_t>(hull) >= oData.mHulls.size() )
return LLCD_REQUEST_OUT_OF_RANGE;
oData.mHulls[ hull ].toLLHull( hullOut );
ndStructTracer::trace( hullOut, mTracer );
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut )
{
TRACE_FUNC( mTracer );
HACDDecoder *pC = mDecoders[ mCurrentDecoder ];
memset( meshDataOut, 0, sizeof( LLCDHull ) );
if ( stage < 0 || static_cast<size_t>(stage) >= pC->mStages.size() )
return LLCD_INVALID_STAGE;
DecompData &oData = pC->mStages[ stage ];
if ( hull < 0 || static_cast<size_t>(hull) >= oData.mHulls.size() )
return LLCD_REQUEST_OUT_OF_RANGE;
oData.mHulls[ hull ].toLLMesh( meshDataOut );
ndStructTracer::trace( meshDataOut, true, mTracer );
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut )
{
TRACE_FUNC( mTracer );
memset( meshOut, 0, sizeof( LLCDMeshData ) );
mMeshToHullVertices.clear();
mMeshToHullTriangles.clear();
if( !hullIn || !hullIn->mVertexBase || !meshOut )
return LLCD_NULL_PTR;
if( hullIn->mVertexStrideBytes < 3*sizeof(float) || hullIn->mNumVertices < 3 )
return LLCD_INVALID_HULL_DATA;
LLCDResult oRet = convertHullToMesh( hullIn, mMeshToHullVertices, mMeshToHullTriangles );
if( LLCD_OK != oRet )
return oRet;
meshOut->mVertexStrideBytes = sizeof( float )*3;
meshOut->mNumVertices = mMeshToHullVertices.size()/3;
meshOut->mVertexBase = &mMeshToHullVertices[0];
meshOut->mIndexType = LLCDMeshData::INT_32;
meshOut->mIndexStrideBytes = sizeof( hacdUINT32 ) * 3;
meshOut->mNumTriangles = mMeshToHullTriangles.size()/3;
meshOut->mIndexBase = &mMeshToHullTriangles[0];
return LLCD_OK;
}
LLCDResult nd_hacdConvexDecomposition::generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut )
{
TRACE_FUNC( mTracer );
memset( meshOut, 0, sizeof( LLCDMeshData ) );
mSingleHullMeshFromMesh->clear();
LLCDResult res = ::setMeshData( meshIn, meshIn->mNumVertices > 3, mSingleHullMeshFromMesh );
if ( LLCD_OK != res )
return res;
// Will already trace oRes
DecompData oRes = ::toSingleHull( mSingleHullMeshFromMesh, res, mTracer );
if ( LLCD_OK != res || oRes.mHulls.size() != 1 )
return res;
mSingleHullMeshFromMesh->mSingleHull = oRes.mHulls[0];
mSingleHullMeshFromMesh->mSingleHull.toLLMesh( meshOut );
return LLCD_OK;
}
void nd_hacdConvexDecomposition::loadMeshData( const char* fileIn, LLCDMeshData** meshDataOut )
{
TRACE_FUNC( mTracer );
static LLCDMeshData meshData;
memset( &meshData, 0, sizeof( LLCDMeshData ) );
*meshDataOut = &meshData;
}
int nd_hacdConvexDecomposition::getParameters( const LLCDParam** paramsOut )
{
TRACE_FUNC( mTracer );
*paramsOut = mParams;
return sizeof(mParams)/sizeof(LLCDParam);
}
int nd_hacdConvexDecomposition::getStages( const LLCDStageData** stagesOut )
{
TRACE_FUNC( mTracer );
*stagesOut = mStages;
return sizeof(mStages)/sizeof(LLCDStageData);
}
void nd_hacdConvexDecomposition::setTracer( ndConvexDecompositionTracer * aTracer)
{
if( mTracer )
mTracer->release();
mTracer = aTracer;
if( mTracer )
mTracer->addref();
}
bool nd_hacdConvexDecomposition::isFunctional()
{
return true;
}

View File

@@ -0,0 +1,103 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#ifndef ND_HACD_CONVEXDECOMP_H
#define ND_HACD_CONVEXDECOMP_H
#include "llconvexdecomposition.h"
#include <map>
#include <vector>
struct HACDDecoder;
class nd_hacdConvexDecomposition : public LLConvexDecomposition, public ndConvexDecompositionTracable
{
int mNextId;
int mCurrentDecoder;
std::map< int, HACDDecoder * > mDecoders;
HACDDecoder *mSingleHullMeshFromMesh;
std::vector< float > mMeshToHullVertices;
std::vector< int > mMeshToHullTriangles;
ndConvexDecompositionTracer *mTracer;
static LLCDStageData mStages[1];
static LLCDParam mParams[4];
static LLCDParam::LLCDEnumItem mMethods[1];
static LLCDParam::LLCDEnumItem mQuality[1];
static LLCDParam::LLCDEnumItem mSimplify[1];
public:
virtual ~nd_hacdConvexDecomposition();
static LLConvexDecomposition* getInstance();
static LLCDResult initSystem();
static LLCDResult initThread();
static LLCDResult quitThread();
static LLCDResult quitSystem();
// Generate a decomposition object handle
void genDecomposition( int& decomp );
// Delete decomposition object handle
void deleteDecomposition( int decomp );
// Bind given decomposition handle
// Commands operate on currently bound decomposition
void bindDecomposition( int decomp );
// Sets *paramsOut to the address of the LLCDParam array and returns
// the length of the array
int getParameters( const LLCDParam** paramsOut );
int getStages( const LLCDStageData** stagesOut ) ;
// Set a parameter by name. Returns false if out of bounds or unsupported parameter
LLCDResult setParam( const char* name, float val );
LLCDResult setParam( const char* name, int val );
LLCDResult setParam( const char* name, bool val );
LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based );
LLCDResult registerCallback( int stage, llcdCallbackFunc callback );
LLCDResult executeStage( int stage );
LLCDResult buildSingleHull() ;
int getNumHullsFromStage( int stage );
LLCDResult getHullFromStage( int stage, int hull, LLCDHull* hullOut );
LLCDResult getSingleHull( LLCDHull* hullOut ) ;
// TODO: Implement lock of some kind to disallow this call if data not yet ready
LLCDResult getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut );
LLCDResult getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut );
// For visualizing convex hull shapes in the viewer physics shape display
LLCDResult generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut );
/// Debug
void loadMeshData( const char* fileIn, LLCDMeshData** meshDataOut );
virtual void setTracer( ndConvexDecompositionTracer *);
virtual bool isFunctional();
private:
nd_hacdConvexDecomposition();
};
#endif

View File

@@ -0,0 +1,46 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#ifndef ND_HACD_DEFINES_H
#define ND_HACD_DEFINES_H
#include "hacdHACD.h"
#define NUM_STAGES 1
typedef unsigned short hacdUINT16;
typedef unsigned int hacdUINT32;
typedef HACD::HACD tHACD;
typedef HACD::Vec3< double > tVecDbl;
typedef HACD::Vec3< long > tVecLong;
typedef tVecLong ( *fFromIXX )( void const *&, int );
const int MAX_VERTICES_PER_HULL = 256; // see http://wiki.secondlife.com/wiki/Mesh/Mesh_physics
const int MIN_NUMBER_OF_CLUSTERS = 1;
int const TO_SINGLE_HULL_TRIES = 10;
// Use a high value so HACD will generate just one hull. For now we use the same concavity for each run.
int const CONCAVITY_FOR_SINGLE_HULL[ TO_SINGLE_HULL_TRIES ] = { 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000 };
// Max distance to connect CC. Increase this each run.
double const CONNECT_DISTS[ TO_SINGLE_HULL_TRIES ] = { 30, 60, 120, 240, 480, 960, 1920, 3840, 7680, 10000 };
#endif

View File

@@ -0,0 +1,106 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#include "nd_hacdStructs.h"
void DecompHull::clear()
{
mVertices.clear();
mTriangles.clear();
mLLVertices.clear();
mLLTriangles.clear();
}
void DecompHull::computeLLVertices()
{
if ( mLLVertices.size()*3 != mVertices.size() )
{
for ( size_t i = 0; i < mVertices.size(); ++i )
{
mLLVertices.push_back( static_cast<float>( mVertices[i].X() ) );
mLLVertices.push_back( static_cast<float>( mVertices[i].Y() ) );
mLLVertices.push_back( static_cast<float>( mVertices[i].Z() ) );
}
}
}
void DecompHull::computeLLTriangles()
{
if ( mLLTriangles.size()*3 != mTriangles.size() )
{
for ( size_t i = 0; i < mTriangles.size(); ++i )
{
mLLTriangles.push_back( mTriangles[i].X() );
mLLTriangles.push_back( mTriangles[i].Y() );
mLLTriangles.push_back( mTriangles[i].Z() );
}
}
}
void DecompHull::toLLHull( LLCDHull *aHull )
{
computeLLVertices();
aHull->mVertexBase = &mLLVertices[0];
aHull->mVertexStrideBytes = sizeof( float ) * 3;
aHull->mNumVertices = mVertices.size();
}
void DecompHull::toLLMesh( LLCDMeshData *aMesh )
{
computeLLVertices();
computeLLTriangles();
aMesh->mIndexType = LLCDMeshData::INT_32;
aMesh->mVertexBase = &mLLVertices[0];
aMesh->mNumVertices = mVertices.size();
aMesh->mVertexStrideBytes = sizeof( float ) * 3;
aMesh->mIndexBase = &mLLTriangles[0];
aMesh->mIndexStrideBytes = sizeof( hacdUINT32 ) * 3;
aMesh->mNumTriangles = mTriangles.size();
}
void DecompData::clear()
{
mHulls.clear();
}
HACDDecoder::HACDDecoder()
{
mStages.resize( NUM_STAGES );
mCallback = 0;
}
void HACDDecoder::clear()
{
mVertices.clear();
mTriangles.clear();
for ( size_t i = 0; i < mStages.size(); ++i )
mStages[i].clear();
mSingleHull.clear();
mCallback = 0;
}

View File

@@ -0,0 +1,77 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#ifndef ND_HACD_DECOMPSTRUCTS_H
#define ND_HACD_DECOMPSTRUCTS_H
#include "nd_hacdDefines.h"
#include "hacdHACD.h"
#include "llconvexdecomposition.h"
#include <vector>
struct LLCDHull;
struct LLCDMeshData;
struct DecompHull
{
std::vector< tVecDbl > mVertices;
std::vector< tVecLong > mTriangles;
std::vector< float > mLLVertices;
std::vector< hacdUINT32 > mLLTriangles;
void clear();
void computeLLVertices();
void computeLLTriangles();
void toLLHull( LLCDHull *aHull );
void toLLMesh( LLCDMeshData *aMesh );
};
struct DecompData
{
std::vector< DecompHull > mHulls;
void clear();
};
struct HACDDecoder: public HACD::ICallback
{
std::vector< tVecDbl > mVertices;
std::vector< tVecLong > mTriangles;
std::vector< DecompData > mStages;
DecompHull mSingleHull;
llcdCallbackFunc mCallback;
HACDDecoder();
void clear();
virtual void operator()( char const *aMsg, double aProgress, double aConcavity, size_t aVertices)
{
if( mCallback )
(*mCallback)(aMsg, static_cast<int>(aProgress), aVertices );
}
};
#endif

View File

@@ -0,0 +1,183 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#include "nd_hacdUtils.h"
tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData )
{
tHACD *pDec = HACD::CreateHACD(0);
pDec->SetPoints( &aData->mVertices[0] );
pDec->SetNPoints( aData->mVertices.size() );
if ( aData->mTriangles.size() )
{
pDec->SetTriangles( &aData->mTriangles[0] );
pDec->SetNTriangles( aData->mTriangles.size() );
}
pDec->SetCompacityWeight( 0.1f );
pDec->SetVolumeWeight( 0 );
pDec->SetNClusters( nClusters );
pDec->SetAddExtraDistPoints( true );
pDec->SetAddFacesPoints( true );
pDec->SetNVerticesPerCH( nMaxVerticesPerHull );
pDec->SetConcavity( nConcavity );
pDec->SetConnectDist( dMaxConnectDist );
pDec->SetCallBack( aData );
return pDec;
}
DecompData decompose( tHACD *aHACD )
{
aHACD->Compute();
DecompData oRet;
int nClusters = aHACD->GetNClusters();
for ( int i = 0; i < nClusters; ++i )
{
int nVertices = aHACD->GetNPointsCH( i );
int nTriangles = aHACD->GetNTrianglesCH( i );
DecompHull oHull;
oHull.mVertices.resize( nVertices );
oHull.mTriangles.resize( nTriangles );
aHACD->GetCH( i, &oHull.mVertices[0], &oHull.mTriangles[0] );
oRet.mHulls.push_back( oHull );
}
return oRet;
}
tVecLong fromI16( void const *& pPtr, int aStride )
{
hacdUINT16 const *pVal = reinterpret_cast< hacdUINT16 const * >( pPtr );
tVecLong oRet( pVal[0], pVal[1], pVal[2] );
pVal += aStride / 2;
pPtr = pVal;
return oRet;
}
tVecLong fromI32( void const *& pPtr, int aStride )
{
hacdUINT32 const *pVal = reinterpret_cast< hacdUINT32 const * >( pPtr );
tVecLong oRet( pVal[0], pVal[1], pVal[2] );
pVal += aStride / 4;
pPtr = pVal;
return oRet;
}
LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based, HACDDecoder *aDec )
{
if ( !data || !data->mVertexBase || ( data->mNumVertices < 3 ) || ( data->mVertexStrideBytes != 12 && data->mVertexStrideBytes != 16 ) )
return LLCD_INVALID_MESH_DATA;
if ( !vertex_based && ( ( data->mNumTriangles < 1 ) || ! data->mIndexBase ) )
return LLCD_INVALID_MESH_DATA;
aDec->clear();
int nCount = data->mNumVertices;
float const* pVertex = data->mVertexBase;
int nStride = data->mVertexStrideBytes / sizeof( float );
for ( int i = 0; i < nCount; ++i )
{
tVecDbl oPt( pVertex[0], pVertex[1], pVertex[2] );
aDec->mVertices.push_back( oPt );
pVertex += nStride;
}
if ( !vertex_based )
{
fFromIXX pFunc = 0;
nCount = data->mNumTriangles;
nStride = data->mIndexStrideBytes;
void const *pData = data->mIndexBase;
if ( data->mIndexType == LLCDMeshData::INT_16 )
pFunc = fromI16;
else
pFunc = fromI32;
for ( int i = 0; i < nCount; ++i )
{
tVecLong oVal( ( *pFunc )( pData, nStride ) );
aDec->mTriangles.push_back( oVal );
}
}
return LLCD_OK;
}
LLCDResult convertHullToMesh( const LLCDHull* aHull, std::vector< float > &aVerticesOut, std::vector< int > &aTrianglesOut )
{
if( !aHull || !aHull->mVertexBase )
return LLCD_NULL_PTR;
if( aHull->mVertexStrideBytes < 3*sizeof(float) || aHull->mNumVertices < 3 )
return LLCD_INVALID_HULL_DATA;
HACD::ICHull oHull;
int nCount = aHull->mNumVertices;
float const *pVertex = aHull->mVertexBase;
int nStride = aHull->mVertexStrideBytes / sizeof( float );
std::vector< tVecDbl > vcPoints;
for ( int i = 0; i < nCount; ++i )
{
vcPoints.push_back( tVecDbl( pVertex[0], pVertex[1], pVertex[2] ) );
pVertex += nStride;
}
oHull.AddPoints( &vcPoints[0], vcPoints.size() );
HACD::ICHullError eErr = oHull.Process( MAX_VERTICES_PER_HULL );
if( HACD::ICHullErrorOK != eErr )
return LLCD_INVALID_HULL_DATA;
HACD::TMMesh &oMesh = oHull.GetMesh();
std::vector< tVecDbl > vPoints;
std::vector< tVecLong > vTriangles;
vPoints.resize( oMesh.GetNVertices() );
vTriangles.resize( oMesh.GetNTriangles() );
oMesh.GetIFS( &vPoints[0], &vTriangles[0] );
for( size_t i = 0; i < vPoints.size(); ++i )
{
aVerticesOut.push_back( static_cast<float>( vPoints[i].X() ) );
aVerticesOut.push_back( static_cast<float>( vPoints[i].Y() ) );
aVerticesOut.push_back( static_cast<float>( vPoints[i].Z() ) );
}
for( size_t i = 0; i < vTriangles.size(); ++i )
{
aTrianglesOut.push_back( vTriangles[i].X() );
aTrianglesOut.push_back( vTriangles[i].Y() );
aTrianglesOut.push_back( vTriangles[i].Z() );
}
return LLCD_OK;
}

View File

@@ -0,0 +1,33 @@
/**
* copyright 2011 sl.nicky.ml@googlemail.com
*
* 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
*/
#ifndef ND_HACD_UTILS_H
#define ND_HACD_UTILS_H
#include "nd_hacdStructs.h"
tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData );
DecompData decompose( tHACD *aHACD );
tVecLong fromI16( void *& pPtr, int aStride );
tVecLong fromI32( void *& pPtr, int aStride );
LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based, HACDDecoder *aDec );
LLCDResult convertHullToMesh( const LLCDHull* aHull, std::vector< float > &aVerticesOut, std::vector< int > &aTrianglesOut );
#endif

View File

@@ -0,0 +1,59 @@
/**
* @file windowsincludes.h
* @brief includes that need to be involved in the windows version of llconvexdecompositionstub
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// TODO: reference additional headers your program requires here

View File

@@ -14,8 +14,8 @@ set(OPENJPEG_VERSION
set(openjpeg_SOURCE_FILES
bio.c
cio.c
cidx_manager.c
cio.c
dwt.c
event.c
image.c
@@ -26,8 +26,8 @@ set(openjpeg_SOURCE_FILES
mct.c
mqc.c
openjpeg.c
pi.c
phix_manager.c
pi.c
ppix_manager.c
raw.c
t1.c
@@ -40,8 +40,8 @@ set(openjpeg_SOURCE_FILES
set(openjpeg_HEADER_FILES
bio.h
cio.h
cidx_manager.h
cio.h
dwt.h
event.h
fix.h

View File

@@ -703,15 +703,15 @@ static void j2k_read_cox(opj_j2k_t *j2k, int compno) {
/* If user wants to remove more resolutions than the codestream contains, return error*/
if (cp->reduce >= tccp->numresolutions) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
j2k->state |= J2K_STATE_ERR;
}
if( tccp->numresolutions > J2K_MAXRLVLS ) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions is too big: %d vs max= %d. Truncating.\n\n",
compno, tccp->numresolutions, J2K_MAXRLVLS);
if( tccp->numresolutions > J2K_MAXRLVLS ) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions is too big: %d vs max= %d. Truncating.\n\n",
compno, tccp->numresolutions, J2K_MAXRLVLS);
j2k->state |= J2K_STATE_ERR;
tccp->numresolutions = J2K_MAXRLVLS;
}
tccp->numresolutions = J2K_MAXRLVLS;
}
tccp->cblkw = cio_read(cio, 1) + 2; /* SPcox (E) */
tccp->cblkh = cio_read(cio, 1) + 2; /* SPcox (F) */
@@ -1516,25 +1516,7 @@ static void j2k_read_sod(opj_j2k_t *j2k) {
if (len == cio_numbytesleft(cio) + 1) {
truncate = 1; /* Case of a truncate codestream */
}
{/* chop padding bytes: */
unsigned char *s, *e;
s = cio_getbp(cio);
e = s + len;
if(len > 8) s = e - 8;
if(e[-2] == 0x00 && e[-1] == 0x00) /* padding bytes */
{
while(e > s)
{
if(e[-2] == 0xff && e[-1] == 0xd9) break;
--len; --e; truncate = 1;
}
}
}
}
data = j2k->tile_data[curtileno];
data = (unsigned char*) opj_realloc(data, (j2k->tile_len[curtileno] + len) * sizeof(unsigned char));
@@ -1935,15 +1917,9 @@ opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *c
#endif /* USE_JPWL */
if (id >> 8 != 0xff) {
if(cio_numbytesleft(cio) != 0) /* not end of file reached and no EOC */
{
opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
opj_image_destroy(image);
return 0;
}
opj_event_msg(cinfo, EVT_WARNING, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
j2k->state = J2K_STATE_NEOC;
break;
opj_image_destroy(image);
opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
return 0;
}
e = j2k_dec_mstab_lookup(id);
/* Check if the marker is known*/
@@ -2037,15 +2013,9 @@ opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestre
id = cio_read(cio, 2);
if (id >> 8 != 0xff) {
if(cio_numbytesleft(cio) != 0) /* no end of file reached and no EOC */
{
opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
opj_image_destroy(image);
return 0;
}
opj_event_msg(cinfo, EVT_WARNING, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
j2k->state = J2K_STATE_NEOC;
break;
opj_image_destroy(image);
opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
return 0;
}
e = j2k_dec_mstab_lookup(id);
if (!(j2k->state & e->states)) {

View File

@@ -1091,14 +1091,27 @@ static double t1_getwmsedec(
int numcomps,
int mct)
{
double w1, w2, wmsedec;
double w1 = 1, w2, wmsedec;
// Prevent running an MCT on more than 3 components. NB openjpeg v2.0 will support this via
// custom MCT tables that can be passed as encode parameters, 1.3 cannot support this as it
// uses a static table of 3 entries and there for can only cope with 3 components with out an
// array overflow
if(numcomps==3) {
if (qmfbid == 1) {
w1 = (numcomps > 1) ? mct_getnorm(compno) : 1.0;
} else {
w1 = (numcomps > 1) ? mct_getnorm_real(compno) : 1.0;
}
}
if (qmfbid == 1) {
w1 = (mct && numcomps==3) ? mct_getnorm(compno) : 1.0;
w2 = dwt_getnorm(level, orient);
} else { /* if (qmfbid == 0) */
w1 = (mct && numcomps==3) ? mct_getnorm_real(compno) : 1.0;
w2 = dwt_getnorm_real(level, orient);
}
wmsedec = w1 * w2 * stepsize * (1 << bpno);
wmsedec *= wmsedec * nmsedec / 8192.0;

View File

@@ -1418,15 +1418,20 @@ opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno
int numres2decode;
if (tcd->cp->reduce != 0) {
if ( tile->comps[compno].numresolutions < ( tcd->cp->reduce - 1 ) ) {
if ( tile->comps[compno].numresolutions < ( tcd->cp->reduce - 1 ) ) {
opj_event_msg(tcd->cinfo, EVT_ERROR, "Error decoding tile. The number of resolutions to remove [%d+1] is higher than the number "
" of resolutions in the original codestream [%d]\nModify the cp_reduce parameter.\n", tcd->cp->reduce, tile->comps[compno].numresolutions);
" of resolutions in the original codestream [%d]\nModify the cp_reduce parameter.\n", tcd->cp->reduce, tile->comps[compno].numresolutions);
return OPJ_FALSE;
}
else {
tcd->image->comps[compno].resno_decoded =
tile->comps[compno].numresolutions - tcd->cp->reduce - 1;
}
else {
tcd->image->comps[compno].resno_decoded =
tile->comps[compno].numresolutions - tcd->cp->reduce - 1;
}
}
if(!tilec->data) {
opj_event_msg(tcd->cinfo, EVT_ERROR, "Error decoding tile. null data\n");
return OPJ_FALSE;
}
numres2decode = tcd->image->comps[compno].resno_decoded + 1;

View File

@@ -0,0 +1,34 @@
# -*- cmake -*-
project(libpathing)
include(00-Common)
include(LLCommon)
include(LLMath)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
)
if( MSVC )
add_definitions(-D_SECURE_SCL=0 -D_CRT_SECURE_NO_WARNINGS=1)
endif( MSVC )
set(libpathing_SOURCE_FILES
llpathinglib.cpp
llphysicsextensions.cpp
)
set(libpathing_HEADER_FILES
llpathinglib.h
llphysicsextensions.h
)
set_source_files_properties(${libpathing_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
add_library(nd_Pathing STATIC ${libpathing_SOURCE_FILES} ${libpathing_HEADER_FILES} )
add_dependencies(nd_Pathing prepare)

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